@code-yeongyu/senpi 2026.8.24 → 2026.8.26

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 (1589) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/dist/cli/args.d.ts.map +1 -1
  3. package/dist/cli/args.js +24 -9
  4. package/dist/cli/args.js.map +1 -1
  5. package/dist/cli/file-processor.d.ts.map +1 -1
  6. package/dist/cli/file-processor.js +2 -1
  7. package/dist/cli/file-processor.js.map +1 -1
  8. package/dist/config.d.ts +6 -3
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +24 -14
  11. package/dist/config.js.map +1 -1
  12. package/dist/core/agent-abort-provenance.d.ts.map +1 -1
  13. package/dist/core/agent-abort-provenance.js +5 -1
  14. package/dist/core/agent-abort-provenance.js.map +1 -1
  15. package/dist/core/agent-session.d.ts +11 -0
  16. package/dist/core/agent-session.d.ts.map +1 -1
  17. package/dist/core/agent-session.js +154 -29
  18. package/dist/core/agent-session.js.map +1 -1
  19. package/dist/core/auth-storage.d.ts +4 -0
  20. package/dist/core/auth-storage.d.ts.map +1 -1
  21. package/dist/core/auth-storage.js +35 -8
  22. package/dist/core/auth-storage.js.map +1 -1
  23. package/dist/core/brand.d.ts +2 -0
  24. package/dist/core/brand.d.ts.map +1 -1
  25. package/dist/core/brand.js +1 -0
  26. package/dist/core/brand.js.map +1 -1
  27. package/dist/core/compaction/compaction.d.ts +1 -0
  28. package/dist/core/compaction/compaction.d.ts.map +1 -1
  29. package/dist/core/compaction/compaction.js +24 -8
  30. package/dist/core/compaction/compaction.js.map +1 -1
  31. package/dist/core/defaults.d.ts +1 -0
  32. package/dist/core/defaults.d.ts.map +1 -1
  33. package/dist/core/defaults.js +9 -0
  34. package/dist/core/defaults.js.map +1 -1
  35. package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts +5 -9
  36. package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
  37. package/dist/core/extensions/builtin/compaction/per-turn-cap.js +5 -11
  38. package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
  39. package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts +2 -3
  40. package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
  41. package/dist/core/extensions/builtin/compaction/todo-bridge.js +53 -14
  42. package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
  43. package/dist/core/extensions/builtin/goal/terminal-provider-error.js +1 -1
  44. package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
  45. package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -1
  46. package/dist/core/extensions/builtin/loop-guard/notice.js +5 -1
  47. package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
  48. package/dist/core/extensions/builtin/mcp/config-schema.d.ts +2 -2
  49. package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
  50. package/dist/core/extensions/builtin/ttsr/index.js +6 -6
  51. package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
  52. package/dist/core/extensions/builtin/ttsr/message-update.d.ts +10 -0
  53. package/dist/core/extensions/builtin/ttsr/message-update.d.ts.map +1 -0
  54. package/dist/core/extensions/builtin/ttsr/message-update.js +38 -0
  55. package/dist/core/extensions/builtin/ttsr/message-update.js.map +1 -0
  56. package/dist/core/extensions/builtin/ttsr/remediation.d.ts +5 -10
  57. package/dist/core/extensions/builtin/ttsr/remediation.d.ts.map +1 -1
  58. package/dist/core/extensions/builtin/ttsr/remediation.js +19 -3
  59. package/dist/core/extensions/builtin/ttsr/remediation.js.map +1 -1
  60. package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts +1 -1
  61. package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts.map +1 -1
  62. package/dist/core/extensions/builtin/ttsr/stream-remediation.js.map +1 -1
  63. package/dist/core/extensions/builtin/ttsr/types.d.ts +1 -1
  64. package/dist/core/extensions/builtin/ttsr/types.d.ts.map +1 -1
  65. package/dist/core/extensions/builtin/ttsr/types.js.map +1 -1
  66. package/dist/core/extensions/builtin/ttsr/watch.d.ts +1 -1
  67. package/dist/core/extensions/builtin/ttsr/watch.d.ts.map +1 -1
  68. package/dist/core/extensions/builtin/ttsr/watch.js +2 -2
  69. package/dist/core/extensions/builtin/ttsr/watch.js.map +1 -1
  70. package/dist/core/extensions/index.d.ts +2 -2
  71. package/dist/core/extensions/index.d.ts.map +1 -1
  72. package/dist/core/extensions/index.js +1 -1
  73. package/dist/core/extensions/index.js.map +1 -1
  74. package/dist/core/extensions/loader.d.ts.map +1 -1
  75. package/dist/core/extensions/loader.js +107 -45
  76. package/dist/core/extensions/loader.js.map +1 -1
  77. package/dist/core/extensions/types.d.ts +17 -6
  78. package/dist/core/extensions/types.d.ts.map +1 -1
  79. package/dist/core/extensions/types.js +3 -0
  80. package/dist/core/extensions/types.js.map +1 -1
  81. package/dist/core/footer-data-provider.d.ts +1 -1
  82. package/dist/core/footer-data-provider.js +1 -1
  83. package/dist/core/footer-data-provider.js.map +1 -1
  84. package/dist/core/keybindings.d.ts +20 -19
  85. package/dist/core/keybindings.d.ts.map +1 -1
  86. package/dist/core/keybindings.js +26 -5
  87. package/dist/core/keybindings.js.map +1 -1
  88. package/dist/core/model-config-schema.d.ts +17 -5
  89. package/dist/core/model-config-schema.d.ts.map +1 -1
  90. package/dist/core/model-config-schema.js +1 -1
  91. package/dist/core/model-config-schema.js.map +1 -1
  92. package/dist/core/model-config.d.ts.map +1 -1
  93. package/dist/core/model-config.js +7 -5
  94. package/dist/core/model-config.js.map +1 -1
  95. package/dist/core/model-resolver.d.ts +3 -2
  96. package/dist/core/model-resolver.d.ts.map +1 -1
  97. package/dist/core/model-resolver.js +3 -2
  98. package/dist/core/model-resolver.js.map +1 -1
  99. package/dist/core/model-runtime.d.ts +0 -1
  100. package/dist/core/model-runtime.d.ts.map +1 -1
  101. package/dist/core/model-runtime.js +0 -18
  102. package/dist/core/model-runtime.js.map +1 -1
  103. package/dist/core/models-store.d.ts.map +1 -1
  104. package/dist/core/models-store.js +2 -1
  105. package/dist/core/models-store.js.map +1 -1
  106. package/dist/core/package-manager.d.ts.map +1 -1
  107. package/dist/core/package-manager.js +14 -10
  108. package/dist/core/package-manager.js.map +1 -1
  109. package/dist/core/pi-manifest.d.ts.map +1 -1
  110. package/dist/core/pi-manifest.js +2 -1
  111. package/dist/core/pi-manifest.js.map +1 -1
  112. package/dist/core/provider-composer.d.ts +2 -0
  113. package/dist/core/provider-composer.d.ts.map +1 -1
  114. package/dist/core/provider-composer.js +3 -6
  115. package/dist/core/provider-composer.js.map +1 -1
  116. package/dist/core/provider-display-names.d.ts.map +1 -1
  117. package/dist/core/provider-display-names.js +0 -1
  118. package/dist/core/provider-display-names.js.map +1 -1
  119. package/dist/core/provider-timeout-retry.d.ts.map +1 -1
  120. package/dist/core/provider-timeout-retry.js +8 -12
  121. package/dist/core/provider-timeout-retry.js.map +1 -1
  122. package/dist/core/resource-loader.d.ts.map +1 -1
  123. package/dist/core/resource-loader.js +3 -2
  124. package/dist/core/resource-loader.js.map +1 -1
  125. package/dist/core/retry-fallback/profile-override.d.ts +24 -0
  126. package/dist/core/retry-fallback/profile-override.d.ts.map +1 -0
  127. package/dist/core/retry-fallback/profile-override.js +138 -0
  128. package/dist/core/retry-fallback/profile-override.js.map +1 -0
  129. package/dist/core/retry-fallback/settings.d.ts +1 -0
  130. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  131. package/dist/core/retry-fallback/settings.js.map +1 -1
  132. package/dist/core/sdk.d.ts +2 -2
  133. package/dist/core/sdk.d.ts.map +1 -1
  134. package/dist/core/sdk.js +20 -5
  135. package/dist/core/sdk.js.map +1 -1
  136. package/dist/core/session-export.d.ts +4 -0
  137. package/dist/core/session-export.d.ts.map +1 -0
  138. package/dist/core/session-export.js +32 -0
  139. package/dist/core/session-export.js.map +1 -0
  140. package/dist/core/session-manager.d.ts.map +1 -1
  141. package/dist/core/session-manager.js +2 -1
  142. package/dist/core/session-manager.js.map +1 -1
  143. package/dist/core/settings-diagnostics.d.ts +9 -0
  144. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  145. package/dist/core/settings-diagnostics.js +21 -0
  146. package/dist/core/settings-diagnostics.js.map +1 -0
  147. package/dist/core/settings-manager.d.ts +18 -0
  148. package/dist/core/settings-manager.d.ts.map +1 -1
  149. package/dist/core/settings-manager.js +88 -7
  150. package/dist/core/settings-manager.js.map +1 -1
  151. package/dist/core/slash-commands.d.ts.map +1 -1
  152. package/dist/core/slash-commands.js +2 -1
  153. package/dist/core/slash-commands.js.map +1 -1
  154. package/dist/core/system-prompt.d.ts.map +1 -1
  155. package/dist/core/system-prompt.js +11 -2
  156. package/dist/core/system-prompt.js.map +1 -1
  157. package/dist/core/tools/bash.d.ts +14 -1
  158. package/dist/core/tools/bash.d.ts.map +1 -1
  159. package/dist/core/tools/bash.js +35 -19
  160. package/dist/core/tools/bash.js.map +1 -1
  161. package/dist/core/tools/edit-diff.d.ts +0 -5
  162. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  163. package/dist/core/tools/edit-diff.js +2 -5
  164. package/dist/core/tools/edit-diff.js.map +1 -1
  165. package/dist/core/tools/edit.d.ts.map +1 -1
  166. package/dist/core/tools/edit.js +3 -2
  167. package/dist/core/tools/edit.js.map +1 -1
  168. package/dist/core/tools/index.d.ts +4 -1
  169. package/dist/core/tools/index.d.ts.map +1 -1
  170. package/dist/core/tools/index.js +13 -1
  171. package/dist/core/tools/index.js.map +1 -1
  172. package/dist/core/tools/powershell.d.ts +16 -0
  173. package/dist/core/tools/powershell.d.ts.map +1 -0
  174. package/dist/core/tools/powershell.js +39 -0
  175. package/dist/core/tools/powershell.js.map +1 -0
  176. package/dist/core/trust-manager.d.ts.map +1 -1
  177. package/dist/core/trust-manager.js +2 -1
  178. package/dist/core/trust-manager.js.map +1 -1
  179. package/dist/extensions/llama/client.d.ts +6 -0
  180. package/dist/extensions/llama/client.d.ts.map +1 -1
  181. package/dist/extensions/llama/client.js +7 -0
  182. package/dist/extensions/llama/client.js.map +1 -1
  183. package/dist/extensions/llama/provider.d.ts +3 -1
  184. package/dist/extensions/llama/provider.d.ts.map +1 -1
  185. package/dist/extensions/llama/provider.js +27 -6
  186. package/dist/extensions/llama/provider.js.map +1 -1
  187. package/dist/index.d.ts +5 -4
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +4 -3
  190. package/dist/index.js.map +1 -1
  191. package/dist/main.d.ts.map +1 -1
  192. package/dist/main.js +13 -2
  193. package/dist/main.js.map +1 -1
  194. package/dist/migrations.d.ts.map +1 -1
  195. package/dist/migrations.js +4 -3
  196. package/dist/migrations.js.map +1 -1
  197. package/dist/modes/app-server/daemon/probe.js +1 -1
  198. package/dist/modes/app-server/daemon/probe.js.map +1 -1
  199. package/dist/modes/app-server/daemon.js +13 -2
  200. package/dist/modes/app-server/daemon.js.map +1 -1
  201. package/dist/modes/app-server/transports/websocket-connection-handler.d.ts.map +1 -1
  202. package/dist/modes/app-server/transports/websocket-connection-handler.js +4 -0
  203. package/dist/modes/app-server/transports/websocket-connection-handler.js.map +1 -1
  204. package/dist/modes/interactive/aborted-error-label.d.ts +2 -0
  205. package/dist/modes/interactive/aborted-error-label.d.ts.map +1 -1
  206. package/dist/modes/interactive/aborted-error-label.js +7 -0
  207. package/dist/modes/interactive/aborted-error-label.js.map +1 -1
  208. package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  209. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  210. package/dist/modes/interactive/components/thinking-selector.js +68 -17
  211. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  212. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  213. package/dist/modes/interactive/external-editor.js +2 -1
  214. package/dist/modes/interactive/external-editor.js.map +1 -1
  215. package/dist/modes/interactive/interactive-mode.d.ts +6 -0
  216. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  217. package/dist/modes/interactive/interactive-mode.js +19 -12
  218. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  219. package/dist/modes/json-event.d.ts +16 -13
  220. package/dist/modes/json-event.d.ts.map +1 -1
  221. package/dist/modes/json-event.js +20 -6
  222. package/dist/modes/json-event.js.map +1 -1
  223. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  224. package/dist/modes/rpc/connection-handler.js +3 -0
  225. package/dist/modes/rpc/connection-handler.js.map +1 -1
  226. package/dist/modes/rpc/rpc-client.d.ts +7 -0
  227. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  228. package/dist/modes/rpc/rpc-client.js +7 -0
  229. package/dist/modes/rpc/rpc-client.js.map +1 -1
  230. package/dist/modes/rpc/rpc-types.d.ts +12 -0
  231. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  232. package/dist/modes/rpc/rpc-types.js.map +1 -1
  233. package/dist/package-manager-cli.d.ts +1 -0
  234. package/dist/package-manager-cli.d.ts.map +1 -1
  235. package/dist/package-manager-cli.js +186 -2
  236. package/dist/package-manager-cli.js.map +1 -1
  237. package/dist/utils/frontmatter.d.ts.map +1 -1
  238. package/dist/utils/frontmatter.js +2 -1
  239. package/dist/utils/frontmatter.js.map +1 -1
  240. package/dist/utils/shell.d.ts +3 -0
  241. package/dist/utils/shell.d.ts.map +1 -1
  242. package/dist/utils/shell.js +17 -5
  243. package/dist/utils/shell.js.map +1 -1
  244. package/dist/utils/syntax-highlight.d.ts +1 -0
  245. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  246. package/dist/utils/syntax-highlight.js +60 -1
  247. package/dist/utils/syntax-highlight.js.map +1 -1
  248. package/dist/utils/text.d.ts +8 -0
  249. package/dist/utils/text.d.ts.map +1 -0
  250. package/dist/utils/text.js +9 -0
  251. package/dist/utils/text.js.map +1 -0
  252. package/docs/compaction.md +0 -2
  253. package/docs/custom-provider.md +6 -6
  254. package/docs/environment-variables.md +8 -8
  255. package/docs/extensions.md +6 -5
  256. package/docs/json.md +7 -2
  257. package/docs/keybindings.md +1 -1
  258. package/docs/packages.md +2 -2
  259. package/docs/rpc.md +32 -3
  260. package/docs/sdk.md +7 -2
  261. package/docs/settings.md +9 -1
  262. package/docs/terminal-setup.md +11 -9
  263. package/docs/usage.md +4 -1
  264. package/docs/windows.md +24 -2
  265. package/examples/extensions/custom-provider-anthropic/package-lock.json +28 -5
  266. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  267. package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +558 -0
  268. package/node_modules/@anthropic-ai/sdk/README.md +16 -1
  269. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -1
  270. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -1
  271. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +14 -2
  272. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -1
  273. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +14 -2
  274. package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -1
  275. package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +1 -0
  276. package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -1
  277. package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +1 -0
  278. package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -1
  279. package/node_modules/@anthropic-ai/sdk/api-promise.mjs +1 -0
  280. package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -1
  281. package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +481 -0
  282. package/node_modules/@anthropic-ai/sdk/client.d.mts +165 -11
  283. package/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -1
  284. package/node_modules/@anthropic-ai/sdk/client.d.ts +165 -11
  285. package/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -1
  286. package/node_modules/@anthropic-ai/sdk/client.js +415 -38
  287. package/node_modules/@anthropic-ai/sdk/client.js.map +1 -1
  288. package/node_modules/@anthropic-ai/sdk/client.mjs +414 -37
  289. package/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -1
  290. package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +1 -0
  291. package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -1
  292. package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +1 -0
  293. package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -1
  294. package/node_modules/@anthropic-ai/sdk/core/api-promise.js +7 -2
  295. package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -1
  296. package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +8 -3
  297. package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -1
  298. package/node_modules/@anthropic-ai/sdk/core/api.d.mts +11 -0
  299. package/node_modules/@anthropic-ai/sdk/core/api.d.mts.map +1 -0
  300. package/node_modules/@anthropic-ai/sdk/core/api.d.ts +11 -0
  301. package/node_modules/@anthropic-ai/sdk/core/api.d.ts.map +1 -0
  302. package/node_modules/@anthropic-ai/sdk/core/api.js +3 -0
  303. package/node_modules/@anthropic-ai/sdk/core/api.js.map +1 -0
  304. package/node_modules/@anthropic-ai/sdk/core/api.mjs +2 -0
  305. package/node_modules/@anthropic-ai/sdk/core/api.mjs.map +1 -0
  306. package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts +131 -0
  307. package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -0
  308. package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts +131 -0
  309. package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -0
  310. package/node_modules/@anthropic-ai/sdk/core/credentials.js +317 -0
  311. package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -0
  312. package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +277 -0
  313. package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -0
  314. package/node_modules/@anthropic-ai/sdk/core/error.d.mts +12 -0
  315. package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -1
  316. package/node_modules/@anthropic-ai/sdk/core/error.d.ts +12 -0
  317. package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -1
  318. package/node_modules/@anthropic-ai/sdk/core/error.js +18 -1
  319. package/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -1
  320. package/node_modules/@anthropic-ai/sdk/core/error.mjs +16 -0
  321. package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -1
  322. package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts +154 -0
  323. package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -0
  324. package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts +154 -0
  325. package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -0
  326. package/node_modules/@anthropic-ai/sdk/core/middleware.js +174 -0
  327. package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -0
  328. package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +168 -0
  329. package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -0
  330. package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +20 -0
  331. package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -1
  332. package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +20 -0
  333. package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -1
  334. package/node_modules/@anthropic-ai/sdk/core/pagination.js +26 -1
  335. package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -1
  336. package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +24 -0
  337. package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -1
  338. package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -1
  339. package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -1
  340. package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +9 -0
  341. package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -1
  342. package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +9 -0
  343. package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -1
  344. package/node_modules/@anthropic-ai/sdk/core/streaming.js +34 -1
  345. package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -1
  346. package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +34 -1
  347. package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -1
  348. package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -1
  349. package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -1
  350. package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -1
  351. package/node_modules/@anthropic-ai/sdk/error.d.mts +1 -0
  352. package/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -1
  353. package/node_modules/@anthropic-ai/sdk/error.d.ts +1 -0
  354. package/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -1
  355. package/node_modules/@anthropic-ai/sdk/error.mjs +1 -0
  356. package/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -1
  357. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts +23 -0
  358. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts.map +1 -0
  359. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts +23 -0
  360. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts.map +1 -0
  361. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js +31 -0
  362. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js.map +1 -0
  363. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs +23 -0
  364. package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs.map +1 -0
  365. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts +6 -0
  366. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts.map +1 -1
  367. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts +6 -0
  368. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts.map +1 -1
  369. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js +1 -0
  370. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js.map +1 -1
  371. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs +1 -0
  372. package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs.map +1 -1
  373. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts +1 -1
  374. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts.map +1 -1
  375. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts +1 -1
  376. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts.map +1 -1
  377. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js +1 -1
  378. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js.map +1 -1
  379. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs +1 -1
  380. package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs.map +1 -1
  381. package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.mts.map +1 -1
  382. package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.ts.map +1 -1
  383. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts +11 -5
  384. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts.map +1 -1
  385. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts +11 -5
  386. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts.map +1 -1
  387. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js +2 -2
  388. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js.map +1 -1
  389. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs +2 -2
  390. package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs.map +1 -1
  391. package/node_modules/@anthropic-ai/sdk/helpers/index.d.mts.map +1 -1
  392. package/node_modules/@anthropic-ai/sdk/helpers/index.d.ts.map +1 -1
  393. package/node_modules/@anthropic-ai/sdk/helpers/index.mjs.map +1 -1
  394. package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.mts.map +1 -1
  395. package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.ts.map +1 -1
  396. package/node_modules/@anthropic-ai/sdk/helpers/json-schema.mjs.map +1 -1
  397. package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts +2 -2
  398. package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts.map +1 -1
  399. package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts +2 -2
  400. package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts.map +1 -1
  401. package/node_modules/@anthropic-ai/sdk/helpers/zod.js +1 -2
  402. package/node_modules/@anthropic-ai/sdk/helpers/zod.js.map +1 -1
  403. package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs +1 -2
  404. package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs.map +1 -1
  405. package/node_modules/@anthropic-ai/sdk/index.d.mts +4 -2
  406. package/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -1
  407. package/node_modules/@anthropic-ai/sdk/index.d.ts +4 -2
  408. package/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -1
  409. package/node_modules/@anthropic-ai/sdk/index.js +5 -1
  410. package/node_modules/@anthropic-ai/sdk/index.js.map +1 -1
  411. package/node_modules/@anthropic-ai/sdk/index.mjs +3 -2
  412. package/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -1
  413. package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -1
  414. package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -1
  415. package/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -5
  416. package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -1
  417. package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +0 -5
  418. package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -1
  419. package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -1
  420. package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -1
  421. package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -1
  422. package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -1
  423. package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
  424. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts +136 -0
  425. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -0
  426. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts +136 -0
  427. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -0
  428. package/node_modules/@anthropic-ai/sdk/internal/file-store.js +531 -0
  429. package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -0
  430. package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +523 -0
  431. package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -0
  432. package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +7 -0
  433. package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -1
  434. package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +7 -0
  435. package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -1
  436. package/node_modules/@anthropic-ai/sdk/internal/headers.js +45 -4
  437. package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -1
  438. package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +43 -3
  439. package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -1
  440. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts +10 -0
  441. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts.map +1 -0
  442. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts +10 -0
  443. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts.map +1 -0
  444. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js +34 -0
  445. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js.map +1 -0
  446. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs +30 -0
  447. package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs.map +1 -0
  448. package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +2 -1
  449. package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -1
  450. package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +2 -1
  451. package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -1
  452. package/node_modules/@anthropic-ai/sdk/internal/parse.js +16 -10
  453. package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
  454. package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +15 -9
  455. package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
  456. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts +7 -0
  457. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts.map +1 -0
  458. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts +7 -0
  459. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts.map +1 -0
  460. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js +13 -0
  461. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js.map +1 -0
  462. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs +9 -0
  463. package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs.map +1 -0
  464. package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts +10 -0
  465. package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts.map +1 -0
  466. package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts +10 -0
  467. package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts.map +1 -0
  468. package/node_modules/@anthropic-ai/sdk/internal/qs/index.js +14 -0
  469. package/node_modules/@anthropic-ai/sdk/internal/qs/index.js.map +1 -0
  470. package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs +10 -0
  471. package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs.map +1 -0
  472. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts +3 -0
  473. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts.map +1 -0
  474. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts +3 -0
  475. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts.map +1 -0
  476. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js +277 -0
  477. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js.map +1 -0
  478. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs +274 -0
  479. package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs.map +1 -0
  480. package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts +57 -0
  481. package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts.map +1 -0
  482. package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts +57 -0
  483. package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts.map +1 -0
  484. package/node_modules/@anthropic-ai/sdk/internal/qs/types.js +3 -0
  485. package/node_modules/@anthropic-ai/sdk/internal/qs/types.js.map +1 -0
  486. package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs +2 -0
  487. package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs.map +1 -0
  488. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts +15 -0
  489. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts.map +1 -0
  490. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts +15 -0
  491. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts.map +1 -0
  492. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js +230 -0
  493. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js.map +1 -0
  494. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs +217 -0
  495. package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs.map +1 -0
  496. package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +52 -2
  497. package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -1
  498. package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +52 -2
  499. package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -1
  500. package/node_modules/@anthropic-ai/sdk/internal/request-options.js +12 -1
  501. package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -1
  502. package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
  503. package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -1
  504. package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts +4 -0
  505. package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts.map +1 -0
  506. package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts +4 -0
  507. package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts.map +1 -0
  508. package/node_modules/@anthropic-ai/sdk/internal/request-signal.js +50 -0
  509. package/node_modules/@anthropic-ai/sdk/internal/request-signal.js.map +1 -0
  510. package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs +45 -0
  511. package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs.map +1 -0
  512. package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +6 -0
  513. package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -1
  514. package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +6 -0
  515. package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -1
  516. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts +60 -0
  517. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts.map +1 -0
  518. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts +60 -0
  519. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts.map +1 -0
  520. package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.js +27 -6
  521. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.js.map +1 -0
  522. package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.mjs +25 -5
  523. package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs.map +1 -0
  524. package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -1
  525. package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -1
  526. package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -1
  527. package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +12 -6
  528. package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -1
  529. package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +12 -6
  530. package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -1
  531. package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -1
  532. package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -1
  533. package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
  534. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts +13 -0
  535. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts.map +1 -0
  536. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts +13 -0
  537. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts.map +1 -0
  538. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js +26 -0
  539. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js.map +1 -0
  540. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs +23 -0
  541. package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs.map +1 -0
  542. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts +31 -0
  543. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts.map +1 -0
  544. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts +31 -0
  545. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts.map +1 -0
  546. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js +75 -0
  547. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js.map +1 -0
  548. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +71 -0
  549. package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs.map +1 -0
  550. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts +23 -0
  551. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts.map +1 -0
  552. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts +23 -0
  553. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts.map +1 -0
  554. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js +44 -0
  555. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js.map +1 -0
  556. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs +36 -0
  557. package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs.map +1 -0
  558. package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -1
  559. package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +11 -1
  560. package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -1
  561. package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +11 -1
  562. package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -1
  563. package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +37 -11
  564. package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -1
  565. package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +35 -10
  566. package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -1
  567. package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -1
  568. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts +11 -0
  569. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts.map +1 -0
  570. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts +11 -0
  571. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts.map +1 -0
  572. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js +18 -0
  573. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js.map +1 -0
  574. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs +15 -0
  575. package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs.map +1 -0
  576. package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts +0 -3
  577. package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts.map +1 -1
  578. package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts +0 -3
  579. package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts.map +1 -1
  580. package/node_modules/@anthropic-ai/sdk/internal/utils/query.js +3 -16
  581. package/node_modules/@anthropic-ai/sdk/internal/utils/query.js.map +1 -1
  582. package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +2 -16
  583. package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs.map +1 -1
  584. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +9 -1
  585. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -1
  586. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +9 -1
  587. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -1
  588. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +23 -2
  589. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -1
  590. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +23 -2
  591. package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -1
  592. package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts +3 -0
  593. package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts.map +1 -0
  594. package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts +3 -0
  595. package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts.map +1 -0
  596. package/node_modules/@anthropic-ai/sdk/internal/utils/time.js +8 -0
  597. package/node_modules/@anthropic-ai/sdk/internal/utils/time.js.map +1 -0
  598. package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs +5 -0
  599. package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs.map +1 -0
  600. package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
  601. package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -1
  602. package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -1
  603. package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -1
  604. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +2 -0
  605. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
  606. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +2 -0
  607. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
  608. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +66 -31
  609. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
  610. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +66 -31
  611. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
  612. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +2 -0
  613. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
  614. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +2 -0
  615. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
  616. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +37 -26
  617. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
  618. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +34 -23
  619. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
  620. package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.mts.map +1 -1
  621. package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.ts.map +1 -1
  622. package/node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs.map +1 -1
  623. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts +39 -0
  624. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts.map +1 -0
  625. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts +39 -0
  626. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts.map +1 -0
  627. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +245 -0
  628. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -0
  629. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +208 -0
  630. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -0
  631. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts +11 -0
  632. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts.map +1 -0
  633. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts +11 -0
  634. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts.map +1 -0
  635. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +72 -0
  636. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -0
  637. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +35 -0
  638. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -0
  639. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts +40 -0
  640. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts.map +1 -0
  641. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts +40 -0
  642. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts.map +1 -0
  643. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js +82 -0
  644. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js.map +1 -0
  645. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs +79 -0
  646. package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs.map +1 -0
  647. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts +54 -0
  648. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts.map +1 -0
  649. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts +54 -0
  650. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts.map +1 -0
  651. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js +112 -0
  652. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js.map +1 -0
  653. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs +108 -0
  654. package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs.map +1 -0
  655. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts +96 -0
  656. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -0
  657. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts +96 -0
  658. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -0
  659. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +266 -0
  660. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -0
  661. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +224 -0
  662. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -0
  663. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts +21 -0
  664. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts.map +1 -0
  665. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts +21 -0
  666. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts.map +1 -0
  667. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +130 -0
  668. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -0
  669. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +94 -0
  670. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -0
  671. package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts +4 -0
  672. package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts.map +1 -0
  673. package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts +4 -0
  674. package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts.map +1 -0
  675. package/node_modules/@anthropic-ai/sdk/lib/credentials.js +8 -0
  676. package/node_modules/@anthropic-ai/sdk/lib/credentials.js.map +1 -0
  677. package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs +3 -0
  678. package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs.map +1 -0
  679. package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts +4 -0
  680. package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts.map +1 -0
  681. package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts +4 -0
  682. package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts.map +1 -0
  683. package/node_modules/@anthropic-ai/sdk/lib/environments/index.js +18 -0
  684. package/node_modules/@anthropic-ai/sdk/lib/environments/index.js.map +1 -0
  685. package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs +4 -0
  686. package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs.map +1 -0
  687. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts +95 -0
  688. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts.map +1 -0
  689. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts +95 -0
  690. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts.map +1 -0
  691. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js +226 -0
  692. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js.map +1 -0
  693. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +217 -0
  694. package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs.map +1 -0
  695. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts +227 -0
  696. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts.map +1 -0
  697. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts +227 -0
  698. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts.map +1 -0
  699. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js +569 -0
  700. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js.map +1 -0
  701. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +564 -0
  702. package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs.map +1 -0
  703. package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts +31 -0
  704. package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts.map +1 -0
  705. package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts +31 -0
  706. package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts.map +1 -0
  707. package/node_modules/@anthropic-ai/sdk/lib/helper-client.js +58 -0
  708. package/node_modules/@anthropic-ai/sdk/lib/helper-client.js.map +1 -0
  709. package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs +55 -0
  710. package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs.map +1 -0
  711. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts +98 -0
  712. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -0
  713. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts +98 -0
  714. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -0
  715. package/node_modules/@anthropic-ai/sdk/lib/middleware.js +754 -0
  716. package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -0
  717. package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +749 -0
  718. package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -0
  719. package/node_modules/@anthropic-ai/sdk/lib/parser.d.mts.map +1 -1
  720. package/node_modules/@anthropic-ai/sdk/lib/parser.d.ts.map +1 -1
  721. package/node_modules/@anthropic-ai/sdk/lib/parser.mjs.map +1 -1
  722. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +22 -0
  723. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -0
  724. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +22 -0
  725. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -0
  726. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +88 -0
  727. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -0
  728. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +85 -0
  729. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -0
  730. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts +38 -5
  731. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts.map +1 -1
  732. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts +38 -5
  733. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts.map +1 -1
  734. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js +28 -0
  735. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js.map +1 -1
  736. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs +25 -1
  737. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs.map +1 -1
  738. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts +1 -1
  739. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts.map +1 -1
  740. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts +1 -1
  741. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts.map +1 -1
  742. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +107 -29
  743. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
  744. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +105 -27
  745. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
  746. package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.mts.map +1 -1
  747. package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.ts.map +1 -1
  748. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts +179 -0
  749. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts.map +1 -0
  750. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts +179 -0
  751. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts.map +1 -0
  752. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js +728 -0
  753. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js.map +1 -0
  754. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +724 -0
  755. package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs.map +1 -0
  756. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.mts.map +1 -1
  757. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.ts.map +1 -1
  758. package/node_modules/@anthropic-ai/sdk/lib/transform-json-schema.mjs.map +1 -1
  759. package/node_modules/@anthropic-ai/sdk/package.json +32 -15
  760. package/node_modules/@anthropic-ai/sdk/pagination.d.mts +1 -0
  761. package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -1
  762. package/node_modules/@anthropic-ai/sdk/pagination.d.ts +1 -0
  763. package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -1
  764. package/node_modules/@anthropic-ai/sdk/pagination.mjs +1 -0
  765. package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -1
  766. package/node_modules/@anthropic-ai/sdk/resource.d.mts +1 -0
  767. package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -1
  768. package/node_modules/@anthropic-ai/sdk/resource.d.ts +1 -0
  769. package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -1
  770. package/node_modules/@anthropic-ai/sdk/resource.mjs +1 -0
  771. package/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -1
  772. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +608 -68
  773. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts.map +1 -1
  774. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts +608 -68
  775. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts.map +1 -1
  776. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js +2 -2
  777. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js.map +1 -1
  778. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs +2 -2
  779. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
  780. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts +1 -1
  781. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts.map +1 -1
  782. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts +1 -1
  783. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts.map +1 -1
  784. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.js.map +1 -1
  785. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.mjs.map +1 -1
  786. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.mts.map +1 -1
  787. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.ts.map +1 -1
  788. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs.map +1 -1
  789. package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.mts.map +1 -1
  790. package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.ts.map +1 -1
  791. package/node_modules/@anthropic-ai/sdk/resources/beta/agents.mjs.map +1 -1
  792. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +51 -13
  793. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -1
  794. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +51 -13
  795. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
  796. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +22 -2
  797. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
  798. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +22 -2
  799. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -1
  800. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts +306 -0
  801. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts.map +1 -0
  802. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +306 -0
  803. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts.map +1 -0
  804. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js +55 -0
  805. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js.map +1 -0
  806. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +51 -0
  807. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs.map +1 -0
  808. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +698 -0
  809. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -0
  810. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +698 -0
  811. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -0
  812. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js +196 -0
  813. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js.map +1 -0
  814. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +192 -0
  815. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs.map +1 -0
  816. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +309 -0
  817. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -0
  818. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +309 -0
  819. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -0
  820. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js +116 -0
  821. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js.map +1 -0
  822. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +112 -0
  823. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs.map +1 -0
  824. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +426 -0
  825. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -0
  826. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +426 -0
  827. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -0
  828. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js +150 -0
  829. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -0
  830. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +145 -0
  831. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -0
  832. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts +3 -0
  833. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts.map +1 -0
  834. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts +3 -0
  835. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts.map +1 -0
  836. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js +9 -0
  837. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js.map +1 -0
  838. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs +4 -0
  839. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs.map +1 -0
  840. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts +501 -0
  841. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts.map +1 -0
  842. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts +501 -0
  843. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts.map +1 -0
  844. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js +257 -0
  845. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js.map +1 -0
  846. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +251 -0
  847. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs.map +1 -0
  848. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts +1 -388
  849. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts.map +1 -1
  850. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts +1 -388
  851. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts.map +1 -1
  852. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js +2 -138
  853. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js.map +1 -1
  854. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs +1 -136
  855. package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs.map +1 -1
  856. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +22 -22
  857. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -1
  858. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +22 -22
  859. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
  860. package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +5 -5
  861. package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
  862. package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +5 -5
  863. package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
  864. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +11 -6
  865. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -1
  866. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +11 -6
  867. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
  868. package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +23 -13
  869. package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
  870. package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -1
  871. package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
  872. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts +1 -1
  873. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts.map +1 -1
  874. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts +1 -1
  875. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts.map +1 -1
  876. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.js.map +1 -1
  877. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.mjs.map +1 -1
  878. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +136 -24
  879. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts.map +1 -1
  880. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts +136 -24
  881. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts.map +1 -1
  882. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js +10 -10
  883. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js.map +1 -1
  884. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +10 -10
  885. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs.map +1 -1
  886. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts +60 -16
  887. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
  888. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts +60 -16
  889. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
  890. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js +12 -12
  891. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js.map +1 -1
  892. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +12 -12
  893. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  894. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +105 -7
  895. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  896. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts +105 -7
  897. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  898. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js +6 -6
  899. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js.map +1 -1
  900. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +6 -6
  901. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
  902. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.mts.map +1 -1
  903. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.ts.map +1 -1
  904. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.mjs.map +1 -1
  905. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +81 -30
  906. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -1
  907. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +81 -30
  908. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -1
  909. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +12 -9
  910. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -1
  911. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +12 -9
  912. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +1 -1
  913. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +1 -1
  914. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -1
  915. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +1 -1
  916. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -1
  917. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -1
  918. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -1
  919. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +2453 -380
  920. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -1
  921. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +2453 -380
  922. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -1
  923. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +16 -22
  924. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -1
  925. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +16 -22
  926. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
  927. package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -1
  928. package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -1
  929. package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -1
  930. package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +6 -0
  931. package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -1
  932. package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +6 -0
  933. package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -1
  934. package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -1
  935. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +643 -19
  936. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts.map +1 -1
  937. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +643 -19
  938. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts.map +1 -1
  939. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js +29 -2
  940. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js.map +1 -1
  941. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +27 -1
  942. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs.map +1 -1
  943. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts +3 -2
  944. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts.map +1 -1
  945. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts +3 -2
  946. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts.map +1 -1
  947. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js +3 -1
  948. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js.map +1 -1
  949. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs +1 -0
  950. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs.map +1 -1
  951. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.mts.map +1 -1
  952. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.ts.map +1 -1
  953. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs.map +1 -1
  954. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +455 -8
  955. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts.map +1 -1
  956. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +455 -8
  957. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts.map +1 -1
  958. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js +5 -1
  959. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js.map +1 -1
  960. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +6 -2
  961. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs.map +1 -1
  962. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts +78 -0
  963. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts.map +1 -0
  964. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts +78 -0
  965. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts.map +1 -0
  966. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js +61 -0
  967. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js.map +1 -0
  968. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +57 -0
  969. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs.map +1 -0
  970. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts +3 -0
  971. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts.map +1 -0
  972. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts +3 -0
  973. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts.map +1 -0
  974. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js +9 -0
  975. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js.map +1 -0
  976. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs +4 -0
  977. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs.map +1 -0
  978. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +195 -0
  979. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -0
  980. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +195 -0
  981. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -0
  982. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js +88 -0
  983. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -0
  984. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +83 -0
  985. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -0
  986. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts +2 -0
  987. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts.map +1 -0
  988. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts +2 -0
  989. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts.map +1 -0
  990. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js +6 -0
  991. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js.map +1 -0
  992. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs +3 -0
  993. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs.map +1 -0
  994. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.mts.map +1 -1
  995. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.ts.map +1 -1
  996. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.mjs.map +1 -1
  997. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +1 -1
  998. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts.map +1 -1
  999. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts +1 -1
  1000. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts.map +1 -1
  1001. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js.map +1 -1
  1002. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs.map +1 -1
  1003. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts +13 -11
  1004. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts.map +1 -1
  1005. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts +13 -11
  1006. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts.map +1 -1
  1007. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +5 -3
  1008. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js.map +1 -1
  1009. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +5 -3
  1010. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs.map +1 -1
  1011. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts +31 -3
  1012. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts.map +1 -1
  1013. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts +31 -3
  1014. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts.map +1 -1
  1015. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +32 -3
  1016. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js.map +1 -1
  1017. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +32 -3
  1018. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
  1019. package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.mts.map +1 -1
  1020. package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.ts.map +1 -1
  1021. package/node_modules/@anthropic-ai/sdk/resources/beta/skills.mjs.map +1 -1
  1022. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts +163 -0
  1023. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts.map +1 -0
  1024. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts +163 -0
  1025. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts.map +1 -0
  1026. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js +129 -0
  1027. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js.map +1 -0
  1028. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +125 -0
  1029. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs.map +1 -0
  1030. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts +3 -0
  1031. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts.map +1 -0
  1032. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts +3 -0
  1033. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts.map +1 -0
  1034. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js +9 -0
  1035. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js.map +1 -0
  1036. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs +4 -0
  1037. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs.map +1 -0
  1038. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts +212 -0
  1039. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts.map +1 -0
  1040. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts +212 -0
  1041. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts.map +1 -0
  1042. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js +181 -0
  1043. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js.map +1 -0
  1044. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +176 -0
  1045. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs.map +1 -0
  1046. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts +2 -0
  1047. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts.map +1 -0
  1048. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts +2 -0
  1049. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts.map +1 -0
  1050. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js +6 -0
  1051. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js.map +1 -0
  1052. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs +3 -0
  1053. package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs.map +1 -0
  1054. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +62 -0
  1055. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts.map +1 -1
  1056. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts +62 -0
  1057. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
  1058. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.js +5 -5
  1059. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +5 -5
  1060. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs.map +1 -1
  1061. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts +256 -4
  1062. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts.map +1 -1
  1063. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts +256 -4
  1064. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts.map +1 -1
  1065. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js +22 -0
  1066. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js.map +1 -1
  1067. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +22 -0
  1068. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs.map +1 -1
  1069. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts +1 -1
  1070. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts.map +1 -1
  1071. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts +1 -1
  1072. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts.map +1 -1
  1073. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.js.map +1 -1
  1074. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.mjs.map +1 -1
  1075. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts +2 -2
  1076. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts.map +1 -1
  1077. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts +2 -2
  1078. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts.map +1 -1
  1079. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.js.map +1 -1
  1080. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs.map +1 -1
  1081. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.mts.map +1 -1
  1082. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.ts.map +1 -1
  1083. package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.mjs.map +1 -1
  1084. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +466 -0
  1085. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -0
  1086. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +466 -0
  1087. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -0
  1088. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +20 -0
  1089. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -0
  1090. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +16 -0
  1091. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -0
  1092. package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -1
  1093. package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -1
  1094. package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -1
  1095. package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +18 -11
  1096. package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -1
  1097. package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +18 -11
  1098. package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -1
  1099. package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -1
  1100. package/node_modules/@anthropic-ai/sdk/resources/files.d.mts +105 -0
  1101. package/node_modules/@anthropic-ai/sdk/resources/files.d.mts.map +1 -0
  1102. package/node_modules/@anthropic-ai/sdk/resources/files.d.ts +105 -0
  1103. package/node_modules/@anthropic-ai/sdk/resources/files.d.ts.map +1 -0
  1104. package/node_modules/@anthropic-ai/sdk/resources/files.js +52 -0
  1105. package/node_modules/@anthropic-ai/sdk/resources/files.js.map +1 -0
  1106. package/node_modules/@anthropic-ai/sdk/resources/files.mjs +48 -0
  1107. package/node_modules/@anthropic-ai/sdk/resources/files.mjs.map +1 -0
  1108. package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +4 -2
  1109. package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -1
  1110. package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +4 -2
  1111. package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -1
  1112. package/node_modules/@anthropic-ai/sdk/resources/index.js +5 -1
  1113. package/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -1
  1114. package/node_modules/@anthropic-ai/sdk/resources/index.mjs +2 -0
  1115. package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -1
  1116. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +20 -11
  1117. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -1
  1118. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +20 -11
  1119. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -1
  1120. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +17 -9
  1121. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -1
  1122. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +17 -9
  1123. package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -1
  1124. package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +1 -1
  1125. package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -1
  1126. package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +1 -1
  1127. package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -1
  1128. package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -1
  1129. package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -1
  1130. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1782 -162
  1131. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -1
  1132. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1782 -162
  1133. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
  1134. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +23 -28
  1135. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
  1136. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +23 -28
  1137. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
  1138. package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -1
  1139. package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -1
  1140. package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -1
  1141. package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -1
  1142. package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -1
  1143. package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -1
  1144. package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts +3 -0
  1145. package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts.map +1 -0
  1146. package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts +3 -0
  1147. package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts.map +1 -0
  1148. package/node_modules/@anthropic-ai/sdk/resources/skills/index.js +9 -0
  1149. package/node_modules/@anthropic-ai/sdk/resources/skills/index.js.map +1 -0
  1150. package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs +4 -0
  1151. package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs.map +1 -0
  1152. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts +129 -0
  1153. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts.map +1 -0
  1154. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts +129 -0
  1155. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts.map +1 -0
  1156. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js +44 -0
  1157. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js.map +1 -0
  1158. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +39 -0
  1159. package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs.map +1 -0
  1160. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts +104 -0
  1161. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts.map +1 -0
  1162. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts +104 -0
  1163. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts.map +1 -0
  1164. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js +41 -0
  1165. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js.map +1 -0
  1166. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +37 -0
  1167. package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs.map +1 -0
  1168. package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts +2 -0
  1169. package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts.map +1 -0
  1170. package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts +2 -0
  1171. package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts.map +1 -0
  1172. package/node_modules/@anthropic-ai/sdk/resources/skills.js +6 -0
  1173. package/node_modules/@anthropic-ai/sdk/resources/skills.js.map +1 -0
  1174. package/node_modules/@anthropic-ai/sdk/resources/skills.mjs +3 -0
  1175. package/node_modules/@anthropic-ai/sdk/resources/skills.mjs.map +1 -0
  1176. package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -1
  1177. package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -1
  1178. package/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -1
  1179. package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +18 -2
  1180. package/node_modules/@anthropic-ai/sdk/src/client.ts +749 -42
  1181. package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +14 -4
  1182. package/node_modules/@anthropic-ai/sdk/src/core/api.ts +11 -0
  1183. package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +379 -0
  1184. package/node_modules/@anthropic-ai/sdk/src/core/error.ts +17 -0
  1185. package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +339 -0
  1186. package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +60 -0
  1187. package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +38 -1
  1188. package/node_modules/@anthropic-ai/sdk/src/helpers/beta/environments.ts +34 -0
  1189. package/node_modules/@anthropic-ai/sdk/src/helpers/beta/json-schema.ts +7 -0
  1190. package/node_modules/@anthropic-ai/sdk/src/helpers/beta/mcp.ts +1 -1
  1191. package/node_modules/@anthropic-ai/sdk/src/helpers/beta/zod.ts +14 -10
  1192. package/node_modules/@anthropic-ai/sdk/src/helpers/zod.ts +3 -6
  1193. package/node_modules/@anthropic-ai/sdk/src/index.ts +16 -1
  1194. package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +0 -5
  1195. package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +550 -0
  1196. package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +47 -4
  1197. package/node_modules/@anthropic-ai/sdk/src/internal/message-stream-utils.ts +30 -0
  1198. package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +16 -11
  1199. package/node_modules/@anthropic-ai/sdk/src/internal/qs/LICENSE.md +13 -0
  1200. package/node_modules/@anthropic-ai/sdk/src/internal/qs/README.md +3 -0
  1201. package/node_modules/@anthropic-ai/sdk/src/internal/qs/formats.ts +10 -0
  1202. package/node_modules/@anthropic-ai/sdk/src/internal/qs/index.ts +13 -0
  1203. package/node_modules/@anthropic-ai/sdk/src/internal/qs/stringify.ts +385 -0
  1204. package/node_modules/@anthropic-ai/sdk/src/internal/qs/types.ts +71 -0
  1205. package/node_modules/@anthropic-ai/sdk/src/internal/qs/utils.ts +265 -0
  1206. package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +55 -2
  1207. package/node_modules/@anthropic-ai/sdk/src/internal/request-signal.ts +68 -0
  1208. package/node_modules/@anthropic-ai/sdk/src/internal/stainless-helper-header.ts +122 -0
  1209. package/node_modules/@anthropic-ai/sdk/src/internal/utils/abort.ts +21 -0
  1210. package/node_modules/@anthropic-ai/sdk/src/internal/utils/async-queue.ts +66 -0
  1211. package/node_modules/@anthropic-ai/sdk/src/internal/utils/backoff.ts +41 -0
  1212. package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +41 -10
  1213. package/node_modules/@anthropic-ai/sdk/src/internal/utils/promise.ts +18 -0
  1214. package/node_modules/@anthropic-ai/sdk/src/internal/utils/query.ts +2 -18
  1215. package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +25 -2
  1216. package/node_modules/@anthropic-ai/sdk/src/internal/utils/time.ts +4 -0
  1217. package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +72 -33
  1218. package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +36 -24
  1219. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +292 -0
  1220. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +37 -0
  1221. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/oidc-federation.ts +140 -0
  1222. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/token-cache.ts +130 -0
  1223. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +295 -0
  1224. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +144 -0
  1225. package/node_modules/@anthropic-ai/sdk/src/lib/credentials.ts +3 -0
  1226. package/node_modules/@anthropic-ai/sdk/src/lib/environments/index.ts +23 -0
  1227. package/node_modules/@anthropic-ai/sdk/src/lib/environments/poller.ts +299 -0
  1228. package/node_modules/@anthropic-ai/sdk/src/lib/environments/worker.ts +779 -0
  1229. package/node_modules/@anthropic-ai/sdk/src/lib/helper-client.ts +86 -0
  1230. package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +994 -0
  1231. package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +130 -0
  1232. package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaRunnableTool.ts +71 -7
  1233. package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +135 -35
  1234. package/node_modules/@anthropic-ai/sdk/src/lib/tools/SessionToolRunner.ts +885 -0
  1235. package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +806 -69
  1236. package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/index.ts +34 -0
  1237. package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +690 -28
  1238. package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +441 -0
  1239. package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +996 -0
  1240. package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +453 -0
  1241. package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +626 -0
  1242. package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/index.ts +42 -0
  1243. package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/work.ts +705 -0
  1244. package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments.ts +1 -540
  1245. package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +28 -28
  1246. package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +312 -5
  1247. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/index.ts +1 -0
  1248. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +141 -31
  1249. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-stores.ts +66 -20
  1250. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +112 -9
  1251. package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +90 -33
  1252. package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +90 -0
  1253. package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2755 -211
  1254. package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +7 -0
  1255. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +888 -18
  1256. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/index.ts +60 -1
  1257. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +669 -14
  1258. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/events.ts +123 -0
  1259. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/index.ts +15 -0
  1260. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +330 -0
  1261. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads.ts +3 -0
  1262. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +1 -0
  1263. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +15 -14
  1264. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +49 -3
  1265. package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/certificates.ts +252 -0
  1266. package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/index.ts +23 -0
  1267. package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/tunnels.ts +347 -0
  1268. package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels.ts +3 -0
  1269. package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +76 -5
  1270. package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/credentials.ts +347 -3
  1271. package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/index.ts +17 -0
  1272. package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/vaults.ts +34 -0
  1273. package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +762 -0
  1274. package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +18 -11
  1275. package/node_modules/@anthropic-ai/sdk/src/resources/files.ts +163 -0
  1276. package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +89 -0
  1277. package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +30 -12
  1278. package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +70 -0
  1279. package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2202 -226
  1280. package/node_modules/@anthropic-ai/sdk/src/resources/skills/index.ts +21 -0
  1281. package/node_modules/@anthropic-ai/sdk/src/resources/skills/skills.ts +194 -0
  1282. package/node_modules/@anthropic-ai/sdk/src/resources/skills/versions.ts +160 -0
  1283. package/node_modules/@anthropic-ai/sdk/src/resources/skills.ts +3 -0
  1284. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +190 -0
  1285. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +1017 -0
  1286. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +172 -0
  1287. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +914 -0
  1288. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +372 -0
  1289. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/sync-interval.ts +30 -0
  1290. package/node_modules/@anthropic-ai/sdk/src/tools/memory/node.browser.ts +64 -0
  1291. package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
  1292. package/node_modules/@anthropic-ai/sdk/streaming.d.mts +1 -0
  1293. package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -1
  1294. package/node_modules/@anthropic-ai/sdk/streaming.d.ts +1 -0
  1295. package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -1
  1296. package/node_modules/@anthropic-ai/sdk/streaming.mjs +1 -0
  1297. package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -1
  1298. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts +75 -0
  1299. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -0
  1300. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts +75 -0
  1301. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -0
  1302. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +196 -0
  1303. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -0
  1304. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +185 -0
  1305. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -0
  1306. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts +173 -0
  1307. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -0
  1308. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts +173 -0
  1309. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -0
  1310. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +902 -0
  1311. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -0
  1312. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +895 -0
  1313. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -0
  1314. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +82 -0
  1315. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -0
  1316. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +82 -0
  1317. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -0
  1318. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +151 -0
  1319. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -0
  1320. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +131 -0
  1321. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -0
  1322. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +190 -0
  1323. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -0
  1324. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +190 -0
  1325. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -0
  1326. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +819 -0
  1327. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -0
  1328. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +797 -0
  1329. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -0
  1330. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +82 -0
  1331. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -0
  1332. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +82 -0
  1333. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -0
  1334. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +352 -0
  1335. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -0
  1336. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +344 -0
  1337. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -0
  1338. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts +19 -0
  1339. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts.map +1 -0
  1340. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts +19 -0
  1341. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts.map +1 -0
  1342. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js +29 -0
  1343. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js.map +1 -0
  1344. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs +25 -0
  1345. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs.map +1 -0
  1346. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts +27 -0
  1347. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts.map +1 -0
  1348. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts +27 -0
  1349. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts.map +1 -0
  1350. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js +49 -0
  1351. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js.map +1 -0
  1352. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs +44 -0
  1353. package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs.map +1 -0
  1354. package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.mts.map +1 -1
  1355. package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.ts.map +1 -1
  1356. package/node_modules/@anthropic-ai/sdk/tools/memory/node.mjs.map +1 -1
  1357. package/node_modules/@anthropic-ai/sdk/uploads.d.mts +1 -0
  1358. package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -1
  1359. package/node_modules/@anthropic-ai/sdk/uploads.d.ts +1 -0
  1360. package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -1
  1361. package/node_modules/@anthropic-ai/sdk/uploads.mjs +1 -0
  1362. package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -1
  1363. package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
  1364. package/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -1
  1365. package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
  1366. package/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -1
  1367. package/node_modules/@anthropic-ai/sdk/version.js +1 -1
  1368. package/node_modules/@anthropic-ai/sdk/version.js.map +1 -1
  1369. package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
  1370. package/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -1
  1371. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +24 -0
  1372. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  1373. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager-proxy.ts +39 -5
  1374. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  1375. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +7 -4
  1376. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  1377. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +2 -3
  1378. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  1379. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +7 -6
  1380. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  1381. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts +4 -0
  1382. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
  1383. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +8 -0
  1384. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -1
  1385. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -0
  1386. package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
  1387. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +1 -0
  1388. package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
  1389. package/node_modules/@earendil-works/pi-agent-core/package.json +5 -5
  1390. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +1 -5
  1391. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  1392. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +25 -13
  1393. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  1394. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
  1395. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -1
  1396. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  1397. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  1398. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +91 -5
  1399. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  1400. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
  1401. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +4 -2
  1402. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  1403. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
  1404. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +4 -2
  1405. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  1406. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
  1407. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -0
  1408. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  1409. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  1410. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +93 -54
  1411. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  1412. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -5
  1413. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  1414. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js +1 -1
  1415. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
  1416. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -1
  1417. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +97 -46
  1418. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -1
  1419. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
  1420. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +1 -14
  1421. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
  1422. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +50 -0
  1423. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -0
  1424. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +129 -0
  1425. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -0
  1426. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  1427. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +3 -1
  1428. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  1429. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +8 -1
  1430. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  1431. package/node_modules/@earendil-works/pi-ai/dist/models.js +16 -3
  1432. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  1433. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts +3 -1
  1434. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
  1435. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +10 -1
  1436. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
  1437. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  1438. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  1439. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  1440. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  1441. package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
  1442. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  1443. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  1444. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  1445. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  1446. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
  1447. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  1448. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  1449. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
  1450. package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
  1451. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +1 -0
  1452. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
  1453. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +1 -0
  1454. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  1455. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts.map +1 -1
  1456. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +4 -0
  1457. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js.map +1 -1
  1458. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +8 -1
  1459. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  1460. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  1461. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +16 -0
  1462. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  1463. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +17 -1
  1464. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  1465. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.d.ts +14 -0
  1466. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.d.ts.map +1 -0
  1467. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.js +24 -0
  1468. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.js.map +1 -0
  1469. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts +36 -0
  1470. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts.map +1 -0
  1471. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js +109 -0
  1472. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js.map +1 -0
  1473. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.d.ts +12 -0
  1474. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.d.ts.map +1 -0
  1475. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.js +109 -0
  1476. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.js.map +1 -0
  1477. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.d.ts +9 -0
  1478. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.d.ts.map +1 -0
  1479. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.js +6 -0
  1480. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.js.map +1 -0
  1481. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.d.ts +46 -0
  1482. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.d.ts.map +1 -0
  1483. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.js +41 -0
  1484. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.js.map +1 -0
  1485. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts +4 -0
  1486. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -0
  1487. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +93 -0
  1488. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -0
  1489. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +121 -0
  1490. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -0
  1491. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js +11 -0
  1492. package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -0
  1493. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +12 -0
  1494. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  1495. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +25 -5
  1496. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  1497. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts +2 -0
  1498. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts.map +1 -0
  1499. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js +15 -0
  1500. package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js.map +1 -0
  1501. package/node_modules/@earendil-works/pi-ai/package.json +21 -17
  1502. package/node_modules/@earendil-works/pi-pty/dist/index.d.ts +1 -0
  1503. package/node_modules/@earendil-works/pi-pty/dist/index.d.ts.map +1 -1
  1504. package/node_modules/@earendil-works/pi-pty/dist/index.js +1 -0
  1505. package/node_modules/@earendil-works/pi-pty/dist/index.js.map +1 -1
  1506. package/node_modules/@earendil-works/pi-pty/dist/session-bun.d.ts +30 -0
  1507. package/node_modules/@earendil-works/pi-pty/dist/session-bun.d.ts.map +1 -0
  1508. package/node_modules/@earendil-works/pi-pty/dist/session-bun.js +76 -0
  1509. package/node_modules/@earendil-works/pi-pty/dist/session-bun.js.map +1 -0
  1510. package/node_modules/@earendil-works/pi-pty/dist/session-types.d.ts +3 -1
  1511. package/node_modules/@earendil-works/pi-pty/dist/session-types.d.ts.map +1 -1
  1512. package/node_modules/@earendil-works/pi-pty/dist/session-types.js.map +1 -1
  1513. package/node_modules/@earendil-works/pi-pty/dist/session.d.ts +2 -0
  1514. package/node_modules/@earendil-works/pi-pty/dist/session.d.ts.map +1 -1
  1515. package/node_modules/@earendil-works/pi-pty/dist/session.js +19 -9
  1516. package/node_modules/@earendil-works/pi-pty/dist/session.js.map +1 -1
  1517. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  1518. package/node_modules/@earendil-works/pi-telemetry/package.json +3 -3
  1519. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  1520. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +9 -4
  1521. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  1522. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +8 -2
  1523. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  1524. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +24 -4
  1525. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  1526. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +2 -2
  1527. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -2
  1528. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  1529. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
  1530. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +2 -8
  1531. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  1532. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts +7 -0
  1533. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts.map +1 -0
  1534. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js +19 -0
  1535. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js.map +1 -0
  1536. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1537. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +4 -10
  1538. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1539. package/node_modules/@earendil-works/pi-tui/package.json +5 -5
  1540. package/node_modules/@stablelib/base64/LICENSE +21 -0
  1541. package/node_modules/@stablelib/base64/base64.bench.ts +25 -0
  1542. package/node_modules/@stablelib/base64/base64.test.ts +85 -0
  1543. package/node_modules/@stablelib/base64/base64.ts +283 -0
  1544. package/node_modules/@stablelib/base64/lib/base64.bench.d.ts +1 -0
  1545. package/node_modules/@stablelib/base64/lib/base64.bench.js +23 -0
  1546. package/node_modules/@stablelib/base64/lib/base64.bench.js.map +1 -0
  1547. package/node_modules/@stablelib/base64/lib/base64.d.ts +34 -0
  1548. package/node_modules/@stablelib/base64/lib/base64.js +282 -0
  1549. package/node_modules/@stablelib/base64/lib/base64.js.map +1 -0
  1550. package/node_modules/@stablelib/base64/lib/base64.test.d.ts +1 -0
  1551. package/node_modules/@stablelib/base64/lib/base64.test.js +82 -0
  1552. package/node_modules/@stablelib/base64/lib/base64.test.js.map +1 -0
  1553. package/node_modules/@stablelib/base64/package.json +25 -0
  1554. package/node_modules/@stablelib/base64/tsconfig.json +27 -0
  1555. package/node_modules/fast-sha256/LICENSE +24 -0
  1556. package/node_modules/fast-sha256/README.md +127 -0
  1557. package/node_modules/fast-sha256/package.json +42 -0
  1558. package/node_modules/fast-sha256/sha256.d.ts +39 -0
  1559. package/node_modules/fast-sha256/sha256.js +427 -0
  1560. package/node_modules/fast-sha256/sha256.min.js +1 -0
  1561. package/node_modules/standardwebhooks/README.md +41 -0
  1562. package/node_modules/standardwebhooks/dist/index.d.ts +24 -0
  1563. package/node_modules/standardwebhooks/dist/index.js +106 -0
  1564. package/node_modules/standardwebhooks/dist/index.js.map +1 -0
  1565. package/node_modules/standardwebhooks/dist/timing_safe_equal.d.ts +1 -0
  1566. package/node_modules/standardwebhooks/dist/timing_safe_equal.js +30 -0
  1567. package/node_modules/standardwebhooks/dist/timing_safe_equal.js.map +1 -0
  1568. package/node_modules/standardwebhooks/package.json +45 -0
  1569. package/package.json +100 -89
  1570. package/dist/core/radius.d.ts +0 -2
  1571. package/dist/core/radius.d.ts.map +0 -1
  1572. package/dist/core/radius.js +0 -2
  1573. package/dist/core/radius.js.map +0 -1
  1574. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts +0 -34
  1575. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts.map +0 -1
  1576. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts +0 -34
  1577. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts.map +0 -1
  1578. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.js.map +0 -1
  1579. package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.mjs.map +0 -1
  1580. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts +0 -132
  1581. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts.map +0 -1
  1582. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts +0 -132
  1583. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts.map +0 -1
  1584. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js +0 -294
  1585. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js.map +0 -1
  1586. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs +0 -290
  1587. package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs.map +0 -1
  1588. package/node_modules/@anthropic-ai/sdk/src/lib/stainless-helper-header.ts +0 -80
  1589. package/node_modules/@anthropic-ai/sdk/src/lib/tools/ToolRunner.ts +0 -381
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CAyBrE,CAAC"}
1
+ {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA0BrE,CAAC"}
@@ -2,6 +2,8 @@ import { APP_NAME } from "../config.js";
2
2
  export const BUILTIN_SLASH_COMMANDS = [
3
3
  { name: "settings", description: "Open settings menu" },
4
4
  { name: "model", description: "Select model (opens selector UI)", argumentHint: "<provider/model>" },
5
+ { name: "tree", description: "Navigate session tree (switch branches)" },
6
+ { name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
5
7
  { name: "scoped-models", description: "Enable/disable models for Ctrl+P cycling" },
6
8
  { name: "favorite-models", description: "Manage favorite models for Ctrl+P cycling" },
7
9
  { name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
@@ -14,7 +16,6 @@ export const BUILTIN_SLASH_COMMANDS = [
14
16
  { name: "hotkeys", description: "Show all keyboard shortcuts" },
15
17
  { name: "fork", description: "Create a new fork from a previous user message" },
16
18
  { name: "clone", description: "Duplicate the current session at the current position" },
17
- { name: "tree", description: "Navigate session tree (switch branches)" },
18
19
  { name: "trust", description: "Save project trust decision for future sessions" },
19
20
  { name: "login", description: "Configure provider authentication", argumentHint: "<provider>" },
20
21
  { name: "logout", description: "Remove provider authentication" },
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAkBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,YAAY,EAAE,kBAAkB,EAAE;IACpG,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,0CAA0C,EAAE;IAClF,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,2CAA2C,EAAE;IACrF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,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AAQ,QAAQ,mBAAmB,EAAE;CAClE,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"favorite-models\", description: \"Manage favorite models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, themes, and context files\" },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n\t{ name: \"exit\", description: `Quit ${APP_NAME} (alias of /quit)` },\n];\n"]}
1
+ {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAkBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,YAAY,EAAE,kBAAkB,EAAE;IACpG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,YAAY,EAAE,SAAS,EAAE;IAChF,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,0CAA0C,EAAE;IAClF,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,2CAA2C,EAAE;IACrF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACzD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC5D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gDAAgD,EAAE;IAC/E,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uDAAuD,EAAE;IACvF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,iDAAiD,EAAE;IACjF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mCAAmC,EAAE,YAAY,EAAE,YAAY,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4EAA4E,EAAE;IAC7G,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;IACjD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,mBAAmB,EAAE;CAClE,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\targumentHint?: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\", argumentHint: \"<provider/model>\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"thinking\", description: \"Set thinking level\", argumentHint: \"<level>\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"favorite-models\", description: \"Manage favorite models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\", argumentHint: \"<provider>\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, themes, and context files\" },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n\t{ name: \"exit\", description: `Quit ${APP_NAME} (alias of /quit)` },\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACxC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,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E,wBAAwB,GAAG,MAAM,CA6I3E"}
@@ -52,13 +52,22 @@ export function buildSystemPrompt(options) {
52
52
  guidelinesList.push(guideline);
53
53
  };
54
54
  const hasBash = tools.includes("bash");
55
+ const hasPowerShell = tools.includes("powershell");
55
56
  const hasGrep = tools.includes("grep");
56
57
  const hasFind = tools.includes("find");
57
58
  const hasLs = tools.includes("ls");
58
59
  const hasRead = tools.includes("read");
59
60
  // File exploration guidelines
60
- if (hasBash && !hasGrep && !hasFind && !hasLs) {
61
- addGuideline("Use bash for file operations like ls, rg, find");
61
+ if ((hasBash || hasPowerShell) && !hasGrep && !hasFind && !hasLs) {
62
+ if (hasBash && hasPowerShell) {
63
+ addGuideline("Use bash or PowerShell for file operations like listing, searching, and finding files");
64
+ }
65
+ else if (hasPowerShell) {
66
+ addGuideline("Use PowerShell for file operations like listing, searching, and finding files");
67
+ }
68
+ else {
69
+ addGuideline("Use bash for file operations like ls, rg, find");
70
+ }
62
71
  }
63
72
  for (const guideline of promptGuidelines ?? []) {
64
73
  const normalized = guideline.trim();
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAqBhE,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IAClE,MAAM,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,GAAG,EACH,YAAY,EAAE,oBAAoB,EAClC,MAAM,EAAE,cAAc,GACtB,GAAG,OAAO,CAAC;IACZ,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,kBAAkB,CAAC,CAAC,CAAC,OAAO,kB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EAAE,CAAC;QAChD,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,YAAY,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IAED,uBAAuB;IACvB,YAAY,CAAC,8BAA8B,CAAC,CAAC;IAC7C,YAAY,CAAC,iDAAiD,CAAC,CAAC;IAEhE,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElE,IAAI,MAAM,GAAG;;;EAGZ,SAAS;;;;;EAKT,UAAU;;;wBAGY,UAAU;qBACb,QAAQ;cACf,YAAY;;;;0GAIgF,CAAC;IAE1G,IAAI,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,aAAa,CAAC;IACzB,CAAC;IAED,+BAA+B;IAC/B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,2BAA2B,CAAC;QACtC,MAAM,IAAI,mDAAmD,CAAC;QAC9D,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;YACxD,MAAM,IAAI,+BAA+B,QAAQ,OAAO,OAAO,+BAA+B,CAAC;QAChG,CAAC;QACD,MAAM,IAAI,sBAAsB,CAAC;IAClC,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,gCAAgC,SAAS,EAAE,CAAC;IAEtD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.ts\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.ts\";\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. */\n\tcwd: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst promptCwd = cwd.replace(/\\\\/g, \"/\");\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t\t}\n\t\t\tprompt += \"</project_context>\\n\";\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\tprompt += `\\nCurrent working directory: ${promptCwd}\\n`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// A tool appears in Available tools only when the caller provides a one-line snippet.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\"];\n\tconst visibleTools = tools.filter((name) => !!toolSnippets?.[name]);\n\tconst toolsList =\n\t\tvisibleTools.length > 0 ? visibleTools.map((name) => `- ${name}: ${toolSnippets![name]}`).join(\"\\n\") : \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif (hasBash && !hasGrep && !hasFind && !hasLs) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t}\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nPi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When reading pi docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), pi packages (docs/packages.md), environment variables (docs/environment-variables.md)\n- When working on pi topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t}\n\t\tprompt += \"</project_context>\\n\";\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\treturn prompt;\n}\n"]}
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAqBhE,kEAA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AED,+BAA+B;IAC/B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,2BAA2B,CAAC;QACtC,MAAM,IAAI,mDAAmD,CAAC;QAC9D,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;YACxD,MAAM,IAAI,+BAA+B,QAAQ,OAAO,OAAO,+BAA+B,CAAC;QAChG,CAAC;QACD,MAAM,IAAI,sBAAsB,CAAC;IAClC,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,IAAI,gCAAgC,SAAS,EAAE,CAAC;IAEtD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.ts\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.ts\";\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. */\n\tcwd: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst promptCwd = cwd.replace(/\\\\/g, \"/\");\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t\t}\n\t\t\tprompt += \"</project_context>\\n\";\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\tprompt += `\\nCurrent working directory: ${promptCwd}\\n`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// A tool appears in Available tools only when the caller provides a one-line snippet.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\"];\n\tconst visibleTools = tools.filter((name) => !!toolSnippets?.[name]);\n\tconst toolsList =\n\t\tvisibleTools.length > 0 ? visibleTools.map((name) => `- ${name}: ${toolSnippets![name]}`).join(\"\\n\") : \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasPowerShell = tools.includes(\"powershell\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif ((hasBash || hasPowerShell) && !hasGrep && !hasFind && !hasLs) {\n\t\tif (hasBash && hasPowerShell) {\n\t\t\taddGuideline(\"Use bash or PowerShell for file operations like listing, searching, and finding files\");\n\t\t} else if (hasPowerShell) {\n\t\t\taddGuideline(\"Use PowerShell for file operations like listing, searching, and finding files\");\n\t\t} else {\n\t\t\taddGuideline(\"Use bash for file operations like ls, rg, find\");\n\t\t}\n\t}\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nPi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When reading pi docs or examples, resolve docs/... under Additional docs and examples/... under Examples, not the current working directory\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), pi packages (docs/packages.md), environment variables (docs/environment-variables.md)\n- When working on pi topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n<project_context>\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `<project_instructions path=\"${filePath}\">\\n${content}\\n</project_instructions>\\n\\n`;\n\t\t}\n\t\tprompt += \"</project_context>\\n\";\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\tprompt += `\\nCurrent working directory: ${promptCwd}`;\n\n\treturn prompt;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { AgentTool } from "@earendil-works/pi-agent-core";
2
2
  import { type Static, Type } from "typebox";
3
+ import { type ShellConfig } from "../../utils/shell.ts";
3
4
  import type { ToolDefinition } from "../extensions/types.ts";
4
5
  import { type TruncationResult } from "./truncate.ts";
5
6
  declare const bashSchema: Type.TObject<{
@@ -36,6 +37,8 @@ export interface BashOperations {
36
37
  exitCode: number | null;
37
38
  }>;
38
39
  }
40
+ /** Shared process execution used by the built-in shell tools. */
41
+ export declare function createLocalShellOperations(shellName: string, resolveShellConfig: () => ShellConfig): BashOperations;
39
42
  /**
40
43
  * Create bash operations using pi's built-in local shell execution backend.
41
44
  *
@@ -63,11 +66,21 @@ export interface BashToolOptions {
63
66
  /** Hook to adjust command, cwd, or env before execution */
64
67
  spawnHook?: BashSpawnHook;
65
68
  }
66
- type BashRenderState = {
69
+ export type BashRenderState = {
67
70
  startedAt: number | undefined;
68
71
  endedAt: number | undefined;
69
72
  interval: NodeJS.Timeout | undefined;
70
73
  };
74
+ export interface ShellToolConfig {
75
+ name: string;
76
+ label: string;
77
+ shellName: string;
78
+ prompt: string;
79
+ promptSnippet: string;
80
+ promptGuidelines?: readonly string[];
81
+ tempFilePrefix: string;
82
+ }
83
+ export declare function createShellToolDefinition(cwd: string, config: ShellToolConfig, options?: BashToolOptions): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState>;
71
84
  export declare function createBashToolDefinition(cwd: string, options?: BashToolOptions): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState>;
72
85
  export declare function createBashTool(cwd: string, options?: BashToolOptions): AgentTool<typeof bashSchema>;
73
86
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAa5C,OAAO,KAAK,EAAoB,cAAc,EAA2B,MAAM,wBAAwB,CAAC;AAIxG,OAAO,EAAoD,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAkBxG,QAAA,MAAM,UAAU;;;EAGd,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;CAGnC,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;OAMG;IACH,IAAI,EAAE,CACL,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;QACR,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QAC/B,MAAM,CAAC,EAAE,WAAW,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AAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GACvB,cAAc,CAAC,OAAO,UAAU,EAAE,eAAe,GAAG,SAAS,EAAE,eAAe,CAAC,CAEjF;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,UAAU,CAAC,CAQnG"}
@@ -28,32 +28,27 @@ function resolveTimeoutMs(timeout) {
28
28
  return timeoutMs;
29
29
  }
30
30
  const bashSchema = Type.Object({
31
- command: Type.String({ description: "Bash command to execute" }),
31
+ command: Type.String({ description: "Shell command to execute" }),
32
32
  timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
33
33
  });
34
34
  export const bashToolSystemPromptContribution = {
35
35
  snippet: "Execute bash commands (ls, rg, find, etc.)",
36
36
  guidelines: ["You can inspect PI_* environment variables for current model and session details."],
37
37
  };
38
- /**
39
- * Create bash operations using pi's built-in local shell execution backend.
40
- *
41
- * This is useful for extensions that intercept user_bash and still want pi's
42
- * standard local shell behavior while wrapping or rewriting commands.
43
- */
44
- export function createLocalBashOperations(options) {
38
+ /** Shared process execution used by the built-in shell tools. */
39
+ export function createLocalShellOperations(shellName, resolveShellConfig) {
45
40
  return {
46
41
  exec: async (command, cwd, { onData, signal, timeout, env }) => {
47
42
  const timeoutMs = resolveTimeoutMs(timeout);
48
43
  if (signal?.aborted) {
49
44
  throw new Error("aborted");
50
45
  }
51
- const shellConfig = getShellConfig(options?.shellPath);
46
+ const shellConfig = resolveShellConfig();
52
47
  try {
53
48
  await fsAccess(cwd, constants.F_OK);
54
49
  }
55
50
  catch {
56
- throw new Error(`Working directory does not exist: ${cwd}\nCannot execute bash commands.`);
51
+ throw new Error(`Working directory does not exist: ${cwd}\nCannot execute ${shellName} commands.`);
57
52
  }
58
53
  const commandFromStdin = shellConfig.commandTransport === "stdin";
59
54
  const child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {
@@ -131,6 +126,15 @@ export function createLocalBashOperations(options) {
131
126
  },
132
127
  };
133
128
  }
129
+ /**
130
+ * Create bash operations using pi's built-in local shell execution backend.
131
+ *
132
+ * This is useful for extensions that intercept user_bash and still want pi's
133
+ * standard local shell behavior while wrapping or rewriting commands.
134
+ */
135
+ export function createLocalBashOperations(options) {
136
+ return createLocalShellOperations("bash", () => getShellConfig(options?.shellPath));
137
+ }
134
138
  function resolveSpawnContext(command, cwd, spawnHook, exposeSessionEnvironment, ctx) {
135
139
  const env = { ...getShellEnv() };
136
140
  delete env.PI_SESSION_ID;
@@ -186,7 +190,7 @@ function formatDuration(ms) {
186
190
  function highlightBashCommand(command) {
187
191
  return highlightCode(replaceTabs(normalizeDisplayText(command)), "bash").join("\n");
188
192
  }
189
- function formatBashCall(args) {
193
+ function formatShellCall(args, _prompt) {
190
194
  const command = str(args?.command);
191
195
  const timeout = args?.timeout;
192
196
  const timeoutSuffix = timeout ? theme.fg("muted", ` (timeout ${timeout}s)`) : "";
@@ -262,23 +266,23 @@ function rebuildBashResultRenderComponent(component, result, options, showImages
262
266
  component.addChild(new Text(`\n${theme.fg("muted", `${label} ${formatDuration(endTime - startedAt)}`)}`, 0, 0));
263
267
  }
264
268
  }
265
- export function createBashToolDefinition(cwd, options) {
269
+ export function createShellToolDefinition(cwd, config, options) {
266
270
  const ops = options?.operations ?? createLocalBashOperations({ shellPath: options?.shellPath });
267
271
  const commandPrefix = options?.commandPrefix;
268
272
  const exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;
269
273
  const spawnHook = options?.spawnHook;
270
274
  return {
271
- name: "bash",
272
- label: "bash",
273
- description: `Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,
274
- promptSnippet: bashToolSystemPromptContribution.snippet,
275
- promptGuidelines: exposeSessionEnvironment ? [...bashToolSystemPromptContribution.guidelines] : undefined,
275
+ name: config.name,
276
+ label: config.label,
277
+ description: `Execute a ${config.shellName} command in the current working directory. Returns stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,
278
+ promptSnippet: config.promptSnippet,
279
+ promptGuidelines: exposeSessionEnvironment && config.promptGuidelines ? [...config.promptGuidelines] : undefined,
276
280
  parameters: bashSchema,
277
281
  constrainedSampling: getExperimentalToolSampling(),
278
282
  async execute(_toolCallId, { command, timeout }, signal, onUpdate, ctx) {
279
283
  const resolvedCommand = commandPrefix ? `${commandPrefix}\n${command}` : command;
280
284
  const spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook, exposeSessionEnvironment, ctx);
281
- const output = new OutputAccumulator({ tempFilePrefix: "pi-bash" });
285
+ const output = new OutputAccumulator({ tempFilePrefix: config.tempFilePrefix });
282
286
  let acceptingOutput = true;
283
287
  let updateTimer;
284
288
  let updateDirty = false;
@@ -399,7 +403,7 @@ export function createBashToolDefinition(cwd, options) {
399
403
  state.endedAt = undefined;
400
404
  }
401
405
  const text = context.lastComponent ?? new Text("", 0, 0);
402
- text.setText(formatBashCall(args));
406
+ text.setText(formatShellCall(args, config.prompt));
403
407
  return text;
404
408
  },
405
409
  renderResult(result, options, _theme, context) {
@@ -421,6 +425,18 @@ export function createBashToolDefinition(cwd, options) {
421
425
  },
422
426
  };
423
427
  }
428
+ const bashToolConfig = {
429
+ name: "bash",
430
+ label: "bash",
431
+ shellName: "bash",
432
+ prompt: "$",
433
+ promptSnippet: bashToolSystemPromptContribution.snippet,
434
+ promptGuidelines: bashToolSystemPromptContribution.guidelines,
435
+ tempFilePrefix: "pi-bash",
436
+ };
437
+ export function createBashToolDefinition(cwd, options) {
438
+ return createShellToolDefinition(cwd, bashToolConfig, options);
439
+ }
424
440
  export function createBashTool(cwd, options) {
425
441
  const definition = createBashToolDefinition(cwd, options);
426
442
  const tool = wrapToolDefinition(definition);
@@ -1 +1 @@
1
- {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAyB,MAAM,eAAe,CAAC;AAExG,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAA2B;IACpD,IAAI,OAAO,KAAK,SAA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AC,aAAa;QACvC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;KAC7C,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport { access as fsAccess } from \"node:fs/promises\";\nimport type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Text, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { spawn } from \"child_process\";\nimport { type Static, Type } from \"typebox\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { truncateToVisualLines } from \"../../modes/interactive/components/visual-truncate.ts\";\nimport { highlightCode, theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { waitForChildProcess } from \"../../utils/child-process.ts\";\nimport {\n\tgetShellConfig,\n\tgetShellEnv,\n\tkillProcessTree,\n\ttrackDetachedChildPid,\n\tuntrackDetachedChildPid,\n} from \"../../utils/shell.ts\";\nimport { getExperimentalToolSampling } from \"../experimental.ts\";\nimport type { ExtensionContext, ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { OutputAccumulator } from \"./output-accumulator.ts\";\nimport { getTextOutput, invalidArgText, normalizeDisplayText, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult } from \"./truncate.ts\";\n\nconst MAX_TIMEOUT_MS = 2_147_483_647;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\n\nfunction resolveTimeoutMs(timeout: number | undefined): number | undefined {\n\tif (timeout === undefined) return undefined;\n\tif (!Number.isFinite(timeout) || timeout <= 0) {\n\t\tthrow new Error(\"Invalid timeout: must be a finite number of seconds\");\n\t}\n\n\tconst timeoutMs = timeout * 1000;\n\tif (timeoutMs > MAX_TIMEOUT_MS) {\n\t\tthrow new Error(`Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`);\n\t}\n\treturn timeoutMs;\n}\n\nconst bashSchema = Type.Object({\n\tcommand: Type.String({ description: \"Bash command to execute\" }),\n\ttimeout: Type.Optional(Type.Number({ description: \"Timeout in seconds (optional, no default timeout)\" })),\n});\n\nexport const bashToolSystemPromptContribution = {\n\tsnippet: \"Execute bash commands (ls, rg, find, etc.)\",\n\tguidelines: [\"You can inspect PI_* environment variables for current model and session details.\"],\n} as const;\n\nexport type BashToolInput = Static<typeof bashSchema>;\n\nexport interface BashToolDetails {\n\ttruncation?: TruncationResult;\n\tfullOutputPath?: string;\n}\n\n/**\n * Pluggable operations for the bash tool.\n * Override these to delegate command execution to remote systems (for example SSH).\n */\nexport interface BashOperations {\n\t/**\n\t * Execute a command and stream output.\n\t * @param command The command to execute\n\t * @param cwd Working directory\n\t * @param options Execution options\n\t * @returns Promise resolving to exit code (null if killed)\n\t */\n\texec: (\n\t\tcommand: string,\n\t\tcwd: string,\n\t\toptions: {\n\t\t\tonData: (data: Buffer) => void;\n\t\t\tsignal?: AbortSignal;\n\t\t\ttimeout?: number;\n\t\t\tenv?: NodeJS.ProcessEnv;\n\t\t},\n\t) => Promise<{ exitCode: number | null }>;\n}\n\n/**\n * Create bash operations using pi's built-in local shell execution backend.\n *\n * This is useful for extensions that intercept user_bash and still want pi's\n * standard local shell behavior while wrapping or rewriting commands.\n */\nexport function createLocalBashOperations(options?: { shellPath?: string }): BashOperations {\n\treturn {\n\t\texec: async (command, cwd, { onData, signal, timeout, env }) => {\n\t\t\tconst timeoutMs = resolveTimeoutMs(timeout);\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t}\n\t\t\tconst shellConfig = getShellConfig(options?.shellPath);\n\t\t\ttry {\n\t\t\t\tawait fsAccess(cwd, constants.F_OK);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Working directory does not exist: ${cwd}\\nCannot execute bash commands.`);\n\t\t\t}\n\n\t\t\tconst commandFromStdin = shellConfig.commandTransport === \"stdin\";\n\t\t\tconst child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {\n\t\t\t\tcwd,\n\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\tenv: env ?? getShellEnv(),\n\t\t\t\tstdio: [commandFromStdin ? \"pipe\" : \"ignore\", \"pipe\", \"pipe\"],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t\tif (commandFromStdin) {\n\t\t\t\tchild.stdin?.on(\"error\", () => {});\n\t\t\t\tchild.stdin?.end(command);\n\t\t\t}\n\t\t\tif (child.pid) trackDetachedChildPid(child.pid);\n\t\t\tlet timedOut = false;\n\t\t\tlet timeoutHandle: NodeJS.Timeout | undefined;\n\t\t\t// Fires once the process tree has been killed so waitForChildProcess\n\t\t\t// stops preserving output tails; descendants that survive the group\n\t\t\t// kill must not keep the aborted command running forever.\n\t\t\tconst killedController = new AbortController();\n\t\t\tconst onAbort = () => {\n\t\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t\t\tkilledController.abort();\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\t// Set timeout if provided.\n\t\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\t\ttimeoutHandle = setTimeout(() => {\n\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\tonAbort();\n\t\t\t\t\t}, timeoutMs);\n\t\t\t\t}\n\t\t\t\t// Stream stdout and stderr.\n\t\t\t\tchild.stdout?.on(\"data\", onData);\n\t\t\t\tchild.stderr?.on(\"data\", onData);\n\t\t\t\t// Handle abort signal by killing the entire process tree.\n\t\t\t\tif (signal) {\n\t\t\t\t\tif (signal.aborted) onAbort();\n\t\t\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t\t// Handle shell spawn errors and wait for the process to terminate without hanging\n\t\t\t\t// on inherited stdio handles held by detached descendants.\n\t\t\t\tconst exitCode = await waitForChildProcess(child, { signal: killedController.signal });\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t\t}\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tthrow new Error(`timeout:${timeout}`);\n\t\t\t\t}\n\t\t\t\treturn { exitCode };\n\t\t\t} finally {\n\t\t\t\tconst pid = child.pid;\n\t\t\t\tif (pid !== undefined) {\n\t\t\t\t\tif (child.exitCode !== null || child.signalCode !== null) {\n\t\t\t\t\t\tuntrackDetachedChildPid(pid);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// The kill grace released the wait while the child is still\n\t\t\t\t\t\t// alive (kill pending): keep it tracked so shutdown cleanup\n\t\t\t\t\t\t// retries, and unref it so it cannot pin the event loop.\n\t\t\t\t\t\tchild.unref();\n\t\t\t\t\t\tchild.once(\"exit\", () => untrackDetachedChildPid(pid));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (timeoutHandle) clearTimeout(timeoutHandle);\n\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport interface BashSpawnContext {\n\tcommand: string;\n\tcwd: string;\n\tenv: NodeJS.ProcessEnv;\n}\n\nexport type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext;\n\nfunction resolveSpawnContext(\n\tcommand: string,\n\tcwd: string,\n\tspawnHook: BashSpawnHook | undefined,\n\texposeSessionEnvironment: boolean,\n\tctx: ExtensionContext | undefined,\n): BashSpawnContext {\n\tconst env = { ...getShellEnv() };\n\tdelete env.PI_SESSION_ID;\n\tdelete env.PI_SESSION_FILE;\n\tdelete env.PI_PROVIDER;\n\tdelete env.PI_MODEL;\n\tdelete env.PI_REASONING_LEVEL;\n\tif (exposeSessionEnvironment && ctx) {\n\t\tconst model = ctx.model;\n\t\tenv.PI_SESSION_ID = ctx.sessionManager.getSessionId();\n\t\tconst sessionFile = ctx.sessionManager.getSessionFile();\n\t\tif (sessionFile) env.PI_SESSION_FILE = sessionFile;\n\t\tif (model) {\n\t\t\tenv.PI_PROVIDER = model.provider;\n\t\t\tenv.PI_MODEL = model.id;\n\t\t}\n\t\tif (ctx.thinkingLevel) env.PI_REASONING_LEVEL = ctx.thinkingLevel;\n\t}\n\tconst baseContext: BashSpawnContext = { command, cwd, env };\n\treturn spawnHook ? spawnHook(baseContext) : baseContext;\n}\n\nexport interface BashToolOptions {\n\t/** Custom operations for command execution. Default: local shell */\n\toperations?: BashOperations;\n\t/** Command prefix prepended to every command (for example shell setup commands) */\n\tcommandPrefix?: string;\n\t/** Optional explicit shell path from settings */\n\tshellPath?: string;\n\t/** Expose current Pi session metadata as PI_* environment variables. Default: true */\n\texposeSessionEnvironment?: boolean;\n\t/** Hook to adjust command, cwd, or env before execution */\n\tspawnHook?: BashSpawnHook;\n}\n\nconst BASH_PREVIEW_LINES = 5;\nconst BASH_UPDATE_THROTTLE_MS = 100;\n\ntype BashRenderState = {\n\tstartedAt: number | undefined;\n\tendedAt: number | undefined;\n\tinterval: NodeJS.Timeout | undefined;\n};\n\ntype BashResultRenderState = {\n\tcachedWidth: number | undefined;\n\tcachedLines: string[] | undefined;\n\tcachedSkipped: number | undefined;\n};\n\nclass BashResultRenderComponent extends Container {\n\tstate: BashResultRenderState = {\n\t\tcachedWidth: undefined,\n\t\tcachedLines: undefined,\n\t\tcachedSkipped: undefined,\n\t};\n}\n\nfunction formatDuration(ms: number): string {\n\tconst totalSeconds = Math.floor(Math.max(0, ms) / 1000);\n\tif (totalSeconds < 1) {\n\t\treturn \"<1s\";\n\t}\n\n\tconst seconds = totalSeconds % 60;\n\tconst totalMinutes = Math.floor(totalSeconds / 60);\n\tif (totalMinutes < 1) {\n\t\treturn `${seconds}s`;\n\t}\n\n\tconst minutes = totalMinutes % 60;\n\tconst hours = Math.floor(totalMinutes / 60);\n\tif (hours < 1) {\n\t\treturn seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;\n\t}\n\n\treturn minutes === 0 ? `${hours}h` : `${hours}h ${minutes}m`;\n}\n\nfunction highlightBashCommand(command: string): string {\n\treturn highlightCode(replaceTabs(normalizeDisplayText(command)), \"bash\").join(\"\\n\");\n}\n\nfunction formatBashCall(args: { command?: string; timeout?: number } | undefined): string {\n\tconst command = str(args?.command);\n\tconst timeout = args?.timeout as number | undefined;\n\tconst timeoutSuffix = timeout ? theme.fg(\"muted\", ` (timeout ${timeout}s)`) : \"\";\n\tconst commandDisplay =\n\t\tcommand === null\n\t\t\t? invalidArgText(theme)\n\t\t\t: command\n\t\t\t\t? highlightBashCommand(command)\n\t\t\t\t: theme.fg(\"toolOutput\", \"...\");\n\treturn theme.fg(\"toolTitle\", theme.bold(\"$ \")) + commandDisplay + timeoutSuffix;\n}\n\nfunction rebuildBashResultRenderComponent(\n\tcomponent: BashResultRenderComponent,\n\tresult: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tdetails?: BashToolDetails;\n\t},\n\toptions: ToolRenderResultOptions,\n\tshowImages: boolean,\n\tstartedAt: number | undefined,\n\tendedAt: number | undefined,\n): void {\n\tconst state = component.state;\n\tcomponent.detachAll();\n\n\tlet output = getTextOutput(result, showImages).trim();\n\tconst truncation = result.details?.truncation;\n\tconst fullOutputPath = result.details?.fullOutputPath;\n\tif (!options.isPartial && truncation?.truncated && fullOutputPath && output.endsWith(\"]\")) {\n\t\tconst footerStart = output.lastIndexOf(\"\\n\\n[\");\n\t\tif (footerStart !== -1 && output.slice(footerStart).includes(fullOutputPath)) {\n\t\t\toutput = output.slice(0, footerStart).trimEnd();\n\t\t}\n\t}\n\n\tif (output) {\n\t\tconst styledOutput = output\n\t\t\t.split(\"\\n\")\n\t\t\t.map((line) => theme.fg(\"toolOutput\", line))\n\t\t\t.join(\"\\n\");\n\n\t\tif (options.expanded) {\n\t\t\tcomponent.addChild(new Text(`\\n${styledOutput}`, 0, 0));\n\t\t} else {\n\t\t\tcomponent.addChild({\n\t\t\t\trender: (width: number) => {\n\t\t\t\t\tif (state.cachedLines === undefined || state.cachedWidth !== width) {\n\t\t\t\t\t\tconst preview = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);\n\t\t\t\t\t\tstate.cachedLines = preview.visualLines;\n\t\t\t\t\t\tstate.cachedSkipped = preview.skippedCount;\n\t\t\t\t\t\tstate.cachedWidth = width;\n\t\t\t\t\t}\n\t\t\t\t\tif (state.cachedSkipped && state.cachedSkipped > 0) {\n\t\t\t\t\t\tconst hint =\n\t\t\t\t\t\t\ttheme.fg(\"muted\", `... (${state.cachedSkipped} earlier lines,`) +\n\t\t\t\t\t\t\t` ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t\t\t\t\treturn [\"\", truncateToWidth(hint, width, \"...\"), ...(state.cachedLines ?? [])];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\"\", ...(state.cachedLines ?? [])];\n\t\t\t\t},\n\t\t\t\tinvalidate: () => {\n\t\t\t\t\tstate.cachedWidth = undefined;\n\t\t\t\t\tstate.cachedLines = undefined;\n\t\t\t\t\tstate.cachedSkipped = undefined;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tif (truncation?.truncated || fullOutputPath) {\n\t\tconst warnings: string[] = [];\n\t\tif (fullOutputPath) {\n\t\t\twarnings.push(`Full output: ${fullOutputPath}`);\n\t\t}\n\t\tif (truncation?.truncated) {\n\t\t\tif (truncation.truncatedBy === \"lines\") {\n\t\t\t\twarnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);\n\t\t\t} else {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tcomponent.addChild(new Text(`\\n${theme.fg(\"warning\", `[${warnings.join(\". \")}]`)}`, 0, 0));\n\t}\n\n\tif (startedAt !== undefined) {\n\t\tconst label = options.isPartial ? \"Elapsed\" : \"Took\";\n\t\tconst endTime = endedAt ?? Date.now();\n\t\tcomponent.addChild(new Text(`\\n${theme.fg(\"muted\", `${label} ${formatDuration(endTime - startedAt)}`)}`, 0, 0));\n\t}\n}\n\nexport function createBashToolDefinition(\n\tcwd: string,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\tconst ops = options?.operations ?? createLocalBashOperations({ shellPath: options?.shellPath });\n\tconst commandPrefix = options?.commandPrefix;\n\tconst exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;\n\tconst spawnHook = options?.spawnHook;\n\treturn {\n\t\tname: \"bash\",\n\t\tlabel: \"bash\",\n\t\tdescription: `Execute a bash command in the current working directory. Returns stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,\n\t\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: exposeSessionEnvironment ? [...bashToolSystemPromptContribution.guidelines] : undefined,\n\t\tparameters: bashSchema,\n\t\tconstrainedSampling: getExperimentalToolSampling(),\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ command, timeout }: { command: string; timeout?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t\tonUpdate?,\n\t\t\tctx?,\n\t\t) {\n\t\t\tconst resolvedCommand = commandPrefix ? `${commandPrefix}\\n${command}` : command;\n\t\t\tconst spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook, exposeSessionEnvironment, ctx);\n\t\t\tconst output = new OutputAccumulator({ tempFilePrefix: \"pi-bash\" });\n\t\t\tlet acceptingOutput = true;\n\t\t\tlet updateTimer: NodeJS.Timeout | undefined;\n\t\t\tlet updateDirty = false;\n\t\t\tlet lastUpdateAt = 0;\n\n\t\t\tconst emitOutputUpdate = () => {\n\t\t\t\tif (!onUpdate || !updateDirty) return;\n\t\t\t\tupdateDirty = false;\n\t\t\t\tlastUpdateAt = Date.now();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tonUpdate({\n\t\t\t\t\tcontent: [{ type: \"text\", text: snapshot.content || \"\" }],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\ttruncation: snapshot.truncation.truncated ? snapshot.truncation : undefined,\n\t\t\t\t\t\tfullOutputPath: snapshot.fullOutputPath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst clearUpdateTimer = () => {\n\t\t\t\tif (updateTimer) {\n\t\t\t\t\tclearTimeout(updateTimer);\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst scheduleOutputUpdate = () => {\n\t\t\t\tif (!onUpdate) return;\n\t\t\t\tupdateDirty = true;\n\t\t\t\tconst delay = BASH_UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);\n\t\t\t\tif (delay <= 0) {\n\t\t\t\t\tclearUpdateTimer();\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateTimer ??= setTimeout(() => {\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t}, delay);\n\t\t\t};\n\n\t\t\tif (onUpdate) {\n\t\t\t\tonUpdate({ content: [], details: undefined });\n\t\t\t}\n\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\tif (!acceptingOutput) return;\n\t\t\t\toutput.append(data);\n\t\t\t\tscheduleOutputUpdate();\n\t\t\t};\n\n\t\t\tconst finishOutput = async () => {\n\t\t\t\tacceptingOutput = false;\n\t\t\t\toutput.finish();\n\t\t\t\tclearUpdateTimer();\n\t\t\t\temitOutputUpdate();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tawait output.closeTempFile();\n\t\t\t\treturn snapshot;\n\t\t\t};\n\n\t\t\tconst formatOutput = (snapshot: Awaited<ReturnType<typeof finishOutput>>, emptyText = \"(no output)\") => {\n\t\t\t\tconst truncation = snapshot.truncation;\n\t\t\t\tlet text = snapshot.content || emptyText;\n\t\t\t\tlet details: BashToolDetails | undefined;\n\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\tdetails = { truncation, fullOutputPath: snapshot.fullOutputPath };\n\t\t\t\t\tconst startLine = truncation.totalLines - truncation.outputLines + 1;\n\t\t\t\t\tconst endLine = truncation.totalLines;\n\t\t\t\t\tif (truncation.lastLinePartial) {\n\t\t\t\t\t\tconst lastLineSize = formatSize(output.getLastLineBytes());\n\t\t\t\t\t\ttext += `\\n\\n[Showing last ${formatSize(truncation.outputBytes)} of line ${endLine} (line is ${lastLineSize}). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { text, details };\n\t\t\t};\n\n\t\t\tconst appendStatus = (text: string, status: string) => `${text ? `${text}\\n\\n` : \"\"}${status}`;\n\n\t\t\ttry {\n\t\t\t\tlet exitCode: number | null;\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await ops.exec(spawnContext.command, spawnContext.cwd, {\n\t\t\t\t\t\tonData: handleData,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tenv: spawnContext.env,\n\t\t\t\t\t});\n\t\t\t\t\texitCode = result.exitCode;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\t\tconst { text } = formatOutput(snapshot, \"\");\n\t\t\t\t\tif (err instanceof Error && err.message === \"aborted\") {\n\t\t\t\t\t\tthrow new Error(appendStatus(text, \"Command aborted\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (err instanceof Error && err.message.startsWith(\"timeout:\")) {\n\t\t\t\t\t\tconst timeoutSecs = err.message.split(\":\")[1];\n\t\t\t\t\t\tthrow new Error(appendStatus(text, `Command timed out after ${timeoutSecs} seconds`));\n\t\t\t\t\t}\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\tconst { text: outputText, details } = formatOutput(snapshot);\n\t\t\t\tif (exitCode !== 0 && exitCode !== null) {\n\t\t\t\t\tthrow new Error(appendStatus(outputText, `Command exited with code ${exitCode}`));\n\t\t\t\t}\n\t\t\t\treturn { content: [{ type: \"text\", text: outputText }], details };\n\t\t\t} finally {\n\t\t\t\tclearUpdateTimer();\n\t\t\t}\n\t\t},\n\t\trenderCall(args, _theme, context) {\n\t\t\tconst state = context.state;\n\t\t\tif (context.executionStarted && state.startedAt === undefined) {\n\t\t\t\tstate.startedAt = Date.now();\n\t\t\t\tstate.endedAt = undefined;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(formatBashCall(args));\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, options, _theme, context) {\n\t\t\tconst state = context.state;\n\t\t\tif (state.startedAt !== undefined && options.isPartial && !state.interval) {\n\t\t\t\tstate.interval = setInterval(() => context.invalidate(), 1000);\n\t\t\t}\n\t\t\tif (!options.isPartial || context.isError) {\n\t\t\t\tstate.endedAt ??= Date.now();\n\t\t\t\tif (state.interval) {\n\t\t\t\t\tclearInterval(state.interval);\n\t\t\t\t\tstate.interval = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as BashResultRenderComponent | undefined) ?? new BashResultRenderComponent();\n\t\t\trebuildBashResultRenderComponent(\n\t\t\t\tcomponent,\n\t\t\t\tresult,\n\t\t\t\toptions,\n\t\t\t\tcontext.showImages,\n\t\t\t\tstate.startedAt,\n\t\t\t\tstate.endedAt,\n\t\t\t);\n\t\t\tcomponent.invalidate();\n\t\t\treturn component;\n\t\t},\n\t};\n}\n\nexport function createBashTool(cwd: string, options?: BashToolOptions): AgentTool<typeof bashSchema> {\n\tconst definition = createBashToolDefinition(cwd, options);\n\tconst tool = wrapToolDefinition(definition);\n\tObject.assign(tool, {\n\t\tpromptSnippet: definition.promptSnippet,\n\t\tpromptGuidelines: definition.promptGuidelines,\n\t});\n\treturn tool;\n}\n"]}
1
+ {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/core/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,eAAe,EAEf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,mBAAmB,C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AC,QAAQ,GAAG,SAAS,CAAC;gBAC5B,CAAC;YACF,CAAC;YACD,MAAM,SAAS,GACb,OAAO,CAAC,aAAuD,IAAI,IAAI,yBAAyB,EAAE,CAAC;YACrG,gCAAgC,CAC/B,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,CAAC,UAAU,EAClB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,OAAO,CACb,CAAC;YACF,SAAS,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QAClB,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAoB;IACvC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,GAAG;IACX,aAAa,EAAE,gCAAgC,CAAC,OAAO;IACvD,gBAAgB,EAAE,gCAAgC,CAAC,UAAU;IAC7D,cAAc,EAAE,SAAS;CACzB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CACvC,GAAW,EACX,OAAyB;IAEzB,OAAO,yBAAyB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAyB;IACpE,MAAM,UAAU,GAAG,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QACnB,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;KAC7C,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport { access as fsAccess } from \"node:fs/promises\";\nimport type { AgentTool } from \"@earendil-works/pi-agent-core\";\nimport { Container, Text, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { spawn } from \"child_process\";\nimport { type Static, Type } from \"typebox\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport { truncateToVisualLines } from \"../../modes/interactive/components/visual-truncate.ts\";\nimport { highlightCode, theme } from \"../../modes/interactive/theme/theme.ts\";\nimport { waitForChildProcess } from \"../../utils/child-process.ts\";\nimport {\n\tgetShellConfig,\n\tgetShellEnv,\n\tkillProcessTree,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n\tuntrackDetachedChildPid,\n} from \"../../utils/shell.ts\";\nimport { getExperimentalToolSampling } from \"../experimental.ts\";\nimport type { ExtensionContext, ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.ts\";\nimport { OutputAccumulator } from \"./output-accumulator.ts\";\nimport { getTextOutput, invalidArgText, normalizeDisplayText, replaceTabs, str } from \"./render-utils.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\nimport { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationResult } from \"./truncate.ts\";\n\nconst MAX_TIMEOUT_MS = 2_147_483_647;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\n\nfunction resolveTimeoutMs(timeout: number | undefined): number | undefined {\n\tif (timeout === undefined) return undefined;\n\tif (!Number.isFinite(timeout) || timeout <= 0) {\n\t\tthrow new Error(\"Invalid timeout: must be a finite number of seconds\");\n\t}\n\n\tconst timeoutMs = timeout * 1000;\n\tif (timeoutMs > MAX_TIMEOUT_MS) {\n\t\tthrow new Error(`Invalid timeout: maximum is ${MAX_TIMEOUT_SECONDS} seconds`);\n\t}\n\treturn timeoutMs;\n}\n\nconst bashSchema = Type.Object({\n\tcommand: Type.String({ description: \"Shell command to execute\" }),\n\ttimeout: Type.Optional(Type.Number({ description: \"Timeout in seconds (optional, no default timeout)\" })),\n});\n\nexport const bashToolSystemPromptContribution = {\n\tsnippet: \"Execute bash commands (ls, rg, find, etc.)\",\n\tguidelines: [\"You can inspect PI_* environment variables for current model and session details.\"],\n} as const;\n\nexport type BashToolInput = Static<typeof bashSchema>;\n\nexport interface BashToolDetails {\n\ttruncation?: TruncationResult;\n\tfullOutputPath?: string;\n}\n\n/**\n * Pluggable operations for the bash tool.\n * Override these to delegate command execution to remote systems (for example SSH).\n */\nexport interface BashOperations {\n\t/**\n\t * Execute a command and stream output.\n\t * @param command The command to execute\n\t * @param cwd Working directory\n\t * @param options Execution options\n\t * @returns Promise resolving to exit code (null if killed)\n\t */\n\texec: (\n\t\tcommand: string,\n\t\tcwd: string,\n\t\toptions: {\n\t\t\tonData: (data: Buffer) => void;\n\t\t\tsignal?: AbortSignal;\n\t\t\ttimeout?: number;\n\t\t\tenv?: NodeJS.ProcessEnv;\n\t\t},\n\t) => Promise<{ exitCode: number | null }>;\n}\n\n/** Shared process execution used by the built-in shell tools. */\nexport function createLocalShellOperations(shellName: string, resolveShellConfig: () => ShellConfig): BashOperations {\n\treturn {\n\t\texec: async (command, cwd, { onData, signal, timeout, env }) => {\n\t\t\tconst timeoutMs = resolveTimeoutMs(timeout);\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t}\n\t\t\tconst shellConfig = resolveShellConfig();\n\t\t\ttry {\n\t\t\t\tawait fsAccess(cwd, constants.F_OK);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(`Working directory does not exist: ${cwd}\\nCannot execute ${shellName} commands.`);\n\t\t\t}\n\n\t\t\tconst commandFromStdin = shellConfig.commandTransport === \"stdin\";\n\t\t\tconst child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {\n\t\t\t\tcwd,\n\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\tenv: env ?? getShellEnv(),\n\t\t\t\tstdio: [commandFromStdin ? \"pipe\" : \"ignore\", \"pipe\", \"pipe\"],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t\tif (commandFromStdin) {\n\t\t\t\tchild.stdin?.on(\"error\", () => {});\n\t\t\t\tchild.stdin?.end(command);\n\t\t\t}\n\t\t\tif (child.pid) trackDetachedChildPid(child.pid);\n\t\t\tlet timedOut = false;\n\t\t\tlet timeoutHandle: NodeJS.Timeout | undefined;\n\t\t\t// Fires once the process tree has been killed so waitForChildProcess\n\t\t\t// stops preserving output tails; descendants that survive the group\n\t\t\t// kill must not keep the aborted command running forever.\n\t\t\tconst killedController = new AbortController();\n\t\t\tconst onAbort = () => {\n\t\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t\t\tkilledController.abort();\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\t// Set timeout if provided.\n\t\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\t\ttimeoutHandle = setTimeout(() => {\n\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\tonAbort();\n\t\t\t\t\t}, timeoutMs);\n\t\t\t\t}\n\t\t\t\t// Stream stdout and stderr.\n\t\t\t\tchild.stdout?.on(\"data\", onData);\n\t\t\t\tchild.stderr?.on(\"data\", onData);\n\t\t\t\t// Handle abort signal by killing the entire process tree.\n\t\t\t\tif (signal) {\n\t\t\t\t\tif (signal.aborted) onAbort();\n\t\t\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t\t// Handle shell spawn errors and wait for the process to terminate without hanging\n\t\t\t\t// on inherited stdio handles held by detached descendants.\n\t\t\t\tconst exitCode = await waitForChildProcess(child, { signal: killedController.signal });\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t\t}\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tthrow new Error(`timeout:${timeout}`);\n\t\t\t\t}\n\t\t\t\treturn { exitCode };\n\t\t\t} finally {\n\t\t\t\tconst pid = child.pid;\n\t\t\t\tif (pid !== undefined) {\n\t\t\t\t\tif (child.exitCode !== null || child.signalCode !== null) {\n\t\t\t\t\t\tuntrackDetachedChildPid(pid);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// The kill grace released the wait while the child is still\n\t\t\t\t\t\t// alive (kill pending): keep it tracked so shutdown cleanup\n\t\t\t\t\t\t// retries, and unref it so it cannot pin the event loop.\n\t\t\t\t\t\tchild.unref();\n\t\t\t\t\t\tchild.once(\"exit\", () => untrackDetachedChildPid(pid));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (timeoutHandle) clearTimeout(timeoutHandle);\n\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Create bash operations using pi's built-in local shell execution backend.\n *\n * This is useful for extensions that intercept user_bash and still want pi's\n * standard local shell behavior while wrapping or rewriting commands.\n */\nexport function createLocalBashOperations(options?: { shellPath?: string }): BashOperations {\n\treturn createLocalShellOperations(\"bash\", () => getShellConfig(options?.shellPath));\n}\n\nexport interface BashSpawnContext {\n\tcommand: string;\n\tcwd: string;\n\tenv: NodeJS.ProcessEnv;\n}\n\nexport type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext;\n\nfunction resolveSpawnContext(\n\tcommand: string,\n\tcwd: string,\n\tspawnHook: BashSpawnHook | undefined,\n\texposeSessionEnvironment: boolean,\n\tctx: ExtensionContext | undefined,\n): BashSpawnContext {\n\tconst env = { ...getShellEnv() };\n\tdelete env.PI_SESSION_ID;\n\tdelete env.PI_SESSION_FILE;\n\tdelete env.PI_PROVIDER;\n\tdelete env.PI_MODEL;\n\tdelete env.PI_REASONING_LEVEL;\n\tif (exposeSessionEnvironment && ctx) {\n\t\tconst model = ctx.model;\n\t\tenv.PI_SESSION_ID = ctx.sessionManager.getSessionId();\n\t\tconst sessionFile = ctx.sessionManager.getSessionFile();\n\t\tif (sessionFile) env.PI_SESSION_FILE = sessionFile;\n\t\tif (model) {\n\t\t\tenv.PI_PROVIDER = model.provider;\n\t\t\tenv.PI_MODEL = model.id;\n\t\t}\n\t\tif (ctx.thinkingLevel) env.PI_REASONING_LEVEL = ctx.thinkingLevel;\n\t}\n\tconst baseContext: BashSpawnContext = { command, cwd, env };\n\treturn spawnHook ? spawnHook(baseContext) : baseContext;\n}\n\nexport interface BashToolOptions {\n\t/** Custom operations for command execution. Default: local shell */\n\toperations?: BashOperations;\n\t/** Command prefix prepended to every command (for example shell setup commands) */\n\tcommandPrefix?: string;\n\t/** Optional explicit shell path from settings */\n\tshellPath?: string;\n\t/** Expose current Pi session metadata as PI_* environment variables. Default: true */\n\texposeSessionEnvironment?: boolean;\n\t/** Hook to adjust command, cwd, or env before execution */\n\tspawnHook?: BashSpawnHook;\n}\n\nconst BASH_PREVIEW_LINES = 5;\nconst BASH_UPDATE_THROTTLE_MS = 100;\n\nexport type BashRenderState = {\n\tstartedAt: number | undefined;\n\tendedAt: number | undefined;\n\tinterval: NodeJS.Timeout | undefined;\n};\n\ntype BashResultRenderState = {\n\tcachedWidth: number | undefined;\n\tcachedLines: string[] | undefined;\n\tcachedSkipped: number | undefined;\n};\n\nclass BashResultRenderComponent extends Container {\n\tstate: BashResultRenderState = {\n\t\tcachedWidth: undefined,\n\t\tcachedLines: undefined,\n\t\tcachedSkipped: undefined,\n\t};\n}\n\nfunction formatDuration(ms: number): string {\n\tconst totalSeconds = Math.floor(Math.max(0, ms) / 1000);\n\tif (totalSeconds < 1) {\n\t\treturn \"<1s\";\n\t}\n\n\tconst seconds = totalSeconds % 60;\n\tconst totalMinutes = Math.floor(totalSeconds / 60);\n\tif (totalMinutes < 1) {\n\t\treturn `${seconds}s`;\n\t}\n\n\tconst minutes = totalMinutes % 60;\n\tconst hours = Math.floor(totalMinutes / 60);\n\tif (hours < 1) {\n\t\treturn seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;\n\t}\n\n\treturn minutes === 0 ? `${hours}h` : `${hours}h ${minutes}m`;\n}\n\nfunction highlightBashCommand(command: string): string {\n\treturn highlightCode(replaceTabs(normalizeDisplayText(command)), \"bash\").join(\"\\n\");\n}\n\nfunction formatShellCall(args: { command?: string; timeout?: number } | undefined, _prompt: string): string {\n\tconst command = str(args?.command);\n\tconst timeout = args?.timeout as number | undefined;\n\tconst timeoutSuffix = timeout ? theme.fg(\"muted\", ` (timeout ${timeout}s)`) : \"\";\n\tconst commandDisplay =\n\t\tcommand === null\n\t\t\t? invalidArgText(theme)\n\t\t\t: command\n\t\t\t\t? highlightBashCommand(command)\n\t\t\t\t: theme.fg(\"toolOutput\", \"...\");\n\treturn theme.fg(\"toolTitle\", theme.bold(\"$ \")) + commandDisplay + timeoutSuffix;\n}\n\nfunction rebuildBashResultRenderComponent(\n\tcomponent: BashResultRenderComponent,\n\tresult: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tdetails?: BashToolDetails;\n\t},\n\toptions: ToolRenderResultOptions,\n\tshowImages: boolean,\n\tstartedAt: number | undefined,\n\tendedAt: number | undefined,\n): void {\n\tconst state = component.state;\n\tcomponent.detachAll();\n\n\tlet output = getTextOutput(result, showImages).trim();\n\tconst truncation = result.details?.truncation;\n\tconst fullOutputPath = result.details?.fullOutputPath;\n\tif (!options.isPartial && truncation?.truncated && fullOutputPath && output.endsWith(\"]\")) {\n\t\tconst footerStart = output.lastIndexOf(\"\\n\\n[\");\n\t\tif (footerStart !== -1 && output.slice(footerStart).includes(fullOutputPath)) {\n\t\t\toutput = output.slice(0, footerStart).trimEnd();\n\t\t}\n\t}\n\n\tif (output) {\n\t\tconst styledOutput = output\n\t\t\t.split(\"\\n\")\n\t\t\t.map((line) => theme.fg(\"toolOutput\", line))\n\t\t\t.join(\"\\n\");\n\n\t\tif (options.expanded) {\n\t\t\tcomponent.addChild(new Text(`\\n${styledOutput}`, 0, 0));\n\t\t} else {\n\t\t\tcomponent.addChild({\n\t\t\t\trender: (width: number) => {\n\t\t\t\t\tif (state.cachedLines === undefined || state.cachedWidth !== width) {\n\t\t\t\t\t\tconst preview = truncateToVisualLines(styledOutput, BASH_PREVIEW_LINES, width);\n\t\t\t\t\t\tstate.cachedLines = preview.visualLines;\n\t\t\t\t\t\tstate.cachedSkipped = preview.skippedCount;\n\t\t\t\t\t\tstate.cachedWidth = width;\n\t\t\t\t\t}\n\t\t\t\t\tif (state.cachedSkipped && state.cachedSkipped > 0) {\n\t\t\t\t\t\tconst hint =\n\t\t\t\t\t\t\ttheme.fg(\"muted\", `... (${state.cachedSkipped} earlier lines,`) +\n\t\t\t\t\t\t\t` ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t\t\t\t\treturn [\"\", truncateToWidth(hint, width, \"...\"), ...(state.cachedLines ?? [])];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\"\", ...(state.cachedLines ?? [])];\n\t\t\t\t},\n\t\t\t\tinvalidate: () => {\n\t\t\t\t\tstate.cachedWidth = undefined;\n\t\t\t\t\tstate.cachedLines = undefined;\n\t\t\t\t\tstate.cachedSkipped = undefined;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tif (truncation?.truncated || fullOutputPath) {\n\t\tconst warnings: string[] = [];\n\t\tif (fullOutputPath) {\n\t\t\twarnings.push(`Full output: ${fullOutputPath}`);\n\t\t}\n\t\tif (truncation?.truncated) {\n\t\t\tif (truncation.truncatedBy === \"lines\") {\n\t\t\t\twarnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);\n\t\t\t} else {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`Truncated: ${truncation.outputLines} lines shown (${formatSize(truncation.maxBytes ?? DEFAULT_MAX_BYTES)} limit)`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tcomponent.addChild(new Text(`\\n${theme.fg(\"warning\", `[${warnings.join(\". \")}]`)}`, 0, 0));\n\t}\n\n\tif (startedAt !== undefined) {\n\t\tconst label = options.isPartial ? \"Elapsed\" : \"Took\";\n\t\tconst endTime = endedAt ?? Date.now();\n\t\tcomponent.addChild(new Text(`\\n${theme.fg(\"muted\", `${label} ${formatDuration(endTime - startedAt)}`)}`, 0, 0));\n\t}\n}\n\nexport interface ShellToolConfig {\n\tname: string;\n\tlabel: string;\n\tshellName: string;\n\tprompt: string;\n\tpromptSnippet: string;\n\tpromptGuidelines?: readonly string[];\n\ttempFilePrefix: string;\n}\n\nexport function createShellToolDefinition(\n\tcwd: string,\n\tconfig: ShellToolConfig,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\tconst ops = options?.operations ?? createLocalBashOperations({ shellPath: options?.shellPath });\n\tconst commandPrefix = options?.commandPrefix;\n\tconst exposeSessionEnvironment = options?.exposeSessionEnvironment ?? true;\n\tconst spawnHook = options?.spawnHook;\n\treturn {\n\t\tname: config.name,\n\t\tlabel: config.label,\n\t\tdescription: `Execute a ${config.shellName} command in the current working directory. Returns stdout and stderr. Output is truncated to last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first). If truncated, full output is saved to a temp file. Optionally provide a timeout in seconds.`,\n\t\tpromptSnippet: config.promptSnippet,\n\t\tpromptGuidelines: exposeSessionEnvironment && config.promptGuidelines ? [...config.promptGuidelines] : undefined,\n\t\tparameters: bashSchema,\n\t\tconstrainedSampling: getExperimentalToolSampling(),\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ command, timeout }: { command: string; timeout?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t\tonUpdate?,\n\t\t\tctx?,\n\t\t) {\n\t\t\tconst resolvedCommand = commandPrefix ? `${commandPrefix}\\n${command}` : command;\n\t\t\tconst spawnContext = resolveSpawnContext(resolvedCommand, cwd, spawnHook, exposeSessionEnvironment, ctx);\n\t\t\tconst output = new OutputAccumulator({ tempFilePrefix: config.tempFilePrefix });\n\t\t\tlet acceptingOutput = true;\n\t\t\tlet updateTimer: NodeJS.Timeout | undefined;\n\t\t\tlet updateDirty = false;\n\t\t\tlet lastUpdateAt = 0;\n\n\t\t\tconst emitOutputUpdate = () => {\n\t\t\t\tif (!onUpdate || !updateDirty) return;\n\t\t\t\tupdateDirty = false;\n\t\t\t\tlastUpdateAt = Date.now();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tonUpdate({\n\t\t\t\t\tcontent: [{ type: \"text\", text: snapshot.content || \"\" }],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\ttruncation: snapshot.truncation.truncated ? snapshot.truncation : undefined,\n\t\t\t\t\t\tfullOutputPath: snapshot.fullOutputPath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst clearUpdateTimer = () => {\n\t\t\t\tif (updateTimer) {\n\t\t\t\t\tclearTimeout(updateTimer);\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst scheduleOutputUpdate = () => {\n\t\t\t\tif (!onUpdate) return;\n\t\t\t\tupdateDirty = true;\n\t\t\t\tconst delay = BASH_UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);\n\t\t\t\tif (delay <= 0) {\n\t\t\t\t\tclearUpdateTimer();\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tupdateTimer ??= setTimeout(() => {\n\t\t\t\t\tupdateTimer = undefined;\n\t\t\t\t\temitOutputUpdate();\n\t\t\t\t}, delay);\n\t\t\t};\n\n\t\t\tif (onUpdate) {\n\t\t\t\tonUpdate({ content: [], details: undefined });\n\t\t\t}\n\n\t\t\tconst handleData = (data: Buffer) => {\n\t\t\t\tif (!acceptingOutput) return;\n\t\t\t\toutput.append(data);\n\t\t\t\tscheduleOutputUpdate();\n\t\t\t};\n\n\t\t\tconst finishOutput = async () => {\n\t\t\t\tacceptingOutput = false;\n\t\t\t\toutput.finish();\n\t\t\t\tclearUpdateTimer();\n\t\t\t\temitOutputUpdate();\n\t\t\t\tconst snapshot = output.snapshot({ persistIfTruncated: true });\n\t\t\t\tawait output.closeTempFile();\n\t\t\t\treturn snapshot;\n\t\t\t};\n\n\t\t\tconst formatOutput = (snapshot: Awaited<ReturnType<typeof finishOutput>>, emptyText = \"(no output)\") => {\n\t\t\t\tconst truncation = snapshot.truncation;\n\t\t\t\tlet text = snapshot.content || emptyText;\n\t\t\t\tlet details: BashToolDetails | undefined;\n\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\tdetails = { truncation, fullOutputPath: snapshot.fullOutputPath };\n\t\t\t\t\tconst startLine = truncation.totalLines - truncation.outputLines + 1;\n\t\t\t\t\tconst endLine = truncation.totalLines;\n\t\t\t\t\tif (truncation.lastLinePartial) {\n\t\t\t\t\t\tconst lastLineSize = formatSize(output.getLastLineBytes());\n\t\t\t\t\t\ttext += `\\n\\n[Showing last ${formatSize(truncation.outputBytes)} of line ${endLine} (line is ${lastLineSize}). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else if (truncation.truncatedBy === \"lines\") {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttext += `\\n\\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Full output: ${snapshot.fullOutputPath}]`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { text, details };\n\t\t\t};\n\n\t\t\tconst appendStatus = (text: string, status: string) => `${text ? `${text}\\n\\n` : \"\"}${status}`;\n\n\t\t\ttry {\n\t\t\t\tlet exitCode: number | null;\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await ops.exec(spawnContext.command, spawnContext.cwd, {\n\t\t\t\t\t\tonData: handleData,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\ttimeout,\n\t\t\t\t\t\tenv: spawnContext.env,\n\t\t\t\t\t});\n\t\t\t\t\texitCode = result.exitCode;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\t\tconst { text } = formatOutput(snapshot, \"\");\n\t\t\t\t\tif (err instanceof Error && err.message === \"aborted\") {\n\t\t\t\t\t\tthrow new Error(appendStatus(text, \"Command aborted\"));\n\t\t\t\t\t}\n\t\t\t\t\tif (err instanceof Error && err.message.startsWith(\"timeout:\")) {\n\t\t\t\t\t\tconst timeoutSecs = err.message.split(\":\")[1];\n\t\t\t\t\t\tthrow new Error(appendStatus(text, `Command timed out after ${timeoutSecs} seconds`));\n\t\t\t\t\t}\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\n\t\t\t\tconst snapshot = await finishOutput();\n\t\t\t\tconst { text: outputText, details } = formatOutput(snapshot);\n\t\t\t\tif (exitCode !== 0 && exitCode !== null) {\n\t\t\t\t\tthrow new Error(appendStatus(outputText, `Command exited with code ${exitCode}`));\n\t\t\t\t}\n\t\t\t\treturn { content: [{ type: \"text\", text: outputText }], details };\n\t\t\t} finally {\n\t\t\t\tclearUpdateTimer();\n\t\t\t}\n\t\t},\n\t\trenderCall(args, _theme, context) {\n\t\t\tconst state = context.state;\n\t\t\tif (context.executionStarted && state.startedAt === undefined) {\n\t\t\t\tstate.startedAt = Date.now();\n\t\t\t\tstate.endedAt = undefined;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(formatShellCall(args, config.prompt));\n\t\t\treturn text;\n\t\t},\n\t\trenderResult(result, options, _theme, context) {\n\t\t\tconst state = context.state;\n\t\t\tif (state.startedAt !== undefined && options.isPartial && !state.interval) {\n\t\t\t\tstate.interval = setInterval(() => context.invalidate(), 1000);\n\t\t\t}\n\t\t\tif (!options.isPartial || context.isError) {\n\t\t\t\tstate.endedAt ??= Date.now();\n\t\t\t\tif (state.interval) {\n\t\t\t\t\tclearInterval(state.interval);\n\t\t\t\t\tstate.interval = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as BashResultRenderComponent | undefined) ?? new BashResultRenderComponent();\n\t\t\trebuildBashResultRenderComponent(\n\t\t\t\tcomponent,\n\t\t\t\tresult,\n\t\t\t\toptions,\n\t\t\t\tcontext.showImages,\n\t\t\t\tstate.startedAt,\n\t\t\t\tstate.endedAt,\n\t\t\t);\n\t\t\tcomponent.invalidate();\n\t\t\treturn component;\n\t\t},\n\t};\n}\n\nconst bashToolConfig: ShellToolConfig = {\n\tname: \"bash\",\n\tlabel: \"bash\",\n\tshellName: \"bash\",\n\tprompt: \"$\",\n\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\tpromptGuidelines: bashToolSystemPromptContribution.guidelines,\n\ttempFilePrefix: \"pi-bash\",\n};\n\nexport function createBashToolDefinition(\n\tcwd: string,\n\toptions?: BashToolOptions,\n): ToolDefinition<typeof bashSchema, BashToolDetails | undefined, BashRenderState> {\n\treturn createShellToolDefinition(cwd, bashToolConfig, options);\n}\n\nexport function createBashTool(cwd: string, options?: BashToolOptions): AgentTool<typeof bashSchema> {\n\tconst definition = createBashToolDefinition(cwd, options);\n\tconst tool = wrapToolDefinition(definition);\n\tObject.assign(tool, {\n\t\tpromptSnippet: definition.promptSnippet,\n\t\tpromptGuidelines: definition.promptGuidelines,\n\t});\n\treturn tool;\n}\n"]}
@@ -60,11 +60,6 @@ export interface AppliedEditsResult {
60
60
  * Unicode quotes/dashes normalized to ASCII).
61
61
  */
62
62
  export declare function fuzzyFindText(content: string, oldText: string): FuzzyMatchResult;
63
- /** Strip UTF-8 BOM if present, return both the BOM (if any) and the text without it */
64
- export declare function stripBom(content: string): {
65
- bom: string;
66
- text: string;
67
- };
68
63
  /**
69
64
  * Apply one or more exact-text replacements to LF-normalized content.
70
65
  *
@@ -1 +1 @@
1
- {"version":3,"file":"edit-diff.d.ts","sourceRoot":"","sources":["../../../src/core/tools/edit-diff.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM/D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM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AGG;AACH,wBAAgB,kBAAkB,CACjC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,SAAI,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAuHxD;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,IAAI,EAAE,EACb,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,cAAc,GAAG,aAAa,CAAC,CAyBzC"}
@@ -4,6 +4,7 @@
4
4
  import * as Diff from "diff";
5
5
  import { constants } from "fs";
6
6
  import { access, readFile } from "fs/promises";
7
+ import { splitBom } from "../../utils/text.js";
7
8
  import { resolveToCwd } from "./path-utils.js";
8
9
  import { createUnifiedPatch } from "./unified-diff.js";
9
10
  export function detectLineEnding(content) {
@@ -174,10 +175,6 @@ export function fuzzyFindText(content, oldText) {
174
175
  contentForReplacement: fuzzyContent,
175
176
  };
176
177
  }
177
- /** Strip UTF-8 BOM if present, return both the BOM (if any) and the text without it */
178
- export function stripBom(content) {
179
- return content.startsWith("\uFEFF") ? { bom: "\uFEFF", text: content.slice(1) } : { bom: "", text: content };
180
- }
181
178
  function countOccurrences(content, oldText) {
182
179
  const fuzzyContent = normalizeForFuzzyMatch(content);
183
180
  const fuzzyOldText = normalizeForFuzzyMatch(oldText);
@@ -402,7 +399,7 @@ export async function computeEditsDiff(path, edits, cwd) {
402
399
  // Read the file
403
400
  const rawContent = await readFile(absolutePath, "utf-8");
404
401
  // Strip BOM before matching (LLM won't include invisible BOM in oldText)
405
- const { text: content } = stripBom(rawContent);
402
+ const { text: content } = splitBom(rawContent);
406
403
  const normalizedContent = normalizeToLF(content);
407
404
  const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path);
408
405
  // Generate the diff