wave-agent-sdk 0.15.0 → 0.15.2

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 (144) hide show
  1. package/builtin/skills/loop/SKILL.md +29 -3
  2. package/dist/agent.d.ts +11 -2
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +44 -11
  5. package/dist/constants/tools.d.ts +3 -0
  6. package/dist/constants/tools.d.ts.map +1 -1
  7. package/dist/constants/tools.js +3 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/managers/aiManager.d.ts +13 -1
  12. package/dist/managers/aiManager.d.ts.map +1 -1
  13. package/dist/managers/aiManager.js +69 -17
  14. package/dist/managers/hookManager.d.ts.map +1 -1
  15. package/dist/managers/hookManager.js +9 -0
  16. package/dist/managers/mcpManager.d.ts +4 -1
  17. package/dist/managers/mcpManager.d.ts.map +1 -1
  18. package/dist/managers/mcpManager.js +25 -5
  19. package/dist/managers/messageManager.d.ts.map +1 -1
  20. package/dist/managers/messageManager.js +7 -6
  21. package/dist/managers/permissionManager.d.ts +0 -2
  22. package/dist/managers/permissionManager.d.ts.map +1 -1
  23. package/dist/managers/permissionManager.js +0 -30
  24. package/dist/managers/slashCommandManager.d.ts +1 -0
  25. package/dist/managers/slashCommandManager.d.ts.map +1 -1
  26. package/dist/managers/slashCommandManager.js +20 -4
  27. package/dist/managers/subagentManager.d.ts +6 -1
  28. package/dist/managers/subagentManager.d.ts.map +1 -1
  29. package/dist/managers/subagentManager.js +17 -18
  30. package/dist/managers/toolManager.d.ts +6 -0
  31. package/dist/managers/toolManager.d.ts.map +1 -1
  32. package/dist/managers/toolManager.js +41 -1
  33. package/dist/prompts/index.d.ts +1 -2
  34. package/dist/prompts/index.d.ts.map +1 -1
  35. package/dist/prompts/index.js +14 -6
  36. package/dist/services/initializationService.d.ts +0 -2
  37. package/dist/services/initializationService.d.ts.map +1 -1
  38. package/dist/services/initializationService.js +3 -35
  39. package/dist/services/jsonlHandler.d.ts +4 -4
  40. package/dist/services/jsonlHandler.d.ts.map +1 -1
  41. package/dist/services/jsonlHandler.js +4 -13
  42. package/dist/services/memory.d.ts +6 -0
  43. package/dist/services/memory.d.ts.map +1 -1
  44. package/dist/services/memory.js +27 -14
  45. package/dist/services/session.d.ts.map +1 -1
  46. package/dist/services/session.js +3 -12
  47. package/dist/tools/agentTool.d.ts.map +1 -1
  48. package/dist/tools/agentTool.js +16 -4
  49. package/dist/tools/bashTool.d.ts.map +1 -1
  50. package/dist/tools/bashTool.js +2 -5
  51. package/dist/tools/cronCreateTool.d.ts.map +1 -1
  52. package/dist/tools/cronCreateTool.js +71 -6
  53. package/dist/tools/cronDeleteTool.d.ts.map +1 -1
  54. package/dist/tools/cronDeleteTool.js +5 -1
  55. package/dist/tools/cronListTool.d.ts.map +1 -1
  56. package/dist/tools/cronListTool.js +5 -1
  57. package/dist/tools/enterWorktreeTool.d.ts +8 -0
  58. package/dist/tools/enterWorktreeTool.d.ts.map +1 -0
  59. package/dist/tools/enterWorktreeTool.js +144 -0
  60. package/dist/tools/exitWorktreeTool.d.ts +8 -0
  61. package/dist/tools/exitWorktreeTool.d.ts.map +1 -0
  62. package/dist/tools/exitWorktreeTool.js +184 -0
  63. package/dist/tools/skillTool.d.ts.map +1 -1
  64. package/dist/tools/skillTool.js +16 -4
  65. package/dist/tools/taskManagementTools.d.ts.map +1 -1
  66. package/dist/tools/taskManagementTools.js +4 -0
  67. package/dist/tools/toolSearchTool.d.ts +15 -0
  68. package/dist/tools/toolSearchTool.d.ts.map +1 -0
  69. package/dist/tools/toolSearchTool.js +185 -0
  70. package/dist/tools/types.d.ts +19 -0
  71. package/dist/tools/types.d.ts.map +1 -1
  72. package/dist/tools/webFetchTool.d.ts.map +1 -1
  73. package/dist/tools/webFetchTool.js +1 -0
  74. package/dist/types/agent.d.ts +6 -1
  75. package/dist/types/agent.d.ts.map +1 -1
  76. package/dist/types/hooks.d.ts +3 -1
  77. package/dist/types/hooks.d.ts.map +1 -1
  78. package/dist/types/hooks.js +1 -0
  79. package/dist/types/messaging.d.ts +1 -0
  80. package/dist/types/messaging.d.ts.map +1 -1
  81. package/dist/types/session.d.ts +0 -4
  82. package/dist/types/session.d.ts.map +1 -1
  83. package/dist/utils/containerSetup.d.ts.map +1 -1
  84. package/dist/utils/containerSetup.js +4 -6
  85. package/dist/utils/cronToHuman.d.ts +6 -0
  86. package/dist/utils/cronToHuman.d.ts.map +1 -0
  87. package/dist/utils/cronToHuman.js +79 -0
  88. package/dist/utils/isDeferredTool.d.ts +19 -0
  89. package/dist/utils/isDeferredTool.d.ts.map +1 -0
  90. package/dist/utils/isDeferredTool.js +31 -0
  91. package/dist/utils/mcpUtils.d.ts.map +1 -1
  92. package/dist/utils/mcpUtils.js +1 -0
  93. package/dist/utils/messageOperations.d.ts.map +1 -1
  94. package/dist/utils/messageOperations.js +5 -0
  95. package/dist/utils/parseCronExpression.d.ts +6 -0
  96. package/dist/utils/parseCronExpression.d.ts.map +1 -0
  97. package/dist/utils/parseCronExpression.js +74 -0
  98. package/dist/utils/worktreeSession.d.ts +26 -0
  99. package/dist/utils/worktreeSession.d.ts.map +1 -0
  100. package/dist/utils/worktreeSession.js +14 -0
  101. package/dist/utils/worktreeUtils.d.ts +42 -0
  102. package/dist/utils/worktreeUtils.d.ts.map +1 -0
  103. package/dist/utils/worktreeUtils.js +236 -0
  104. package/package.json +1 -1
  105. package/src/agent.ts +61 -12
  106. package/src/constants/tools.ts +3 -0
  107. package/src/index.ts +1 -0
  108. package/src/managers/aiManager.ts +73 -18
  109. package/src/managers/hookManager.ts +10 -0
  110. package/src/managers/mcpManager.ts +32 -6
  111. package/src/managers/messageManager.ts +7 -8
  112. package/src/managers/permissionManager.ts +0 -42
  113. package/src/managers/slashCommandManager.ts +30 -5
  114. package/src/managers/subagentManager.ts +28 -23
  115. package/src/managers/toolManager.ts +47 -1
  116. package/src/prompts/index.ts +17 -6
  117. package/src/services/initializationService.ts +2 -41
  118. package/src/services/jsonlHandler.ts +12 -24
  119. package/src/services/memory.ts +30 -17
  120. package/src/services/session.ts +3 -14
  121. package/src/tools/agentTool.ts +24 -5
  122. package/src/tools/bashTool.ts +2 -5
  123. package/src/tools/cronCreateTool.ts +81 -8
  124. package/src/tools/cronDeleteTool.ts +7 -2
  125. package/src/tools/cronListTool.ts +7 -2
  126. package/src/tools/enterWorktreeTool.ts +183 -0
  127. package/src/tools/exitWorktreeTool.ts +242 -0
  128. package/src/tools/skillTool.ts +24 -4
  129. package/src/tools/taskManagementTools.ts +4 -0
  130. package/src/tools/toolSearchTool.ts +228 -0
  131. package/src/tools/types.ts +19 -0
  132. package/src/tools/webFetchTool.ts +1 -0
  133. package/src/types/agent.ts +6 -0
  134. package/src/types/hooks.ts +4 -0
  135. package/src/types/messaging.ts +1 -0
  136. package/src/types/session.ts +0 -8
  137. package/src/utils/containerSetup.ts +7 -8
  138. package/src/utils/cronToHuman.ts +99 -0
  139. package/src/utils/isDeferredTool.ts +36 -0
  140. package/src/utils/mcpUtils.ts +1 -0
  141. package/src/utils/messageOperations.ts +5 -0
  142. package/src/utils/parseCronExpression.ts +78 -0
  143. package/src/utils/worktreeSession.ts +36 -0
  144. package/src/utils/worktreeUtils.ts +288 -0
