stitchkit 0.135.1 → 0.136.1

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 (436) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/README.md +37 -11
  3. package/dist/agent-executor/acp/v1-session-build.d.ts +51 -0
  4. package/dist/agent-executor/acp/v1-session-build.d.ts.map +1 -0
  5. package/dist/agent-executor/acp/v1-session.d.ts +1 -1
  6. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  7. package/dist/agent-executor/claude/classify.d.ts +1 -1
  8. package/dist/agent-executor/claude/classify.d.ts.map +1 -1
  9. package/dist/agent-executor/claude/events-wire.d.ts +13 -0
  10. package/dist/agent-executor/claude/events-wire.d.ts.map +1 -0
  11. package/dist/agent-executor/claude/events.d.ts +1 -11
  12. package/dist/agent-executor/claude/events.d.ts.map +1 -1
  13. package/dist/agent-executor/codex/protocol.d.ts +0 -143
  14. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  15. package/dist/agent-executor/codex/request-answers.d.ts +1 -1
  16. package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
  17. package/dist/agent-executor/codex/server-requests.d.ts +150 -0
  18. package/dist/agent-executor/codex/server-requests.d.ts.map +1 -0
  19. package/dist/agent-executor/executor-contract.d.ts.map +1 -1
  20. package/dist/agent-executor/image-input.d.ts +10 -3
  21. package/dist/agent-executor/image-input.d.ts.map +1 -1
  22. package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -1
  23. package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
  24. package/dist/agent-executor/vocabulary.d.ts +80 -0
  25. package/dist/agent-executor/vocabulary.d.ts.map +1 -1
  26. package/dist/agent-parts/model.d.ts +94 -0
  27. package/dist/agent-parts/model.d.ts.map +1 -1
  28. package/dist/agent-parts/parts.d.ts +176 -0
  29. package/dist/agent-parts/parts.d.ts.map +1 -1
  30. package/dist/agent-runtime/browser/browser-control-contract.d.ts +444 -0
  31. package/dist/agent-runtime/browser/browser-control-contract.d.ts.map +1 -1
  32. package/dist/agent-runtime/browser/control-schema.d.ts +532 -0
  33. package/dist/agent-runtime/browser/control-schema.d.ts.map +1 -1
  34. package/dist/agent-runtime/browser/control-view.d.ts.map +1 -1
  35. package/dist/agent-runtime/event-schema.d.ts +720 -3
  36. package/dist/agent-runtime/event-schema.d.ts.map +1 -1
  37. package/dist/agent-runtime/history/run-history-parts.d.ts.map +1 -1
  38. package/dist/agent-runtime/loop/deferred-tools.d.ts.map +1 -1
  39. package/dist/agent-runtime/loop/invocation-payload.d.ts.map +1 -1
  40. package/dist/agent-runtime/loop/invocation-stream.d.ts +9 -1
  41. package/dist/agent-runtime/loop/invocation-stream.d.ts.map +1 -1
  42. package/dist/agent-runtime/loop/provider-stream-parts.d.ts +6 -0
  43. package/dist/agent-runtime/loop/provider-stream-parts.d.ts.map +1 -1
  44. package/dist/agent-runtime/loop/provider-stream-segments.d.ts +1 -3
  45. package/dist/agent-runtime/loop/provider-stream-segments.d.ts.map +1 -1
  46. package/dist/agent-runtime/loop/run-acquisition.d.ts.map +1 -1
  47. package/dist/agent-runtime/loop/run-approval-signature.d.ts +38 -0
  48. package/dist/agent-runtime/loop/run-approval-signature.d.ts.map +1 -0
  49. package/dist/agent-runtime/loop/run-approval.d.ts +0 -28
  50. package/dist/agent-runtime/loop/run-approval.d.ts.map +1 -1
  51. package/dist/agent-runtime/loop/run-complete-port.d.ts +24 -0
  52. package/dist/agent-runtime/loop/run-complete-port.d.ts.map +1 -0
  53. package/dist/agent-runtime/loop/run-complete-stream.d.ts +7 -2
  54. package/dist/agent-runtime/loop/run-complete-stream.d.ts.map +1 -1
  55. package/dist/agent-runtime/loop/run-complete-types.d.ts +14 -1
  56. package/dist/agent-runtime/loop/run-complete-types.d.ts.map +1 -1
  57. package/dist/agent-runtime/loop/run-complete.d.ts +2 -2
  58. package/dist/agent-runtime/loop/run-complete.d.ts.map +1 -1
  59. package/dist/agent-runtime/loop/run-execution-state.d.ts +8 -0
  60. package/dist/agent-runtime/loop/run-execution-state.d.ts.map +1 -1
  61. package/dist/agent-runtime/loop/run-loop-events.d.ts +6 -1
  62. package/dist/agent-runtime/loop/run-loop-events.d.ts.map +1 -1
  63. package/dist/agent-runtime/loop/run-model-call.d.ts +44 -0
  64. package/dist/agent-runtime/loop/run-model-call.d.ts.map +1 -0
  65. package/dist/agent-runtime/loop/run-model-step.d.ts +25 -28
  66. package/dist/agent-runtime/loop/run-model-step.d.ts.map +1 -1
  67. package/dist/agent-runtime/loop/run-model-steps.d.ts +6 -0
  68. package/dist/agent-runtime/loop/run-model-steps.d.ts.map +1 -0
  69. package/dist/agent-runtime/loop/run-model-stream.d.ts +3 -1
  70. package/dist/agent-runtime/loop/run-model-stream.d.ts.map +1 -1
  71. package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts +0 -2
  72. package/dist/agent-runtime/loop/run-operation-lifecycle.d.ts.map +1 -1
  73. package/dist/agent-runtime/loop/run-step-loop.d.ts +19 -0
  74. package/dist/agent-runtime/loop/run-step-loop.d.ts.map +1 -0
  75. package/dist/agent-runtime/loop/run-step-port.d.ts +175 -0
  76. package/dist/agent-runtime/loop/run-step-port.d.ts.map +1 -0
  77. package/dist/agent-runtime/loop/run-stream-parts.d.ts.map +1 -1
  78. package/dist/agent-runtime/loop/run-stream-recorded.d.ts.map +1 -1
  79. package/dist/agent-runtime/loop/run-stream-step-text.d.ts.map +1 -1
  80. package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts +2 -1
  81. package/dist/agent-runtime/loop/run-tool-approval-flow.d.ts.map +1 -1
  82. package/dist/agent-runtime/loop/run-tool-call-input.d.ts +39 -0
  83. package/dist/agent-runtime/loop/run-tool-call-input.d.ts.map +1 -0
  84. package/dist/agent-runtime/loop/run-tool-call.d.ts +13 -34
  85. package/dist/agent-runtime/loop/run-tool-call.d.ts.map +1 -1
  86. package/dist/agent-runtime/loop/run-tool-errors.d.ts +5 -0
  87. package/dist/agent-runtime/loop/run-tool-errors.d.ts.map +1 -1
  88. package/dist/agent-runtime/loop/run-tool-executor.d.ts +1 -1
  89. package/dist/agent-runtime/loop/run-tool-executor.d.ts.map +1 -1
  90. package/dist/agent-runtime/loop/run-tool-slots.d.ts +2 -1
  91. package/dist/agent-runtime/loop/run-tool-slots.d.ts.map +1 -1
  92. package/dist/agent-runtime/loop/runtime-state.d.ts.map +1 -1
  93. package/dist/agent-runtime/loop/runtime.d.ts +0 -5
  94. package/dist/agent-runtime/loop/runtime.d.ts.map +1 -1
  95. package/dist/agent-runtime/providers/ai-sdk-convert.d.ts +1 -5
  96. package/dist/agent-runtime/providers/ai-sdk-convert.d.ts.map +1 -1
  97. package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts +15 -0
  98. package/dist/agent-runtime/providers/ai-sdk-normalize.d.ts.map +1 -0
  99. package/dist/agent-runtime/providers/ai-sdk-tools.d.ts +11 -0
  100. package/dist/agent-runtime/providers/ai-sdk-tools.d.ts.map +1 -0
  101. package/dist/agent-runtime/providers/ai-sdk.d.ts +1 -9
  102. package/dist/agent-runtime/providers/ai-sdk.d.ts.map +1 -1
  103. package/dist/agent-runtime/providers/anthropic-sse.d.ts.map +1 -1
  104. package/dist/agent-runtime/providers/openrouter-admission.d.ts.map +1 -1
  105. package/dist/agent-runtime/providers/openrouter-audio.d.ts +123 -81
  106. package/dist/agent-runtime/providers/openrouter-audio.d.ts.map +1 -1
  107. package/dist/agent-runtime/providers/openrouter-catalog-cache.d.ts.map +1 -1
  108. package/dist/agent-runtime/providers/openrouter-catalog-query.d.ts.map +1 -1
  109. package/dist/agent-runtime/providers/openrouter-catalog.d.ts +2 -2
  110. package/dist/agent-runtime/providers/openrouter-catalog.d.ts.map +1 -1
  111. package/dist/agent-runtime/providers/openrouter-client.d.ts +37 -0
  112. package/dist/agent-runtime/providers/openrouter-client.d.ts.map +1 -0
  113. package/dist/agent-runtime/providers/openrouter-http.d.ts +26 -6
  114. package/dist/agent-runtime/providers/openrouter-http.d.ts.map +1 -1
  115. package/dist/agent-runtime/providers/openrouter-media.d.ts +91 -77
  116. package/dist/agent-runtime/providers/openrouter-media.d.ts.map +1 -1
  117. package/dist/agent-runtime/providers/openrouter-models.d.ts +2 -23
  118. package/dist/agent-runtime/providers/openrouter-models.d.ts.map +1 -1
  119. package/dist/agent-runtime/providers/openrouter-options.d.ts +2 -0
  120. package/dist/agent-runtime/providers/openrouter-options.d.ts.map +1 -1
  121. package/dist/agent-runtime/providers/openrouter-request.d.ts +23 -0
  122. package/dist/agent-runtime/providers/openrouter-request.d.ts.map +1 -0
  123. package/dist/agent-runtime/providers/openrouter-retrieval.d.ts +86 -55
  124. package/dist/agent-runtime/providers/openrouter-retrieval.d.ts.map +1 -1
  125. package/dist/agent-runtime/providers/openrouter-speech.d.ts +90 -0
  126. package/dist/agent-runtime/providers/openrouter-speech.d.ts.map +1 -0
  127. package/dist/agent-runtime/providers/openrouter-spend.d.ts +2 -2
  128. package/dist/agent-runtime/providers/openrouter-spend.d.ts.map +1 -1
  129. package/dist/agent-runtime/providers/openrouter-stream.d.ts.map +1 -1
  130. package/dist/agent-runtime/providers/openrouter-systemone.d.ts +87 -32
  131. package/dist/agent-runtime/providers/openrouter-systemone.d.ts.map +1 -1
  132. package/dist/agent-runtime/providers/openrouter-url.d.ts +7 -1
  133. package/dist/agent-runtime/providers/openrouter-url.d.ts.map +1 -1
  134. package/dist/agent-runtime/providers/openrouter-wire.d.ts +45 -0
  135. package/dist/agent-runtime/providers/openrouter-wire.d.ts.map +1 -0
  136. package/dist/agent-runtime/providers/openrouter.d.ts +1 -3
  137. package/dist/agent-runtime/providers/openrouter.d.ts.map +1 -1
  138. package/dist/agent-runtime/providers/provider-http.d.ts +14 -2
  139. package/dist/agent-runtime/providers/provider-http.d.ts.map +1 -1
  140. package/dist/agent-runtime/providers/provider-json-schema-strip.d.ts.map +1 -1
  141. package/dist/agent-runtime/providers/provider-json-schema.d.ts.map +1 -1
  142. package/dist/agent-runtime/providers/provider-openai-chat-sse.d.ts.map +1 -1
  143. package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts +42 -0
  144. package/dist/agent-runtime/providers/provider-openai-chat-state.d.ts.map +1 -0
  145. package/dist/agent-runtime/providers/provider-usage.d.ts +9 -0
  146. package/dist/agent-runtime/providers/provider-usage.d.ts.map +1 -1
  147. package/dist/agent-runtime/runtime-internals.d.ts +1 -3
  148. package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
  149. package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts +9 -0
  150. package/dist/agent-runtime/sandbox/sandbox-bubblewrap-args.d.ts.map +1 -1
  151. package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts +6 -0
  152. package/dist/agent-runtime/sandbox/sandbox-bubblewrap.d.ts.map +1 -1
  153. package/dist/agent-runtime/sandbox/sandbox-contract.d.ts.map +1 -1
  154. package/dist/agent-runtime/sandbox/sandbox-process-linux.d.ts.map +1 -1
  155. package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts +5 -1
  156. package/dist/agent-runtime/sandbox/sandbox-process-spec.d.ts.map +1 -1
  157. package/dist/agent-runtime/sandbox/sandbox-process-wrapper.d.ts.map +1 -1
  158. package/dist/agent-runtime/schemas-json-projection.d.ts +29 -0
  159. package/dist/agent-runtime/schemas-json-projection.d.ts.map +1 -0
  160. package/dist/agent-runtime/schemas-message.d.ts +88 -0
  161. package/dist/agent-runtime/schemas-message.d.ts.map +1 -1
  162. package/dist/agent-runtime/schemas-run.d.ts +88 -0
  163. package/dist/agent-runtime/schemas-run.d.ts.map +1 -1
  164. package/dist/agent-runtime/stores/branch-messages.d.ts.map +1 -1
  165. package/dist/agent-runtime/stores/branch-observations.d.ts +42 -42
  166. package/dist/agent-runtime/stores/branch-replay.d.ts +264 -0
  167. package/dist/agent-runtime/stores/branch-replay.d.ts.map +1 -1
  168. package/dist/agent-runtime/stores/conversations.d.ts +88 -0
  169. package/dist/agent-runtime/stores/conversations.d.ts.map +1 -1
  170. package/dist/agent-runtime/stores/sql-rows.d.ts +74 -10
  171. package/dist/agent-runtime/stores/sql-rows.d.ts.map +1 -1
  172. package/dist/agent-runtime/stores/store-driver-contract.d.ts +616 -0
  173. package/dist/agent-runtime/stores/store-driver-contract.d.ts.map +1 -1
  174. package/dist/agent-runtime/stores/store-events.d.ts +1056 -0
  175. package/dist/agent-runtime/stores/store-events.d.ts.map +1 -1
  176. package/dist/agent-runtime/stores/store.d.ts +1232 -0
  177. package/dist/agent-runtime/stores/store.d.ts.map +1 -1
  178. package/dist/agent-runtime/terminal-commit.d.ts +74 -10
  179. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
  180. package/dist/agent-runtime/testing/fault-bench.d.ts +5 -1
  181. package/dist/agent-runtime/testing/fault-bench.d.ts.map +1 -1
  182. package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts +158 -30
  183. package/dist/agent-runtime/testing/store-conformance-lifecycle.d.ts.map +1 -1
  184. package/dist/agent-runtime/testing/store-conformance-support.d.ts +79 -15
  185. package/dist/agent-runtime/testing/store-conformance-support.d.ts.map +1 -1
  186. package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
  187. package/dist/application/diagnostic-journal-manager.d.ts +1 -1
  188. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  189. package/dist/application/notification-delivery.d.ts.map +1 -1
  190. package/dist/browser/client-executors.d.ts.map +1 -1
  191. package/dist/browser/client-url.d.ts.map +1 -1
  192. package/dist/contract/define.d.ts +3 -7
  193. package/dist/contract/define.d.ts.map +1 -1
  194. package/dist/contract/normalize.d.ts +17 -5
  195. package/dist/contract/normalize.d.ts.map +1 -1
  196. package/dist/entrypoints/agent-executor/acp.js +9 -6
  197. package/dist/entrypoints/agent-executor/claude-sdk.js +26 -25
  198. package/dist/entrypoints/agent-executor/claude.js +13 -12
  199. package/dist/entrypoints/agent-executor/codex.d.ts +2 -1
  200. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
  201. package/dist/entrypoints/agent-executor/codex.js +135 -40
  202. package/dist/entrypoints/agent-executor/testing/claude-sdk.js +5 -4
  203. package/dist/entrypoints/agent-executor/testing.js +23 -18
  204. package/dist/entrypoints/agent-executor.js +8 -8
  205. package/dist/entrypoints/agent-runtime/ai-sdk.d.ts +2 -1
  206. package/dist/entrypoints/agent-runtime/ai-sdk.d.ts.map +1 -1
  207. package/dist/entrypoints/agent-runtime/ai-sdk.js +34 -30
  208. package/dist/entrypoints/agent-runtime/anthropic.js +15 -12
  209. package/dist/entrypoints/agent-runtime/browser.js +13 -8
  210. package/dist/entrypoints/agent-runtime/harness.js +26 -27
  211. package/dist/entrypoints/agent-runtime/openai.js +7 -7
  212. package/dist/entrypoints/agent-runtime/openrouter.d.ts +7 -5
  213. package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
  214. package/dist/entrypoints/agent-runtime/openrouter.js +1097 -856
  215. package/dist/entrypoints/agent-runtime/postgres.js +9 -9
  216. package/dist/entrypoints/agent-runtime/realtime.js +9 -8
  217. package/dist/entrypoints/agent-runtime/sandbox.js +167 -139
  218. package/dist/entrypoints/agent-runtime/sqlite/bun.js +10 -10
  219. package/dist/entrypoints/agent-runtime/sqlite/node.js +10 -10
  220. package/dist/entrypoints/agent-runtime/testing.js +9 -9
  221. package/dist/entrypoints/agent-runtime.js +261 -375
  222. package/dist/entrypoints/application/diagnostic-journal.js +14 -10
  223. package/dist/entrypoints/application.js +18 -6
  224. package/dist/entrypoints/cli.js +36 -15
  225. package/dist/entrypoints/contract.js +12 -10
  226. package/dist/entrypoints/geo.js +1 -1
  227. package/dist/entrypoints/handler.js +5 -6
  228. package/dist/entrypoints/http.d.ts +2 -0
  229. package/dist/entrypoints/http.d.ts.map +1 -1
  230. package/dist/entrypoints/http.js +16 -4
  231. package/dist/entrypoints/index.js +26 -35
  232. package/dist/entrypoints/live.js +3 -3
  233. package/dist/entrypoints/node.js +7 -7
  234. package/dist/entrypoints/observability.js +9 -7
  235. package/dist/entrypoints/process.js +3 -3
  236. package/dist/entrypoints/remote.js +5 -5
  237. package/dist/entrypoints/server.js +29 -16
  238. package/dist/entrypoints/telegram/grammy.d.ts +1 -1
  239. package/dist/entrypoints/telegram/grammy.d.ts.map +1 -1
  240. package/dist/entrypoints/telegram/grammy.js +39 -5
  241. package/dist/entrypoints/telegram/screens.js +3 -0
  242. package/dist/entrypoints/telegram.d.ts +1 -1
  243. package/dist/entrypoints/telegram.d.ts.map +1 -1
  244. package/dist/entrypoints/telegram.js +19 -6
  245. package/dist/entrypoints/testing.js +10 -11
  246. package/dist/entrypoints/tools/agent.js +9 -10
  247. package/dist/entrypoints/tools/connections.js +27 -57
  248. package/dist/entrypoints/tools/contract.js +4 -4
  249. package/dist/entrypoints/tools/invoker.js +7 -8
  250. package/dist/entrypoints/tools/mcp.js +9 -10
  251. package/dist/entrypoints/tools/toolkit.js +11 -12
  252. package/dist/entrypoints/tools.js +24 -22
  253. package/dist/entrypoints/tracking/contract.js +1 -1
  254. package/dist/entrypoints/tracking/performance.js +1 -1
  255. package/dist/entrypoints/tracking.js +1 -1
  256. package/dist/{index-3czc3ykr.js → index-08a3qfr8.js} +1 -1
  257. package/dist/index-1psbyyhj.js +21 -0
  258. package/dist/{index-pdcbjd6a.js → index-1yky29qg.js} +6 -3
  259. package/dist/{index-b4c9dpzm.js → index-252den5a.js} +10 -11
  260. package/dist/{index-yhwx4fwk.js → index-26v8hjqm.js} +4 -4
  261. package/dist/{index-xtby8rj3.js → index-28kbdn63.js} +5 -47
  262. package/dist/{index-c24bj2r1.js → index-2wm9b9vs.js} +5 -5
  263. package/dist/{index-ht71v1ag.js → index-32ew02z1.js} +60 -45
  264. package/dist/{index-dm84tsd5.js → index-3kb8dw48.js} +1 -1
  265. package/dist/index-3tb82xr7.js +11 -0
  266. package/dist/{index-nr4fhfn4.js → index-4p2zx593.js} +2 -0
  267. package/dist/{index-grhhsrd5.js → index-4q9tmzea.js} +5 -4
  268. package/dist/{index-mcv7b2n0.js → index-63ctzjp4.js} +497 -495
  269. package/dist/{index-y0a4gt1s.js → index-65p8v81y.js} +3 -2
  270. package/dist/{index-z72vazf5.js → index-6y3eae97.js} +27 -83
  271. package/dist/{index-y0mwkgkf.js → index-8cnfgwg8.js} +1212 -1139
  272. package/dist/{index-mkmep637.js → index-9m1m92rg.js} +1 -1
  273. package/dist/{index-5awtbyns.js → index-9vj869rx.js} +1 -1
  274. package/dist/index-a1rjr381.js +114 -0
  275. package/dist/{index-6kwdfb9m.js → index-akesakvj.js} +23 -4
  276. package/dist/{index-5q0qpw3v.js → index-aqm7e864.js} +23 -8
  277. package/dist/{index-d4at0q09.js → index-b9mj31q7.js} +90 -88
  278. package/dist/{index-baba8ehy.js → index-bjrcbcn2.js} +2 -2
  279. package/dist/{index-fsw9wxk9.js → index-c9j8441q.js} +1 -103
  280. package/dist/{index-wdb5jhas.js → index-d1pdv8qc.js} +1 -1
  281. package/dist/{index-v0j22shs.js → index-d5mhgx72.js} +16 -11
  282. package/dist/{index-73wq9abg.js → index-df5xr2f9.js} +13 -59
  283. package/dist/{index-n9358ydy.js → index-dm50x3by.js} +1 -1
  284. package/dist/{index-zyyerdny.js → index-dmrx8xma.js} +3 -0
  285. package/dist/{index-78da4g74.js → index-dwq6a6sq.js} +17 -13
  286. package/dist/{index-9be3tf6r.js → index-e413q2cj.js} +49 -22
  287. package/dist/{index-57sbckhv.js → index-e4w0sfm1.js} +2 -2
  288. package/dist/{index-g4gstmp1.js → index-ednf2cxs.js} +1 -1
  289. package/dist/{index-84tp547a.js → index-edpkm3k7.js} +29 -97
  290. package/dist/{index-gs0jw0hy.js → index-efbzm2se.js} +3 -3
  291. package/dist/{index-asnd4h2k.js → index-f0dzyskg.js} +27 -4
  292. package/dist/{index-xbb8ysmq.js → index-fatke81t.js} +2 -2
  293. package/dist/{index-d3s070eh.js → index-gj4wdts6.js} +1 -1
  294. package/dist/{index-6nzzj7qr.js → index-gq35s3bm.js} +1 -1
  295. package/dist/index-gvgtmt7a.js +102 -0
  296. package/dist/{index-pd9e8rz4.js → index-gvv7y0s4.js} +1 -1
  297. package/dist/{index-m2b49tvc.js → index-h08xqfw9.js} +20 -21
  298. package/dist/{index-gk6dq9ay.js → index-ha1tv70k.js} +3 -26
  299. package/dist/{index-vebzvse6.js → index-jy907kcs.js} +24 -1
  300. package/dist/{index-q86qnzzf.js → index-k5azb3v3.js} +8 -25
  301. package/dist/{index-qcy8et93.js → index-kaq9nb7h.js} +6 -6
  302. package/dist/{index-vse7x1qt.js → index-knqye3gv.js} +1 -1
  303. package/dist/{index-tav72wz5.js → index-ks4rhtcc.js} +5 -0
  304. package/dist/{index-bvpevwt6.js → index-mtpcax6d.js} +210 -205
  305. package/dist/{index-7qza24g1.js → index-px9r6wv1.js} +1 -1
  306. package/dist/{index-x6sp5vpa.js → index-q4tr9vnf.js} +1 -1
  307. package/dist/{index-hce3hbdg.js → index-qj0sq69b.js} +6 -2
  308. package/dist/{index-de7b0kvz.js → index-r9w7wfgn.js} +2 -2
  309. package/dist/{index-8vzh5wpv.js → index-rw1caff2.js} +14 -26
  310. package/dist/index-s8af9jqw.js +6 -0
  311. package/dist/{index-bgj9hbm3.js → index-sdppfbrh.js} +30 -16
  312. package/dist/{index-aacwkve4.js → index-sjq4akrx.js} +3 -5
  313. package/dist/{index-fec05c9k.js → index-ta0e2daw.js} +9 -7
  314. package/dist/{index-5dxgx3yj.js → index-tcv71frn.js} +1 -1
  315. package/dist/{index-1zy31r3b.js → index-v92djygb.js} +1 -1
  316. package/dist/{index-c0yym4a0.js → index-w7e402wx.js} +11 -105
  317. package/dist/{index-9f60gnfn.js → index-xaa3603f.js} +4 -11
  318. package/dist/index-xrbrvn15.js +147 -0
  319. package/dist/{index-ac3rfec5.js → index-y6wzzk2e.js} +21 -1
  320. package/dist/{index-3d2c45jn.js → index-yjx5jna7.js} +2 -2
  321. package/dist/{index-j3r7r1mh.js → index-yv7d6tav.js} +1 -1
  322. package/dist/{index-wsv11dhg.js → index-zagc12j1.js} +5 -5
  323. package/dist/{index-npfdymav.js → index-zqc64g69.js} +3 -3
  324. package/dist/{index-rkphknhx.js → index-zthekmrt.js} +2 -2
  325. package/dist/internal/json-stringify.d.ts +37 -0
  326. package/dist/internal/json-stringify.d.ts.map +1 -0
  327. package/dist/internal/loopback-host.d.ts +8 -0
  328. package/dist/internal/loopback-host.d.ts.map +1 -0
  329. package/dist/internal/own-member.d.ts +7 -0
  330. package/dist/internal/own-member.d.ts.map +1 -0
  331. package/dist/internal/request.d.ts +17 -8
  332. package/dist/internal/request.d.ts.map +1 -1
  333. package/dist/internal/secret-shapes.d.ts +33 -4
  334. package/dist/internal/secret-shapes.d.ts.map +1 -1
  335. package/dist/json-schema/dialect.d.ts.map +1 -1
  336. package/dist/json-schema/keywords.d.ts +25 -6
  337. package/dist/json-schema/keywords.d.ts.map +1 -1
  338. package/dist/json-schema/string-format.d.ts.map +1 -1
  339. package/dist/live/events.d.ts.map +1 -1
  340. package/dist/live/watch-client.d.ts.map +1 -1
  341. package/dist/live/watch-delta.d.ts.map +1 -1
  342. package/dist/observability/context.d.ts +4 -3
  343. package/dist/observability/context.d.ts.map +1 -1
  344. package/dist/observability/sanitize.d.ts.map +1 -1
  345. package/dist/observability/secret-values.d.ts +0 -9
  346. package/dist/observability/secret-values.d.ts.map +1 -1
  347. package/dist/server/context.d.ts +3 -2
  348. package/dist/server/context.d.ts.map +1 -1
  349. package/dist/server/error-hook.d.ts +4 -3
  350. package/dist/server/error-hook.d.ts.map +1 -1
  351. package/dist/server/event-bus.d.ts.map +1 -1
  352. package/dist/server/file.d.ts +11 -3
  353. package/dist/server/file.d.ts.map +1 -1
  354. package/dist/server/handler-state.d.ts +2 -2
  355. package/dist/server/handler-state.d.ts.map +1 -1
  356. package/dist/server/middleware/jwt.d.ts +12 -1
  357. package/dist/server/middleware/jwt.d.ts.map +1 -1
  358. package/dist/server/middleware/trust-fence.d.ts +4 -0
  359. package/dist/server/middleware/trust-fence.d.ts.map +1 -1
  360. package/dist/server/multipart.d.ts +2 -3
  361. package/dist/server/multipart.d.ts.map +1 -1
  362. package/dist/server/raw.d.ts.map +1 -1
  363. package/dist/server/request-body.d.ts +12 -1
  364. package/dist/server/request-body.d.ts.map +1 -1
  365. package/dist/server/request-completion.d.ts.map +1 -1
  366. package/dist/server/types.d.ts +14 -9
  367. package/dist/server/types.d.ts.map +1 -1
  368. package/dist/telegram/crypto.d.ts.map +1 -1
  369. package/dist/telegram/init-data.d.ts +4 -4
  370. package/dist/telegram/init-data.d.ts.map +1 -1
  371. package/dist/telegram/outbound-cost.d.ts.map +1 -1
  372. package/dist/telegram/screens/test-chat.d.ts.map +1 -1
  373. package/dist/telegram/widget-api.d.ts +85 -13
  374. package/dist/telegram/widget-api.d.ts.map +1 -1
  375. package/dist/telegram/widget.d.ts +46 -2
  376. package/dist/telegram/widget.d.ts.map +1 -1
  377. package/dist/tools/cli/args-classify.d.ts +4 -74
  378. package/dist/tools/cli/args-classify.d.ts.map +1 -1
  379. package/dist/tools/cli/args-framework.d.ts +79 -0
  380. package/dist/tools/cli/args-framework.d.ts.map +1 -0
  381. package/dist/tools/cli/args-scan.d.ts.map +1 -1
  382. package/dist/tools/cli/args-tokens.d.ts.map +1 -1
  383. package/dist/tools/cli/checkpoint.d.ts +5 -0
  384. package/dist/tools/cli/checkpoint.d.ts.map +1 -1
  385. package/dist/tools/cli/stream.d.ts.map +1 -1
  386. package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -1
  387. package/dist/tools/connections/openapi.d.ts.map +1 -1
  388. package/dist/tools/connections/runtime.d.ts.map +1 -1
  389. package/dist/tools/execute-handler.d.ts +24 -0
  390. package/dist/tools/execute-handler.d.ts.map +1 -0
  391. package/dist/tools/execute.d.ts.map +1 -1
  392. package/dist/tools/mcp/round.d.ts.map +1 -1
  393. package/dist/tools/schema/coerce.d.ts.map +1 -1
  394. package/dist/tools/schema/flatten.d.ts.map +1 -1
  395. package/dist/tools/schema/inline-references.d.ts.map +1 -1
  396. package/dist/tools/schema/nesting-limit.d.ts.map +1 -1
  397. package/dist/tools/schema/presentation.d.ts.map +1 -1
  398. package/dist/tracking/privacy.d.ts.map +1 -1
  399. package/llms/agent-runtime-openrouter.txt +10 -9
  400. package/llms/agent-runtime-sandbox.txt +50 -11
  401. package/llms/agent-runtime-testing.txt +1 -1
  402. package/llms/agent-runtime.2.txt +9 -6
  403. package/llms/agent-runtime.3.txt +2 -2
  404. package/llms/agent-runtime.4.txt +11 -5
  405. package/llms/agent-runtime.5.txt +2 -2
  406. package/llms/agent-runtime.txt +297 -36
  407. package/llms/application.2.txt +6 -3
  408. package/llms/application.3.txt +2 -1
  409. package/llms/application.txt +7 -2
  410. package/llms/http.txt +1 -1
  411. package/llms/live.txt +3 -1
  412. package/llms/observability.txt +16 -9
  413. package/llms/server.2.txt +13 -8
  414. package/llms/server.4.txt +23 -11
  415. package/llms/server.5.txt +5 -5
  416. package/llms/server.txt +54 -1
  417. package/llms/spend.txt +1 -0
  418. package/llms/stitchkit.2.txt +4 -2
  419. package/llms/stitchkit.txt +113 -93
  420. package/llms/telegram-grammy.txt +3 -2
  421. package/llms/telegram.2.txt +3 -1
  422. package/llms/telegram.txt +35 -10
  423. package/llms/upgrading-0.128.0-0.129.0.txt +175 -0
  424. package/llms/{upgrading-0.128.0-0.135.0.txt → upgrading-0.130.0-0.136.0.txt} +353 -169
  425. package/llms/upgrading.txt +2 -1
  426. package/llms-full.txt +1021 -223
  427. package/llms.txt +14 -13
  428. package/package.json +6 -6
  429. package/dist/agent-runtime/loop/deferred-tools-internal.d.ts +0 -19
  430. package/dist/agent-runtime/loop/deferred-tools-internal.d.ts.map +0 -1
  431. package/dist/agent-runtime/loop/run-complete-retry.d.ts +0 -24
  432. package/dist/agent-runtime/loop/run-complete-retry.d.ts.map +0 -1
  433. package/dist/agent-runtime/loop/run-model-attempts.d.ts +0 -6
  434. package/dist/agent-runtime/loop/run-model-attempts.d.ts.map +0 -1
  435. package/dist/index-sznqf8fx.js +0 -20
  436. /package/dist/{index-fthw8dwa.js → index-4gbybjg6.js} +0 -0
