Glossary and references
源码版本v4.0.10
This page is the terminology index and source-code map for the Cline architecture site. Each entry gives the English term, a one-line explanation, and points to a specific location in the source, so other pages can cross-reference it.
Core terms
| Term | English | Notes |
|---|---|---|
| Task | Task | The per-turn agent state machine; holds message history, the tool coordinator, and the checkpoint manager. apps/vscode/src/core/task/index.ts:188 export class Task |
| Tool call | tool_use | A tool-call block in the Anthropic message protocol; parsed from LLM output into tool name + input and dispatched by ToolExecutor to the matching handler |
| Recursive request | recursivelyMakeClineRequests | The Task's main loop driver: send API → parse → feed tools → recurse to the next round. apps/vscode/src/core/task/index.ts:2790 |
| Present assistant message | presentAssistantMessage | Flushes parsed assistant blocks to the webview one by one, with a lock guarding against concurrent refresh. apps/vscode/src/core/task/index.ts:2630 |
| API request | attemptApiRequest | An async generator that packs user content and hands it to the ApiHandler, yielding streamed tokens. apps/vscode/src/core/task/index.ts:2175 |
| Message parsing | parseAssistantMessageV2 | Slices the LLM text stream into text / tool_use / reasoning blocks and recognizes SEARCH/REPLACE diff boundaries. apps/vscode/src/core/assistant-message/parse-assistant-message.ts:28 |
| Search/replace diff | SEARCH/REPLACE | The multi-file edit format Cline uses: three markers ------- SEARCH / ======= / +++++++ REPLACE. apps/vscode/src/core/assistant-message/diff.ts:1-3 |
| Plan/act mode | plan / act mode | plan mode only plans and does not write files; act mode actually executes tools. apps/vscode/src/shared/storage/types.ts:14 export type Mode = "plan" | "act" |
| Context management | ContextManager | Monitors conversation token usage and triggers truncation / compression / cleanup. apps/vscode/src/core/context/context-management/ContextManager.ts:44 |
| MCP hub | McpHub | Connects to external MCP servers and exposes their tools / resources / prompts to Cline. apps/vscode/src/services/mcp/McpHub.ts:51 |
| Sub-agent | SubagentRunner | Runs sub-tasks in an isolated sub-session with its own message history and tool set. apps/vscode/src/core/task/tools/subagent/SubagentRunner.ts:254 |
| Provider handler | ApiHandler | The LLM vendor adapter interface; buildApiHandler routes by config to Anthropic / OpenAI and so on. apps/vscode/src/core/api/index.ts:517 |
| Prompt builder | PromptBuilder | Assembles the system prompt and tool definitions by model variant. apps/vscode/src/core/prompts/system-prompt/registry/PromptBuilder.ts:12 |
| Tool set | ClineToolSet | A set of tools registered by ModelFamily; one variant maps to one set of available tools. apps/vscode/src/core/prompts/system-prompt/registry/ClineToolSet.ts:8 |
| State manager | StateManager | Persists and reads global config, settings, and task history. apps/vscode/src/core/storage/StateManager.ts:58 |
| Checkpoint | Checkpoint | A task replay unit — one commit in the shadow git — attached to a checkpoint_created message. apps/vscode/src/integrations/checkpoints/CheckpointTracker.ts:50 |
Directory conventions
- Source repo:
cline/cline, tagv4.0.10. - Main code locations:
apps/vscode/src/— the VS Code extension itself;sdk/is the cross-platform SDK;evals/holds evaluations;packages/holds shared sub-packages. - Extension entry:
apps/vscode/src/extension.ts. - Task core:
apps/vscode/src/core/task/index.ts— the Task class, the recursion loop, attemptApiRequest, and presentAssistantMessage all live here. - Tool implementations:
apps/vscode/src/core/task/tools/— the handlers directory splits tools by file; subagent/ holds the sub-agent implementation. - Checkpoints:
apps/vscode/src/integrations/checkpoints/— the full shadow-git stack lives here. - Prompts:
apps/vscode/src/core/prompts/system-prompt/— system prompt templates organized by variant. - User data: VS Code globalState / workspaceState plus local files under globalStorage (checkpoint shadow git, task history, rule files, etc.).
Official resources
- Cline docs
- Cline GitHub (tag v4.0.10)
Source versions on this site are pinned to v4.0.10; line numbers refer to that tag.