stitchkit 0.132.3 → 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 (335) hide show
  1. package/CHANGELOG.md +172 -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/driver.d.ts +20 -2
  23. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  24. package/dist/agent-executor/claude-sdk/engine-spawn.d.ts +18 -0
  25. package/dist/agent-executor/claude-sdk/engine-spawn.d.ts.map +1 -0
  26. package/dist/agent-executor/claude-sdk/query-loop.d.ts +8 -11
  27. package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
  28. package/dist/agent-executor/claude-sdk/query-manager.d.ts +4 -2
  29. package/dist/agent-executor/claude-sdk/query-manager.d.ts.map +1 -1
  30. package/dist/agent-executor/claude-sdk/query-options.d.ts +1 -0
  31. package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -1
  32. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  33. package/dist/agent-executor/codex/capabilities.d.ts +8 -0
  34. package/dist/agent-executor/codex/capabilities.d.ts.map +1 -0
  35. package/dist/agent-executor/codex/connect.d.ts +6 -1
  36. package/dist/agent-executor/codex/connect.d.ts.map +1 -1
  37. package/dist/agent-executor/codex/driver.d.ts +10 -0
  38. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  39. package/dist/agent-executor/codex/event-routing.d.ts +23 -1
  40. package/dist/agent-executor/codex/event-routing.d.ts.map +1 -1
  41. package/dist/agent-executor/codex/handlers.d.ts +23 -3
  42. package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
  43. package/dist/agent-executor/codex/limits.d.ts +17 -0
  44. package/dist/agent-executor/codex/limits.d.ts.map +1 -1
  45. package/dist/agent-executor/codex/request-answers.d.ts +23 -3
  46. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  47. package/dist/agent-executor/codex/session-bind.d.ts +6 -1
  48. package/dist/agent-executor/codex/session-bind.d.ts.map +1 -1
  49. package/dist/agent-executor/codex/session-types.d.ts +5 -1
  50. package/dist/agent-executor/codex/session-types.d.ts.map +1 -1
  51. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  52. package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
  53. package/dist/agent-executor/codex/shared-thread.d.ts +6 -8
  54. package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
  55. package/dist/agent-executor/codex/thread-open.d.ts +12 -3
  56. package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
  57. package/dist/agent-executor/engine-requests.d.ts +42 -0
  58. package/dist/agent-executor/engine-requests.d.ts.map +1 -1
  59. package/dist/agent-executor/handoff-schemas.d.ts.map +1 -1
  60. package/dist/agent-executor/handoff.d.ts.map +1 -1
  61. package/dist/agent-executor/image-input.d.ts +6 -5
  62. package/dist/agent-executor/image-input.d.ts.map +1 -1
  63. package/dist/agent-executor/profile.d.ts +3 -5
  64. package/dist/agent-executor/profile.d.ts.map +1 -1
  65. package/dist/agent-executor/session-primitives.d.ts +64 -3
  66. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  67. package/dist/agent-executor/testing/claude-sdk-stubs.d.ts +5 -0
  68. package/dist/agent-executor/testing/claude-sdk-stubs.d.ts.map +1 -0
  69. package/dist/agent-executor/testing/conformance-lifecycle.d.ts +11 -0
  70. package/dist/agent-executor/testing/conformance-lifecycle.d.ts.map +1 -0
  71. package/dist/agent-executor/testing/conformance-support.d.ts +23 -0
  72. package/dist/agent-executor/testing/conformance-support.d.ts.map +1 -0
  73. package/dist/agent-executor/testing/conformance.d.ts +7 -2
  74. package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
  75. package/dist/agent-executor/testing/consumer-stubs.d.ts +5 -3
  76. package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -1
  77. package/dist/agent-executor/testing/fake-codex-app-server.d.ts +5 -1
  78. package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -1
  79. package/dist/agent-executor/testing/replay-driver.d.ts +6 -0
  80. package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
  81. package/dist/agent-executor/testing/replay-gate.d.ts +4 -1
  82. package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -1
  83. package/dist/agent-runtime/deferred-tool-types.d.ts +2 -0
  84. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  85. package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
  86. package/dist/browser/client.d.ts.map +1 -1
  87. package/dist/browser/operation-refusal.d.ts +10 -0
  88. package/dist/browser/operation-refusal.d.ts.map +1 -0
  89. package/dist/contract/client-types.d.ts +13 -4
  90. package/dist/contract/client-types.d.ts.map +1 -1
  91. package/dist/contract/define-validation.d.ts +6 -0
  92. package/dist/contract/define-validation.d.ts.map +1 -1
  93. package/dist/contract/define.d.ts +3 -0
  94. package/dist/contract/define.d.ts.map +1 -1
  95. package/dist/contract/errors-factory.d.ts +8 -2
  96. package/dist/contract/errors-factory.d.ts.map +1 -1
  97. package/dist/contract/errors.d.ts +9 -0
  98. package/dist/contract/errors.d.ts.map +1 -1
  99. package/dist/contract/fingerprint.d.ts +4 -1
  100. package/dist/contract/fingerprint.d.ts.map +1 -1
  101. package/dist/contract/operation-refusals.d.ts +51 -0
  102. package/dist/contract/operation-refusals.d.ts.map +1 -0
  103. package/dist/contract/tool-options.d.ts +4 -0
  104. package/dist/contract/tool-options.d.ts.map +1 -1
  105. package/dist/entrypoints/agent-executor/acp.js +253 -210
  106. package/dist/entrypoints/agent-executor/claude-sdk.js +248 -173
  107. package/dist/entrypoints/agent-executor/claude.js +57 -109
  108. package/dist/entrypoints/agent-executor/codex.js +412 -335
  109. package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts +3 -0
  110. package/dist/entrypoints/agent-executor/testing/claude-sdk.d.ts.map +1 -0
  111. package/dist/entrypoints/agent-executor/testing/claude-sdk.js +329 -0
  112. package/dist/entrypoints/agent-executor/testing.d.ts +1 -2
  113. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
  114. package/dist/entrypoints/agent-executor/testing.js +413 -667
  115. package/dist/entrypoints/agent-executor.d.ts +1 -1
  116. package/dist/entrypoints/agent-executor.d.ts.map +1 -1
  117. package/dist/entrypoints/agent-executor.js +12 -12
  118. package/dist/entrypoints/agent-runtime/browser.js +2 -2
  119. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  120. package/dist/entrypoints/agent-runtime/harness.js +8 -8
  121. package/dist/entrypoints/agent-runtime/postgres.js +5 -5
  122. package/dist/entrypoints/agent-runtime/realtime.js +2 -2
  123. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  124. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  125. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  126. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  127. package/dist/entrypoints/agent-runtime.js +26 -18
  128. package/dist/entrypoints/application/grammy.js +1 -1
  129. package/dist/entrypoints/application.js +2 -2
  130. package/dist/entrypoints/cli.js +8 -8
  131. package/dist/entrypoints/contract.d.ts +3 -2
  132. package/dist/entrypoints/contract.d.ts.map +1 -1
  133. package/dist/entrypoints/contract.js +6 -4
  134. package/dist/entrypoints/files/packaging.d.ts +4 -1
  135. package/dist/entrypoints/files/packaging.d.ts.map +1 -1
  136. package/dist/entrypoints/files/packaging.js +868 -167
  137. package/dist/entrypoints/files.js +1 -1
  138. package/dist/entrypoints/handler.js +7 -7
  139. package/dist/entrypoints/http.js +2 -2
  140. package/dist/entrypoints/index.js +10 -8
  141. package/dist/entrypoints/node.js +11 -11
  142. package/dist/entrypoints/observability.js +1 -1
  143. package/dist/entrypoints/process/bootstrap.d.ts +3 -0
  144. package/dist/entrypoints/process/bootstrap.d.ts.map +1 -0
  145. package/dist/entrypoints/process/bootstrap.js +16 -0
  146. package/dist/entrypoints/process.js +7 -7
  147. package/dist/entrypoints/realtime.js +3 -3
  148. package/dist/entrypoints/remote.js +8 -7
  149. package/dist/entrypoints/server.js +30 -14
  150. package/dist/entrypoints/service-host/macos.js +72 -206
  151. package/dist/entrypoints/service-host/work.d.ts +15 -0
  152. package/dist/entrypoints/service-host/work.d.ts.map +1 -0
  153. package/dist/entrypoints/service-host/work.js +676 -0
  154. package/dist/entrypoints/service-host.js +146 -536
  155. package/dist/entrypoints/telegram/screens.js +4 -4
  156. package/dist/entrypoints/telegram.js +4 -4
  157. package/dist/entrypoints/testing.d.ts +2 -1
  158. package/dist/entrypoints/testing.d.ts.map +1 -1
  159. package/dist/entrypoints/testing.js +27 -8
  160. package/dist/entrypoints/tools/agent.js +6 -6
  161. package/dist/entrypoints/tools/connections.js +2 -2
  162. package/dist/entrypoints/tools/invoker.js +5 -5
  163. package/dist/entrypoints/tools/mcp.js +8 -6
  164. package/dist/entrypoints/tools/toolkit.js +11 -9
  165. package/dist/entrypoints/tools.js +19 -17
  166. package/dist/entrypoints/tracking/contract.js +1 -1
  167. package/dist/entrypoints/tracking/performance.js +3 -3
  168. package/dist/files/client-artifact.d.ts +14 -42
  169. package/dist/files/client-artifact.d.ts.map +1 -1
  170. package/dist/files/client-build.d.ts +57 -0
  171. package/dist/files/client-build.d.ts.map +1 -0
  172. package/dist/files/client-declarations.d.ts +35 -0
  173. package/dist/files/client-declarations.d.ts.map +1 -0
  174. package/dist/files/client-package-contract.d.ts +162 -0
  175. package/dist/files/client-package-contract.d.ts.map +1 -0
  176. package/dist/files/client-package-proof.d.ts +38 -0
  177. package/dist/files/client-package-proof.d.ts.map +1 -0
  178. package/dist/files/client-package.d.ts +17 -0
  179. package/dist/files/client-package.d.ts.map +1 -0
  180. package/dist/files/declaration-specifiers.d.ts +30 -0
  181. package/dist/files/declaration-specifiers.d.ts.map +1 -0
  182. package/dist/{index-v759mzed.js → index-02r5sq9p.js} +36 -23
  183. package/dist/{index-0r15pkjq.js → index-0k1ba0ss.js} +1 -1
  184. package/dist/{index-znd1b57f.js → index-1dn2wjq6.js} +5 -4
  185. package/dist/{index-p06z7g7w.js → index-1p8q0yrt.js} +6 -5
  186. package/dist/{index-wa6h4tz6.js → index-1qwd54n3.js} +6 -5
  187. package/dist/index-2dzc7mv9.js +174 -0
  188. package/dist/index-2mz8hj58.js +155 -0
  189. package/dist/{index-17qgm6xe.js → index-34k82crg.js} +2 -2
  190. package/dist/index-3mcbr8sx.js +349 -0
  191. package/dist/{index-ybdq8kk2.js → index-3y2tzhr8.js} +3 -3
  192. package/dist/{index-fgahdc7s.js → index-5n3a8hd8.js} +5 -3
  193. package/dist/{index-jb4m241t.js → index-6918kxbf.js} +45 -1
  194. package/dist/{index-n3bm7zqq.js → index-6kmjcm81.js} +4 -4
  195. package/dist/{index-akf0xkrm.js → index-78da4g74.js} +1 -1
  196. package/dist/{index-9pv126eh.js → index-7fjbdga8.js} +7 -1
  197. package/dist/{index-zhshhxew.js → index-8jf4bt7v.js} +1 -1
  198. package/dist/{index-p16q492v.js → index-8t9dr41h.js} +18 -5
  199. package/dist/{index-xq4s9mka.js → index-8yt3rwe7.js} +1 -1
  200. package/dist/{index-39c2hj6h.js → index-9c76vfxf.js} +7 -3
  201. package/dist/index-9ft4n9j1.js +432 -0
  202. package/dist/{index-sd4e5x5j.js → index-9wdrwx3b.js} +8 -7
  203. package/dist/{index-z114ax5e.js → index-an7vcmwf.js} +49 -2
  204. package/dist/{index-pzhqydxb.js → index-d04w81fz.js} +1 -1
  205. package/dist/index-d2drhb9c.js +219 -0
  206. package/dist/{index-8gmmdz7k.js → index-dacxr7nf.js} +1 -1
  207. package/dist/{index-dnzxxf8a.js → index-dm6nxkn1.js} +1 -1
  208. package/dist/index-dxft2mnm.js +42 -0
  209. package/dist/{index-rxh3qy4x.js → index-fzd477xk.js} +1 -1
  210. package/dist/{index-xgae0bn7.js → index-g4gstmp1.js} +2 -2
  211. package/dist/{index-athc412x.js → index-g5fgeb6v.js} +1 -1
  212. package/dist/{index-z9d74jmb.js → index-gbhj370g.js} +3 -3
  213. package/dist/{index-3fym4j8n.js → index-gtaaxe9d.js} +1 -1
  214. package/dist/{index-v59pxmf1.js → index-jpecjm30.js} +2 -2
  215. package/dist/index-k9g061ma.js +164 -0
  216. package/dist/{index-669374qc.js → index-ma26mfnt.js} +84 -315
  217. package/dist/{index-ryxb427v.js → index-msxf2r8x.js} +16 -3
  218. package/dist/{index-rbd2rq3z.js → index-nr4fhfn4.js} +1 -1
  219. package/dist/{index-qa2jjb65.js → index-pbekeqzm.js} +1 -1
  220. package/dist/{index-mkfhpk11.js → index-pq6g1k9t.js} +2 -2
  221. package/dist/{index-gya4hwh3.js → index-pws5c3x6.js} +21 -1
  222. package/dist/{index-x2fb37t0.js → index-q427q23r.js} +3 -2
  223. package/dist/{index-jcrj0b8z.js → index-qggqqja2.js} +39 -2
  224. package/dist/{index-jxtg307y.js → index-rkjfzs0a.js} +1 -1
  225. package/dist/{index-5tdc0q43.js → index-rw8ze745.js} +5 -3
  226. package/dist/index-s43tr4my.js +129 -0
  227. package/dist/{index-f9p62ean.js → index-stpy56r3.js} +175 -249
  228. package/dist/index-t5g5rm9n.js +213 -0
  229. package/dist/{index-z20pdxeb.js → index-tmv3ez1h.js} +3 -3
  230. package/dist/{index-dcsxj68j.js → index-tqjamnax.js} +1 -1
  231. package/dist/{index-j15dhkda.js → index-wddcfbng.js} +1 -325
  232. package/dist/{index-9sfhje6y.js → index-wh70tmpd.js} +24 -234
  233. package/dist/index-wxjv4sqx.js +82 -0
  234. package/dist/{index-qhjmmsm2.js → index-x46y9z26.js} +2 -2
  235. package/dist/{index-nk0cy9g1.js → index-y53cqwke.js} +1 -1
  236. package/dist/{index-sv5svtq7.js → index-y68gavb5.js} +1 -1
  237. package/dist/{index-5y7j383h.js → index-yrhw10ef.js} +1 -1
  238. package/dist/process/bootstrap.d.ts +12 -0
  239. package/dist/process/bootstrap.d.ts.map +1 -0
  240. package/dist/process/owner-loss-guard.d.ts +2 -9
  241. package/dist/process/owner-loss-guard.d.ts.map +1 -1
  242. package/dist/process/work-root.d.ts +20 -0
  243. package/dist/process/work-root.d.ts.map +1 -0
  244. package/dist/server/contract-identity.d.ts.map +1 -1
  245. package/dist/server/contract-method.d.ts +12 -0
  246. package/dist/server/contract-method.d.ts.map +1 -1
  247. package/dist/server/implement.d.ts.map +1 -1
  248. package/dist/server/openapi.d.ts.map +1 -1
  249. package/dist/server/types.d.ts +10 -9
  250. package/dist/server/types.d.ts.map +1 -1
  251. package/dist/service-host/host-adapter.d.ts +2 -0
  252. package/dist/service-host/host-adapter.d.ts.map +1 -1
  253. package/dist/service-host/work/command.d.ts +72 -0
  254. package/dist/service-host/work/command.d.ts.map +1 -0
  255. package/dist/service-host/work/errors.d.ts +29 -0
  256. package/dist/service-host/work/errors.d.ts.map +1 -0
  257. package/dist/service-host/work/host.d.ts +38 -0
  258. package/dist/service-host/work/host.d.ts.map +1 -0
  259. package/dist/service-host/work/launch.d.ts +51 -0
  260. package/dist/service-host/work/launch.d.ts.map +1 -0
  261. package/dist/service-host/work/membership.d.ts +51 -0
  262. package/dist/service-host/work/membership.d.ts.map +1 -0
  263. package/dist/service-host/work/origin.d.ts +79 -0
  264. package/dist/service-host/work/origin.d.ts.map +1 -0
  265. package/dist/service-host/work/owner.d.ts +45 -0
  266. package/dist/service-host/work/owner.d.ts.map +1 -0
  267. package/dist/service-host/work/placement.d.ts +55 -0
  268. package/dist/service-host/work/placement.d.ts.map +1 -0
  269. package/dist/service-host/work/probe.d.ts +24 -0
  270. package/dist/service-host/work/probe.d.ts.map +1 -0
  271. package/dist/service-host/work/scope-command.d.ts +68 -0
  272. package/dist/service-host/work/scope-command.d.ts.map +1 -0
  273. package/dist/sync/session.d.ts +4 -1
  274. package/dist/sync/session.d.ts.map +1 -1
  275. package/dist/testing/surface-manifest-digest.d.ts +2 -0
  276. package/dist/testing/surface-manifest-digest.d.ts.map +1 -1
  277. package/dist/testing/surface-manifest.d.ts +32 -3
  278. package/dist/testing/surface-manifest.d.ts.map +1 -1
  279. package/dist/tools/agent.d.ts +2 -0
  280. package/dist/tools/agent.d.ts.map +1 -1
  281. package/dist/tools/cli/stream-surface.d.ts.map +1 -1
  282. package/dist/tools/internal/mcp-projection.d.ts +58 -0
  283. package/dist/tools/internal/mcp-projection.d.ts.map +1 -0
  284. package/dist/tools/internal/surface-projector.d.ts +3 -47
  285. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  286. package/dist/tools/invoker.d.ts +2 -0
  287. package/dist/tools/invoker.d.ts.map +1 -1
  288. package/dist/tools/manifest.d.ts +2 -0
  289. package/dist/tools/manifest.d.ts.map +1 -1
  290. package/dist/tools/mcp/handler.d.ts.map +1 -1
  291. package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
  292. package/dist/tools/mcp/mount.d.ts +4 -0
  293. package/dist/tools/mcp/mount.d.ts.map +1 -1
  294. package/dist/tools/mcp/prepare.d.ts +5 -2
  295. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  296. package/dist/tools/mount.d.ts +2 -0
  297. package/dist/tools/mount.d.ts.map +1 -1
  298. package/dist/tools/remote.d.ts.map +1 -1
  299. package/dist/tools/schema/nesting-limit.d.ts +8 -0
  300. package/dist/tools/schema/nesting-limit.d.ts.map +1 -0
  301. package/dist/tools/schema/presentation.d.ts +7 -0
  302. package/dist/tools/schema/presentation.d.ts.map +1 -1
  303. package/dist/tools/surface.d.ts.map +1 -1
  304. package/llms/agent-executor-acp.txt +3 -3
  305. package/llms/agent-executor-claude-sdk.txt +1 -1
  306. package/llms/agent-executor-claude.txt +1 -1
  307. package/llms/agent-executor-codex.txt +1 -1
  308. package/llms/agent-executor-testing-claude-sdk.txt +28 -0
  309. package/llms/agent-executor-testing.txt +7 -8
  310. package/llms/agent-executor.txt +27 -4
  311. package/llms/agent-runtime.txt +1 -1
  312. package/llms/contract.txt +8 -2
  313. package/llms/files-packaging.txt +11 -6
  314. package/llms/process-bootstrap.txt +18 -0
  315. package/llms/process.2.txt +215 -18
  316. package/llms/process.txt +130 -92
  317. package/llms/server.4.txt +49 -1
  318. package/llms/service-host-work.txt +34 -0
  319. package/llms/stitchkit.2.txt +31 -0
  320. package/llms/stitchkit.txt +78 -75
  321. package/llms/sync.txt +5 -2
  322. package/llms/testing.txt +1 -0
  323. package/llms/tools.2.txt +747 -775
  324. package/llms/tools.3.txt +846 -210
  325. package/llms/tools.4.txt +226 -0
  326. package/llms/tools.txt +3 -790
  327. package/llms/{upgrading-0.128.0-0.132.0.txt → upgrading-0.128.0-0.133.0.txt} +194 -6
  328. package/llms/upgrading.txt +1 -1
  329. package/llms-full.txt +746 -135
  330. package/llms.txt +18 -16
  331. package/package.json +12 -4
  332. package/dist/entrypoints/process/owner-loss.d.ts +0 -3
  333. package/dist/entrypoints/process/owner-loss.d.ts.map +0 -1
  334. package/dist/entrypoints/process/owner-loss.js +0 -7
  335. package/llms/process-owner-loss.txt +0 -18
