@code-yeongyu/senpi 2026.9.4 → 2026.9.5

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 (1010) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/README.md +5 -4
  3. package/dist/cli/startup-ui.d.ts.map +1 -1
  4. package/dist/cli/startup-ui.js +2 -1
  5. package/dist/cli/startup-ui.js.map +1 -1
  6. package/dist/core/agent-session-runtime.js +2 -2
  7. package/dist/core/agent-session-runtime.js.map +1 -1
  8. package/dist/core/agent-session.d.ts +17 -1
  9. package/dist/core/agent-session.d.ts.map +1 -1
  10. package/dist/core/agent-session.js +86 -3
  11. package/dist/core/agent-session.js.map +1 -1
  12. package/dist/core/auth-storage.d.ts.map +1 -1
  13. package/dist/core/auth-storage.js +31 -41
  14. package/dist/core/auth-storage.js.map +1 -1
  15. package/dist/core/compaction/compaction.d.ts.map +1 -1
  16. package/dist/core/compaction/compaction.js +16 -7
  17. package/dist/core/compaction/compaction.js.map +1 -1
  18. package/dist/core/credential-pool/state-store.d.ts +1 -0
  19. package/dist/core/credential-pool/state-store.d.ts.map +1 -1
  20. package/dist/core/credential-pool/state-store.js +22 -2
  21. package/dist/core/credential-pool/state-store.js.map +1 -1
  22. package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
  23. package/dist/core/extensions/builtin/bash-timeout/index.js +1 -5
  24. package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
  25. package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +0 -2
  26. package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
  27. package/dist/core/extensions/builtin/bash-timeout/timeout.js +3 -4
  28. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  29. package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts +5 -0
  30. package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -1
  31. package/dist/core/extensions/builtin/compaction/model-usability-budget.js +11 -4
  32. package/dist/core/extensions/builtin/compaction/model-usability-budget.js.map +1 -1
  33. package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
  34. package/dist/core/extensions/builtin/goal/prompt.js +1 -3
  35. package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
  36. package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
  37. package/dist/core/extensions/builtin/goal/store.js +8 -20
  38. package/dist/core/extensions/builtin/goal/store.js.map +1 -1
  39. package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
  40. package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
  41. package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
  42. package/dist/core/extensions/builtin/hooks/trust-storage.js +3 -1
  43. package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
  44. package/dist/core/extensions/builtin/imagegen/auth.d.ts.map +1 -1
  45. package/dist/core/extensions/builtin/imagegen/auth.js +10 -2
  46. package/dist/core/extensions/builtin/imagegen/auth.js.map +1 -1
  47. package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
  48. package/dist/core/extensions/builtin/loop/index.js +20 -1
  49. package/dist/core/extensions/builtin/loop/index.js.map +1 -1
  50. package/dist/core/extensions/builtin/loop/store.d.ts +8 -6
  51. package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
  52. package/dist/core/extensions/builtin/loop/store.js +54 -88
  53. package/dist/core/extensions/builtin/loop/store.js.map +1 -1
  54. package/dist/core/extensions/builtin/loop/tools.d.ts +6 -1
  55. package/dist/core/extensions/builtin/loop/tools.d.ts.map +1 -1
  56. package/dist/core/extensions/builtin/loop/tools.js +8 -1
  57. package/dist/core/extensions/builtin/loop/tools.js.map +1 -1
  58. package/dist/core/extensions/builtin/monitor-state-event.d.ts +2 -0
  59. package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
  60. package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
  61. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +9 -5
  62. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
  63. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +20 -11
  64. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
  65. package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
  66. package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
  67. package/dist/core/extensions/builtin/recommended-models/index.js +1 -0
  68. package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
  69. package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
  70. package/dist/core/extensions/builtin/service-tier.js +12 -4
  71. package/dist/core/extensions/builtin/service-tier.js.map +1 -1
  72. package/dist/core/extensions/builtin/terminal/durable-command.d.ts +31 -0
  73. package/dist/core/extensions/builtin/terminal/durable-command.d.ts.map +1 -0
  74. package/dist/core/extensions/builtin/terminal/durable-command.js +96 -0
  75. package/dist/core/extensions/builtin/terminal/durable-command.js.map +1 -0
  76. package/dist/core/extensions/builtin/terminal/durable-file.d.ts +42 -0
  77. package/dist/core/extensions/builtin/terminal/durable-file.d.ts.map +1 -0
  78. package/dist/core/extensions/builtin/terminal/durable-file.js +102 -0
  79. package/dist/core/extensions/builtin/terminal/durable-file.js.map +1 -0
  80. package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
  81. package/dist/core/extensions/builtin/terminal/extension.js +226 -3
  82. package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
  83. package/dist/core/extensions/builtin/terminal/manager.d.ts +10 -0
  84. package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
  85. package/dist/core/extensions/builtin/terminal/manager.js +21 -0
  86. package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
  87. package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts +24 -0
  88. package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts.map +1 -0
  89. package/dist/core/extensions/builtin/terminal/manifest-lease.js +105 -0
  90. package/dist/core/extensions/builtin/terminal/manifest-lease.js.map +1 -0
  91. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
  92. package/dist/core/extensions/builtin/terminal/monitor-notify.js +5 -1
  93. package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
  94. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +42 -2
  95. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
  96. package/dist/core/extensions/builtin/terminal/monitor-registry.js +73 -2
  97. package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
  98. package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
  99. package/dist/core/extensions/builtin/terminal/monitor-status.js +21 -1
  100. package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
  101. package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
  102. package/dist/core/extensions/builtin/terminal/prompt.js +9 -5
  103. package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
  104. package/dist/core/extensions/builtin/terminal/restore.d.ts +56 -0
  105. package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -0
  106. package/dist/core/extensions/builtin/terminal/restore.js +177 -0
  107. package/dist/core/extensions/builtin/terminal/restore.js.map +1 -0
  108. package/dist/core/extensions/builtin/terminal/shared.d.ts +25 -0
  109. package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
  110. package/dist/core/extensions/builtin/terminal/shared.js +25 -0
  111. package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
  112. package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts +91 -0
  113. package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts.map +1 -0
  114. package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js +14 -0
  115. package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js.map +1 -0
  116. package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts +62 -0
  117. package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -0
  118. package/dist/core/extensions/builtin/terminal/terminal-manifest.js +204 -0
  119. package/dist/core/extensions/builtin/terminal/terminal-manifest.js.map +1 -0
  120. package/dist/core/extensions/builtin/terminal/tools/bash-input.d.ts.map +1 -1
  121. package/dist/core/extensions/builtin/terminal/tools/bash-input.js +3 -2
  122. package/dist/core/extensions/builtin/terminal/tools/bash-input.js.map +1 -1
  123. package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/terminal/tools/bash-output.js +5 -4
  125. package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
  126. package/dist/core/extensions/builtin/terminal/tools/bash-resize.d.ts.map +1 -1
  127. package/dist/core/extensions/builtin/terminal/tools/bash-resize.js +3 -2
  128. package/dist/core/extensions/builtin/terminal/tools/bash-resize.js.map +1 -1
  129. package/dist/core/extensions/builtin/terminal/tools/context.d.ts +8 -0
  130. package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/terminal/tools/context.js +10 -0
  132. package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
  133. package/dist/core/extensions/builtin/terminal/tools/kill-bash.d.ts.map +1 -1
  134. package/dist/core/extensions/builtin/terminal/tools/kill-bash.js +5 -4
  135. package/dist/core/extensions/builtin/terminal/tools/kill-bash.js.map +1 -1
  136. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +4 -1
  137. package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
  138. package/dist/core/extensions/builtin/terminal/tools/monitor.js +114 -22
  139. package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
  140. package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
  141. package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
  142. package/dist/core/extensions/builtin/todotools/prompt.js +3 -6
  143. package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
  144. package/dist/core/extensions/builtin/tool-search/index.d.ts.map +1 -1
  145. package/dist/core/extensions/builtin/tool-search/index.js +1 -1
  146. package/dist/core/extensions/builtin/tool-search/index.js.map +1 -1
  147. package/dist/core/extensions/builtin/tool-search/native-search.d.ts +9 -4
  148. package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
  149. package/dist/core/extensions/builtin/tool-search/native-search.js +11 -6
  150. package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
  151. package/dist/core/extensions/builtin/tool-search/native-support.d.ts +13 -0
  152. package/dist/core/extensions/builtin/tool-search/native-support.d.ts.map +1 -0
  153. package/dist/core/extensions/builtin/tool-search/native-support.js +45 -0
  154. package/dist/core/extensions/builtin/tool-search/native-support.js.map +1 -0
  155. package/dist/core/extensions/index.d.ts +1 -1
  156. package/dist/core/extensions/index.d.ts.map +1 -1
  157. package/dist/core/extensions/index.js.map +1 -1
  158. package/dist/core/extensions/runner.d.ts +5 -0
  159. package/dist/core/extensions/runner.d.ts.map +1 -1
  160. package/dist/core/extensions/runner.js +44 -1
  161. package/dist/core/extensions/runner.js.map +1 -1
  162. package/dist/core/extensions/types.d.ts +26 -3
  163. package/dist/core/extensions/types.d.ts.map +1 -1
  164. package/dist/core/extensions/types.js.map +1 -1
  165. package/dist/core/footer-data-provider.d.ts.map +1 -1
  166. package/dist/core/footer-data-provider.js +18 -1
  167. package/dist/core/footer-data-provider.js.map +1 -1
  168. package/dist/core/http-dispatcher.d.ts.map +1 -1
  169. package/dist/core/http-dispatcher.js +2 -0
  170. package/dist/core/http-dispatcher.js.map +1 -1
  171. package/dist/core/lockfile-policy.d.ts +11 -0
  172. package/dist/core/lockfile-policy.d.ts.map +1 -1
  173. package/dist/core/lockfile-policy.js +19 -0
  174. package/dist/core/lockfile-policy.js.map +1 -1
  175. package/dist/core/manual-continue.d.ts +13 -0
  176. package/dist/core/manual-continue.d.ts.map +1 -0
  177. package/dist/core/manual-continue.js +19 -0
  178. package/dist/core/manual-continue.js.map +1 -0
  179. package/dist/core/messages.d.ts.map +1 -1
  180. package/dist/core/messages.js +8 -2
  181. package/dist/core/messages.js.map +1 -1
  182. package/dist/core/model-config.d.ts.map +1 -1
  183. package/dist/core/model-config.js +3 -0
  184. package/dist/core/model-config.js.map +1 -1
  185. package/dist/core/provider-composer.d.ts.map +1 -1
  186. package/dist/core/provider-composer.js +13 -2
  187. package/dist/core/provider-composer.js.map +1 -1
  188. package/dist/core/retry-fallback/chains.d.ts +1 -13
  189. package/dist/core/retry-fallback/chains.d.ts.map +1 -1
  190. package/dist/core/retry-fallback/chains.js +3 -49
  191. package/dist/core/retry-fallback/chains.js.map +1 -1
  192. package/dist/core/retry-fallback/controller.d.ts.map +1 -1
  193. package/dist/core/retry-fallback/controller.js +4 -9
  194. package/dist/core/retry-fallback/controller.js.map +1 -1
  195. package/dist/core/retry-fallback/expansion.js +1 -1
  196. package/dist/core/retry-fallback/expansion.js.map +1 -1
  197. package/dist/core/retry-fallback/settings.d.ts +2 -4
  198. package/dist/core/retry-fallback/settings.d.ts.map +1 -1
  199. package/dist/core/retry-fallback/settings.js +7 -36
  200. package/dist/core/retry-fallback/settings.js.map +1 -1
  201. package/dist/core/sdk.d.ts.map +1 -1
  202. package/dist/core/sdk.js +1 -1
  203. package/dist/core/sdk.js.map +1 -1
  204. package/dist/core/session-manager.d.ts.map +1 -1
  205. package/dist/core/session-manager.js +10 -3
  206. package/dist/core/session-manager.js.map +1 -1
  207. package/dist/core/session-sidecar-store.d.ts +62 -0
  208. package/dist/core/session-sidecar-store.d.ts.map +1 -0
  209. package/dist/core/session-sidecar-store.js +149 -0
  210. package/dist/core/session-sidecar-store.js.map +1 -0
  211. package/dist/core/settings-manager.d.ts +5 -1
  212. package/dist/core/settings-manager.d.ts.map +1 -1
  213. package/dist/core/settings-manager.js +45 -15
  214. package/dist/core/settings-manager.js.map +1 -1
  215. package/dist/core/skills.d.ts.map +1 -1
  216. package/dist/core/skills.js +19 -2
  217. package/dist/core/skills.js.map +1 -1
  218. package/dist/core/terminal-settings.d.ts +3 -0
  219. package/dist/core/terminal-settings.d.ts.map +1 -1
  220. package/dist/core/terminal-settings.js.map +1 -1
  221. package/dist/core/tools/bash.d.ts.map +1 -1
  222. package/dist/core/tools/bash.js +1 -1
  223. package/dist/core/tools/bash.js.map +1 -1
  224. package/dist/core/tools/edit.d.ts.map +1 -1
  225. package/dist/core/tools/edit.js +2 -2
  226. package/dist/core/tools/edit.js.map +1 -1
  227. package/dist/core/tools/find.d.ts.map +1 -1
  228. package/dist/core/tools/find.js +2 -2
  229. package/dist/core/tools/find.js.map +1 -1
  230. package/dist/core/tools/grep.d.ts.map +1 -1
  231. package/dist/core/tools/grep.js +2 -2
  232. package/dist/core/tools/grep.js.map +1 -1
  233. package/dist/core/tools/ls.d.ts.map +1 -1
  234. package/dist/core/tools/ls.js +2 -2
  235. package/dist/core/tools/ls.js.map +1 -1
  236. package/dist/core/tools/read.d.ts.map +1 -1
  237. package/dist/core/tools/read.js +1 -1
  238. package/dist/core/tools/read.js.map +1 -1
  239. package/dist/core/tools/write.d.ts.map +1 -1
  240. package/dist/core/tools/write.js +3 -3
  241. package/dist/core/tools/write.js.map +1 -1
  242. package/dist/index.d.ts +1 -1
  243. package/dist/index.d.ts.map +1 -1
  244. package/dist/index.js.map +1 -1
  245. package/dist/main.d.ts.map +1 -1
  246. package/dist/main.js +2 -0
  247. package/dist/main.js.map +1 -1
  248. package/dist/modes/app-server/daemon/process.d.ts +33 -3
  249. package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
  250. package/dist/modes/app-server/daemon/process.js +57 -6
  251. package/dist/modes/app-server/daemon/process.js.map +1 -1
  252. package/dist/modes/app-server/daemon.js +9 -1
  253. package/dist/modes/app-server/daemon.js.map +1 -1
  254. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  255. package/dist/modes/interactive/components/scoped-models-selector.js +5 -11
  256. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  257. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  258. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  259. package/dist/modes/interactive/components/settings-selector.js +21 -8
  260. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  261. package/dist/modes/interactive/components/thinking-selector.js +2 -2
  262. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  263. package/dist/modes/interactive/components/trust-selector.js +2 -2
  264. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  265. package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
  266. package/dist/modes/interactive/grok/welcome-card.js +5 -2
  267. package/dist/modes/interactive/grok/welcome-card.js.map +1 -1
  268. package/dist/modes/interactive/interactive-mode.d.ts +3 -0
  269. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  270. package/dist/modes/interactive/interactive-mode.js +83 -14
  271. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  272. package/dist/modes/interactive/version-label.d.ts +7 -0
  273. package/dist/modes/interactive/version-label.d.ts.map +1 -0
  274. package/dist/modes/interactive/version-label.js +9 -0
  275. package/dist/modes/interactive/version-label.js.map +1 -0
  276. package/dist/modes/rpc/host-ensure.d.ts +2 -0
  277. package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
  278. package/dist/modes/rpc/host-ensure.js +77 -18
  279. package/dist/modes/rpc/host-ensure.js.map +1 -1
  280. package/dist/utils/version-check.d.ts.map +1 -1
  281. package/dist/utils/version-check.js +3 -4
  282. package/dist/utils/version-check.js.map +1 -1
  283. package/docs/compaction.md +2 -0
  284. package/docs/environment-variables.md +5 -0
  285. package/docs/extensions.md +22 -2
  286. package/docs/keybindings.md +1 -1
  287. package/docs/models.md +3 -0
  288. package/docs/quickstart.md +1 -1
  289. package/docs/rpc.md +1 -1
  290. package/docs/settings.md +13 -5
  291. package/docs/terminal-setup.md +27 -0
  292. package/docs/terminal-tools.md +35 -4
  293. package/docs/usage.md +5 -3
  294. package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +96 -0
  295. package/node_modules/@anthropic-ai/sdk/README.md +1 -1
  296. package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -1
  297. package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -1
  298. package/node_modules/@anthropic-ai/sdk/core/credentials.js +5 -7
  299. package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -1
  300. package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +5 -7
  301. package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -1
  302. package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -1
  303. package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -1
  304. package/node_modules/@anthropic-ai/sdk/core/middleware.js +4 -4
  305. package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -1
  306. package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +4 -4
  307. package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -1
  308. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts +45 -0
  309. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts.map +1 -0
  310. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts +45 -0
  311. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts.map +1 -0
  312. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js +58 -0
  313. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js.map +1 -0
  314. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs +54 -0
  315. package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs.map +1 -0
  316. package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +1 -1
  317. package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -1
  318. package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +1 -1
  319. package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
  320. package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -1
  321. package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -1
  322. package/node_modules/@anthropic-ai/sdk/internal/errors.js +3 -1
  323. package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -1
  324. package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +3 -1
  325. package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -1
  326. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -1
  327. package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -1
  328. package/node_modules/@anthropic-ai/sdk/internal/file-store.js +23 -25
  329. package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -1
  330. package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +5 -6
  331. package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -1
  332. package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts +9 -0
  333. package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts.map +1 -0
  334. package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts +9 -0
  335. package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts.map +1 -0
  336. package/node_modules/@anthropic-ai/sdk/internal/node.browser.js +22 -0
  337. package/node_modules/@anthropic-ai/sdk/internal/node.browser.js.map +1 -0
  338. package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +19 -0
  339. package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs.map +1 -0
  340. package/node_modules/@anthropic-ai/sdk/internal/node.d.mts +14 -0
  341. package/node_modules/@anthropic-ai/sdk/internal/node.d.mts.map +1 -0
  342. package/node_modules/@anthropic-ai/sdk/internal/node.d.ts +14 -0
  343. package/node_modules/@anthropic-ai/sdk/internal/node.d.ts.map +1 -0
  344. package/node_modules/@anthropic-ai/sdk/internal/node.js +24 -0
  345. package/node_modules/@anthropic-ai/sdk/internal/node.js.map +1 -0
  346. package/node_modules/@anthropic-ai/sdk/internal/node.mjs +14 -0
  347. package/node_modules/@anthropic-ai/sdk/internal/node.mjs.map +1 -0
  348. package/node_modules/@anthropic-ai/sdk/internal/parse.js +1 -1
  349. package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
  350. package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +1 -1
  351. package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
  352. package/node_modules/@anthropic-ai/sdk/internal/uploads.js +10 -6
  353. package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -1
  354. package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +10 -6
  355. package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
  356. package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +6 -0
  357. package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -1
  358. package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +6 -0
  359. package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -1
  360. package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +7 -0
  361. package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -1
  362. package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +6 -0
  363. package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
  364. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
  365. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
  366. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +6 -4
  367. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
  368. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +4 -2
  369. package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
  370. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
  371. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
  372. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +3 -4
  373. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
  374. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +1 -2
  375. package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
  376. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +1 -1
  377. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -1
  378. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +1 -1
  379. package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -1
  380. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +1 -1
  381. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -1
  382. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +1 -1
  383. package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -1
  384. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -1
  385. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -1
  386. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +2 -3
  387. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -1
  388. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +2 -3
  389. package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -1
  390. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +1 -1
  391. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -1
  392. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +1 -1
  393. package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -1
  394. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -1
  395. package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -1
  396. package/node_modules/@anthropic-ai/sdk/lib/middleware.js +30 -7
  397. package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -1
  398. package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +30 -7
  399. package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -1
  400. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +3 -2
  401. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -1
  402. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +3 -2
  403. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -1
  404. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +3 -46
  405. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -1
  406. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +3 -46
  407. package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -1
  408. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts +131 -0
  409. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts.map +1 -0
  410. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts +131 -0
  411. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts.map +1 -0
  412. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js +45 -0
  413. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js.map +1 -0
  414. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs +41 -0
  415. package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs.map +1 -0
  416. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts.map +1 -1
  417. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts.map +1 -1
  418. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +35 -6
  419. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
  420. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +35 -6
  421. package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
  422. package/node_modules/@anthropic-ai/sdk/package.json +4 -11
  423. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +1 -1
  424. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts.map +1 -1
  425. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts +1 -1
  426. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts.map +1 -1
  427. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js.map +1 -1
  428. package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
  429. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +13 -9
  430. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -1
  431. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +13 -9
  432. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
  433. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +4 -0
  434. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
  435. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +4 -0
  436. package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -1
  437. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts +6 -6
  438. package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +6 -6
  439. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +3 -2
  440. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -1
  441. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +3 -2
  442. package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -1
  443. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +28 -1
  444. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -1
  445. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +28 -1
  446. package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -1
  447. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +8 -1
  448. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -1
  449. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +8 -1
  450. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -1
  451. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -1
  452. package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -1
  453. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +25 -5
  454. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -1
  455. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +25 -5
  456. package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
  457. package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +6 -6
  458. package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
  459. package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +7 -7
  460. package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
  461. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -4
  462. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -1
  463. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -4
  464. package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
  465. package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +11 -9
  466. package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
  467. package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +1 -0
  468. package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
  469. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +12 -9
  470. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts.map +1 -1
  471. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts +12 -9
  472. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts.map +1 -1
  473. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +8 -5
  474. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  475. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts +8 -5
  476. package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  477. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +1 -1
  478. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -1
  479. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +1 -1
  480. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -1
  481. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -1
  482. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -1
  483. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +198 -29
  484. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -1
  485. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +198 -29
  486. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -1
  487. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -1
  488. package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
  489. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts +177 -0
  490. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts.map +1 -0
  491. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts +177 -0
  492. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts.map +1 -0
  493. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js +56 -0
  494. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js.map +1 -0
  495. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +52 -0
  496. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs.map +1 -0
  497. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts +74 -0
  498. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts.map +1 -0
  499. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts +74 -0
  500. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts.map +1 -0
  501. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js +52 -0
  502. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js.map +1 -0
  503. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +48 -0
  504. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs.map +1 -0
  505. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts +272 -0
  506. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts.map +1 -0
  507. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts +272 -0
  508. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts.map +1 -0
  509. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js +119 -0
  510. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js.map +1 -0
  511. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +115 -0
  512. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs.map +1 -0
  513. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts +14 -0
  514. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts.map +1 -0
  515. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts +14 -0
  516. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts.map +1 -0
  517. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js +21 -0
  518. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js.map +1 -0
  519. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +16 -0
  520. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs.map +1 -0
  521. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts +4 -0
  522. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts.map +1 -0
  523. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts +4 -0
  524. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts.map +1 -0
  525. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js +11 -0
  526. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js.map +1 -0
  527. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs +5 -0
  528. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs.map +1 -0
  529. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts +353 -0
  530. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts.map +1 -0
  531. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts +353 -0
  532. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts.map +1 -0
  533. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js +169 -0
  534. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js.map +1 -0
  535. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +165 -0
  536. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs.map +1 -0
  537. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts +3 -0
  538. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
  539. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts +3 -0
  540. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
  541. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js +9 -0
  542. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js.map +1 -0
  543. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs +4 -0
  544. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs.map +1 -0
  545. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts +468 -0
  546. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
  547. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts +468 -0
  548. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
  549. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js +198 -0
  550. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js.map +1 -0
  551. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +193 -0
  552. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
  553. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
  554. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
  555. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
  556. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
  557. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js +114 -0
  558. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
  559. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
  560. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
  561. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts +2 -0
  562. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts.map +1 -0
  563. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts +2 -0
  564. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts.map +1 -0
  565. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js +6 -0
  566. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js.map +1 -0
  567. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs +3 -0
  568. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs.map +1 -0
  569. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts +2 -0
  570. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts.map +1 -0
  571. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts +2 -0
  572. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts.map +1 -0
  573. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js +6 -0
  574. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js.map +1 -0
  575. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs +3 -0
  576. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs.map +1 -0
  577. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts +11 -0
  578. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts.map +1 -0
  579. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts +11 -0
  580. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts.map +1 -0
  581. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js +25 -0
  582. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js.map +1 -0
  583. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs +12 -0
  584. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs.map +1 -0
  585. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts +162 -0
  586. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts.map +1 -0
  587. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts +162 -0
  588. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts.map +1 -0
  589. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js +76 -0
  590. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js.map +1 -0
  591. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +72 -0
  592. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs.map +1 -0
  593. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts +73 -0
  594. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts.map +1 -0
  595. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts +73 -0
  596. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts.map +1 -0
  597. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js +62 -0
  598. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js.map +1 -0
  599. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +57 -0
  600. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs.map +1 -0
  601. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts +77 -0
  602. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts.map +1 -0
  603. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts +77 -0
  604. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts.map +1 -0
  605. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js +31 -0
  606. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js.map +1 -0
  607. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +27 -0
  608. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs.map +1 -0
  609. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts +3 -0
  610. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
  611. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts +3 -0
  612. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
  613. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js +9 -0
  614. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js.map +1 -0
  615. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs +4 -0
  616. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs.map +1 -0
  617. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
  618. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
  619. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
  620. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
  621. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js +174 -0
  622. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
  623. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
  624. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
  625. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
  626. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
  627. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
  628. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
  629. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js +125 -0
  630. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
  631. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
  632. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
  633. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts +2 -0
  634. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts.map +1 -0
  635. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts +2 -0
  636. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts.map +1 -0
  637. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js +6 -0
  638. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js.map +1 -0
  639. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs +3 -0
  640. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs.map +1 -0
  641. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts +124 -0
  642. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts.map +1 -0
  643. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts +124 -0
  644. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts.map +1 -0
  645. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js +67 -0
  646. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js.map +1 -0
  647. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +63 -0
  648. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs.map +1 -0
  649. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts +5 -0
  650. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts.map +1 -0
  651. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts +5 -0
  652. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts.map +1 -0
  653. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js +13 -0
  654. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js.map +1 -0
  655. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs +6 -0
  656. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs.map +1 -0
  657. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts +135 -0
  658. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts.map +1 -0
  659. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts +135 -0
  660. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts.map +1 -0
  661. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js +102 -0
  662. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js.map +1 -0
  663. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +98 -0
  664. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs.map +1 -0
  665. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts +83 -0
  666. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
  667. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts +83 -0
  668. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
  669. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js +34 -0
  670. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
  671. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +30 -0
  672. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
  673. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
  674. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
  675. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
  676. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
  677. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js +189 -0
  678. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
  679. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
  680. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
  681. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts +303 -0
  682. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
  683. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts +303 -0
  684. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
  685. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js +112 -0
  686. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js.map +1 -0
  687. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +107 -0
  688. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
  689. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts +2 -0
  690. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts.map +1 -0
  691. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts +2 -0
  692. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts.map +1 -0
  693. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js +6 -0
  694. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js.map +1 -0
  695. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs +3 -0
  696. package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs.map +1 -0
  697. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts +2 -0
  698. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts.map +1 -0
  699. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts +2 -0
  700. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts.map +1 -0
  701. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js +6 -0
  702. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js.map +1 -0
  703. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs +3 -0
  704. package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs.map +1 -0
  705. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +1 -1
  706. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +1 -1
  707. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +10 -10
  708. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +10 -10
  709. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +2 -1
  710. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -1
  711. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +2 -1
  712. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -1
  713. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -1
  714. package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -1
  715. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +2 -2
  716. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts.map +1 -1
  717. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts +2 -2
  718. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts.map +1 -1
  719. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js.map +1 -1
  720. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs.map +1 -1
  721. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts +48 -120
  722. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts.map +1 -1
  723. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts +48 -120
  724. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts.map +1 -1
  725. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +12 -8
  726. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js.map +1 -1
  727. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +12 -8
  728. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs.map +1 -1
  729. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts +35 -138
  730. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts.map +1 -1
  731. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts +35 -138
  732. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts.map +1 -1
  733. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +18 -18
  734. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js.map +1 -1
  735. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +18 -18
  736. package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
  737. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +21 -25
  738. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts.map +1 -1
  739. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts +21 -25
  740. package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
  741. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +16 -17
  742. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -1
  743. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +16 -17
  744. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -1
  745. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +21 -8
  746. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -1
  747. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +21 -8
  748. package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -1
  749. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1 -3
  750. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -1
  751. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1 -3
  752. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
  753. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
  754. package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
  755. package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +5 -7
  756. package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +4 -3
  757. package/node_modules/@anthropic-ai/sdk/src/helpers/beta/standard-schema.ts +99 -0
  758. package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +1 -1
  759. package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +3 -1
  760. package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +11 -10
  761. package/node_modules/@anthropic-ai/sdk/src/internal/node.browser.ts +22 -0
  762. package/node_modules/@anthropic-ai/sdk/src/internal/node.ts +14 -0
  763. package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +1 -1
  764. package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +10 -7
  765. package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +7 -0
  766. package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +5 -3
  767. package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +1 -3
  768. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +1 -1
  769. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +1 -1
  770. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +2 -3
  771. package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +1 -1
  772. package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +33 -9
  773. package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +7 -49
  774. package/node_modules/@anthropic-ai/sdk/src/lib/standard-schema.ts +209 -0
  775. package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +38 -6
  776. package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +1 -0
  777. package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +45 -15
  778. package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +6 -6
  779. package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +3 -2
  780. package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +42 -0
  781. package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +8 -1
  782. package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +34 -11
  783. package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +13 -7
  784. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +12 -9
  785. package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +8 -5
  786. package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +5 -1
  787. package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +221 -38
  788. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/api-keys.ts +231 -0
  789. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/compliance-settings.ts +96 -0
  790. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/external-keys.ts +365 -0
  791. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/federation.ts +71 -0
  792. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/index.ts +31 -0
  793. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/issuers.ts +486 -0
  794. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/index.ts +23 -0
  795. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/rules.ts +624 -0
  796. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
  797. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules.ts +3 -0
  798. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation.ts +3 -0
  799. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/index.ts +92 -0
  800. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/invites.ts +207 -0
  801. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/organization.ts +269 -0
  802. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rate-limits.ts +104 -0
  803. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/index.ts +21 -0
  804. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
  805. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
  806. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts.ts +3 -0
  807. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/users.ts +163 -0
  808. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/index.ts +43 -0
  809. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/members.ts +209 -0
  810. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/rate-limits.ts +113 -0
  811. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
  812. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/workspaces.ts +450 -0
  813. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces.ts +3 -0
  814. package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization.ts +3 -0
  815. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +1 -1
  816. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +10 -10
  817. package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +2 -1
  818. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +7 -10
  819. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +60 -150
  820. package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +43 -166
  821. package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +24 -27
  822. package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +25 -29
  823. package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2 -8
  824. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +6 -5
  825. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +5 -3
  826. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +1 -5
  827. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +122 -17
  828. package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +10 -43
  829. package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
  830. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -1
  831. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -1
  832. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +13 -15
  833. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -1
  834. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +3 -4
  835. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -1
  836. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -1
  837. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -1
  838. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +6 -4
  839. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -1
  840. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +5 -3
  841. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -1
  842. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +1 -2
  843. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -1
  844. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +1 -2
  845. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -1
  846. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +0 -4
  847. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -1
  848. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +0 -3
  849. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -1
  850. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +11 -9
  851. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -1
  852. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +11 -9
  853. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -1
  854. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +96 -8
  855. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -1
  856. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +96 -7
  857. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -1
  858. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +0 -8
  859. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -1
  860. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +0 -8
  861. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -1
  862. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +20 -46
  863. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -1
  864. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +9 -33
  865. package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -1
  866. package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
  867. package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
  868. package/node_modules/@anthropic-ai/sdk/version.js +1 -1
  869. package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
  870. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +45 -0
  871. package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
  872. package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
  873. package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +29 -0
  874. package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +8 -4
  875. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +3 -1
  876. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/display-image.js +162 -0
  877. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +2 -2
  878. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +29 -60
  879. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +66 -1
  880. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +28 -94
  881. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +7 -0
  882. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +6 -0
  883. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +14 -2
  884. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +12 -7
  885. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  886. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +58 -64
  887. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  888. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  889. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +16 -6
  890. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  891. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +1 -1
  892. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
  893. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +6 -1
  894. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  895. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -1
  896. package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
  897. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -0
  898. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  899. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +40 -10
  900. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  901. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -2
  902. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  903. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  904. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  905. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +1 -1
  906. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  907. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +130 -15
  908. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  909. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +4 -4
  910. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  911. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
  912. package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
  913. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +1 -1
  914. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  915. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -1
  916. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  917. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  918. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +30 -10
  919. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  920. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +3 -3
  921. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
  922. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  923. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +1 -1
  924. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
  925. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +8 -5
  926. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  927. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts +2 -0
  928. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
  929. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +6 -0
  930. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  931. package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js +1 -1
  932. package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -1
  933. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +30 -0
  934. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  935. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
  936. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  937. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
  938. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  939. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  940. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  941. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +3 -1
  942. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  943. package/node_modules/@earendil-works/pi-ai/dist/models.js +27 -3
  944. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  945. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +2 -0
  946. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
  947. package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
  948. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  949. package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
  950. package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
  951. package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
  952. package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  953. package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
  954. package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
  955. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
  956. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
  957. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  958. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  959. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  960. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  961. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +1 -1
  962. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
  963. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +8 -1
  964. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
  965. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -1
  966. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  967. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  968. package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.d.ts +23 -0
  969. package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.d.ts.map +1 -0
  970. package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js +58 -0
  971. package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js.map +1 -0
  972. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -1
  973. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +53 -12
  974. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -1
  975. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +4 -2
  976. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  977. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +3 -0
  978. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  979. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
  980. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +3 -0
  981. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  982. package/node_modules/@earendil-works/pi-ai/package.json +3 -3
  983. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  984. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  985. package/node_modules/@earendil-works/pi-tui/README.md +1 -1
  986. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
  987. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  988. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +36 -3
  989. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  990. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
  991. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  992. package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
  993. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  994. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +2 -0
  995. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  996. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +106 -6
  997. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  998. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +6 -0
  999. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1000. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +17 -4
  1001. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1002. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +11 -0
  1003. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1004. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +57 -15
  1005. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1006. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1007. package/node_modules/@earendil-works/pi-tui/dist/tui.js +22 -7
  1008. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1009. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  1010. package/package.json +8 -8
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The `restartable-command` durability class: the restore handler that brings a persistent
3
+ * command monitor back after a restart. It re-spawns the saved command EXACTLY ONCE, in the
4
+ * saved working directory, with NO timeout (a persistent watch has no deadline), and
5
+ * re-registers it under the SAVED `mon_` id so the stable handle the agent already knows
6
+ * keeps resolving. Nothing the pre-restart PTY produced is replayed — no output is persisted
7
+ * anywhere, so a restored watch starts from an empty buffer by construction.
8
+ */
9
+ import { stat } from "node:fs/promises";
10
+ import { isAbsolute } from "node:path";
11
+ import { reapplyPersistedMute } from "./restore.js";
12
+ import { DEFAULT_COLS, DEFAULT_ROWS } from "./shared.js";
13
+ import { spawnCommandSession } from "./tools/spawn.js";
14
+ const LOST = { outcome: "lost" };
15
+ async function defaultDirectoryExists(path) {
16
+ try {
17
+ return (await stat(path)).isDirectory();
18
+ }
19
+ catch {
20
+ return false;
21
+ }
22
+ }
23
+ function compileFilter(source) {
24
+ if (source === undefined)
25
+ return undefined;
26
+ try {
27
+ return new RegExp(source);
28
+ }
29
+ catch {
30
+ // A filter that no longer compiles must not sink the watch: restore it unfiltered.
31
+ return undefined;
32
+ }
33
+ }
34
+ function dimension(value, fallback) {
35
+ return value !== undefined && Number.isFinite(value) && value >= 1 ? Math.trunc(value) : fallback;
36
+ }
37
+ /**
38
+ * Decide whether a manifest entry is a restorable persistent command watch. Only the
39
+ * command runtime kind qualifies, only when it was created `persistent: true` (a
40
+ * non-persistent watch had a deadline and is deliberately not resurrected), and only
41
+ * when it actually carries a command and an absolute cwd to spawn it in.
42
+ */
43
+ function restorable(monitor) {
44
+ if (monitor.runtimeKind !== "command" || !monitor.persistent)
45
+ return undefined;
46
+ const { command, cwd } = monitor;
47
+ if (command === undefined || command.length === 0)
48
+ return undefined;
49
+ if (cwd === undefined || !isAbsolute(cwd))
50
+ return undefined;
51
+ return { command, cwd };
52
+ }
53
+ /**
54
+ * Build the `restartable-command` restore handler. Every guard rejects BEFORE spawning, so a
55
+ * rejected entry costs zero PTY sessions; a spawn failure is reported lost rather than thrown,
56
+ * because restore must never fail the startup path for one unrecoverable watch.
57
+ */
58
+ export function createRestartableCommandHandler(deps) {
59
+ const spawn = deps.spawn ?? spawnCommandSession;
60
+ const directoryExists = deps.directoryExists ?? defaultDirectoryExists;
61
+ return async (monitor) => {
62
+ const target = restorable(monitor);
63
+ if (target === undefined)
64
+ return LOST;
65
+ if (!(await directoryExists(target.cwd)))
66
+ return LOST;
67
+ let spawned;
68
+ try {
69
+ spawned = await spawn(deps.ctx, {
70
+ command: target.command,
71
+ cols: dimension(deps.ctx.defaultCols, DEFAULT_COLS),
72
+ rows: dimension(deps.ctx.defaultRows, DEFAULT_ROWS),
73
+ cwd: target.cwd,
74
+ // Persistent watches carry no deadline: omit timeoutMs entirely.
75
+ });
76
+ }
77
+ catch {
78
+ return LOST;
79
+ }
80
+ deps.registry.register({
81
+ id: spawned.id,
82
+ monitorId: monitor.monitorId,
83
+ description: monitor.description,
84
+ runtime: spawned.runtime,
85
+ filter: compileFilter(monitor.filter),
86
+ // The persisted deadline rides through verbatim; a restore never extends it.
87
+ ...(monitor.expiresAt !== null ? { expiresAt: monitor.expiresAt } : {}),
88
+ });
89
+ deps.ctx.manager.bindMonitorId(monitor.monitorId, spawned.id);
90
+ deps.onRestored?.(monitor.monitorId, spawned.id);
91
+ // A persisted mute is re-applied by the FRESH runtime id; the registry resolves
92
+ // records by runtime id only, so the mon_ id would silently no-op here.
93
+ return { outcome: reapplyPersistedMute(deps.registry, monitor, spawned.id) };
94
+ };
95
+ }
96
+ //# sourceMappingURL=durable-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-command.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/durable-command.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * The `restartable-command` durability class: the restore handler that brings a persistent\n * command monitor back after a restart. It re-spawns the saved command EXACTLY ONCE, in the\n * saved working directory, with NO timeout (a persistent watch has no deadline), and\n * re-registers it under the SAVED `mon_` id so the stable handle the agent already knows\n * keeps resolving. Nothing the pre-restart PTY produced is replayed — no output is persisted\n * anywhere, so a restored watch starts from an empty buffer by construction.\n */\n\nimport { stat } from \"node:fs/promises\";\nimport { isAbsolute } from \"node:path\";\nimport type { MonitorRegistry } from \"./monitor-registry.ts\";\nimport { type RestoreHandler, type RestoreHandlerResult, reapplyPersistedMute } from \"./restore.ts\";\nimport { DEFAULT_COLS, DEFAULT_ROWS } from \"./shared.ts\";\nimport type { ManifestMonitor } from \"./terminal-manifest.ts\";\nimport type { TerminalToolContext } from \"./tools/context.ts\";\nimport { spawnCommandSession } from \"./tools/spawn.ts\";\n\nexport interface RestartableCommandDeps {\n\t/** Spawn target: supplies the terminal manager, shell config, env and default geometry. */\n\treadonly ctx: TerminalToolContext;\n\t/** The live registry this generation owns; the restored watch is registered here. */\n\treadonly registry: MonitorRegistry;\n\t/** Seam for tests and future callers; defaults to the real PTY spawn. */\n\treadonly spawn?: typeof spawnCommandSession;\n\t/** Directory existence probe; defaults to a real stat of the saved cwd. */\n\treadonly directoryExists?: (path: string) => Promise<boolean>;\n\t/** Called after a successful restore with the stable id and its fresh runtime id. */\n\treadonly onRestored?: (monitorId: string, runtimeId: string) => void;\n}\n\nconst LOST: RestoreHandlerResult = { outcome: \"lost\" };\n\nasync function defaultDirectoryExists(path: string): Promise<boolean> {\n\ttry {\n\t\treturn (await stat(path)).isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction compileFilter(source: string | undefined): RegExp | undefined {\n\tif (source === undefined) return undefined;\n\ttry {\n\t\treturn new RegExp(source);\n\t} catch {\n\t\t// A filter that no longer compiles must not sink the watch: restore it unfiltered.\n\t\treturn undefined;\n\t}\n}\n\nfunction dimension(value: number | undefined, fallback: number): number {\n\treturn value !== undefined && Number.isFinite(value) && value >= 1 ? Math.trunc(value) : fallback;\n}\n\n/**\n * Decide whether a manifest entry is a restorable persistent command watch. Only the\n * command runtime kind qualifies, only when it was created `persistent: true` (a\n * non-persistent watch had a deadline and is deliberately not resurrected), and only\n * when it actually carries a command and an absolute cwd to spawn it in.\n */\nfunction restorable(monitor: ManifestMonitor): { command: string; cwd: string } | undefined {\n\tif (monitor.runtimeKind !== \"command\" || !monitor.persistent) return undefined;\n\tconst { command, cwd } = monitor;\n\tif (command === undefined || command.length === 0) return undefined;\n\tif (cwd === undefined || !isAbsolute(cwd)) return undefined;\n\treturn { command, cwd };\n}\n\n/**\n * Build the `restartable-command` restore handler. Every guard rejects BEFORE spawning, so a\n * rejected entry costs zero PTY sessions; a spawn failure is reported lost rather than thrown,\n * because restore must never fail the startup path for one unrecoverable watch.\n */\nexport function createRestartableCommandHandler(deps: RestartableCommandDeps): RestoreHandler {\n\tconst spawn = deps.spawn ?? spawnCommandSession;\n\tconst directoryExists = deps.directoryExists ?? defaultDirectoryExists;\n\treturn async (monitor: ManifestMonitor): Promise<RestoreHandlerResult> => {\n\t\tconst target = restorable(monitor);\n\t\tif (target === undefined) return LOST;\n\t\tif (!(await directoryExists(target.cwd))) return LOST;\n\n\t\tlet spawned: Awaited<ReturnType<typeof spawnCommandSession>>;\n\t\ttry {\n\t\t\tspawned = await spawn(deps.ctx, {\n\t\t\t\tcommand: target.command,\n\t\t\t\tcols: dimension(deps.ctx.defaultCols, DEFAULT_COLS),\n\t\t\t\trows: dimension(deps.ctx.defaultRows, DEFAULT_ROWS),\n\t\t\t\tcwd: target.cwd,\n\t\t\t\t// Persistent watches carry no deadline: omit timeoutMs entirely.\n\t\t\t});\n\t\t} catch {\n\t\t\treturn LOST;\n\t\t}\n\n\t\tdeps.registry.register({\n\t\t\tid: spawned.id,\n\t\t\tmonitorId: monitor.monitorId,\n\t\t\tdescription: monitor.description,\n\t\t\truntime: spawned.runtime,\n\t\t\tfilter: compileFilter(monitor.filter),\n\t\t\t// The persisted deadline rides through verbatim; a restore never extends it.\n\t\t\t...(monitor.expiresAt !== null ? { expiresAt: monitor.expiresAt } : {}),\n\t\t});\n\t\tdeps.ctx.manager.bindMonitorId(monitor.monitorId, spawned.id);\n\t\tdeps.onRestored?.(monitor.monitorId, spawned.id);\n\t\t// A persisted mute is re-applied by the FRESH runtime id; the registry resolves\n\t\t// records by runtime id only, so the mon_ id would silently no-op here.\n\t\treturn { outcome: reapplyPersistedMute(deps.registry, monitor, spawned.id) };\n\t};\n}\n"]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The `checkpointed-file` durability class: the restore handler that makes a persistent file
3
+ * watch survive a restart. On create the monitor tool persists the registry's own identity
4
+ * tuple (dev/ino/size/mtimeMs/digest/present) as the manifest checkpoint; here that checkpoint
5
+ * is compared ONCE against the file as it is now, and any change that happened while the process
6
+ * was gone is reported as EXACTLY ONE line through the registry's normal event sink — so the
7
+ * notifier's coalescing and wake budget apply to it exactly as they do to a live watch event.
8
+ *
9
+ * `digest` is load-bearing: without it a same-size, same-mtime rewrite is invisible across a restart.
10
+ */
11
+ import type { MonitorRegistry } from "./monitor-registry.ts";
12
+ import type { RestoreHandler } from "./restore.ts";
13
+ import type { TerminalManifestCheckpoint, TerminalManifestWriter } from "./terminal-manifest.ts";
14
+ /**
15
+ * What a detached change is reported as. `null` means the file is byte-identical to the checkpoint;
16
+ * `"gone"` means it existed at checkpoint time and does not now, which is not restorable.
17
+ */
18
+ export type DetachedChange = "created" | "replaced" | "modified" | "gone" | null;
19
+ /** Only what the handler needs, so a caller can hand it a narrower registry/writer. */
20
+ export interface CheckpointedFileRestoreDeps {
21
+ readonly registry: Pick<MonitorRegistry, "registerFile" | "fileCheckpoint" | "emitFileLine" | "stopFile">;
22
+ /** Optional: the durable checkpoint is re-persisted through the writer when one is bound. */
23
+ readonly writer?: Pick<TerminalManifestWriter, "scheduleCheckpoint">;
24
+ /** Optional: re-bind the stable `mon_` id to its fresh runtime id so kill_bash keeps resolving it. */
25
+ readonly bindMonitorId?: (monitorId: string, runtimeId: string) => void;
26
+ readonly now?: () => number;
27
+ }
28
+ /** The live tuple `registry.fileCheckpoint` returns; identical in shape to the persisted checkpoint. */
29
+ type LiveCheckpoint = NonNullable<ReturnType<MonitorRegistry["fileCheckpoint"]>>;
30
+ /**
31
+ * The single comparison, run once per restore. `created` and `replaced` outrank `modified`:
32
+ * an absent→present transition or a new dev/ino is a stronger statement about the same file.
33
+ */
34
+ export declare function classifyDetachedChange(saved: TerminalManifestCheckpoint, live: LiveCheckpoint): DetachedChange;
35
+ /**
36
+ * Build the `checkpointed-file` restore handler. It re-registers the watch under its original
37
+ * `mon_` id and approved parent (so the permission decision still holds), then reports at most
38
+ * one detached-change line. Returns `lost` when the path is gone or unreadable, `restored` otherwise.
39
+ */
40
+ export declare function createCheckpointedFileRestoreHandler(deps: CheckpointedFileRestoreDeps): RestoreHandler;
41
+ export {};
42
+ //# sourceMappingURL=durable-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-file.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/durable-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAmB,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAElH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;AAEjF,uFAAuF;AACvF,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,UAAU,CAAC,CAAC;IAC1G,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IACrE,sGAAsG;IACtG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED,wGAAwG;AACxG,KAAK,cAAc,GAAG,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,cAAc,GAAG,cAAc,CAM9G;AAcD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,IAAI,EAAE,2BAA2B,GAAG,cAAc,CAwDtG"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * The `checkpointed-file` durability class: the restore handler that makes a persistent file
3
+ * watch survive a restart. On create the monitor tool persists the registry's own identity
4
+ * tuple (dev/ino/size/mtimeMs/digest/present) as the manifest checkpoint; here that checkpoint
5
+ * is compared ONCE against the file as it is now, and any change that happened while the process
6
+ * was gone is reported as EXACTLY ONE line through the registry's normal event sink — so the
7
+ * notifier's coalescing and wake budget apply to it exactly as they do to a live watch event.
8
+ *
9
+ * `digest` is load-bearing: without it a same-size, same-mtime rewrite is invisible across a restart.
10
+ */
11
+ import { stat } from "node:fs/promises";
12
+ import { resolve } from "node:path";
13
+ /**
14
+ * The single comparison, run once per restore. `created` and `replaced` outrank `modified`:
15
+ * an absent→present transition or a new dev/ino is a stronger statement about the same file.
16
+ */
17
+ export function classifyDetachedChange(saved, live) {
18
+ if (!saved.present)
19
+ return live.present ? "created" : null;
20
+ if (!live.present)
21
+ return "gone";
22
+ if (live.dev !== saved.dev || live.ino !== saved.ino)
23
+ return "replaced";
24
+ if (live.mtimeMs !== saved.mtimeMs || live.size !== saved.size || live.digest !== saved.digest)
25
+ return "modified";
26
+ return null;
27
+ }
28
+ function lost(reason) {
29
+ return { outcome: "lost", reason };
30
+ }
31
+ /** Remaining lifetime of a durable watch; a watch with no recorded expiry keeps its default window. */
32
+ function remainingMs(monitor, now) {
33
+ if (monitor.expiresAt === null)
34
+ return DEFAULT_RESTORED_WATCH_MS;
35
+ return Math.max(1, monitor.expiresAt - now);
36
+ }
37
+ const DEFAULT_RESTORED_WATCH_MS = 300_000;
38
+ /**
39
+ * Build the `checkpointed-file` restore handler. It re-registers the watch under its original
40
+ * `mon_` id and approved parent (so the permission decision still holds), then reports at most
41
+ * one detached-change line. Returns `lost` when the path is gone or unreadable, `restored` otherwise.
42
+ */
43
+ export function createCheckpointedFileRestoreHandler(deps) {
44
+ const now = deps.now ?? Date.now;
45
+ return async (monitor) => {
46
+ if (monitor.runtimeKind !== "file" || monitor.path === undefined || monitor.cwd === undefined) {
47
+ return lost(`monitor ${monitor.monitorId} is not a restorable file watch`);
48
+ }
49
+ const saved = monitor.lastCheckpoint;
50
+ if (saved === null)
51
+ return lost(`monitor ${monitor.monitorId} has no checkpoint to compare against`);
52
+ // A watch whose file existed at checkpoint time but is gone or unreadable now cannot be
53
+ // resumed; probe BEFORE re-registering so a lost restore never leaves a live watch behind.
54
+ if (saved.present) {
55
+ try {
56
+ const target = await stat(resolve(monitor.cwd, monitor.path));
57
+ if (!target.isFile())
58
+ return lost(`watched path is no longer a regular file: ${monitor.path}`);
59
+ }
60
+ catch (error) {
61
+ return lost(`watched path is gone: ${monitor.path} (${error instanceof Error ? error.message : error})`);
62
+ }
63
+ }
64
+ let runtimeId;
65
+ try {
66
+ const registered = await deps.registry.registerFile({
67
+ description: monitor.description,
68
+ path: monitor.path,
69
+ monitorId: monitor.monitorId,
70
+ event: monitor.event ?? "create",
71
+ timeoutMs: remainingMs(monitor, now()),
72
+ cwd: monitor.cwd,
73
+ // Preserve the parent approved at permission time: registerFile re-checks it.
74
+ ...(monitor.approvedParent !== undefined ? { approvedParent: monitor.approvedParent } : {}),
75
+ // The persisted deadline rides through verbatim; a restore never extends it.
76
+ ...(monitor.expiresAt !== null ? { expiresAt: monitor.expiresAt } : {}),
77
+ });
78
+ runtimeId = registered.id;
79
+ }
80
+ catch (error) {
81
+ return lost(`cannot re-watch ${monitor.path}: ${error instanceof Error ? error.message : String(error)}`);
82
+ }
83
+ const live = deps.registry.fileCheckpoint(runtimeId);
84
+ if (live === undefined)
85
+ return lost(`monitor ${monitor.monitorId} settled before its checkpoint was compared`);
86
+ const change = classifyDetachedChange(saved, live);
87
+ if (change === "gone") {
88
+ // Lost the race with a deletion between the probe and re-registration: report lost, not a
89
+ // change, and settle the watch just registered so a lost restore leaves nothing behind.
90
+ await deps.registry.stopFile(runtimeId);
91
+ return lost(`watched path is gone: ${monitor.path}`);
92
+ }
93
+ deps.bindMonitorId?.(monitor.monitorId, runtimeId);
94
+ if (change !== null)
95
+ deps.registry.emitFileLine(runtimeId, `changed while detached: ${change} ${monitor.path}`);
96
+ // Re-checkpoint on every restore: after `replaced` this is the new identity, and otherwise
97
+ // it re-states the tuple the next restart compares against.
98
+ deps.writer?.scheduleCheckpoint(monitor.monitorId, live);
99
+ return { outcome: "restored" };
100
+ };
101
+ }
102
+ //# sourceMappingURL=durable-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-file.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/durable-file.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * The `checkpointed-file` durability class: the restore handler that makes a persistent file\n * watch survive a restart. On create the monitor tool persists the registry's own identity\n * tuple (dev/ino/size/mtimeMs/digest/present) as the manifest checkpoint; here that checkpoint\n * is compared ONCE against the file as it is now, and any change that happened while the process\n * was gone is reported as EXACTLY ONE line through the registry's normal event sink — so the\n * notifier's coalescing and wake budget apply to it exactly as they do to a live watch event.\n *\n * `digest` is load-bearing: without it a same-size, same-mtime rewrite is invisible across a restart.\n */\n\nimport { stat } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { MonitorRegistry } from \"./monitor-registry.ts\";\nimport type { RestoreHandler, RestoreHandlerResult } from \"./restore.ts\";\nimport type { ManifestMonitor, TerminalManifestCheckpoint, TerminalManifestWriter } from \"./terminal-manifest.ts\";\n\n/**\n * What a detached change is reported as. `null` means the file is byte-identical to the checkpoint;\n * `\"gone\"` means it existed at checkpoint time and does not now, which is not restorable.\n */\nexport type DetachedChange = \"created\" | \"replaced\" | \"modified\" | \"gone\" | null;\n\n/** Only what the handler needs, so a caller can hand it a narrower registry/writer. */\nexport interface CheckpointedFileRestoreDeps {\n\treadonly registry: Pick<MonitorRegistry, \"registerFile\" | \"fileCheckpoint\" | \"emitFileLine\" | \"stopFile\">;\n\t/** Optional: the durable checkpoint is re-persisted through the writer when one is bound. */\n\treadonly writer?: Pick<TerminalManifestWriter, \"scheduleCheckpoint\">;\n\t/** Optional: re-bind the stable `mon_` id to its fresh runtime id so kill_bash keeps resolving it. */\n\treadonly bindMonitorId?: (monitorId: string, runtimeId: string) => void;\n\treadonly now?: () => number;\n}\n\n/** The live tuple `registry.fileCheckpoint` returns; identical in shape to the persisted checkpoint. */\ntype LiveCheckpoint = NonNullable<ReturnType<MonitorRegistry[\"fileCheckpoint\"]>>;\n\n/**\n * The single comparison, run once per restore. `created` and `replaced` outrank `modified`:\n * an absent→present transition or a new dev/ino is a stronger statement about the same file.\n */\nexport function classifyDetachedChange(saved: TerminalManifestCheckpoint, live: LiveCheckpoint): DetachedChange {\n\tif (!saved.present) return live.present ? \"created\" : null;\n\tif (!live.present) return \"gone\";\n\tif (live.dev !== saved.dev || live.ino !== saved.ino) return \"replaced\";\n\tif (live.mtimeMs !== saved.mtimeMs || live.size !== saved.size || live.digest !== saved.digest) return \"modified\";\n\treturn null;\n}\n\nfunction lost(reason: string): RestoreHandlerResult {\n\treturn { outcome: \"lost\", reason };\n}\n\n/** Remaining lifetime of a durable watch; a watch with no recorded expiry keeps its default window. */\nfunction remainingMs(monitor: ManifestMonitor, now: number): number {\n\tif (monitor.expiresAt === null) return DEFAULT_RESTORED_WATCH_MS;\n\treturn Math.max(1, monitor.expiresAt - now);\n}\n\nconst DEFAULT_RESTORED_WATCH_MS = 300_000;\n\n/**\n * Build the `checkpointed-file` restore handler. It re-registers the watch under its original\n * `mon_` id and approved parent (so the permission decision still holds), then reports at most\n * one detached-change line. Returns `lost` when the path is gone or unreadable, `restored` otherwise.\n */\nexport function createCheckpointedFileRestoreHandler(deps: CheckpointedFileRestoreDeps): RestoreHandler {\n\tconst now = deps.now ?? Date.now;\n\treturn async (monitor: ManifestMonitor): Promise<RestoreHandlerResult> => {\n\t\tif (monitor.runtimeKind !== \"file\" || monitor.path === undefined || monitor.cwd === undefined) {\n\t\t\treturn lost(`monitor ${monitor.monitorId} is not a restorable file watch`);\n\t\t}\n\t\tconst saved = monitor.lastCheckpoint;\n\t\tif (saved === null) return lost(`monitor ${monitor.monitorId} has no checkpoint to compare against`);\n\t\t// A watch whose file existed at checkpoint time but is gone or unreadable now cannot be\n\t\t// resumed; probe BEFORE re-registering so a lost restore never leaves a live watch behind.\n\t\tif (saved.present) {\n\t\t\ttry {\n\t\t\t\tconst target = await stat(resolve(monitor.cwd, monitor.path));\n\t\t\t\tif (!target.isFile()) return lost(`watched path is no longer a regular file: ${monitor.path}`);\n\t\t\t} catch (error) {\n\t\t\t\treturn lost(`watched path is gone: ${monitor.path} (${error instanceof Error ? error.message : error})`);\n\t\t\t}\n\t\t}\n\n\t\tlet runtimeId: string;\n\t\ttry {\n\t\t\tconst registered = await deps.registry.registerFile({\n\t\t\t\tdescription: monitor.description,\n\t\t\t\tpath: monitor.path,\n\t\t\t\tmonitorId: monitor.monitorId,\n\t\t\t\tevent: monitor.event ?? \"create\",\n\t\t\t\ttimeoutMs: remainingMs(monitor, now()),\n\t\t\t\tcwd: monitor.cwd,\n\t\t\t\t// Preserve the parent approved at permission time: registerFile re-checks it.\n\t\t\t\t...(monitor.approvedParent !== undefined ? { approvedParent: monitor.approvedParent } : {}),\n\t\t\t\t// The persisted deadline rides through verbatim; a restore never extends it.\n\t\t\t\t...(monitor.expiresAt !== null ? { expiresAt: monitor.expiresAt } : {}),\n\t\t\t});\n\t\t\truntimeId = registered.id;\n\t\t} catch (error) {\n\t\t\treturn lost(`cannot re-watch ${monitor.path}: ${error instanceof Error ? error.message : String(error)}`);\n\t\t}\n\n\t\tconst live = deps.registry.fileCheckpoint(runtimeId);\n\t\tif (live === undefined) return lost(`monitor ${monitor.monitorId} settled before its checkpoint was compared`);\n\n\t\tconst change = classifyDetachedChange(saved, live);\n\t\tif (change === \"gone\") {\n\t\t\t// Lost the race with a deletion between the probe and re-registration: report lost, not a\n\t\t\t// change, and settle the watch just registered so a lost restore leaves nothing behind.\n\t\t\tawait deps.registry.stopFile(runtimeId);\n\t\t\treturn lost(`watched path is gone: ${monitor.path}`);\n\t\t}\n\n\t\tdeps.bindMonitorId?.(monitor.monitorId, runtimeId);\n\t\tif (change !== null) deps.registry.emitFileLine(runtimeId, `changed while detached: ${change} ${monitor.path}`);\n\t\t// Re-checkpoint on every restore: after `replaced` this is the new identity, and otherwise\n\t\t// it re-states the tuple the next restart compares against.\n\t\tdeps.writer?.scheduleCheckpoint(monitor.monitorId, live);\n\t\treturn { outcome: \"restored\" };\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAsKrE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA2GhE;AAED,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/extension.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAiXrE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA4IhE;AAED,eAAe,yBAAyB,CAAC"}
@@ -1,26 +1,43 @@
1
+ import { isAbsolute, join } from "node:path";
1
2
  import { getShellEnv } from "../../../../utils/shell.js";
