@office-ai/aioncli-core 0.8.1 → 0.18.4

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 (777) hide show
  1. package/dist/index.d.ts +8 -2
  2. package/dist/index.js +7 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/agents/codebase-investigator.d.ts +36 -1
  5. package/dist/src/agents/codebase-investigator.js +93 -34
  6. package/dist/src/agents/codebase-investigator.js.map +1 -1
  7. package/dist/src/agents/codebase-investigator.test.d.ts +6 -0
  8. package/dist/src/agents/codebase-investigator.test.js +35 -0
  9. package/dist/src/agents/codebase-investigator.test.js.map +1 -0
  10. package/dist/src/agents/executor.d.ts +37 -11
  11. package/dist/src/agents/executor.js +512 -150
  12. package/dist/src/agents/executor.js.map +1 -1
  13. package/dist/src/agents/executor.test.js +1188 -245
  14. package/dist/src/agents/executor.test.js.map +1 -1
  15. package/dist/src/agents/invocation.d.ts +5 -2
  16. package/dist/src/agents/invocation.js +4 -2
  17. package/dist/src/agents/invocation.js.map +1 -1
  18. package/dist/src/agents/invocation.test.js +9 -0
  19. package/dist/src/agents/invocation.test.js.map +1 -1
  20. package/dist/src/agents/registry.d.ts +6 -1
  21. package/dist/src/agents/registry.js +51 -4
  22. package/dist/src/agents/registry.js.map +1 -1
  23. package/dist/src/agents/registry.test.js +30 -16
  24. package/dist/src/agents/registry.test.js.map +1 -1
  25. package/dist/src/agents/subagent-tool-wrapper.d.ts +3 -1
  26. package/dist/src/agents/subagent-tool-wrapper.js +4 -3
  27. package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
  28. package/dist/src/agents/subagent-tool-wrapper.test.js +9 -4
  29. package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
  30. package/dist/src/agents/types.d.ts +37 -7
  31. package/dist/src/agents/types.js +2 -0
  32. package/dist/src/agents/types.js.map +1 -1
  33. package/dist/src/code_assist/codeAssist.js +1 -1
  34. package/dist/src/code_assist/codeAssist.test.d.ts +6 -0
  35. package/dist/src/code_assist/codeAssist.test.js +99 -0
  36. package/dist/src/code_assist/codeAssist.test.js.map +1 -0
  37. package/dist/src/code_assist/converter.d.ts +1 -0
  38. package/dist/src/code_assist/converter.js +1 -0
  39. package/dist/src/code_assist/converter.js.map +1 -1
  40. package/dist/src/code_assist/converter.test.js +19 -0
  41. package/dist/src/code_assist/converter.test.js.map +1 -1
  42. package/dist/src/code_assist/experiments/client_metadata.d.ts +12 -0
  43. package/dist/src/code_assist/experiments/client_metadata.js +50 -0
  44. package/dist/src/code_assist/experiments/client_metadata.js.map +1 -0
  45. package/dist/src/code_assist/experiments/client_metadata.test.d.ts +6 -0
  46. package/dist/src/code_assist/experiments/client_metadata.test.js +99 -0
  47. package/dist/src/code_assist/experiments/client_metadata.test.js.map +1 -0
  48. package/dist/src/code_assist/experiments/experiments.d.ts +17 -0
  49. package/dist/src/code_assist/experiments/experiments.js +36 -0
  50. package/dist/src/code_assist/experiments/experiments.js.map +1 -0
  51. package/dist/src/code_assist/experiments/experiments.test.d.ts +6 -0
  52. package/dist/src/code_assist/experiments/experiments.test.js +92 -0
  53. package/dist/src/code_assist/experiments/experiments.test.js.map +1 -0
  54. package/dist/src/code_assist/experiments/flagNames.d.ts +13 -0
  55. package/dist/src/code_assist/experiments/flagNames.js +13 -0
  56. package/dist/src/code_assist/experiments/flagNames.js.map +1 -0
  57. package/dist/src/code_assist/experiments/types.d.ts +35 -0
  58. package/dist/src/code_assist/experiments/types.js +7 -0
  59. package/dist/src/code_assist/experiments/types.js.map +1 -0
  60. package/dist/src/code_assist/oauth-credential-storage.js +6 -5
  61. package/dist/src/code_assist/oauth-credential-storage.js.map +1 -1
  62. package/dist/src/code_assist/oauth-credential-storage.test.js +65 -3
  63. package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -1
  64. package/dist/src/code_assist/oauth2.d.ts +2 -2
  65. package/dist/src/code_assist/oauth2.js +161 -93
  66. package/dist/src/code_assist/oauth2.js.map +1 -1
  67. package/dist/src/code_assist/oauth2.test.js +103 -57
  68. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  69. package/dist/src/code_assist/server.d.ts +6 -4
  70. package/dist/src/code_assist/server.js +16 -8
  71. package/dist/src/code_assist/server.js.map +1 -1
  72. package/dist/src/code_assist/server.test.js +126 -28
  73. package/dist/src/code_assist/server.test.js.map +1 -1
  74. package/dist/src/code_assist/setup.d.ts +2 -2
  75. package/dist/src/code_assist/setup.js +4 -2
  76. package/dist/src/code_assist/setup.js.map +1 -1
  77. package/dist/src/code_assist/types.d.ts +1 -1
  78. package/dist/src/code_assist/types.js.map +1 -1
  79. package/dist/src/commands/extensions.d.ts +7 -0
  80. package/dist/src/commands/extensions.js +9 -0
  81. package/dist/src/commands/extensions.js.map +1 -0
  82. package/dist/src/commands/extensions.test.d.ts +6 -0
  83. package/dist/src/commands/extensions.test.js +19 -0
  84. package/dist/src/commands/extensions.test.js.map +1 -0
  85. package/dist/src/config/config.d.ts +169 -43
  86. package/dist/src/config/config.js +418 -79
  87. package/dist/src/config/config.js.map +1 -1
  88. package/dist/src/config/config.test.js +684 -49
  89. package/dist/src/config/config.test.js.map +1 -1
  90. package/dist/src/config/defaultModelConfigs.d.ts +7 -0
  91. package/dist/src/config/defaultModelConfigs.js +185 -0
  92. package/dist/src/config/defaultModelConfigs.js.map +1 -0
  93. package/dist/src/config/models.d.ts +23 -2
  94. package/dist/src/config/models.js +50 -7
  95. package/dist/src/config/models.js.map +1 -1
  96. package/dist/src/config/models.test.js +71 -10
  97. package/dist/src/config/models.test.js.map +1 -1
  98. package/dist/src/config/storage.d.ts +3 -1
  99. package/dist/src/config/storage.js +22 -2
  100. package/dist/src/config/storage.js.map +1 -1
  101. package/dist/src/config/storage.test.js +7 -6
  102. package/dist/src/config/storage.test.js.map +1 -1
  103. package/dist/src/confirmation-bus/message-bus.d.ts +3 -2
  104. package/dist/src/confirmation-bus/message-bus.js +9 -3
  105. package/dist/src/confirmation-bus/message-bus.js.map +1 -1
  106. package/dist/src/confirmation-bus/message-bus.test.js +30 -24
  107. package/dist/src/confirmation-bus/message-bus.test.js.map +1 -1
  108. package/dist/src/confirmation-bus/types.d.ts +13 -2
  109. package/dist/src/confirmation-bus/types.js +1 -0
  110. package/dist/src/confirmation-bus/types.js.map +1 -1
  111. package/dist/src/core/apiKeyCredentialStorage.d.ts +17 -0
  112. package/dist/src/core/apiKeyCredentialStorage.js +64 -0
  113. package/dist/src/core/apiKeyCredentialStorage.js.map +1 -0
  114. package/dist/src/core/apiKeyCredentialStorage.test.d.ts +6 -0
  115. package/dist/src/core/apiKeyCredentialStorage.test.js +71 -0
  116. package/dist/src/core/apiKeyCredentialStorage.test.js.map +1 -0
  117. package/dist/src/core/baseLlmClient.d.ts +4 -8
  118. package/dist/src/core/baseLlmClient.js +6 -11
  119. package/dist/src/core/baseLlmClient.js.map +1 -1
  120. package/dist/src/core/baseLlmClient.test.js +22 -27
  121. package/dist/src/core/baseLlmClient.test.js.map +1 -1
  122. package/dist/src/core/client.d.ts +12 -19
  123. package/dist/src/core/client.js +104 -206
  124. package/dist/src/core/client.js.map +1 -1
  125. package/dist/src/core/client.test.js +329 -452
  126. package/dist/src/core/client.test.js.map +1 -1
  127. package/dist/src/core/contentGenerator.d.ts +3 -2
  128. package/dist/src/core/contentGenerator.js +56 -41
  129. package/dist/src/core/contentGenerator.js.map +1 -1
  130. package/dist/src/core/contentGenerator.test.js +49 -1
  131. package/dist/src/core/contentGenerator.test.js.map +1 -1
  132. package/dist/src/core/coreToolScheduler.d.ts +8 -4
  133. package/dist/src/core/coreToolScheduler.js +348 -179
  134. package/dist/src/core/coreToolScheduler.js.map +1 -1
  135. package/dist/src/core/coreToolScheduler.test.js +575 -219
  136. package/dist/src/core/coreToolScheduler.test.js.map +1 -1
  137. package/dist/src/core/fakeContentGenerator.d.ts +33 -0
  138. package/dist/src/core/fakeContentGenerator.js +58 -0
  139. package/dist/src/core/fakeContentGenerator.js.map +1 -0
  140. package/dist/src/core/fakeContentGenerator.test.d.ts +6 -0
  141. package/dist/src/core/fakeContentGenerator.test.js +127 -0
  142. package/dist/src/core/fakeContentGenerator.test.js.map +1 -0
  143. package/dist/src/core/geminiChat.d.ts +23 -18
  144. package/dist/src/core/geminiChat.js +186 -108
  145. package/dist/src/core/geminiChat.js.map +1 -1
  146. package/dist/src/core/geminiChat.test.js +581 -270
  147. package/dist/src/core/geminiChat.test.js.map +1 -1
  148. package/dist/src/core/logger.d.ts +7 -2
  149. package/dist/src/core/logger.js +35 -27
  150. package/dist/src/core/logger.js.map +1 -1
  151. package/dist/src/core/logger.test.js +45 -29
  152. package/dist/src/core/logger.test.js.map +1 -1
  153. package/dist/src/core/loggingContentGenerator.d.ts +1 -0
  154. package/dist/src/core/loggingContentGenerator.js +113 -33
  155. package/dist/src/core/loggingContentGenerator.js.map +1 -1
  156. package/dist/src/core/loggingContentGenerator.test.d.ts +6 -0
  157. package/dist/src/core/loggingContentGenerator.test.js +180 -0
  158. package/dist/src/core/loggingContentGenerator.test.js.map +1 -0
  159. package/dist/src/core/nonInteractiveToolExecutor.d.ts +3 -2
  160. package/dist/src/core/nonInteractiveToolExecutor.js +12 -7
  161. package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -1
  162. package/dist/src/core/nonInteractiveToolExecutor.test.js +12 -8
  163. package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
  164. package/dist/src/core/openaiContentGenerator.js +31 -8
  165. package/dist/src/core/openaiContentGenerator.js.map +1 -1
  166. package/dist/src/core/prompts.d.ts +2 -1
  167. package/dist/src/core/prompts.js +135 -154
  168. package/dist/src/core/prompts.js.map +1 -1
  169. package/dist/src/core/prompts.test.js +128 -189
  170. package/dist/src/core/prompts.test.js.map +1 -1
  171. package/dist/src/core/recordingContentGenerator.d.ts +18 -0
  172. package/dist/src/core/recordingContentGenerator.js +77 -0
  173. package/dist/src/core/recordingContentGenerator.js.map +1 -0
  174. package/dist/src/core/recordingContentGenerator.test.d.ts +6 -0
  175. package/dist/src/core/recordingContentGenerator.test.js +101 -0
  176. package/dist/src/core/recordingContentGenerator.test.js.map +1 -0
  177. package/dist/src/core/tokenLimits.test.d.ts +6 -0
  178. package/dist/src/core/tokenLimits.test.js +26 -0
  179. package/dist/src/core/tokenLimits.test.js.map +1 -0
  180. package/dist/src/core/turn.d.ts +23 -3
  181. package/dist/src/core/turn.js +18 -9
  182. package/dist/src/core/turn.js.map +1 -1
  183. package/dist/src/core/turn.test.js +98 -104
  184. package/dist/src/core/turn.test.js.map +1 -1
  185. package/dist/src/fallback/handler.js +60 -8
  186. package/dist/src/fallback/handler.js.map +1 -1
  187. package/dist/src/fallback/handler.test.js +132 -17
  188. package/dist/src/fallback/handler.test.js.map +1 -1
  189. package/dist/src/fallback/types.d.ts +1 -1
  190. package/dist/src/generated/git-commit.d.ts +2 -2
  191. package/dist/src/generated/git-commit.js +2 -2
  192. package/dist/src/generated/git-commit.js.map +1 -1
  193. package/dist/src/hooks/hookAggregator.d.ts +68 -0
  194. package/dist/src/hooks/hookAggregator.js +262 -0
  195. package/dist/src/hooks/hookAggregator.js.map +1 -0
  196. package/dist/src/hooks/hookAggregator.test.d.ts +6 -0
  197. package/dist/src/hooks/hookAggregator.test.js +387 -0
  198. package/dist/src/hooks/hookAggregator.test.js.map +1 -0
  199. package/dist/src/hooks/hookPlanner.d.ts +46 -0
  200. package/dist/src/hooks/hookPlanner.js +108 -0
  201. package/dist/src/hooks/hookPlanner.js.map +1 -0
  202. package/dist/src/hooks/hookPlanner.test.d.ts +6 -0
  203. package/dist/src/hooks/hookPlanner.test.js +255 -0
  204. package/dist/src/hooks/hookPlanner.test.js.map +1 -0
  205. package/dist/src/hooks/hookRegistry.d.ts +87 -0
  206. package/dist/src/hooks/hookRegistry.js +198 -0
  207. package/dist/src/hooks/hookRegistry.js.map +1 -0
  208. package/dist/src/hooks/hookRegistry.test.d.ts +6 -0
  209. package/dist/src/hooks/hookRegistry.test.js +341 -0
  210. package/dist/src/hooks/hookRegistry.test.js.map +1 -0
  211. package/dist/src/hooks/hookRunner.d.ts +42 -0
  212. package/dist/src/hooks/hookRunner.js +272 -0
  213. package/dist/src/hooks/hookRunner.js.map +1 -0
  214. package/dist/src/hooks/hookRunner.test.d.ts +6 -0
  215. package/dist/src/hooks/hookRunner.test.js +468 -0
  216. package/dist/src/hooks/hookRunner.test.js.map +1 -0
  217. package/dist/src/hooks/hookTranslator.d.ts +113 -0
  218. package/dist/src/hooks/hookTranslator.js +232 -0
  219. package/dist/src/hooks/hookTranslator.js.map +1 -0
  220. package/dist/src/hooks/hookTranslator.test.d.ts +6 -0
  221. package/dist/src/hooks/hookTranslator.test.js +192 -0
  222. package/dist/src/hooks/hookTranslator.test.js.map +1 -0
  223. package/dist/src/hooks/types.d.ts +384 -0
  224. package/dist/src/hooks/types.js +284 -0
  225. package/dist/src/hooks/types.js.map +1 -0
  226. package/dist/src/hooks/types.test.d.ts +6 -0
  227. package/dist/src/hooks/types.test.js +313 -0
  228. package/dist/src/hooks/types.test.js.map +1 -0
  229. package/dist/src/ide/detect-ide.d.ts +4 -0
  230. package/dist/src/ide/detect-ide.js +6 -1
  231. package/dist/src/ide/detect-ide.js.map +1 -1
  232. package/dist/src/ide/detect-ide.test.js +16 -0
  233. package/dist/src/ide/detect-ide.test.js.map +1 -1
  234. package/dist/src/ide/ide-client.d.ts +3 -1
  235. package/dist/src/ide/ide-client.js +12 -10
  236. package/dist/src/ide/ide-client.js.map +1 -1
  237. package/dist/src/ide/ide-client.test.js +163 -4
  238. package/dist/src/ide/ide-client.test.js.map +1 -1
  239. package/dist/src/ide/ide-installer.js +66 -21
  240. package/dist/src/ide/ide-installer.js.map +1 -1
  241. package/dist/src/ide/ide-installer.test.js +54 -1
  242. package/dist/src/ide/ide-installer.test.js.map +1 -1
  243. package/dist/src/ide/process-utils.js +85 -75
  244. package/dist/src/ide/process-utils.js.map +1 -1
  245. package/dist/src/ide/process-utils.test.js +83 -90
  246. package/dist/src/ide/process-utils.test.js.map +1 -1
  247. package/dist/src/ide/types.d.ts +1 -1
  248. package/dist/src/ide/types.js +1 -1
  249. package/dist/src/index.d.ts +21 -0
  250. package/dist/src/index.js +24 -0
  251. package/dist/src/index.js.map +1 -1
  252. package/dist/src/mcp/google-auth-provider.d.ts +2 -0
  253. package/dist/src/mcp/google-auth-provider.js +21 -3
  254. package/dist/src/mcp/google-auth-provider.js.map +1 -1
  255. package/dist/src/mcp/google-auth-provider.test.js +42 -9
  256. package/dist/src/mcp/google-auth-provider.test.js.map +1 -1
  257. package/dist/src/mcp/oauth-provider.d.ts +8 -5
  258. package/dist/src/mcp/oauth-provider.js +140 -55
  259. package/dist/src/mcp/oauth-provider.js.map +1 -1
  260. package/dist/src/mcp/oauth-provider.test.js +369 -2
  261. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  262. package/dist/src/mcp/oauth-token-storage.js +5 -4
  263. package/dist/src/mcp/oauth-token-storage.js.map +1 -1
  264. package/dist/src/mcp/oauth-token-storage.test.js +17 -11
  265. package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
  266. package/dist/src/mcp/oauth-utils.d.ts +7 -0
  267. package/dist/src/mcp/oauth-utils.js +28 -8
  268. package/dist/src/mcp/oauth-utils.js.map +1 -1
  269. package/dist/src/mcp/oauth-utils.test.js +45 -2
  270. package/dist/src/mcp/oauth-utils.test.js.map +1 -1
  271. package/dist/src/mcp/sa-impersonation-provider.d.ts +0 -6
  272. package/dist/src/mcp/sa-impersonation-provider.js +6 -23
  273. package/dist/src/mcp/sa-impersonation-provider.js.map +1 -1
  274. package/dist/src/mcp/token-storage/base-token-storage.test.js +75 -84
  275. package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -1
  276. package/dist/src/mcp/token-storage/file-token-storage.js +3 -2
  277. package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -1
  278. package/dist/src/mcp/token-storage/file-token-storage.test.js +11 -8
  279. package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -1
  280. package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +6 -2
  281. package/dist/src/mcp/token-storage/keychain-token-storage.js +63 -7
  282. package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
  283. package/dist/src/mcp/token-storage/keychain-token-storage.test.js +54 -3
  284. package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -1
  285. package/dist/src/mcp/token-storage/types.d.ts +6 -0
  286. package/dist/src/mcp/token-storage/types.js.map +1 -1
  287. package/dist/src/output/stream-json-formatter.d.ts +32 -0
  288. package/dist/src/output/stream-json-formatter.js +52 -0
  289. package/dist/src/output/stream-json-formatter.js.map +1 -0
  290. package/dist/src/output/stream-json-formatter.test.d.ts +6 -0
  291. package/dist/src/output/stream-json-formatter.test.js +479 -0
  292. package/dist/src/output/stream-json-formatter.test.js.map +1 -0
  293. package/dist/src/output/types.d.ts +63 -1
  294. package/dist/src/output/types.js +11 -0
  295. package/dist/src/output/types.js.map +1 -1
  296. package/dist/src/policy/config.d.ts +31 -0
  297. package/dist/src/policy/config.js +199 -0
  298. package/dist/src/policy/config.js.map +1 -0
  299. package/dist/src/policy/config.test.d.ts +6 -0
  300. package/dist/src/policy/config.test.js +538 -0
  301. package/dist/src/policy/config.test.js.map +1 -0
  302. package/dist/src/policy/index.d.ts +2 -0
  303. package/dist/src/policy/index.js +2 -0
  304. package/dist/src/policy/index.js.map +1 -1
  305. package/dist/src/policy/policies/discovered.toml +8 -0
  306. package/dist/src/policy/policies/read-only.toml +56 -0
  307. package/dist/src/policy/policies/write.toml +73 -0
  308. package/dist/src/policy/policies/yolo.toml +31 -0
  309. package/dist/src/policy/policy-engine.d.ts +12 -3
  310. package/dist/src/policy/policy-engine.js +74 -8
  311. package/dist/src/policy/policy-engine.js.map +1 -1
  312. package/dist/src/policy/policy-engine.test.js +460 -76
  313. package/dist/src/policy/policy-engine.test.js.map +1 -1
  314. package/dist/src/policy/toml-loader.d.ts +47 -0
  315. package/dist/src/policy/toml-loader.js +411 -0
  316. package/dist/src/policy/toml-loader.js.map +1 -0
  317. package/dist/src/policy/toml-loader.test.d.ts +6 -0
  318. package/dist/src/policy/toml-loader.test.js +376 -0
  319. package/dist/src/policy/toml-loader.test.js.map +1 -0
  320. package/dist/src/policy/types.d.ts +83 -0
  321. package/dist/src/policy/types.js +10 -0
  322. package/dist/src/policy/types.js.map +1 -1
  323. package/dist/src/prompts/mcp-prompts.test.d.ts +6 -0
  324. package/dist/src/prompts/mcp-prompts.test.js +39 -0
  325. package/dist/src/prompts/mcp-prompts.test.js.map +1 -0
  326. package/dist/src/prompts/prompt-registry.js +2 -1
  327. package/dist/src/prompts/prompt-registry.js.map +1 -1
  328. package/dist/src/prompts/prompt-registry.test.d.ts +6 -0
  329. package/dist/src/prompts/prompt-registry.test.js +96 -0
  330. package/dist/src/prompts/prompt-registry.test.js.map +1 -0
  331. package/dist/src/routing/modelRouterService.js +15 -0
  332. package/dist/src/routing/modelRouterService.js.map +1 -1
  333. package/dist/src/routing/modelRouterService.test.js +62 -0
  334. package/dist/src/routing/modelRouterService.test.js.map +1 -1
  335. package/dist/src/routing/strategies/classifierStrategy.d.ts +1 -1
  336. package/dist/src/routing/strategies/classifierStrategy.js +9 -16
  337. package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
  338. package/dist/src/routing/strategies/classifierStrategy.test.js +17 -13
  339. package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
  340. package/dist/src/routing/strategies/fallbackStrategy.js +1 -1
  341. package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
  342. package/dist/src/routing/strategies/fallbackStrategy.test.js +4 -0
  343. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
  344. package/dist/src/routing/strategies/overrideStrategy.js +2 -2
  345. package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
  346. package/dist/src/routing/strategies/overrideStrategy.test.js +3 -0
  347. package/dist/src/routing/strategies/overrideStrategy.test.js.map +1 -1
  348. package/dist/src/safety/built-in.d.ts +21 -0
  349. package/dist/src/safety/built-in.js +106 -0
  350. package/dist/src/safety/built-in.js.map +1 -0
  351. package/dist/src/safety/built-in.test.d.ts +6 -0
  352. package/dist/src/safety/built-in.test.js +199 -0
  353. package/dist/src/safety/built-in.test.js.map +1 -0
  354. package/dist/src/safety/checker-runner.d.ts +48 -0
  355. package/dist/src/safety/checker-runner.js +208 -0
  356. package/dist/src/safety/checker-runner.js.map +1 -0
  357. package/dist/src/safety/checker-runner.test.d.ts +6 -0
  358. package/dist/src/safety/checker-runner.test.js +238 -0
  359. package/dist/src/safety/checker-runner.test.js.map +1 -0
  360. package/dist/src/safety/context-builder.d.ts +23 -0
  361. package/dist/src/safety/context-builder.js +47 -0
  362. package/dist/src/safety/context-builder.js.map +1 -0
  363. package/dist/src/safety/context-builder.test.d.ts +6 -0
  364. package/dist/src/safety/context-builder.test.js +49 -0
  365. package/dist/src/safety/context-builder.test.js.map +1 -0
  366. package/dist/src/safety/protocol.d.ts +88 -0
  367. package/dist/src/safety/protocol.js +15 -0
  368. package/dist/src/safety/protocol.js.map +1 -0
  369. package/dist/src/safety/registry.d.ts +26 -0
  370. package/dist/src/safety/registry.js +65 -0
  371. package/dist/src/safety/registry.js.map +1 -0
  372. package/dist/src/safety/registry.test.d.ts +6 -0
  373. package/dist/src/safety/registry.test.js +31 -0
  374. package/dist/src/safety/registry.test.js.map +1 -0
  375. package/dist/src/services/chatCompressionService.d.ts +32 -0
  376. package/dist/src/services/chatCompressionService.js +162 -0
  377. package/dist/src/services/chatCompressionService.js.map +1 -0
  378. package/dist/src/services/chatCompressionService.test.d.ts +6 -0
  379. package/dist/src/services/chatCompressionService.test.js +210 -0
  380. package/dist/src/services/chatCompressionService.test.js.map +1 -0
  381. package/dist/src/services/chatRecordingService.d.ts +3 -2
  382. package/dist/src/services/chatRecordingService.js +11 -9
  383. package/dist/src/services/chatRecordingService.js.map +1 -1
  384. package/dist/src/services/fileDiscoveryService.d.ts +2 -14
  385. package/dist/src/services/fileDiscoveryService.js +19 -55
  386. package/dist/src/services/fileDiscoveryService.js.map +1 -1
  387. package/dist/src/services/fileDiscoveryService.test.js +91 -11
  388. package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
  389. package/dist/src/services/loopDetectionService.d.ts +4 -1
  390. package/dist/src/services/loopDetectionService.js +95 -42
  391. package/dist/src/services/loopDetectionService.js.map +1 -1
  392. package/dist/src/services/loopDetectionService.test.js +220 -12
  393. package/dist/src/services/loopDetectionService.test.js.map +1 -1
  394. package/dist/src/services/modelConfig.golden.test.d.ts +6 -0
  395. package/dist/src/services/modelConfig.golden.test.js +42 -0
  396. package/dist/src/services/modelConfig.golden.test.js.map +1 -0
  397. package/dist/src/services/modelConfig.integration.test.d.ts +6 -0
  398. package/dist/src/services/modelConfig.integration.test.js +247 -0
  399. package/dist/src/services/modelConfig.integration.test.js.map +1 -0
  400. package/dist/src/services/modelConfigService.d.ts +48 -0
  401. package/dist/src/services/modelConfigService.js +151 -0
  402. package/dist/src/services/modelConfigService.js.map +1 -0
  403. package/dist/src/services/modelConfigService.test.d.ts +6 -0
  404. package/dist/src/services/modelConfigService.test.js +531 -0
  405. package/dist/src/services/modelConfigService.test.js.map +1 -0
  406. package/dist/src/services/shellExecutionService.d.ts +1 -0
  407. package/dist/src/services/shellExecutionService.js +195 -92
  408. package/dist/src/services/shellExecutionService.js.map +1 -1
  409. package/dist/src/services/shellExecutionService.test.js +137 -14
  410. package/dist/src/services/shellExecutionService.test.js.map +1 -1
  411. package/dist/src/services/test-data/resolved-aliases.golden.json +202 -0
  412. package/dist/src/telemetry/activity-monitor.d.ts +116 -0
  413. package/dist/src/telemetry/activity-monitor.js +209 -0
  414. package/dist/src/telemetry/activity-monitor.js.map +1 -0
  415. package/dist/src/telemetry/activity-monitor.test.d.ts +6 -0
  416. package/dist/src/telemetry/activity-monitor.test.js +251 -0
  417. package/dist/src/telemetry/activity-monitor.test.js.map +1 -0
  418. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +25 -7
  419. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +294 -76
  420. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  421. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +1 -0
  422. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +192 -66
  423. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
  424. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +25 -3
  425. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +59 -5
  426. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  427. package/dist/src/telemetry/constants.d.ts +0 -28
  428. package/dist/src/telemetry/constants.js +0 -29
  429. package/dist/src/telemetry/constants.js.map +1 -1
  430. package/dist/src/telemetry/gcp-exporters.js +0 -1
  431. package/dist/src/telemetry/gcp-exporters.js.map +1 -1
  432. package/dist/src/telemetry/gcp-exporters.test.js +1 -1
  433. package/dist/src/telemetry/gcp-exporters.test.js.map +1 -1
  434. package/dist/src/telemetry/index.d.ts +7 -3
  435. package/dist/src/telemetry/index.js +13 -4
  436. package/dist/src/telemetry/index.js.map +1 -1
  437. package/dist/src/telemetry/loggers.d.ts +14 -7
  438. package/dist/src/telemetry/loggers.js +197 -320
  439. package/dist/src/telemetry/loggers.js.map +1 -1
  440. package/dist/src/telemetry/loggers.test.circular.js +0 -1
  441. package/dist/src/telemetry/loggers.test.circular.js.map +1 -1
  442. package/dist/src/telemetry/loggers.test.js +460 -59
  443. package/dist/src/telemetry/loggers.test.js.map +1 -1
  444. package/dist/src/telemetry/memory-monitor.d.ts +149 -0
  445. package/dist/src/telemetry/memory-monitor.js +335 -0
  446. package/dist/src/telemetry/memory-monitor.js.map +1 -0
  447. package/dist/src/telemetry/memory-monitor.test.d.ts +6 -0
  448. package/dist/src/telemetry/memory-monitor.test.js +472 -0
  449. package/dist/src/telemetry/memory-monitor.test.js.map +1 -0
  450. package/dist/src/telemetry/metrics.d.ts +180 -4
  451. package/dist/src/telemetry/metrics.js +270 -6
  452. package/dist/src/telemetry/metrics.js.map +1 -1
  453. package/dist/src/telemetry/metrics.test.js +502 -184
  454. package/dist/src/telemetry/metrics.test.js.map +1 -1
  455. package/dist/src/telemetry/sdk.js +3 -2
  456. package/dist/src/telemetry/sdk.js.map +1 -1
  457. package/dist/src/telemetry/semantic.d.ts +82 -0
  458. package/dist/src/telemetry/semantic.js +269 -0
  459. package/dist/src/telemetry/semantic.js.map +1 -0
  460. package/dist/src/telemetry/semantic.test.d.ts +6 -0
  461. package/dist/src/telemetry/semantic.test.js +387 -0
  462. package/dist/src/telemetry/semantic.test.js.map +1 -0
  463. package/dist/src/telemetry/telemetry-utils.test.js +29 -28
  464. package/dist/src/telemetry/telemetry-utils.test.js.map +1 -1
  465. package/dist/src/telemetry/telemetryAttributes.d.ts +8 -0
  466. package/dist/src/telemetry/telemetryAttributes.js +19 -0
  467. package/dist/src/telemetry/telemetryAttributes.js.map +1 -0
  468. package/dist/src/telemetry/trace.d.ts +46 -0
  469. package/dist/src/telemetry/trace.js +121 -0
  470. package/dist/src/telemetry/trace.js.map +1 -0
  471. package/dist/src/telemetry/types.d.ts +227 -29
  472. package/dist/src/telemetry/types.js +858 -72
  473. package/dist/src/telemetry/types.js.map +1 -1
  474. package/dist/src/telemetry/uiTelemetry.d.ts +1 -1
  475. package/dist/src/telemetry/uiTelemetry.js +7 -7
  476. package/dist/src/telemetry/uiTelemetry.js.map +1 -1
  477. package/dist/src/telemetry/uiTelemetry.test.js +89 -67
  478. package/dist/src/telemetry/uiTelemetry.test.js.map +1 -1
  479. package/dist/src/test-utils/config.d.ts +1 -1
  480. package/dist/src/test-utils/config.js +1 -1
  481. package/dist/src/tools/base-tool-invocation.test.d.ts +6 -0
  482. package/dist/src/tools/base-tool-invocation.test.js +85 -0
  483. package/dist/src/tools/base-tool-invocation.test.js.map +1 -0
  484. package/dist/src/tools/edit.d.ts +4 -3
  485. package/dist/src/tools/edit.js +50 -47
  486. package/dist/src/tools/edit.js.map +1 -1
  487. package/dist/src/tools/edit.test.js +306 -216
  488. package/dist/src/tools/edit.test.js.map +1 -1
  489. package/dist/src/tools/glob.d.ts +4 -3
  490. package/dist/src/tools/glob.js +24 -27
  491. package/dist/src/tools/glob.js.map +1 -1
  492. package/dist/src/tools/glob.test.js +212 -205
  493. package/dist/src/tools/glob.test.js.map +1 -1
  494. package/dist/src/tools/grep.d.ts +4 -3
  495. package/dist/src/tools/grep.js +31 -25
  496. package/dist/src/tools/grep.js.map +1 -1
  497. package/dist/src/tools/grep.test.js +15 -12
  498. package/dist/src/tools/grep.test.js.map +1 -1
  499. package/dist/src/tools/ls.d.ts +4 -3
  500. package/dist/src/tools/ls.js +29 -35
  501. package/dist/src/tools/ls.js.map +1 -1
  502. package/dist/src/tools/ls.test.js +34 -42
  503. package/dist/src/tools/ls.test.js.map +1 -1
  504. package/dist/src/tools/mcp-client-manager.d.ts +49 -11
  505. package/dist/src/tools/mcp-client-manager.js +191 -31
  506. package/dist/src/tools/mcp-client-manager.js.map +1 -1
  507. package/dist/src/tools/mcp-client-manager.test.js +132 -25
  508. package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
  509. package/dist/src/tools/mcp-client.d.ts +12 -5
  510. package/dist/src/tools/mcp-client.js +287 -267
  511. package/dist/src/tools/mcp-client.js.map +1 -1
  512. package/dist/src/tools/mcp-client.test.js +352 -45
  513. package/dist/src/tools/mcp-client.test.js.map +1 -1
  514. package/dist/src/tools/mcp-tool.d.ts +6 -2
  515. package/dist/src/tools/mcp-tool.js +19 -8
  516. package/dist/src/tools/mcp-tool.js.map +1 -1
  517. package/dist/src/tools/mcp-tool.test.js +186 -273
  518. package/dist/src/tools/mcp-tool.test.js.map +1 -1
  519. package/dist/src/tools/memoryTool.d.ts +7 -5
  520. package/dist/src/tools/memoryTool.js +14 -12
  521. package/dist/src/tools/memoryTool.js.map +1 -1
  522. package/dist/src/tools/memoryTool.test.js +10 -9
  523. package/dist/src/tools/memoryTool.test.js.map +1 -1
  524. package/dist/src/tools/message-bus-integration.test.js +14 -1
  525. package/dist/src/tools/message-bus-integration.test.js.map +1 -1
  526. package/dist/src/tools/modifiable-tool.d.ts +5 -1
  527. package/dist/src/tools/modifiable-tool.js +38 -16
  528. package/dist/src/tools/modifiable-tool.js.map +1 -1
  529. package/dist/src/tools/modifiable-tool.test.js +66 -31
  530. package/dist/src/tools/modifiable-tool.test.js.map +1 -1
  531. package/dist/src/tools/read-file.d.ts +6 -5
  532. package/dist/src/tools/read-file.js +26 -32
  533. package/dist/src/tools/read-file.js.map +1 -1
  534. package/dist/src/tools/read-file.test.js +68 -33
  535. package/dist/src/tools/read-file.test.js.map +1 -1
  536. package/dist/src/tools/read-many-files.d.ts +6 -12
  537. package/dist/src/tools/read-many-files.js +28 -57
  538. package/dist/src/tools/read-many-files.js.map +1 -1
  539. package/dist/src/tools/read-many-files.test.js +37 -36
  540. package/dist/src/tools/read-many-files.test.js.map +1 -1
  541. package/dist/src/tools/ripGrep.d.ts +28 -10
  542. package/dist/src/tools/ripGrep.js +195 -193
  543. package/dist/src/tools/ripGrep.js.map +1 -1
  544. package/dist/src/tools/ripGrep.test.js +533 -204
  545. package/dist/src/tools/ripGrep.test.js.map +1 -1
  546. package/dist/src/tools/shell.d.ts +8 -6
  547. package/dist/src/tools/shell.js +64 -38
  548. package/dist/src/tools/shell.js.map +1 -1
  549. package/dist/src/tools/shell.test.js +134 -43
  550. package/dist/src/tools/shell.test.js.map +1 -1
  551. package/dist/src/tools/smart-edit.d.ts +10 -23
  552. package/dist/src/tools/smart-edit.js +100 -85
  553. package/dist/src/tools/smart-edit.js.map +1 -1
  554. package/dist/src/tools/smart-edit.test.js +229 -179
  555. package/dist/src/tools/smart-edit.test.js.map +1 -1
  556. package/dist/src/tools/tool-error.d.ts +21 -0
  557. package/dist/src/tools/tool-error.js +27 -0
  558. package/dist/src/tools/tool-error.js.map +1 -1
  559. package/dist/src/tools/tool-names.d.ts +17 -0
  560. package/dist/src/tools/tool-names.js +21 -0
  561. package/dist/src/tools/tool-names.js.map +1 -0
  562. package/dist/src/tools/tool-registry.d.ts +32 -20
  563. package/dist/src/tools/tool-registry.js +122 -78
  564. package/dist/src/tools/tool-registry.js.map +1 -1
  565. package/dist/src/tools/tool-registry.test.js +167 -90
  566. package/dist/src/tools/tool-registry.test.js.map +1 -1
  567. package/dist/src/tools/tools.d.ts +23 -8
  568. package/dist/src/tools/tools.js +69 -37
  569. package/dist/src/tools/tools.js.map +1 -1
  570. package/dist/src/tools/web-fetch.d.ts +11 -3
  571. package/dist/src/tools/web-fetch.js +80 -38
  572. package/dist/src/tools/web-fetch.js.map +1 -1
  573. package/dist/src/tools/web-fetch.test.js +338 -9
  574. package/dist/src/tools/web-fetch.test.js.map +1 -1
  575. package/dist/src/tools/web-search.d.ts +4 -3
  576. package/dist/src/tools/web-search.js +11 -9
  577. package/dist/src/tools/web-search.js.map +1 -1
  578. package/dist/src/tools/web-search.test.js +6 -0
  579. package/dist/src/tools/web-search.test.js.map +1 -1
  580. package/dist/src/tools/write-file.d.ts +3 -2
  581. package/dist/src/tools/write-file.js +41 -40
  582. package/dist/src/tools/write-file.js.map +1 -1
  583. package/dist/src/tools/write-file.test.js +130 -123
  584. package/dist/src/tools/write-file.test.js.map +1 -1
  585. package/dist/src/tools/write-todos.d.ts +34 -9
  586. package/dist/src/tools/write-todos.js +54 -11
  587. package/dist/src/tools/write-todos.js.map +1 -1
  588. package/dist/src/tools/write-todos.test.js +2 -2
  589. package/dist/src/tools/write-todos.test.js.map +1 -1
  590. package/dist/src/utils/bfsFileSearch.js +3 -2
  591. package/dist/src/utils/bfsFileSearch.js.map +1 -1
  592. package/dist/src/utils/channel.d.ts +19 -0
  593. package/dist/src/utils/channel.js +49 -0
  594. package/dist/src/utils/channel.js.map +1 -0
  595. package/dist/src/utils/channel.test.d.ts +6 -0
  596. package/dist/src/utils/channel.test.js +170 -0
  597. package/dist/src/utils/channel.test.js.map +1 -0
  598. package/dist/src/utils/debugLogger.d.ts +25 -0
  599. package/dist/src/utils/debugLogger.js +33 -0
  600. package/dist/src/utils/debugLogger.js.map +1 -0
  601. package/dist/src/utils/debugLogger.test.d.ts +6 -0
  602. package/dist/src/utils/debugLogger.test.js +69 -0
  603. package/dist/src/utils/debugLogger.test.js.map +1 -0
  604. package/dist/src/utils/delay.d.ts +16 -0
  605. package/dist/src/utils/delay.js +43 -0
  606. package/dist/src/utils/delay.js.map +1 -0
  607. package/dist/src/utils/delay.test.d.ts +6 -0
  608. package/dist/src/utils/delay.test.js +88 -0
  609. package/dist/src/utils/delay.test.js.map +1 -0
  610. package/dist/src/utils/editCorrector.js +10 -25
  611. package/dist/src/utils/editCorrector.js.map +1 -1
  612. package/dist/src/utils/editCorrector.test.js +19 -5
  613. package/dist/src/utils/editCorrector.test.js.map +1 -1
  614. package/dist/src/utils/editor.d.ts +4 -2
  615. package/dist/src/utils/editor.js +53 -39
  616. package/dist/src/utils/editor.js.map +1 -1
  617. package/dist/src/utils/editor.test.js +18 -45
  618. package/dist/src/utils/editor.test.js.map +1 -1
  619. package/dist/src/utils/environmentContext.d.ts +2 -1
  620. package/dist/src/utils/environmentContext.js +20 -33
  621. package/dist/src/utils/environmentContext.js.map +1 -1
  622. package/dist/src/utils/environmentContext.test.js +6 -34
  623. package/dist/src/utils/environmentContext.test.js.map +1 -1
  624. package/dist/src/utils/errorParsing.d.ts +1 -1
  625. package/dist/src/utils/errorParsing.js +5 -33
  626. package/dist/src/utils/errorParsing.js.map +1 -1
  627. package/dist/src/utils/errorParsing.test.js +0 -88
  628. package/dist/src/utils/errorParsing.test.js.map +1 -1
  629. package/dist/src/utils/errors.d.ts +3 -0
  630. package/dist/src/utils/errors.js +6 -0
  631. package/dist/src/utils/errors.js.map +1 -1
  632. package/dist/src/utils/events.d.ts +121 -0
  633. package/dist/src/utils/events.js +84 -0
  634. package/dist/src/utils/events.js.map +1 -0
  635. package/dist/src/utils/events.test.d.ts +6 -0
  636. package/dist/src/utils/events.test.js +212 -0
  637. package/dist/src/utils/events.test.js.map +1 -0
  638. package/dist/src/utils/extensionLoader.d.ts +86 -0
  639. package/dist/src/utils/extensionLoader.js +208 -0
  640. package/dist/src/utils/extensionLoader.js.map +1 -0
  641. package/dist/src/utils/extensionLoader.test.d.ts +6 -0
  642. package/dist/src/utils/extensionLoader.test.js +154 -0
  643. package/dist/src/utils/extensionLoader.test.js.map +1 -0
  644. package/dist/src/utils/fetch.d.ts +1 -0
  645. package/dist/src/utils/fetch.js +4 -0
  646. package/dist/src/utils/fetch.js.map +1 -1
  647. package/dist/src/utils/fileUtils.d.ts +4 -0
  648. package/dist/src/utils/fileUtils.js +34 -2
  649. package/dist/src/utils/fileUtils.js.map +1 -1
  650. package/dist/src/utils/fileUtils.test.js +87 -61
  651. package/dist/src/utils/fileUtils.test.js.map +1 -1
  652. package/dist/src/utils/filesearch/fileSearch.js +1 -1
  653. package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
  654. package/dist/src/utils/flashFallback.test.js +28 -47
  655. package/dist/src/utils/flashFallback.test.js.map +1 -1
  656. package/dist/src/utils/formatters.d.ts +1 -0
  657. package/dist/src/utils/formatters.js +2 -1
  658. package/dist/src/utils/formatters.js.map +1 -1
  659. package/dist/src/utils/formatters.test.d.ts +6 -0
  660. package/dist/src/utils/formatters.test.js +26 -0
  661. package/dist/src/utils/formatters.test.js.map +1 -0
  662. package/dist/src/utils/getFolderStructure.js +9 -17
  663. package/dist/src/utils/getFolderStructure.js.map +1 -1
  664. package/dist/src/utils/getFolderStructure.test.js +7 -6
  665. package/dist/src/utils/getFolderStructure.test.js.map +1 -1
  666. package/dist/src/utils/gitIgnoreParser.d.ts +4 -1
  667. package/dist/src/utils/gitIgnoreParser.js +28 -10
  668. package/dist/src/utils/gitIgnoreParser.js.map +1 -1
  669. package/dist/src/utils/gitIgnoreParser.test.js +58 -0
  670. package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
  671. package/dist/src/utils/googleErrors.d.ts +104 -0
  672. package/dist/src/utils/googleErrors.js +152 -0
  673. package/dist/src/utils/googleErrors.js.map +1 -0
  674. package/dist/src/utils/googleErrors.test.d.ts +6 -0
  675. package/dist/src/utils/googleErrors.test.js +301 -0
  676. package/dist/src/utils/googleErrors.test.js.map +1 -0
  677. package/dist/src/utils/googleQuotaErrors.d.ts +37 -0
  678. package/dist/src/utils/googleQuotaErrors.js +157 -0
  679. package/dist/src/utils/googleQuotaErrors.js.map +1 -0
  680. package/dist/src/utils/googleQuotaErrors.test.d.ts +6 -0
  681. package/dist/src/utils/googleQuotaErrors.test.js +311 -0
  682. package/dist/src/utils/googleQuotaErrors.test.js.map +1 -0
  683. package/dist/src/utils/httpErrors.d.ts +18 -0
  684. package/dist/src/utils/httpErrors.js +36 -0
  685. package/dist/src/utils/httpErrors.js.map +1 -0
  686. package/dist/src/utils/ignorePatterns.test.js +26 -30
  687. package/dist/src/utils/ignorePatterns.test.js.map +1 -1
  688. package/dist/src/utils/installationManager.js +2 -1
  689. package/dist/src/utils/installationManager.js.map +1 -1
  690. package/dist/src/utils/installationManager.test.js +6 -4
  691. package/dist/src/utils/installationManager.test.js.map +1 -1
  692. package/dist/src/utils/llm-edit-fixer.d.ts +1 -1
  693. package/dist/src/utils/llm-edit-fixer.js +33 -9
  694. package/dist/src/utils/llm-edit-fixer.js.map +1 -1
  695. package/dist/src/utils/llm-edit-fixer.test.js +38 -1
  696. package/dist/src/utils/llm-edit-fixer.test.js.map +1 -1
  697. package/dist/src/utils/memoryDiscovery.d.ts +20 -1
  698. package/dist/src/utils/memoryDiscovery.js +176 -12
  699. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  700. package/dist/src/utils/memoryDiscovery.test.js +299 -40
  701. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  702. package/dist/src/utils/memoryImportProcessor.js +4 -3
  703. package/dist/src/utils/memoryImportProcessor.js.map +1 -1
  704. package/dist/src/utils/memoryImportProcessor.test.js +8 -14
  705. package/dist/src/utils/memoryImportProcessor.test.js.map +1 -1
  706. package/dist/src/utils/nextSpeakerChecker.js +3 -3
  707. package/dist/src/utils/nextSpeakerChecker.js.map +1 -1
  708. package/dist/src/utils/nextSpeakerChecker.test.js +13 -5
  709. package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -1
  710. package/dist/src/utils/package.d.ts +12 -0
  711. package/dist/src/utils/package.js +15 -0
  712. package/dist/src/utils/package.js.map +1 -0
  713. package/dist/src/utils/pathCorrector.d.ts +25 -0
  714. package/dist/src/utils/pathCorrector.js +33 -0
  715. package/dist/src/utils/pathCorrector.js.map +1 -0
  716. package/dist/src/utils/pathCorrector.test.d.ts +6 -0
  717. package/dist/src/utils/pathCorrector.test.js +83 -0
  718. package/dist/src/utils/pathCorrector.test.js.map +1 -0
  719. package/dist/src/utils/pathReader.js +4 -4
  720. package/dist/src/utils/pathReader.js.map +1 -1
  721. package/dist/src/utils/pathReader.test.js +44 -1
  722. package/dist/src/utils/pathReader.test.js.map +1 -1
  723. package/dist/src/utils/paths.d.ts +1 -1
  724. package/dist/src/utils/paths.js +131 -29
  725. package/dist/src/utils/paths.js.map +1 -1
  726. package/dist/src/utils/paths.test.js +200 -68
  727. package/dist/src/utils/paths.test.js.map +1 -1
  728. package/dist/src/utils/quotaErrorDetection.d.ts +0 -2
  729. package/dist/src/utils/quotaErrorDetection.js +0 -46
  730. package/dist/src/utils/quotaErrorDetection.js.map +1 -1
  731. package/dist/src/utils/retry.d.ts +3 -10
  732. package/dist/src/utils/retry.js +97 -195
  733. package/dist/src/utils/retry.js.map +1 -1
  734. package/dist/src/utils/retry.test.js +179 -145
  735. package/dist/src/utils/retry.test.js.map +1 -1
  736. package/dist/src/utils/safeJsonStringify.d.ts +4 -4
  737. package/dist/src/utils/safeJsonStringify.js +31 -7
  738. package/dist/src/utils/safeJsonStringify.js.map +1 -1
  739. package/dist/src/utils/shell-utils.d.ts +15 -2
  740. package/dist/src/utils/shell-utils.js +387 -140
  741. package/dist/src/utils/shell-utils.js.map +1 -1
  742. package/dist/src/utils/shell-utils.test.js +244 -62
  743. package/dist/src/utils/shell-utils.test.js.map +1 -1
  744. package/dist/src/utils/stdio.d.ts +32 -0
  745. package/dist/src/utils/stdio.js +85 -0
  746. package/dist/src/utils/stdio.js.map +1 -0
  747. package/dist/src/utils/stdio.test.d.ts +6 -0
  748. package/dist/src/utils/stdio.test.js +47 -0
  749. package/dist/src/utils/stdio.test.js.map +1 -0
  750. package/dist/src/utils/summarizer.d.ts +4 -2
  751. package/dist/src/utils/summarizer.js +8 -9
  752. package/dist/src/utils/summarizer.js.map +1 -1
  753. package/dist/src/utils/summarizer.test.js +32 -12
  754. package/dist/src/utils/summarizer.test.js.map +1 -1
  755. package/dist/src/utils/systemEncoding.js +5 -4
  756. package/dist/src/utils/systemEncoding.js.map +1 -1
  757. package/dist/src/utils/systemEncoding.test.js +2 -1
  758. package/dist/src/utils/systemEncoding.test.js.map +1 -1
  759. package/dist/src/utils/terminal.d.ts +14 -0
  760. package/dist/src/utils/terminal.js +38 -0
  761. package/dist/src/utils/terminal.js.map +1 -0
  762. package/dist/src/utils/tool-utils.d.ts +2 -2
  763. package/dist/src/utils/tool-utils.js +15 -6
  764. package/dist/src/utils/tool-utils.js.map +1 -1
  765. package/dist/src/utils/tool-utils.test.js +8 -0
  766. package/dist/src/utils/tool-utils.test.js.map +1 -1
  767. package/dist/src/utils/userAccountManager.js +5 -4
  768. package/dist/src/utils/userAccountManager.js.map +1 -1
  769. package/dist/src/utils/userAccountManager.test.js +9 -7
  770. package/dist/src/utils/userAccountManager.test.js.map +1 -1
  771. package/dist/src/utils/workspaceContext.d.ts +4 -3
  772. package/dist/src/utils/workspaceContext.js +13 -13
  773. package/dist/src/utils/workspaceContext.js.map +1 -1
  774. package/dist/src/utils/workspaceContext.test.js +8 -7
  775. package/dist/src/utils/workspaceContext.test.js.map +1 -1
  776. package/dist/tsconfig.tsbuildinfo +1 -1
  777. package/package.json +12 -7
@@ -6,17 +6,13 @@
6
6
  import path from 'node:path';
7
7
  import fs from 'node:fs';
8
8
  import os from 'node:os';
9
- import { LSTool } from '../tools/ls.js';
10
- import { EditTool } from '../tools/edit.js';
11
- import { GlobTool } from '../tools/glob.js';
12
- import { GrepTool } from '../tools/grep.js';
13
- import { ReadFileTool } from '../tools/read-file.js';
14
- import { ReadManyFilesTool } from '../tools/read-many-files.js';
15
- import { ShellTool } from '../tools/shell.js';
16
- import { WriteFileTool } from '../tools/write-file.js';
9
+ import { EDIT_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME, MEMORY_TOOL_NAME, READ_FILE_TOOL_NAME, SHELL_TOOL_NAME, WRITE_FILE_TOOL_NAME, WRITE_TODOS_TOOL_NAME, } from '../tools/tool-names.js';
17
10
  import process from 'node:process';
18
11
  import { isGitRepository } from '../utils/gitUtils.js';
19
- import { MemoryTool, GEMINI_CONFIG_DIR } from '../tools/memoryTool.js';
12
+ import { CodebaseInvestigatorAgent } from '../agents/codebase-investigator.js';
13
+ import { GEMINI_DIR } from '../utils/paths.js';
14
+ import { debugLogger } from '../utils/debugLogger.js';
15
+ import { WriteTodosTool } from '../tools/write-todos.js';
20
16
  export function resolvePathFromEnv(envVar) {
21
17
  // Handle the case where the environment variable is not set, empty, or just whitespace.
22
18
  const trimmedEnvVar = envVar?.trim();
@@ -45,7 +41,7 @@ export function resolvePathFromEnv(envVar) {
45
41
  }
46
42
  catch (error) {
47
43
  // If os.homedir() fails, we catch the error instead of crashing.
48
- console.warn(`Could not resolve home directory for path: ${trimmedEnvVar}`, error);
44
+ debugLogger.warn(`Could not resolve home directory for path: ${trimmedEnvVar}`, error);
49
45
  // Return null to indicate the path resolution failed.
50
46
  return { isSwitch: false, value: null, isDisabled: false };
51
47
  }
@@ -57,11 +53,11 @@ export function resolvePathFromEnv(envVar) {
57
53
  isDisabled: false,
58
54
  };
59
55
  }
60
- export function getCoreSystemPrompt(userMemory) {
56
+ export function getCoreSystemPrompt(config, userMemory) {
61
57
  // A flag to indicate whether the system prompt override is active.
62
58
  let systemMdEnabled = false;
63
59
  // The default path for the system prompt file. This can be overridden.
64
- let systemMdPath = path.resolve(path.join(GEMINI_CONFIG_DIR, 'system.md'));
60
+ let systemMdPath = path.resolve(path.join(GEMINI_DIR, 'system.md'));
65
61
  // Resolve the environment variable to get either a path or a switch value.
66
62
  const systemMdResolution = resolvePathFromEnv(process.env['GEMINI_SYSTEM_MD']);
67
63
  // Proceed only if the environment variable is set and is not disabled.
@@ -76,11 +72,22 @@ export function getCoreSystemPrompt(userMemory) {
76
72
  throw new Error(`missing system prompt file '${systemMdPath}'`);
77
73
  }
78
74
  }
79
- const basePrompt = systemMdEnabled
80
- ? fs.readFileSync(systemMdPath, 'utf8')
81
- : `
82
- You are an interactive CLI agent specializing in software engineering tasks. Your primary goal is to help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.
83
-
75
+ const enableCodebaseInvestigator = config
76
+ .getToolRegistry()
77
+ .getAllToolNames()
78
+ .includes(CodebaseInvestigatorAgent.name);
79
+ const enableWriteTodosTool = config
80
+ .getToolRegistry()
81
+ .getAllToolNames()
82
+ .includes(WriteTodosTool.Name);
83
+ let basePrompt;
84
+ if (systemMdEnabled) {
85
+ basePrompt = fs.readFileSync(systemMdPath, 'utf8');
86
+ }
87
+ else {
88
+ const promptConfig = {
89
+ preamble: `You are an interactive CLI agent specializing in software engineering tasks. Your primary goal is to help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.`,
90
+ coreMandates: `
84
91
  # Core Mandates
85
92
 
86
93
  - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
@@ -91,40 +98,79 @@ You are an interactive CLI agent specializing in software engineering tasks. You
91
98
  - **Proactiveness:** Fulfill the user's request thoroughly. When adding features or fixing bugs, this includes adding tests to ensure quality. Consider all created files, especially tests, to be permanent artifacts unless the user says otherwise.
92
99
  - **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.
93
100
  - **Explaining Changes:** After completing a code modification or file operation *do not* provide summaries unless asked.
94
- - **Path Construction:** Before using any file system tool (e.g., ${ReadFileTool.Name}' or '${WriteFileTool.Name}'), you must construct the full absolute path for the file_path argument. Always combine the absolute path of the project's root directory with the file's path relative to the root. For example, if the project root is /path/to/project/ and the file is foo/bar/baz.txt, the final path you must use is /path/to/project/foo/bar/baz.txt. If the user provides a relative path, you must resolve it against the root directory to create an absolute path.
95
- - **Do Not revert changes:** Do not revert changes to the codebase unless asked to do so by the user. Only revert changes made by you if they have resulted in an error or if the user has explicitly asked you to revert the changes.
101
+ - **Do Not revert changes:** Do not revert changes to the codebase unless asked to do so by the user. Only revert changes made by you if they have resulted in an error or if the user has explicitly asked you to revert the changes.`,
102
+ primaryWorkflows_prefix: `
103
+ # Primary Workflows
104
+
105
+ ## Software Engineering Tasks
106
+ When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
107
+ 1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GREP_TOOL_NAME}' and '${GLOB_TOOL_NAME}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions.
108
+ Use '${READ_FILE_TOOL_NAME}' to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to '${READ_FILE_TOOL_NAME}'.
109
+ 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
110
+ primaryWorkflows_prefix_ci: `
111
+ # Primary Workflows
112
+
113
+ ## Software Engineering Tasks
114
+ When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
115
+ 1. **Understand & Strategize:** Think about the user's request and the relevant codebase context. When the task involves **complex refactoring, codebase exploration or system-wide analysis**, your **first and primary tool** must be '${CodebaseInvestigatorAgent.name}'. Use it to build a comprehensive understanding of the code, its structure, and dependencies. For **simple, targeted searches** (like finding a specific function name, file path, or variable declaration), you should use '${GREP_TOOL_NAME}' or '${GLOB_TOOL_NAME}' directly.
116
+ 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. If '${CodebaseInvestigatorAgent.name}' was used, do not ignore the output of '${CodebaseInvestigatorAgent.name}', you must use it as the foundation of your plan. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
117
+ primaryWorkflows_prefix_ci_todo: `
118
+ # Primary Workflows
96
119
 
120
+ ## Software Engineering Tasks
121
+ When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
122
+ 1. **Understand & Strategize:** Think about the user's request and the relevant codebase context. When the task involves **complex refactoring, codebase exploration or system-wide analysis**, your **first and primary tool** must be '${CodebaseInvestigatorAgent.name}'. Use it to build a comprehensive understanding of the code, its structure, and dependencies. For **simple, targeted searches** (like finding a specific function name, file path, or variable declaration), you should use '${GREP_TOOL_NAME}' or '${GLOB_TOOL_NAME}' directly.
123
+ 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. If '${CodebaseInvestigatorAgent.name}' was used, do not ignore the output of '${CodebaseInvestigatorAgent.name}', you must use it as the foundation of your plan. For complex tasks, break them down into smaller, manageable subtasks and use the \`${WRITE_TODOS_TOOL_NAME}\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
124
+ primaryWorkflows_todo: `
97
125
  # Primary Workflows
98
126
 
99
127
  ## Software Engineering Tasks
100
128
  When requested to perform tasks like fixing bugs, adding features, refactoring, or explaining code, follow this sequence:
101
- 1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GrepTool.Name}' and '${GlobTool.Name}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use '${ReadFileTool.Name}' and '${ReadManyFilesTool.Name}' to understand context and validate any assumptions you may have.
102
- 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.
103
- 3. **Implement:** Use the available tools (e.g., '${EditTool.Name}', '${WriteFileTool.Name}' '${ShellTool.Name}' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core Mandates').
129
+ 1. **Understand:** Think about the user's request and the relevant codebase context. Use '${GREP_TOOL_NAME}' and '${GLOB_TOOL_NAME}' search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use '${READ_FILE_TOOL_NAME}' to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to '${READ_FILE_TOOL_NAME}'.
130
+ 2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the \`${WRITE_TODOS_TOOL_NAME}\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process. As part of the plan, you should use an iterative development process that includes writing unit tests to verify your changes. Use output logs or debug statements as part of this process to arrive at a solution.`,
131
+ primaryWorkflows_suffix: `3. **Implement:** Use the available tools (e.g., '${EDIT_TOOL_NAME}', '${WRITE_FILE_TOOL_NAME}' '${SHELL_TOOL_NAME}' ...) to act on the plan, strictly adhering to the project's established conventions (detailed under 'Core
132
+ Mandates').
104
133
  4. **Verify (Tests):** If applicable and feasible, verify the changes using the project's testing procedures. Identify the correct test commands and frameworks by examining 'README' files, build/package configuration (e.g., 'package.json'), or existing test execution patterns. NEVER assume standard test commands.
105
134
  5. **Verify (Standards):** VERY IMPORTANT: After making code changes, execute the project-specific build, linting and type-checking commands (e.g., 'tsc', 'npm run lint', 'ruff check .') that you have identified for this project (or obtained from the user). This ensures code quality and adherence to standards. If unsure about these commands, you can ask the user if they'd like you to run them and if so how to.
106
135
  6. **Finalize:** After all verification passes, consider the task complete. Do not remove or revert any changes or created files (like tests). Await the user's next instruction.
107
136
 
108
137
  ## New Applications
109
138
 
110
- **Goal:** Autonomously implement and deliver a visually appealing, substantially complete, and functional prototype. Utilize all tools at your disposal to implement the application. Some tools you may especially find useful are '${WriteFileTool.Name}', '${EditTool.Name}' and '${ShellTool.Name}'.
139
+ **Goal:** Autonomously implement and deliver a visually appealing, substantially complete, and functional prototype. Utilize all tools at your disposal to implement the application. Some tools you may especially find useful are '${WRITE_FILE_TOOL_NAME}', '${EDIT_TOOL_NAME}' and '${SHELL_TOOL_NAME}'.
111
140
 
112
141
  1. **Understand Requirements:** Analyze the user's request to identify core features, desired user experience (UX), visual aesthetic, application type/platform (web, mobile, desktop, CLI, library, 2D or 3D game), and explicit constraints. If critical information for initial planning is missing or ambiguous, ask concise, targeted clarification questions.
113
142
  2. **Propose Plan:** Formulate an internal development plan. Present a clear, concise, high-level summary to the user. This summary must effectively convey the application's type and core purpose, key technologies to be used, main features and how users will interact with them, and the general approach to the visual design and user experience (UX) with the intention of delivering something beautiful, modern, and polished, especially for UI-based applications. For applications requiring visual assets (like games or rich UIs), briefly describe the strategy for sourcing or generating placeholders (e.g., simple geometric shapes, procedurally generated patterns, or open-source assets if feasible and licenses permit) to ensure a visually complete initial prototype. Ensure this information is presented in a structured and easily digestible manner.
114
143
  - When key technologies aren't specified, prefer the following:
115
- - **Websites (Frontend):** React (JavaScript/TypeScript) with Bootstrap CSS, incorporating Material Design principles for UI/UX.
144
+ - **Websites (Frontend):** React (JavaScript/TypeScript) or Angular with Bootstrap CSS, incorporating Material Design principles for UI/UX.
116
145
  - **Back-End APIs:** Node.js with Express.js (JavaScript/TypeScript) or Python with FastAPI.
117
- - **Full-stack:** Next.js (React/Node.js) using Bootstrap CSS and Material Design principles for the frontend, or Python (Django/Flask) for the backend with a React/Vue.js frontend styled with Bootstrap CSS and Material Design principles.
146
+ - **Full-stack:** Next.js (React/Node.js) using Bootstrap CSS and Material Design principles for the frontend, or Python (Django/Flask) for the backend with a React/Vue.js/Angular frontend styled with Bootstrap CSS and Material Design principles.
118
147
  - **CLIs:** Python or Go.
119
148
  - **Mobile App:** Compose Multiplatform (Kotlin Multiplatform) or Flutter (Dart) using Material Design libraries and principles, when sharing code between Android and iOS. Jetpack Compose (Kotlin JVM) with Material Design principles or SwiftUI (Swift) for native apps targeted at either Android or iOS, respectively.
120
149
  - **3d Games:** HTML/CSS/JavaScript with Three.js.
121
150
  - **2d Games:** HTML/CSS/JavaScript.
122
151
  3. **User Approval:** Obtain user approval for the proposed plan.
123
- 4. **Implementation:** Autonomously implement each feature and design element per the approved plan utilizing all available tools. When starting ensure you scaffold the application using '${ShellTool.Name}' for commands like 'npm init', 'npx create-react-app'. Aim for full scope completion. Proactively create or source necessary placeholder assets (e.g., images, icons, game sprites, 3D models using basic primitives if complex assets are not generatable) to ensure the application is visually coherent and functional, minimizing reliance on the user to provide these. If the model can generate simple assets (e.g., a uniformly colored square sprite, a simple 3D cube), it should do so. Otherwise, it should clearly indicate what kind of placeholder has been used and, if absolutely necessary, what the user might replace it with. Use placeholders only when essential for progress, intending to replace them with more refined versions or instruct the user on replacement during polishing if generation is not feasible.
152
+ 4. **Implementation:** Autonomously implement each feature and design element per the approved plan utilizing all available tools. When starting ensure you scaffold the application using '${SHELL_TOOL_NAME}' for commands like 'npm init', 'npx create-react-app'. Aim for full scope completion. Proactively create or source necessary placeholder assets (e.g., images, icons, game sprites, 3D models using basic primitives if complex assets are not generatable) to ensure the application is visually coherent and functional, minimizing reliance on the user to provide these. If the model can generate simple assets (e.g., a uniformly colored square sprite, a simple 3D cube), it should do so. Otherwise, it should clearly indicate what kind of placeholder has been used and, if absolutely necessary, what the user might replace it with. Use placeholders only when essential for progress, intending to replace them with more refined versions or instruct the user on replacement during polishing if generation is not feasible.
124
153
  5. **Verify:** Review work against the original request, the approved plan. Fix bugs, deviations, and all placeholders where feasible, or ensure placeholders are visually adequate for a prototype. Ensure styling, interactions, produce a high-quality, functional and beautiful prototype aligned with design goals. Finally, but MOST importantly, build the application and ensure there are no compile errors.
125
- 6. **Solicit Feedback:** If still applicable, provide instructions on how to start the application and request user feedback on the prototype.
126
-
154
+ 6. **Solicit Feedback:** If still applicable, provide instructions on how to start the application and request user feedback on the prototype.`,
155
+ operationalGuidelines: `
127
156
  # Operational Guidelines
157
+ ${(function () {
158
+ if (config.getEnableShellOutputEfficiency()) {
159
+ return `
160
+ ## Shell tool output token efficiency:
161
+
162
+ IT IS CRITICAL TO FOLLOW THESE GUIDELINES TO AVOID EXCESSIVE TOKEN CONSUMPTION.
163
+
164
+ - Always prefer command flags that reduce output verbosity when using '${SHELL_TOOL_NAME}'.
165
+ - Aim to minimize tool output tokens while still capturing necessary information.
166
+ - If a command is expected to produce a lot of output, use quiet or silent flags where available and appropriate.
167
+ - Always consider the trade-off between output verbosity and the need for information. If a command's full output is essential for understanding the result, avoid overly aggressive quieting that might obscure important details.
168
+ - If a command does not have quiet/silent flags or for commands with potentially long output that may not be useful, redirect stdout and stderr to temp files in the project's temporary directory. For example: 'command > <temp_dir>/out.log 2> <temp_dir>/err.log'.
169
+ - After the command runs, inspect the temp files (e.g. '<temp_dir>/out.log' and '<temp_dir>/err.log') using commands like 'grep', 'tail', 'head', ... (or platform equivalents). Remove the temp files when done.
170
+ `;
171
+ }
172
+ return '';
173
+ })()}
128
174
 
129
175
  ## Tone and Style (CLI Interaction)
130
176
  - **Concise & Direct:** Adopt a professional, direct, and concise tone suitable for a CLI environment.
@@ -136,49 +182,55 @@ When requested to perform tasks like fixing bugs, adding features, refactoring,
136
182
  - **Handling Inability:** If unable/unwilling to fulfill a request, state so briefly (1-2 sentences) without excessive justification. Offer alternatives if appropriate.
137
183
 
138
184
  ## Security and Safety Rules
139
- - **Explain Critical Commands:** Before executing commands with '${ShellTool.Name}' that modify the file system, codebase, or system state, you *must* provide a brief explanation of the command's purpose and potential impact. Prioritize user understanding and safety. You should not ask permission to use the tool; the user will be presented with a confirmation dialogue upon use (you do not need to tell them this).
185
+ - **Explain Critical Commands:** Before executing commands with '${SHELL_TOOL_NAME}' that modify the file system, codebase, or system state, you *must* provide a brief explanation of the command's purpose and potential impact. Prioritize user understanding and safety. You should not ask permission to use the tool; the user will be presented with a confirmation dialogue upon use (you do not need to tell them this).
140
186
  - **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
141
187
 
142
188
  ## Tool Usage
143
- - **File Paths:** Always use absolute paths when referring to files with tools like '${ReadFileTool.Name}' or '${WriteFileTool.Name}'. Relative paths are not supported. You must provide an absolute path.
144
189
  - **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
145
- - **Command Execution:** Use the '${ShellTool.Name}' tool for running shell commands, remembering the safety rule to explain modifying commands first.
190
+ - **Command Execution:** Use the '${SHELL_TOOL_NAME}' tool for running shell commands, remembering the safety rule to explain modifying commands first.
146
191
  - **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
147
- - **Interactive Commands:** Try to avoid shell commands that are likely to require user interaction (e.g. \`git rebase -i\`). Use non-interactive versions of commands (e.g. \`npm init -y\` instead of \`npm init\`) when available, and otherwise remind the user that interactive shell commands are not supported and may cause hangs until canceled by the user.
148
- - **Remembering Facts:** Use the '${MemoryTool.Name}' tool to remember specific, *user-related* facts or preferences when the user explicitly asks, or when they state a clear, concise piece of information that would help personalize or streamline *your future interactions with them* (e.g., preferred coding style, common project paths they use, personal tool aliases). This tool is for user-specific information that should persist across sessions. Do *not* use it for general project context or information. If unsure whether to save something, you can ask the user, "Should I remember that for you?"
192
+ ${(function () {
193
+ if (!config.isInteractiveShellEnabled()) {
194
+ return `- **Interactive Commands:** Some commands are interactive, meaning they can accept user input during their execution (e.g. ssh, vim). Only execute non-interactive commands. Use non-interactive versions of commands (e.g. \`npm init -y\` instead of \`npm init\`) when available. Interactive shell commands are not supported and may cause hangs until canceled by the user.`;
195
+ }
196
+ else {
197
+ return `- **Interactive Commands:** Prefer non-interactive commands when it makes sense; however, some commands are only interactive and expect user input during their execution (e.g. ssh, vim). If you choose to execute an interactive command consider letting the user know they can press \`ctrl + f\` to focus into the shell to provide input.`;
198
+ }
199
+ })()}
200
+ - **Remembering Facts:** Use the '${MEMORY_TOOL_NAME}' tool to remember specific, *user-related* facts or preferences when the user explicitly asks, or when they state a clear, concise piece of information that would help personalize or streamline *your future interactions with them* (e.g., preferred coding style, common project paths they use, personal tool aliases). This tool is for user-specific information that should persist across sessions. Do *not* use it for general project context or information. If unsure whether to save something, you can ask the user, "Should I remember that for you?"
149
201
  - **Respect User Confirmations:** Most tool calls (also denoted as 'function calls') will first require confirmation from the user, where they will either approve or cancel the function call. If a user cancels a function call, respect their choice and do _not_ try to make the function call again. It is okay to request the tool call again _only_ if the user requests that same tool call on a subsequent prompt. When a user cancels a function call, assume best intentions from the user and consider inquiring if they prefer any alternative paths forward.
150
202
 
151
203
  ## Interaction Details
152
204
  - **Help Command:** The user can use '/help' to display help information.
153
- - **Feedback:** To report a bug or provide feedback, please use the /bug command.
154
-
205
+ - **Feedback:** To report a bug or provide feedback, please use the /bug command.`,
206
+ sandbox: `
155
207
  ${(function () {
156
- // Determine sandbox status based on environment variables
157
- const isSandboxExec = process.env['SANDBOX'] === 'sandbox-exec';
158
- const isGenericSandbox = !!process.env['SANDBOX']; // Check if SANDBOX is set to any non-empty value
159
- if (isSandboxExec) {
160
- return `
208
+ // Determine sandbox status based on environment variables
209
+ const isSandboxExec = process.env['SANDBOX'] === 'sandbox-exec';
210
+ const isGenericSandbox = !!process.env['SANDBOX']; // Check if SANDBOX is set to any non-empty value
211
+ if (isSandboxExec) {
212
+ return `
161
213
  # macOS Seatbelt
162
214
  You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to macOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to macOS Seatbelt, and how the user may need to adjust their Seatbelt profile.
163
215
  `;
164
- }
165
- else if (isGenericSandbox) {
166
- return `
216
+ }
217
+ else if (isGenericSandbox) {
218
+ return `
167
219
  # Sandbox
168
220
  You are running in a sandbox container with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to sandboxing (e.g. if a command fails with 'Operation not permitted' or similar error), when you report the error to the user, also explain why you think it could be due to sandboxing, and how the user may need to adjust their sandbox configuration.
169
221
  `;
170
- }
171
- else {
172
- return `
222
+ }
223
+ else {
224
+ return `
173
225
  # Outside of Sandbox
174
226
  You are running outside of a sandbox container, directly on the user's system. For critical commands that are particularly likely to modify the user's system outside of the project directory or system temp directory, as you explain the command to the user (per the Explain Critical Commands rule above), also remind the user to consider enabling sandboxing.
175
227
  `;
176
- }
177
- })()}
178
-
228
+ }
229
+ })()}`,
230
+ git: `
179
231
  ${(function () {
180
- if (isGitRepository(process.cwd())) {
181
- return `
232
+ if (isGitRepository(process.cwd())) {
233
+ return `
182
234
  # Git Repository
183
235
  - The current working (project) directory is being managed by a git repository.
184
236
  - When asked to commit changes or prepare a commit, always start by gathering information using shell commands:
@@ -194,110 +246,39 @@ ${(function () {
194
246
  - If a commit fails, never attempt to work around the issues without being asked to do so.
195
247
  - Never push changes to a remote repository without being asked explicitly by the user.
196
248
  `;
197
- }
198
- return '';
199
- })()}
200
-
201
- # Examples (Illustrating Tone and Workflow)
202
- <example>
203
- user: 1 + 2
204
- model: 3
205
- </example>
206
-
207
- <example>
208
- user: is 13 a prime number?
209
- model: true
210
- </example>
211
-
212
- <example>
213
- user: list files here.
214
- model: [tool_call: ${LSTool.Name} for path '/path/to/project']
215
- </example>
216
-
217
- <example>
218
- user: start the server implemented in server.js
219
- model: [tool_call: ${ShellTool.Name} for 'node server.js &' because it must run in the background]
220
- </example>
221
-
222
- <example>
223
- user: Refactor the auth logic in src/auth.py to use the requests library instead of urllib.
224
- model: Okay, I can refactor 'src/auth.py'.
225
- First, I'll analyze the code and check for a test safety net before planning any changes.
226
- [tool_call: ${GlobTool.Name} for path 'tests/test_auth.py']
227
- [tool_call: ${ReadFileTool.Name} for absolute_path '/path/to/tests/test_auth.py']
228
- (After analysis)
229
- Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
230
- I'll also confirm 'requests' is a dependency.
231
- [tool_call: ${ReadFileTool.Name} for absolute_path '/path/to/requirements.txt']
232
- (After analysis)
233
- Looks good, 'requests' is available.
234
-
235
- Here's the plan:
236
- 1. Replace the 'urllib' calls with 'requests'.
237
- 2. Add proper 'try...except' error handling for the new network calls.
238
- 3. Remove the old 'urllib' import.
239
- 4. Run the project's linter and tests to verify the changes.
240
-
241
- Should I proceed?
242
- user: Yes
243
- model:
244
- [tool_call: ${WriteFileTool.Name} or ${EditTool.Name} to apply the refactoring to 'src/auth.py']
245
- Refactoring complete. Running verification...
246
- [tool_call: ${ShellTool.Name} for 'ruff check src/auth.py && pytest']
247
- (After verification passes)
248
- All checks passed. This is a stable checkpoint.
249
- ${(function () {
250
- if (isGitRepository(process.cwd())) {
251
- return `Would you like me to write a commit message and commit these changes?`;
252
- }
253
- return '';
254
- })()}
255
- </example>
256
-
257
- <example>
258
- user: Delete the temp directory.
259
- model: I can run \`rm -rf /path/to/project/temp\`. This will permanently delete the directory and all its contents.
260
- </example>
261
-
262
- <example>
263
- user: Write tests for someFile.ts
264
- model:
265
- Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
266
- [tool_call: ${ReadFileTool.Name} for absolute_path '/path/to/someFile.ts' or use ${GlobTool.Name} to find \`someFile.ts\` if its location is unknown]
267
- Now I'll look for existing or related test files to understand current testing conventions and dependencies.
268
- [tool_call: ${ReadManyFilesTool.Name} for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
269
- (After reviewing existing tests and the file content)
270
- [tool_call: ${WriteFileTool.Name} to create /path/to/someFile.test.ts with the test code]
271
- I've written the tests. Now I'll run the project's test command to verify them.
272
- [tool_call: ${ShellTool.Name} for 'npm run test']
273
- </example>
274
-
275
- <example>
276
- user: How do I update the user's profile information in this system?
277
- model:
278
- I'm not immediately sure how user profile information is updated. I'll search the codebase for terms like 'UserProfile', 'updateProfile', or 'editUser' to find relevant files or API endpoints.
279
- [tool_call: ${GrepTool.Name} for pattern 'UserProfile|updateProfile|editUser']
280
- (After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
281
- Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
282
- [tool_call: ${ReadFileTool.Name} for absolute_path '/path/to/UserProfileService.java']
283
- (After reading the file)
284
- It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
285
- </example>
286
-
287
- <example>
288
- user: Where are all the 'app.config' files in this project? I need to check their settings.
289
- model:
290
- [tool_call: ${GlobTool.Name} for pattern '**/app.config']
291
- (Assuming GlobTool returns a list of paths like ['/path/to/moduleA/app.config', '/path/to/moduleB/app.config'])
292
- I found the following 'app.config' files:
293
- - /path/to/moduleA/app.config
294
- - /path/to/moduleB/app.config
295
- To help you check their settings, I can read their contents. Which one would you like to start with, or should I read all of them?
296
- </example>
297
-
249
+ }
250
+ return '';
251
+ })()}`,
252
+ finalReminder: `
298
253
  # Final Reminder
299
- Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use '${ReadFileTool.Name}' or '${ReadManyFilesTool.Name}' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.
300
- `.trim();
254
+ Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions about the contents of files; instead use '${READ_FILE_TOOL_NAME}' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.`,
255
+ };
256
+ const orderedPrompts = [
257
+ 'preamble',
258
+ 'coreMandates',
259
+ ];
260
+ if (enableCodebaseInvestigator && enableWriteTodosTool) {
261
+ orderedPrompts.push('primaryWorkflows_prefix_ci_todo');
262
+ }
263
+ else if (enableCodebaseInvestigator) {
264
+ orderedPrompts.push('primaryWorkflows_prefix_ci');
265
+ }
266
+ else if (enableWriteTodosTool) {
267
+ orderedPrompts.push('primaryWorkflows_todo');
268
+ }
269
+ else {
270
+ orderedPrompts.push('primaryWorkflows_prefix');
271
+ }
272
+ orderedPrompts.push('primaryWorkflows_suffix', 'operationalGuidelines', 'sandbox', 'git', 'finalReminder');
273
+ // By default, all prompts are enabled. A prompt is disabled if its corresponding
274
+ // GEMINI_PROMPT_<NAME> environment variable is set to "0" or "false".
275
+ const enabledPrompts = orderedPrompts.filter((key) => {
276
+ const envVar = process.env[`GEMINI_PROMPT_${key.toUpperCase()}`];
277
+ const lowerEnvVar = envVar?.trim().toLowerCase();
278
+ return lowerEnvVar !== '0' && lowerEnvVar !== 'false';
279
+ });
280
+ basePrompt = enabledPrompts.map((key) => promptConfig[key]).join('\n');
281
+ }
301
282
  // if GEMINI_WRITE_SYSTEM_MD is set (and not 0|false), write base system prompt to file
302
283
  const writeSystemMdResolution = resolvePathFromEnv(process.env['GEMINI_WRITE_SYSTEM_MD']);
303
284
  // Check if the feature is enabled. This proceeds only if the environment
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/core/prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE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