@@ -0,0 +1,219 @@
1
+ import {
2
+ RegularFileError2,
3
+ readRegularFile2
4
+ } from "./index-21cfxc4z.js";
5
+ import {
6
+ runNativeCommand2
7
+ } from "./index-d04w81fz.js";
8
+ import {
9
+ writeFileAtomic2
10
+ } from "./index-pp97q86a.js";
11
+ import {
12
+ errnoOf
13
+ } from "./index-jj9228tt.js";
14
+ import {
15
+ compareCodeUnits,
16
+ serializeCanonicalJson
17
+ } from "./index-fmzg39a8.js";
18
+
19
+ // src/service-host/artifact-manifest.ts
20
+ import { createHash } from "node:crypto";
21
+ import { z } from "zod";
22
+ var ARTIFACT_MANIFEST_FILENAME2 = "manifest.json";
23
+ var DEFAULT_ARTIFACT_MAX_FILE_BYTES2 = 256 * 1024 * 1024;
24
+ var DEFAULT_ARTIFACT_MAX_FILES2 = 1e4;
25
+
26
+ class ArtifactVerificationError2 extends Error {
27
+ code;
28
+ path;
29
+ constructor(code, message, options) {
30
+ super(message, options);
31
+ this.name = "ArtifactVerificationError";
32
+ this.code = code;
33
+ this.path = options?.path;
34
+ }
35
+ }
36
+ function artifactRelativePathIssue(relPath, manifestFileName) {
37
+ if (relPath.length === 0)
38
+ return "Artifact file path must not be empty";
39
+ if (relPath.includes("\x00"))
40
+ return `Artifact file path contains NUL byte: ${relPath}`;
41
+ if (relPath.includes("\\"))
42
+ return `Artifact file path contains backslash: ${relPath}`;
43
+ if (relPath.startsWith("/"))
44
+ return `Artifact file path must be relative: ${relPath}`;
45
+ if (relPath.endsWith("/"))
46
+ return `Artifact file path must not end with '/': ${relPath}`;
47
+ if (manifestFileName !== undefined && relPath === manifestFileName) {
48
+ return `Artifact manifest cannot declare itself (${manifestFileName})`;
49
+ }
50
+ const segments = relPath.split("/");
51
+ for (const segment of segments) {
52
+ if (segment === "" || segment === "." || segment === "..") {
53
+ return `Artifact file path contains invalid segment '${segment}': ${relPath}`;
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+ function assertSafeSingleSegment(label, value, errorCode = "ACTIVATION_FAILED") {
59
+ if (value.length === 0 || value === "." || value === ".." || value.includes("\x00") || !/^[A-Za-z0-9._-]+$/.test(value)) {
60
+ throw new ArtifactVerificationError2(errorCode, `${label} must be a safe single path segment: ${JSON.stringify(value)}`);
61
+ }
62
+ }
63
+ var ArtifactFileEntrySchema2 = z.strictObject({
64
+ path: z.string().min(1),
65
+ sha256: z.string().regex(/^[0-9a-f]{64}$/),
66
+ size: z.number().int().nonnegative().optional(),
67
+ executable: z.boolean().optional()
68
+ }).check((ctx) => {
69
+ const issue = artifactRelativePathIssue(ctx.value.path);
70
+ if (issue !== null) {
71
+ ctx.issues.push({
72
+ code: "custom",
73
+ input: ctx.value.path,
74
+ path: ["path"],
75
+ message: issue
76
+ });
77
+ }
78
+ });
79
+ var ArtifactManifestSchema2 = z.strictObject({
80
+ version: z.string().min(1),
81
+ files: z.array(ArtifactFileEntrySchema2).min(1),
82
+ metadata: z.record(z.string(), z.unknown()).optional()
83
+ }).check((ctx) => {
84
+ const seen = new Set;
85
+ for (let index = 0;index < ctx.value.files.length; index += 1) {
86
+ const entry = ctx.value.files[index];
87
+ if (!entry)
88
+ continue;
89
+ if (seen.has(entry.path)) {
90
+ ctx.issues.push({
91
+ code: "custom",
92
+ input: entry.path,
93
+ path: ["files", index, "path"],
94
+ message: `Duplicate artifact file entry: ${entry.path}`
95
+ });
96
+ }
97
+ seen.add(entry.path);
98
+ }
99
+ });
100
+ function computeSha256Hex(data) {
101
+ return createHash("sha256").update(data).digest("hex");
102
+ }
103
+ function computeArtifactManifestDigest2(manifest) {
104
+ const sortedFiles = [...manifest.files].sort((left, right) => compareCodeUnits(left.path, right.path));
105
+ const canonical = {
106
+ version: manifest.version,
107
+ files: sortedFiles,
108
+ ...manifest.metadata !== undefined ? { metadata: manifest.metadata } : {}
109
+ };
110
+ return computeSha256Hex(serializeCanonicalJson(canonical));
111
+ }
112
+
113
+ // src/service-host/host-adapter.ts
114
+ import { lstat, readlink, realpath, unlink } from "node:fs/promises";
115
+ import { basename, dirname, join, posix } from "node:path";
116
+ var DEFAULT_COMMAND_TIMEOUT_MS = 30000;
117
+ var DEFAULT_MAX_OUTPUT_BYTES = 1024 * 1024;
118
+ var HOST_COMMAND_PATH = "/usr/sbin:/usr/bin:/sbin:/bin";
119
+ var HOST_COMMAND_SESSION_KEYS = [
120
+ "HOME",
121
+ "XDG_RUNTIME_DIR",
122
+ "DBUS_SESSION_BUS_ADDRESS"
123
+ ];
124
+ function hostCommandEnv() {
125
+ const env = { PATH: HOST_COMMAND_PATH };
126
+ for (const key of HOST_COMMAND_SESSION_KEYS) {
127
+ const value = process.env[key];
128
+ if (value !== undefined)
129
+ env[key] = value;
130
+ }
131
+ return env;
132
+ }
133
+ function isAbsoluteNormalPath(path) {
134
+ return path.startsWith("/") && !path.includes("\x00") && posix.normalize(path) === path && !(path.length > 1 && path.endsWith("/"));
135
+ }
136
+ async function canonicalHostPath(path) {
137
+ try {
138
+ return join(await realpath(dirname(path)), basename(path));
139
+ } catch (cause) {
140
+ const code = errnoOf(cause);
141
+ if (code === "ENOENT" || code === "ENOTDIR")
142
+ return path;
143
+ throw cause;
144
+ }
145
+ }
146
+ async function sameHostPath(adapter, reported, path) {
147
+ if (reported === path)
148
+ return true;
149
+ return await adapter.canonicalPath(reported) === await adapter.canonicalPath(path);
150
+ }
151
+ function isNonRegularFileError(error) {
152
+ return error instanceof RegularFileError2 && error.reason === "not-regular";
153
+ }
154
+ function createBaseServiceHostAdapter(adapterOptions) {
155
+ const decoder = new TextDecoder;
156
+ const nullOnNonRegular = adapterOptions.nullOnNonRegularFile ?? false;
157
+ return {
158
+ async runCommand(executable, args, options) {
159
+ const result = await runNativeCommand2({
160
+ executable,
161
+ args: [...args],
162
+ envPolicy: "declared-only",
163
+ env: hostCommandEnv(),
164
+ capture: true,
165
+ maxOutputBytes: DEFAULT_MAX_OUTPUT_BYTES,
166
+ timeoutMs: options?.timeoutMs ?? DEFAULT_COMMAND_TIMEOUT_MS,
167
+ ...options?.stdin !== undefined ? { stdin: options.stdin } : {}
168
+ });
169
+ return {
170
+ exitCode: result.exitCode ?? 1,
171
+ stdout: decoder.decode(result.stdout),
172
+ stderr: decoder.decode(result.stderr)
173
+ };
174
+ },
175
+ async readFile(path) {
176
+ try {
177
+ return await readRegularFile2(path);
178
+ } catch (cause) {
179
+ if (errnoOf(cause) === "ENOENT" || nullOnNonRegular && isNonRegularFileError(cause)) {
180
+ return null;
181
+ }
182
+ throw cause;
183
+ }
184
+ },
185
+ async writeFileAtomic(path, content, options) {
186
+ await writeFileAtomic2(path, content, {
187
+ mode: options?.mode ?? adapterOptions.defaultFileMode
188
+ });
189
+ },
190
+ async removeFile(path) {
191
+ try {
192
+ await unlink(path);
193
+ } catch (cause) {
194
+ if (errnoOf(cause) !== "ENOENT")
195
+ throw cause;
196
+ }
197
+ },
198
+ canonicalPath: canonicalHostPath,
199
+ async inspectPath(path) {
200
+ let info;
201
+ try {
202
+ info = await lstat(path);
203
+ } catch (cause) {
204
+ if (errnoOf(cause) === "ENOENT")
205
+ return { kind: "missing" };
206
+ throw cause;
207
+ }
208
+ if (info.isSymbolicLink())
209
+ return { kind: "symlink", target: await readlink(path) };
210
+ if (info.isFile())
211
+ return { kind: "file", mode: info.mode & 4095 };
212
+ return { kind: "other" };
213
+ },
214
+ now: () => Date.now(),
215
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
216
+ };
217
+ }
218
+
219
+ export { ARTIFACT_MANIFEST_FILENAME2, DEFAULT_ARTIFACT_MAX_FILE_BYTES2, DEFAULT_ARTIFACT_MAX_FILES2, ArtifactVerificationError2, artifactRelativePathIssue, assertSafeSingleSegment, ArtifactFileEntrySchema2, ArtifactManifestSchema2, computeSha256Hex, computeArtifactManifestDigest2, hostCommandEnv, isAbsoluteNormalPath, sameHostPath, createBaseServiceHostAdapter };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AppError2
3
- } from "./index-9pv126eh.js";
3
+ } from "./index-7fjbdga8.js";
4
4
 
5
5
  // src/tools/internal/tool-error-projection.ts
6
6
  var TOOL_ERROR_PROJECTION = Symbol.for("stitchkit.toolErrorProjection");
@@ -25,7 +25,7 @@ import {
25
25
  replaceMessage,
26
26
  ArchiveSpillSchema,
27
27
  createAgentRuntimeStore2
28
- } from "./index-dcsxj68j.js";
28
+ } from "./index-tqjamnax.js";
29
29
 
