@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":"terminal.js","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAC5C,MAAM,iCAAiC,GAAG,gBAAgB,CAAC;AAC3D,MAAM,gCAAgC,GAAG,gBAAgB,CAAC;AAC1D,MAAM,2BAA2B,GAAG,YAAY,CAAC;AACjD,MAAM,qCAAqC,GAAG,CAAC,CAAC;AAChD,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AACxE,uGAAuG;AACvG,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,8CAA8C,GAAG,GAAG,CAAC;AAC3D,MAAM,6BAA6B,GAAG,SAAS,qCAAqC,gBAAgB,CAAC;AAMrG,MAAM,UAAU,wCAAwC,CACvD,QAAgB;IAEhB,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtD,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,EA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AAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["import * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { setKittyProtocolActive } from \"./keys.ts\";\nimport { isNativeModifierPressed } from \"./native-modifiers.ts\";\nimport { StdinBuffer } from \"./stdin-buffer.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nconst TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;\nconst TERMINAL_PROGRESS_ACTIVE_SEQUENCE = \"\\x1b]9;4;3\\x07\";\nconst TERMINAL_PROGRESS_CLEAR_SEQUENCE = \"\\x1b]9;4;0\\x07\";\nconst NATIVE_SHIFT_ENTER_SEQUENCE = \"\\x1b[13;2u\";\nconst DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;\nconst DEAD_TERMINAL_ERROR_CODES = new Set([\"EIO\", \"EPIPE\", \"ENOTCONN\"]);\n// Bun's macOS tty shim can report synchronous ioctl EIO as raw positive errno 5 without a string code.\nconst EIO_ERRNO = 5;\nconst KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;\nconst KITTY_KEYBOARD_PROTOCOL_QUERY = `\\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\\x1b[?u\\x1b[c`;\n\nexport type KeyboardProtocolNegotiationSequence =\n\t| { type: \"kitty-flags\"; flags: number }\n\t| { type: \"device-attributes\" };\n\nexport function parseKeyboardProtocolNegotiationSequence(\n\tsequence: string,\n): KeyboardProtocolNegotiationSequence | undefined {\n\tconst kittyFlags = sequence.match(/^\\x1b\\[\\?(\\d+)u$/);\n\tif (kittyFlags) {\n\t\treturn { type: \"kitty-flags\", flags: Number.parseInt(kittyFlags[1]!, 10) };\n\t}\n\tif (/^\\x1b\\[\\?[\\d;]*c$/.test(sequence)) {\n\t\treturn { type: \"device-attributes\" };\n\t}\n\treturn undefined;\n}\n\nfunction isKeyboardProtocolNegotiationSequencePrefix(sequence: string): boolean {\n\treturn sequence === \"\\x1b[\" || /^\\x1b\\[\\?[\\d;]*$/.test(sequence);\n}\n\nexport function isAppleTerminalSession(): boolean {\n\treturn process.platform === \"darwin\" && process.env.TERM_PROGRAM === \"Apple_Terminal\";\n}\n\nexport function normalizeNativeShiftEnterInput(\n\tdata: string,\n\tshouldDetectNativeShiftEnter: boolean,\n\tisShiftPressed: boolean,\n): string {\n\tif (shouldDetectNativeShiftEnter && data === \"\\r\" && isShiftPressed) return NATIVE_SHIFT_ENTER_SEQUENCE;\n\treturn data;\n}\n\nexport function normalizeAppleTerminalInput(data: string, isAppleTerminal: boolean, isShiftPressed: boolean): string {\n\treturn normalizeNativeShiftEnterInput(data, isAppleTerminal, isShiftPressed);\n}\n\nexport function keyboardEnhancementEnabled(): boolean {\n\tconst value = process.env.PI_TUI_KEYBOARD_PROTOCOL;\n\tif (value === undefined) return true;\n\treturn ![\"0\", \"false\", \"no\", \"off\"].includes(value.toLowerCase());\n}\n\nfunction isDeadTerminalError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tif (\"code\" in error && typeof error.code === \"string\") return DEAD_TERMINAL_ERROR_CODES.has(error.code);\n\treturn \"errno\" in error && error.errno === EIO_ERRNO;\n}\n\n/**\n * Minimal terminal interface for TUI\n */\nexport interface Terminal {\n\t// Start the terminal with input and resize handlers\n\tstart(onInput: (data: string) => void, onResize: () => void): void;\n\n\t// Stop the terminal and restore state\n\tstop(): void;\n\n\t/**\n\t * Drain stdin before exiting to prevent Kitty key release events from\n\t * leaking to the parent shell over slow SSH connections.\n\t * @param maxMs - Maximum time to drain (default: 1000ms)\n\t * @param idleMs - Exit early if no input arrives within this time (default: 50ms)\n\t */\n\tdrainInput(maxMs?: number, idleMs?: number): Promise<void>;\n\n\t// Write output to terminal\n\twrite(data: string): void;\n\n\t// Get terminal dimensions\n\tget columns(): number;\n\tget rows(): number;\n\n\t// Whether Kitty keyboard protocol is active\n\tget kittyProtocolActive(): boolean;\n\n\t// Cursor positioning (relative to current position)\n\tmoveBy(lines: number): void; // Move cursor up (negative) or down (positive) by N lines\n\n\t// Cursor visibility\n\thideCursor(): void; // Hide the cursor\n\tshowCursor(): void; // Show the cursor\n\n\t// Clear operations\n\tclearLine(): void; // Clear current line\n\tclearFromCursor(): void; // Clear from cursor to end of screen\n\tclearScreen(): void; // Clear entire screen and move cursor to (0,0)\n\n\t// Title operations\n\tsetTitle(title: string): void; // Set terminal window title\n\n\t// Progress indicator (OSC 9;4)\n\tsetProgress(active: boolean): void;\n}\n\nexport interface ProcessTerminalOptions {\n\t/**\n\t * When set, stdout writes not issued by this terminal are hidden from the\n\t * screen while the terminal is started and forwarded to this handler\n\t * instead. External writes (console.log, libraries) would otherwise\n\t * interleave with frames and desynchronize differential rendering.\n\t */\n\tonExternalStdoutWrite?: (text: string) => void;\n}\n\nconst DEFAULT_ESCAPE_TIMEOUT_MS = 10;\nconst DEFAULT_SSH_ESCAPE_TIMEOUT_MS = 100;\n\n/**\n * Resolve how long to wait for the rest of an escape sequence before\n * dispatching a lone ESC as the Escape key. Legacy Alt+key input is ESC plus\n * another byte, so high-latency transports need a longer reassembly window.\n */\nexport function resolveEscapeTimeoutMs(env: NodeJS.ProcessEnv = process.env): number {\n\tconst configured = Number(env.PI_TUI_ESC_TIMEOUT);\n\tif (Number.isFinite(configured) && configured > 0) {\n\t\treturn configured;\n\t}\n\tif (env.SSH_CONNECTION || env.SSH_TTY) {\n\t\treturn DEFAULT_SSH_ESCAPE_TIMEOUT_MS;\n\t}\n\treturn DEFAULT_ESCAPE_TIMEOUT_MS;\n}\n\n/**\n * Real terminal using process.stdin/stdout\n */\nexport class ProcessTerminal implements Terminal {\n\tprivate wasRaw = false;\n\tprivate onExternalStdoutWrite?: (text: string) => void;\n\tprivate originalStdoutWrite?: typeof process.stdout.write;\n\tprivate rawStdoutWrite?: (data: string) => void;\n\tprivate forwardingExternalWrite = false;\n\tprivate inputHandler?: (data: string) => void;\n\tprivate resizeHandler?: () => void;\n\tprivate _kittyProtocolActive = false;\n\tprivate _modifyOtherKeysActive = false;\n\tprivate keyboardProtocolPushed = false;\n\tprivate keyboardProtocolNegotiationBuffer = \"\";\n\tprivate keyboardProtocolBufferFlushTimer?: ReturnType<typeof setTimeout>;\n\tprivate stdinBuffer?: StdinBuffer;\n\tprivate stdinDataHandler?: (data: string | Buffer) => void;\n\tprivate progressInterval?: ReturnType<typeof setInterval>;\n\tprivate writeLogPath = (() => {\n\t\tconst env = process.env.PI_TUI_WRITE_LOG || \"\";\n\t\tif (!env) return \"\";\n\t\ttry {\n\t\t\tif (fs.statSync(env).isDirectory()) {\n\t\t\t\tconst now = new Date();\n\t\t\t\tconst ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\n\t\t\t\treturn path.join(env, `tui-${ts}-${process.pid}.log`);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Not an existing directory - use as-is (file path)\n\t\t}\n\t\treturn env;\n\t})();\n\n\tconstructor(options?: ProcessTerminalOptions) {\n\t\tthis.onExternalStdoutWrite = options?.onExternalStdoutWrite;\n\t}\n\n\tget kittyProtocolActive(): boolean {\n\t\treturn this._kittyProtocolActive;\n\t}\n\n\tprivate rawWrite(data: string): void {\n\t\tif (this.rawStdoutWrite) {\n\t\t\tthis.rawStdoutWrite(data);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stdout.write(data);\n\t}\n\n\tprivate installExternalStdoutGuard(): void {\n\t\tconst handler = this.onExternalStdoutWrite;\n\t\tif (!handler || this.originalStdoutWrite) {\n\t\t\treturn;\n\t\t}\n\t\tthis.originalStdoutWrite = process.stdout.write;\n\t\tconst rawWrite = process.stdout.write.bind(process.stdout);\n\t\tthis.rawStdoutWrite = rawWrite;\n\n\t\tprocess.stdout.write = ((\n\t\t\tchunk: string | Uint8Array,\n\t\t\tencodingOrCallback?: BufferEncoding | ((error?: Error | null) => void),\n\t\t\tcallback?: (error?: Error | null) => void,\n\t\t): boolean => {\n\t\t\tconst cb = typeof encodingOrCallback === \"function\" ? encodingOrCallback : callback;\n\t\t\tconst encoding = typeof encodingOrCallback === \"string\" ? encodingOrCallback : undefined;\n\t\t\tconst text = typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(encoding);\n\t\t\tif (this.forwardingExternalWrite) {\n\t\t\t\trawWrite(text);\n\t\t\t\tcb?.(null);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.forwardingExternalWrite = true;\n\t\t\ttry {\n\t\t\t\thandler(text);\n\t\t\t} catch {\n\t\t\t\trawWrite(text);\n\t\t\t} finally {\n\t\t\t\tthis.forwardingExternalWrite = false;\n\t\t\t}\n\t\t\tcb?.(null);\n\t\t\treturn true;\n\t\t}) as typeof process.stdout.write;\n\t}\n\n\tprivate removeExternalStdoutGuard(): void {\n\t\tif (!this.originalStdoutWrite) {\n\t\t\treturn;\n\t\t}\n\t\tprocess.stdout.write = this.originalStdoutWrite;\n\t\tthis.originalStdoutWrite = undefined;\n\t\tthis.rawStdoutWrite = undefined;\n\t}\n\n\tget modifyOtherKeysActive(): boolean {\n\t\treturn this._modifyOtherKeysActive;\n\t}\n\n\tstart(onInput: (data: string) => void, onResize: () => void): void {\n\t\tthis.installExternalStdoutGuard();\n\t\tthis.inputHandler = onInput;\n\t\tthis.resizeHandler = onResize;\n\n\t\t// Save previous state and enable raw mode\n\t\tthis.wasRaw = process.stdin.isRaw || false;\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(true);\n\t\t}\n\t\tprocess.stdin.resume();\n\n\t\t// Enable bracketed paste mode - terminal will wrap pastes in \\x1b[200~ ... \\x1b[201~\n\t\tthis.rawWrite(\"\\x1b[?2004h\");\n\n\t\t// Set up resize handler immediately\n\t\tprocess.stdout.on(\"resize\", this.resizeHandler);\n\n\t\t// Refresh terminal dimensions - they may be stale after suspend/resume\n\t\t// (SIGWINCH is lost while process is stopped). Unix only.\n\t\tif (process.platform !== \"win32\") {\n\t\t\tprocess.kill(process.pid, \"SIGWINCH\");\n\t\t}\n\n\t\t// On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends\n\t\t// VT escape sequences (e.g. \\x1b[Z for Shift+Tab) instead of raw console\n\t\t// events that lose modifier information. Must run AFTER setRawMode(true)\n\t\t// since that resets console mode flags.\n\t\tthis.enableWindowsVTInput();\n\n\t\t// Query Kitty keyboard protocol and fall back to modifyOtherKeys when DA confirms no Kitty response.\n\t\t// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n\t\tthis.queryAndEnableKittyProtocol();\n\t}\n\n\t/**\n\t * Set up StdinBuffer to split batched input into individual sequences.\n\t * This ensures components receive single events, making matchesKey/isKeyRelease work correctly.\n\t *\n\t * Also watches for Kitty protocol response and enables it when detected.\n\t * This is done here (after stdinBuffer parsing) rather than on raw stdin\n\t * to handle the case where the response arrives split across multiple events.\n\t */\n\tprivate setupStdinBuffer(): void {\n\t\tthis.stdinBuffer = new StdinBuffer({ escapeTimeout: resolveEscapeTimeoutMs() });\n\n\t\t// Forward individual sequences to the input handler\n\t\tthis.stdinBuffer.on(\"data\", (sequence) => {\n\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence);\n\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t\treturn; // Wait briefly for the rest of a split Kitty response.\n\t\t\t}\n\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.forwardInputSequence(sequence);\n\t\t});\n\n\t\t// Re-wrap paste content with bracketed paste markers for existing editor handling\n\t\tthis.stdinBuffer.on(\"paste\", (content) => {\n\t\t\tif (this.inputHandler) {\n\t\t\t\tthis.inputHandler(`\\x1b[200~${content}\\x1b[201~`);\n\t\t\t}\n\t\t});\n\n\t\t// Handler that pipes stdin data through the buffer\n\t\tthis.stdinDataHandler = (data: string | Buffer) => {\n\t\t\tthis.stdinBuffer!.process(data);\n\t\t};\n\t}\n\n\t/**\n\t * Query terminal for Kitty keyboard protocol support and enable it if available.\n\t *\n\t * Kitty's progressive enhancement detection requires requesting the desired\n\t * flags before querying them. The trailing DA query is a sentinel supported by\n\t * terminals that do not know Kitty keyboard protocol; receiving DA before a\n\t * Kitty response enables modifyOtherKeys fallback without a startup timeout.\n\t *\n\t * The requested flags are:\n\t * - 1 = disambiguate escape codes\n\t * - 2 = report event types (press/repeat/release)\n\t * - 4 = report alternate keys (shifted key, base layout key)\n\t */\n\tprivate queryAndEnableKittyProtocol(): void {\n\t\tthis.setupStdinBuffer();\n\t\tprocess.stdin.on(\"data\", this.stdinDataHandler!);\n\t\tif (!keyboardEnhancementEnabled()) {\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.TMUX !== undefined || process.env.TMUX_PANE !== undefined) {\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}\n\t\tthis.keyboardProtocolPushed = true;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.rawWrite(KITTY_KEYBOARD_PROTOCOL_QUERY);\n\t}\n\n\tprivate handleKeyboardProtocolNegotiationSequence(\n\t\tnegotiationSequence: KeyboardProtocolNegotiationSequence | undefined,\n\t): boolean {\n\t\tif (!negotiationSequence) return false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tif (negotiationSequence.type === \"kitty-flags\") {\n\t\t\tif (negotiationSequence.flags !== 0) {\n\t\t\t\tthis.disableModifyOtherKeys();\n\t\t\t\tif (!this._kittyProtocolActive) {\n\t\t\t\t\tthis._kittyProtocolActive = true;\n\t\t\t\t\tsetKittyProtocolActive(true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.enableModifyOtherKeys();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this._kittyProtocolActive) {\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate readKeyboardProtocolNegotiationSequence(\n\t\tsequence: string,\n\t): KeyboardProtocolNegotiationSequence | \"pending\" | undefined {\n\t\tif (this.keyboardProtocolNegotiationBuffer) {\n\t\t\tconst bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;\n\t\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);\n\t\t\tif (negotiationSequence) {\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\treturn negotiationSequence;\n\t\t\t}\n\t\t\tif (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence)) {\n\t\t\t\tthis.setKeyboardProtocolNegotiationBuffer(bufferedSequence);\n\t\t\t\treturn \"pending\";\n\t\t\t}\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}\n\n\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);\n\t\tif (negotiationSequence) return negotiationSequence;\n\t\tif (isKeyboardProtocolNegotiationSequencePrefix(sequence)) {\n\t\t\tthis.setKeyboardProtocolNegotiationBuffer(sequence);\n\t\t\treturn \"pending\";\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate setKeyboardProtocolNegotiationBuffer(sequence: string): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = sequence;\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBuffer(): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = \"\";\n\t}\n\n\tprivate flushKeyboardProtocolNegotiationBufferAsInput(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer) return;\n\t\tconst sequence = this.keyboardProtocolNegotiationBuffer;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.forwardInputSequence(sequence);\n\t}\n\n\tprivate scheduleKeyboardProtocolNegotiationBufferFlush(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer) return;\n\t\tthis.keyboardProtocolBufferFlushTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBufferFlushTimer(): void {\n\t\tif (!this.keyboardProtocolBufferFlushTimer) return;\n\t\tclearTimeout(this.keyboardProtocolBufferFlushTimer);\n\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t}\n\n\tprivate forwardInputSequence(sequence: string): void {\n\t\tif (!this.inputHandler) return;\n\t\tconst shouldDetectNativeShiftEnter =\n\t\t\tsequence === \"\\r\" && (isAppleTerminalSession() || process.platform === \"win32\");\n\t\tconst input = normalizeNativeShiftEnterInput(\n\t\t\tsequence,\n\t\t\tshouldDetectNativeShiftEnter,\n\t\t\tshouldDetectNativeShiftEnter && isNativeModifierPressed(\"shift\"),\n\t\t);\n\t\tthis.inputHandler(input);\n\t}\n\n\tprivate enableModifyOtherKeys(): void {\n\t\tif (this._kittyProtocolActive || this._modifyOtherKeysActive) return;\n\t\tthis.rawWrite(\"\\x1b[>4;2m\");\n\t\tthis._modifyOtherKeysActive = true;\n\t}\n\n\tprivate disableModifyOtherKeys(): void {\n\t\tif (!this._modifyOtherKeysActive) return;\n\t\tthis.rawWrite(\"\\x1b[>4;0m\");\n\t\tthis._modifyOtherKeysActive = false;\n\t}\n\n\t/**\n\t * On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin\n\t * console handle so the terminal sends VT sequences for modified keys\n\t * (e.g. \\x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW\n\t * discards modifier state and Shift+Tab arrives as plain \\t.\n\t */\n\tprivate enableWindowsVTInput(): void {\n\t\tif (process.platform !== \"win32\") return;\n\t\ttry {\n\t\t\tconst arch = process.arch;\n\t\t\tif (arch !== \"x64\" && arch !== \"arm64\") return;\n\n\t\t\t// Dynamic require so non-Windows and bundled/browser paths never load the\n\t\t\t// native helper. In the npm package native/ is next to dist/; in compiled\n\t\t\t// binary archives native/ is copied next to the executable.\n\t\t\tconst moduleDir = path.dirname(fileURLToPath(import.meta.url));\n\t\t\tconst nativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t\t\tconst candidates = [\n\t\t\t\tpath.join(moduleDir, \"..\", nativePath),\n\t\t\t\tpath.join(moduleDir, nativePath),\n\t\t\t\tpath.join(path.dirname(process.execPath), nativePath),\n\t\t\t];\n\t\t\tfor (const modulePath of candidates) {\n\t\t\t\ttry {\n\t\t\t\t\tconst helper = cjsRequire(modulePath) as { enableVirtualTerminalInput?: () => boolean };\n\t\t\t\t\thelper.enableVirtualTerminalInput?.();\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// Try the next possible packaging location.\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\t// Native helper not available — Shift+Tab won't be distinguishable from Tab.\n\t\t}\n\t}\n\n\tasync drainInput(maxMs = 1000, idleMs = 50): Promise<void> {\n\t\tconst shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\t// Disable Kitty keyboard protocol first so any late key releases\n\t\t\t// do not generate new Kitty escape sequences.\n\t\t\tthis.rawWrite(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.disableModifyOtherKeys();\n\n\t\tconst previousHandler = this.inputHandler;\n\t\tthis.inputHandler = undefined;\n\n\t\tlet lastDataTime = Date.now();\n\t\tconst onData = () => {\n\t\t\tlastDataTime = Date.now();\n\t\t};\n\n\t\tprocess.stdin.on(\"data\", onData);\n\t\tconst endTime = Date.now() + maxMs;\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tconst timeLeft = endTime - now;\n\t\t\t\tif (timeLeft <= 0) break;\n\t\t\t\tif (now - lastDataTime >= idleMs) break;\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));\n\t\t\t}\n\t\t} finally {\n\t\t\tprocess.stdin.removeListener(\"data\", onData);\n\t\t\tthis.inputHandler = previousHandler;\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tif (this.clearProgressInterval()) {\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\n\t\t// Disable bracketed paste mode\n\t\tthis.rawWrite(\"\\x1b[?2004l\");\n\n\t\tconst shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\n\t\t// Disable Kitty keyboard protocol if not already done by drainInput()\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\tthis.rawWrite(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.disableModifyOtherKeys();\n\n\t\t// Clean up StdinBuffer\n\t\tif (this.stdinBuffer) {\n\t\t\tthis.stdinBuffer.destroy();\n\t\t\tthis.stdinBuffer = undefined;\n\t\t}\n\n\t\t// Remove event handlers\n\t\tif (this.stdinDataHandler) {\n\t\t\tprocess.stdin.removeListener(\"data\", this.stdinDataHandler);\n\t\t\tthis.stdinDataHandler = undefined;\n\t\t}\n\t\tthis.inputHandler = undefined;\n\t\tif (this.resizeHandler) {\n\t\t\tprocess.stdout.removeListener(\"resize\", this.resizeHandler);\n\t\t\tthis.resizeHandler = undefined;\n\t\t}\n\n\t\t// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being\n\t\t// re-interpreted after raw mode is disabled. This fixes a race condition\n\t\t// where Ctrl+D could close the parent shell over SSH.\n\t\tprocess.stdin.pause();\n\n\t\t// Restore raw mode state\n\t\tif (process.stdin.setRawMode) {\n\t\t\ttry {\n\t\t\t\tprocess.stdin.setRawMode(this.wasRaw);\n\t\t\t} catch (error) {\n\t\t\t\tif (!isDeadTerminalError(error)) throw error;\n\t\t\t}\n\t\t}\n\n\t\tthis.removeExternalStdoutGuard();\n\t}\n\n\twrite(data: string): void {\n\t\tthis.rawWrite(data);\n\t\tif (this.writeLogPath) {\n\t\t\ttry {\n\t\t\t\tfs.appendFileSync(this.writeLogPath, data, { encoding: \"utf8\" });\n\t\t\t} catch {\n\t\t\t\t// Ignore logging errors\n\t\t\t}\n\t\t}\n\t}\n\n\tget columns(): number {\n\t\treturn process.stdout.columns || Number(process.env.COLUMNS) || 80;\n\t}\n\n\tget rows(): number {\n\t\treturn process.stdout.rows || Number(process.env.LINES) || 24;\n\t}\n\n\tmoveBy(lines: number): void {\n\t\tif (lines > 0) {\n\t\t\t// Move down\n\t\t\tthis.rawWrite(`\\x1b[${lines}B`);\n\t\t} else if (lines < 0) {\n\t\t\t// Move up\n\t\t\tthis.rawWrite(`\\x1b[${-lines}A`);\n\t\t}\n\t\t// lines === 0: no movement\n\t}\n\n\thideCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[?25l\");\n\t}\n\n\tshowCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[?25h\");\n\t}\n\n\tclearLine(): void {\n\t\tthis.rawWrite(\"\\x1b[K\");\n\t}\n\n\tclearFromCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[J\");\n\t}\n\n\tclearScreen(): void {\n\t\tthis.rawWrite(\"\\x1b[2J\\x1b[H\"); // Clear screen and move to home (1,1)\n\t}\n\n\tsetTitle(title: string): void {\n\t\t// OSC 0;title BEL - set terminal window title. Control characters are\n\t\t// stripped so a title cannot terminate the OSC early and leak the rest\n\t\t// onto the screen.\n\t\tconst sanitizedTitle = title.replace(/[\\u0000-\\u001f\\u007f-\\u009f]/g, \"\");\n\t\tthis.rawWrite(`\\x1b]0;${sanitizedTitle}\\x07`);\n\t}\n\n\tsetProgress(active: boolean): void {\n\t\tif (active) {\n\t\t\t// OSC 9;4;3 - indeterminate progress\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\tif (!this.progressInterval) {\n\t\t\t\tthis.progressInterval = setInterval(() => {\n\t\t\t\t\tthis.rawWrite(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\t\t}, TERMINAL_PROGRESS_KEEPALIVE_MS);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.clearProgressInterval();\n\t\t\t// OSC 9;4;0 - clear progress\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\t}\n\n\tprivate clearProgressInterval(): boolean {\n\t\tif (!this.progressInterval) return false;\n\t\tclearInterval(this.progressInterval);\n\t\tthis.progressInterval = undefined;\n\t\treturn true;\n\t}\n}\n"]}
1
+ {"version":3,"file":"terminal.js","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,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EAAE,8BAA8B,CAAC,CAAC;YACpC,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC7B,6BAA6B;YAC7B,IAAI,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;IAEO,qBAAqB;QAC5B,IAAI,CAAC,IAAI,CAAC,gBAAgB;YAAE,OAAO,KAAK,CAAC;QACzC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["import * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { setKittyProtocolActive } from \"./keys.ts\";\nimport { isNativeModifierPressed } from \"./native-modifiers.ts\";\nimport { getNativeModuleCandidates } from \"./native-module-path.ts\";\nimport { StdinBuffer } from \"./stdin-buffer.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nconst TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;\nconst TERMINAL_PROGRESS_ACTIVE_SEQUENCE = \"\\x1b]9;4;3\\x07\";\nconst TERMINAL_PROGRESS_CLEAR_SEQUENCE = \"\\x1b]9;4;0\\x07\";\nconst NATIVE_SHIFT_ENTER_SEQUENCE = \"\\x1b[13;2u\";\nconst DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;\nconst DEAD_TERMINAL_ERROR_CODES = new Set([\"EIO\", \"EPIPE\", \"ENOTCONN\"]);\n// Bun's macOS tty shim can report synchronous ioctl EIO as raw positive errno 5 without a string code.\nconst EIO_ERRNO = 5;\nconst KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;\nconst KITTY_KEYBOARD_PROTOCOL_QUERY = `\\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\\x1b[?u\\x1b[c`;\n\nexport type KeyboardProtocolNegotiationSequence =\n\t| { type: \"kitty-flags\"; flags: number }\n\t| { type: \"device-attributes\" };\n\nexport function parseKeyboardProtocolNegotiationSequence(\n\tsequence: string,\n): KeyboardProtocolNegotiationSequence | undefined {\n\tconst kittyFlags = sequence.match(/^\\x1b\\[\\?(\\d+)u$/);\n\tif (kittyFlags) {\n\t\treturn { type: \"kitty-flags\", flags: Number.parseInt(kittyFlags[1]!, 10) };\n\t}\n\tif (/^\\x1b\\[\\?[\\d;]*c$/.test(sequence)) {\n\t\treturn { type: \"device-attributes\" };\n\t}\n\treturn undefined;\n}\n\nfunction isKeyboardProtocolNegotiationSequencePrefix(sequence: string): boolean {\n\treturn sequence === \"\\x1b[\" || /^\\x1b\\[\\?[\\d;]*$/.test(sequence);\n}\n\nexport function isAppleTerminalSession(): boolean {\n\treturn process.platform === \"darwin\" && process.env.TERM_PROGRAM === \"Apple_Terminal\";\n}\n\nexport function normalizeNativeShiftEnterInput(\n\tdata: string,\n\tshouldDetectNativeShiftEnter: boolean,\n\tisShiftPressed: boolean,\n): string {\n\tif (shouldDetectNativeShiftEnter && data === \"\\r\" && isShiftPressed) return NATIVE_SHIFT_ENTER_SEQUENCE;\n\treturn data;\n}\n\nexport function normalizeAppleTerminalInput(data: string, isAppleTerminal: boolean, isShiftPressed: boolean): string {\n\treturn normalizeNativeShiftEnterInput(data, isAppleTerminal, isShiftPressed);\n}\n\nexport function keyboardEnhancementEnabled(): boolean {\n\tconst value = process.env.PI_TUI_KEYBOARD_PROTOCOL;\n\tif (value === undefined) return true;\n\treturn ![\"0\", \"false\", \"no\", \"off\"].includes(value.toLowerCase());\n}\n\nfunction isDeadTerminalError(error: unknown): boolean {\n\tif (!(error instanceof Error)) return false;\n\tif (\"code\" in error && typeof error.code === \"string\") return DEAD_TERMINAL_ERROR_CODES.has(error.code);\n\treturn \"errno\" in error && error.errno === EIO_ERRNO;\n}\n\n/**\n * Minimal terminal interface for TUI\n */\nexport interface Terminal {\n\t// Start the terminal with input and resize handlers\n\tstart(onInput: (data: string) => void, onResize: () => void): void;\n\n\t// Stop the terminal and restore state\n\tstop(): void;\n\n\t/**\n\t * Drain stdin before exiting to prevent Kitty key release events from\n\t * leaking to the parent shell over slow SSH connections.\n\t * @param maxMs - Maximum time to drain (default: 1000ms)\n\t * @param idleMs - Exit early if no input arrives within this time (default: 50ms)\n\t */\n\tdrainInput(maxMs?: number, idleMs?: number): Promise<void>;\n\n\t// Write output to terminal\n\twrite(data: string): void;\n\n\t// Get terminal dimensions\n\tget columns(): number;\n\tget rows(): number;\n\n\t// Whether Kitty keyboard protocol is active\n\tget kittyProtocolActive(): boolean;\n\n\t// Cursor positioning (relative to current position)\n\tmoveBy(lines: number): void; // Move cursor up (negative) or down (positive) by N lines\n\n\t// Cursor visibility\n\thideCursor(): void; // Hide the cursor\n\tshowCursor(): void; // Show the cursor\n\n\t// Clear operations\n\tclearLine(): void; // Clear current line\n\tclearFromCursor(): void; // Clear from cursor to end of screen\n\tclearScreen(): void; // Clear entire screen and move cursor to (0,0)\n\n\t// Title operations\n\tsetTitle(title: string): void; // Set terminal window title\n\n\t// Progress indicator (OSC 9;4)\n\tsetProgress(active: boolean): void;\n}\n\nexport interface ProcessTerminalOptions {\n\t/**\n\t * When set, stdout writes not issued by this terminal are hidden from the\n\t * screen while the terminal is started and forwarded to this handler\n\t * instead. External writes (console.log, libraries) would otherwise\n\t * interleave with frames and desynchronize differential rendering.\n\t */\n\tonExternalStdoutWrite?: (text: string) => void;\n}\n\nconst DEFAULT_ESCAPE_TIMEOUT_MS = 10;\nconst DEFAULT_SSH_ESCAPE_TIMEOUT_MS = 100;\n\n/**\n * Resolve how long to wait for the rest of an escape sequence before\n * dispatching a lone ESC as the Escape key. Legacy Alt+key input is ESC plus\n * another byte, so high-latency transports need a longer reassembly window.\n */\nexport function resolveEscapeTimeoutMs(env: NodeJS.ProcessEnv = process.env): number {\n\tconst configured = Number(env.PI_TUI_ESC_TIMEOUT);\n\tif (Number.isFinite(configured) && configured > 0) {\n\t\treturn configured;\n\t}\n\tif (env.SSH_CONNECTION || env.SSH_TTY) {\n\t\treturn DEFAULT_SSH_ESCAPE_TIMEOUT_MS;\n\t}\n\treturn DEFAULT_ESCAPE_TIMEOUT_MS;\n}\n\n/**\n * Real terminal using process.stdin/stdout\n */\nexport class ProcessTerminal implements Terminal {\n\tprivate wasRaw = false;\n\tprivate onExternalStdoutWrite?: (text: string) => void;\n\tprivate originalStdoutWrite?: typeof process.stdout.write;\n\tprivate rawStdoutWrite?: (data: string) => void;\n\tprivate forwardingExternalWrite = false;\n\tprivate inputHandler?: (data: string) => void;\n\tprivate resizeHandler?: () => void;\n\tprivate _kittyProtocolActive = false;\n\tprivate _modifyOtherKeysActive = false;\n\tprivate keyboardProtocolPushed = false;\n\tprivate keyboardProtocolNegotiationBuffer = \"\";\n\tprivate keyboardProtocolBufferFlushTimer?: ReturnType<typeof setTimeout>;\n\tprivate stdinBuffer?: StdinBuffer;\n\tprivate stdinDataHandler?: (data: string | Buffer) => void;\n\tprivate progressInterval?: ReturnType<typeof setInterval>;\n\tprivate writeLogPath = (() => {\n\t\tconst env = process.env.PI_TUI_WRITE_LOG || \"\";\n\t\tif (!env) return \"\";\n\t\ttry {\n\t\t\tif (fs.statSync(env).isDirectory()) {\n\t\t\t\tconst now = new Date();\n\t\t\t\tconst ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\n\t\t\t\treturn path.join(env, `tui-${ts}-${process.pid}.log`);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Not an existing directory - use as-is (file path)\n\t\t}\n\t\treturn env;\n\t})();\n\n\tconstructor(options?: ProcessTerminalOptions) {\n\t\tthis.onExternalStdoutWrite = options?.onExternalStdoutWrite;\n\t}\n\n\tget kittyProtocolActive(): boolean {\n\t\treturn this._kittyProtocolActive;\n\t}\n\n\tprivate rawWrite(data: string): void {\n\t\tif (this.rawStdoutWrite) {\n\t\t\tthis.rawStdoutWrite(data);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stdout.write(data);\n\t}\n\n\tprivate installExternalStdoutGuard(): void {\n\t\tconst handler = this.onExternalStdoutWrite;\n\t\tif (!handler || this.originalStdoutWrite) {\n\t\t\treturn;\n\t\t}\n\t\tthis.originalStdoutWrite = process.stdout.write;\n\t\tconst rawWrite = process.stdout.write.bind(process.stdout);\n\t\tthis.rawStdoutWrite = rawWrite;\n\n\t\tprocess.stdout.write = ((\n\t\t\tchunk: string | Uint8Array,\n\t\t\tencodingOrCallback?: BufferEncoding | ((error?: Error | null) => void),\n\t\t\tcallback?: (error?: Error | null) => void,\n\t\t): boolean => {\n\t\t\tconst cb = typeof encodingOrCallback === \"function\" ? encodingOrCallback : callback;\n\t\t\tconst encoding = typeof encodingOrCallback === \"string\" ? encodingOrCallback : undefined;\n\t\t\tconst text = typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(encoding);\n\t\t\tif (this.forwardingExternalWrite) {\n\t\t\t\trawWrite(text);\n\t\t\t\tcb?.(null);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.forwardingExternalWrite = true;\n\t\t\ttry {\n\t\t\t\thandler(text);\n\t\t\t} catch {\n\t\t\t\trawWrite(text);\n\t\t\t} finally {\n\t\t\t\tthis.forwardingExternalWrite = false;\n\t\t\t}\n\t\t\tcb?.(null);\n\t\t\treturn true;\n\t\t}) as typeof process.stdout.write;\n\t}\n\n\tprivate removeExternalStdoutGuard(): void {\n\t\tif (!this.originalStdoutWrite) {\n\t\t\treturn;\n\t\t}\n\t\tprocess.stdout.write = this.originalStdoutWrite;\n\t\tthis.originalStdoutWrite = undefined;\n\t\tthis.rawStdoutWrite = undefined;\n\t}\n\n\tget modifyOtherKeysActive(): boolean {\n\t\treturn this._modifyOtherKeysActive;\n\t}\n\n\tstart(onInput: (data: string) => void, onResize: () => void): void {\n\t\tthis.installExternalStdoutGuard();\n\t\tthis.inputHandler = onInput;\n\t\tthis.resizeHandler = onResize;\n\n\t\t// Save previous state and enable raw mode\n\t\tthis.wasRaw = process.stdin.isRaw || false;\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(true);\n\t\t}\n\t\tprocess.stdin.resume();\n\n\t\t// Enable bracketed paste mode - terminal will wrap pastes in \\x1b[200~ ... \\x1b[201~\n\t\tthis.rawWrite(\"\\x1b[?2004h\");\n\n\t\t// Set up resize handler immediately\n\t\tprocess.stdout.on(\"resize\", this.resizeHandler);\n\n\t\t// Refresh terminal dimensions - they may be stale after suspend/resume\n\t\t// (SIGWINCH is lost while process is stopped). Unix only.\n\t\tif (process.platform !== \"win32\") {\n\t\t\tprocess.kill(process.pid, \"SIGWINCH\");\n\t\t}\n\n\t\t// On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends\n\t\t// VT escape sequences (e.g. \\x1b[Z for Shift+Tab) instead of raw console\n\t\t// events that lose modifier information. Must run AFTER setRawMode(true)\n\t\t// since that resets console mode flags.\n\t\tthis.enableWindowsVTInput();\n\n\t\t// Query Kitty keyboard protocol and fall back to modifyOtherKeys when DA confirms no Kitty response.\n\t\t// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n\t\tthis.queryAndEnableKittyProtocol();\n\t}\n\n\t/**\n\t * Set up StdinBuffer to split batched input into individual sequences.\n\t * This ensures components receive single events, making matchesKey/isKeyRelease work correctly.\n\t *\n\t * Also watches for Kitty protocol response and enables it when detected.\n\t * This is done here (after stdinBuffer parsing) rather than on raw stdin\n\t * to handle the case where the response arrives split across multiple events.\n\t */\n\tprivate setupStdinBuffer(): void {\n\t\tthis.stdinBuffer = new StdinBuffer({ escapeTimeout: resolveEscapeTimeoutMs() });\n\n\t\t// Forward individual sequences to the input handler\n\t\tthis.stdinBuffer.on(\"data\", (sequence) => {\n\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence);\n\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t\treturn; // Wait briefly for the rest of a split Kitty response.\n\t\t\t}\n\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.forwardInputSequence(sequence);\n\t\t});\n\n\t\t// Re-wrap paste content with bracketed paste markers for existing editor handling\n\t\tthis.stdinBuffer.on(\"paste\", (content) => {\n\t\t\tif (this.inputHandler) {\n\t\t\t\tthis.inputHandler(`\\x1b[200~${content}\\x1b[201~`);\n\t\t\t}\n\t\t});\n\n\t\t// Handler that pipes stdin data through the buffer\n\t\tthis.stdinDataHandler = (data: string | Buffer) => {\n\t\t\tthis.stdinBuffer!.process(data);\n\t\t};\n\t}\n\n\t/**\n\t * Query terminal for Kitty keyboard protocol support and enable it if available.\n\t *\n\t * Kitty's progressive enhancement detection requires requesting the desired\n\t * flags before querying them. The trailing DA query is a sentinel supported by\n\t * terminals that do not know Kitty keyboard protocol; receiving DA before a\n\t * Kitty response enables modifyOtherKeys fallback without a startup timeout.\n\t *\n\t * The requested flags are:\n\t * - 1 = disambiguate escape codes\n\t * - 2 = report event types (press/repeat/release)\n\t * - 4 = report alternate keys (shifted key, base layout key)\n\t */\n\tprivate queryAndEnableKittyProtocol(): void {\n\t\tthis.setupStdinBuffer();\n\t\tprocess.stdin.on(\"data\", this.stdinDataHandler!);\n\t\tif (!keyboardEnhancementEnabled()) {\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.TMUX !== undefined || process.env.TMUX_PANE !== undefined) {\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}\n\t\tthis.keyboardProtocolPushed = true;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.rawWrite(KITTY_KEYBOARD_PROTOCOL_QUERY);\n\t}\n\n\tprivate handleKeyboardProtocolNegotiationSequence(\n\t\tnegotiationSequence: KeyboardProtocolNegotiationSequence | undefined,\n\t): boolean {\n\t\tif (!negotiationSequence) return false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tif (negotiationSequence.type === \"kitty-flags\") {\n\t\t\tif (negotiationSequence.flags !== 0) {\n\t\t\t\tthis.disableModifyOtherKeys();\n\t\t\t\tif (!this._kittyProtocolActive) {\n\t\t\t\t\tthis._kittyProtocolActive = true;\n\t\t\t\t\tsetKittyProtocolActive(true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.enableModifyOtherKeys();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this._kittyProtocolActive) {\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate readKeyboardProtocolNegotiationSequence(\n\t\tsequence: string,\n\t): KeyboardProtocolNegotiationSequence | \"pending\" | undefined {\n\t\tif (this.keyboardProtocolNegotiationBuffer) {\n\t\t\tconst bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;\n\t\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);\n\t\t\tif (negotiationSequence) {\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\treturn negotiationSequence;\n\t\t\t}\n\t\t\tif (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence)) {\n\t\t\t\tthis.setKeyboardProtocolNegotiationBuffer(bufferedSequence);\n\t\t\t\treturn \"pending\";\n\t\t\t}\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}\n\n\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);\n\t\tif (negotiationSequence) return negotiationSequence;\n\t\tif (isKeyboardProtocolNegotiationSequencePrefix(sequence)) {\n\t\t\tthis.setKeyboardProtocolNegotiationBuffer(sequence);\n\t\t\treturn \"pending\";\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate setKeyboardProtocolNegotiationBuffer(sequence: string): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = sequence;\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBuffer(): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = \"\";\n\t}\n\n\tprivate flushKeyboardProtocolNegotiationBufferAsInput(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer) return;\n\t\tconst sequence = this.keyboardProtocolNegotiationBuffer;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.forwardInputSequence(sequence);\n\t}\n\n\tprivate scheduleKeyboardProtocolNegotiationBufferFlush(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer) return;\n\t\tthis.keyboardProtocolBufferFlushTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBufferFlushTimer(): void {\n\t\tif (!this.keyboardProtocolBufferFlushTimer) return;\n\t\tclearTimeout(this.keyboardProtocolBufferFlushTimer);\n\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t}\n\n\tprivate forwardInputSequence(sequence: string): void {\n\t\tif (!this.inputHandler) return;\n\t\tconst shouldDetectNativeShiftEnter =\n\t\t\tsequence === \"\\r\" && (isAppleTerminalSession() || process.platform === \"win32\");\n\t\tconst input = normalizeNativeShiftEnterInput(\n\t\t\tsequence,\n\t\t\tshouldDetectNativeShiftEnter,\n\t\t\tshouldDetectNativeShiftEnter && isNativeModifierPressed(\"shift\"),\n\t\t);\n\t\tthis.inputHandler(input);\n\t}\n\n\tprivate enableModifyOtherKeys(): void {\n\t\tif (this._kittyProtocolActive || this._modifyOtherKeysActive) return;\n\t\tthis.rawWrite(\"\\x1b[>4;2m\");\n\t\tthis._modifyOtherKeysActive = true;\n\t}\n\n\tprivate disableModifyOtherKeys(): void {\n\t\tif (!this._modifyOtherKeysActive) return;\n\t\tthis.rawWrite(\"\\x1b[>4;0m\");\n\t\tthis._modifyOtherKeysActive = false;\n\t}\n\n\t/**\n\t * On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin\n\t * console handle so the terminal sends VT sequences for modified keys\n\t * (e.g. \\x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW\n\t * discards modifier state and Shift+Tab arrives as plain \\t.\n\t */\n\tprivate enableWindowsVTInput(): void {\n\t\tif (process.platform !== \"win32\") return;\n\t\ttry {\n\t\t\tconst arch = process.arch;\n\t\t\tif (arch !== \"x64\" && arch !== \"arm64\") return;\n\n\t\t\t// Dynamic require so non-Windows and bundled/browser paths never load the\n\t\t\t// native helper. Installed packages resolve it from pi-tui; standalone\n\t\t\t// binaries resolve the copy next to the executable.\n\t\t\tconst nativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t\t\tfor (const modulePath of getNativeModuleCandidates(nativePath)) {\n\t\t\t\ttry {\n\t\t\t\t\tconst helper = cjsRequire(modulePath) as { enableVirtualTerminalInput?: () => boolean };\n\t\t\t\t\thelper.enableVirtualTerminalInput?.();\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// Try the next possible packaging location.\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\t// Native helper not available — Shift+Tab won't be distinguishable from Tab.\n\t\t}\n\t}\n\n\tasync drainInput(maxMs = 1000, idleMs = 50): Promise<void> {\n\t\tconst shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\t// Disable Kitty keyboard protocol first so any late key releases\n\t\t\t// do not generate new Kitty escape sequences.\n\t\t\tthis.rawWrite(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.disableModifyOtherKeys();\n\n\t\tconst previousHandler = this.inputHandler;\n\t\tthis.inputHandler = undefined;\n\n\t\tlet lastDataTime = Date.now();\n\t\tconst onData = () => {\n\t\t\tlastDataTime = Date.now();\n\t\t};\n\n\t\tprocess.stdin.on(\"data\", onData);\n\t\tconst endTime = Date.now() + maxMs;\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tconst timeLeft = endTime - now;\n\t\t\t\tif (timeLeft <= 0) break;\n\t\t\t\tif (now - lastDataTime >= idleMs) break;\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));\n\t\t\t}\n\t\t} finally {\n\t\t\tprocess.stdin.removeListener(\"data\", onData);\n\t\t\tthis.inputHandler = previousHandler;\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tif (this.clearProgressInterval()) {\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\n\t\t// Disable bracketed paste mode\n\t\tthis.rawWrite(\"\\x1b[?2004l\");\n\n\t\tconst shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\n\t\t// Disable Kitty keyboard protocol if not already done by drainInput()\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\tthis.rawWrite(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.disableModifyOtherKeys();\n\n\t\t// Clean up StdinBuffer\n\t\tif (this.stdinBuffer) {\n\t\t\tthis.stdinBuffer.destroy();\n\t\t\tthis.stdinBuffer = undefined;\n\t\t}\n\n\t\t// Remove event handlers\n\t\tif (this.stdinDataHandler) {\n\t\t\tprocess.stdin.removeListener(\"data\", this.stdinDataHandler);\n\t\t\tthis.stdinDataHandler = undefined;\n\t\t}\n\t\tthis.inputHandler = undefined;\n\t\tif (this.resizeHandler) {\n\t\t\tprocess.stdout.removeListener(\"resize\", this.resizeHandler);\n\t\t\tthis.resizeHandler = undefined;\n\t\t}\n\n\t\t// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being\n\t\t// re-interpreted after raw mode is disabled. This fixes a race condition\n\t\t// where Ctrl+D could close the parent shell over SSH.\n\t\tprocess.stdin.pause();\n\n\t\t// Restore raw mode state\n\t\tif (process.stdin.setRawMode) {\n\t\t\ttry {\n\t\t\t\tprocess.stdin.setRawMode(this.wasRaw);\n\t\t\t} catch (error) {\n\t\t\t\tif (!isDeadTerminalError(error)) throw error;\n\t\t\t}\n\t\t}\n\n\t\tthis.removeExternalStdoutGuard();\n\t}\n\n\twrite(data: string): void {\n\t\tthis.rawWrite(data);\n\t\tif (this.writeLogPath) {\n\t\t\ttry {\n\t\t\t\tfs.appendFileSync(this.writeLogPath, data, { encoding: \"utf8\" });\n\t\t\t} catch {\n\t\t\t\t// Ignore logging errors\n\t\t\t}\n\t\t}\n\t}\n\n\tget columns(): number {\n\t\treturn process.stdout.columns || Number(process.env.COLUMNS) || 80;\n\t}\n\n\tget rows(): number {\n\t\treturn process.stdout.rows || Number(process.env.LINES) || 24;\n\t}\n\n\tmoveBy(lines: number): void {\n\t\tif (lines > 0) {\n\t\t\t// Move down\n\t\t\tthis.rawWrite(`\\x1b[${lines}B`);\n\t\t} else if (lines < 0) {\n\t\t\t// Move up\n\t\t\tthis.rawWrite(`\\x1b[${-lines}A`);\n\t\t}\n\t\t// lines === 0: no movement\n\t}\n\n\thideCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[?25l\");\n\t}\n\n\tshowCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[?25h\");\n\t}\n\n\tclearLine(): void {\n\t\tthis.rawWrite(\"\\x1b[K\");\n\t}\n\n\tclearFromCursor(): void {\n\t\tthis.rawWrite(\"\\x1b[J\");\n\t}\n\n\tclearScreen(): void {\n\t\tthis.rawWrite(\"\\x1b[2J\\x1b[H\"); // Clear screen and move to home (1,1)\n\t}\n\n\tsetTitle(title: string): void {\n\t\t// OSC 0;title BEL - set terminal window title. Control characters are\n\t\t// stripped so a title cannot terminate the OSC early and leak the rest\n\t\t// onto the screen.\n\t\tconst sanitizedTitle = title.replace(/[\\u0000-\\u001f\\u007f-\\u009f]/g, \"\");\n\t\tthis.rawWrite(`\\x1b]0;${sanitizedTitle}\\x07`);\n\t}\n\n\tsetProgress(active: boolean): void {\n\t\tif (active) {\n\t\t\t// OSC 9;4;3 - indeterminate progress\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\tif (!this.progressInterval) {\n\t\t\t\tthis.progressInterval = setInterval(() => {\n\t\t\t\t\tthis.rawWrite(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\t\t}, TERMINAL_PROGRESS_KEEPALIVE_MS);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.clearProgressInterval();\n\t\t\t// OSC 9;4;0 - clear progress\n\t\t\tthis.rawWrite(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\t}\n\n\tprivate clearProgressInterval(): boolean {\n\t\tif (!this.progressInterval) return false;\n\t\tclearInterval(this.progressInterval);\n\t\tthis.progressInterval = undefined;\n\t\treturn true;\n\t}\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-tui",
3
- "private": true,
4
- "version": "2026.8.24",
3
+ "version": "2026.8.26",
5
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
5
  "type": "module",
7
6
  "main": "dist/index.js",
@@ -10,9 +9,9 @@
10
9
  "build": "tsc -p tsconfig.build.json",
11
10
  "build:native:darwin": "native/darwin/build.sh",
12
11
  "build:native:win32": "node native/win32/build.mjs",
13
- "bench:frame-cost": "tsx bench/frame-cost.ts",
14
12
  "test": "node --test --import tsx --import ./test/setup-multiplexer-env.mjs --test-reporter=dot --test-reporter-destination=stdout test/*.test.ts",
15
- "prepublishOnly": "npm run clean && npm run build"
13
+ "prepublishOnly": "npm run clean && npm run build",
14
+ "bench:frame-cost": "tsx bench/frame-cost.ts"
16
15
  },