3
+ import { encodedSessionId } from "../../../session-sidecar-store.js";
2
4
  import { SettingsManager } from "../../../settings-manager.js";
3
5
  import { isAnthropicBashEnabled } from "../anthropic-bash/index.js";
4
6
  import { isEvalOnlyRouting } from "../eval-only-routing.js";
5
7
  import { TERMINAL_MONITOR_STATE_EVENT, WAKE_SOURCE_STATE_EVENT } from "../monitor-state-event.js";
8
+ import { createRestartableCommandHandler } from "./durable-command.js";
9
+ import { createCheckpointedFileRestoreHandler } from "./durable-file.js";
10
+ import { acquireTerminalLease, releaseTerminalLease } from "./manifest-lease.js";
6
11
  import { MonitorNotifier } from "./monitor-notify.js";
7
12
  import { MONITOR_STATUS_KEY } from "./monitor-status.js";
8
13
  import { MonitorStatusTicker } from "./monitor-status-ticker.js";
9
- import { TerminalNotifier } from "./notify.js";
14
+ import { getTerminalNotificationDelivery, TerminalNotifier } from "./notify.js";
10
15
  import { buildTerminalPromptSection } from "./prompt.js";
16
+ import { reapplyPersistedMute, restoreTerminalState, } from "./restore.js";
11
17
  import { claimParkedBundle, parkBundle, TerminalSessionBundle, teardownParkedBundle, } from "./session-bundle.js";
