mirror of
https://github.com/cline/cline.git
synced 2026-09-01 23:19:18 +08:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a07554f191 | |||
| 474c655240 | |||
| b5157a2376 | |||
| b14db72140 | |||
| 0fb4a6c7e9 | |||
| 855db7d8d8 | |||
| bb375b78ca | |||
| 31af254f0a | |||
| 2745cdd54b | |||
| c94c6fd8f1 | |||
| a87664318e | |||
| ba70718c83 | |||
| cf8dd1c150 | |||
| e714c74ec4 | |||
| a6f8b33895 | |||
| 02abbcf045 | |||
| 8ca2706cca | |||
| e747d211e6 | |||
| 19aa81a1cc | |||
| f5f3654966 | |||
| 344b99988b | |||
| 7d3c39bcdb | |||
| 33c1692f8a | |||
| 3be3ffae4c | |||
| 87c6708fbe | |||
| b296706bc0 | |||
| 7fdc82ae23 | |||
| 246ed87350 | |||
| a28465151f | |||
| f1967bc3a1 | |||
| ccc83d6728 | |||
| c151d719c8 | |||
| cc25833963 | |||
| 2ef3b7cf0f | |||
| 19d7bd5198 | |||
| 121066f938 | |||
| f9b88318ea | |||
| 1d64f64f43 | |||
| 766e2e6a25 | |||
| 8bd7260350 | |||
| a1f4e8b9d4 | |||
| aa3e0860cd | |||
| 67bc9932e5 | |||
| ba98b44504 | |||
| fdeb639f75 | |||
| 76410b42b0 | |||
| e4e347a8a4 | |||
| 59e7c2b7b9 | |||
| 5371377b21 | |||
| 5a444dc30a | |||
| 34c48264c0 | |||
| daf14ef181 | |||
| f1bf9b3f90 | |||
| 6e20047c3e | |||
| 1d4fe88bec | |||
| 74dbbb9d6b | |||
| 3073cf40be | |||
| 50056768d6 | |||
| e7cd32b830 | |||
| d983b451e1 | |||
| bb32aac8e7 | |||
| e6d5f55fb2 | |||
| 93f60ebe5b |
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Removes reasoning_details content field from Anthropic providers
|
||||
@@ -20,6 +20,9 @@ eslint-rules/**
|
||||
.husky/**
|
||||
.env
|
||||
|
||||
# cli
|
||||
cli/**
|
||||
|
||||
# Custom
|
||||
**/demo.gif
|
||||
.nvmrc
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
# Changelog
|
||||
|
||||
## 3.37.1
|
||||
|
||||
- cf8dd1c: Comprehensive changes to better support GPT 5.1 - System prompt, tools, deep-planning, focus chain, etc.
|
||||
- 02abbcf: Add AGENTS.md support
|
||||
- 855db7d: feat(models): Add free minimax/mimax-m2 model to the model picker
|
||||
|
||||
## [3.37.0]
|
||||
|
||||
## Added
|
||||
|
||||
- GPT-5.1 with model-specific prompting: tailored system prompts, tool usage, focus chain, and deep-planning optimizations
|
||||
- Nous Research provider with Hermes 4 model family and custom system prompts
|
||||
- Switched to Aqua Voice's Avalon model in speech to text transcription
|
||||
- Added Linux support for speech to text
|
||||
- Model-family breakouts for deep-planning prompting, laying groundwork for enhanced slash commands
|
||||
- Expanded HTTP proxy support throughout the codebase
|
||||
- Improved focus chain prompting for frontier models (Anthropic, OpenAI, Gemini, xAI)
|
||||
|
||||
## Fixed
|
||||
|
||||
- Duplicate tool results prevention through existence checking
|
||||
- XML entity escaping in model content processor
|
||||
- Commit message generation in command palette
|
||||
- OpenAI Compatible provider temperature parameter type conversion
|
||||
|
||||
## Documentation
|
||||
|
||||
- Added missing proto generation step in CONTRIBUTING.md
|
||||
- New `npm run dev` script for streamlined terminal workflow (fixes #7335)
|
||||
|
||||
## [3.36.1]
|
||||
|
||||
- fix: remove native tool calling support from Gemini and XAI provider due to invalid tool names issues
|
||||
- fix: disable native tool callings for grok code models
|
||||
- Add MCP tool usage to GLM
|
||||
- Removes reasoning_details content field from Anthropic providers
|
||||
|
||||
## [3.36.0]
|
||||
|
||||
- Add: Hooks allow you to inject custom logic into Cline's workflow
|
||||
|
||||
+7
-1
@@ -46,7 +46,11 @@ We also welcome contributions to our [documentation](https://github.com/cline/cl
|
||||
```bash
|
||||
npm run install:all
|
||||
```
|
||||
4. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.)
|
||||
4. Generate Protocol Buffer files (required before first build):
|
||||
```bash
|
||||
npm run protos
|
||||
```
|
||||
5. Launch by pressing `F5` (or `Run`->`Start Debugging`) to open a new VSCode window with the extension loaded. (You may need to install the [esbuild problem matchers extension](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers) if you run into issues building the project.)
|
||||
|
||||
|
||||
|
||||
@@ -85,8 +89,10 @@ We also welcome contributions to our [documentation](https://github.com/cline/cl
|
||||
|
||||
2. **Local Development**
|
||||
- Run `npm run install:all` to install dependencies
|
||||
- Run `npm run protos` to generate Protocol Buffer files (required before first build)
|
||||
- Run `npm run test` to run tests locally
|
||||
- Run → Start Debugging or `>Debug: Select and Start Debugging` and wait for a new VS Code instance to open
|
||||
- **Terminal Workflow**: Use `npm run dev` (generates protos + runs watch mode) or `npm run watch` (if protos already generated)
|
||||
- Before submitting PR, run `npm run format:fix` to format your code
|
||||
|
||||
3. **Linux-specific Setup**
|
||||
|
||||
@@ -75,6 +75,12 @@ func QuickSetupFromFlags(ctx context.Context, provider, apiKey, modelID, baseURL
|
||||
}
|
||||
}
|
||||
|
||||
// Flush pending state changes to disk immediately
|
||||
// This ensures all configuration changes are persisted before the instance terminates
|
||||
if _, err := manager.GetClient().State.FlushPendingState(ctx, &cline.EmptyRequest{}); err != nil {
|
||||
return fmt.Errorf("failed to flush pending state: %w", err)
|
||||
}
|
||||
|
||||
// Success message
|
||||
fmt.Printf("\n✓ Successfully configured %s provider\n", GetProviderDisplayName(providerEnum))
|
||||
fmt.Printf(" Model: %s\n", finalModelID)
|
||||
@@ -170,6 +176,7 @@ func validateQuickSetupProvider(providerID string) (cline.ApiProvider, error) {
|
||||
cline.ApiProvider_XAI: true,
|
||||
cline.ApiProvider_CEREBRAS: true,
|
||||
cline.ApiProvider_OLLAMA: true,
|
||||
cline.ApiProvider_NOUSRESEARCH: true,
|
||||
}
|
||||
|
||||
if !supportedProviders[provider] {
|
||||
|
||||
@@ -26,6 +26,7 @@ func GetBYOProviderList() []BYOProviderOption {
|
||||
{Name: "Google Gemini", Provider: cline.ApiProvider_GEMINI},
|
||||
{Name: "Ollama", Provider: cline.ApiProvider_OLLAMA},
|
||||
{Name: "Cerebras", Provider: cline.ApiProvider_CEREBRAS},
|
||||
{Name: "NousResearch", Provider: cline.ApiProvider_NOUSRESEARCH},
|
||||
{Name: "Oracle Code Assist", Provider: cline.ApiProvider_OCA},
|
||||
}
|
||||
}
|
||||
@@ -100,6 +101,8 @@ func GetBYOProviderPlaceholder(provider cline.ApiProvider) string {
|
||||
return "e.g., qwen3-coder:30b"
|
||||
case cline.ApiProvider_CEREBRAS:
|
||||
return "e.g., gpt-oss-120b"
|
||||
case cline.ApiProvider_NOUSRESEARCH:
|
||||
return "e.g., Hermes-4-405B"
|
||||
case cline.ApiProvider_OCA:
|
||||
return "e.g., oca/llama4"
|
||||
default:
|
||||
|
||||
@@ -111,6 +111,7 @@ func (r *ProviderListResult) GetAllReadyProviders() []*ProviderDisplay {
|
||||
cline.ApiProvider_GEMINI,
|
||||
cline.ApiProvider_OLLAMA,
|
||||
cline.ApiProvider_CEREBRAS,
|
||||
cline.ApiProvider_NOUSRESEARCH,
|
||||
cline.ApiProvider_OCA,
|
||||
cline.ApiProvider_HICAP,
|
||||
}
|
||||
@@ -241,6 +242,8 @@ func mapProviderStringToEnum(providerStr string) (cline.ApiProvider, bool) {
|
||||
return cline.ApiProvider_OCA, true
|
||||
case "hicap":
|
||||
return cline.ApiProvider_HICAP, true
|
||||
case "nousResearch":
|
||||
return cline.ApiProvider_NOUSRESEARCH, true
|
||||
default:
|
||||
return cline.ApiProvider_ANTHROPIC, false // Return 0 value with false
|
||||
}
|
||||
@@ -274,6 +277,8 @@ func GetProviderIDForEnum(provider cline.ApiProvider) string {
|
||||
return "oca"
|
||||
case cline.ApiProvider_HICAP:
|
||||
return "hicap"
|
||||
case cline.ApiProvider_NOUSRESEARCH:
|
||||
return "nousResearch"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
@@ -353,6 +358,8 @@ func GetProviderDisplayName(provider cline.ApiProvider) string {
|
||||
return "Oracle Code Assist"
|
||||
case cline.ApiProvider_HICAP:
|
||||
return "Hicap"
|
||||
case cline.ApiProvider_NOUSRESEARCH:
|
||||
return "NousResearch"
|
||||
default:
|
||||
return "Unknown"
|
||||
}
|
||||
@@ -475,6 +482,7 @@ func DetectAllConfiguredProviders(ctx context.Context, manager *task.Manager) ([
|
||||
{cline.ApiProvider_OLLAMA, "ollamaBaseUrl"}, // Ollama uses baseUrl instead of API key
|
||||
{cline.ApiProvider_CEREBRAS, "cerebrasApiKey"},
|
||||
{cline.ApiProvider_HICAP, "hicapApiKey"},
|
||||
{cline.ApiProvider_NOUSRESEARCH, "nousResearchApiKey"},
|
||||
}
|
||||
|
||||
for _, providerCheck := range providersToCheck {
|
||||
|
||||
@@ -163,6 +163,15 @@ func GetProviderFields(provider cline.ApiProvider) (ProviderFields, error) {
|
||||
ActModeProviderSpecificModelIDField: "actModeHicapModelId",
|
||||
}, nil
|
||||
|
||||
case cline.ApiProvider_NOUSRESEARCH:
|
||||
return ProviderFields{
|
||||
APIKeyField: "nousResearchApiKey",
|
||||
PlanModeModelIDField: "planModeApiModelId",
|
||||
ActModeModelIDField: "actModeApiModelId",
|
||||
PlanModeProviderSpecificModelIDField: "planModeNousResearchModelId",
|
||||
ActModeProviderSpecificModelIDField: "actModeNousResearchModelId",
|
||||
}, nil
|
||||
|
||||
default:
|
||||
return ProviderFields{}, fmt.Errorf("unsupported provider: %v", provider)
|
||||
}
|
||||
@@ -278,6 +287,8 @@ func setAPIKeyField(apiConfig *cline.ModelsApiConfiguration, fieldName string, v
|
||||
apiConfig.OcaApiKey = value
|
||||
case "hicapApiKey":
|
||||
apiConfig.HicapApiKey = value
|
||||
case "nousResearchApiKey":
|
||||
apiConfig.NousResearchApiKey = value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,6 +313,9 @@ func setProviderSpecificModelID(apiConfig *cline.ModelsApiConfiguration, fieldNa
|
||||
case "planModeHicapModelId":
|
||||
apiConfig.PlanModeHicapModelId = value
|
||||
apiConfig.ActModeHicapModelId = value
|
||||
case "planModeNousResearchModelId":
|
||||
apiConfig.PlanModeNousResearchModelId = value
|
||||
apiConfig.ActModeNousResearchModelId = value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ const (
|
||||
XAI = "xai"
|
||||
CEREBRAS = "cerebras"
|
||||
OCA = "oca"
|
||||
NOUSRESEARCH = "nousResearch"
|
||||
)
|
||||
|
||||
// AllProviders returns a slice of enabled provider IDs for the CLI build.
|
||||
@@ -161,6 +162,7 @@ var AllProviders = []string{
|
||||
"xai",
|
||||
"cerebras",
|
||||
"oca",
|
||||
"nousResearch",
|
||||
}
|
||||
|
||||
// ConfigField represents a configuration field requirement
|
||||
@@ -318,6 +320,15 @@ var rawConfigFields = ` [
|
||||
"fieldType": "password",
|
||||
"placeholder": "Enter your API key"
|
||||
},
|
||||
{
|
||||
"name": "nousResearchApiKey",
|
||||
"type": "string",
|
||||
"comment": "",
|
||||
"category": "nousResearch",
|
||||
"required": true,
|
||||
"fieldType": "password",
|
||||
"placeholder": "Enter your API key"
|
||||
},
|
||||
{
|
||||
"name": "ulid",
|
||||
"type": "string",
|
||||
@@ -435,6 +446,15 @@ var rawConfigFields = ` [
|
||||
"fieldType": "url",
|
||||
"placeholder": "https://api.example.com"
|
||||
},
|
||||
{
|
||||
"name": "minimaxApiLine",
|
||||
"type": "string",
|
||||
"comment": "",
|
||||
"category": "general",
|
||||
"required": false,
|
||||
"fieldType": "string",
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"name": "ocaMode",
|
||||
"type": "string",
|
||||
@@ -775,6 +795,24 @@ var rawModelDefinitions = ` {
|
||||
"supportsImages": false,
|
||||
"supportsPromptCache": false,
|
||||
"description": "A compact 20B open-weight Mixture-of-Experts language model designed for strong reasoning and tool use, ideal for edge devices and local inference."
|
||||
},
|
||||
"qwen.qwen3-coder-30b-a3b-v1:0": {
|
||||
"maxTokens": 8192,
|
||||
"contextWindow": 262144,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"supportsImages": false,
|
||||
"supportsPromptCache": false,
|
||||
"description": "Qwen3 Coder 30B MoE model with 3.3B activated parameters, optimized for code generation and analysis with 256K context window."
|
||||
},
|
||||
"qwen.qwen3-coder-480b-a35b-v1:0": {
|
||||
"maxTokens": 8192,
|
||||
"contextWindow": 262144,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 1,
|
||||
"supportsImages": false,
|
||||
"supportsPromptCache": false,
|
||||
"description": "Qwen3 Coder 480B flagship MoE model with 35B activated parameters, designed for complex coding tasks with advanced reasoning capabilities and 256K context window."
|
||||
}
|
||||
},
|
||||
"gemini": {
|
||||
@@ -1263,6 +1301,26 @@ var rawModelDefinitions = ` {
|
||||
"supportsPromptCache": false,
|
||||
"description": "SOTA performance with ~1500 tokens/s"
|
||||
}
|
||||
},
|
||||
"nousResearch": {
|
||||
"Hermes-4-405B": {
|
||||
"maxTokens": 8192,
|
||||
"contextWindow": 128000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"supportsImages": false,
|
||||
"supportsPromptCache": false,
|
||||
"description": "This is the largest model in the Hermes 4 family, and it is the fullest expression of our design, focused on advanced reasoning and creative depth rather than optimizing inference speed or cost."
|
||||
},
|
||||
"Hermes-4-70B": {
|
||||
"maxTokens": 8192,
|
||||
"contextWindow": 128000,
|
||||
"inputPrice": 0,
|
||||
"outputPrice": 0,
|
||||
"supportsImages": false,
|
||||
"supportsPromptCache": false,
|
||||
"description": "This incarnation of Hermes 4 balances scale and size. It handles complex reasoning tasks, while staying fast and cost effective. A versatile choice for many use cases."
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
@@ -1432,6 +1490,18 @@ func GetProviderDefinitions() (map[string]ProviderDefinition, error) {
|
||||
HasDynamicModels: false,
|
||||
SetupInstructions: `Configure Oca API credentials`,
|
||||
}
|
||||
|
||||
// NousResearch
|
||||
definitions["nousResearch"] = ProviderDefinition{
|
||||
ID: "nousResearch",
|
||||
Name: "NousResearch",
|
||||
RequiredFields: getFieldsByProvider("nousResearch", configFields, true),
|
||||
OptionalFields: getFieldsByProvider("nousResearch", configFields, false),
|
||||
Models: modelDefinitions["nousResearch"],
|
||||
DefaultModelID: "Hermes-4-405B",
|
||||
HasDynamicModels: false,
|
||||
SetupInstructions: `Configure NousResearch API credentials`,
|
||||
}
|
||||
|
||||
return definitions, nil
|
||||
}
|
||||
@@ -1459,6 +1529,7 @@ func GetProviderDisplayName(providerID string) string {
|
||||
"xai": "X AI (Grok)",
|
||||
"cerebras": "Cerebras",
|
||||
"oca": "Oca",
|
||||
"nousResearch": "NousResearch",
|
||||
}
|
||||
|
||||
if name, exists := displayNames[providerID]; exists {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Git
|
||||
.git
|
||||
.gitignore
|
||||
.gitattributes
|
||||
|
||||
# Node modules
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
# Build artifacts
|
||||
dist
|
||||
dist-standalone
|
||||
build
|
||||
*.log
|
||||
|
||||
# Generated code
|
||||
src/generated
|
||||
|
||||
# CLI build artifacts
|
||||
cli/bin
|
||||
cli/dist
|
||||
|
||||
# Webview build artifacts
|
||||
webview-ui/dist
|
||||
webview-ui/build
|
||||
|
||||
# IDE
|
||||
.vscode
|
||||
.idea
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Documentation
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
# Tests
|
||||
tests
|
||||
*.test.js
|
||||
*.spec.js
|
||||
|
||||
# CI/CD
|
||||
.github
|
||||
.gitlab-ci.yml
|
||||
@@ -0,0 +1,49 @@
|
||||
FROM node:22-slim
|
||||
|
||||
# TARGETARCH enables multi-architecture support without emulation warnings:
|
||||
# - Docker automatically sets TARGETARCH to the build platform's architecture
|
||||
# - On arm64 machines (Apple Silicon): TARGETARCH=arm64, uses linux-arm64 binaries
|
||||
# - On amd64 machines (Intel/AMD): TARGETARCH=amd64, uses linux-x64 binaries
|
||||
# The corresponding platform-specific binaries and native modules (better-sqlite3)
|
||||
# are pre-built by scripts/package-standalone.mjs during the build process.
|
||||
ARG TARGETARCH
|
||||
|
||||
# Install only runtime dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git curl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/cline
|
||||
|
||||
# Copy the entire pre-built distribution
|
||||
COPY dist-standalone/ ./
|
||||
|
||||
# Create symlink for Linux native modules
|
||||
# Map Docker's TARGETARCH (arm64/amd64) to Node's platform naming (x64 for amd64)
|
||||
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||
ln -sf /opt/cline/binaries/linux-x64/node_modules/better-sqlite3 /opt/cline/node_modules/better-sqlite3; \
|
||||
else \
|
||||
ln -sf /opt/cline/binaries/linux-$TARGETARCH/node_modules/better-sqlite3 /opt/cline/node_modules/better-sqlite3; \
|
||||
fi
|
||||
|
||||
# Set up CLI binaries
|
||||
# The Linux binaries are already in /opt/cline/bin/ from dist-standalone
|
||||
# Just need to create symlinks to the platform-specific ones
|
||||
RUN cd /opt/cline/bin && \
|
||||
ln -sf cline-linux-$TARGETARCH cline && \
|
||||
ln -sf cline-host-linux-$TARGETARCH cline-host && \
|
||||
chmod +x cline-linux-$TARGETARCH cline-host-linux-$TARGETARCH cline cline-host
|
||||
|
||||
# Add binaries to PATH
|
||||
ENV PATH="/opt/cline/bin:${PATH}"
|
||||
ENV NODE_ENV=production
|
||||
ENV CLINE_HOME=/root/.cline
|
||||
|
||||
RUN mkdir -p $CLINE_HOME
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/opt/cline/bin/cline"]
|
||||
CMD ["--help"]
|
||||
@@ -81,6 +81,20 @@ your-project/
|
||||
|
||||
Cline's system prompt, on the other hand, is not user-editable ([here's where you can find it](https://github.com/cline/cline/blob/main/src/core/prompts/system.ts)). For a broader look at prompt engineering best practices, check out [this resource](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview).
|
||||
|
||||
### AGENTS.md Standard Support
|
||||
|
||||
Cline also supports the [AGENTS.md](https://agents.md/) standard as a fallback
|
||||
(in addition to Cline Rules) by automatically detecting `AGENTS.md` files in
|
||||
your workspace root. This allows you to use the same rules file across different AI
|
||||
coding tools.
|
||||
|
||||
```
|
||||
your-project/
|
||||
├── AGENTS.md
|
||||
├── src/
|
||||
└── ...
|
||||
```
|
||||
|
||||
### Tips for Writing Effective Cline Rules
|
||||
|
||||
- Be Clear and Concise: Use simple language and avoid ambiguity.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: "Dictation"
|
||||
description: "Communicate with Cline using your voice for faster, more natural AI collaboration"
|
||||
---
|
||||
|
||||
Dictation transforms how you work with AI. Instead of typing out complex thoughts, you speak naturally and share your complete intent. This isn't just about speed - though voice is faster - it's about unlocking the kind of fluid collaboration that typing can't match.
|
||||
Dictation transforms how you work with AI. Instead of typing out complex thoughts, you speak naturally and share your complete intent. This isn't just about speed - though voice is faster - it's about enabling fluid collaboration that typing can't match.
|
||||
|
||||
## Why Voice Changes Everything
|
||||
|
||||
@@ -35,11 +35,14 @@ Dictation works with any AI model you've configured. The transcription happens t
|
||||
|
||||
## System Requirements
|
||||
|
||||
<Note>
|
||||
Dictation is currently not available on Windows. Support for Windows is planned for a future release.
|
||||
</Note>
|
||||
|
||||
Dictation uses FFmpeg to capture your voice across all platforms:
|
||||
|
||||
- **macOS**: FFmpeg (via Homebrew: `brew install ffmpeg`)
|
||||
- **Linux**: FFmpeg (via apt: `sudo apt-get install ffmpeg`)
|
||||
- **Windows**: FFmpeg (via winget: `winget install Gyan.FFmpeg`)
|
||||
|
||||
If you don't have FFmpeg installed, Cline will automatically detect this and prompt you to install it with a single click.
|
||||
|
||||
|
||||
+51
-23
@@ -76,7 +76,7 @@ echo "$input" | jq -r '.timestamp | type'
|
||||
|
||||
This example script demonstrates the key mechanics of hook input/output: reading the JSON payload from stdin with `input=$(cat)`, and using `jq` to inspect the data structure and field types that your hook receives. This helps you understand what data is available before building more complex hook logic.
|
||||
|
||||
#### Make it executable
|
||||
**Make it executable**
|
||||
|
||||
```bash
|
||||
chmod +x .clinerules/hooks/TaskStart
|
||||
@@ -92,6 +92,32 @@ Start a task in Cline and verify your hook executes.
|
||||
Start with a simple hook that just logs information before building complex validation logic. This helps you understand the data structure and timing.
|
||||
</Tip>
|
||||
|
||||
|
||||
## What You Can Build
|
||||
|
||||
Once you understand the basics, hooks open up creative possibilities:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Intelligent Code Review" icon="code-branch">
|
||||
Run linters or custom validators before files get saved. Block commits that don't pass checks. Track code quality metrics over time.
|
||||
</Card>
|
||||
|
||||
<Card title="Security Enforcement" icon="shield-halved">
|
||||
Prevent operations that violate security policies. Detect when sensitive data might be exposed. Audit all file access for compliance.
|
||||
</Card>
|
||||
|
||||
<Card title="Development Analytics" icon="chart-line">
|
||||
Measure how long different operations take. Identify patterns in how the AI works. Generate productivity reports from hook data.
|
||||
</Card>
|
||||
|
||||
<Card title="Integration Hub" icon="plug">
|
||||
Connect to issue trackers when certain keywords appear. Update project management tools. Sync with external APIs at the right moments.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
The key is combining hooks with external tools. A hook can be the glue between Cline's workflow and the rest of your development ecosystem.
|
||||
|
||||
|
||||
## Hook Types
|
||||
|
||||
Cline provides multiple hook types that let you tap into different stages of the AI workflow. They're organized into categories based on their trigger points and use cases.
|
||||
@@ -341,22 +367,6 @@ Context injection affects future decisions, not current ones. When a hook runs:
|
||||
This means PreToolUse hooks are for blocking bad actions, while PostToolUse hooks are for learning from completed ones.
|
||||
|
||||
|
||||
## What You Can Build
|
||||
|
||||
Once you understand the basics, hooks open up creative possibilities:
|
||||
|
||||
- **Intelligent Code Review**:
|
||||
Run linters or custom validators before files get saved. Block commits that don't pass checks. Track code quality metrics over time.
|
||||
|
||||
- **Security Enforcement**:
|
||||
Prevent operations that violate security policies. Detect when sensitive data might be exposed. Audit all file access for compliance.
|
||||
|
||||
- **Development Analytics**: Measure how long different operations take. Identify patterns in how the AI works. Generate productivity reports from hook data.
|
||||
|
||||
- **Integration Hub**: Connect to issue trackers when certain keywords appear. Update project management tools. Sync with external APIs at the right moments.
|
||||
|
||||
The key is combining hooks with external tools. A hook can be the glue between Cline's workflow and the rest of your development ecosystem.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Hook Not Running
|
||||
@@ -371,12 +381,30 @@ The key is combining hooks with external tools. A hook can be the glue between C
|
||||
- Consider moving complex logic to a background process
|
||||
|
||||
### Context Not Affecting Behavior
|
||||
- Remember: context affects FUTURE decisions, not the current tool
|
||||
- The current AI behavior is based on the previous "API Request..." block
|
||||
- Your `contextModification` gets injected into the NEXT "API Request..." block
|
||||
- Use PreToolUse for validation (blocking) if you need immediate effect
|
||||
- Ensure context modifications are clear and actionable
|
||||
- Check that context isn't being truncated (50KB limit)
|
||||
Remember that context modifications affect future AI decisions, not the current operation. The AI's current behavior is based on the previous "API Request..." block, and your `contextModification` gets injected into the next "API Request..." block. This means if you need immediate effect, you should use PreToolUse hooks for validation and return `cancel: true` in your hook's JSON response to block Cline from continuing.
|
||||
|
||||
When adding context, ensure your modifications are clear and actionable so the AI can understand and apply them effectively. Also check that your context isn't being truncated due to the 50KB limit, as this could prevent important information from reaching the AI.
|
||||
|
||||
### Handling Strings with Quotes in JSON Payloads
|
||||
When your hook needs to include strings containing unescaped quote characters (`"`) in JSON output, use jq's `--arg` flag for proper escaping:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# When $output contains unescaped quote characters (")...
|
||||
output='{"foo":"bar"}'
|
||||
|
||||
# Use the --arg flag for automatic string escaping
|
||||
jq -n --arg ctx "$output" '{cancel: false, contextModification: $ctx}'
|
||||
|
||||
# This will result in:
|
||||
# {
|
||||
# "cancel": false,
|
||||
# "contextModification": "{\"foo\":\"bar\"}"
|
||||
# }
|
||||
```
|
||||
|
||||
The `--arg` flag automatically escapes special characters, preventing JSON parsing errors when your context modification includes complex strings or nested JSON structures.
|
||||
|
||||
<Warning>
|
||||
Hooks run with the same permissions as VS Code. They can access all workspace files and environment variables. Review hooks from untrusted sources before enabling them.
|
||||
|
||||
@@ -29,11 +29,33 @@ The "Remote Servers" tab allows you to connect to any MCP server that's accessib
|
||||
2. Fill in the required information:
|
||||
- **Server Name**: Provide a unique, descriptive name for the server
|
||||
- **Server URL**: Enter the complete URL endpoint of the MCP server (e.g., `https://example.com/mcp-sse`)
|
||||
- **Transport Type**: Select the connection protocol (Streamable HTTP is recommended for modern servers)
|
||||
3. Click "Add Server" to initiate the connection
|
||||
4. Cline will attempt to connect to the server and display the connection status
|
||||
|
||||
> **Note**: When connecting to a remote server, ensure you trust the source, as MCP servers can execute code in your environment.
|
||||
|
||||
#### Transport Types
|
||||
|
||||
Cline supports two transport protocols for remote MCP servers:
|
||||
|
||||
- **Streamable HTTP (Recommended)**: The modern MCP transport protocol with better performance, reliability, and full OAuth 2.1 authentication support. Use this for most remote servers.
|
||||
- **SSE (Legacy)**: Server-Sent Events transport. Use this only if the server specifically requires SSE or doesn't support Streamable HTTP.
|
||||
|
||||
#### OAuth Authentication
|
||||
|
||||
Some MCP servers (like Vercel's MCP) require OAuth authentication to access your data securely. When connecting to an OAuth-enabled server:
|
||||
|
||||
1. Add the server as usual with its URL
|
||||
2. If the server requires authentication, you'll see an error message asking to authenticate.
|
||||
3. Click the **"Authenticate"** button that appears
|
||||
4. Your browser will open to the server's authorization page
|
||||
5. Sign in and grant permission
|
||||
6. You'll be redirected back to Cline automatically
|
||||
7. The server will connect and show a green status dot
|
||||
|
||||
Once authenticated, your credentials are securely stored and the server will reconnect automatically when you reload Cline. You won't need to authenticate again unless you delete the server or your credentials expire.
|
||||
|
||||
### Remote Server Discovery
|
||||
|
||||
If you're looking for MCP servers to connect to, several third-party marketplaces provide directories of available servers with various capabilities.
|
||||
@@ -90,9 +112,20 @@ Toggle the switch next to each server to enable or disable it:
|
||||
If a server fails to connect:
|
||||
|
||||
1. An error message will be displayed with details about the failure
|
||||
2. Check that the server URL is correct and the server is running
|
||||
3. Use the "Restart Server" button to attempt reconnection
|
||||
4. If problems persist, you can delete the server and try adding it again
|
||||
2. **For OAuth errors**: Click the "Authenticate" button to complete the authorization flow
|
||||
3. Check that the server URL is correct and the server is running
|
||||
4. Try selecting a different transport type (Streamable HTTP vs SSE)
|
||||
5. Use the "Restart Server" button to attempt reconnection
|
||||
6. If problems persist, you can delete the server and try adding it again
|
||||
|
||||
#### OAuth-Specific Issues
|
||||
|
||||
If you're having trouble authenticating with an OAuth-enabled server:
|
||||
|
||||
- **"Authentication required" persists**: Make sure you completed the authorization flow in your browser and didn't cancel it
|
||||
- **Browser doesn't open**: Check your system's default browser settings and ensure external URLs can be opened
|
||||
- **Redirect errors**: Verify you're using the latest version of Cline - older versions may not support OAuth
|
||||
- **Reset authentication**: Delete the server and re-add it to start fresh with a new OAuth flow
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
@@ -105,10 +138,11 @@ For advanced users, Cline stores MCP server configurations in a JSON file that c
|
||||
{
|
||||
"mcpServers": {
|
||||
"exampleServer": {
|
||||
"url": "https://example.com/mcp-sse",
|
||||
"url": "https://example.com/mcp-server",
|
||||
"type": "streamableHttp",
|
||||
"disabled": false,
|
||||
"autoApprove": ["tool1", "tool2"],
|
||||
"timeout": 30
|
||||
"timeout": 60
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,9 +151,10 @@ For advanced users, Cline stores MCP server configurations in a JSON file that c
|
||||
Key configuration options:
|
||||
|
||||
- **url**: The endpoint URL (for remote servers)
|
||||
- **type**: Transport protocol - `"streamableHttp"` (recommended) or `"sse"` (legacy)
|
||||
- **disabled**: Whether the server is currently enabled (true/false)
|
||||
- **autoApprove**: List of tool names that don't require confirmation
|
||||
- **timeout**: Maximum time in seconds to wait for server responses
|
||||
- **timeout**: Maximum time in seconds to wait for server responses (default: 60)
|
||||
|
||||
For additional MCP settings, click the "Advanced MCP Settings" link to access VSCode settings.
|
||||
|
||||
@@ -130,3 +165,20 @@ Once connected, Cline can use the tools and resources provided by the MCP server
|
||||
1. A tool approval prompt will appear (unless auto-approved)
|
||||
2. Review the tool details and parameters before approving
|
||||
3. The tool will execute and return results to Cline
|
||||
|
||||
### Example: Connecting to Vercel MCP
|
||||
|
||||
[Vercel MCP](https://vercel.com/docs/mcp/vercel-mcp) is an OAuth-enabled server that provides tools for managing your Vercel projects and deployments:
|
||||
|
||||
1. Click "Remote Servers" tab
|
||||
2. Enter:
|
||||
- **Server Name**: `vercel`
|
||||
- **Server URL**: `https://mcp.vercel.com`
|
||||
- **Transport Type**: Streamable HTTP (pre-selected)
|
||||
3. Click "Add Server"
|
||||
4. You'll see "Authentication required" - click the **"Authenticate"** button
|
||||
5. Sign in to Vercel in your browser and authorize Cline
|
||||
6. Return to Cline - the server will automatically connect
|
||||
7. Vercel's tools (deploy, logs, projects) are now available to Cline!
|
||||
|
||||
Your Vercel authentication persists across sessions, so you won't need to re-authenticate each time you use Cline.
|
||||
|
||||
@@ -18,8 +18,7 @@ Cerebras delivers the world's fastest AI inference through their revolutionary w
|
||||
|
||||
Cline supports the following Cerebras models:
|
||||
|
||||
- `qwen-3-coder-480b-free` (Free tier) - High-performance coding model at no cost
|
||||
- `qwen-3-coder-480b` - Flagship 480B parameter coding model
|
||||
- `zai-glm-4.6` - Intelligent general purpose model with 1,500 tokens/s
|
||||
- `qwen-3-235b-a22b-instruct-2507` - Advanced instruction-following model
|
||||
- `qwen-3-235b-a22b-thinking-2507` - Reasoning model with step-by-step thinking
|
||||
- `llama-3.3-70b` - Meta's Llama 3.3 model optimized for speed
|
||||
|
||||
Generated
+33
-10
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "claude-dev",
|
||||
"version": "3.36.0",
|
||||
"version": "3.37.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "claude-dev",
|
||||
"version": "3.36.0",
|
||||
"version": "3.37.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.37.0",
|
||||
@@ -72,6 +72,7 @@
|
||||
"jschardet": "^3.1.4",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"mammoth": "^1.11.0",
|
||||
"nanoid": "^5.1.6",
|
||||
"nice-grpc": "^2.1.12",
|
||||
"node-machine-id": "^1.1.12",
|
||||
"ollama": "^0.5.13",
|
||||
@@ -13385,9 +13386,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.11",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
|
||||
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.6.tgz",
|
||||
"integrity": "sha512-c7+7RQ+dMB5dPwwCp4ee1/iV/q2P6aK1mTZcfr1BTuVlyW9hJYiMPybJCcnBlQtuSmTIWNeazm/zqNoZSSElBg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -13395,12 +13396,11 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
"nanoid": "bin/nanoid.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
"node": "^18 || >=20"
|
||||
}
|
||||
},
|
||||
"node_modules/napi-build-utils": {
|
||||
@@ -14344,7 +14344,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/openai": {
|
||||
"version": "4.83.0",
|
||||
"version": "4.104.0",
|
||||
"resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz",
|
||||
"integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
@@ -14372,7 +14374,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/openai/node_modules/@types/node": {
|
||||
"version": "18.19.43",
|
||||
"version": "18.19.130",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz",
|
||||
"integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
@@ -15093,6 +15097,25 @@
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss/node_modules/nanoid": {
|
||||
"version": "3.3.11",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
|
||||
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/posthog-node": {
|
||||
"version": "5.8.0",
|
||||
"resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-5.8.0.tgz",
|
||||
|
||||
+14
-4
@@ -2,7 +2,7 @@
|
||||
"name": "claude-dev",
|
||||
"displayName": "Cline",
|
||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
|
||||
"version": "3.36.0",
|
||||
"version": "3.37.1",
|
||||
"icon": "assets/icons/icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.84.0"
|
||||
@@ -149,6 +149,12 @@
|
||||
"category": "Cline",
|
||||
"when": "cline.isDevMode"
|
||||
},
|
||||
{
|
||||
"command": "cline.dev.expireMcpOAuthTokens",
|
||||
"title": "Expire MCP OAuth Tokens (for testing)",
|
||||
"category": "Cline",
|
||||
"when": "cline.isDevMode"
|
||||
},
|
||||
{
|
||||
"command": "cline.addToChat",
|
||||
"title": "Add to Cline",
|
||||
@@ -278,11 +284,11 @@
|
||||
"commandPalette": [
|
||||
{
|
||||
"command": "cline.generateGitCommitMessage",
|
||||
"when": "config.git.enabled && scmProvider == git && !cline.isGeneratingCommit"
|
||||
"when": "config.git.enabled && !cline.isGeneratingCommit"
|
||||
},
|
||||
{
|
||||
"command": "cline.abortGitCommitMessage",
|
||||
"when": "config.git.enabled && scmProvider == git && cline.isGeneratingCommit"
|
||||
"when": "config.git.enabled && cline.isGeneratingCommit"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -300,10 +306,13 @@
|
||||
"compile-cli-all-platforms": "scripts/build-cli-all-platforms.sh",
|
||||
"compile-cli-man-page": "pandoc cli/man/cline.1.md -s -t man -o cli/man/cline.1",
|
||||
"build:npm": "scripts/build-npm-package.sh",
|
||||
"build:docker:dev": "node scripts/build-docker-dev.mjs",
|
||||
"docker:shell": "node scripts/docker-shell.mjs",
|
||||
"test:install": "bash scripts/test-install.sh",
|
||||
"dev:cli:watch": "node scripts/dev-cli-watch.mjs",
|
||||
"postcompile-standalone": "node scripts/package-standalone.mjs",
|
||||
"postcompile-standalone-npm": "node scripts/package-standalone.mjs --target=npm",
|
||||
"dev": "npm run protos && npm run watch",
|
||||
"watch": "npm-run-all -p watch:*",
|
||||
"watch:esbuild": "node esbuild.mjs --watch",
|
||||
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
|
||||
@@ -330,7 +339,7 @@
|
||||
"pretest": "npm run compile && npm run compile-tests && npm run compile-standalone && npm run lint",
|
||||
"test": "npm-run-all test:unit test:integration",
|
||||
"test:integration": "vscode-test",
|
||||
"test:unit": "cross-env TS_NODE_PROJECT=./tsconfig.unit-test.json mocha",
|
||||
"test:unit": "cross-env TS_NODE_PROJECT=./tsconfig.unit-test.json mocha # Use `UPDATE_SNAPSHOTS=true npm run test:unit` to rebuild prompt snapshots",
|
||||
"test:coverage": "vscode-test --coverage",
|
||||
"test:sca-server": "npx tsx watch scripts/test-standalone-core-api-server.ts",
|
||||
"test:tp-orchestrator": "npx tsx scripts/testing-platform-orchestrator.ts",
|
||||
@@ -466,6 +475,7 @@
|
||||
"jschardet": "^3.1.4",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"mammoth": "^1.11.0",
|
||||
"nanoid": "^5.1.6",
|
||||
"nice-grpc": "^2.1.12",
|
||||
"node-machine-id": "^1.1.12",
|
||||
"ollama": "^0.5.13",
|
||||
|
||||
+23
-4
@@ -49,6 +49,9 @@ service FileService {
|
||||
// Toggle a Windsurf rule (enable or disable)
|
||||
rpc toggleWindsurfRule(ToggleWindsurfRuleRequest) returns (ClineRulesToggles);
|
||||
|
||||
// Toggle an Agents rule (enable or disable)
|
||||
rpc toggleAgentsRule(ToggleAgentsRuleRequest) returns (ClineRulesToggles);
|
||||
|
||||
// Refreshes all rule toggles (Cline, External, and Workflows)
|
||||
rpc refreshRules(EmptyRequest) returns (RefreshedRules);
|
||||
|
||||
@@ -74,8 +77,9 @@ message RefreshedRules {
|
||||
ClineRulesToggles local_cline_rules_toggles = 2;
|
||||
ClineRulesToggles local_cursor_rules_toggles = 3;
|
||||
ClineRulesToggles local_windsurf_rules_toggles = 4;
|
||||
ClineRulesToggles local_workflow_toggles = 5;
|
||||
ClineRulesToggles global_workflow_toggles = 6;
|
||||
ClineRulesToggles local_agents_rules_toggles = 5;
|
||||
ClineRulesToggles local_workflow_toggles = 6;
|
||||
ClineRulesToggles global_workflow_toggles = 7;
|
||||
}
|
||||
|
||||
// Request to toggle a Windsurf rule
|
||||
@@ -85,6 +89,13 @@ message ToggleWindsurfRuleRequest {
|
||||
bool enabled = 3; // Whether to enable or disable the rule
|
||||
}
|
||||
|
||||
// Request to toggle an Agents rule
|
||||
message ToggleAgentsRuleRequest {
|
||||
Metadata metadata = 1;
|
||||
string rule_path = 2; // Path to the rule file
|
||||
bool enabled = 3; // Whether to enable or disable the rule
|
||||
}
|
||||
|
||||
// Request to convert a list of URIs to relative paths
|
||||
message RelativePathsRequest {
|
||||
Metadata metadata = 1;
|
||||
@@ -156,10 +167,17 @@ message RuleFile {
|
||||
bool already_exists = 3; // For createRuleFile, indicates if file already existed
|
||||
}
|
||||
|
||||
// Enum for rule scope (local, global, or remote)
|
||||
enum RuleScope {
|
||||
LOCAL = 0;
|
||||
GLOBAL = 1;
|
||||
REMOTE = 2;
|
||||
}
|
||||
|
||||
// Request to toggle a Cline rule
|
||||
message ToggleClineRuleRequest {
|
||||
Metadata metadata = 1;
|
||||
bool is_global = 2; // Whether this is a global rule or workspace rule
|
||||
RuleScope scope = 2; // Scope of the rule (local, global, or remote)
|
||||
string rule_path = 3; // Path to the rule file
|
||||
bool enabled = 4; // Whether to enable or disable the rule
|
||||
}
|
||||
@@ -173,6 +191,7 @@ message ClineRulesToggles {
|
||||
message ToggleClineRules {
|
||||
ClineRulesToggles global_cline_rules_toggles = 1;
|
||||
ClineRulesToggles local_cline_rules_toggles = 2;
|
||||
ClineRulesToggles remote_rules_toggles = 3;
|
||||
}
|
||||
|
||||
// Request to toggle a Cursor rule
|
||||
@@ -187,5 +206,5 @@ message ToggleWorkflowRequest {
|
||||
Metadata metadata = 1;
|
||||
string workflow_path = 2;
|
||||
bool enabled = 3;
|
||||
bool is_global = 4;
|
||||
RuleScope scope = 4; // Scope of the workflow (local, global, or remote)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ service McpService {
|
||||
rpc toggleToolAutoApprove(ToggleToolAutoApproveRequest) returns (McpServers);
|
||||
rpc refreshMcpMarketplace(EmptyRequest) returns (McpMarketplaceCatalog);
|
||||
rpc openMcpSettings(EmptyRequest) returns (Empty);
|
||||
rpc authenticateMcpServer(StringRequest) returns (Empty);
|
||||
|
||||
// Subscribe to MCP marketplace catalog updates
|
||||
rpc subscribeToMcpMarketplaceCatalog(EmptyRequest) returns (stream McpMarketplaceCatalog);
|
||||
@@ -43,6 +44,7 @@ message AddRemoteMcpServerRequest {
|
||||
Metadata metadata = 1;
|
||||
string server_name = 2;
|
||||
string server_url = 3;
|
||||
optional string transport_type = 4;
|
||||
}
|
||||
|
||||
message ToggleToolAutoApproveRequest {
|
||||
@@ -91,6 +93,8 @@ message McpServer {
|
||||
repeated McpResourceTemplate resource_templates = 7;
|
||||
optional bool disabled = 8;
|
||||
optional int32 timeout = 9;
|
||||
optional bool oauth_required = 10;
|
||||
optional string oauth_auth_status = 11;
|
||||
}
|
||||
|
||||
message McpServers {
|
||||
|
||||
@@ -96,6 +96,7 @@ message OpenRouterModelInfo {
|
||||
optional ThinkingConfig thinking_config = 10;
|
||||
optional bool supports_global_endpoint = 11;
|
||||
repeated ModelTier tiers = 12;
|
||||
optional string name = 13;
|
||||
}
|
||||
|
||||
// Shared response message for model information
|
||||
@@ -312,7 +313,7 @@ message ApiConfiguration {
|
||||
// Request for updating API configuration (new - uses separate options and secrets)
|
||||
message UpdateApiConfigurationRequestNew {
|
||||
Metadata metadata = 1;
|
||||
ApiConfiguration api_configuration = 2;
|
||||
ApiConfiguration updates = 2;
|
||||
|
||||
// Required field mask specifying which fields to update.
|
||||
// Field paths use dot notation with camelCase field names:
|
||||
@@ -320,7 +321,7 @@ message UpdateApiConfigurationRequestNew {
|
||||
// - "options.openAiHeaders" (for options fields)
|
||||
// - "secrets.apiKey" (for secrets fields)
|
||||
// - "secrets.openRouterApiKey" (for secrets fields)
|
||||
google.protobuf.FieldMask update_mask = 3;
|
||||
repeated string update_mask = 3;
|
||||
}
|
||||
|
||||
// Request for partially updating API configuration using FieldMask
|
||||
@@ -421,6 +422,7 @@ enum ApiProvider {
|
||||
MINIMAX = 36;
|
||||
HICAP = 37;
|
||||
AIHUBMIX = 38;
|
||||
NOUSRESEARCH = 39;
|
||||
}
|
||||
|
||||
// Model info for OpenAI-compatible models
|
||||
@@ -545,6 +547,7 @@ message ModelsApiConfiguration {
|
||||
optional string aihubmix_api_key = 82;
|
||||
optional string aihubmix_base_url = 83;
|
||||
optional string aihubmix_app_code = 84;
|
||||
optional string nous_research_api_key = 85;
|
||||
|
||||
// Plan mode configurations
|
||||
optional ApiProvider plan_mode_api_provider = 100;
|
||||
@@ -584,6 +587,7 @@ message ModelsApiConfiguration {
|
||||
optional OpenRouterModelInfo plan_mode_hicap_model_info = 134;
|
||||
optional string plan_mode_aihubmix_model_id = 135;
|
||||
optional OpenAiCompatibleModelInfo plan_mode_aihubmix_model_info = 136;
|
||||
optional string plan_mode_nous_research_model_id = 137;
|
||||
|
||||
// Act mode configurations
|
||||
optional ApiProvider act_mode_api_provider = 200;
|
||||
@@ -623,4 +627,5 @@ message ModelsApiConfiguration {
|
||||
optional OpenRouterModelInfo act_mode_hicap_model_info = 234;
|
||||
optional string act_mode_aihubmix_model_id = 235;
|
||||
optional OpenAiCompatibleModelInfo act_mode_aihubmix_model_info = 236;
|
||||
optional string act_mode_nous_research_model_id = 237;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ service StateService {
|
||||
rpc updateSettingsCli(UpdateSettingsRequestCli) returns (Empty);
|
||||
rpc updateTaskSettings(UpdateTaskSettingsRequest) returns (Empty);
|
||||
rpc updateTelemetrySetting(TelemetrySettingRequest) returns (Empty);
|
||||
rpc captureOnboardingProgress(OnboardingProgressRequest) returns (Empty);
|
||||
rpc setWelcomeViewCompleted(BooleanRequest) returns (Empty);
|
||||
rpc updateInfoBannerVersion(Int64Request) returns (Empty);
|
||||
rpc updateModelBannerVersion(Int64Request) returns (Empty);
|
||||
@@ -30,6 +31,7 @@ service StateService {
|
||||
rpc installClineCli(EmptyRequest) returns (Empty);
|
||||
rpc checkCliInstallation(EmptyRequest) returns (Boolean);
|
||||
rpc getProcessInfo(EmptyRequest) returns (ProcessInfo);
|
||||
rpc flushPendingState(EmptyRequest) returns (Empty);
|
||||
}
|
||||
|
||||
message AutoApprovalActions {
|
||||
@@ -88,6 +90,7 @@ message Secrets {
|
||||
optional string oca_api_key = 37;
|
||||
optional string oca_refresh_token = 38;
|
||||
optional string hicap_api_key = 39;
|
||||
optional string mcp_oauth_secrets = 40;
|
||||
}
|
||||
|
||||
message Settings {
|
||||
@@ -359,6 +362,7 @@ message UpdateSettingsRequest {
|
||||
optional int32 subagent_terminal_output_line_limit = 30;
|
||||
optional string cline_env = 31;
|
||||
optional bool native_tool_call_enabled = 32;
|
||||
optional bool show_onboarding_flow = 33;
|
||||
}
|
||||
|
||||
message UpdateTerminalConnectionTimeoutRequest {
|
||||
@@ -379,3 +383,10 @@ message ProcessInfo {
|
||||
optional string version = 2;
|
||||
optional int64 uptime_ms = 3;
|
||||
}
|
||||
|
||||
message OnboardingProgressRequest {
|
||||
int32 step = 1;
|
||||
optional string action = 2;
|
||||
optional bool completed = 3;
|
||||
optional string model_selected = 4;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ message TaskResponse {
|
||||
int32 tokens_out = 8;
|
||||
int32 cache_writes = 9;
|
||||
int32 cache_reads = 10;
|
||||
string model_id = 11;
|
||||
}
|
||||
|
||||
// Request for getting task history with filtering
|
||||
@@ -99,6 +100,7 @@ message TaskItem {
|
||||
int32 tokens_out = 8;
|
||||
int32 cache_writes = 9;
|
||||
int32 cache_reads = 10;
|
||||
string model_id = 11;
|
||||
}
|
||||
|
||||
// Request for ask response operation
|
||||
|
||||
@@ -32,6 +32,7 @@ enum ClineAsk {
|
||||
CONDENSE = 13;
|
||||
REPORT_BUG = 14;
|
||||
SUMMARIZE_TASK = 15;
|
||||
ACT_MODE_RESPOND = 16;
|
||||
}
|
||||
|
||||
// Enum for ClineSay types
|
||||
@@ -184,6 +185,11 @@ message ClineApiReqInfo {
|
||||
ApiReqRetryStatus retry_status = 9;
|
||||
}
|
||||
|
||||
message ClineModelInfo {
|
||||
string provider_id = 1;
|
||||
string model_id = 2;
|
||||
}
|
||||
|
||||
// Main ClineMessage type
|
||||
message ClineMessage {
|
||||
int64 ts = 1;
|
||||
@@ -210,6 +216,7 @@ message ClineMessage {
|
||||
ClineAskQuestion ask_question = 20;
|
||||
ClineAskNewTask ask_new_task = 21;
|
||||
ClineApiReqInfo api_req_info = 22;
|
||||
ClineModelInfo model_info = 23;
|
||||
}
|
||||
|
||||
// UiService provides methods for managing UI interactions
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { execSync } from "child_process"
|
||||
|
||||
/**
|
||||
* Build Docker image for Cline CLI
|
||||
* This script builds a Docker image using pre-built binaries from dist-standalone/
|
||||
*
|
||||
* Prerequisites:
|
||||
* - Run `npm run compile-standalone` first to build all platform binaries
|
||||
* - Run `npm run compile-cli` first to build CLI binaries
|
||||
*/
|
||||
|
||||
function runCommand(command, description) {
|
||||
console.log(`\n${description}...`)
|
||||
try {
|
||||
execSync(command, { stdio: "inherit" })
|
||||
console.log("✓ Success\n")
|
||||
} catch (error) {
|
||||
console.error(`✗ Failed: ${error.message}`)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
function getCommandOutput(command) {
|
||||
try {
|
||||
return execSync(command, { encoding: "utf-8" }).trim()
|
||||
} catch (error) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
function buildPrerequisites() {
|
||||
console.log("Building prerequisites...\n")
|
||||
|
||||
// Build standalone (includes cline-core and platform-specific native modules)
|
||||
runCommand("npm run compile-standalone", "Running npm run compile-standalone")
|
||||
|
||||
// Build CLI binaries for all platforms
|
||||
runCommand("npm run compile-cli-all-platforms", "Running npm run compile-cli-all-platforms")
|
||||
|
||||
console.log("✓ All prerequisites built successfully\n")
|
||||
}
|
||||
|
||||
function main() {
|
||||
console.log("🐳 Building Cline CLI Docker Image\n")
|
||||
|
||||
// Remove existing container to ensure clean state after rebuild
|
||||
const containerId = getCommandOutput(`docker ps -aq --filter "name=^cline-cli-dev$"`)
|
||||
if (containerId) {
|
||||
console.log("🗑️ Removing existing container to ensure fresh start...")
|
||||
try {
|
||||
execSync(`docker rm -f cline-cli-dev`, { stdio: "inherit" })
|
||||
console.log("✓ Container removed\n")
|
||||
} catch (error) {
|
||||
console.log("Note: Container cleanup failed, continuing anyway\n")
|
||||
}
|
||||
}
|
||||
|
||||
buildPrerequisites()
|
||||
|
||||
// Build Docker image for native platform
|
||||
// Docker will automatically use the correct architecture (arm64 on Apple Silicon, amd64 on Intel)
|
||||
runCommand("docker build -f docker/Dockerfile -t cline-cli:dev .", "Building Docker image")
|
||||
|
||||
console.log("✅ Docker image built successfully!")
|
||||
console.log("\n📋 Next steps:\n")
|
||||
console.log("Interactive shell:")
|
||||
console.log(" npm run docker:shell\n")
|
||||
console.log("This will:")
|
||||
console.log(" • Reuse existing 'cline-cli-dev' container if running")
|
||||
console.log(" • Start stopped container if it exists")
|
||||
console.log(" • Create new persistent container if none exists")
|
||||
console.log(" • Mount current directory at /workspace")
|
||||
console.log(" • Provide all CLI commands (cline auth, cline task, etc.)")
|
||||
console.log("\nContainer persists between sessions. To remove:")
|
||||
console.log(" docker rm -f cline-cli-dev\n")
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -95,6 +95,7 @@ const ENABLED_PROVIDERS = [
|
||||
"ollama", // Ollama local models
|
||||
"cerebras", // Cerebras models
|
||||
"oca", // Oracle Code Assist
|
||||
"nousResearch", // NousResearch provider
|
||||
]
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { execSync } from "child_process"
|
||||
import { platform } from "os"
|
||||
|
||||
const CONTAINER_NAME = "cline-cli-dev"
|
||||
|
||||
function runCommand(command) {
|
||||
try {
|
||||
return execSync(command, { encoding: "utf-8" }).trim()
|
||||
} catch (error) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentDirectory() {
|
||||
// Get current working directory in a cross-platform way
|
||||
return process.cwd()
|
||||
}
|
||||
|
||||
function main() {
|
||||
console.log("🐳 Cline CLI Docker Shell\n")
|
||||
|
||||
// Check if container exists (running or stopped)
|
||||
const containerId = runCommand(`docker ps -a --filter "name=^${CONTAINER_NAME}$" --format "{{.ID}}"`)
|
||||
|
||||
if (containerId) {
|
||||
// Check if container is running
|
||||
const isRunning = runCommand(`docker ps --filter "id=${containerId}" --format "{{.ID}}"`)
|
||||
|
||||
if (isRunning) {
|
||||
console.log(`📦 Connecting to running container: ${CONTAINER_NAME}\n`)
|
||||
try {
|
||||
execSync(`docker exec -it ${containerId} /bin/bash`, { stdio: "inherit" })
|
||||
} catch (error) {
|
||||
// User exited shell normally
|
||||
}
|
||||
} else {
|
||||
console.log(`▶️ Starting stopped container: ${CONTAINER_NAME}\n`)
|
||||
try {
|
||||
execSync(`docker start ${containerId}`, { stdio: "inherit" })
|
||||
execSync(`docker exec -it ${containerId} /bin/bash`, { stdio: "inherit" })
|
||||
} catch (error) {
|
||||
// User exited shell normally
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(`🚀 Creating new container: ${CONTAINER_NAME}\n`)
|
||||
const cwd = getCurrentDirectory()
|
||||
|
||||
try {
|
||||
// Use different volume mount syntax for Windows vs Unix
|
||||
const isWindows = platform() === "win32"
|
||||
const volumeMount = isWindows ? `${cwd.replace(/\\/g, "/")}:/workspace` : `${cwd}:/workspace`
|
||||
|
||||
execSync(
|
||||
`docker run -it --name ${CONTAINER_NAME} -v "${volumeMount}" -w /workspace --entrypoint /bin/bash cline-cli:dev`,
|
||||
{ stdio: "inherit" },
|
||||
)
|
||||
} catch (error) {
|
||||
// User exited shell normally
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -24,6 +24,7 @@ const TARGET_PLATFORMS = [
|
||||
{ platform: "darwin", arch: "x64", targetDir: "darwin-x64" },
|
||||
{ platform: "darwin", arch: "arm64", targetDir: "darwin-arm64" },
|
||||
{ platform: "linux", arch: "x64", targetDir: "linux-x64" },
|
||||
{ platform: "linux", arch: "arm64", targetDir: "linux-arm64" },
|
||||
]
|
||||
const SUPPORTED_BINARY_MODULES = ["better-sqlite3"]
|
||||
|
||||
|
||||
+3
-3
@@ -28,8 +28,8 @@ class ClineEndpoint {
|
||||
private environment: Environment = Environment.production
|
||||
|
||||
private constructor() {
|
||||
// Set environment at module load
|
||||
const _env = process?.env?.CLINE_ENVIRONMENT
|
||||
// Set environment at module load. Use override if provided.
|
||||
const _env = process?.env?.CLINE_ENVIRONMENT_OVERRIDE || process?.env?.CLINE_ENVIRONMENT
|
||||
if (_env && Object.values(Environment).includes(_env as Environment)) {
|
||||
this.environment = _env as Environment
|
||||
return
|
||||
@@ -62,7 +62,7 @@ class ClineEndpoint {
|
||||
environment: Environment.staging,
|
||||
appBaseUrl: "https://staging-app.cline.bot",
|
||||
apiBaseUrl: "https://core-api.staging.int.cline.bot",
|
||||
mcpBaseUrl: "https://api.cline.bot/v1/mcp",
|
||||
mcpBaseUrl: "https://core-api.staging.int.cline.bot/v1/mcp",
|
||||
firebase: {
|
||||
apiKey: "AIzaSyASSwkwX1kSO8vddjZkE5N19QU9cVQ0CIk",
|
||||
authDomain: "cline-staging.firebaseapp.com",
|
||||
|
||||
@@ -25,6 +25,7 @@ import { MinimaxHandler } from "./providers/minimax"
|
||||
import { MistralHandler } from "./providers/mistral"
|
||||
import { MoonshotHandler } from "./providers/moonshot"
|
||||
import { NebiusHandler } from "./providers/nebius"
|
||||
import { NousResearchHandler } from "./providers/nousresearch"
|
||||
import { OcaHandler } from "./providers/oca"
|
||||
import { OllamaHandler } from "./providers/ollama"
|
||||
import { OpenAiHandler } from "./providers/openai"
|
||||
@@ -416,6 +417,12 @@ function createHandlerForProvider(
|
||||
hicapApiKey: options.hicapApiKey,
|
||||
hicapModelId: mode === "plan" ? options.planModeHicapModelId : options.actModeHicapModelId,
|
||||
})
|
||||
case "nousResearch":
|
||||
return new NousResearchHandler({
|
||||
onRetryAttempt: options.onRetryAttempt,
|
||||
nousResearchApiKey: options.nousResearchApiKey,
|
||||
apiModelId: mode === "plan" ? options.planModeNousResearchModelId : options.actModeNousResearchModelId,
|
||||
})
|
||||
default:
|
||||
return new AnthropicHandler({
|
||||
onRetryAttempt: options.onRetryAttempt,
|
||||
|
||||
@@ -27,7 +27,7 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
const { baseURL, appCode, ...rest } = options
|
||||
this.options = {
|
||||
baseURL: baseURL ?? "https://aihubmix.com",
|
||||
appCode: appCode ?? "KUWF9311", // 应用代码,享受折扣
|
||||
appCode: appCode ?? "KUWF9311",
|
||||
...rest,
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,6 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
this.geminiClient = new GoogleGenAI({
|
||||
apiKey: this.options.apiKey,
|
||||
httpOptions: {
|
||||
// AIhubmix Gemini 兼容网关,按 Google GenAI 路径规范
|
||||
baseUrl: `${this.options.baseURL}/gemini`,
|
||||
headers: {
|
||||
// @ts-expect-error
|
||||
@@ -97,9 +96,6 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
return this.geminiClient
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模型名称路由到对应的客户端
|
||||
*/
|
||||
private routeModel(modelName: string): "anthropic" | "openai" | "gemini" | "openai-response" {
|
||||
const id = modelName || ""
|
||||
if (id.startsWith("claude")) {
|
||||
@@ -114,9 +110,6 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
return "openai"
|
||||
}
|
||||
|
||||
/**
|
||||
* 修复空工具时的 tool_choice 问题
|
||||
*/
|
||||
private fixToolChoice(requestBody: any): any {
|
||||
if (requestBody.tools?.length === 0 && requestBody.tool_choice) {
|
||||
delete requestBody.tool_choice
|
||||
@@ -203,25 +196,21 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
const client = this.ensureOpenaiClient()
|
||||
const modelId = this.options.modelId || "gpt-4o-mini"
|
||||
|
||||
// 将 Anthropic 风格消息转换为 Responses API 的 input 结构
|
||||
const input = (messages || []).map((m: any) => {
|
||||
const role = m.role || "user"
|
||||
const contentArray = Array.isArray(m.content) ? m.content : [{ type: "text", text: m.content }]
|
||||
const content = contentArray
|
||||
.filter((c: any) => c != null)
|
||||
.map((c: any) => {
|
||||
// 图片
|
||||
if (c.type === "image" || c.type === "input_image" || c.type === "image_url") {
|
||||
return { type: "input_image", image_url: c.image_url || c.url || c.source?.url }
|
||||
}
|
||||
// 文本(用户 -> input_text,助手 -> output_text)
|
||||
const text = c.text ?? (typeof c === "string" ? c : "")
|
||||
return { type: role === "assistant" ? "output_text" : "input_text", text }
|
||||
})
|
||||
return { role, content }
|
||||
})
|
||||
|
||||
// 使用 Responses 流式 API,以事件驱动产出
|
||||
const stream = await (client as any).responses.stream({
|
||||
model: modelId,
|
||||
instructions: systemPrompt,
|
||||
@@ -261,7 +250,6 @@ export class AIhubmixHandler implements ApiHandler {
|
||||
stream: true,
|
||||
}
|
||||
|
||||
// 修复空工具问题
|
||||
const fixedRequestBody = this.fixToolChoice(requestBody)
|
||||
|
||||
const stream = await client.chat.completions.create(fixedRequestBody)
|
||||
|
||||
@@ -144,20 +144,21 @@ export class AnthropicHandler implements ApiHandler {
|
||||
}
|
||||
}
|
||||
|
||||
let thinkingDeltaAccumulator = ""
|
||||
const lastStartedToolCall = { id: "", name: "", arguments: "" }
|
||||
|
||||
for await (const chunk of stream) {
|
||||
switch (chunk?.type) {
|
||||
case "message_start":
|
||||
// tells us cache reads/writes/input/output
|
||||
const usage = chunk.message.usage
|
||||
yield {
|
||||
type: "usage",
|
||||
inputTokens: usage.input_tokens || 0,
|
||||
outputTokens: usage.output_tokens || 0,
|
||||
cacheWriteTokens: usage.cache_creation_input_tokens || undefined,
|
||||
cacheReadTokens: usage.cache_read_input_tokens || undefined,
|
||||
{
|
||||
// tells us cache reads/writes/input/output
|
||||
const usage = chunk.message.usage
|
||||
yield {
|
||||
type: "usage",
|
||||
inputTokens: usage.input_tokens || 0,
|
||||
outputTokens: usage.output_tokens || 0,
|
||||
cacheWriteTokens: usage.cache_creation_input_tokens || undefined,
|
||||
cacheReadTokens: usage.cache_read_input_tokens || undefined,
|
||||
}
|
||||
}
|
||||
break
|
||||
case "message_delta":
|
||||
@@ -178,15 +179,7 @@ export class AnthropicHandler implements ApiHandler {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: chunk.content_block.thinking || "",
|
||||
}
|
||||
const thinking = chunk.content_block.thinking
|
||||
const signature = chunk.content_block.signature
|
||||
if (thinking && signature) {
|
||||
yield {
|
||||
type: "ant_thinking",
|
||||
thinking,
|
||||
signature,
|
||||
}
|
||||
signature: chunk.content_block.signature,
|
||||
}
|
||||
break
|
||||
case "redacted_thinking":
|
||||
@@ -194,10 +187,7 @@ export class AnthropicHandler implements ApiHandler {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: "[Redacted thinking block]",
|
||||
}
|
||||
yield {
|
||||
type: "ant_redacted_thinking",
|
||||
data: chunk.content_block.data,
|
||||
redacted_data: chunk.content_block.data,
|
||||
}
|
||||
break
|
||||
case "tool_use":
|
||||
@@ -226,20 +216,19 @@ export class AnthropicHandler implements ApiHandler {
|
||||
case "content_block_delta":
|
||||
switch (chunk.delta.type) {
|
||||
case "thinking_delta":
|
||||
// 'reasoning' type just displays in the UI, but ant_thinking will be used to send the thinking traces back to the API
|
||||
// 'reasoning' type just displays in the UI, but reasoning with signature will be used to send the thinking traces back to the API
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: chunk.delta.thinking,
|
||||
}
|
||||
thinkingDeltaAccumulator += chunk.delta.thinking
|
||||
break
|
||||
case "signature_delta":
|
||||
// It's used when sending the thinking block back to the API
|
||||
// API expects this in completed form, not as array of deltas
|
||||
if (thinkingDeltaAccumulator && chunk.delta.signature) {
|
||||
if (chunk.delta.signature) {
|
||||
yield {
|
||||
type: "ant_thinking",
|
||||
thinking: thinkingDeltaAccumulator,
|
||||
type: "reasoning",
|
||||
reasoning: "", // reasoning text is already sent via thinking_delta
|
||||
signature: chunk.delta.signature,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,18 @@ export class ClaudeCodeHandler implements ApiHandler {
|
||||
}
|
||||
break
|
||||
case "tool_use":
|
||||
console.error(`tool_use is not supported yet. Received: ${JSON.stringify(content)}`)
|
||||
// Yield tool_use blocks to the streaming pipeline for proper tool execution
|
||||
yield {
|
||||
type: "tool_calls",
|
||||
tool_call: {
|
||||
call_id: content.id,
|
||||
function: {
|
||||
id: content.id,
|
||||
name: content.name,
|
||||
arguments: content.input,
|
||||
},
|
||||
},
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,8 +165,7 @@ export class ClineHandler implements ApiHandler {
|
||||
if ("reasoning" in delta && delta.reasoning && !shouldSkipReasoningForModel(this.options.openRouterModelId)) {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
// @ts-ignore-next-line
|
||||
reasoning: delta.reasoning,
|
||||
reasoning: typeof delta.reasoning === "string" ? delta.reasoning : JSON.stringify(delta.reasoning),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +184,9 @@ export class ClineHandler implements ApiHandler {
|
||||
!shouldSkipReasoningForModel(this.options.openRouterModelId)
|
||||
) {
|
||||
yield {
|
||||
type: "reasoning_details",
|
||||
reasoning_details: delta.reasoning_details,
|
||||
type: "reasoning",
|
||||
reasoning: "",
|
||||
details: delta.reasoning_details,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ export class ClineHandler implements ApiHandler {
|
||||
// @ts-ignore-next-line
|
||||
let totalCost = (chunk.usage.cost || 0) + (chunk.usage.cost_details?.upstream_inference_cost || 0)
|
||||
|
||||
if (this.getModel().id === "x-ai/grok-code-fast-1") {
|
||||
if (this.getModel().id === "x-ai/grok-code-fast-1" || this.getModel().id === "minimax/minimax-m2") {
|
||||
totalCost = 0
|
||||
}
|
||||
|
||||
|
||||
@@ -66,12 +66,11 @@ export class MinimaxHandler implements ApiHandler {
|
||||
tool_choice: nativeToolsOn ? { type: "any" } : undefined,
|
||||
})
|
||||
|
||||
let thinkingDeltaAccumulator = ""
|
||||
const lastStartedToolCall = { id: "", name: "", arguments: "" }
|
||||
|
||||
for await (const chunk of stream) {
|
||||
switch (chunk?.type) {
|
||||
case "message_start":
|
||||
case "message_start": {
|
||||
// tells us cache reads/writes/input/output
|
||||
const usage = chunk.message.usage
|
||||
yield {
|
||||
@@ -82,6 +81,7 @@ export class MinimaxHandler implements ApiHandler {
|
||||
cacheReadTokens: usage.cache_read_input_tokens || undefined,
|
||||
}
|
||||
break
|
||||
}
|
||||
case "message_delta":
|
||||
// tells us stop_reason, stop_sequence, and output tokens along the way and at the end of the message
|
||||
yield {
|
||||
@@ -100,13 +100,11 @@ export class MinimaxHandler implements ApiHandler {
|
||||
type: "reasoning",
|
||||
reasoning: chunk.content_block.thinking || "",
|
||||
}
|
||||
const thinking = chunk.content_block.thinking
|
||||
const signature = chunk.content_block.signature
|
||||
if (thinking && signature) {
|
||||
if (chunk.content_block.thinking && chunk.content_block.signature) {
|
||||
yield {
|
||||
type: "ant_thinking",
|
||||
thinking,
|
||||
signature,
|
||||
type: "reasoning",
|
||||
reasoning: chunk.content_block.thinking,
|
||||
signature: chunk.content_block.signature,
|
||||
}
|
||||
}
|
||||
break
|
||||
@@ -115,10 +113,7 @@ export class MinimaxHandler implements ApiHandler {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: "[Redacted thinking block]",
|
||||
}
|
||||
yield {
|
||||
type: "ant_redacted_thinking",
|
||||
data: chunk.content_block.data,
|
||||
redacted_data: chunk.content_block.data,
|
||||
}
|
||||
break
|
||||
case "tool_use":
|
||||
@@ -147,20 +142,19 @@ export class MinimaxHandler implements ApiHandler {
|
||||
case "content_block_delta":
|
||||
switch (chunk.delta.type) {
|
||||
case "thinking_delta":
|
||||
// 'reasoning' type just displays in the UI, but ant_thinking will be used to send the thinking traces back to the API
|
||||
// 'reasoning' type just displays in the UI, but reasoning with signature will be used to send the thinking traces back to the API
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: chunk.delta.thinking,
|
||||
}
|
||||
thinkingDeltaAccumulator += chunk.delta.thinking
|
||||
break
|
||||
case "signature_delta":
|
||||
// It's used when sending the thinking block back to the API
|
||||
// API expects this in completed form, not as array of deltas
|
||||
if (thinkingDeltaAccumulator && chunk.delta.signature) {
|
||||
if (chunk.delta.signature) {
|
||||
yield {
|
||||
type: "ant_thinking",
|
||||
thinking: thinkingDeltaAccumulator,
|
||||
type: "reasoning",
|
||||
reasoning: "",
|
||||
signature: chunk.delta.signature,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import { ModelInfo, NousResearchModelId, nousResearchDefaultModelId, nousResearchModels } from "@shared/api"
|
||||
import OpenAI from "openai"
|
||||
import { ApiHandler, CommonApiHandlerOptions } from "../index"
|
||||
import { withRetry } from "../retry"
|
||||
import { convertToOpenAiMessages } from "../transform/openai-format"
|
||||
import { ApiStream } from "../transform/stream"
|
||||
|
||||
interface NousResearchHandlerOptions extends CommonApiHandlerOptions {
|
||||
nousResearchApiKey?: string
|
||||
apiModelId?: string
|
||||
}
|
||||
|
||||
export class NousResearchHandler implements ApiHandler {
|
||||
private options: NousResearchHandlerOptions
|
||||
private client: OpenAI | undefined
|
||||
|
||||
constructor(options: NousResearchHandlerOptions) {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
private ensureClient(): OpenAI {
|
||||
if (!this.client) {
|
||||
if (!this.options.nousResearchApiKey) {
|
||||
throw new Error("NousResearch API key is required")
|
||||
}
|
||||
try {
|
||||
this.client = new OpenAI({
|
||||
baseURL: "https://inference-api.nousResearch.com/v1",
|
||||
apiKey: this.options.nousResearchApiKey,
|
||||
})
|
||||
} catch (error: any) {
|
||||
throw new Error(`Error creating NousResearch client: ${error.message}`)
|
||||
}
|
||||
}
|
||||
return this.client
|
||||
}
|
||||
|
||||
@withRetry()
|
||||
async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream {
|
||||
const client = this.ensureClient()
|
||||
const model = this.getModel()
|
||||
|
||||
const openAiMessages: OpenAI.Chat.ChatCompletionMessageParam[] = [
|
||||
{ role: "system", content: systemPrompt },
|
||||
...convertToOpenAiMessages(messages),
|
||||
]
|
||||
|
||||
const stream = await client.chat.completions.create({
|
||||
model: model.id,
|
||||
messages: openAiMessages,
|
||||
temperature: 0,
|
||||
stream: true,
|
||||
stream_options: { include_usage: true },
|
||||
})
|
||||
|
||||
for await (const chunk of stream) {
|
||||
const delta = chunk.choices[0]?.delta
|
||||
if (delta?.content) {
|
||||
yield {
|
||||
type: "text",
|
||||
text: delta.content,
|
||||
}
|
||||
}
|
||||
|
||||
if (delta && "reasoning_content" in delta && delta.reasoning_content) {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
reasoning: (delta.reasoning_content as string | undefined) || "",
|
||||
}
|
||||
}
|
||||
|
||||
if (chunk.usage) {
|
||||
yield {
|
||||
type: "usage",
|
||||
inputTokens: chunk.usage.prompt_tokens || 0,
|
||||
outputTokens: chunk.usage.completion_tokens || 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getModel(): { id: NousResearchModelId; info: ModelInfo } {
|
||||
const modelId = this.options.apiModelId
|
||||
|
||||
if (modelId && modelId in nousResearchModels) {
|
||||
const id = modelId as NousResearchModelId
|
||||
return { id, info: nousResearchModels[id] }
|
||||
}
|
||||
return { id: nousResearchDefaultModelId, info: nousResearchModels[nousResearchDefaultModelId] }
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,9 @@ export class OpenAiNativeHandler implements ApiHandler {
|
||||
case "gpt-5-2025-08-07":
|
||||
case "gpt-5-mini-2025-08-07":
|
||||
case "gpt-5-nano-2025-08-07":
|
||||
case "gpt-5.1-2025-11-13":
|
||||
case "gpt-5.1-chat-latest":
|
||||
case "gpt-5.1": {
|
||||
const stream = await client.chat.completions.create({
|
||||
model: model.id,
|
||||
temperature: 1,
|
||||
@@ -148,6 +151,7 @@ export class OpenAiNativeHandler implements ApiHandler {
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
default: {
|
||||
const stream = await client.chat.completions.create({
|
||||
model: model.id,
|
||||
|
||||
@@ -81,7 +81,13 @@ export class OpenAiHandler implements ApiHandler {
|
||||
{ role: "system", content: systemPrompt },
|
||||
...convertToOpenAiMessages(messages),
|
||||
]
|
||||
let temperature: number | undefined = this.options.openAiModelInfo?.temperature ?? openAiModelInfoSaneDefaults.temperature
|
||||
let temperature: number | undefined
|
||||
if (this.options.openAiModelInfo?.temperature !== undefined) {
|
||||
const tempValue = Number(this.options.openAiModelInfo.temperature)
|
||||
temperature = tempValue === 0 ? undefined : tempValue
|
||||
} else {
|
||||
temperature = openAiModelInfoSaneDefaults.temperature
|
||||
}
|
||||
let reasoningEffort: ChatCompletionReasoningEffort | undefined
|
||||
let maxTokens: number | undefined
|
||||
|
||||
|
||||
@@ -127,8 +127,7 @@ export class OpenRouterHandler implements ApiHandler {
|
||||
if ("reasoning" in delta && delta.reasoning && !shouldSkipReasoningForModel(this.options.openRouterModelId)) {
|
||||
yield {
|
||||
type: "reasoning",
|
||||
// @ts-ignore-next-line
|
||||
reasoning: delta.reasoning,
|
||||
reasoning: typeof delta.reasoning === "string" ? delta.reasoning : JSON.stringify(delta.reasoning),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,8 +141,9 @@ export class OpenRouterHandler implements ApiHandler {
|
||||
!shouldSkipReasoningForModel(this.options.openRouterModelId)
|
||||
) {
|
||||
yield {
|
||||
type: "reasoning_details",
|
||||
reasoning_details: delta.reasoning_details,
|
||||
type: "reasoning",
|
||||
reasoning: "",
|
||||
details: delta.reasoning_details,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import { ModelInfo, requestyDefaultModelId, requestyDefaultModelInfo } from "@shared/api"
|
||||
import { calculateApiCostOpenAI } from "@utils/cost"
|
||||
import OpenAI from "openai"
|
||||
import { toRequestyServiceStringUrl } from "@/shared/clients/requesty"
|
||||
import { fetch } from "@/shared/net"
|
||||
import { toRequestyServiceStringUrl } from "@/shared/providers/requesty"
|
||||
import { ApiHandler, CommonApiHandlerOptions } from "../index"
|
||||
import { withRetry } from "../retry"
|
||||
import { convertToOpenAiMessages } from "../transform/openai-format"
|
||||
|
||||
@@ -95,8 +95,9 @@ export class VercelAIGatewayHandler implements ApiHandler {
|
||||
delta.reasoning_details.length // exists and non-0
|
||||
) {
|
||||
yield {
|
||||
type: "reasoning_details",
|
||||
reasoning_details: delta.reasoning_details,
|
||||
type: "reasoning",
|
||||
reasoning: "",
|
||||
details: delta.reasoning_details,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ export class VertexHandler implements ApiHandler {
|
||||
|
||||
for await (const chunk of stream) {
|
||||
switch (chunk?.type) {
|
||||
case "message_start":
|
||||
case "message_start": {
|
||||
const usage = chunk.message.usage
|
||||
yield {
|
||||
type: "usage",
|
||||
@@ -176,6 +176,7 @@ export class VertexHandler implements ApiHandler {
|
||||
cacheReadTokens: usage.cache_read_input_tokens || undefined,
|
||||
}
|
||||
break
|
||||
}
|
||||
case "message_delta":
|
||||
yield {
|
||||
type: "usage",
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
import { MessageParam } from "@anthropic-ai/sdk/resources/index"
|
||||
import Anthropic from "@anthropic-ai/sdk"
|
||||
import { ClineStorageMessage } from "@/shared/messages/content"
|
||||
|
||||
/**
|
||||
* Sanitize Anthropic messages by removing reasoning details and adding ephemeral cache control
|
||||
* to the last two user messages to prevent them from being stored in Anthropic's cache.
|
||||
*/
|
||||
export function sanitizeAnthropicMessages(
|
||||
messages: Array<MessageParam>,
|
||||
messages: Array<ClineStorageMessage>,
|
||||
lastUserMsgIndex?: number,
|
||||
secondLastMsgUserIndex?: number,
|
||||
): Array<MessageParam> {
|
||||
): Array<Anthropic.Messages.MessageParam> {
|
||||
return messages.map((_message, index) => {
|
||||
const message = removeReasoningDetails(_message)
|
||||
const message = removeUnknownParams(_message)
|
||||
const addCacheControl = lastUserMsgIndex !== undefined && secondLastMsgUserIndex !== undefined
|
||||
|
||||
// Construct message
|
||||
if (addCacheControl && (index === lastUserMsgIndex || index === secondLastMsgUserIndex)) {
|
||||
return {
|
||||
...message,
|
||||
@@ -56,22 +57,20 @@ export function sanitizeAnthropicMessages(
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove reasoning details from a single Anthropic message parameter
|
||||
* Remove reasoning details and other known params that are not Anthropic specific.
|
||||
*/
|
||||
function removeReasoningDetails(param: MessageParam): MessageParam {
|
||||
if (Array.isArray(param.content)) {
|
||||
return {
|
||||
...param,
|
||||
content: param.content.map((item) => {
|
||||
if (item.type === "text") {
|
||||
function removeUnknownParams(param: ClineStorageMessage): Anthropic.Messages.MessageParam {
|
||||
// Construct new content array with known Anthropic content blocks only.
|
||||
return {
|
||||
role: param.role === "user" ? "user" : "assistant",
|
||||
content: Array.isArray(param.content)
|
||||
? param.content.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
// Ensure reasoning_details is removed
|
||||
reasoning_details: undefined,
|
||||
}
|
||||
}
|
||||
return item
|
||||
}),
|
||||
}
|
||||
})
|
||||
: param.content, // String content remains unchanged
|
||||
}
|
||||
return param
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import { Message } from "ollama"
|
||||
import {
|
||||
ClineAssistantToolUseBlock,
|
||||
ClineImageContentBlock,
|
||||
ClineStorageMessage,
|
||||
ClineTextContentBlock,
|
||||
ClineUserToolResultContentBlock,
|
||||
} from "@/shared/messages/content"
|
||||
|
||||
export function convertToOllamaMessages(anthropicMessages: Anthropic.Messages.MessageParam[]): Message[] {
|
||||
export function convertToOllamaMessages(anthropicMessages: Omit<ClineStorageMessage, "modelInfo">[]): Message[] {
|
||||
const ollamaMessages: Message[] = []
|
||||
|
||||
for (const anthropicMessage of anthropicMessages) {
|
||||
@@ -13,8 +19,8 @@ export function convertToOllamaMessages(anthropicMessages: Anthropic.Messages.Me
|
||||
} else {
|
||||
if (anthropicMessage.role === "user") {
|
||||
const { nonToolMessages, toolMessages } = anthropicMessage.content.reduce<{
|
||||
nonToolMessages: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[]
|
||||
toolMessages: Anthropic.ToolResultBlockParam[]
|
||||
nonToolMessages: (ClineTextContentBlock | ClineImageContentBlock)[]
|
||||
toolMessages: ClineUserToolResultContentBlock[]
|
||||
}>(
|
||||
(acc, part) => {
|
||||
if (part.type === "tool_result") {
|
||||
@@ -70,8 +76,8 @@ export function convertToOllamaMessages(anthropicMessages: Anthropic.Messages.Me
|
||||
}
|
||||
} else if (anthropicMessage.role === "assistant") {
|
||||
const { nonToolMessages, toolMessages } = anthropicMessage.content.reduce<{
|
||||
nonToolMessages: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[]
|
||||
toolMessages: Anthropic.ToolUseBlockParam[]
|
||||
nonToolMessages: (ClineTextContentBlock | ClineImageContentBlock)[]
|
||||
toolMessages: ClineAssistantToolUseBlock[]
|
||||
}>(
|
||||
(acc, part) => {
|
||||
if (part.type === "tool_use") {
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import OpenAI from "openai"
|
||||
import {
|
||||
ClineAssistantRedactedThinkingBlock,
|
||||
ClineAssistantThinkingBlock,
|
||||
ClineAssistantToolUseBlock,
|
||||
ClineImageContentBlock,
|
||||
ClineStorageMessage,
|
||||
ClineTextContentBlock,
|
||||
ClineUserToolResultContentBlock,
|
||||
} from "@/shared/messages/content"
|
||||
|
||||
export function convertToOpenAiMessages(
|
||||
anthropicMessages: Anthropic.Messages.MessageParam[],
|
||||
anthropicMessages: Omit<ClineStorageMessage, "modelInfo">[],
|
||||
): OpenAI.Chat.ChatCompletionMessageParam[] {
|
||||
const openAiMessages: OpenAI.Chat.ChatCompletionMessageParam[] = []
|
||||
|
||||
@@ -23,8 +32,8 @@ export function convertToOpenAiMessages(
|
||||
*/
|
||||
if (anthropicMessage.role === "user") {
|
||||
const { nonToolMessages, toolMessages } = anthropicMessage.content.reduce<{
|
||||
nonToolMessages: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[]
|
||||
toolMessages: Anthropic.ToolResultBlockParam[]
|
||||
nonToolMessages: (ClineTextContentBlock | ClineImageContentBlock)[]
|
||||
toolMessages: ClineUserToolResultContentBlock[]
|
||||
}>(
|
||||
(acc, part) => {
|
||||
if (part.type === "tool_result") {
|
||||
@@ -38,7 +47,7 @@ export function convertToOpenAiMessages(
|
||||
)
|
||||
|
||||
// Process tool result messages FIRST since they must follow the tool use messages
|
||||
const toolResultImages: Anthropic.Messages.ImageBlockParam[] = []
|
||||
const toolResultImages: ClineImageContentBlock[] = []
|
||||
toolMessages.forEach((toolMessage) => {
|
||||
// The Anthropic SDK allows tool results to be a string or an array of text and image blocks, enabling rich and structured content. In contrast, the OpenAI SDK only supports tool results as a single string, so we map the Anthropic tool result parts into one concatenated string to maintain compatibility.
|
||||
let content: string
|
||||
@@ -102,8 +111,13 @@ export function convertToOpenAiMessages(
|
||||
}
|
||||
} else if (anthropicMessage.role === "assistant") {
|
||||
const { nonToolMessages, toolMessages } = anthropicMessage.content.reduce<{
|
||||
nonToolMessages: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[]
|
||||
toolMessages: Anthropic.ToolUseBlockParam[]
|
||||
nonToolMessages: (
|
||||
| ClineTextContentBlock
|
||||
| ClineImageContentBlock
|
||||
| ClineAssistantThinkingBlock
|
||||
| ClineAssistantRedactedThinkingBlock
|
||||
)[]
|
||||
toolMessages: ClineAssistantToolUseBlock[]
|
||||
}>(
|
||||
(acc, part) => {
|
||||
if (part.type === "tool_use") {
|
||||
@@ -119,6 +133,7 @@ export function convertToOpenAiMessages(
|
||||
// Process non-tool messages
|
||||
let content: string | undefined
|
||||
const reasoningDetails: any[] = []
|
||||
const thinkingBlock = []
|
||||
if (nonToolMessages.length > 0) {
|
||||
nonToolMessages.forEach((part) => {
|
||||
// @ts-ignore-next-line
|
||||
@@ -134,13 +149,16 @@ export function convertToOpenAiMessages(
|
||||
// @ts-ignore-next-line
|
||||
// delete part.reasoning_details
|
||||
}
|
||||
if (part.type === "thinking" && part.thinking) {
|
||||
thinkingBlock.push(part)
|
||||
}
|
||||
})
|
||||
content = nonToolMessages
|
||||
.map((part) => {
|
||||
if (part.type === "image") {
|
||||
return "" // impossible as the assistant cannot send images
|
||||
if (part.type === "text" && part.text) {
|
||||
return part.text
|
||||
}
|
||||
return part.text
|
||||
return ""
|
||||
})
|
||||
.join("\n")
|
||||
}
|
||||
|
||||
@@ -1,39 +1,11 @@
|
||||
export type ApiStream = AsyncGenerator<ApiStreamChunk>
|
||||
export type ApiStreamChunk =
|
||||
| ApiStreamTextChunk
|
||||
| ApiStreamReasoningChunk
|
||||
| ApiStreamReasoningDetailsChunk
|
||||
| ApiStreamAnthropicThinkingChunk
|
||||
| ApiStreamAnthropicRedactedThinkingChunk
|
||||
| ApiStreamUsageChunk
|
||||
| ApiStreamToolCallsChunk
|
||||
export type ApiStreamChunk = ApiStreamTextChunk | ApiStreamThinkingChunk | ApiStreamUsageChunk | ApiStreamToolCallsChunk
|
||||
|
||||
export interface ApiStreamTextChunk {
|
||||
type: "text"
|
||||
text: string
|
||||
}
|
||||
|
||||
export interface ApiStreamReasoningChunk {
|
||||
type: "reasoning"
|
||||
reasoning: string
|
||||
}
|
||||
|
||||
export interface ApiStreamReasoningDetailsChunk {
|
||||
type: "reasoning_details"
|
||||
reasoning_details: any // openrouter has various properties that we can pass back unmodified in api requests to preserve reasoning traces
|
||||
}
|
||||
|
||||
export interface ApiStreamAnthropicThinkingChunk {
|
||||
type: "ant_thinking"
|
||||
thinking: string
|
||||
signature: string
|
||||
}
|
||||
|
||||
export interface ApiStreamAnthropicRedactedThinkingChunk {
|
||||
type: "ant_redacted_thinking"
|
||||
data: string
|
||||
}
|
||||
|
||||
export interface ApiStreamUsageChunk {
|
||||
type: "usage"
|
||||
inputTokens: number
|
||||
@@ -58,3 +30,11 @@ export interface ApiStreamToolCall {
|
||||
arguments?: any
|
||||
}
|
||||
}
|
||||
|
||||
export interface ApiStreamThinkingChunk {
|
||||
type: "reasoning"
|
||||
reasoning: string
|
||||
details?: unknown // openrouter has various properties that we can pass back unmodified in api requests to preserve reasoning traces
|
||||
signature?: string
|
||||
redacted_data?: string
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export function getOpenAIToolParams(tools?: OpenAITool[]) {
|
||||
? {
|
||||
tools,
|
||||
tool_choice: tools ? ("auto" as ChatCompletionToolChoiceOption) : undefined,
|
||||
parallel_tool_calls: tools ? true : undefined,
|
||||
parallel_tool_calls: tools ? false : undefined, // Set to false to force single tool calls
|
||||
}
|
||||
: {
|
||||
tools: undefined,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import type { ToolUse } from "@core/assistant-message"
|
||||
import { JSONParser } from "@streamparser/json"
|
||||
import { McpHub } from "@/services/mcp/McpHub"
|
||||
import { CLINE_MCP_TOOL_IDENTIFIER } from "@/shared/mcp"
|
||||
import { ClineAssistantToolUseBlock } from "@/shared/messages/content"
|
||||
import { ClineDefaultTool } from "@/shared/tools"
|
||||
|
||||
export interface PendingToolUse {
|
||||
@@ -32,7 +32,7 @@ const ESCAPE_MAP: Record<string, string> = {
|
||||
const ESCAPE_PATTERN = /\\[ntr"\\]/g
|
||||
|
||||
/**
|
||||
* Handles streaming native tool use blocks and converts them to Anthropic.ToolUseBlockParam format
|
||||
* Handles streaming native tool use blocks and converts them to ClineAssistantToolUseBlock format
|
||||
*/
|
||||
export class ToolUseHandler {
|
||||
private pendingToolUses = new Map<string, PendingToolUse>()
|
||||
@@ -60,7 +60,7 @@ export class ToolUseHandler {
|
||||
}
|
||||
}
|
||||
|
||||
getFinalizedToolUse(id: string): Anthropic.ToolUseBlockParam | undefined {
|
||||
getFinalizedToolUse(id: string): ClineAssistantToolUseBlock | undefined {
|
||||
const pending = this.pendingToolUses.get(id)
|
||||
if (!pending?.name) {
|
||||
return undefined
|
||||
@@ -85,8 +85,8 @@ export class ToolUseHandler {
|
||||
}
|
||||
}
|
||||
|
||||
getAllFinalizedToolUses(): Anthropic.ToolUseBlockParam[] {
|
||||
const results: Anthropic.ToolUseBlockParam[] = []
|
||||
getAllFinalizedToolUses(): ClineAssistantToolUseBlock[] {
|
||||
const results: ClineAssistantToolUseBlock[] = []
|
||||
for (const id of this.pendingToolUses.keys()) {
|
||||
const toolUse = this.getFinalizedToolUse(id)
|
||||
if (toolUse) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { ClineDefaultTool } from "@shared/tools"
|
||||
export type AssistantMessageContent = TextContent | ToolUse
|
||||
|
||||
export type AssistantMessageContent = TextStreamContent | ToolUse | ReasoningStreamContent
|
||||
|
||||
export { parseAssistantMessageV2 } from "./parse-assistant-message"
|
||||
|
||||
export interface TextContent {
|
||||
export interface TextStreamContent {
|
||||
type: "text"
|
||||
content: string
|
||||
partial: boolean
|
||||
@@ -54,3 +55,13 @@ export interface ToolUse {
|
||||
// Whether this tool use was initiated by a native tool call
|
||||
isNativeToolCall?: boolean
|
||||
}
|
||||
|
||||
export interface ReasoningStreamContent {
|
||||
type: "reasoning"
|
||||
reasoning: string
|
||||
details?: any // openrouter has various properties that we can pass back unmodified in api requests to preserve reasoning traces
|
||||
signature?: string
|
||||
redacted?: boolean // whether this reasoning block has been redacted
|
||||
data?: string // redacted data
|
||||
partial: boolean
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ClineDefaultTool, toolUseNames } from "@shared/tools"
|
||||
import { AssistantMessageContent, TextContent, ToolParamName, ToolUse, toolParamNames } from "." // Assuming types are defined in index.ts or a similar file
|
||||
import { AssistantMessageContent, TextStreamContent, ToolParamName, ToolUse, toolParamNames } from "." // Assuming types are defined in index.ts or a similar file
|
||||
|
||||
// parseAssistantmessageV1 removed in https://github.com/cline/cline/pull/5425
|
||||
|
||||
@@ -27,7 +27,7 @@ import { AssistantMessageContent, TextContent, ToolParamName, ToolUse, toolParam
|
||||
export function parseAssistantMessageV2(assistantMessage: string): AssistantMessageContent[] {
|
||||
const contentBlocks: AssistantMessageContent[] = []
|
||||
let currentTextContentStart = 0 // Index where the current text block started
|
||||
let currentTextContent: TextContent | undefined
|
||||
let currentTextContent: TextStreamContent | undefined
|
||||
let currentToolUseStart = 0 // Index *after* the opening tag of the current tool use
|
||||
let currentToolUse: ToolUse | undefined
|
||||
let currentParamValueStart = 0 // Index *after* the opening tag of the current param
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { getRuleFilesTotalContent, synchronizeRuleToggles } from "@core/context/instructions/user-instructions/rule-helpers"
|
||||
import { formatResponse } from "@core/prompts/responses"
|
||||
import { ensureRulesDirectoryExists, GlobalFileNames } from "@core/storage/disk"
|
||||
import { StateManager } from "@core/storage/StateManager"
|
||||
import { ClineRulesToggles } from "@shared/cline-rules"
|
||||
import { fileExistsAtPath, isDirectory, readDirectory } from "@utils/fs"
|
||||
import fs from "fs/promises"
|
||||
@@ -8,27 +9,48 @@ import path from "path"
|
||||
import { Controller } from "@/core/controller"
|
||||
|
||||
export const getGlobalClineRules = async (globalClineRulesFilePath: string, toggles: ClineRulesToggles) => {
|
||||
let combinedContent = ""
|
||||
|
||||
// 1. Get file-based rules
|
||||
if (await fileExistsAtPath(globalClineRulesFilePath)) {
|
||||
if (await isDirectory(globalClineRulesFilePath)) {
|
||||
try {
|
||||
const rulesFilePaths = await readDirectory(globalClineRulesFilePath)
|
||||
const rulesFilesTotalContent = await getRuleFilesTotalContent(rulesFilePaths, globalClineRulesFilePath, toggles)
|
||||
if (rulesFilesTotalContent) {
|
||||
const clineRulesFileInstructions = formatResponse.clineRulesGlobalDirectoryInstructions(
|
||||
globalClineRulesFilePath,
|
||||
rulesFilesTotalContent,
|
||||
)
|
||||
return clineRulesFileInstructions
|
||||
combinedContent = rulesFilesTotalContent
|
||||
}
|
||||
} catch {
|
||||
console.error(`Failed to read .clinerules directory at ${globalClineRulesFilePath}`)
|
||||
}
|
||||
} else {
|
||||
console.error(`${globalClineRulesFilePath} is not a directory`)
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Append remote config rules
|
||||
const stateManager = StateManager.get()
|
||||
const remoteConfigSettings = stateManager.getRemoteConfigSettings()
|
||||
const remoteRules = remoteConfigSettings.remoteGlobalRules || []
|
||||
const remoteToggles = stateManager.getGlobalStateKey("remoteRulesToggles") || {}
|
||||
|
||||
for (const rule of remoteRules) {
|
||||
// If alwaysEnabled, always include; otherwise check toggle
|
||||
const isEnabled = rule.alwaysEnabled || remoteToggles[rule.name] !== false
|
||||
|
||||
if (isEnabled) {
|
||||
if (combinedContent) {
|
||||
combinedContent += "\n\n"
|
||||
}
|
||||
combinedContent += `${rule.name}\n${rule.contents}`
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Return formatted instructions
|
||||
if (combinedContent) {
|
||||
return formatResponse.clineRulesGlobalDirectoryInstructions(globalClineRulesFilePath, combinedContent)
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from "@core/context/instructions/user-instructions/rule-helpers"
|
||||
import { formatResponse } from "@core/prompts/responses"
|
||||
import { GlobalFileNames } from "@core/storage/disk"
|
||||
import { listFiles } from "@services/glob/list-files"
|
||||
import { ClineRulesToggles } from "@shared/cline-rules"
|
||||
import { fileExistsAtPath, isDirectory } from "@utils/fs"
|
||||
import fs from "fs/promises"
|
||||
@@ -13,7 +14,7 @@ import path from "path"
|
||||
import { Controller } from "@/core/controller"
|
||||
|
||||
/**
|
||||
* Refreshes the toggles for windsurf and cursor rules
|
||||
* Refreshes the toggles for windsurf, cursor, and agents rules
|
||||
*/
|
||||
export async function refreshExternalRulesToggles(
|
||||
controller: Controller,
|
||||
@@ -21,6 +22,7 @@ export async function refreshExternalRulesToggles(
|
||||
): Promise<{
|
||||
windsurfLocalToggles: ClineRulesToggles
|
||||
cursorLocalToggles: ClineRulesToggles
|
||||
agentsLocalToggles: ClineRulesToggles
|
||||
}> {
|
||||
// local windsurf toggles
|
||||
const localWindsurfRulesToggles = controller.stateManager.getWorkspaceStateKey("localWindsurfRulesToggles")
|
||||
@@ -42,9 +44,16 @@ export async function refreshExternalRulesToggles(
|
||||
const updatedLocalCursorToggles = combineRuleToggles(updatedLocalCursorToggles1, updatedLocalCursorToggles2)
|
||||
controller.stateManager.setWorkspaceState("localCursorRulesToggles", updatedLocalCursorToggles)
|
||||
|
||||
// local agents toggles
|
||||
const localAgentsRulesToggles = controller.stateManager.getWorkspaceStateKey("localAgentsRulesToggles")
|
||||
const localAgentsRulesFilePath = path.resolve(workingDirectory, GlobalFileNames.agentsRulesFile)
|
||||
const updatedLocalAgentsToggles = await synchronizeRuleToggles(localAgentsRulesFilePath, localAgentsRulesToggles)
|
||||
controller.stateManager.setWorkspaceState("localAgentsRulesToggles", updatedLocalAgentsToggles)
|
||||
|
||||
return {
|
||||
windsurfLocalToggles: updatedLocalWindsurfToggles,
|
||||
cursorLocalToggles: updatedLocalCursorToggles,
|
||||
agentsLocalToggles: updatedLocalAgentsToggles,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,3 +126,76 @@ export const getLocalCursorRules = async (cwd: string, toggles: ClineRulesToggle
|
||||
|
||||
return [cursorRulesFileInstructions, cursorRulesDirInstructions]
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to find all agents.md files recursively (case-insensitive)
|
||||
* Only searches if a top-level agents.md file exists
|
||||
*/
|
||||
async function findAgentsMdFiles(cwd: string): Promise<string[]> {
|
||||
try {
|
||||
// First check if top-level agents.md exists
|
||||
const topLevelAgentsPath = path.resolve(cwd, GlobalFileNames.agentsRulesFile)
|
||||
const topLevelExists = await fileExistsAtPath(topLevelAgentsPath)
|
||||
|
||||
// Only search recursively if top-level agents.md exists
|
||||
if (!topLevelExists) {
|
||||
return []
|
||||
}
|
||||
|
||||
// Search recursively for all agents.md files
|
||||
const [allFiles] = await listFiles(cwd, true, 500)
|
||||
return allFiles.filter((filePath) => {
|
||||
const basename = path.basename(filePath).toLowerCase()
|
||||
return basename === GlobalFileNames.agentsRulesFile.toLowerCase()
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(`Failed to find agents.md files in ${cwd}:`, error)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gather formatted agents rules - searches recursively and combines all agents.md files
|
||||
*/
|
||||
export const getLocalAgentsRules = async (cwd: string, toggles: ClineRulesToggles) => {
|
||||
const agentsRulesFilePath = path.resolve(cwd, GlobalFileNames.agentsRulesFile)
|
||||
|
||||
// Check if the top-level agents.md file is enabled
|
||||
if (agentsRulesFilePath in toggles && toggles[agentsRulesFilePath] === false) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
try {
|
||||
const agentsMdFiles = await findAgentsMdFiles(cwd)
|
||||
|
||||
if (agentsMdFiles.length === 0) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
// Read and combine all agents.md files
|
||||
const combinedContent = await Promise.all(
|
||||
agentsMdFiles.map(async (filePath) => {
|
||||
try {
|
||||
const fullPath = path.resolve(cwd, filePath)
|
||||
const content = (await fs.readFile(fullPath, "utf8")).trim()
|
||||
if (content) {
|
||||
const relativePath = path.relative(cwd, fullPath)
|
||||
return `## ${relativePath}\n\n${content}`
|
||||
}
|
||||
return null
|
||||
} catch (error) {
|
||||
console.error(`Failed to read agents.md file at ${filePath}:`, error)
|
||||
return null
|
||||
}
|
||||
}),
|
||||
).then((contents) => contents.filter(Boolean).join("\n\n"))
|
||||
|
||||
if (combinedContent) {
|
||||
return formatResponse.agentsRulesLocalFileInstructions(cwd, combinedContent)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to read agents.md files:", error)
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ensureRulesDirectoryExists, ensureWorkflowsDirectoryExists, GlobalFileNames } from "@core/storage/disk"
|
||||
import { ClineRulesToggles } from "@shared/cline-rules"
|
||||
import { GlobalInstructionsFile } from "@shared/remote-config/schema"
|
||||
import { fileExistsAtPath, isDirectory, readDirectory } from "@utils/fs"
|
||||
import fs from "fs/promises"
|
||||
import * as path from "path"
|
||||
@@ -101,6 +102,36 @@ export async function synchronizeRuleToggles(
|
||||
return updatedToggles
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronizes remote rule toggles with current remote config
|
||||
* Removes toggles for rules that no longer exist, adds defaults for new rules
|
||||
*/
|
||||
export function synchronizeRemoteRuleToggles(
|
||||
remoteRules: GlobalInstructionsFile[],
|
||||
currentToggles: ClineRulesToggles,
|
||||
): ClineRulesToggles {
|
||||
const updatedToggles: ClineRulesToggles = {}
|
||||
|
||||
// Create set of current remote rule names
|
||||
const existingRuleNames = new Set(remoteRules.map((rule) => rule.name))
|
||||
|
||||
// Keep toggles only for rules that still exist
|
||||
for (const [ruleName, enabled] of Object.entries(currentToggles)) {
|
||||
if (existingRuleNames.has(ruleName)) {
|
||||
updatedToggles[ruleName] = enabled
|
||||
}
|
||||
}
|
||||
|
||||
// Add default toggles for new rules (default to enabled)
|
||||
for (const rule of remoteRules) {
|
||||
if (!(rule.name in updatedToggles)) {
|
||||
updatedToggles[rule.name] = true
|
||||
}
|
||||
}
|
||||
|
||||
return updatedToggles
|
||||
}
|
||||
|
||||
/**
|
||||
* Certain project rules have more than a single location where rules are allowed to be stored
|
||||
*/
|
||||
@@ -268,6 +299,10 @@ export async function deleteRuleFile(
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localWindsurfRulesToggles")
|
||||
delete toggles[rulePath]
|
||||
controller.stateManager.setWorkspaceState("localWindsurfRulesToggles", toggles)
|
||||
} else if (type === "agents") {
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localAgentsRulesToggles")
|
||||
delete toggles[rulePath]
|
||||
controller.stateManager.setWorkspaceState("localAgentsRulesToggles", toggles)
|
||||
} else {
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localClineRulesToggles")
|
||||
delete toggles[rulePath]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Empty, StringRequest } from "@shared/proto/cline/common"
|
||||
import { toRequestyServiceUrl } from "@shared/providers/requesty"
|
||||
import { HostProvider } from "@/hosts/host-provider"
|
||||
import { toRequestyServiceUrl } from "@/shared/clients/requesty"
|
||||
import { openExternal } from "@/utils/env"
|
||||
import { Controller } from ".."
|
||||
|
||||
|
||||
@@ -16,7 +16,10 @@ export async function refreshRules(controller: Controller, _request: EmptyReques
|
||||
try {
|
||||
const cwd = await getCwd(getDesktopDir())
|
||||
const { globalToggles, localToggles } = await refreshClineRulesToggles(controller, cwd)
|
||||
const { cursorLocalToggles, windsurfLocalToggles } = await refreshExternalRulesToggles(controller, cwd)
|
||||
const { cursorLocalToggles, windsurfLocalToggles, agentsLocalToggles } = await refreshExternalRulesToggles(
|
||||
controller,
|
||||
cwd,
|
||||
)
|
||||
const { localWorkflowToggles, globalWorkflowToggles } = await refreshWorkflowToggles(controller, cwd)
|
||||
|
||||
return RefreshedRules.create({
|
||||
@@ -24,6 +27,7 @@ export async function refreshRules(controller: Controller, _request: EmptyReques
|
||||
localClineRulesToggles: { toggles: localToggles },
|
||||
localCursorRulesToggles: { toggles: cursorLocalToggles },
|
||||
localWindsurfRulesToggles: { toggles: windsurfLocalToggles },
|
||||
localAgentsRulesToggles: { toggles: agentsLocalToggles },
|
||||
localWorkflowToggles: { toggles: localWorkflowToggles },
|
||||
globalWorkflowToggles: { toggles: globalWorkflowToggles },
|
||||
})
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { ToggleAgentsRuleRequest } from "@shared/proto/cline/file"
|
||||
import { ClineRulesToggles } from "@shared/proto/cline/file"
|
||||
import type { Controller } from "../index"
|
||||
|
||||
/**
|
||||
* Toggles an Agents rule (enable or disable)
|
||||
* @param controller The controller instance
|
||||
* @param request The toggle request
|
||||
* @returns The updated Agents rule toggles
|
||||
*/
|
||||
export async function toggleAgentsRule(controller: Controller, request: ToggleAgentsRuleRequest): Promise<ClineRulesToggles> {
|
||||
const { rulePath, enabled } = request
|
||||
|
||||
if (!rulePath || typeof enabled !== "boolean") {
|
||||
console.error("toggleAgentsRule: Missing or invalid parameters", {
|
||||
rulePath,
|
||||
enabled: typeof enabled === "boolean" ? enabled : `Invalid: ${typeof enabled}`,
|
||||
})
|
||||
throw new Error("Missing or invalid parameters for toggleAgentsRule")
|
||||
}
|
||||
|
||||
// Update the toggle in workspace state
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localAgentsRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setWorkspaceState("localAgentsRulesToggles", toggles)
|
||||
|
||||
// Get the current state to return in the response
|
||||
const agentsToggles = controller.stateManager.getWorkspaceStateKey("localAgentsRulesToggles")
|
||||
|
||||
return ClineRulesToggles.create({
|
||||
toggles: agentsToggles,
|
||||
})
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getWorkspaceBasename } from "@core/workspace"
|
||||
import type { ToggleClineRuleRequest } from "@shared/proto/cline/file"
|
||||
import { ToggleClineRules } from "@shared/proto/cline/file"
|
||||
import { RuleScope, ToggleClineRules } from "@shared/proto/cline/file"
|
||||
import { telemetryService } from "@/services/telemetry"
|
||||
import type { Controller } from "../index"
|
||||
|
||||
@@ -11,41 +11,57 @@ import type { Controller } from "../index"
|
||||
* @returns The updated Cline rule toggles
|
||||
*/
|
||||
export async function toggleClineRule(controller: Controller, request: ToggleClineRuleRequest): Promise<ToggleClineRules> {
|
||||
const { isGlobal, rulePath, enabled } = request
|
||||
const { scope, rulePath, enabled } = request
|
||||
|
||||
if (!rulePath || typeof enabled !== "boolean" || typeof isGlobal !== "boolean") {
|
||||
if (!rulePath || typeof enabled !== "boolean" || scope === undefined) {
|
||||
console.error("toggleClineRule: Missing or invalid parameters", {
|
||||
rulePath,
|
||||
isGlobal: typeof isGlobal === "boolean" ? isGlobal : `Invalid: ${typeof isGlobal}`,
|
||||
scope,
|
||||
enabled: typeof enabled === "boolean" ? enabled : `Invalid: ${typeof enabled}`,
|
||||
})
|
||||
throw new Error("Missing or invalid parameters for toggleClineRule")
|
||||
}
|
||||
|
||||
// This is the same core logic as in the original handler
|
||||
if (isGlobal) {
|
||||
const toggles = controller.stateManager.getGlobalSettingsKey("globalClineRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setGlobalState("globalClineRulesToggles", toggles)
|
||||
} else {
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localClineRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setWorkspaceState("localClineRulesToggles", toggles)
|
||||
// Handle the three different scopes
|
||||
switch (scope) {
|
||||
case RuleScope.GLOBAL: {
|
||||
const toggles = controller.stateManager.getGlobalSettingsKey("globalClineRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setGlobalState("globalClineRulesToggles", toggles)
|
||||
break
|
||||
}
|
||||
case RuleScope.LOCAL: {
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("localClineRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setWorkspaceState("localClineRulesToggles", toggles)
|
||||
break
|
||||
}
|
||||
case RuleScope.REMOTE: {
|
||||
const toggles = controller.stateManager.getGlobalStateKey("remoteRulesToggles")
|
||||
toggles[rulePath] = enabled
|
||||
controller.stateManager.setGlobalState("remoteRulesToggles", toggles)
|
||||
break
|
||||
}
|
||||
default:
|
||||
throw new Error(`Invalid scope: ${scope}`)
|
||||
}
|
||||
|
||||
// Track rule toggle telemetry with current task context
|
||||
if (controller.task?.ulid) {
|
||||
// Extract just the filename for privacy (no full paths)
|
||||
const ruleFileName = getWorkspaceBasename(rulePath, "Controller.toggleClineRule")
|
||||
const isGlobal = scope === RuleScope.GLOBAL
|
||||
telemetryService.captureClineRuleToggled(controller.task.ulid, ruleFileName, enabled, isGlobal)
|
||||
}
|
||||
|
||||
// Get the current state to return in the response
|
||||
const globalToggles = controller.stateManager.getGlobalSettingsKey("globalClineRulesToggles")
|
||||
const localToggles = controller.stateManager.getWorkspaceStateKey("localClineRulesToggles")
|
||||
const remoteToggles = controller.stateManager.getGlobalStateKey("remoteRulesToggles")
|
||||
|
||||
return ToggleClineRules.create({
|
||||
globalClineRulesToggles: { toggles: globalToggles },
|
||||
localClineRulesToggles: { toggles: localToggles },
|
||||
remoteRulesToggles: { toggles: remoteToggles },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ClineRulesToggles, ToggleWorkflowRequest } from "@shared/proto/cline/file"
|
||||
import { ClineRulesToggles, RuleScope, ToggleWorkflowRequest } from "@shared/proto/cline/file"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -8,34 +8,45 @@ import { Controller } from ".."
|
||||
* @returns The updated workflow toggles
|
||||
*/
|
||||
export async function toggleWorkflow(controller: Controller, request: ToggleWorkflowRequest): Promise<ClineRulesToggles> {
|
||||
const { workflowPath, enabled, isGlobal } = request
|
||||
const { workflowPath, enabled, scope } = request
|
||||
|
||||
if (!workflowPath || typeof enabled !== "boolean") {
|
||||
if (!workflowPath || typeof enabled !== "boolean" || scope === undefined) {
|
||||
console.error("toggleWorkflow: Missing or invalid parameters", {
|
||||
workflowPath,
|
||||
scope,
|
||||
enabled: typeof enabled === "boolean" ? enabled : `Invalid: ${typeof enabled}`,
|
||||
})
|
||||
throw new Error("Missing or invalid parameters for toggleWorkflow")
|
||||
}
|
||||
|
||||
// Update the toggles based on isGlobal flag
|
||||
if (isGlobal) {
|
||||
// Global workflows
|
||||
const toggles = controller.stateManager.getGlobalSettingsKey("globalWorkflowToggles")
|
||||
toggles[workflowPath] = enabled
|
||||
controller.stateManager.setGlobalState("globalWorkflowToggles", toggles)
|
||||
await controller.postStateToWebview()
|
||||
// Handle the three different scopes
|
||||
let toggles: Record<string, boolean>
|
||||
|
||||
// Return the global toggles
|
||||
return ClineRulesToggles.create({ toggles: toggles })
|
||||
} else {
|
||||
// Workspace workflows
|
||||
const toggles = controller.stateManager.getWorkspaceStateKey("workflowToggles")
|
||||
toggles[workflowPath] = enabled
|
||||
controller.stateManager.setWorkspaceState("workflowToggles", toggles)
|
||||
await controller.postStateToWebview()
|
||||
|
||||
// Return the workspace toggles
|
||||
return ClineRulesToggles.create({ toggles: toggles })
|
||||
switch (scope) {
|
||||
case RuleScope.GLOBAL: {
|
||||
toggles = controller.stateManager.getGlobalSettingsKey("globalWorkflowToggles")
|
||||
toggles[workflowPath] = enabled
|
||||
controller.stateManager.setGlobalState("globalWorkflowToggles", toggles)
|
||||
break
|
||||
}
|
||||
case RuleScope.LOCAL: {
|
||||
toggles = controller.stateManager.getWorkspaceStateKey("workflowToggles")
|
||||
toggles[workflowPath] = enabled
|
||||
controller.stateManager.setWorkspaceState("workflowToggles", toggles)
|
||||
break
|
||||
}
|
||||
case RuleScope.REMOTE: {
|
||||
toggles = controller.stateManager.getGlobalStateKey("remoteWorkflowToggles")
|
||||
toggles[workflowPath] = enabled
|
||||
controller.stateManager.setGlobalState("remoteWorkflowToggles", toggles)
|
||||
break
|
||||
}
|
||||
default:
|
||||
throw new Error(`Invalid scope: ${scope}`)
|
||||
}
|
||||
|
||||
await controller.postStateToWebview()
|
||||
|
||||
// Return the updated toggles
|
||||
return ClineRulesToggles.create({ toggles: toggles })
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import { LogoutReason } from "@/services/auth/types"
|
||||
import { featureFlagsService } from "@/services/feature-flags"
|
||||
import { getDistinctId } from "@/services/logging/distinctId"
|
||||
import { telemetryService } from "@/services/telemetry"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { ShowMessageType } from "@/shared/proto/host/window"
|
||||
import { AuthState } from "@/shared/proto/index.cline"
|
||||
import { getLatestAnnouncementId } from "@/utils/announcements"
|
||||
@@ -639,6 +640,23 @@ export class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
async handleMcpOAuthCallback(serverHash: string, code: string, state: string | null) {
|
||||
try {
|
||||
await this.mcpHub.completeOAuth(serverHash, code, state)
|
||||
await this.postStateToWebview()
|
||||
HostProvider.window.showMessage({
|
||||
type: ShowMessageType.INFORMATION,
|
||||
message: `Successfully authenticated MCP server`,
|
||||
})
|
||||
} catch (error) {
|
||||
console.error("Failed to complete MCP OAuth:", error)
|
||||
HostProvider.window.showMessage({
|
||||
type: ShowMessageType.ERROR,
|
||||
message: `Failed to authenticate MCP server`,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async handleTaskCreation(prompt: string) {
|
||||
await sendChatButtonClickedEvent()
|
||||
await this.initTask(prompt)
|
||||
@@ -651,6 +669,7 @@ export class Controller {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": "cline-vscode-extension",
|
||||
},
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
|
||||
if (!response.data) {
|
||||
@@ -698,7 +717,7 @@ export class Controller {
|
||||
async handleOpenRouterCallback(code: string) {
|
||||
let apiKey: string
|
||||
try {
|
||||
const response = await axios.post("https://openrouter.ai/api/v1/auth/keys", { code })
|
||||
const response = await axios.post("https://openrouter.ai/api/v1/auth/keys", { code }, getAxiosSettings())
|
||||
if (response.data && response.data.key) {
|
||||
apiKey = response.data.key
|
||||
} else {
|
||||
@@ -848,14 +867,16 @@ export class Controller {
|
||||
const enableCheckpointsSetting = this.stateManager.getGlobalSettingsKey("enableCheckpointsSetting")
|
||||
const globalClineRulesToggles = this.stateManager.getGlobalSettingsKey("globalClineRulesToggles")
|
||||
const globalWorkflowToggles = this.stateManager.getGlobalSettingsKey("globalWorkflowToggles")
|
||||
const remoteRulesToggles = this.stateManager.getGlobalStateKey("remoteRulesToggles")
|
||||
const remoteWorkflowToggles = this.stateManager.getGlobalStateKey("remoteWorkflowToggles")
|
||||
const shellIntegrationTimeout = this.stateManager.getGlobalSettingsKey("shellIntegrationTimeout")
|
||||
const terminalReuseEnabled = this.stateManager.getGlobalStateKey("terminalReuseEnabled")
|
||||
const vscodeTerminalExecutionMode = this.stateManager.getGlobalStateKey("vscodeTerminalExecutionMode")
|
||||
const defaultTerminalProfile = this.stateManager.getGlobalSettingsKey("defaultTerminalProfile")
|
||||
const isNewUser = this.stateManager.getGlobalStateKey("isNewUser")
|
||||
const welcomeViewCompleted = Boolean(
|
||||
this.stateManager.getGlobalStateKey("welcomeViewCompleted") || this.authService.getInfo()?.user?.uid,
|
||||
)
|
||||
// Can be undefined but is set to either true or false by the migration that runs on extension launch in extension.ts
|
||||
const welcomeViewCompleted = !!this.stateManager.getGlobalStateKey("welcomeViewCompleted")
|
||||
|
||||
const customPrompt = this.stateManager.getGlobalSettingsKey("customPrompt")
|
||||
const mcpResponsesCollapsed = this.stateManager.getGlobalStateKey("mcpResponsesCollapsed")
|
||||
const terminalOutputLineLimit = this.stateManager.getGlobalSettingsKey("terminalOutputLineLimit")
|
||||
@@ -870,6 +891,7 @@ export class Controller {
|
||||
const localClineRulesToggles = this.stateManager.getWorkspaceStateKey("localClineRulesToggles")
|
||||
const localWindsurfRulesToggles = this.stateManager.getWorkspaceStateKey("localWindsurfRulesToggles")
|
||||
const localCursorRulesToggles = this.stateManager.getWorkspaceStateKey("localCursorRulesToggles")
|
||||
const localAgentsRulesToggles = this.stateManager.getWorkspaceStateKey("localAgentsRulesToggles")
|
||||
const workflowToggles = this.stateManager.getWorkspaceStateKey("workflowToggles")
|
||||
const autoCondenseThreshold = this.stateManager.getGlobalSettingsKey("autoCondenseThreshold")
|
||||
|
||||
@@ -892,7 +914,7 @@ export class Controller {
|
||||
// Set feature flag in dictation settings based on platform
|
||||
const updatedDictationSettings = {
|
||||
...dictationSettings,
|
||||
featureEnabled: process.platform === "darwin", // Enable dictation only on macOS
|
||||
featureEnabled: process.platform === "darwin" || process.platform === "linux", // Enable dictation on macOS and Linux
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -925,14 +947,18 @@ export class Controller {
|
||||
localClineRulesToggles: localClineRulesToggles || {},
|
||||
localWindsurfRulesToggles: localWindsurfRulesToggles || {},
|
||||
localCursorRulesToggles: localCursorRulesToggles || {},
|
||||
localAgentsRulesToggles: localAgentsRulesToggles || {},
|
||||
localWorkflowToggles: workflowToggles || {},
|
||||
globalWorkflowToggles: globalWorkflowToggles || {},
|
||||
remoteRulesToggles: remoteRulesToggles,
|
||||
remoteWorkflowToggles: remoteWorkflowToggles,
|
||||
shellIntegrationTimeout,
|
||||
terminalReuseEnabled,
|
||||
vscodeTerminalExecutionMode: vscodeTerminalExecutionMode,
|
||||
defaultTerminalProfile,
|
||||
isNewUser,
|
||||
welcomeViewCompleted: welcomeViewCompleted as boolean, // Can be undefined but is set to either true or false by the migration that runs on extension launch in extension.ts
|
||||
welcomeViewCompleted,
|
||||
showOnboardingFlow: featureFlagsService.getOnboardingEnabled(),
|
||||
mcpResponsesCollapsed,
|
||||
terminalOutputLineLimit,
|
||||
maxConsecutiveMistakes,
|
||||
|
||||
@@ -20,7 +20,7 @@ export async function addRemoteMcpServer(controller: Controller, request: AddRem
|
||||
}
|
||||
|
||||
// Call the McpHub method to add the remote server
|
||||
const servers = await controller.mcpHub?.addRemoteServer(request.serverName, request.serverUrl)
|
||||
const servers = await controller.mcpHub?.addRemoteServer(request.serverName, request.serverUrl, request.transportType)
|
||||
|
||||
const protoServers = convertMcpServersToProtoMcpServers(servers)
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { StringRequest } from "@shared/proto/cline/common"
|
||||
import { Empty } from "@shared/proto/cline/common"
|
||||
import type { Controller } from "../index"
|
||||
|
||||
/**
|
||||
* Initiates OAuth authentication for an MCP server
|
||||
* @param controller The controller instance
|
||||
* @param request The request containing server name
|
||||
* @returns Empty response
|
||||
*/
|
||||
export async function authenticateMcpServer(controller: Controller, request: StringRequest): Promise<Empty> {
|
||||
try {
|
||||
const serverName = request.value
|
||||
if (!serverName) {
|
||||
throw new Error("Server name is required")
|
||||
}
|
||||
|
||||
// Call the McpHub method to initiate OAuth
|
||||
await controller.mcpHub?.initiateOAuth(serverName)
|
||||
|
||||
return Empty.create()
|
||||
} catch (error) {
|
||||
console.error(`Failed to initiate OAuth for MCP server:`, error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { StringRequest } from "@shared/proto/cline/common"
|
||||
import { McpDownloadResponse } from "@shared/proto/cline/mcp"
|
||||
import axios from "axios"
|
||||
import { ClineEnv } from "@/config"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
import { sendChatButtonClickedEvent } from "../ui/subscribeToChatButtonClicked"
|
||||
|
||||
@@ -36,6 +37,7 @@ export async function downloadMcp(controller: Controller, request: StringRequest
|
||||
{
|
||||
headers: { "Content-Type": "application/json" },
|
||||
timeout: 10000,
|
||||
...getAxiosSettings(),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { EmptyRequest } from "@shared/proto/cline/common"
|
||||
import { OpenRouterCompatibleModelInfo, OpenRouterModelInfo } from "@shared/proto/cline/models"
|
||||
import axios from "axios"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ import { Controller } from ".."
|
||||
*/
|
||||
export async function getAihubmixModels(_controller: Controller, _request: EmptyRequest): Promise<OpenRouterCompatibleModelInfo> {
|
||||
try {
|
||||
const response = await axios.get("https://aihubmix.com/call/mdl_info_platform?tag=coding")
|
||||
const response = await axios.get("https://aihubmix.com/call/mdl_info_platform?tag=coding", getAxiosSettings())
|
||||
|
||||
if (!response.data?.success || !Array.isArray(response.data?.data)) {
|
||||
console.error("Invalid response from AIhubmix API:", response.data)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { StringArray, StringRequest } from "@shared/proto/cline/common"
|
||||
import axios from "axios"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -16,7 +17,7 @@ export async function getOllamaModels(_controller: Controller, request: StringRe
|
||||
return StringArray.create({ values: [] })
|
||||
}
|
||||
|
||||
const response = await axios.get(`${baseUrl}/api/tags`)
|
||||
const response = await axios.get(`${baseUrl}/api/tags`, getAxiosSettings())
|
||||
const modelsArray = response.data?.models?.map((model: any) => model.name) || []
|
||||
const models = [...new Set<string>(modelsArray)].sort()
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import axios from "axios"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { SapAiCoreModelDeployment, SapAiCoreModelsRequest, SapAiCoreModelsResponse } from "@/shared/proto/cline/models"
|
||||
import { Controller } from ".."
|
||||
|
||||
@@ -33,6 +34,7 @@ async function getToken(clientId: string, clientSecret: string, tokenUrl: string
|
||||
const url = tokenUrl.replace(/\/+$/, "") + "/oauth/token"
|
||||
const response = await axios.post(url, payload, {
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
const token = response.data as Token
|
||||
token.expires_at = Date.now() + token.expires_in * 1000
|
||||
@@ -65,7 +67,7 @@ async function fetchAiCoreDeploymentsAndOrchestration(
|
||||
const url = `${baseUrl}/v2/lm/deployments?$top=10000&$skip=0`
|
||||
|
||||
try {
|
||||
const response = await axios.get(url, { headers })
|
||||
const response = await axios.get(url, { headers, ...getAxiosSettings() })
|
||||
const allDeployments = response.data.resources
|
||||
|
||||
// Filter running deployments
|
||||
|
||||
@@ -5,6 +5,7 @@ import { parsePrice } from "@utils/model-utils"
|
||||
import axios from "axios"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { basetenModels } from "../../../shared/api"
|
||||
import { Controller } from ".."
|
||||
|
||||
@@ -50,6 +51,7 @@ export async function refreshBasetenModels(controller: Controller): Promise<Reco
|
||||
"User-Agent": "Cline-VSCode-Extension",
|
||||
},
|
||||
timeout: 10000, // 10 second timeout
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
|
||||
if (response.data?.data) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import axios from "axios"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { telemetryService } from "@/services/telemetry"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { groqModels } from "../../../shared/api"
|
||||
import { Controller } from ".."
|
||||
|
||||
@@ -52,6 +53,7 @@ export async function refreshGroqModels(controller: Controller): Promise<Record<
|
||||
"User-Agent": "Cline-VSCode-Extension",
|
||||
},
|
||||
timeout: 10000, // 10 second timeout
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
|
||||
if (response.data?.data) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { fileExistsAtPath } from "@utils/fs"
|
||||
import axios from "axios"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -33,6 +34,7 @@ export async function refreshHicapModels(controller: Controller, _request: Empty
|
||||
headers: {
|
||||
"api-key": hicapApiKey,
|
||||
},
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
|
||||
if (response.data?.data) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import axios from "axios"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { ensureCacheDirectoryExists } from "@/core/storage/disk"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -26,6 +27,7 @@ export async function refreshHuggingFaceModels(
|
||||
// Fetch models from Hugging Face API
|
||||
const response = await axios.get("https://router.huggingface.co/v1/models", {
|
||||
timeout: 10000,
|
||||
...getAxiosSettings(),
|
||||
})
|
||||
|
||||
if (response.data?.data) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { StringArray } from "@shared/proto/cline/common"
|
||||
import { OpenAiModelsRequest } from "@shared/proto/cline/models"
|
||||
import type { AxiosRequestConfig } from "axios"
|
||||
import axios from "axios"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -25,7 +26,7 @@ export async function refreshOpenAiModels(_controller: Controller, request: Open
|
||||
config["headers"] = { Authorization: `Bearer ${request.apiKey}` }
|
||||
}
|
||||
|
||||
const response = await axios.get(`${request.baseUrl}/models`, config)
|
||||
const response = await axios.get(`${request.baseUrl}/models`, { ...config, ...getAxiosSettings() })
|
||||
const modelsArray = response.data?.data?.map((model: any) => model.id) || []
|
||||
const models = [...new Set<string>(modelsArray)]
|
||||
|
||||
|
||||
@@ -4,7 +4,13 @@ import axios from "axios"
|
||||
import cloneDeep from "clone-deep"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { CLAUDE_SONNET_1M_TIERS, openRouterClaudeSonnet41mModelId, openRouterClaudeSonnet451mModelId } from "@/shared/api"
|
||||
import {
|
||||
ANTHROPIC_MAX_THINKING_BUDGET,
|
||||
CLAUDE_SONNET_1M_TIERS,
|
||||
openRouterClaudeSonnet41mModelId,
|
||||
openRouterClaudeSonnet451mModelId,
|
||||
} from "@/shared/api"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import type { Controller } from ".."
|
||||
|
||||
type OpenRouterSupportedParams =
|
||||
@@ -59,7 +65,6 @@ interface OpenRouterRawModelInfo {
|
||||
input_cache_read: string
|
||||
input_cache_write: string
|
||||
} | null
|
||||
thinking_config: Record<string, unknown> | null
|
||||
supports_global_endpoint: boolean | null
|
||||
tiers: any[] | null
|
||||
supported_parameters?: OpenRouterSupportedParams[] | null
|
||||
@@ -75,7 +80,7 @@ export async function refreshOpenRouterModels(controller: Controller): Promise<R
|
||||
|
||||
const models: Record<string, ModelInfo> = {}
|
||||
try {
|
||||
const response = await axios.get("https://openrouter.ai/api/v1/models")
|
||||
const response = await axios.get("https://openrouter.ai/api/v1/models", getAxiosSettings())
|
||||
|
||||
if (response.data?.data) {
|
||||
const rawModels = response.data.data
|
||||
@@ -86,8 +91,10 @@ export async function refreshOpenRouterModels(controller: Controller): Promise<R
|
||||
return undefined
|
||||
}
|
||||
for (const rawModel of rawModels as OpenRouterRawModelInfo[]) {
|
||||
const supportThinking = rawModel.supported_parameters?.some((p) => p === "include_reasoning")
|
||||
const supportThinking = rawModel.supported_parameters?.some((p) => p === "include_reasoning" || p === "reasoning")
|
||||
|
||||
const modelInfo: ModelInfo = {
|
||||
name: rawModel.name,
|
||||
maxTokens: rawModel.top_provider?.max_completion_tokens ?? 0,
|
||||
contextWindow: rawModel.context_length ?? 0,
|
||||
supportsImages: rawModel.architecture?.modality?.includes("image") ?? false,
|
||||
@@ -97,7 +104,9 @@ export async function refreshOpenRouterModels(controller: Controller): Promise<R
|
||||
cacheWritesPrice: parsePrice(rawModel.pricing?.input_cache_write),
|
||||
cacheReadsPrice: parsePrice(rawModel.pricing?.input_cache_read),
|
||||
description: rawModel.description ?? "",
|
||||
thinkingConfig: (supportThinking && rawModel.thinking_config) || undefined,
|
||||
// If thinking is supported, set maxBudget with a default value as a placeholder
|
||||
// to ensure it has a valid thinkingConfig that lets the application know thinking is supported.
|
||||
thinkingConfig: supportThinking ? { maxBudget: ANTHROPIC_MAX_THINKING_BUDGET } : undefined,
|
||||
supportsGlobalEndpoint: rawModel.supports_global_endpoint ?? undefined,
|
||||
tiers: rawModel.tiers ?? undefined,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { EmptyRequest } from "@shared/proto/cline/common"
|
||||
import { OpenRouterCompatibleModelInfo, OpenRouterModelInfo } from "@shared/proto/cline/models"
|
||||
import axios from "axios"
|
||||
import { toRequestyServiceUrl } from "@/shared/providers/requesty"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { toRequestyServiceUrl } from "@/shared/clients/requesty"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -33,7 +34,7 @@ export async function refreshRequestyModels(controller: Controller, _: EmptyRequ
|
||||
const headers = {
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
}
|
||||
const response = await axios.get(url, { headers })
|
||||
const response = await axios.get(url, { headers, ...getAxiosSettings() })
|
||||
if (response.data?.data) {
|
||||
for (const model of response.data.data) {
|
||||
const modelInfo: OpenRouterModelInfo = OpenRouterModelInfo.create({
|
||||
|
||||
@@ -4,6 +4,7 @@ import { fileExistsAtPath } from "@utils/fs"
|
||||
import axios from "axios"
|
||||
import fs from "fs/promises"
|
||||
import path from "path"
|
||||
import { getAxiosSettings } from "@/shared/net"
|
||||
import { Controller } from ".."
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,7 @@ export async function refreshVercelAiGatewayModels(_controller: Controller): Pro
|
||||
let models: Record<string, ModelInfo> = {}
|
||||
|
||||
try {
|
||||
const response = await axios.get("https://ai-gateway.vercel.sh/v1/models")
|
||||
const response = await axios.get("https://ai-gateway.vercel.sh/v1/models", getAxiosSettings())
|
||||
|
||||
if (response.data?.data) {
|
||||
const rawModels = response.data.data
|
||||
|
||||
@@ -31,6 +31,20 @@ function parseFieldMask(updateMask: string[]): {
|
||||
return { options, secrets }
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the alternate mode field name (e.g., planModeX <-> actModeX)
|
||||
* @param fieldName The field name to get alternate for
|
||||
* @returns The alternate mode field name or null if not a mode-specific field
|
||||
*/
|
||||
function getAlternateModeField(fieldName: string): string | null {
|
||||
if (fieldName.startsWith("planMode")) {
|
||||
return fieldName.replace("planMode", "actMode")
|
||||
} else if (fieldName.startsWith("actMode")) {
|
||||
return fieldName.replace("actMode", "planMode")
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates API configuration using field mask
|
||||
* @param controller The controller instance
|
||||
@@ -39,9 +53,9 @@ function parseFieldMask(updateMask: string[]): {
|
||||
*/
|
||||
export async function updateApiConfiguration(controller: Controller, request: UpdateApiConfigurationRequestNew): Promise<Empty> {
|
||||
try {
|
||||
const { apiConfiguration, updateMask } = request
|
||||
const { updates, updateMask } = request
|
||||
|
||||
if (!apiConfiguration) {
|
||||
if (!updates) {
|
||||
throw new Error("API configuration is required")
|
||||
}
|
||||
|
||||
@@ -49,7 +63,7 @@ export async function updateApiConfiguration(controller: Controller, request: Up
|
||||
throw new Error("Update mask is required and must contain at least one path")
|
||||
}
|
||||
|
||||
const { options: protoOptions, secrets: protoSecrets } = apiConfiguration
|
||||
const { options: protoOptions, secrets: protoSecrets } = updates
|
||||
|
||||
// Parse the field mask to determine which fields to update
|
||||
const { options: maskOptionsFields, secrets: maskSecretsFields } = parseFieldMask(updateMask)
|
||||
@@ -81,6 +95,10 @@ export async function updateApiConfiguration(controller: Controller, request: Up
|
||||
throw new Error(`Field "${fieldName}" specified in mask but not found in options`)
|
||||
}
|
||||
}
|
||||
|
||||
// Check if mode-specific configurations should be kept separate
|
||||
const separateModeConfigs = controller.stateManager.getGlobalSettingsKey("planActSeparateModelsSetting")
|
||||
|
||||
// Process entries that are in the mask
|
||||
for (const [key, value] of Object.entries(protoOptions)) {
|
||||
if (maskOptionsFields.has(key)) {
|
||||
@@ -92,6 +110,20 @@ export async function updateApiConfiguration(controller: Controller, request: Up
|
||||
} else {
|
||||
options[key as keyof ApiHandlerOptions] = value
|
||||
}
|
||||
|
||||
// If mode configs should be synced, also update the alternate mode field
|
||||
if (!separateModeConfigs) {
|
||||
const alternateField = getAlternateModeField(key)
|
||||
if (alternateField) {
|
||||
if (alternateField === "planModeApiProvider") {
|
||||
options.planModeApiProvider = convertProtoToApiProvider(value)
|
||||
} else if (alternateField === "actModeApiProvider") {
|
||||
options.actModeApiProvider = convertProtoToApiProvider(value)
|
||||
} else {
|
||||
options[alternateField as keyof ApiHandlerOptions] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Empty } from "@shared/proto/cline/common"
|
||||
import { OnboardingProgressRequest } from "@shared/proto/cline/state"
|
||||
import { telemetryService } from "../../../services/telemetry"
|
||||
import type { Controller } from "../index"
|
||||
|
||||
/**
|
||||
* Captures the onboarding progress step
|
||||
* @param controller The controller instance
|
||||
* @param request The request containing the step number
|
||||
* @returns Empty response
|
||||
*/
|
||||
export async function captureOnboardingProgress(_controller: Controller, request: OnboardingProgressRequest): Promise<Empty> {
|
||||
try {
|
||||
telemetryService.captureOnboardingProgress({
|
||||
step: Number(request.step),
|
||||
model: request.modelSelected,
|
||||
action: request.action,
|
||||
completed: !!request.completed,
|
||||
})
|
||||
return Empty.create({})
|
||||
} catch (error) {
|
||||
console.error("Failed to set welcome view completed:", error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { EmptyRequest } from "@shared/proto/cline/common"
|
||||
import { Empty } from "@shared/proto/cline/common"
|
||||
import type { Controller } from "../index"
|
||||
|
||||
/**
|
||||
* Flush all pending state changes immediately to disk
|
||||
* Bypasses the debounced persistence and forces immediate writes
|
||||
*/
|
||||
export async function flushPendingState(controller: Controller, request: EmptyRequest): Promise<Empty> {
|
||||
try {
|
||||
await controller.stateManager.flushPendingState()
|
||||
return Empty.create({})
|
||||
} catch (error) {
|
||||
console.error("[flushPendingState] Error flushing pending state:", error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,7 @@ export async function getTaskHistory(controller: Controller, request: GetTaskHis
|
||||
tokensOut: item.tokensOut || 0,
|
||||
cacheWrites: item.cacheWrites || 0,
|
||||
cacheReads: item.cacheReads || 0,
|
||||
modelId: item.modelId || "",
|
||||
}))
|
||||
|
||||
return TaskHistoryArray.create({
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Error thrown when a PreToolUse hook requests cancellation.
|
||||
* This signals to the tool handler that execution should be aborted.
|
||||
*/
|
||||
export class PreToolUseHookCancellationError extends Error {
|
||||
constructor(message: string = "PreToolUse hook requested cancellation") {
|
||||
super(message)
|
||||
this.name = "PreToolUseHookCancellationError"
|
||||
}
|
||||
}
|
||||
+10
-253
@@ -1,4 +1,5 @@
|
||||
import { getShell } from "@utils/shell"
|
||||
import type { ApiProviderInfo } from "@/core/api"
|
||||
import { getDeepPlanningPrompt } from "./commands/deep-planning"
|
||||
|
||||
export const newTaskToolResponse = () =>
|
||||
`<explicit_instructions type="new_task">
|
||||
@@ -208,256 +209,12 @@ cline "<prompt>"
|
||||
</explicit_instructions>\n
|
||||
`
|
||||
|
||||
export const deepPlanningToolResponse = (focusChainSettings?: { enabled: boolean }) => {
|
||||
const detectedShell = getShell()
|
||||
|
||||
// FIXME: detectedShell returns a non-string value on some Windows machines
|
||||
let isPowerShell = false
|
||||
try {
|
||||
isPowerShell =
|
||||
detectedShell != null &&
|
||||
typeof detectedShell === "string" &&
|
||||
(detectedShell.toLowerCase().includes("powershell") || detectedShell.toLowerCase().includes("pwsh"))
|
||||
} catch {}
|
||||
|
||||
return `<explicit_instructions type="deep-planning">
|
||||
Your task is to create a comprehensive implementation plan before writing any code. This process has four distinct steps that must be completed in order.
|
||||
|
||||
Your behavior should be methodical and thorough - take time to understand the codebase completely before making any recommendations. The quality of your investigation directly impacts the success of the implementation.
|
||||
|
||||
## STEP 1: Silent Investigation
|
||||
|
||||
<important>
|
||||
until explicitly instructed by the user to proceed with coding.
|
||||
You must thoroughly understand the existing codebase before proposing any changes.
|
||||
Perform your research without commentary or narration. Execute commands and read files without explaining what you're about to do. Only speak up if you have specific questions for the user.
|
||||
</important>
|
||||
|
||||
### Required Research Activities
|
||||
You must use the read_file tool to examine relevant source files, configuration files, and documentation. You must use terminal commands to gather information about the codebase structure and patterns. All terminal output must be piped to cat for visibility.
|
||||
|
||||
### Essential Terminal Commands
|
||||
First, determine the language(s) used in the codebase, then execute these commands to build your understanding. You must tailor them to the codebase and ensure the output is not overly verbose. For example, you should exclude dependency folders such as node_modules, venv or php vendor, etc. These are only examples, the exact commands will differ depending on the codebase.
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? `
|
||||
# Discover project structure and file types
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-Object -First 30 | Select-Object FullName
|
||||
|
||||
# Find all class and function definitions
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "class|function|def|interface|struct"
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp" | Select-String -Pattern "import|from|require|#include" | Sort-Object | Get-Unique
|
||||
|
||||
# Find dependency manifests
|
||||
Get-ChildItem -Recurse -Include "requirements*.txt","package.json","Cargo.toml","pom.xml","Gemfile","go.mod" | Get-Content
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "TODO|FIXME|XXX|HACK|NOTE"
|
||||
`
|
||||
: `
|
||||
# Discover project structure and file types
|
||||
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.cpp" -o -name "*.go" | head -30 | cat
|
||||
|
||||
# Find all class and function definitions
|
||||
grep -r "class\|function\|def\|interface\|struct\|func\|type.*struct\|type.*interface" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
grep -r "import\|from\|require\|#include" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" . | sort | uniq | cat
|
||||
|
||||
# Find dependency manifests
|
||||
find . -name "requirements*.txt" -o -name "package.json" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "Gemfile" -o -name "go.mod" | xargs cat
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
grep -r "TODO\|FIXME\|XXX\|HACK\|NOTE" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
## STEP 2: Discussion and Questions
|
||||
|
||||
Ask the user brief, targeted questions that will influence your implementation plan. Keep your questions concise and conversational. Ask only essential questions needed to create an accurate plan.
|
||||
|
||||
**Ask questions only when necessary for:**
|
||||
- Clarifying ambiguous requirements or specifications
|
||||
- Choosing between multiple equally valid implementation approaches
|
||||
- Confirming assumptions about existing system behavior or constraints
|
||||
- Understanding preferences for specific technical decisions that will affect the implementation
|
||||
|
||||
Your questions should be direct and specific. Avoid long explanations or multiple questions in one response.
|
||||
|
||||
## STEP 3: Create Implementation Plan Document
|
||||
|
||||
Create a structured markdown document containing your complete implementation plan. The document must follow this exact format with clearly marked sections:
|
||||
|
||||
### Document Structure Requirements
|
||||
|
||||
Your implementation plan must be saved as implementation_plan.md, and *must* be structured as follows:
|
||||
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
[Overview]
|
||||
Single sentence describing the overall goal.
|
||||
|
||||
Multiple paragraphs outlining the scope, context, and high-level approach. Explain why this implementation is needed and how it fits into the existing system.
|
||||
|
||||
[Types]
|
||||
Single sentence describing the type system changes.
|
||||
|
||||
Detailed type definitions, interfaces, enums, or data structures with complete specifications. Include field names, types, validation rules, and relationships.
|
||||
|
||||
[Files]
|
||||
Single sentence describing file modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New files to be created (with full paths and purpose)
|
||||
- Existing files to be modified (with specific changes)
|
||||
- Files to be deleted or moved
|
||||
- Configuration file updates
|
||||
|
||||
[Functions]
|
||||
Single sentence describing function modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New functions (name, signature, file path, purpose)
|
||||
- Modified functions (exact name, current file path, required changes)
|
||||
- Removed functions (name, file path, reason, migration strategy)
|
||||
|
||||
[Classes]
|
||||
Single sentence describing class modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New classes (name, file path, key methods, inheritance)
|
||||
- Modified classes (exact name, file path, specific modifications)
|
||||
- Removed classes (name, file path, replacement strategy)
|
||||
|
||||
[Dependencies]
|
||||
Single sentence describing dependency modifications.
|
||||
|
||||
Details of new packages, version changes, and integration requirements.
|
||||
|
||||
[Testing]
|
||||
Single sentence describing testing approach.
|
||||
|
||||
Test file requirements, existing test modifications, and validation strategies.
|
||||
|
||||
[Implementation Order]
|
||||
Single sentence describing the implementation sequence.
|
||||
|
||||
Numbered steps showing the logical order of changes to minimize conflicts and ensure successful integration.
|
||||
|
||||
|
||||
## STEP 4: Create Implementation Task
|
||||
|
||||
Use the new_task command to create a task for implementing the plan. The task must include a <task_progress> list that breaks down the implementation into trackable steps.
|
||||
|
||||
### Task Creation Requirements
|
||||
|
||||
Your new task should be self-contained and reference the plan document rather than requiring additional codebase investigation. Include these specific instructions in the task description:
|
||||
|
||||
**Plan Document Navigation Commands:**
|
||||
The implementation agent should use these commands to read specific sections of the implementation plan. You should adapt these examples to conform to the structure of the .md file you createdm, and explicitly provide them when creating the new task:
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? `
|
||||
# Read Overview section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Overview\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Types section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Files section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Functions section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Classes section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Dependencies section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Testing section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Implementation Order section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($content.Length-1)]
|
||||
`
|
||||
: `
|
||||
# Read Overview section
|
||||
sed -n '/\[Overview\]/,/\[Types\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Types section
|
||||
sed -n '/\[Types\]/,/\[Files\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Files section
|
||||
sed -n '/\[Files\]/,/\[Functions\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Functions section
|
||||
sed -n '/\[Functions\]/,/\[Classes\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Classes section
|
||||
sed -n '/\[Classes\]/,/\[Dependencies\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Dependencies section
|
||||
sed -n '/\[Dependencies\]/,/\[Testing\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Testing section
|
||||
sed -n '/\[Testing\]/,/\[Implementation Order\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Implementation Order section
|
||||
sed -n '/\[Implementation Order\]/,$p' implementation_plan.md | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
**Task Progress Format:**
|
||||
<IMPORTANT>
|
||||
You absolutely must include the task_progress contents in context when creating the new task. When providing it, do not wrap it in XML tags- instead provide it like this:
|
||||
|
||||
|
||||
task_progress Items:
|
||||
- [ ] Step 1: Brief description of first implementation step
|
||||
- [ ] Step 2: Brief description of second implementation step
|
||||
- [ ] Step 3: Brief description of third implementation step
|
||||
- [ ] Step N: Brief description of final implementation step
|
||||
|
||||
|
||||
You also MUST include the path to the markdown file you have created in your new task prompt. You should do this as follows:
|
||||
|
||||
Refer to @path/to/file/markdown.md for a complete breakdown of the task requirements and steps. You should periodically read this file again.
|
||||
|
||||
${
|
||||
focusChainSettings?.enabled
|
||||
? `
|
||||
**Task Progress Parameter:**
|
||||
When creating the new task, you must include a task_progress parameter that breaks down the implementation into trackable steps. This should follow the standard Markdown checklist format with "- [ ]" for incomplete items.`
|
||||
: ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
### Mode Switching
|
||||
|
||||
When creating the new task, request a switch to "act mode" if you are currently in "plan mode". This ensures the implementation agent operates in execution mode rather than planning mode.
|
||||
</IMPORTANT>
|
||||
|
||||
## Quality Standards
|
||||
|
||||
You must be specific with exact file paths, function names, and class names. You must be comprehensive and avoid assuming implicit understanding. You must be practical and consider real-world constraints and edge cases. You must use precise technical language and avoid ambiguity.
|
||||
|
||||
Your implementation plan should be detailed enough that another developer could execute it without additional investigation.
|
||||
|
||||
---
|
||||
|
||||
**Execute all four steps in sequence. Your role is to plan thoroughly, not to implement. Code creation begins only after the new task is created and you receive explicit instruction to proceed.**
|
||||
|
||||
Below is the user's input when they indicated that they wanted to create a comprehensive implementation plan.
|
||||
</explicit_instructions>\n
|
||||
`
|
||||
/**
|
||||
* Generates the deep-planning slash command response with model-family-aware variant selection
|
||||
* @param focusChainSettings Optional focus chain settings to include in the prompt
|
||||
* @param providerInfo Optional API provider info for model family detection
|
||||
* @returns The deep-planning prompt string with appropriate variant and focus chain settings applied
|
||||
*/
|
||||
export const deepPlanningToolResponse = (focusChainSettings?: { enabled: boolean }, providerInfo?: ApiProviderInfo) => {
|
||||
return getDeepPlanningPrompt(focusChainSettings, providerInfo)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { ApiProviderInfo } from "@/core/api"
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
import { getDeepPlanningRegistry } from "./registry"
|
||||
import { generateGPT51Template } from "./variants/gpt5"
|
||||
|
||||
/**
|
||||
* Generates the deep-planning slash command response with model-family-aware variant selection
|
||||
* @param focusChainSettings Optional focus chain settings to include in the prompt
|
||||
* @param providerInfo Optional API provider info for model family detection
|
||||
* @returns The deep-planning prompt string with appropriate variant and focus chain settings applied
|
||||
*/
|
||||
export function getDeepPlanningPrompt(focusChainSettings?: { enabled: boolean }, providerInfo?: ApiProviderInfo): string {
|
||||
// Create context for variant selection
|
||||
const context: SystemPromptContext = {
|
||||
providerInfo: providerInfo || ({} as ApiProviderInfo),
|
||||
ide: "vscode",
|
||||
}
|
||||
|
||||
// Get the appropriate variant from registry
|
||||
const registry = getDeepPlanningRegistry()
|
||||
const variant = registry.get(context)
|
||||
|
||||
// For variants with extensive focus chain prompting, generate template with focus chain flag
|
||||
let template: string
|
||||
if (variant.id === "gpt-5") {
|
||||
template = generateGPT51Template(focusChainSettings?.enabled ?? false)
|
||||
} else {
|
||||
template = variant.template
|
||||
}
|
||||
|
||||
// For variants with simpler focus chain prompting, Replace the FOCUS_CHAIN_PARAM placeholder with actual content
|
||||
const focusChainParam = focusChainSettings?.enabled
|
||||
? `**Task Progress Parameter:**
|
||||
When creating the new task, you must include a task_progress parameter that breaks down the implementation into trackable steps. This parameter should be included inside the tool call, but not located inside of other content/argument blocks. This should follow the standard Markdown checklist format with "- [ ]" for incomplete items.`
|
||||
: ""
|
||||
|
||||
template = template.replace("{{FOCUS_CHAIN_PARAM}}", focusChainParam)
|
||||
|
||||
return template
|
||||
}
|
||||
|
||||
// Export types for external use
|
||||
export type { DeepPlanningRegistry, DeepPlanningVariant } from "./types"
|
||||
@@ -0,0 +1,92 @@
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
import type { DeepPlanningVariant, DeepPlanningRegistry as IDeepPlanningRegistry } from "./types"
|
||||
import { createAnthropicVariant, createGeminiVariant, createGenericVariant, createGPT51Variant } from "./variants"
|
||||
|
||||
/**
|
||||
* Singleton registry for managing deep-planning prompt variants
|
||||
* Selects appropriate variant based on model family detection
|
||||
*/
|
||||
class DeepPlanningRegistry implements IDeepPlanningRegistry {
|
||||
private static instance: DeepPlanningRegistry | null = null
|
||||
private variants: Map<string, DeepPlanningVariant> = new Map()
|
||||
private genericVariant: DeepPlanningVariant
|
||||
|
||||
private constructor() {
|
||||
// Initialize all variants
|
||||
this.registerVariant(createAnthropicVariant())
|
||||
this.registerVariant(createGeminiVariant())
|
||||
this.registerVariant(createGPT51Variant())
|
||||
|
||||
// Generic variant must be registered last as fallback
|
||||
const genericVariant = createGenericVariant()
|
||||
this.registerVariant(genericVariant)
|
||||
this.genericVariant = genericVariant
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the singleton instance of the registry
|
||||
*/
|
||||
public static getInstance(): DeepPlanningRegistry {
|
||||
if (!DeepPlanningRegistry.instance) {
|
||||
DeepPlanningRegistry.instance = new DeepPlanningRegistry()
|
||||
}
|
||||
return DeepPlanningRegistry.instance
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new variant in the registry
|
||||
*/
|
||||
public register(variant: DeepPlanningVariant): void {
|
||||
this.registerVariant(variant)
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal method to register a variant
|
||||
*/
|
||||
private registerVariant(variant: DeepPlanningVariant): void {
|
||||
this.variants.set(variant.id, variant)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the appropriate variant based on the system prompt context
|
||||
* Uses matcher functions to determine which variant to use
|
||||
* Falls back to generic variant if no match or on error
|
||||
*/
|
||||
public get(context: SystemPromptContext): DeepPlanningVariant {
|
||||
try {
|
||||
// Try each variant's matcher function (except generic which is last)
|
||||
for (const variant of this.variants.values()) {
|
||||
// Skip generic variant in iteration (it's the fallback)
|
||||
if (variant.id === "generic") {
|
||||
continue
|
||||
}
|
||||
|
||||
// Test if this variant matches the context
|
||||
if (variant.matcher(context)) {
|
||||
return variant
|
||||
}
|
||||
}
|
||||
|
||||
// No match found, return generic variant
|
||||
return this.genericVariant
|
||||
} catch (error) {
|
||||
// On any error, safely fall back to generic variant
|
||||
console.warn("Error selecting deep-planning variant, falling back to generic:", error)
|
||||
return this.genericVariant
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all registered variants
|
||||
*/
|
||||
public getAll(): DeepPlanningVariant[] {
|
||||
return Array.from(this.variants.values())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export singleton instance getter
|
||||
*/
|
||||
export function getDeepPlanningRegistry(): DeepPlanningRegistry {
|
||||
return DeepPlanningRegistry.getInstance()
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
|
||||
/**
|
||||
* Configuration for a deep-planning prompt variant
|
||||
*/
|
||||
export interface DeepPlanningVariant {
|
||||
/** Unique identifier for this variant (e.g., "anthropic", "gemini", "gpt-5", "generic") */
|
||||
id: string
|
||||
|
||||
/** Human-readable description of this variant */
|
||||
description: string
|
||||
|
||||
/** The model family this variant is designed for */
|
||||
family: string
|
||||
|
||||
/** Version number for this variant */
|
||||
version: number
|
||||
|
||||
/** Matcher function to determine if this variant should be used */
|
||||
matcher: (context: SystemPromptContext) => boolean
|
||||
|
||||
/** The complete prompt template string */
|
||||
template: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Registry for deep-planning prompt variants
|
||||
*/
|
||||
export interface DeepPlanningRegistry {
|
||||
/** Get the appropriate variant based on context */
|
||||
get(context: SystemPromptContext): DeepPlanningVariant
|
||||
|
||||
/** Register a new variant */
|
||||
register(variant: DeepPlanningVariant): void
|
||||
|
||||
/** Get all registered variants */
|
||||
getAll(): DeepPlanningVariant[]
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
import { isAnthropicModelId } from "@utils/model-utils"
|
||||
import { getShell } from "@utils/shell"
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
import type { DeepPlanningVariant } from "../types"
|
||||
|
||||
/**
|
||||
* Creates the Anthropic Claude variant for deep-planning prompt
|
||||
* This variant is optimized for Claude models
|
||||
*/
|
||||
export function createAnthropicVariant(): DeepPlanningVariant {
|
||||
return {
|
||||
id: "anthropic",
|
||||
description: "Deep-planning variant optimized for Anthropic Claude models",
|
||||
family: "anthropic",
|
||||
version: 1,
|
||||
matcher: (context: SystemPromptContext) => {
|
||||
const modelId = context.providerInfo?.model?.id
|
||||
if (!modelId) {
|
||||
return false
|
||||
}
|
||||
return isAnthropicModelId(modelId)
|
||||
},
|
||||
template: generateTemplate(),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the deep-planning template with shell-specific commands
|
||||
*/
|
||||
function generateTemplate(): string {
|
||||
const detectedShell = getShell()
|
||||
|
||||
// FIXME: detectedShell returns a non-string value on some Windows machines
|
||||
let isPowerShell = false
|
||||
try {
|
||||
isPowerShell =
|
||||
detectedShell != null &&
|
||||
typeof detectedShell === "string" &&
|
||||
(detectedShell.toLowerCase().includes("powershell") || detectedShell.toLowerCase().includes("pwsh"))
|
||||
} catch {}
|
||||
|
||||
return `<explicit_instructions type="deep-planning">
|
||||
Your task is to create a comprehensive implementation plan before writing any code. This process has four distinct steps that must be completed in order.
|
||||
|
||||
Your behavior should be methodical and thorough - take time to understand the codebase completely before making any recommendations. The quality of your investigation directly impacts the success of the implementation.
|
||||
|
||||
## STEP 1: Silent Investigation
|
||||
|
||||
<important>
|
||||
until explicitly instructed by the user to proceed with coding.
|
||||
You must thoroughly understand the existing codebase before proposing any changes.
|
||||
Perform your research without commentary or narration. Execute commands and read files without explaining what you're about to do. Only speak up if you have specific questions for the user.
|
||||
</important>
|
||||
|
||||
### Required Research Activities
|
||||
You must use the read_file tool to examine relevant source files, configuration files, and documentation. You must use terminal commands to gather information about the codebase structure and patterns. All terminal output must be piped to cat for visibility.
|
||||
|
||||
### Essential Terminal Commands
|
||||
First, determine the language(s) used in the codebase, then execute these commands to build your understanding. You must tailor them to the codebase and ensure the output is not overly verbose. For example, you should exclude dependency folders such as node_modules, venv or php vendor, etc. These are only examples, the exact commands will differ depending on the codebase.
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? // PowerShell-specific commands
|
||||
|
||||
`# Discover project structure and file types
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-Object -First 30 | Select-Object FullName
|
||||
|
||||
# Find all class and function definitions
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "class|function|def|interface|struct"
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp" | Select-String -Pattern "import|from|require|#include" | Sort-Object | Get-Unique
|
||||
|
||||
# Find dependency manifests
|
||||
Get-ChildItem -Recurse -Include "requirements*.txt","package.json","Cargo.toml","pom.xml","Gemfile","go.mod" | Get-Content
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "TODO|FIXME|XXX|HACK|NOTE"
|
||||
`
|
||||
: // bash/zsh-specific commands
|
||||
`# Discover project structure and file types
|
||||
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.cpp" -o -name "*.go" | head -30 | cat
|
||||
|
||||
# Find all class and function definitions
|
||||
grep -r "class\\|function\\|def\\|interface\\|struct\\|func\\|type.*struct\\|type.*interface" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
grep -r "import\\|from\\|require\\|#include" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" . | sort | uniq | cat
|
||||
|
||||
# Find dependency manifests
|
||||
find . -name "requirements*.txt" -o -name "package.json" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "Gemfile" -o -name "go.mod" | xargs cat
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
grep -r "TODO\\|FIXME\\|XXX\\|HACK\\|NOTE" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
## STEP 2: Discussion and Questions
|
||||
|
||||
Ask the user brief, targeted questions that will influence your implementation plan. Keep your questions concise and conversational. Ask only essential questions needed to create an accurate plan.
|
||||
|
||||
**Ask questions only when necessary for:**
|
||||
- Clarifying ambiguous requirements or specifications
|
||||
- Choosing between multiple equally valid implementation approaches
|
||||
- Confirming assumptions about existing system behavior or constraints
|
||||
- Understanding preferences for specific technical decisions that will affect the implementation
|
||||
|
||||
Your questions should be direct and specific. Avoid long explanations or multiple questions in one response.
|
||||
|
||||
## STEP 3: Create Implementation Plan Document
|
||||
|
||||
Create a structured markdown document containing your complete implementation plan. The document must follow this exact format with clearly marked sections:
|
||||
|
||||
### Document Structure Requirements
|
||||
|
||||
Your implementation plan must be saved as implementation_plan.md, and *must* be structured as follows:
|
||||
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
[Overview]
|
||||
Single sentence describing the overall goal.
|
||||
|
||||
Multiple paragraphs outlining the scope, context, and high-level approach. Explain why this implementation is needed and how it fits into the existing system.
|
||||
|
||||
[Types]
|
||||
Single sentence describing the type system changes.
|
||||
|
||||
Detailed type definitions, interfaces, enums, or data structures with complete specifications. Include field names, types, validation rules, and relationships.
|
||||
|
||||
[Files]
|
||||
Single sentence describing file modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New files to be created (with full paths and purpose)
|
||||
- Existing files to be modified (with specific changes)
|
||||
- Files to be deleted or moved
|
||||
- Configuration file updates
|
||||
|
||||
[Functions]
|
||||
Single sentence describing function modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New functions (name, signature, file path, purpose)
|
||||
- Modified functions (exact name, current file path, required changes)
|
||||
- Removed functions (name, file path, reason, migration strategy)
|
||||
|
||||
[Classes]
|
||||
Single sentence describing class modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New classes (name, file path, key methods, inheritance)
|
||||
- Modified classes (exact name, file path, specific modifications)
|
||||
- Removed classes (name, file path, replacement strategy)
|
||||
|
||||
[Dependencies]
|
||||
Single sentence describing dependency modifications.
|
||||
|
||||
Details of new packages, version changes, and integration requirements.
|
||||
|
||||
[Testing]
|
||||
Single sentence describing testing approach.
|
||||
|
||||
Test file requirements, existing test modifications, and validation strategies.
|
||||
|
||||
[Implementation Order]
|
||||
Single sentence describing the implementation sequence.
|
||||
|
||||
Numbered steps showing the logical order of changes to minimize conflicts and ensure successful integration.
|
||||
|
||||
|
||||
## STEP 4: Create Implementation Task
|
||||
|
||||
Use the new_task command to create a task for implementing the plan. The task must include a <task_progress> list that breaks down the implementation into trackable steps.
|
||||
|
||||
### Task Creation Requirements
|
||||
|
||||
Your new task should be self-contained and reference the plan document rather than requiring additional codebase investigation. Include these specific instructions in the task description:
|
||||
|
||||
**Plan Document Navigation Commands:**
|
||||
The implementation agent should use these commands to read specific sections of the implementation plan. You should adapt these examples to conform to the structure of the .md file you created, and explicitly provide them when creating the new task:
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? `
|
||||
# Read Overview section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Overview\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Types section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Files section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Functions section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Classes section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Dependencies section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Testing section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Implementation Order section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($content.Length-1)]
|
||||
`
|
||||
: `
|
||||
# Read Overview section
|
||||
sed -n '/\\[Overview\\]/,/\\[Types\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Types section
|
||||
sed -n '/\\[Types\\]/,/\\[Files\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Files section
|
||||
sed -n '/\\[Files\\]/,/\\[Functions\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Functions section
|
||||
sed -n '/\\[Functions\\]/,/\\[Classes\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Classes section
|
||||
sed -n '/\\[Classes\\]/,/\\[Dependencies\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Dependencies section
|
||||
sed -n '/\\[Dependencies\\]/,/\\[Testing\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Testing section
|
||||
sed -n '/\\[Testing\\]/,/\\[Implementation Order\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Implementation Order section
|
||||
sed -n '/\\[Implementation Order\\]/,$p' implementation_plan.md | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
**Task Progress Format:**
|
||||
<IMPORTANT>
|
||||
You absolutely must include the task_progress contents in context when creating the new task. When providing it, do not wrap it in XML tags- instead provide it like this:
|
||||
|
||||
|
||||
task_progress Items:
|
||||
- [ ] Step 1: Brief description of first implementation step
|
||||
- [ ] Step 2: Brief description of second implementation step
|
||||
- [ ] Step 3: Brief description of third implementation step
|
||||
- [ ] Step N: Brief description of final implementation step
|
||||
|
||||
|
||||
You also MUST include the path to the markdown file you have created in your new task prompt. You should do this as follows:
|
||||
|
||||
Refer to @path/to/file/markdown.md for a complete breakdown of the task requirements and steps. You should periodically read this file again.
|
||||
|
||||
{{FOCUS_CHAIN_PARAM}}
|
||||
|
||||
|
||||
|
||||
### Mode Switching
|
||||
|
||||
When creating the new task, request a switch to "act mode" if you are currently in "plan mode". This ensures the implementation agent operates in execution mode rather than planning mode.
|
||||
</IMPORTANT>
|
||||
|
||||
## Quality Standards
|
||||
|
||||
You must be specific with exact file paths, function names, and class names. You must be comprehensive and avoid assuming implicit understanding. You must be practical and consider real-world constraints and edge cases. You must use precise technical language and avoid ambiguity.
|
||||
|
||||
Your implementation plan should be detailed enough that another developer could execute it without additional investigation.
|
||||
|
||||
---
|
||||
|
||||
**Execute all four steps in sequence. Your role is to plan thoroughly, not to implement. Code creation begins only after the new task is created and you receive explicit instruction to proceed.**
|
||||
|
||||
Below is the user's input when they indicated that they wanted to create a comprehensive implementation plan.
|
||||
</explicit_instructions>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
import { isGemini2dot5ModelFamily } from "@utils/model-utils"
|
||||
import { getShell } from "@utils/shell"
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
import type { DeepPlanningVariant } from "../types"
|
||||
|
||||
/**
|
||||
* Creates the Google Gemini 2.5 variant for deep-planning prompt
|
||||
* This variant is optimized for Gemini 2.5 models
|
||||
*/
|
||||
export function createGeminiVariant(): DeepPlanningVariant {
|
||||
return {
|
||||
id: "gemini",
|
||||
description: "Deep-planning variant optimized for Google Gemini 2.5 models",
|
||||
family: "gemini",
|
||||
version: 1,
|
||||
matcher: (context: SystemPromptContext) => {
|
||||
const modelId = context.providerInfo?.model?.id
|
||||
if (!modelId) {
|
||||
return false
|
||||
}
|
||||
return isGemini2dot5ModelFamily(modelId)
|
||||
},
|
||||
template: generateTemplate(),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the deep-planning template with shell-specific commands
|
||||
*/
|
||||
function generateTemplate(): string {
|
||||
const detectedShell = getShell()
|
||||
|
||||
// FIXME: detectedShell returns a non-string value on some Windows machines
|
||||
let isPowerShell = false
|
||||
try {
|
||||
isPowerShell =
|
||||
detectedShell != null &&
|
||||
typeof detectedShell === "string" &&
|
||||
(detectedShell.toLowerCase().includes("powershell") || detectedShell.toLowerCase().includes("pwsh"))
|
||||
} catch {}
|
||||
|
||||
return `<explicit_instructions type="deep-planning">
|
||||
Your task is to create a comprehensive implementation plan before writing any code. This process has four distinct steps that must be completed in order.
|
||||
|
||||
Your behavior should be methodical and thorough - take time to understand the codebase completely before making any recommendations. The quality of your investigation directly impacts the success of the implementation.
|
||||
|
||||
## STEP 1: Silent Investigation
|
||||
|
||||
<important>
|
||||
until explicitly instructed by the user to proceed with coding.
|
||||
You must thoroughly understand the existing codebase before proposing any changes.
|
||||
Perform your research without commentary or narration. Execute commands and read files without explaining what you're about to do. Only speak up if you have specific questions for the user.
|
||||
</important>
|
||||
|
||||
### Required Research Activities
|
||||
You must first use the read_file tool to examine several source files, configuration files, and documentation to better inform subsequent research steps. You should only use read_file to prepare for more granular searching. Use this tool to determine the language(s) used in the codebase, and to identify the domain(s) relevant to the user's request.
|
||||
|
||||
You must then use terminal commands to gather information about the codebase structure and patterns relevant to the user's request. All terminal output must be piped to cat for visibility.
|
||||
You will tailor these commands to explore and identify key functions, classes, methods, types, and variables that are directly, or indirectly related to the task.
|
||||
These commands must be crafted to not produce exceptionally long or verbose search results. For example, you should exclude dependency folders such as node_modules, venv or php vendor, etc. Carefully consider the scope of search patterns. Use the results of your read_file tool calls to tailor the commands for balanced search result lengths. If a command returns no results, you may loosen the search patterns or scope slightly. If a command returns hundreds or thousands of results, you should adjust subsequent commands to be more targeted.
|
||||
|
||||
Execute these commands to build your understanding. Adjust subsequent commands based on the output you have received from each previous command, informing the scope and direction of your search.
|
||||
|
||||
Here are some example commands, remember to adjust them as instructed previously:
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? // PowerShell-specific commands
|
||||
`
|
||||
# Discover project structure and file types
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-Object -First 30 | Select-Object FullName
|
||||
|
||||
# Find all class and function definitions
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "class|function|def|interface|struct"
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp" | Select-String -Pattern "import|from|require|#include" | Sort-Object | Get-Unique
|
||||
|
||||
# Find dependency manifests
|
||||
Get-ChildItem -Recurse -Include "requirements*.txt","package.json","Cargo.toml","pom.xml","Gemfile","go.mod" | Get-Content
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "TODO|FIXME|XXX|HACK|NOTE"
|
||||
`
|
||||
: // bash/zsh-specific commands
|
||||
`
|
||||
# Discover project structure and file types
|
||||
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.cpp" -o -name "*.go" | head -30 | cat
|
||||
|
||||
# Find all class and function definitions
|
||||
grep -r "class\\|function\\|def\\|interface\\|struct\\|func\\|type.*struct\\|type.*interface" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
grep -r "import\\|from\\|require\\|#include" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" . | sort | uniq | cat
|
||||
|
||||
# Find dependency manifests
|
||||
find . -name "requirements*.txt" -o -name "package.json" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "Gemfile" -o -name "go.mod" | xargs cat
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
grep -r "TODO\\|FIXME\\|XXX\\|HACK\\|NOTE" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
## STEP 2: Discussion and Questions
|
||||
|
||||
Ask the user brief, targeted questions that will influence your implementation plan. Keep your questions concise and conversational. Ask only essential questions needed to create an accurate plan.
|
||||
|
||||
**Ask questions only when necessary for:**
|
||||
- Clarifying ambiguous requirements or specifications
|
||||
- Choosing between multiple equally valid implementation approaches
|
||||
- Confirming assumptions about existing system behavior or constraints
|
||||
- Understanding preferences for specific technical decisions that will affect the implementation
|
||||
|
||||
Your questions should be direct and specific. Avoid long explanations or multiple questions in one response.
|
||||
|
||||
## STEP 3: Create Implementation Plan Document
|
||||
|
||||
Create a structured markdown document containing your complete implementation plan. The document must follow this exact format with clearly marked sections:
|
||||
|
||||
### Document Structure Requirements
|
||||
|
||||
Your implementation plan must be saved as implementation_plan.md, and *must* be structured as follows:
|
||||
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
[Overview]
|
||||
Single sentence describing the overall goal.
|
||||
|
||||
Multiple paragraphs outlining the scope, context, and high-level approach. Explain why this implementation is needed and how it fits into the existing system.
|
||||
|
||||
[Types]
|
||||
Single sentence describing the type system changes.
|
||||
|
||||
Detailed type definitions, interfaces, enums, or data structures with complete specifications. Include field names, types, validation rules, and relationships.
|
||||
|
||||
[Files]
|
||||
Single sentence describing file modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New files to be created (with full paths and purpose)
|
||||
- Existing files to be modified (with specific changes)
|
||||
- Files to be deleted or moved
|
||||
- Configuration file updates
|
||||
|
||||
[Functions]
|
||||
Single sentence describing function modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New functions (name, signature, file path, purpose)
|
||||
- Modified functions (exact name, current file path, required changes)
|
||||
- Removed functions (name, file path, reason, migration strategy)
|
||||
|
||||
[Classes]
|
||||
Single sentence describing class modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New classes (name, file path, key methods, inheritance)
|
||||
- Modified classes (exact name, file path, specific modifications)
|
||||
- Removed classes (name, file path, replacement strategy)
|
||||
|
||||
[Dependencies]
|
||||
Single sentence describing dependency modifications.
|
||||
|
||||
Details of new packages, version changes, and integration requirements.
|
||||
|
||||
[Testing]
|
||||
Single sentence describing testing approach.
|
||||
|
||||
Test file requirements, existing test modifications, and validation strategies.
|
||||
|
||||
[Implementation Order]
|
||||
Single sentence describing the implementation sequence.
|
||||
|
||||
Numbered steps showing the logical order of changes to minimize conflicts and ensure successful integration.
|
||||
|
||||
|
||||
## STEP 4: Create Implementation Task
|
||||
|
||||
Use the new_task command to create a task for implementing the plan. The task must include a <task_progress> list that breaks down the implementation into trackable steps.
|
||||
|
||||
### Task Creation Requirements
|
||||
|
||||
Your new task should be self-contained and reference the plan document rather than requiring additional codebase investigation. Include these specific instructions in the task description:
|
||||
|
||||
**Plan Document Navigation Commands:**
|
||||
The implementation agent should use these commands to read specific sections of the implementation plan. You should adapt these examples to conform to the structure of the .md file you created, and explicitly provide them when creating the new task:
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? // PowerShell-specific commands
|
||||
`
|
||||
# Read Overview section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Overview\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Types section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Files section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Functions section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Classes section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Dependencies section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Testing section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Implementation Order section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($content.Length-1)]
|
||||
`
|
||||
: // bash/zsh-specific commands
|
||||
`
|
||||
# Read Overview section
|
||||
sed -n '/\\[Overview\\]/,/\\[Types\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Types section
|
||||
sed -n '/\\[Types\\]/,/\\[Files\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Files section
|
||||
sed -n '/\\[Files\\]/,/\\[Functions\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Functions section
|
||||
sed -n '/\\[Functions\\]/,/\\[Classes\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Classes section
|
||||
sed -n '/\\[Classes\\]/,/\\[Dependencies\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Dependencies section
|
||||
sed -n '/\\[Dependencies\\]/,/\\[Testing\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Testing section
|
||||
sed -n '/\\[Testing\\]/,/\\[Implementation Order\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Implementation Order section
|
||||
sed -n '/\\[Implementation Order\\]/,$p' implementation_plan.md | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
**Task Progress Format:**
|
||||
<IMPORTANT>
|
||||
You absolutely must include the task_progress contents in context when creating the new task. When providing it, do not wrap it in XML tags- instead provide it like this:
|
||||
|
||||
|
||||
task_progress Items:
|
||||
- [ ] Step 1: Brief description of first implementation step
|
||||
- [ ] Step 2: Brief description of second implementation step
|
||||
- [ ] Step 3: Brief description of third implementation step
|
||||
- [ ] Step N: Brief description of final implementation step
|
||||
|
||||
|
||||
You also MUST include the path to the markdown file you have created in your new task prompt. You should do this as follows:
|
||||
|
||||
Refer to @path/to/file/markdown.md for a complete breakdown of the task requirements and steps. You should periodically read this file again.
|
||||
|
||||
{{FOCUS_CHAIN_PARAM}}
|
||||
|
||||
|
||||
|
||||
### Mode Switching
|
||||
|
||||
When creating the new task, request a switch to "act mode" if you are currently in "plan mode". This ensures the implementation agent operates in execution mode rather than planning mode.
|
||||
</IMPORTANT>
|
||||
|
||||
## Quality Standards
|
||||
|
||||
You must be specific with exact file paths, function names, and class names. You must be comprehensive and avoid assuming implicit understanding. You must be practical and consider real-world constraints and edge cases. You must use precise technical language and avoid ambiguity.
|
||||
|
||||
Your implementation plan should be detailed enough that another developer could execute it without additional investigation.
|
||||
|
||||
---
|
||||
|
||||
**Execute all four steps in sequence. Your role is to plan thoroughly, not to implement. Code creation begins only after the new task is created and you receive explicit instruction to proceed.**
|
||||
|
||||
Below is the user's input when they indicated that they wanted to create a comprehensive implementation plan.
|
||||
</explicit_instructions>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
import { getShell } from "@utils/shell"
|
||||
import type { DeepPlanningVariant } from "../types"
|
||||
|
||||
/**
|
||||
* Creates the generic fallback variant for deep-planning prompt
|
||||
* This variant is used when no specific model family matcher applies
|
||||
*/
|
||||
export function createGenericVariant(): DeepPlanningVariant {
|
||||
return {
|
||||
id: "generic",
|
||||
description: "Generic fallback variant for deep-planning prompt, used for all models",
|
||||
family: "generic",
|
||||
version: 1,
|
||||
matcher: () => true, // Always matches as fallback
|
||||
template: generateTemplate(),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the deep-planning template with shell-specific commands
|
||||
*/
|
||||
function generateTemplate(): string {
|
||||
const detectedShell = getShell()
|
||||
|
||||
// FIXME: detectedShell returns a non-string value on some Windows machines
|
||||
let isPowerShell = false
|
||||
try {
|
||||
isPowerShell =
|
||||
detectedShell != null &&
|
||||
typeof detectedShell === "string" &&
|
||||
(detectedShell.toLowerCase().includes("powershell") || detectedShell.toLowerCase().includes("pwsh"))
|
||||
} catch {}
|
||||
|
||||
return `<explicit_instructions type="deep-planning">
|
||||
Your task is to create a comprehensive implementation plan before writing any code. This process has four distinct steps that must be completed in order.
|
||||
|
||||
Your behavior should be methodical and thorough - take time to understand the codebase completely before making any recommendations. The quality of your investigation directly impacts the success of the implementation.
|
||||
|
||||
## STEP 1: Silent Investigation
|
||||
|
||||
<important>
|
||||
until explicitly instructed by the user to proceed with coding.
|
||||
You must thoroughly understand the existing codebase before proposing any changes.
|
||||
Perform your research without commentary or narration. Execute commands and read files without explaining what you're about to do. Only speak up if you have specific questions for the user.
|
||||
</important>
|
||||
|
||||
### Required Research Activities
|
||||
You must use the read_file tool to examine relevant source files, configuration files, and documentation. You must use terminal commands to gather information about the codebase structure and patterns. All terminal output must be piped to cat for visibility.
|
||||
|
||||
### Essential Terminal Commands
|
||||
First, determine the language(s) used in the codebase, then execute these commands to build your understanding. You must tailor them to the codebase and ensure the output is not overly verbose. For example, you should exclude dependency folders such as node_modules, venv or php vendor, etc. These are only examples, the exact commands will differ depending on the codebase.
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? `
|
||||
# Discover project structure and file types
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-Object -First 30 | Select-Object FullName
|
||||
|
||||
# Find all class and function definitions
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "class|function|def|interface|struct"
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp" | Select-String -Pattern "import|from|require|#include" | Sort-Object | Get-Unique
|
||||
|
||||
# Find dependency manifests
|
||||
Get-ChildItem -Recurse -Include "requirements*.txt","package.json","Cargo.toml","pom.xml","Gemfile","go.mod" | Get-Content
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "TODO|FIXME|XXX|HACK|NOTE"
|
||||
`
|
||||
: `
|
||||
# Discover project structure and file types
|
||||
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.cpp" -o -name "*.go" | head -30 | cat
|
||||
|
||||
# Find all class and function definitions
|
||||
grep -r "class\\|function\\|def\\|interface\\|struct\\|func\\|type.*struct\\|type.*interface" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
grep -r "import\\|from\\|require\\|#include" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" . | sort | uniq | cat
|
||||
|
||||
# Find dependency manifests
|
||||
find . -name "requirements*.txt" -o -name "package.json" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "Gemfile" -o -name "go.mod" | xargs cat
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
grep -r "TODO\\|FIXME\\|XXX\\|HACK\\|NOTE" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
## STEP 2: Discussion and Questions
|
||||
|
||||
Ask the user brief, targeted questions that will influence your implementation plan. Keep your questions concise and conversational. Ask only essential questions needed to create an accurate plan.
|
||||
|
||||
**Ask questions only when necessary for:**
|
||||
- Clarifying ambiguous requirements or specifications
|
||||
- Choosing between multiple equally valid implementation approaches
|
||||
- Confirming assumptions about existing system behavior or constraints
|
||||
- Understanding preferences for specific technical decisions that will affect the implementation
|
||||
|
||||
Your questions should be direct and specific. Avoid long explanations or multiple questions in one response.
|
||||
|
||||
## STEP 3: Create Implementation Plan Document
|
||||
|
||||
Create a structured markdown document containing your complete implementation plan. The document must follow this exact format with clearly marked sections:
|
||||
|
||||
### Document Structure Requirements
|
||||
|
||||
Your implementation plan must be saved as implementation_plan.md, and *must* be structured as follows:
|
||||
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
[Overview]
|
||||
Single sentence describing the overall goal.
|
||||
|
||||
Multiple paragraphs outlining the scope, context, and high-level approach. Explain why this implementation is needed and how it fits into the existing system.
|
||||
|
||||
[Types]
|
||||
Single sentence describing the type system changes.
|
||||
|
||||
Detailed type definitions, interfaces, enums, or data structures with complete specifications. Include field names, types, validation rules, and relationships.
|
||||
|
||||
[Files]
|
||||
Single sentence describing file modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New files to be created (with full paths and purpose)
|
||||
- Existing files to be modified (with specific changes)
|
||||
- Files to be deleted or moved
|
||||
- Configuration file updates
|
||||
|
||||
[Functions]
|
||||
Single sentence describing function modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New functions (name, signature, file path, purpose)
|
||||
- Modified functions (exact name, current file path, required changes)
|
||||
- Removed functions (name, file path, reason, migration strategy)
|
||||
|
||||
[Classes]
|
||||
Single sentence describing class modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New classes (name, file path, key methods, inheritance)
|
||||
- Modified classes (exact name, file path, specific modifications)
|
||||
- Removed classes (name, file path, replacement strategy)
|
||||
|
||||
[Dependencies]
|
||||
Single sentence describing dependency modifications.
|
||||
|
||||
Details of new packages, version changes, and integration requirements.
|
||||
|
||||
[Testing]
|
||||
Single sentence describing testing approach.
|
||||
|
||||
Test file requirements, existing test modifications, and validation strategies.
|
||||
|
||||
[Implementation Order]
|
||||
Single sentence describing the implementation sequence.
|
||||
|
||||
Numbered steps showing the logical order of changes to minimize conflicts and ensure successful integration.
|
||||
|
||||
|
||||
## STEP 4: Create Implementation Task
|
||||
|
||||
Use the new_task command to create a task for implementing the plan. The task must include a <task_progress> list that breaks down the implementation into trackable steps.
|
||||
|
||||
### Task Creation Requirements
|
||||
|
||||
Your new task should be self-contained and reference the plan document rather than requiring additional codebase investigation. Include these specific instructions in the task description:
|
||||
|
||||
**Plan Document Navigation Commands:**
|
||||
The implementation agent should use these commands to read specific sections of the implementation plan. You should adapt these examples to conform to the structure of the .md file you created, and explicitly provide them when creating the new task:
|
||||
|
||||
${
|
||||
isPowerShell
|
||||
? `
|
||||
# Read Overview section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Overview\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Types section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Types\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Files section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Files\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Functions section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Functions\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Classes section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Classes\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Dependencies section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Dependencies\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Testing section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Testing\\]').LineNumber; $end = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($end-2)]
|
||||
|
||||
# Read Implementation Order section
|
||||
$content = Get-Content implementation_plan.md; $start = ($content | Select-String -Pattern '\\[Implementation Order\\]').LineNumber; $content[($start-1)..($content.Length-1)]
|
||||
`
|
||||
: `
|
||||
# Read Overview section
|
||||
sed -n '/\\[Overview\\]/,/\\[Types\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Types section
|
||||
sed -n '/\\[Types\\]/,/\\[Files\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Files section
|
||||
sed -n '/\\[Files\\]/,/\\[Functions\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Functions section
|
||||
sed -n '/\\[Functions\\]/,/\\[Classes\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Classes section
|
||||
sed -n '/\\[Classes\\]/,/\\[Dependencies\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Dependencies section
|
||||
sed -n '/\\[Dependencies\\]/,/\\[Testing\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Testing section
|
||||
sed -n '/\\[Testing\\]/,/\\[Implementation Order\\]/p' implementation_plan.md | head -n 1 | cat
|
||||
|
||||
# Read Implementation Order section
|
||||
sed -n '/\\[Implementation Order\\]/,$p' implementation_plan.md | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
**Task Progress Format:**
|
||||
<IMPORTANT>
|
||||
You absolutely must include the task_progress contents in context when creating the new task. When providing it, do not wrap it in XML tags- instead provide it like this:
|
||||
|
||||
|
||||
task_progress Items:
|
||||
- [ ] Step 1: Brief description of first implementation step
|
||||
- [ ] Step 2: Brief description of second implementation step
|
||||
- [ ] Step 3: Brief description of third implementation step
|
||||
- [ ] Step N: Brief description of final implementation step
|
||||
|
||||
|
||||
You also MUST include the path to the markdown file you have created in your new task prompt. You should do this as follows:
|
||||
|
||||
Refer to @path/to/file/markdown.md for a complete breakdown of the task requirements and steps. You should periodically read this file again.
|
||||
|
||||
{{FOCUS_CHAIN_PARAM}}
|
||||
|
||||
|
||||
|
||||
### Mode Switching
|
||||
|
||||
When creating the new task, request a switch to "act mode" if you are currently in "plan mode". This ensures the implementation agent operates in execution mode rather than planning mode.
|
||||
</IMPORTANT>
|
||||
|
||||
## Quality Standards
|
||||
|
||||
You must be specific with exact file paths, function names, and class names. You must be comprehensive and avoid assuming implicit understanding. You must be practical and consider real-world constraints and edge cases. You must use precise technical language and avoid ambiguity.
|
||||
|
||||
Your implementation plan should be detailed enough that another developer could execute it without additional investigation.
|
||||
|
||||
---
|
||||
|
||||
**Execute all four steps in sequence. Your role is to plan thoroughly, not to implement. Code creation begins only after the new task is created and you receive explicit instruction to proceed.**
|
||||
|
||||
Below is the user's input when they indicated that they wanted to create a comprehensive implementation plan.
|
||||
</explicit_instructions>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
import { isGPT51Model } from "@utils/model-utils"
|
||||
import { getShell } from "@utils/shell"
|
||||
import type { SystemPromptContext } from "@/core/prompts/system-prompt/types"
|
||||
import type { DeepPlanningVariant } from "../types"
|
||||
|
||||
/**
|
||||
* Creates the OpenAI GPT-5.1 variant for deep-planning prompt
|
||||
*/
|
||||
export function createGPT51Variant(): DeepPlanningVariant {
|
||||
return {
|
||||
id: "gpt-5",
|
||||
description: "Deep-planning variant optimized for OpenAI GPT-5 models",
|
||||
family: "gpt-5",
|
||||
version: 1,
|
||||
matcher: (context: SystemPromptContext) => {
|
||||
const modelId = context.providerInfo?.model?.id
|
||||
if (!modelId) {
|
||||
return false
|
||||
}
|
||||
return isGPT51Model(modelId)
|
||||
},
|
||||
template: "", // Template is dynamically generated in getDeepPlanningPrompt() based on focus chain settings
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the deep-planning template with shell-specific commands
|
||||
* @param focusChainEnabled Whether focus chain (task_progress) is enabled for this task
|
||||
*/
|
||||
export function generateGPT51Template(focusChainEnabled: boolean): string {
|
||||
const detectedShell = getShell()
|
||||
|
||||
let isPowerShell = false
|
||||
try {
|
||||
isPowerShell =
|
||||
detectedShell != null &&
|
||||
typeof detectedShell === "string" &&
|
||||
(detectedShell.toLowerCase().includes("powershell") || detectedShell.toLowerCase().includes("pwsh"))
|
||||
} catch {}
|
||||
|
||||
return `<explicit_instructions type="deep-planning">
|
||||
Your task is to create a comprehensive implementation plan before writing any code. This process has five distinct steps that must be completed in order:
|
||||
1. Silent Read Investigation
|
||||
2. Silent Terminal Investigation
|
||||
3. Discussion and Questions
|
||||
4. Create Implementation Plan Document
|
||||
5. Create new_task for Implementation Phase
|
||||
|
||||
${focusChainEnabled ? `You should track these five steps in your task_progress parameter, and update it only when steps are completed.` : ""}
|
||||
Your behavior should be methodical and thorough - take time to understand the codebase completely before making any recommendations. The quality of your investigation and use of targeted reads/searches directly impacts the success of the implementation.
|
||||
|
||||
<IMPORTANT>
|
||||
Execute only exploration and plan generation steps until explicitly instructed by the user to proceed with coding.
|
||||
You must thoroughly understand the existing codebase before proposing any changes.
|
||||
Perform your research without commentary or narration. Execute commands and read files without explaining what you're about to do. Only speak up if you have specific questions for the user.
|
||||
</IMPORTANT>
|
||||
|
||||
## STEP 1: Silent Read Investigation
|
||||
|
||||
### Required Research Activities
|
||||
You MUST first use the read_file tool to examine several source files, configuration files, and documentation to better inform subsequent research steps. You should only use read_file to prepare for more granular searching. Use this step to get the big picture, you will use the next step for granular details. Use this tool to determine the language(s) used in the codebase, and to identify the domain(s) relevant to the user's request.
|
||||
|
||||
|
||||
## STEP 2: Silent Terminal Investigation
|
||||
|
||||
### Required Research Activities
|
||||
You MUST use terminal commands to gather information about the codebase structure and patterns relevant to the user's request.
|
||||
You will tailor these commands to explore and identify key functions, classes, methods, types, and variables that are directly, or indirectly related to the task.
|
||||
These commands must be crafted to not produce exceptionally long or verbose search results. For example, you should exclude dependency folders such as node_modules, venv or php vendor, etc. Carefully consider the scope of search patterns. Use the results of your read_file tool calls to tailor the commands for balanced search result lengths. If a command returns no results, you may loosen the search patterns or scope slightly. If a command returns hundreds or thousands of results, you should adjust subsequent commands to be more targeted.
|
||||
Execute these commands to build your understanding. Adjust subsequent commands based on the output you have received from each previous command, informing the scope and direction of your search.
|
||||
You should only execute one command at a time for the first 1-3 commands. Do not chain search commands until you have executed and interpreted the results of several search commands, then use the context you have gathered to inform more complex chained commands.
|
||||
|
||||
Here are some example commands, remember to adjust them as instructed previously:
|
||||
${
|
||||
isPowerShell
|
||||
? // PowerShell-specific commands
|
||||
`
|
||||
# Discover project structure and file types
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-Object -First 30 | Select-Object FullName
|
||||
|
||||
# Find all class and function definitions
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "class|function|def|interface|struct"
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp" | Select-String -Pattern "import|from|require|#include" | Sort-Object | Get-Unique
|
||||
|
||||
# Find dependency manifests
|
||||
Get-ChildItem -Recurse -Include "requirements*.txt","package.json","Cargo.toml","pom.xml","Gemfile","go.mod" | Get-Content
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
Get-ChildItem -Recurse -Include "*.py","*.js","*.ts","*.java","*.cpp","*.go" | Select-String -Pattern "TODO|FIXME|XXX|HACK|NOTE"
|
||||
`
|
||||
: // bash/zsh-specific commands
|
||||
`
|
||||
# Discover project structure and file types
|
||||
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.java" -o -name "*.cpp" -o -name "*.go" | head -30 | cat
|
||||
|
||||
# Find all class and function definitions
|
||||
grep -r "class\\|function\\|def\\|interface\\|struct\\|func\\|type.*struct\\|type.*interface" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
|
||||
# Analyze import patterns and dependencies
|
||||
grep -r "import\\|from\\|require\\|#include" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" . | sort | uniq | cat
|
||||
|
||||
# Find dependency manifests
|
||||
find . -name "requirements*.txt" -o -name "package.json" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "Gemfile" -o -name "go.mod" | xargs cat
|
||||
|
||||
# Identify technical debt and TODOs
|
||||
grep -r "TODO\\|FIXME\\|XXX\\|HACK\\|NOTE" --include="*.py" --include="*.js" --include="*.ts" --include="*.java" --include="*.cpp" --include="*.go" . | cat
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
## STEP 3: Discussion and Questions
|
||||
|
||||
Ask the user brief, targeted questions that will influence your implementation plan. Keep your questions concise and conversational. Ask only essential questions needed to create an accurate plan.
|
||||
|
||||
**Ask questions only when necessary for:**
|
||||
- Clarifying ambiguous requirements or unclear specifications
|
||||
- Choosing between multiple equally valid implementation approaches that have significant trade-offs
|
||||
- Confirming non-trivial assumptions about existing system behavior or constraints
|
||||
- Understanding preferences for specific technical decisions that will affect the final implementation's behavior or code maintainability
|
||||
|
||||
Your questions should be direct and specific. Avoid long explanations or multiple questions in one response. Only ask one question at a time. You may ask several questions if required and within scope of the task.
|
||||
|
||||
## STEP 4: Create Implementation Plan Document
|
||||
|
||||
Once you have obtained sufficient context to understand all code modifications that will be required, create a structured markdown document containing your complete implementation plan. The document must follow this exact format with clearly marked sections:
|
||||
|
||||
### Document Structure Requirements
|
||||
|
||||
Your implementation plan must be saved as implementation_plan.md, and *must* be structured as follows:
|
||||
|
||||
<example_implementation_plan>
|
||||
# Implementation Plan
|
||||
|
||||
[Overview]
|
||||
Single sentence describing the overall goal.
|
||||
|
||||
Multiple paragraphs outlining the scope, context, and high-level approach. Explain why this implementation is needed and how it fits into the existing system.
|
||||
|
||||
[Types]
|
||||
Single sentence describing the type system changes.
|
||||
|
||||
Detailed type definitions, interfaces, enums, or data structures with complete specifications. Include field names, types, validation rules, and relationships.
|
||||
|
||||
[Files]
|
||||
Single sentence describing file modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New files to be created (with full paths and purpose)
|
||||
- Existing files to be modified (with specific changes)
|
||||
- Files to be deleted or moved
|
||||
- Configuration file updates
|
||||
|
||||
[Functions]
|
||||
Single sentence describing function modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New functions (name, signature, file path, purpose)
|
||||
- Modified functions (exact name, current file path, required changes)
|
||||
- Removed functions (name, file path, reason, migration strategy)
|
||||
|
||||
[Classes]
|
||||
Single sentence describing class modifications.
|
||||
|
||||
Detailed breakdown:
|
||||
- New classes (name, file path, key methods, inheritance)
|
||||
- Modified classes (exact name, file path, specific modifications)
|
||||
- Removed classes (name, file path, replacement strategy)
|
||||
|
||||
[Dependencies]
|
||||
Single sentence describing dependency modifications.
|
||||
|
||||
Details of new packages, version changes, and integration requirements.
|
||||
|
||||
[Implementation Order]
|
||||
Single sentence describing the implementation sequence.
|
||||
|
||||
Numbered steps showing the logical order of changes to minimize conflicts and ensure successful integration.
|
||||
${focusChainEnabled ? "A task_progress list of steps that will need to be completed during the implementation" : ""}
|
||||
|
||||
</example_implementation_plan>
|
||||
|
||||
## STEP 5: Create Implementation new_task
|
||||
|
||||
Use the new_task command to create a task for implementing the plan. ${focusChainEnabled ? "The task must include a <task_progress> list that breaks down the implementation into trackable steps." : ""}
|
||||
|
||||
### Task Creation Requirements
|
||||
|
||||
<IMPORTANT>
|
||||
**Standalone Product:**
|
||||
Your new task should be self-contained and reference the plan document rather than requiring additional codebase investigation. Include these specific instructions in the task description:
|
||||
|
||||
${
|
||||
focusChainEnabled
|
||||
? `**Task Progress Format:**
|
||||
You absolutely MUST include the task_progress contents in context when creating the new task. When providing it, do not wrap it in XML tags- instead provide it like this:
|
||||
|
||||
task_progress Items:
|
||||
- [ ] Step 1: Brief description of first implementation step
|
||||
- [ ] Step 2: Brief description of second implementation step
|
||||
- [ ] Step 3: Brief description of third implementation step
|
||||
- [ ] Step N: Brief description of subsequent/final implementation step(s)
|
||||
|
||||
**Markdown Implementation Plan Path:**
|
||||
You also MUST include the path to the markdown file you have created in your new task prompt. You should do this as follows:
|
||||
Refer to @path/to/file/markdown.md for a complete breakdown of the task requirements and steps. You should periodically read this file again.`
|
||||
: ""
|
||||
}
|
||||
</IMPORTANT>
|
||||
|
||||
|
||||
### Mode Switching
|
||||
|
||||
<IMPORTANT>
|
||||
When creating the new task, request a switch to "act mode" if you are currently in "plan mode". This ensures the implementation agent operates in execution mode rather than planning mode.
|
||||
</IMPORTANT>
|
||||
|
||||
## Quality Standards
|
||||
|
||||
You must be specific with exact file paths, function names, and class names. You must be comprehensive and avoid assuming implicit understanding. You must be practical and consider real-world constraints and edge cases. You must use precise technical language and avoid ambiguity.
|
||||
|
||||
Your implementation plan should be detailed enough that another developer could execute it without additional investigation.
|
||||
|
||||
---
|
||||
|
||||
**Execute all five steps in sequence. Your role is to plan thoroughly, not to implement. Code creation begins only after the new task is created and you receive explicit instruction to proceed.**
|
||||
|
||||
Below is the user's input from when they indicated that they wanted to create this comprehensive implementation plan.
|
||||
</explicit_instructions>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Export for all deep-planning prompt variants
|
||||
*/
|
||||
|
||||
export { createAnthropicVariant } from "./anthropic"
|
||||
export { createGeminiVariant } from "./gemini"
|
||||
export { createGenericVariant } from "./generic"
|
||||
export { createGPT51Variant } from "./gpt5"
|
||||
@@ -249,6 +249,9 @@ Otherwise, if you have not completed the task and do not need additional informa
|
||||
cursorRulesLocalDirectoryInstructions: (cwd: string, content: string) =>
|
||||
`# .cursor/rules\n\nThe following is provided by a root-level .cursor/rules directory where the user has specified instructions for this working directory (${cwd.toPosix()})\n\n${content}`,
|
||||
|
||||
agentsRulesLocalFileInstructions: (cwd: string, content: string) =>
|
||||
`# AGENTS.md\n\nThe following is provided by AGENTS.md files found recursively throughout this working directory (${cwd.toPosix()}) where the user has specified instructions. Nested AGENTS.md will be combined below, and you should only apply the instructions for each AGENTS.md file that is directly applicable to the current task, i.e. if you are reading or writing to a file in that directory.\n\n${content}`,
|
||||
|
||||
fileContextWarning: (editedFiles: string[]): string => {
|
||||
const fileCount = editedFiles.length
|
||||
const fileVerb = fileCount === 1 ? "file has" : "files have"
|
||||
|
||||
@@ -63,6 +63,7 @@ describe("PromptRegistry", () => {
|
||||
{ id: "gpt-5", provider: "cline", expected: ModelFamily.NATIVE_GPT_5, useNativeTools: true },
|
||||
{ id: "gpt-5", provider: "openai-native", expected: ModelFamily.NATIVE_GPT_5, useNativeTools: true },
|
||||
{ id: "gpt-5", provider: "cline", expected: ModelFamily.GPT_5, useNativeTools: false },
|
||||
{ id: "gpt-5-1", provider: "openai-native", expected: ModelFamily.NATIVE_GPT_5_1, useNativeTools: true },
|
||||
{ id: "openai/gpt-5", expected: ModelFamily.NEXT_GEN },
|
||||
{ id: "unknown-model", expected: ModelFamily.GENERIC },
|
||||
]
|
||||
|
||||
+31
-42
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -182,7 +182,7 @@ Description: Fetches content from a specified URL and processes into markdown
|
||||
- This tool is read-only and does not modify any files
|
||||
Parameters:
|
||||
- url: (required) The URL to fetch content from
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<web_fetch>
|
||||
<url>https://example.com/docs</url>
|
||||
@@ -195,7 +195,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -214,7 +214,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -227,7 +227,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -454,16 +454,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -582,32 +597,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, use the browser, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
+31
-42
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -148,7 +148,7 @@ Description: Fetches content from a specified URL and processes into markdown
|
||||
- This tool is read-only and does not modify any files
|
||||
Parameters:
|
||||
- url: (required) The URL to fetch content from
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<web_fetch>
|
||||
<url>https://example.com/docs</url>
|
||||
@@ -161,7 +161,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -180,7 +180,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -193,7 +193,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -420,16 +420,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -548,32 +563,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
+31
-42
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -182,7 +182,7 @@ Description: Fetches content from a specified URL and processes into markdown
|
||||
- This tool is read-only and does not modify any files
|
||||
Parameters:
|
||||
- url: (required) The URL to fetch content from
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<web_fetch>
|
||||
<url>https://example.com/docs</url>
|
||||
@@ -195,7 +195,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -214,7 +214,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -227,7 +227,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -454,16 +454,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -562,32 +577,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, use the browser, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
+13
-6
@@ -6,16 +6,23 @@ You have access to a set of tools that are executed upon the user's approval. Yo
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
**How to use task_progress:**
|
||||
- include the task_progress parameter in your tool calls to provide an updated checklist
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- The task_progress parameter MUST be included as a separate parameter in the tool, it should not be included inside other content or argument blocks.
|
||||
|
||||
====
|
||||
|
||||
|
||||
+13
-6
@@ -6,16 +6,23 @@ You have access to a set of tools that are executed upon the user's approval. Yo
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
**How to use task_progress:**
|
||||
- include the task_progress parameter in your tool calls to provide an updated checklist
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- The task_progress parameter MUST be included as a separate parameter in the tool, it should not be included inside other content or argument blocks.
|
||||
|
||||
====
|
||||
|
||||
|
||||
+13
-6
@@ -6,16 +6,23 @@ You have access to a set of tools that are executed upon the user's approval. Yo
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
**How to use task_progress:**
|
||||
- include the task_progress parameter in your tool calls to provide an updated checklist
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- The task_progress parameter MUST be included as a separate parameter in the tool, it should not be included inside other content or argument blocks.
|
||||
|
||||
====
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -177,7 +177,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -196,7 +196,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -209,7 +209,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -436,16 +436,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -564,32 +579,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, use the browser, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
+30
-41
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -143,7 +143,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -162,7 +162,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -175,7 +175,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -402,16 +402,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -530,32 +545,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -177,7 +177,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -196,7 +196,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -209,7 +209,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -436,16 +436,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -544,32 +559,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, use the browser, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -182,7 +182,7 @@ Description: Fetches content from a specified URL and processes into markdown
|
||||
- This tool is read-only and does not modify any files
|
||||
Parameters:
|
||||
- url: (required) The URL to fetch content from
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<web_fetch>
|
||||
<url>https://example.com/docs</url>
|
||||
@@ -195,7 +195,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -214,7 +214,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -227,7 +227,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -454,16 +454,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -582,32 +597,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, use the browser, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
+31
-42
@@ -42,7 +42,7 @@ Usage:
|
||||
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string. Do NOT use this tool to list the contents of a directory. Only use this tool on files.
|
||||
Parameters:
|
||||
- path: (required) The path of the file to read (relative to the current working directory /test/project)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<read_file>
|
||||
<path>File path here</path>
|
||||
@@ -54,7 +54,7 @@ Description: Request to write content to a file at the specified path. If the fi
|
||||
Parameters:
|
||||
- path: (required) The path of the file to write to (relative to the current working directory /test/project)
|
||||
- content: (required) The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions. You MUST include ALL parts of the file, even if they haven't been modified.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<write_to_file>
|
||||
<path>File path here</path>
|
||||
@@ -90,7 +90,7 @@ Parameters:
|
||||
4. Special operations:
|
||||
* To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location)
|
||||
* To delete code: Use empty REPLACE section
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<replace_in_file>
|
||||
<path>File path here</path>
|
||||
@@ -104,7 +104,7 @@ Parameters:
|
||||
- path: (required) The path of the directory to search in (relative to the current working directory /test/project). This directory will be recursively searched.
|
||||
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
|
||||
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<search_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -118,7 +118,7 @@ Description: Request to list files and directories within the specified director
|
||||
Parameters:
|
||||
- path: (required) The path of the directory to list contents for (relative to the current working directory /test/project)
|
||||
- recursive: (optional) Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_files>
|
||||
<path>Directory path here</path>
|
||||
@@ -130,7 +130,7 @@ Usage:
|
||||
Description: Request to list definition names (classes, functions, methods, etc.) used in source code files at the top level of the specified directory. This tool provides insights into the codebase structure and important constructs, encapsulating high-level concepts and relationships that are crucial for understanding the overall architecture.
|
||||
Parameters:
|
||||
- path: (required) The path of the directory (relative to the current working directory /test/project) to list top level source code definitions for.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<list_code_definition_names>
|
||||
<path>Directory path here</path>
|
||||
@@ -148,7 +148,7 @@ Description: Fetches content from a specified URL and processes into markdown
|
||||
- This tool is read-only and does not modify any files
|
||||
Parameters:
|
||||
- url: (required) The URL to fetch content from
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<web_fetch>
|
||||
<url>https://example.com/docs</url>
|
||||
@@ -161,7 +161,7 @@ Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the tool
|
||||
- tool_name: (required) The name of the tool to execute
|
||||
- arguments: (required) A JSON object containing the tool's input parameters, following the tool's input schema
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<use_mcp_tool>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -180,7 +180,7 @@ Description: Request to access a resource provided by a connected MCP server. Re
|
||||
Parameters:
|
||||
- server_name: (required) The name of the MCP server providing the resource
|
||||
- uri: (required) The URI identifying the specific resource to access
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<access_mcp_resource>
|
||||
<server_name>server name here</server_name>
|
||||
@@ -193,7 +193,7 @@ Description: Ask the user a question to gather additional information needed to
|
||||
Parameters:
|
||||
- question: (required) The question to ask the user. This should be a clear, specific question that addresses the information you need.
|
||||
- options: (optional) An array of 2-5 options for the user to choose from. Each option should be a string describing a possible answer. You may not always need to provide options, but it may be helpful in many cases where it can save the user from having to type out a response manually. IMPORTANT: NEVER include an option to toggle to Act mode, as this would be something you need to direct the user to do manually themselves if needed.
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. (See 'Updating Task Progress' section for more details)
|
||||
- task_progress: (optional) A checklist showing task progress after this tool use is completed. The task_progress parameter must be included as a separate parameter inside of the parent tool call, it must be separate from other parameters such as content, arguments, etc. (See 'UPDATING TASK PROGRESS' section for more details)
|
||||
Usage:
|
||||
<ask_followup_question>
|
||||
<question>Your question here</question>
|
||||
@@ -420,16 +420,31 @@ By waiting for and carefully considering the user's response after each tool use
|
||||
|
||||
====
|
||||
|
||||
AUTOMATIC TODO LIST MANAGEMENT
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
The system automatically manages todo lists to help track task progress:
|
||||
You can track and communicate your progress on the overall task using the task_progress parameter supported by every tool call. Using task_progress ensures you remain on task, and stay focused on completing the user's objective. This parameter can be used in any mode, and with any tool call.
|
||||
|
||||
- Every 10th API request, you will be prompted to review and update the current todo list if one exists
|
||||
- When switching from PLAN MODE to ACT MODE, you should create a comprehensive todo list for the task
|
||||
- When switching from PLAN MODE to ACT MODE, you must create a comprehensive todo list for the task using the task_progress parameter
|
||||
- Todo list updates should be done silently using the task_progress parameter - do not announce these updates to the user
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- The system will automatically include todo list context in your prompts when appropriate
|
||||
- Focus on creating actionable, meaningful steps rather than granular technical details
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your task_progress parameter.
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
- The system will automatically include todo list context in your prompts when appropriate - these reminders are important.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
@@ -548,32 +563,6 @@ In each user message, the environment_details will specify the current mode. The
|
||||
|
||||
====
|
||||
|
||||
UPDATING TASK PROGRESS
|
||||
|
||||
Every tool use supports an optional task_progress parameter that allows you to provide an updated checklist to keep the user informed of your overall progress on the task. This should be used regularly throughout the task to keep the user informed of completed and remaining steps. Before using the attempt_completion tool, ensure the final checklist item is checked off to indicate task completion.
|
||||
|
||||
- You probably wouldn't use this while in PLAN mode until the user has approved your plan and switched you to ACT mode.
|
||||
- Use standard Markdown checklist format: "- [ ]" for incomplete items and "- [x]" for completed items
|
||||
- Provide the whole checklist of steps you intend to complete in the task, and keep the checkboxes updated as you make progress. It's okay to rewrite this checklist as needed if it becomes invalid due to scope changes or new information.
|
||||
- Keep items focused on meaningful progress milestones rather than minor technical details. The checklist should not be so granular that minor implementation details clutter the progress tracking.
|
||||
- If you are creating this checklist for the first time, and the tool use completes the first step in the checklist, make sure to mark it as completed in your parameter input since this checklist will be displayed after this tool use is completed.
|
||||
- For simple tasks, short checklists with even a single item are acceptable. For complex tasks, avoid making the checklist too long or verbose.
|
||||
- If a checklist is being used, be sure to update it any time a step has been completed.
|
||||
|
||||
Example:
|
||||
<execute_command>
|
||||
<command>npm install react</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
<task_progress>
|
||||
- [x] Set up project structure
|
||||
- [x] Install dependencies
|
||||
- [ ] Create components
|
||||
- [ ] Test application
|
||||
</task_progress>
|
||||
</execute_command>
|
||||
|
||||
====
|
||||
|
||||
CAPABILITIES
|
||||
|
||||
- You have access to tools that let you execute CLI commands on the user's computer, list files, view source code definitions, regex search, read and edit files, and ask follow-up questions. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user