stitchkit 0.132.2 → 0.133.0

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 (341) hide show
  1. package/CHANGELOG.md +181 -1
  2. package/dist/agent-executor/acp/v1-connect.d.ts +12 -1
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +3 -1
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-handlers.d.ts +9 -1
  7. package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
  8. package/dist/agent-executor/acp/v1-permission.d.ts +3 -2
  9. package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -1
  10. package/dist/agent-executor/acp/v1-probe.d.ts +10 -1
  11. package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -1
  12. package/dist/agent-executor/acp/v1-session.d.ts +11 -2
  13. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  14. package/dist/agent-executor/acp/v1-turn.d.ts +13 -10
  15. package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
  16. package/dist/agent-executor/claude/cli-driver.d.ts +6 -0
  17. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  18. package/dist/agent-executor/claude/record-router.d.ts +44 -0
  19. package/dist/agent-executor/claude/record-router.d.ts.map +1 -0
  20. package/dist/agent-executor/claude/session.d.ts +2 -0
  21. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  22. package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
  23. package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
  24. package/dist/agent-executor/claude-sdk/driver.d.ts +20 -2
  25. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  26. package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
  27. package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
  28. package/dist/agent-executor/claude-sdk/query-loop.d.ts +9 -7
  29. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  30. package/dist/agent-executor/claude-sdk/query-manager.d.ts +42 -0
  31. package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -0
  32. package/dist/agent-executor/claude-sdk/query-options.d.ts +4 -1
  33. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
  34. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  35. package/dist/agent-executor/codex/capabilities.d.ts +8 -0
  36. package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
  37. package/dist/agent-executor/codex/connect.d.ts +6 -1
  38. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  39. package/dist/agent-executor/codex/driver.d.ts +10 -0
  40. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  41. package/dist/agent-executor/codex/event-routing.d.ts +23 -1
  42. package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
  43. package/dist/agent-executor/codex/handlers.d.ts +24 -4
  44. package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
  45. package/dist/agent-executor/codex/limits.d.ts +17 -0
  46. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  47. package/dist/agent-executor/codex/request-answers.d.ts +23 -3
  48. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  49. package/dist/agent-executor/codex/session-bind.d.ts +6 -1
  50. package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
  51. package/dist/agent-executor/codex/session-types.d.ts +5 -1
  52. package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
  53. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  54. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
  55. package/dist/agent-executor/codex/shared-thread.d.ts +7 -7
  56. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
  57. package/dist/agent-executor/codex/thread-open.d.ts +12 -3
  58. package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
  59. package/dist/agent-executor/engine-requests.d.ts +42 -0
  60. package/dist/agent-executor/engine-requests.d.ts.map +1 -1
  61. package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
  62. package/dist/agent-executor/handoff.d.ts.map +1 -1
  63. package/dist/agent-executor/image-input.d.ts +6 -5
  64. package/dist/agent-executor/image-input.d.ts.map +1 -1
  65. package/dist/agent-executor/profile.d.ts +3 -5
  66. package/dist/agent-executor/profile.d.ts.map +1 -1
  67. package/dist/agent-executor/session-primitives.d.ts +64 -3
  68. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  69. package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
  70. package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
  71. package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
  72. package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
  73. package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
  74. package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
  75. package/dist/agent-executor/testing/conformance.d.ts +7 -2
  76. package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
  77. package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
  78. package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
  79. package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
  80. package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
  81. package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
  82. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
  83. package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
  84. package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
  85. package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
  86. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  87. package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
  88. package/dist/agent-runtime/sql-rows.d.ts +10 -10
  89. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  90. package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
  91. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  92. package/dist/browser/client.d.ts.map +1 -1
  93. package/dist/browser/operation-refusal.d.ts +10 -0
  94. package/dist/browser/operation-refusal.d.ts.map +1 -0
  95. package/dist/contract/client-types.d.ts +13 -4
  96. package/dist/contract/client-types.d.ts.map +1 -1
  97. package/dist/contract/define-validation.d.ts +6 -0
  98. package/dist/contract/define-validation.d.ts.map +1 -1
  99. package/dist/contract/define.d.ts +3 -0
  100. package/dist/contract/define.d.ts.map +1 -1
  101. package/dist/contract/errors-factory.d.ts +8 -2
  102. package/dist/contract/errors-factory.d.ts.map +1 -1
  103. package/dist/contract/errors.d.ts +9 -0
  104. package/dist/contract/errors.d.ts.map +1 -1
  105. package/dist/contract/fingerprint.d.ts +4 -1
  106. package/dist/contract/fingerprint.d.ts.map +1 -1
  107. package/dist/contract/operation-refusals.d.ts +51 -0
  108. package/dist/contract/operation-refusals.d.ts.map +1 -0
  109. package/dist/contract/tool-options.d.ts +4 -0
  110. package/dist/contract/tool-options.d.ts.map +1 -1
  111. package/dist/entrypoints/agent-executor/acp.js +254 -196
  112. package/dist/entrypoints/agent-executor/claude-sdk.js +467 -294
  113. package/dist/entrypoints/agent-executor/claude.js +130 -99
  114. package/dist/entrypoints/agent-executor/codex.js +441 -314
  115. package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
  116. package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
  117. package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
  118. package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
  119. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  120. package/dist/entrypoints/agent-executor/testing.js +413 -667
  121. package/dist/entrypoints/agent-executor.d.ts +1 -1
  122. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  123. package/dist/entrypoints/agent-executor.js +12 -12
  124. package/dist/entrypoints/agent-runtime/browser.js +2 -2
  125. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  126. package/dist/entrypoints/agent-runtime/harness.js +8 -8
  127. package/dist/entrypoints/agent-runtime/postgres.js +5 -5
  128. package/dist/entrypoints/agent-runtime/realtime.js +2 -2
  129. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  130. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  131. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  132. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  133. package/dist/entrypoints/agent-runtime.js +26 -18
  134. package/dist/entrypoints/application/grammy.js +1 -1
  135. package/dist/entrypoints/application.js +2 -2
  136. package/dist/entrypoints/cli.js +8 -8
  137. package/dist/entrypoints/contract.d.ts +3 -2
  138. package/dist/entrypoints/contract.d.ts.map +1 -1
  139. package/dist/entrypoints/contract.js +6 -4
  140. package/dist/entrypoints/files/packaging.d.ts +4 -1
  141. package/dist/entrypoints/files/packaging.d.ts.map +1 -1
  142. package/dist/entrypoints/files/packaging.js +868 -167
  143. package/dist/entrypoints/files.js +1 -1
  144. package/dist/entrypoints/handler.js +7 -7
  145. package/dist/entrypoints/http.js +2 -2
  146. package/dist/entrypoints/index.js +10 -8
  147. package/dist/entrypoints/node.js +11 -11
  148. package/dist/entrypoints/observability.js +1 -1
  149. package/dist/entrypoints/process/bootstrap.d.ts +3 -0
  150. package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
  151. package/dist/entrypoints/process/bootstrap.js +16 -0
  152. package/dist/entrypoints/process.js +7 -7
  153. package/dist/entrypoints/realtime.js +3 -3
  154. package/dist/entrypoints/remote.js +8 -7
  155. package/dist/entrypoints/server.js +30 -14
  156. package/dist/entrypoints/service-host/macos.js +72 -206
  157. package/dist/entrypoints/service-host/work.d.ts +15 -0
  158. package/dist/entrypoints/service-host/work.d.ts.map +1 -0
  159. package/dist/entrypoints/service-host/work.js +676 -0
  160. package/dist/entrypoints/service-host.js +146 -536
  161. package/dist/entrypoints/telegram/screens.js +4 -4
  162. package/dist/entrypoints/telegram.js +4 -4
  163. package/dist/entrypoints/testing.d.ts +2 -1
  164. package/dist/entrypoints/testing.d.ts.map +1 -1
  165. package/dist/entrypoints/testing.js +27 -8
  166. package/dist/entrypoints/tools/agent.js +6 -6
  167. package/dist/entrypoints/tools/connections.js +2 -2
  168. package/dist/entrypoints/tools/invoker.js +5 -5
  169. package/dist/entrypoints/tools/mcp.js +8 -6
  170. package/dist/entrypoints/tools/toolkit.js +11 -9
  171. package/dist/entrypoints/tools.js +19 -17
  172. package/dist/entrypoints/tracking/contract.js +1 -1
  173. package/dist/entrypoints/tracking/performance.js +3 -3
  174. package/dist/files/client-artifact.d.ts +14 -42
  175. package/dist/files/client-artifact.d.ts.map +1 -1
  176. package/dist/files/client-build.d.ts +57 -0
  177. package/dist/files/client-build.d.ts.map +1 -0
  178. package/dist/files/client-declarations.d.ts +35 -0
  179. package/dist/files/client-declarations.d.ts.map +1 -0
  180. package/dist/files/client-package-contract.d.ts +162 -0
  181. package/dist/files/client-package-contract.d.ts.map +1 -0
  182. package/dist/files/client-package-proof.d.ts +38 -0
  183. package/dist/files/client-package-proof.d.ts.map +1 -0
  184. package/dist/files/client-package.d.ts +17 -0
  185. package/dist/files/client-package.d.ts.map +1 -0
  186. package/dist/files/declaration-specifiers.d.ts +30 -0
  187. package/dist/files/declaration-specifiers.d.ts.map +1 -0
  188. package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
  189. package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
  190. package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
  191. package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
  192. package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
  193. package/dist/index-2dzc7mv9.js +174 -0
  194. package/dist/index-2mz8hj58.js +155 -0
  195. package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
  196. package/dist/index-3mcbr8sx.js +349 -0
  197. package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
  198. package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
  199. package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
  200. package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
  201. package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
  202. package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
  203. package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
  204. package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
  205. package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
  206. package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
  207. package/dist/index-9ft4n9j1.js +432 -0
  208. package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
  209. package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
  210. package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
  211. package/dist/index-d2drhb9c.js +219 -0
  212. package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
  213. package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
  214. package/dist/index-dxft2mnm.js +42 -0
  215. package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
  216. package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
  217. package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
  218. package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
  219. package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
  220. package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
  221. package/dist/index-k9g061ma.js +164 -0
  222. package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
  223. package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
  224. package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
  225. package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
  226. package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
  227. package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
  228. package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
  229. package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
  230. package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
  231. package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
  232. package/dist/index-s43tr4my.js +129 -0
  233. package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
  234. package/dist/index-t5g5rm9n.js +213 -0
  235. package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
  236. package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
  237. package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
  238. package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
  239. package/dist/index-wxjv4sqx.js +82 -0
  240. package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
  241. package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
  242. package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
  243. package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
  244. package/dist/process/bootstrap.d.ts +12 -0
  245. package/dist/process/bootstrap.d.ts.map +1 -0
  246. package/dist/process/owner-loss-guard.d.ts +2 -9
  247. package/dist/process/owner-loss-guard.d.ts.map +1 -1
  248. package/dist/process/work-root.d.ts +20 -0
  249. package/dist/process/work-root.d.ts.map +1 -0
  250. package/dist/server/contract-identity.d.ts.map +1 -1
  251. package/dist/server/contract-method.d.ts +12 -0
  252. package/dist/server/contract-method.d.ts.map +1 -1
  253. package/dist/server/implement.d.ts.map +1 -1
  254. package/dist/server/openapi.d.ts.map +1 -1
  255. package/dist/server/types.d.ts +10 -9
  256. package/dist/server/types.d.ts.map +1 -1
  257. package/dist/service-host/host-adapter.d.ts +2 -0
  258. package/dist/service-host/host-adapter.d.ts.map +1 -1
  259. package/dist/service-host/work/command.d.ts +72 -0
  260. package/dist/service-host/work/command.d.ts.map +1 -0
  261. package/dist/service-host/work/errors.d.ts +29 -0
  262. package/dist/service-host/work/errors.d.ts.map +1 -0
  263. package/dist/service-host/work/host.d.ts +38 -0
  264. package/dist/service-host/work/host.d.ts.map +1 -0
  265. package/dist/service-host/work/launch.d.ts +51 -0
  266. package/dist/service-host/work/launch.d.ts.map +1 -0
  267. package/dist/service-host/work/membership.d.ts +51 -0
  268. package/dist/service-host/work/membership.d.ts.map +1 -0
  269. package/dist/service-host/work/origin.d.ts +79 -0
  270. package/dist/service-host/work/origin.d.ts.map +1 -0
  271. package/dist/service-host/work/owner.d.ts +45 -0
  272. package/dist/service-host/work/owner.d.ts.map +1 -0
  273. package/dist/service-host/work/placement.d.ts +55 -0
  274. package/dist/service-host/work/placement.d.ts.map +1 -0
  275. package/dist/service-host/work/probe.d.ts +24 -0
  276. package/dist/service-host/work/probe.d.ts.map +1 -0
  277. package/dist/service-host/work/scope-command.d.ts +68 -0
  278. package/dist/service-host/work/scope-command.d.ts.map +1 -0
  279. package/dist/sync/session.d.ts +4 -1
  280. package/dist/sync/session.d.ts.map +1 -1
  281. package/dist/testing/surface-manifest-digest.d.ts +2 -0
  282. package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
  283. package/dist/testing/surface-manifest.d.ts +32 -3
  284. package/dist/testing/surface-manifest.d.ts.map +1 -1
  285. package/dist/tools/agent.d.ts +2 -0
  286. package/dist/tools/agent.d.ts.map +1 -1
  287. package/dist/tools/cli/stream-surface.d.ts.map +1 -1
  288. package/dist/tools/internal/mcp-projection.d.ts +58 -0
  289. package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
  290. package/dist/tools/internal/surface-projector.d.ts +3 -47
  291. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  292. package/dist/tools/invoker.d.ts +2 -0
  293. package/dist/tools/invoker.d.ts.map +1 -1
  294. package/dist/tools/manifest.d.ts +2 -0
  295. package/dist/tools/manifest.d.ts.map +1 -1
  296. package/dist/tools/mcp/handler.d.ts.map +1 -1
  297. package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
  298. package/dist/tools/mcp/mount.d.ts +4 -0
  299. package/dist/tools/mcp/mount.d.ts.map +1 -1
  300. package/dist/tools/mcp/prepare.d.ts +5 -2
  301. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  302. package/dist/tools/mount.d.ts +2 -0
  303. package/dist/tools/mount.d.ts.map +1 -1
  304. package/dist/tools/remote.d.ts.map +1 -1
  305. package/dist/tools/schema/nesting-limit.d.ts +8 -0
  306. package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
  307. package/dist/tools/schema/presentation.d.ts +7 -0
  308. package/dist/tools/schema/presentation.d.ts.map +1 -1
  309. package/dist/tools/surface.d.ts.map +1 -1
  310. package/llms/agent-executor-acp.txt +3 -3
  311. package/llms/agent-executor-claude-sdk.txt +1 -1
  312. package/llms/agent-executor-claude.txt +1 -1
  313. package/llms/agent-executor-codex.txt +1 -1
  314. package/llms/agent-executor-testing-claude-sdk.txt +28 -0
  315. package/llms/agent-executor-testing.txt +7 -8
  316. package/llms/agent-executor.txt +27 -4
  317. package/llms/agent-runtime.txt +1 -1
  318. package/llms/contract.txt +8 -2
  319. package/llms/files-packaging.txt +11 -6
  320. package/llms/process-bootstrap.txt +18 -0
  321. package/llms/process.2.txt +215 -18
  322. package/llms/process.txt +130 -92
  323. package/llms/server.4.txt +49 -1
  324. package/llms/service-host-work.txt +34 -0
  325. package/llms/stitchkit.2.txt +31 -0
  326. package/llms/stitchkit.txt +78 -75
  327. package/llms/sync.txt +5 -2
  328. package/llms/testing.txt +1 -0
  329. package/llms/tools.2.txt +747 -775
  330. package/llms/tools.3.txt +846 -210
  331. package/llms/tools.4.txt +226 -0
  332. package/llms/tools.txt +3 -790
  333. package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
  334. package/llms/upgrading.txt +1 -1
  335. package/llms-full.txt +746 -135
  336. package/llms.txt +18 -16
  337. package/package.json +12 -4
  338. package/dist/entrypoints/process/owner-loss.d.ts +0 -3
  339. package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
  340. package/dist/entrypoints/process/owner-loss.js +0 -7
  341. package/llms/process-owner-loss.txt +0 -18