12
18
  import { loadTerminalSettings, TERMINAL_SETTINGS_DEFAULTS } from "./settings.js";
13
19
  import { TERMINAL_BASH_TOOL, TERMINAL_COMPANION_TOOLS } from "./shared.js";
20
+ import { TerminalManifestWriter } from "./terminal-manifest.js";
14
21
  import { createPtyBashTool } from "./tools/bash.js";
15
22
  import { createBashInputTool } from "./tools/bash-input.js";
16
23
  import { createBashOutputTool } from "./tools/bash-output.js";
17
24
  import { createBashResizeTool } from "./tools/bash-resize.js";
18
25
  import { createKillBashTool } from "./tools/kill-bash.js";
19
- import { createMonitorTool } from "./tools/monitor.js";
26
+ import { bindTerminalManifestWriter, createMonitorTool, unbindTerminalManifestWriter } from "./tools/monitor.js";
20
27
  /** Tests and SDK callers may hand partial contexts without a session manager. */
21
28
  function sessionKeyOf(ctx) {
22
29
  return ctx?.sessionManager?.getSessionId?.();
23
30
  }
31
+ /**
32
+ * Per-session persistence dir for the terminal lease + manifest; undefined when the context
33
+ * carries no durable session dir (SDK/in-memory sessions must not persist terminal state).
34
+ */
35
+ function terminalStateDir(ctx) {
36
+ const sessionDir = ctx?.sessionManager?.getSessionDir?.();
37
+ if (sessionDir === undefined || sessionDir.length === 0 || !isAbsolute(sessionDir))
38
+ return undefined;
39
+ return join(sessionDir, "extensions", "terminal");
40
+ }
24
41
  function createBundle(state) {
25
42
  return new TerminalSessionBundle({
26
43
  maxSessions: state.settings.maxSessions,
@@ -53,6 +70,8 @@ function bundleSinks(pi, state) {
53
70
  startedAtMs: entry.startedAtMs,
54
71
  })),
55
72
  });