@@ -60,6 +60,7 @@ export class McpManager {
60
60
  this.configPath = "";
61
61
  this.workdir = "";
62
62
  this.callbacks = options.callbacks || {};
63
+ this.mcpServers = options.mcpServers;
63
64
  }
64
65
  /**
65
66
  * Initialize MCP manager with working directory and optionally auto-connect
@@ -67,10 +68,17 @@ export class McpManager {
67
68
  async initialize(workdir, autoConnect = false) {
68
69
  this.configPath = join(workdir, ".mcp.json");
69
70
  this.workdir = workdir;
71
+ // Register constructor-provided servers before loading .mcp.json
72
+ if (this.mcpServers) {
73
+ for (const [name, config] of Object.entries(this.mcpServers)) {
74
+ this.addServer(name, config);
75
+ }
76
+ }
70
77
  if (autoConnect) {
71
78
  logger?.debug("Initializing MCP servers...");
72
- // Ensure MCP configuration is loaded
73
- const config = await this.ensureConfigLoaded();
79
+ // Load workspace MCP configuration (always read, merge with any plugin servers already added)
80
+ await this.loadConfig();
81
+ const config = this.config;
74
82
  if (config && config.mcpServers) {
75
83
  // Connect to all configured servers in background to avoid blocking agent initialization
76
84
  Object.keys(config.mcpServers).forEach((serverName) => {
@@ -91,7 +99,7 @@ export class McpManager {
91
99
  }
92
100
  logger?.debug("MCP servers initialization started in background");
93
101
  // Trigger state change callback after starting initialization
94
- this.callbacks.onServersChange?.(this.getAllServers());
102
+ this.callbacks.onMcpServersChange?.(this.getAllServers());
95
103
  }
96
104
  }
97
105
  async ensureConfigLoaded() {
@@ -107,7 +115,19 @@ export class McpManager {
107
115
  }
108
116
  try {
109
117
  const configContent = await fs.readFile(this.configPath, "utf-8");
110
- this.config = resolveMcpConfig(JSON.parse(configContent));
118
+ const workspaceConfig = resolveMcpConfig(JSON.parse(configContent));
119
+ // Merge workspace config with any existing config (e.g., from plugins or constructor)
120
+ // Constructor-provided servers take precedence, then workspace config, then existing config
121
+ const merged = { mcpServers: {} };
122
+ if (this.config) {
123
+ Object.assign(merged.mcpServers, this.config.mcpServers);
124
+ }
125
+ Object.assign(merged.mcpServers, workspaceConfig.mcpServers);
126
+ // Constructor-provided servers override both for same names
127
+ if (this.mcpServers) {
128
+ Object.assign(merged.mcpServers, this.mcpServers);
129
+ }
130
+ this.config = merged;
111
131
  // Initialize server statuses (preserve existing status for already known servers)
112
132
  if (this.config) {
113
133
  for (const [name, config] of Object.entries(this.config.mcpServers)) {
@@ -164,7 +184,7 @@ export class McpManager {
164
184
  if (server) {
165
185
  this.servers.set(name, { ...server, ...updates });
166
186
  // Trigger state change callback
167
- this.callbacks.onServersChange?.(this.getAllServers());
187
+ this.callbacks.onMcpServersChange?.(this.getAllServers());
168
188
  }
169
189
  }
170
190
  addServer(name, config) {
@@ -1 +1 @@
1
- {"version":3,"file":"messageManager.d.ts","sourceRoot":"","sources":["../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I,2BAA2B,CAAC,qBAAqB,EAAE,MAAM,GAAG,IAAI;IAkEvE;;;OAGG;IACI,6BAA6B,CAAC,uBAAuB,EAAE,MAAM,GAAG,IAAI;IAmE3E;;;OAGG;IACI,uBAAuB,IAAI,IAAI;IAItC;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAuBtC;;;OAGG;IACI,qBAAqB,IAAI,IAAI;IAKvB,oBAAoB,IAAI,OAAO,CAAC;QAC3C,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IAKF;;;;OAIG;IACU,eAAe,CAC1B,KAAK,EAAE,MAAM,EACb,gBAAgB,CAAC,EAAE,OAAO,uBAAuB,EAAE,gBAAgB,GAClE,OAAO,CAAC,IAAI,CAAC;IAkGhB;;OAEG;YACW,kBAAkB;IAkBhC,OAAO,CAAC,sBAAsB;IA6B9B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA6BnC;;;;;OAKG;IACI,kBAAkB,CACvB,QAAQ,SAAI,EACZ,gBAAgB,SAAO,GACtB,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAgB3C;;OAEG;IACH,OAAO,CAAC,kCAAkC;IA2B1C;;;;OAIG;IACI,oBAAoB,CAAC,SAAS,SAAK,GAAG,MAAM,EAAE;IAQrD;;OAEG;IACI,kBAAkB,IAAI,IAAI;CAGlC"}
@@ -336,6 +336,7 @@ export class MessageManager {
336
336
  sessionId: this.sessionId,
337
337
  },
338
338
  ],
339
+ timestamp: new Date().toISOString(),
339
340
  ...(usage && { usage }),
340
341
  };
341
342
  // Build new message array: keep the compacted message and last 3 messages
@@ -669,12 +670,12 @@ export class MessageManager {
669
670
  async rewriteSessionFile(messages) {
670
671
  try {
671
672
  const { writeFile } = await import("fs/promises");
672
- const sessionMessages = messages.map((message) => ({
673
- ...message,
674
- timestamp: new Date().toISOString(),
675
- }));
676
- const content = sessionMessages.map((m) => JSON.stringify(m)).join("\n") +
677
- (sessionMessages.length > 0 ? "\n" : "");
673
+ const content = messages
674
+ .map((m) => {
675
+ const { timestamp, ...rest } = m;
676
+ return JSON.stringify({ timestamp, ...rest });
677
+ })
678
+ .join("\n") + (messages.length > 0 ? "\n" : "");
678
679
  await writeFile(this.transcriptPath, content, "utf8");
679
680
  }
680
681
  catch (error) {
@@ -39,8 +39,6 @@ export declare class PermissionManager {
39
39
  private additionalDirectories;
40
40
  private systemAdditionalDirectories;
41
41
  private planFilePath?;
42
- private worktreeName?;
43
- private mainRepoRoot?;
44
42
  private workdir?;
45
43
  private onConfiguredPermissionModeChange?;
46
44
  private _logger?;
@@ -1 +1 @@
1
- {"version":3,"file":"permissionManager.d.ts","sourceRoot":"","sources":["../../src/managers/permissionManager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAkBhD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAiElD,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,wBAAwB,CAAC,EAAE,cAAc,CAAC;IAC1C,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,0DAA0D;IAC1D,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,8DAA8D;IAC9D,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,gEAAgE;IAChE,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;IACvC,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM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PermissionManager {
91
91
  for (const dir of options.systemAdditionalDirectories || []) {
92
92
  this.addSystemAdditionalDirectory(dir);
93
93
  }
94
- this.worktreeName = this.container.get("WorktreeName");
95
- this.mainRepoRoot = this.container.get("MainRepoRoot");
96
94
  this.workdir = this.container.get("Workdir");
97
95
  }
98
96
  /**
@@ -327,34 +325,6 @@ export class PermissionManager {
327
325
  };
328
326
  }
329
327
  }
330
- // 0. Check worktree safety for Write and Edit tools
331
- const currentWorkdir = this.getWorkdir();
332
- if (this.worktreeName &&
333
- this.mainRepoRoot &&
334
- currentWorkdir &&
335
- (context.toolName === WRITE_TOOL_NAME ||
336
- context.toolName === EDIT_TOOL_NAME)) {
337
- const targetPath = context.toolInput?.file_path;
338
- if (targetPath) {
339
- const absoluteTargetPath = path.resolve(currentWorkdir, targetPath);
340
- const isInsideMainRepo = isPathInside(absoluteTargetPath, this.mainRepoRoot);
341
- const isInsideWorktree = isPathInside(absoluteTargetPath, currentWorkdir);
342
- // If it's inside the main repo but NOT inside the current worktree
343
- if (isInsideMainRepo && !isInsideWorktree) {
344
- logger?.warn("Worktree safety violation", {
345
- toolName: context.toolName,
346
- targetPath,
347
- worktreeName: this.worktreeName,
348
- mainRepoRoot: this.mainRepoRoot,
349
- workdir: currentWorkdir,
350
- });
351
- return {
352
- behavior: "deny",
353
- message: `Access denied: You are currently in a worktree session ("${this.worktreeName}"). Modifying files in the main repository (outside the worktree) is not allowed. Please only modify files within the worktree directory: ${currentWorkdir}`,
354
- };
355
- }
356
- }
357
- }
358
328
  // 0. Check denied rules first - Deny always takes precedence
359
329
  for (const rule of this.deniedRules) {
360
330
  if (this.matchesRule(context, rule)) {
@@ -19,6 +19,7 @@ export declare class SlashCommandManager {
19
19
  private get taskManager();
20
20
  private get skillManager();
21
21
  private get subagentManager();
22
+ private get memoryService();
22
23
  private initializeBuiltinCommands;
23
24
  /**
24
25
  * Load custom commands from filesystem
@@ -1 +1 @@
1
- {"version":3,"file":"slashCommandManager.d.ts","sourceRoot":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
41
  get subagentManager() {
42
42
  return this.container.get("SubagentManager");
43
43
  }
44
+ get memoryService() {
45
+ return this.container.get("MemoryService");
46
+ }
44
47
  initializeBuiltinCommands() {
45
48
  // Register built-in clear command
46
49
  this.registerCommand({
@@ -50,6 +53,7 @@ export class SlashCommandManager {
50
53
  handler: async () => {
51
54
  this.aiManager.abortAIMessage();
52
55
  this.messageManager.clearMessages();
56
+ this.memoryService.clearCache();
53
57
  await this.taskManager.syncWithSession();
54
58
  },
55
59
  });
@@ -147,17 +151,29 @@ export class SlashCommandManager {
147
151
  if (subagent) {
148
152
  const messages = subagent.messages;
149
153
  const tokens = subagent.messageManager.getLatestTotalTokens();
150
- const lastTools = subagent.lastTools;
154
+ const usedTools = subagent.usedTools;
151
155
  const toolCount = countToolBlocks(messages);
152
156
  const summary = formatToolTokenSummary(toolCount, tokens);
157
+ const getDisplayParam = (t) => {
158
+ if ((t.stage === "end" || t.stage === "running") &&
159
+ t.compactParams) {
160
+ return t.compactParams;
161
+ }
162
+ const flat = t.parameters.replace(/\n/g, "\\n");
163
+ return flat.length > 30 ? `…${flat.slice(-30)}` : flat;
164
+ };
153
165
  let shortResult = "";
154
166
  if (toolCount > 2) {
155
167
  shortResult += "... ";
156
168
  }
157
- if (lastTools.length > 0) {
158
- shortResult += `${lastTools.join(", ")} `;
159
- }
160
169
  shortResult += summary;
170
+ if (usedTools.length > 0) {
171
+ shortResult +=
172
+ "\n" +
173
+ usedTools
174
+ .map((t) => `${t.name} ${getDisplayParam(t)}`)
175
+ .join("\n");
176
+ }
161
177
  this.messageManager.updateToolBlock({
162
178
  id: toolBlockId,
163
179
  messageId,
@@ -31,7 +31,12 @@ export interface SubagentInstance {
31
31
  toolManager: ToolManager;
32
32
  status: "initializing" | "active" | "completed" | "error" | "aborted";
33
33
  messages: Message[];
34
- lastTools: string[];
34
+ usedTools: {
35
+ name: string;
36
+ parameters: string;
37
+ compactParams?: string;
38
+ stage?: string;
39
+ }[];
35
40
  subagentType: string;
36
41
  description: string;
37
42
  allowedTools?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"subagentManager.d.ts","sourceRoot":"","sources":["../../src/managers/subagentManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS/C,OAAO,EACL,iBAAiB,EACjB,KAAK,0BAA0B,EAChC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,WAAW,wBAAwB;IAEvC,gDAAgD;IAChD,0BAA0B,CAAC,EAAE,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,KACtB,IAAI,CAAC;IACV,wDAAwD;IACxD,+BAA+B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,0DAA0D;IAC1D,iCAAiC,CAAC,EAAE,CAClC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,KAChB,IAAI,CAAC;IACV,4DAA4D;IAC5D,mCAAmC,CAAC,EAAE,CACpC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,KAChB,IAAI,CAAC;IACV,oDAAoD;IACpD,0BAA0B,CAAC,EAAE,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,0BAA0B,KAC/B,IAAI,CAAC;IACV,8CAA8C;I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QACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,CAAC,EAAE,cAAc,CAAC;QACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,EACD,eAAe,CAAC,EAAE,OAAO,EACzB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,gBAAgB,CAAC;IAkJ5B;;;;;OAKG;IACG,YAAY,CAChB,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAAC,MAAM,CAAC;IAiFZ,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YA6C/C,eAAe;IAmJ7B;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAIxD;;OAEG;IACH,oBAAoB,CAClB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GACjC,IAAI;IAOP;;OAEG;IACH,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAOhE;;OAEG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAazC;;OAEG;IACH,kBAAkB,IAAI,gBAAgB,EAAE;IAOxC;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;OAGG;IACH,OAAO,CAAC,uBAAuB;CA+FhC"}
@@ -225,7 +225,7 @@ export class SubagentManager {
225
225
  toolManager,
226
226
  status: "initializing",
227
227
  messages: [],
228
- lastTools: [], // Initialize lastTools
228
+ usedTools: [], // Initialize usedTools
229
229
  subagentType: parameters.subagent_type, // Store the subagent type
230
230
  description: parameters.description, // Store the AI-generated description
231
231
  allowedTools: parameters.allowedTools, // Store optional permission rules
@@ -548,23 +548,13 @@ export class SubagentManager {
548
548
  }
549
549
  },
550
550
  onToolBlockUpdated: (params) => {
551
- // Track last two tool names when a tool starts running
552
- if (params.stage === "running" && params.name) {
553
- const instance = this.instances.get(subagentId);
554
- if (instance) {
555
- // Add to lastTools if it's different from the last one or we want to show duplicates
556
- // Based on "ToolA, ToolB" requirement, we'll just keep the last two
557
- instance.lastTools.push(params.name);
558
- if (instance.lastTools.length > 2) {
559
- instance.lastTools.shift();
560
- }
561
- instance.onUpdate?.();
562
- // Log tool execution to file
563
- if (instance.logStream) {
564
- const displayParams = params.compactParams ||
565
- (params.parameters || "{}").substring(0, 100);
566
- instance.logStream.write(`[${new Date().toISOString()}] ${params.name}${displayParams ? ` ${displayParams}` : ""}\n`);
567
- }
551
+ const instance = this.instances.get(subagentId);
552
+ if (instance) {
553
+ // Log tool execution to file only when finalized
554
+ if (instance.logStream && params.stage === "end") {
555
+ const displayParams = params.compactParams ||
556
+ (params.parameters || "").substring(0, 100);
557
+ instance.logStream.write(`[${new Date().toISOString()}] ${params.name}${displayParams ? ` ${displayParams}` : ""}\n`);
568
558
  }
569
559
  }
570
560
  // Forward tool block updates to parent via SubagentManager callbacks
@@ -577,6 +567,15 @@ export class SubagentManager {
577
567
  const instance = this.instances.get(subagentId);
578
568
  if (instance) {
579
569
  instance.messages = messages;
570
+ // Compute usedTools from messages (last 2 tool blocks)
571
+ const toolBlocks = messages.flatMap((m) => m.blocks?.filter((b) => b.type === "tool") ?? []);
572
+ const last2 = toolBlocks.slice(-2);
573
+ instance.usedTools = last2.map((tb) => ({
574
+ name: tb.name ?? "",
575
+ parameters: tb.parameters ?? "",
576
+ compactParams: tb.compactParams,
577
+ stage: tb.stage,
578
+ }));
580
579
  // Trigger the onUpdate callback if provided
581
580
  instance.onUpdate?.();
582
581
  // Forward subagent message changes to parent via callbacks
@@ -74,6 +74,8 @@ declare class ToolManager {
74
74
  availableSkills?: SkillMetadata[];
75
75
  workdir?: string;
76
76
  isSubagent?: boolean;
77
+ /** Set of discovered deferred tool names to include in the API call */
78
+ discoveredTools?: Set<string>;
77
79
  }): ChatCompletionFunctionTool[];
