stitchkit 0.104.2 → 0.105.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 (429) hide show
  1. package/CHANGELOG.md +372 -13
  2. package/darwin-native.cjs +4 -2
  3. package/dist/agent-runtime/browser-control-contract.d.ts +32 -2
  4. package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -1
  5. package/dist/agent-runtime/browser-controller.d.ts +21 -3
  6. package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
  7. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  8. package/dist/agent-runtime/coding-tool-refusals.d.ts +1 -0
  9. package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
  10. package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
  11. package/dist/agent-runtime/compaction.d.ts.map +1 -1
  12. package/dist/agent-runtime/contained-write.d.ts.map +1 -1
  13. package/dist/agent-runtime/control-schema.d.ts +48 -1
  14. package/dist/agent-runtime/control-schema.d.ts.map +1 -1
  15. package/dist/agent-runtime/deferred-tool-search.d.ts +3 -2
  16. package/dist/agent-runtime/deferred-tool-search.d.ts.map +1 -1
  17. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  18. package/dist/agent-runtime/harness-realtime.d.ts +34 -4
  19. package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
  20. package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -1
  21. package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
  22. package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
  23. package/dist/agent-runtime/sandbox-process-owner.d.ts +9 -1
  24. package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -1
  25. package/dist/agent-runtime/sandbox.d.ts +32 -1
  26. package/dist/agent-runtime/sandbox.d.ts.map +1 -1
  27. package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
  28. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  29. package/dist/agent-runtime/store-events.d.ts +9 -4
  30. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  31. package/dist/agent-runtime/testing.d.ts.map +1 -1
  32. package/dist/application/diagnostic-journal-contract.d.ts +50 -0
  33. package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
  34. package/dist/application/diagnostic-journal-generations.d.ts +24 -0
  35. package/dist/application/diagnostic-journal-generations.d.ts.map +1 -0
  36. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  37. package/dist/application/diagnostic-journal-open.d.ts +10 -0
  38. package/dist/application/diagnostic-journal-open.d.ts.map +1 -0
  39. package/dist/application/diagnostic-journal-quarantine.d.ts +28 -0
  40. package/dist/application/diagnostic-journal-quarantine.d.ts.map +1 -0
  41. package/dist/application/diagnostic-journal-read-contract.d.ts +73 -3
  42. package/dist/application/diagnostic-journal-read-contract.d.ts.map +1 -1
  43. package/dist/application/diagnostic-journal-reader.d.ts +17 -2
  44. package/dist/application/diagnostic-journal-reader.d.ts.map +1 -1
  45. package/dist/application/diagnostic-journal-recovery.d.ts +18 -2
  46. package/dist/application/diagnostic-journal-recovery.d.ts.map +1 -1
  47. package/dist/application/diagnostic-journal-storage.d.ts +6 -2
  48. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  49. package/dist/application/diagnostic-journal-tail.d.ts +12 -0
  50. package/dist/application/diagnostic-journal-tail.d.ts.map +1 -0
  51. package/dist/application/diagnostic-journal.d.ts +3 -0
  52. package/dist/application/diagnostic-journal.d.ts.map +1 -1
  53. package/dist/application/directory-inbox-accept.d.ts +3 -3
  54. package/dist/application/directory-inbox-accept.d.ts.map +1 -1
  55. package/dist/application/directory-inbox-contract.d.ts +38 -10
  56. package/dist/application/directory-inbox-contract.d.ts.map +1 -1
  57. package/dist/application/directory-inbox-delivery.d.ts +3 -3
  58. package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
  59. package/dist/application/directory-inbox-files.d.ts +17 -2
  60. package/dist/application/directory-inbox-files.d.ts.map +1 -1
  61. package/dist/application/directory-inbox-state.d.ts +1 -1
  62. package/dist/application/directory-inbox-state.d.ts.map +1 -1
  63. package/dist/application/directory-inbox.d.ts +1 -1
  64. package/dist/application/directory-inbox.d.ts.map +1 -1
  65. package/dist/application/file-state-store.d.ts +21 -1
  66. package/dist/application/file-state-store.d.ts.map +1 -1
  67. package/dist/application/grammy.d.ts.map +1 -1
  68. package/dist/application/kernel-contract.d.ts.map +1 -1
  69. package/dist/application/revision-signal.d.ts.map +1 -1
  70. package/dist/application/state-store.d.ts +3 -0
  71. package/dist/application/state-store.d.ts.map +1 -1
  72. package/dist/browser/api-error.d.ts +38 -0
  73. package/dist/browser/api-error.d.ts.map +1 -0
  74. package/dist/browser/chunked-upload.d.ts.map +1 -1
  75. package/dist/browser/client-executors.d.ts.map +1 -1
  76. package/dist/browser/client-url.d.ts.map +1 -1
  77. package/dist/browser/contract-stream.d.ts.map +1 -1
  78. package/dist/browser/http.d.ts +0 -25
  79. package/dist/browser/http.d.ts.map +1 -1
  80. package/dist/browser/resumable.d.ts.map +1 -1
  81. package/dist/contract/define-validation.d.ts +0 -1
  82. package/dist/contract/define-validation.d.ts.map +1 -1
  83. package/dist/contract/define.d.ts.map +1 -1
  84. package/dist/contract/errors-factory.d.ts.map +1 -1
  85. package/dist/contract/errors.d.ts +15 -18
  86. package/dist/contract/errors.d.ts.map +1 -1
  87. package/dist/contract/normalize.d.ts.map +1 -1
  88. package/dist/durability/effect.d.ts.map +1 -1
  89. package/dist/durability/scheduler.d.ts.map +1 -1
  90. package/dist/entrypoints/agent-runtime/browser.js +29 -18
  91. package/dist/entrypoints/agent-runtime/coding-tools.js +8 -7
  92. package/dist/entrypoints/agent-runtime/harness.js +15 -14
  93. package/dist/entrypoints/agent-runtime/realtime.d.ts +1 -1
  94. package/dist/entrypoints/agent-runtime/realtime.d.ts.map +1 -1
  95. package/dist/entrypoints/agent-runtime/realtime.js +119 -54
  96. package/dist/entrypoints/agent-runtime/sandbox.js +23 -17
  97. package/dist/entrypoints/agent-runtime/sqlite/bun.js +4 -3
  98. package/dist/entrypoints/agent-runtime/sqlite/node.js +4 -3
  99. package/dist/entrypoints/agent-runtime/testing.js +8 -6
  100. package/dist/entrypoints/agent-runtime.js +37 -38
  101. package/dist/entrypoints/application/diagnostic-journal.js +305 -111
  102. package/dist/entrypoints/application/directory-inbox.js +174 -77
  103. package/dist/entrypoints/application/grammy.js +5 -2
  104. package/dist/entrypoints/application/opentelemetry.js +2 -2
  105. package/dist/entrypoints/application.d.ts +2 -2
  106. package/dist/entrypoints/application.d.ts.map +1 -1
  107. package/dist/entrypoints/application.js +17 -8
  108. package/dist/entrypoints/cli/publish.d.ts +16 -0
  109. package/dist/entrypoints/cli/publish.d.ts.map +1 -0
  110. package/dist/entrypoints/cli/publish.js +527 -0
  111. package/dist/entrypoints/cli.d.ts +1 -2
  112. package/dist/entrypoints/cli.d.ts.map +1 -1
  113. package/dist/entrypoints/cli.js +59 -966
  114. package/dist/entrypoints/contract.js +3 -3
  115. package/dist/entrypoints/files/packaging.js +153 -64
  116. package/dist/entrypoints/files.d.ts +1 -0
  117. package/dist/entrypoints/files.d.ts.map +1 -1
  118. package/dist/entrypoints/files.js +17 -10
  119. package/dist/entrypoints/index.d.ts +2 -1
  120. package/dist/entrypoints/index.d.ts.map +1 -1
  121. package/dist/entrypoints/index.js +31 -60
  122. package/dist/entrypoints/node.js +8 -8
  123. package/dist/entrypoints/observability.js +3 -3
  124. package/dist/entrypoints/primitives.js +67 -83
  125. package/dist/entrypoints/process.d.ts +1 -1
  126. package/dist/entrypoints/process.d.ts.map +1 -1
  127. package/dist/entrypoints/process.js +2 -2
  128. package/dist/entrypoints/react.js +4 -2
  129. package/dist/entrypoints/remote.js +37 -13
  130. package/dist/entrypoints/server.js +18 -16
  131. package/dist/entrypoints/telegram/screens.js +5 -3
  132. package/dist/entrypoints/telegram.js +31 -46
  133. package/dist/entrypoints/testing.d.ts +1 -1
  134. package/dist/entrypoints/testing.d.ts.map +1 -1
  135. package/dist/entrypoints/testing.js +444 -448
  136. package/dist/entrypoints/tools/connections.js +268 -105
  137. package/dist/entrypoints/tools/contract.js +2 -2
  138. package/dist/entrypoints/tools/invoker.js +8 -7
  139. package/dist/entrypoints/tools/mcp.d.ts +2 -2
  140. package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
  141. package/dist/entrypoints/tools/mcp.js +10 -9
  142. package/dist/entrypoints/tools.d.ts +0 -1
  143. package/dist/entrypoints/tools.d.ts.map +1 -1
  144. package/dist/entrypoints/tools.js +118 -53
  145. package/dist/entrypoints/tracking.js +2 -3
  146. package/dist/files/boundary.d.ts +2 -2
  147. package/dist/files/boundary.d.ts.map +1 -1
  148. package/dist/files/chunk-spool.d.ts.map +1 -1
  149. package/dist/files/file-io.d.ts +2 -2
  150. package/dist/files/file-io.d.ts.map +1 -1
  151. package/dist/files/native-packaging-layout.d.ts +50 -4
  152. package/dist/files/native-packaging-layout.d.ts.map +1 -1
  153. package/dist/files/native-packaging.d.ts +78 -17
  154. package/dist/files/native-packaging.d.ts.map +1 -1
  155. package/dist/{index-r5hsgkz5.js → index-0gs4ymfj.js} +6 -3
  156. package/dist/{index-zax7resm.js → index-0gxvns6s.js} +1 -13
  157. package/dist/index-0s4xebbg.js +8 -0
  158. package/dist/{index-r4r70zmh.js → index-12zsej7b.js} +5 -2
  159. package/dist/{index-kemm0ej5.js → index-1pwwan01.js} +65 -22
  160. package/dist/{index-vgkbcnkc.js → index-299sm5tr.js} +1 -1
  161. package/dist/{index-2vnh05w4.js → index-2k91mewf.js} +31 -74
  162. package/dist/{index-269zqj8m.js → index-2rc6jd9n.js} +28 -12
  163. package/dist/{index-wh0ecvyk.js → index-37asdw3a.js} +1 -1
  164. package/dist/index-3h0ztg0z.js +285 -0
  165. package/dist/{index-g95fk660.js → index-4vsby8n8.js} +8 -15
  166. package/dist/index-556g5hsh.js +17 -0
  167. package/dist/{index-adhgd4pe.js → index-5p55xreg.js} +2 -2
  168. package/dist/index-5w6t91ze.js +47 -0
  169. package/dist/{index-9pw0a51a.js → index-6yxhe58g.js} +40 -7
  170. package/dist/{index-6d9xaxw1.js → index-8ks9b85e.js} +33 -5
  171. package/dist/{index-bhb950qs.js → index-916yh4e2.js} +25 -12
  172. package/dist/index-9tqbxv5p.js +44 -0
  173. package/dist/{index-5csmzesf.js → index-azx12jgv.js} +4 -3
  174. package/dist/{index-mbnnw3f2.js → index-b0kddvzw.js} +15 -5
  175. package/dist/{index-n5yqxd3d.js → index-b0w7rbpt.js} +23 -2
  176. package/dist/index-b56nnscm.js +132 -0
  177. package/dist/{index-0ndk4555.js → index-c0hffcmj.js} +2 -2
  178. package/dist/{index-pptyv13k.js → index-c17xcx4k.js} +42 -6
  179. package/dist/{index-g2j7pnak.js → index-cmzvhhtd.js} +5 -2
  180. package/dist/index-cq59agna.js +51 -0
  181. package/dist/{index-ssmd41kh.js → index-d2h99n7d.js} +1 -1
  182. package/dist/{index-z94wht4y.js → index-dky0dcmf.js} +34 -5
  183. package/dist/{index-za6j7nwy.js → index-dsnjzb62.js} +104 -51
  184. package/dist/index-eemvahkc.js +21 -0
  185. package/dist/index-ef8gdaq0.js +105 -0
  186. package/dist/{index-fa4wg312.js → index-f199nfq5.js} +10 -6
  187. package/dist/{index-ck71tbcf.js → index-fsw1ybf3.js} +11 -15
  188. package/dist/{index-f330qqyg.js → index-g2vfg7ak.js} +217 -63
  189. package/dist/{index-fk18k56k.js → index-gr5g3xfw.js} +11 -18
  190. package/dist/{index-jn9g8xdt.js → index-hjvje0pf.js} +6 -4
  191. package/dist/{index-x928baz2.js → index-j9gxbztg.js} +18 -14
  192. package/dist/index-kfjkb396.js +37 -0
  193. package/dist/{index-6drst9sg.js → index-ksfagmyz.js} +45 -345
  194. package/dist/index-m616f0yz.js +120 -0
  195. package/dist/{index-fm1c1a08.js → index-m6w6jtda.js} +40 -21
  196. package/dist/{index-ptn0g0gj.js → index-ma963wz7.js} +21 -20
  197. package/dist/{index-bakgedh8.js → index-msfpyy2f.js} +2 -4
  198. package/dist/{index-ywppsaby.js → index-n1nszyk0.js} +23 -34
  199. package/dist/{index-v14qqmys.js → index-n4689krb.js} +1 -1
  200. package/dist/{index-a0zzh8ak.js → index-pz3y6b6g.js} +3 -3
  201. package/dist/{index-43p08g7t.js → index-pzb63z66.js} +12 -8
  202. package/dist/{index-h97tqqp1.js → index-qaet40b2.js} +5 -3
  203. package/dist/{index-t1sr4aks.js → index-qaqbdm7s.js} +52 -6
  204. package/dist/{index-77nxk6ay.js → index-r393tnfp.js} +16 -10
  205. package/dist/{index-kb8styz3.js → index-rpzewktb.js} +15 -5
  206. package/dist/{index-27a2pj09.js → index-sj28htvf.js} +1 -1
  207. package/dist/index-szybbezc.js +455 -0
  208. package/dist/{index-2hyavjjj.js → index-wbhdzxar.js} +3 -3
  209. package/dist/{index-4e0ah203.js → index-wdy68sh6.js} +47 -24
  210. package/dist/{index-hbd32c6a.js → index-wqmvtnkp.js} +38 -89
  211. package/dist/{index-hp9d77wk.js → index-x7w1z6pf.js} +15 -4
  212. package/dist/{index-20yvtn9a.js → index-yt7gyg5x.js} +1 -1
  213. package/dist/{index-cvda079a.js → index-yvfk3y36.js} +12 -2
  214. package/dist/{index-5z6jn897.js → index-z23rfxhj.js} +1 -1
  215. package/dist/internal/abort-race.d.ts +8 -2
  216. package/dist/internal/abort-race.d.ts.map +1 -1
  217. package/dist/internal/atomic-file.d.ts +55 -9
  218. package/dist/internal/atomic-file.d.ts.map +1 -1
  219. package/dist/internal/atomic-publication.d.ts +39 -4
  220. package/dist/internal/atomic-publication.d.ts.map +1 -1
  221. package/dist/internal/atomic-staging.d.ts +46 -0
  222. package/dist/internal/atomic-staging.d.ts.map +1 -0
  223. package/dist/internal/bounded-file-read.d.ts +19 -11
  224. package/dist/internal/bounded-file-read.d.ts.map +1 -1
  225. package/dist/internal/bounded-lines.d.ts.map +1 -1
  226. package/dist/internal/close-after.d.ts +11 -0
  227. package/dist/internal/close-after.d.ts.map +1 -0
  228. package/dist/internal/deadline.d.ts +10 -0
  229. package/dist/internal/deadline.d.ts.map +1 -1
  230. package/dist/internal/exclusive-lock-read.d.ts +10 -12
  231. package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
  232. package/dist/internal/exclusive-lock.d.ts +2 -2
  233. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  234. package/dist/internal/file-observation.d.ts +14 -0
  235. package/dist/internal/file-observation.d.ts.map +1 -0
  236. package/dist/internal/json-data.d.ts +22 -5
  237. package/dist/internal/json-data.d.ts.map +1 -1
  238. package/dist/internal/positive-integer.d.ts +9 -0
  239. package/dist/internal/positive-integer.d.ts.map +1 -0
  240. package/dist/internal/process-instance.d.ts +35 -5
  241. package/dist/internal/process-instance.d.ts.map +1 -1
  242. package/dist/internal/secure-fetch.d.ts.map +1 -1
  243. package/dist/internal/timers.d.ts +11 -0
  244. package/dist/internal/timers.d.ts.map +1 -0
  245. package/dist/internal/with-exclusive-lock.d.ts +5 -4
  246. package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
  247. package/dist/observability/bounded-sink.d.ts.map +1 -1
  248. package/dist/primitives/canonical-json.d.ts +23 -2
  249. package/dist/primitives/canonical-json.d.ts.map +1 -1
  250. package/dist/primitives/delivery.d.ts.map +1 -1
  251. package/dist/primitives/index.d.ts +1 -1
  252. package/dist/primitives/index.d.ts.map +1 -1
  253. package/dist/primitives/money.d.ts.map +1 -1
  254. package/dist/process/cleanup.d.ts +6 -1
  255. package/dist/process/cleanup.d.ts.map +1 -1
  256. package/dist/process/command-lifetime.d.ts +4 -0
  257. package/dist/process/command-lifetime.d.ts.map +1 -1
  258. package/dist/process/command-owner.d.ts.map +1 -1
  259. package/dist/process/command.d.ts +4 -0
  260. package/dist/process/command.d.ts.map +1 -1
  261. package/dist/process/contract.d.ts +67 -2
  262. package/dist/process/contract.d.ts.map +1 -1
  263. package/dist/process/group.d.ts +40 -3
  264. package/dist/process/group.d.ts.map +1 -1
  265. package/dist/process/launch.d.ts +12 -1
  266. package/dist/process/launch.d.ts.map +1 -1
  267. package/dist/process/terminate.d.ts +39 -0
  268. package/dist/process/terminate.d.ts.map +1 -0
  269. package/dist/react/query-client.d.ts.map +1 -1
  270. package/dist/realtime/rejection.d.ts.map +1 -1
  271. package/dist/server/contract-stream.d.ts.map +1 -1
  272. package/dist/server/handler-state.d.ts.map +1 -1
  273. package/dist/server/implement.d.ts.map +1 -1
  274. package/dist/server/request-body.d.ts +0 -1
  275. package/dist/server/request-body.d.ts.map +1 -1
  276. package/dist/server/unix-client.d.ts.map +1 -1
  277. package/dist/telegram/broadcast-delivery.d.ts.map +1 -1
  278. package/dist/telegram/broadcast-failure.d.ts +10 -2
  279. package/dist/telegram/broadcast-failure.d.ts.map +1 -1
  280. package/dist/telegram/operator-channel.d.ts.map +1 -1
  281. package/dist/telegram/screens/outcome.d.ts.map +1 -1
  282. package/dist/testing/surface-conformance.d.ts +1 -1
  283. package/dist/testing/surface-conformance.d.ts.map +1 -1
  284. package/dist/testing/surface-manifest.d.ts +0 -6
  285. package/dist/testing/surface-manifest.d.ts.map +1 -1
  286. package/dist/tools/agent.d.ts +1 -1
  287. package/dist/tools/agent.d.ts.map +1 -1
  288. package/dist/tools/cli/args.d.ts +1 -1
  289. package/dist/tools/cli/args.d.ts.map +1 -1
  290. package/dist/tools/cli/help.d.ts.map +1 -1
  291. package/dist/tools/cli/invoke.d.ts +2 -2
  292. package/dist/tools/cli/invoke.d.ts.map +1 -1
  293. package/dist/tools/cli/profile.d.ts.map +1 -1
  294. package/dist/tools/cli/publication-assets.d.ts.map +1 -1
  295. package/dist/tools/cli/publication-contract.d.ts +8 -0
  296. package/dist/tools/cli/publication-contract.d.ts.map +1 -1
  297. package/dist/tools/cli/publication-control.d.ts.map +1 -1
  298. package/dist/tools/cli/publication-storage.d.ts +23 -2
  299. package/dist/tools/cli/publication-storage.d.ts.map +1 -1
  300. package/dist/tools/cli/publication.d.ts +8 -1
  301. package/dist/tools/cli/publication.d.ts.map +1 -1
  302. package/dist/tools/connections/errors.d.ts +18 -6
  303. package/dist/tools/connections/errors.d.ts.map +1 -1
  304. package/dist/tools/connections/limits.d.ts +8 -2
  305. package/dist/tools/connections/limits.d.ts.map +1 -1
  306. package/dist/tools/connections/mcp-client.d.ts.map +1 -1
  307. package/dist/tools/connections/mcp-envelope.d.ts.map +1 -1
  308. package/dist/tools/connections/openapi.d.ts.map +1 -1
  309. package/dist/tools/connections/schema-budget.d.ts +1 -1
  310. package/dist/tools/connections/schema-budget.d.ts.map +1 -1
  311. package/dist/tools/connections/sse-session.d.ts.map +1 -1
  312. package/dist/tools/execute-args.d.ts.map +1 -1
  313. package/dist/tools/execute-result.d.ts.map +1 -1
  314. package/dist/tools/internal/surface-projector.d.ts +17 -3
  315. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  316. package/dist/tools/internal/tool-error-projection.d.ts +16 -0
  317. package/dist/tools/internal/tool-error-projection.d.ts.map +1 -0
  318. package/dist/tools/internal/tool-view.d.ts.map +1 -1
  319. package/dist/tools/invoker.d.ts.map +1 -1
  320. package/dist/tools/list-names.d.ts +3 -2
  321. package/dist/tools/list-names.d.ts.map +1 -1
  322. package/dist/tools/manifest.d.ts +3 -2
  323. package/dist/tools/manifest.d.ts.map +1 -1
  324. package/dist/tools/mcp/handler.d.ts +7 -0
  325. package/dist/tools/mcp/handler.d.ts.map +1 -1
  326. package/dist/tools/mcp/mount.d.ts +18 -2
  327. package/dist/tools/mcp/mount.d.ts.map +1 -1
  328. package/dist/tools/mcp/prepare.d.ts +3 -3
  329. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  330. package/dist/tools/mcp/register.d.ts.map +1 -1
  331. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  332. package/dist/tools/mcp/stdio-signals.d.ts +14 -0
  333. package/dist/tools/mcp/stdio-signals.d.ts.map +1 -1
  334. package/dist/tools/mcp/stdio.d.ts +7 -0
  335. package/dist/tools/mcp/stdio.d.ts.map +1 -1
  336. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
  337. package/dist/tools/operations/async-operation-runtime-types.d.ts +3 -3
  338. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
  339. package/dist/tools/operations/define-wait-tool.d.ts +1 -1
  340. package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
  341. package/dist/tools/operations/wait-core.d.ts +0 -6
  342. package/dist/tools/operations/wait-core.d.ts.map +1 -1
  343. package/dist/tools/registry.d.ts +1 -1
  344. package/dist/tools/registry.d.ts.map +1 -1
  345. package/dist/tools/remote.d.ts +1 -1
  346. package/dist/tools/remote.d.ts.map +1 -1
  347. package/dist/tools/{runtime-tool-execution.d.ts → runtime-tool-declaration.d.ts} +32 -9
  348. package/dist/tools/runtime-tool-declaration.d.ts.map +1 -0
  349. package/dist/tools/runtime-tool-mcp.d.ts +6 -15
  350. package/dist/tools/runtime-tool-mcp.d.ts.map +1 -1
  351. package/dist/tools/runtime-tool.d.ts +14 -12
  352. package/dist/tools/runtime-tool.d.ts.map +1 -1
  353. package/dist/tools/schema/coerce.d.ts +4 -0
  354. package/dist/tools/schema/coerce.d.ts.map +1 -1
  355. package/dist/tools/schema/flatten-join.d.ts.map +1 -1
  356. package/dist/tools/surface.d.ts +7 -11
  357. package/dist/tools/surface.d.ts.map +1 -1
  358. package/dist/tools/transfer/define-download-tool.d.ts +1 -1
  359. package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
  360. package/dist/tools/transfer/define-upload-tool.d.ts +1 -1
  361. package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
  362. package/dist/tools/transfer/define-view-file-tool.d.ts +1 -1
  363. package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
  364. package/dist/tools/transfer/managed-file-error.d.ts.map +1 -1
  365. package/dist/tools/transfer/view-file-contract.d.ts.map +1 -1
  366. package/dist/tools/transfer/view-file.d.ts +1 -1
  367. package/dist/tools/transfer/view-file.d.ts.map +1 -1
  368. package/dist/tools/transports.d.ts +3 -2
  369. package/dist/tools/transports.d.ts.map +1 -1
  370. package/llms/agent-runtime-browser.txt +10 -4
  371. package/llms/agent-runtime-harness.txt +32 -31
  372. package/llms/agent-runtime-react.txt +1 -1
  373. package/llms/agent-runtime-realtime.txt +14 -5
  374. package/llms/agent-runtime-sandbox.txt +3 -11
  375. package/llms/agent-runtime.3.txt +2 -2
  376. package/llms/agent-runtime.txt +0 -9
  377. package/llms/application.2.txt +3 -12
  378. package/llms/application.3.txt +7 -4
  379. package/llms/application.txt +44 -15
  380. package/llms/cli-publish.txt +29 -0
  381. package/llms/cli.2.txt +9 -11
  382. package/llms/cli.txt +26 -14
  383. package/llms/declaration.txt +0 -9
  384. package/llms/files-packaging.txt +16 -8
  385. package/llms/files.txt +4 -2
  386. package/llms/geo.txt +0 -9
  387. package/llms/live.txt +4 -13
  388. package/llms/observability.txt +31 -5
  389. package/llms/primitives.txt +38 -20
  390. package/llms/process.txt +287 -157
  391. package/llms/react-keyboard.txt +0 -9
  392. package/llms/react.txt +0 -18
  393. package/llms/server.4.txt +1 -1
  394. package/llms/server.5.txt +1 -1
  395. package/llms/server.txt +1 -1
  396. package/llms/stitchkit.txt +6 -7
  397. package/llms/telegram-screens.txt +2 -2
  398. package/llms/testing.txt +0 -1
  399. package/llms/tools-mcp.txt +2 -3
  400. package/llms/tools.2.txt +12 -0
  401. package/llms/tools.3.txt +5 -6
  402. package/llms/tools.txt +6 -4
  403. package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
  404. package/llms/{upgrading-0.44.0-0.61.0.txt → upgrading-0.53.0-0.67.0.txt} +576 -506
  405. package/llms/{upgrading-0.62.0-0.80.0.txt → upgrading-0.68.0-0.94.0.txt} +562 -576
  406. package/llms/{upgrading-0.81.0-0.104.0.txt → upgrading-0.95.0-0.105.0.txt} +452 -567
  407. package/llms/upgrading.txt +4 -4
  408. package/llms-full.txt +1029 -409
  409. package/llms.txt +24 -24
  410. package/native-assets.json +11 -3
  411. package/package.json +6 -6
  412. package/dist/agent-runtime/harness-tools.d.ts +0 -11
  413. package/dist/agent-runtime/harness-tools.d.ts.map +0 -1
  414. package/dist/entrypoints/agent-runtime/harness-tools.d.ts +0 -2
  415. package/dist/entrypoints/agent-runtime/harness-tools.d.ts.map +0 -1
  416. package/dist/entrypoints/agent-runtime/harness-tools.js +0 -32
  417. package/dist/index-1a6jtnd9.js +0 -88
  418. package/dist/index-8a9ksm91.js +0 -95
  419. package/dist/index-a3wma1hk.js +0 -48
  420. package/dist/index-jd470k6q.js +0 -109
  421. package/dist/index-n1dqr7gf.js +0 -20
  422. package/dist/index-nggfa2yn.js +0 -34
  423. package/dist/index-s4evrmp5.js +0 -98
  424. package/dist/index-ze1eph1k.js +0 -20
  425. package/dist/tools/connections/error-projection.d.ts +0 -4
  426. package/dist/tools/connections/error-projection.d.ts.map +0 -1
  427. package/dist/tools/runtime-tool-execution.d.ts.map +0 -1
  428. package/llms/agent-runtime-harness-tools.txt +0 -25
  429. package/llms/upgrading-0.37.0-0.44.0.txt +0 -444