73
+ if (state.manifestWriter)
74
+ void state.manifestWriter.observeMonitorState(snapshot);
56
75
  },
57
76
  onBackgroundState: (snapshot) => {
58
77
  pi.events?.emit(WAKE_SOURCE_STATE_EVENT, {
@@ -60,8 +79,22 @@ function bundleSinks(pi, state) {
60
79
  activeCount: snapshot.length,
61
80
  items: snapshot,
62
81
  });
82
+ const writer = state.manifestWriter;
83
+ if (!writer)
84
+ return;
85
+ for (const entry of snapshot) {
86
+ if (state.recordedBackgroundIds.has(entry.id))
87
+ continue;
88
+ state.recordedBackgroundIds.add(entry.id);
89
+ void writer.recordBackgroundStart(entry.id, entry.description ?? entry.id, entry.startedAtMs);
90
+ }
91
+ },
92
+ onBackgroundExit: (id, runtime) => {
93
+ state.recordedBackgroundIds.delete(id);
94
+ if (state.manifestWriter)
95
+ void state.manifestWriter.recordBackgroundExit(id);
96
+ state.notifier?.notifyCompletion(id, runtime);
63
97
  },
64
- onBackgroundExit: (id, runtime) => state.notifier?.notifyCompletion(id, runtime),
65
98
  };
