stitchkit 0.136.8 → 0.137.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 (342) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/agent-runtime/stores/branch-observations.d.ts +19 -19
  3. package/dist/agent-runtime/stores/schedule-contract.d.ts.map +1 -1
  4. package/dist/agent-runtime/stores/schedule-records.d.ts.map +1 -1
  5. package/dist/agent-runtime/stores/schedule-tools.d.ts.map +1 -1
  6. package/dist/agent-runtime/stores/sql-rows.d.ts +36 -36
  7. package/dist/agent-runtime/terminal-commit.d.ts +5 -5
  8. package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts +52 -52
  9. package/dist/agent-runtime/testing/store-conformance-support.d.ts +26 -26
  10. package/dist/browser/client-executors.d.ts +2 -3
  11. package/dist/browser/client-executors.d.ts.map +1 -1
  12. package/dist/browser/realtime-client.d.ts +6 -1
  13. package/dist/browser/realtime-client.d.ts.map +1 -1
  14. package/dist/browser/socket-io-client.d.ts.map +1 -1
  15. package/dist/browser/socket-io-contract.d.ts +2 -0
  16. package/dist/browser/socket-io-contract.d.ts.map +1 -1
  17. package/dist/contract/define-validation.d.ts +6 -0
  18. package/dist/contract/define-validation.d.ts.map +1 -1
  19. package/dist/contract/define.d.ts +1 -1
  20. package/dist/contract/define.d.ts.map +1 -1
  21. package/dist/contract/error-mapping.d.ts +71 -0
  22. package/dist/contract/error-mapping.d.ts.map +1 -0
  23. package/dist/contract/errors.d.ts +8 -0
  24. package/dist/contract/errors.d.ts.map +1 -1
  25. package/dist/contract/factory.d.ts +8 -0
  26. package/dist/contract/factory.d.ts.map +1 -1
  27. package/dist/contract/fragments.d.ts +45 -0
  28. package/dist/contract/fragments.d.ts.map +1 -0
  29. package/dist/contract/normalize.d.ts +6 -3
  30. package/dist/contract/normalize.d.ts.map +1 -1
  31. package/dist/contract/operation-read.d.ts +38 -0
  32. package/dist/contract/operation-read.d.ts.map +1 -0
  33. package/dist/contract/stream.d.ts.map +1 -1
  34. package/dist/contract/time-zone.d.ts +31 -0
  35. package/dist/contract/time-zone.d.ts.map +1 -0
  36. package/dist/contract/tool-options.d.ts +1 -1
  37. package/dist/contract/tool-options.d.ts.map +1 -1
  38. package/dist/device-relay/hub.d.ts +1 -1
  39. package/dist/device-relay/hub.d.ts.map +1 -1
  40. package/dist/entrypoints/agent-executor/acp.js +9 -9
  41. package/dist/entrypoints/agent-executor/claude-sdk.js +11 -11
  42. package/dist/entrypoints/agent-executor/claude.js +8 -8
  43. package/dist/entrypoints/agent-executor/codex.js +15 -15
  44. package/dist/entrypoints/agent-executor/testing.js +11 -11
  45. package/dist/entrypoints/agent-executor.js +14 -13
  46. package/dist/entrypoints/agent-runtime/ai-sdk.js +5 -5
  47. package/dist/entrypoints/agent-runtime/anthropic.js +1 -1
  48. package/dist/entrypoints/agent-runtime/browser.js +5 -5
  49. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  50. package/dist/entrypoints/agent-runtime/harness.js +14 -15
  51. package/dist/entrypoints/agent-runtime/openai.js +1 -1
  52. package/dist/entrypoints/agent-runtime/openrouter.js +7 -7
  53. package/dist/entrypoints/agent-runtime/postgres.js +5 -5
  54. package/dist/entrypoints/agent-runtime/realtime.js +8 -8
  55. package/dist/entrypoints/agent-runtime/sandbox.js +7 -7
  56. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  57. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  58. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  59. package/dist/entrypoints/agent-runtime.js +33 -29
  60. package/dist/entrypoints/application/diagnostic-journal.js +3 -3
  61. package/dist/entrypoints/application/directory-inbox.js +1 -1
  62. package/dist/entrypoints/application/grammy.js +1 -1
  63. package/dist/entrypoints/application/opentelemetry.js +2 -2
  64. package/dist/entrypoints/application.js +10 -10
  65. package/dist/entrypoints/cli/publish.js +8 -8
  66. package/dist/entrypoints/cli.d.ts +2 -0
  67. package/dist/entrypoints/cli.d.ts.map +1 -1
  68. package/dist/entrypoints/cli.js +518 -59
  69. package/dist/entrypoints/contract.d.ts +5 -1
  70. package/dist/entrypoints/contract.d.ts.map +1 -1
  71. package/dist/entrypoints/contract.js +25 -7
  72. package/dist/entrypoints/device-relay.js +20 -10
  73. package/dist/entrypoints/files/packaging.js +2 -2
  74. package/dist/entrypoints/files.js +10 -10
  75. package/dist/entrypoints/handler.d.ts +1 -1
  76. package/dist/entrypoints/handler.d.ts.map +1 -1
  77. package/dist/entrypoints/handler.js +12 -12
  78. package/dist/entrypoints/http.js +13 -12
  79. package/dist/entrypoints/index.js +36 -18
  80. package/dist/entrypoints/live.d.ts +2 -1
  81. package/dist/entrypoints/live.d.ts.map +1 -1
  82. package/dist/entrypoints/live.js +630 -1
  83. package/dist/entrypoints/node.d.ts +5 -0
  84. package/dist/entrypoints/node.d.ts.map +1 -1
  85. package/dist/entrypoints/node.js +36 -16
  86. package/dist/entrypoints/observability.js +25 -10
  87. package/dist/entrypoints/postgres.d.ts +1 -0
  88. package/dist/entrypoints/postgres.d.ts.map +1 -1
  89. package/dist/entrypoints/postgres.js +66 -0
  90. package/dist/entrypoints/primitives.js +11 -4
  91. package/dist/entrypoints/process.js +7 -7
  92. package/dist/entrypoints/react.js +1 -1
  93. package/dist/entrypoints/realtime.js +3 -3
  94. package/dist/entrypoints/remote.js +6 -29
  95. package/dist/entrypoints/server.d.ts +6 -1
  96. package/dist/entrypoints/server.d.ts.map +1 -1
  97. package/dist/entrypoints/server.js +93 -32
  98. package/dist/entrypoints/service-host/macos.js +6 -6
  99. package/dist/entrypoints/service-host/work.js +6 -6
  100. package/dist/entrypoints/service-host.js +10 -10
  101. package/dist/entrypoints/spend.js +2 -1
  102. package/dist/entrypoints/sync.js +5 -5
  103. package/dist/entrypoints/telegram.js +8 -8
  104. package/dist/entrypoints/testing.d.ts +1 -0
  105. package/dist/entrypoints/testing.d.ts.map +1 -1
  106. package/dist/entrypoints/testing.js +1501 -13
  107. package/dist/entrypoints/tools/agent.js +6 -7
  108. package/dist/entrypoints/tools/connections.js +9 -11
  109. package/dist/entrypoints/tools/contract.js +1 -2
  110. package/dist/entrypoints/tools/invoker.js +4 -5
  111. package/dist/entrypoints/tools/mcp.js +10 -11
  112. package/dist/entrypoints/tools/toolkit.d.ts +1 -1
  113. package/dist/entrypoints/tools/toolkit.d.ts.map +1 -1
  114. package/dist/entrypoints/tools/toolkit.js +29 -24
  115. package/dist/entrypoints/tools.js +28 -30
  116. package/dist/entrypoints/tracking/contract.js +2 -1
  117. package/dist/entrypoints/xlsx.js +5 -8
  118. package/dist/{index-033tyx59.js → index-0zw0hcyg.js} +4 -1
  119. package/dist/{index-zcq3dby3.js → index-1bjwfnnj.js} +1 -1
  120. package/dist/{index-3zt0r4y0.js → index-1cfacbe2.js} +4 -4
  121. package/dist/{index-gj4wdts6.js → index-1ckh9qx1.js} +1 -1
  122. package/dist/index-1pvwmbxp.js +1435 -0
  123. package/dist/{index-0s75mjh7.js → index-2e4hdh32.js} +1 -1
  124. package/dist/{index-3shdhzt6.js → index-2j0pqxkn.js} +12 -6
  125. package/dist/index-3k8w02se.js +28 -0
  126. package/dist/{index-7fjbdga8.js → index-3pb4ccj2.js} +8 -0
  127. package/dist/{index-w7e402wx.js → index-48kb4gqq.js} +46 -7
  128. package/dist/{index-cv9b7fz2.js → index-6rws2xf5.js} +8 -0
  129. package/dist/{index-bbpygynk.js → index-77w5vx0g.js} +1 -1
  130. package/dist/index-7dz1ngaf.js +35 -0
  131. package/dist/{index-y68gavb5.js → index-7n4atsm4.js} +1 -1
  132. package/dist/index-8ef1bfea.js +71 -0
  133. package/dist/{index-0x4mnwg5.js → index-8k3y9nd4.js} +6 -9
  134. package/dist/{index-ezwsqyad.js → index-8rkdkefj.js} +40 -23
  135. package/dist/{index-3cwq5byx.js → index-9nax7tkn.js} +2 -2
  136. package/dist/{index-dz6tstcp.js → index-9r6emjwz.js} +1 -1
  137. package/dist/{index-32ew02z1.js → index-c4b7d6ej.js} +5 -5
  138. package/dist/index-ceshyndf.js +284 -0
  139. package/dist/{index-w161azza.js → index-d13rw31w.js} +6 -6
  140. package/dist/{index-1h0dtfz3.js → index-dmm7vs3f.js} +1 -1
  141. package/dist/{index-ypm85xwe.js → index-dp8j2e77.js} +1 -1
  142. package/dist/{index-qqd979f7.js → index-edycjvrv.js} +9 -9
  143. package/dist/{index-18qdpbcq.js → index-egpf9dv0.js} +200 -1479
  144. package/dist/{index-fatke81t.js → index-ezgvsj9w.js} +2 -2
  145. package/dist/{index-chapre0y.js → index-f3e7tj1g.js} +1 -1
  146. package/dist/{index-df5xr2f9.js → index-frsd2a94.js} +16 -1
  147. package/dist/index-fy9mmek1.js +95 -0
  148. package/dist/{index-2331y2tf.js → index-g0gvfzrx.js} +12 -12
  149. package/dist/index-gpe8d1ka.js +19 -0
  150. package/dist/{index-4p2zx593.js → index-gyw4qd0m.js} +1 -1
  151. package/dist/index-gzqy81tw.js +172 -0
  152. package/dist/{index-yrhw10ef.js → index-h34c510q.js} +8 -4
  153. package/dist/{index-rr94xcj6.js → index-h527p1yj.js} +10 -4
  154. package/dist/{index-qj0sq69b.js → index-hgf1tbgz.js} +76 -16
  155. package/dist/{index-smvmnz5y.js → index-hvpan32x.js} +1 -1
  156. package/dist/{index-4gbybjg6.js → index-hxawqrb6.js} +2 -2
  157. package/dist/{index-0k1ba0ss.js → index-j91jffhv.js} +1 -1
  158. package/dist/{index-d01akj5n.js → index-jr4kwetx.js} +8 -8
  159. package/dist/{index-xqppqn97.js → index-ka6z48zc.js} +315 -69
  160. package/dist/{index-by8w2461.js → index-kw0segzt.js} +104 -3
  161. package/dist/{index-6f4fjygr.js → index-m5t4dr7h.js} +29 -7
  162. package/dist/{index-afaq0nc4.js → index-n0egp1ke.js} +1 -1
  163. package/dist/{index-9fzjgg86.js → index-n74rb1dq.js} +2 -2
  164. package/dist/{index-dwq6a6sq.js → index-pt25vmhc.js} +33 -16
  165. package/dist/{index-vwg0n3e6.js → index-pyazb8q4.js} +23 -14
  166. package/dist/{index-5md04mwc.js → index-qpjjbkc5.js} +4 -4
  167. package/dist/{index-08a3qfr8.js → index-r1qt6zgj.js} +1 -1
  168. package/dist/{index-ctaxjpa4.js → index-r709pqed.js} +1 -1
  169. package/dist/{index-2zrx0nzv.js → index-rzc40z6e.js} +3 -5
  170. package/dist/{index-gq35s3bm.js → index-s5axtd56.js} +2 -2
  171. package/dist/{index-edpkm3k7.js → index-scpcps66.js} +669 -16
  172. package/dist/{index-ry8m2mhg.js → index-sf2mt6wj.js} +1 -1
  173. package/dist/{index-tjhhsnjv.js → index-t1213r0t.js} +1 -1
  174. package/dist/{index-gvgtmt7a.js → index-t7efje30.js} +2 -2
  175. package/dist/{index-w3s79kcb.js → index-tzyk36dy.js} +1 -1
  176. package/dist/{index-8tn10tp6.js → index-v64bvwjr.js} +1 -1
  177. package/dist/{index-1fhbe4e4.js → index-vksbsqpb.js} +1 -1
  178. package/dist/{index-dxft2mnm.js → index-wdg7bswj.js} +1 -1
  179. package/dist/{index-ppy23bd2.js → index-wjx1zs2r.js} +7 -578
  180. package/dist/{index-efbzm2se.js → index-x2r0ma9t.js} +1 -1
  181. package/dist/{index-kd48gk7d.js → index-x8py72a3.js} +1 -1
  182. package/dist/index-xvydbxmk.js +1404 -0
  183. package/dist/index-xwaphv0d.js +31 -0
  184. package/dist/{index-a09r9ff0.js → index-y44j39yk.js} +1 -1
  185. package/dist/{index-7mjsb7zv.js → index-ybrrxjhb.js} +1 -1
  186. package/dist/{index-xsrma0jd.js → index-ysthxsa8.js} +6 -6
  187. package/dist/{index-6p5pshcd.js → index-yyh3ey4b.js} +1 -1
  188. package/dist/{index-mr3njw67.js → index-z6hq9j8j.js} +1 -1
  189. package/dist/{index-67mzzkdv.js → index-z72agxdn.js} +2 -2
  190. package/dist/{index-e4w0sfm1.js → index-z78mtc16.js} +1 -1
  191. package/dist/{index-7csn6pva.js → index-ze94h4ph.js} +5 -0
  192. package/dist/internal/json-stringify.d.ts +12 -0
  193. package/dist/internal/json-stringify.d.ts.map +1 -1
  194. package/dist/internal/unix-client-error.d.ts +4 -0
  195. package/dist/internal/unix-client-error.d.ts.map +1 -1
  196. package/dist/live/watch-contract.d.ts +4 -0
  197. package/dist/live/watch-contract.d.ts.map +1 -1
  198. package/dist/live/watch-fanout-frame.d.ts +81 -0
  199. package/dist/live/watch-fanout-frame.d.ts.map +1 -0
  200. package/dist/live/watch-fanout.d.ts +57 -0
  201. package/dist/live/watch-fanout.d.ts.map +1 -0
  202. package/dist/observability/audit.d.ts.map +1 -1
  203. package/dist/observability/spool-core.d.ts +1 -0
  204. package/dist/observability/spool-core.d.ts.map +1 -1
  205. package/dist/observability/spool-drain.d.ts +48 -0
  206. package/dist/observability/spool-drain.d.ts.map +1 -0
  207. package/dist/observability/spool.d.ts +12 -6
  208. package/dist/observability/spool.d.ts.map +1 -1
  209. package/dist/postgres/rollback-transaction.d.ts +61 -0
  210. package/dist/postgres/rollback-transaction.d.ts.map +1 -0
  211. package/dist/primitives/deadline.d.ts +4 -4
  212. package/dist/primitives/deadline.d.ts.map +1 -1
  213. package/dist/server/error-hook.d.ts +3 -32
  214. package/dist/server/error-hook.d.ts.map +1 -1
  215. package/dist/server/local-consent-key.d.ts +104 -0
  216. package/dist/server/local-consent-key.d.ts.map +1 -0
  217. package/dist/server/local-control-journal.d.ts +51 -0
  218. package/dist/server/local-control-journal.d.ts.map +1 -0
  219. package/dist/server/local-control-reporter.d.ts +32 -0
  220. package/dist/server/local-control-reporter.d.ts.map +1 -0
  221. package/dist/server/local-control.d.ts +48 -0
  222. package/dist/server/local-control.d.ts.map +1 -0
  223. package/dist/server/local-host-clients.d.ts +105 -0
  224. package/dist/server/local-host-clients.d.ts.map +1 -0
  225. package/dist/server/middleware/trust-fence.d.ts +20 -0
  226. package/dist/server/middleware/trust-fence.d.ts.map +1 -1
  227. package/dist/spend/receipt-spool.d.ts +9 -4
  228. package/dist/spend/receipt-spool.d.ts.map +1 -1
  229. package/dist/testing/tool-surface-checks.d.ts +89 -0
  230. package/dist/testing/tool-surface-checks.d.ts.map +1 -0
  231. package/dist/testing/tool-surface-cli-callable.d.ts +63 -0
  232. package/dist/testing/tool-surface-cli-callable.d.ts.map +1 -0
  233. package/dist/testing/tool-surface-dead-refs.d.ts +32 -0
  234. package/dist/testing/tool-surface-dead-refs.d.ts.map +1 -0
  235. package/dist/testing/tool-surface-gates.d.ts +72 -0
  236. package/dist/testing/tool-surface-gates.d.ts.map +1 -0
  237. package/dist/testing/tool-surface-parity-drivers.d.ts +56 -0
  238. package/dist/testing/tool-surface-parity-drivers.d.ts.map +1 -0
  239. package/dist/testing/tool-surface-parity.d.ts +28 -0
  240. package/dist/testing/tool-surface-parity.d.ts.map +1 -0
  241. package/dist/testing/tool-surface-ratchet.d.ts +71 -0
  242. package/dist/testing/tool-surface-ratchet.d.ts.map +1 -0
  243. package/dist/tools/agent-tools.d.ts +3 -0
  244. package/dist/tools/agent-tools.d.ts.map +1 -1
  245. package/dist/tools/cli/command.d.ts +3 -0
  246. package/dist/tools/cli/command.d.ts.map +1 -1
  247. package/dist/tools/cli/create-cli.d.ts.map +1 -1
  248. package/dist/tools/cli/format.d.ts +3 -6
  249. package/dist/tools/cli/format.d.ts.map +1 -1
  250. package/dist/tools/cli/invoke.d.ts +4 -0
  251. package/dist/tools/cli/invoke.d.ts.map +1 -1
  252. package/dist/tools/cli/local-key-command.d.ts +53 -0
  253. package/dist/tools/cli/local-key-command.d.ts.map +1 -0
  254. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  255. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  256. package/dist/tools/cli/run-stream.d.ts.map +1 -1
  257. package/dist/tools/cli/runner.d.ts +8 -3
  258. package/dist/tools/cli/runner.d.ts.map +1 -1
  259. package/dist/tools/cli/secret.d.ts +55 -0
  260. package/dist/tools/cli/secret.d.ts.map +1 -0
  261. package/dist/tools/cli/session.d.ts +2 -2
  262. package/dist/tools/cli/session.d.ts.map +1 -1
  263. package/dist/tools/cli/stream.d.ts.map +1 -1
  264. package/dist/tools/cli/unix-outcome.d.ts +6 -0
  265. package/dist/tools/cli/unix-outcome.d.ts.map +1 -1
  266. package/dist/tools/execute-result.d.ts +20 -0
  267. package/dist/tools/execute-result.d.ts.map +1 -1
  268. package/dist/tools/execute.d.ts +3 -0
  269. package/dist/tools/execute.d.ts.map +1 -1
  270. package/dist/tools/internal/json-projection.d.ts +13 -9
  271. package/dist/tools/internal/json-projection.d.ts.map +1 -1
  272. package/dist/tools/internal/remote-error.d.ts +15 -0
  273. package/dist/tools/internal/remote-error.d.ts.map +1 -0
  274. package/dist/tools/internal/surface-projector.d.ts +2 -0
  275. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  276. package/dist/tools/invoker.d.ts +3 -0
  277. package/dist/tools/invoker.d.ts.map +1 -1
  278. package/dist/tools/mcp/handler.d.ts.map +1 -1
  279. package/dist/tools/mcp/lazy-discovery.d.ts +2 -0
  280. package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -1
  281. package/dist/tools/mcp/mount.d.ts +5 -0
  282. package/dist/tools/mcp/mount.d.ts.map +1 -1
  283. package/dist/tools/mcp/register.d.ts +2 -0
  284. package/dist/tools/mcp/register.d.ts.map +1 -1
  285. package/dist/tools/mcp/runtime-tools.d.ts +2 -0
  286. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  287. package/dist/tools/mcp/stdio.d.ts.map +1 -1
  288. package/dist/tools/mount.d.ts +3 -0
  289. package/dist/tools/mount.d.ts.map +1 -1
  290. package/dist/tools/read-operation.d.ts +2 -6
  291. package/dist/tools/read-operation.d.ts.map +1 -1
  292. package/dist/tools/remote.d.ts.map +1 -1
  293. package/dist/tools/runtime-tool.d.ts.map +1 -1
  294. package/dist/tools/toolkit.d.ts +10 -3
  295. package/dist/tools/toolkit.d.ts.map +1 -1
  296. package/dist/xlsx/schema.d.ts.map +1 -1
  297. package/llms/cli.2.txt +10 -8
  298. package/llms/cli.3.txt +2 -0
  299. package/llms/cli.txt +18 -3
  300. package/llms/contract.txt +47 -5
  301. package/llms/handler.txt +1 -1
  302. package/llms/live.txt +82 -0
  303. package/llms/node.txt +5 -0
  304. package/llms/observability.2.txt +1 -1
  305. package/llms/observability.txt +6 -0
  306. package/llms/postgres.txt +1 -0
  307. package/llms/server.2.txt +206 -240
  308. package/llms/server.3.txt +242 -202
  309. package/llms/server.4.txt +202 -1025
  310. package/llms/server.5.txt +1053 -255
  311. package/llms/server.6.txt +274 -0
  312. package/llms/server.txt +32 -116
  313. package/llms/spend.txt +8 -7
  314. package/llms/stitchkit.2.txt +13 -35
  315. package/llms/stitchkit.3.txt +27 -0
  316. package/llms/stitchkit.txt +81 -81
  317. package/llms/testing.txt +40 -0
  318. package/llms/tools-toolkit.txt +2 -2
  319. package/llms/tools.2.txt +29 -20
  320. package/llms/{upgrading-0.128.0-0.129.0.txt → upgrading-0.128.0-0.131.0.txt} +101 -3
  321. package/llms/{upgrading-0.130.0-0.136.0.txt → upgrading-0.132.0-0.137.0.txt} +62 -101
  322. package/llms/upgrading.txt +2 -2
  323. package/llms-full.txt +590 -171
  324. package/llms.txt +13 -13
  325. package/package.json +1 -1
  326. package/dist/index-9118dw8d.js +0 -603
  327. package/dist/index-9vj869rx.js +0 -19
  328. package/dist/index-a1rjr381.js +0 -114
  329. package/dist/index-dacxr7nf.js +0 -17
  330. package/dist/index-dm50x3by.js +0 -63
  331. package/dist/index-dmrx8xma.js +0 -163
  332. package/dist/index-ednf2cxs.js +0 -37
  333. package/dist/{index-e4zt2x70.js → index-3czppvrr.js} +3 -3
  334. package/dist/{index-42n9jycn.js → index-3f79t32b.js} +3 -3
  335. package/dist/{index-mfe9a266.js → index-84n49vam.js} +0 -0
  336. package/dist/{index-f16b7rze.js → index-er1tp8de.js} +3 -3
  337. package/dist/{index-k137ezb6.js → index-f5d0fdcf.js} +3 -3
  338. package/dist/{index-65p8v81y.js → index-psz8qrz0.js} +3 -3
  339. package/dist/{index-kadgaw1s.js → index-r8cq86h1.js} +0 -0
  340. package/dist/{index-1yky29qg.js → index-tyyvbarf.js} +0 -0
  341. package/dist/{index-tjakdpf2.js → index-wq71v08n.js} +3 -3
  342. package/dist/{index-7an2fs5h.js → index-wswcpbm4.js} +3 -3