78
80
  /**
79
81
  * Get the list of registered tool plugins
@@ -92,6 +94,10 @@ declare class ToolManager {
92
94
  * Get the permission manager
93
95
  */
94
96
  getPermissionManager(): PermissionManager | undefined;
97
+ /**
98
+ * Get the names of all deferred tools (those that require ToolSearch to discover).
99
+ */
100
+ getDeferredToolNames(): string[];
95
101
  /**
96
102
  * Get the task manager
97
103
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toolManager.d.ts","sourceRoot":"","sources":["../../src/managers/toolManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA0B7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;GAKG;AACH,cAAM,WAAW;IACf,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,KAAK,CAAC,CAAW;IACzB,OAAO,CAAC,SAAS,CAAY;gBAEjB,OAAO,EAAE,kBAAkB;IAKvC,OAAO,KAAK,UAAU,GAErB;IAED;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAIvC;;;;;;;;;;;;;;;;;;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BAAoB,IAAI,iBAAiB,GAAG,SAAS;IAI5D;;OAEG;IACI,oBAAoB,IAAI,MAAM,EAAE;IAcvC;;OAEG;IACI,cAAc,IACjB,OAAO,4BAA4B,EAAE,WAAW,GAChD,SAAS;CAKd;AAGD,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -17,8 +17,12 @@ import { lspTool } from "../tools/lspTool.js";
17
17
  import { agentTool } from "../tools/agentTool.js";
18
18
  import { skillTool } from "../tools/skillTool.js";
19
19
  import { taskCreateTool, taskGetTool, taskUpdateTool, taskListTool, } from "../tools/taskManagementTools.js";
20
+ import { enterWorktreeTool } from "../tools/enterWorktreeTool.js";
21
+ import { exitWorktreeTool } from "../tools/exitWorktreeTool.js";
20
22
  import * as aiService from "../services/aiService.js";
21
23
  import { logger } from "../utils/globalLogger.js";
24
+ import { toolSearchTool } from "../tools/toolSearchTool.js";
25
+ import { isDeferredTool } from "../utils/isDeferredTool.js";
22
26
  /**
23
27
  * Tool Manager
24
28
  *
@@ -86,6 +90,9 @@ class ToolManager {
86
90
  cronDeleteTool,
87
91
  cronListTool,
88
92
  webFetchTool,
93
+ enterWorktreeTool,
94
+ exitWorktreeTool,
95
+ toolSearchTool,
89
96
  ];
90
97
  for (const tool of builtInTools) {
91
98
  if (this.shouldEnableTool(tool.name)) {
@@ -138,6 +145,7 @@ class ToolManager {
138
145
  permissionMode: effectivePermissionMode,
139
146
  canUseToolCallback,
140
147
  permissionManager,
148
+ toolManager: this, // Allow ToolSearchTool to access the tool manager
141
149
  taskManager: this.container.get("TaskManager"),
142
150
  reversionManager: this.container.get("ReversionManager"),
143
151
  backgroundTaskManager: this.container.get("BackgroundTaskManager"),
@@ -158,6 +166,9 @@ class ToolManager {
158
166
  : undefined,
159
167
  aiService: aiService,
160
168
  messageManager: this.container.get("MessageManager"),
169
+ hookManager: this.container.has("HookManager")
170
+ ? this.container.get("HookManager")
171
+ : undefined,
161
172
  sessionId: context.sessionId,
162
173
  toolCallId: context.toolCallId,
163
174
  };
@@ -207,6 +218,7 @@ class ToolManager {
207
218
  getToolsConfig(options) {
208
219
  const permissionManager = this.container.get("PermissionManager");
209
220
  const effectivePermissionMode = this.getPermissionMode();
221
+ const discoveredTools = options?.discoveredTools;
210
222
  const builtInToolsConfig = Array.from(this.toolsRegistry.values())
211
223
  .filter((tool) => {
212
224
  // If tool is explicitly denied by name in permission rules, filter it out
@@ -227,6 +239,10 @@ class ToolManager {
227
239
  return (effectivePermissionMode !== "plan" &&
228
240
  effectivePermissionMode !== "bypassPermissions");
229
241
  }
242
+ // Exclude deferred tools that haven't been discovered yet
243
+ if (isDeferredTool(tool) && !discoveredTools?.has(tool.name)) {
244
+ return false;
245
+ }
230
246
  return true;
231
247
  })
232
248
  .map((tool) => {
@@ -245,7 +261,16 @@ class ToolManager {
245
261
  });
246
262
  const mcpToolsConfig = this.mcpManager
247
263
  .getMcpToolsConfig()
248
- .filter((tool) => !permissionManager?.isToolDenied(tool.function.name));
264
+ .filter((tool) => {
265
+ if (permissionManager?.isToolDenied(tool.function.name)) {
266
+ return false;
267
+ }
268
+ // Exclude MCP tools that haven't been discovered yet
269
+ if (discoveredTools && !discoveredTools.has(tool.function.name)) {
270
+ return false;
271
+ }
272
+ return true;
273
+ });
249
274
  return [...builtInToolsConfig, ...mcpToolsConfig];
250
275
  }
251
276
  /**
@@ -280,6 +305,21 @@ class ToolManager {
280
305
  getPermissionManager() {
281
306
  return this.container.get("PermissionManager");
282
307
  }
308
+ /**
309
+ * Get the names of all deferred tools (those that require ToolSearch to discover).
310
+ */
311
+ getDeferredToolNames() {
312
+ const permissionManager = this.container.get("PermissionManager");
313
+ const builtInDeferred = Array.from(this.toolsRegistry.values())
314
+ .filter((tool) => isDeferredTool(tool))
315
+ .filter((tool) => !permissionManager?.isToolDenied(tool.name))
316
+ .map((tool) => tool.name);
317
+ const mcpDeferred = this.mcpManager
318
+ .getMcpToolsConfig()
319
+ .filter((tool) => !permissionManager?.isToolDenied(tool.function.name))
320
+ .map((tool) => tool.function.name);
321
+ return [...builtInDeferred, ...mcpDeferred];
322
+ }
283
323
  /**
284
324
  * Get the task manager
285
325
  */