66
99
  }
67
100
  function buildToolContext(pi, state) {
@@ -141,6 +174,160 @@ function syncToolset(pi, state) {
141
174
  state.steppedAside = stepAside;
142
175
  pi.setActiveTools([...active]);
143
176
  }
177
+ /** Send one model-visible terminal reminder; suppressed by notify `off` and non-interactive modes. */
178
+ function sendTerminalReminder(pi, state, sentence) {
179
+ getTerminalNotificationDelivery({
180
+ sendMessage: (message, options) => pi.sendMessage(message, options),
181
+ getContext: () => state.ctx,
182
+ getMode: () => state.settings.notify,
183
+ })?.send(`<system-reminder>${sentence}</system-reminder>`);
184
+ }
185
+ function clauseWithDescriptions(label, count, descriptions) {
186
+ return descriptions.length > 0 ? `${label} ${count} (${descriptions.join(", ")})` : `${label} ${count}`;
187
+ }
188
+ /**
189
+ * The ONE coalesced restore digest. Counts come from the restore orchestrator; descriptions
190
+ * are attributed per manifest entry so the sentence stays a single message however many
191
+ * monitors there are. Empty clauses are omitted; undefined when there is nothing to report.
192
+ */
193
+ function restoreDigestSentence(digest, restoredDescriptions, lostDescriptions) {
194
+ const clauses = [];
195
+ if (digest.restored > 0)
196
+ clauses.push(clauseWithDescriptions("restored", digest.restored, restoredDescriptions));
197
+ if (digest.lost > 0)
198
+ clauses.push(clauseWithDescriptions("lost", digest.lost, lostDescriptions));
199
+ if (digest.expired > 0)
200
+ clauses.push(`expired ${digest.expired}`);
201
+ if (digest.muted > 0)
202
+ clauses.push(`${digest.muted} still muted`);
203
+ if (clauses.length === 0)
204
+ return undefined;
205
+ return `Terminal state after restart: ${clauses.join("; ")}.`;
206
+ }
207
+ /**
208
+ * Non-reload startup: acquire the persistence lease, then restore from the manifest and
209
+ * deliver EXACTLY ONE coalesced digest. A live foreign holder keeps its lease and gets one
210
+ * attached-elsewhere reminder; an unreadable manifest fails closed with one notice and no
211
+ * restore attempt. Only the lease owner records manifest state afterwards.
212
+ */
213
+ async function adoptPersistedTerminalState(pi, state, toolCtx, bundle, sessionKey) {
214
+ const ctx = state.ctx;
215
+ const dir = terminalStateDir(ctx);
216
+ if (dir === undefined || !ctx?.sessionManager)
217
+ return;
218
+ const lease = await acquireTerminalLease({ dir, encodedSessionId: sessionKey });
219
+ if (!lease.acquired) {
220
+ sendTerminalReminder(pi, state, `Terminal monitors for this session are attached in another live process (pid ${lease.holder.pid}); nothing was restored here.`);
221
+ return;
222
+ }
223
+ state.lease = { path: lease.path, pid: lease.pid };
224
+ const writer = new TerminalManifestWriter({ session: ctx.sessionManager });
225
+ state.manifestWriter = writer;
226
+ state.recordedBackgroundIds.clear();
227
+ bindTerminalManifestWriter(sessionKey, writer);
228
+ // The real durability handlers, built from what this restore site already owns: the live
229
+ // registry/manager of the bundle created for this generation, plus the manifest writer.
230
+ // Each monitor's REAL outcome is recorded so the digest attributes descriptions correctly.
231
+ const nowMs = Date.now();
232
+ const outcomesById = new Map();
233
+ const registry = bundle.monitors;
234
+ const record = (handler) => {
235
+ return async (monitor) => {
236
+ const result = await handler(monitor);
237
+ outcomesById.set(monitor.monitorId, result.outcome);
238
+ // Re-adopt every entry that is LIVE in this generation, so the next persist rewrites
239
+ // the manifest with it instead of erasing it: `restored` and `muted` both describe a
240
+ // live monitor (a mute only silences delivery). `lost`/`expired`/`attachedElsewhere`
241
+ // are deliberately not adopted — nothing is running for them here.
242
+ if (result.outcome === "restored" || result.outcome === "muted") {
243
+ writer.adoptRestored(monitor);
244
+ // Re-bind the persisted fire budget so a restart cannot hand the watch a fresh window.
245
+ registry.adoptFireWindow(monitor.monitorId, monitor.fireWindow);
246
+ }
247
+ return result;
248
+ };
249
+ };
250
+ const restartableCommand = createRestartableCommandHandler({ ctx: toolCtx, registry });
251
+ // The file handler re-binds the mon_ id to the fresh runtime id; capture that id here so a
252
+ // persisted mute is re-applied by the runtime id the registry can actually resolve.
253
+ let freshFileRuntimeId;
254
+ const checkpointedFile = createCheckpointedFileRestoreHandler({
255
+ registry,
256
+ writer,
257
+ bindMonitorId: (monitorId, runtimeId) => {
258
+ freshFileRuntimeId = runtimeId;
259
+ bundle.manager.bindMonitorId(monitorId, runtimeId);
260
+ },
261
+ now: () => nowMs,
262
+ });
263
+ const handlers = {
264
+ "restartable-command": record(restartableCommand),
265
+ "checkpointed-file": record(async (monitor) => {
266
+ freshFileRuntimeId = undefined;
267
+ const result = await checkpointedFile(monitor);
268
+ if (result.outcome !== "restored" || freshFileRuntimeId === undefined)
269
+ return result;
270
+ return { ...result, outcome: reapplyPersistedMute(registry, monitor, freshFileRuntimeId) };
271
+ }),
272
+ };
273
+ const digest = await restoreTerminalState({ manifest: writer.store, handlers, now: () => nowMs });
274
+ let manifest = null;
275
+ let unreadable = digest.storeError;
276
+ if (!unreadable) {
277
+ try {
278
+ manifest = await writer.store.read();
279
+ }
280
+ catch {
281
+ unreadable = true;
282
+ }
283
+ }
284
+ if (unreadable) {
285
+ sendTerminalReminder(pi, state, "Terminal state after restart: the persisted terminal manifest is corrupt; nothing was restored here (fail closed).");
286
+ return;
287
+ }
288
+ if (manifest === null)
289
+ return; // nothing was ever persisted for this session
290
+ const restoredDescriptions = [];
291
+ const lostDescriptions = [];
292
+ for (const monitor of manifest.monitors) {
293
+ // Same boundary as the restore orchestrator: at the deadline the entry is expired.
294
+ if (monitor.expiresAt !== null && monitor.expiresAt <= nowMs)
295
+ continue;
296
+ const outcome = outcomesById.get(monitor.monitorId);
297
+ // Only `restored` and `lost` carry descriptions; a muted restore is reported by its own
298
+ // count clause, so naming it under either list would desync the clause counts.
299
+ if (outcome === "restored")
300
+ restoredDescriptions.push(monitor.description);
301
+ else if (outcome === undefined || outcome === "lost")
302
+ lostDescriptions.push(monitor.description);
303
+ }
304
+ for (const background of manifest.backgroundSessions)
305
+ lostDescriptions.push(background.command);
306
+ const sentence = restoreDigestSentence(digest, restoredDescriptions, lostDescriptions);
307
+ if (sentence !== undefined)
308
+ sendTerminalReminder(pi, state, sentence);
309
+ }
310
+ /** Detach the manifest recorder without writing (a reload keeps live state instead). */
311
+ function detachManifestWriter(state, sessionKey) {
312
+ state.manifestWriter = null;
313
+ state.recordedBackgroundIds.clear();
314
+ if (sessionKey !== undefined)
315
+ unbindTerminalManifestWriter(sessionKey);
316
+ }
317
+ /**
318
+ * Shutdown view of the manifest: recordShutdown absorbs pending checkpoints, marks every
319
+ * live monitor `suspended`, and persists in one write. Detach FIRST so bundle teardown's
320
+ * empty-registry sync cannot touch the recorder afterwards.
321
+ */
322
+ async function suspendAndFlushManifest(state, sessionKey) {
323
+ const writer = state.manifestWriter;
324
+ // Final live-state sync: the shutdown write must carry each watch's burned fire window.
325
+ if (writer && state.bundle)
326
+ await writer.observeMonitorState(state.bundle.monitors.snapshot());
327
+ detachManifestWriter(state, sessionKey);
328
+ if (writer)
329
+ await writer.recordShutdown();
330
+ }
144
331
  export function registerTerminalExtension(pi) {
145
332
  const state = {
146
333
  bundle: null,
@@ -159,6 +346,9 @@ export function registerTerminalExtension(pi) {
159
346
  shellPath: undefined,
160
347
  steppedAside: false,
161
348
  noticeShown: false,
349
+ lease: null,
350
+ manifestWriter: null,
351
+ recordedBackgroundIds: new Set(),
162
352
  };
163
353
  const toolCtx = buildToolContext(pi, state);
164
354
  pi.registerTool(createPtyBashTool(toolCtx));
@@ -201,6 +391,19 @@ export function registerTerminalExtension(pi) {
201
391
  }
202
392
  state.bundle ??= createBundle(state);
203
393
  state.bundle.bind(bundleSinks(pi, state));
394
+ if (event.reason === "reload") {
395
+ // Park/claim and the lease stay untouched: the same pid keeps holding it. The
396
+ // reload generation only rebinds the recorder so manifest coverage continues.
397
+ if (sessionKey !== undefined && terminalStateDir(ctx) !== undefined) {
398
+ const writer = new TerminalManifestWriter({ session: ctx.sessionManager });
399
+ state.manifestWriter = writer;
400
+ state.recordedBackgroundIds.clear();
401
+ bindTerminalManifestWriter(sessionKey, writer);
402
+ }
403
+ }
404
+ else if (sessionKey !== undefined) {
405
+ await adoptPersistedTerminalState(pi, state, toolCtx, state.bundle, sessionKey);
406
+ }
204
407
  syncToolset(pi, state);
205
408
  });
206
409
  pi.on("model_select", async (event, ctx) => {
@@ -234,10 +437,30 @@ export function registerTerminalExtension(pi) {
234
437
  if (event.reason === "reload" && state.bundle && sessionKey !== undefined) {
235
438
  // Keep state.bundle referenced: exit listeners captured by this instance's tool
236
439
  // context still route through the shared bundle after the new owner claims it.
440
+ // The lease is deliberately NOT released: the same pid keeps it across the reload.
441
+ detachManifestWriter(state, sessionKey);
237
442
  state.bundle.park();
238
443
  await parkBundle(sessionKey, state.bundle);
239
444
  return;
240
445
  }
446
+ if (sessionKey !== undefined)
447
+ await suspendAndFlushManifest(state, sessionKey);
448
+ const lease = state.lease;
449
+ state.lease = null;
450
+ if (lease !== null) {
451
+ await releaseTerminalLease(lease);
452
+ }
453
+ else if (sessionKey !== undefined) {
454
+ const dir = terminalStateDir(ctx) ?? terminalStateDir(state.ctx);
455
+ // A reload generation inherits the pre-reload lease without re-acquiring it;
456
+ // releasing by (path, own pid) removes exactly that file and no foreign holder's.
457
+ if (dir !== undefined) {
458
+ await releaseTerminalLease({
459
+ path: join(dir, `${encodedSessionId(sessionKey)}.lease`),
460
+ pid: process.pid,
461
+ });
462
+ }
463
+ }
241
464
  const bundle = state.bundle;
242
465
  state.bundle = null;
243
466
  await bundle?.teardown();