@@ -1,19 +0,0 @@
1
- import {
2
- redact2
3
- } from "./index-28kbdn63.js";
4
-
5
- // src/tools/internal/json-projection.ts
6
- function projectJsonSafe(value, space) {
7
- try {
8
- const serialized = JSON.stringify(value, null, space);
9
- if (serialized !== undefined)
10
- return { value, text: serialized };
11
- } catch {}
12
- const safe = redact2(value, { sensitiveKeys: /(?!)/ });
13
- return { value: safe, text: JSON.stringify(safe, null, space) ?? "null" };
14
- }
15
- function stringifyJsonSafe(value, space) {
16
- return projectJsonSafe(value, space).text;
17
- }
18
-
19
- export { projectJsonSafe, stringifyJsonSafe };
@@ -1,114 +0,0 @@
1
- // src/internal/json-stringify.ts
2
- class Refused extends Error {
3
- refusal;
4
- constructor(refusal) {
5
- super(refusal.reason);
6
- this.refusal = refusal;
7
- }
8
- }
9
- var REFUSAL_TEXT = {
10
- bigint: "a BigInt",
11
- cycle: "a cycle",
12
- threw: "a value whose serialization threw"
13
- };
14
- function describeJsonRefusal(refusal) {
15
- const path = refusal.path.length > MAX_PATH_TEXT ? `${refusal.path.slice(0, MAX_PATH_TEXT)}…` : refusal.path;
16
- const where = path.length > 0 ? path : "the root";
17
- return `${REFUSAL_TEXT[refusal.reason]} at ${where}`;
18
- }
19
- var MAX_PATH_TEXT = 200;
20
- function joinPath(path, key) {
21
- return path.length > 0 ? `${path}.${key}` : key;
22
- }
23
- function resolveForJson(value, key) {
24
- let resolved = value;
25
- if (typeof resolved === "object" && resolved !== null || typeof resolved === "bigint") {
26
- const toJSON = Reflect.get(Object(resolved), "toJSON");
27
- if (typeof toJSON === "function")
28
- resolved = toJSON.call(resolved, key);
29
- }
30
- if (resolved instanceof Number)
31
- return Number(resolved);
32
- if (resolved instanceof String)
33
- return String(resolved);
34
- if (resolved instanceof Boolean)
35
- return Boolean.prototype.valueOf.call(resolved);
36
- if (resolved instanceof BigInt)
37
- return BigInt.prototype.valueOf.call(resolved);
38
- return resolved;
39
- }
40
- function projectJson(value) {
41
- const ancestors = new Set;
42
- const visit = (raw, key, path) => {
43
- let item;
44
- try {
45
- item = resolveForJson(raw, key);
46
- } catch {
47
- throw new Refused({ reason: "threw", path });
48
- }
49
- if (item === null || typeof item === "string" || typeof item === "boolean")
50
- return item;
51
- if (typeof item === "number")
52
- return Number.isFinite(item) ? item + 0 : null;
53
- if (typeof item === "bigint")
54
- throw new Refused({ reason: "bigint", path });
55
- if (typeof item !== "object")
56
- return;
57
- if (ancestors.has(item))
58
- throw new Refused({ reason: "cycle", path });
59
- ancestors.add(item);
60
- try {
61
- let length;
62
- try {
63
- length = Array.isArray(item) ? Number(Reflect.get(item, "length")) : undefined;
64
- } catch {
65
- throw new Refused({ reason: "threw", path });
66
- }
67
- if (length !== undefined) {
68
- const out = [];
69
- for (let index = 0;index < length; index += 1) {
70
- const entry = readProperty(item, String(index), path);
71
- out.push(visit(entry, String(index), joinPath(path, String(index))) ?? null);
72
- }
73
- return out;
74
- }
75
- const out = {};
76
- let names;
77
- try {
78
- names = Object.keys(item);
79
- } catch {
80
- throw new Refused({ reason: "threw", path });
81
- }
82
- for (const name of names) {
83
- const entry = visit(readProperty(item, name, path), name, joinPath(path, name));
84
- if (name === "__proto__")
85
- continue;
86
- if (entry !== undefined)
87
- out[name] = entry;
88
- }
89
- return out;
90
- } finally {
91
- ancestors.delete(item);
92
- }
93
- };
94
- try {
95
- return { ok: true, value: visit(value, "", "") ?? null };
96
- } catch (error) {
97
- if (error instanceof Refused)
98
- return { ok: false, refusal: error.refusal };
99
- return { ok: false, refusal: { reason: "threw", path: "" } };
100
- }
101
- }
102
- function readProperty(holder, key, path) {
103
- try {
104
- return Reflect.get(holder, key);
105
- } catch {
106
- throw new Refused({ reason: "threw", path: joinPath(path, key) });
107
- }
108
- }
109
- function recordedJson(value) {
110
- const projected = projectJson(value);
111
- return projected.ok ? projected.value : { unrecordable: describeJsonRefusal(projected.refusal) };
112
- }
113
-
114
- export { describeJsonRefusal, projectJson, recordedJson };
@@ -1,17 +0,0 @@
1
- import {
2
- AppError2
3
- } from "./index-7fjbdga8.js";
4
-
5
- // src/tools/internal/tool-error-projection.ts
6
- var TOOL_ERROR_PROJECTION = Symbol.for("stitchkit.toolErrorProjection");
7
- function projectedToolError(error) {
8
- if (typeof error !== "object" || error === null)
9
- return;
10
- const project = Reflect.get(error, TOOL_ERROR_PROJECTION);
11
- if (typeof project !== "function")
12
- return;
13
- const projected = Reflect.apply(project, error, []);
14
- return AppError2.is(projected) ? projected : undefined;
15
- }
16
-
17
- export { TOOL_ERROR_PROJECTION, projectedToolError };
@@ -1,63 +0,0 @@
1
- import {
2
- toJsonSchema
3
- } from "./index-d1pdv8qc.js";
4
-
5
- // src/tools/schema/schema.ts
6
- import { z } from "zod";
7
- function unwrapZodWrappers(field) {
8
- if (field instanceof z.ZodOptional || field instanceof z.ZodNullable || field instanceof z.ZodDefault || field instanceof z.ZodReadonly) {
9
- return unwrapZodWrappers(field.unwrap());
10
- }
11
- return field;
12
- }
13
- function objectShapeKeys(schema) {
14
- const base = schema ? unwrapZodWrappers(schema) : undefined;
15
- return base instanceof z.ZodObject ? Object.keys(base.shape) : [];
16
- }
17
- function keyPolicyOf(schema) {
18
- return schema.def.catchall;
19
- }
20
- function rebuildObject(source, shape) {
21
- return withKeyPolicy(z.object(shape), keyPolicyOf(source));
22
- }
23
- function withKeyPolicy(object, policy) {
24
- if (policy === undefined)
25
- return object;
26
- return object.catchall(representable(policy));
27
- }
28
- function representable(policy) {
29
- if (policy instanceof z.ZodNever || policy instanceof z.ZodUnknown)
30
- return policy;
31
- if (!(policy instanceof z.ZodType))
32
- return z.unknown();
33
- try {
34
- toJsonSchema(policy, "input");
35
- return policy;
36
- } catch {
37
- return z.unknown();
38
- }
39
- }
40
- function mergeSchemas(paramsSchema, inputSchema) {
41
- if (paramsSchema && !(paramsSchema instanceof z.ZodObject)) {
42
- throw new Error("Tool params schema must be a z.object()");
43
- }
44
- const paramsObject = paramsSchema instanceof z.ZodObject ? paramsSchema : undefined;
45
- if (!inputSchema) {
46
- return paramsObject ?? z.object({});
47
- }
48
- if (inputSchema instanceof z.ZodObject) {
49
- if (paramsObject) {
50
- const conflicts = Object.keys(paramsObject.shape).filter((key) => (key in inputSchema.shape));
51
- if (conflicts.length > 0) {
52
- throw new Error(`Schema merge conflict: ${conflicts.join(", ")} appear in both params and input`);
53
- }
54
- }
55
- return rebuildObject(inputSchema, {
56
- ...paramsObject?.shape ?? {},
57
- ...inputSchema.shape
58
- });
59
- }
60
- return paramsObject ? z.intersection(paramsObject, inputSchema) : inputSchema;
61
- }
62
-
63
- export { unwrapZodWrappers, objectShapeKeys, rebuildObject, mergeSchemas };
@@ -1,163 +0,0 @@
1
- import {
2
- resolveRouteParamsSchema
3
- } from "./index-m38ej7e5.js";
4
- import {
5
- TOOL_TRANSPORTS2,
6
- isHttpOnlyEndpoint,
7
- assertEndpointExposure
8
- } from "./index-yt1gg11x.js";
9
- import {
10
- assertEndpointEffect
11
- } from "./index-werjqesf.js";
12
- import {
13
- assertEndpointRefusals
14
- } from "./index-dxft2mnm.js";
15
- import {
16
- assertMultipartEndpoint,
17
- assertRawEndpoint,
18
- assertStreamingResponseEndpoint,
19
- assertNoUngroupedToolOptions,
20
- assertToolDepthOptions,
21
- assertHeadEndpoint,
22
- assertRawBodyEndpoint,
23
- assertSafelistedBodyEndpoint,
24
- assertResponseMetaEndpoint
25
- } from "./index-by8w2461.js";
26
- import {
27
- assertPositiveSafeInteger
28
- } from "./index-gr0kxymw.js";
29
- import {
30
- assertTimerMs
31
- } from "./index-e1y74yra.js";
32
- import {
33
- isRecord
34
- } from "./index-ps3djm8d.js";
35
-
36
- // src/contract/tool-view.ts
37
- import { z } from "zod";
38
- var DECLARED_TOOL_VIEW = Symbol.for("stitchkit.toolView");
39
- function withToolView2(endpoint, view) {
40
- const declared = { ...view, [DECLARED_TOOL_VIEW]: true };
41
- return { ...endpoint, tool: { ...endpoint.tool, view: declared } };
42
- }
43
- function objectKeys(schema) {
44
- return schema instanceof z.ZodObject ? new Set(Object.keys(schema.shape)) : new Set;
45
- }
46
- function assertToolView(prefix, key, ep) {
47
- const where = `Contract "${prefix}": endpoint "${key}" tool.view`;
48
- const tool = Reflect.get(ep, "tool");
49
- const view = isRecord(tool) ? tool.view : undefined;
50
- if (!isRecord(view))
51
- throw new Error(`${where} must be an object`);
52
- if (Reflect.get(view, DECLARED_TOOL_VIEW) !== true) {
53
- throw new Error(`${where} must be declared with withToolView, which types its project`);
54
- }
55
- if (isHttpOnlyEndpoint(ep)) {
56
- throw new Error(`${where} is only for a JSON tool endpoint — this one is HTTP-only by kind`);
57
- }
58
- if (!ep.output) {
59
- throw new Error(`${where} needs the endpoint's full output — the view is derived from it`);
60
- }
61
- const output = view.output;
62
- const project = view.project;
63
- if (output !== undefined && !(output instanceof z.ZodType)) {
64
- throw new Error(`${where}.output must be a Zod schema`);
65
- }
66
- if (project !== undefined && typeof project !== "function") {
67
- throw new Error(`${where}.project must be a function`);
68
- }
69
- const defaults = view.defaults;
70
- if (defaults !== undefined && !isRecord(defaults)) {
71
- throw new Error(`${where}.defaults must be an object`);
72
- }
73
- const entries = defaults === undefined ? [] : Object.entries(defaults);
74
- if (output === undefined && project === undefined && entries.length === 0) {
75
- throw new Error(`${where} declares no defaults, output or project — it would change nothing`);
76
- }
77
- if (entries.length === 0)
78
- return;
79
- if (!(ep.input instanceof z.ZodObject)) {
80
- throw new Error(`${where}.defaults needs an object input schema to name keys of`);
81
- }
82
- const inputKeys = objectKeys(ep.input);
83
- const paramKeys = objectKeys(ep.params);
84
- for (const [name, value] of entries) {
85
- if (paramKeys.has(name)) {
86
- throw new Error(`${where}.defaults.${name} is a path param — a route segment has no default`);
87
- }
88
- if (!inputKeys.has(name)) {
89
- throw new Error(`${where}.defaults.${name} is not a key of the endpoint's input`);
90
- }
91
- const field = ep.input.shape[name];
92
- if (field === undefined || !z.safeParse(field, value).success) {
93
- throw new Error(`${where}.defaults.${name} is not a valid value for that input key`);
94
- }
95
- }
96
- }
97
-
98
- // src/contract/define.ts
99
- function defineContract2(meta, endpoints) {
100
- const materializedEndpoints = {};
101
- for (const [key, endpoint] of Object.entries(endpoints)) {
102
- const params = resolveRouteParamsSchema(endpoint.path, endpoint.params);
103
- materializedEndpoints[key] = params === endpoint.params ? endpoint : { ...endpoint, params };
104
- }
105
- const toolTransports = new Map;
106
- for (const [key, ep] of Object.entries(materializedEndpoints)) {
107
- assertEndpointExposure(meta.prefix, key, ep);
108
- assertEndpointEffect(meta.prefix, key, ep);
109
- assertEndpointRefusals(`Contract "${meta.prefix}": endpoint "${key}"`, ep.refuses);
110
- if (typeof ep.desc !== "string") {
111
- throw new Error(`Contract "${meta.prefix}": endpoint "${key}" requires desc`);
112
- }
113
- if (ep.desc.trim() === "") {
114
- throw new Error(`Contract "${meta.prefix}": endpoint "${key}" has an empty desc`);
115
- }
116
- assertPositiveSafeInteger(`Contract "${meta.prefix}": endpoint "${key}" maxJsonBodyBytes`, ep.maxJsonBodyBytes, Error);
117
- assertTimerMs(`Contract "${meta.prefix}": endpoint "${key}" timeout`, ep.timeout);
118
- if (ep.multipart)
119
- assertMultipartEndpoint(meta.prefix, key, ep);
120
- if (ep.rawResponse)
121
- assertRawEndpoint(meta.prefix, key, ep);
122
- if ("stream" in ep)
123
- assertStreamingResponseEndpoint(meta.prefix, key, ep);
124
- if (ep.method === "HEAD")
125
- assertHeadEndpoint(meta.prefix, key, ep);
126
- if (ep.rawBody)
127
- assertRawBodyEndpoint(meta.prefix, key, ep);
128
- if (ep.safelistedBody)
129
- assertSafelistedBodyEndpoint(meta.prefix, key, ep);
130
- if ("responseMeta" in ep)
131
- assertResponseMetaEndpoint(meta.prefix, key, ep);
132
- assertNoUngroupedToolOptions(meta.prefix, key, ep);
133
- const tool = "tool" in ep ? ep.tool : undefined;
134
- if (tool === undefined)
135
- continue;
136
- if (typeof tool !== "object" || tool === null) {
137
- throw new Error(`Contract "${meta.prefix}": endpoint "${key}" tool must be an object`);
138
- }
139
- const transports = new Set(ep.expose ? ep.expose.filter((t) => t !== "HTTP") : ["MCP", "AGENT"]);
140
- if (transports.size === 0) {
141
- throw new Error(`Contract "${meta.prefix}": endpoint "${key}" sets tool options but is not exposed on any tool transport (${TOOL_TRANSPORTS2.join(" / ")}) — add a tool transport to expose or the factory default`);
142
- }
143
- if (tool.view !== undefined)
144
- assertToolView(meta.prefix, key, ep);
145
- assertToolDepthOptions(`Contract "${meta.prefix}": endpoint "${key}" tool`, tool);
146
- if (!tool.name)
147
- continue;
148
- const existing = toolTransports.get(tool.name);
149
- if (existing) {
150
- for (const t of transports) {
151
- if (existing.transports.has(t)) {
152
- throw new Error(`Contract "${meta.prefix}": duplicate tool name "${tool.name}" on transport "${t}" (endpoints: "${existing.key}" and "${key}")`);
153
- }
154
- existing.transports.add(t);
155
- }
156
- } else {
157
- toolTransports.set(tool.name, { key, transports });
158
- }
159
- }
160
- return { meta, endpoints: materializedEndpoints };
161
- }
162
-
163
- export { withToolView2, defineContract2 };
@@ -1,37 +0,0 @@
1
- import {
2
- normalizeError2
3
- } from "./index-dwq6a6sq.js";
4
- import {
5
- isStitchErrorCode2
6
- } from "./index-7fjbdga8.js";
7
-
8
- // src/server/error-hook.ts
9
- function createErrorHook2(config) {
10
- if (config.vocabulary && (config.codeMap !== undefined || config.unmappedCode !== undefined)) {
11
- throw new Error("[stitchkit] createErrorHook: `vocabulary` carries the wire map — it cannot be combined with `codeMap` or `unmappedCode`");
12
- }
13
- return async (ctx, error, endpoint) => {
14
- const appErr = normalizeError2(error);
15
- const stitchCode = isStitchErrorCode2(appErr.code) ? appErr.code : undefined;
16
- const vocabularyMap = config.vocabulary?.codeMap;
17
- const configuredMap = vocabularyMap ?? config.codeMap;
18
- const mapped = stitchCode === undefined ? undefined : configuredMap?.[stitchCode];
19
- const fallback = mapped === undefined && stitchCode !== undefined ? typeof config.unmappedCode === "function" ? config.unmappedCode(stitchCode) : config.unmappedCode : undefined;
20
- const code = mapped ?? fallback ?? appErr.code;
21
- const info = {
22
- code,
23
- status: appErr.status,
24
- message: appErr.message,
25
- details: appErr.details,
26
- hint: appErr.hint
27
- };
28
- await config.onError?.(error, info, ctx, endpoint);
29
- const body = await config.render(info, ctx, endpoint);
30
- return new Response(JSON.stringify(body), {
31
- status: info.status,
32
- headers: { "content-type": "application/json" }
33
- });
34
- };
35
- }
36
-
37
- export { createErrorHook2 };
@@ -19,9 +19,6 @@ import {
19
19
  import {
20
20
  errnoOf
21
21
  } from "./index-jj9228tt.js";
22
- import {
23
- assertPositiveSafeInteger
24
- } from "./index-gr0kxymw.js";
25
22
  import {
26
23
  assertTimerMs
27
24
  } from "./index-e1y74yra.js";
@@ -30,6 +27,9 @@ import {
30
27
  raceAbort,
31
28
  linkAbortSignals
32
29
  } from "./index-rptj3qnc.js";
30
+ import {
31
+ assertPositiveSafeInteger
32
+ } from "./index-gr0kxymw.js";
33
33
 
34
34
  // src/files/boundary.ts
35
35
  import { mkdir, realpath, stat } from "node:fs/promises";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  serializeCanonicalJson
3
3
  } from "./index-fmzg39a8.js";