@@ -0,0 +1,6 @@
1
+ // src/internal/loopback-host.ts
2
+ function isLoopbackHostname(hostname) {
3
+ return hostname === "localhost" || hostname === "[::1]" || /^127(?:\.\d{1,3}){3}$/u.test(hostname);
4
+ }
5
+
6
+ export { isLoopbackHostname };
@@ -58,6 +58,19 @@ var TelegramWidgetMessageSchema2 = z.looseObject({
58
58
  chat_data: z.string().optional()
59
59
  })
60
60
  });
61
+ var QueryTypeSchema = z.discriminatedUnion("type", [
62
+ z.looseObject({ type: z.literal("data"), wallet_card: z.looseObject({}).optional() }),
63
+ z.looseObject({
64
+ type: z.literal("sign_data"),
65
+ wallet: WalletSchema,
66
+ sign_data: z.string()
67
+ }),
68
+ z.looseObject({
69
+ type: z.literal("sent_transaction"),
70
+ wallet: WalletSchema,
71
+ msg_hash: z.string()
72
+ })
73
+ ]);
61
74
  var TelegramWidgetQuerySchema2 = z.looseObject({
62
75
  id: z.string().min(1),
63
76
  from: z.looseObject({ id: z.int() }),
@@ -66,28 +79,29 @@ var TelegramWidgetQuerySchema2 = z.looseObject({
66
79
  inline_message_id: z.string().optional(),
67
80
  chat_instance: z.string(),
68
81
  chat_type: z.string().optional(),
69
- type: z.discriminatedUnion("type", [
70
- z.looseObject({ type: z.literal("data"), wallet_card: z.looseObject({}).optional() }),
71
- z.looseObject({
72
- type: z.literal("sign_data"),
73
- wallet: WalletSchema,
74
- sign_data: z.string()
75
- }),
76
- z.looseObject({
77
- type: z.literal("sent_transaction"),
78
- wallet: WalletSchema,
79
- msg_hash: z.string()
80
- })
81
- ]),
82
+ type: QueryTypeSchema,
82
83
  data: QueryDataSchema,
83
84
  widget_id: z.string().optional()
84
85
  });
85
- function parseTelegramWidgetQuery2(value) {
86
- const parsed = TelegramWidgetQuerySchema2.safeParse(value);
86
+ var TelegramSharedWidgetQuerySchema2 = z.looseObject({
87
+ id: z.string().min(1),
88
+ from: z.looseObject({ id: z.int() }),
89
+ type: QueryTypeSchema,
90
+ data: QueryDataSchema,
91
+ widget_id: z.string().min(1)
92
+ });
93
+ function parseQuery(schema, value) {
94
+ const parsed = schema.safeParse(value);
87
95
  if (parsed.success)
88
96
  return { query: parsed.data };
89
97
  const id = typeof value === "object" && value !== null ? Reflect.get(value, "id") : undefined;
90
98
  return typeof id === "string" && id.length > 0 ? { id, error: parsed.error } : undefined;
91
99
  }
100
+ function parseTelegramWidgetQuery2(value) {
101
+ return parseQuery(TelegramWidgetQuerySchema2, value);
102
+ }
103
+ function parseTelegramSharedWidgetQuery2(value) {
104
+ return parseQuery(TelegramSharedWidgetQuerySchema2, value);
105
+ }
92
106
 
93
- export { TELEGRAM_WIDGET_LIMITS2, TelegramWidgetHtmlSchema2, TelegramWidgetDataSchema2, TelegramWidgetMessageSchema2, TelegramWidgetQuerySchema2, parseTelegramWidgetQuery2 };
107
+ export { TELEGRAM_WIDGET_LIMITS2, TelegramWidgetHtmlSchema2, TelegramWidgetDataSchema2, TelegramWidgetMessageSchema2, TelegramWidgetQuerySchema2, TelegramSharedWidgetQuerySchema2, parseTelegramWidgetQuery2, parseTelegramSharedWidgetQuery2 };
@@ -1,11 +1,9 @@
1
1
  import {
2
- AgentMessagePartSchema2
3
- } from "./index-tav72wz5.js";
4
- import {
2
+ ExecutorMessagePartSchema,
5
3
  ExecutorThreadDispositionSchema2,
6
4
  ExecutorStartupPhaseSchema2,
7
5
  ExecutorDeltaSchema2
8
- } from "./index-6kwdfb9m.js";
6
+ } from "./index-akesakvj.js";
9
7
  import {
10
8
  createBoundedChannel2
11
9
  } from "./index-02kdtrcd.js";
@@ -60,7 +58,7 @@ var TurnOfferSchema2 = z.strictObject({
60
58
  threadId: ExecutorIdSchema,
61
59
  turnOrdinal: TurnOrdinalSchema,
62
60
  fence: Fence,
63
- input: z.array(AgentMessagePartSchema2).min(1),
61
+ input: z.array(ExecutorMessagePartSchema).min(1),
64
62
  inputDigest: z.string().min(1),
65
63
  nativeThreadId: z.string().min(1).optional()
66
64
  });
@@ -1,6 +1,3 @@
1
- import {
2
- normalizeError2
3
- } from "./index-78da4g74.js";
4
1
  import {
5
2
  ShutdownOptionsSchema2
6
3
  } from "./index-5xsxvk2x.js";
@@ -9,12 +6,15 @@ import {
9
6
  assertExpectedOwnerUid,
10
7
  assertUnixSocketClientTarget
11
8
  } from "./index-kp1j7cc8.js";
9
+ import {
10
+ DEFAULT_REQUEST_BODY_BYTES
11
+ } from "./index-h08xqfw9.js";
12
12
  import {
13
13
  secretsEqual
14
14
  } from "./index-apv5xfef.js";
15
15
  import {
16
16
  bindContract
17
- } from "./index-6nzzj7qr.js";
17
+ } from "./index-gq35s3bm.js";
18
18
  import {
19
19
  DEFAULT_PROCESS_SIGNALS,
20
20
  defaultSignalSource,
@@ -26,7 +26,10 @@ import {
26
26
  } from "./index-kyejf658.js";
27
27
  import {
28
28
  getTraceId2
29
- } from "./index-x6sp5vpa.js";
29
+ } from "./index-q4tr9vnf.js";
30
+ import {
31
+ normalizeError2
32
+ } from "./index-dwq6a6sq.js";
30
33
  import {
31
34
  isModuleNotFound
32
35
  } from "./index-sx3g49y2.js";
@@ -141,13 +144,12 @@ function errorResponse2(error) {
141
144
  }
142
145
  async function parseBody2(req, schema, options = {}) {
143
146
  assertPositiveSafeInteger("maxBytes", options.maxBytes);
144
- const raw = await readJson(req, options.maxBytes ?? DEFAULT_PARSE_BODY_BYTES);
147
+ const raw = await readJson(req, options.maxBytes ?? DEFAULT_REQUEST_BODY_BYTES);
145
148
  if (raw === null)
146
149
  return null;
147
150
  const parsed = schema.safeParse(raw);
148
151
  return parsed.success ? parsed.data : null;
149
152
  }
150
- var DEFAULT_PARSE_BODY_BYTES = 1024 * 1024;
151
153
  async function readJson(req, maxBytes) {
152
154
  try {
153
155
  const result = await readBoundedText(req, { maxBytes, signal: req.signal });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  offerTurnDelta
3
- } from "./index-aacwkve4.js";
3
+ } from "./index-sjq4akrx.js";
4
4
 
5
5
  // src/agent-executor/engine-requests.ts
6
6
  function holdEngineRequest(turn, request) {
@@ -2,7 +2,7 @@ import {
2
2
  AgentRecordIdSchema2,
3
3
  AgentRecordVersionSchema2,
4
4
  AgentMessageSchema2
5
- } from "./index-j3r7r1mh.js";
5
+ } from "./index-yv7d6tav.js";
6
6
 
7
7
  // src/agent-runtime/stores/conversations.ts
8
8
  import { z } from "zod";
@@ -1,122 +1,28 @@
1
- import {
2
- resolveRouteParamsSchema
3
- } from "./index-m38ej7e5.js";
4
1
  import {
5
2
  ExposureSchema,
6
3
  isHttpOnlyEndpoint
7
4
  } from "./index-yt1gg11x.js";
8
5
  import {
9
6
  defineContract2
10
- } from "./index-zyyerdny.js";
7
+ } from "./index-dmrx8xma.js";
11
8
  import {
12
9
  bytesToBase64Url,
13
10
  base64UrlToBytes
14
11
  } from "./index-dwfv9a85.js";
