stitchkit 0.94.0 → 0.95.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 (360) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  3. package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
  4. package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
  5. package/dist/agent-runtime/contained-darwin.d.ts +38 -0
  6. package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
  7. package/dist/agent-runtime/contained-files.d.ts +11 -26
  8. package/dist/agent-runtime/contained-files.d.ts.map +1 -1
  9. package/dist/agent-runtime/contained-scan.d.ts +21 -0
  10. package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
  11. package/dist/agent-runtime/contained-write.d.ts +9 -0
  12. package/dist/agent-runtime/contained-write.d.ts.map +1 -0
  13. package/dist/agent-runtime/deferred-tool-types.d.ts +3 -2
  14. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  15. package/dist/agent-runtime/harness-control.d.ts +0 -1
  16. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  17. package/dist/agent-runtime/harness.d.ts +0 -5
  18. package/dist/agent-runtime/harness.d.ts.map +1 -1
  19. package/dist/agent-runtime/managed-tools.d.ts +3 -2
  20. package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
  21. package/dist/agent-runtime/provider-origin.d.ts +7 -0
  22. package/dist/agent-runtime/provider-origin.d.ts.map +1 -1
  23. package/dist/agent-runtime/run-operation-lifecycle.d.ts.map +1 -1
  24. package/dist/agent-runtime/runtime.d.ts +1 -1
  25. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  26. package/dist/agent-runtime/schedule-records.d.ts +34 -0
  27. package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
  28. package/dist/agent-runtime/schedules.d.ts +34 -0
  29. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  30. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
  31. package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
  32. package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
  33. package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
  34. package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
  35. package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
  36. package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
  37. package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
  38. package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
  39. package/dist/application/admission-rate.d.ts +21 -0
  40. package/dist/application/admission-rate.d.ts.map +1 -0
  41. package/dist/application/admission-run.d.ts +8 -0
  42. package/dist/application/admission-run.d.ts.map +1 -0
  43. package/dist/application/admission.d.ts.map +1 -1
  44. package/dist/application/diagnostic-journal-lock.d.ts +9 -34
  45. package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
  46. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  47. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  48. package/dist/application/kernel-resource-context.d.ts.map +1 -1
  49. package/dist/application/notification-outbox.d.ts.map +1 -1
  50. package/dist/application/process-lifecycle-transitions.d.ts +175 -0
  51. package/dist/application/process-lifecycle-transitions.d.ts.map +1 -0
  52. package/dist/application/process-lifecycle.d.ts +3 -131
  53. package/dist/application/process-lifecycle.d.ts.map +1 -1
  54. package/dist/application/schedule.d.ts +0 -1
  55. package/dist/application/schedule.d.ts.map +1 -1
  56. package/dist/application/watch-hub-core.d.ts +122 -0
  57. package/dist/application/watch-hub-core.d.ts.map +1 -0
  58. package/dist/application/watch-hub.d.ts +2 -2
  59. package/dist/application/watch-hub.d.ts.map +1 -1
  60. package/dist/browser/client-executors.d.ts +14 -0
  61. package/dist/browser/client-executors.d.ts.map +1 -0
  62. package/dist/browser/client-multipart.d.ts +1 -1
  63. package/dist/browser/client-multipart.d.ts.map +1 -1
  64. package/dist/browser/client.d.ts +3 -2
  65. package/dist/browser/client.d.ts.map +1 -1
  66. package/dist/browser/http-fetch.d.ts +22 -0
  67. package/dist/browser/http-fetch.d.ts.map +1 -0
  68. package/dist/browser/http.d.ts +1 -3
  69. package/dist/browser/http.d.ts.map +1 -1
  70. package/dist/browser/live-state-core.d.ts +63 -0
  71. package/dist/browser/live-state-core.d.ts.map +1 -0
  72. package/dist/browser/live-state.d.ts.map +1 -1
  73. package/dist/browser/realtime-client.d.ts +26 -0
  74. package/dist/browser/realtime-client.d.ts.map +1 -0
  75. package/dist/browser/socket-io-connection.d.ts +82 -0
  76. package/dist/browser/socket-io-connection.d.ts.map +1 -0
  77. package/dist/browser/socket-io-peer.d.ts +20 -0
  78. package/dist/browser/socket-io-peer.d.ts.map +1 -0
  79. package/dist/browser/socket-io-trace.d.ts +31 -0
  80. package/dist/browser/socket-io-trace.d.ts.map +1 -0
  81. package/dist/browser/socket-io.d.ts +2 -18
  82. package/dist/browser/socket-io.d.ts.map +1 -1
  83. package/dist/contract/client-types.d.ts +134 -0
  84. package/dist/contract/client-types.d.ts.map +1 -0
  85. package/dist/contract/define-validation.d.ts +30 -0
  86. package/dist/contract/define-validation.d.ts.map +1 -0
  87. package/dist/contract/define.d.ts +3 -357
  88. package/dist/contract/define.d.ts.map +1 -1
  89. package/dist/contract/runtime-context.d.ts +131 -0
  90. package/dist/contract/runtime-context.d.ts.map +1 -0
  91. package/dist/contract/tool-options.d.ts +105 -0
  92. package/dist/contract/tool-options.d.ts.map +1 -0
  93. package/dist/contract/tool-view.d.ts +15 -2
  94. package/dist/contract/tool-view.d.ts.map +1 -1
  95. package/dist/durability/contract.d.ts +83 -0
  96. package/dist/durability/contract.d.ts.map +1 -1
  97. package/dist/durability/effect.d.ts +24 -0
  98. package/dist/durability/effect.d.ts.map +1 -0
  99. package/dist/durability/engine.d.ts +2 -2
  100. package/dist/durability/engine.d.ts.map +1 -1
  101. package/dist/durability/events.d.ts +2 -0
  102. package/dist/durability/events.d.ts.map +1 -1
  103. package/dist/durability/ledger.d.ts +11 -0
  104. package/dist/durability/ledger.d.ts.map +1 -1
  105. package/dist/durability/parks.d.ts +22 -0
  106. package/dist/durability/parks.d.ts.map +1 -0
  107. package/dist/durability/scheduler.d.ts +1 -0
  108. package/dist/durability/scheduler.d.ts.map +1 -1
  109. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
  110. package/dist/entrypoints/agent-runtime/harness.js +127 -116
  111. package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
  112. package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
  113. package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
  114. package/dist/entrypoints/agent-runtime/testing.js +246 -214
  115. package/dist/entrypoints/agent-runtime.js +224 -203
  116. package/dist/entrypoints/application/diagnostic-journal.js +63 -203
  117. package/dist/entrypoints/application/opentelemetry.js +1 -1
  118. package/dist/entrypoints/application.d.ts +2 -1
  119. package/dist/entrypoints/application.d.ts.map +1 -1
  120. package/dist/entrypoints/application.js +506 -380
  121. package/dist/entrypoints/cli.d.ts +4 -1
  122. package/dist/entrypoints/cli.d.ts.map +1 -1
  123. package/dist/entrypoints/cli.js +57 -35
  124. package/dist/entrypoints/contract.d.ts +5 -2
  125. package/dist/entrypoints/contract.d.ts.map +1 -1
  126. package/dist/entrypoints/contract.js +3 -2
  127. package/dist/entrypoints/files.d.ts +2 -0
  128. package/dist/entrypoints/files.d.ts.map +1 -1
  129. package/dist/entrypoints/files.js +98 -2
  130. package/dist/entrypoints/index.d.ts +4 -2
  131. package/dist/entrypoints/index.d.ts.map +1 -1
  132. package/dist/entrypoints/index.js +348 -282
  133. package/dist/entrypoints/live.js +89 -71
  134. package/dist/entrypoints/node.d.ts +2 -1
  135. package/dist/entrypoints/node.d.ts.map +1 -1
  136. package/dist/entrypoints/node.js +13 -12
  137. package/dist/entrypoints/react.js +1 -1
  138. package/dist/entrypoints/remote.js +4 -4
  139. package/dist/entrypoints/server.d.ts +4 -2
  140. package/dist/entrypoints/server.d.ts.map +1 -1
  141. package/dist/entrypoints/server.js +293 -79
  142. package/dist/entrypoints/testing.d.ts +2 -1
  143. package/dist/entrypoints/testing.d.ts.map +1 -1
  144. package/dist/entrypoints/testing.js +288 -281
  145. package/dist/entrypoints/tools/connections.js +2 -2
  146. package/dist/entrypoints/tools/invoker.js +4 -4
  147. package/dist/entrypoints/tools.d.ts +6 -3
  148. package/dist/entrypoints/tools.d.ts.map +1 -1
  149. package/dist/entrypoints/tools.js +245 -202
  150. package/dist/entrypoints/tracking.js +325 -274
  151. package/dist/files/boundary.d.ts.map +1 -1
  152. package/dist/files/file-io.d.ts +14 -0
  153. package/dist/files/file-io.d.ts.map +1 -0
  154. package/dist/index-1j8pm5t0.js +412 -0
  155. package/dist/{index-kvj7f4hq.js → index-2bxbyab0.js} +10 -2
  156. package/dist/{index-xnj9bgxe.js → index-2gxzjvyr.js} +2 -162
  157. package/dist/index-4gcnakhx.js +82 -0
  158. package/dist/{index-j05z5gn4.js → index-55hkhm67.js} +136 -119
  159. package/dist/{index-cq4qfycf.js → index-79z7m7dt.js} +227 -59
  160. package/dist/{index-r7nmqpsg.js → index-7p1f0vp2.js} +1 -1
  161. package/dist/{index-dcpdvjsc.js → index-863ea9jb.js} +4 -4
  162. package/dist/index-8p52kd5p.js +242 -0
  163. package/dist/{index-97ac4gph.js → index-8zja4pkf.js} +26 -4
  164. package/dist/{index-2qzskm8h.js → index-dce5wxcq.js} +1 -1
  165. package/dist/index-e01r054k.js +105 -0
  166. package/dist/{index-sees8yf8.js → index-ensd0r74.js} +118 -111
  167. package/dist/{index-1nd48tm9.js → index-gxrt5h6v.js} +2 -1
  168. package/dist/{index-e87kakm4.js → index-ham5sz8m.js} +112 -110
  169. package/dist/{index-kj2wbeta.js → index-het2he5g.js} +280 -196
  170. package/dist/{index-vcvkq30w.js → index-hmp4800j.js} +3 -3
  171. package/dist/{index-gyr48nzg.js → index-k30h66yd.js} +71 -151
  172. package/dist/{index-2cr1cqhn.js → index-khtgb21r.js} +2 -2
  173. package/dist/{index-x4799c19.js → index-ndddxtyx.js} +11 -11
  174. package/dist/{index-dydjcp8z.js → index-np4m8hd3.js} +38 -36
  175. package/dist/{index-p81267c2.js → index-p3vsv1fb.js} +621 -357
  176. package/dist/{index-mp5sn43f.js → index-p9e0w8hs.js} +2 -2
  177. package/dist/{index-rewkc2hj.js → index-p9sh0xx4.js} +3 -3
  178. package/dist/{index-70yj2ebz.js → index-paz6sgdp.js} +107 -103
  179. package/dist/{index-bn2cjajt.js → index-px2gm2jp.js} +26 -102
  180. package/dist/index-s812ycat.js +65 -0
  181. package/dist/{index-xsqjkha9.js → index-sp1tzwnb.js} +2 -2
  182. package/dist/{index-n6hxg8as.js → index-t9rhjr9f.js} +615 -566
  183. package/dist/{index-zeemqhqx.js → index-v260df89.js} +88 -80
  184. package/dist/{index-fdp6hdxn.js → index-w906953s.js} +5 -1
  185. package/dist/{index-mdzh02yc.js → index-wdkt63w3.js} +1 -1
  186. package/dist/{index-58k4fp34.js → index-wsm5w4ee.js} +1 -1
  187. package/dist/{index-v38qyerb.js → index-xw3s75nj.js} +1 -1
  188. package/dist/internal/atomic-file.d.ts +23 -2
  189. package/dist/internal/atomic-file.d.ts.map +1 -1
  190. package/dist/internal/exclusive-lock.d.ts +51 -0
  191. package/dist/internal/exclusive-lock.d.ts.map +1 -0
  192. package/dist/internal/process-identity.d.ts +47 -0
  193. package/dist/internal/process-identity.d.ts.map +1 -0
  194. package/dist/internal/with-exclusive-lock.d.ts +67 -0
  195. package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
  196. package/dist/live/watch-client.d.ts.map +1 -1
  197. package/dist/observability/audit.d.ts +2 -2
  198. package/dist/observability/audit.d.ts.map +1 -1
  199. package/dist/observability/event.d.ts +2 -1
  200. package/dist/observability/event.d.ts.map +1 -1
  201. package/dist/primitives/export-operation.d.ts +1 -1
  202. package/dist/primitives/export-operation.d.ts.map +1 -1
  203. package/dist/realtime/registry.d.ts +0 -5
  204. package/dist/realtime/registry.d.ts.map +1 -1
  205. package/dist/server/bun.d.ts +0 -1
  206. package/dist/server/bun.d.ts.map +1 -1
  207. package/dist/server/context-contribution.d.ts +1 -1
  208. package/dist/server/context-contribution.d.ts.map +1 -1
  209. package/dist/server/context.d.ts +1 -1
  210. package/dist/server/context.d.ts.map +1 -1
  211. package/dist/server/endpoint-response.d.ts +2 -1
  212. package/dist/server/endpoint-response.d.ts.map +1 -1
  213. package/dist/server/error-dispatch.d.ts +1 -1
  214. package/dist/server/error-dispatch.d.ts.map +1 -1
  215. package/dist/server/error-hook.d.ts +1 -1
  216. package/dist/server/error-hook.d.ts.map +1 -1
  217. package/dist/server/handler-state.d.ts +1 -1
  218. package/dist/server/handler-state.d.ts.map +1 -1
  219. package/dist/server/implement-registry.d.ts +54 -0
  220. package/dist/server/implement-registry.d.ts.map +1 -0
  221. package/dist/server/implement.d.ts +9 -55
  222. package/dist/server/implement.d.ts.map +1 -1
  223. package/dist/server/middleware/auth.d.ts +1 -31
  224. package/dist/server/middleware/auth.d.ts.map +1 -1
  225. package/dist/server/middleware/jwt.d.ts +31 -0
  226. package/dist/server/middleware/jwt.d.ts.map +1 -0
  227. package/dist/server/multipart-reader.d.ts +22 -0
  228. package/dist/server/multipart-reader.d.ts.map +1 -0
  229. package/dist/server/multipart.d.ts +1 -1
  230. package/dist/server/multipart.d.ts.map +1 -1
  231. package/dist/server/oauth/cimd.d.ts +88 -0
  232. package/dist/server/oauth/cimd.d.ts.map +1 -0
  233. package/dist/server/oauth/endpoints.d.ts +39 -0
  234. package/dist/server/oauth/endpoints.d.ts.map +1 -0
  235. package/dist/server/oauth/provider.d.ts +1 -68
  236. package/dist/server/oauth/provider.d.ts.map +1 -1
  237. package/dist/server/streaming-pump.d.ts +66 -0
  238. package/dist/server/streaming-pump.d.ts.map +1 -0
  239. package/dist/server/streaming-route.d.ts +12 -5
  240. package/dist/server/streaming-route.d.ts.map +1 -1
  241. package/dist/server/types.d.ts +4 -1
  242. package/dist/server/types.d.ts.map +1 -1
  243. package/dist/server/unix-client-bun.d.ts.map +1 -1
  244. package/dist/server/unix-client-http1.d.ts +76 -0
  245. package/dist/server/unix-client-http1.d.ts.map +1 -0
  246. package/dist/server/unix-client.d.ts.map +1 -1
  247. package/dist/testing/handler-clients.d.ts +2 -1
  248. package/dist/testing/handler-clients.d.ts.map +1 -1
  249. package/dist/testing/realtime-probe.d.ts +33 -0
  250. package/dist/testing/realtime-probe.d.ts.map +1 -0
  251. package/dist/testing/surface-conformance.d.ts +0 -31
  252. package/dist/testing/surface-conformance.d.ts.map +1 -1
  253. package/dist/testing/surface-manifest-digest.d.ts +44 -0
  254. package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
  255. package/dist/testing/surface-manifest.d.ts.map +1 -1
  256. package/dist/tools/agent.d.ts +1 -1
  257. package/dist/tools/agent.d.ts.map +1 -1
  258. package/dist/tools/cli/args-fields.d.ts +31 -0
  259. package/dist/tools/cli/args-fields.d.ts.map +1 -0
  260. package/dist/tools/cli/args-route.d.ts +42 -0
  261. package/dist/tools/cli/args-route.d.ts.map +1 -0
  262. package/dist/tools/cli/args-view.d.ts +32 -0
  263. package/dist/tools/cli/args-view.d.ts.map +1 -0
  264. package/dist/tools/cli/args.d.ts +2 -65
  265. package/dist/tools/cli/args.d.ts.map +1 -1
  266. package/dist/tools/cli/argument-error.d.ts +5 -0
  267. package/dist/tools/cli/argument-error.d.ts.map +1 -0
  268. package/dist/tools/cli/checkpoint.d.ts.map +1 -1
  269. package/dist/tools/cli/command.d.ts +1 -1
  270. package/dist/tools/cli/command.d.ts.map +1 -1
  271. package/dist/tools/cli/config.d.ts +1 -1
  272. package/dist/tools/cli/config.d.ts.map +1 -1
  273. package/dist/tools/cli/format.d.ts +2 -1
  274. package/dist/tools/cli/format.d.ts.map +1 -1
  275. package/dist/tools/cli/invoke.d.ts +2 -1
  276. package/dist/tools/cli/invoke.d.ts.map +1 -1
  277. package/dist/tools/cli/managed-surface.d.ts +1 -1
  278. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  279. package/dist/tools/cli/policy.d.ts +1 -1
  280. package/dist/tools/cli/policy.d.ts.map +1 -1
  281. package/dist/tools/cli/prepare.d.ts.map +1 -1
  282. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  283. package/dist/tools/cli/session.d.ts +1 -1
  284. package/dist/tools/cli/session.d.ts.map +1 -1
  285. package/dist/tools/cli/update.d.ts +19 -0
  286. package/dist/tools/cli/update.d.ts.map +1 -1
  287. package/dist/tools/cli/view.d.ts +1 -1
  288. package/dist/tools/cli/view.d.ts.map +1 -1
  289. package/dist/tools/cli/wait.d.ts +1 -1
  290. package/dist/tools/cli/wait.d.ts.map +1 -1
  291. package/dist/tools/connections/runtime.d.ts +1 -1
  292. package/dist/tools/connections/runtime.d.ts.map +1 -1
  293. package/dist/tools/execute-args.d.ts +23 -0
  294. package/dist/tools/execute-args.d.ts.map +1 -0
  295. package/dist/tools/execute-hooks.d.ts +146 -0
  296. package/dist/tools/execute-hooks.d.ts.map +1 -0
  297. package/dist/tools/execute-result.d.ts +40 -0
  298. package/dist/tools/execute-result.d.ts.map +1 -0
  299. package/dist/tools/execute.d.ts +4 -193
  300. package/dist/tools/execute.d.ts.map +1 -1
  301. package/dist/tools/internal/surface-projector.d.ts +2 -1
  302. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  303. package/dist/tools/invoker.d.ts +2 -1
  304. package/dist/tools/invoker.d.ts.map +1 -1
  305. package/dist/tools/lifecycle.d.ts +1 -1
  306. package/dist/tools/lifecycle.d.ts.map +1 -1
  307. package/dist/tools/mcp/mount.d.ts +1 -1
  308. package/dist/tools/mcp/mount.d.ts.map +1 -1
  309. package/dist/tools/mcp/prepare.d.ts +2 -1
  310. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  311. package/dist/tools/mcp/progress.d.ts +1 -1
  312. package/dist/tools/mcp/progress.d.ts.map +1 -1
  313. package/dist/tools/mcp/register.d.ts +3 -2
  314. package/dist/tools/mcp/register.d.ts.map +1 -1
  315. package/dist/tools/mcp/round-context.d.ts +38 -0
  316. package/dist/tools/mcp/round-context.d.ts.map +1 -0
  317. package/dist/tools/mcp/round-policy.d.ts +1 -1
  318. package/dist/tools/mcp/round-policy.d.ts.map +1 -1
  319. package/dist/tools/mcp/round.d.ts +3 -11
  320. package/dist/tools/mcp/round.d.ts.map +1 -1
  321. package/dist/tools/mcp/runtime-tools.d.ts +2 -1
  322. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  323. package/dist/tools/mount.d.ts +3 -1
  324. package/dist/tools/mount.d.ts.map +1 -1
  325. package/dist/tools/native-definition.d.ts +2 -1
  326. package/dist/tools/native-definition.d.ts.map +1 -1
  327. package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -1
  328. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
  329. package/dist/tools/operations/async-operation-runtime-types.d.ts +2 -1
  330. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
  331. package/dist/tools/remote.d.ts.map +1 -1
  332. package/dist/tools/runtime-tool.d.ts +3 -1
  333. package/dist/tools/runtime-tool.d.ts.map +1 -1
  334. package/dist/tools/tool-logger.d.ts +1 -1
  335. package/dist/tools/tool-logger.d.ts.map +1 -1
  336. package/dist/tracking/client-listeners.d.ts +30 -0
  337. package/dist/tracking/client-listeners.d.ts.map +1 -0
  338. package/dist/tracking/client-visit.d.ts +61 -0
  339. package/dist/tracking/client-visit.d.ts.map +1 -0
  340. package/dist/tracking/client.d.ts +3 -2
  341. package/dist/tracking/client.d.ts.map +1 -1
  342. package/llms/application.2.txt +271 -7
  343. package/llms/application.txt +66 -289
  344. package/llms/cli.2.txt +80 -0
  345. package/llms/cli.txt +45 -74
  346. package/llms/contract.txt +3 -3
  347. package/llms/files.txt +3 -0
  348. package/llms/stitchkit.txt +3 -3
  349. package/llms/tools.2.txt +88 -279
  350. package/llms/tools.3.txt +288 -0
  351. package/llms/tools.txt +27 -65
  352. package/llms/{upgrading-0.37.0-0.50.0.txt → upgrading-0.37.0-0.53.0.txt} +25 -3
  353. package/llms/{upgrading-0.53.0-0.67.0.txt → upgrading-0.55.0-0.68.0.txt} +53 -25
  354. package/llms/{upgrading-0.68.0-0.94.0.txt → upgrading-0.69.0-0.95.0.txt} +45 -53
  355. package/llms/upgrading.txt +3 -3
  356. package/llms-full.txt +216 -43
  357. package/llms.txt +8 -8
  358. package/package.json +1 -1
  359. package/dist/index-e2z3ahw9.js +0 -325
  360. package/dist/index-mkm15s49.js +0 -394