@@ -1,36 +1,73 @@
1
- import"../../index-x928baz2.js";
2
- import"../../index-43p08g7t.js";
1
+ import"../../index-j9gxbztg.js";
2
+ import"../../index-pzb63z66.js";
3
3
  import"../../index-4s0fep5q.js";
4
4
  import"../../index-814xpr6d.js";
5
5
  import"../../index-8kzct1d6.js";
6
6
  import"../../index-mnkk1ffz.js";
7
- import"../../index-n5yqxd3d.js";
7
+ import"../../index-b0w7rbpt.js";
8
8
  import {
9
9
  agentControlRealtimeContract2
10
- } from "../../index-20yvtn9a.js";
11
- import"../../index-h97tqqp1.js";
10
+ } from "../../index-yt7gyg5x.js";
11
+ import"../../index-qaet40b2.js";
12
12
  import {
13
13
  createAgentHarnessControlServer2
14
- } from "../../index-jn9g8xdt.js";
14
+ } from "../../index-hjvje0pf.js";
15
+ import"../../index-299sm5tr.js";
15
16
  import {
16
17
  bindRealtimeServer2
17
- } from "../../index-5z6jn897.js";
18
- import"../../index-vgkbcnkc.js";
18
+ } from "../../index-z23rfxhj.js";
19
+ import {
20
+ withSignalDeadline
21
+ } from "../../index-9tqbxv5p.js";
22
+ import {
23
+ raceAbort
24
+ } from "../../index-b0kddvzw.js";
25
+ import {
26
+ MAX_TIMER_MS
27
+ } from "../../index-eemvahkc.js";
28
+ import {
29
+ assertPositiveSafeInteger
30
+ } from "../../index-0s4xebbg.js";
19
31
 
