stitchkit 0.94.0 → 0.94.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 (346) hide show
  1. package/CHANGELOG.md +64 -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/runtime.d.ts +1 -1
  22. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  23. package/dist/agent-runtime/schedule-records.d.ts +34 -0
  24. package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
  25. package/dist/agent-runtime/schedules.d.ts +34 -0
  26. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  27. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
  28. package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
  29. package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
  30. package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
  31. package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
  32. package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
  33. package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
  34. package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
  35. package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
  36. package/dist/application/admission-rate.d.ts +21 -0
  37. package/dist/application/admission-rate.d.ts.map +1 -0
  38. package/dist/application/admission-run.d.ts +8 -0
  39. package/dist/application/admission-run.d.ts.map +1 -0
  40. package/dist/application/admission.d.ts.map +1 -1
  41. package/dist/application/diagnostic-journal-lock.d.ts +9 -34
  42. package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
  43. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  44. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  45. package/dist/application/kernel-resource-context.d.ts.map +1 -1
  46. package/dist/application/notification-outbox.d.ts.map +1 -1
  47. package/dist/application/schedule.d.ts +0 -1
  48. package/dist/application/schedule.d.ts.map +1 -1
  49. package/dist/application/watch-hub-core.d.ts +122 -0
  50. package/dist/application/watch-hub-core.d.ts.map +1 -0
  51. package/dist/application/watch-hub.d.ts +2 -2
  52. package/dist/application/watch-hub.d.ts.map +1 -1
  53. package/dist/browser/client-executors.d.ts +14 -0
  54. package/dist/browser/client-executors.d.ts.map +1 -0
  55. package/dist/browser/client-multipart.d.ts +1 -1
  56. package/dist/browser/client-multipart.d.ts.map +1 -1
  57. package/dist/browser/client.d.ts +3 -2
  58. package/dist/browser/client.d.ts.map +1 -1
  59. package/dist/browser/http-fetch.d.ts +22 -0
  60. package/dist/browser/http-fetch.d.ts.map +1 -0
  61. package/dist/browser/http.d.ts +1 -3
  62. package/dist/browser/http.d.ts.map +1 -1
  63. package/dist/browser/live-state-core.d.ts +63 -0
  64. package/dist/browser/live-state-core.d.ts.map +1 -0
  65. package/dist/browser/live-state.d.ts.map +1 -1
  66. package/dist/browser/realtime-client.d.ts +26 -0
  67. package/dist/browser/realtime-client.d.ts.map +1 -0
  68. package/dist/browser/socket-io-connection.d.ts +82 -0
  69. package/dist/browser/socket-io-connection.d.ts.map +1 -0
  70. package/dist/browser/socket-io-peer.d.ts +20 -0
  71. package/dist/browser/socket-io-peer.d.ts.map +1 -0
  72. package/dist/browser/socket-io-trace.d.ts +31 -0
  73. package/dist/browser/socket-io-trace.d.ts.map +1 -0
  74. package/dist/browser/socket-io.d.ts +2 -18
  75. package/dist/browser/socket-io.d.ts.map +1 -1
  76. package/dist/contract/client-types.d.ts +134 -0
  77. package/dist/contract/client-types.d.ts.map +1 -0
  78. package/dist/contract/define-validation.d.ts +30 -0
  79. package/dist/contract/define-validation.d.ts.map +1 -0
  80. package/dist/contract/define.d.ts +3 -357
  81. package/dist/contract/define.d.ts.map +1 -1
  82. package/dist/contract/runtime-context.d.ts +131 -0
  83. package/dist/contract/runtime-context.d.ts.map +1 -0
  84. package/dist/contract/tool-options.d.ts +105 -0
  85. package/dist/contract/tool-options.d.ts.map +1 -0
  86. package/dist/contract/tool-view.d.ts +15 -2
  87. package/dist/contract/tool-view.d.ts.map +1 -1
  88. package/dist/durability/contract.d.ts +83 -0
  89. package/dist/durability/contract.d.ts.map +1 -1
  90. package/dist/durability/effect.d.ts +24 -0
  91. package/dist/durability/effect.d.ts.map +1 -0
  92. package/dist/durability/engine.d.ts +2 -2
  93. package/dist/durability/engine.d.ts.map +1 -1
  94. package/dist/durability/events.d.ts +2 -0
  95. package/dist/durability/events.d.ts.map +1 -1
  96. package/dist/durability/ledger.d.ts +11 -0
  97. package/dist/durability/ledger.d.ts.map +1 -1
  98. package/dist/durability/parks.d.ts +22 -0
  99. package/dist/durability/parks.d.ts.map +1 -0
  100. package/dist/durability/scheduler.d.ts +1 -0
  101. package/dist/durability/scheduler.d.ts.map +1 -1
  102. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
  103. package/dist/entrypoints/agent-runtime/harness.js +127 -116
  104. package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
  105. package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
  106. package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
  107. package/dist/entrypoints/agent-runtime/testing.js +246 -214
  108. package/dist/entrypoints/agent-runtime.js +224 -203
  109. package/dist/entrypoints/application/diagnostic-journal.js +63 -203
  110. package/dist/entrypoints/application/opentelemetry.js +1 -1
  111. package/dist/entrypoints/application.js +361 -324
  112. package/dist/entrypoints/cli.d.ts +4 -1
  113. package/dist/entrypoints/cli.d.ts.map +1 -1
  114. package/dist/entrypoints/cli.js +57 -35
  115. package/dist/entrypoints/contract.d.ts +5 -2
  116. package/dist/entrypoints/contract.d.ts.map +1 -1
  117. package/dist/entrypoints/contract.js +3 -2
  118. package/dist/entrypoints/files.d.ts +2 -0
  119. package/dist/entrypoints/files.d.ts.map +1 -1
  120. package/dist/entrypoints/files.js +98 -2
  121. package/dist/entrypoints/index.d.ts +4 -2
  122. package/dist/entrypoints/index.d.ts.map +1 -1
  123. package/dist/entrypoints/index.js +348 -282
  124. package/dist/entrypoints/live.js +89 -71
  125. package/dist/entrypoints/node.d.ts +2 -1
  126. package/dist/entrypoints/node.d.ts.map +1 -1
  127. package/dist/entrypoints/node.js +13 -12
  128. package/dist/entrypoints/react.js +1 -1
  129. package/dist/entrypoints/remote.js +4 -4
  130. package/dist/entrypoints/server.d.ts +4 -2
  131. package/dist/entrypoints/server.d.ts.map +1 -1
  132. package/dist/entrypoints/server.js +293 -79
  133. package/dist/entrypoints/testing.d.ts +2 -1
  134. package/dist/entrypoints/testing.d.ts.map +1 -1
  135. package/dist/entrypoints/testing.js +288 -281
  136. package/dist/entrypoints/tools/connections.js +2 -2
  137. package/dist/entrypoints/tools/invoker.js +4 -4
  138. package/dist/entrypoints/tools.d.ts +6 -3
  139. package/dist/entrypoints/tools.d.ts.map +1 -1
  140. package/dist/entrypoints/tools.js +245 -202
  141. package/dist/entrypoints/tracking.js +325 -274
  142. package/dist/files/boundary.d.ts.map +1 -1
  143. package/dist/files/file-io.d.ts +14 -0
  144. package/dist/files/file-io.d.ts.map +1 -0
  145. package/dist/index-1j8pm5t0.js +412 -0
  146. package/dist/{index-kvj7f4hq.js → index-2bxbyab0.js} +10 -2
  147. package/dist/{index-xnj9bgxe.js → index-2gxzjvyr.js} +2 -162
  148. package/dist/index-4gcnakhx.js +82 -0
  149. package/dist/{index-j05z5gn4.js → index-55hkhm67.js} +136 -119
  150. package/dist/{index-cq4qfycf.js → index-79z7m7dt.js} +227 -59
  151. package/dist/{index-97ac4gph.js → index-7f68ghdn.js} +3 -3
  152. package/dist/{index-r7nmqpsg.js → index-7p1f0vp2.js} +1 -1
  153. package/dist/{index-dcpdvjsc.js → index-863ea9jb.js} +4 -4
  154. package/dist/index-8p52kd5p.js +242 -0
  155. package/dist/{index-2qzskm8h.js → index-dce5wxcq.js} +1 -1
  156. package/dist/index-e01r054k.js +105 -0
  157. package/dist/{index-sees8yf8.js → index-ensd0r74.js} +118 -111
  158. package/dist/{index-1nd48tm9.js → index-gxrt5h6v.js} +2 -1
  159. package/dist/{index-e87kakm4.js → index-ham5sz8m.js} +112 -110
  160. package/dist/{index-kj2wbeta.js → index-het2he5g.js} +280 -196
  161. package/dist/{index-vcvkq30w.js → index-hmp4800j.js} +3 -3
  162. package/dist/{index-gyr48nzg.js → index-k30h66yd.js} +71 -151
  163. package/dist/{index-2cr1cqhn.js → index-khtgb21r.js} +2 -2
  164. package/dist/{index-x4799c19.js → index-ndddxtyx.js} +11 -11
  165. package/dist/{index-dydjcp8z.js → index-np4m8hd3.js} +38 -36
  166. package/dist/{index-p81267c2.js → index-p3vsv1fb.js} +621 -357
  167. package/dist/{index-mp5sn43f.js → index-p9e0w8hs.js} +2 -2
  168. package/dist/{index-rewkc2hj.js → index-p9sh0xx4.js} +3 -3
  169. package/dist/{index-70yj2ebz.js → index-paz6sgdp.js} +107 -103
  170. package/dist/{index-bn2cjajt.js → index-px2gm2jp.js} +26 -102
  171. package/dist/index-s812ycat.js +65 -0
  172. package/dist/{index-xsqjkha9.js → index-sp1tzwnb.js} +2 -2
  173. package/dist/{index-n6hxg8as.js → index-t9rhjr9f.js} +615 -566
  174. package/dist/{index-zeemqhqx.js → index-v260df89.js} +88 -80
  175. package/dist/{index-fdp6hdxn.js → index-w906953s.js} +5 -1
  176. package/dist/{index-mdzh02yc.js → index-wdkt63w3.js} +1 -1
  177. package/dist/{index-58k4fp34.js → index-wsm5w4ee.js} +1 -1
  178. package/dist/{index-v38qyerb.js → index-xw3s75nj.js} +1 -1
  179. package/dist/internal/atomic-file.d.ts +23 -2
  180. package/dist/internal/atomic-file.d.ts.map +1 -1
  181. package/dist/internal/exclusive-lock.d.ts +51 -0
  182. package/dist/internal/exclusive-lock.d.ts.map +1 -0
  183. package/dist/internal/process-identity.d.ts +47 -0
  184. package/dist/internal/process-identity.d.ts.map +1 -0
  185. package/dist/internal/with-exclusive-lock.d.ts +67 -0
  186. package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
  187. package/dist/live/watch-client.d.ts.map +1 -1
  188. package/dist/observability/audit.d.ts +2 -2
  189. package/dist/observability/audit.d.ts.map +1 -1
  190. package/dist/observability/event.d.ts +2 -1
  191. package/dist/observability/event.d.ts.map +1 -1
  192. package/dist/primitives/export-operation.d.ts +1 -1
  193. package/dist/primitives/export-operation.d.ts.map +1 -1
  194. package/dist/realtime/registry.d.ts +0 -5
  195. package/dist/realtime/registry.d.ts.map +1 -1
  196. package/dist/server/bun.d.ts +0 -1
  197. package/dist/server/bun.d.ts.map +1 -1
  198. package/dist/server/context-contribution.d.ts +1 -1
  199. package/dist/server/context-contribution.d.ts.map +1 -1
  200. package/dist/server/context.d.ts +1 -1
  201. package/dist/server/context.d.ts.map +1 -1
  202. package/dist/server/endpoint-response.d.ts +2 -1
  203. package/dist/server/endpoint-response.d.ts.map +1 -1
  204. package/dist/server/error-dispatch.d.ts +1 -1
  205. package/dist/server/error-dispatch.d.ts.map +1 -1
  206. package/dist/server/error-hook.d.ts +1 -1
  207. package/dist/server/error-hook.d.ts.map +1 -1
  208. package/dist/server/handler-state.d.ts +1 -1
  209. package/dist/server/handler-state.d.ts.map +1 -1
  210. package/dist/server/implement-registry.d.ts +54 -0
  211. package/dist/server/implement-registry.d.ts.map +1 -0
  212. package/dist/server/implement.d.ts +9 -55
  213. package/dist/server/implement.d.ts.map +1 -1
  214. package/dist/server/middleware/auth.d.ts +1 -31
  215. package/dist/server/middleware/auth.d.ts.map +1 -1
  216. package/dist/server/middleware/jwt.d.ts +31 -0
  217. package/dist/server/middleware/jwt.d.ts.map +1 -0
  218. package/dist/server/multipart-reader.d.ts +22 -0
  219. package/dist/server/multipart-reader.d.ts.map +1 -0
  220. package/dist/server/multipart.d.ts +1 -1
  221. package/dist/server/multipart.d.ts.map +1 -1
  222. package/dist/server/oauth/cimd.d.ts +88 -0
  223. package/dist/server/oauth/cimd.d.ts.map +1 -0
  224. package/dist/server/oauth/endpoints.d.ts +39 -0
  225. package/dist/server/oauth/endpoints.d.ts.map +1 -0
  226. package/dist/server/oauth/provider.d.ts +1 -68
  227. package/dist/server/oauth/provider.d.ts.map +1 -1
  228. package/dist/server/streaming-pump.d.ts +66 -0
  229. package/dist/server/streaming-pump.d.ts.map +1 -0
  230. package/dist/server/streaming-route.d.ts +12 -5
  231. package/dist/server/streaming-route.d.ts.map +1 -1
  232. package/dist/server/types.d.ts +4 -1
  233. package/dist/server/types.d.ts.map +1 -1
  234. package/dist/server/unix-client-bun.d.ts.map +1 -1
  235. package/dist/server/unix-client-http1.d.ts +76 -0
  236. package/dist/server/unix-client-http1.d.ts.map +1 -0
  237. package/dist/server/unix-client.d.ts.map +1 -1
  238. package/dist/testing/handler-clients.d.ts +2 -1
  239. package/dist/testing/handler-clients.d.ts.map +1 -1
  240. package/dist/testing/realtime-probe.d.ts +33 -0
  241. package/dist/testing/realtime-probe.d.ts.map +1 -0
  242. package/dist/testing/surface-conformance.d.ts +0 -31
  243. package/dist/testing/surface-conformance.d.ts.map +1 -1
  244. package/dist/testing/surface-manifest-digest.d.ts +44 -0
  245. package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
  246. package/dist/testing/surface-manifest.d.ts.map +1 -1
  247. package/dist/tools/agent.d.ts +1 -1
  248. package/dist/tools/agent.d.ts.map +1 -1
  249. package/dist/tools/cli/args-fields.d.ts +31 -0
  250. package/dist/tools/cli/args-fields.d.ts.map +1 -0
  251. package/dist/tools/cli/args-route.d.ts +42 -0
  252. package/dist/tools/cli/args-route.d.ts.map +1 -0
  253. package/dist/tools/cli/args-view.d.ts +32 -0
  254. package/dist/tools/cli/args-view.d.ts.map +1 -0
  255. package/dist/tools/cli/args.d.ts +2 -65
  256. package/dist/tools/cli/args.d.ts.map +1 -1
  257. package/dist/tools/cli/argument-error.d.ts +5 -0
  258. package/dist/tools/cli/argument-error.d.ts.map +1 -0
  259. package/dist/tools/cli/checkpoint.d.ts.map +1 -1
  260. package/dist/tools/cli/command.d.ts +1 -1
  261. package/dist/tools/cli/command.d.ts.map +1 -1
  262. package/dist/tools/cli/config.d.ts +1 -1
  263. package/dist/tools/cli/config.d.ts.map +1 -1
  264. package/dist/tools/cli/format.d.ts +2 -1
  265. package/dist/tools/cli/format.d.ts.map +1 -1
  266. package/dist/tools/cli/invoke.d.ts +2 -1
  267. package/dist/tools/cli/invoke.d.ts.map +1 -1
  268. package/dist/tools/cli/managed-surface.d.ts +1 -1
  269. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  270. package/dist/tools/cli/policy.d.ts +1 -1
  271. package/dist/tools/cli/policy.d.ts.map +1 -1
  272. package/dist/tools/cli/prepare.d.ts.map +1 -1
  273. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  274. package/dist/tools/cli/session.d.ts +1 -1
  275. package/dist/tools/cli/session.d.ts.map +1 -1
  276. package/dist/tools/cli/update.d.ts +19 -0
  277. package/dist/tools/cli/update.d.ts.map +1 -1
  278. package/dist/tools/cli/view.d.ts +1 -1
  279. package/dist/tools/cli/view.d.ts.map +1 -1
  280. package/dist/tools/cli/wait.d.ts +1 -1
  281. package/dist/tools/cli/wait.d.ts.map +1 -1
  282. package/dist/tools/connections/runtime.d.ts +1 -1
  283. package/dist/tools/connections/runtime.d.ts.map +1 -1
  284. package/dist/tools/execute-args.d.ts +23 -0
  285. package/dist/tools/execute-args.d.ts.map +1 -0
  286. package/dist/tools/execute-hooks.d.ts +146 -0
  287. package/dist/tools/execute-hooks.d.ts.map +1 -0
  288. package/dist/tools/execute-result.d.ts +40 -0
  289. package/dist/tools/execute-result.d.ts.map +1 -0
  290. package/dist/tools/execute.d.ts +4 -193
  291. package/dist/tools/execute.d.ts.map +1 -1
  292. package/dist/tools/internal/surface-projector.d.ts +2 -1
  293. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  294. package/dist/tools/invoker.d.ts +2 -1
  295. package/dist/tools/invoker.d.ts.map +1 -1
  296. package/dist/tools/lifecycle.d.ts +1 -1
  297. package/dist/tools/lifecycle.d.ts.map +1 -1
  298. package/dist/tools/mcp/mount.d.ts +1 -1
  299. package/dist/tools/mcp/mount.d.ts.map +1 -1
  300. package/dist/tools/mcp/prepare.d.ts +2 -1
  301. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  302. package/dist/tools/mcp/progress.d.ts +1 -1
  303. package/dist/tools/mcp/progress.d.ts.map +1 -1
  304. package/dist/tools/mcp/register.d.ts +3 -2
  305. package/dist/tools/mcp/register.d.ts.map +1 -1
  306. package/dist/tools/mcp/round-context.d.ts +38 -0
  307. package/dist/tools/mcp/round-context.d.ts.map +1 -0
  308. package/dist/tools/mcp/round-policy.d.ts +1 -1
  309. package/dist/tools/mcp/round-policy.d.ts.map +1 -1
  310. package/dist/tools/mcp/round.d.ts +3 -11
  311. package/dist/tools/mcp/round.d.ts.map +1 -1
  312. package/dist/tools/mcp/runtime-tools.d.ts +2 -1
  313. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  314. package/dist/tools/mount.d.ts +3 -1
  315. package/dist/tools/mount.d.ts.map +1 -1
  316. package/dist/tools/native-definition.d.ts +2 -1
  317. package/dist/tools/native-definition.d.ts.map +1 -1
  318. package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -1
  319. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
  320. package/dist/tools/operations/async-operation-runtime-types.d.ts +2 -1
  321. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
  322. package/dist/tools/remote.d.ts.map +1 -1
  323. package/dist/tools/runtime-tool.d.ts +3 -1
  324. package/dist/tools/runtime-tool.d.ts.map +1 -1
  325. package/dist/tools/tool-logger.d.ts +1 -1
  326. package/dist/tools/tool-logger.d.ts.map +1 -1
  327. package/dist/tracking/client-listeners.d.ts +30 -0
  328. package/dist/tracking/client-listeners.d.ts.map +1 -0
  329. package/dist/tracking/client-visit.d.ts +61 -0
  330. package/dist/tracking/client-visit.d.ts.map +1 -0
  331. package/dist/tracking/client.d.ts +3 -2
  332. package/dist/tracking/client.d.ts.map +1 -1
  333. package/llms/application.2.txt +266 -2
  334. package/llms/application.txt +8 -266
  335. package/llms/cli.2.txt +80 -0
  336. package/llms/cli.txt +45 -74
  337. package/llms/contract.txt +3 -3
  338. package/llms/files.txt +3 -0
  339. package/llms/tools.2.txt +88 -279
  340. package/llms/tools.3.txt +288 -0
  341. package/llms/tools.txt +27 -65
  342. package/llms-full.txt +108 -12
  343. package/llms.txt +5 -5
  344. package/package.json +1 -1
  345. package/dist/index-e2z3ahw9.js +0 -325
  346. package/dist/index-mkm15s49.js +0 -394
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createApplication
3
- } from "../index-fdp6hdxn.js";
3
+ } from "../index-w906953s.js";
4
4
  import"../index-3gye9wzb.js";
