stitchkit 0.104.1 → 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 +381 -12
  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 +196 -56
  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 +104 -21
  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 +22 -7
  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 +305 -154
  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 +1053 -405
  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 +1 @@
1
- {"version":3,"file":"wait-core.d.ts","sourceRoot":"","sources":["../../../src/tools/operations/wait-core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,cAGC;CACF;AA2BD,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,sDAAsD;IACtD,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3C,yDAAyD;IACzD,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;IAC5B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,gFAAgF;IAChF,M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1,4 @@
1
- import type { RuntimeToolDefinition } from './runtime-tool.js';
1
+ import type { RuntimeToolDefinition } from './runtime-tool-declaration.js';
2
2
  /**
3
3
  * The effective tool surface one composition will mount.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;IAC7E,gEAAgE;IAChE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAChD,KAAK,IAAI,iBAAiB,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,wBAAwB,CA6D1F"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,wBAAwB,CAAC;IAC7E,gEAAgE;IAChE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAAC;IAChD,KAAK,IAAI,iBAAiB,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,wBAAwB,CA6D1F"}
@@ -1,4 +1,4 @@
1
- import { type HttpClient } from '../browser/http.js';
1
+ import type { HttpClient } from '../browser/http.js';
2
2
  import type { ContractDef, EndpointDef } from '../contract/define.js';
3
3
  import type { ServiceDef } from '../server/types.js';
4
4
  export interface ImplementRemoteOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/tools/remote.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKnE,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAqC7D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnE,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,IAAI,EAAE,UAAU,EAChB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,UAAU,CA+EZ"}
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/tools/remote.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKnE,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAkE7D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnE,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,IAAI,EAAE,UAAU,EAChB,OAAO,CAAC,EAAE,sBAAsB,GAC/B,UAAU,CAgEZ"}
@@ -42,24 +42,47 @@ export interface RuntimeToolDefinitionBase<TInput extends ZodObject, TMcp extend
42
42
  /** Opt-in multi-round input gate on the MCP transport only. */
43
43
  mcp?: TMcp;
44
44
  }
45
- /** Executable contract shared by CLI and SDK adapters; presentation belongs to the adapter. */
46
- export interface RuntimeToolExecutionWithOutput<TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined> extends RuntimeToolDefinitionBase<TInput, TMcp> {
45
+ /**
46
+ * The one declaration of a runtime tool, with no SDK declaration in it. The
47
+ * `present` slot is the adapters' extension point: an adapter names the
48
+ * presenters it understands as the fourth type argument (the MCP presenters of
49
+ * `stitchkit/tools/mcp`, the MCP and Agent presenters of `stitchkit/tools`), and
50
+ * the neutral default admits none. Execution never reads it.
51
+ */
52
+ export interface RuntimeToolDefinitionWithOutput<TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined, TPresent = undefined> extends RuntimeToolDefinitionBase<TInput, TMcp> {
47
53
  output: TOutput;
48
54
  handler: (context: RuntimeToolHandlerContext<TInput, TMcp>) => z.output<TOutput> | Promise<z.output<TOutput>>;
55
+ present?: TPresent;
49
56
  }
57
+ /**
58
+ * A runtime tool that declares no `output` schema; its handler returns nothing and has no
59
+ * `present` slot.
60
+ */
50
61
  export interface RuntimeToolDefinitionWithoutOutput<TInput extends ZodObject, TMcp extends EndpointMcpPolicy | undefined = undefined> extends RuntimeToolDefinitionBase<TInput, TMcp> {
51
62
  output?: never;
52
63
  handler: (context: RuntimeToolHandlerContext<TInput, TMcp>) => void | Promise<void>;
53
64
  present?: never;
54
65
  }
55
66
  /**
56
- * Heterogeneous registration preserves each definition's validated input shape.
57
- * Its erased handler cannot be called directly: the canonical mount supplies
58
- * schema-parsed input before execution. Construction uses the generic contracts.
67
+ * The input every registered handler is shaped for: any object the canonical runner parsed.
68
+ */
69
+ type RegisteredHandlerContext = RuntimeToolHandlerContext<ZodObject, EndpointMcpPolicy | undefined>;
70
+ /**
71
+ * Heterogeneous registration of runtime tools (`runtimeTools: [...]`), where every
72
+ * tool has its own input schema. Each registered handler is declared as a METHOD:
73
+ * a method parameter is compared bivariantly, so a handler constructed against
74
+ * its own schema is accepted, and an inline handler is contextually typed by the
75
+ * loose parsed-object context instead of being erased. The canonical runner parses
76
+ * the input against the tool's schema before it calls the handler.
77
+ *
78
+ * `present` is whatever presenters the declaring adapter attached; the mount that
79
+ * reads them narrows what it finds, because each presenter was typed against its
80
+ * own tool when it was declared.
59
81
  */
60
- export type RuntimeToolExecution = (Omit<RuntimeToolExecutionWithOutput<ZodObject, ZodType, EndpointMcpPolicy | undefined>, 'handler'> & {
61
- handler: (context: never) => ReturnType<RuntimeToolExecutionWithOutput<ZodObject, ZodType, EndpointMcpPolicy | undefined>['handler']>;
82
+ export type RuntimeToolDefinition = (Omit<RuntimeToolDefinitionWithOutput<ZodObject, ZodType, EndpointMcpPolicy | undefined, unknown>, 'handler'> & {
83
+ handler(context: RegisteredHandlerContext): unknown;
62
84
  }) | (Omit<RuntimeToolDefinitionWithoutOutput<ZodObject, EndpointMcpPolicy | undefined>, 'handler'> & {
63
- handler: (context: never) => ReturnType<RuntimeToolDefinitionWithoutOutput<ZodObject, EndpointMcpPolicy | undefined>['handler']>;
85
+ handler(context: RegisteredHandlerContext): void | Promise<void>;
64
86
  });
65
- //# sourceMappingURL=runtime-tool-execution.d.ts.map
87
+ export {};
88
+ //# sourceMappingURL=runtime-tool-declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-tool-declaration.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,iBAAiB,GAAG,SAAS,IAC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IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;GAEG;AACH,KAAK,wBAAwB,GAAG,yBAAyB,CACvD,SAAS,EACT,iBAAiB,GAAG,SAAS,CAC9B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAC7B,CAAC,IAAI,CACH,+BAA+B,CAC7B,SAAS,EACT,OAAO,EACP,iBAAiB,GAAG,SAAS,EAC7B,OAAO,CACR,EACD,SAAS,CACV,GAAG;IACF,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC;CACrD,CAAC,GACF,CAAC,IAAI,CACH,kCAAkC,CAAC,SAAS,EAAE,iBAAiB,GAAG,SAAS,CAAC,EAC5E,SAAS,CACV,GAAG;IACF,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE,CAAC,CAAC"}
@@ -1,7 +1,4 @@
1
1
  import type { CallToolResult } from '@modelcontextprotocol/server';
2
- import type { ZodObject, ZodType, z } from 'zod';
3
- import type { EndpointMcpPolicy } from '../contract/tool-options.js';
4
- import type { RuntimeToolExecution, RuntimeToolExecutionWithOutput } from './runtime-tool-execution.js';
5
2
  /**
6
3
  * Preserve the SDK's required content and metadata despite its extension index.
7
4
  * Validation and error state belong to the canonical runner, never a presenter.
@@ -10,18 +7,12 @@ export type RuntimeMcpPresentation = CallToolResult & {
10
7
  structuredContent?: never;
11
8
  isError?: never;
12
9
  };
13
- export interface RuntimeMcpToolPresenters<TOutput> {
14
- mcp?: (output: TOutput) => RuntimeMcpPresentation | Promise<RuntimeMcpPresentation>;
15
- }
16
- /** Schema-aware construction for an MCP tool without an AI SDK declaration. */
17
- export interface RuntimeMcpToolDefinitionWithOutput<TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined> extends RuntimeToolExecutionWithOutput<TInput, TOutput, TMcp> {
18
- present?: RuntimeMcpToolPresenters<z.output<TOutput>>;
19
- }
20
10
  /**
21
- * Heterogeneous registration retains typed definitions. The canonical runner
22
- * parses input and output before invoking either erased function.
11
+ * The MCP presenters a tool declaration may carry as its `present` extension.
12
+ * Declared as methods so a presenter written for one tool's output registers
13
+ * beside the others; the canonical runner validates the output before it calls one.
23
14
  */
24
- export type RuntimeMcpToolDefinition = RuntimeToolExecution & {
25
- present?: RuntimeMcpToolPresenters<never>;
26
- };
15
+ export interface RuntimeMcpToolPresenters<TOutput> {
16
+ mcp?(output: TOutput): RuntimeMcpPresentation | Promise<RuntimeMcpPresentation>;
17
+ }
27
18
  //# sourceMappingURL=runtime-tool-mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-tool-mcp.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EACV,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,wBAAwB,CAAC,OAAO;IAC/C,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACrF;AAED,+EAA+E;AAC/E,MAAM,WAAW,kCAAkC,CACjD,MAAM,SAAS,SAAS,EACxB,OAAO,SAAS,OAAO,EACvB,IAAI,SAAS,iBAAiB,GAAG,SAAS,GAAG,SAAS,CACtD,SAAQ,8BAA8B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;CACvD;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG;IAC5D,OAAO,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;CAC3C,CAAC"}
1
+ {"version":3,"file":"runtime-tool-mcp.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,wBAAwB,CAAC,OAAO;IAC/C,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACjF"}
@@ -4,18 +4,14 @@ import type { HttpMethod } from '../contract/define.js';
4
4
  import type { EndpointMcpPolicy } from '../contract/tool-options.js';
5
5
  import { type SurfaceAgentRuntimeToolDefinition } from './internal/surface-projector.js';
6
6
  import type { MountableTool } from './mount.js';
7
- import type { RuntimeToolDefinitionWithoutOutput, RuntimeToolExecution, RuntimeToolExecutionWithOutput, RuntimeToolFactoryHandlerContext } from './runtime-tool-execution.js';
7
+ import type { RuntimeToolDefinition, RuntimeToolDefinitionWithOutput, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext } from './runtime-tool-declaration.js';
8
8
  import type { RuntimeMcpToolPresenters } from './runtime-tool-mcp.js';
9
- export type { RuntimeMcpInput, RuntimeToolDefinitionBase, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext, RuntimeToolHandlerContext, RuntimeToolIdentity, RuntimeToolOutput, } from './runtime-tool-execution.js';
9
+ export type { RuntimeMcpInput, RuntimeToolDefinition, RuntimeToolDefinitionBase, RuntimeToolDefinitionWithOutput, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext, RuntimeToolHandlerContext, RuntimeToolIdentity, RuntimeToolOutput, } from './runtime-tool-declaration.js';
10
10
  export type { RuntimeMcpPresentation } from './runtime-tool-mcp.js';
11
11
  export type RuntimeAgentModelOutput = Awaited<ReturnType<NonNullable<Tool<unknown, unknown>['toModelOutput']>>>;
12
12
  export interface RuntimeToolPresenters<TOutput> extends RuntimeMcpToolPresenters<TOutput> {
13
- agent?: (output: TOutput) => RuntimeAgentModelOutput | PromiseLike<RuntimeAgentModelOutput>;
13
+ agent?(output: TOutput): RuntimeAgentModelOutput | PromiseLike<RuntimeAgentModelOutput>;
14
14
  }
15
- export interface RuntimeToolDefinitionWithOutput<TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined> extends RuntimeToolExecutionWithOutput<TInput, TOutput, TMcp> {
16
- present?: RuntimeToolPresenters<z.output<TOutput>>;
17
- }
18
- export type RuntimeToolDefinition = RuntimeToolDefinitionWithOutput<ZodObject, ZodType, EndpointMcpPolicy | undefined> | RuntimeToolDefinitionWithoutOutput<ZodObject, EndpointMcpPolicy | undefined>;
19
15
  export interface RuntimeToolFactoryConfig<TContext extends ZodObject> {
20
16
  serviceName: string;
21
17
  scope?: string;
@@ -27,25 +23,31 @@ export interface RuntimeToolFactoryIdentityFields {
27
23
  method: HttpMethod;
28
24
  meta?: Record<string, unknown>;
29
25
  }
30
- export type RuntimeToolFactoryDefinitionWithOutput<TContext extends ZodObject, TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined> = Omit<RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp>, 'handler' | 'identity'> & RuntimeToolFactoryIdentityFields & {
26
+ export type RuntimeToolFactoryDefinitionWithOutput<TContext extends ZodObject, TInput extends ZodObject, TOutput extends ZodType, TMcp extends EndpointMcpPolicy | undefined = undefined> = Omit<RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp, RuntimeToolPresenters<z.output<TOutput>>>, 'handler' | 'identity'> & RuntimeToolFactoryIdentityFields & {
31
27
  handler: (context: RuntimeToolFactoryHandlerContext<TContext, TInput, TMcp>) => z.output<TOutput> | Promise<z.output<TOutput>>;
32
28
  };
33
29
  export type RuntimeToolFactoryDefinitionWithoutOutput<TContext extends ZodObject, TInput extends ZodObject, TMcp extends EndpointMcpPolicy | undefined = undefined> = Omit<RuntimeToolDefinitionWithoutOutput<TInput, TMcp>, 'handler' | 'identity'> & RuntimeToolFactoryIdentityFields & {
34
30
  handler: (context: RuntimeToolFactoryHandlerContext<TContext, TInput, TMcp>) => void | Promise<void>;
35
31
  };
36
32
  export interface RuntimeToolFactory<TContext extends ZodObject> {
37
- define<TInput extends ZodObject, TOutput extends ZodType, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolFactoryDefinitionWithOutput<TContext, TInput, TOutput, TMcp>): RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp>;
33
+ define<TInput extends ZodObject, TOutput extends ZodType, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolFactoryDefinitionWithOutput<TContext, TInput, TOutput, TMcp>): RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp, RuntimeToolPresenters<z.output<TOutput>>>;
38
34
  define<TInput extends ZodObject, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolFactoryDefinitionWithoutOutput<TContext, TInput, TMcp>): RuntimeToolDefinitionWithoutOutput<TInput, TMcp>;
39
35
  }
40
- /** Typed identity helper; execution remains owned by the transport mounts. */
41
- export declare function defineRuntimeTool<TInput extends ZodObject, TOutput extends ZodType, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp>): RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp>;
36
+ /**
37
+ * Typed construction of a runtime tool with the MCP and Agent presenters of this
38
+ * entrypoint; execution remains owned by the transport mounts.
39
+ */
40
+ export declare function defineRuntimeTool<TInput extends ZodObject, TOutput extends ZodType, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp, RuntimeToolPresenters<z.output<TOutput>>>): RuntimeToolDefinitionWithOutput<TInput, TOutput, TMcp, RuntimeToolPresenters<z.output<TOutput>>>;
42
41
  export declare function defineRuntimeTool<TInput extends ZodObject, const TMcp extends EndpointMcpPolicy | undefined = undefined>(definition: RuntimeToolDefinitionWithoutOutput<TInput, TMcp>): RuntimeToolDefinitionWithoutOutput<TInput, TMcp>;
43
42
  /**
44
43
  * Bind shared runtime-tool identity and validate application context once per
45
44
  * call while keeping execution in the canonical tool runner.
46
45
  */
47
46
  export declare function createRuntimeToolFactory<TContext extends ZodObject>(config: RuntimeToolFactoryConfig<TContext>): RuntimeToolFactory<TContext>;
48
- export declare function runtimeToolMountable(definition: RuntimeToolExecution, assertName?: boolean): MountableTool;
47
+ type AgentPresenter = (output: unknown) => RuntimeAgentModelOutput | PromiseLike<RuntimeAgentModelOutput>;
48
+ /** The Agent presenter a registered tool declares, if any. */
49
+ export declare function agentPresenterOf(definition: RuntimeToolDefinition): AgentPresenter | undefined;
50
+ export declare function runtimeToolMountable(definition: RuntimeToolDefinition, assertName?: boolean): MountableTool;
49
51
  /**
50
52
  * Agent-only public declarations use a peer-free structural tool definition.
51
53
  * Construction validates executable functions before this boundary restores
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-tool.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC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AC,OAAO,CAAC,CAAC,CACzC,GACA,+BAA+B,CAChC,MAAM,EACN,OAAO,EACP,IAAI,EACJ,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CACzC,CAAC;AACF,wBAAgB,iBAAiB,CAC/B,MAAM,SAAS,SAAS,EACxB,KAAK,CAAC,IAAI,SAAS,iBAAiB,GAAG,SAAS,GAAG,SAAS,EAE5D,UAAU,EAAE,kCAAkC,CAAC,MAAM,EAAE,IAAI,CAAC,GAC3D,kCAAkC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAQpD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,SAAS,EACjE,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GACzC,kBAAkB,CAAC,QAAQ,CAAC,CAiE9B;AAED,KAAK,cAAc,GAAG,CACpB,MAAM,EAAE,OAAO,KACZ,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAYpE,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,qBAAqB,GAChC,cAAc,GAAG,SAAS,CAG5B;AAiBD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,qBAAqB,EACjC,UAAU,UAAO,GAChB,aAAa,CAef;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,iCAAiC,EAAE,GAClD,SAAS,qBAAqB,EAAE,CAelC"}
@@ -8,6 +8,10 @@ import { z } from 'zod';
8
8
  * is repaired, not just a top-level field. The transform touches the **arguments**
9
9
  * only — it never rebuilds a schema, so it cannot alter what an object does with
10
10
  * an undeclared key (→ ADR 0034).
11
+ *
12
+ * A string that a union keeps as a string but that parses to an array the union's
13
+ * array member accepts is not repaired: it throws a `ZodError` naming the field,
14
+ * which every tool surface reports as a validation error.
11
15
  */
12
16
  export declare function coerceJsonArgs(args: Record<string, unknown>, schema: z.ZodType | undefined): Record<string, unknown>;
13
17
  //# sourceMappingURL=coerce.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/coerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuHxB;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB"}
1
+ {"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/coerce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2KxB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;AAsKD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,eAAe,EAAE,EAC7B,aAAa,EAAE,MAAM,GACpB,sBAAsB,CAiCxB"}
1
+ {"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;AAqKD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,eAAe,EAAE,EAC7B,aAAa,EAAE,MAAM,GACpB,sBAAsB,CAiCxB"}
@@ -1,12 +1,8 @@
1
1
  import type { ToolTransport } from '../contract/define.js';
2
2
  import { type ProjectedTool, type ToolSurfaceProjection } from './internal/surface-projector.js';
3
3
  import { type CollectToolsConfig, type MountableTool } from './mount.js';
4
- import { type RuntimeToolDefinition } from './runtime-tool.js';
5
- import type { RuntimeToolExecution } from './runtime-tool-execution.js';
6
- /** Contract and pathless runtime operations that form one tool surface. */
7
- export interface ToolSurfaceDefinition<TRuntime extends RuntimeToolExecution = RuntimeToolDefinition> extends ToolSurfaceProjection<TRuntime> {
8
- }
9
- interface CollectedContractTool<TRuntime extends RuntimeToolExecution> {
4
+ import type { RuntimeToolDefinition } from './runtime-tool-declaration.js';
5
+ interface CollectedContractTool<TRuntime extends RuntimeToolDefinition> {
10
6
  kind: 'contract';
11
7
  service: string;
12
8
  action: string;
@@ -15,7 +11,7 @@ interface CollectedContractTool<TRuntime extends RuntimeToolExecution> {
15
11
  kind: 'contract';
16
12
  }>;
17
13
  }
18
- interface CollectedRuntimeTool<TRuntime extends RuntimeToolExecution> {
14
+ interface CollectedRuntimeTool<TRuntime extends RuntimeToolDefinition> {
19
15
  kind: 'runtime';
20
16
  service: string;
21
17
  action: string;
@@ -25,9 +21,9 @@ interface CollectedRuntimeTool<TRuntime extends RuntimeToolExecution> {
25
21
  kind: 'runtime';
26
22
  }>;
27
23
  }
28
- export type CollectedToolSurfaceEntry<TRuntime extends RuntimeToolExecution = RuntimeToolDefinition> = CollectedContractTool<TRuntime> | CollectedRuntimeTool<TRuntime>;
29
- export interface CollectToolSurfaceConfig<TRuntime extends RuntimeToolExecution = RuntimeToolDefinition> extends CollectToolsConfig {
30
- surface: ToolSurfaceDefinition<TRuntime>;
24
+ export type CollectedToolSurfaceEntry<TRuntime extends RuntimeToolDefinition = RuntimeToolDefinition> = CollectedContractTool<TRuntime> | CollectedRuntimeTool<TRuntime>;
25
+ export interface CollectToolSurfaceConfig<TRuntime extends RuntimeToolDefinition = RuntimeToolDefinition> extends CollectToolsConfig {
26
+ surface: ToolSurfaceProjection<TRuntime>;
31
27
  transport: ToolTransport;
32
28
  /** Diagnostics disable this so they can report a broken surface. Default: true. */
33
29
  assertUniqueNames?: boolean;
@@ -36,6 +32,6 @@ export interface CollectToolSurfaceConfig<TRuntime extends RuntimeToolExecution
36
32
  * Resolve contracts and runtime definitions in their real mount order through
37
33
  * the same name, exposure and presentation-schema machinery as the mounts.
38
34
  */
39
- export declare function collectToolSurface<TRuntime extends RuntimeToolExecution>({ surface, transport, assertUniqueNames, ...collectConfig }: CollectToolSurfaceConfig<TRuntime>): CollectedToolSurfaceEntry<TRuntime>[];
35
+ export declare function collectToolSurface<TRuntime extends RuntimeToolDefinition>({ surface, transport, assertUniqueNames, ...collectConfig }: CollectToolSurfaceConfig<TRuntime>): CollectedToolSurfaceEntry<TRuntime>[];
40
36
  export {};
41
37
  //# sourceMappingURL=surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/tools/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,kBAAk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S,qBAAqB,GAAG,qBAAqB,IAC5D,qBAAqB,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAErE,MAAM,WAAW,wBAAwB,CACvC,QAAQ,SAAS,qBAAqB,GAAG,qBAAqB,CAC9D,SAAQ,kBAAkB;IAC1B,OAAO,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACzC,SAAS,EAAE,aAAa,CAAC;IACzB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,qBAAqB,EAAE,EACzE,OAAO,EACP,SAAS,EACT,iBAAwB,EACxB,GAAG,aAAa,EACjB,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GAAG,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAkC5E"}
@@ -14,5 +14,5 @@ export interface DefineDownloadToolConfig<TInput extends ZodObject> extends Mana
14
14
  present?: RuntimeToolPresenters<z.output<typeof ManagedFileRefSchema>>;
15
15
  }
16
16
  /** Define one guarded managed download operation. */
17
- export declare function defineDownloadTool<TInput extends ZodObject>(config: DefineDownloadToolConfig<TInput>): RuntimeToolDefinitionWithOutput<TInput, typeof ManagedFileRefSchema>;
17
+ export declare function defineDownloadTool<TInput extends ZodObject>(config: DefineDownloadToolConfig<TInput>): RuntimeToolDefinitionWithOutput<TInput, typeof ManagedFileRefSchema, undefined, RuntimeToolPresenters<z.output<typeof ManagedFileRefSchema>>>;
18
18
  //# sourceMappingURL=define-download-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-download-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/define-download-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAA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AAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAIzB,MAAM,WAAW,wBAAwB,CAAC,MAAM,SAAS,SAAS,CAChE,SAAQ,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,CACV,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EACvB,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,KACvC,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5C,KAAK,EAAE,mBAAmB,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;CACxE;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,SAAS,EACzD,MAAM,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACvC,+BAA+B,CAChC,MAAM,EACN,OAAO,oBAAoB,EAC3B,SAAS,EACT,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAC7D,CAyCA"}
@@ -12,5 +12,5 @@ export interface DefineUploadToolConfig<TOutput extends ZodType> extends Managed
12
12
  present?: RuntimeToolPresenters<z.output<TOutput>>;
13
13
  }
14
14
  /** Define one managed local-file upload operation. */
15
- export declare function defineUploadTool<TOutput extends ZodType>(config: DefineUploadToolConfig<TOutput>): RuntimeToolDefinitionWithOutput<typeof UploadToolInputSchema, TOutput>;
15
+ export declare function defineUploadTool<TOutput extends ZodType>(config: DefineUploadToolConfig<TOutput>): RuntimeToolDefinitionWithOutput<typeof UploadToolInputSchema, TOutput, undefined, RuntimeToolPresenters<z.output<TOutput>>>;
16
16
  //# sourceMappingURL=define-upload-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-upload-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/define-upload-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAEH,MAAM,WAAW,sBAAsB,CAAC,OAAO,SAAS,OAAO,CAC7D,SAAQ,uBAAuB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,MAAM,EAAE,CACN,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,yBAAyB,CAAC,OAAO,qBAAqB,CAAC,KAC7D,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;CACpD;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,OAAO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5 +6,5 @@ export interface DefineViewFileToolConfig extends ManagedNativeToolConfig, ViewF
6
6
  present?: RuntimeToolPresenters<z.output<typeof ViewFileOutputSchema>>;
7
7
  }
8
8
  /** Define one protected managed multimodal media-inspection operation. */
9
- export declare function defineViewFileTool(config: DefineViewFileToolConfig): RuntimeToolDefinitionWithOutput<typeof ViewFileInputSchema, typeof ViewFileOutputSchema>;
9
+ export declare function defineViewFileTool(config: DefineViewFileToolConfig): RuntimeToolDefinitionWithOutput<typeof ViewFileInputSchema, typeof ViewFileOutputSchema, undefined, RuntimeToolPresenters<z.output<typeof ViewFileOutputSchema>>>;
10
10
  //# sourceMappingURL=define-view-file-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-view-file-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/define-view-file-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,mBAAmB,EACnB,KAAK,eAAe,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB,EAAE,eAAe;IACxF,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;CACxE;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,GAC/B,+BAA+B,CAAC,OAAO,mBAAmB,EAAE,OAAO,oBAAoB,CAAC,CAwC1F"}
1
+ {"version":3,"file":"define-view-file-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/define-view-file-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,uBAAuB,EAAyB,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,mBAAmB,EACnB,KAAK,eAAe,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAyB,SAAQ,uBAAuB,EAAE,eAAe;IACxF,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;CACxE;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,wBAAwB,GAC/B,+BAA+B,CAChC,OAAO,mBAAmB,EAC1B,OAAO,oBAAoB,EAC3B,SAAS,EACT,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAC7D,CAwCA"}
@@ -1 +1 @@
1
- {"version":3,"file":"managed-file-error.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/managed-file-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAC;AAmBtE,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAyBnE;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAE/D"}
1
+ {"version":3,"file":"managed-file-error.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/managed-file-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAC;AAmBtE,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAiCnE;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAE/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"view-file-contract.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/view-file-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;2BAchC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAgBlE,eAAO,MAAM,mBAAmB;;iBAM9B,CAAC"}
1
+ {"version":3,"file":"view-file-contract.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/view-file-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qFAAqF;AACrF,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;2BAchC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB;;iBAM9B,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * sandboxed to a `baseDir`, and downloads are capped before they reach memory.
14
14
  */
15
15
  import type { McpServer } from '@modelcontextprotocol/server';
16
- import type { z } from 'zod';
16
+ import { z } from 'zod';
17
17
  import type { McpMediaContent, ViewFileOutput } from './view-file-contract.js';
18
18
  import { ViewFileInputSchema } from './view-file-contract.js';
19
19
  export { type McpAnnotations, McpAnnotationsSchema, type McpMediaContent, McpMediaContentSchema, ViewFileErrorSchema, ViewFileInputSchema, type ViewFileOutput, ViewFileOutputSchema, } from './view-file-contract.js';
@@ -1 +1 @@
1
- {"version":3,"file":"view-file.d.ts","sourceRoot":"","sources":["../../../src/tools/transfer/view-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAwB,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EACL,KAAK,cAAc,EACnB,oBAAoB,EACpB,KAAK,eAAe,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,cAAc,EACnB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAG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AmB,EAAoB,MAAM,sBAAsB,CAAC;AA0BlF,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwKD;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,eAAe,EAAE,CAAC,CAE5B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC,OAAO,CAAC,EACpD,OAAO,GAAE,eAAoB,EAC7B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAyBpF"}
@@ -8,7 +8,8 @@
8
8
  * definitions cannot disappear from the boot diagnostic.
9
9
  */
10
10
  import type { Transport } from '../contract/define.js';
11
- import { type ToolSurfaceDefinition } from './surface.js';
11
+ import type { ToolSurfaceProjection } from './internal/surface-projector.js';
12
+ import type { RuntimeToolDefinition } from './runtime-tool-declaration.js';
12
13
  /** Operation counts per transport, for one service or the whole fleet. */
13
14
  export type TransportCounts = Record<Transport, number>;
14
15
  /** The result of `summarizeTransports`. */
@@ -26,5 +27,5 @@ export interface TransportSummary {
26
27
  counts: TransportCounts;
27
28
  }>;
28
29
  }
29
- export declare function summarizeTransports(surface: ToolSurfaceDefinition): TransportSummary;
30
+ export declare function summarizeTransports(surface: ToolSurfaceProjection<RuntimeToolDefinition>): TransportSummary;
30
31
  //# sourceMappingURL=transports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../../src/tools/transports.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE3E,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAExD,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,MAAM,EAAE,eAAe,CAAC;IACxB,iFAAiF;IACjF,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;QAC7B,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,eAAe,CAAC;KACzB,CAAC,CAAC;CACJ;AAwCD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,GAAG,gBAAgB,CA6BpF"}
1
+ {"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../../src/tools/transports.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAExD,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,MAAM,EAAE,eAAe,CAAC;IACxB,iFAAiF;IACjF,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;QAC7B,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,eAAe,CAAC;KACzB,CAAC,CAAC;CACJ;AAwCD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,CAAC,qBAAqB,CAAC,GACpD,gBAAgB,CA6BlB"}
@@ -21,7 +21,10 @@ terminal and provider-envelope schemas/types listed under
21
21
  including `AgentAttemptResetEventSchema` for `attempt-reset`),
22
22
  `AgentRuntimeEventCursorSchema`, `advanceAgentRuntimeEventCursor`,
23
23
  `AgentControlRequestSchema` / `AgentControlRequest`, `AgentControlResponseSchema` /
24
- `AgentControlResponse`, `AgentControlDeliverySchema` / `AgentControlDelivery`, `AgentMultiSessionCursorSchema` /
24
+ `AgentControlResponse`, `AgentControlDeliverySchema` / `AgentControlDelivery`,
25
+ `AgentControlErrorCodeSchema` / `AgentControlErrorCode` (the one vocabulary of every control
26
+ error code: `FORBIDDEN`, `CONNECTION_CLOSED`, `REQUEST_CAPACITY`, `ATTACHMENT_CAPACITY`,
27
+ `LEASE_CONFLICT`, `EVENT_OVERFLOW` and the rest), `AgentMultiSessionCursorSchema` /
25
28
  `AgentMultiSessionCursor`, `AgentConversationView`, `AgentControlView`,
26
29
  `advanceAgentMultiSessionCursor`, `createAgentControlView`, `reduceAgentControlSnapshot`,
27
30
  `reduceAgentControlEvent` and
@@ -51,9 +54,12 @@ attachment per conversation on that transport; share the controller between view
51
54
  `submit` requires a caller-owned idempotency key. Unknown-outcome mutations are never
52
55
  replayed automatically. `AgentControllerState` distinguishes connecting, ready,
53
56
  disconnected, error and closed and retains the canonical full `view` plus safe error
54
- code/message. Errors in automatic attach/refresh appear there. Reconnect attaches again
55
- and reads a snapshot; snapshot gaps coalesce, stale generations cannot overwrite state,
56
- and buffers/queues are bounded. Overflow or failed refresh is visible and requires
57
+ code/message. Errors in automatic attach/refresh appear there, and so does an
58
+ `access-denied` delivery: the server detached the conversation, the state becomes
59
+ `error` with code `FORBIDDEN`, and nothing arrives until the controller attaches again.
60
+ Reconnect attaches again and reads a snapshot; requests of the previous connection are
61
+ rejected at once and release their capacity, snapshot gaps coalesce, stale generations
62
+ cannot overwrite state, and buffers/queues are bounded. Overflow or failed refresh is visible and requires
57
63
  explicit recovery. Closing detaches without closing the shared transport or remote run.
58
64
 
59
65
  See [agent composition](../guide/agent-composition.md) for a complete wiring example.
@@ -12,20 +12,6 @@ Also read:
12
12
  # Guide: Agent composition (docs/guide/agent-composition.md)
13
13
  ==============================================================================
14
14
 
15
- ---
16
- title: "Agent composition without a second runtime"
17
- description: "Compose contract tools, authenticated realtime control, React views and exact-run behavioral checks."
18
- type: architecture
19
- status: active
20
- created: 2026-09-30 22:45 +07:00
21
- updated: 2026-09-30 23:03 +07:00
22
- participants:
23
- - role: authored
24
- harness: Codex
25
- model: GPT-6
26
- at: 2026-09-30 22:45 +07:00
27
- ---
28
-
29
15
  # Compose an agent application
30
16
 
31
17
  Use these pieces when an application wants the existing headless harness and a generic
@@ -41,7 +27,7 @@ import {
41
27
  createAgentHarnessFileResources,
42
28
  createHeadlessAgentHarness,
43
29
  } from 'stitchkit/agent-runtime/harness';
44
- import { createAgentHarnessTools } from 'stitchkit/agent-runtime/harness-tools';
30
+ import { composeToolLifecycle, mountAgent } from 'stitchkit/tools';
45
31
 
46
32
  const resources = createAgentHarnessFileResources({
47
33
  roots: [{ id: 'guide', kind: 'instruction', path: instructionRoot }],
@@ -50,27 +36,31 @@ const resources = createAgentHarnessFileResources({
50
36
  const harness = createHeadlessAgentHarness({
51
37
  protocol, store, models, promptBudget,
52
38
  resources,
53
- tools: createAgentHarnessTools(({ context, run }) => ({
54
- services: [catalogService],
55
- context: { ...context, messageId: run.assistantMessageId },
56
- runtimeTools: resources.runtimeTools,
57
- lifecycle: authorizeTools,
58
- hooks: observeTools,
59
- })),
39
+ tools: ({ context, run, toolFenceLifecycle }) =>
40
+ mountAgent([catalogService], {
41
+ context: { ...context, messageId: run.assistantMessageId },
42
+ runtimeTools: resources.runtimeTools,
43
+ lifecycle: composeToolLifecycle(authorizeTools, toolFenceLifecycle),
44
+ hooks: observeTools,
45
+ }),
60
46
  });
61
47
  ```
62
48
 
63
- The factory composes application authorization then the runtime fence through `mountAgent`.
64
- The optional harness-tools leaf preserves the complete tool types, including MCP presenter
65
- declarations; install the same `ai` and `@modelcontextprotocol/server` peers as for
66
- `stitchkit/tools`. The base harness stays AI-only. Every mount option remains available, including registry, runtime tools, extension,
67
- coercion, output stripping, hooks and durability. Async per-run configuration is supported.
68
- The original tools callback still accepts arbitrary typed AI SDK tools and prepareStep.
49
+ `tools` is called for each run with its validated context. Mount through `mountAgent` and
50
+ compose your authorization with the run's `toolFenceLifecycle` by `composeToolLifecycle`: the
51
+ fence rejects a call from a run that no longer owns the conversation, and it must run exactly
52
+ once. Every mount option remains available, including registry, runtime tools, extension,
53
+ coercion, output stripping, hooks and durability, and the callback may be async. The same callback
54
+ still accepts arbitrary typed AI SDK tools and prepareStep. `stitchkit/tools` needs the same `ai` and
55
+ `@modelcontextprotocol/server` peers as any `mountAgent` use; the base harness stays AI-only.
69
56
  The resource reader is explicitly selected: filtered allowlists do not gain tools merely
70
57
  because a loader exists. Root IDs, kinds, provenance and limits are unchanged.
71
58
 
72
59
  ## Server and browser
73
60
 
61
+ `stitchkit/agent-runtime/realtime` and `stitchkit/agent-runtime/react` are evolving and
62
+ experimental: no application has committed to them yet, so expect their shape to change.
63
+
74
64
  ```ts
75
65
  import { bindAgentHarnessRealtime } from 'stitchkit/agent-runtime/realtime';
76
66
 
@@ -82,11 +72,19 @@ const binding = bindAgentHarnessRealtime(harness, socket, {
82
72
  },
83
73
  onError: reportServerError,
84
74
  });
75
+
76
+ // When an application withdraws someone's access, tell the binding.
77
+ await removeMember(conversationId, userId);
78
+ binding.revoke(conversationId, (identity) => identity.userId === userId);
85
79
  ```
86
80
 
87
81
  `socket` is the existing `createSocketIOServer` handle, attached to `createServer` (Bun)
88
- or the Node adapter. The access policy checks every operation, file/reference and metadata
89
- as well as snapshot/event reads. Session handshake authentication alone is insufficient.
82
+ or the Node adapter. The access policy checks every request, file/reference and metadata, and
83
+ the attach that opens a stream. Events then flow under that grant without a call per token;
84
+ Without a `revoke()` call a grant lasts until the socket disconnects or the conversation is detached: events keep flowing even if your own permission data changed. That fail-open default is deliberate (one check per request, not one per token), so call `revoke` whenever access is withdrawn. `revoke` ends the grant, the next event is re-authorized (`source: 'delivery'`), and a refusal
85
+ or failure detaches the conversation and delivers `access-denied`, which puts the controller in
86
+ `error` with code `FORBIDDEN` instead of leaving a frozen view. Session handshake
87
+ authentication alone is insufficient.
90
88
  Conversation ownership and observer/controller roles are application policy; the canonical
91
89
  control server additionally enforces its exclusive controller lease.
92
90
 
@@ -124,7 +122,10 @@ view does not interrupt its remote run. Use explicit `interrupt` for cancellatio
124
122
  Reconnect reattaches and reads durable state. Mutations are not retried automatically:
125
123
  if an acknowledgement is lost, retain the original idempotency key. Incoming event
126
124
  buffers and outgoing requests have finite limits; capacity/overflow/lease failures stay
127
- visible. A server overflow deliberately disconnects the transport; reconnect explicitly.
125
+ visible, each with a code from the one `AgentControlErrorCode` vocabulary. A reconnect
126
+ rejects the requests of the previous connection at once and attaches again, so they
127
+ cannot hold capacity the new attach needs. A server overflow deliberately disconnects the
128
+ transport; reconnect explicitly.
128
129
 
129
130
  ## Check behavior, not just admission
130
131
 
@@ -15,7 +15,7 @@ Also read:
15
15
 
16
16
  ## `stitchkit/agent-runtime/react`
17
17
 
18
- Optional evolving React peer leaf. `useAgent` takes a controller and subscribes through
18
+ Optional evolving React peer leaf, experimental: no committed consumer yet. `useAgent` takes a controller and subscribes through
19
19
  `useSyncExternalStore`, returning the same `AgentControllerState` as `getSnapshot()`.
20
20
  Create and close the controller at application/session scope. Multiple components can
21
21
  observe it; StrictMode and unmount release only the component's own subscription.