@@ -1,17 +1,18 @@
1
1
  import"../../index-2rf33y2h.js";
2
+ import"../../index-s43tr4my.js";
2
3
  import {
3
4
  engineProfile,
4
5
  engineEnvironment2,
5
6
  createTurnDeltaChannel,
6
- offerTurnDelta,
7
7
  sessionAbort,
8
+ sessionLiveness,
8
9
  runEngineCli,
9
10
  stopConnection,
10
11
  emitStartupPhase
11
- } from "../../index-f9p62ean.js";
12
+ } from "../../index-stpy56r3.js";
12
13
  import"../../index-09f7w2qq.js";
13
- import"../../index-v59pxmf1.js";
14
- import"../../index-qa2jjb65.js";
14
+ import"../../index-jpecjm30.js";
15
+ import"../../index-pbekeqzm.js";
15
16
  import"../../index-6kec3b14.js";
16
17
  import {
17
18
  claudeUserContent,
@@ -21,14 +22,14 @@ import {
21
22
  claudeControlError,
22
23
  claudeInterrupt,
23
24
  newClaudeTurnState,
24
- classifyClaudeRecord,
25
25
  claudeUsagePlanLimits2,
26
26
  claudePlanWindows2,
27
+ routeClaudeRecord,
27
28
  claudeTranscriptPath2,
28
29
  claudeTranscriptHasUuid2,
29
30
  claudeTranscriptExists,
30
31
  findTranscriptInput2
31
- } from "../../index-z114ax5e.js";
32
+ } from "../../index-an7vcmwf.js";
32
33
  import {
33
34
  CLAUDE_CLI_MAX_LINE_BYTES,
34
35
  validateImageOptions,
@@ -37,20 +38,20 @@ import {
37
38
  } from "../../index-y0a4gt1s.js";
38
39
  import {
39
40
  holdEngineRequest,
40
- answerEngineRequest,
41
- drainEngineRequests,
42
- endEngineTurn,
43
- loseEngineTurn
44
- } from "../../index-jcrj0b8z.js";
41
+ loseEngineTurn,
42
+ interruptEngineTurn,
43
+ respondToEngineRequest
44
+ } from "../../index-qggqqja2.js";
45
45
  import {
46
46
  ENGINE_LINE_BYTES,
47
47
  spawnEngineProcess2
48
- } from "../../index-rxh3qy4x.js";
49
- import"../../index-3fym4j8n.js";
48
+ } from "../../index-fzd477xk.js";
49
+ import"../../index-gtaaxe9d.js";
50
+ import"../../index-g5fgeb6v.js";
51
+ import"../../index-d04w81fz.js";
50
52
  import {
51
- mergeRateLimitEvent2
52
- } from "../../index-athc412x.js";
53
- import"../../index-pzhqydxb.js";
53
+ abortReason
54
+ } from "../../index-rptj3qnc.js";
54
55
 