5
5
  import"../index-2k4yrqkc.js";
6
6
  import"../index-3z73fh2c.js";
@@ -13,26 +13,28 @@ import {
13
13
  import {
14
14
  createClient,
15
15
  createClients
16
- } from "../index-e87kakm4.js";
16
+ } from "../index-ham5sz8m.js";
17
17
  import {
18
18
  RealtimeRequestDisconnectedError,
19
19
  RealtimeRequestInvalidAcknowledgementError,
20
20
  RealtimeRequestTimeoutError
21
- } from "../index-2qzskm8h.js";
21
+ } from "../index-dce5wxcq.js";
22
22
  import"../index-48ffdxgk.js";
23
23
  import"../index-wqgjfstn.js";
24
- import"../index-zeemqhqx.js";
24
+ import"../index-v260df89.js";
25
+ import {
26
+ TOOL_TRANSPORTS
27
+ } from "../index-k30h66yd.js";
25
28
  import {
26
- TOOL_TRANSPORTS,
27
29
  joinRoutePath
28
- } from "../index-gyr48nzg.js";
30
+ } from "../index-4gcnakhx.js";
29
31
  import"../index-zcgf3gqf.js";
30
32
  import {
31
33
  mcpProjectionCandidate,
32
34
  prepareProjectedMcpTools,
33
35
  projectToolSurface,
34
36
  staticInputRounds
35
- } from "../index-dydjcp8z.js";
37
+ } from "../index-np4m8hd3.js";
36
38
  import {
37
39
  toJsonSchema
38
40
  } from "../index-eqqvgdb3.js";