@@ -1,10 +1,9 @@
1
1
  import { ToolPlugin } from "../tools/types.js";
2
2
  import { PermissionMode } from "../types/permissions.js";
3
- export declare const MAX_PARALLEL_TOOL_CALLS = 3;
4
3
  export declare const BASE_SYSTEM_PROMPT = "You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.";
5
4
  export declare const DOING_TASKS_PROMPT = "# Doing tasks\n- The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change \"methodName\" to snake case, do not reply with just \"method_name\", instead find the method in the code and modify the code.\n- You are highly capable and often allow users to complete ambitious tasks that would otherwise be too complex or take too long. You should defer to user judgement about whether a task is too large to attempt.\n- If you notice the user's request is based on a misconception, or spot a bug adjacent to what they asked about, say so. You're a collaborator, not just an executor\u2014users benefit from your judgment, not just your compliance.\n- In general, do not propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.\n- Do not create files unless they're absolutely necessary for achieving your goal. Generally prefer editing an existing file to creating a new one, as this prevents file bloat and builds on existing work more effectively.\n- If an approach fails, diagnose why before switching tactics\u2014read the error, check your assumptions, try a focused fix. Don't retry the identical action blindly, but don't abandon a viable approach after a single failure either. Escalate to the user with AskUserQuestion only when you're genuinely stuck after investigation, not as a first response to friction.\n- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it. Prioritize writing safe, secure, and correct code.\n- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.\n - Don't add features, refactor code, or make \"improvements\" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.\n - Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.\n - Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is what the task actually requires\u2014no speculative abstractions, but no half-finished implementations either. Three similar lines of code is better than a premature abstraction.\n- Avoid backwards-compatibility hacks like renaming unused _vars, re-exporting types, adding // removed comments for removed code, etc. If you are certain that something is unused, you can delete it completely.\n- Report outcomes faithfully: if tests fail, say so with the relevant output; if you did not run a verification step, say that rather than implying it succeeded. Never claim \"all tests pass\" when output shows failures, never suppress or simplify failing checks (tests, lints, type errors) to manufacture a green result, and never characterize incomplete or broken work as done. Equally, when a check did pass or a task is complete, state it plainly \u2014 do not hedge confirmed results with unnecessary disclaimers, downgrade finished work to \"partial,\" or re-verify things you already checked. The goal is an accurate report, not a defensive one.\n- Before reporting a task complete, verify it actually works: run the test, execute the script, check the output. Minimum complexity means no gold-plating, not skipping the finish line. If you can't verify (no test exists, can't run the code), say so explicitly rather than claiming success.";