55
56
  // src/agent-executor/claude/cli-driver.ts
56
57
  import { z } from "zod";
@@ -66,21 +67,73 @@ var LOST = {
66
67
  behavior: "deny",
67
68
  message: "The Claude CLI was lost"
68
69
  };
69
- function claudeTurnHandle(turn, send) {
70
+ function claudeTurnHandle(turn, send, liveness) {
70
71
  return {
71
72
  deltas: turn.channel,
72
- async interrupt() {
73
- turn.state.interruptRequested = true;
74
- drainEngineRequests(turn, () => INTERRUPTED);
75
- send(JSON.stringify(claudeInterrupt(randomUUID())));
76
- },
73
+ interrupt: () => interruptEngineTurn(turn, liveness, {
74
+ refusal: () => INTERRUPTED,
75
+ tell: () => send(JSON.stringify(claudeInterrupt(randomUUID())))
76
+ }),
77
77
  async respond(interactionId, rawReply) {
78
- const waiting = turn.pending.get(interactionId);
79
- if (waiting === undefined) {
80
- throw new TypeError(`Unknown interaction ${interactionId} for this turn`);
78
+ respondToEngineRequest(turn, liveness, interactionId, (detail) => resolveClaudePermissionReply(detail, rawReply));
79
+ }
80
+ };
81
+ }
82
+ function startClaudeReadingLoop(state) {
83
+ const { engine, profileId, limits, liveness } = state;
84
+ const send = (record) => {
85
+ if (liveness.isAlive())
86
+ engine.send(JSON.stringify(record));
87
+ };
88
+ return (async () => {
89
+ try {
90
+ for await (const line of engine.lines) {
91
+ if (!liveness.isAlive())
92
+ continue;
93
+ routeClaudeRecord(JSON.parse(line), {
94
+ turn: state.getTurn(),
95
+ profileId,
96
+ limits,
97
+ ended: () => ENDED,
98
+ clearTurn: state.clearTurn,
99
+ onRequest(turn, { delta, input, toolName, suppressSessionRule }) {
100
+ const answer = (decision) => send(claudePermissionResponse(delta.interactionId, decision));
101
+ if (turn === undefined)
102
+ answer({ behavior: "deny", message: "No turn is running to ask" });
103
+ else
104
+ holdEngineRequest(turn, {
105
+ interactionId: delta.interactionId,
106
+ detail: { input, toolName, suppressSessionRule },
107
+ answeredBy: { source: "claude", type: "control_response" },
108
+ delta: () => delta,
109
+ refusal: INTERRUPTED,
110
+ resolve: answer
111
+ });
112
+ },
113
+ onRefuse: (refuse) => send(claudeControlError(refuse.requestId, refuse.message))
114
+ });
81
115
  }
82
- answerEngineRequest(turn, interactionId, resolveClaudePermissionReply(waiting.detail, rawReply));
116
+ state.onExit(new Error(`The Claude CLI exited during the turn: ${engine.stderrTail().slice(-2000)}`));
117
+ } catch (error) {
118
+ state.onExit(error);
119
+ await engine.stop().catch(() => {
120
+ return;
121
+ });
83
122
  }
123
+ })();
124
+ }
125
+ function createClaudeSessionClose(state) {
126
+ let closePromise;
127
+ return () => {
128
+ if (closePromise !== undefined)
129
+ return closePromise;
130
+ state.markClosing();
131
+ state.settleTurn(new Error("The Claude CLI session is closed"));
132
+ state.abortLinked();
133
+ closePromise = stopConnection({ engine: state.engine, reading: state.reading }).finally(() => {
134
+ state.releaseLinked();
135
+ });
136
+ return closePromise;
84
137
  };
85
138
  }
86
139
  async function openClaudeSession(config, input) {
@@ -93,8 +146,9 @@ async function openClaudeSession(config, input) {
93
146
  const resume = input.nativeThreadId !== undefined && await claudeTranscriptExists(transcript);
94
147
  const linked = sessionAbort(input.signal);
95
148
  let engine;
96
- emitStartupPhase(input.onStartupPhase, "spawning");
149
+ emitStartupPhase(input.onStartupPhase, "spawning", config.onObserverError);
97
150
  try {
151
+ linked.signal.throwIfAborted();
98
152
  engine = spawnEngineProcess2({
99
153
  executable,
100
154
  args: [
@@ -126,82 +180,50 @@ async function openClaudeSession(config, input) {
126
180
  throw error;
127
181
  }
128
182
  let current;
129
- let dead;
130
- const fail = (error) => {
131
- const failed = error instanceof Error ? error : new Error(String(error));
132
- dead = failed;
183
+ const liveness = sessionLiveness({
184
+ closedMessage: "The Claude CLI session is closed",
185
+ caller: input.signal,
186
+ linked: linked.signal
187
+ });
188
+ const settleTurn = (reason) => {
133
189
  const turn = current;
134
190
  current = undefined;
135
- loseEngineTurn(turn, () => LOST, failed);
136
- linked.abort();
191
+ loseEngineTurn(turn, () => LOST, reason);
137
192
  };
138
- const reading = (async () => {
139
- try {
140
- for await (const line of engine.lines) {
141
- const turn = current;
142
- const verdict = classifyClaudeRecord(JSON.parse(line), turn?.state ?? newClaudeTurnState("between-turns"));
143
- switch (verdict.kind) {
144
- case "limits":
145
- limits.set(profile.profileId, mergeRateLimitEvent2({
146
- previous: limits.get(profile.profileId),
147
- windows: claudePlanWindows2(verdict.info),
148
- now: new Date
149
- }));
150
- break;
151
- case "deltas":
152
- for (const delta of verdict.deltas)
153
- offerTurnDelta(turn?.channel, delta);
154
- break;
155
- case "request": {
156
- const { delta, input, toolName, suppressSessionRule } = verdict;
157
- const answer = (decision) => {
158
- if (dead === undefined)
159
- engine.send(JSON.stringify(claudePermissionResponse(delta.interactionId, decision)));
160
- };
161
- if (turn === undefined)
162
- answer({ behavior: "deny", message: "No turn is running to ask" });
163
- else
164
- holdEngineRequest(turn, {
165
- interactionId: delta.interactionId,
166
- detail: { input, toolName, suppressSessionRule },
167
- answeredBy: { source: "claude", type: "control_response" },
168
- delta: () => delta,
169
- refusal: INTERRUPTED,
170
- resolve: answer
171
- });
172
- break;
173
- }
174
- case "unhandled":
175
- offerTurnDelta(turn?.channel, verdict.delta);
176
- if (verdict.refuse !== undefined)
177
- engine.send(JSON.stringify(claudeControlError(verdict.refuse.requestId, verdict.refuse.message)));
178
- break;
179
- case "end":
180
- endEngineTurn(turn, () => ENDED, verdict.deltas);
181
- current = undefined;
182
- break;
183
- case "event":
184
- case "session":
185
- case "ignore":
186
- break;
187
- }
188
- }
189
- fail(new Error(`The Claude CLI exited during the turn: ${engine.stderrTail().slice(-2000)}`));
190
- } catch (error) {
191
- fail(error);
192
- await engine.stop().catch(() => {
193
+ linked.signal.addEventListener("abort", () => {
194
+ if (liveness.closing || liveness.lost !== undefined)
195
+ return;
196
+ settleTurn(abortReason(linked.signal));
197
+ }, { once: true });
198
+ const reading = startClaudeReadingLoop({
199
+ engine,
200
+ profileId: profile.profileId,
201
+ limits,
202
+ liveness,
203
+ getTurn: () => current,
204
+ clearTurn: (turn) => {
205
+ if (current === turn)
206
+ current = undefined;
207
+ },
208
+ onExit: (error) => {
209
+ const stop = liveness.closing || liveness.abortedByCaller ? liveness.stopped() : undefined;
210
+ if (stop !== undefined) {
211
+ settleTurn(stop.reason);
193
212
  return;
194
- });
213
+ }
214
+ const failed = error instanceof Error ? error : new Error(String(error));
215
+ liveness.markLost(failed);
216
+ settleTurn(failed);
217
+ linked.abort();
195
218
  }
196
- })();
219
+ });
197
220
  const startTurn = imageTurnStarter({
198
221
  driverLabel: "The Claude CLI driver",
199
222
  busyMessage: "A turn is already running in this Claude session",
200
223
  imageOptions: config,
201
224
  signal: linked.signal,
202
225
  check() {
203
- if (dead !== undefined)
204
- throw dead;
226
+ liveness.ensureAlive();
205
227
  if (current !== undefined)
206
228
  throw new Error("A turn is already running in this Claude session");
207
229
  },
@@ -215,7 +237,8 @@ async function openClaudeSession(config, input) {
215
237
  const turn = {
216
238
  state: newClaudeTurnState(turnInput.turnId),
217
239
  channel: createTurnDeltaChannel(),
218
- pending: new Map
240
+ pending: new Map,
241
+ settled: false
219
242
  };
220
243
  current = turn;
221
244
  try {
@@ -225,16 +248,21 @@ async function openClaudeSession(config, input) {
225
248
  current = undefined;
226
249
  throw error;
227
250
  }
228
- return claudeTurnHandle(turn, (line) => engine.send(line));
251
+ return claudeTurnHandle(turn, (line) => engine.send(line), liveness);
229
252
  }
230
253
  });
254
+ const close = createClaudeSessionClose({
255
+ engine,
256
+ reading,
257
+ markClosing: () => liveness.markClosing(),
258
+ settleTurn,
259
+ abortLinked: () => linked.abort(),
260
+ releaseLinked: () => linked.release()
261
+ });
231
262
  return {
232
263
  nativeThreadId: sessionId,
233
264
  startTurn,
234
- async close() {
235
- linked.abort();
236
- await stopConnection({ engine, reading });
237
- }
265
+ close
238
266
  };
239
267
  }
240
268
 
@@ -335,7 +363,10 @@ function createClaudeCliDriver(config = {}) {
335
363
  ambient,
336
364
  limits,
337
365
  ...config.resolveFile !== undefined && { resolveFile: config.resolveFile },
338
- ...config.maxImageBytes !== undefined && { maxImageBytes: config.maxImageBytes }
366
+ ...config.maxImageBytes !== undefined && { maxImageBytes: config.maxImageBytes },
367
+ ...config.onObserverError !== undefined && {
368
+ onObserverError: config.onObserverError
369
+ }
339
370
  }, input)
340
371
  };
341
372
  }