20
32
  // src/agent-runtime/harness-realtime.ts
33
+ async function askAuthorizationHook(input) {
34
+ const { config, identity, request, source, timeoutMs, report } = input;
35
+ const settled = new AbortController;
36
+ try {
37
+ return await withSignalDeadline(timeoutMs, undefined, () => new Error("Agent authorization timed out"), (deadline) => {
38
+ const signal = AbortSignal.any([deadline, settled.signal]);
39
+ return raceAbort(Promise.resolve().then(() => config.authorize({ identity, request, source, signal })), signal);
40
+ });
41
+ } catch (error) {
42
+ report(error);
43
+ return null;
44
+ } finally {
45
+ settled.abort();
46
+ }
47
+ }
21
48
  function bindAgentHarnessRealtime(harness, handle, config) {
22
49
  const control = createAgentHarnessControlServer2(harness, config);
23
50
  const realtime = bindRealtimeServer2(agentControlRealtimeContract2, handle);
24
51
  const cleanups = new Set;
52
+ const sockets = new Set;
25
53
  const maxPending = config.maxPendingRequests ?? 32;
26
54
  const authTimeout = config.authorizationTimeoutMs ?? 1e4;
27
- for (const [name, value] of Object.entries({ maxPending, authTimeout })) {
28
- if (!Number.isSafeInteger(value) || value < 1)
29
- throw new TypeError(`${name} must be a positive safe integer`);
55
+ assertPositiveSafeInteger("maxPendingRequests", maxPending);
56
+ assertPositiveSafeInteger("authorizationTimeoutMs", authTimeout);
57
+ if (authTimeout > MAX_TIMER_MS) {
58
+ throw new RangeError("authorizationTimeoutMs exceeds the timer range");
30
59
  }
31
60
  const unsubscribe = realtime.onConnection(({ raw, events }) => {
32
61
  let closed = false;
62
+ const grants = {
63
+ identity: raw.data,
64
+ granted: new Set,
65
+ revocations: new Map,
66
+ refused: new Set
67
+ };
68
+ sockets.add(grants);
33
69
  const pending = new Set;
70
+ const deciding = new Map;
34
71
  const report = (error) => {
35
72
  try {
36
73
  if (config.onError)
@@ -44,42 +81,64 @@ function bindAgentHarnessRealtime(harness, handle, config) {
44
81
  });
45
82
  }
46
83
  };
47
- const authorize = async (request) => {
48
- let timer;
49
- const abort = new AbortController;
50
- try {
51
- return await Promise.race([
52
- Promise.resolve().then(() => config.authorize({ identity: raw.data, request, signal: abort.signal })),
53
- new Promise((_resolve, reject) => {
54
- timer = setTimeout(() => reject(new Error("Agent authorization timed out")), authTimeout);
55
- })
56
- ]);
57
- } catch (error) {
58
- report(error);
59
- return null;
60
- } finally {
61
- abort.abort();
62
- if (timer !== undefined)
63
- clearTimeout(timer);
84
+ const authorize = async (request, source = "request") => {
85
+ const startedAt = grants.revocations.get(request.conversationId) ?? 0;
86
+ let allowed = await askAuthorizationHook({
87
+ config,
88
+ identity: raw.data,
89
+ request,
90
+ source,
91
+ timeoutMs: authTimeout,
92
+ report
93
+ });
94
+ if (allowed && (grants.revocations.get(request.conversationId) ?? 0) !== startedAt) {
95
+ allowed = null;
64
96
  }
97
+ if (allowed && request.operation !== "detach") {
98
+ grants.granted.add(request.conversationId);
99
+ if (request.operation === "attach")
100
+ grants.refused.delete(request.conversationId);
101
+ } else
102
+ grants.granted.delete(request.conversationId);
103
+ return allowed;
65
104
  };
66
105
  const connection = control.connect({
67
106
  id: raw.id,
68
107
  async deliver(delivery) {
69
- const allowed = await authorize({
70
- schemaVersion: 1,
71
- requestId: crypto.randomUUID(),
72
- operation: "snapshot",
73
- conversationId: delivery.event.conversationId
74
- });
75
- if (!allowed) {
76
- await connection.request({
77
- schemaVersion: 1,
78
- requestId: crypto.randomUUID(),
79
- operation: "detach",
80
- conversationId: delivery.event.conversationId
81
- });
108
+ const { conversationId } = delivery.event;
109
+ if (grants.refused.has(conversationId))
82
110
  return;
111
+ if (!grants.granted.has(conversationId)) {
112
+ let decision = deciding.get(conversationId);
113
+ if (!decision) {
114
+ decision = authorize({
115
+ schemaVersion: 1,
116
+ requestId: crypto.randomUUID(),
117
+ operation: "snapshot",
118
+ conversationId
119
+ }, "delivery").finally(() => deciding.delete(conversationId));
120
+ deciding.set(conversationId, decision);
121
+ }
122
+ const allowed = await decision;
123
+ if (!allowed) {
124
+ if (grants.refused.has(conversationId))
125
+ return;
126
+ grants.refused.add(conversationId);
127
+ await connection.request({
128
+ schemaVersion: 1,
129
+ requestId: crypto.randomUUID(),
130
+ operation: "detach",
131
+ conversationId
132
+ });
133
+ if (!closed) {
134
+ events.emit("agent:delivery", {
135
+ schemaVersion: 1,
136
+ type: "access-denied",
137
+ conversationId
138
+ });
139
+ }
140
+ return;
141
+ }
83
142
  }
84
143
  if (!closed)
85
144
  events.emit("agent:delivery", delivery);
@@ -97,6 +156,7 @@ function bindAgentHarnessRealtime(harness, handle, config) {
97
156
  error: { code, message }
98
157
  });
99
158
  if (request.operation === "detach") {
159
+ grants.granted.delete(request.conversationId);
100
160
  for (const entry of pending)
101
161
  if (entry.conversationId === request.conversationId)
102
162
  entry.cancelled = true;
@@ -112,21 +172,17 @@ function bindAgentHarnessRealtime(harness, handle, config) {
112
172
  const allowed = await authorize(request);
113
173
  if (entry.cancelled)
114
174
  return fail("REQUEST_CANCELLED", "Agent request was detached");
115
- if (!allowed || closed) {
116
- if (!allowed)
117
- await connection.request({
118
- schemaVersion: 1,
119
- requestId: crypto.randomUUID(),
120
- operation: "detach",
121
- conversationId: request.conversationId
122
- });
123
- return {
175
+ if (!allowed) {
176
+ await connection.request({
124
177
  schemaVersion: 1,
125
- requestId: request.requestId,
126
- outcome: "error",
127
- error: { code: "ACCESS_DENIED", message: "Agent access denied" }
128
- };
178
+ requestId: crypto.randomUUID(),
179
+ operation: "detach",
180
+ conversationId: request.conversationId
181
+ });
182
+ return fail("FORBIDDEN", "Agent access denied");
129
183
  }
184
+ if (closed)
185
+ return fail("CONNECTION_CLOSED", "Connection is closed");
130
186
  return connection.request(request.operation === "submit" || request.operation === "respond-approval" ? { ...request, context: allowed.context } : request);
131
187
  };
132
188
  execute().then(ack).catch(report).finally(() => {
@@ -137,6 +193,7 @@ function bindAgentHarnessRealtime(harness, handle, config) {
137
193
  if (closed)
138
194
  return;
139
195
  closed = true;
196
+ sockets.delete(grants);
140
197
  offRequest();
141
198
  raw.off("disconnect", close);
142
199
  connection.close();
@@ -146,6 +203,14 @@ function bindAgentHarnessRealtime(harness, handle, config) {
146
203
  cleanups.add(close);
147
204
  });
148
205
  return {
206
+ revoke(conversationId, matches) {
207
+ for (const socket of sockets) {
208
+ if (matches && !matches(socket.identity))
209
+ continue;
210
+ socket.granted.delete(conversationId);
211
+ socket.revocations.set(conversationId, (socket.revocations.get(conversationId) ?? 0) + 1);
212
+ }
213
+ },
149
214
  close() {
150
215
  unsubscribe();
151
216
  for (const close of cleanups)
@@ -2,23 +2,29 @@ import {
2
2
  probeAgentProcessSandbox2,
3
3
  missingSandboxRestrictions2,
4
4
  codingRefusal
5
- } from "../../index-6d9xaxw1.js";
6
- import"../../index-x928baz2.js";
5
+ } from "../../index-8ks9b85e.js";
6
+ import"../../index-j9gxbztg.js";
7
7
  import"../../index-ct75c3at.js";
8
- import"../../index-77nxk6ay.js";
9
- import"../../index-kb8styz3.js";
8
+ import"../../index-r393tnfp.js";
9
+ import"../../index-rpzewktb.js";
10
10
  import {
11
11
  createAgentCodingTools2
12
- } from "../../index-ptn0g0gj.js";
12
+ } from "../../index-ma963wz7.js";
13
13
  import"../../index-v5ee8ath.js";
14
+ import"../../index-cq59agna.js";
14
15
  import {
16
+ COMMAND_CLEANUP_TIMEOUT_MS,
15
17
  NativeCommandError2,
16
18
  spawnOwnedCommand,
17
19
  nativeCommandOwner,
20
+ terminateOwnedGroup,
18
21
  startNativeCommand
19
- } from "../../index-f330qqyg.js";
22
+ } from "../../index-g2vfg7ak.js";
20
23
  import"../../index-gxm9rc97.js";
21
- import"../../index-cvda079a.js";
24
+ import {
25
+ MAX_TIMER_MS
26
+ } from "../../index-eemvahkc.js";
27
+ import"../../index-yvfk3y36.js";
22
28
 
23
29
  // src/agent-runtime/sandbox-bubblewrap.ts
24
30
  import { mkdir as mkdir2, mkdtemp, realpath, rm as rm2 } from "node:fs/promises";
@@ -65,7 +71,7 @@ var SandboxCommandSchema = z.object({
65
71
  args: z.array(z.string()).optional(),
66
72
  cwd: z.string().optional(),
67
73
  environment: z.record(z.string(), z.string()).optional(),
68
- timeoutMs: z.number().int().positive().max(2147483647).optional(),
74
+ timeoutMs: z.number().int().positive().max(MAX_TIMER_MS).optional(),
69
75
  maxOutputBytes: z.number().int().positive().optional()
70
76
  }).strict();
71
77
 
@@ -521,7 +527,7 @@ function spawnSandboxProcess(executable, args, limits, options = {}, onSpawn) {
521
527
  capture: true,
522
528
  envPolicy: "declared-only",
523
529
  env: {},
524
- killGraceMs: 0,
530
+ stop: { target: "group", graceMs: 0 },
525
531
  ...options.stdin !== undefined ? {
526
532
  stdin: typeof options.stdin === "string" ? new TextEncoder().encode(options.stdin) : options.stdin,
527
533
  maxStdinBytes: Math.max(1, typeof options.stdin === "string" ? Buffer.byteLength(options.stdin) : options.stdin.byteLength)
@@ -550,14 +556,14 @@ function sandboxProcessOwner(assertActive, maximum) {
550
556
  if (children.size >= maximum)
551
557
  throw new SandboxError("SANDBOX_BUSY", "Sandbox command concurrency limit reached");
552
558
  };
553
- const terminate = (child) => {
554
- const owner = nativeCommandOwner(child) ?? startNativeCommand({ executable: "host-owned-command", signal: new AbortController().signal }, undefined, { launch: () => child, group: process.platform !== "win32", force: true });
555
- return owner.terminate();
556
- };
559
+ const terminate = (child, closeEvent) => nativeCommandOwner(child)?.terminate() ?? terminateOwnedGroup(child, closeEvent, COMMAND_CLEANUP_TIMEOUT_MS);
557
560
  const track = (child) => {
561
+ const closeEvent = new Promise((resolve) => {
562
+ child.once("close", () => resolve());
563
+ });
558
564
  const settleDirect = () => {
559
565
  if (!nativeCommandOwner(child))
560
- terminate(child).catch(() => {
566
+ terminate(child, closeEvent).catch(() => {
561
567
  return;
562
568
  });
563
569
  };
@@ -582,7 +588,7 @@ function sandboxProcessOwner(assertActive, maximum) {
582
588
  closed.catch(() => {
583
589
  return;
584
590
  });
585
- children.set(child, closed);
591
+ children.set(child, { closed, closeEvent });
586
592
  };
587
593
  return {
588
594
  admit,
@@ -605,8 +611,8 @@ function sandboxProcessOwner(assertActive, maximum) {
605
611
  },
606
612
  async stop() {
607
613
  const pending = [...children];
608
- await Promise.all(pending.map(([child]) => terminate(child)));
609
- await Promise.all(pending.map(([, closed]) => closed));
614
+ await Promise.all(pending.map(([child, { closeEvent }]) => terminate(child, closeEvent)));
615
+ await Promise.all(pending.map(([, { closed }]) => closed));
610
616
  }
611
617
  };
612
618
  }
@@ -1,11 +1,12 @@
1
- import"../../../index-r5hsgkz5.js";
1
+ import"../../../index-0gs4ymfj.js";
2
2
  import"../../../index-8kzct1d6.js";
3
- import"../../../index-ssmd41kh.js";
3
+ import"../../../index-d2h99n7d.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-0ndk4555.js";
7
+ } from "../../../index-c0hffcmj.js";
8
8
  import"../../../index-kqnd6a85.js";
9
+ import"../../../index-5w6t91ze.js";
9
10
 
10
11
  // src/agent-runtime/sqlite-bun.ts
11
12
  import { Database } from "bun:sqlite";
@@ -1,11 +1,12 @@
1
- import"../../../index-r5hsgkz5.js";
1
+ import"../../../index-0gs4ymfj.js";
2
2
  import"../../../index-8kzct1d6.js";
3
- import"../../../index-ssmd41kh.js";
3
+ import"../../../index-d2h99n7d.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-0ndk4555.js";
7
+ } from "../../../index-c0hffcmj.js";
8
8
  import"../../../index-kqnd6a85.js";
9
+ import"../../../index-5w6t91ze.js";
9
10
 
10
11
  // src/agent-runtime/sqlite-node.ts
11
12
  import { DatabaseSync } from "node:sqlite";
@@ -7,11 +7,15 @@ import {
7
7
  decodeAgentConversationArchive2,
8
8
  createToolChronology,
9
9
  advanceToolChronology
10
- } from "../../index-r5hsgkz5.js";
11
- import"../../index-ssmd41kh.js";
10
+ } from "../../index-0gs4ymfj.js";
11
+ import"../../index-5w6t91ze.js";
12
+ import"../../index-d2h99n7d.js";
12
13
  import {
13
14
  createMemoryAgentRuntimeStore2
14
- } from "../../index-adhgd4pe.js";
15
+ } from "../../index-5p55xreg.js";
16
+ import {
17
+ assertPositiveSafeInteger
18
+ } from "../../index-0s4xebbg.js";
15
19
 
16
20
  // src/agent-runtime/fault-bench.ts
17
21
  import { createServer } from "node:http";
@@ -1093,9 +1097,7 @@ async function archiveScenario(store, conversationId) {
1093
1097
  }
1094
1098
  // src/agent-runtime/testing.ts
1095
1099
  function createAgentRaceBarrier(timeoutMs = 5000) {
1096
- if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1) {
1097
- throw new TypeError("Agent race barrier timeoutMs must be a positive safe integer");
1098
- }
1100
+ assertPositiveSafeInteger("Agent race barrier timeoutMs", timeoutMs);
1099
1101
  const reached = Promise.withResolvers();
1100
1102
  const released = Promise.withResolvers();
1101
1103
  let announced = false;
@@ -47,7 +47,7 @@ import {
47
47
  AgentHistoryMutationSchema2,
48
48
  ACTIVE_AGENT_RUN_STATES2,
49
49
  createAgentRuntimeStore2
50
- } from "../index-ssmd41kh.js";
50
+ } from "../index-d2h99n7d.js";
51
51
  import {
52
52
  AgentStoreEventKindSchema2,
53
53
  AgentStoreEventEnvelopeSchema2,
@@ -79,7 +79,8 @@ import {
79
79
  decodeAgentConversationArchive2,
80
80
  isAssistantHistoryEvidence2,
81
81
  isCompleteAgentHistoryTurn
82
- } from "../index-r5hsgkz5.js";
82
+ } from "../index-0gs4ymfj.js";
83
+ import"../index-5w6t91ze.js";
83
84
  import {
84
85
  AgentRuntimeConflictError2,
85
86
  normalizeSdkUsage,
@@ -110,30 +111,39 @@ import {
110
111
  agentGoalStateSlot2,
111
112
  agentTodoStateSlot2,
112
113
  createAgentRuntime2
113
- } from "../index-fk18k56k.js";
114
+ } from "../index-gr5g3xfw.js";
114
115
  import {
115
116
  AgentConversationSummarySchema2,
116
117
  AgentConversationPageSchema2,
117
118
  AgentConversationMessagePageSchema2
118
119
  } from "../index-kqnd6a85.js";
119
- import"../index-nggfa2yn.js";
120
- import"../index-x928baz2.js";
121
- import"../index-kb8styz3.js";
120
+ import {
121
+ DURABILITY_STEP_EVENT_KIND2,
122
+ StepResultDecodeError2,
123
+ StepResultNotSerializableError2,
124
+ StepAbortedError2,
125
+ ParkRecordDecodeError2,
126
+ ParkAbortedError2
127
+ } from "../index-c17xcx4k.js";
128
+ import"../index-j9gxbztg.js";
129
+ import"../index-rpzewktb.js";
122
130
  import {
123
131
  createTraceContext2,
124
132
  childSpan2
125
133
  } from "../index-yex7eg1v.js";
126
- import"../index-9pw0a51a.js";
134
+ import"../index-6yxhe58g.js";
127
135
  import"../index-ct75c3at.js";
128
- import"../index-77nxk6ay.js";
129
- import"../index-2vnh05w4.js";
130
- import"../index-2hyavjjj.js";
136
+ import"../index-r393tnfp.js";
137
+ import"../index-2k91mewf.js";
138
+ import"../index-556g5hsh.js";
139
+ import"../index-wbhdzxar.js";
131
140
  import {
132
- mountAgent2
133
- } from "../index-t1sr4aks.js";
141
+ mountAgent2,
142
+ buildToolManifest2
143
+ } from "../index-qaqbdm7s.js";
134
144
  import {
135
145
  createBoundedSinkManager
136
- } from "../index-h97tqqp1.js";
146
+ } from "../index-qaet40b2.js";
137
147
  import {
138
148
  AgentAdmissionEventSchema2,
139
149
  AgentTransientDeltaEventSchema2,
@@ -168,14 +178,6 @@ import {
168
178
  defineModelRegistry2,
169
179
  validateAgentModelSnapshot2
170
180
  } from "../index-nx6eazt0.js";
171
- import {
172
- DURABILITY_STEP_EVENT_KIND2,
173
- StepResultDecodeError2,
174
- StepResultNotSerializableError2,
175
- StepAbortedError2,
176
- ParkRecordDecodeError2,
177
- ParkAbortedError2
178
- } from "../index-pptyv13k.js";
179
181
  import {
180
182
  AgentSandboxRestrictionSchema2,
181
183
  AgentSandboxGradeSchema2,
@@ -183,21 +185,24 @@ import {
183
185
  missingSandboxRestrictions2,
184
186
  recordAgentSandboxProbe2,
185
187
  refuseUnknownSpillReference
186
- } from "../index-6d9xaxw1.js";
188
+ } from "../index-8ks9b85e.js";
187
189
  import {
188
190
  createMemoryAgentRuntimeStore2
189
- } from "../index-adhgd4pe.js";
191
+ } from "../index-5p55xreg.js";
190
192
  import {
191
193
  createAgentRuntimeEventSink2
192
- } from "../index-vgkbcnkc.js";
194
+ } from "../index-299sm5tr.js";
193
195
  import {
194
- buildToolManifest2
195
- } from "../index-a3wma1hk.js";
196
- import"../index-a0zzh8ak.js";
196
+ MAX_TIMER_MS
197
+ } from "../index-eemvahkc.js";
198
+ import {
199
+ assertPositiveSafeInteger
200
+ } from "../index-0s4xebbg.js";
201
+ import"../index-pz3y6b6g.js";
197
202
  import {
198
203
  defineRuntimeTool2,
199
204
  executableAgentRuntimeTools
200
- } from "../index-cvda079a.js";
205
+ } from "../index-yvfk3y36.js";
201
206
  import"../index-7n68nmc6.js";
202
207
 
203
208
  // src/agent-runtime/child-tools.ts
@@ -952,13 +957,9 @@ function mutationSnapshot(result, fallback, attempts) {
952
957
  return { outcome: result.outcome, snapshot: fallback, attempts };
953
958
  }
954
959
  function structuredCompaction(config) {
955
- if (!Number.isSafeInteger(config.keepRecentTurns) || config.keepRecentTurns < 1) {
956
- throw new TypeError("keepRecentTurns must be a positive safe integer");
957
- }
960
+ assertPositiveSafeInteger("keepRecentTurns", config.keepRecentTurns);
958
961
  const maxAttempts = config.maxAttempts ?? 1;
959
- if (!Number.isSafeInteger(maxAttempts) || maxAttempts < 1) {
960
- throw new TypeError("maxAttempts must be a positive safe integer");
961
- }
962
+ assertPositiveSafeInteger("maxAttempts", maxAttempts);
962
963
  return async (input) => {
963
964
  let lastSnapshot = await input.store.loadSnapshot(input.conversationId);
964
965
  for (let attempt = 1;attempt <= maxAttempts; attempt += 1) {
@@ -2066,9 +2067,7 @@ function newSchedule(request, observedAt) {
2066
2067
  const kind = request.at !== undefined ? "at" : request.afterMs !== undefined ? "after" : "every";
2067
2068
  const intervalMs = request.everyMs;
2068
2069
  const delay = request.afterMs ?? request.everyMs;
2069
- if (delay !== undefined && (!Number.isSafeInteger(delay) || delay < 1)) {
2070
- throw new TypeError("Schedule delay must be a positive safe integer");
2071
- }
2070
+ assertPositiveSafeInteger("Schedule delay", delay);
2072
2071
  const nextAt = request.at ? new Date(z10.iso.datetime({ offset: true }).parse(request.at)).toISOString() : new Date(observedAt.getTime() + (delay ?? 0)).toISOString();
2073
2072
  const schedule = AgentScheduleSchema.parse({
2074
2073
  id: randomUUID2(),
@@ -2333,7 +2332,7 @@ function createAgentScheduleService(input) {
2333
2332
  timer = setTimer(() => {
2334
2333
  timer = undefined;
2335
2334
  tick();
2336
- }, Math.min(Math.max(0, dueAt - now().getTime()), 2147483647));
2335
+ }, Math.min(Math.max(0, dueAt - now().getTime()), MAX_TIMER_MS));
2337
2336
  };
2338
2337
  const runTick = async () => {
2339
2338
  if (lifecycle.signal.aborted || now().getTime() < recoveryAt)