6
5
  export declare const EXECUTING_ACTIONS_PROMPT = "# Executing actions with care\n\nCarefully consider the reversibility and blast radius of actions. Generally you can freely take local, reversible actions like editing files or running tests. But for actions that are hard to reverse, affect shared systems beyond your local environment, or could otherwise be risky or destructive, check with the user before proceeding. The cost of pausing to confirm is low, while the cost of an unwanted action (lost work, unintended messages sent, deleted branches) can be very high. For actions like these, consider the context, the action, and user instructions, and by default transparently communicate the action and ask for confirmation before proceeding.\n\nExamples of the kind of risky actions that warrant user confirmation:\n- Destructive operations: deleting files/branches, dropping database tables, killing processes, rm -rf, overwriting uncommitted changes\n- Hard-to-reverse operations: force-pushing (can also overwrite upstream), git reset --hard, amending published commits, removing or downgrading packages/dependencies, modifying CI/CD pipelines\n- Actions visible to others or that affect shared state: pushing code, creating/closing/commenting on PRs or issues, sending messages (Slack, email, GitHub), posting to external services\n\nWhen you encounter an obstacle, do not use destructive actions as a shortcut to simply make it go away. For instance, try to identify root causes and fix underlying issues rather than bypassing safety checks (e.g. --no-verify). If you discover unexpected state like unfamiliar files, branches, or configuration, investigate before deleting or overwriting, as it may represent the user's in-progress work. For example, typically resolve merge conflicts rather than discarding changes. In short: only take risky actions carefully, and when in doubt, ask before acting. Follow both the spirit and letter of these instructions - measure twice, cut once.";
