@ddlqhd/agent-sdk 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +2 -1
  2. package/dist/{chunk-742JTNYI.js → chunk-D3UZNLZO.js} +570 -77
  3. package/dist/chunk-D3UZNLZO.js.map +1 -0
  4. package/dist/{chunk-AJD3DTL7.cjs → chunk-JXAJQGV5.cjs} +756 -107
  5. package/dist/chunk-JXAJQGV5.cjs.map +1 -0
  6. package/dist/{chunk-DQFTAD3I.cjs → chunk-NYZD3THB.cjs} +573 -76
  7. package/dist/chunk-NYZD3THB.cjs.map +1 -0
  8. package/dist/{chunk-Q3L4GIBG.cjs → chunk-P2X3AMDK.cjs} +115 -117
  9. package/dist/chunk-P2X3AMDK.cjs.map +1 -0
  10. package/dist/{chunk-THKEF32L.js → chunk-TKUPLTGJ.js} +110 -114
  11. package/dist/chunk-TKUPLTGJ.js.map +1 -0
  12. package/dist/{chunk-DXMVWGLJ.js → chunk-UHENMHUS.js} +744 -100
  13. package/dist/chunk-UHENMHUS.js.map +1 -0
  14. package/dist/cli/index.cjs +40 -31
  15. package/dist/cli/index.cjs.map +1 -1
  16. package/dist/cli/index.js +14 -5
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/{index-DGPDMbW5.d.cts → index-CnrY1ZA2.d.ts} +36 -14
  19. package/dist/{index-nEfayAzD.d.ts → index-DzBt4ewK.d.cts} +36 -14
  20. package/dist/index.cjs +128 -88
  21. package/dist/index.d.cts +42 -22
  22. package/dist/index.d.ts +42 -22
  23. package/dist/index.js +3 -3
  24. package/dist/models/index.cjs +14 -10
  25. package/dist/models/index.d.cts +7 -2
  26. package/dist/models/index.d.ts +7 -2
  27. package/dist/models/index.js +1 -1
  28. package/dist/tools/index.cjs +65 -57
  29. package/dist/tools/index.d.cts +3 -3
  30. package/dist/tools/index.d.ts +3 -3
  31. package/dist/tools/index.js +1 -1
  32. package/dist/{types-BLf9IqRs.d.cts → types-BUwjMwNH.d.cts} +279 -13
  33. package/dist/{types-BLf9IqRs.d.ts → types-BUwjMwNH.d.ts} +279 -13
  34. package/package.json +11 -11
  35. package/dist/chunk-742JTNYI.js.map +0 -1
  36. package/dist/chunk-AJD3DTL7.cjs.map +0 -1
  37. package/dist/chunk-DQFTAD3I.cjs.map +0 -1
  38. package/dist/chunk-DXMVWGLJ.js.map +0 -1
  39. package/dist/chunk-Q3L4GIBG.cjs.map +0 -1
  40. package/dist/chunk-THKEF32L.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { S as StorageConfig, M as Message, a as SessionInfo, b as StorageAdapter, T as ToolResult, c as ToolDefinition, A as AgentConfig, d as SystemPrompt, e as StreamEvent, f as AgentResult, g as ModelAdapter, h as MCPServerConfig, i as SessionTokenUsage, j as TokenUsage, k as StreamChunk, P as ParsedSkill, l as MemoryConfig } from './types-BLf9IqRs.js';
2
- export { m as AgentCallbacks, n as AgentModelConfig, o as AskUserQuestionAnswer, p as AskUserQuestionItem, q as AskUserQuestionResolver, r as AssistantMessage, C as CLIConfig, s as CanUseToolCallback, t as ChatOptions, u as CommandHookConfig, v as CompletionResult, w as ContentPart, x as ContextManagerConfig, y as CreateAskUserQuestionToolOptions, F as FlatCommandHookEntry, z as FunctionHook, H as HookContext, B as HookEventType, D as HookGroupConfig, E as HookManager, G as HookResult, I as HooksSettings, J as HooksSettingsFile, K as ImageContent, L as MCPOptions, N as MCPPromptArgument, O as MCPResourceContent, Q as MessageRole, R as ModelCapabilities, U as ModelParams, V as RunOptions, W as SessionListOptions, X as SkillConfig, Y as SkillDefinition, Z as SkillMetadata, _ as SkillOptions, $ as StreamChunkType, a0 as StreamEventAnnotations, a1 as StreamEventType, a2 as SystemMessage, a3 as SystemPromptConfig, a4 as TextContent, a5 as ThinkingContent, a6 as ToolCall, a7 as ToolExecutionContext, a8 as ToolExecutionPolicy, a9 as ToolHandler, aa as ToolListOptions, ab as ToolMessage, ac as ToolResultMetadata, ad as ToolSchema, ae as UserMessage, af as buildHookEnv, ag as createAskUserQuestionTool, ah as createFunctionHook, ai as formatAnswerSummary, aj as formatAskUserQuestionPrompt, ak as getInteractionTools, al as matchTool, am as mergeCommandHookLayers, an as questionTool } from './types-BLf9IqRs.js';
3
- import { T as ToolRegistry, S as SkillRegistry } from './index-nEfayAzD.js';
4
- export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, a as SkillLoader, b as SkillLoaderConfig, c as SubagentRequest, d as SubagentRunner, e as ToolExecuteOptions, f as ToolRegistryConfig, g as agentTool, h as bashTool, i as createAgentTool, j as createSkillLoader, k as createSkillRegistry, l as createSkillTool, m as createTool, n as editTool, o as getAllBuiltinTools, p as getFileSystemTools, q as getGlobalRegistry, r as getGrepTools, s as getSafeBuiltinTools, t as getShellTools, u as getSkillTools, v as getSubagentTools, w as getTaskTools, x as getWebTools, y as globTool, z as grepTool, A as loadHooksSettingsFromProject, B as loadHooksSettingsFromUser, E as parseHooksSettingsFile, F as readFileTool, G as subagentRequestSchema, H as taskCreateTool, I as taskListTool, J as taskUpdateTool, K as truncateMatchLineForDisplay, L as webFetchTool, N as webSearchTool, O as writeFileTool } from './index-nEfayAzD.js';
5
- export { AnthropicAdapter, AnthropicConfig, AnthropicFetchRetryOptions, CreateModelConfig, ModelProvider, OllamaAdapter, OllamaConfig, OpenAIAdapter, OpenAIConfig, createAnthropic, createModel, createOllama, createOpenAI } from './models/index.js';
1
+ import { S as StorageConfig, M as Message, a as SessionInfo, b as StorageAdapter, c as MCPServerConfig, T as ToolResult, d as ToolDefinition, A as AgentConfig, e as SystemPrompt, f as StreamEvent, g as AgentResult, h as ModelAdapter, i as SessionTokenUsage, j as SDKLogger, L as LogEvent, k as TokenUsage, l as StreamChunk, P as ParsedSkill, m as MemoryConfig } from './types-BUwjMwNH.js';
2
+ export { n as AgentCallbacks, o as AgentErrorContext, p as AgentLifecycleCallbacks, q as AgentModelConfig, r as AgentRunContext, s as AgentRunEndContext, t as AgentRunEndReason, u as AgentRunStartContext, v as AskUserQuestionAnswer, w as AskUserQuestionItem, x as AskUserQuestionResolver, y as AssistantMessage, C as CLIConfig, z as CanUseToolCallback, B as ChatOptions, D as CommandHookConfig, E as CompletionResult, F as ContentPart, G as ContextManagerConfig, H as CreateAskUserQuestionToolOptions, I as FlatCommandHookEntry, J as FunctionHook, K as HookContext, N as HookDecisionContext, O as HookEventType, Q as HookGroupConfig, R as HookManager, U as HookObservationContext, V as HookResult, W as HooksSettings, X as HooksSettingsFile, Y as ImageContent, Z as LogRedactionConfig, _ as MCPOptions, $ as MCPPromptArgument, a0 as MCPResourceContent, a1 as MODEL_STREAM_EVENT_TYPES, a2 as MessageObservationContext, a3 as MessageRole, a4 as ModelCapabilities, a5 as ModelParams, a6 as ModelRequestStartContext, a7 as RunOptions, a8 as SDKLogLevel, a9 as SessionListOptions, aa as SkillConfig, ab as SkillDefinition, ac as SkillMetadata, ad as SkillOptions, ae as StreamChunkType, af as StreamEventAnnotations, ag as StreamEventType, ah as SystemMessage, ai as SystemMessageSource, aj as SystemPromptConfig, ak as TextContent, al as ThinkingContent, am as ToolCall, an as ToolExecutionBaseContext, ao as ToolExecutionContext, ap as ToolExecutionEndContext, aq as ToolExecutionPolicy, ar as ToolHandler, as as ToolHookObserver, at as ToolListOptions, au as ToolMessage, av as ToolResultMetadata, aw as ToolResultObservationContext, ax as ToolSchema, ay as UserMessage, az as UserMessageSource, aA as buildHookEnv, aB as createAskUserQuestionTool, aC as createFunctionHook, aD as formatAnswerSummary, aE as formatAskUserQuestionPrompt, aF as getInteractionTools, aG as isModelStreamEventType, aH as matchTool, aI as mergeCommandHookLayers, aJ as questionTool } from './types-BUwjMwNH.js';
3
+ import { T as ToolRegistry, S as SkillRegistry } from './index-CnrY1ZA2.js';
4
+ export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, a as SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES, b as SUBAGENT_TYPES, c as SkillLoader, d as SkillLoaderConfig, e as SubagentRequest, f as SubagentRunner, g as SubagentType, h as ToolExecuteOptions, i as ToolRegistryConfig, j as agentTool, k as bashTool, l as createAgentTool, m as createSkillLoader, n as createSkillRegistry, o as createSkillTool, p as createTool, q as editTool, r as getAllBuiltinTools, s as getFileSystemTools, t as getGlobalRegistry, u as getGrepTools, v as getPlanningTools, w as getSafeBuiltinTools, x as getShellTools, y as getSkillTools, z as getSubagentTools, A as getWebTools, B as globTool, E as grepTool, F as loadHooksSettingsFromProject, G as loadHooksSettingsFromUser, H as parseHooksSettingsFile, I as readFileTool, J as resolveSubagentTypeAppend, K as subagentExploreDefaultsUnavailableMessage, L as subagentRequestSchema, N as todoWriteTool, O as truncateMatchLineForDisplay, P as webFetchTool, Q as webSearchTool, R as writeFileTool } from './index-CnrY1ZA2.js';
5
+ export { AnthropicAdapter, AnthropicConfig, AnthropicFetchRetryOptions, CreateModelConfig, DEFAULT_ADAPTER_CAPABILITIES, ModelProvider, OllamaAdapter, OllamaConfig, OpenAIAdapter, OpenAIConfig, createAnthropic, createModel, createOllama, createOpenAI } from './models/index.js';
6
6
  import 'zod';