30
30
  // src/agent-runtime/store-memory.ts
31
31
  import { z as z2 } from "zod";
@@ -0,0 +1,42 @@
1
+ import {
2
+ isRetryableStatus2
3
+ } from "./index-7fjbdga8.js";
4
+
5
+ // src/contract/operation-refusals.ts
6
+ function assertEndpointRefusals(where, refuses) {
7
+ if (refuses === undefined)
8
+ return;
9
+ if (!Array.isArray(refuses)) {
10
+ throw new Error(`${where}.refuses must be an array of error factories from defineErrors`);
11
+ }
12
+ const seen = new Set;
13
+ refuses.forEach((entry, index) => {
14
+ const code = isDeclaration(entry) ? entry.code : undefined;
15
+ if (code === undefined) {
16
+ throw new Error(`${where}.refuses[${index}] is not an error factory from defineErrors — declare the code there and list its factory`);
17
+ }
18
+ if (seen.has(code))
19
+ throw new Error(`${where}.refuses names "${code}" twice`);
20
+ seen.add(code);
21
+ });
22
+ }
23
+ function isDeclaration(entry) {
24
+ if (typeof entry !== "function" && (typeof entry !== "object" || entry === null))
25
+ return false;
26
+ const code = Reflect.get(entry, "code");
27
+ const definition = Reflect.get(entry, "definition");
28
+ return typeof code === "string" && code.length > 0 && typeof definition === "object" && definition !== null && typeof Reflect.get(definition, "status") === "number";
29
+ }
30
+ function describeRefusals(refuses) {
31
+ if (refuses === undefined)
32
+ return;
33
+ return Object.freeze(refuses.map(({ code, definition }) => Object.freeze({
34
+ code,
35
+ status: definition.status,
36
+ retryable: definition.retryable ?? isRetryableStatus2(definition.status),
37
+ ...definition.message !== undefined && { message: definition.message },
38
+ ...definition.details !== undefined && { details: definition.details }
39
+ })));
40
+ }
41
+
42
+ export { assertEndpointRefusals, describeRefusals };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  streamNativeCommand2
3
- } from "./index-3fym4j8n.js";
3
+ } from "./index-gtaaxe9d.js";
4
4
  import {
5
5
  createBoundedLineDecoder
6
6
  } from "./index-39rmc00v.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  normalizeError2