4
- import {
5
- assertPositiveSafeInteger
6
- } from "./index-gr0kxymw.js";
7
4
  import {
8
5
  assertTimerMs
9
6
  } from "./index-e1y74yra.js";
7
+ import {
8
+ assertPositiveSafeInteger
9
+ } from "./index-gr0kxymw.js";
10
10
  import {
11
11
  isRecord
12
12
  } from "./index-ps3djm8d.js";
File without changes
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  chunksOf
3
3
  } from "./index-sk03xe0n.js";
4
- import {
5
- assertPositiveSafeInteger
6
- } from "./index-gr0kxymw.js";
7
4
  import {
8
5
  abortReason,
9
6
  raceAbort
10
7
  } from "./index-rptj3qnc.js";
8
+ import {
9
+ assertPositiveSafeInteger
10
+ } from "./index-gr0kxymw.js";
11
11
 
12
12
  // src/internal/bounded-body.ts
13
13
  async function readBoundedChunks(source, options) {
@@ -1,12 +1,12 @@
1
- import {
2
- isPositiveSafeInteger
3
- } from "./index-gr0kxymw.js";
4
1
  import {
5
2
  assertTimerMs
6
3
  } from "./index-e1y74yra.js";
7
4
  import {
8
5
  clampTimerMs
9
6
  } from "./index-h20qcyh5.js";
7
+ import {
8
+ isPositiveSafeInteger
9
+ } from "./index-gr0kxymw.js";
10
10
 
11
11
  // src/internal/deadline-budget.ts
12
12
  var DEADLINE_BUDGET_HEADER2 = "x-stitchkit-timeout-ms";
@@ -1,9 +1,9 @@
1
- import {
2
- assertPositiveSafeInteger
3
- } from "./index-gr0kxymw.js";
4
1
  import {
5
2
  raceAbort
6
3
  } from "./index-rptj3qnc.js";
4
+ import {
5
+ assertPositiveSafeInteger
6
+ } from "./index-gr0kxymw.js";
7
7
 
8
8
  // src/agent-executor/image-input.ts
9
9
  import { z } from "zod";
File without changes
File without changes
@@ -15,9 +15,6 @@ import {
15
15
  import {
16
16
  errnoOf
17
17
  } from "./index-jj9228tt.js";
18
- import {
19
- assertPositiveSafeInteger
20
- } from "./index-gr0kxymw.js";
21
18
  import {
22
19
  monotonicTimerClock,
23
20
  scheduleAt,
@@ -29,6 +26,9 @@ import {
29
26
  import {
30
27
  abortError
31
28
  } from "./index-wz392jyz.js";
29
+ import {
30
+ assertPositiveSafeInteger
31
+ } from "./index-gr0kxymw.js";
32
32
 
33
33
  // src/process/group-diagnostics.ts
34
34
  import { z } from "zod";
@@ -1,9 +1,9 @@
1
- import {
2
- assertPositiveSafeInteger
3
- } from "./index-gr0kxymw.js";
4
1
  import {
5
2
  assertTimerMs
6
3
  } from "./index-e1y74yra.js";
4
+ import {
5
+ assertPositiveSafeInteger
6
+ } from "./index-gr0kxymw.js";
7
7
 
8
8
  // src/observability/status.ts
9
9
  import { z } from "zod";