17
16
  "files": [
18
17
  "dist/**/*",
@@ -53,5 +52,6 @@
53
52
  "devDependencies": {
54
53
  "@xterm/headless": "6.0.0",
55
54
  "chalk": "6.0.0"
56
- }
55
+ },
56
+ "private": true
57
57
  }
@@ -0,0 +1,21 @@
1
+ This software is licensed under the MIT license:
2
+
3
+ Copyright (C) 2016 Dmitry Chestnykh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ // Copyright (C) 2016 Dmitry Chestnykh
2
+ // MIT License. See LICENSE file for details.
3
+
4
+ import { encode, decode } from "./base64";
5
+ import { benchmark, report, byteSeq } from "@stablelib/benchmark";
6
+
7
+ let buf = byteSeq(1024);
8
+ const encBuf = encode(buf);
9
+
10
+ report("Base64 encode", benchmark(() => encode(buf), buf.length));
11
+ // Decode benchmark reports MiB/s for decoded MiB, not input.
12
+ report("Base64 decode", benchmark(() => decode(encBuf), buf.length));
13
+
14
+ declare var Buffer: any;
15
+
16
+ if (typeof Buffer !== "undefined") {
17
+ // For comparison with Node.js buffer speed.
18
+ const nodeBuf = Buffer.from(buf);
19
+ const nodeEncBuf = nodeBuf.toString("base64");
20
+
21
+ report("Buffer - Base64 encode", benchmark(() =>
22
+ nodeBuf.toString("base64"), nodeBuf.length));
23
+ report("Buffer - Base64 decode", benchmark(() =>
24
+ Buffer.from(nodeEncBuf, "base64"), nodeBuf.length));
25
+ }
@@ -0,0 +1,85 @@
1
+ // Copyright (C) 2016 Dmitry Chestnykh
2
+ // MIT License. See LICENSE file for details.
3
+
4
+ import { encode, decode, encodeURLSafe, decodeURLSafe } from "./base64";
5
+
6
+ const testVectors: [number[], string][] = [
7
+ // https://tools.ietf.org/html/rfc4648
8
+ [[], ""],
9
+ [[102], "Zg=="],
10
+ [[102, 111], "Zm8="],
11
+ [[102, 111, 111], "Zm9v"],
12
+ [[102, 111, 111, 98], "Zm9vYg=="],
13
+ [[102, 111, 111, 98, 97], "Zm9vYmE="],
14
+ [[102, 111, 111, 98, 97, 114], "Zm9vYmFy"],
15
+ // "hello world"
16
+ [[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100], "aGVsbG8gd29ybGQ="],
17
+ // zeros
18
+ [[0], "AA=="],
19
+ [[0, 0], "AAA="],
20
+ [[0, 0, 0], "AAAA"],
21
+ [[0, 0, 0, 0], "AAAAAA=="],
22
+ [[0, 0, 0, 0, 0], "AAAAAAA="],
23
+ [[0, 0, 0, 0, 0, 0], "AAAAAAAA"],
24
+ // random
25
+ [
26
+ [111, 16, 164, 40, 38, 216, 61, 120, 247, 118, 115, 82, 77, 65, 170, 155],
27
+ "bxCkKCbYPXj3dnNSTUGqmw=="
28
+ ],
29
+ [
30
+ [216, 8, 213, 125, 61, 133, 254, 192, 132, 229, 47, 151, 14, 63, 142, 230, 59, 143, 232, 228],
31
+ "2AjVfT2F/sCE5S+XDj+O5juP6OQ="
32
+ ]
33
+ ];
34
+
35
+ const badVectors = [
36
+ "=",
37
+ "==",
38
+ "Zg===",
39
+ "AAA",
40
+ "=Zm8",
41
+ "что"
42
+ ];
43
+
44
+ describe("Base64", () => {
45
+ it("should correctly encode test vectors", () => {
46
+ testVectors.forEach((v) => {
47
+ const input = new Uint8Array(v[0] as Array<number>);
48
+ expect(encode(input)).toBe(v[1]);
49
+ });
50
+ });
51
+ it("should correctly decode test vectors", () => {
52
+ testVectors.forEach((v) => {
53
+ const output = new Uint8Array(v[0] as Array<number>);
54
+ expect(decode(v[1] as string).toString()).toBe(output.toString());
55
+ });
56
+ });
57
+ it("should throw when decoding incorrect strings", () => {
58
+ badVectors.forEach((v) => {
59
+ expect(() => decode(v)).toThrow();
60
+ });
61
+ });
62
+ });
63
+
64
+ describe("Base64 URL-safe", () => {
65
+ // Converts strings from standard to URL-safe encoding.
66
+ const urlSafe = (s: string) => s.replace(/\+/g, "-").replace(/\//g, "_");
67
+
68
+ it("should correctly encode test vectors", () => {
69
+ testVectors.forEach((v) => {
70
+ const input = new Uint8Array(v[0] as Array<number>);
71
+ expect(encodeURLSafe(input)).toBe(urlSafe(v[1] as string));
72
+ });
73
+ });
74
+ it("should correctly decode test vectors", () => {
75
+ testVectors.forEach((v) => {
76
+ const output = new Uint8Array(v[0] as Array<number>);
77
+ expect(decodeURLSafe(urlSafe(v[1] as string)).toString()).toBe(output.toString());
78
+ });
79
+ });
80
+ it("should throw when decoding incorrect strings", () => {
81
+ badVectors.forEach((v) => {
82
+ expect(() => decodeURLSafe(urlSafe(v))).toThrow();
83
+ });
84
+ });
85
+ });
@@ -0,0 +1,283 @@
1
+ // Copyright (C) 2016 Dmitry Chestnykh
2
+ // MIT License. See LICENSE file for details.
3
+
4
+ /**
5
+ * Package base64 implements Base64 encoding and decoding.
6
+ */
7
+
8
+ // Invalid character used in decoding to indicate
9
+ // that the character to decode is out of range of
10
+ // alphabet and cannot be decoded.
11
+ const INVALID_BYTE = 256;
12
+
13
+ /**
14
+ * Implements standard Base64 encoding.
15
+ *
16
+ * Operates in constant time.
17
+ */
18
+ export class Coder {
19
+ // TODO(dchest): methods to encode chunk-by-chunk.
20
+
21
+ constructor(private _paddingCharacter = "=") { }
22
+
23
+ encodedLength(length: number): number {
24
+ if (!this._paddingCharacter) {
25
+ return (length * 8 + 5) / 6 | 0;
26
+ }
27
+ return (length + 2) / 3 * 4 | 0;
28
+ }
29
+
30
+ encode(data: Uint8Array): string {
31
+ let out = "";
32
+
33
+ let i = 0;
34
+ for (; i < data.length - 2; i += 3) {
35
+ let c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);
36
+ out += this._encodeByte((c >>> 3 * 6) & 63);
37
+ out += this._encodeByte((c >>> 2 * 6) & 63);
38
+ out += this._encodeByte((c >>> 1 * 6) & 63);
39
+ out += this._encodeByte((c >>> 0 * 6) & 63);
40
+ }
41
+
42
+ const left = data.length - i;
43
+ if (left > 0) {
44
+ let c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0);
45
+ out += this._encodeByte((c >>> 3 * 6) & 63);
46
+ out += this._encodeByte((c >>> 2 * 6) & 63);
47
+ if (left === 2) {
48
+ out += this._encodeByte((c >>> 1 * 6) & 63);
49
+ } else {
50
+ out += this._paddingCharacter || "";
51
+ }
52
+ out += this._paddingCharacter || "";
53
+ }
54
+
55
+ return out;
56
+ }
57
+
58
+ maxDecodedLength(length: number): number {
59
+ if (!this._paddingCharacter) {
60
+ return (length * 6 + 7) / 8 | 0;
61
+ }
62
+ return length / 4 * 3 | 0;
63
+ }
64
+
65
+ decodedLength(s: string): number {
66
+ return this.maxDecodedLength(s.length - this._getPaddingLength(s));
67
+ }
68
+
69
+ decode(s: string): Uint8Array {
70
+ if (s.length === 0) {
71
+ return new Uint8Array(0);
72
+ }
73
+ const paddingLength = this._getPaddingLength(s);
74
+ const length = s.length - paddingLength;
75
+ const out = new Uint8Array(this.maxDecodedLength(length));
76
+ let op = 0;
77
+ let i = 0;
78
+ let haveBad = 0;
79
+ let v0 = 0, v1 = 0, v2 = 0, v3 = 0;
80
+ for (; i < length - 4; i += 4) {
81
+ v0 = this._decodeChar(s.charCodeAt(i + 0));
82
+ v1 = this._decodeChar(s.charCodeAt(i + 1));
83
+ v2 = this._decodeChar(s.charCodeAt(i + 2));
84
+ v3 = this._decodeChar(s.charCodeAt(i + 3));
85
+ out[op++] = (v0 << 2) | (v1 >>> 4);
86
+ out[op++] = (v1 << 4) | (v2 >>> 2);
87
+ out[op++] = (v2 << 6) | v3;
88
+ haveBad |= v0 & INVALID_BYTE;
89
+ haveBad |= v1 & INVALID_BYTE;
90
+ haveBad |= v2 & INVALID_BYTE;
91
+ haveBad |= v3 & INVALID_BYTE;
92
+ }
93
+ if (i < length - 1) {
94
+ v0 = this._decodeChar(s.charCodeAt(i));
95
+ v1 = this._decodeChar(s.charCodeAt(i + 1));
96
+ out[op++] = (v0 << 2) | (v1 >>> 4);
97
+ haveBad |= v0 & INVALID_BYTE;
98
+ haveBad |= v1 & INVALID_BYTE;
99
+ }
100
+ if (i < length - 2) {
101
+ v2 = this._decodeChar(s.charCodeAt(i + 2));
102
+ out[op++] = (v1 << 4) | (v2 >>> 2);
103
+ haveBad |= v2 & INVALID_BYTE;
104
+ }
105
+ if (i < length - 3) {
106
+ v3 = this._decodeChar(s.charCodeAt(i + 3));
107
+ out[op++] = (v2 << 6) | v3;
108
+ haveBad |= v3 & INVALID_BYTE;
109
+ }
110
+ if (haveBad !== 0) {
111
+ throw new Error("Base64Coder: incorrect characters for decoding");
112
+ }
113
+ return out;
114
+ }
115
+
116
+ // Standard encoding have the following encoded/decoded ranges,
117
+ // which we need to convert between.
118
+ //
119
+ // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 + /
120
+ // Index: 0 - 25 26 - 51 52 - 61 62 63
121
+ // ASCII: 65 - 90 97 - 122 48 - 57 43 47
122
+ //
123
+
124
+ // Encode 6 bits in b into a new character.
125
+ protected _encodeByte(b: number): string {
126
+ // Encoding uses constant time operations as follows:
127
+ //
128
+ // 1. Define comparison of A with B using (A - B) >>> 8:
129
+ // if A > B, then result is positive integer
130
+ // if A <= B, then result is 0
131
+ //
132
+ // 2. Define selection of C or 0 using bitwise AND: X & C:
133
+ // if X == 0, then result is 0
134
+ // if X != 0, then result is C
135
+ //
136
+ // 3. Start with the smallest comparison (b >= 0), which is always
137
+ // true, so set the result to the starting ASCII value (65).
138
+ //
139
+ // 4. Continue comparing b to higher ASCII values, and selecting
140
+ // zero if comparison isn't true, otherwise selecting a value
141
+ // to add to result, which:
142
+ //
143
+ // a) undoes the previous addition
144
+ // b) provides new value to add
145
+ //
146
+ let result = b;
147
+ // b >= 0
148
+ result += 65;
149
+ // b > 25
150
+ result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);
151
+ // b > 51
152
+ result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);
153
+ // b > 61
154
+ result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43);
155
+ // b > 62
156
+ result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47);
157
+
158
+ return String.fromCharCode(result);
159
+ }
160
+
161
+ // Decode a character code into a byte.
162
+ // Must return 256 if character is out of alphabet range.
163
+ protected _decodeChar(c: number): number {
164
+ // Decoding works similar to encoding: using the same comparison
165
+ // function, but now it works on ranges: result is always incremented
166
+ // by value, but this value becomes zero if the range is not
167
+ // satisfied.
168
+ //
169
+ // Decoding starts with invalid value, 256, which is then
170
+ // subtracted when the range is satisfied. If none of the ranges
171
+ // apply, the function returns 256, which is then checked by
172
+ // the caller to throw error.
173
+ let result = INVALID_BYTE; // start with invalid character
174
+
175
+ // c == 43 (c > 42 and c < 44)
176
+ result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62);
177
+ // c == 47 (c > 46 and c < 48)
178
+ result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63);
179
+ // c > 47 and c < 58
180
+ result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);
181
+ // c > 64 and c < 91
182
+ result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);
183
+ // c > 96 and c < 123
184
+ result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);
185
+
186
+ return result;
187
+ }
188
+
189
+ private _getPaddingLength(s: string): number {
190
+ let paddingLength = 0;
191
+ if (this._paddingCharacter) {
192
+ for (let i = s.length - 1; i >= 0; i--) {
193
+ if (s[i] !== this._paddingCharacter) {
194
+ break;
195
+ }
196
+ paddingLength++;
197
+ }
198
+ if (s.length < 4 || paddingLength > 2) {
199
+ throw new Error("Base64Coder: incorrect padding");
200
+ }
201
+ }
202
+ return paddingLength;
203
+ }
204
+
205
+ }
206
+
207
+ const stdCoder = new Coder();
208
+
209
+ export function encode(data: Uint8Array): string {
210
+ return stdCoder.encode(data);
211
+ }
212
+
213
+ export function decode(s: string): Uint8Array {
214
+ return stdCoder.decode(s);
215
+ }
216
+
217
+ /**
218
+ * Implements URL-safe Base64 encoding.
219
+ * (Same as Base64, but '+' is replaced with '-', and '/' with '_').
220
+ *
221
+ * Operates in constant time.
222
+ */
223
+ export class URLSafeCoder extends Coder {
224
+ // URL-safe encoding have the following encoded/decoded ranges:
225
+ //
226
+ // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 - _
227
+ // Index: 0 - 25 26 - 51 52 - 61 62 63
228
+ // ASCII: 65 - 90 97 - 122 48 - 57 45 95
229
+ //
230
+
231
+ protected _encodeByte(b: number): string {
232
+ let result = b;
233
+ // b >= 0
234
+ result += 65;
235
+ // b > 25
236
+ result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);
237
+ // b > 51
238
+ result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);
239
+ // b > 61
240
+ result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45);
241
+ // b > 62
242
+ result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95);
243
+
244
+ return String.fromCharCode(result);
245
+ }
246
+
247
+ protected _decodeChar(c: number): number {
248
+ let result = INVALID_BYTE;
249
+
250
+ // c == 45 (c > 44 and c < 46)
251
+ result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62);
252
+ // c == 95 (c > 94 and c < 96)
253
+ result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63);
254
+ // c > 47 and c < 58
255
+ result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);
256
+ // c > 64 and c < 91
257
+ result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);
258
+ // c > 96 and c < 123
259
+ result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);
260
+
261
+ return result;
262
+ }
263
+ }
264
+
265
+ const urlSafeCoder = new URLSafeCoder();
266
+
267
+ export function encodeURLSafe(data: Uint8Array): string {
268
+ return urlSafeCoder.encode(data);
269
+ }
270
+
271
+ export function decodeURLSafe(s: string): Uint8Array {
272
+ return urlSafeCoder.decode(s);
273
+ }
274
+
275
+
276
+ export const encodedLength = (length: number) =>
277
+ stdCoder.encodedLength(length);
278
+
279
+ export const maxDecodedLength = (length: number) =>
280
+ stdCoder.maxDecodedLength(length);
281
+
282
+ export const decodedLength = (s: string) =>
283
+ stdCoder.decodedLength(s);