@@ -0,0 +1,288 @@
1
+ # stitchkit/tools — stitchkit docs slice, part 3 of 3
2
+
3
+ > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
+ > `llms.txt` in this package.
5
+
6
+ Parts of this slice:
7
+ - `llms/tools.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
8
+ - `llms/tools.2.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
9
+ - `llms/tools.3.txt`: API reference: `stitchkit/tools` (docs/api/reference.md)
10
+
11
+ ==============================================================================
12
+ # API reference: `stitchkit/tools` (docs/api/reference.md)
13
+ ==============================================================================
14
+
15
+ ## `stitchkit/tools`
16
+
17
+ Server-only. Turns contracts into MCP and AI-agent tools. MCP server surfaces
18
+ need the `@modelcontextprotocol/server` v2 peer; MCP hosts/tests use the separate
19
+ `@modelcontextprotocol/client` package. Agent surfaces need the `ai` peer.
20
+
21
+ Framework-owned MCP tools advertise the exact declared output schema and return
22
+ the validated value unchanged as `structuredContent`, including arrays, scalars
23
+ and `null`. Tools without an output contract advertise and return no structured
24
+ payload.
25
+
26
+ | Export | Kind | Summary |
27
+ |--------|------|---------|
28
+ | `createMcpHandler` | function | a stateless dual-era Streamable-HTTP MCP handler — [guide](../guide/mcp-and-agents.md#mcp--createmcphandler) |
29
+ | `createMcpHttpRoute` | function | framework-owned `RawRoute` adapter for an MCP HTTP handler |
30
+ | `createStdioMcpServer` | function | a complete stdio MCP server — [guide](../guide/mcp-and-agents.md#mcp-over-stdio--createstdiomcpserver) |
31
+ | `bindStdioProcessSignals` | function | explicitly bind OS signals to one close-only stdio handle — [guide](../guide/testing-and-deployment.md#stdio-process-signals) |
32
+ | `buildMcpServer` | function | build an `McpServer` from contract/runtime surfaces; no-auth configs omit the second argument |
33
+ | `mountMcp` | function | add contract tools to an existing `McpServer` — [guide](../guide/mcp-and-agents.md#mountmcp) |
34
+ | `mountAgent` | function | a Vercel AI SDK `ToolSet` from a service; failed executions reject through the SDK tool-error channel with a safe typed envelope, while successful output is never classified by field name — [guide](../guide/mcp-and-agents.md#ai-agents--mountagent) |
35
+ | `defineRuntimeTool` | function | define one validated pathless operation for explicit MCP, Agent and/or CLI surfaces — [guide](../guide/mcp-and-agents.md#pathless-runtime-tools-and-multimodal-results) |
36
+ | `createRuntimeToolFactory` | function | bind shared identity and Zod-validated per-call context for runtime tools — [guide](../guide/mcp-and-agents.md#pathless-runtime-tools-and-multimodal-results) |
37
+ | `createToolInvoker` | function | compile an exposure-aware in-process dispatcher over the canonical tool runner; use peer-free `stitchkit/tools/invoker`, or the full `stitchkit/tools` adapter barrel — [guide](../guide/mcp-and-agents.md#in-process-calls--createtoolinvoker) |
38
+ | `createToolkit` | function | context-typed tool mounts — [guide](../guide/cli.md#typed-context) |
39
+ | `mountViewFile` | function | a native multimodal "view file" MCP tool |
40
+ | `resolveMedia` | function | resolve a media reference for a tool result |
41
+ | `validateMcpSchemas` | function | object-shaped assertion over the exact advertised schema surface — compatibility, typed properties and portable formats ([guide](../guide/mcp-and-agents.md#mcp-schema-validation-profile)) |
42
+ | `listToolNames` | function | every contract/runtime tool name with origin, identity and transports — for stable snapshots — [guide](../guide/mcp-and-agents.md#pinning-tool-names--listtoolnames) |
43
+ | `listContractToolNames` | function | the same listing straight from contracts — no handlers or stub services needed |
44
+ | `describeToolCatalog` | function | inspect the exact model-facing names, source identities, schema byte sizes and deferred state; an explicit total byte budget fails closed |
45
+ | `ToolCatalogConfig` / `ToolCatalogEntry` | _type_ | catalog source, transport, optional explicit schema budget and one inspectable result row |
46
+ | `McpHandlerConfig` | _type_ | server surface plus stateless HTTP transport config |
47
+ | `McpHttpConfig` | _type_ | HTTP auth, protected-resource, legacy-era and security options |
48
+ | `McpHttpHandler` | _type_ | framework-owned `{ fetch(request), close() }` lifecycle |
49
+ | `McpHttpSecurityConfig` | _type_ | Fetch-boundary Host and Origin allowlists |
50
+ | `McpLegacyPolicy` | _type_ | `'serve' \| 'reject'` protocol-era compatibility policy |
51
+ | `McpStdioHandle` | _type_ | closeable official stdio transport handle |
52
+ | `StdioMcpServerConfig` | _type_ | config for `createStdioMcpServer` |
53
+ | `StdioCloseTarget` | _type_ | minimal close-only target accepted by `bindStdioProcessSignals` |
54
+ | `StdioProcessSignalsOptions` | _type_ | signal source, close callbacks and phased error reporting |
55
+ | `StdioProcessSignalsBinding` | _type_ | close-only signal binding with observed `promise` and listener `close()` |
56
+ | `StdioProcessSignalsErrorPhase` | _type_ | `'prepare' \| 'close' \| 'complete'` reporting phase |
57
+ | `McpServerBuildConfig` | _type_ | shared config for `buildMcpServer` |
58
+ | `McpServerSharedConfig` | _type_ | transport-neutral options shared by direct and finite surface configs |
59
+ | `McpServer` | _type_ | official split-SDK server instance accepted by raw extension points |
60
+ | `DirectMcpSurfaceConfig` | _type_ | static or identity-dynamic `services` / `runtimeTools` source |
61
+ | `FiniteMcpSurfaceConfig` | _type_ | bounded `surfaces` registry plus typed selector |
62
+ | `McpSurfaceDefinition` | _type_ | one immutable `{ services, runtimeTools }` MCP surface |
63
+ | `McpSurfaceRegistry` | _type_ | finite keyed surface registry for eager preparation |
64
+ | `StdioAuthConfig` | _type_ | startup identity composed into `StdioMcpServerConfig` |
65
+ | `McpMountConfig` | _type_ | config for `mountMcp` |
66
+ | `McpSchemaValidationConfig` | _type_ | shared `{ policy, requireTypedProperties, allowUntyped, requirePortableFormats, allowFormats }` profile |
67
+ | `ValidateMcpSchemasConfig` | _type_ | standalone validation profile plus `services`, `extend`, flattening and logger |
68
+ | `RuntimeToolDefinition` | _type_ | transport-neutral pathless operation with identity, schemas, handler and optional presenters |
69
+ | `RuntimeToolDefinitionBase` | _type_ | common name, identity, input, exposure and MCP metadata fields |
70
+ | `RuntimeToolDefinitionWithOutput` | _type_ | runtime definition whose handler and presenters share a validated output type |
71
+ | `RuntimeToolDefinitionWithoutOutput` | _type_ | runtime definition with a void handler and no presentation callbacks |
72
+ | `RuntimeToolFactory` | _type_ | identity/context-bound runtime-tool definition factory |
73
+ | `RuntimeToolFactoryConfig` | _type_ | factory service identity and context schema |
74
+ | `RuntimeToolFactoryDefinitionWithOutput` | _type_ | factory-authored runtime tool with a validated output schema |
75
+ | `RuntimeToolFactoryDefinitionWithoutOutput` | _type_ | factory-authored void runtime tool without presenters |
76
+ | `RuntimeToolFactoryHandlerContext` | _type_ | parsed factory context plus parsed tool input |
77
+ | `RuntimeToolFactoryIdentityFields` | _type_ | per-tool action, semantic method and optional identity metadata |
78
+ | `RuntimeToolIdentity` | _type_ | `{ serviceName, action, scope?, method, meta? }` for runtime lifecycle/audit |
79
+ | `RuntimeToolHandlerContext` | _type_ | runtime context with the definition's parsed input |
80
+ | `RuntimeToolOutput` | _type_ | output inferred from a runtime tool's optional Zod schema |
81
+ | `RuntimeToolPresenters` | _type_ | optional MCP and AI SDK `toModelOutput` presentation callbacks |
82
+ | `RuntimeMcpPresentation` | _type_ | MCP content/metadata result without framework-owned `structuredContent` or `isError` |
83
+ | `RuntimeMcpInput` | _type_ | typed accepted multi-round input for an opted-in runtime tool |
84
+ | `OAuthClientRegistrationConfig` | _type_ | deterministic pre-registered → CIMD → explicit-DCR client resolution |
85
+ | `CimdClientMetadata` | _type_ | validated Client ID Metadata Document |
86
+ | `CimdClientMetadataFetcher` | _type_ | injectable secure network boundary for metadata loading |
87
+ | `CimdFetchResponse` | _type_ | bounded metadata fetch result passed across the injectable network boundary |
88
+ | `CimdFetchPolicy` | _type_ | CIMD timeout, redirect and size limits |
89
+ | `CimdCachePolicy` | _type_ | bounded HTTP-aware cache policy: separate positive/negative pools (`maxEntries`), per-client and server-wide resolution rate limits (`maxResolutionsPerClient` / `maxResolutions` per `resolutionWindowMs`) |
90
+ | `CimdCacheEvent` | _type_ | observable CIMD cache hit, miss, revalidation and eviction event |
91
+ | `createSecureClientMetadataFetcher` | function | production HTTPS, DNS/IP-pinned CIMD fetcher |
92
+ | `RuntimeAgentModelOutput` | _type_ | AI SDK model-facing text/JSON/content output returned by `present.agent` |
93
+ | `AgentMountConfig` | _type_ | config for `mountAgent` |
94
+ | `AgentToolRegistry` / `AgentToolRegistryBuilder` / `AgentToolRegistryInput` | _type_ | the composed runtime surface and its builder: declared defaults, `replace`/`disable` by name, and the exact `{ tools, names }` a mount receives |
95
+ | `defineToolRegistry` | function | compose runtime tools over one declared default set; an unknown `replace`/`disable` name is refused instead of silently leaving the default in place |
96
+ | `AgentContext` | _type_ | the context merged into agent tool handlers |
97
+ | `Toolkit` | _type_ | the context-pinned tool surface from `createToolkit` |
98
+ | `ToolExtend` | _type_ | extra-args extension for `mountMcp` / `mountAgent` |
99
+ | `ToolLifecycle` | _type_ | `beforeHandle` / `afterHandle` gate for tool calls — [guide](../guide/mcp-and-agents.md#guarding-tools--lifecycle) |
100
+ | `ToolExecutionControlReason` | _type_ | internal managed-execution stop reason: stale run or requested interruption |
101
+ | `ToolExecutionControlError` | class | control-flow error used to unwind a superseded managed tool call without presenting it as a model-facing tool failure |
102
+ | `isToolExecutionControlError` | function | narrow an unknown thrown value to the managed execution control error |
103
+ | `ToolOperation` | _type_ | executable path-free operation shape shared by contract and framework-native runners |
104
+ | `ToolCallHooks` | _type_ | object-shaped `beforeToolCall` / `afterToolCall` / `onToolError` observability hooks; the raw thrown value reaches the last two as `error` ([guide](../guide/observability.md#the-cause-behind-a-failed-tool-call)) |
105
+ | `BeforeToolCallOptions` | _type_ | `{ toolName, args, context, endpoint }` passed before execution |
106
+ | `AfterToolCallOptions` | _type_ | completed call options plus `{ result, durationMs, error? }` |
107
+ | `ToolErrorOptions` | _type_ | `{ toolName, error, context, endpoint }` for a thrown handler-path value |
108
+ | `ErrorHintFn` | _type_ | `(toolName, errorCode) => string \| null` — a per-tool recovery hint, shared by every mount |
109
+ | `ToolResult` | _type_ | the result of one tool call |
110
+ | `ToolInvoker` | _type_ | immutable compiled dispatcher (`names`, envelope `invoke`, throwing `invokeOrThrow`) |
111
+ | `ToolInvokerConfig` | _type_ | compile-time exposure, extension and presentation options |
112
+ | `ToolInvocationOptions` | _type_ | per-call source, context, lifecycle, hooks and output-strip reporter |
113
+ | `ToolCallContext` | _type_ | the context every tool hook receives — `{ source, mcp? }` plus whatever the mount's `context` added |
114
+ | `ViewFileOptions` | _type_ | shared URL/managed-file-boundary policy for `defineViewFileTool`, `mountViewFile` and `resolveMedia` |
115
+ | `ViewFileOutput` | _type_ | neutral managed batch result with multimodal `content` and per-item `errors` |
116
+ | `ViewFileInputSchema` | constant | fixed one-or-many media path/URL input schema |
117
+ | `ViewFileOutputSchema` | constant | Zod schema for the neutral managed view-file batch result |
118
+ | `ViewFileErrorSchema` | constant | Zod schema for one structured per-item view failure |
119
+ | `McpAnnotations` | _type_ | MCP annotations on a media result |
120
+ | `McpAnnotationsSchema` | constant | Zod schema for MCP media annotations |
121
+ | `McpMediaContentSchema` | constant | Zod schema for text/image/audio media content |
122
+ | `CollectToolsConfig` | _type_ | options for `collectTools` |
123
+ | `findUntypedProperties` | function | every property in a JSON Schema with no `type`/`enum`/`$ref` — what a model is shown and cannot obey ([guide](../guide/mcp-and-agents.md)) |
124
+ | `UntypedProperty` | _type_ | one such property — `{ path, description? }` |
125
+ | `findNonPortableFormats` | function | deep finder for formats outside the portable MCP/AJV baseline |
126
+ | `NonPortableFormat` | _type_ | one `{ path, format }` portability finding |
127
+ | `PORTABLE_JSON_SCHEMA_FORMATS` | constant | portable-format baseline used by MCP validation |
128
+ | `ToolNameEntry` | _type_ | one `listToolNames` row — `{ kind, name, service, method, transports }` |
129
+ | `IncompatibleSchemaPolicy` | _type_ | `'throw' \| 'skip' \| 'warn'` |
130
+ | `McpMediaContent` | _type_ | a multimodal MCP content item |
131
+
132
+ ### Native tools
133
+
134
+ Generic host-supplied operations — managed definitions for the canonical
135
+ runtime-tool runner, plus deliberate raw MCP adapters over the same mechanics.
136
+
137
+ | Export | Kind | Summary |
138
+ |--------|------|---------|
139
+ | `defineDownloadTool` | function | define a guarded, size-capped managed download for MCP/Agent `runtimeTools` |
140
+ | `defineUploadTool` | function | define a typed managed local-file upload for MCP/Agent `runtimeTools` |
141
+ | `defineWaitTool` | function | define a typed, cancellable managed polling operation for MCP/Agent `runtimeTools` |
142
+ | `defineViewFileTool` | function | define a guarded, batch-capped managed multimodal operation for MCP/Agent `runtimeTools` |
143
+ | `DefineDownloadToolConfig` | _type_ | Zod input, stable identity, URL resolver, storage policy and presenters for `defineDownloadTool` |
144
+ | `DefineUploadToolConfig` | _type_ | stable identity, typed output, upload callback and presenters for `defineUploadTool` |
145
+ | `DefineWaitToolConfig` | _type_ | Zod input/state, identity, poll/done/timeout policy and presenters for `defineWaitTool` |
146
+ | `DefineViewFileToolConfig` | _type_ | identity, media security policy and optional presenters for `defineViewFileTool` |
147
+ | `ManagedNativeToolConfig` | _type_ | shared name, description, identity, exposure and annotations for managed native factories |
148
+ | `NativeToolIdentity` | _type_ | pathless service/action/scope/meta identity; semantic method is factory-owned |
149
+ | `ManagedWaitRender` | _type_ | optional managed wait terminal text and failure classification |
150
+ | `UploadToolInputSchema` | constant | fixed `{ path: string }` input schema for `defineUploadTool` |
151
+ | `defineAsyncOperation` | function | runtime-only start/status/wait plus configured cancel/result/artifacts definitions; see the [durable application-owned recipe](../guide/mcp-and-agents.md#durable-application-owned-execution) |
152
+ | `defineAsyncOperationContract` | function | define one canonical Zod-first HTTP contract for start/status/wait plus optional capabilities; execution and recovery remain application-owned |
153
+ | `bindContractAsyncOperation` | function | bind literal methods from an existing contract without creating another HTTP surface |
154
+ | `createAsyncOperationSnapshotSchema` | function | canonical pending/running/succeeded/failed/cancelled Zod snapshot |
155
+ | `AsyncOperationSnapshotSchema` | _type_ | the snapshot union `createAsyncOperationSnapshotSchema` returns when no `progress` schema is configured |
156
+ | `AsyncOperationSnapshotSchemaWithProgress` | _type_ | the same union with the configured `progress` schema optional on every phase |
157
+ | `AsyncOperationCancelResultSchema` | constant | validated accepted/already_terminal/rejected cancellation result |
158
+ | `AsyncOperationCancelResult` | _type_ | validated cancel capability result |
159
+ | `AsyncOperationCancelCapability` | _type_ | optional typed domain cancellation callback |
160
+ | `AsyncOperationCapability` | _type_ | generated capability-name union |
161
+ | `AsyncOperationStartDefinition` / `AsyncOperationFollowDefinition` | _type_ | generated runtime definition types |
162
+ | `AsyncOperationIdentity` | _type_ | shared service/action/scope/meta identity for an operation |
163
+ | `AsyncOperationOutputCapability` | _type_ | optional result/artifact schema plus handler |
164
+ | `RuntimeAsyncOperationConfig` | _type_ | runtime-only descriptor configuration |
165
+ | `RuntimeAsyncOperation` | _type_ | inferred generated definitions and schemas |
166
+ | `AsyncOperationContractConfig` | _type_ | canonical contract config where start returns the operation id; optional `expose` names the transports per capability, because this contract is built inside the framework and never passes through a consumer's `toolExposure: 'explicit'` factory |
167
+ | `AsyncOperationContractWithStartOutputConfig` | _type_ | canonical contract config with an application start envelope and typed id extractor |
168
+ | `DefinedAsyncOperationContract` | _type_ | generated contract, capability keys, schemas and parsed adapters |
169
+ | `ContractAsyncOperationConfig` | _type_ | literal contract method binding and handlers |
170
+ | `AdaptedContractAsyncOperationConfig` | _type_ | existing-contract binding with explicit id and per-capability input adapters |
171
+ | `BoundAdaptedContractAsyncOperation` | _type_ | inferred adapted binding with parsed id/input projectors |
172
+ | `AdaptedContractAsyncOperationStartKey` | _type_ | existing-contract keys with a declared start output |
173
+ | `AdaptedContractAsyncOperationFollowKey` | _type_ | existing-contract keys with both input and output schemas |
174
+ | `AdaptedContractAsyncOperationWaitKey` | _type_ | adapted follow-up keys whose output matches the selected status snapshot |
175
+ | `ContractAsyncOperationInputAdapters` | _type_ | guaranteed direct-binding status/wait input adapters plus configured optional capabilities |
176
+ | `ContractAsyncOperationKeys` | _type_ | literal method-key union of a bound contract |
177
+ | `ContractAsyncOperationStartKey` | _type_ | direct-binding start keys whose declared ID schema has stable input/output |
178
+ | `ContractAsyncOperationFollowKey` | _type_ | contract keys whose input schema type matches the selected start output |
179
+ | `ContractAsyncOperationWaitKey` | _type_ | follow-up keys whose output schema type also matches the selected status output |
180
+ | `composeToolLifecycle` | function | ordered composition of tool before/after phases |
181
+ | `mountDownload` | function | raw MCP "download a URL to disk" adapter (SSRF-guarded, size-capped) |
182
+ | `mountUpload` | function | raw MCP "upload a local file" adapter |
183
+ | `mountWait` | function | raw MCP generic `--wait`-style polling adapter |
184
+ | `DownloadToolConfig` | _type_ | config for `mountDownload` |
185
+ | `UploadToolConfig` | _type_ | config for `mountUpload` |
186
+ | `WaitToolConfig` | _type_ | config for `mountWait` |
187
+
188
+ ### OAuth 2.1 provider
189
+
190
+ A native remote-connector auth surface for MCP — [guide](../guide/mcp-and-agents.md#oauth-21--a-native-remote-connector).
191
+
192
+ | Export | Kind | Summary |
193
+ |--------|------|---------|
194
+ | `mountOAuthProvider` | function | the OAuth 2.1 provider routes (DCR, PKCE, token) |
195
+ | `oauthProtectedResourceRoute` | function | the RFC 9728 protected-resource-metadata route |
196
+ | `protectedResourceMetadataUrl` | function | build the metadata URL for a resource |
197
+ | `wwwAuthenticateHeader` | function | build the `WWW-Authenticate` challenge header |
198
+ | `PROTECTED_RESOURCE_PATH` | const | the well-known metadata path |
199
+ | `OAuthProviderConfig` | _type_ | config for `mountOAuthProvider` |
200
+ | `ProtectedResourceConfig` | _type_ | config for `oauthProtectedResourceRoute` |
201
+ | `ApplicationType` | _type_ | DCR `application_type` — `'native'` (loopback allowed) \| `'web'` (https only) |
202
+ | `AuthCodeData` | _type_ | a stored authorization-code record |
203
+ | `AuthRequest` | _type_ | a parsed authorization request |
204
+ | `ClientMetadata` | _type_ | dynamic-client-registration metadata |
205
+ | `RefreshData` | _type_ | a stored refresh-token record |
206
+ | `RegisteredClient` | _type_ | a registered OAuth client |
207
+
208
+ ### Durable tool bodies
209
+
210
+ A mounted tool body can be made restartable without adopting `agent-runtime`: declare a
211
+ factory and `step` / `sleep` / `waitFor` appear in the handler context, backed by whatever
212
+ ledger the application already has.
213
+
214
+ ```ts
215
+ mountAgent(services, { durability: (toolCallId) => myLedgerFor(toolCallId) });
216
+ ```
217
+
218
+ | Export | Kind | Summary |
219
+ |--------|------|---------|
220
+ | `ToolDurability` | _type_ | the port a tool body needs: `step`, `sleep`, `waitFor` |
221
+ | `ToolDurabilityFactory` | _type_ | `(toolCallId, signal) => ToolDurability`, called once per call |
222
+ | `DurableJsonValue` | _type_ | what a durable step result may hold — a record is read back in another process, so it must be JSON |
223
+ | `createLocalStepDurability` | function | the durability engine — replay, absolute deadlines, park/deliver — over a two-method ledger the application owns |
224
+ | `StepDurabilityLedger` | _type_ | the two methods an engine needs: `appendEvent`, `readEvents` |
225
+ | `LocalStepDurability` | _type_ | what the engine returns; satisfies `ToolDurability` and adds `deliver`, `effect` and record introspection for the ledger's owner |
226
+ | `EffectHandlers` / `EffectOutcome` / `EffectRunOptions` | _type_ | `effect(name, { run, reconcile }, { signal, reconcileTimeoutMs })`: the intent is recorded before `run`, an intent without an outcome is settled by `reconcile` and never run again; `accepted` with the proof or a recorded, final `uncertain` → ADR 0200 |
227
+ | `EffectUnresolvedError` | class | an effect whose outcome this call could not settle — `run` or `reconcile` threw, `reconcile` overran, the proof was not recordable; the intent stands and the next call reconciles |
228
+ | `LocalStepDurabilityOptions` | _type_ | `{ store, conversationId, runId, signal?, subscribe?, clock? }` |
229
+ | `AppendAgentStoreEvent` / `ReadAgentStoreEvents` / `AgentStoreEventEnvelope` / `AgentStoreEventPage` | _type_ | the ledger's row shapes, re-exported so a ledger is typed from the entrypoint that consumes it |
230
+ | `AgentToolError` | class | the model-safe envelope a failed agent tool throws |
231
+ | `isAgentToolError` | function | brand check for it — a consumer running its own loop no longer parses the message |
232
+
233
+ ### Catalog stamp
234
+
235
+ Every advertised tool and every tool result carries the fingerprint of the catalog it came
236
+ from, so a long-lived consumer can see that its own copy is stale **without making a
237
+ request for it**. `createMcpHandler` is stateless by construction and therefore has no
238
+ retained session to push `notifications/tools/list_changed` down; the stamp needs none.
239
+
240
+ Store the stamp beside the tools when you list them, compare it against the one on every
241
+ result, and re-list when they differ — including on a refusal, which is exactly when a
242
+ stale catalog is the likeliest explanation and the least visible one. The server side
243
+ needs no wiring: every mount stamps what it advertises.
244
+
245
+ | Export | Kind | Summary |
246
+ |--------|------|---------|
247
+ | `readMcpCatalogStamp` | function | read a peer's stamp out of `_meta`, or `null` when there is none |
248
+ | `mcpCatalogMeta` | function | the `_meta` fragment a stamped tool or result carries |
249
+ | `MCP_CATALOG_META_KEY` | const | the namespaced `_meta` key (`stitchkit/catalog`) |
250
+ | `McpCatalogStamp` | _type_ | `{ digest, tools }` — the catalog fingerprint and its tool count |
251
+
252
+ ### MCP Apps (widgets)
253
+
254
+ Interactive MCP resources — [ADR 0019](../decisions/0019-generic-native-tools.md).
255
+
256
+ | Export | Kind | Summary |
257
+ |--------|------|---------|
258
+ | `mountMcpResource` | function | mount an MCP Apps widget resource |
259
+ | `inlineMcpAppBundle` | function | inline a built widget bundle into a resource |
260
+ | `EXT_APPS_BUNDLE_PLACEHOLDER` | const | the placeholder token `inlineMcpAppBundle` replaces |
261
+ | `RESOURCE_MIME_TYPE` | const | the MCP Apps resource MIME type |
262
+ | `McpResourceDef` | _type_ | an MCP Apps resource definition |
263
+ | `McpAppResourceMeta` | _type_ | resource `_meta` for an MCP App |
264
+ | `McpAppCsp` | _type_ | the widget content-security policy |
265
+
266
+ ### Introspection & internals
267
+
268
+ Advanced building blocks — the shared machinery the mounts are built on.
269
+
270
+ | Export | Kind | Summary |
271
+ |--------|------|---------|
272
+ | `collectTools` | function | resolve a service's methods to mountable tools (the shared resolver) |
273
+ | `createToolLogger` | function | a ready `afterToolCall` that logs every tool call — [guide](../guide/mcp-and-agents.md#logging-tool-calls--createtoollogger) |
274
+ | `summarizeTransports` | function | mixed contract/runtime operation counts and per-source breakdown for a boot-time summary |
275
+ | `buildToolManifest` | function | transport-aware searchable `{ name, description, inputSchema }` rows from a mixed surface |
276
+ | `ToolLoggerConfig` | _type_ | config for `createToolLogger` |
277
+ | `ToolCallRecord` | _type_ | the structured record `createToolLogger` passes to `onRecord` |
278
+ | `TransportSummary` | _type_ | `{ contractServices, runtimeTools, totals, sources }` from `summarizeTransports` |
279
+ | `TransportCounts` | _type_ | per-transport counts (`{ HTTP, MCP, AGENT, CLI }`) |
280
+ | `ToolSurfaceDefinition` | _type_ | shared object-shaped `{ services?, runtimeTools? }` introspection surface |
281
+ | `ToolManifestConfig` | _type_ | mixed surface plus required model-facing `transport` and presentation options |
282
+ | `coerceJsonArgs` | function | coerce JSON-stringified array/object tool arguments |
283
+ | `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins; divergent fields retain every provable base kind in a deterministic `type` array, and the projection never executes validation |
284
+ | `ToolPresentationSchema` | _type_ | immutable model-facing JSON Schema document shared by tool transports |
285
+ | `MountableTool` | _type_ | one operation with separate executable CLI argument schema and model-facing presentation schema |
286
+ | `ToolManifestEntry` | _type_ | one `buildToolManifest` row |
287
+
288
+ ---
package/llms/tools.txt CHANGED
@@ -1,4 +1,4 @@
1
- # stitchkit/tools — stitchkit docs slice, part 1 of 2
1
+ # stitchkit/tools — stitchkit docs slice, part 1 of 3
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
@@ -6,7 +6,8 @@
6
6
 
7
7
  Parts of this slice:
8
8
  - `llms/tools.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
9
- - `llms/tools.2.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md) · API reference: `stitchkit/tools` (docs/api/reference.md)
9
+ - `llms/tools.2.txt`: Guide: MCP & agents (docs/guide/mcp-and-agents.md)
10
+ - `llms/tools.3.txt`: API reference: `stitchkit/tools` (docs/api/reference.md)
10
11
 
11
12
  ==============================================================================
12
13
  # Guide: MCP & agents (docs/guide/mcp-and-agents.md)
@@ -406,6 +407,30 @@ enters the `stitchkit/tools` graph. An application that *does* run on
406
407
  `agent-runtime` gets durability through the run context and needs no option;
407
408
  where both exist the runtime's wins, because the run is recorded in its ledger.
408
409
 
410
+ #### An effect in another system — `effect`, at most once
411
+
412
+ `step` records its result **after** the body, so a body cut short by a crash
413
+ runs again. For sending a message or starting a turn at a provider, a repeat is
414
+ worse than a loss. The engine's `effect` records the intent **before** it runs:
415
+
416
+ ```ts
417
+ const sent = await engine.effect('reply', {
418
+ run: () => chat.send({ clientId, text }), // → { messageId }
419
+ reconcile: (signal) => chat.findByClientId(clientId, { signal }), // → { messageId } | null
420
+ })
421
+ if (sent.outcome === 'uncertain') reportPossiblyLost(clientId)
422
+ ```
423
+
424
+ A later call — the same process or a restarted one — that finds the intent with
425
+ no outcome calls `reconcile`, never `run`. Found is `accepted` with the proof;
426
+ not found is `uncertain`. Both are recorded and final: `run` is never called for
427
+ that name again, and `uncertain` is not asked again — it is the honest third
428
+ answer, and retrying it is the caller's decision under a new name. A `run` that
429
+ throws, or a `reconcile` that throws or overruns `reconcileTimeoutMs` (default
430
+ 30 s), rejects with `EffectUnresolvedError` and leaves the intent for the next
431
+ call. The proof is JSON of at most 64 KiB — the identity the recipient assigned,
432
+ not a payload. → [ADR 0200](../decisions/0200-an-effect-is-recorded-before-it-runs.md)
433
+
409
434
  ### Typed MCP call metadata
410
435
 
411
436
  Contract handlers, runtime-tool handlers/factories, lifecycle and tool hooks all
@@ -939,66 +964,3 @@ official SDK.
939
964
  A tool without an output contract advertises no `outputSchema` and returns no
940
965
  invented structured value. Its successful MCP result has an empty `content`
941
966
  list.
942
-
943
- ## A different answer for tools — `withToolView`
944
-
945
- An admin page wants the full record; a model wants a card. Every byte of a
946
- tool result enters the model's context and stays in its history, and personal
947
- fields a task does not need are better never shown to it. Two endpoints on one
948
- path (one `expose: ['HTTP']`, one for the tools) duplicate the description, the
949
- schemas and the handler; branching on `ctx.source` teaches every handler about
950
- transports and still advertises the full output schema.
951
-
952
- A **tool view** declares the difference on the endpoint instead:
953
-
954
- ```ts
955
- import { defineContract, withToolView } from 'stitchkit';
956
-
957
- export const users = defineContract({ prefix: 'users' }, {
958
- list: withToolView(
959
- {
960
- method: 'GET', path: '/', desc: 'List users', tool: { name: 'user_list' },
961
- input: UserListQuery, // include: z.array(...).default(['profile', 'stats'])
962
- output: UserListResponse, // HTTP, OpenAPI and the typed client — unchanged
963
- },
964
- {
965
- defaults: { include: [] }, // what a tool call gets when it passes nothing
966
- output: UserCardList, // the tool answer and its schema
967
- project: (full, { input }) => ({ items: full.items.map(toCard) }), // optional: without it, `output` slices
968
- },
969
- ),
970
- });
971
- ```
972
-
973
- - **One handler, one parser.** `defaults` joins the tool call's arguments
974
- *before* the endpoint's own `input` parses them, so the handler receives an
975
- ordinary `input` — `include: []` from a tool, the HTTP default from HTTP — and
976
- loads only what was asked for. An explicit argument wins over the default.
977
- - **The answer is derived, then checked.** The handler's result is validated
978
- against the full `output` first, as always; then `project` (a pure,
979
- synchronous function of the full result and the parsed input) or a slice by
980
- the view's `output`, then validation against the view's schema. A projection
981
- that throws, returns a Promise or breaks its schema is `INTERNAL_SERVER_ERROR`
982
- — a server fault, like any output mismatch.
983
- - **Where it applies.** The MCP, agent and CLI mounts answer with the view;
984
- `outputSchema`, `structuredContent`, the advertised input `default`, the
985
- catalog stamp and the surface snapshot follow it. HTTP, OpenAPI, the typed
986
- client and the in-process [`createToolInvoker`](#in-process-calls--createtoolinvoker)
987
- keep the full answer — code, not a model, is calling there.
988
- - **Three forms, one helper.** With `output` and `project` the answer has its
989
- own schema. With `project` alone it reshapes values inside the full schema.
990
- With `output` alone it is a slice, and the full result must fit that schema —
991
- `withToolView` refuses the endpoint at compile time when it does not.
992
- - **Exposure.** A view needs a tool transport. With `createContractFactory({
993
- toolExposure: 'explicit' })` an endpoint without `expose` is HTTP-only, so an
994
- endpoint with a view names its tool transports in `expose`.
995
- - **What it refuses.** `defineContract` rejects a view on an endpoint with no
996
- tool transport or no full `output`, on a raw, `rawBody`, multipart,
997
- `responseMeta` or streaming endpoint, a view that declares neither `output`
998
- nor `project`, and a default for a key the input does not have, for a path
999
- param, or with a value the input would reject.
1000
-
1001
- A projection adds nothing the full result does not carry: a field the tool
1002
- answer needs belongs in the full answer, loaded by the handler. Keys a
1003
- projection returns beyond its schema are reported by `onOutputStrip`; a slice
1004
- removes keys on purpose and is not reported. → [ADR 0196](../decisions/0196-a-tool-answer-is-a-declared-view.md)
@@ -1,14 +1,36 @@
1
- # Upgrading 0.37.0 → 0.50.0 — stitchkit docs slice
1
+ # Upgrading 0.37.0 → 0.53.0 — stitchkit docs slice
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
5
5
 
6
- Contains: Guide: Upgrading, 0.37.0 → 0.50.0 (docs/guide/upgrading.md)
6
+ Contains: Guide: Upgrading, 0.37.0 → 0.53.0 (docs/guide/upgrading.md)
7
7
 
8
8
  ==============================================================================
9
- # Guide: Upgrading, 0.37.0 → 0.50.0 (docs/guide/upgrading.md)
9
+ # Guide: Upgrading, 0.37.0 → 0.53.0 (docs/guide/upgrading.md)
10
10
  ==============================================================================
11
11
 
12
+ ## Released migration: 0.53.0
13
+
14
+ ### Realtime `emit` returns `boolean` instead of `void`
15
+
16
+ Every **call site** compiles and behaves exactly as before — the return value
17
+ is new information (`true` = accepted by the transport, `false` = dropped
18
+ while the browser client was disconnected), not a behavior change. What breaks
19
+ is **implementing** the interfaces: a test mock or app-side adapter of
20
+ `SocketIOClient` / `RealtimeClient` / `ValidatedRealtimeSocket` /
21
+ `RealtimeServer` whose `emit` returns `void` no longer typechecks.
22
+
23
+ ```ts
24
+ // before — a void mock satisfied the interface
25
+ const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => {} }
26
+ // after — report acceptance (true is what a live server-side emit reports)
27
+ const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => true }
28
+ ```
29
+
30
+ While migrating, consider replacing hand-rolled `if (client.connected)` guards
31
+ with the new honest surface: check `client.emit(...) === false`, or observe
32
+ drops centrally with `onDroppedEmit`.
33
+
12
34
  ## Released migration: 0.50.0
13
35
 
14
36
  ### The factory's scope union now covers per-endpoint overrides
@@ -1,14 +1,64 @@
1
- # Upgrading 0.53.0 → 0.67.0 — stitchkit docs slice
1
+ # Upgrading 0.55.0 → 0.68.0 — stitchkit docs slice
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
5
5
 
6
- Contains: Guide: Upgrading, 0.53.0 → 0.67.0 (docs/guide/upgrading.md)
6
+ Contains: Guide: Upgrading, 0.55.0 → 0.68.0 (docs/guide/upgrading.md)
7
7
 
8
8
  ==============================================================================
9
- # Guide: Upgrading, 0.53.0 → 0.67.0 (docs/guide/upgrading.md)
9
+ # Guide: Upgrading, 0.55.0 → 0.68.0 (docs/guide/upgrading.md)
10
10
  ==============================================================================
11
11
 
12
+ ## Released migration: 0.68.0
13
+
14
+ ### Make Unix transport selection explicit outside Bun
15
+
16
+ The legacy `unix` option remains a Bun convenience, but on Node or another
17
+ runtime it now fails before dispatch. Replace it with the owned adapter and close
18
+ that adapter with the application:
19
+
20
+ ```ts
21
+ // before — unsafe outside Bun: an unsupported fetch could dial baseUrl over TCP
22
+ const http = createHttpClient({ baseUrl, unix: '/run/service.sock' })
23
+
24
+ // after — Bun and Node; every dispatch and redirect stays on the socket
25
+ import { createUnixClientTransport } from 'stitchkit/server' // or stitchkit/node
26
+ const transport = createUnixClientTransport({ socketPath: '/run/service.sock' })
27
+ const http = createHttpClient({ baseUrl, fetch: transport.fetch })
28
+ // during shutdown
29
+ await transport.close()
30
+ ```
31
+
32
+ Do not automatically replay `possibly-dispatched`: a timeout or connection loss
33
+ after bytes left the process does not prove that a write did not happen.
34
+
35
+ ### Choose tolerant stream parsing explicitly
36
+
37
+ `parseNDJSON` and `parseSSE` now throw on malformed JSON, invalid UTF-8 and an
38
+ over-limit line. The default line ceiling is 1 MiB. If a feed deliberately skips
39
+ bad records, retain that policy explicitly:
40
+
41
+ ```ts
42
+ // before — malformed input disappeared implicitly
43
+ parseNDJSON(response)
44
+
45
+ // after — ordinary fail-closed path
46
+ parseNDJSON(response, { maxLineBytes: 256 * 1024 })
47
+
48
+ // after — deliberately tolerant path
49
+ parseNDJSON(response, { onParseError: (raw, error) => report(raw, error) })
50
+ ```
51
+
52
+ ### Extend exhaustive framework-error handling
53
+
54
+ If a switch makes `StitchErrorCode` exhaustive, add
55
+ `STREAM_ITEM_INVALID`, `STREAM_FRAME_TOO_LARGE`,
56
+ `STREAM_TERMINAL_MISSING` and `STREAM_LIFETIME_EXCEEDED`. A partial application
57
+ status map needs no change (ADR 0105).
58
+
59
+ The admission/channel APIs and endpoint `stream` descriptor are additive; raw
60
+ responses and raw `streamingRoute` remain supported.
61
+
12
62
  ## Released migration: 0.67.0
13
63
 
14
64
  Three application-kernel changes. Two of them fix silent failures, so the most
@@ -1150,25 +1200,3 @@ Downloaded `path` is now relative to the boundary and MIME metadata is named
1150
1200
  same way. Auth predicates must explicitly return `true`, `false`, or a plain
1151
1201
  object of context fields; replace accidental `undefined` fallthroughs with the
1152
1202
  intended boolean.
1153
-
1154
- ## Released migration: 0.53.0
1155
-
1156
- ### Realtime `emit` returns `boolean` instead of `void`
1157
-
1158
- Every **call site** compiles and behaves exactly as before — the return value
1159
- is new information (`true` = accepted by the transport, `false` = dropped
1160
- while the browser client was disconnected), not a behavior change. What breaks
1161
- is **implementing** the interfaces: a test mock or app-side adapter of
1162
- `SocketIOClient` / `RealtimeClient` / `ValidatedRealtimeSocket` /
1163
- `RealtimeServer` whose `emit` returns `void` no longer typechecks.
1164
-
1165
- ```ts
1166
- // before — a void mock satisfied the interface
1167
- const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => {} }
1168
- // after — report acceptance (true is what a live server-side emit reports)
1169
- const mock: Pick<RealtimeClient<S, C>, 'emit'> = { emit: () => true }
1170
- ```
1171
-
1172
- While migrating, consider replacing hand-rolled `if (client.connected)` guards
1173
- with the new honest surface: check `client.emit(...) === false`, or observe
1174
- drops centrally with `onDroppedEmit`.