stitchkit 0.93.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 (1082) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/README.md +5 -2
  3. package/dist/agent-runtime/children-control.d.ts +6 -0
  4. package/dist/agent-runtime/children-control.d.ts.map +1 -0
  5. package/dist/agent-runtime/children-spawn.d.ts +6 -0
  6. package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
  7. package/dist/agent-runtime/children-state.d.ts +46 -0
  8. package/dist/agent-runtime/children-state.d.ts.map +1 -0
  9. package/dist/agent-runtime/children-usage.d.ts +8 -0
  10. package/dist/agent-runtime/children-usage.d.ts.map +1 -0
  11. package/dist/agent-runtime/children.d.ts +11 -14
  12. package/dist/agent-runtime/children.d.ts.map +1 -1
  13. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  14. package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
  15. package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
  16. package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
  17. package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
  18. package/dist/agent-runtime/contained-darwin.d.ts +38 -0
  19. package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
  20. package/dist/agent-runtime/contained-files.d.ts +11 -26
  21. package/dist/agent-runtime/contained-files.d.ts.map +1 -1
  22. package/dist/agent-runtime/contained-scan.d.ts +21 -0
  23. package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
  24. package/dist/agent-runtime/contained-write.d.ts +9 -0
  25. package/dist/agent-runtime/contained-write.d.ts.map +1 -0
  26. package/dist/agent-runtime/deferred-tool-types.d.ts +4 -3
  27. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  28. package/dist/agent-runtime/events.d.ts +1 -1
  29. package/dist/agent-runtime/events.d.ts.map +1 -1
  30. package/dist/agent-runtime/harness-control.d.ts +0 -1
  31. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  32. package/dist/agent-runtime/harness.d.ts +0 -5
  33. package/dist/agent-runtime/harness.d.ts.map +1 -1
  34. package/dist/agent-runtime/managed-tools.d.ts +3 -2
  35. package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
  36. package/dist/agent-runtime/observability.d.ts +1 -1
  37. package/dist/agent-runtime/observability.d.ts.map +1 -1
  38. package/dist/agent-runtime/openrouter.d.ts +29 -0
  39. package/dist/agent-runtime/openrouter.d.ts.map +1 -0
  40. package/dist/agent-runtime/projections.d.ts +1 -1
  41. package/dist/agent-runtime/projections.d.ts.map +1 -1
  42. package/dist/agent-runtime/run-acquisition.d.ts +17 -0
  43. package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
  44. package/dist/agent-runtime/run-execution-state.d.ts +133 -0
  45. package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
  46. package/dist/agent-runtime/run-execution.d.ts +17 -33
  47. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  48. package/dist/agent-runtime/run-failure.d.ts +18 -0
  49. package/dist/agent-runtime/run-failure.d.ts.map +1 -0
  50. package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
  51. package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
  52. package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
  53. package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
  54. package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
  55. package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
  56. package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
  57. package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
  58. package/dist/agent-runtime/run-terminal.d.ts +11 -0
  59. package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
  60. package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
  61. package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
  62. package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
  63. package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
  64. package/dist/agent-runtime/runtime-control.d.ts +9 -0
  65. package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
  66. package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
  67. package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
  68. package/dist/agent-runtime/runtime-state.d.ts +36 -0
  69. package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
  70. package/dist/agent-runtime/runtime-submit.d.ts +5 -0
  71. package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
  72. package/dist/agent-runtime/runtime.d.ts +10 -5
  73. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  74. package/dist/agent-runtime/schedule-records.d.ts +34 -0
  75. package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
  76. package/dist/agent-runtime/schedules.d.ts +34 -0
  77. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  78. package/dist/agent-runtime/sqlite-bun.d.ts +12 -0
  79. package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
  80. package/dist/agent-runtime/sqlite-events.d.ts +5 -0
  81. package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
  82. package/dist/agent-runtime/sqlite-history.d.ts +7 -0
  83. package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
  84. package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
  85. package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
  86. package/dist/agent-runtime/sqlite-node.d.ts +12 -0
  87. package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
  88. package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
  89. package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
  90. package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
  91. package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
  92. package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
  93. package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
  94. package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
  95. package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
  96. package/dist/agent-runtime/sqlite.d.ts +10 -6
  97. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  98. package/dist/agent-runtime/store-archive.d.ts +16 -0
  99. package/dist/agent-runtime/store-archive.d.ts.map +1 -0
  100. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
  101. package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
  102. package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
  103. package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
  104. package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
  105. package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
  106. package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
  107. package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
  108. package/dist/agent-runtime/store-conformance.d.ts +40 -0
  109. package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
  110. package/dist/agent-runtime/store-create.d.ts +11 -0
  111. package/dist/agent-runtime/store-create.d.ts.map +1 -0
  112. package/dist/agent-runtime/store-driver-contract.d.ts +814 -0
  113. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
  114. package/dist/agent-runtime/store-events.d.ts +7 -89
  115. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  116. package/dist/agent-runtime/store-memory.d.ts +4 -0
  117. package/dist/agent-runtime/store-memory.d.ts.map +1 -0
  118. package/dist/agent-runtime/store-mutate.d.ts +13 -0
  119. package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
  120. package/dist/agent-runtime/store-purge.d.ts +1 -1
  121. package/dist/agent-runtime/store-purge.d.ts.map +1 -1
  122. package/dist/agent-runtime/store-reads.d.ts +29 -0
  123. package/dist/agent-runtime/store-reads.d.ts.map +1 -0
  124. package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
  125. package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
  126. package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
  127. package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
  128. package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
  129. package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
  130. package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
  131. package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
  132. package/dist/agent-runtime/store-reducer.d.ts +24 -0
  133. package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
  134. package/dist/agent-runtime/store-snapshot.d.ts +19 -0
  135. package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
  136. package/dist/agent-runtime/store.d.ts +1 -1
  137. package/dist/agent-runtime/store.d.ts.map +1 -1
  138. package/dist/application/admission-rate.d.ts +21 -0
  139. package/dist/application/admission-rate.d.ts.map +1 -0
  140. package/dist/application/admission-run.d.ts +8 -0
  141. package/dist/application/admission-run.d.ts.map +1 -0
  142. package/dist/application/admission.d.ts +1 -1
  143. package/dist/application/admission.d.ts.map +1 -1
  144. package/dist/application/diagnostic-journal-lock.d.ts +9 -34
  145. package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
  146. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  147. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  148. package/dist/application/events.d.ts +1 -1
  149. package/dist/application/events.d.ts.map +1 -1
  150. package/dist/application/file-state-store.d.ts +23 -0
  151. package/dist/application/file-state-store.d.ts.map +1 -0
  152. package/dist/application/health.d.ts +1 -1
  153. package/dist/application/health.d.ts.map +1 -1
  154. package/dist/application/kernel-admission.d.ts +8 -0
  155. package/dist/application/kernel-admission.d.ts.map +1 -0
  156. package/dist/application/kernel-contract.d.ts +142 -0
  157. package/dist/application/kernel-contract.d.ts.map +1 -0
  158. package/dist/application/kernel-resource-context.d.ts +24 -0
  159. package/dist/application/kernel-resource-context.d.ts.map +1 -0
  160. package/dist/application/kernel-restart.d.ts +5 -0
  161. package/dist/application/kernel-restart.d.ts.map +1 -0
  162. package/dist/application/kernel-rollback.d.ts +4 -0
  163. package/dist/application/kernel-rollback.d.ts.map +1 -0
  164. package/dist/application/kernel-shutdown.d.ts +6 -0
  165. package/dist/application/kernel-shutdown.d.ts.map +1 -0
  166. package/dist/application/kernel-start.d.ts +20 -0
  167. package/dist/application/kernel-start.d.ts.map +1 -0
  168. package/dist/application/kernel-state.d.ts +116 -0
  169. package/dist/application/kernel-state.d.ts.map +1 -0
  170. package/dist/application/kernel.d.ts +9 -140
  171. package/dist/application/kernel.d.ts.map +1 -1
  172. package/dist/application/latest-sink.d.ts +1 -1
  173. package/dist/application/latest-sink.d.ts.map +1 -1
  174. package/dist/application/notification-outbox.d.ts.map +1 -1
  175. package/dist/application/opentelemetry.d.ts +1 -1
  176. package/dist/application/opentelemetry.d.ts.map +1 -1
  177. package/dist/application/schedule.d.ts +0 -1
  178. package/dist/application/schedule.d.ts.map +1 -1
  179. package/dist/application/watch-hub-core.d.ts +122 -0
  180. package/dist/application/watch-hub-core.d.ts.map +1 -0
  181. package/dist/application/watch-hub.d.ts +3 -3
  182. package/dist/application/watch-hub.d.ts.map +1 -1
  183. package/dist/browser/client-executors.d.ts +14 -0
  184. package/dist/browser/client-executors.d.ts.map +1 -0
  185. package/dist/browser/client-multipart.d.ts +1 -1
  186. package/dist/browser/client-multipart.d.ts.map +1 -1
  187. package/dist/browser/client-url.d.ts +1 -1
  188. package/dist/browser/client-url.d.ts.map +1 -1
  189. package/dist/browser/client.d.ts +3 -2
  190. package/dist/browser/client.d.ts.map +1 -1
  191. package/dist/browser/contract-stream.d.ts +1 -1
  192. package/dist/browser/contract-stream.d.ts.map +1 -1
  193. package/dist/browser/http-fetch.d.ts +22 -0
  194. package/dist/browser/http-fetch.d.ts.map +1 -0
  195. package/dist/browser/http.d.ts +2 -4
  196. package/dist/browser/http.d.ts.map +1 -1
  197. package/dist/browser/live-state-core.d.ts +63 -0
  198. package/dist/browser/live-state-core.d.ts.map +1 -0
  199. package/dist/browser/live-state.d.ts.map +1 -1
  200. package/dist/browser/realtime-client.d.ts +26 -0
  201. package/dist/browser/realtime-client.d.ts.map +1 -0
  202. package/dist/browser/resumable.d.ts +1 -28
  203. package/dist/browser/resumable.d.ts.map +1 -1
  204. package/dist/browser/retained.d.ts.map +1 -0
  205. package/dist/browser/socket-io-connection.d.ts +82 -0
  206. package/dist/browser/socket-io-connection.d.ts.map +1 -0
  207. package/dist/browser/socket-io-peer.d.ts +20 -0
  208. package/dist/browser/socket-io-peer.d.ts.map +1 -0
  209. package/dist/browser/socket-io-trace.d.ts +31 -0
  210. package/dist/browser/socket-io-trace.d.ts.map +1 -0
  211. package/dist/browser/socket-io.d.ts +24 -18
  212. package/dist/browser/socket-io.d.ts.map +1 -1
  213. package/dist/browser/stream.d.ts +14 -2
  214. package/dist/browser/stream.d.ts.map +1 -1
  215. package/dist/contract/client-types.d.ts +134 -0
  216. package/dist/contract/client-types.d.ts.map +1 -0
  217. package/dist/contract/define-validation.d.ts +30 -0
  218. package/dist/contract/define-validation.d.ts.map +1 -0
  219. package/dist/contract/define.d.ts +47 -394
  220. package/dist/contract/define.d.ts.map +1 -1
  221. package/dist/contract/normalize.d.ts +56 -0
  222. package/dist/contract/normalize.d.ts.map +1 -0
  223. package/dist/contract/runtime-context.d.ts +131 -0
  224. package/dist/contract/runtime-context.d.ts.map +1 -0
  225. package/dist/contract/tool-options.d.ts +105 -0
  226. package/dist/contract/tool-options.d.ts.map +1 -0
  227. package/dist/contract/tool-view.d.ts +148 -0
  228. package/dist/contract/tool-view.d.ts.map +1 -0
  229. package/dist/declaration/declaration.d.ts.map +1 -0
  230. package/dist/durability/contract.d.ts +259 -0
  231. package/dist/durability/contract.d.ts.map +1 -0
  232. package/dist/durability/effect.d.ts +24 -0
  233. package/dist/durability/effect.d.ts.map +1 -0
  234. package/dist/durability/engine.d.ts +14 -0
  235. package/dist/durability/engine.d.ts.map +1 -0
  236. package/dist/durability/events.d.ts +103 -0
  237. package/dist/durability/events.d.ts.map +1 -0
  238. package/dist/durability/json.d.ts +3 -0
  239. package/dist/durability/json.d.ts.map +1 -0
  240. package/dist/durability/ledger.d.ts +27 -0
  241. package/dist/durability/ledger.d.ts.map +1 -0
  242. package/dist/durability/parks.d.ts +22 -0
  243. package/dist/durability/parks.d.ts.map +1 -0
  244. package/dist/durability/scheduler.d.ts +30 -0
  245. package/dist/durability/scheduler.d.ts.map +1 -0
  246. package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
  247. package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
  248. package/dist/entrypoints/agent-runtime/browser.js +124 -0
  249. package/dist/entrypoints/agent-runtime/coding-tools.d.ts +2 -0
  250. package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
  251. package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
  252. package/dist/entrypoints/agent-runtime/harness.d.ts +2 -0
  253. package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
  254. package/dist/entrypoints/agent-runtime/harness.js +739 -0
  255. package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
  256. package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
  257. package/dist/entrypoints/agent-runtime/openrouter.js +270 -0
  258. package/dist/entrypoints/agent-runtime/sandbox.d.ts +5 -0
  259. package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
  260. package/dist/entrypoints/agent-runtime/sandbox.js +797 -0
  261. package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
  262. package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
  263. package/dist/entrypoints/agent-runtime/sqlite/bun.js +44 -0
  264. package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
  265. package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
  266. package/dist/entrypoints/agent-runtime/sqlite/node.js +46 -0
  267. package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
  268. package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
  269. package/dist/entrypoints/agent-runtime/testing.js +1116 -0
  270. package/dist/entrypoints/agent-runtime.d.ts +42 -0
  271. package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
  272. package/dist/entrypoints/agent-runtime.js +2670 -0
  273. package/dist/entrypoints/application/diagnostic-journal.d.ts +21 -0
  274. package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
  275. package/dist/entrypoints/application/diagnostic-journal.js +492 -0
  276. package/dist/entrypoints/application/grammy.d.ts +2 -0
  277. package/dist/entrypoints/application/grammy.d.ts.map +1 -0
  278. package/dist/entrypoints/application/grammy.js +169 -0
  279. package/dist/entrypoints/application/opentelemetry.d.ts +2 -0
  280. package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
  281. package/dist/entrypoints/application/opentelemetry.js +250 -0
  282. package/dist/entrypoints/application/schemas.d.ts +15 -0
  283. package/dist/entrypoints/application/schemas.d.ts.map +1 -0
  284. package/dist/entrypoints/application/schemas.js +27 -0
  285. package/dist/entrypoints/application.d.ts +23 -0
  286. package/dist/entrypoints/application.d.ts.map +1 -0
  287. package/dist/entrypoints/application.js +2016 -0
  288. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
  289. package/dist/entrypoints/bin/upgrade-cli.js +177 -0
  290. package/dist/entrypoints/cli.d.ts +44 -0
  291. package/dist/entrypoints/cli.d.ts.map +1 -0
  292. package/dist/entrypoints/cli.js +773 -0
  293. package/dist/entrypoints/contract.d.ts +12 -0
  294. package/dist/entrypoints/contract.d.ts.map +1 -0
  295. package/dist/entrypoints/contract.js +64 -0
  296. package/dist/entrypoints/declaration.d.ts +2 -0
  297. package/dist/entrypoints/declaration.d.ts.map +1 -0
  298. package/dist/entrypoints/declaration.js +183 -0
  299. package/dist/entrypoints/files.d.ts +5 -0
  300. package/dist/entrypoints/files.d.ts.map +1 -0
  301. package/dist/entrypoints/files.js +111 -0
  302. package/dist/entrypoints/geo.d.ts +3 -0
  303. package/dist/entrypoints/geo.d.ts.map +1 -0
  304. package/dist/entrypoints/geo.js +245 -0
  305. package/dist/entrypoints/google.d.ts +2 -0
  306. package/dist/entrypoints/google.d.ts.map +1 -0
  307. package/dist/entrypoints/google.js +175 -0
  308. package/dist/entrypoints/index.d.ts +17 -0
  309. package/dist/entrypoints/index.d.ts.map +1 -0
  310. package/dist/entrypoints/index.js +764 -0
  311. package/dist/entrypoints/live.d.ts +19 -0
  312. package/dist/entrypoints/live.d.ts.map +1 -0
  313. package/dist/entrypoints/live.js +302 -0
  314. package/dist/entrypoints/node.d.ts +19 -0
  315. package/dist/entrypoints/node.d.ts.map +1 -0
  316. package/dist/entrypoints/node.js +308 -0
  317. package/dist/entrypoints/oauth.d.ts +2 -0
  318. package/dist/entrypoints/oauth.d.ts.map +1 -0
  319. package/dist/entrypoints/oauth.js +170 -0
  320. package/dist/entrypoints/observability.d.ts +19 -0
  321. package/dist/entrypoints/observability.d.ts.map +1 -0
  322. package/dist/entrypoints/observability.js +567 -0
  323. package/dist/entrypoints/primitives.d.ts +3 -0
  324. package/dist/entrypoints/primitives.d.ts.map +1 -0
  325. package/dist/entrypoints/primitives.js +749 -0
  326. package/dist/entrypoints/react.d.ts +5 -0
  327. package/dist/entrypoints/react.d.ts.map +1 -0
  328. package/dist/entrypoints/react.js +403 -0
  329. package/dist/entrypoints/release.d.ts +15 -0
  330. package/dist/entrypoints/release.d.ts.map +1 -0
  331. package/dist/entrypoints/release.js +196 -0
  332. package/dist/entrypoints/remote.d.ts +9 -0
  333. package/dist/entrypoints/remote.d.ts.map +1 -0
  334. package/dist/entrypoints/remote.js +66 -0
  335. package/dist/entrypoints/server.d.ts +39 -0
  336. package/dist/entrypoints/server.d.ts.map +1 -0
  337. package/dist/entrypoints/server.js +2009 -0
  338. package/dist/entrypoints/telegram.d.ts +3 -0
  339. package/dist/entrypoints/telegram.d.ts.map +1 -0
  340. package/dist/entrypoints/telegram.js +224 -0
  341. package/dist/entrypoints/testing.d.ts +10 -0
  342. package/dist/entrypoints/testing.d.ts.map +1 -0
  343. package/dist/entrypoints/testing.js +1377 -0
  344. package/dist/entrypoints/tools/connections.d.ts +19 -0
  345. package/dist/entrypoints/tools/connections.d.ts.map +1 -0
  346. package/dist/entrypoints/tools/connections.js +1110 -0
  347. package/dist/entrypoints/tools/contract.d.ts +29 -0
  348. package/dist/entrypoints/tools/contract.d.ts.map +1 -0
  349. package/dist/entrypoints/tools/contract.js +24 -0
  350. package/dist/entrypoints/tools/invoker.d.ts +9 -0
  351. package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
  352. package/dist/entrypoints/tools/invoker.js +20 -0
  353. package/dist/entrypoints/tools.d.ts +54 -0
  354. package/dist/entrypoints/tools.d.ts.map +1 -0
  355. package/dist/entrypoints/tools.js +3009 -0
  356. package/dist/entrypoints/tracking/server.d.ts +15 -0
  357. package/dist/entrypoints/tracking/server.d.ts.map +1 -0
  358. package/dist/entrypoints/tracking.d.ts +24 -0
  359. package/dist/entrypoints/tracking.d.ts.map +1 -0
  360. package/dist/entrypoints/tracking.js +1140 -0
  361. package/dist/files/boundary.d.ts.map +1 -1
  362. package/dist/files/file-io.d.ts +14 -0
  363. package/dist/files/file-io.d.ts.map +1 -0
  364. package/dist/google/google.d.ts.map +1 -0
  365. package/dist/index-0b1ess5e.js +38 -0
  366. package/dist/index-1j8pm5t0.js +412 -0
  367. package/dist/index-1zbbzgfh.js +89 -0
  368. package/dist/index-2bxbyab0.js +47 -0
  369. package/dist/index-2gxzjvyr.js +266 -0
  370. package/dist/index-35mh5bhj.js +177 -0
  371. package/dist/index-48ffdxgk.js +6 -0
  372. package/dist/index-4gcnakhx.js +82 -0
  373. package/dist/index-55hkhm67.js +343 -0
  374. package/dist/index-79z7m7dt.js +675 -0
  375. package/dist/index-7f68ghdn.js +3618 -0
  376. package/dist/index-7p1f0vp2.js +154 -0
  377. package/dist/index-83bdg97s.js +16 -0
  378. package/dist/index-863ea9jb.js +154 -0
  379. package/dist/index-8p52kd5p.js +242 -0
  380. package/dist/index-d9pk3td4.js +326 -0
  381. package/dist/index-dce5wxcq.js +63 -0
  382. package/dist/index-e01r054k.js +105 -0
  383. package/dist/index-ensd0r74.js +595 -0
  384. package/dist/index-eqqvgdb3.js +46 -0
  385. package/dist/index-gxrt5h6v.js +341 -0
  386. package/dist/index-h6eeys1v.js +211 -0
  387. package/dist/index-ham5sz8m.js +734 -0
  388. package/dist/index-het2he5g.js +1387 -0
  389. package/dist/index-hffjpmq9.js +30 -0
  390. package/dist/index-hmp4800j.js +51 -0
  391. package/dist/index-k30h66yd.js +317 -0
  392. package/dist/index-k5hsfc3j.js +31 -0
  393. package/dist/index-khtgb21r.js +92 -0
  394. package/dist/index-m9zn6cpq.js +51 -0
  395. package/dist/index-ndddxtyx.js +324 -0
  396. package/dist/index-ngfhvfpd.js +30 -0
  397. package/dist/index-np4m8hd3.js +1205 -0
  398. package/dist/index-p3vsv1fb.js +3493 -0
  399. package/dist/index-p5r7qpdd.js +85 -0
  400. package/dist/index-p9e0w8hs.js +1084 -0
  401. package/dist/index-p9sh0xx4.js +64 -0
  402. package/dist/index-paz6sgdp.js +371 -0
  403. package/dist/index-px2gm2jp.js +448 -0
  404. package/dist/index-qwhynv6x.js +103 -0
  405. package/dist/index-s812ycat.js +65 -0
  406. package/dist/index-sp1tzwnb.js +281 -0
  407. package/dist/index-t9rhjr9f.js +2306 -0
  408. package/dist/index-v260df89.js +342 -0
  409. package/dist/index-w906953s.js +946 -0
  410. package/dist/index-wdkt63w3.js +214 -0
  411. package/dist/index-wqgjfstn.js +18 -0
  412. package/dist/index-wsm5w4ee.js +1023 -0
  413. package/dist/index-xw3s75nj.js +100 -0
  414. package/dist/index-yw4fzmdz.js +268 -0
  415. package/dist/index-zfrhfn82.js +85 -0
  416. package/dist/index-znfs20ss.js +98 -0
  417. package/dist/internal/atomic-file.d.ts +23 -2
  418. package/dist/internal/atomic-file.d.ts.map +1 -1
  419. package/dist/internal/backoff.d.ts +29 -0
  420. package/dist/internal/backoff.d.ts.map +1 -0
  421. package/dist/internal/canonical-json.d.ts +21 -11
  422. package/dist/internal/canonical-json.d.ts.map +1 -1
  423. package/dist/internal/channel.d.ts.map +1 -0
  424. package/dist/internal/exclusive-lock.d.ts +51 -0
  425. package/dist/internal/exclusive-lock.d.ts.map +1 -0
  426. package/dist/internal/logger.d.ts.map +1 -0
  427. package/dist/internal/process-identity.d.ts +47 -0
  428. package/dist/internal/process-identity.d.ts.map +1 -0
  429. package/dist/internal/request.d.ts.map +1 -0
  430. package/dist/internal/stable-digest.d.ts +0 -43
  431. package/dist/internal/stable-digest.d.ts.map +1 -1
  432. package/dist/internal/typed.d.ts +0 -8
  433. package/dist/internal/typed.d.ts.map +1 -1
  434. package/dist/internal/with-exclusive-lock.d.ts +67 -0
  435. package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
  436. package/dist/internal/zod-issues.d.ts +38 -0
  437. package/dist/internal/zod-issues.d.ts.map +1 -0
  438. package/dist/json-schema/dialect.d.ts +17 -0
  439. package/dist/json-schema/dialect.d.ts.map +1 -0
  440. package/dist/json-schema/json-schema.d.ts.map +1 -0
  441. package/dist/live/watch-client.d.ts.map +1 -1
  442. package/dist/live/watch-delta.d.ts.map +1 -1
  443. package/dist/oauth/authorization-code.d.ts +57 -0
  444. package/dist/oauth/authorization-code.d.ts.map +1 -0
  445. package/dist/observability/audit.d.ts +3 -3
  446. package/dist/observability/audit.d.ts.map +1 -1
  447. package/dist/observability/bounded-logger.d.ts +1 -1
  448. package/dist/observability/bounded-logger.d.ts.map +1 -1
  449. package/dist/observability/bounded-sink.d.ts +81 -0
  450. package/dist/observability/bounded-sink.d.ts.map +1 -0
  451. package/dist/observability/context.d.ts +1 -1
  452. package/dist/observability/context.d.ts.map +1 -1
  453. package/dist/observability/event.d.ts +2 -1
  454. package/dist/observability/event.d.ts.map +1 -1
  455. package/dist/observability/work.d.ts +1 -1
  456. package/dist/observability/work.d.ts.map +1 -1
  457. package/dist/primitives/audit.d.ts +1 -1
  458. package/dist/primitives/audit.d.ts.map +1 -1
  459. package/dist/primitives/export-operation.d.ts +4 -2
  460. package/dist/primitives/export-operation.d.ts.map +1 -1
  461. package/dist/realtime/registry.d.ts +0 -5
  462. package/dist/realtime/registry.d.ts.map +1 -1
  463. package/dist/realtime/socket.d.ts +1 -1
  464. package/dist/realtime/socket.d.ts.map +1 -1
  465. package/dist/server/bun.d.ts +0 -1
  466. package/dist/server/bun.d.ts.map +1 -1
  467. package/dist/server/context-contribution.d.ts +1 -1
  468. package/dist/server/context-contribution.d.ts.map +1 -1
  469. package/dist/server/context.d.ts +2 -2
  470. package/dist/server/context.d.ts.map +1 -1
  471. package/dist/server/contract-method.d.ts +15 -0
  472. package/dist/server/contract-method.d.ts.map +1 -0
  473. package/dist/server/contract-stream.d.ts +1 -1
  474. package/dist/server/contract-stream.d.ts.map +1 -1
  475. package/dist/server/create.d.ts +8 -0
  476. package/dist/server/create.d.ts.map +1 -1
  477. package/dist/server/endpoint-dispatch.d.ts +10 -0
  478. package/dist/server/endpoint-dispatch.d.ts.map +1 -0
  479. package/dist/server/endpoint-response.d.ts +19 -0
  480. package/dist/server/endpoint-response.d.ts.map +1 -0
  481. package/dist/server/error-dispatch.d.ts +17 -1
  482. package/dist/server/error-dispatch.d.ts.map +1 -1
  483. package/dist/server/error-hook.d.ts +2 -2
  484. package/dist/server/error-hook.d.ts.map +1 -1
  485. package/dist/server/handler-state.d.ts +44 -0
  486. package/dist/server/handler-state.d.ts.map +1 -0
  487. package/dist/server/implement-registry.d.ts +54 -0
  488. package/dist/server/implement-registry.d.ts.map +1 -0
  489. package/dist/server/implement.d.ts +9 -55
  490. package/dist/server/implement.d.ts.map +1 -1
  491. package/dist/server/middleware/auth.d.ts +1 -31
  492. package/dist/server/middleware/auth.d.ts.map +1 -1
  493. package/dist/server/middleware/cors.d.ts +17 -0
  494. package/dist/server/middleware/cors.d.ts.map +1 -1
  495. package/dist/server/middleware/jwt.d.ts +31 -0
  496. package/dist/server/middleware/jwt.d.ts.map +1 -0
  497. package/dist/server/middleware/trust-fence.d.ts +1 -1
  498. package/dist/server/middleware/trust-fence.d.ts.map +1 -1
  499. package/dist/server/multipart-reader.d.ts +22 -0
  500. package/dist/server/multipart-reader.d.ts.map +1 -0
  501. package/dist/server/multipart.d.ts +1 -1
  502. package/dist/server/multipart.d.ts.map +1 -1
  503. package/dist/server/oauth/cimd.d.ts +88 -0
  504. package/dist/server/oauth/cimd.d.ts.map +1 -0
  505. package/dist/server/oauth/endpoints.d.ts +39 -0
  506. package/dist/server/oauth/endpoints.d.ts.map +1 -0
  507. package/dist/server/oauth/metadata.d.ts +28 -0
  508. package/dist/server/oauth/metadata.d.ts.map +1 -0
  509. package/dist/server/oauth/provider.d.ts +117 -0
  510. package/dist/server/oauth/provider.d.ts.map +1 -0
  511. package/dist/server/realtime.d.ts +1 -1
  512. package/dist/server/realtime.d.ts.map +1 -1
  513. package/dist/server/request-completion.d.ts +16 -0
  514. package/dist/server/request-completion.d.ts.map +1 -0
  515. package/dist/server/response-metadata.d.ts +1 -1
  516. package/dist/server/response-metadata.d.ts.map +1 -1
  517. package/dist/server/route-table.d.ts +9 -0
  518. package/dist/server/route-table.d.ts.map +1 -0
  519. package/dist/server/stream.d.ts +0 -13
  520. package/dist/server/stream.d.ts.map +1 -1
  521. package/dist/server/streaming-pump.d.ts +66 -0
  522. package/dist/server/streaming-pump.d.ts.map +1 -0
  523. package/dist/server/streaming-route.d.ts +12 -5
  524. package/dist/server/streaming-route.d.ts.map +1 -1
  525. package/dist/server/types.d.ts +10 -4
  526. package/dist/server/types.d.ts.map +1 -1
  527. package/dist/server/unix-client-bun.d.ts.map +1 -1
  528. package/dist/server/unix-client-http1.d.ts +76 -0
  529. package/dist/server/unix-client-http1.d.ts.map +1 -0
  530. package/dist/server/unix-client.d.ts.map +1 -1
  531. package/dist/testing/handler-clients.d.ts +32 -0
  532. package/dist/testing/handler-clients.d.ts.map +1 -0
  533. package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
  534. package/dist/testing/realtime-probe.d.ts +33 -0
  535. package/dist/testing/realtime-probe.d.ts.map +1 -0
  536. package/dist/testing/surface-conformance.d.ts +2 -32
  537. package/dist/testing/surface-conformance.d.ts.map +1 -1
  538. package/dist/testing/surface-manifest-digest.d.ts +44 -0
  539. package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
  540. package/dist/testing/surface-manifest.d.ts +30 -4
  541. package/dist/testing/surface-manifest.d.ts.map +1 -1
  542. package/dist/tools/agent.d.ts +1 -1
  543. package/dist/tools/agent.d.ts.map +1 -1
  544. package/dist/tools/cli/args-fields.d.ts +31 -0
  545. package/dist/tools/cli/args-fields.d.ts.map +1 -0
  546. package/dist/tools/cli/args-route.d.ts +42 -0
  547. package/dist/tools/cli/args-route.d.ts.map +1 -0
  548. package/dist/tools/cli/args-view.d.ts +32 -0
  549. package/dist/tools/cli/args-view.d.ts.map +1 -0
  550. package/dist/tools/cli/args.d.ts +80 -0
  551. package/dist/tools/cli/args.d.ts.map +1 -0
  552. package/dist/tools/cli/argument-error.d.ts +5 -0
  553. package/dist/tools/cli/argument-error.d.ts.map +1 -0
  554. package/dist/tools/cli/checkpoint.d.ts +24 -0
  555. package/dist/tools/cli/checkpoint.d.ts.map +1 -0
  556. package/dist/tools/cli/command.d.ts +70 -0
  557. package/dist/tools/cli/command.d.ts.map +1 -0
  558. package/dist/tools/cli/config.d.ts +90 -0
  559. package/dist/tools/cli/config.d.ts.map +1 -0
  560. package/dist/tools/cli/create-cli.d.ts +36 -0
  561. package/dist/tools/cli/create-cli.d.ts.map +1 -0
  562. package/dist/tools/cli/download.d.ts +8 -0
  563. package/dist/tools/cli/download.d.ts.map +1 -0
  564. package/dist/tools/cli/format.d.ts +50 -0
  565. package/dist/tools/cli/format.d.ts.map +1 -0
  566. package/dist/tools/cli/help.d.ts +24 -0
  567. package/dist/tools/cli/help.d.ts.map +1 -0
  568. package/dist/tools/cli/installer.d.ts +34 -0
  569. package/dist/tools/cli/installer.d.ts.map +1 -0
  570. package/dist/tools/cli/invoke.d.ts +144 -0
  571. package/dist/tools/cli/invoke.d.ts.map +1 -0
  572. package/dist/tools/cli/io.d.ts +10 -0
  573. package/dist/tools/cli/io.d.ts.map +1 -0
  574. package/dist/tools/cli/managed-surface.d.ts +30 -0
  575. package/dist/tools/cli/managed-surface.d.ts.map +1 -0
  576. package/dist/tools/cli/manifest.d.ts +80 -0
  577. package/dist/tools/cli/manifest.d.ts.map +1 -0
  578. package/dist/tools/cli/policy.d.ts +27 -0
  579. package/dist/tools/cli/policy.d.ts.map +1 -0
  580. package/dist/tools/cli/prepare.d.ts +14 -0
  581. package/dist/tools/cli/prepare.d.ts.map +1 -0
  582. package/dist/tools/cli/profile.d.ts +40 -0
  583. package/dist/tools/cli/profile.d.ts.map +1 -0
  584. package/dist/tools/cli/run-managed.d.ts +5 -0
  585. package/dist/tools/cli/run-managed.d.ts.map +1 -0
  586. package/dist/tools/cli/run-native.d.ts +9 -0
  587. package/dist/tools/cli/run-native.d.ts.map +1 -0
  588. package/dist/tools/cli/session.d.ts +40 -0
  589. package/dist/tools/cli/session.d.ts.map +1 -0
  590. package/dist/tools/cli/signature.d.ts +81 -0
  591. package/dist/tools/cli/signature.d.ts.map +1 -0
  592. package/dist/tools/cli/stream.d.ts +93 -0
  593. package/dist/tools/cli/stream.d.ts.map +1 -0
  594. package/dist/tools/cli/update.d.ts +145 -0
  595. package/dist/tools/cli/update.d.ts.map +1 -0
  596. package/dist/tools/cli/view.d.ts +12 -0
  597. package/dist/tools/cli/view.d.ts.map +1 -0
  598. package/dist/tools/cli/wait.d.ts +54 -0
  599. package/dist/tools/cli/wait.d.ts.map +1 -0
  600. package/dist/tools/connections/runtime.d.ts +1 -1
  601. package/dist/tools/connections/runtime.d.ts.map +1 -1
  602. package/dist/tools/connections/types.d.ts +3 -3
  603. package/dist/tools/connections/types.d.ts.map +1 -1
  604. package/dist/tools/durability-context.d.ts +1 -1
  605. package/dist/tools/durability-context.d.ts.map +1 -1
  606. package/dist/tools/execute-args.d.ts +23 -0
  607. package/dist/tools/execute-args.d.ts.map +1 -0
  608. package/dist/tools/execute-hooks.d.ts +146 -0
  609. package/dist/tools/execute-hooks.d.ts.map +1 -0
  610. package/dist/tools/execute-result.d.ts +40 -0
  611. package/dist/tools/execute-result.d.ts.map +1 -0
  612. package/dist/tools/execute.d.ts +31 -193
  613. package/dist/tools/execute.d.ts.map +1 -1
  614. package/dist/tools/internal/surface-projector.d.ts +9 -6
  615. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  616. package/dist/tools/internal/tool-view.d.ts +41 -0
  617. package/dist/tools/internal/tool-view.d.ts.map +1 -0
  618. package/dist/tools/invoker.d.ts +13 -4
  619. package/dist/tools/invoker.d.ts.map +1 -1
  620. package/dist/tools/lifecycle.d.ts +1 -1
  621. package/dist/tools/lifecycle.d.ts.map +1 -1
  622. package/dist/tools/list-names.d.ts +3 -3
  623. package/dist/tools/list-names.d.ts.map +1 -1
  624. package/dist/tools/manifest.d.ts +2 -2
  625. package/dist/tools/manifest.d.ts.map +1 -1
  626. package/dist/tools/mcp/app.d.ts +62 -0
  627. package/dist/tools/mcp/app.d.ts.map +1 -0
  628. package/dist/tools/mcp/catalog.d.ts +68 -0
  629. package/dist/tools/mcp/catalog.d.ts.map +1 -0
  630. package/dist/tools/mcp/handler.d.ts +46 -0
  631. package/dist/tools/mcp/handler.d.ts.map +1 -0
  632. package/dist/tools/mcp/mount.d.ts +152 -0
  633. package/dist/tools/mcp/mount.d.ts.map +1 -0
  634. package/dist/tools/mcp/prepare.d.ts +76 -0
  635. package/dist/tools/mcp/prepare.d.ts.map +1 -0
  636. package/dist/tools/mcp/progress.d.ts +46 -0
  637. package/dist/tools/mcp/progress.d.ts.map +1 -0
  638. package/dist/tools/mcp/register.d.ts +36 -0
  639. package/dist/tools/mcp/register.d.ts.map +1 -0
  640. package/dist/tools/mcp/round-context.d.ts +38 -0
  641. package/dist/tools/mcp/round-context.d.ts.map +1 -0
  642. package/dist/tools/mcp/round-policy.d.ts +33 -0
  643. package/dist/tools/mcp/round-policy.d.ts.map +1 -0
  644. package/dist/tools/mcp/round.d.ts +53 -0
  645. package/dist/tools/mcp/round.d.ts.map +1 -0
  646. package/dist/tools/mcp/runtime-tools.d.ts +25 -0
  647. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
  648. package/dist/tools/mcp/stdio-signals.d.ts +33 -0
  649. package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
  650. package/dist/tools/mcp/stdio.d.ts +20 -0
  651. package/dist/tools/mcp/stdio.d.ts.map +1 -0
  652. package/dist/tools/mcp/trace.d.ts +12 -0
  653. package/dist/tools/mcp/trace.d.ts.map +1 -0
  654. package/dist/tools/mount.d.ts +14 -7
  655. package/dist/tools/mount.d.ts.map +1 -1
  656. package/dist/tools/native-definition.d.ts +4 -3
  657. package/dist/tools/native-definition.d.ts.map +1 -1
  658. package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
  659. package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
  660. package/dist/tools/operations/async-operation-binding.d.ts +28 -0
  661. package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
  662. package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
  663. package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
  664. package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
  665. package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
  666. package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
  667. package/dist/tools/operations/async-operation-id.d.ts +23 -0
  668. package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
  669. package/dist/tools/operations/async-operation-runtime-tools.d.ts +41 -0
  670. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
  671. package/dist/tools/operations/async-operation-runtime-types.d.ts +69 -0
  672. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
  673. package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
  674. package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
  675. package/dist/tools/operations/define-wait-tool.d.ts +22 -0
  676. package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
  677. package/dist/tools/operations/mount-wait.d.ts.map +1 -0
  678. package/dist/tools/operations/wait-core.d.ts.map +1 -0
  679. package/dist/tools/remote.d.ts +1 -1
  680. package/dist/tools/remote.d.ts.map +1 -1
  681. package/dist/tools/runtime-tool.d.ts +13 -4
  682. package/dist/tools/runtime-tool.d.ts.map +1 -1
  683. package/dist/tools/schema/coerce.d.ts.map +1 -0
  684. package/dist/tools/schema/flatten-join.d.ts.map +1 -0
  685. package/dist/tools/schema/flatten.d.ts.map +1 -0
  686. package/dist/tools/schema/portable-formats.d.ts.map +1 -0
  687. package/dist/tools/schema/presentation.d.ts +24 -0
  688. package/dist/tools/schema/presentation.d.ts.map +1 -0
  689. package/dist/tools/schema/schema.d.ts.map +1 -0
  690. package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
  691. package/dist/tools/surface.d.ts +2 -3
  692. package/dist/tools/surface.d.ts.map +1 -1
  693. package/dist/tools/tool-logger.d.ts +1 -1
  694. package/dist/tools/tool-logger.d.ts.map +1 -1
  695. package/dist/tools/toolkit.d.ts +4 -4
  696. package/dist/tools/toolkit.d.ts.map +1 -1
  697. package/dist/tools/transfer/define-download-tool.d.ts +18 -0
  698. package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
  699. package/dist/tools/transfer/define-upload-tool.d.ts +16 -0
  700. package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
  701. package/dist/tools/transfer/define-view-file-tool.d.ts +10 -0
  702. package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
  703. package/dist/tools/transfer/download-core.d.ts +20 -0
  704. package/dist/tools/transfer/download-core.d.ts.map +1 -0
  705. package/dist/tools/transfer/managed-file-error.d.ts +6 -0
  706. package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
  707. package/dist/tools/transfer/mount-download.d.ts +41 -0
  708. package/dist/tools/transfer/mount-download.d.ts.map +1 -0
  709. package/dist/tools/transfer/mount-upload.d.ts +21 -0
  710. package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
  711. package/dist/tools/transfer/native-result.d.ts.map +1 -0
  712. package/dist/tools/transfer/upload-core.d.ts +4 -0
  713. package/dist/tools/transfer/upload-core.d.ts.map +1 -0
  714. package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
  715. package/dist/tools/transfer/view-file.d.ts +62 -0
  716. package/dist/tools/transfer/view-file.d.ts.map +1 -0
  717. package/dist/tools/transports.d.ts +1 -1
  718. package/dist/tools/transports.d.ts.map +1 -1
  719. package/dist/tracking/client-listeners.d.ts +30 -0
  720. package/dist/tracking/client-listeners.d.ts.map +1 -0
  721. package/dist/tracking/client-visit.d.ts +61 -0
  722. package/dist/tracking/client-visit.d.ts.map +1 -0
  723. package/dist/tracking/client.d.ts +3 -2
  724. package/dist/tracking/client.d.ts.map +1 -1
  725. package/dist/tracking/contract.d.ts +1 -1
  726. package/dist/tracking/contract.d.ts.map +1 -1
  727. package/llms/agent-runtime-browser.txt +33 -0
  728. package/llms/agent-runtime-coding-tools.txt +58 -0
  729. package/llms/agent-runtime-harness.txt +45 -0
  730. package/llms/agent-runtime-openrouter.txt +22 -0
  731. package/llms/agent-runtime-sandbox.txt +159 -0
  732. package/llms/agent-runtime-sqlite-bun.txt +29 -0
  733. package/llms/agent-runtime-sqlite-node.txt +26 -0
  734. package/llms/agent-runtime-testing.txt +30 -0
  735. package/llms/agent-runtime.2.txt +550 -0
  736. package/llms/agent-runtime.3.txt +311 -0
  737. package/llms/agent-runtime.txt +893 -0
  738. package/llms/application-diagnostic-journal.txt +30 -0
  739. package/llms/application-grammy.txt +27 -0
  740. package/llms/application-opentelemetry.txt +27 -0
  741. package/llms/application-schemas.txt +42 -0
  742. package/llms/application.2.txt +487 -0
  743. package/llms/application.txt +886 -0
  744. package/llms/cli.2.txt +80 -0
  745. package/llms/cli.txt +948 -0
  746. package/llms/contract.txt +606 -0
  747. package/llms/declaration.txt +286 -0
  748. package/llms/files.txt +33 -0
  749. package/llms/geo.txt +114 -0
  750. package/llms/google.txt +27 -0
  751. package/llms/live.txt +471 -0
  752. package/llms/node.txt +43 -0
  753. package/llms/oauth.txt +136 -0
  754. package/llms/observability.txt +893 -0
  755. package/llms/primitives.txt +158 -0
  756. package/llms/react.txt +184 -0
  757. package/llms/release.txt +176 -0
  758. package/llms/remote.txt +25 -0
  759. package/llms/server.2.txt +361 -0
  760. package/llms/server.3.txt +1031 -0
  761. package/llms/server.4.txt +905 -0
  762. package/llms/server.5.txt +250 -0
  763. package/llms/server.txt +996 -0
  764. package/llms/stitchkit.2.txt +836 -0
  765. package/llms/stitchkit.3.txt +147 -0
  766. package/llms/stitchkit.txt +260 -0
  767. package/llms/telegram.txt +30 -0
  768. package/llms/testing.txt +676 -0
  769. package/llms/tools-connections.txt +45 -0
  770. package/llms/tools-contract.txt +9 -0
  771. package/llms/tools-invoker.txt +9 -0
  772. package/llms/tools.2.txt +647 -0
  773. package/llms/tools.3.txt +288 -0
  774. package/llms/tools.txt +966 -0
  775. package/llms/tracking-server.txt +32 -0
  776. package/llms/tracking.txt +263 -0
  777. package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
  778. package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
  779. package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
  780. package/llms/upgrading.txt +215 -0
  781. package/llms-full.txt +312 -77
  782. package/llms.txt +54 -5
  783. package/package.json +84 -83
  784. package/dist/agent-runtime/durability-contract.d.ts +0 -176
  785. package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
  786. package/dist/agent-runtime/durability-json.d.ts +0 -3
  787. package/dist/agent-runtime/durability-json.d.ts.map +0 -1
  788. package/dist/agent-runtime/durability-ledger.d.ts +0 -16
  789. package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
  790. package/dist/agent-runtime/durability-scheduler.d.ts +0 -29
  791. package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
  792. package/dist/agent-runtime/durability.d.ts +0 -14
  793. package/dist/agent-runtime/durability.d.ts.map +0 -1
  794. package/dist/agent-runtime/store-driver.d.ts +0 -814
  795. package/dist/agent-runtime/store-driver.d.ts.map +0 -1
  796. package/dist/agent-runtime-browser.d.ts +0 -5
  797. package/dist/agent-runtime-browser.d.ts.map +0 -1
  798. package/dist/agent-runtime-browser.js +0 -124
  799. package/dist/agent-runtime-coding-tools.d.ts +0 -2
  800. package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
  801. package/dist/agent-runtime-coding-tools.js +0 -23
  802. package/dist/agent-runtime-harness.d.ts +0 -2
  803. package/dist/agent-runtime-harness.d.ts.map +0 -1
  804. package/dist/agent-runtime-harness.js +0 -729
  805. package/dist/agent-runtime-openrouter.d.ts +0 -29
  806. package/dist/agent-runtime-openrouter.d.ts.map +0 -1
  807. package/dist/agent-runtime-openrouter.js +0 -270
  808. package/dist/agent-runtime-sandbox.d.ts +0 -5
  809. package/dist/agent-runtime-sandbox.d.ts.map +0 -1
  810. package/dist/agent-runtime-sandbox.js +0 -798
  811. package/dist/agent-runtime-sqlite-bun.d.ts +0 -11
  812. package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
  813. package/dist/agent-runtime-sqlite-bun.js +0 -42
  814. package/dist/agent-runtime-sqlite-node.d.ts +0 -11
  815. package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
  816. package/dist/agent-runtime-sqlite-node.js +0 -44
  817. package/dist/agent-runtime-testing.d.ts +0 -3
  818. package/dist/agent-runtime-testing.d.ts.map +0 -1
  819. package/dist/agent-runtime-testing.js +0 -156
  820. package/dist/agent-runtime.d.ts +0 -38
  821. package/dist/agent-runtime.d.ts.map +0 -1
  822. package/dist/agent-runtime.js +0 -2607
  823. package/dist/application/channel.d.ts.map +0 -1
  824. package/dist/application-diagnostic-journal.d.ts +0 -21
  825. package/dist/application-diagnostic-journal.d.ts.map +0 -1
  826. package/dist/application-diagnostic-journal.js +0 -632
  827. package/dist/application-grammy.d.ts +0 -2
  828. package/dist/application-grammy.d.ts.map +0 -1
  829. package/dist/application-grammy.js +0 -169
  830. package/dist/application-opentelemetry.d.ts +0 -2
  831. package/dist/application-opentelemetry.d.ts.map +0 -1
  832. package/dist/application-opentelemetry.js +0 -250
  833. package/dist/application-schemas.d.ts +0 -15
  834. package/dist/application-schemas.d.ts.map +0 -1
  835. package/dist/application-schemas.js +0 -27
  836. package/dist/application.d.ts +0 -22
  837. package/dist/application.d.ts.map +0 -1
  838. package/dist/application.js +0 -1977
  839. package/dist/cli.d.ts +0 -41
  840. package/dist/cli.d.ts.map +0 -1
  841. package/dist/cli.js +0 -753
  842. package/dist/contract/index.d.ts +0 -8
  843. package/dist/contract/index.d.ts.map +0 -1
  844. package/dist/contract/index.js +0 -55
  845. package/dist/declaration.d.ts.map +0 -1
  846. package/dist/declaration.js +0 -183
  847. package/dist/files.d.ts +0 -3
  848. package/dist/files.d.ts.map +0 -1
  849. package/dist/files.js +0 -15
  850. package/dist/geo.d.ts +0 -3
  851. package/dist/geo.d.ts.map +0 -1
  852. package/dist/geo.js +0 -245
  853. package/dist/google.d.ts.map +0 -1
  854. package/dist/google.js +0 -175
  855. package/dist/index-0a349c33.js +0 -470
  856. package/dist/index-0j3vcp5m.js +0 -28
  857. package/dist/index-2c2bjw3s.js +0 -51
  858. package/dist/index-2na0qrfn.js +0 -214
  859. package/dist/index-2qzskm8h.js +0 -63
  860. package/dist/index-3bmnp41g.js +0 -2169
  861. package/dist/index-3xwxfj4z.js +0 -334
  862. package/dist/index-4fpa9dy2.js +0 -51
  863. package/dist/index-6kyksz9y.js +0 -268
  864. package/dist/index-77fekveh.js +0 -44
  865. package/dist/index-7gnkny4z.js +0 -326
  866. package/dist/index-7zbps32p.js +0 -89
  867. package/dist/index-9f8ztey6.js +0 -588
  868. package/dist/index-a11g2kry.js +0 -866
  869. package/dist/index-a916km3r.js +0 -45
  870. package/dist/index-actkayzn.js +0 -367
  871. package/dist/index-bn2cjajt.js +0 -524
  872. package/dist/index-bx75zwt7.js +0 -63
  873. package/dist/index-cby4ar3v.js +0 -46
  874. package/dist/index-cnyk6te3.js +0 -77
  875. package/dist/index-cxqhvq21.js +0 -413
  876. package/dist/index-e0znv5gn.js +0 -176
  877. package/dist/index-e42wzzz5.js +0 -154
  878. package/dist/index-f477k430.js +0 -324
  879. package/dist/index-f9mb610r.js +0 -177
  880. package/dist/index-fadnxwna.js +0 -1046
  881. package/dist/index-fq77yfzc.js +0 -1303
  882. package/dist/index-h9etkkyk.js +0 -1126
  883. package/dist/index-hrbajay7.js +0 -1196
  884. package/dist/index-kw9t5ayn.js +0 -507
  885. package/dist/index-mzvgxp0n.js +0 -80
  886. package/dist/index-n0f51dfn.js +0 -3170
  887. package/dist/index-p13mwz16.js +0 -16
  888. package/dist/index-s8cnx02s.js +0 -90
  889. package/dist/index-sr93cwf9.js +0 -325
  890. package/dist/index-tmwcrptx.js +0 -85
  891. package/dist/index-v5573g1k.js +0 -142
  892. package/dist/index-vjpvjqpn.js +0 -86
  893. package/dist/index-vk3kq9sb.js +0 -3344
  894. package/dist/index-wc4x00bn.js +0 -103
  895. package/dist/index-wnfk50r0.js +0 -211
  896. package/dist/index-yewwh1w4.js +0 -647
  897. package/dist/index-yn8remb1.js +0 -290
  898. package/dist/index-ywd0y6m1.js +0 -394
  899. package/dist/index-zwkgfq1s.js +0 -345
  900. package/dist/index.d.ts +0 -14
  901. package/dist/index.d.ts.map +0 -1
  902. package/dist/index.js +0 -632
  903. package/dist/internal/errors.d.ts +0 -92
  904. package/dist/internal/errors.d.ts.map +0 -1
  905. package/dist/internal/observability-sink.d.ts +0 -81
  906. package/dist/internal/observability-sink.d.ts.map +0 -1
  907. package/dist/live.d.ts +0 -19
  908. package/dist/live.d.ts.map +0 -1
  909. package/dist/live.js +0 -282
  910. package/dist/logger.d.ts.map +0 -1
  911. package/dist/node.d.ts +0 -18
  912. package/dist/node.d.ts.map +0 -1
  913. package/dist/node.js +0 -303
  914. package/dist/oauth.d.ts +0 -57
  915. package/dist/oauth.d.ts.map +0 -1
  916. package/dist/oauth.js +0 -170
  917. package/dist/observability/index.d.ts +0 -19
  918. package/dist/observability/index.d.ts.map +0 -1
  919. package/dist/observability/index.js +0 -569
  920. package/dist/primitives.d.ts +0 -3
  921. package/dist/primitives.d.ts.map +0 -1
  922. package/dist/primitives.js +0 -754
  923. package/dist/react.d.ts +0 -5
  924. package/dist/react.d.ts.map +0 -1
  925. package/dist/react.js +0 -403
  926. package/dist/release.d.ts +0 -15
  927. package/dist/release.d.ts.map +0 -1
  928. package/dist/release.js +0 -196
  929. package/dist/remote.d.ts +0 -9
  930. package/dist/remote.d.ts.map +0 -1
  931. package/dist/remote.js +0 -88
  932. package/dist/retained.d.ts.map +0 -1
  933. package/dist/server/file-state-store.d.ts +0 -23
  934. package/dist/server/file-state-store.d.ts.map +0 -1
  935. package/dist/server/index.d.ts +0 -36
  936. package/dist/server/index.d.ts.map +0 -1
  937. package/dist/server/index.js +0 -1745
  938. package/dist/server/request.d.ts.map +0 -1
  939. package/dist/telegram.d.ts +0 -3
  940. package/dist/telegram.d.ts.map +0 -1
  941. package/dist/telegram.js +0 -224
  942. package/dist/testing/agent-store-conformance.d.ts +0 -40
  943. package/dist/testing/agent-store-conformance.d.ts.map +0 -1
  944. package/dist/testing.d.ts +0 -39
  945. package/dist/testing.d.ts.map +0 -1
  946. package/dist/testing.js +0 -2209
  947. package/dist/tool-invoker.d.ts +0 -9
  948. package/dist/tool-invoker.d.ts.map +0 -1
  949. package/dist/tool-invoker.js +0 -21
  950. package/dist/tools/async-operation-contract.d.ts.map +0 -1
  951. package/dist/tools/async-operation.d.ts +0 -332
  952. package/dist/tools/async-operation.d.ts.map +0 -1
  953. package/dist/tools/cli-args.d.ts +0 -143
  954. package/dist/tools/cli-args.d.ts.map +0 -1
  955. package/dist/tools/cli-checkpoint.d.ts +0 -24
  956. package/dist/tools/cli-checkpoint.d.ts.map +0 -1
  957. package/dist/tools/cli-command.d.ts +0 -70
  958. package/dist/tools/cli-command.d.ts.map +0 -1
  959. package/dist/tools/cli-format.d.ts +0 -49
  960. package/dist/tools/cli-format.d.ts.map +0 -1
  961. package/dist/tools/cli-installer.d.ts +0 -34
  962. package/dist/tools/cli-installer.d.ts.map +0 -1
  963. package/dist/tools/cli-invoke.d.ts +0 -143
  964. package/dist/tools/cli-invoke.d.ts.map +0 -1
  965. package/dist/tools/cli-manifest.d.ts +0 -80
  966. package/dist/tools/cli-manifest.d.ts.map +0 -1
  967. package/dist/tools/cli-policy.d.ts +0 -27
  968. package/dist/tools/cli-policy.d.ts.map +0 -1
  969. package/dist/tools/cli-profile.d.ts +0 -40
  970. package/dist/tools/cli-profile.d.ts.map +0 -1
  971. package/dist/tools/cli-signature.d.ts +0 -81
  972. package/dist/tools/cli-signature.d.ts.map +0 -1
  973. package/dist/tools/cli-stream.d.ts +0 -93
  974. package/dist/tools/cli-stream.d.ts.map +0 -1
  975. package/dist/tools/cli-update.d.ts +0 -126
  976. package/dist/tools/cli-update.d.ts.map +0 -1
  977. package/dist/tools/cli-view.d.ts +0 -12
  978. package/dist/tools/cli-view.d.ts.map +0 -1
  979. package/dist/tools/cli-wait.d.ts +0 -54
  980. package/dist/tools/cli-wait.d.ts.map +0 -1
  981. package/dist/tools/cli.d.ts +0 -94
  982. package/dist/tools/cli.d.ts.map +0 -1
  983. package/dist/tools/coerce.d.ts.map +0 -1
  984. package/dist/tools/connections/index.d.ts +0 -20
  985. package/dist/tools/connections/index.d.ts.map +0 -1
  986. package/dist/tools/connections/index.js +0 -1107
  987. package/dist/tools/define-download-tool.d.ts +0 -18
  988. package/dist/tools/define-download-tool.d.ts.map +0 -1
  989. package/dist/tools/define-upload-tool.d.ts +0 -16
  990. package/dist/tools/define-upload-tool.d.ts.map +0 -1
  991. package/dist/tools/define-view-file-tool.d.ts +0 -10
  992. package/dist/tools/define-view-file-tool.d.ts.map +0 -1
  993. package/dist/tools/define-wait-tool.d.ts +0 -22
  994. package/dist/tools/define-wait-tool.d.ts.map +0 -1
  995. package/dist/tools/download-core.d.ts +0 -20
  996. package/dist/tools/download-core.d.ts.map +0 -1
  997. package/dist/tools/flatten-join.d.ts.map +0 -1
  998. package/dist/tools/flatten.d.ts.map +0 -1
  999. package/dist/tools/json-schema-dialect.d.ts +0 -17
  1000. package/dist/tools/json-schema-dialect.d.ts.map +0 -1
  1001. package/dist/tools/json-schema.d.ts.map +0 -1
  1002. package/dist/tools/managed-file-error.d.ts +0 -6
  1003. package/dist/tools/managed-file-error.d.ts.map +0 -1
  1004. package/dist/tools/mcp-app.d.ts +0 -62
  1005. package/dist/tools/mcp-app.d.ts.map +0 -1
  1006. package/dist/tools/mcp-catalog.d.ts +0 -68
  1007. package/dist/tools/mcp-catalog.d.ts.map +0 -1
  1008. package/dist/tools/mcp-handler.d.ts +0 -46
  1009. package/dist/tools/mcp-handler.d.ts.map +0 -1
  1010. package/dist/tools/mcp-prepare.d.ts +0 -75
  1011. package/dist/tools/mcp-prepare.d.ts.map +0 -1
  1012. package/dist/tools/mcp-progress.d.ts +0 -46
  1013. package/dist/tools/mcp-progress.d.ts.map +0 -1
  1014. package/dist/tools/mcp-round-policy.d.ts +0 -33
  1015. package/dist/tools/mcp-round-policy.d.ts.map +0 -1
  1016. package/dist/tools/mcp-round.d.ts +0 -61
  1017. package/dist/tools/mcp-round.d.ts.map +0 -1
  1018. package/dist/tools/mcp-stdio-signals.d.ts +0 -33
  1019. package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
  1020. package/dist/tools/mcp-stdio.d.ts +0 -20
  1021. package/dist/tools/mcp-stdio.d.ts.map +0 -1
  1022. package/dist/tools/mcp-trace.d.ts +0 -12
  1023. package/dist/tools/mcp-trace.d.ts.map +0 -1
  1024. package/dist/tools/mcp.d.ts +0 -152
  1025. package/dist/tools/mcp.d.ts.map +0 -1
  1026. package/dist/tools/mount-download.d.ts +0 -41
  1027. package/dist/tools/mount-download.d.ts.map +0 -1
  1028. package/dist/tools/mount-upload.d.ts +0 -21
  1029. package/dist/tools/mount-upload.d.ts.map +0 -1
  1030. package/dist/tools/mount-wait.d.ts.map +0 -1
  1031. package/dist/tools/native-mcp.d.ts +0 -20
  1032. package/dist/tools/native-mcp.d.ts.map +0 -1
  1033. package/dist/tools/native-result.d.ts.map +0 -1
  1034. package/dist/tools/oauth-metadata.d.ts +0 -28
  1035. package/dist/tools/oauth-metadata.d.ts.map +0 -1
  1036. package/dist/tools/oauth-provider.d.ts +0 -184
  1037. package/dist/tools/oauth-provider.d.ts.map +0 -1
  1038. package/dist/tools/portable-formats.d.ts.map +0 -1
  1039. package/dist/tools/presentation.d.ts +0 -22
  1040. package/dist/tools/presentation.d.ts.map +0 -1
  1041. package/dist/tools/schema.d.ts.map +0 -1
  1042. package/dist/tools/untyped-properties.d.ts.map +0 -1
  1043. package/dist/tools/upload-core.d.ts +0 -4
  1044. package/dist/tools/upload-core.d.ts.map +0 -1
  1045. package/dist/tools/view-file-contract.d.ts.map +0 -1
  1046. package/dist/tools/view-file.d.ts +0 -62
  1047. package/dist/tools/view-file.d.ts.map +0 -1
  1048. package/dist/tools/wait-core.d.ts.map +0 -1
  1049. package/dist/tools-contract.d.ts +0 -29
  1050. package/dist/tools-contract.d.ts.map +0 -1
  1051. package/dist/tools-contract.js +0 -24
  1052. package/dist/tools.d.ts +0 -50
  1053. package/dist/tools.d.ts.map +0 -1
  1054. package/dist/tools.js +0 -2930
  1055. package/dist/tracking-server.d.ts +0 -15
  1056. package/dist/tracking-server.d.ts.map +0 -1
  1057. package/dist/tracking.d.ts +0 -24
  1058. package/dist/tracking.d.ts.map +0 -1
  1059. package/dist/tracking.js +0 -1092
  1060. package/dist/upgrade-cli.d.ts.map +0 -1
  1061. package/dist/upgrade-cli.js +0 -177
  1062. /package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
  1063. /package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
  1064. /package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
  1065. /package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
  1066. /package/dist/{google.d.ts → google/google.d.ts} +0 -0
  1067. /package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
  1068. /package/dist/{application → internal}/channel.d.ts +0 -0
  1069. /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
  1070. /package/dist/{server → internal}/request.d.ts +0 -0
  1071. /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
  1072. /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
  1073. /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
  1074. /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
  1075. /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
  1076. /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
  1077. /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
  1078. /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
  1079. /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
  1080. /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
  1081. /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
  1082. /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