3
- } from "./index-akf0xkrm.js";
3
+ } from "./index-78da4g74.js";
4
4
  import {
5
5
  isStitchErrorCode2
6
- } from "./index-9pv126eh.js";
6
+ } from "./index-7fjbdga8.js";
7
7
 
8
8
  // src/server/error-hook.ts
9
9
  function createErrorHook2(config) {
@@ -2,7 +2,7 @@ import {
2
2
  PlanWindowSchema2,
3
3
  PlanLimitsSchema2,
4
4
  clampPlanName
5
- } from "./index-f9p62ean.js";
5
+ } from "./index-stpy56r3.js";
6
6
  import {
7
7
  isPositiveSafeInteger
8
8
  } from "./index-gr0kxymw.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normalizeError2
3
- } from "./index-akf0xkrm.js";
3
+ } from "./index-78da4g74.js";
4
4
  import {
5
5
  ShutdownOptionsSchema2
6
6
  } from "./index-t1a2jrg7.js";
@@ -30,7 +30,7 @@ import {
30
30
  } from "./index-cv9b7fz2.js";
31
31
  import {
32
32
  bindContract
33
- } from "./index-wa6h4tz6.js";
33
+ } from "./index-1qwd54n3.js";
34
34
  import {
35
35
  getTraceId2
36
36
  } from "./index-x6sp5vpa.js";