7
- export declare const TOOL_POLICY = "# Using your tools\n\n- Do NOT use the Bash to run commands when a relevant dedicated tool is provided. Using dedicated tools allows the user to better understand and review your work. This is CRITICAL to assisting the user:\n - To read files use Read instead of cat, head, tail, or sed\n - To edit files use Edit instead of sed or awk\n - To create files use Write instead of cat with heredoc or echo redirection\n - To search for files use Glob instead of find or ls\n - To search the content of files, use Grep instead of grep or rg\n - Reserve using the Bash exclusively for system commands and terminal operations that require shell execution. If you are unsure and there is a relevant dedicated tool, default to using the dedicated tool and only fallback on using the Bash tool for these if it is absolutely necessary.\n- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.\n- **Limit**: You MUST NOT call more than 3 tools in parallel in a single response.\n- However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.\n- If the user specifies that they want you to run tools \"in parallel\", you MUST send a single message with multiple tool use content blocks.";
6
+ export declare const TOOL_POLICY = "# Using your tools\n\n- Do NOT use the Bash to run commands when a relevant dedicated tool is provided. Using dedicated tools allows the user to better understand and review your work. This is CRITICAL to assisting the user:\n - To read files use Read instead of cat, head, tail, or sed\n - To edit files use Edit instead of sed or awk\n - To create files use Write instead of cat with heredoc or echo redirection\n - To search for files use Glob instead of find or ls\n - To search the content of files, use Grep instead of grep or rg\n - Reserve using the Bash exclusively for system commands and terminal operations that require shell execution. If you are unsure and there is a relevant dedicated tool, default to using the dedicated tool and only fallback on using the Bash tool for these if it is absolutely necessary.\n- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.\n- However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.\n- If the user specifies that they want you to run tools \"in parallel\", you MUST send a single message with multiple tool use content blocks.";
8
7
  /**
9
8
  * Reference: /home/liuyiqi/github/claude-code/src/constants/prompts.ts getOutputEfficiencySection
10
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiBzD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,eAAO,MAAM,kBAAkB,oKAAoK,CAAC;AAEpM,eAAO,MAAM,kBAAkB,opIAcqQ,CAAC;AAErS,eAAO,MAAM,wBAAwB,25DASqmB,CAAC;AAE3oB,eAAO,MAAM,WAAW,knDAYqH,CAAC;AAE9I;;GAEG;AACH,eAAO,MAAM,wBAAwB,+uBAWiH,CAAC;AAEvJ,eAAO,MAAM,qBAAqB,6sBAMuL,CAAC;AAE1N,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,UAAU,GAAE,OAAe,GAC1B,MAAM,CAmFR;AAED,eAAO,MAAM,qBAAqB,oKAAqB,CAAC;AAExD,eAAO,MAAM,8BAA8B,44DA8CI,CAAC;AAEhD,eAAO,MAAM,yBAAyB,wHAAwH,CAAC;AAC/J,eAAO,MAAM,iBAAiB,qWAG4B,CAAC;AAE3D,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE;IACP,OAA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/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,cAAc,CAAC,EAAE,cAAc,CAAC;CAC5B,GACL,MAAM,CAuER;AAED,wBAAgB,iCAAiC,CAC/C,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM,GACd,MAAM,CAkCR"}
@@ -1,9 +1,10 @@
1
1
  import * as os from "node:os";
2
2
  import { isGitRepository } from "../utils/gitUtils.js";
3
+ import { getCurrentWorktreeSession } from "../utils/worktreeSession.js";
3
4
  import { buildAutoMemoryPrompt } from "./autoMemory.js";
4
5
  import { EXPLORE_SUBAGENT_TYPE, PLAN_SUBAGENT_TYPE, } from "../constants/subagents.js";
5
- import { ASK_USER_QUESTION_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, AGENT_TOOL_NAME, BASH_TOOL_NAME, READ_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME, } from "../constants/tools.js";
6
- export const MAX_PARALLEL_TOOL_CALLS = 3;
6
+ import { ASK_USER_QUESTION_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, EXIT_PLAN_MODE_TOOL_NAME, AGENT_TOOL_NAME, BASH_TOOL_NAME, READ_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME, TOOL_SEARCH_TOOL_NAME, } from "../constants/tools.js";
7
+ import { isDeferredTool } from "../utils/isDeferredTool.js";
7
8
  export const BASE_SYSTEM_PROMPT = `You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.`;
8
9
  export const DOING_TASKS_PROMPT = `# Doing tasks
9
10
  - The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.
@@ -40,7 +41,6 @@ export const TOOL_POLICY = `# Using your tools
40
41
  - To search the content of files, use ${GREP_TOOL_NAME} instead of grep or rg
41
42
  - Reserve using the ${BASH_TOOL_NAME} exclusively for system commands and terminal operations that require shell execution. If you are unsure and there is a relevant dedicated tool, default to using the dedicated tool and only fallback on using the ${BASH_TOOL_NAME} tool for these if it is absolutely necessary.
42
43
  - You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.
43
- - **Limit**: You MUST NOT call more than ${MAX_PARALLEL_TOOL_CALLS} tools in parallel in a single response.
44
44
  - However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.
45
45
  - If the user specifies that they want you to run tools "in parallel", you MUST send a single message with multiple tool use content blocks.`;
46
46
  /**
@@ -207,6 +207,12 @@ export function buildSystemPrompt(basePrompt, tools, options = {}) {
207
207
  if (tools.length > 0) {
208
208
  prompt += `\n\n${TOOL_POLICY}`;
209
209
  }
210
+ // List available deferred tool names so the model knows they exist
211
+ // Matching Claude Code: deferred tools appear by name, not loaded until fetched.
212
+ const deferredToolNames = tools.filter(isDeferredTool).map((t) => t.name);
213
+ if (deferredToolNames.length > 0) {
214
+ prompt += `\n\n<available-deferred-tools>${deferredToolNames.join(" ")}\nThese tools are NOT loaded yet — call ${TOOL_SEARCH_TOOL_NAME} first to discover their schemas before invoking them.</available-deferred-tools>`;
215
+ }
210
216
  prompt += `\n\n${OUTPUT_EFFICIENCY_PROMPT}`;
211
217
  prompt += `\n\n${TONE_AND_STYLE_PROMPT}`;
212
218
  if (options.permissionMode === "dontAsk") {
@@ -229,11 +235,12 @@ export function buildSystemPrompt(basePrompt, tools, options = {}) {
229
235
  : shell.includes("bash")
230
236
  ? "bash"
231
237
  : shell;
238
+ const worktreeSession = getCurrentWorktreeSession();
232
239
  prompt += `
233
240
 
234
241
  Here is useful information about the environment you are running in:
235
242
  <env>
236
- Working directory: ${options.workdir}
243
+ Working directory: ${options.workdir}${worktreeSession ? `\nThis is a git worktree — an isolated copy of the repository. Run all commands from this directory. Do NOT \`cd\` to the original repository root at ${worktreeSession.originalCwd}.` : ""}
237
244
  Is directory a git repo: ${isGitRepo}
238
245
  Platform: ${platform}
239
246
  Shell: ${shellName}
@@ -264,8 +271,9 @@ export function enhanceSystemPromptWithEnvDetails(existingSystemPrompt, workdir)
264
271
  : shell.includes("bash")
265
272
  ? "bash"
266
273
  : shell;
274
+ const worktreeSession = getCurrentWorktreeSession();
267
275
  const notes = `Notes:
268
- - Agent threads always have their cwd reset between bash calls, as a result please only use absolute file paths.
276
+ - Agent threads always have their cwd reset between bash calls, as a result please only use absolute file paths.${worktreeSession ? `\n- You are in a git worktree at ${worktreeSession.worktreePath} (branch: ${worktreeSession.worktreeBranch}). Absolute paths from prior context may refer to the original repo at ${worktreeSession.originalCwd}; translate them to your worktree. Do NOT edit files outside this worktree.` : ""}
269
277
  - In your final response, share file paths (always absolute, never relative) that are relevant to the task. Include code snippets only when the exact text is load-bearing (e.g., a bug you found, a function signature the caller asked for) — do not recap code you merely read.
270
278
  - For clear communication with the user the assistant MUST avoid using emojis.
271
279
  - Do not use a colon before tool calls. Text like "Let me read the file:" followed by a read tool call should just be "Let me read the file." with a period.`;
@@ -275,7 +283,7 @@ ${notes}
275
283
 
276
284
  Here is useful information about the environment you are running in:
277
285
  <env>
278
- Working directory: ${workdir}
286
+ Working directory: ${workdir}${worktreeSession ? `\nThis is a git worktree — an isolated copy of the repository. Run all commands from this directory. Do NOT \`cd\` to the original repository root at ${worktreeSession.originalCwd}.` : ""}
279
287
  Is directory a git repo: ${isGitRepo}
280
288
  Platform: ${platform}
281
289
  Shell: ${shellName}
@@ -30,8 +30,6 @@ export interface InitializationContext {
30
30
  memoryRuleManager: MemoryRuleManager;
31
31
  liveConfigManager: LiveConfigManager;
32
32
  taskManager: TaskManager;
33
- setProjectMemory: (content: string) => void;
34
- setUserMemory: (content: string) => void;
35
33
  resolveAndValidateConfig: () => void;
36
34
  }
37
35
  export declare class InitializationService {
@@ -1 +1 @@
1
- {"version":3,"file":"initializationService.d.ts","sourceRoot":"","sources":["../../src/services/initializationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;IACxB,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,wBAAwB,EAAE,MAAM,IAAI,CAAC;CACtC;AAED,qBAAa,qBAAqB;WACZ,UAAU,CAC5B,OAAO,EAAE,qBAAqB,EAC9B,OAAO,CAAC,EAAE;QACR,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,GACA,OAAO,CAAC,IAAI,CAAC;CAyTjB"}
1
+ {"version":3,"file":"initializationService.d.ts","sourceRoot":"","sources":["../../src/services/initializationService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EACP,MA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