@@ -1,1126 +0,0 @@
1
- import {
2
- toJsonSchema
3
- } from "./index-cby4ar3v.js";
4
- import {
5
- isRecord
6
- } from "./index-77fekveh.js";
7
-
8
- // src/tools/portable-formats.ts
9
- var PORTABLE_JSON_SCHEMA_FORMATS = new Set([
10
- "date",
11
- "time",
12
- "date-time",
13
- "duration",
14
- "uri",
15
- "uri-reference",
16
- "uri-template",
17
- "email",
18
- "hostname",
19
- "ipv4",
20
- "ipv6",
21
- "regex",
22
- "uuid",
23
- "json-pointer",
24
- "relative-json-pointer"
25
- ]);
26
- function propertyPath(prefix, property) {
27
- return prefix ? `${prefix}.${property}` : property;
28
- }
29
- function keywordPath(prefix, keyword) {
30
- if (prefix && keyword.startsWith("["))
31
- return `${prefix}${keyword}`;
32
- return prefix ? `${prefix}.${keyword}` : keyword;
33
- }
34
- function findNonPortableFormats(schema, allowFormats = []) {
35
- const allowed = new Set([...PORTABLE_JSON_SCHEMA_FORMATS, ...allowFormats]);
36
- const found = [];
37
- const pending = [{ value: schema, path: "" }];
38
- while (pending.length > 0) {
39
- const current = pending.pop();
40
- if (!current || !isRecord(current.value))
41
- continue;
42
- const format = current.value.format;
43
- if (typeof format === "string" && !allowed.has(format)) {
44
- found.push({ path: current.path || "(root)", format });
45
- }
46
- const properties = current.value.properties;
47
- if (isRecord(properties)) {
48
- for (const [key, value] of Object.entries(properties)) {
49
- pending.push({ value, path: propertyPath(current.path, key) });
50
- }
51
- }
52
- for (const mapKey of ["$defs", "definitions", "patternProperties", "dependentSchemas"]) {
53
- const entries = current.value[mapKey];
54
- if (!isRecord(entries))
55
- continue;
56
- for (const [key, value] of Object.entries(entries)) {
57
- pending.push({ value, path: keywordPath(current.path, `${mapKey}.${key}`) });
58
- }
59
- }
60
- const directChildren = [
61
- ["items", "[]"],
62
- ["contains", "contains"],
63
- ["additionalProperties", "*"],
64
- ["unevaluatedProperties", "*"],
65
- ["propertyNames", "propertyNames"],
66
- ["not", "not"],
67
- ["if", "if"],
68
- ["then", "then"],
69
- ["else", "else"]
70
- ];
71
- for (const [keyword, segment] of directChildren) {
72
- const child = current.value[keyword];
73
- if (isRecord(child)) {
74
- pending.push({ value: child, path: keywordPath(current.path, segment) });
75
- }
76
- if (Array.isArray(child)) {
77
- child.forEach((value, index) => {
78
- pending.push({ value, path: keywordPath(current.path, `${segment}[${index}]`) });
79
- });
80
- }
81
- }
82
- for (const keyword of ["prefixItems", "allOf", "anyOf", "oneOf"]) {
83
- const branches = current.value[keyword];
84
- if (!Array.isArray(branches))
85
- continue;
86
- branches.forEach((value, index) => {
87
- pending.push({ value, path: keywordPath(current.path, `${keyword}[${index}]`) });
88
- });
89
- }
90
- }
91
- return found.sort((left, right) => left.path.localeCompare(right.path) || left.format.localeCompare(right.format));
92
- }
93
-
94
- // src/tools/flatten-join.ts
95
- var ANNOTATION_KEYS = new Set(["$schema", "default", "description", "examples", "title"]);
96
- var TYPE_KEYWORDS = {
97
- array: [
98
- "contains",
99
- "items",
100
- "maxContains",
101
- "maxItems",
102
- "minContains",
103
- "minItems",
104
- "prefixItems",
105
- "uniqueItems"
106
- ],
107
- integer: ["exclusiveMaximum", "exclusiveMinimum", "maximum", "minimum", "multipleOf"],
108
- number: ["exclusiveMaximum", "exclusiveMinimum", "maximum", "minimum", "multipleOf"],
109
- object: [
110
- "additionalProperties",
111
- "dependentRequired",
112
- "dependentSchemas",
113
- "maxProperties",
114
- "minProperties",
115
- "patternProperties",
116
- "properties",
117
- "propertyNames",
118
- "required"
119
- ],
120
- string: [
121
- "contentEncoding",
122
- "contentMediaType",
123
- "format",
124
- "maxLength",
125
- "minLength",
126
- "pattern"
127
- ]
128
- };
129
- function nullableProjection(schema) {
130
- if (!Array.isArray(schema.anyOf) || schema.anyOf.length !== 2)
131
- return schema;
132
- const branches = schema.anyOf.filter(isRecord);
133
- if (branches.length !== 2)
134
- return schema;
135
- const nullBranch = branches.find((branch) => branch.type === "null");
136
- const value = branches.find((branch) => typeof branch.type === "string" && branch.type !== "null");
137
- if (!nullBranch || !value || Object.keys(nullBranch).some((key) => key !== "type")) {
138
- return schema;
139
- }
140
- const type = value.type;
141
- if (typeof type !== "string")
142
- return schema;
143
- const projected = { type: [type, "null"] };
144
- for (const key of [...ANNOTATION_KEYS, ...TYPE_KEYWORDS[type] ?? []]) {
145
- if (value[key] !== undefined)
146
- projected[key] = value[key];
147
- else if (schema[key] !== undefined)
148
- projected[key] = schema[key];
149
- }
150
- if (value.const !== undefined)
151
- projected.enum = [value.const, null];
152
- else if (Array.isArray(value.enum))
153
- projected.enum = [...value.enum, null];
154
- return projected;
155
- }
156
- function withoutAnnotations(schema) {
157
- const result = {};
158
- for (const [key, value] of Object.entries(schema)) {
159
- if (!ANNOTATION_KEYS.has(key))
160
- result[key] = value;
161
- }
162
- return result;
163
- }
164
- function stableJson(value) {
165
- if (Array.isArray(value))
166
- return `[${value.map(stableJson).join(",")}]`;
167
- if (!isRecord(value))
168
- return JSON.stringify(value) ?? "undefined";
169
- return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(",")}}`;
170
- }
171
- function stringValues(schema) {
172
- if (typeof schema.const === "string")
173
- return [schema.const];
174
- if (!Array.isArray(schema.enum))
175
- return null;
176
- const values = schema.enum.filter((value) => typeof value === "string");
177
- return values.length === schema.enum.length ? values : null;
178
- }
179
- var JSON_SCHEMA_TYPE_ORDER = [
180
- "string",
181
- "number",
182
- "integer",
183
- "boolean",
184
- "object",
185
- "array",
186
- "null"
187
- ];
188
- function jsonSchemaType(value) {
189
- switch (value) {
190
- case "array":
191
- case "boolean":
192
- case "integer":
193
- case "null":
194
- case "number":
195
- case "object":
196
- case "string":
197
- return value;
198
- default:
199
- return null;
200
- }
201
- }
202
- function valueType(value) {
203
- if (value === null)
204
- return "null";
205
- if (Array.isArray(value))
206
- return "array";
207
- if (isRecord(value))
208
- return "object";
209
- if (typeof value === "string")
210
- return "string";
211
- if (typeof value === "number")
212
- return "number";
213
- if (typeof value === "boolean")
214
- return "boolean";
215
- return null;
216
- }
217
- function normalizeTypes(types) {
218
- const normalized = new Set(types);
219
- if (normalized.has("number"))
220
- normalized.delete("integer");
221
- return JSON_SCHEMA_TYPE_ORDER.filter((type) => normalized.has(type));
222
- }
223
- function combinedBranchTypes(schema) {
224
- for (const keyword of ["oneOf", "anyOf"]) {
225
- const value = schema[keyword];
226
- if (!Array.isArray(value) || value.length === 0)
227
- continue;
228
- const collected = [];
229
- for (const branch of value) {
230
- if (!isRecord(branch))
231
- return null;
232
- const types = typeNames(branch);
233
- if (!types)
234
- return null;
235
- collected.push(...types);
236
- }
237
- return normalizeTypes(collected);
238
- }
239
- return null;
240
- }
241
- function typeNames(schema) {
242
- const direct = jsonSchemaType(schema.type);
243
- if (direct)
244
- return [direct];
245
- if (Array.isArray(schema.type)) {
246
- const values = [];
247
- for (const value of schema.type) {
248
- const type = jsonSchemaType(value);
249
- if (!type)
250
- return null;
251
- values.push(type);
252
- }
253
- return values.length > 0 ? normalizeTypes(values) : null;
254
- }
255
- if (schema.const !== undefined) {
256
- const type = valueType(schema.const);
257
- return type ? [type] : null;
258
- }
259
- if (Array.isArray(schema.enum) && schema.enum.length > 0) {
260
- const values = [];
261
- for (const value of schema.enum) {
262
- const type = valueType(value);
263
- if (!type)
264
- return null;
265
- values.push(type);
266
- }
267
- return normalizeTypes(values);
268
- }
269
- return combinedBranchTypes(schema);
270
- }
271
- function typeSchema(type, nullable) {
272
- const schema = { type: nullable ? [type, "null"] : type };
273
- if (type === "array")
274
- schema.items = {};
275
- if (type === "object")
276
- schema.additionalProperties = {};
277
- return schema;
278
- }
279
- function commonBaseType(schemas) {
280
- const names = schemas.map(typeNames);
281
- if (names.some((value) => value === null))
282
- return {};
283
- let nullable = false;
284
- const bases = new Set;
285
- for (const branch of names) {
286
- if (!branch)
287
- return {};
288
- for (const name of branch) {
289
- if (name === "null")
290
- nullable = true;
291
- else
292
- bases.add(name);
293
- }
294
- }
295
- if (bases.size === 0)
296
- return nullable ? { type: "null" } : {};
297
- if (bases.size === 1) {
298
- const [only] = bases;
299
- return only ? typeSchema(only, nullable) : {};
300
- }
301
- if ([...bases].every((name) => name === "integer" || name === "number")) {
302
- return typeSchema("number", nullable);
303
- }
304
- const types = normalizeTypes(nullable ? [...bases, "null"] : bases);
305
- return types.length > 0 ? { type: types } : {};
306
- }
307
- function mergePropertySchemas(properties) {
308
- const schemas = properties.map((property) => nullableProjection(property.schema));
309
- const structural = schemas.map(withoutAnnotations);
310
- const [first] = structural;
311
- let merged;
312
- if (first && structural.every((schema) => stableJson(schema) === stableJson(first))) {
313
- merged = structuredClone(first);
314
- } else {
315
- const values = schemas.map(stringValues);
316
- const allStrings = values.every((value) => value !== null);
317
- merged = allStrings ? { type: "string", enum: [...new Set(values.flatMap((value) => value ?? []))] } : commonBaseType(schemas);
318
- }
319
- const descriptions = [
320
- ...new Set(schemas.map((schema) => schema.description).filter((value) => typeof value === "string"))
321
- ];
322
- if (descriptions.length === 1)
323
- merged.description = descriptions[0];
324
- return merged;
325
- }
326
-
327
- // src/tools/flatten.ts
328
- function rebuild(value) {
329
- if (Array.isArray(value))
330
- return value.map(rebuild);
331
- if (!isRecord(value))
332
- return value;
333
- const node = {};
334
- for (const [key, child] of Object.entries(value))
335
- node[key] = rebuild(child);
336
- return flattenNode(node);
337
- }
338
- function objectVariants(node) {
339
- if (!Array.isArray(node.oneOf) || node.oneOf.length < 2)
340
- return null;
341
- const variants = node.oneOf.filter(isRecord);
342
- if (variants.length !== node.oneOf.length)
343
- return null;
344
- if (variants.some((variant) => variant.type !== "object" || !isRecord(variant.properties))) {
345
- return null;
346
- }
347
- return variants;
348
- }
349
- function findDiscriminator(variants) {
350
- const [first] = variants;
351
- if (!first || !isRecord(first.properties))
352
- return null;
353
- for (const key of Object.keys(first.properties).sort()) {
354
- const values = [];
355
- const seen = new Set;
356
- let valid = true;
357
- for (const variant of variants) {
358
- if (!requiredKeys(variant).has(key)) {
359
- valid = false;
360
- break;
361
- }
362
- const properties = variant.properties;
363
- const field = isRecord(properties) ? properties[key] : undefined;
364
- const branchValues = isRecord(field) ? stringValues(field) : null;
365
- if (!branchValues || branchValues.length === 0) {
366
- valid = false;
367
- break;
368
- }
369
- for (const value of branchValues) {
370
- if (seen.has(value)) {
371
- valid = false;
372
- break;
373
- }
374
- seen.add(value);
375
- }
376
- if (!valid)
377
- break;
378
- values.push(branchValues);
379
- }
380
- if (valid)
381
- return { key, values };
382
- }
383
- return null;
384
- }
385
- function requiredKeys(variant) {
386
- if (!Array.isArray(variant.required))
387
- return new Set;
388
- return new Set(variant.required.filter((key) => typeof key === "string"));
389
- }
390
- function appendHint(schema, hint) {
391
- const description = typeof schema.description === "string" ? schema.description : undefined;
392
- return { ...schema, description: description ? `${description} ${hint}` : hint };
393
- }
394
- function flattenNode(node) {
395
- const variants = objectVariants(node);
396
- if (!variants)
397
- return node;
398
- const discriminator = findDiscriminator(variants);
399
- if (!discriminator)
400
- return node;
401
- const perKey = new Map;
402
- for (let index = 0;index < variants.length; index++) {
403
- const variant = variants[index];
404
- if (!variant)
405
- continue;
406
- const labels = discriminator.values[index] ?? [];
407
- const required2 = requiredKeys(variant);
408
- if (!isRecord(variant.properties))
409
- continue;
410
- for (const [key, rawSchema] of Object.entries(variant.properties)) {
411
- if (key === discriminator.key || !isRecord(rawSchema))
412
- continue;
413
- const entries = perKey.get(key) ?? [];
414
- entries.push({ schema: rawSchema, labels, required: required2.has(key) });
415
- perKey.set(key, entries);
416
- }
417
- }
418
- const discriminatorProperties = [];
419
- for (let index = 0;index < variants.length; index++) {
420
- const variant = variants[index];
421
- if (!variant || !isRecord(variant.properties))
422
- continue;
423
- const schema = variant.properties[discriminator.key];
424
- if (!isRecord(schema))
425
- continue;
426
- discriminatorProperties.push({
427
- schema,
428
- labels: discriminator.values[index] ?? [],
429
- required: true
430
- });
431
- }
432
- const properties = {
433
- [discriminator.key]: mergePropertySchemas(discriminatorProperties)
434
- };
435
- const required = [discriminator.key];
436
- for (const [key, entries] of perKey) {
437
- let merged = mergePropertySchemas(entries);
438
- const requiredEverywhere = entries.length === variants.length && entries.every((entry) => entry.required);
439
- if (requiredEverywhere) {
440
- required.push(key);
441
- } else {
442
- const requiredLabels = entries.filter((entry) => entry.required).flatMap((entry) => entry.labels);
443
- const presentLabels = entries.flatMap((entry) => entry.labels);
444
- const labels = requiredLabels.length > 0 ? requiredLabels : presentLabels;
445
- const verb = requiredLabels.length > 0 ? "Required" : "Available";
446
- merged = appendHint(merged, `${verb} if ${discriminator.key} = ${[...new Set(labels)].join(" | ")}`);
447
- }
448
- properties[key] = merged;
449
- }
450
- const result = {};
451
- for (const [key, value] of Object.entries(node)) {
452
- if (key !== "oneOf" && key !== "anyOf" && key !== "properties" && key !== "required") {
453
- result[key] = value;
454
- }
455
- }
456
- result.type = "object";
457
- result.properties = properties;
458
- result.required = required;
459
- result.additionalProperties = variants.every((variant) => variant.additionalProperties === false) ? false : {};
460
- return result;
461
- }
462
- function flattenToolJsonSchema(schema) {
463
- const result = rebuild(schema);
464
- return isRecord(result) ? result : {};
465
- }
466
- function freezeToolJsonSchema(schema) {
467
- for (const value of Object.values(schema))
468
- freezeJsonValue(value);
469
- return Object.freeze(schema);
470
- }
471
- function freezeJsonValue(value) {
472
- if (Array.isArray(value)) {
473
- for (const item of value)
474
- freezeJsonValue(item);
475
- Object.freeze(value);
476
- } else if (isRecord(value)) {
477
- freezeToolJsonSchema(value);
478
- }
479
- }
480
-
481
- // src/tools/untyped-properties.ts
482
- var TYPE_KEYWORDS2 = ["type", "enum", "const", "anyOf", "oneOf", "allOf", "$ref", "not"];
483
- function saysWhatItIs(schema) {
484
- return TYPE_KEYWORDS2.some((keyword) => schema[keyword] !== undefined);
485
- }
486
- function findUntypedProperties(schema, prefix = "") {
487
- if (!isRecord(schema))
488
- return [];
489
- const found = [];
490
- const properties = schema.properties;
491
- if (isRecord(properties)) {
492
- for (const [key, value] of Object.entries(properties)) {
493
- const path = prefix ? `${prefix}.${key}` : key;
494
- if (isRecord(value)) {
495
- if (!saysWhatItIs(value)) {
496
- const description = value.description;
497
- found.push({
498
- path,
499
- ...typeof description === "string" && { description }
500
- });
501
- }
502
- found.push(...findUntypedProperties(value, path));
503
- }
504
- }
505
- }
506
- for (const key of ["items", "additionalProperties"]) {
507
- const child = schema[key];
508
- if (isRecord(child))
509
- found.push(...findUntypedProperties(child, prefix));
510
- if (Array.isArray(child)) {
511
- for (const entry of child) {
512
- if (isRecord(entry))
513
- found.push(...findUntypedProperties(entry, prefix));
514
- }
515
- }
516
- }
517
- for (const key of ["prefixItems"]) {
518
- const child = schema[key];
519
- if (Array.isArray(child)) {
520
- for (const entry of child) {
521
- if (isRecord(entry))
522
- found.push(...findUntypedProperties(entry, prefix));
523
- }
524
- }
525
- }
526
- const patterned = schema.patternProperties;
527
- if (isRecord(patterned)) {
528
- for (const value of Object.values(patterned)) {
529
- if (isRecord(value))
530
- found.push(...findUntypedProperties(value, prefix));
531
- }
532
- }
533
- for (const key of ["$defs", "definitions"]) {
534
- const container = schema[key];
535
- if (!isRecord(container))
536
- continue;
537
- for (const definition of Object.values(container)) {
538
- if (isRecord(definition))
539
- found.push(...findUntypedProperties(definition, prefix));
540
- }
541
- }
542
- for (const key of ["allOf", "anyOf", "oneOf"]) {
543
- const branches = schema[key];
544
- if (Array.isArray(branches)) {
545
- for (const branch of branches)
546
- found.push(...findUntypedProperties(branch, prefix));
547
- }
548
- }
549
- return found;
550
- }
551
-
552
- // src/tools/schema.ts
553
- import { z } from "zod";
554
- function objectShapeKeys(schema) {
555
- return schema instanceof z.ZodObject ? Object.keys(schema.shape) : [];
556
- }
557
- function keyPolicyOf(schema) {
558
- return schema.def.catchall;
559
- }
560
- function rebuildObject(source, shape) {
561
- return withKeyPolicy(z.object(shape), keyPolicyOf(source));
562
- }
563
- function withKeyPolicy(object, policy) {
564
- if (policy === undefined)
565
- return object;
566
- return object.catchall(representable(policy));
567
- }
568
- function representable(policy) {
569
- if (policy instanceof z.ZodNever || policy instanceof z.ZodUnknown)
570
- return policy;
571
- if (!(policy instanceof z.ZodType))
572
- return z.unknown();
573
- try {
574
- toJsonSchema(policy, "input");
575
- return policy;
576
- } catch {
577
- return z.unknown();
578
- }
579
- }
580
- function mergeSchemas(paramsSchema, inputSchema) {
581
- if (paramsSchema && !(paramsSchema instanceof z.ZodObject)) {
582
- throw new Error("Tool params schema must be a z.object()");
583
- }
584
- const paramsObject = paramsSchema instanceof z.ZodObject ? paramsSchema : undefined;
585
- if (!inputSchema) {
586
- return paramsObject ?? z.object({});
587
- }
588
- if (inputSchema instanceof z.ZodObject) {
589
- if (paramsObject) {
590
- const conflicts = Object.keys(paramsObject.shape).filter((key) => (key in inputSchema.shape));
591
- if (conflicts.length > 0) {
592
- throw new Error(`Schema merge conflict: ${conflicts.join(", ")} appear in both params and input`);
593
- }
594
- }
595
- return rebuildObject(inputSchema, {
596
- ...paramsObject?.shape ?? {},
597
- ...inputSchema.shape
598
- });
599
- }
600
- return paramsObject ? z.intersection(paramsObject, inputSchema) : inputSchema;
601
- }
602
-
603
- // src/tools/mcp-round-policy.ts
604
- function staticInputRounds(policy) {
605
- return Array.isArray(policy.inputRequired) ? policy.inputRequired : undefined;
606
- }
607
- function validateMcpRoundPolicy(tool, policy, runtime) {
608
- if (!runtime?.stateConfigured) {
609
- throw new Error(`[stitchkit] MCP tool "${tool.name}" declares inputRequired but no multiRound.state key is configured`);
610
- }
611
- const { maxRounds } = runtime;
612
- if (!Number.isInteger(maxRounds) || maxRounds < 1) {
613
- throw new Error("[stitchkit] multiRound.serving.maxRounds must be a positive integer");
614
- }
615
- const declared = staticInputRounds(policy);
616
- if (!declared)
617
- return;
618
- if (declared.length === 0) {
619
- throw new Error(`[stitchkit] MCP tool "${tool.name}" must declare at least one input round`);
620
- }
621
- assertRoundShape(tool, declared, maxRounds);
622
- }
623
- function validateResolvedInputRounds(tool, resolved, maxRounds) {
624
- assertRoundShape(tool, resolved, maxRounds);
625
- }
626
- function assertRoundShape(tool, rounds, maxRounds) {
627
- if (rounds.length > maxRounds) {
628
- throw new Error(`[stitchkit] MCP tool "${tool.name}" declares ${rounds.length} input rounds, exceeding maxRounds ${maxRounds}`);
629
- }
630
- const keys = new Set;
631
- for (const request of rounds) {
632
- if (keys.has(request.key)) {
633
- throw new Error(`[stitchkit] MCP tool "${tool.name}" declares duplicate input key "${request.key}"`);
634
- }
635
- keys.add(request.key);
636
- }
637
- }
638
-
639
- // src/tools/names.ts
640
- var SINGULAR_EXCEPTIONS = new Set([
641
- "analytics",
642
- "status",
643
- "stats",
644
- "settings",
645
- "media",
646
- "progress",
647
- "news"
648
- ]);
649
- var TOOL_NAME_RE = /^[a-zA-Z0-9_-]{1,64}$/;
650
- function normalizeService(value) {
651
- return value.replace(/[^a-zA-Z0-9_]/g, "_");
652
- }
653
- function normalizeMethod(value) {
654
- return value.replace(/[^a-zA-Z0-9_-]/g, "_");
655
- }
656
- function singularize(name) {
657
- if (SINGULAR_EXCEPTIONS.has(name))
658
- return name;
659
- if (name.endsWith("ies"))
660
- return `${name.slice(0, -3)}y`;
661
- if (name.endsWith("s") && !name.endsWith("ss"))
662
- return name.slice(0, -1);
663
- return name;
664
- }
665
- function singularizeTail(name) {
666
- const cut = name.lastIndexOf("_");
667
- if (cut === -1)
668
- return singularize(name);
669
- return `${name.slice(0, cut + 1)}${singularize(name.slice(cut + 1))}`;
670
- }
671
- function hasUsableChars(value) {
672
- return /[a-zA-Z0-9]/.test(value);
673
- }
674
- function assertToolName(name, serviceName, key) {
675
- const where = `service "${serviceName}", method "${key}"`;
676
- if (!TOOL_NAME_RE.test(name)) {
677
- const why = name.length > 64 ? `is ${name.length} characters (max 64) — set an explicit \`toolName\`` : "must match [a-zA-Z0-9_-]";
678
- throw new Error(`Tool name "${name}" (${where}) ${why}`);
679
- }
680
- }
681
- function toToolName(serviceName, methodName) {
682
- const normalized = normalizeService(serviceName);
683
- const singular = singularizeTail(normalized);
684
- const method = normalizeMethod(methodName);
685
- if (method === "list")
686
- return `list_${normalized}`;
687
- if (method === "get")
688
- return `get_${singular}`;
689
- if (method === "create")
690
- return `create_${singular}`;
691
- if (method === "update")
692
- return `update_${singular}`;
693
- if (method === "delete")
694
- return `delete_${singular}`;
695
- const snake = method.replace(/([A-Z])/g, "_$1").toLowerCase();
696
- return `${snake}_${singular}`.replace(/^_/, "");
697
- }
698
- function assertUniqueToolName(name, taken, surface) {
699
- if (taken) {
700
- throw new Error(`Duplicate ${surface} "${name}" across mounted operations`);
701
- }
702
- }
703
-
704
- // src/tools/presentation.ts
705
- import { z as z2 } from "zod";
706
-
707
- // src/tools/json-schema-dialect.ts
708
- var DRAFT_07_MARKER = "draft-07";
709
- var DRAFT_07_KEYWORD = "definitions";
710
- var DEFS_KEYWORD = "$defs";
711
- function declaresDraft07(dialect) {
712
- return typeof dialect === "string" && dialect.includes(DRAFT_07_MARKER);
713
- }
714
- function rewriteDefinitionPointers(value) {
715
- if (Array.isArray(value))
716
- return value.map(rewriteDefinitionPointers);
717
- if (!isRecord(value))
718
- return value;
719
- const rewritten = {};
720
- for (const [key, child] of Object.entries(value)) {
721
- rewritten[key] = key === "$ref" && typeof child === "string" && child.startsWith(`#/${DRAFT_07_KEYWORD}/`) ? `#/${DEFS_KEYWORD}/${child.slice(`#/${DRAFT_07_KEYWORD}/`.length)}` : rewriteDefinitionPointers(child);
722
- }
723
- return rewritten;
724
- }
725
- function withDefsDialect(schema) {
726
- const definitions = schema[DRAFT_07_KEYWORD];
727
- if (!isRecord(definitions) || DEFS_KEYWORD in schema)
728
- return schema;
729
- const rewritten = {};
730
- for (const [key, value] of Object.entries(schema)) {
731
- if (key === DRAFT_07_KEYWORD)
732
- continue;
733
- rewritten[key] = rewriteDefinitionPointers(value);
734
- }
735
- rewritten[DEFS_KEYWORD] = rewriteDefinitionPointers(definitions);
736
- return rewritten;
737
- }
738
-
739
- // src/tools/presentation.ts
740
- function withoutDialect(schema) {
741
- const result = {};
742
- for (const [key, value] of Object.entries(schema)) {
743
- if (key !== "$schema")
744
- result[key] = value;
745
- }
746
- return result;
747
- }
748
- function hasLocalReference(value) {
749
- if (Array.isArray(value))
750
- return value.some(hasLocalReference);
751
- if (!isRecord(value))
752
- return false;
753
- if (typeof value.$ref === "string" && value.$ref.startsWith("#"))
754
- return true;
755
- return Object.values(value).some(hasLocalReference);
756
- }
757
- var NAMESPACE_SEPARATOR = "__";
758
- var DEFINITION_KEYWORDS = ["definitions", "$defs"];
759
- function rewriteReference(reference, namespace, targets) {
760
- if (reference === "#" || reference === "#/") {
761
- targets.rootReferenced = true;
762
- return `#/definitions/${namespace}`;
763
- }
764
- const segments = reference.slice(2).split("/");
765
- const [keyword, name, ...rest] = segments;
766
- if (keyword !== undefined && name !== undefined && DEFINITION_KEYWORDS.includes(keyword)) {
767
- const renamed = `${namespace}${NAMESPACE_SEPARATOR}${name}`;
768
- return ["#", "definitions", renamed, ...rest].join("/");
769
- }
770
- targets.rootReferenced = true;
771
- return `#/definitions/${namespace}/${segments.join("/")}`;
772
- }
773
- function rewriteLocalReferences(value, namespace, targets) {
774
- if (Array.isArray(value)) {
775
- return value.map((child) => rewriteLocalReferences(child, namespace, targets));
776
- }
777
- if (!isRecord(value))
778
- return value;
779
- const rewritten = {};
780
- for (const [key, child] of Object.entries(value)) {
781
- rewritten[key] = key === "$ref" && typeof child === "string" && child.startsWith("#") ? rewriteReference(child, namespace, targets) : rewriteLocalReferences(child, namespace, targets);
782
- }
783
- return rewritten;
784
- }
785
- function namespaceLocalReferences(schema, namespace) {
786
- if (!schema || !hasLocalReference(schema))
787
- return schema;
788
- const targets = { rootReferenced: false };
789
- const rewritten = rewriteLocalReferences(schema, namespace, targets);
790
- if (!isRecord(rewritten))
791
- return schema;
792
- const definitions = {};
793
- const body = {};
794
- for (const [key, value] of Object.entries(rewritten)) {
795
- if (DEFINITION_KEYWORDS.includes(key)) {
796
- if (isRecord(value)) {
797
- for (const [name, definition] of Object.entries(value)) {
798
- definitions[`${namespace}${NAMESPACE_SEPARATOR}${name}`] = definition;
799
- }
800
- }
801
- continue;
802
- }
803
- body[key] = value;
804
- }
805
- if (targets.rootReferenced)
806
- definitions[namespace] = withoutDialect(body);
807
- if (Object.keys(definitions).length === 0)
808
- return body;
809
- return { ...body, definitions };
810
- }
811
- function objectProperties(schema) {
812
- return schema.type === "object" && isRecord(schema.properties) ? schema.properties : null;
813
- }
814
- function requiredKeys2(schema) {
815
- return Array.isArray(schema.required) ? schema.required.filter((key) => typeof key === "string") : [];
816
- }
817
- function hoistDefinitions(schema) {
818
- const branches = Array.isArray(schema.allOf) ? schema.allOf : [];
819
- const definitions = {};
820
- const lifted = branches.map((branch) => {
821
- if (!isRecord(branch) || !isRecord(branch.definitions))
822
- return branch;
823
- Object.assign(definitions, branch.definitions);
824
- const rest = {};
825
- for (const [key, value] of Object.entries(branch)) {
826
- if (key !== "definitions")
827
- rest[key] = value;
828
- }
829
- return rest;
830
- });
831
- if (Object.keys(definitions).length === 0)
832
- return schema;
833
- return { ...schema, allOf: lifted, definitions };
834
- }
835
- function mergeObjectSchemas(left, right, rightOwnsUnknownKeys) {
836
- const leftProperties = objectProperties(left);
837
- const rightProperties = objectProperties(right);
838
- if (!leftProperties || !rightProperties)
839
- return hoistDefinitions({ allOf: [left, right] });
840
- const conflicts = Object.keys(leftProperties).filter((key) => (key in rightProperties));
841
- if (conflicts.length > 0) {
842
- throw new Error(`Schema merge conflict: ${conflicts.join(", ")} appear in both params and input`);
843
- }
844
- const merged = {
845
- type: "object",
846
- properties: { ...leftProperties, ...rightProperties },
847
- required: [...new Set([...requiredKeys2(left), ...requiredKeys2(right)])]
848
- };
849
- const leftDefinitions = isRecord(left.definitions) ? left.definitions : {};
850
- const rightDefinitions = isRecord(right.definitions) ? right.definitions : {};
851
- const definitions = { ...leftDefinitions, ...rightDefinitions };
852
- if (Object.keys(definitions).length > 0)
853
- merged.definitions = definitions;
854
- const unknownKeys = rightOwnsUnknownKeys ? right.additionalProperties : left.additionalProperties;
855
- if (unknownKeys !== undefined)
856
- merged.additionalProperties = unknownKeys;
857
- return merged;
858
- }
859
- function schemaFromZod(schema, unrepresentable, flatten) {
860
- if (!schema)
861
- return;
862
- const json = toJsonSchema(schema, "input", unrepresentable, "draft-07");
863
- return flatten ? flattenToolJsonSchema(json) : json;
864
- }
865
- function buildToolPresentationSchema(config) {
866
- const unrepresentable = config.unrepresentable ?? "any";
867
- const flatten = config.flattenUnionInput ?? false;
868
- const params = namespaceLocalReferences(schemaFromZod(config.paramsSchema, unrepresentable, flatten), "params");
869
- const input = namespaceLocalReferences(schemaFromZod(config.inputSchema, unrepresentable, flatten), "input");
870
- let presentation;
871
- if (params && input) {
872
- presentation = mergeObjectSchemas(withoutDialect(params), withoutDialect(input), true);
873
- } else if (input) {
874
- presentation = input;
875
- } else if (params) {
876
- presentation = params;
877
- } else {
878
- presentation = {
879
- $schema: "http://json-schema.org/draft-07/schema#",
880
- type: "object",
881
- properties: {}
882
- };
883
- }
884
- if (config.extendSchema) {
885
- const extra = namespaceLocalReferences(schemaFromZod(z2.object(config.extendSchema), unrepresentable, flatten), "extend");
886
- if (extra) {
887
- presentation = mergeObjectSchemas(withoutDialect(extra), withoutDialect(presentation), true);
888
- }
889
- }
890
- if (presentation.$schema === undefined) {
891
- presentation = {
892
- $schema: "http://json-schema.org/draft-07/schema#",
893
- ...presentation
894
- };
895
- }
896
- return freezeToolJsonSchema(presentation);
897
- }
898
- function isObjectPresentationSchema(schema) {
899
- return schema.type === "object" && isRecord(schema.properties);
900
- }
901
- function presentationMetadata(schema) {
902
- return withDefsDialect(withoutDialect(schema));
903
- }
904
-
905
- // src/tools/internal/surface-projector.ts
906
- import { z as z3 } from "zod";
907
- function assertToolExtensionCompatible(base, extra) {
908
- if (!(base instanceof z3.ZodObject))
909
- return;
910
- const conflicts = Object.keys(extra).filter((key) => (key in base.shape));
911
- if (conflicts.length > 0) {
912
- throw new Error(`Tool extend conflict: ${conflicts.join(", ")} already declared by the contract`);
913
- }
914
- }
915
- function projectRuntimeTool(definition, assertName = true) {
916
- if (assertName) {
917
- assertProjectedName(definition.name, definition.identity.serviceName, definition.identity.action, "MCP", false);
918
- }
919
- return {
920
- kind: "runtime",
921
- source: definition,
922
- serviceName: definition.identity.serviceName,
923
- action: definition.identity.action,
924
- name: definition.name,
925
- presentationSchema: buildToolPresentationSchema({
926
- inputSchema: definition.input,
927
- unrepresentable: "any"
928
- }),
929
- shouldExtend: false,
930
- ...definition.mcp !== undefined && { mcp: definition.mcp }
931
- };
932
- }
933
- function projectedRuntimeToolSupports(definition, transport) {
934
- if (definition.transports?.length === 0) {
935
- throw new Error(`Runtime tool "${definition.name}" must expose at least one transport`);
936
- }
937
- return definition.transports ? definition.transports.includes(transport) : transport !== "CLI";
938
- }
939
- function duplicateLabel(transport) {
940
- if (transport === "MCP")
941
- return "MCP tool name";
942
- if (transport === "AGENT")
943
- return "agent tool name";
944
- return "CLI command";
945
- }
946
- function assertProjectedName(name, serviceName, action, transport, derived) {
947
- if (transport === "CLI")
948
- return;
949
- if (derived && !hasUsableChars(serviceName)) {
950
- throw new Error(`Service prefix "${serviceName}" (method "${action}") has no characters usable in a tool name — set an explicit \`toolName\` or rename the prefix`);
951
- }
952
- assertToolName(name, serviceName, action);
953
- }
954
- function projectToolSurface(surface, transport, config = {}) {
955
- const projected = [];
956
- const names = new Set;
957
- const origins = new Map;
958
- const append = (tool) => {
959
- if (config.assertUniqueNames ?? true) {
960
- if (names.has(tool.name)) {
961
- const previous = origins.get(tool.name) ?? "unknown";
962
- const current = `${tool.serviceName}.${tool.action}`;
963
- throw new Error(`Duplicate ${duplicateLabel(transport)} "${tool.name}" across mounted operations: ${previous}, ${current}`);
964
- }
965
- assertUniqueToolName(tool.name, false, duplicateLabel(transport));
966
- }
967
- names.add(tool.name);
968
- origins.set(tool.name, `${tool.serviceName}.${tool.action}`);
969
- projected.push(tool);
970
- };
971
- for (const service of surface.services ?? []) {
972
- for (const [methodName, method] of Object.entries(service.methods)) {
973
- if (transport === "CLI") {
974
- if (!method.expose?.includes("CLI"))
975
- continue;
976
- } else if (method.expose && !method.expose.includes(transport)) {
977
- continue;
978
- }
979
- if (method.multipart || method.rawBody || method.responseMeta || method.rawResponse) {
980
- continue;
981
- }
982
- const name = method.toolName ?? toToolName(service.name, methodName);
983
- if (config.assertNames ?? true) {
984
- assertProjectedName(name, service.name, methodName, transport, !method.toolName);
985
- }
986
- const shouldExtend = transport !== "CLI" && config.extend !== undefined && (!config.extend.filter || config.extend.filter(service, method));
987
- if (shouldExtend && config.extend) {
988
- assertToolExtensionCompatible(mergeSchemas(method.paramsSchema, method.inputSchema), config.extend.schema);
989
- }
990
- append({
991
- kind: "contract",
992
- source: method,
993
- serviceName: method.serviceName,
994
- action: method.key,
995
- name,
996
- presentationSchema: buildToolPresentationSchema({
997
- paramsSchema: method.paramsSchema,
998
- inputSchema: method.inputSchema,
999
- extendSchema: shouldExtend ? config.extend?.schema : undefined,
1000
- flattenUnionInput: config.flattenUnionInput,
1001
- unrepresentable: "any"
1002
- }),
1003
- shouldExtend,
1004
- ...method.mcp !== undefined && { mcp: method.mcp }
1005
- });
1006
- }
1007
- }
1008
- for (const definition of surface.runtimeTools ?? []) {
1009
- if (!projectedRuntimeToolSupports(definition, transport))
1010
- continue;
1011
- if (config.assertNames ?? true) {
1012
- assertProjectedName(definition.name, definition.identity.serviceName, definition.identity.action, transport, false);
1013
- }
1014
- append(projectRuntimeTool(definition, false));
1015
- }
1016
- return projected;
1017
- }
1018
- function mcpProjectionCandidate(tool) {
1019
- if (tool.kind === "contract") {
1020
- return {
1021
- tool,
1022
- name: tool.name,
1023
- ...tool.source.paramsSchema !== undefined && {
1024
- paramsSchema: tool.source.paramsSchema
1025
- },
1026
- ...tool.source.inputSchema !== undefined && {
1027
- inputSchema: tool.source.inputSchema
1028
- },
1029
- ...tool.source.outputSchema !== undefined && {
1030
- outputSchema: tool.source.outputSchema
1031
- },
1032
- shouldExtend: tool.shouldExtend,
1033
- ...tool.mcp !== undefined && { mcp: tool.mcp }
1034
- };
1035
- }
1036
- return {
1037
- tool,
1038
- name: tool.name,
1039
- inputSchema: tool.source.input,
1040
- ...tool.source.output !== undefined && { outputSchema: tool.source.output },
1041
- shouldExtend: false,
1042
- ...tool.mcp !== undefined && { mcp: tool.mcp }
1043
- };
1044
- }
1045
- function reportIncompatible(message, policy, logger, failures) {
1046
- if (policy === "throw")
1047
- failures.push(message);
1048
- else if (policy === "warn") {
1049
- if (logger)
1050
- logger.warn(`[stitchkit] ${message}`);
1051
- else
1052
- console.warn(`[stitchkit] ${message}`);
1053
- }
1054
- }
1055
- function prepareProjectedMcpTools(tools, config = {}) {
1056
- const policy = config.schemaValidation?.policy ?? "throw";
1057
- const failures = [];
1058
- const prepared = [];
1059
- const names = new Set;
1060
- for (const tool of tools) {
1061
- assertUniqueToolName(tool.name, names.has(tool.name), "MCP tool name");
1062
- names.add(tool.name);
1063
- if (tool.mcp)
1064
- validateMcpRoundPolicy(tool, tool.mcp, config.multiRound);
1065
- let inputSchema;
1066
- try {
1067
- inputSchema = buildToolPresentationSchema({
1068
- paramsSchema: tool.paramsSchema,
1069
- inputSchema: tool.inputSchema,
1070
- extendSchema: tool.shouldExtend && config.extend ? config.extend.schema : undefined,
1071
- flattenUnionInput: config.flattenUnionInput,
1072
- unrepresentable: "throw"
1073
- });
1074
- } catch (error) {
1075
- reportIncompatible(`MCP tool "${tool.name}" — input schema is not JSON Schema-compatible: ${error instanceof Error ? error.message : String(error)}`, policy, config.logger, failures);
1076
- continue;
1077
- }
1078
- if (!isObjectPresentationSchema(inputSchema)) {
1079
- reportIncompatible(`MCP tool "${tool.name}" — input must be an object schema; a union, discriminated union or scalar cannot be an MCP tool input (flatten it in the contract, or drop MCP from \`expose\`)`, policy, config.logger, failures);
1080
- continue;
1081
- }
1082
- if (config.schemaValidation?.requireTypedProperties) {
1083
- const allowed = new Set(config.schemaValidation.allowUntyped ?? []);
1084
- for (const untyped of findUntypedProperties(inputSchema)) {
1085
- const path = `${tool.name}.${untyped.path}`;
1086
- if (allowed.has(path))
1087
- continue;
1088
- const clue = untyped.description ? ` (only a description: "${untyped.description}")` : "";
1089
- reportIncompatible(`MCP tool "${tool.name}" — input property "${untyped.path}" carries no type, enum or $ref${clue}. A model is given no way to know what to send. Use \`z.json()\` for an arbitrary JSON value; use \`allowUntyped\` only when the presentation value is genuinely not representable as JSON Schema.`, policy === "skip" ? "warn" : policy, config.logger, failures);
1090
- }
1091
- }
1092
- if (config.schemaValidation?.requirePortableFormats) {
1093
- for (const finding of findNonPortableFormats(inputSchema, config.schemaValidation.allowFormats)) {
1094
- reportIncompatible(`MCP tool "${tool.name}" — input property "${finding.path}" uses non-portable JSON Schema format "${finding.format}". Use a portable pattern/schema, or list the format in \`allowFormats\` only when every MCP client supports it.`, policy === "skip" ? "warn" : policy, config.logger, failures);
1095
- }
1096
- }
1097
- const outputSchema = tool.outputSchema;
1098
- let compatibleOutput;
1099
- if (outputSchema) {
1100
- try {
1101
- const output = toJsonSchema(outputSchema, "output");
1102
- compatibleOutput = outputSchema;
1103
- if (config.schemaValidation?.requirePortableFormats) {
1104
- for (const finding of findNonPortableFormats(output, config.schemaValidation.allowFormats)) {
1105
- reportIncompatible(`MCP tool "${tool.name}" — output property "${finding.path}" uses non-portable JSON Schema format "${finding.format}". Use a portable pattern/schema, or list the format in \`allowFormats\` only when every MCP client supports it.`, policy === "skip" ? "warn" : policy, config.logger, failures);
1106
- }
1107
- }
1108
- } catch (error) {
1109
- reportIncompatible(`MCP tool "${tool.name}" — output schema is not JSON Schema-compatible: ${error instanceof Error ? error.message : String(error)}`, policy, config.logger, failures);
1110
- }
1111
- }
1112
- prepared.push({
1113
- tool: tool.tool,
1114
- inputSchema,
1115
- ...compatibleOutput !== undefined && { outputSchema: compatibleOutput }
1116
- });
1117
- }
1118
- if (failures.length > 0) {
1119
- throw new Error(`[stitchkit] ${failures.length} problem(s) with MCP tool schemas:
1120
- - ${failures.join(`
1121
- - `)}`);
1122
- }
1123
- return prepared;
1124
- }
1125
-
1126
- export { objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS, findNonPortableFormats, flattenToolJsonSchema, declaresDraft07, withDefsDialect, buildToolPresentationSchema, presentationMetadata, findUntypedProperties, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };