gencode-ai 0.1.0 → 0.1.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 (356) hide show
  1. package/.gencode/settings.local.json +7 -0
  2. package/README.md +20 -102
  3. package/dist/agent/agent.d.ts +43 -2
  4. package/dist/agent/agent.d.ts.map +1 -1
  5. package/dist/agent/agent.js +90 -17
  6. package/dist/agent/agent.js.map +1 -1
  7. package/dist/agent/types.d.ts +9 -1
  8. package/dist/agent/types.d.ts.map +1 -1
  9. package/dist/cli/components/AllModelsSelector.d.ts +11 -0
  10. package/dist/cli/components/AllModelsSelector.d.ts.map +1 -0
  11. package/dist/cli/components/AllModelsSelector.js +153 -0
  12. package/dist/cli/components/AllModelsSelector.js.map +1 -0
  13. package/dist/cli/components/App.d.ts +8 -1
  14. package/dist/cli/components/App.d.ts.map +1 -1
  15. package/dist/cli/components/App.js +276 -40
  16. package/dist/cli/components/App.js.map +1 -1
  17. package/dist/cli/components/CommandSuggestions.d.ts.map +1 -1
  18. package/dist/cli/components/CommandSuggestions.js +3 -0
  19. package/dist/cli/components/CommandSuggestions.js.map +1 -1
  20. package/dist/cli/components/Header.d.ts +1 -1
  21. package/dist/cli/components/Header.d.ts.map +1 -1
  22. package/dist/cli/components/Header.js +4 -6
  23. package/dist/cli/components/Header.js.map +1 -1
  24. package/dist/cli/components/Logo.d.ts +1 -0
  25. package/dist/cli/components/Logo.d.ts.map +1 -1
  26. package/dist/cli/components/Logo.js +16 -3
  27. package/dist/cli/components/Logo.js.map +1 -1
  28. package/dist/cli/components/Messages.d.ts +17 -3
  29. package/dist/cli/components/Messages.d.ts.map +1 -1
  30. package/dist/cli/components/Messages.js +70 -18
  31. package/dist/cli/components/Messages.js.map +1 -1
  32. package/dist/cli/components/ModelSelector.d.ts +7 -7
  33. package/dist/cli/components/ModelSelector.d.ts.map +1 -1
  34. package/dist/cli/components/ModelSelector.js +116 -33
  35. package/dist/cli/components/ModelSelector.js.map +1 -1
  36. package/dist/cli/components/PermissionPrompt.d.ts +60 -0
  37. package/dist/cli/components/PermissionPrompt.d.ts.map +1 -0
  38. package/dist/cli/components/PermissionPrompt.js +192 -0
  39. package/dist/cli/components/PermissionPrompt.js.map +1 -0
  40. package/dist/cli/components/ProviderManager.d.ts +8 -0
  41. package/dist/cli/components/ProviderManager.d.ts.map +1 -0
  42. package/dist/cli/components/ProviderManager.js +280 -0
  43. package/dist/cli/components/ProviderManager.js.map +1 -0
  44. package/dist/cli/components/Spinner.d.ts +7 -2
  45. package/dist/cli/components/Spinner.d.ts.map +1 -1
  46. package/dist/cli/components/Spinner.js +116 -25
  47. package/dist/cli/components/Spinner.js.map +1 -1
  48. package/dist/cli/components/TodoList.d.ts +7 -0
  49. package/dist/cli/components/TodoList.d.ts.map +1 -0
  50. package/dist/cli/components/TodoList.js +34 -0
  51. package/dist/cli/components/TodoList.js.map +1 -0
  52. package/dist/cli/components/index.d.ts +1 -0
  53. package/dist/cli/components/index.d.ts.map +1 -1
  54. package/dist/cli/components/index.js +1 -0
  55. package/dist/cli/components/index.js.map +1 -1
  56. package/dist/cli/components/markdown.d.ts +9 -0
  57. package/dist/cli/components/markdown.d.ts.map +1 -0
  58. package/dist/cli/components/markdown.js +129 -0
  59. package/dist/cli/components/markdown.js.map +1 -0
  60. package/dist/cli/components/theme.d.ts +5 -0
  61. package/dist/cli/components/theme.d.ts.map +1 -1
  62. package/dist/cli/components/theme.js +7 -0
  63. package/dist/cli/components/theme.js.map +1 -1
  64. package/dist/cli/index.js +66 -12
  65. package/dist/cli/index.js.map +1 -1
  66. package/dist/config/index.d.ts +14 -4
  67. package/dist/config/index.d.ts.map +1 -1
  68. package/dist/config/index.js +19 -3
  69. package/dist/config/index.js.map +1 -1
  70. package/dist/config/levels.d.ts +49 -0
  71. package/dist/config/levels.d.ts.map +1 -0
  72. package/dist/config/levels.js +222 -0
  73. package/dist/config/levels.js.map +1 -0
  74. package/dist/config/loader.d.ts +46 -0
  75. package/dist/config/loader.d.ts.map +1 -0
  76. package/dist/config/loader.js +153 -0
  77. package/dist/config/loader.js.map +1 -0
  78. package/dist/config/manager.d.ts +115 -15
  79. package/dist/config/manager.d.ts.map +1 -1
  80. package/dist/config/manager.js +260 -34
  81. package/dist/config/manager.js.map +1 -1
  82. package/dist/config/manager.test.d.ts +5 -0
  83. package/dist/config/manager.test.d.ts.map +1 -0
  84. package/dist/config/manager.test.js +192 -0
  85. package/dist/config/manager.test.js.map +1 -0
  86. package/dist/config/merger.d.ts +56 -0
  87. package/dist/config/merger.d.ts.map +1 -0
  88. package/dist/config/merger.js +177 -0
  89. package/dist/config/merger.js.map +1 -0
  90. package/dist/config/providers-config.d.ts +28 -0
  91. package/dist/config/providers-config.d.ts.map +1 -0
  92. package/dist/config/providers-config.js +79 -0
  93. package/dist/config/providers-config.js.map +1 -0
  94. package/dist/config/test-utils.d.ts +24 -0
  95. package/dist/config/test-utils.d.ts.map +1 -0
  96. package/dist/config/test-utils.js +55 -0
  97. package/dist/config/test-utils.js.map +1 -0
  98. package/dist/config/types.d.ts +108 -9
  99. package/dist/config/types.d.ts.map +1 -1
  100. package/dist/config/types.js +53 -2
  101. package/dist/config/types.js.map +1 -1
  102. package/dist/memory/import-resolver.d.ts +46 -0
  103. package/dist/memory/import-resolver.d.ts.map +1 -0
  104. package/dist/memory/import-resolver.js +117 -0
  105. package/dist/memory/import-resolver.js.map +1 -0
  106. package/dist/memory/index.d.ts +7 -6
  107. package/dist/memory/index.d.ts.map +1 -1
  108. package/dist/memory/index.js +7 -5
  109. package/dist/memory/index.js.map +1 -1
  110. package/dist/memory/init-prompt.d.ts +22 -0
  111. package/dist/memory/init-prompt.d.ts.map +1 -0
  112. package/dist/memory/init-prompt.js +103 -0
  113. package/dist/memory/init-prompt.js.map +1 -0
  114. package/dist/memory/memory-manager.d.ts +119 -0
  115. package/dist/memory/memory-manager.d.ts.map +1 -0
  116. package/dist/memory/memory-manager.js +587 -0
  117. package/dist/memory/memory-manager.js.map +1 -0
  118. package/dist/memory/rules-parser.d.ts +38 -0
  119. package/dist/memory/rules-parser.d.ts.map +1 -0
  120. package/dist/memory/rules-parser.js +69 -0
  121. package/dist/memory/rules-parser.js.map +1 -0
  122. package/dist/memory/test-utils.d.ts +20 -0
  123. package/dist/memory/test-utils.d.ts.map +1 -0
  124. package/dist/memory/test-utils.js +44 -0
  125. package/dist/memory/test-utils.js.map +1 -0
  126. package/dist/memory/types.d.ts +70 -63
  127. package/dist/memory/types.d.ts.map +1 -1
  128. package/dist/memory/types.js +42 -2
  129. package/dist/memory/types.js.map +1 -1
  130. package/dist/permissions/audit.d.ts +82 -0
  131. package/dist/permissions/audit.d.ts.map +1 -0
  132. package/dist/permissions/audit.js +229 -0
  133. package/dist/permissions/audit.js.map +1 -0
  134. package/dist/permissions/index.d.ts +11 -1
  135. package/dist/permissions/index.d.ts.map +1 -1
  136. package/dist/permissions/index.js +15 -0
  137. package/dist/permissions/index.js.map +1 -1
  138. package/dist/permissions/manager.d.ts +149 -13
  139. package/dist/permissions/manager.d.ts.map +1 -1
  140. package/dist/permissions/manager.js +480 -35
  141. package/dist/permissions/manager.js.map +1 -1
  142. package/dist/permissions/manager.test.d.ts +5 -0
  143. package/dist/permissions/manager.test.d.ts.map +1 -0
  144. package/dist/permissions/manager.test.js +213 -0
  145. package/dist/permissions/manager.test.js.map +1 -0
  146. package/dist/permissions/persistence.d.ts +74 -0
  147. package/dist/permissions/persistence.d.ts.map +1 -0
  148. package/dist/permissions/persistence.js +248 -0
  149. package/dist/permissions/persistence.js.map +1 -0
  150. package/dist/permissions/persistence.test.d.ts +5 -0
  151. package/dist/permissions/persistence.test.d.ts.map +1 -0
  152. package/dist/permissions/persistence.test.js +171 -0
  153. package/dist/permissions/persistence.test.js.map +1 -0
  154. package/dist/permissions/prompt-matcher.d.ts +64 -0
  155. package/dist/permissions/prompt-matcher.d.ts.map +1 -0
  156. package/dist/permissions/prompt-matcher.js +415 -0
  157. package/dist/permissions/prompt-matcher.js.map +1 -0
  158. package/dist/permissions/prompt-matcher.test.d.ts +5 -0
  159. package/dist/permissions/prompt-matcher.test.d.ts.map +1 -0
  160. package/dist/permissions/prompt-matcher.test.js +107 -0
  161. package/dist/permissions/prompt-matcher.test.js.map +1 -0
  162. package/dist/permissions/types.d.ts +157 -0
  163. package/dist/permissions/types.d.ts.map +1 -1
  164. package/dist/permissions/types.js +43 -8
  165. package/dist/permissions/types.js.map +1 -1
  166. package/dist/prompts/index.d.ts +92 -0
  167. package/dist/prompts/index.d.ts.map +1 -0
  168. package/dist/prompts/index.js +241 -0
  169. package/dist/prompts/index.js.map +1 -0
  170. package/dist/providers/gemini.d.ts.map +1 -1
  171. package/dist/providers/gemini.js +14 -3
  172. package/dist/providers/gemini.js.map +1 -1
  173. package/dist/providers/index.d.ts +5 -3
  174. package/dist/providers/index.d.ts.map +1 -1
  175. package/dist/providers/index.js +13 -1
  176. package/dist/providers/index.js.map +1 -1
  177. package/dist/providers/registry.d.ts +66 -0
  178. package/dist/providers/registry.d.ts.map +1 -0
  179. package/dist/providers/registry.js +158 -0
  180. package/dist/providers/registry.js.map +1 -0
  181. package/dist/providers/search/brave.d.ts +14 -0
  182. package/dist/providers/search/brave.d.ts.map +1 -0
  183. package/dist/providers/search/brave.js +87 -0
  184. package/dist/providers/search/brave.js.map +1 -0
  185. package/dist/providers/search/exa.d.ts +12 -0
  186. package/dist/providers/search/exa.d.ts.map +1 -0
  187. package/dist/providers/search/exa.js +158 -0
  188. package/dist/providers/search/exa.js.map +1 -0
  189. package/dist/providers/search/index.d.ts +31 -0
  190. package/dist/providers/search/index.d.ts.map +1 -0
  191. package/dist/providers/search/index.js +75 -0
  192. package/dist/providers/search/index.js.map +1 -0
  193. package/dist/providers/search/serper.d.ts +14 -0
  194. package/dist/providers/search/serper.d.ts.map +1 -0
  195. package/dist/providers/search/serper.js +87 -0
  196. package/dist/providers/search/serper.js.map +1 -0
  197. package/dist/providers/search/types.d.ts +21 -0
  198. package/dist/providers/search/types.d.ts.map +1 -0
  199. package/dist/providers/search/types.js +5 -0
  200. package/dist/providers/search/types.js.map +1 -0
  201. package/dist/providers/store.d.ts +104 -0
  202. package/dist/providers/store.d.ts.map +1 -0
  203. package/dist/providers/store.js +171 -0
  204. package/dist/providers/store.js.map +1 -0
  205. package/dist/providers/types.d.ts +7 -1
  206. package/dist/providers/types.d.ts.map +1 -1
  207. package/dist/providers/vertex-ai.d.ts +33 -0
  208. package/dist/providers/vertex-ai.d.ts.map +1 -0
  209. package/dist/providers/vertex-ai.js +407 -0
  210. package/dist/providers/vertex-ai.js.map +1 -0
  211. package/dist/tools/builtin/bash.d.ts.map +1 -1
  212. package/dist/tools/builtin/bash.js +2 -1
  213. package/dist/tools/builtin/bash.js.map +1 -1
  214. package/dist/tools/builtin/edit.d.ts.map +1 -1
  215. package/dist/tools/builtin/edit.js +2 -1
  216. package/dist/tools/builtin/edit.js.map +1 -1
  217. package/dist/tools/builtin/glob.d.ts.map +1 -1
  218. package/dist/tools/builtin/glob.js +2 -1
  219. package/dist/tools/builtin/glob.js.map +1 -1
  220. package/dist/tools/builtin/grep.d.ts.map +1 -1
  221. package/dist/tools/builtin/grep.js +2 -1
  222. package/dist/tools/builtin/grep.js.map +1 -1
  223. package/dist/tools/builtin/read.d.ts.map +1 -1
  224. package/dist/tools/builtin/read.js +2 -1
  225. package/dist/tools/builtin/read.js.map +1 -1
  226. package/dist/tools/builtin/todowrite.d.ts +15 -0
  227. package/dist/tools/builtin/todowrite.d.ts.map +1 -0
  228. package/dist/tools/builtin/todowrite.js +88 -0
  229. package/dist/tools/builtin/todowrite.js.map +1 -0
  230. package/dist/tools/builtin/webfetch.d.ts +20 -0
  231. package/dist/tools/builtin/webfetch.d.ts.map +1 -0
  232. package/dist/tools/builtin/webfetch.js +228 -0
  233. package/dist/tools/builtin/webfetch.js.map +1 -0
  234. package/dist/tools/builtin/websearch.d.ts +17 -0
  235. package/dist/tools/builtin/websearch.d.ts.map +1 -0
  236. package/dist/tools/builtin/websearch.js +87 -0
  237. package/dist/tools/builtin/websearch.js.map +1 -0
  238. package/dist/tools/builtin/write.d.ts.map +1 -1
  239. package/dist/tools/builtin/write.js +2 -1
  240. package/dist/tools/builtin/write.js.map +1 -1
  241. package/dist/tools/index.d.ts +18 -0
  242. package/dist/tools/index.d.ts.map +1 -1
  243. package/dist/tools/index.js +28 -2
  244. package/dist/tools/index.js.map +1 -1
  245. package/dist/tools/types.d.ts +41 -0
  246. package/dist/tools/types.d.ts.map +1 -1
  247. package/dist/tools/types.js +16 -0
  248. package/dist/tools/types.js.map +1 -1
  249. package/dist/tools/utils/ssrf.d.ts +18 -0
  250. package/dist/tools/utils/ssrf.d.ts.map +1 -0
  251. package/dist/tools/utils/ssrf.js +70 -0
  252. package/dist/tools/utils/ssrf.js.map +1 -0
  253. package/docs/README.md +5 -4
  254. package/docs/config-system-comparison.md +707 -0
  255. package/docs/memory-system.md +238 -0
  256. package/docs/permissions.md +368 -0
  257. package/docs/proposals/0001-web-fetch-tool.md +32 -2
  258. package/docs/proposals/0002-web-search-tool.md +59 -2
  259. package/docs/proposals/0005-todo-system.md +350 -85
  260. package/docs/proposals/0006-memory-system.md +11 -10
  261. package/docs/proposals/0012-ask-user-question.md +941 -206
  262. package/docs/proposals/0023-permission-enhancements.md +61 -2
  263. package/docs/proposals/0041-configuration-system.md +587 -0
  264. package/docs/proposals/0042-prompt-optimization.md +866 -0
  265. package/docs/proposals/README.md +8 -6
  266. package/docs/providers.md +220 -0
  267. package/jest.config.js +26 -0
  268. package/package.json +14 -3
  269. package/src/agent/agent.ts +120 -18
  270. package/src/agent/types.ts +9 -1
  271. package/src/cli/components/App.tsx +369 -47
  272. package/src/cli/components/CommandSuggestions.tsx +3 -0
  273. package/src/cli/components/Header.tsx +11 -17
  274. package/src/cli/components/Logo.tsx +76 -9
  275. package/src/cli/components/Messages.tsx +146 -38
  276. package/src/cli/components/ModelSelector.tsx +169 -52
  277. package/src/cli/components/PermissionPrompt.tsx +388 -0
  278. package/src/cli/components/ProviderManager.tsx +534 -0
  279. package/src/cli/components/Spinner.tsx +138 -25
  280. package/src/cli/components/TodoList.tsx +54 -0
  281. package/src/cli/components/index.ts +6 -0
  282. package/src/cli/components/markdown.ts +157 -0
  283. package/src/cli/components/theme.ts +7 -0
  284. package/src/cli/index.tsx +76 -13
  285. package/src/config/index.ts +79 -4
  286. package/src/config/levels.test.ts +163 -0
  287. package/src/config/levels.ts +285 -0
  288. package/src/config/loader.test.ts +120 -0
  289. package/src/config/loader.ts +178 -0
  290. package/src/config/manager.test.ts +215 -0
  291. package/src/config/manager.ts +328 -40
  292. package/src/config/merger.test.ts +360 -0
  293. package/src/config/merger.ts +221 -0
  294. package/src/config/providers-config.ts +85 -0
  295. package/src/config/test-utils.ts +79 -0
  296. package/src/config/types.ts +186 -9
  297. package/src/memory/import-resolver.test.ts +117 -0
  298. package/src/memory/import-resolver.ts +149 -0
  299. package/src/memory/index.ts +11 -0
  300. package/src/memory/init-prompt.ts +113 -0
  301. package/src/memory/memory-manager.test.ts +198 -0
  302. package/src/memory/memory-manager.ts +716 -0
  303. package/src/memory/rules-parser.test.ts +182 -0
  304. package/src/memory/rules-parser.ts +82 -0
  305. package/src/memory/test-utils.ts +60 -0
  306. package/src/memory/types.ts +119 -0
  307. package/src/permissions/audit.ts +284 -0
  308. package/src/permissions/index.ts +20 -1
  309. package/src/permissions/manager.test.ts +260 -0
  310. package/src/permissions/manager.ts +592 -40
  311. package/src/permissions/persistence.test.ts +220 -0
  312. package/src/permissions/persistence.ts +301 -0
  313. package/src/permissions/prompt-matcher.test.ts +213 -0
  314. package/src/permissions/prompt-matcher.ts +472 -0
  315. package/src/permissions/types.ts +236 -8
  316. package/src/prompts/index.test.ts +279 -0
  317. package/src/prompts/index.ts +306 -0
  318. package/src/prompts/system/anthropic.txt +29 -0
  319. package/src/prompts/system/base.txt +124 -0
  320. package/src/prompts/system/gemini.txt +35 -0
  321. package/src/prompts/system/generic.txt +128 -0
  322. package/src/prompts/system/openai.txt +29 -0
  323. package/src/prompts/tools/bash.txt +60 -0
  324. package/src/prompts/tools/edit.txt +29 -0
  325. package/src/prompts/tools/glob.txt +35 -0
  326. package/src/prompts/tools/grep.txt +43 -0
  327. package/src/prompts/tools/read.txt +22 -0
  328. package/src/prompts/tools/todowrite.txt +71 -0
  329. package/src/prompts/tools/webfetch.txt +34 -0
  330. package/src/prompts/tools/websearch.txt +41 -0
  331. package/src/prompts/tools/write.txt +23 -0
  332. package/src/providers/gemini.ts +20 -4
  333. package/src/providers/index.ts +18 -3
  334. package/src/providers/registry.ts +198 -0
  335. package/src/providers/search/brave.ts +132 -0
  336. package/src/providers/search/exa.ts +217 -0
  337. package/src/providers/search/index.ts +79 -0
  338. package/src/providers/search/serper.ts +133 -0
  339. package/src/providers/search/types.ts +24 -0
  340. package/src/providers/store.ts +216 -0
  341. package/src/providers/types.ts +9 -1
  342. package/src/providers/vertex-ai.ts +594 -0
  343. package/src/tools/builtin/bash.ts +2 -1
  344. package/src/tools/builtin/edit.ts +2 -1
  345. package/src/tools/builtin/glob.ts +2 -1
  346. package/src/tools/builtin/grep.ts +2 -1
  347. package/src/tools/builtin/read.ts +2 -1
  348. package/src/tools/builtin/todowrite.ts +102 -0
  349. package/src/tools/builtin/webfetch.ts +261 -0
  350. package/src/tools/builtin/websearch.ts +103 -0
  351. package/src/tools/builtin/write.ts +2 -1
  352. package/src/tools/index.ts +28 -2
  353. package/src/tools/types.ts +32 -0
  354. package/src/tools/utils/ssrf.ts +79 -0
  355. package/tsconfig.json +1 -1
  356. package/CLAUDE.md +0 -70
@@ -0,0 +1,60 @@
1
+ Executes a bash command in a persistent shell session with optional timeout.
2
+
3
+ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for those instead.
4
+
5
+ Before executing the command:
6
+
7
+ 1. Directory Verification:
8
+ - If the command will create new directories or files, first use `ls` to verify the parent directory exists
9
+ - For example, before running "mkdir foo/bar", first use `ls foo` to check that "foo" exists
10
+
11
+ 2. Command Execution:
12
+ - Always quote file paths that contain spaces with double quotes
13
+ - Examples of proper quoting:
14
+ - cd "/Users/name/My Documents" (correct)
15
+ - cd /Users/name/My Documents (incorrect - will fail)
16
+
17
+ Usage notes:
18
+ - The command argument is required
19
+ - You can specify an optional timeout in milliseconds (default: 30000, max: 600000)
20
+ - If output exceeds 30000 characters, it will be truncated
21
+
22
+ Avoid using these commands via Bash (use specialized tools instead):
23
+ - File search: Use Glob (NOT find or ls)
24
+ - Content search: Use Grep (NOT grep or rg)
25
+ - Read files: Use Read (NOT cat/head/tail)
26
+ - Edit files: Use Edit (NOT sed/awk)
27
+ - Write files: Use Write (NOT echo)
28
+
29
+ When issuing multiple commands:
30
+ - If independent, make multiple Bash calls in parallel
31
+ - If dependent, chain with && (e.g., `git add . && git commit -m "message"`)
32
+ - Use ; only when you don't care if earlier commands fail
33
+
34
+ # Git Operations
35
+
36
+ Only create commits when requested by the user. When committing:
37
+
38
+ Git Safety Protocol:
39
+ - NEVER update git config
40
+ - NEVER run destructive commands (push --force, hard reset) unless explicitly requested
41
+ - NEVER skip hooks (--no-verify) unless explicitly requested
42
+ - NEVER commit unless explicitly asked
43
+
44
+ Commit workflow:
45
+ 1. Run git status and git diff in parallel to understand changes
46
+ 2. Run git log to see recent commit message style
47
+ 3. Add relevant files and create commit
48
+ 4. Run git status to verify success
49
+
50
+ # Creating Pull Requests
51
+
52
+ Use the gh command for GitHub-related tasks. When creating PRs:
53
+ 1. Check git status and branch state
54
+ 2. Run git log and git diff to understand all changes
55
+ 3. Push to remote if needed
56
+ 4. Create PR with gh pr create
57
+
58
+ Important:
59
+ - NEVER use git commands with -i flag (interactive mode not supported)
60
+ - DO NOT push unless explicitly asked
@@ -0,0 +1,29 @@
1
+ Performs exact string replacements in files.
2
+
3
+ Usage:
4
+ - You must use the Read tool at least once before editing. This tool will error if you attempt an edit without reading the file first.
5
+ - When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: spaces + line number + tab. Everything after that tab is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.
6
+ - ALWAYS prefer editing existing files. NEVER write new files unless explicitly required.
7
+
8
+ Critical Rules:
9
+ - The edit will FAIL if old_string is not unique in the file
10
+ - Either provide a larger string with more surrounding context to make it unique, or use replace_all to change every instance
11
+ - Use replace_all for renaming variables or strings across the file
12
+
13
+ <example>
14
+ Changing a function name:
15
+ old_string: "function oldName("
16
+ new_string: "function newName("
17
+ </example>
18
+
19
+ <example>
20
+ Updating a variable value:
21
+ old_string: "const MAX_RETRIES = 3;"
22
+ new_string: "const MAX_RETRIES = 5;"
23
+ </example>
24
+
25
+ Best Practices:
26
+ - Include enough context to make old_string unique
27
+ - Preserve exact whitespace and indentation
28
+ - Test changes compile/work after editing
29
+ - Make minimal, focused changes
@@ -0,0 +1,35 @@
1
+ Fast file pattern matching tool that works with any codebase size.
2
+
3
+ Supports glob patterns like "**/*.js" or "src/**/*.ts".
4
+
5
+ Returns matching file paths sorted by modification time.
6
+
7
+ Usage:
8
+ - Use this tool when you need to find files by name patterns
9
+ - Supports standard glob syntax:
10
+ - * matches any characters except /
11
+ - ** matches any characters including /
12
+ - ? matches a single character
13
+ - [abc] matches any of a, b, or c
14
+ - {a,b} matches either a or b
15
+
16
+ <example>
17
+ Find all TypeScript files:
18
+ pattern: "**/*.ts"
19
+ </example>
20
+
21
+ <example>
22
+ Find test files:
23
+ pattern: "**/*.test.{ts,js}"
24
+ </example>
25
+
26
+ <example>
27
+ Find files in a specific directory:
28
+ pattern: "src/components/**/*.tsx"
29
+ </example>
30
+
31
+ Best Practices:
32
+ - Use specific patterns to narrow results
33
+ - Combine with Read to examine matching files
34
+ - Call multiple globs in parallel if searching for different patterns
35
+ - Use Grep instead if you need to search file contents
@@ -0,0 +1,43 @@
1
+ A powerful search tool for finding patterns in file contents.
2
+
3
+ Supports full regex syntax (e.g., "log.*Error", "function\\s+\\w+").
4
+
5
+ Usage:
6
+ - Use this tool for content search tasks
7
+ - NEVER invoke grep or rg as a Bash command - use this tool instead
8
+ - Filter files with glob parameter (e.g., "*.js", "**/*.tsx")
9
+ - Output modes:
10
+ - "content" shows matching lines
11
+ - "files_with_matches" shows only file paths (default)
12
+ - "count" shows match counts
13
+
14
+ <example>
15
+ Find all console.log statements:
16
+ pattern: "console\\.log"
17
+ glob: "**/*.ts"
18
+ output_mode: "content"
19
+ </example>
20
+
21
+ <example>
22
+ Find files containing a function:
23
+ pattern: "function handleSubmit"
24
+ output_mode: "files_with_matches"
25
+ </example>
26
+
27
+ <example>
28
+ Find TODO comments with context:
29
+ pattern: "TODO:"
30
+ output_mode: "content"
31
+ -C: 2 (show 2 lines before and after)
32
+ </example>
33
+
34
+ Pattern Syntax:
35
+ - Uses ripgrep syntax (not grep)
36
+ - Literal braces need escaping (use `interface\\{\\}` for `interface{}`)
37
+ - Use -i for case insensitive search
38
+ - Use multiline: true for patterns spanning multiple lines
39
+
40
+ Best Practices:
41
+ - Start with files_with_matches to find relevant files
42
+ - Then use content mode with context flags for details
43
+ - Combine with Read to see full file context
@@ -0,0 +1,22 @@
1
+ Reads a file from the local filesystem. You can access any file directly by using this tool.
2
+
3
+ Assume this tool is able to read all files on the machine. If the user provides a path to a file, assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
4
+
5
+ Usage:
6
+ - The file_path parameter must be an absolute path, not a relative path
7
+ - By default, it reads up to 2000 lines starting from the beginning of the file
8
+ - You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
9
+ - Any lines longer than 2000 characters will be truncated
10
+ - Results are returned using cat -n format, with line numbers starting at 1
11
+ - You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.
12
+ - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
13
+
14
+ <example>
15
+ user: What's in config.json?
16
+ assistant: [Uses Read tool with file_path="/path/to/config.json"]
17
+ </example>
18
+
19
+ When exploring a codebase:
20
+ - Read related files together in parallel
21
+ - Start with entry points and work outward
22
+ - Use Glob/Grep first if you're unsure which files to read
@@ -0,0 +1,71 @@
1
+ Use this tool to create and manage a structured task list for your current session.
2
+
3
+ This tool serves TWO purposes:
4
+ 1. User visibility: Shows task progress in CLI so users understand what you're doing
5
+ 2. Your external memory: The rendered result helps YOU remember your plan across turns
6
+
7
+ This helps you:
8
+ - Track progress and demonstrate thoroughness to the user
9
+ - Organize complex tasks into manageable steps
10
+ - Avoid forgetting tasks in long conversations
11
+
12
+ ## When to Use This Tool
13
+
14
+ Use proactively in these scenarios:
15
+
16
+ 1. Complex multi-step tasks - When a task requires 3 or more distinct steps
17
+ 2. Non-trivial tasks - Tasks requiring careful planning or multiple operations
18
+ 3. User provides multiple tasks - Numbered or comma-separated lists
19
+ 4. After receiving instructions - Immediately capture requirements as todos
20
+ 5. When starting a task - Mark it as in_progress BEFORE beginning work
21
+ 6. After completing a task - Mark as completed and add any follow-up tasks discovered
22
+
23
+ ## When NOT to Use This Tool
24
+
25
+ Skip for:
26
+ - Single, straightforward tasks
27
+ - Trivial tasks that can be completed in under 3 steps
28
+ - Purely conversational or informational requests
29
+
30
+ ## Task States
31
+
32
+ - pending: Task not yet started
33
+ - in_progress: Currently working on (limit to ONE task at a time)
34
+ - completed: Task finished successfully
35
+
36
+ ## Task Management Rules
37
+
38
+ - Update task status in real-time as you work
39
+ - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
40
+ - Exactly ONE task should be in_progress at any time
41
+ - Complete current tasks before starting new ones
42
+ - Remove tasks that are no longer relevant
43
+
44
+ ## Completion Requirements
45
+
46
+ ONLY mark a task as completed when you have FULLY accomplished it.
47
+
48
+ Never mark completed if:
49
+ - Tests are failing
50
+ - Implementation is partial
51
+ - You encountered unresolved errors
52
+ - You couldn't find necessary files
53
+
54
+ If blocked, create a new task describing what needs to be resolved.
55
+
56
+ <example>
57
+ user: Run the build and fix any errors
58
+ assistant: Creating todo list:
59
+ 1. Run the build [in_progress]
60
+ 2. Fix any errors [pending]
61
+
62
+ Running build...
63
+
64
+ Found 3 errors. Updating todos:
65
+ 1. Run the build [completed]
66
+ 2. Fix error in auth.ts [in_progress]
67
+ 3. Fix error in api.ts [pending]
68
+ 4. Fix error in utils.ts [pending]
69
+
70
+ Starting with first error...
71
+ </example>
@@ -0,0 +1,34 @@
1
+ Fetches content from a URL and processes it.
2
+
3
+ Takes a URL and a prompt as input:
4
+ 1. Fetches the URL content
5
+ 2. Converts HTML to markdown
6
+ 3. Processes the content with the prompt using a fast model
7
+ 4. Returns the model's response about the content
8
+
9
+ Usage:
10
+ - The URL must be a fully-formed valid URL
11
+ - HTTP URLs will be automatically upgraded to HTTPS
12
+ - The prompt should describe what information you want to extract
13
+
14
+ <example>
15
+ Fetching documentation:
16
+ url: "https://docs.example.com/api"
17
+ prompt: "Extract the authentication methods and their parameters"
18
+ </example>
19
+
20
+ <example>
21
+ Reading a GitHub README:
22
+ url: "https://github.com/owner/repo"
23
+ prompt: "Summarize the project's main features and installation steps"
24
+ </example>
25
+
26
+ Behavior notes:
27
+ - Results may be summarized if content is very large
28
+ - Includes a 15-minute cache for faster repeated access
29
+ - When a URL redirects to a different host, the tool will inform you and provide the redirect URL - make a new WebFetch request with that URL
30
+
31
+ Best Practices:
32
+ - Be specific in your prompt about what information you need
33
+ - Use for documentation, tutorials, and reference material
34
+ - Combine with WebSearch to find relevant URLs first
@@ -0,0 +1,41 @@
1
+ Search the web for current information.
2
+
3
+ Use this tool when you need:
4
+ - Up-to-date information beyond your knowledge cutoff
5
+ - Current documentation or release notes
6
+ - Recent solutions to technical problems
7
+ - Current best practices
8
+
9
+ Usage:
10
+ - query: The search query (minimum 2 characters)
11
+ - num_results: Number of results to return (optional)
12
+ - allowed_domains: Only include results from these domains (optional)
13
+ - blocked_domains: Exclude results from these domains (optional)
14
+
15
+ <example>
16
+ Search for documentation:
17
+ query: "React useEffect cleanup function"
18
+ </example>
19
+
20
+ <example>
21
+ Search within specific domains:
22
+ query: "TypeScript strict mode configuration"
23
+ allowed_domains: ["typescriptlang.org", "github.com"]
24
+ </example>
25
+
26
+ IMPORTANT: After answering using search results, include a "Sources:" section with relevant URLs as markdown hyperlinks.
27
+
28
+ Example response format:
29
+ ```
30
+ [Your answer based on search results]
31
+
32
+ Sources:
33
+ - [React Documentation](https://react.dev/...)
34
+ - [Stack Overflow Answer](https://stackoverflow.com/...)
35
+ ```
36
+
37
+ Best Practices:
38
+ - Use specific, targeted queries
39
+ - Include technology versions when relevant (e.g., "React 18 hooks")
40
+ - Use allowed_domains to filter to authoritative sources
41
+ - Follow up with WebFetch for detailed page content
@@ -0,0 +1,23 @@
1
+ Writes a file to the local filesystem.
2
+
3
+ Usage:
4
+ - This tool will overwrite the existing file if there is one at the provided path
5
+ - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
6
+ - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
7
+ - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the user.
8
+
9
+ When to use Write vs Edit:
10
+ - Use Write for creating new files
11
+ - Use Write when you need to completely replace file contents
12
+ - Use Edit for making targeted changes to existing files
13
+ - Prefer Edit over Write for existing files as it's more precise
14
+
15
+ <example>
16
+ user: Create a new utility file
17
+ assistant: [Uses Write tool with file_path and content]
18
+ </example>
19
+
20
+ Important:
21
+ - Ensure the parent directory exists before writing
22
+ - Use appropriate file extensions
23
+ - Follow existing code style in the project
@@ -65,7 +65,12 @@ export class GeminiProvider implements LLMProvider {
65
65
  const result = await model.generateContentStream({ contents });
66
66
 
67
67
  let textContent = '';
68
- const functionCalls: Array<{ id: string; name: string; args: Record<string, unknown> }> = [];
68
+ const functionCalls: Array<{
69
+ id: string;
70
+ name: string;
71
+ args: Record<string, unknown>;
72
+ thoughtSignature?: string;
73
+ }> = [];
69
74
  let callIndex = 0;
70
75
 
71
76
  for await (const chunk of result.stream) {
@@ -78,10 +83,13 @@ export class GeminiProvider implements LLMProvider {
78
83
  } else if ('functionCall' in part && part.functionCall) {
79
84
  const fc = part.functionCall;
80
85
  const id = `call_${callIndex++}`;
86
+ // Capture thoughtSignature for Gemini 3+ models
87
+ const partAny = part as { thoughtSignature?: string };
81
88
  functionCalls.push({
82
89
  id,
83
90
  name: fc.name,
84
91
  args: (fc.args as Record<string, unknown>) ?? {},
92
+ thoughtSignature: partAny.thoughtSignature,
85
93
  });
86
94
  yield { type: 'tool_start', id, name: fc.name };
87
95
  yield { type: 'tool_input', id, input: JSON.stringify(fc.args) };
@@ -100,6 +108,7 @@ export class GeminiProvider implements LLMProvider {
100
108
  id: fc.id,
101
109
  name: fc.name,
102
110
  input: fc.args,
111
+ thoughtSignature: fc.thoughtSignature,
103
112
  });
104
113
  }
105
114
 
@@ -152,13 +161,17 @@ export class GeminiProvider implements LLMProvider {
152
161
  if (item.type === 'text') {
153
162
  parts.push({ text: item.text });
154
163
  } else if (item.type === 'tool_use' && role === 'model') {
155
- // Function call from model
156
- parts.push({
164
+ // Function call from model - include thoughtSignature for Gemini 3+
165
+ const fcPart: Part & { thoughtSignature?: string } = {
157
166
  functionCall: {
158
167
  name: item.name,
159
168
  args: item.input,
160
169
  },
161
- });
170
+ };
171
+ if (item.thoughtSignature) {
172
+ fcPart.thoughtSignature = item.thoughtSignature;
173
+ }
174
+ parts.push(fcPart as Part);
162
175
  } else if (item.type === 'tool_result' && role === 'user') {
163
176
  // Function response
164
177
  parts.push({
@@ -234,11 +247,14 @@ export class GeminiProvider implements LLMProvider {
234
247
  if ('text' in part && part.text) {
235
248
  content.push({ type: 'text', text: part.text });
236
249
  } else if ('functionCall' in part && part.functionCall) {
250
+ // Capture thoughtSignature for Gemini 3+ models
251
+ const partAny = part as { thoughtSignature?: string };
237
252
  content.push({
238
253
  type: 'tool_use',
239
254
  id: `call_${callIndex++}`,
240
255
  name: part.functionCall.name,
241
256
  input: (part.functionCall.args as Record<string, unknown>) ?? {},
257
+ thoughtSignature: partAny.thoughtSignature,
242
258
  });
243
259
  }
244
260
  }
@@ -1,22 +1,25 @@
1
1
  /**
2
- * LLM Providers - Unified interface for OpenAI, Anthropic, and Gemini
2
+ * LLM Providers - Unified interface for OpenAI, Anthropic, Gemini, and Vertex AI
3
3
  */
4
4
 
5
5
  export * from './types.js';
6
6
  export { OpenAIProvider } from './openai.js';
7
7
  export { AnthropicProvider } from './anthropic.js';
8
8
  export { GeminiProvider } from './gemini.js';
9
+ export { VertexAIProvider } from './vertex-ai.js';
9
10
 
10
- import type { LLMProvider, OpenAIConfig, AnthropicConfig, GeminiConfig } from './types.js';
11
+ import type { LLMProvider, OpenAIConfig, AnthropicConfig, GeminiConfig, VertexAIConfig } from './types.js';
11
12
  import { OpenAIProvider } from './openai.js';
12
13
  import { AnthropicProvider } from './anthropic.js';
13
14
  import { GeminiProvider } from './gemini.js';
15
+ import { VertexAIProvider } from './vertex-ai.js';
14
16
 
15
- export type ProviderName = 'openai' | 'anthropic' | 'gemini';
17
+ export type ProviderName = 'openai' | 'anthropic' | 'gemini' | 'vertex-ai';
16
18
  export type ProviderConfigMap = {
17
19
  openai: OpenAIConfig;
18
20
  anthropic: AnthropicConfig;
19
21
  gemini: GeminiConfig;
22
+ 'vertex-ai': VertexAIConfig;
20
23
  };
21
24
 
22
25
  export interface CreateProviderOptions<T extends ProviderName = ProviderName> {
@@ -35,6 +38,8 @@ export function createProvider(options: CreateProviderOptions): LLMProvider {
35
38
  return new AnthropicProvider(options.config as AnthropicConfig);
36
39
  case 'gemini':
37
40
  return new GeminiProvider(options.config as GeminiConfig);
41
+ case 'vertex-ai':
42
+ return new VertexAIProvider(options.config as VertexAIConfig);
38
43
  default:
39
44
  throw new Error(`Unknown provider: ${options.provider}`);
40
45
  }
@@ -46,6 +51,11 @@ export function createProvider(options: CreateProviderOptions): LLMProvider {
46
51
  export function inferProvider(model: string): ProviderName {
47
52
  const modelLower = model.toLowerCase();
48
53
 
54
+ // Vertex AI models (Claude models with @ version suffix like claude-sonnet-4-5@20250929)
55
+ if (modelLower.includes('claude') && modelLower.includes('@')) {
56
+ return 'vertex-ai';
57
+ }
58
+
49
59
  // OpenAI models
50
60
  if (
51
61
  modelLower.includes('gpt') ||
@@ -94,4 +104,9 @@ export const ModelAliases: Record<string, { provider: ProviderName; model: strin
94
104
  'gemini-2.0-flash': { provider: 'gemini', model: 'gemini-2.0-flash' },
95
105
  'gemini-1.5-pro': { provider: 'gemini', model: 'gemini-1.5-pro' },
96
106
  'gemini-1.5-flash': { provider: 'gemini', model: 'gemini-1.5-flash' },
107
+
108
+ // Vertex AI (Claude on GCP)
109
+ 'vertex-sonnet': { provider: 'vertex-ai', model: 'claude-sonnet-4-5@20250929' },
110
+ 'vertex-haiku': { provider: 'vertex-ai', model: 'claude-haiku-4-5@20251001' },
111
+ 'vertex-opus': { provider: 'vertex-ai', model: 'claude-opus-4-1@20250805' },
97
112
  };