15
- import {
16
- describeRefusals
17
- } from "./index-dxft2mnm.js";
18
12
  import {
19
13
  AppError2,
20
14
  STITCH_ERROR_STATUS2,
21
15
  isStitchErrorCode2
22
16
  } from "./index-7fjbdga8.js";
23
- import {
24
- canonicalDigest
25
- } from "./index-3dq8466w.js";
26
17
  import {
27
18
  typedEntries,
28
- isRecord,
29
19
  transportResult,
30
20
  mapObjectTypeBoundary
31
21
  } from "./index-ps3djm8d.js";
32
-
33
- // src/contract/fingerprint.ts
34
- import { z } from "zod";
35
- var ContractFingerprintSchema2 = z.strictObject({
36
- fingerprint: z.string(),
37
- operations: z.record(z.string(), z.string())
38
- });
39
- var ANNOTATIONS = new Set(["description", "title", "examples", "deprecated", "$comment"]);
40
- function constraintsOf(schema) {
41
- if (Array.isArray(schema))
42
- return schema.map(constraintsOf);
43
- if (!isRecord(schema))
44
- return schema;
45
- const constraints = {};
46
- for (const [key, value] of Object.entries(schema)) {
47
- if (ANNOTATIONS.has(key))
48
- continue;
49
- constraints[key] = key === "required" && Array.isArray(value) ? [...value].sort() : key === "properties" && isRecord(value) ? Object.fromEntries(Object.entries(value).map(([name, property]) => [name, constraintsOf(property)])) : constraintsOf(value);
50
- }
51
- return constraints;
52
- }
53
- function schemaIdentity(schema, io) {
54
- if (schema === undefined)
55
- return null;
56
- return constraintsOf(z.toJSONSchema(schema, { io, unrepresentable: "any", cycles: "ref" }));
57
- }
58
- function refusalIdentity(refuses) {
59
- return [...refuses].sort((left, right) => left.code < right.code ? -1 : left.code > right.code ? 1 : 0).map((refusal) => ({
60
- code: refusal.code,
61
- status: refusal.status,
62
- details: schemaIdentity(refusal.details, "output")
63
- }));
64
- }
65
- function fingerprintOperations(operations) {
66
- const digests = {};
67
- for (const operation of operations) {
68
- if (Object.hasOwn(digests, operation.name)) {
69
- throw new Error(`[stitchkit] contract fingerprint: duplicate operation "${operation.name}"`);
70
- }
71
- digests[operation.name] = canonicalDigest({
72
- method: operation.method,
73
- path: operation.path,
74
- params: schemaIdentity(operation.params, "input"),
75
- input: schemaIdentity(operation.input, "input"),
76
- output: schemaIdentity(operation.output, "output"),
77
- item: schemaIdentity(operation.item, "output"),
78
- ...operation.refuses && { refuses: refusalIdentity(operation.refuses) }
79
- });
80
- }
81
- return { fingerprint: canonicalDigest(digests), operations: digests };
82
- }
83
- function contractFingerprint2(contracts) {
84
- const list = Array.isArray(contracts) ? contracts : [contracts];
85
- return fingerprintOperations(list.flatMap(contractOperations));
86
- }
87
- function contractOperations(contract) {
88
- const operations = [];
89
- for (const [key, endpoint] of typedEntries(contract.endpoints)) {
90
- if (endpoint.expose && !endpoint.expose.includes("HTTP"))
91
- continue;
92
- operations.push({
93
- name: `${contract.meta.prefix}.${key}`,
94
- method: endpoint.method,
95
- path: endpoint.path,
96
- params: resolveRouteParamsSchema(endpoint.path, endpoint.params),
97
- input: endpoint.input,
98
- output: endpoint.output,
99
- item: "stream" in endpoint ? endpoint.stream?.item : undefined,
100
- refuses: describeRefusals(endpoint.refuses)
101
- });
102
- }
103
- return operations;
104
- }
105
-
106
- // src/contract/identity.ts
107
- var contractIdentityContract2 = defineContract2({ prefix: "contract-identity", scope: "public" }, {
108
- read: {
109
- method: "GET",
110
- path: "/",
111
- desc: "The fingerprint of the contract operations this server answers",
112
- expose: ["HTTP"],
113
- output: ContractFingerprintSchema2
114
- }
115
- });
116
22
  // src/contract/errors-factory.ts