@@ -653,87 +655,12 @@ async function runManagedResourceConformance(config) {
653
655
  import { z as z3 } from "zod";
654
656
 
655
657
  // src/testing/surface-manifest.ts
656
- import { createHash } from "node:crypto";
657
658
  import { z as z2 } from "zod";
658
- var SURFACE_MANIFEST_VERSION = 3;
659
- var HttpMethodSchema = z2.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]);
660
- var ToolTransportSchema = z2.enum(TOOL_TRANSPORTS);
661
- var SurfaceTransportSchema = z2.enum(["HTTP", "MCP", "AGENT", "CLI", "REALTIME"]);
662
- var SurfaceSchemaDigestsSchema = z2.object({
663
- params: z2.string().nullable(),
664
- input: z2.string().nullable(),
665
- output: z2.string().nullable(),
666
- multipart: z2.string().nullable()
667
- });
668
- var SurfaceManifestOperationMcpSchema = z2.object({
669
- inputRequired: z2.union([
670
- z2.array(z2.object({ key: z2.string(), message: z2.string(), schema: z2.string().nullable() })),
671
- z2.literal("resolved-per-call")
672
- ])
673
- }).nullable();
674
- var SurfaceManifestOperationToolViewSchema = z2.object({
675
- defaults: z2.string().nullable(),
676
- output: z2.string().nullable(),
677
- project: z2.boolean()
678
- });
679
- var SurfaceManifestOperationSchema = z2.object({
680
- kind: z2.enum(["contract", "runtime"]),
681
- service: z2.string(),
682
- action: z2.string(),
683
- method: HttpMethodSchema,
684
- scope: z2.string().nullable(),
685
- description: z2.string(),
686
- schemas: SurfaceSchemaDigestsSchema,
687
- mcp: SurfaceManifestOperationMcpSchema,
688
- toolView: SurfaceManifestOperationToolViewSchema.optional(),
689
- http: z2.array(z2.object({ method: HttpMethodSchema, path: z2.string() }))
690
- });
691
- var SurfaceManifestToolSchema = z2.object({
692
- kind: z2.enum(["contract", "runtime"]),
693
- service: z2.string(),
694
- action: z2.string(),
695
- name: z2.string(),
696
- input: z2.string()
697
- });
698
- var SurfaceManifestToolSurfaceSchema = z2.object({
699
- transport: ToolTransportSchema,
700
- surface: z2.string().nullable(),
701
- tools: z2.array(SurfaceManifestToolSchema)
702
- });
703
- var SurfaceManifestCliCommandSchema = z2.object({
704
- name: z2.string(),
705
- description: z2.string(),
706
- input: z2.string(),
707
- output: z2.string().nullable()
708
- });
709
- var SurfaceManifestExtensionSchema = z2.object({
710
- name: z2.string(),
711
- transport: SurfaceTransportSchema
712
- });
713
- var SurfaceRealtimeSchemaPairSchema = z2.object({
714
- input: z2.string(),
715
- output: z2.string()
716
- });
717
- var SurfaceManifestRealtimeEventSchema = z2.object({
718
- contract: z2.string(),
719
- direction: z2.enum(["serverToClient", "clientToServer"]),
720
- event: z2.string(),
721
- args: SurfaceRealtimeSchemaPairSchema,
722
- acknowledgement: SurfaceRealtimeSchemaPairSchema.nullable()
723
- });
724
- var SurfaceManifestSchema = z2.object({
725
- manifestVersion: z2.literal(SURFACE_MANIFEST_VERSION),
726
- digestVersion: z2.literal(1),
727
- operations: z2.array(SurfaceManifestOperationSchema),
728
- toolSurfaces: z2.array(SurfaceManifestToolSurfaceSchema),
729
- realtimeContracts: z2.array(z2.string()),
730
- realtime: z2.array(SurfaceManifestRealtimeEventSchema),
731
- cliOnly: z2.array(SurfaceManifestCliCommandSchema),
732
- extensions: z2.array(SurfaceManifestExtensionSchema)
733
- });
734
- var serializeSurfaceValue = serializeCanonicalJson;
659
+
660
+ // src/testing/surface-manifest-digest.ts
661
+ import { createHash } from "node:crypto";
735
662
  function digestValue(value) {
736
- return createHash("sha256").update(serializeSurfaceValue(value)).digest("hex").slice(0, 16);
663
+ return createHash("sha256").update(serializeCanonicalJson(value)).digest("hex").slice(0, 16);
737
664
  }