7
7
 
8
8
  /** Published package version, read from package root `package.json`. */
@@ -76,18 +76,6 @@ declare class SessionManager {
76
76
  */
77
77
  declare function createSessionManager(config?: StorageConfig): SessionManager;
78
78
 
79
- interface StdioMCPConfig {
80
- name: string;
81
- command: string;
82
- args?: string[];
83
- env?: Record<string, string>;
84
- }
85
- interface HttpMCPConfig {
86
- name: string;
87
- url: string;
88
- headers?: Record<string, string>;
89
- }
90
- type MCPClientConfig = StdioMCPConfig | HttpMCPConfig;
91
79
  interface MCPTool {
92
80
  name: string;
93
81
  description?: string;
@@ -123,7 +111,7 @@ declare class MCPClient {
123
111
  private _connected;
124
112
  private _tools;
125
113
  private _serverInfo?;
126
- constructor(config: MCPClientConfig);
114
+ constructor(config: MCPServerConfig);
127
115
  connect(): Promise<void>;
128
116
  disconnect(): Promise<void>;
129
117
  listTools(): Promise<MCPTool[]>;
@@ -142,12 +130,12 @@ declare class MCPClient {
142
130
  } | undefined;
143
131
  get tools(): MCPTool[];
144
132
  }
145
- declare function createMCPClient(config: MCPClientConfig): MCPClient;
133
+ declare function createMCPClient(config: MCPServerConfig): MCPClient;
146
134
 
147
135
  declare class MCPAdapter {
148
136
  private clients;
149
137
  private toolMap;
150
- addServer(config: MCPClientConfig): Promise<void>;
138
+ addServer(config: MCPServerConfig): Promise<void>;
151
139
  removeServer(name: string): Promise<void>;
152
140
  getToolDefinitions(): ToolDefinition[];
153
141
  executeTool(fullName: string, args: unknown): Promise<ToolResult>;
@@ -161,6 +149,8 @@ declare class MCPAdapter {
161
149
  }
162
150
  declare function createMCPAdapter(): MCPAdapter;
163
151
 
152
+ /** Default upper bound for model↔tool rounds per user turn when `AgentConfig.maxIterations` is omitted. */
153
+ declare const DEFAULT_MAX_ITERATIONS = 400;
164
154
  /**
165
155
  * 流式执行选项
166
156
  */
@@ -190,6 +180,7 @@ declare class Agent {
190
180
  private sessionUsage;
191
181
  private static resolveModel;
192
182
  constructor(config: AgentConfig);
183
+ private log;
193
184
  /**
194
185
  * 注册内置 + 自定义工具,或仅 {@link AgentConfig.exclusiveTools}。
195
186
  */
@@ -208,6 +199,16 @@ declare class Agent {
208
199
  */
209
200
  private initializeMCP;
210
201
  private annotateStreamEvent;
202
+ private baseRunContext;
203
+ /**
204
+ * 分发流式事件到 `callbacks.onEvent` 与 `lifecycle.onModelEvent` / `onModelUsage`。
205
+ */
206
+ private emitStreamEvent;
207
+ /** 标注、触发观察回调并返回供 `yield` 的事件 */
208
+ private streamOut;
209
+ private emitAgentError;
210
+ private safeLifecycleVoid;
211
+ private emitRunEnd;
211
212
  private static createEmptySessionUsage;
212
213
  private resetSessionState;
213
214
  /**
@@ -379,7 +380,10 @@ declare function mergeMcpStdioEnv(agentEnv?: Record<string, string>, serverEnv?:
379
380
  * 占位符说明:
380
381
  * - {{SKILL_LIST}}: 会被运行时注入的skill列表替换
381
382
  */
382
- declare const DEFAULT_SYSTEM_PROMPT = "You are an AI assistant powered by the Agent SDK. You can help users with various tasks by using your built-in tools and capabilities.\n\n## Core Capabilities\n\n### Tools\nYou have access to a set of tools that allow you to:\n- **File Operations**: read, write, list, delete files and directories\n- **Code Execution**: run shell commands, Python scripts, Node.js code\n- **Web Access**: make HTTP requests, fetch webpages, download files\n- **Custom Tools**: additional tools registered by the user or skills\n\nWhen to use tools:\n- Use tools when the task requires real-world actions (file I/O, computation, API calls)\n- Prefer reading files before modifying them\n- Use the simplest tool that gets the job done\n- Run multiple independent tool calls in parallel when possible\n\n**Prefer dedicated tools over Bash:** Do not use `Bash` to do work that has a first-class tool. This keeps actions reviewable and consistent.\n- **Read** for file contents \u2014 not `cat`, `head`, `tail`, or `sed` to print files\n- **Write** to create or overwrite files \u2014 not shell redirection or heredocs\n- **Edit** for targeted file changes \u2014 not `sed`, `awk`, or ad-hoc scripts to patch files\n- **Glob** to find paths by pattern \u2014 not `find` or `ls` for discovery\n- **Grep** to search file contents \u2014 not `grep` or `rg` in the shell (built-in line-by-line regex search; correct integration)\n- **WebFetch** / **WebSearch** when the task needs HTTP or web search (when configured)\n\nReserve **Bash** for real shell needs: `git`, package managers, build commands, compilers, and other operations that require a shell or are not covered above.\n\n### Skills\nSkills are instruction guides for specialized tasks. When activated, you receive the skill's full content including any referenced file paths.\n\n{{SKILL_LIST}}\n\n**Usage:**\n- **Listing skills**: When the user asks about available skills (e.g., \"what skills do you have\", \"\u4F60\u6709\u54EA\u4E9B\u6280\u80FD\", \"list your skills\") \u2192 Simply describe the skills listed above. Do NOT activate any skill.\n- **Activating skills**: When the user has a specific task that matches a skill's purpose \u2192 Call `Skill` with the skill name, then follow the returned instructions.\n- After activation, use the provided Base Path to read any referenced files.\n\n### Sessions\n- Conversations are persisted in sessions\n- Use session IDs to maintain context across multiple interactions\n- Previous messages provide important context for current tasks\n\n## Task Execution Principles\n\n1. **Plan First for Complex Tasks**: For multi-step tasks, you MUST call `TaskCreate` BEFORE any other tool. Do NOT skip this step.\n2. **Be Direct**: Go straight to the point. Try the simplest approach first.\n3. **Be Concise**: If you can say it in one sentence, don't use three.\n4. **Read Before Modify**: Always understand existing code before changing it.\n5. **No Over-Engineering**: Only make changes directly requested or clearly necessary.\n6. **Prefer Edit Over Create**: Modify existing files rather than creating new ones when appropriate.\n7. **Handle Errors Gracefully**: Report errors clearly with actionable suggestions.\n\n## Task Management with Todo List\n\n**MANDATORY**: For multi-step tasks, call `TaskCreate` FIRST.\n\n**Workflow:**\n1. Receive complex task -> call `TaskCreate` immediately\n2. Start first task (in_progress) -> complete -> mark completed\n3. Move to next task -> repeat\n4. Cancel tasks that become irrelevant\n\n**Example:**\nUser: \"Open Google, search X, summarize results, open first link, extract info\"\n-> Multi-step task detected -> call `TaskCreate` FIRST, then execute.\n\n## Output Format\n\n- Lead with the answer or action, not the reasoning\n- Skip filler words and unnecessary preamble\n- Use code blocks with language hints for code\n- Structure longer responses with headers and lists\n- Reference file paths with line numbers when relevant (e.g., `src/index.ts:42`)\n\n## Security Guidelines\n\n- Do not introduce security vulnerabilities (injection, XSS, etc.)\n- Validate user inputs at boundaries\n- Do not execute untrusted code without sandboxing\n- Respect file system permissions and access controls\n\n### High-risk actions (confirm with the user first)\n\nThere is no automatic approval UI: **ask in the conversation** (or use `AskUserQuestion`) before proceeding when an action is destructive, hard to reverse, or affects others. Examples:\n- Deleting files or branches, dropping data, `rm -rf`, overwriting uncommitted work\n- Hard-to-reverse git: force-push, `reset --hard`, rewriting published history, amending shared commits\n- Actions visible outside this machine: pushing code, opening/closing/commenting on PRs or issues, sending messages, posting to external services, changing shared CI/CD or cloud permissions\n- Broad dependency or infrastructure changes (e.g. major version bumps, lockfile rewrites) when impact is unclear\n\nDefault to explaining what you intend and getting explicit agreement unless the user already directed that exact action.\n\n## Tool hooks\n\nWhen hooks are configured (e.g. PreToolUse), a tool call may be **blocked** or its **inputs adjusted** before execution. If a tool fails with a message indicating a hook blocked or rejected the call, **do not** retry the identical tool call unchanged \u2014 read the reason, change your approach, or ask the user. Treat hook feedback as binding policy from the environment.\n\n## Interaction Style\n\n- Be helpful and proactive\n- Ask clarifying questions when instructions are ambiguous\n- Provide suggestions when you see opportunities for improvement\n- Acknowledge limitations honestly\n- Maintain a professional, friendly tone";
383
+ declare const DEFAULT_SYSTEM_PROMPT = "You are an AI assistant powered by the Agent SDK. You can help users with various tasks by using your built-in tools and capabilities.\n\n## Core Capabilities\n\n### Tools\nYou have access to a set of tools that allow you to:\n- **File Operations**: read, write, list, delete files and directories\n- **Code Execution**: run shell commands, Python scripts, Node.js code\n- **Web Access**: make HTTP requests, fetch webpages, download files\n- **Custom Tools**: additional tools registered by the user or skills\n\nWhen to use tools:\n- Use tools when the task requires real-world actions (file I/O, computation, API calls)\n- Prefer reading files before modifying them\n- Use the simplest tool that gets the job done\n- Run multiple independent tool calls in parallel when possible\n\n**Prefer dedicated tools over Bash:** Do not use `Bash` to do work that has a first-class tool. This keeps actions reviewable and consistent.\n- **Read** for file contents \u2014 not `cat`, `head`, `tail`, or `sed` to print files\n- **Write** to create or overwrite files \u2014 not shell redirection or heredocs\n- **Edit** for targeted file changes \u2014 not `sed`, `awk`, or ad-hoc scripts to patch files\n- **Glob** to find paths by pattern \u2014 not `find` or `ls` for discovery\n- **Grep** to search file contents \u2014 not `grep` or `rg` in the shell (built-in line-by-line regex search; correct integration)\n- **WebFetch** / **WebSearch** when the task needs HTTP or web search (when configured)\n- **TodoWrite** for structured multi-step task lists (see **Task Management with Todo List** below)\n\nReserve **Bash** for real shell needs: `git`, package managers, build commands, compilers, and other operations that require a shell or are not covered above.\n\n### Skills\nSkills are instruction guides for specialized tasks. When activated, you receive the skill's full content including any referenced file paths.\n\n{{SKILL_LIST}}\n\n**Usage:**\n- **Listing skills**: When the user asks about available skills (e.g., \"what skills do you have\", \"\u4F60\u6709\u54EA\u4E9B\u6280\u80FD\", \"list your skills\") \u2192 Simply describe the skills listed above. Do NOT activate any skill.\n- **Activating skills**: When the user has a specific task that matches a skill's purpose \u2192 Call `Skill` with the skill name, then follow the returned instructions.\n- After activation, use the provided Base Path to read any referenced files.\n\n### Sessions\n- Conversations are persisted in sessions\n- Use session IDs to maintain context across multiple interactions\n- Previous messages provide important context for current tasks\n\n## Task Execution Principles\n\n1. **Plan First for Complex Tasks**: For multi-step tasks, you MUST call `TodoWrite` BEFORE any other tool. Do NOT skip this step.\n2. **Be Direct**: Go straight to the point. Try the simplest approach first.\n3. **Be Concise**: If you can say it in one sentence, don't use three.\n4. **Read Before Modify**: Always understand existing code before changing it.\n5. **No Over-Engineering**: Only make changes directly requested or clearly necessary.\n6. **Prefer Edit Over Create**: Modify existing files rather than creating new ones when appropriate.\n7. **Handle Errors Gracefully**: Report errors clearly with actionable suggestions.\n\n## Task Management with Todo List\n\n**MANDATORY**: For multi-step tasks, call `TodoWrite` FIRST.\n\n**Workflow:**\n1. Receive complex task -> call `TodoWrite` immediately\n2. Mark tasks `in_progress` / `completed` as you work; several items may be `in_progress` at once when work is parallel\n3. **Replan freely:** if the plan was wrong or incomplete, call `TodoWrite` again with a revised full list (add, remove, reorder, or rewrite steps)\n4. **Before you finish your response** for a multi-step request, ensure **every** todo is `completed` via `TodoWrite` (unless you intentionally pause for a follow-up turn). Do not leave `pending` / `in_progress` items when the work is done\n\n**Example:**\nUser: \"Open Google, search X, summarize results, open first link, extract info\"\n-> Multi-step task detected -> call `TodoWrite` FIRST, then execute.\n\n## Output Format\n\n- Lead with the answer or action, not the reasoning\n- Skip filler words and unnecessary preamble\n- Use code blocks with language hints for code\n- Structure longer responses with headers and lists\n- Reference file paths with line numbers when relevant (e.g., `src/index.ts:42`)\n\n## Security Guidelines\n\n- Do not introduce security vulnerabilities (injection, XSS, etc.)\n- Validate user inputs at boundaries\n- Do not execute untrusted code without sandboxing\n- Respect file system permissions and access controls\n\n### High-risk actions (confirm with the user first)\n\nThere is no automatic approval UI: **ask in the conversation** (or use `AskUserQuestion`) before proceeding when an action is destructive, hard to reverse, or affects others. Examples:\n- Deleting files or branches, dropping data, `rm -rf`, overwriting uncommitted work\n- Hard-to-reverse git: force-push, `reset --hard`, rewriting published history, amending shared commits\n- Actions visible outside this machine: pushing code, opening/closing/commenting on PRs or issues, sending messages, posting to external services, changing shared CI/CD or cloud permissions\n- Broad dependency or infrastructure changes (e.g. major version bumps, lockfile rewrites) when impact is unclear\n\nDefault to explaining what you intend and getting explicit agreement unless the user already directed that exact action.\n\n## Tool hooks\n\nWhen hooks are configured (e.g. PreToolUse), a tool call may be **blocked** or its **inputs adjusted** before execution. If a tool fails with a message indicating a hook blocked or rejected the call, **do not** retry the identical tool call unchanged \u2014 read the reason, change your approach, or ask the user. Treat hook feedback as binding policy from the environment.\n\n## Interaction Style\n\n- Be helpful and proactive\n- Ask clarifying questions when instructions are ambiguous\n- Provide suggestions when you see opportunities for improvement\n- Acknowledge limitations honestly\n- Maintain a professional, friendly tone";
384
+
385
+ declare function formatSDKLog(event: LogEvent): string;
386
+ declare function createConsoleSDKLogger(): SDKLogger;
383
387
 
384
388
  /**
385
389
  * Same directory as {@link Agent} session storage: `<userBase>/.claude/sessions`.
@@ -582,6 +586,8 @@ declare function fromAsyncIterable(iterable: AsyncIterable<StreamEvent>): AgentS
582
586
  interface StreamChunkProcessorOptions {
583
587
  /** Emit `text_start` / `text_end` around assistant text deltas (Claude-style content blocks). Default true. */
584
588
  emitTextBoundaries?: boolean;
589
+ /** Emit `thinking_start` / `thinking_end` around assistant thinking deltas. Default true. */
590
+ emitThinkingBoundaries?: boolean;
585
591
  }
586
592
  /**
587
593
  * Stateful conversion from model `StreamChunk` to normalized `StreamEvent`s.
@@ -591,7 +597,9 @@ declare class StreamChunkProcessor {
591
597
  private currentToolCall;
592
598
  private lastUsage;
593
599
  private inTextBlock;
600
+ private inThinkingBlock;
594
601
  private readonly emitTextBoundaries;
602
+ private readonly emitThinkingBoundaries;
595
603
  constructor(options?: StreamChunkProcessorOptions);
596
604
  processChunk(chunk: StreamChunk): StreamEvent[];
597
605
  /** End open text block and finalize any in-progress streamed tool call. */
@@ -601,6 +609,16 @@ declare class StreamChunkProcessor {
601
609
  private safeParseJSON;
602
610
  }
603
611
 
612
+ /**
613
+ * Builds the Agent-facing tool name for an MCP tool: `mcp__<serverName>__<toolName>`.
614
+ * Avoid `__` inside `serverName` or `toolName`; those segments are not escaped and would make parsing ambiguous.
615
+ */
616
+ declare function formatMcpToolName(serverName: string, toolName: string): string;
617
+ /**
618
+ * True if `name` matches the MCP-prefixed tool naming convention (at least `mcp__<server>__<tool>`).
619
+ */
620
+ declare function isMcpPrefixedToolName(name: string): boolean;
621
+
604
622
  /**
605
623
  * 解析 SKILL.md 文件
606
624
  * 格式:
@@ -652,6 +670,8 @@ interface MCPConfigFile {
652
670
  args?: string[];
653
671
  /** 环境变量 */
654
672
  env?: Record<string, string>;
673
+ /** stdio 子进程工作目录 */
674
+ cwd?: string;
655
675
  /** URL (HTTP transport) */
656
676
  url?: string;
657
677
  /** HTTP headers */
@@ -681,4 +701,4 @@ declare function loadMCPConfig(configPath?: string, startDir?: string, userBaseP
681
701
  */
682
702
  declare function validateMCPConfig(config: MCPConfigFile): string[];
683
703
 
684
- export { Agent, AgentConfig, AgentResult, AgentStream, DEFAULT_SYSTEM_PROMPT, type HttpMCPConfig, JsonlStorage, MCPAdapter, MCPClient, type MCPClientConfig, type MCPConfigFile, type MCPConfigLoadResult, type MCPPrompt, type MCPResource, MCPServerConfig, type MCPTool, MemoryConfig, MemoryManager, MemoryStorage, Message, ModelAdapter, PACKAGE_VERSION, ParsedSkill, type PromptMessage, SessionInfo, SessionManager, SessionTokenUsage, SkillRegistry, type StdioMCPConfig, StorageAdapter, StorageConfig, StreamChunk, StreamChunkProcessor, type StreamChunkProcessorOptions, StreamEvent, type StreamOptions, SystemPrompt, TokenUsage, ToolDefinition, ToolRegistry, ToolResult, createAgent, createJsonlStorage, createMCPAdapter, createMCPClient, createMemoryStorage, createSessionManager, createStorage, createStream, fromAsyncIterable, getLatestSessionId, getSessionStoragePath, loadMCPConfig, mergeMcpStdioEnv, mergeProcessEnv, parseSkillMd, validateMCPConfig };
704
+ export { Agent, AgentConfig, AgentResult, AgentStream, DEFAULT_MAX_ITERATIONS, DEFAULT_SYSTEM_PROMPT, JsonlStorage, LogEvent, MCPAdapter, MCPClient, type MCPConfigFile, type MCPConfigLoadResult, type MCPPrompt, type MCPResource, MCPServerConfig, type MCPTool, MemoryConfig, MemoryManager, MemoryStorage, Message, ModelAdapter, PACKAGE_VERSION, ParsedSkill, type PromptMessage, SDKLogger, SessionInfo, SessionManager, SessionTokenUsage, SkillRegistry, StorageAdapter, StorageConfig, StreamChunk, StreamChunkProcessor, type StreamChunkProcessorOptions, StreamEvent, type StreamOptions, SystemPrompt, TokenUsage, ToolDefinition, ToolRegistry, ToolResult, createAgent, createConsoleSDKLogger, createJsonlStorage, createMCPAdapter, createMCPClient, createMemoryStorage, createSessionManager, createStorage, createStream, formatMcpToolName, formatSDKLog, fromAsyncIterable, getLatestSessionId, getSessionStoragePath, isMcpPrefixedToolName, loadMCPConfig, mergeMcpStdioEnv, mergeProcessEnv, parseSkillMd, validateMCPConfig };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import './chunk-A3S3AGE3.js';
3
- export { Agent, DEFAULT_SYSTEM_PROMPT, JsonlStorage, MCPAdapter, MCPClient, MemoryManager, MemoryStorage, PACKAGE_VERSION, SessionManager, SkillLoader, SkillRegistry, StreamChunkProcessor, createAgent, createJsonlStorage, createMCPAdapter, createMCPClient, createMemoryStorage, createSessionManager, createSkillLoader, createSkillRegistry, createStorage, getLatestSessionId, getSessionStoragePath, loadMCPConfig, parseSkillMd, validateMCPConfig } from './chunk-DXMVWGLJ.js';
4
- export { AnthropicAdapter, OllamaAdapter, OpenAIAdapter, createAnthropic, createModel, createOllama, createOpenAI, mergeMcpStdioEnv, mergeProcessEnv } from './chunk-742JTNYI.js';
5
- export { DEFAULT_GREP_HEAD_LIMIT, HookManager, MAX_LINE_LENGTH, ToolRegistry, agentTool, bashTool, buildHookEnv, createAgentTool, createAskUserQuestionTool, createFunctionHook, createSkillTool, createTool, editTool, formatAnswerSummary, formatAskUserQuestionPrompt, getAllBuiltinTools, getFileSystemTools, getGlobalRegistry, getGrepTools, getInteractionTools, getSafeBuiltinTools, getShellTools, getSkillTools, getSubagentTools, getTaskTools, getWebTools, globTool, grepTool, loadHooksSettingsFromProject, loadHooksSettingsFromUser, matchTool, mergeCommandHookLayers, parseHooksSettingsFile, questionTool, readFileTool, subagentRequestSchema, taskCreateTool, taskListTool, taskUpdateTool, truncateMatchLineForDisplay, webFetchTool, webSearchTool, writeFileTool } from './chunk-THKEF32L.js';
3
+ export { Agent, DEFAULT_MAX_ITERATIONS, DEFAULT_SYSTEM_PROMPT, JsonlStorage, MCPAdapter, MCPClient, MODEL_STREAM_EVENT_TYPES, MemoryManager, MemoryStorage, PACKAGE_VERSION, SessionManager, SkillLoader, SkillRegistry, StreamChunkProcessor, createAgent, createJsonlStorage, createMCPAdapter, createMCPClient, createMemoryStorage, createSessionManager, createSkillLoader, createSkillRegistry, createStorage, formatMcpToolName, getLatestSessionId, getSessionStoragePath, isMcpPrefixedToolName, isModelStreamEventType, loadMCPConfig, parseSkillMd, validateMCPConfig } from './chunk-UHENMHUS.js';
4
+ export { AnthropicAdapter, DEFAULT_ADAPTER_CAPABILITIES, OllamaAdapter, OpenAIAdapter, createAnthropic, createConsoleSDKLogger, createModel, createOllama, createOpenAI, formatSDKLog, mergeMcpStdioEnv, mergeProcessEnv } from './chunk-D3UZNLZO.js';
5
+ export { DEFAULT_GREP_HEAD_LIMIT, HookManager, MAX_LINE_LENGTH, SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES, SUBAGENT_TYPES, ToolRegistry, agentTool, bashTool, buildHookEnv, createAgentTool, createAskUserQuestionTool, createFunctionHook, createSkillTool, createTool, editTool, formatAnswerSummary, formatAskUserQuestionPrompt, getAllBuiltinTools, getFileSystemTools, getGlobalRegistry, getGrepTools, getInteractionTools, getPlanningTools, getSafeBuiltinTools, getShellTools, getSkillTools, getSubagentTools, getWebTools, globTool, grepTool, loadHooksSettingsFromProject, loadHooksSettingsFromUser, matchTool, mergeCommandHookLayers, parseHooksSettingsFile, questionTool, readFileTool, resolveSubagentTypeAppend, subagentExploreDefaultsUnavailableMessage, subagentRequestSchema, todoWriteTool, truncateMatchLineForDisplay, webFetchTool, webSearchTool, writeFileTool } from './chunk-TKUPLTGJ.js';
6
6
  import './chunk-LOYIGOBZ.js';
7
7
 
8
8
  // src/streaming/event-emitter.ts
@@ -1,46 +1,50 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkDQFTAD3I_cjs = require('../chunk-DQFTAD3I.cjs');
4
+ var chunkNYZD3THB_cjs = require('../chunk-NYZD3THB.cjs');
5
5
  var chunkOZO7D77N_cjs = require('../chunk-OZO7D77N.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "AnthropicAdapter", {
10
10
  enumerable: true,
11
- get: function () { return chunkDQFTAD3I_cjs.AnthropicAdapter; }
11
+ get: function () { return chunkNYZD3THB_cjs.AnthropicAdapter; }
12
+ });
13
+ Object.defineProperty(exports, "DEFAULT_ADAPTER_CAPABILITIES", {
14
+ enumerable: true,
15
+ get: function () { return chunkNYZD3THB_cjs.DEFAULT_ADAPTER_CAPABILITIES; }
12
16
  });
13
17
  Object.defineProperty(exports, "OllamaAdapter", {
14
18
  enumerable: true,
15
- get: function () { return chunkDQFTAD3I_cjs.OllamaAdapter; }
19
+ get: function () { return chunkNYZD3THB_cjs.OllamaAdapter; }
16
20
  });
17
21
  Object.defineProperty(exports, "OpenAIAdapter", {
18
22
  enumerable: true,
19
- get: function () { return chunkDQFTAD3I_cjs.OpenAIAdapter; }
23
+ get: function () { return chunkNYZD3THB_cjs.OpenAIAdapter; }
20
24
  });
21
25
  Object.defineProperty(exports, "createAnthropic", {
22
26
  enumerable: true,
23
- get: function () { return chunkDQFTAD3I_cjs.createAnthropic; }
27
+ get: function () { return chunkNYZD3THB_cjs.createAnthropic; }
24
28
  });
25
29
  Object.defineProperty(exports, "createModel", {
26
30
  enumerable: true,
27
- get: function () { return chunkDQFTAD3I_cjs.createModel; }
31
+ get: function () { return chunkNYZD3THB_cjs.createModel; }
28
32
  });
29
33
  Object.defineProperty(exports, "createOllama", {
30
34
  enumerable: true,
31
- get: function () { return chunkDQFTAD3I_cjs.createOllama; }
35
+ get: function () { return chunkNYZD3THB_cjs.createOllama; }
32
36
  });
33
37
  Object.defineProperty(exports, "createOpenAI", {
34
38
  enumerable: true,
35
- get: function () { return chunkDQFTAD3I_cjs.createOpenAI; }
39
+ get: function () { return chunkNYZD3THB_cjs.createOpenAI; }
36
40
  });
37
41
  Object.defineProperty(exports, "ollamaMessageContentToApiString", {
38
42
  enumerable: true,
39
- get: function () { return chunkDQFTAD3I_cjs.ollamaMessageContentToApiString; }
43
+ get: function () { return chunkNYZD3THB_cjs.ollamaMessageContentToApiString; }
40
44
  });
41
45
  Object.defineProperty(exports, "ollamaStreamChunksFromChatData", {
42
46
  enumerable: true,
43
- get: function () { return chunkDQFTAD3I_cjs.ollamaStreamChunksFromChatData; }
47
+ get: function () { return chunkNYZD3THB_cjs.ollamaStreamChunksFromChatData; }
44
48
  });
45
49
  Object.defineProperty(exports, "BaseModelAdapter", {
46
50
  enumerable: true,
@@ -1,5 +1,10 @@
1
+ import { a4 as ModelCapabilities, h as ModelAdapter, a5 as ModelParams, l as StreamChunk, E as CompletionResult, k as TokenUsage, d as ToolDefinition, ax as ToolSchema, F as ContentPart } from '../types-BUwjMwNH.cjs';
1
2
  import { z } from 'zod';
2
- import { g as ModelAdapter, R as ModelCapabilities, U as ModelParams, k as StreamChunk, v as CompletionResult, j as TokenUsage, c as ToolDefinition, ad as ToolSchema, w as ContentPart } from '../types-BLf9IqRs.cjs';
3
+
4
+ /**
5
+ * 各提供商适配器在省略 `config.capabilities` 时共用的默认能力(上下文 200K、最大输出 32K)。
6
+ */
7
+ declare const DEFAULT_ADAPTER_CAPABILITIES: ModelCapabilities;
3
8
 
4
9
  /** Options passed through to Zod’s JSON Schema conversion (target, io, etc.). */
5
10
  type ZodToJsonSchemaOptions = NonNullable<Parameters<typeof z.toJSONSchema>[1]>;
@@ -206,4 +211,4 @@ interface CreateModelConfig {
206
211
  */
207
212
  declare function createModel(modelConfig: CreateModelConfig, agentEnv?: Record<string, string>): ModelAdapter;
208
213
 
209
- export { AnthropicAdapter, type AnthropicConfig, type AnthropicFetchRetryOptions, type AnthropicRequestMetadata, BaseModelAdapter, type CreateModelConfig, type ModelProvider, OllamaAdapter, type OllamaConfig, type OllamaThinkOption, OpenAIAdapter, type OpenAIConfig, type ZodToJsonSchemaOptions, createAnthropic, createModel, createOllama, createOpenAI, mergeTokenUsage, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData, toolsToModelSchema, zodToJsonSchema };
214
+ export { AnthropicAdapter, type AnthropicConfig, type AnthropicFetchRetryOptions, type AnthropicRequestMetadata, BaseModelAdapter, type CreateModelConfig, DEFAULT_ADAPTER_CAPABILITIES, type ModelProvider, OllamaAdapter, type OllamaConfig, type OllamaThinkOption, OpenAIAdapter, type OpenAIConfig, type ZodToJsonSchemaOptions, createAnthropic, createModel, createOllama, createOpenAI, mergeTokenUsage, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData, toolsToModelSchema, zodToJsonSchema };
@@ -1,5 +1,10 @@
1
+ import { a4 as ModelCapabilities, h as ModelAdapter, a5 as ModelParams, l as StreamChunk, E as CompletionResult, k as TokenUsage, d as ToolDefinition, ax as ToolSchema, F as ContentPart } from '../types-BUwjMwNH.js';
1
2
  import { z } from 'zod';
2
- import { g as ModelAdapter, R as ModelCapabilities, U as ModelParams, k as StreamChunk, v as CompletionResult, j as TokenUsage, c as ToolDefinition, ad as ToolSchema, w as ContentPart } from '../types-BLf9IqRs.js';
3
+
4
+ /**
5
+ * 各提供商适配器在省略 `config.capabilities` 时共用的默认能力(上下文 200K、最大输出 32K)。
6
+ */
7
+ declare const DEFAULT_ADAPTER_CAPABILITIES: ModelCapabilities;
3
8
 
4
9
  /** Options passed through to Zod’s JSON Schema conversion (target, io, etc.). */
5
10
  type ZodToJsonSchemaOptions = NonNullable<Parameters<typeof z.toJSONSchema>[1]>;
@@ -206,4 +211,4 @@ interface CreateModelConfig {
206
211
  */
207
212
  declare function createModel(modelConfig: CreateModelConfig, agentEnv?: Record<string, string>): ModelAdapter;
208
213
 
209
- export { AnthropicAdapter, type AnthropicConfig, type AnthropicFetchRetryOptions, type AnthropicRequestMetadata, BaseModelAdapter, type CreateModelConfig, type ModelProvider, OllamaAdapter, type OllamaConfig, type OllamaThinkOption, OpenAIAdapter, type OpenAIConfig, type ZodToJsonSchemaOptions, createAnthropic, createModel, createOllama, createOpenAI, mergeTokenUsage, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData, toolsToModelSchema, zodToJsonSchema };
214
+ export { AnthropicAdapter, type AnthropicConfig, type AnthropicFetchRetryOptions, type AnthropicRequestMetadata, BaseModelAdapter, type CreateModelConfig, DEFAULT_ADAPTER_CAPABILITIES, type ModelProvider, OllamaAdapter, type OllamaConfig, type OllamaThinkOption, OpenAIAdapter, type OpenAIConfig, type ZodToJsonSchemaOptions, createAnthropic, createModel, createOllama, createOpenAI, mergeTokenUsage, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData, toolsToModelSchema, zodToJsonSchema };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export { AnthropicAdapter, OllamaAdapter, OpenAIAdapter, createAnthropic, createModel, createOllama, createOpenAI, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData } from '../chunk-742JTNYI.js';
2
+ export { AnthropicAdapter, DEFAULT_ADAPTER_CAPABILITIES, OllamaAdapter, OpenAIAdapter, createAnthropic, createModel, createOllama, createOpenAI, ollamaMessageContentToApiString, ollamaStreamChunksFromChatData } from '../chunk-D3UZNLZO.js';
3
3
  export { BaseModelAdapter, mergeTokenUsage, toolsToModelSchema, zodToJsonSchema } from '../chunk-LOYIGOBZ.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -2,206 +2,214 @@
2
2
  'use strict';
3
3
 
4
4
  require('../chunk-5Y56A64C.cjs');
5
- var chunkQ3L4GIBG_cjs = require('../chunk-Q3L4GIBG.cjs');
5
+ var chunkP2X3AMDK_cjs = require('../chunk-P2X3AMDK.cjs');
6
6
  require('../chunk-OZO7D77N.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "DEFAULT_GREP_HEAD_LIMIT", {
11
11
  enumerable: true,
12
- get: function () { return chunkQ3L4GIBG_cjs.DEFAULT_GREP_HEAD_LIMIT; }
12
+ get: function () { return chunkP2X3AMDK_cjs.DEFAULT_GREP_HEAD_LIMIT; }
13
13
  });
14
14
  Object.defineProperty(exports, "FileStorageStrategy", {
15
15
  enumerable: true,
16
- get: function () { return chunkQ3L4GIBG_cjs.FileStorageStrategy; }
16
+ get: function () { return chunkP2X3AMDK_cjs.FileStorageStrategy; }
17
17
  });
18
18
  Object.defineProperty(exports, "HookManager", {
19
19
  enumerable: true,
20
- get: function () { return chunkQ3L4GIBG_cjs.HookManager; }
20
+ get: function () { return chunkP2X3AMDK_cjs.HookManager; }
21
21
  });
22
22
  Object.defineProperty(exports, "MAX_LINE_LENGTH", {
23
23
  enumerable: true,
24
- get: function () { return chunkQ3L4GIBG_cjs.MAX_LINE_LENGTH; }
24
+ get: function () { return chunkP2X3AMDK_cjs.MAX_LINE_LENGTH; }
25
25
  });
26
26
  Object.defineProperty(exports, "OUTPUT_CONFIG", {
27
27
  enumerable: true,
28
- get: function () { return chunkQ3L4GIBG_cjs.OUTPUT_CONFIG; }
28
+ get: function () { return chunkP2X3AMDK_cjs.OUTPUT_CONFIG; }
29
29
  });
30
30
  Object.defineProperty(exports, "OutputHandler", {
31
31
  enumerable: true,
32
- get: function () { return chunkQ3L4GIBG_cjs.OutputHandler; }
32
+ get: function () { return chunkP2X3AMDK_cjs.OutputHandler; }
33
33
  });
34
34
  Object.defineProperty(exports, "PaginationHintStrategy", {
35
35
  enumerable: true,
36
- get: function () { return chunkQ3L4GIBG_cjs.PaginationHintStrategy; }
36
+ get: function () { return chunkP2X3AMDK_cjs.PaginationHintStrategy; }
37
+ });
38
+ Object.defineProperty(exports, "SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES", {
39
+ enumerable: true,
40
+ get: function () { return chunkP2X3AMDK_cjs.SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES; }
41
+ });
42
+ Object.defineProperty(exports, "SUBAGENT_TYPES", {
43
+ enumerable: true,
44
+ get: function () { return chunkP2X3AMDK_cjs.SUBAGENT_TYPES; }
37
45
  });
38
46
  Object.defineProperty(exports, "SmartTruncateStrategy", {
39
47
  enumerable: true,
40
- get: function () { return chunkQ3L4GIBG_cjs.SmartTruncateStrategy; }
48
+ get: function () { return chunkP2X3AMDK_cjs.SmartTruncateStrategy; }
41
49
  });
42
50
  Object.defineProperty(exports, "ToolRegistry", {
43
51
  enumerable: true,
44
- get: function () { return chunkQ3L4GIBG_cjs.ToolRegistry; }
52
+ get: function () { return chunkP2X3AMDK_cjs.ToolRegistry; }
45
53
  });
46
54
  Object.defineProperty(exports, "agentTool", {
47
55
  enumerable: true,
48
- get: function () { return chunkQ3L4GIBG_cjs.agentTool; }
56
+ get: function () { return chunkP2X3AMDK_cjs.agentTool; }
49
57
  });
50
58
  Object.defineProperty(exports, "bashTool", {
51
59
  enumerable: true,
52
- get: function () { return chunkQ3L4GIBG_cjs.bashTool; }
60
+ get: function () { return chunkP2X3AMDK_cjs.bashTool; }
53
61
  });
54
62
  Object.defineProperty(exports, "buildHookEnv", {
55
63
  enumerable: true,
56
- get: function () { return chunkQ3L4GIBG_cjs.buildHookEnv; }
64
+ get: function () { return chunkP2X3AMDK_cjs.buildHookEnv; }
57
65
  });
58
66
  Object.defineProperty(exports, "createAgentTool", {
59
67
  enumerable: true,
60
- get: function () { return chunkQ3L4GIBG_cjs.createAgentTool; }
68
+ get: function () { return chunkP2X3AMDK_cjs.createAgentTool; }
61
69
  });
62
70
  Object.defineProperty(exports, "createAskUserQuestionTool", {
63
71
  enumerable: true,
64
- get: function () { return chunkQ3L4GIBG_cjs.createAskUserQuestionTool; }
72
+ get: function () { return chunkP2X3AMDK_cjs.createAskUserQuestionTool; }
65
73
  });
66
74
  Object.defineProperty(exports, "createFunctionHook", {
67
75
  enumerable: true,
68
- get: function () { return chunkQ3L4GIBG_cjs.createFunctionHook; }
76
+ get: function () { return chunkP2X3AMDK_cjs.createFunctionHook; }
69
77
  });
70
78
  Object.defineProperty(exports, "createOutputHandler", {
71
79
  enumerable: true,
72
- get: function () { return chunkQ3L4GIBG_cjs.createOutputHandler; }
80
+ get: function () { return chunkP2X3AMDK_cjs.createOutputHandler; }
73
81
  });
74
82
  Object.defineProperty(exports, "createSkillTool", {
75
83
  enumerable: true,
76
- get: function () { return chunkQ3L4GIBG_cjs.createSkillTool; }
84
+ get: function () { return chunkP2X3AMDK_cjs.createSkillTool; }
77
85
  });
78
86
  Object.defineProperty(exports, "createTool", {
79
87
  enumerable: true,
80
- get: function () { return chunkQ3L4GIBG_cjs.createTool; }
88
+ get: function () { return chunkP2X3AMDK_cjs.createTool; }
81
89
  });
82
90
  Object.defineProperty(exports, "editTool", {
83
91
  enumerable: true,
84
- get: function () { return chunkQ3L4GIBG_cjs.editTool; }
92
+ get: function () { return chunkP2X3AMDK_cjs.editTool; }
85
93
  });
86
94
  Object.defineProperty(exports, "formatAnswerSummary", {
87
95
  enumerable: true,
88
- get: function () { return chunkQ3L4GIBG_cjs.formatAnswerSummary; }
96
+ get: function () { return chunkP2X3AMDK_cjs.formatAnswerSummary; }
89
97
  });
90
98
  Object.defineProperty(exports, "formatAskUserQuestionPrompt", {
91
99
  enumerable: true,
92
- get: function () { return chunkQ3L4GIBG_cjs.formatAskUserQuestionPrompt; }
100
+ get: function () { return chunkP2X3AMDK_cjs.formatAskUserQuestionPrompt; }
93
101
  });
94
102
  Object.defineProperty(exports, "getAllBuiltinTools", {
95
103
  enumerable: true,
96
- get: function () { return chunkQ3L4GIBG_cjs.getAllBuiltinTools; }
104
+ get: function () { return chunkP2X3AMDK_cjs.getAllBuiltinTools; }
97
105
  });
98
106
  Object.defineProperty(exports, "getFileSystemTools", {
99
107
  enumerable: true,
100
- get: function () { return chunkQ3L4GIBG_cjs.getFileSystemTools; }
108
+ get: function () { return chunkP2X3AMDK_cjs.getFileSystemTools; }
101
109
  });
102
110
  Object.defineProperty(exports, "getGlobalRegistry", {
103
111
  enumerable: true,
104
- get: function () { return chunkQ3L4GIBG_cjs.getGlobalRegistry; }
112
+ get: function () { return chunkP2X3AMDK_cjs.getGlobalRegistry; }
105
113
  });
106
114
  Object.defineProperty(exports, "getGrepTools", {
107
115
  enumerable: true,
108
- get: function () { return chunkQ3L4GIBG_cjs.getGrepTools; }
116
+ get: function () { return chunkP2X3AMDK_cjs.getGrepTools; }
109
117
  });
110
118
  Object.defineProperty(exports, "getInteractionTools", {
111
119
  enumerable: true,
112
- get: function () { return chunkQ3L4GIBG_cjs.getInteractionTools; }
120
+ get: function () { return chunkP2X3AMDK_cjs.getInteractionTools; }
121
+ });
122
+ Object.defineProperty(exports, "getPlanningTools", {
123
+ enumerable: true,
124
+ get: function () { return chunkP2X3AMDK_cjs.getPlanningTools; }
113
125
  });
114
126
  Object.defineProperty(exports, "getSafeBuiltinTools", {
115
127
  enumerable: true,
116
- get: function () { return chunkQ3L4GIBG_cjs.getSafeBuiltinTools; }
128
+ get: function () { return chunkP2X3AMDK_cjs.getSafeBuiltinTools; }
117
129
  });
118
130
  Object.defineProperty(exports, "getShellTools", {
119
131
  enumerable: true,
120
- get: function () { return chunkQ3L4GIBG_cjs.getShellTools; }
132
+ get: function () { return chunkP2X3AMDK_cjs.getShellTools; }
121
133
  });
122
134
  Object.defineProperty(exports, "getSkillTools", {
123
135
  enumerable: true,
124
- get: function () { return chunkQ3L4GIBG_cjs.getSkillTools; }
136
+ get: function () { return chunkP2X3AMDK_cjs.getSkillTools; }
125
137
  });
126
138
  Object.defineProperty(exports, "getSubagentTools", {
127
139
  enumerable: true,
128
- get: function () { return chunkQ3L4GIBG_cjs.getSubagentTools; }
129
- });
130
- Object.defineProperty(exports, "getTaskTools", {
131
- enumerable: true,
132
- get: function () { return chunkQ3L4GIBG_cjs.getTaskTools; }
140
+ get: function () { return chunkP2X3AMDK_cjs.getSubagentTools; }
133
141
  });
134
142
  Object.defineProperty(exports, "getWebTools", {
135
143
  enumerable: true,
136
- get: function () { return chunkQ3L4GIBG_cjs.getWebTools; }
144
+ get: function () { return chunkP2X3AMDK_cjs.getWebTools; }
137
145
  });
138
146
  Object.defineProperty(exports, "globTool", {
139
147
  enumerable: true,
140
- get: function () { return chunkQ3L4GIBG_cjs.globTool; }
148
+ get: function () { return chunkP2X3AMDK_cjs.globTool; }
141
149
  });
142
150
  Object.defineProperty(exports, "grepTool", {
143
151
  enumerable: true,
144
- get: function () { return chunkQ3L4GIBG_cjs.grepTool; }
152
+ get: function () { return chunkP2X3AMDK_cjs.grepTool; }
145
153
  });
146
154
  Object.defineProperty(exports, "loadHooksSettingsFromProject", {
147
155
  enumerable: true,
148
- get: function () { return chunkQ3L4GIBG_cjs.loadHooksSettingsFromProject; }
156
+ get: function () { return chunkP2X3AMDK_cjs.loadHooksSettingsFromProject; }
149
157
  });
150
158
  Object.defineProperty(exports, "loadHooksSettingsFromUser", {
151
159
  enumerable: true,
152
- get: function () { return chunkQ3L4GIBG_cjs.loadHooksSettingsFromUser; }
160
+ get: function () { return chunkP2X3AMDK_cjs.loadHooksSettingsFromUser; }
153
161
  });
154
162
  Object.defineProperty(exports, "matchTool", {
155
163
  enumerable: true,
156
- get: function () { return chunkQ3L4GIBG_cjs.matchTool; }
164
+ get: function () { return chunkP2X3AMDK_cjs.matchTool; }
157
165
  });
158
166
  Object.defineProperty(exports, "mergeCommandHookLayers", {
159
167
  enumerable: true,
160
- get: function () { return chunkQ3L4GIBG_cjs.mergeCommandHookLayers; }
168
+ get: function () { return chunkP2X3AMDK_cjs.mergeCommandHookLayers; }
161
169
  });
162
170
  Object.defineProperty(exports, "parseHooksSettingsFile", {
163
171
  enumerable: true,
164
- get: function () { return chunkQ3L4GIBG_cjs.parseHooksSettingsFile; }
172
+ get: function () { return chunkP2X3AMDK_cjs.parseHooksSettingsFile; }
165
173
  });
166
174
  Object.defineProperty(exports, "questionTool", {
167
175
  enumerable: true,
168
- get: function () { return chunkQ3L4GIBG_cjs.questionTool; }
176
+ get: function () { return chunkP2X3AMDK_cjs.questionTool; }
169
177
  });
170
178
  Object.defineProperty(exports, "readFileTool", {
171
179
  enumerable: true,
172
- get: function () { return chunkQ3L4GIBG_cjs.readFileTool; }
180
+ get: function () { return chunkP2X3AMDK_cjs.readFileTool; }
173
181
  });
174
- Object.defineProperty(exports, "subagentRequestSchema", {
182
+ Object.defineProperty(exports, "resolveSubagentTypeAppend", {
175
183
  enumerable: true,
176
- get: function () { return chunkQ3L4GIBG_cjs.subagentRequestSchema; }
184
+ get: function () { return chunkP2X3AMDK_cjs.resolveSubagentTypeAppend; }
177
185
  });
178
- Object.defineProperty(exports, "taskCreateTool", {
186
+ Object.defineProperty(exports, "subagentExploreDefaultsUnavailableMessage", {
179
187
  enumerable: true,
180
- get: function () { return chunkQ3L4GIBG_cjs.taskCreateTool; }
188
+ get: function () { return chunkP2X3AMDK_cjs.subagentExploreDefaultsUnavailableMessage; }
181
189
  });
182
- Object.defineProperty(exports, "taskListTool", {
190
+ Object.defineProperty(exports, "subagentRequestSchema", {
183
191
  enumerable: true,
184
- get: function () { return chunkQ3L4GIBG_cjs.taskListTool; }
192
+ get: function () { return chunkP2X3AMDK_cjs.subagentRequestSchema; }
185
193
  });
186
- Object.defineProperty(exports, "taskUpdateTool", {
194
+ Object.defineProperty(exports, "todoWriteTool", {
187
195
  enumerable: true,
188
- get: function () { return chunkQ3L4GIBG_cjs.taskUpdateTool; }
196
+ get: function () { return chunkP2X3AMDK_cjs.todoWriteTool; }
189
197
  });
190
198
  Object.defineProperty(exports, "truncateMatchLineForDisplay", {
191
199
  enumerable: true,
192
- get: function () { return chunkQ3L4GIBG_cjs.truncateMatchLineForDisplay; }
200
+ get: function () { return chunkP2X3AMDK_cjs.truncateMatchLineForDisplay; }
193
201
  });
194
202
  Object.defineProperty(exports, "webFetchTool", {
195
203
  enumerable: true,
196
- get: function () { return chunkQ3L4GIBG_cjs.webFetchTool; }
204
+ get: function () { return chunkP2X3AMDK_cjs.webFetchTool; }
197
205
  });
198
206
  Object.defineProperty(exports, "webSearchTool", {
199
207
  enumerable: true,
200
- get: function () { return chunkQ3L4GIBG_cjs.webSearchTool; }
208
+ get: function () { return chunkP2X3AMDK_cjs.webSearchTool; }
201
209
  });
202
210
  Object.defineProperty(exports, "writeFileTool", {
203
211
  enumerable: true,
204
- get: function () { return chunkQ3L4GIBG_cjs.writeFileTool; }
212
+ get: function () { return chunkP2X3AMDK_cjs.writeFileTool; }
205
213
  });
206
214
  //# sourceMappingURL=index.cjs.map
207
215
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
- export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, c as SubagentRequest, d as SubagentRunner, e as ToolExecuteOptions, T as ToolRegistry, f as ToolRegistryConfig, g as agentTool, h as bashTool, i as createAgentTool, l as createSkillTool, m as createTool, n as editTool, o as getAllBuiltinTools, p as getFileSystemTools, q as getGlobalRegistry, r as getGrepTools, s as getSafeBuiltinTools, t as getShellTools, u as getSkillTools, v as getSubagentTools, w as getTaskTools, x as getWebTools, y as globTool, z as grepTool, A as loadHooksSettingsFromProject, B as loadHooksSettingsFromUser, E as parseHooksSettingsFile, F as readFileTool, G as subagentRequestSchema, H as taskCreateTool, I as taskListTool, J as taskUpdateTool, K as truncateMatchLineForDisplay, L as webFetchTool, N as webSearchTool, O as writeFileTool } from '../index-DGPDMbW5.cjs';
2
- import { T as ToolResult } from '../types-BLf9IqRs.cjs';
3
- export { o as AskUserQuestionAnswer, p as AskUserQuestionItem, q as AskUserQuestionResolver, u as CommandHookConfig, y as CreateAskUserQuestionToolOptions, F as FlatCommandHookEntry, z as FunctionHook, H as HookContext, B as HookEventType, D as HookGroupConfig, E as HookManager, G as HookResult, I as HooksSettings, J as HooksSettingsFile, c as ToolDefinition, ac as ToolResultMetadata, ad as ToolSchema, af as buildHookEnv, ag as createAskUserQuestionTool, ah as createFunctionHook, ai as formatAnswerSummary, aj as formatAskUserQuestionPrompt, ak as getInteractionTools, al as matchTool, am as mergeCommandHookLayers, an as questionTool } from '../types-BLf9IqRs.cjs';
1
+ export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, a as SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES, b as SUBAGENT_TYPES, e as SubagentRequest, f as SubagentRunner, g as SubagentType, h as ToolExecuteOptions, T as ToolRegistry, i as ToolRegistryConfig, j as agentTool, k as bashTool, l as createAgentTool, o as createSkillTool, p as createTool, q as editTool, r as getAllBuiltinTools, s as getFileSystemTools, t as getGlobalRegistry, u as getGrepTools, v as getPlanningTools, w as getSafeBuiltinTools, x as getShellTools, y as getSkillTools, z as getSubagentTools, A as getWebTools, B as globTool, E as grepTool, F as loadHooksSettingsFromProject, G as loadHooksSettingsFromUser, H as parseHooksSettingsFile, I as readFileTool, J as resolveSubagentTypeAppend, K as subagentExploreDefaultsUnavailableMessage, L as subagentRequestSchema, N as todoWriteTool, O as truncateMatchLineForDisplay, P as webFetchTool, Q as webSearchTool, R as writeFileTool } from '../index-DzBt4ewK.cjs';
2
+ import { T as ToolResult } from '../types-BUwjMwNH.cjs';
3
+ export { v as AskUserQuestionAnswer, w as AskUserQuestionItem, x as AskUserQuestionResolver, D as CommandHookConfig, H as CreateAskUserQuestionToolOptions, I as FlatCommandHookEntry, J as FunctionHook, K as HookContext, O as HookEventType, Q as HookGroupConfig, R as HookManager, V as HookResult, W as HooksSettings, X as HooksSettingsFile, d as ToolDefinition, av as ToolResultMetadata, ax as ToolSchema, aA as buildHookEnv, aB as createAskUserQuestionTool, aC as createFunctionHook, aD as formatAnswerSummary, aE as formatAskUserQuestionPrompt, aF as getInteractionTools, aH as matchTool, aI as mergeCommandHookLayers, aJ as questionTool } from '../types-BUwjMwNH.cjs';
4
4
  import 'zod';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, c as SubagentRequest, d as SubagentRunner, e as ToolExecuteOptions, T as ToolRegistry, f as ToolRegistryConfig, g as agentTool, h as bashTool, i as createAgentTool, l as createSkillTool, m as createTool, n as editTool, o as getAllBuiltinTools, p as getFileSystemTools, q as getGlobalRegistry, r as getGrepTools, s as getSafeBuiltinTools, t as getShellTools, u as getSkillTools, v as getSubagentTools, w as getTaskTools, x as getWebTools, y as globTool, z as grepTool, A as loadHooksSettingsFromProject, B as loadHooksSettingsFromUser, E as parseHooksSettingsFile, F as readFileTool, G as subagentRequestSchema, H as taskCreateTool, I as taskListTool, J as taskUpdateTool, K as truncateMatchLineForDisplay, L as webFetchTool, N as webSearchTool, O as writeFileTool } from '../index-nEfayAzD.js';
2
- import { T as ToolResult } from '../types-BLf9IqRs.js';
3
- export { o as AskUserQuestionAnswer, p as AskUserQuestionItem, q as AskUserQuestionResolver, u as CommandHookConfig, y as CreateAskUserQuestionToolOptions, F as FlatCommandHookEntry, z as FunctionHook, H as HookContext, B as HookEventType, D as HookGroupConfig, E as HookManager, G as HookResult, I as HooksSettings, J as HooksSettingsFile, c as ToolDefinition, ac as ToolResultMetadata, ad as ToolSchema, af as buildHookEnv, ag as createAskUserQuestionTool, ah as createFunctionHook, ai as formatAnswerSummary, aj as formatAskUserQuestionPrompt, ak as getInteractionTools, al as matchTool, am as mergeCommandHookLayers, an as questionTool } from '../types-BLf9IqRs.js';
1
+ export { C as CreateAgentToolOptions, D as DEFAULT_GREP_HEAD_LIMIT, M as MAX_LINE_LENGTH, a as SUBAGENT_EXPLORE_DEFAULT_TOOL_NAMES, b as SUBAGENT_TYPES, e as SubagentRequest, f as SubagentRunner, g as SubagentType, h as ToolExecuteOptions, T as ToolRegistry, i as ToolRegistryConfig, j as agentTool, k as bashTool, l as createAgentTool, o as createSkillTool, p as createTool, q as editTool, r as getAllBuiltinTools, s as getFileSystemTools, t as getGlobalRegistry, u as getGrepTools, v as getPlanningTools, w as getSafeBuiltinTools, x as getShellTools, y as getSkillTools, z as getSubagentTools, A as getWebTools, B as globTool, E as grepTool, F as loadHooksSettingsFromProject, G as loadHooksSettingsFromUser, H as parseHooksSettingsFile, I as readFileTool, J as resolveSubagentTypeAppend, K as subagentExploreDefaultsUnavailableMessage, L as subagentRequestSchema, N as todoWriteTool, O as truncateMatchLineForDisplay, P as webFetchTool, Q as webSearchTool, R as writeFileTool } from '../index-CnrY1ZA2.js';
2
+ import { T as ToolResult } from '../types-BUwjMwNH.js';
3
+ export { v as AskUserQuestionAnswer, w as AskUserQuestionItem, x as AskUserQuestionResolver, D as CommandHookConfig, H as CreateAskUserQuestionToolOptions, I as FlatCommandHookEntry, J as FunctionHook, K as HookContext, O as HookEventType, Q as HookGroupConfig, R as HookManager, V as HookResult, W as HooksSettings, X as HooksSettingsFile, d as ToolDefinition, av as ToolResultMetadata, ax as ToolSchema, aA as buildHookEnv, aB as createAskUserQuestionTool, aC as createFunctionHook, aD as formatAnswerSummary, aE as formatAskUserQuestionPrompt, aF as getInteractionTools, aH as matchTool, aI as mergeCommandHookLayers, aJ as questionTool } from '../types-BUwjMwNH.js';
4
4
  import 'zod';
5
5
 
6
6
  /**