@@ -40,7 +40,7 @@ import {
40
40
  import {
41
41
  unauthorized2,
42
42
  forbidden2
43
- } from "./index-9pv126eh.js";
43
+ } from "./index-7fjbdga8.js";
44
44
  import {
45
45
  readBoundedBody2,
46
46
  readBoundedText
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startNativeCommand
3
- } from "./index-qa2jjb65.js";
3
+ } from "./index-pbekeqzm.js";
4
4
  import {
5
5
  raceAbort
6
6
  } from "./index-rptj3qnc.js";
@@ -670,7 +670,7 @@ function startOwnerLossGuardEntry() {
670
670
  runOwnerLossGuard(process.argv[3], process.argv[pinnedCwd ? 6 : 4], process.argv.slice(pinnedCwd ? 7 : 5), pinnedCwd ? 4 : undefined);
671
671
  guardInvocation = true;
672
672
  }
673
- function bootstrapNativeCommandOwnerLoss2() {
673
+ function ownerLossGuardStarted() {
674
674
  return guardInvocation;
675
675
  }
676
676
  function ownerLossGuardEntry() {
@@ -678,4 +678,4 @@ function ownerLossGuardEntry() {
678
678
  }
679
679
  startOwnerLossGuardEntry();
680
680
 
681
- export { COMMAND_CLEANUP_TIMEOUT_MS, NativeCommandOptionsSchema, NativeCommandError2, abortOwnerLossLaunch, attachOwnerLossControl, transferOwnerLossControl, awaitCommandStart, ownerLossAvailable, ownerLossGuardCommand, hostIsBun, spawnBunChild, spawnBunInheritedChild, bootstrapNativeCommandOwnerLoss2, ownerLossGuardEntry };
681
+ export { COMMAND_CLEANUP_TIMEOUT_MS, NativeCommandOptionsSchema, NativeCommandError2, abortOwnerLossLaunch, attachOwnerLossControl, transferOwnerLossControl, awaitCommandStart, ownerLossAvailable, ownerLossGuardCommand, hostIsBun, spawnBunChild, spawnBunInheritedChild, ownerLossGuardStarted, ownerLossGuardEntry };
@@ -0,0 +1,164 @@
1
+ import {
2
+ TYPE_DEFINING_KEYWORDS
3
+ } from "./index-27hck3z2.js";
4
+ import {
5
+ isRecord
6
+ } from "./index-ps3djm8d.js";
7
+
8
+ // src/tools/schema/portable-formats.ts
9
+ var PORTABLE_JSON_SCHEMA_FORMATS2 = new Set([
10
+ "date",
11
+ "time",
12
+ "date-time",
13
+ "duration",
14
+ "uri",
15
+ "uri-reference",
16
+ "uri-template",
17
+ "email",
18
+ "hostname",
19
+ "ipv4",
20
+ "ipv6",
21
+ "regex",
22
+ "uuid",
23
+ "json-pointer",
24
+ "relative-json-pointer"
25
+ ]);
26
+ function propertyPath(prefix, property) {
27
+ return prefix ? `${prefix}.${property}` : property;
28
+ }
29
+ function keywordPath(prefix, keyword) {
30
+ if (prefix && keyword.startsWith("["))
31
+ return `${prefix}${keyword}`;
32
+ return prefix ? `${prefix}.${keyword}` : keyword;
33
+ }
34
+ function findNonPortableFormats2(schema, allowFormats = []) {
35
+ const allowed = new Set([...PORTABLE_JSON_SCHEMA_FORMATS2, ...allowFormats]);
36
+ const found = [];
37
+ const pending = [{ value: schema, path: "" }];
38
+ while (pending.length > 0) {
39
+ const current = pending.pop();
40
+ if (!current || !isRecord(current.value))
41
+ continue;
42
+ const format = current.value.format;
43
+ if (typeof format === "string" && !allowed.has(format)) {
44
+ found.push({ path: current.path || "(root)", format });
45
+ }
46
+ const properties = current.value.properties;
47
+ if (isRecord(properties)) {
48
+ for (const [key, value] of Object.entries(properties)) {
49
+ pending.push({ value, path: propertyPath(current.path, key) });
50
+ }
51
+ }
52
+ for (const mapKey of ["$defs", "definitions", "patternProperties", "dependentSchemas"]) {
53
+ const entries = current.value[mapKey];
54
+ if (!isRecord(entries))
55
+ continue;
56
+ for (const [key, value] of Object.entries(entries)) {
57
+ pending.push({ value, path: keywordPath(current.path, `${mapKey}.${key}`) });
58
+ }
59
+ }
60
+ const directChildren = [
61
+ ["items", "[]"],
62
+ ["contains", "contains"],
63
+ ["additionalProperties", "*"],
64
+ ["unevaluatedProperties", "*"],
65
+ ["propertyNames", "propertyNames"],
66
+ ["not", "not"],
67
+ ["if", "if"],
68
+ ["then", "then"],
69
+ ["else", "else"]
70
+ ];
71
+ for (const [keyword, segment] of directChildren) {
72
+ const child = current.value[keyword];
73
+ if (isRecord(child)) {
74
+ pending.push({ value: child, path: keywordPath(current.path, segment) });
75
+ }
76
+ if (Array.isArray(child)) {
77
+ child.forEach((value, index) => {
78
+ pending.push({ value, path: keywordPath(current.path, `${segment}[${index}]`) });
79
+ });
80
+ }
81
+ }
82
+ for (const keyword of ["prefixItems", "allOf", "anyOf", "oneOf"]) {
83
+ const branches = current.value[keyword];
84
+ if (!Array.isArray(branches))
85
+ continue;
86
+ branches.forEach((value, index) => {
87
+ pending.push({ value, path: keywordPath(current.path, `${keyword}[${index}]`) });
88
+ });
89
+ }
90
+ }
91
+ return found.sort((left, right) => left.path.localeCompare(right.path) || left.format.localeCompare(right.format));
92
+ }
93
+
94
+ // src/tools/schema/untyped-properties.ts
95
+ function saysWhatItIs(schema) {
96
+ return TYPE_DEFINING_KEYWORDS.some((keyword) => schema[keyword] !== undefined);
97
+ }
98
+ function findUntypedProperties2(schema, prefix = "") {
99
+ if (!isRecord(schema))
100
+ return [];
101
+ const found = [];
102
+ const properties = schema.properties;
103
+ if (isRecord(properties)) {
104
+ for (const [key, value] of Object.entries(properties)) {
105
+ const path = prefix ? `${prefix}.${key}` : key;
106
+ if (isRecord(value)) {
107
+ if (!saysWhatItIs(value)) {
108
+ const description = value.description;
109
+ found.push({
110
+ path,
111
+ ...typeof description === "string" && { description }
112
+ });
113
+ }
114
+ found.push(...findUntypedProperties2(value, path));
115
+ }
116
+ }
117
+ }
118
+ for (const key of ["items", "additionalProperties"]) {
119
+ const child = schema[key];
120
+ if (isRecord(child))
121
+ found.push(...findUntypedProperties2(child, prefix));
122
+ if (Array.isArray(child)) {
123
+ for (const entry of child) {
124
+ if (isRecord(entry))
125
+ found.push(...findUntypedProperties2(entry, prefix));
126
+ }
127
+ }
128
+ }
129
+ for (const key of ["prefixItems"]) {
130
+ const child = schema[key];
131
+ if (Array.isArray(child)) {
132
+ for (const entry of child) {
133
+ if (isRecord(entry))
134
+ found.push(...findUntypedProperties2(entry, prefix));
135
+ }
136
+ }
137
+ }
138
+ const patterned = schema.patternProperties;
139
+ if (isRecord(patterned)) {
140
+ for (const value of Object.values(patterned)) {
141
+ if (isRecord(value))
142
+ found.push(...findUntypedProperties2(value, prefix));
143
+ }
144
+ }
145
+ for (const key of ["$defs", "definitions"]) {
146
+ const container = schema[key];
147
+ if (!isRecord(container))
148
+ continue;
149
+ for (const definition of Object.values(container)) {
150
+ if (isRecord(definition))
151
+ found.push(...findUntypedProperties2(definition, prefix));
152
+ }
153
+ }
154
+ for (const key of ["allOf", "anyOf", "oneOf"]) {
155
+ const branches = schema[key];
156
+ if (Array.isArray(branches)) {
157
+ for (const branch of branches)
158
+ found.push(...findUntypedProperties2(branch, prefix));
159
+ }
160
+ }
161
+ return found;
162
+ }
163
+
164
+ export { PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, findUntypedProperties2 };