117
- import { z as z2 } from "zod";
23
+ import { z } from "zod";
118
24
  function isErrorDetailsSchema(value) {
119
- return value instanceof z2.ZodObject || value instanceof z2.ZodOptional && value.unwrap() instanceof z2.ZodObject;
25
+ return value instanceof z.ZodObject || value instanceof z.ZodOptional && value.unwrap() instanceof z.ZodObject;
120
26
  }
121
27
  function validateDefinition(code, definition) {
122
28
  if (!Number.isInteger(definition.status) || definition.status < 400 || definition.status > 599) {
@@ -218,9 +124,9 @@ function defineErrors2(source, mapping) {
218
124
  });
219
125
  }
220
126
  // src/contract/factory.ts
221
- import { z as z3 } from "zod";
222
- var ContractFactoryToolExposureSchema = z3.strictObject({ default: ExposureSchema });
223
- var ContractFactoryConfigSchema = z3.strictObject({
127
+ import { z as z2 } from "zod";
128
+ var ContractFactoryToolExposureSchema = z2.strictObject({ default: ExposureSchema });
129
+ var ContractFactoryConfigSchema = z2.strictObject({
224
130
  toolExposure: ContractFactoryToolExposureSchema
225
131
  });
226
132
  function createContractFactory2(...args) {
@@ -249,11 +155,11 @@ function createContractFactory2(...args) {
249
155
  return { defineContract: scoped, configure };
250
156
  }
251
157
  // src/contract/pagination.ts
252
- import { z as z4 } from "zod";
158
+ import { z as z3 } from "zod";
253
159
  function paginatedSchema2(itemSchema) {
254
- return z4.object({
255
- items: z4.array(itemSchema),
256
- nextCursor: z4.string().nullable()
160
+ return z3.object({
161
+ items: z3.array(itemSchema),
162
+ nextCursor: z3.string().nullable()
257
163
  });
258
164
  }
259
165
  function toBase64Url(str) {
@@ -275,4 +181,4 @@ function decodeCursor2(cursor, schema) {
275
181
  return null;
276
182
  }
277
183
  }
278
- export { ContractFingerprintSchema2, fingerprintOperations, contractFingerprint2, contractIdentityContract2, defineErrors2, createContractFactory2, paginatedSchema2, encodeCursor2, decodeCursor2 };
184
+ export { defineErrors2, createContractFactory2, paginatedSchema2, encodeCursor2, decodeCursor2 };
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  AgentMessagePartSchema2
3
- } from "./index-tav72wz5.js";
3
+ } from "./index-ks4rhtcc.js";
4
4
  import {
5
5
  AgentJsonObjectSchema2,
6
6
  AgentMessageSchema2,
7
7
  AgentUsageSchema2
8
- } from "./index-j3r7r1mh.js";
8
+ } from "./index-yv7d6tav.js";
9
9
  import {
10
10
  AgentProviderResponseSchema2
11
- } from "./index-7qza24g1.js";
11
+ } from "./index-px9r6wv1.js";
12
12
  import {
13
13
  assistantStatus
14
14
  } from "./index-kgj8j7bv.js";
@@ -16,9 +16,6 @@ import {
16
16
  linkAbortSignals
17
17
  } from "./index-rptj3qnc.js";
18
18
 
19
- // src/agent-runtime/runtime-internals.ts
20
- import { z } from "zod";
21
-
22
19
  // src/agent-runtime/run-store-retry.ts
23
20
  var STORE_RETRY_DELAYS_MS = [25, 100, 400];
24
21
  function storeRetryDelay(failures) {
@@ -222,10 +219,6 @@ function findRun(runs, runId) {
222
219
  throw new AgentRuntimeConflictError2("run lookup");
223
220
  return run;
224
221
  }
225
- function jsonValue(value) {
226
- const parsed = z.json().safeParse(value);
227
- return parsed.success ? parsed.data : { message: "Non-JSON tool output omitted" };
228
- }
229
222
  function providerEnvelope(value) {
230
223
  const parsed = AgentJsonObjectSchema2.safeParse(value);
231
224
  if (!parsed.success)
@@ -390,4 +383,4 @@ function createIdleDeadline(parent, timeoutMs, maxDurationMs) {
390
383
  };
391
384
  }
392
385
 
393
- export { withStoreRetries, AgentRuntimeConflictError2, AgentRunUnsettledError2, appliedSnapshot, terminalOfSnapshot, terminalOfRunView, commitAgentRunTerminal, findRun, jsonValue, providerEnvelope, parseOptionalAgentUsage, providerResponseIdentity, abortTerminalReason, addUsage, mergeModelTotals, normalizeTokenUsage, createIdleDeadline };
386
+ export { withStoreRetries, AgentRuntimeConflictError2, AgentRunUnsettledError2, appliedSnapshot, terminalOfSnapshot, terminalOfRunView, commitAgentRunTerminal, findRun, providerEnvelope, parseOptionalAgentUsage, providerResponseIdentity, abortTerminalReason, addUsage, mergeModelTotals, normalizeTokenUsage, createIdleDeadline };
@@ -0,0 +1,147 @@
1
+ // src/internal/secret-shapes.ts
2
+ var SENSITIVE_WORDS = new Set([
3
+ "password",
4
+ "passwords",
5
+ "passwd",
6
+ "passphrase",
7
+ "pwd",
8
+ "secret",
9
+ "secrets",
10
+ "token",
11
+ "tokens",
12
+ "apikey",
13
+ "authorization",
14
+ "bearer",
15
+ "cookie",
16
+ "cookies",
17
+ "credential",
18
+ "credentials"
19
+ ]);
20
+ var SENSITIVE_WORD_PAIRS = new Set([
21
+ "apikey",
22
+ "apikeys",
23
+ "accesskey",
24
+ "accesskeys",
25
+ "privatekey",
26
+ "initdata",
27
+ "sessionid",
28
+ "sessionkey",
29
+ "pincode",
30
+ "authheader",
31
+ "authkey",
32
+ "authcode",
33
+ "authdata",
34
+ "otpcode"
35
+ ]);
36
+ var SENSITIVE_LAST_WORDS = new Set(["auth", "signature", "jwt", "otp", "pin", "dsn"]);
37
+ var TOKEN_COUNT_WORDS = new Set([
38
+ "max",
39
+ "min",
40
+ "input",
41
+ "output",
42
+ "prompt",
43
+ "completion",
44
+ "total",
45
+ "cached",
46
+ "cache",
47
+ "reasoning",
48
+ "count",
49
+ "used",
50
+ "remaining",
51
+ "limit",
52
+ "budget"
53
+ ]);
54
+ var COMPACT_SECRET_ENDINGS = [
55
+ "password",
56
+ "passwd",
57
+ "passphrase",
58
+ "token",
59
+ "secret",
60
+ "apikey",
61
+ "privatekey",
62
+ "signature",
63
+ "credentials"
64
+ ];
65
+ var SENSITIVE_EXACT = new Set(["session"]);
66
+ function splitKeyWords(key) {
67
+ return key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter((word) => word.length > 0);
68
+ }
69
+ function isSecretKeyName(key) {
70
+ const words = splitKeyWords(key);
71
+ const only = words.length === 1 ? words[0] ?? "" : undefined;
72
+ if (only !== undefined && SENSITIVE_EXACT.has(only))
73
+ return true;
74
+ if (only !== undefined && /^[a-z0-9]+$/.test(key) && (only.startsWith("password") || COMPACT_SECRET_ENDINGS.some((end) => only.endsWith(end)))) {
75
+ return true;
76
+ }
77
+ for (let index = 0;index < words.length; index += 1) {
78
+ const word = words[index] ?? "";
79
+ if (word === "tokens" && words.some((other) => TOKEN_COUNT_WORDS.has(other)))
80
+ continue;
81
+ if (SENSITIVE_WORDS.has(word))
82
+ return true;
83
+ const next = words[index + 1];
84
+ if (next !== undefined && SENSITIVE_WORD_PAIRS.has(word + next))
85
+ return true;
86
+ }
87
+ const named = words.filter((word) => !/^\d+$/.test(word));
88
+ return SENSITIVE_LAST_WORDS.has(named.at(-1) ?? "");
89
+ }
90
+ var BOT_TOKEN_SECRET = /(?<=\d{5,}:)[A-Za-z0-9_-]{30,}/;
91
+ var JWT = /\beyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*/g;
92
+ var PROVIDER_KEY = /\bsk-[A-Za-z0-9_*-]{8,}|\bor-v1-[A-Za-z0-9_*-]{6,}|\bAIza[0-9A-Za-z_-]{20,}/g;
93
+ var BEARER = /\b(bearer\s+)([A-Za-z0-9._~+/-]+=*)/gi;
94
+ var BEARER_OR_BASIC = /\b((?:bearer|basic)\s+)([A-Za-z0-9._~+/-]+=*)/gi;
95
+ var NAMED_ASSIGNMENT = /\b([A-Za-z][A-Za-z0-9_-]*)(\\?["']?)\s*([:=])\s*(\\"(?:(?!\\").)*\\"|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|(?:(?:Bearer|Basic|Token)\s+)?[^\s"',;}\\]+)/gi;
96
+ var URL_PASSWORD = /(\b[a-z][a-z0-9+.-]*:\/\/[^\s/?#@:"'<>]*:)([^\s/?#@"'<>]+)(?=@)/gi;
97
+ var HTTP_USERINFO = /(\b(?:https?|wss?):\/\/)([^\s/?#@:"'<>]+)(?=@)/gi;
98
+ var HTTP_ADDRESS = /(https?:\/\/)([^/\s@]+@)?([^\s/?#]+)([^\s]*)/gi;
99
+ var QUERY_PARAMETER = /([?&;])([^=&#\s"'<>]+)=([^&#\s"'<>]*)/g;
100
+ var QUERY_SECRET_NAMES = new Set(["key", "sig", "signature"]);
101
+ function isSecretQueryName(name, isSecretName = isSecretKeyName) {
102
+ return isSecretName(name) || QUERY_SECRET_NAMES.has(name.toLowerCase());
103
+ }
104
+ function decoded(name) {
105
+ try {
106
+ return decodeURIComponent(name);
107
+ } catch {
108
+ return name;
109
+ }
110
+ }
111
+ function isBearerCredential(value) {
112
+ return /[\d._~+/=-]|[a-z][A-Z]/.test(value) || value.length >= 20;
113
+ }
114
+ function maskAssignments(input, options) {
115
+ return input.replace(NAMED_ASSIGNMENT, (whole, name, nameQuote, separator, value) => {
116
+ if (!options.isSecretName(name)) {
117
+ return value.length > 2 && value.startsWith('"') ? `${whole.slice(0, whole.length - value.length)}${maskAssignments(value, options)}` : whole;
118
+ }
119
+ const escaped = value.startsWith("\\\"") ? "\\\"" : undefined;
120
+ const quote = escaped ?? (value.startsWith('"') || value.startsWith("'") ? value[0] : "");
121
+ const masked = `${quote}${options.mask}${quote}`;
122
+ return `${name}${nameQuote}${separator === ":" && nameQuote ? ": " : "="}${masked}`;
123
+ });
124
+ }
125
+ function maskKeyShapes(input, mask) {
126
+ return input.replace(new RegExp(BOT_TOKEN_SECRET.source, "g"), mask).replace(JWT, mask).replace(PROVIDER_KEY, mask);
127
+ }
128
+ function maskAuthorizationValues(input, mask) {
129
+ return input.replace(BEARER_OR_BASIC, `$1${mask}`);
130
+ }
131
+ function maskUrlPasswords(input, mask) {
132
+ return input.replace(URL_PASSWORD, `$1${mask}`);
133
+ }
134
+ function maskSecretShapes(input, options) {
135
+ const { mask, isSecretName, untrusted = false } = options;
136
+ let output = maskKeyShapes(input, mask);
137
+ if (untrusted) {
138
+ output = maskAssignments(maskAuthorizationValues(output, mask), options).replace(HTTP_ADDRESS, (_whole, scheme, _userinfo, host, rest) => `${scheme}${host}${rest.split(/[?#]/)[0] ?? ""}`);
139
+ } else {
140
+ output = output.replace(BEARER, (whole, scheme, value) => isBearerCredential(value) ? `${scheme}${mask}` : whole).replace(HTTP_USERINFO, `$1${mask}`);
141
+ }
142
+ return maskUrlPasswords(output, mask).replace(QUERY_PARAMETER, (whole, separator, name) => {
143
+ return isSecretQueryName(decoded(name), isSecretName) ? `${separator}${name}=${mask}` : whole;
144
+ });
145
+ }
146
+
147
+ export { isSecretKeyName, BOT_TOKEN_SECRET, isSecretQueryName, maskKeyShapes, maskAuthorizationValues, maskUrlPasswords, maskSecretShapes };
@@ -1,3 +1,10 @@
1
+ import {
2
+ contractFingerprint2,
3
+ contractIdentityContract2
4
+ } from "./index-gvgtmt7a.js";
5
+ import {
6
+ createClient2
7
+ } from "./index-f0dzyskg.js";
1
8
  import {
2
9
  ApiError2
3
10
  } from "./index-kfjkb396.js";
@@ -97,4 +104,17 @@ function throwIfAborted(signal) {
97
104
  }
98
105
  }
99
106
 
100
- export { uploadInChunks2 };
107
+ // src/browser/contract-identity.ts
108
+ async function readContractIdentity2(contracts, configOrClient) {
109
+ const client = contractFingerprint2(contracts);
110
+ const api = createClient2(contractIdentityContract2, configOrClient);
111
+ try {
112
+ return { client, server: await api.read() };
113
+ } catch (error) {
114
+ if (error instanceof ApiError2 && error.status === 404)
115
+ return { client, server: undefined };
116
+ throw error;
117
+ }
118
+ }
119
+
120
+ export { uploadInChunks2, readContractIdentity2 };
@@ -3,10 +3,10 @@ import {
3
3
  toolErrorFromResult,
4
4
  collectTools2,
5
5
  createToolRunner
6
- } from "./index-d4at0q09.js";
6
+ } from "./index-b9mj31q7.js";
7
7
  import {
8
8
  assertUniqueToolName
9
- } from "./index-84tp547a.js";
9
+ } from "./index-edpkm3k7.js";
10
10
  import {
11
11
  AppError2
12
12
  } from "./index-7fjbdga8.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AgentMessagePartSchema2
3
- } from "./index-tav72wz5.js";
3
+ } from "./index-ks4rhtcc.js";
4
4
 
5
5
  // src/durability/events.ts
6
6
  import { z } from "zod";
@@ -3,10 +3,10 @@ import {
3
3
  AppendAgentStoreEventSchema2,
4
4
  AgentStoreEventPageSchema2,
5
5
  AgentMessageSchema2
6
- } from "./index-j3r7r1mh.js";
6
+ } from "./index-yv7d6tav.js";
7
7
  import {
8
8
  AgentRunSchema2
9
- } from "./index-pd9e8rz4.js";
9
+ } from "./index-gvv7y0s4.js";
10
10
  import {
11
11
  SqlIntegerSchema,
12
12
  HeadRowSchema,
@@ -26,7 +26,7 @@ import {
26
26
  isRuntimeSnapshotEntry,
27
27
  appendEventIn,
28
28
  ArchiveSpillSchema
29
- } from "./index-v0j22shs.js";
29
+ } from "./index-d5mhgx72.js";
30
30
  import {
31
31
  InvocationExpiredPayloadSchema,
32
32
  parsePayloadPurgeCutoff,
@@ -38,11 +38,11 @@ import {
38
38
  AgentAdmissionReceiptSchema2,
39
39
  AgentSeedReceiptSchema2,
40
40
  AgentHistoryMutationSchema2
41
- } from "./index-qcy8et93.js";
41
+ } from "./index-kaq9nb7h.js";
42
42
  import {
43
43
  AgentConversationPageSchema2,
44
44
  AgentConversationMessagePageSchema2
45
- } from "./index-1zy31r3b.js";
45
+ } from "./index-v92djygb.js";
46
46
 
47
47
  // src/agent-runtime/stores/companion-host.ts
48
48
  function createCompanionHost(input) {
@@ -3,7 +3,7 @@ import {
3
3
  AgentStoreEventEnvelopeSchema2,
4
4
  AgentStoreEventPageSchema2,
5
5
  AgentMessageSchema2
6
- } from "./index-j3r7r1mh.js";
6
+ } from "./index-yv7d6tav.js";
7
7
  import {
8
8
  InvocationExpiredPayloadSchema,
9
9
  parsePayloadPurgeCutoff,
@@ -16,14 +16,14 @@ import {
16
16
  AgentSeedReceiptSchema2,
17
17
  AgentHistoryMutationSchema2,
18
18
  isActiveRunState
19
- } from "./index-qcy8et93.js";
19
+ } from "./index-kaq9nb7h.js";
20
20
  import {
21
21
  ArchiveProjectionSchema,
22
22
  isRuntimeSnapshotEntry,
23
23
  replaceMessage,
24
24
  ArchiveSpillSchema,
25
25
  createAgentRuntimeStore2
26
- } from "./index-v0j22shs.js";
26
+ } from "./index-d5mhgx72.js";
27
27
 
28
28
  // src/agent-runtime/stores/store-memory.ts
29
29
  import { z as z2 } from "zod";
@@ -4,12 +4,12 @@ import {
4
4
  import {
5
5
  AgentTextPartSchema2,
6
6
  AgentFilePartSchema2
7
- } from "./index-tav72wz5.js";
7
+ } from "./index-ks4rhtcc.js";
8
8
  import {
9
9
  AgentControlRequestSchema2,
10
10
  AgentControlResponseSchema2,
11
11
  AgentControlDeliverySchema2
12
- } from "./index-yhwx4fwk.js";
12
+ } from "./index-26v8hjqm.js";
13
13
 
14
14
  // src/agent-runtime/browser/browser-control-contract.ts
15
15
  import { z } from "zod";