738
665
  function canonicalSchemaValue(value, parentKey) {
739
666
  if (Array.isArray(value)) {
@@ -809,7 +736,7 @@ function mcpRoundsOf(source) {
809
736
  }
810
737
  function operationFingerprint(source) {
811
738
  const mcp = mcpRoundsOf(source);
812
- return serializeSurfaceValue({
739
+ return serializeCanonicalJson({
813
740
  method: source.method,
814
741
  serviceName: source.serviceName,
815
742
  key: source.key,
@@ -841,6 +768,139 @@ function operationFingerprint(source) {
841
768
  function sortTools(tools) {
842
769
  return tools.sort((left, right) => compareCodeUnits(left.name, right.name) || compareCodeUnits(left.service, right.service) || compareCodeUnits(left.action, right.action) || compareCodeUnits(left.kind, right.kind));
843
770
  }
771
+ function runtimeOperationSource(source) {
772
+ return {
773
+ definitionToken: source,
774
+ method: source.identity.method,
775
+ serviceName: source.identity.serviceName,
776
+ key: source.identity.action,
777
+ desc: source.description,
778
+ ...source.identity.scope !== undefined && { scope: source.identity.scope },
779
+ inputSchema: source.input,
780
+ ...source.output !== undefined && { outputSchema: source.output },
781
+ toolName: source.name,
782
+ expose: source.transports,
783
+ ...source.annotations !== undefined && { annotations: source.annotations },
784
+ ...source.ui !== undefined && { ui: source.ui },
785
+ ...source.identity.meta !== undefined && { meta: source.identity.meta },
786
+ ...source.mcp !== undefined && { mcp: source.mcp }
787
+ };
788
+ }
789
+
790
+ // src/testing/surface-manifest.ts
791
+ var SURFACE_MANIFEST_VERSION = 3;
792
+ var HttpMethodSchema = z2.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]);
793
+ var ToolTransportSchema = z2.enum(TOOL_TRANSPORTS);
794
+ var SurfaceTransportSchema = z2.enum(["HTTP", "MCP", "AGENT", "CLI", "REALTIME"]);
795
+ var SurfaceSchemaDigestsSchema = z2.object({
796
+ params: z2.string().nullable(),
797
+ input: z2.string().nullable(),
798
+ output: z2.string().nullable(),
799
+ multipart: z2.string().nullable()
800
+ });
801
+ var SurfaceManifestOperationMcpSchema = z2.object({
802
+ inputRequired: z2.union([
803
+ z2.array(z2.object({ key: z2.string(), message: z2.string(), schema: z2.string().nullable() })),
804
+ z2.literal("resolved-per-call")
805
+ ])
806
+ }).nullable();
807
+ var SurfaceManifestOperationToolViewSchema = z2.object({
808
+ defaults: z2.string().nullable(),
809
+ output: z2.string().nullable(),
810
+ project: z2.boolean()
811
+ });
812
+ var SurfaceManifestOperationSchema = z2.object({
813
+ kind: z2.enum(["contract", "runtime"]),
814
+ service: z2.string(),
815
+ action: z2.string(),
816
+ method: HttpMethodSchema,
817
+ scope: z2.string().nullable(),
818
+ description: z2.string(),
819
+ schemas: SurfaceSchemaDigestsSchema,
820
+ mcp: SurfaceManifestOperationMcpSchema,
821
+ toolView: SurfaceManifestOperationToolViewSchema.optional(),
822
+ http: z2.array(z2.object({ method: HttpMethodSchema, path: z2.string() }))
823
+ });
824
+ var SurfaceManifestToolSchema = z2.object({
825
+ kind: z2.enum(["contract", "runtime"]),
826
+ service: z2.string(),
827
+ action: z2.string(),
828
+ name: z2.string(),
829
+ input: z2.string()
830
+ });
831
+ var SurfaceManifestToolSurfaceSchema = z2.object({
832
+ transport: ToolTransportSchema,
833
+ surface: z2.string().nullable(),
834
+ tools: z2.array(SurfaceManifestToolSchema)
835
+ });
836
+ var SurfaceManifestCliCommandSchema = z2.object({
837
+ name: z2.string(),
838
+ description: z2.string(),
839
+ input: z2.string(),
840
+ output: z2.string().nullable()
841
+ });
842
+ var SurfaceManifestExtensionSchema = z2.object({
843
+ name: z2.string(),
844
+ transport: SurfaceTransportSchema
845
+ });
846
+ var SurfaceRealtimeSchemaPairSchema = z2.object({
847
+ input: z2.string(),
848
+ output: z2.string()
849
+ });
850
+ var SurfaceManifestRealtimeEventSchema = z2.object({
851
+ contract: z2.string(),
852
+ direction: z2.enum(["serverToClient", "clientToServer"]),
853
+ event: z2.string(),
854
+ args: SurfaceRealtimeSchemaPairSchema,
855
+ acknowledgement: SurfaceRealtimeSchemaPairSchema.nullable()
856
+ });
857
+ var SurfaceManifestSchema = z2.object({
858
+ manifestVersion: z2.literal(SURFACE_MANIFEST_VERSION),
859
+ digestVersion: z2.literal(1),
860
+ operations: z2.array(SurfaceManifestOperationSchema),
861
+ toolSurfaces: z2.array(SurfaceManifestToolSurfaceSchema),
862
+ realtimeContracts: z2.array(z2.string()),
863
+ realtime: z2.array(SurfaceManifestRealtimeEventSchema),
864
+ cliOnly: z2.array(SurfaceManifestCliCommandSchema),
865
+ extensions: z2.array(SurfaceManifestExtensionSchema)
866
+ });
867
+ var serializeSurfaceValue = serializeCanonicalJson;
868
+ function realtimeEvents(config, realtimeContracts) {
869
+ const realtime = [];
870
+ for (const contractName of realtimeContracts) {
871
+ const contract = config.realtime?.[contractName];
872
+ if (!contract)
873
+ continue;
874
+ for (const direction of ["serverToClient", "clientToServer"]) {
875
+ const registry = contract[direction];
876
+ for (const event of Object.keys(registry).sort(compareCodeUnits)) {
877
+ const definition = registry[event];
878
+ if (!definition)
879
+ continue;
880
+ const argsInput = schemaDigest(definition.args, "input");
881
+ const argsOutput = schemaDigest(definition.args, "output");
882
+ if (!argsInput || !argsOutput)
883
+ throw new Error("Realtime args schema digest missing");
884
+ let acknowledgement = null;
885
+ if (definition.ack) {
886
+ const input = schemaDigest(definition.ack, "input");
887
+ const output = schemaDigest(definition.ack, "output");
888
+ if (!input || !output)
889
+ throw new Error("Realtime ack schema digest missing");
890
+ acknowledgement = { input, output };
891
+ }
892
+ realtime.push({
893
+ contract: contractName,
894
+ direction,
895
+ event,
896
+ args: { input: argsInput, output: argsOutput },
897
+ acknowledgement
898
+ });
899
+ }
900
+ }
901
+ }
902
+ return realtime;
903
+ }
844
904
  function buildSurfaceManifest(config) {
845
905
  const operations = new Map;
846
906
  const operationFingerprints = new Map;
@@ -891,30 +951,7 @@ function buildSurfaceManifest(config) {
891
951
  })) : projected;
892
952
  const tools = [];
893
953
  for (const entry of collected) {
894
- const source = entry.kind === "contract" ? entry.source : {
895
- definitionToken: entry.source,
896
- method: entry.source.identity.method,
897
- serviceName: entry.source.identity.serviceName,
898
- key: entry.source.identity.action,
899
- desc: entry.source.description,
900
- ...entry.source.identity.scope !== undefined && {
901
- scope: entry.source.identity.scope
902
- },
903
- inputSchema: entry.source.input,
904
- ...entry.source.output !== undefined && {
905
- outputSchema: entry.source.output
906
- },
907
- toolName: entry.source.name,
908
- expose: entry.source.transports,
909
- ...entry.source.annotations !== undefined && {
910
- annotations: entry.source.annotations
911
- },
912
- ...entry.source.ui !== undefined && { ui: entry.source.ui },
913
- ...entry.source.identity.meta !== undefined && {
914
- meta: entry.source.identity.meta
915
- },
916
- ...entry.source.mcp !== undefined && { mcp: entry.source.mcp }
917
- };
954
+ const source = entry.kind === "contract" ? entry.source : runtimeOperationSource(entry.source);
918
955
  const operation = addOperation(entry.kind, source);
919
956
  tools.push({
920
957
  kind: entry.kind,
@@ -949,40 +986,8 @@ function buildSurfaceManifest(config) {
949
986
  const agent = config.toolSurfaces?.AGENT;
950
987
  addToolProjection("AGENT", null, agent ?? shared, agent ?? {});
951
988
  addToolProjection("CLI", null, config.toolSurfaces?.CLI ?? shared);
952
- const realtime = [];
953
989
  const realtimeContracts = Object.keys(config.realtime ?? {}).sort(compareCodeUnits);
954
- for (const contractName of realtimeContracts) {
955
- const contract = config.realtime?.[contractName];
956
- if (!contract)
957
- continue;
958
- for (const direction of ["serverToClient", "clientToServer"]) {
959
- const registry = contract[direction];
960
- for (const event of Object.keys(registry).sort(compareCodeUnits)) {
961
- const definition = registry[event];
962
- if (!definition)
963
- continue;
964
- const argsInput = schemaDigest(definition.args, "input");
965
- const argsOutput = schemaDigest(definition.args, "output");
966
- if (!argsInput || !argsOutput)
967
- throw new Error("Realtime args schema digest missing");
968
- let acknowledgement = null;
969
- if (definition.ack) {
970
- const input = schemaDigest(definition.ack, "input");
971
- const output = schemaDigest(definition.ack, "output");
972
- if (!input || !output)
973
- throw new Error("Realtime ack schema digest missing");
974
- acknowledgement = { input, output };
975
- }
976
- realtime.push({
977
- contract: contractName,
978
- direction,
979
- event,
980
- args: { input: argsInput, output: argsOutput },
981
- acknowledgement
982
- });
983
- }
984
- }
985
- }
990
+ const realtime = realtimeEvents(config, realtimeContracts);
986
991
  const cliOnly = (config.cliCommands ?? []).map((command) => ({
987
992
  name: command.name,
988
993
  description: command.description,
@@ -1050,143 +1055,6 @@ var TransportObservationSchema = z3.discriminatedUnion("outcome", [
1050
1055
  }),
1051
1056
  z3.object({ outcome: z3.literal("timeout"), ...ObservationFields })
1052
1057
  ]);
1053
- function scenarioOutcome(scenario) {
1054
- if (scenario === "event" || scenario === "acknowledgement")
1055
- return "success";
1056
- if (scenario === "invalid_arguments" || scenario === "invalid_acknowledgement" || scenario === "peer_rejection") {
1057
- return "realtime_rejected";
1058
- }
1059
- if (scenario === "disconnected" || scenario === "in_flight_disconnect") {
1060
- return "disconnected";
1061
- }
1062
- return "timeout";
1063
- }
1064
- function assertScenarioExpectation(scenario, expected) {
1065
- const outcome = scenarioOutcome(scenario);
1066
- if (expected.outcome !== outcome) {
1067
- throw new TypeError(`Realtime probe scenario "${scenario}" requires outcome "${outcome}"`);
1068
- }
1069
- if (expected.outcome === "realtime_rejected" && (scenario === "invalid_arguments" && expected.rejection.phase !== "arguments" || scenario === "invalid_acknowledgement" && expected.rejection.phase !== "acknowledgement")) {
1070
- throw new TypeError(`Realtime probe scenario "${scenario}" has incompatible rejection phase`);
1071
- }
1072
- if (scenario === "invalid_arguments" && expected.handlerCalls !== 0) {
1073
- throw new TypeError('Realtime probe scenario "invalid_arguments" requires handlerCalls: 0');
1074
- }
1075
- if (scenario === "peer_rejection" && (expected.outcome !== "realtime_rejected" || expected.rejection.reason !== "rejected-by-peer")) {
1076
- throw new TypeError('Realtime probe scenario "peer_rejection" requires a rejected-by-peer outcome');
1077
- }
1078
- if (expected.outcome === "disconnected") {
1079
- const phase = scenario === "disconnected" ? "before-invoke" : "in-flight";
1080
- if (expected.disconnect.phase !== phase) {
1081
- throw new TypeError(`Realtime probe scenario "${scenario}" requires disconnect phase "${phase}"`);
1082
- }
1083
- }
1084
- }
1085
- function defineRealtimeProbe(config) {
1086
- const expected = TransportObservationSchema.parse(config.expected);
1087
- assertScenarioExpectation(config.scenario, expected);
1088
- return {
1089
- name: config.name,
1090
- fixture: { scenario: config.scenario, value: config.fixture },
1091
- transports: ["REALTIME"],
1092
- expected: { REALTIME: expected },
1093
- setup: config.setup,
1094
- teardown: config.teardown
1095
- };
1096
- }
1097
- function rejectionObservation(rejected) {
1098
- return RealtimeRejectionObservationSchema.parse(rejected);
1099
- }
1100
- function createRealtimeProbeDriver({
1101
- bind,
1102
- handlerCalls
1103
- }) {
1104
- return {
1105
- async invoke(fixture, signal) {
1106
- let rejected;
1107
- const currentRejection = () => rejected;
1108
- const adapter = bind((event) => {
1109
- rejected = event;
1110
- }, fixture);
1111
- const connectedBefore = adapter.connected();
1112
- const callsBefore = handlerCalls?.();
1113
- const withCalls = (observation) => {
1114
- if (callsBefore === undefined || !handlerCalls)
1115
- return observation;
1116
- return { ...observation, handlerCalls: handlerCalls() - callsBefore };
1117
- };
1118
- try {
1119
- signal.throwIfAborted();
1120
- const data = await adapter.invoke(fixture, signal);
1121
- const observedRejection = currentRejection();
1122
- if (observedRejection) {
1123
- return withCalls({
1124
- outcome: "realtime_rejected",
1125
- code: observedRejection.error.code,
1126
- rejection: rejectionObservation(observedRejection)
1127
- });
1128
- }
1129
- return withCalls({
1130
- outcome: "success",
1131
- ...data !== undefined && { data }
1132
- });
1133
- } catch (error) {
1134
- const observedRejection = currentRejection();
1135
- if (observedRejection) {
1136
- return withCalls({
1137
- outcome: "realtime_rejected",
1138
- code: error instanceof RealtimeRequestInvalidAcknowledgementError ? error.code : observedRejection.error.code,
1139
- rejection: rejectionObservation(observedRejection)
1140
- });
1141
- }
1142
- if (error instanceof RealtimeRequestInvalidAcknowledgementError) {
1143
- return withCalls({
1144
- outcome: "realtime_rejected",
1145
- code: error.code,
1146
- rejection: {
1147
- direction: "client-inbound",
1148
- phase: "acknowledgement",
1149
- reason: "invalid-acknowledgement-value",
1150
- fault: "peer"
1151
- }
1152
- });
1153
- }
1154
- if (error instanceof RealtimeRequestDisconnectedError) {
1155
- return withCalls({
1156
- outcome: "disconnected",
1157
- code: error.code,
1158
- disconnect: {
1159
- phase: connectedBefore ? "in-flight" : "before-invoke"
1160
- }
1161
- });
1162
- }
1163
- if (error instanceof RealtimeRequestTimeoutError) {
1164
- return withCalls({ outcome: "timeout", code: error.code });
1165
- }
1166
- if (signal.aborted && error === signal.reason) {
1167
- return withCalls({ outcome: "aborted" });
1168
- }
1169
- const parsedRejection = RealtimeRejectionObservationSchema.safeParse(typeof error === "object" && error !== null && "details" in error ? error.details : undefined);
1170
- if (parsedRejection.success) {
1171
- const code2 = typeof error === "object" && error !== null && "code" in error ? String(error.code) : "REALTIME_CONTRACT_VIOLATION";
1172
- return withCalls({
1173
- outcome: "realtime_rejected",
1174
- code: code2,
1175
- rejection: parsedRejection.data
1176
- });
1177
- }
1178
- const code = typeof error === "object" && error !== null && "code" in error ? String(error.code) : undefined;
1179
- return withCalls({
1180
- outcome: "domain_error",
1181
- ...code !== undefined && { code },
1182
- diagnostic: error instanceof Error ? error.message : String(error)
1183
- });
1184
- } finally {
1185
- await adapter.dispose?.();
1186
- }
1187
- }
1188
- };
1189
- }
1190
1058
  function sorted(values) {
1191
1059
  return [...values].sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
1192
1060
  }
@@ -1336,6 +1204,145 @@ actual: ${serializeSurfaceValue(actual)}`);
1336
1204
  throw failure;
1337
1205
  }
1338
1206
  }
1207
+
1208
+ // src/testing/realtime-probe.ts
1209
+ function scenarioOutcome(scenario) {
1210
+ if (scenario === "event" || scenario === "acknowledgement")
1211
+ return "success";
1212
+ if (scenario === "invalid_arguments" || scenario === "invalid_acknowledgement" || scenario === "peer_rejection") {
1213
+ return "realtime_rejected";
1214
+ }
1215
+ if (scenario === "disconnected" || scenario === "in_flight_disconnect") {
1216
+ return "disconnected";
1217
+ }
1218
+ return "timeout";
1219
+ }
1220
+ function assertScenarioExpectation(scenario, expected) {
1221
+ const outcome = scenarioOutcome(scenario);
1222
+ if (expected.outcome !== outcome) {
1223
+ throw new TypeError(`Realtime probe scenario "${scenario}" requires outcome "${outcome}"`);
1224
+ }
1225
+ if (expected.outcome === "realtime_rejected" && (scenario === "invalid_arguments" && expected.rejection.phase !== "arguments" || scenario === "invalid_acknowledgement" && expected.rejection.phase !== "acknowledgement")) {
1226
+ throw new TypeError(`Realtime probe scenario "${scenario}" has incompatible rejection phase`);
1227
+ }
1228
+ if (scenario === "invalid_arguments" && expected.handlerCalls !== 0) {
1229
+ throw new TypeError('Realtime probe scenario "invalid_arguments" requires handlerCalls: 0');
1230
+ }
1231
+ if (scenario === "peer_rejection" && (expected.outcome !== "realtime_rejected" || expected.rejection.reason !== "rejected-by-peer")) {
1232
+ throw new TypeError('Realtime probe scenario "peer_rejection" requires a rejected-by-peer outcome');
1233
+ }
1234
+ if (expected.outcome === "disconnected") {
1235
+ const phase = scenario === "disconnected" ? "before-invoke" : "in-flight";
1236
+ if (expected.disconnect.phase !== phase) {
1237
+ throw new TypeError(`Realtime probe scenario "${scenario}" requires disconnect phase "${phase}"`);
1238
+ }
1239
+ }
1240
+ }
1241
+ function defineRealtimeProbe(config) {
1242
+ const expected = TransportObservationSchema.parse(config.expected);
1243
+ assertScenarioExpectation(config.scenario, expected);
1244
+ return {
1245
+ name: config.name,
1246
+ fixture: { scenario: config.scenario, value: config.fixture },
1247
+ transports: ["REALTIME"],
1248
+ expected: { REALTIME: expected },
1249
+ setup: config.setup,
1250
+ teardown: config.teardown
1251
+ };
1252
+ }
1253
+ function rejectionObservation(rejected) {
1254
+ return RealtimeRejectionObservationSchema.parse(rejected);
1255
+ }
1256
+ function createRealtimeProbeDriver({
1257
+ bind,
1258
+ handlerCalls
1259
+ }) {
1260
+ return {
1261
+ async invoke(fixture, signal) {
1262
+ let rejected;
1263
+ const currentRejection = () => rejected;
1264
+ const adapter = bind((event) => {
1265
+ rejected = event;
1266
+ }, fixture);
1267
+ const connectedBefore = adapter.connected();
1268
+ const callsBefore = handlerCalls?.();
1269
+ const withCalls = (observation) => {
1270
+ if (callsBefore === undefined || !handlerCalls)
1271
+ return observation;
1272
+ return { ...observation, handlerCalls: handlerCalls() - callsBefore };
1273
+ };
1274
+ try {
1275
+ signal.throwIfAborted();
1276
+ const data = await adapter.invoke(fixture, signal);
1277
+ const observedRejection = currentRejection();
1278
+ if (observedRejection) {
1279
+ return withCalls({
1280
+ outcome: "realtime_rejected",
1281
+ code: observedRejection.error.code,
1282
+ rejection: rejectionObservation(observedRejection)
1283
+ });
1284
+ }
1285
+ return withCalls({
1286
+ outcome: "success",
1287
+ ...data !== undefined && { data }
1288
+ });
1289
+ } catch (error) {
1290
+ const observedRejection = currentRejection();
1291
+ if (observedRejection) {
1292
+ return withCalls({
1293
+ outcome: "realtime_rejected",
1294
+ code: error instanceof RealtimeRequestInvalidAcknowledgementError ? error.code : observedRejection.error.code,
1295
+ rejection: rejectionObservation(observedRejection)
1296
+ });
1297
+ }
1298
+ if (error instanceof RealtimeRequestInvalidAcknowledgementError) {
1299
+ return withCalls({
1300
+ outcome: "realtime_rejected",
1301
+ code: error.code,
1302
+ rejection: {
1303
+ direction: "client-inbound",
1304
+ phase: "acknowledgement",
1305
+ reason: "invalid-acknowledgement-value",
1306
+ fault: "peer"
1307
+ }
1308
+ });
1309
+ }
1310
+ if (error instanceof RealtimeRequestDisconnectedError) {
1311
+ return withCalls({
1312
+ outcome: "disconnected",
1313
+ code: error.code,
1314
+ disconnect: {
1315
+ phase: connectedBefore ? "in-flight" : "before-invoke"
1316
+ }
1317
+ });
1318
+ }
1319
+ if (error instanceof RealtimeRequestTimeoutError) {
1320
+ return withCalls({ outcome: "timeout", code: error.code });
1321
+ }
1322
+ if (signal.aborted && error === signal.reason) {
1323
+ return withCalls({ outcome: "aborted" });
1324
+ }
1325
+ const parsedRejection = RealtimeRejectionObservationSchema.safeParse(typeof error === "object" && error !== null && "details" in error ? error.details : undefined);
1326
+ if (parsedRejection.success) {
1327
+ const code2 = typeof error === "object" && error !== null && "code" in error ? String(error.code) : "REALTIME_CONTRACT_VIOLATION";
1328
+ return withCalls({
1329
+ outcome: "realtime_rejected",
1330
+ code: code2,
1331
+ rejection: parsedRejection.data
1332
+ });
1333
+ }
1334
+ const code = typeof error === "object" && error !== null && "code" in error ? String(error.code) : undefined;
1335
+ return withCalls({
1336
+ outcome: "domain_error",
1337
+ ...code !== undefined && { code },
1338
+ diagnostic: error instanceof Error ? error.message : String(error)
1339
+ });
1340
+ } finally {
1341
+ await adapter.dispose?.();
1342
+ }
1343
+ }
1344
+ };
1345
+ }
1339
1346
  export {
1340
1347
  serializeSurfaceValue,
1341
1348
  runSurfaceProbes,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  defineRuntimeTool
3
- } from "../../index-v38qyerb.js";
3
+ } from "../../index-xw3s75nj.js";
4
4
  import {
5
5
  declaresDraft07,
6
6
  withDefsDialect
7
- } from "../../index-dydjcp8z.js";
7
+ } from "../../index-np4m8hd3.js";
8
8
  import"../../index-eqqvgdb3.js";
9
9
  import"../../index-znfs20ss.js";
10
10
  import"../../index-p5r7qpdd.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createToolInvoker
3
- } from "../../index-rewkc2hj.js";
4
- import"../../index-2cr1cqhn.js";
5
- import"../../index-j05z5gn4.js";
3
+ } from "../../index-p9sh0xx4.js";
4
+ import"../../index-khtgb21r.js";
5
+ import"../../index-55hkhm67.js";
6
6
  import"../../index-zfrhfn82.js";
7
7
  import"../../index-35mh5bhj.js";
8
8
  import"../../index-zcgf3gqf.js";
9
9
  import"../../index-1zbbzgfh.js";
10
- import"../../index-dydjcp8z.js";
10
+ import"../../index-np4m8hd3.js";
11
11
  import"../../index-eqqvgdb3.js";
12
12
  import"../../index-znfs20ss.js";
13
13
  import"../../index-p5r7qpdd.js";