stitchkit 0.125.0 → 0.127.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1249) hide show
  1. package/CHANGELOG.md +1707 -1
  2. package/README.md +12 -4
  3. package/dist/agent-executor/acp/scenarios.d.ts +4 -0
  4. package/dist/agent-executor/acp/scenarios.d.ts.map +1 -0
  5. package/dist/agent-executor/acp/v1-connect.d.ts +89 -0
  6. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -0
  7. package/dist/agent-executor/acp/v1-driver.d.ts +31 -0
  8. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -0
  9. package/dist/agent-executor/acp/v1-map.d.ts +41 -0
  10. package/dist/agent-executor/acp/v1-map.d.ts.map +1 -0
  11. package/dist/agent-executor/acp/v1-protocol.d.ts +270 -0
  12. package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -0
  13. package/dist/agent-executor/acp/v1-session.d.ts +22 -0
  14. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -0
  15. package/dist/agent-executor/acp/v1-turn.d.ts +25 -0
  16. package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -0
  17. package/dist/agent-executor/claude/classify.d.ts +54 -0
  18. package/dist/agent-executor/claude/classify.d.ts.map +1 -0
  19. package/dist/agent-executor/claude/cli-driver.d.ts +27 -0
  20. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -0
  21. package/dist/agent-executor/claude/limits.d.ts +8 -0
  22. package/dist/agent-executor/claude/limits.d.ts.map +1 -0
  23. package/dist/agent-executor/claude/protocol.d.ts +188 -0
  24. package/dist/agent-executor/claude/protocol.d.ts.map +1 -0
  25. package/dist/agent-executor/claude/scenarios.d.ts +4 -0
  26. package/dist/agent-executor/claude/scenarios.d.ts.map +1 -0
  27. package/dist/agent-executor/claude/session.d.ts +22 -0
  28. package/dist/agent-executor/claude/session.d.ts.map +1 -0
  29. package/dist/agent-executor/claude/transcript.d.ts +33 -0
  30. package/dist/agent-executor/claude/transcript.d.ts.map +1 -0
  31. package/dist/agent-executor/claude-sdk/driver.d.ts +31 -0
  32. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -0
  33. package/dist/agent-executor/claude-sdk/session.d.ts +10 -0
  34. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -0
  35. package/dist/agent-executor/codex/classify.d.ts +28 -0
  36. package/dist/agent-executor/codex/classify.d.ts.map +1 -0
  37. package/dist/agent-executor/codex/driver.d.ts +23 -0
  38. package/dist/agent-executor/codex/driver.d.ts.map +1 -0
  39. package/dist/agent-executor/codex/limits.d.ts +4 -0
  40. package/dist/agent-executor/codex/limits.d.ts.map +1 -0
  41. package/dist/agent-executor/codex/protocol.d.ts +152 -0
  42. package/dist/agent-executor/codex/protocol.d.ts.map +1 -0
  43. package/dist/agent-executor/codex/scenarios.d.ts +4 -0
  44. package/dist/agent-executor/codex/scenarios.d.ts.map +1 -0
  45. package/dist/agent-executor/codex/session.d.ts +41 -0
  46. package/dist/agent-executor/codex/session.d.ts.map +1 -0
  47. package/dist/agent-executor/contract.d.ts +454 -0
  48. package/dist/agent-executor/contract.d.ts.map +1 -0
  49. package/dist/agent-executor/dispatch.d.ts +41 -0
  50. package/dist/agent-executor/dispatch.d.ts.map +1 -0
  51. package/dist/agent-executor/engine-process.d.ts +45 -0
  52. package/dist/agent-executor/engine-process.d.ts.map +1 -0
  53. package/dist/agent-executor/engine-requests.d.ts +63 -0
  54. package/dist/agent-executor/engine-requests.d.ts.map +1 -0
  55. package/dist/agent-executor/engine.d.ts +64 -0
  56. package/dist/agent-executor/engine.d.ts.map +1 -0
  57. package/dist/agent-executor/executor-contract.d.ts +387 -0
  58. package/dist/agent-executor/executor-contract.d.ts.map +1 -0
  59. package/dist/agent-executor/executor-machine.d.ts +50 -0
  60. package/dist/agent-executor/executor-machine.d.ts.map +1 -0
  61. package/dist/agent-executor/hello.d.ts +235 -0
  62. package/dist/agent-executor/hello.d.ts.map +1 -0
  63. package/dist/agent-executor/json-rpc-peer.d.ts +48 -0
  64. package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -0
  65. package/dist/agent-executor/leases.d.ts +159 -0
  66. package/dist/agent-executor/leases.d.ts.map +1 -0
  67. package/dist/agent-executor/plan-limits.d.ts +25 -0
  68. package/dist/agent-executor/plan-limits.d.ts.map +1 -0
  69. package/dist/agent-executor/profile.d.ts +52 -0
  70. package/dist/agent-executor/profile.d.ts.map +1 -0
  71. package/dist/agent-executor/projection.d.ts +14 -0
  72. package/dist/agent-executor/projection.d.ts.map +1 -0
  73. package/dist/agent-executor/session-primitives.d.ts +72 -0
  74. package/dist/agent-executor/session-primitives.d.ts.map +1 -0
  75. package/dist/agent-executor/testing/conformance.d.ts +55 -0
  76. package/dist/agent-executor/testing/conformance.d.ts.map +1 -0
  77. package/dist/agent-executor/testing/fake-claude-engine.d.ts +18 -0
  78. package/dist/agent-executor/testing/fake-claude-engine.d.ts.map +1 -0
  79. package/dist/agent-executor/testing/fake-engine.d.ts +52 -0
  80. package/dist/agent-executor/testing/fake-engine.d.ts.map +1 -0
  81. package/dist/agent-executor/turn-phases.d.ts +10 -0
  82. package/dist/agent-executor/turn-phases.d.ts.map +1 -0
  83. package/dist/agent-executor/vocabulary.d.ts +353 -0
  84. package/dist/agent-executor/vocabulary.d.ts.map +1 -0
  85. package/dist/agent-parts/parts.d.ts +160 -0
  86. package/dist/agent-parts/parts.d.ts.map +1 -0
  87. package/dist/agent-runtime/agent-tool.d.ts +1 -1
  88. package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
  89. package/dist/agent-runtime/archive-projection.d.ts +5 -0
  90. package/dist/agent-runtime/archive-projection.d.ts.map +1 -1
  91. package/dist/agent-runtime/branch-contract.d.ts +63 -1
  92. package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
  93. package/dist/agent-runtime/branch-events.d.ts +7 -0
  94. package/dist/agent-runtime/branch-events.d.ts.map +1 -1
  95. package/dist/agent-runtime/branch-identities.d.ts +53 -1
  96. package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
  97. package/dist/agent-runtime/branch-messages.d.ts +15 -26
  98. package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
  99. package/dist/agent-runtime/branch-observations.d.ts +138 -28
  100. package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
  101. package/dist/agent-runtime/branch-provider.d.ts +32 -51
  102. package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
  103. package/dist/agent-runtime/branch-refusal.d.ts +60 -0
  104. package/dist/agent-runtime/branch-refusal.d.ts.map +1 -0
  105. package/dist/agent-runtime/branch-runtime-tools.d.ts +14 -0
  106. package/dist/agent-runtime/branch-runtime-tools.d.ts.map +1 -0
  107. package/dist/agent-runtime/branch-source.d.ts +7 -2
  108. package/dist/agent-runtime/branch-source.d.ts.map +1 -1
  109. package/dist/agent-runtime/branch-transitions.d.ts.map +1 -1
  110. package/dist/agent-runtime/browser-control-contract.d.ts +2 -2
  111. package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
  112. package/dist/agent-runtime/child-blocking.d.ts +17 -6
  113. package/dist/agent-runtime/child-blocking.d.ts.map +1 -1
  114. package/dist/agent-runtime/child-budget-policy.d.ts +4 -9
  115. package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -1
  116. package/dist/agent-runtime/child-tools.d.ts +19 -8
  117. package/dist/agent-runtime/child-tools.d.ts.map +1 -1
  118. package/dist/agent-runtime/children-contract.d.ts +84 -3
  119. package/dist/agent-runtime/children-contract.d.ts.map +1 -1
  120. package/dist/agent-runtime/children-control.d.ts +23 -2
  121. package/dist/agent-runtime/children-control.d.ts.map +1 -1
  122. package/dist/agent-runtime/children-spawn.d.ts +9 -0
  123. package/dist/agent-runtime/children-spawn.d.ts.map +1 -1
  124. package/dist/agent-runtime/children-state.d.ts +121 -19
  125. package/dist/agent-runtime/children-state.d.ts.map +1 -1
  126. package/dist/agent-runtime/children-usage.d.ts +10 -1
  127. package/dist/agent-runtime/children-usage.d.ts.map +1 -1
  128. package/dist/agent-runtime/children.d.ts +3 -3
  129. package/dist/agent-runtime/children.d.ts.map +1 -1
  130. package/dist/agent-runtime/{sandbox-coding.d.ts → coding-sandbox.d.ts} +2 -9
  131. package/dist/agent-runtime/coding-sandbox.d.ts.map +1 -0
  132. package/dist/agent-runtime/coding-shell-process.d.ts +2 -0
  133. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  134. package/dist/agent-runtime/coding-tool-contract.d.ts +32 -1
  135. package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
  136. package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
  137. package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
  138. package/dist/agent-runtime/compaction.d.ts.map +1 -1
  139. package/dist/agent-runtime/companion-host.d.ts +38 -0
  140. package/dist/agent-runtime/companion-host.d.ts.map +1 -0
  141. package/dist/agent-runtime/context-issue.d.ts +5 -0
  142. package/dist/agent-runtime/context-issue.d.ts.map +1 -0
  143. package/dist/agent-runtime/control-schema.d.ts +2 -2
  144. package/dist/agent-runtime/control-schema.d.ts.map +1 -1
  145. package/dist/agent-runtime/conversations.d.ts.map +1 -1
  146. package/dist/agent-runtime/coordinator.d.ts.map +1 -1
  147. package/dist/agent-runtime/deferred-tool-types.d.ts +17 -5
  148. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  149. package/dist/agent-runtime/deferred-tools-internal.d.ts +2 -0
  150. package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -1
  151. package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
  152. package/dist/agent-runtime/event-durability.d.ts +8 -0
  153. package/dist/agent-runtime/event-durability.d.ts.map +1 -0
  154. package/dist/agent-runtime/event-schema.d.ts +13 -5
  155. package/dist/agent-runtime/event-schema.d.ts.map +1 -1
  156. package/dist/agent-runtime/event-search-postgres.d.ts +38 -0
  157. package/dist/agent-runtime/event-search-postgres.d.ts.map +1 -0
  158. package/dist/agent-runtime/event-search-terms.d.ts +37 -0
  159. package/dist/agent-runtime/event-search-terms.d.ts.map +1 -0
  160. package/dist/agent-runtime/event-search-tools.d.ts +64 -4
  161. package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
  162. package/dist/agent-runtime/event-search.d.ts +16 -3
  163. package/dist/agent-runtime/event-search.d.ts.map +1 -1
  164. package/dist/agent-runtime/fault-bench.d.ts.map +1 -1
  165. package/dist/agent-runtime/harness-control.d.ts +8 -0
  166. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  167. package/dist/agent-runtime/harness-realtime.d.ts +0 -2
  168. package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
  169. package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
  170. package/dist/agent-runtime/invocation-schema.d.ts +23 -0
  171. package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
  172. package/dist/agent-runtime/invocation-spend.d.ts +9 -0
  173. package/dist/agent-runtime/invocation-spend.d.ts.map +1 -0
  174. package/dist/agent-runtime/invocations.d.ts.map +1 -1
  175. package/dist/agent-runtime/managed-tools.d.ts +2 -2
  176. package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
  177. package/dist/agent-runtime/observability.d.ts +42 -4
  178. package/dist/agent-runtime/observability.d.ts.map +1 -1
  179. package/dist/agent-runtime/openrouter-admission.d.ts +81 -0
  180. package/dist/agent-runtime/openrouter-admission.d.ts.map +1 -0
  181. package/dist/agent-runtime/openrouter-catalog.d.ts +83 -0
  182. package/dist/agent-runtime/openrouter-catalog.d.ts.map +1 -0
  183. package/dist/agent-runtime/openrouter-models.d.ts +66 -0
  184. package/dist/agent-runtime/openrouter-models.d.ts.map +1 -0
  185. package/dist/agent-runtime/openrouter-options.d.ts +106 -0
  186. package/dist/agent-runtime/openrouter-options.d.ts.map +1 -0
  187. package/dist/agent-runtime/openrouter-route.d.ts +50 -0
  188. package/dist/agent-runtime/openrouter-route.d.ts.map +1 -0
  189. package/dist/agent-runtime/openrouter-spend.d.ts +24 -0
  190. package/dist/agent-runtime/openrouter-spend.d.ts.map +1 -0
  191. package/dist/agent-runtime/openrouter.d.ts +23 -2
  192. package/dist/agent-runtime/openrouter.d.ts.map +1 -1
  193. package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -1
  194. package/dist/agent-runtime/postgres-schema.d.ts +34 -0
  195. package/dist/agent-runtime/postgres-schema.d.ts.map +1 -0
  196. package/dist/agent-runtime/postgres-transactions.d.ts +54 -0
  197. package/dist/agent-runtime/postgres-transactions.d.ts.map +1 -0
  198. package/dist/agent-runtime/postgres.d.ts +72 -0
  199. package/dist/agent-runtime/postgres.d.ts.map +1 -0
  200. package/dist/agent-runtime/projections.d.ts +57 -17
  201. package/dist/agent-runtime/projections.d.ts.map +1 -1
  202. package/dist/agent-runtime/provider-journal.d.ts +57 -0
  203. package/dist/agent-runtime/provider-journal.d.ts.map +1 -1
  204. package/dist/agent-runtime/purge.d.ts.map +1 -1
  205. package/dist/agent-runtime/retry-policy.d.ts +6 -0
  206. package/dist/agent-runtime/retry-policy.d.ts.map +1 -1
  207. package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
  208. package/dist/agent-runtime/run-execution-state.d.ts +26 -2
  209. package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
  210. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  211. package/dist/agent-runtime/run-failure.d.ts.map +1 -1
  212. package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
  213. package/dist/agent-runtime/run-provider-ledger.d.ts +2 -0
  214. package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -1
  215. package/dist/agent-runtime/run-step-barriers.d.ts +72 -0
  216. package/dist/agent-runtime/run-step-barriers.d.ts.map +1 -0
  217. package/dist/agent-runtime/run-step-spend.d.ts +319 -0
  218. package/dist/agent-runtime/run-step-spend.d.ts.map +1 -0
  219. package/dist/agent-runtime/run-stream-parts.d.ts +2 -0
  220. package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
  221. package/dist/agent-runtime/{tool-progress.d.ts → run-tool-progress.d.ts} +1 -1
  222. package/dist/agent-runtime/run-tool-progress.d.ts.map +1 -0
  223. package/dist/agent-runtime/run-turn-preparation.d.ts +3 -1
  224. package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -1
  225. package/dist/agent-runtime/runtime-admission-gate.d.ts +0 -14
  226. package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -1
  227. package/dist/agent-runtime/runtime-internals.d.ts +6 -0
  228. package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
  229. package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
  230. package/dist/agent-runtime/runtime.d.ts +31 -2
  231. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  232. package/dist/agent-runtime/sandbox-binding.d.ts +10 -0
  233. package/dist/agent-runtime/sandbox-binding.d.ts.map +1 -0
  234. package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -1
  235. package/dist/agent-runtime/sandbox-contract.d.ts +1 -1
  236. package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
  237. package/dist/agent-runtime/sandbox.d.ts +5 -0
  238. package/dist/agent-runtime/sandbox.d.ts.map +1 -1
  239. package/dist/agent-runtime/schedule-contract.d.ts +3 -2
  240. package/dist/agent-runtime/schedule-contract.d.ts.map +1 -1
  241. package/dist/agent-runtime/schedule-dispatch.d.ts +3 -2
  242. package/dist/agent-runtime/schedule-dispatch.d.ts.map +1 -1
  243. package/dist/agent-runtime/schedule-records.d.ts +6 -6
  244. package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
  245. package/dist/agent-runtime/schedule-tools.d.ts +19 -8
  246. package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
  247. package/dist/agent-runtime/schedules.d.ts +13 -3
  248. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  249. package/dist/agent-runtime/schemas-message.d.ts +118 -0
  250. package/dist/agent-runtime/schemas-message.d.ts.map +1 -0
  251. package/dist/agent-runtime/schemas-provider.d.ts +8 -0
  252. package/dist/agent-runtime/schemas-provider.d.ts.map +1 -0
  253. package/dist/agent-runtime/schemas-records.d.ts +5 -0
  254. package/dist/agent-runtime/schemas-records.d.ts.map +1 -0
  255. package/dist/agent-runtime/schemas-run.d.ts +487 -0
  256. package/dist/agent-runtime/schemas-run.d.ts.map +1 -0
  257. package/dist/agent-runtime/schemas-usage.d.ts +129 -0
  258. package/dist/agent-runtime/schemas-usage.d.ts.map +1 -0
  259. package/dist/agent-runtime/schemas.d.ts +11 -886
  260. package/dist/agent-runtime/schemas.d.ts.map +1 -1
  261. package/dist/agent-runtime/spill.d.ts +9 -7
  262. package/dist/agent-runtime/spill.d.ts.map +1 -1
  263. package/dist/agent-runtime/sql-events.d.ts +6 -0
  264. package/dist/agent-runtime/sql-events.d.ts.map +1 -0
  265. package/dist/agent-runtime/sql-history.d.ts +8 -0
  266. package/dist/agent-runtime/sql-history.d.ts.map +1 -0
  267. package/dist/agent-runtime/sql-ledger.d.ts +5 -0
  268. package/dist/agent-runtime/sql-ledger.d.ts.map +1 -0
  269. package/dist/agent-runtime/sql-purge.d.ts +13 -0
  270. package/dist/agent-runtime/sql-purge.d.ts.map +1 -0
  271. package/dist/agent-runtime/sql-reads.d.ts +16 -0
  272. package/dist/agent-runtime/sql-reads.d.ts.map +1 -0
  273. package/dist/agent-runtime/{sqlite-rows.d.ts → sql-rows.d.ts} +24 -10
  274. package/dist/agent-runtime/sql-rows.d.ts.map +1 -0
  275. package/dist/agent-runtime/sql-session.d.ts +71 -0
  276. package/dist/agent-runtime/sql-session.d.ts.map +1 -0
  277. package/dist/agent-runtime/sqlite-bun.d.ts +1 -1
  278. package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -1
  279. package/dist/agent-runtime/sqlite-node.d.ts +1 -1
  280. package/dist/agent-runtime/sqlite-node.d.ts.map +1 -1
  281. package/dist/agent-runtime/sqlite-purge.d.ts +2 -3
  282. package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
  283. package/dist/agent-runtime/sqlite-schema.d.ts +1 -1
  284. package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -1
  285. package/dist/agent-runtime/sqlite-transactions.d.ts +10 -6
  286. package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
  287. package/dist/agent-runtime/sqlite.d.ts +10 -29
  288. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  289. package/dist/agent-runtime/state-tools.d.ts +8 -4
  290. package/dist/agent-runtime/state-tools.d.ts.map +1 -1
  291. package/dist/agent-runtime/store-archive.d.ts.map +1 -1
  292. package/dist/agent-runtime/store-branch.d.ts +6 -1
  293. package/dist/agent-runtime/store-branch.d.ts.map +1 -1
  294. package/dist/agent-runtime/store-capabilities.d.ts +42 -0
  295. package/dist/agent-runtime/store-capabilities.d.ts.map +1 -0
  296. package/dist/agent-runtime/store-conformance-branch.d.ts +5 -2
  297. package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -1
  298. package/dist/agent-runtime/store-conformance-capabilities.d.ts +6 -0
  299. package/dist/agent-runtime/store-conformance-capabilities.d.ts.map +1 -0
  300. package/dist/agent-runtime/store-conformance-event-once.d.ts +12 -0
  301. package/dist/agent-runtime/store-conformance-event-once.d.ts.map +1 -0
  302. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  303. package/dist/agent-runtime/store-conformance-seed.d.ts +8 -0
  304. package/dist/agent-runtime/store-conformance-seed.d.ts.map +1 -0
  305. package/dist/agent-runtime/store-conformance.d.ts +31 -8
  306. package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
  307. package/dist/agent-runtime/store-create.d.ts +1 -1
  308. package/dist/agent-runtime/store-create.d.ts.map +1 -1
  309. package/dist/agent-runtime/store-driver-contract.d.ts +15 -8
  310. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  311. package/dist/agent-runtime/store-event-once.d.ts.map +1 -1
  312. package/dist/agent-runtime/store-events.d.ts +114 -0
  313. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  314. package/dist/agent-runtime/store-memory-archive.d.ts +2 -0
  315. package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -1
  316. package/dist/agent-runtime/store-memory.d.ts +2 -2
  317. package/dist/agent-runtime/store-memory.d.ts.map +1 -1
  318. package/dist/agent-runtime/store-mutate.d.ts.map +1 -1
  319. package/dist/agent-runtime/store-reduce-shared.d.ts +2 -1
  320. package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
  321. package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
  322. package/dist/agent-runtime/store-replay.d.ts.map +1 -1
  323. package/dist/agent-runtime/store.d.ts +15 -2
  324. package/dist/agent-runtime/store.d.ts.map +1 -1
  325. package/dist/agent-runtime/terminal-commit.d.ts +10 -10
  326. package/dist/application/admission-run.d.ts.map +1 -1
  327. package/dist/application/admission.d.ts.map +1 -1
  328. package/dist/application/change-subscription.d.ts.map +1 -1
  329. package/dist/application/decisions.d.ts.map +1 -1
  330. package/dist/application/diagnostic-journal-lock-format.d.ts +9 -0
  331. package/dist/application/diagnostic-journal-lock-format.d.ts.map +1 -0
  332. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  333. package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
  334. package/dist/application/grammy-update-admission.d.ts.map +1 -1
  335. package/dist/application/health.d.ts.map +1 -1
  336. package/dist/application/kernel-admission.d.ts.map +1 -1
  337. package/dist/application/kernel-contract.d.ts.map +1 -1
  338. package/dist/application/kernel-restart.d.ts.map +1 -1
  339. package/dist/application/kernel-rollback.d.ts.map +1 -1
  340. package/dist/application/kernel-shutdown.d.ts.map +1 -1
  341. package/dist/application/kernel-state.d.ts.map +1 -1
  342. package/dist/application/notification-outbox-state.d.ts.map +1 -1
  343. package/dist/application/notification-outbox.d.ts +1 -1
  344. package/dist/application/notification-outbox.d.ts.map +1 -1
  345. package/dist/application/revision-signal.d.ts.map +1 -1
  346. package/dist/application/schedule-run.d.ts.map +1 -1
  347. package/dist/application/schedule.d.ts.map +1 -1
  348. package/dist/application/sqlite-migrations.d.ts +104 -0
  349. package/dist/application/sqlite-migrations.d.ts.map +1 -0
  350. package/dist/application/watch-hub-core.d.ts +2 -1
  351. package/dist/application/watch-hub-core.d.ts.map +1 -1
  352. package/dist/application/watch-hub-source.d.ts +2 -0
  353. package/dist/application/watch-hub-source.d.ts.map +1 -1
  354. package/dist/application/watch-hub.d.ts +20 -1
  355. package/dist/application/watch-hub.d.ts.map +1 -1
  356. package/dist/browser/bridge-errors.d.ts +24 -0
  357. package/dist/browser/bridge-errors.d.ts.map +1 -0
  358. package/dist/browser/bridge-fetch.d.ts +30 -0
  359. package/dist/browser/bridge-fetch.d.ts.map +1 -0
  360. package/dist/browser/bridge-inbound.d.ts +28 -0
  361. package/dist/browser/bridge-inbound.d.ts.map +1 -0
  362. package/dist/browser/cancellation.d.ts +10 -2
  363. package/dist/browser/cancellation.d.ts.map +1 -1
  364. package/dist/browser/chunked-upload.d.ts +1 -1
  365. package/dist/browser/chunked-upload.d.ts.map +1 -1
  366. package/dist/browser/client-call-arguments.d.ts +31 -0
  367. package/dist/browser/client-call-arguments.d.ts.map +1 -0
  368. package/dist/browser/client-executors.d.ts +6 -0
  369. package/dist/browser/client-executors.d.ts.map +1 -1
  370. package/dist/browser/client.d.ts +9 -0
  371. package/dist/browser/client.d.ts.map +1 -1
  372. package/dist/browser/http.d.ts +17 -2
  373. package/dist/browser/http.d.ts.map +1 -1
  374. package/dist/browser/realtime-client.d.ts +0 -5
  375. package/dist/browser/realtime-client.d.ts.map +1 -1
  376. package/dist/browser/session-credentials-storage.d.ts +48 -0
  377. package/dist/browser/session-credentials-storage.d.ts.map +1 -0
  378. package/dist/browser/session-credentials.d.ts +26 -5
  379. package/dist/browser/session-credentials.d.ts.map +1 -1
  380. package/dist/browser/session-refresh-policy.d.ts +124 -0
  381. package/dist/browser/session-refresh-policy.d.ts.map +1 -0
  382. package/dist/browser/session-refresh-timer.d.ts +30 -0
  383. package/dist/browser/session-refresh-timer.d.ts.map +1 -0
  384. package/dist/browser/session.d.ts.map +1 -1
  385. package/dist/browser/socket-io-connection.d.ts.map +1 -1
  386. package/dist/browser/socket-io-explicit-peer.d.ts +0 -1
  387. package/dist/browser/socket-io-explicit-peer.d.ts.map +1 -1
  388. package/dist/browser/stream.d.ts +1 -1
  389. package/dist/browser/stream.d.ts.map +1 -1
  390. package/dist/browser/upload-progress.d.ts +3 -0
  391. package/dist/browser/upload-progress.d.ts.map +1 -1
  392. package/dist/contract/bridge-envelope.d.ts +155 -0
  393. package/dist/contract/bridge-envelope.d.ts.map +1 -0
  394. package/dist/contract/define-validation.d.ts +2 -0
  395. package/dist/contract/define-validation.d.ts.map +1 -1
  396. package/dist/contract/define.d.ts +3 -0
  397. package/dist/contract/define.d.ts.map +1 -1
  398. package/dist/contract/errors.d.ts +4 -4
  399. package/dist/contract/errors.d.ts.map +1 -1
  400. package/dist/contract/normalize.d.ts +3 -1
  401. package/dist/contract/normalize.d.ts.map +1 -1
  402. package/dist/contract/operation-effect.d.ts +29 -0
  403. package/dist/contract/operation-effect.d.ts.map +1 -0
  404. package/dist/contract/runtime-context.d.ts +2 -0
  405. package/dist/contract/runtime-context.d.ts.map +1 -1
  406. package/dist/contract/tool-options.d.ts +7 -0
  407. package/dist/contract/tool-options.d.ts.map +1 -1
  408. package/dist/declaration/command.d.ts +26 -0
  409. package/dist/declaration/command.d.ts.map +1 -0
  410. package/dist/declaration/declaration.d.ts +4 -22
  411. package/dist/declaration/declaration.d.ts.map +1 -1
  412. package/dist/declaration/machine-names.d.ts +11 -0
  413. package/dist/declaration/machine-names.d.ts.map +1 -0
  414. package/dist/durability/effect.d.ts.map +1 -1
  415. package/dist/durability/engine.d.ts.map +1 -1
  416. package/dist/durability/events.d.ts +5 -8
  417. package/dist/durability/events.d.ts.map +1 -1
  418. package/dist/durability/parks.d.ts +0 -5
  419. package/dist/durability/parks.d.ts.map +1 -1
  420. package/dist/durability/scheduler.d.ts +5 -0
  421. package/dist/durability/scheduler.d.ts.map +1 -1
  422. package/dist/entrypoints/agent-executor/acp.d.ts +4 -0
  423. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -0
  424. package/dist/entrypoints/agent-executor/acp.js +910 -0
  425. package/dist/entrypoints/agent-executor/claude-sdk.d.ts +2 -0
  426. package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -0
  427. package/dist/entrypoints/agent-executor/claude-sdk.js +309 -0
  428. package/dist/entrypoints/agent-executor/claude.d.ts +5 -0
  429. package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -0
  430. package/dist/entrypoints/agent-executor/claude.js +403 -0
  431. package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
  432. package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -0
  433. package/dist/entrypoints/agent-executor/codex.js +798 -0
  434. package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
  435. package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -0
  436. package/dist/entrypoints/agent-executor/testing.js +375 -0
  437. package/dist/entrypoints/agent-executor.d.ts +15 -0
  438. package/dist/entrypoints/agent-executor.d.ts.map +1 -0
  439. package/dist/entrypoints/agent-executor.js +455 -0
  440. package/dist/entrypoints/agent-runtime/browser.d.ts +1 -0
  441. package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
  442. package/dist/entrypoints/agent-runtime/browser.js +60 -30
  443. package/dist/entrypoints/agent-runtime/coding-tools.js +9 -12
  444. package/dist/entrypoints/agent-runtime/harness.js +35 -22
  445. package/dist/entrypoints/agent-runtime/openrouter.d.ts +6 -0
  446. package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
  447. package/dist/entrypoints/agent-runtime/openrouter.js +675 -45
  448. package/dist/entrypoints/agent-runtime/postgres.d.ts +4 -0
  449. package/dist/entrypoints/agent-runtime/postgres.d.ts.map +1 -0
  450. package/dist/entrypoints/agent-runtime/postgres.js +330 -0
  451. package/dist/entrypoints/agent-runtime/realtime.js +46 -49
  452. package/dist/entrypoints/agent-runtime/sandbox.d.ts +3 -1
  453. package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -1
  454. package/dist/entrypoints/agent-runtime/sandbox.js +74 -67
  455. package/dist/entrypoints/agent-runtime/sqlite/bun.js +18 -18
  456. package/dist/entrypoints/agent-runtime/sqlite/node.js +18 -18
  457. package/dist/entrypoints/agent-runtime/testing.d.ts +1 -1
  458. package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
  459. package/dist/entrypoints/agent-runtime/testing.js +419 -96
  460. package/dist/entrypoints/agent-runtime.d.ts +21 -13
  461. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  462. package/dist/entrypoints/agent-runtime.js +1280 -1086
  463. package/dist/entrypoints/application/diagnostic-journal.js +16 -11
  464. package/dist/entrypoints/application/directory-inbox.js +20 -14
  465. package/dist/entrypoints/application/grammy.js +11 -8
  466. package/dist/entrypoints/application/opentelemetry.js +3 -3
  467. package/dist/entrypoints/application.d.ts +5 -3
  468. package/dist/entrypoints/application.d.ts.map +1 -1
  469. package/dist/entrypoints/application.js +464 -116
  470. package/dist/entrypoints/bin/upgrade-cli.d.ts +0 -12
  471. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
  472. package/dist/entrypoints/bin/upgrade-cli.js +13 -7
  473. package/dist/entrypoints/cli/publish.js +10 -9
  474. package/dist/entrypoints/cli.d.ts +10 -3
  475. package/dist/entrypoints/cli.d.ts.map +1 -1
  476. package/dist/entrypoints/cli.js +91 -29
  477. package/dist/entrypoints/contract.d.ts +2 -1
  478. package/dist/entrypoints/contract.d.ts.map +1 -1
  479. package/dist/entrypoints/contract.js +13 -7
  480. package/dist/entrypoints/declaration.d.ts +2 -0
  481. package/dist/entrypoints/declaration.d.ts.map +1 -1
  482. package/dist/entrypoints/declaration.js +55 -44
  483. package/dist/entrypoints/files/packaging.js +8 -5
  484. package/dist/entrypoints/files.d.ts +5 -0
  485. package/dist/entrypoints/files.d.ts.map +1 -1
  486. package/dist/entrypoints/files.js +236 -47
  487. package/dist/entrypoints/geo.js +9 -4
  488. package/dist/entrypoints/google.js +14 -13
  489. package/dist/entrypoints/handler.d.ts +12 -0
  490. package/dist/entrypoints/handler.d.ts.map +1 -0
  491. package/dist/entrypoints/handler.js +350 -0
  492. package/dist/entrypoints/http.d.ts +4 -0
  493. package/dist/entrypoints/http.d.ts.map +1 -1
  494. package/dist/entrypoints/http.js +411 -5
  495. package/dist/entrypoints/index.d.ts +2 -0
  496. package/dist/entrypoints/index.d.ts.map +1 -1
  497. package/dist/entrypoints/index.js +664 -91
  498. package/dist/entrypoints/live.js +22 -12
  499. package/dist/entrypoints/node.d.ts +2 -1
  500. package/dist/entrypoints/node.d.ts.map +1 -1
  501. package/dist/entrypoints/node.js +34 -24
  502. package/dist/entrypoints/observability.d.ts +2 -0
  503. package/dist/entrypoints/observability.d.ts.map +1 -1
  504. package/dist/entrypoints/observability.js +205 -131
  505. package/dist/entrypoints/primitives.js +152 -14
  506. package/dist/entrypoints/process/owner-loss.js +2 -2
  507. package/dist/entrypoints/process.js +18 -92
  508. package/dist/entrypoints/react.js +6 -5
  509. package/dist/entrypoints/realtime.d.ts +1 -0
  510. package/dist/entrypoints/realtime.d.ts.map +1 -1
  511. package/dist/entrypoints/realtime.js +6 -3
  512. package/dist/entrypoints/release.js +4 -0
  513. package/dist/entrypoints/remote.js +7 -6
  514. package/dist/entrypoints/server.d.ts +4 -2
  515. package/dist/entrypoints/server.d.ts.map +1 -1
  516. package/dist/entrypoints/server.js +300 -199
  517. package/dist/entrypoints/service-host/macos.d.ts +16 -0
  518. package/dist/entrypoints/service-host/macos.d.ts.map +1 -0
  519. package/dist/entrypoints/service-host/macos.js +1998 -0
  520. package/dist/entrypoints/service-host.d.ts +23 -0
  521. package/dist/entrypoints/service-host.d.ts.map +1 -0
  522. package/dist/entrypoints/service-host.js +2544 -0
  523. package/dist/entrypoints/spend/testing.d.ts +2 -0
  524. package/dist/entrypoints/spend/testing.d.ts.map +1 -0
  525. package/dist/entrypoints/spend/testing.js +442 -0
  526. package/dist/entrypoints/spend.d.ts +8 -0
  527. package/dist/entrypoints/spend.d.ts.map +1 -0
  528. package/dist/entrypoints/spend.js +593 -0
  529. package/dist/entrypoints/sync/postgres.d.ts +12 -0
  530. package/dist/entrypoints/sync/postgres.d.ts.map +1 -0
  531. package/dist/entrypoints/sync/postgres.js +737 -0
  532. package/dist/entrypoints/sync.d.ts +12 -0
  533. package/dist/entrypoints/sync.d.ts.map +1 -0
  534. package/dist/entrypoints/sync.js +782 -0
  535. package/dist/entrypoints/telegram/grammy.js +5 -5
  536. package/dist/entrypoints/telegram/html.d.ts +2 -0
  537. package/dist/entrypoints/telegram/html.d.ts.map +1 -1
  538. package/dist/entrypoints/telegram/html.js +839 -2
  539. package/dist/entrypoints/telegram/screens.js +13 -15
  540. package/dist/entrypoints/telegram.d.ts +1 -1
  541. package/dist/entrypoints/telegram.d.ts.map +1 -1
  542. package/dist/entrypoints/telegram.js +286 -76
  543. package/dist/entrypoints/testing.js +33 -41
  544. package/dist/entrypoints/tools/agent.js +12 -9
  545. package/dist/entrypoints/tools/connections.js +664 -63
  546. package/dist/entrypoints/tools/contract.d.ts +2 -2
  547. package/dist/entrypoints/tools/contract.js +4 -1
  548. package/dist/entrypoints/tools/invoker.js +9 -7
  549. package/dist/entrypoints/tools/mcp.js +16 -11
  550. package/dist/entrypoints/tools/toolkit.js +21 -16
  551. package/dist/entrypoints/tools.d.ts +3 -1
  552. package/dist/entrypoints/tools.d.ts.map +1 -1
  553. package/dist/entrypoints/tools.js +107 -94
  554. package/dist/entrypoints/tracking/contract.js +2 -1
  555. package/dist/entrypoints/tracking/performance.js +4 -0
  556. package/dist/entrypoints/tracking.js +6 -1
  557. package/dist/entrypoints/voice.js +3 -3
  558. package/dist/entrypoints/xlsx.js +1 -1
  559. package/dist/files/boundary.d.ts.map +1 -1
  560. package/dist/files/chunk-spool.d.ts +27 -0
  561. package/dist/files/chunk-spool.d.ts.map +1 -1
  562. package/dist/files/directory-appearance.d.ts +44 -0
  563. package/dist/files/directory-appearance.d.ts.map +1 -0
  564. package/dist/files/file-io.d.ts.map +1 -1
  565. package/dist/files/file-stamp.d.ts +35 -0
  566. package/dist/files/file-stamp.d.ts.map +1 -0
  567. package/dist/files/json-file-reading.d.ts +37 -0
  568. package/dist/files/json-file-reading.d.ts.map +1 -0
  569. package/dist/files/native-packaging.d.ts.map +1 -1
  570. package/dist/files/polled-json.d.ts +121 -0
  571. package/dist/files/polled-json.d.ts.map +1 -0
  572. package/dist/files/regular-file.d.ts +125 -0
  573. package/dist/files/regular-file.d.ts.map +1 -0
  574. package/dist/geo/index.d.ts +2 -1
  575. package/dist/geo/index.d.ts.map +1 -1
  576. package/dist/geo/resolver.d.ts.map +1 -1
  577. package/dist/geo/types.d.ts +0 -1
  578. package/dist/geo/types.d.ts.map +1 -1
  579. package/dist/google/google.d.ts +6 -0
  580. package/dist/google/google.d.ts.map +1 -1
  581. package/dist/{index-w0eqdhyd.js → index-09f7w2qq.js} +6 -1
  582. package/dist/index-0djnptn8.js +501 -0
  583. package/dist/index-0hdm5sx6.js +1457 -0
  584. package/dist/{index-t05a2ry4.js → index-0p0s5hrj.js} +8 -14
  585. package/dist/{index-1c945ten.js → index-0r15pkjq.js} +1 -1
  586. package/dist/{index-v1swr26p.js → index-0tyt97nk.js} +2 -2
  587. package/dist/{index-332d0m9g.js → index-0x4mnwg5.js} +4 -0
  588. package/dist/index-118aebbg.js +48 -0
  589. package/dist/index-1q0n6zek.js +184 -0
  590. package/dist/index-27hck3z2.js +307 -0
  591. package/dist/index-2rf33y2h.js +77 -0
  592. package/dist/index-360j58vb.js +63 -0
  593. package/dist/{index-tt30h7mr.js → index-39n02e0q.js} +1 -1
  594. package/dist/index-3agqmmrg.js +42 -0
  595. package/dist/{index-n6hvd1r2.js → index-3b31z0pc.js} +22 -15
  596. package/dist/index-3djgv3ch.js +472 -0
  597. package/dist/{index-mfntvj58.js → index-3dq8466w.js} +1 -1
  598. package/dist/index-3gwp8ez6.js +200 -0
  599. package/dist/{index-x2d51zay.js → index-3ypvpkwr.js} +309 -345
  600. package/dist/index-4gk6k3zc.js +248 -0
  601. package/dist/index-4qvyhn23.js +40 -0
  602. package/dist/index-4s2w4g37.js +647 -0
  603. package/dist/index-4ynw5ktx.js +78 -0
  604. package/dist/index-5awtbyns.js +19 -0
  605. package/dist/{index-kxff9e9w.js → index-5e0zsbf7.js} +5 -4
  606. package/dist/{index-nz06qw5a.js → index-5jyjb4s0.js} +1 -1
  607. package/dist/{index-7q05ag0z.js → index-5ptwb6ka.js} +1 -1
  608. package/dist/{index-w3nv6kr8.js → index-5q0qpw3v.js} +54 -9
  609. package/dist/{index-mm89hd8v.js → index-5t4fpdct.js} +1 -1
  610. package/dist/{index-0v9xb8pz.js → index-5y7j383h.js} +5 -5
  611. package/dist/index-5zwac8ft.js +221 -0
  612. package/dist/{index-v62cpkx3.js → index-6g85s734.js} +1 -1
  613. package/dist/{index-sqc6ezrb.js → index-6kec3b14.js} +17 -4
  614. package/dist/{index-kqnd6a85.js → index-7416mhyh.js} +1 -1
  615. package/dist/{index-m0wsfmrc.js → index-7csn6pva.js} +37 -24
  616. package/dist/{index-dqpesdck.js → index-7grgs8cx.js} +25 -5
  617. package/dist/{index-gdqawggb.js → index-7kfcb576.js} +143 -39
  618. package/dist/{index-cvjddnvd.js → index-7xp05h20.js} +19 -10
  619. package/dist/{index-fgzbc06j.js → index-83n766x4.js} +91 -50
  620. package/dist/{index-ss67fxhj.js → index-877e9y8r.js} +7 -7
  621. package/dist/{index-aw6kx2e6.js → index-8gmmdz7k.js} +1 -1
  622. package/dist/{index-wt6rw7rf.js → index-8xr2eq99.js} +29 -21
  623. package/dist/{index-rz3z13e9.js → index-97q9kykw.js} +1 -1
  624. package/dist/index-97rp94ff.js +8 -0
  625. package/dist/{index-0w0hxp7n.js → index-9pv126eh.js} +3 -9
  626. package/dist/{index-x2rvpbtj.js → index-9wh98cpa.js} +110 -16
  627. package/dist/{index-egg0yp2j.js → index-9xr44d2g.js} +86 -210
  628. package/dist/{index-b2sey031.js → index-9y0afd5f.js} +24 -23
  629. package/dist/index-a725ayvz.js +405 -0
  630. package/dist/{index-nmaqxdx7.js → index-ac5rj3d4.js} +203 -90
  631. package/dist/{index-wqzw3qg9.js → index-agy5fqgf.js} +32 -13
  632. package/dist/index-ajmtxsky.js +193 -0
  633. package/dist/{index-ndjzbt2v.js → index-akf0xkrm.js} +4 -3
  634. package/dist/index-akfgymyr.js +8 -0
  635. package/dist/index-apv5xfef.js +13 -0
  636. package/dist/index-ax3wns1a.js +93 -0
  637. package/dist/{index-0sg3wnzr.js → index-bbzvrq66.js} +1670 -340
  638. package/dist/index-bh4pmtr9.js +317 -0
  639. package/dist/{index-fa53vygr.js → index-bmaz3jzy.js} +3 -3
  640. package/dist/{index-8kzct1d6.js → index-bn2baakz.js} +143 -143
  641. package/dist/{index-m8ddk770.js → index-brhhaygm.js} +1 -1
  642. package/dist/index-caywx1c0.js +199 -0
  643. package/dist/index-cbhxhma2.js +90 -0
  644. package/dist/index-cfnmvcq8.js +11 -0
  645. package/dist/index-cv9b7fz2.js +42 -0
  646. package/dist/index-d4svrknj.js +156 -0
  647. package/dist/{index-a3z56mtn.js → index-d96c1n1q.js} +5 -3
  648. package/dist/{index-3ymcmpa9.js → index-dvd1qdwa.js} +33 -163
  649. package/dist/{index-v7rbjatr.js → index-dwa6pskj.js} +1837 -1151
  650. package/dist/{index-ne4j9998.js → index-e06z0tkb.js} +123 -94
  651. package/dist/{index-99nnsz39.js → index-en8e5zsj.js} +15 -135
  652. package/dist/index-fcw255hd.js +929 -0
  653. package/dist/{index-20hn8pbh.js → index-fmzg39a8.js} +1 -1
  654. package/dist/{index-fvd6pvw3.js → index-g1q7fwn9.js} +2 -2
  655. package/dist/index-g56ht6qf.js +98 -0
  656. package/dist/{index-f56ct5gb.js → index-gj1rjf78.js} +4 -3
  657. package/dist/{index-g6a3na27.js → index-gnjgkecx.js} +7 -3
  658. package/dist/index-hy4653g4.js +345 -0
  659. package/dist/index-j13gzgdv.js +403 -0
  660. package/dist/{index-r8swbw1x.js → index-j516jaaz.js} +37 -11
  661. package/dist/{index-t8jz0e20.js → index-j903yhp4.js} +30 -38
  662. package/dist/{index-9ypczvpj.js → index-jb4m241t.js} +2 -0
  663. package/dist/index-jrka9029.js +177 -0
  664. package/dist/{index-cjzaj7ev.js → index-jxtg307y.js} +23 -21
  665. package/dist/index-kmbpej2y.js +1152 -0
  666. package/dist/{index-bz9cmnqq.js → index-kt6dh1n6.js} +4 -4
  667. package/dist/index-ky3ardqn.js +80 -0
  668. package/dist/index-kyejf658.js +14 -0
  669. package/dist/{index-zyc64nbh.js → index-kynwa08q.js} +52 -47
  670. package/dist/index-kzavdze2.js +15 -0
  671. package/dist/{index-pq7rkwkk.js → index-mbd92r1w.js} +67 -12
  672. package/dist/index-mxt0wfjy.js +58 -0
  673. package/dist/{index-9cxxfkhb.js → index-n20tybgk.js} +14 -9
  674. package/dist/index-nbv44x0x.js +250 -0
  675. package/dist/index-ngwf1s3c.js +51 -0
  676. package/dist/{index-zfncctjp.js → index-nk0cy9g1.js} +5 -4
  677. package/dist/index-p1m9djt6.js +108 -0
  678. package/dist/{index-hs76yzt7.js → index-paff5y0r.js} +17 -11
  679. package/dist/{index-qaet40b2.js → index-prf6ayhf.js} +5 -7
  680. package/dist/{index-hkxgennw.js → index-ps3djm8d.js} +7 -1
  681. package/dist/{index-1v3k5zgx.js → index-qnzhmk2s.js} +528 -1129
  682. package/dist/{index-3bzk2645.js → index-r9kq5ark.js} +1 -1
  683. package/dist/{index-hkw233vx.js → index-rbd2rq3z.js} +2 -2
  684. package/dist/{index-r0xr7y4m.js → index-rhb33thr.js} +138 -33
  685. package/dist/{index-kffm4r8w.js → index-rj32hkkp.js} +2 -2
  686. package/dist/index-rptj3qnc.js +96 -0
  687. package/dist/{index-hqsbtvta.js → index-rpyn7geq.js} +11 -3
  688. package/dist/{index-m9hb9wnk.js → index-sfzfd2m2.js} +2 -2
  689. package/dist/{index-sqkttz7z.js → index-sv5svtq7.js} +1 -1
  690. package/dist/{index-srs8hj9c.js → index-sx3g49y2.js} +5 -1
  691. package/dist/{index-9mjrnqxs.js → index-t1a2jrg7.js} +21 -91
  692. package/dist/{index-568w258r.js → index-tazm4dxf.js} +1 -1
  693. package/dist/{index-b51tzcgh.js → index-tf70nm22.js} +2 -2
  694. package/dist/index-ttexdtjj.js +28 -0
  695. package/dist/{index-gbj964dt.js → index-v37b2cd6.js} +1970 -3142
  696. package/dist/{index-0ndz5r8z.js → index-v59pxmf1.js} +17 -9
  697. package/dist/{index-rfkh44ss.js → index-vgytj9wp.js} +1 -1
  698. package/dist/{index-tnnmekgb.js → index-wa6h4tz6.js} +3 -3
  699. package/dist/{index-8wzhmgpa.js → index-wavv538x.js} +211 -196
  700. package/dist/{index-1szhrfsf.js → index-wbnpa8z6.js} +7 -5
  701. package/dist/index-werjqesf.js +43 -0
  702. package/dist/{index-7qyv50r4.js → index-wv8dqy7q.js} +2 -2
  703. package/dist/index-wz392jyz.js +10 -0
  704. package/dist/{index-1d7s7da0.js → index-x6sp5vpa.js} +36 -5
  705. package/dist/{index-bqzgaj57.js → index-x90w78yz.js} +183 -61
  706. package/dist/index-xgae0bn7.js +37 -0
  707. package/dist/index-xmr47znh.js +160 -0
  708. package/dist/{index-ftk3838x.js → index-xq4s9mka.js} +7 -2
  709. package/dist/{index-ww3gss55.js → index-xrgn784x.js} +1 -1
  710. package/dist/{index-fpwbskp2.js → index-xtby8rj3.js} +1 -1
  711. package/dist/index-xtkw9866.js +107 -0
  712. package/dist/{index-btjwc7xr.js → index-xypxnzhp.js} +15 -14
  713. package/dist/{index-yex7eg1v.js → index-y7sy1xdp.js} +6 -2
  714. package/dist/index-z4k0hqp9.js +476 -0
  715. package/dist/{index-a7ebd769.js → index-zwgwyvdt.js} +3 -3
  716. package/dist/internal/abort-error.d.ts +9 -0
  717. package/dist/internal/abort-error.d.ts.map +1 -0
  718. package/dist/internal/abort-race.d.ts +47 -4
  719. package/dist/internal/abort-race.d.ts.map +1 -1
  720. package/dist/internal/atomic-file.d.ts +19 -0
  721. package/dist/internal/atomic-file.d.ts.map +1 -1
  722. package/dist/internal/backoff.d.ts.map +1 -1
  723. package/dist/internal/bounded-body.d.ts +37 -1
  724. package/dist/internal/bounded-body.d.ts.map +1 -1
  725. package/dist/internal/bounded-file-read.d.ts +31 -15
  726. package/dist/internal/bounded-file-read.d.ts.map +1 -1
  727. package/dist/internal/bun-command.d.ts +11 -0
  728. package/dist/internal/bun-command.d.ts.map +1 -1
  729. package/dist/internal/channel.d.ts.map +1 -1
  730. package/dist/internal/coalesced-task.d.ts +14 -2
  731. package/dist/internal/coalesced-task.d.ts.map +1 -1
  732. package/dist/internal/darwin-binding-error.d.ts.map +1 -1
  733. package/dist/internal/darwin-binding.d.ts +10 -0
  734. package/dist/internal/darwin-binding.d.ts.map +1 -1
  735. package/dist/internal/deadline.d.ts +22 -2
  736. package/dist/internal/deadline.d.ts.map +1 -1
  737. package/dist/internal/exclusive-lock-owner.d.ts +20 -1
  738. package/dist/internal/exclusive-lock-owner.d.ts.map +1 -1
  739. package/dist/internal/exclusive-lock-read.d.ts +2 -0
  740. package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
  741. package/dist/internal/exclusive-lock.d.ts +26 -0
  742. package/dist/internal/exclusive-lock.d.ts.map +1 -1
  743. package/dist/internal/file-observation.d.ts +49 -0
  744. package/dist/internal/file-observation.d.ts.map +1 -1
  745. package/dist/internal/json-response.d.ts +10 -0
  746. package/dist/internal/json-response.d.ts.map +1 -0
  747. package/dist/internal/open-descriptors.d.ts +5 -0
  748. package/dist/internal/open-descriptors.d.ts.map +1 -1
  749. package/dist/internal/optional-peer.d.ts.map +1 -1
  750. package/dist/internal/pinned-http.d.ts.map +1 -1
  751. package/dist/internal/positive-integer.d.ts +14 -6
  752. package/dist/internal/positive-integer.d.ts.map +1 -1
  753. package/dist/internal/postgres-query.d.ts +16 -0
  754. package/dist/internal/postgres-query.d.ts.map +1 -0
  755. package/dist/internal/process-identity.d.ts +21 -1
  756. package/dist/internal/process-identity.d.ts.map +1 -1
  757. package/dist/internal/process-instance.d.ts +6 -0
  758. package/dist/internal/process-instance.d.ts.map +1 -1
  759. package/dist/internal/request.d.ts +4 -0
  760. package/dist/internal/request.d.ts.map +1 -1
  761. package/dist/internal/secret-equal.d.ts +11 -0
  762. package/dist/internal/secret-equal.d.ts.map +1 -0
  763. package/dist/internal/secure-fetch.d.ts.map +1 -1
  764. package/dist/internal/sqlite.d.ts +8 -0
  765. package/dist/internal/sqlite.d.ts.map +1 -1
  766. package/dist/internal/timers.d.ts +20 -0
  767. package/dist/internal/timers.d.ts.map +1 -1
  768. package/dist/internal/typed.d.ts +11 -0
  769. package/dist/internal/typed.d.ts.map +1 -1
  770. package/dist/internal/unix-client-error.d.ts +21 -0
  771. package/dist/internal/unix-client-error.d.ts.map +1 -0
  772. package/dist/internal/unix-socket-lock.d.ts +23 -0
  773. package/dist/internal/unix-socket-lock.d.ts.map +1 -0
  774. package/dist/internal/unix-socket.d.ts +60 -0
  775. package/dist/internal/unix-socket.d.ts.map +1 -1
  776. package/dist/internal/upgrade-affects.d.ts +3 -3
  777. package/dist/internal/upgrade-affects.d.ts.map +1 -1
  778. package/dist/internal/upgrade-plan.d.ts.map +1 -1
  779. package/dist/json-schema/dialect.d.ts +0 -6
  780. package/dist/json-schema/dialect.d.ts.map +1 -1
  781. package/dist/json-schema/keywords.d.ts +116 -0
  782. package/dist/json-schema/keywords.d.ts.map +1 -0
  783. package/dist/json-schema/string-format.d.ts.map +1 -1
  784. package/dist/live/events.d.ts.map +1 -1
  785. package/dist/live/watch-client.d.ts.map +1 -1
  786. package/dist/observability/bounded-logger.d.ts +3 -0
  787. package/dist/observability/bounded-logger.d.ts.map +1 -1
  788. package/dist/observability/bounded-sink.d.ts.map +1 -1
  789. package/dist/observability/context.d.ts +12 -2
  790. package/dist/observability/context.d.ts.map +1 -1
  791. package/dist/observability/event-loop-delay.d.ts +62 -0
  792. package/dist/observability/event-loop-delay.d.ts.map +1 -0
  793. package/dist/observability/json-logger.d.ts.map +1 -1
  794. package/dist/observability/log-repeat.d.ts +44 -0
  795. package/dist/observability/log-repeat.d.ts.map +1 -0
  796. package/dist/observability/spool-core.d.ts +95 -0
  797. package/dist/observability/spool-core.d.ts.map +1 -0
  798. package/dist/observability/spool-file.d.ts +46 -0
  799. package/dist/observability/spool-file.d.ts.map +1 -0
  800. package/dist/observability/spool.d.ts +14 -8
  801. package/dist/observability/spool.d.ts.map +1 -1
  802. package/dist/observability/trace.d.ts.map +1 -1
  803. package/dist/observability/work.d.ts.map +1 -1
  804. package/dist/primitives/index.d.ts +1 -0
  805. package/dist/primitives/index.d.ts.map +1 -1
  806. package/dist/primitives/order-key.d.ts +37 -0
  807. package/dist/primitives/order-key.d.ts.map +1 -0
  808. package/dist/process/bun-child.d.ts.map +1 -1
  809. package/dist/process/command-owner.d.ts.map +1 -1
  810. package/dist/process/contract.d.ts +4 -3
  811. package/dist/process/contract.d.ts.map +1 -1
  812. package/dist/process/group-presence.d.ts.map +1 -1
  813. package/dist/process/group-settlement.d.ts +2 -0
  814. package/dist/process/group-settlement.d.ts.map +1 -1
  815. package/dist/process/group.d.ts +5 -1
  816. package/dist/process/group.d.ts.map +1 -1
  817. package/dist/process/launch.d.ts +5 -3
  818. package/dist/process/launch.d.ts.map +1 -1
  819. package/dist/process/owner-loss-guard.d.ts.map +1 -1
  820. package/dist/react/cache-bridge.d.ts.map +1 -1
  821. package/dist/release/watcher.d.ts.map +1 -1
  822. package/dist/server/bridge-host.d.ts +51 -0
  823. package/dist/server/bridge-host.d.ts.map +1 -0
  824. package/dist/server/bun.d.ts +4 -4
  825. package/dist/server/bun.d.ts.map +1 -1
  826. package/dist/server/context-contribution.d.ts.map +1 -1
  827. package/dist/server/context.d.ts +2 -2
  828. package/dist/server/context.d.ts.map +1 -1
  829. package/dist/server/contract-method.d.ts.map +1 -1
  830. package/dist/server/create.d.ts +1 -0
  831. package/dist/server/create.d.ts.map +1 -1
  832. package/dist/server/endpoint-dispatch.d.ts.map +1 -1
  833. package/dist/server/endpoint-response.d.ts.map +1 -1
  834. package/dist/server/error-dispatch.d.ts +4 -0
  835. package/dist/server/error-dispatch.d.ts.map +1 -1
  836. package/dist/server/error-hook.d.ts +2 -0
  837. package/dist/server/error-hook.d.ts.map +1 -1
  838. package/dist/server/handler-state.d.ts +16 -2
  839. package/dist/server/handler-state.d.ts.map +1 -1
  840. package/dist/server/implement.d.ts +1 -0
  841. package/dist/server/implement.d.ts.map +1 -1
  842. package/dist/server/local-host.d.ts +47 -0
  843. package/dist/server/local-host.d.ts.map +1 -0
  844. package/dist/server/logger.d.ts +20 -3
  845. package/dist/server/logger.d.ts.map +1 -1
  846. package/dist/server/logging.d.ts +2 -1
  847. package/dist/server/logging.d.ts.map +1 -1
  848. package/dist/server/middleware/cors.d.ts +49 -3
  849. package/dist/server/middleware/cors.d.ts.map +1 -1
  850. package/dist/server/middleware/signed-link.d.ts +42 -0
  851. package/dist/server/middleware/signed-link.d.ts.map +1 -0
  852. package/dist/server/multipart-reader.d.ts +3 -1
  853. package/dist/server/multipart-reader.d.ts.map +1 -1
  854. package/dist/server/multipart.d.ts.map +1 -1
  855. package/dist/server/oauth/cimd.d.ts.map +1 -1
  856. package/dist/server/oauth/endpoints.d.ts.map +1 -1
  857. package/dist/server/openapi.d.ts.map +1 -1
  858. package/dist/server/protocol-outcome.d.ts +17 -0
  859. package/dist/server/protocol-outcome.d.ts.map +1 -0
  860. package/dist/server/raw.d.ts.map +1 -1
  861. package/dist/server/request-completion.d.ts +3 -1
  862. package/dist/server/request-completion.d.ts.map +1 -1
  863. package/dist/server/shutdown.d.ts.map +1 -1
  864. package/dist/server/socket-io-config.d.ts +1 -1
  865. package/dist/server/socket-io-config.d.ts.map +1 -1
  866. package/dist/server/streaming-route.d.ts.map +1 -1
  867. package/dist/server/types.d.ts +20 -11
  868. package/dist/server/types.d.ts.map +1 -1
  869. package/dist/server/unix-client-body.d.ts +4 -1
  870. package/dist/server/unix-client-body.d.ts.map +1 -1
  871. package/dist/server/unix-client-bun.d.ts.map +1 -1
  872. package/dist/server/unix-client.d.ts +1 -1
  873. package/dist/server/unix-client.d.ts.map +1 -1
  874. package/dist/service-host/artifact-activation.d.ts +58 -0
  875. package/dist/service-host/artifact-activation.d.ts.map +1 -0
  876. package/dist/service-host/artifact-manifest.d.ts +68 -0
  877. package/dist/service-host/artifact-manifest.d.ts.map +1 -0
  878. package/dist/service-host/artifact.d.ts +43 -0
  879. package/dist/service-host/artifact.d.ts.map +1 -0
  880. package/dist/service-host/config-reloader-contract.d.ts +66 -0
  881. package/dist/service-host/config-reloader-contract.d.ts.map +1 -0
  882. package/dist/service-host/config-reloader-helpers.d.ts +32 -0
  883. package/dist/service-host/config-reloader-helpers.d.ts.map +1 -0
  884. package/dist/service-host/config-reloader-source.d.ts +47 -0
  885. package/dist/service-host/config-reloader-source.d.ts.map +1 -0
  886. package/dist/service-host/config-reloader.d.ts +6 -0
  887. package/dist/service-host/config-reloader.d.ts.map +1 -0
  888. package/dist/service-host/host-adapter.d.ts +72 -0
  889. package/dist/service-host/host-adapter.d.ts.map +1 -0
  890. package/dist/service-host/identity-unix-socket.d.ts +101 -0
  891. package/dist/service-host/identity-unix-socket.d.ts.map +1 -0
  892. package/dist/service-host/identity.d.ts +117 -0
  893. package/dist/service-host/identity.d.ts.map +1 -0
  894. package/dist/service-host/launchd-plist.d.ts +77 -0
  895. package/dist/service-host/launchd-plist.d.ts.map +1 -0
  896. package/dist/service-host/launchd-render.d.ts +91 -0
  897. package/dist/service-host/launchd-render.d.ts.map +1 -0
  898. package/dist/service-host/launchd.d.ts +82 -0
  899. package/dist/service-host/launchd.d.ts.map +1 -0
  900. package/dist/service-host/macos/bundle-plist.d.ts +50 -0
  901. package/dist/service-host/macos/bundle-plist.d.ts.map +1 -0
  902. package/dist/service-host/macos/bundle.d.ts +66 -0
  903. package/dist/service-host/macos/bundle.d.ts.map +1 -0
  904. package/dist/service-host/macos/codesign.d.ts +95 -0
  905. package/dist/service-host/macos/codesign.d.ts.map +1 -0
  906. package/dist/service-host/macos/icon.d.ts +93 -0
  907. package/dist/service-host/macos/icon.d.ts.map +1 -0
  908. package/dist/service-host/macos/launch-services.d.ts +88 -0
  909. package/dist/service-host/macos/launch-services.d.ts.map +1 -0
  910. package/dist/service-host/macos/launcher.d.ts +59 -0
  911. package/dist/service-host/macos/launcher.d.ts.map +1 -0
  912. package/dist/service-host/macos/responsibility.d.ts +90 -0
  913. package/dist/service-host/macos/responsibility.d.ts.map +1 -0
  914. package/dist/service-host/macos/runner.d.ts +69 -0
  915. package/dist/service-host/macos/runner.d.ts.map +1 -0
  916. package/dist/service-host/plist-xml.d.ts +48 -0
  917. package/dist/service-host/plist-xml.d.ts.map +1 -0
  918. package/dist/service-host/process-evidence.d.ts +17 -0
  919. package/dist/service-host/process-evidence.d.ts.map +1 -0
  920. package/dist/service-host/systemd-inspect.d.ts +126 -0
  921. package/dist/service-host/systemd-inspect.d.ts.map +1 -0
  922. package/dist/service-host/systemd-links.d.ts +23 -0
  923. package/dist/service-host/systemd-links.d.ts.map +1 -0
  924. package/dist/service-host/systemd-render.d.ts +93 -0
  925. package/dist/service-host/systemd-render.d.ts.map +1 -0
  926. package/dist/service-host/systemd.d.ts +50 -0
  927. package/dist/service-host/systemd.d.ts.map +1 -0
  928. package/dist/spend/attribution.d.ts +17 -0
  929. package/dist/spend/attribution.d.ts.map +1 -0
  930. package/dist/spend/coverage-guard.d.ts +60 -0
  931. package/dist/spend/coverage-guard.d.ts.map +1 -0
  932. package/dist/spend/coverage-lexer.d.ts +20 -0
  933. package/dist/spend/coverage-lexer.d.ts.map +1 -0
  934. package/dist/spend/facts.d.ts +23 -0
  935. package/dist/spend/facts.d.ts.map +1 -0
  936. package/dist/spend/gateway-stream.d.ts +25 -0
  937. package/dist/spend/gateway-stream.d.ts.map +1 -0
  938. package/dist/spend/gateway.d.ts +64 -0
  939. package/dist/spend/gateway.d.ts.map +1 -0
  940. package/dist/spend/receipt-merge.d.ts +13 -0
  941. package/dist/spend/receipt-merge.d.ts.map +1 -0
  942. package/dist/spend/receipt-spool.d.ts +35 -0
  943. package/dist/spend/receipt-spool.d.ts.map +1 -0
  944. package/dist/spend/reconcile.d.ts +45 -0
  945. package/dist/spend/reconcile.d.ts.map +1 -0
  946. package/dist/spend/schemas.d.ts +249 -0
  947. package/dist/spend/schemas.d.ts.map +1 -0
  948. package/dist/sync/outbox.d.ts +131 -0
  949. package/dist/sync/outbox.d.ts.map +1 -0
  950. package/dist/sync/overlay.d.ts +59 -0
  951. package/dist/sync/overlay.d.ts.map +1 -0
  952. package/dist/sync/protocol.d.ts +132 -0
  953. package/dist/sync/protocol.d.ts.map +1 -0
  954. package/dist/sync/server-store-check.d.ts +10 -0
  955. package/dist/sync/server-store-check.d.ts.map +1 -0
  956. package/dist/sync/server-store-memory.d.ts +14 -0
  957. package/dist/sync/server-store-memory.d.ts.map +1 -0
  958. package/dist/sync/server-store-postgres.d.ts +25 -0
  959. package/dist/sync/server-store-postgres.d.ts.map +1 -0
  960. package/dist/sync/server-store.d.ts +139 -0
  961. package/dist/sync/server-store.d.ts.map +1 -0
  962. package/dist/sync/session-machine.d.ts +79 -0
  963. package/dist/sync/session-machine.d.ts.map +1 -0
  964. package/dist/sync/session-snapshot.d.ts +19 -0
  965. package/dist/sync/session-snapshot.d.ts.map +1 -0
  966. package/dist/sync/session-steps.d.ts +15 -0
  967. package/dist/sync/session-steps.d.ts.map +1 -0
  968. package/dist/sync/session.d.ts +142 -0
  969. package/dist/sync/session.d.ts.map +1 -0
  970. package/dist/sync/tombstones.d.ts +53 -0
  971. package/dist/sync/tombstones.d.ts.map +1 -0
  972. package/dist/telegram/bot-api.d.ts.map +1 -1
  973. package/dist/telegram/broadcast-failure.d.ts.map +1 -1
  974. package/dist/telegram/budget-transformer.d.ts.map +1 -1
  975. package/dist/telegram/crypto.d.ts +2 -10
  976. package/dist/telegram/crypto.d.ts.map +1 -1
  977. package/dist/telegram/html/markdown-inline.d.ts +19 -0
  978. package/dist/telegram/html/markdown-inline.d.ts.map +1 -0
  979. package/dist/telegram/html/markdown-lines.d.ts +51 -0
  980. package/dist/telegram/html/markdown-lines.d.ts.map +1 -0
  981. package/dist/telegram/html/markdown-split.d.ts +49 -0
  982. package/dist/telegram/html/markdown-split.d.ts.map +1 -0
  983. package/dist/telegram/html/markdown.d.ts +14 -0
  984. package/dist/telegram/html/markdown.d.ts.map +1 -0
  985. package/dist/telegram/html/nodes.d.ts +26 -4
  986. package/dist/telegram/html/nodes.d.ts.map +1 -1
  987. package/dist/telegram/html/parse.d.ts.map +1 -1
  988. package/dist/telegram/html/render.d.ts.map +1 -1
  989. package/dist/telegram/init-data.d.ts.map +1 -1
  990. package/dist/telegram/local-files.d.ts.map +1 -1
  991. package/dist/telegram/operator-channel.d.ts +15 -2
  992. package/dist/telegram/operator-channel.d.ts.map +1 -1
  993. package/dist/telegram/outbound-budget.d.ts.map +1 -1
  994. package/dist/telegram/outbound-cost.d.ts +9 -1
  995. package/dist/telegram/outbound-cost.d.ts.map +1 -1
  996. package/dist/telegram/outbound-queue.d.ts +2 -1
  997. package/dist/telegram/outbound-queue.d.ts.map +1 -1
  998. package/dist/telegram/screens/outcome.d.ts.map +1 -1
  999. package/dist/telegram/send-failure.d.ts.map +1 -1
  1000. package/dist/telegram/transport-connect.d.ts.map +1 -1
  1001. package/dist/telegram/transport.d.ts.map +1 -1
  1002. package/dist/telegram/update-intake.d.ts.map +1 -1
  1003. package/dist/telegram/update-store-postgres.d.ts +2 -2
  1004. package/dist/telegram/update-store-postgres.d.ts.map +1 -1
  1005. package/dist/telegram/webhook.d.ts.map +1 -1
  1006. package/dist/testing/managed-resource-conformance.d.ts.map +1 -1
  1007. package/dist/testing/surface-conformance.d.ts.map +1 -1
  1008. package/dist/testing/surface-manifest.d.ts +2 -0
  1009. package/dist/testing/surface-manifest.d.ts.map +1 -1
  1010. package/dist/tools/access.d.ts +34 -0
  1011. package/dist/tools/access.d.ts.map +1 -0
  1012. package/dist/tools/agent.d.ts +14 -6
  1013. package/dist/tools/agent.d.ts.map +1 -1
  1014. package/dist/tools/cli/args-classify.d.ts +154 -0
  1015. package/dist/tools/cli/args-classify.d.ts.map +1 -0
  1016. package/dist/tools/cli/args-fields.d.ts +14 -7
  1017. package/dist/tools/cli/args-fields.d.ts.map +1 -1
  1018. package/dist/tools/cli/args-json.d.ts +1 -1
  1019. package/dist/tools/cli/args-json.d.ts.map +1 -1
  1020. package/dist/tools/cli/args-route.d.ts +4 -48
  1021. package/dist/tools/cli/args-route.d.ts.map +1 -1
  1022. package/dist/tools/cli/args-scan.d.ts +70 -0
  1023. package/dist/tools/cli/args-scan.d.ts.map +1 -0
  1024. package/dist/tools/cli/args-tokens.d.ts +2 -1
  1025. package/dist/tools/cli/args-tokens.d.ts.map +1 -1
  1026. package/dist/tools/cli/args.d.ts +31 -19
  1027. package/dist/tools/cli/args.d.ts.map +1 -1
  1028. package/dist/tools/cli/checkpoint.d.ts.map +1 -1
  1029. package/dist/tools/cli/command-shape.d.ts +5 -0
  1030. package/dist/tools/cli/command-shape.d.ts.map +1 -1
  1031. package/dist/tools/cli/command.d.ts +57 -2
  1032. package/dist/tools/cli/command.d.ts.map +1 -1
  1033. package/dist/tools/cli/config.d.ts +15 -58
  1034. package/dist/tools/cli/config.d.ts.map +1 -1
  1035. package/dist/tools/cli/create-cli.d.ts +7 -3
  1036. package/dist/tools/cli/create-cli.d.ts.map +1 -1
  1037. package/dist/tools/cli/format.d.ts.map +1 -1
  1038. package/dist/tools/cli/help.d.ts.map +1 -1
  1039. package/dist/tools/cli/invoke.d.ts +70 -20
  1040. package/dist/tools/cli/invoke.d.ts.map +1 -1
  1041. package/dist/tools/cli/io.d.ts.map +1 -1
  1042. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  1043. package/dist/tools/cli/notices.d.ts.map +1 -1
  1044. package/dist/tools/cli/policy.d.ts +66 -10
  1045. package/dist/tools/cli/policy.d.ts.map +1 -1
  1046. package/dist/tools/cli/prepare.d.ts +5 -4
  1047. package/dist/tools/cli/prepare.d.ts.map +1 -1
  1048. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  1049. package/dist/tools/cli/run-native.d.ts.map +1 -1
  1050. package/dist/tools/cli/run-stream.d.ts.map +1 -1
  1051. package/dist/tools/cli/runner.d.ts +28 -0
  1052. package/dist/tools/cli/runner.d.ts.map +1 -0
  1053. package/dist/tools/cli/session.d.ts +12 -6
  1054. package/dist/tools/cli/session.d.ts.map +1 -1
  1055. package/dist/tools/cli/stream-surface.d.ts.map +1 -1
  1056. package/dist/tools/cli/stream.d.ts.map +1 -1
  1057. package/dist/tools/cli/unavailable.d.ts +2 -0
  1058. package/dist/tools/cli/unavailable.d.ts.map +1 -1
  1059. package/dist/tools/cli/unix-outcome.d.ts +8 -0
  1060. package/dist/tools/cli/unix-outcome.d.ts.map +1 -0
  1061. package/dist/tools/cli/update.d.ts.map +1 -1
  1062. package/dist/tools/cli/view-columns.d.ts +18 -0
  1063. package/dist/tools/cli/view-columns.d.ts.map +1 -0
  1064. package/dist/tools/cli/view.d.ts.map +1 -1
  1065. package/dist/tools/connections/define.d.ts.map +1 -1
  1066. package/dist/tools/connections/foreign-schema-join.d.ts +28 -0
  1067. package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -0
  1068. package/dist/tools/connections/foreign-schema.d.ts +9 -0
  1069. package/dist/tools/connections/foreign-schema.d.ts.map +1 -0
  1070. package/dist/tools/connections/limits.d.ts +1 -1
  1071. package/dist/tools/connections/limits.d.ts.map +1 -1
  1072. package/dist/tools/connections/mcp-client.d.ts.map +1 -1
  1073. package/dist/tools/connections/mcp.d.ts.map +1 -1
  1074. package/dist/tools/connections/openapi.d.ts.map +1 -1
  1075. package/dist/tools/connections/runtime.d.ts +18 -6
  1076. package/dist/tools/connections/runtime.d.ts.map +1 -1
  1077. package/dist/tools/connections/sse-session.d.ts.map +1 -1
  1078. package/dist/tools/connections/types.d.ts +12 -2
  1079. package/dist/tools/connections/types.d.ts.map +1 -1
  1080. package/dist/tools/execute.d.ts.map +1 -1
  1081. package/dist/tools/internal/expose.d.ts +6 -0
  1082. package/dist/tools/internal/expose.d.ts.map +1 -0
  1083. package/dist/tools/internal/json-projection.d.ts +17 -0
  1084. package/dist/tools/internal/json-projection.d.ts.map +1 -0
  1085. package/dist/tools/internal/surface-projector.d.ts +18 -4
  1086. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  1087. package/dist/tools/invoker.d.ts +9 -2
  1088. package/dist/tools/invoker.d.ts.map +1 -1
  1089. package/dist/tools/lifecycle.d.ts +8 -2
  1090. package/dist/tools/lifecycle.d.ts.map +1 -1
  1091. package/dist/tools/list-names.d.ts +1 -1
  1092. package/dist/tools/list-names.d.ts.map +1 -1
  1093. package/dist/tools/manifest.d.ts +2 -0
  1094. package/dist/tools/manifest.d.ts.map +1 -1
  1095. package/dist/tools/mcp/handler.d.ts.map +1 -1
  1096. package/dist/tools/mcp/mount.d.ts +26 -14
  1097. package/dist/tools/mcp/mount.d.ts.map +1 -1
  1098. package/dist/tools/mcp/prepare.d.ts +2 -0
  1099. package/dist/tools/mcp/prepare.d.ts.map +1 -1
  1100. package/dist/tools/mcp/register.d.ts.map +1 -1
  1101. package/dist/tools/mcp/runtime-tools.d.ts +1 -1
  1102. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  1103. package/dist/tools/mcp/stdio.d.ts.map +1 -1
  1104. package/dist/tools/mount.d.ts +7 -2
  1105. package/dist/tools/mount.d.ts.map +1 -1
  1106. package/dist/tools/native-definition.d.ts +1 -1
  1107. package/dist/tools/native-definition.d.ts.map +1 -1
  1108. package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -2
  1109. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
  1110. package/dist/tools/operations/async-operation-runtime-types.d.ts +1 -1
  1111. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
  1112. package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
  1113. package/dist/tools/operations/mount-wait.d.ts.map +1 -1
  1114. package/dist/tools/operations/wait-core.d.ts.map +1 -1
  1115. package/dist/tools/read-operation.d.ts +6 -4
  1116. package/dist/tools/read-operation.d.ts.map +1 -1
  1117. package/dist/tools/registry.d.ts.map +1 -1
  1118. package/dist/tools/runtime-tool-declaration.d.ts +4 -1
  1119. package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
  1120. package/dist/tools/runtime-tool.d.ts +6 -1
  1121. package/dist/tools/runtime-tool.d.ts.map +1 -1
  1122. package/dist/tools/schema/coerce.d.ts.map +1 -1
  1123. package/dist/tools/schema/inline-references.d.ts +7 -0
  1124. package/dist/tools/schema/inline-references.d.ts.map +1 -0
  1125. package/dist/tools/schema/json-schema-origin.d.ts +1 -1
  1126. package/dist/tools/schema/json-schema-origin.d.ts.map +1 -1
  1127. package/dist/tools/schema/presentation.d.ts +6 -0
  1128. package/dist/tools/schema/presentation.d.ts.map +1 -1
  1129. package/dist/tools/schema/schema.d.ts +2 -0
  1130. package/dist/tools/schema/schema.d.ts.map +1 -1
  1131. package/dist/tools/schema/untyped-properties.d.ts.map +1 -1
  1132. package/dist/tools/surface.d.ts.map +1 -1
  1133. package/dist/tools/toolkit.d.ts +6 -3
  1134. package/dist/tools/toolkit.d.ts.map +1 -1
  1135. package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
  1136. package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
  1137. package/dist/tools/transfer/define-view-file-tool.d.ts +2 -1
  1138. package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
  1139. package/dist/tools/transfer/mount-download.d.ts.map +1 -1
  1140. package/dist/tools/transfer/view-file-contract.d.ts +2 -2
  1141. package/dist/tools/transfer/view-file.d.ts +1 -2
  1142. package/dist/tools/transfer/view-file.d.ts.map +1 -1
  1143. package/dist/tracking/client.d.ts +0 -13
  1144. package/dist/tracking/client.d.ts.map +1 -1
  1145. package/dist/tracking/delivery.d.ts.map +1 -1
  1146. package/dist/tracking/performance/collector.d.ts.map +1 -1
  1147. package/llms/agent-executor-acp.txt +51 -0
  1148. package/llms/agent-executor-claude-sdk.txt +31 -0
  1149. package/llms/agent-executor-claude.txt +29 -0
  1150. package/llms/agent-executor-codex.txt +25 -0
  1151. package/llms/agent-executor-testing.txt +26 -0
  1152. package/llms/agent-executor.txt +40 -0
  1153. package/llms/agent-runtime-harness.txt +68 -5
  1154. package/llms/agent-runtime-openrouter.txt +8 -2
  1155. package/llms/agent-runtime-postgres.txt +30 -0
  1156. package/llms/agent-runtime-react.txt +1 -1
  1157. package/llms/agent-runtime-realtime.txt +1 -1
  1158. package/llms/agent-runtime-sandbox.txt +5 -2
  1159. package/llms/agent-runtime-sqlite-bun.txt +2 -2
  1160. package/llms/agent-runtime-sqlite-node.txt +2 -2
  1161. package/llms/agent-runtime-testing.txt +2 -1
  1162. package/llms/agent-runtime.2.txt +475 -496
  1163. package/llms/agent-runtime.3.txt +229 -267
  1164. package/llms/agent-runtime.4.txt +23 -242
  1165. package/llms/agent-runtime.5.txt +1 -1
  1166. package/llms/agent-runtime.txt +551 -2
  1167. package/llms/application-diagnostic-journal.txt +2 -0
  1168. package/llms/application.2.txt +3 -0
  1169. package/llms/application.3.txt +30 -7
  1170. package/llms/application.txt +4 -1
  1171. package/llms/cli.2.txt +259 -99
  1172. package/llms/cli.3.txt +90 -0
  1173. package/llms/cli.txt +95 -184
  1174. package/llms/contract.txt +7 -6
  1175. package/llms/declaration.txt +1 -1
  1176. package/llms/files.txt +11 -0
  1177. package/llms/handler.txt +25 -0
  1178. package/llms/http.txt +18 -1
  1179. package/llms/live.txt +28 -1
  1180. package/llms/node.txt +3 -2
  1181. package/llms/observability.2.txt +105 -0
  1182. package/llms/observability.txt +14 -90
  1183. package/llms/primitives.txt +27 -0
  1184. package/llms/process.2.txt +2 -2
  1185. package/llms/process.txt +10 -9
  1186. package/llms/realtime.txt +11 -0
  1187. package/llms/server.2.txt +355 -0
  1188. package/llms/server.3.txt +2 -1
  1189. package/llms/server.4.txt +45 -6
  1190. package/llms/server.5.txt +9 -2
  1191. package/llms/server.txt +185 -255
  1192. package/llms/service-host-macos.txt +53 -0
  1193. package/llms/service-host.txt +69 -0
  1194. package/llms/spend-testing.txt +21 -0
  1195. package/llms/spend.txt +173 -0
  1196. package/llms/stitchkit.2.txt +368 -42
  1197. package/llms/stitchkit.3.txt +164 -13
  1198. package/llms/stitchkit.txt +95 -417
  1199. package/llms/sync-postgres.txt +31 -0
  1200. package/llms/sync.txt +396 -0
  1201. package/llms/telegram-html.txt +4 -1
  1202. package/llms/telegram.2.txt +4 -4
  1203. package/llms/telegram.txt +105 -14
  1204. package/llms/testing.txt +4 -3
  1205. package/llms/tools-connections.txt +4 -4
  1206. package/llms/tools.2.txt +78 -17
  1207. package/llms/tools.3.txt +12 -8
  1208. package/llms/tools.txt +85 -78
  1209. package/llms/{upgrading-0.106.0-0.125.0.txt → upgrading-0.106.0-0.126.0.txt} +42 -3
  1210. package/llms/upgrading-0.127.0.txt +1059 -0
  1211. package/llms/upgrading.txt +2 -1
  1212. package/llms-full.txt +3692 -518
  1213. package/llms.txt +45 -29
  1214. package/native/darwin-arm64.node +0 -0
  1215. package/native/darwin-x64.node +0 -0
  1216. package/native-assets.json +4 -4
  1217. package/package.json +69 -11
  1218. package/dist/agent-runtime/sandbox-coding.d.ts.map +0 -1
  1219. package/dist/agent-runtime/sqlite-events.d.ts +0 -5
  1220. package/dist/agent-runtime/sqlite-events.d.ts.map +0 -1
  1221. package/dist/agent-runtime/sqlite-history.d.ts +0 -7
  1222. package/dist/agent-runtime/sqlite-history.d.ts.map +0 -1
  1223. package/dist/agent-runtime/sqlite-ledger.d.ts +0 -7
  1224. package/dist/agent-runtime/sqlite-ledger.d.ts.map +0 -1
  1225. package/dist/agent-runtime/sqlite-reads.d.ts +0 -14
  1226. package/dist/agent-runtime/sqlite-reads.d.ts.map +0 -1
  1227. package/dist/agent-runtime/sqlite-rows.d.ts.map +0 -1
  1228. package/dist/agent-runtime/tool-progress.d.ts.map +0 -1
  1229. package/dist/entrypoints/application/schemas.d.ts +0 -15
  1230. package/dist/entrypoints/application/schemas.d.ts.map +0 -1
  1231. package/dist/entrypoints/application/schemas.js +0 -27
  1232. package/dist/index-0s4xebbg.js +0 -8
  1233. package/dist/index-5dmk54h9.js +0 -256
  1234. package/dist/index-7cn66qdk.js +0 -92
  1235. package/dist/index-8x0q6yfb.js +0 -247
  1236. package/dist/index-a5qr2rj6.js +0 -26
  1237. package/dist/index-b0kddvzw.js +0 -35
  1238. package/dist/index-cj5f0x4y.js +0 -1150
  1239. package/dist/index-drcjjhy1.js +0 -40
  1240. package/dist/index-eemvahkc.js +0 -21
  1241. package/dist/index-gfk7nrht.js +0 -0
  1242. package/dist/index-jp2qd9jb.js +0 -108
  1243. package/dist/index-nx6eazt0.js +0 -160
  1244. package/dist/index-wxadzdb7.js +0 -55
  1245. package/dist/internal/until-aborted.d.ts +0 -9
  1246. package/dist/internal/until-aborted.d.ts.map +0 -1
  1247. package/dist/server/unix-client-error.d.ts +0 -9
  1248. package/dist/server/unix-client-error.d.ts.map +0 -1
  1249. package/llms/application-schemas.txt +0 -42
package/llms/cli.3.txt ADDED
@@ -0,0 +1,90 @@
1
+ # stitchkit/cli — stitchkit docs slice, part 3 of 3
2
+
3
+ > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
+ > `llms.txt` in this package.
5
+
6
+ Parts of this slice:
7
+ - `llms/cli.txt`: Guide: CLI (docs/guide/cli.md)
8
+ - `llms/cli.2.txt`: Guide: CLI (docs/guide/cli.md)
9
+ - `llms/cli.3.txt`: API reference: `stitchkit/cli` (docs/api/reference.md)
10
+
11
+ ==============================================================================
12
+ # API reference: `stitchkit/cli` (docs/api/reference.md)
13
+ ==============================================================================
14
+
15
+ ## `stitchkit/cli`
16
+
17
+ Server-only. Composes contract/runtime managed operations and CLI-only native
18
+ commands into one command-line program. Light by design: needs neither the MCP
19
+ SDK nor the `ai` peer.
20
+
21
+ | Export | Kind | Summary |
22
+ |--------|------|---------|
23
+ | `createCli` | function | build and run a CLI from contracts; a runtime catalogue field conflicting with reserved/global argv options disables only that entry, retained in help with its reason; invocation returns `CLI_COMMAND_UNAVAILABLE` before side effects — [guide](../guide/cli.md#when-one-runtime-command-cannot-be-represented-in-argv) |
24
+ | `defineCliCommand` | function | define one Zod-typed CLI-only executable command with optional validated-result presentation/exit policy |
25
+ | `defineCliResult` | function | type a managed command's `present` / `exitCode` policy against its output schema, for `CliConfig.results` — [guide](../guide/cli.md#the-same-policy-for-a-managed-command) |
26
+ | `parseCliArgs` | function | argv → typed tool args against a schema, in the grammar `createCli` reads a command with (`--bool=maybe` on a pure boolean is a `CliArgumentError`; a line asking for help or `--schema` is answered before arguments it cannot read, with empty `toolArgs`); inline `--field:=JSON` assigns a whole JSON value, including null, while ordinary string flags remain lexical; optional `separatedBefore` marks token boundaries left by stripped options so surrounding tokens are never glued; named array options together with bare positionals require an explicit `positionals` policy (advanced) |
27
+ | `scanCliInvocation` | function | single-pass CLI invocation scanner returning framework flags, application globals, selected command, command tokens and top-level help/version state — [guide](../guide/cli.md#global-flags) |
28
+ | `routeCliArgv` | function | select the command using the framework's option grammar before catalogue discovery (thin projection over `scanCliInvocation`); takes `{ defaultCommand?, separatedBefore? }` and carries `separatedBefore` onto `commandArgv`; a line `createCli` refuses before a command runs (`--` before the command, `--json=maybe`, a repeated framework option) comes back with `error` and an empty `commandArgv`, unless help, `--version` or `--schema` answers it — [guide](../guide/cli.md#global-flags) |
29
+ | `extractCliGlobalOptions` | function | lift the application's own global options out of argv before routing (thin projection over `scanCliInvocation`); `globals` is always readable, and reading `argv` throws `CliArgumentError` when a lifted global separated a bare framework boolean from `true` or `false` (non-framework option boundaries return in `separatedBefore`) |
30
+ | `coerceJsonArgs` | function | the second half of `parseCliArgs` — parse array/object values a consumer sends itself, including discovered MCP object guards restored from JSON Schema, without the `stitchkit/tools` barrel |
31
+ | `CliArgumentError` | class | the refusal `parseCliArgs` and the view flags raise; a CLI reports it and exits `2` |
32
+ | `renderCliView` | function | compute an aggregate over a result (`--count-by`, `--sum`, `--top`, `--table`) — [guide](../guide/cli.md#aggregate-views) |
33
+ | `createCliProfileStore` | function | named `0600` credential profiles resolved by name, with the never-substitute rule built in — [guide](../guide/cli.md#named-profiles) |
34
+ | `CliProfileError` | class | an `AppError` refusing a named profile that is missing, unreadable or shared between users |
35
+ | `renderCliInstaller` | function | generate the one-line installer from a build manifest, with the URL and digest substituted — [guide](../guide/cli.md#distribution-and-self-update) |
36
+ | `checkCliUpdate` | function | bounded, interval-limited, never-throwing check for a newer published build |
37
+ | `applyCliUpdate` | function | download, verify the decompressed digest and replace the binary by rename; with `partialPath` an interrupted download continues with `Range`/`If-Range`, and a continued file that fails its checks is downloaded once more from zero |
38
+ | `assertCliPublishable` | function | refuse republishing one version from a different commit — takes one manifest or every manifest already published, because the promise a version makes does not stop at a channel boundary |
39
+ | `rollbackCliUpdate` / `CliRollbackConfig` / `RolledBackCliUpdate` | function / _types_ | put the kept previous build back, digest-checked first and written by the same atomic rename the update uses |
40
+ | `signCliManifest` / `verifyCliManifest` / `cliManifestSigningPayload` | function | Ed25519 over `{name, version, commit, builtAt, assets[]}` — every asset's digest included, so the chain closes on the file that executes |
41
+ | `cliSignatureAccepted` / `CliSignatureVerdict` | function / _type_ | `valid` \| `unenforced` \| `missing` \| `unknown-key` \| `invalid`; `unenforced` keeps an unpinned build updating while making the absence of a check visible |
42
+ | `CliTrustRoot` / `CliSigningKey` / `CliBuildSignature` / `CliBuildSignatureSchema` | _types_ / schema | the keys a build trusts, by id, and the detached signature a manifest carries |
43
+ | `selectCliBuildAsset` | function | the asset for one target, or `undefined` |
44
+ | `currentCliBuildTarget` | function | `{ platform, arch }` of the running process |
45
+ | `formatCliBuildStamp` | function | one line saying what the running build is |
46
+ | `compareCliVersions` | function | compare two versions, or `undefined` when they are not comparable |
47
+ | `CliBuildManifestSchema` / `CliBuildManifest` | schema / _type_ | name, version, commit, build time and assets |
48
+ | `CliBuildAssetSchema` / `CliBuildAsset` | schema / _type_ | one download; `size` and `sha256` describe the **decompressed** bytes |
49
+ | `CliBuildTargetSchema` / `CliBuildTarget` | schema / _type_ | `{ platform, arch }` |
50
+ | `CliBuildStampSchema` / `CliBuildStamp` | schema / _type_ | the version/commit/build time carried inside a binary |
51
+ | `CliInstallerConfig` | _type_ | manifest, binary name, default install directory, and an optional `asset` — omit it for one script that selects the target by `uname` |
52
+ | `CliUpdateCheckConfig` / `CliUpdateCheck` | _type_ | check inputs, and its four answers — `skipped`, `current`, `outdated`, `unknown` |
53
+ | `CliUpdateApplyConfig` / `AppliedCliUpdate` | _type_ | apply inputs — including `verify`, run on an executable candidate beside the target before the backup and the replacement, within `verifyTimeoutMs`; `timeoutMs` (default 30 minutes) and `idleTimeoutMs` (default 30 s of silence when `timeoutMs` is not declared); `partialPath` for a resumable download — and the replaced path, byte count and digest |
54
+ | `CliProfileStore` / `CliProfileStoreConfig` / `ResolvedCliProfile` | _type_ | the profile store, its directory/schema/hint config, and one resolution |
55
+ | `CliResultView` | _type_ | the requested view — `count`, `sum`, or `records` (ordered and/or table-rendered) |
56
+ | `CliViewOutput` | _type_ | a JSON value, or the one human-facing text shape |
57
+ | `CliGlobalOptionsParse` | _type_ | `{ argv, globals, separatedBefore? }` returned by `extractCliGlobalOptions` (`separatedBefore` present when a lifted global separated an option from a value-shaped token; a `--` before the command stays in `argv`) |
58
+ | `CliArgvRoute` | _type_ | `{ command, commandArgv, topLevelHelp, version, error?, separatedBefore? }` returned by `routeCliArgv` (`separatedBefore` indexes `commandArgv`, for `parseCliArgs`) |
59
+ | `CliRouteOptions` | _type_ | `{ defaultCommand?, separatedBefore? }` accepted by `routeCliArgv`; `separatedBefore` is the set `extractCliGlobalOptions` returned |
60
+ | `CliInvocationScanOptions` / `CliInvocationScan` / `CliFrameworkOptions` | _types_ | options (`appGlobals`, `defaultCommand`), full scan output (`framework`, `globals`, `command`, `commandTokens`, `separatedBefore`, `topLevelHelp`, `helpFilter`, `version`), and parsed framework flags returned by `scanCliInvocation` |
61
+ | `pollUntilDone` | function | the generic `--wait` poller (advanced) |
62
+ | `emitResult` | function | write a pretty or compact `ToolResult` record to stdout/stderr + exit code (advanced) |
63
+ | `cliExitCode` | function | the exit code a result earns, from the same table, without writing anything — so an in-process run and the printed path cannot disagree |
64
+ | `createCliInvoker` / `CliInvoker` / `CliInvokerConfig` / `CliInvocationResult` / `CliInvokerCommand` / `cliInvocationResult` | function / _types_ | compile the managed surface once and run parsed calls against it in process — no argv round-trip, no child process, no writing |
65
+ | `defineCliStreamCommand` / `CliStreamCommandConfig` / `CliStreamAnswer` / `CliStreamHooks` / `runCliStream` | function / _types_ | one operation per JSON line of stdin, answered with the same `id`; a bad line answers and the stream continues |
66
+ | `defineCliBatchCommand` / `CliBatchCommandConfig` | function / _type_ | the same loop, resumable: a recorded line replays, a line whose content changed under the same id is refused |
67
+ | `readCliCheckpoint` / `writeCliCheckpoint` / `CliCheckpoint` / `CliCheckpointEntry` | function / _types_ | the batch's record — id plus a digest of the line, written by atomic rename after every line |
68
+ | `DEFAULT_EXIT_CODES` | const | the default `ToolResult.code` → exit-code map |
69
+ | `CliConfig` | _type_ | config for `createCli`; `defaultCommand`, `globalOptions`, and `commandSettings` define the shared command presentation and result policy |
70
+ | `CliCommandName` / `CliCommandSettings` | _types_ | command identifier key and per-command `{ aliases?, positionals?, wait?, result?, passthrough? }` settings map for `CliConfig.commandSettings` |
71
+ | `CliPresentationPolicyConfig` | _type_ | shared command presentation-policy subset of `CliConfig` |
72
+ | `CliSurfaceSource` | _type_ | static service/runtime array or `(auth, globals) => TValue[]` factory receiving parsed auth and application globals |
73
+ | `RuntimeToolDefinition` | _type_ | neutral heterogeneous runtime-tool registration; an inline handler is contextually typed, and handlers execute through the schema-validating managed runner |
74
+ | `RuntimeToolDefinitionWithOutput` | _type_ | strict neutral managed definition with schema-derived handler input/output, the same declaration `stitchkit/tools` constructs with presenters |
75
+ | `RuntimeToolDefinitionWithoutOutput` | _type_ | strict neutral managed void definition without an output contract or transport presenters |
76
+ | `CliCommandDefinition` | _type_ | native command definition union |
77
+ | `CliCommandDefinitionBase` | _type_ | native command name, description and input schema |
78
+ | `CliCommandDefinitionWithOutput` | _type_ | native command with validated declared output and typed optional `present` / successful `exitCode` callbacks |
79
+ | `CliCommandDefinitionWithoutOutput` | _type_ | native void command without an output contract |
80
+ | `CliResultPolicy` | _type_ | `present` / successful `exitCode` callbacks of one command, typed against its validated result; `CliConfig.results` holds one per managed command |
81
+ | `CliCommandContext` | _type_ | parsed input, framework run options, the application's `globals` and stdout/stderr writers |
82
+ | `CliRunOptions` | _type_ | parsed global flags (`--json` compacts success/error records, `--wait`, `--schema`, …) |
83
+ | `ParsedCliArgs` | _type_ | result of `parseCliArgs` |
84
+ | `CliWaitConfig` | _type_ | per-command `--wait` polling config; optional `failed(result)` maps a terminal domain failure to `WAIT_FAILED` and a non-zero exit |
85
+ | `ExitCodeMap` | _type_ | `ToolResult.code` → process exit code |
86
+ | `PollParams` | _type_ | params for `pollUntilDone` |
87
+ | `CliWriters` | _type_ | stdout/stderr sinks for `emitResult` |
88
+ | `EmitOptions` | _type_ | options for `emitResult` |
89
+
90
+ ---
package/llms/cli.txt CHANGED
@@ -1,4 +1,4 @@
1
- # stitchkit/cli — stitchkit docs slice, part 1 of 2
1
+ # stitchkit/cli — stitchkit docs slice, part 1 of 3
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
@@ -6,7 +6,8 @@
6
6
 
7
7
  Parts of this slice:
8
8
  - `llms/cli.txt`: Guide: CLI (docs/guide/cli.md)
9
- - `llms/cli.2.txt`: Guide: CLI (docs/guide/cli.md) · API reference: `stitchkit/cli` (docs/api/reference.md)
9
+ - `llms/cli.2.txt`: Guide: CLI (docs/guide/cli.md)
10
+ - `llms/cli.3.txt`: API reference: `stitchkit/cli` (docs/api/reference.md)
10
11
 
11
12
  ==============================================================================
12
13
  # Guide: CLI (docs/guide/cli.md)
@@ -58,7 +59,7 @@ const output = z.object({ size: z.number() })
58
59
  const measure = {
59
60
  name: 'measure', description: 'Measure text',
60
61
  identity: { serviceName: 'text', action: 'measure', method: 'POST' },
61
- transports: ['CLI'], input, output,
62
+ expose: ['CLI'], input, output,
62
63
  handler: ({ input }) => ({ size: input.text.length }),
63
64
  } satisfies RuntimeToolDefinitionWithOutput<typeof input, typeof output>
64
65
  ```
@@ -85,7 +86,7 @@ the CLI never silently turns your existing API tools into shell commands.
85
86
 
86
87
  A fresh contract shows **zero** CLI commands until methods opt in — that is the
87
88
  design, not a bug. A pathless runtime definition follows the same rule: it must
88
- explicitly include `'CLI'` in `transports`; the undefined default remains
89
+ explicitly include `'CLI'` in `expose`; the undefined default remains
89
90
  `['MCP', 'AGENT']`. The command name is the tool name — `tool.name` if set, else
90
91
  a verb-aware name from the method + prefix (`list` → `list_widgets`, `get` →
91
92
  `get_widget`), not a literal `prefix_key`.
@@ -105,6 +106,7 @@ await createCli({
105
106
  name: 'myapp',
106
107
  version: '1.0.0',
107
108
  services: [catalogService, generateService],
109
+ access: { gate: { beforeHandle: authHook } },
108
110
  resolveAuth: () => resolveToken(process.env.MYAPP_TOKEN), // lazy, at most once
109
111
  })
110
112
  ```
@@ -140,7 +142,7 @@ const uploadInput = defineUploadTool({
140
142
  description: 'Upload one local input file',
141
143
  identity: { serviceName: 'jobs', action: 'uploadInput', scope: 'user' },
142
144
  output: z.object({ url: z.url() }),
143
- transports: ['MCP', 'AGENT', 'CLI'],
145
+ expose: ['MCP', 'AGENT', 'CLI'],
144
146
  upload: (path, context) => uploadFile(path, context.signal),
145
147
  })
146
148
 
@@ -148,6 +150,7 @@ await createCli({
148
150
  name: 'myapp',
149
151
  version: '1.0.0',
150
152
  runtimeTools: [uploadInput],
153
+ access: { gate: { beforeHandle: authHook } },
151
154
  })
152
155
  ```
153
156
 
@@ -182,6 +185,7 @@ await createCli({
182
185
  commands: [login],
183
186
  resolveAuth: loadStoredIdentity,
184
187
  services: (identity) => createRemoteServices(identity),
188
+ access: { open: 'remote' },
185
189
  })
186
190
  ```
187
191
 
@@ -222,7 +226,7 @@ either callback.
222
226
  ### The same policy for a managed command
223
227
 
224
228
  A command that comes from a contract or a runtime tool declares the same two
225
- callbacks where the CLI is mounted — `CliConfig.results`, keyed by command name.
229
+ callbacks where the CLI is mounted — inside `CliConfig.commandSettings[name].result`.
226
230
  A client and a server print nothing, so the policy belongs to the CLI, not to
227
231
  the contract. `defineCliResult` types both callbacks against the operation's
228
232
  output schema:
@@ -234,12 +238,15 @@ await createCli({
234
238
  name: 'myapp',
235
239
  version: '1.0.0',
236
240
  services: [recordService],
237
- results: {
238
- lookup: defineCliResult(LookupOutput, {
239
- present: ({ result, options }) =>
240
- options.json ? `${JSON.stringify(result)}\n` : `${result.location ?? 'not found'}\n`,
241
- exitCode: (result) => (result.found ? 0 : 1),
242
- }),
241
+ access: { open: 'local-operator' },
242
+ commandSettings: {
243
+ lookup: {
244
+ result: defineCliResult(LookupOutput, {
245
+ present: ({ result, options }) =>
246
+ options.json ? `${JSON.stringify(result)}\n` : `${result.location ?? 'not found'}\n`,
247
+ exitCode: (result) => (result.found ? 0 : 1),
248
+ }),
249
+ },
243
250
  },
244
251
  })
245
252
  ```
@@ -397,14 +404,17 @@ await createCli({
397
404
  name: 'myapp',
398
405
  version: '1.0.0',
399
406
  services,
407
+ access: { gate: { beforeHandle: authHook } },
400
408
  commands: [doctor],
401
409
  defaultCommand: 'logs',
402
- optionAliases: {
403
- logs: { f: 'follow', n: 'lines' },
404
- },
405
- positionals: {
406
- logs: ['target'], // `lines` is option-only
407
- doctor: [], // no argv positionals
410
+ commandSettings: {
411
+ logs: {
412
+ aliases: { f: 'follow', n: 'lines' },
413
+ positionals: ['target'], // `lines` is option-only
414
+ },
415
+ doctor: {
416
+ positionals: [], // no argv positionals
417
+ },
408
418
  },
409
419
  })
410
420
  ```
@@ -429,7 +439,7 @@ When the LAST declared positional is an array field, it takes every remaining
429
439
  token, each coerced by the array's element type:
430
440
 
431
441
  ```ts
432
- positionals: { handoff: ['to', 'files'] } // files: z.array(z.string())
442
+ commandSettings: { handoff: { positionals: ['to', 'files'] } } // files: z.array(z.string())
433
443
  ```
434
444
 
435
445
  ```
@@ -461,23 +471,28 @@ same Zod schema an HTTP or MCP call does.
461
471
  ## Global flags
462
472
 
463
473
  Framework options can precede an explicit command even when the CLI has no
464
- default command. With a static catalogue, `myapp --quiet item_list --json` and
465
- `myapp item_list --quiet --json` produce the same output. Keep an option's value
466
- next to it, as in `myapp --sort date item_list`. Place `--help` before the
467
- command name to filter the command list or after the name to show that command's help.
468
-
469
- Shell command names cannot use a framework option spelling such as `--quiet`,
470
- `--sort` or `--json=false`, the separator `--`, or a built-in help or version
474
+ default command. In every CLI profile — static, native or managed factory —
475
+ `myapp --quiet item_list --json` and `myapp item_list --quiet --json` produce
476
+ the same output. Keep an option's value next to it, as in
477
+ `myapp --sort date item_list`. Place `--help` before the command name to filter
478
+ the command list or after the name to show that command's help. A command's own
479
+ option goes after its name: without a default command, `myapp --verbose inspect`
480
+ is a usage error (exit 2) that says so, the same answer `routeCliArgv` returns as
481
+ `error`.
482
+
483
+ Shell command names cannot be option-shaped (`-x`, `--custom`), use a framework
484
+ option spelling such as `--quiet`, `--sort` or `--json=false`, the separator `--`, or a built-in help or version
471
485
  token. Static CLI declarations are checked before dispatch. Names supplied by
472
486
  a managed factory are checked when that factory is resolved.
473
487
 
474
- If a CLI has a managed factory and no default command, put a native command
475
- first, for example `myapp whoami --quiet`. A leading framework option before a
476
- native command exits with code 2: older catalogues could use that option as a
477
- command name. This refusal and the command-first invocation both work offline.
478
- To keep a positional `false` in a preview after moving the command first,
479
- use `myapp inspect --dry-run=true false`.
480
- Discovered managed commands accept framework flags in either position.
488
+ Native and managed commands alike accept leading framework options in any CLI
489
+ profile, including a CLI with a managed factory and no default command —
490
+ `myapp --quiet whoami` and `myapp whoami --quiet` both resolve the native
491
+ command offline without loading credentials. Do not separate a bare boolean
492
+ framework flag from a trailing `true` or `false` token with a command name or
493
+ application option (`myapp --dry-run inspect false` exits with code 2); write
494
+ `myapp --dry-run=true inspect false`, `myapp inspect --dry-run=true false`, or
495
+ `myapp inspect --dry-run -- false` instead.
481
496
 
482
497
  | Flag | Effect |
483
498
  | --------------------- | ---------------------------------------------------------- |
@@ -574,6 +589,7 @@ await createCli({
574
589
  resolveAuth: (globals) => loadIdentity(globals.caller),
575
590
  context: (auth, globals) => ({ auth, root: globals.root }),
576
591
  runtimeTools: (auth) => catalogFor(auth),
592
+ access: { gate: { beforeHandle: authHook } },
577
593
  })
578
594
  ```
579
595
 
@@ -595,6 +611,44 @@ survives intact.
595
611
 
596
612
  Both help levels list them under `Application options:`.
597
613
 
614
+ ### Parsing argv yourself
615
+
616
+ An entry point that needs the globals or the command before `createCli` runs —
617
+ to pick a profile, or to decide whether to discover a catalogue — reads the line
618
+ with the same grammar through the public projections. Each answers what
619
+ `createCli` answers: the same refusal, the same arguments, the same exit code.
620
+
621
+ ```ts
622
+ import { CliArgumentError, extractCliGlobalOptions, parseCliArgs, routeCliArgv } from 'stitchkit/cli'
623
+
624
+ try {
625
+ const lifted = extractCliGlobalOptions(argv, GlobalsSchema)
626
+ const route = routeCliArgv(lifted.argv, { separatedBefore: lifted.separatedBefore })
627
+ if (route.error !== undefined) return refuse(route.error) // exit 2, nothing ran
628
+ if (route.command === undefined || route.topLevelHelp) return showHelp()
629
+ const parsed = parseCliArgs(route.commandArgv, inputFor(route.command), {
630
+ separatedBefore: route.separatedBefore,
631
+ })
632
+ if (parsed.options.help) return showCommandHelp(route.command)
633
+ if (parsed.options.schema) return showSchema(route.command)
634
+ const result = await invoker.invoke(route.command, parsed.toolArgs)
635
+ } catch (error) {
636
+ if (!(error instanceof CliArgumentError)) throw error
637
+ return refuse(error.message) // exit 2
638
+ }
639
+ ```
640
+
641
+ `separatedBefore` is how a boundary survives the lift: in
642
+ `inspect --verbose --profile demo false` the word `false` was never the value of
643
+ `--verbose`, so it stays the positional it was. A `--` before the command stays in
644
+ the lifted argv and the route refuses it; a line answered by help, `--version` or
645
+ `--schema` reports no global's error; the route refuses in `error` every line
646
+ `createCli` refuses before a command runs (a repeated or malformed framework option
647
+ included); `parseCliArgs` answers help and `--schema` before arguments it cannot read
648
+ (`inspect --verbose=maybe --help` asks for help, with empty `toolArgs`); a pure boolean
649
+ written `--verbose=maybe` is otherwise a `CliArgumentError`; and a name no command
650
+ answers to is `UNKNOWN_OPERATION` (exit `4`) on both `createCli` and `createCliInvoker`.
651
+
598
652
  ## When one runtime command cannot be represented in argv
599
653
 
600
654
  A `runtimeTools` catalogue can change independently of the CLI application. An
@@ -692,12 +746,15 @@ await createCli({
692
746
  name: 'myapp',
693
747
  version: '1.0.0',
694
748
  services,
695
- wait: {
749
+ access: { gate: { beforeHandle: authHook } },
750
+ commandSettings: {
696
751
  generate: {
697
- tool: 'get_generation',
698
- poll: (r) => (isRecord(r) && typeof r.id === 'string' ? { id: r.id } : null),
699
- done: (r) => isRecord(r) && ['COMPLETED', 'FAILED'].includes(String(r.status)),
700
- failed: (r) => isRecord(r) && r.status === 'FAILED',
752
+ wait: {
753
+ tool: 'get_generation',
754
+ poll: (r) => (isRecord(r) && typeof r.id === 'string' ? { id: r.id } : null),
755
+ done: (r) => isRecord(r) && ['COMPLETED', 'FAILED'].includes(String(r.status)),
756
+ failed: (r) => isRecord(r) && r.status === 'FAILED',
757
+ },
701
758
  },
702
759
  },
703
760
  })
@@ -800,149 +857,3 @@ on macOS it uses the packaged native backend. A bundled or compiled macOS CLI mu
800
857
  [`createNativePackaging`](./native-io.md) from `stitchkit/files/packaging` at build
801
858
  time. Missing native support and unsupported platforms, including Windows, refuse the download;
802
859
  CLI commands without downloads continue to work. There is no weaker path-based fallback.
803
-
804
- ## Aggregate views
805
-
806
- The CLI's audience is agents, scripts and `jq`, so output is JSON. That settles
807
- the *encoding*; it does not settle whether the answer to "how many items per
808
- status" should be every item. Measured on a live server, one ordinary question:
809
-
810
- | call | characters returned |
811
- |---|---|
812
- | the listing (98 records) | 34 750 |
813
- | `--count-by status` | ~90 |
814
-
815
- An agent pays for every one of those characters in its context window, and `|
816
- jq` does not help: the bytes have been read into the conversation by the time
817
- `jq` sees them. So the aggregate is computed on the result, before anything is
818
- written.
819
-
820
- ```bash
821
- myapp item_list --count-by status # { "active": 33, "idle": 33, "stopped": 32 }
822
- myapp item_list --count-by status --top 2 # the two largest groups
823
- myapp item_list --sum messages # 4753
824
- myapp item_list --sum messages --by status # one total per status
825
- myapp item_list --top 5 --by status # same view, written the other way round
826
- myapp item_list --table id,status # the one human-facing shape
827
- ```
828
-
829
- Two words, one each: **`--by` groups, `--sort` orders.** That leaves `--top` a
830
- single meaning everywhere — *the n leading entries of the view you asked for* —
831
- so the question a CLI actually gets asked composes out of the parts:
832
-
833
- ```bash
834
- myapp item_list --top 5 --sort messages --table id,messages # the five biggest, as a table
835
- myapp item_list --sort messages --top 5 --json # the same five, as records
836
- myapp item_list --sort name --ascending # ordered the other way
837
- ```
838
-
839
- Groups come back largest first for the same reason, in the printed bytes even when a key looks
840
- like a number; a reader that parses them into a JavaScript object reorders such keys itself.
841
- A string equal to `null` or `(absent)` is quoted, so it stays apart from the missing value. A record that carries no
842
- value for the sort field sorts **last in both directions**: it is not the
843
- smallest, it is not on the scale at all, and letting it lead an ascending list
844
- would answer a question nobody asked.
845
-
846
- Rules worth knowing before you rely on them:
847
-
848
- - **A field no record carries in a nonempty collection is a presentation error.** A group of zero
849
- over a misspelled field is indistinguishable from a true empty answer, and the
850
- caller reads it as data. The message names the fields that *are* there.
851
- Plain and dotted field paths read own properties only at every segment; inherited
852
- properties are not record data. Own keys named `constructor`, `prototype` or `toString`
853
- are ordinary fields.
854
- - **An empty collection is a successful answer.** Count and grouped sums return `{}`,
855
- an ungrouped sum returns `0`, and sorted records return `[]`. Tables keep their header
856
- and separator without data rows. This applies both to a direct `[]` and to the single
857
- array field of an envelope such as `{ items: [], total: 0 }`. With no records, field
858
- presence cannot be checked, so a misspelled field answers empty too; malformed paths, unsafe
859
- `__proto__` segments and a field of the envelope itself (`--sum total` here) still refuse.
860
- - **An aggregate needs a collection** — the result itself when it is an array,
861
- or the single array field of a result object. An aggregate over a scalar, or
862
- over an object with two array fields, is refused rather than guessed.
863
- - **Without a view flag the output is byte-for-byte what it was.** The flags are
864
- reserved CLI behaviour like `--json`; they never reach a tool argument.
865
- - **Ordering and grouping do not mix.** `--sort` with `--by`, `--count-by` or
866
- `--sum` is refused rather than given a second meaning.
867
-
868
- A failed call still reports its own error and exit code. An aggregate over an
869
- error is not an answer to the question that was asked.
870
-
871
- If the command succeeds but its requested view cannot be built, the CLI writes a
872
- structured `CLI_PRESENTATION_FAILED` diagnostic to stderr and exits with `8`,
873
- configurable through `exitCodes`. Its `details.operationSucceeded: true` and
874
- `retryable: false` distinguish a presentation refusal from a failed operation;
875
- `details.cause` preserves the safe reason, such as the misspelled field and the
876
- fields that are there. Domain retry hints are not appended to this diagnostic.
877
-
878
- What reaches stdout depends on whether the command can be called again for its answer,
879
- and `details.resultOnStdout` states which case occurred:
880
-
881
- | Command | stdout | Recover the answer by |
882
- |---|---|---|
883
- | has an effect | the complete original result in the normal JSON format (`--json` still selects compact output) | reading stdout — never by repeating the mutation |
884
- | only reads | nothing | repeating the command with a corrected view |
885
-
886
- A managed command only reads when its tool declares `annotations.readOnlyHint: true`,
887
- or declares no `readOnlyHint` and its method is `GET`. `readOnlyHint: false`, or
888
- `destructiveHint: true` without a `readOnlyHint`, on a `GET` endpoint keeps the result on stdout. A native
889
- `defineCliCommand` declares neither fact, so a failed `present` always keeps the validated
890
- result on stdout.
891
-
892
- A CLI that mounts a server's tools through `defineMcpClientConnection` never sees the
893
- method — every MCP call is a `POST` — so it reads the `readOnlyHint` the server
894
- publishes. A Stitchkit server publishes it for every `GET` by the rule above
895
- ([MCP → `readOnlyHint`](./mcp-and-agents.md#saying-which-tools-only-read--readonlyhint)),
896
- so the same command behaves the same over the contract and over MCP. The hint is the
897
- server's word: a server that labels a write as read-only makes the CLI withhold that
898
- write's result on a refused view, and repeating the command repeats the effect.
899
-
900
- CLI argument errors detected before execution still exit with `2`
901
- and have no successful result to preserve.
902
-
903
- ## Named profiles
904
-
905
- A CLI that talks to a deployed server needs an address and a credential per
906
- environment, and the way a person picks one is a name: `--profile prod`.
907
- `globalOptions` gives the flag a home and `resolveAuth(globals)` gives it a
908
- resolution point. The rule that makes the mechanism safe is easy to write the
909
- wrong way round, because the unsafe version reads as kindness:
910
-
911
- > the named profile does not exist, but exactly one profile is configured — use it.
912
-
913
- That is correct exactly while a single profile exists. The day a second appears
914
- it is a command run against the wrong deployment, with nothing in the output to
915
- say so. **A profile named explicitly and not found is a refusal, never a
916
- substitution.** With no name given and exactly one profile configured, the CLI
917
- selects it and writes a notice to stderr by default. `--quiet` suppresses that
918
- notice, including when the app selects the profile before discovering its
919
- commands. Profile refusals still report their cause. An app that supplies
920
- `announce` controls its own notice.
921
-
922
- `createCliProfileStore` is that rule, plus the twenty lines every consumer of
923
- this shape writes:
924
-
925
- ```ts
926
- import { createCliProfileStore } from 'stitchkit/cli'
927
- import { homedir } from 'node:os'
928
- import { join } from 'node:path'
929
- import { z } from 'zod'
930
-
931
- const profiles = createCliProfileStore({
932
- directory: join(homedir(), '.config/myapp/profiles'),
933
- schema: z.object({ url: z.url(), token: z.string().min(1) }),
934
- createHint: (name, path) => `write ${path} with {"url","token"} for "${name}"`,
935
- })
936
-
937
- await createCli({
938
- name: 'myapp',
939
- version,
940
- globalOptions: z.object({ profile: z.string().optional() }),
941
- resolveAuth: (globals) => profiles.resolve(globals.profile).value,
942
- services,
943
- })
944
- ```
945
-
946
- Files are written `0600` in a `0700` directory — and a profile file other users
947
- can read is refused with the `chmod` that fixes it, because it holds a
948
- credential.
package/llms/contract.txt CHANGED
@@ -78,7 +78,7 @@ export const users = defineContract({ prefix: 'users' }, {
78
78
  | `multipart` | no | typed file fields, cardinality, delivery and upload policy — see [below](#file-uploads) |
79
79
  | `maxJsonBodyBytes` | no | per-route JSON body ceiling; overrides the server default |
80
80
  | `timeout` | no | per-endpoint client timeout in ms, for slow endpoints |
81
- | `idempotent` | no | safe to call twice with the same input (like `PUT`/`DELETE`); a retrying transport reads it — see [Realtime](./realtime.md#bring-your-own-transport) |
81
+ | `idempotent` | no | safe to call twice with the same input (like `PUT`/`DELETE`); the typed client repeats a call that got no answer only when it is set, or for a `GET`/`HEAD` without `idempotent: false` or `effect: 'write'` — see [Client](./client.md#calls-that-never-got-an-answer); a retrying transport reads it too — see [Realtime](./realtime.md#bring-your-own-transport) |
82
82
  | `meta` | no | opaque app metadata — read in hooks / on tool mounts, never in OpenAPI ([below](#endpoint-metadata-meta)) |
83
83
  | `rawResponse` | no | the handler returns the `Response` itself — a download, a file, an SSE stream. HTTP-only, never a tool, no `output`. See [Raw-response endpoints](./server.md#raw-response-endpoints) |
84
84
  | `rawBody` | no | retain original JSON text for a signed HTTP webhook. See [Signed JSON webhooks](./server.md#signed-json-webhooks) |
@@ -538,13 +538,15 @@ from the root `stitchkit`.
538
538
  | `ScopedContractDef` | _type_ | a factory-defined contract whose `meta.scope` is the required concrete literal |
539
539
  | `ScopedDefineContract` | _type_ | the `defineContract` `createContractFactory` returns — endpoint `scope` overrides join the union |
540
540
  | `ALL_TRANSPORTS` | constant | `['HTTP', 'MCP', 'AGENT', 'CLI']` |
541
- | `TOOL_TRANSPORTS` / `ToolTransport` | constant / _type_ | `['MCP', 'AGENT', 'CLI']` — the transports a model or tool client reads; the one name for a tool surface everywhere (runtime-tool `transports`, invoker, collector, connections) |
541
+ | `TOOL_TRANSPORTS` / `ToolTransport` | constant / _type_ | `['MCP', 'AGENT', 'CLI']` — the transports a model or tool client reads; the one name for a tool surface everywhere (runtime-tool `expose`, invoker, collector, connections) |
542
542
  | `ContractDef` | _type_ | a defined contract |
543
543
  | `PathParams` | _type_ | infer named `:segments` and a terminal `*wildcard` from a path literal as string params |
544
544
  | `ContractMeta` | _type_ | a contract's `prefix` + optional `scope` and `meta` (a default every endpoint shallow-merges over) |
545
- | `EndpointDef` | _type_ | a single endpoint definition; `output` declares JSON response presence (`null` is data, `undefined` is invalid); `safelistedBody: true` admits the JSON body as `text/plain` from an allow-listed `Origin` — [guide](../guide/server.md#safelisted-request-bodies-beacons) |
545
+ | `EndpointDef` | _type_ | a single endpoint definition; `output` declares JSON response presence (`null` is data, `undefined` is invalid); optional `effect?: OperationEffect` declares `'read' \| 'write'` side effects; `safelistedBody: true` admits the JSON body as `text/plain` from an allow-listed `Origin` — [guide](../guide/server.md#safelisted-request-bodies-beacons) |
546
+ | `OperationEffect` / `OperationEffectSchema` | _type_ / schema | closed `'read' \| 'write'` side-effect classification declared on contract endpoints |
547
+ | `contractOperationEffects` / `requireContractOperationEffects` | function | project declared endpoint `effect` tags from a contract; `requireContractOperationEffects` fails closed and lists every operation missing `effect` |
546
548
  | `withToolView` | function | declare an endpoint's call and answer on the tool surface (MCP, AGENT, CLI): input `defaults`, and optionally a view `output` and a `project`, typed against the endpoint's own schemas; HTTP keeps the full answer — [guide](../guide/mcp-and-agents.md#a-different-answer-for-tools--withtoolview) |
547
- | `EndpointToolOptions` | _type_ | an endpoint's `tool` group — `name`, `view`, `ui`, `annotations`, `mcp`: what the tool surfaces read that HTTP does not |
549
+ | `EndpointToolOptions` | _type_ | an endpoint's `tool` group — `name`, `view`, `ui`, `annotations`, `mcp`, `inputRecursionDepth`: what the tool surfaces read that HTTP does not |
548
550
  | `EndpointToolView` | _type_ | the stored shape of a tool view (`MethodDef.toolView`) |
549
551
  | `DeclaredToolView` | _type_ | a tool view as `withToolView` produces it — the only form `tool.view` accepts |
550
552
  | `WithToolView` | _type_ | the endpoint `withToolView` returns: its own tool options plus the declared view in `tool.view` — name it when a helper returns such an endpoint |
@@ -584,7 +586,7 @@ from the root `stitchkit`.
584
586
  | `MultipartDescriptor` | _type_ | file fields, cardinality, delivery and request/text limits |
585
587
  | `MultipartFilePolicy` | _type_ | required/multiple, per-file bytes/count and declared MIME policy |
586
588
  | `MultipartBufferedFiles` | _type_ | `File` map inferred from a multipart descriptor |
587
- | `EndpointToolAnnotations` | _type_ | MCP behavioural hints on an endpoint (`readOnlyHint` / `destructiveHint` / `title`) |
589
+ | `EndpointToolAnnotations` | _type_ | MCP behavioural hints on an endpoint (`readOnlyHint` / `destructiveHint` / `title`); omitted `readOnlyHint` derives `true` when `effect: 'read'` (or `GET` without `effect: 'write'`) and `destructiveHint !== true` |
588
590
  | `EndpointUiMeta` | _type_ | MCP Apps widget metadata on an endpoint |
589
591
  | `EndpointMcpInputRequired` | _type_ | typed MCP multi-round input request (`key`, message and Zod object schema) |
590
592
  | `EndpointMcpPolicy` | _type_ | MCP-only endpoint policy containing `inputRequired` |
@@ -602,7 +604,6 @@ from the root `stitchkit`.
602
604
  | `forbidden` | function | throw `403 FORBIDDEN` |
603
605
  | `conflict` | function | throw `409 CONFLICT` |
604
606
  | `rateLimited` | function | throw `429 RATE_LIMITED` |
605
- | `appError` | function | throw an `AppError` for any code |
606
607
  | `defineErrors` | function | declare immutable domain error definitions → typed `AppError` constructors, codes and schemas — [guide](../guide/auth-and-errors.md#domain-errors--defineerrors) |
607
608
  | `DefinedErrors` | _type_ | the `{ errors, codes, definitions, isCode, codeMap }` handle `defineErrors` returns |
608
609
  | `DefinedAppError` | _type_ | literal-code error instance with schema-refined details |
@@ -243,7 +243,7 @@ is how a partially understood declaration becomes a running, wrong deployment.
243
243
 
244
244
  | Export | Kind | Summary |
245
245
  |--------|------|---------|
246
- | `ProjectDeclarationSchema` / `ProjectDeclaration` | schema / _type_ | the declaration: `schemaVersion`, `kind`, `identity`, `roles`, `build`, `requires`, `release`, `env` |
246
+ | `ProjectDeclarationSchema` / `ProjectDeclaration` | schema / _type_ | the declaration: `schemaVersion`, `kind`, `identity`, optional `starter: { version }`, `roles`, `build`, `requires`, `release`, `env` |
247
247
  | `parseProjectDeclaration` | function | parse a declaration, refusing an unrecognised `schemaVersion` **before** any field is read |
248
248
  | `PROJECT_DECLARATION_SCHEMA_VERSION` | constant | the declaration format this build understands — the number a reader refuses on |
249
249
  | `namesAMachine` | function | why a string names a particular machine, or `undefined` — the one predicate every free string is checked against |
package/llms/files.txt CHANGED
@@ -46,3 +46,14 @@ available from `stitchkit/contract`.
46
46
  |---|---|---|
47
47
  | `AtomicFilePublicationError` | class | published=true with cleanup/directory-sync/directory-close phase |
48
48
  | `FileObservation` | type | observed descriptor dev/ino/size/nlink/mtimeMs/ctimeMs |
49
+ | `FileStatsView` | type | the file metadata an `accept` check receives: `FileObservation` plus mode, uid, gid and the kind checks; `fs.Stats` satisfies it, so declarations need no `@types/node` |
50
+ | `FileIdentityStats` | type | what `fileIdentity` reads: dev, ino, size and times as numbers or bigints; `fs.Stats` and `fs.BigIntStats` both satisfy it |
51
+ | `RegularFileError` / `RegularFileRefusal` / `JsonValueRefusal` | class / _type_ / _type_ | a refused read, with the message naming the path, the original failure as `cause` and `reason` — of the file: `not-regular`, `too-large`, `symbolic-link`, `rejected`, `unsupported` or `changed` (the file kept changing across a read and its one retry); of its bytes (`JsonValueRefusal`): `encoding` (not strict UTF-8), `syntax` (not JSON, or a `__proto__` key) or `schema` (refused or thrown). A refusal of the operating system (`ENOENT`, `EACCES`) is not a `RegularFileError` |
52
+ | `DEFAULT_JSON_FILE_BYTES` / `MAX_POLLED_JSON_CACHE_BYTES` | const | default regular-file JSON byte limit (1 MiB) and polled JSON cache memory ceiling (4 MiB) |
53
+ | `fileIdentity` | function | stable `dev:ino:size:mtime:ctime` identity string from `Stats` or `BigIntStats` |
54
+ | `readRegularFileSync` / `readRegularFile` | function | non-blocking (`O_NONBLOCK`) regular-file readers refusing FIFOs, directories, sockets and oversized files, retrying once on concurrent change; options `{ limit, noFollow, accept }`, plus `signal` for the async one |
55
+ | `RegularFileReadOptions` / `RegularFileAsyncReadOptions` / `RegularFileAccept` | _type_ | `noFollow` opens with `O_NOFOLLOW`, so a symbolic link as the last path component is refused (`reason: 'symbolic-link'`), never followed — links in the directories above it still are; `accept(info)` runs on the `fstat` of the descriptor the bytes are then read from, before any byte is read and on each attempt, so replacing the file at the path after the check changes nothing; the file is read only when it returns `true` (`reason: 'rejected'` otherwise) |
56
+ | `parseJsonBytes` / `readJsonFileSync` / `JsonValueSchema` | function / _type_ | strict fatal UTF-8 JSON parsing that refuses a `__proto__` key rather than dropping it, and schema validation (Zod and `{ safeParse }` compatible); every failure is a `RegularFileError` with reason `encoding`, `syntax` or `schema` |
57
+ | `readJsonOnce` / `JsonFileReading` / `PolledJsonFile` / `PolledJsonFiles` / `PolledJsonOptions` | function / _type_ / class / _type_ | classified JSON polling (`missing` / `unreadable` — the operating system or a file rule refused it, with the rule's `reason` / `invalid` — the bytes are not the value, with `reason` `encoding`, `syntax` or `schema` / `read`) with bounded LRU cache and `readChanged()` returning `null` when unchanged; `noFollow` and `accept` apply to every read from disk — a file whose identity is unchanged is answered from the cache, once a read found its last change at least 3 s old (a younger file is read and compared again, since a same-length rewrite in one tick of a coarse filesystem clock keeps size, mtime and ctime) — and with `noFollow` that shortcut uses `lstat`, so a symbolic link to the cached inode is refused too; a schema that throws is an `invalid` file |
58
+ | `PolledJsonFiles.refresh(entries)` / `PolledJsonFiles.refreshAsync(entries, { signal })` / `PolledJsonEntry` / `PolledJsonChange` / `MAX_POLLED_JSON_PATHS` | method / method / _type_ / _type_ / const | make the `{ path, options }` entries the tracked set and get its changes in their order: `changed` with the new reading for a new path or a new state, `removed` for a path that left the set. A path's own `options` replace the set's field by field (a set of explicit files that follow links and drop-ins read with `noFollow` and `accept`), and new options read the file again; a path listed twice is a `TypeError`. `refreshAsync` stats and reads asynchronously, commits nothing when aborted, and refuses every other call on the set while it runs. A declaration goes away either way: its path left the set (`removed`), or its file did (`changed` to `missing`). Tracking more than `MAX_POLLED_JSON_PATHS` (1024) throws `RangeError` — from `refresh`, `read` and `readChanged` alike — instead of evicting, since an evicted path would come back as a false change |
59
+ | `waitForDirectory` / `WaitForDirectoryOptions` | function / _type_ | resolves once a path exists as a directory, without a polling timer: `fs.watch` on the nearest existing ancestor, moving down as components appear and back up if the watched directory is removed; each watch start is followed by one immediate and one deferred rescan (`settleMs`, default 250) for a directory created before the watch saw it, and each event re-arms the watch, so a directory removed and made again at once is followed; a symbolic link at the path counts once it resolves to a directory; `signal` rejects with its reason and closes every watcher; `keepAlive: false` unreferences the watcher and the deferred rescan, so the wait does not hold the process |
@@ -0,0 +1,25 @@
1
+ # stitchkit/handler — stitchkit docs slice
2
+
3
+ > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
+ > `llms.txt` in this package.
5
+
6
+ Contains: API reference: `stitchkit/handler` (docs/api/reference.md)
7
+
8
+ ==============================================================================
9
+ # API reference: `stitchkit/handler` (docs/api/reference.md)
10
+ ==============================================================================
11
+
12
+ ## `stitchkit/handler`
13
+
14
+ Portable Fetch handler and `postMessage` bridge host without Node built-ins; usable in browsers, edge runtimes and React Native / Hermes (→ [A host inside React Native](../guide/server.md#a-host-inside-react-native), [ADR 0307](../decisions/0307-a-handler-runs-without-node-and-a-bridge-carries-requests.md)).
15
+
16
+ | Export | Kind | Summary |
17
+ |--------|------|---------|
18
+ | `createHandler` | function | build a Fetch `(req) => Promise<Response>` contract router without Node built-ins |
19
+ | `implement` / `createImplement` | function | bind typed contract handlers (`ImplementOptions`, `MissingHandlerPolicy`) |
20
+ | `createErrorHook` | function | build a composable error hook (`ErrorHookBase`, `ErrorHookConfig`, `ErrorHookMapping`, `ResolvedError`) |
21
+ | `serveBridge` | function | serve a `FetchHandler` over a string-only `postMessage` bridge port with origin trust, optional constant-time secret, `maxFrameBytes` before `JSON.parse` and `maxInFlight` |
22
+ | `BridgeHostConfig` / `BridgeHostHandle` / `BridgeHostPort` / `BridgeHostStats` / `BridgeInboundMessage` | _types_ | configuration, handle, port, diagnostic counters and inbound container message for `serveBridge` |
23
+ | `AppError` / `badRequest` / `unauthorized` / `forbidden` / `notFound` / `conflict` / `rateLimited` / `isStitchErrorCode` / `STITCH_ERROR_STATUS` / `StitchErrorCode` | class / function / const / _type_ | shared error vocabulary re-exported for portable handlers |
24
+ | `CorsConfig` / `CorsOriginDecision` / `CorsOriginPolicy` | _types_ | CORS configuration and per-request origin decision types |
25
+ | `FetchHandler` / `HandlerConfig` / `Handlers` / `LifecycleHooks` / `LoggingConfig` / `LogOutcome` / `RawRoute` / `RawRouteContext` / `RouteGroup` / `RouteGroupHooks` / `ServiceDef` / `StitchLogger` | _types_ | portable handler, lifecycle hook, raw route and logger types |
package/llms/http.txt CHANGED
@@ -14,9 +14,26 @@ Also read:
14
14
 
15
15
  ## `stitchkit/http`
16
16
 
17
- An HTTP-only entrypoint for browsers, React Native/Hermes and servers. It exports the same `createClient`, `createClients`, `createHttpClient`, URL builders, client configuration types and `ApiError` as the root, without loading its optional Socket.IO graph. Import shared contracts from `stitchkit/contract`.
17
+ An HTTP-only entrypoint for browsers, React Native/Hermes and servers. It exports the same `createClient`, `createClients`, `createHttpClient`, URL builders, client configuration types and `ApiError` as the root, without loading its optional Socket.IO graph, plus the `postMessage` bridge `ClientFetch` adapter and envelope schemas. Import shared contracts from `stitchkit/contract`.
18
18
 
19
19
  ```ts
20
20
  import { createClients, createHttpClient } from 'stitchkit/http';
21
21
  import { defineContract } from 'stitchkit/contract';
22
22
  ```
23
+
24
+ ### Bridge client & wire envelope
25
+
26
+ | Export | Kind | Summary |
27
+ |--------|------|---------|
28
+ | `createBridgeFetch` | function | adapt a string-only `BridgeClientPort` or Expo DOM `BridgeInvoke` function into a `BridgeFetch` (`ClientFetch & { close() }`) for `createClient` / `createHttpClient` — [guide](../guide/server.md#a-host-inside-react-native) |
29
+ | `BridgeFailureError` | class | transport-level `TypeError` with `code: BridgeFailureCode` raised when the host replies with a `failure` frame |
30
+ | `BRIDGE_ORIGIN` / `DEFAULT_BRIDGE_MAX_FRAME_BYTES` | const | synthetic bridge base origin (`http://bridge.invalid`) and default 1 MiB frame byte limit |
31
+ | `BridgeClientPort` / `BridgeInvoke` / `BridgeFetch` / `BridgeFetchOptions` / `BridgeDropReason` | _types_ | window-side port, async invoke seam, closeable fetch handle, options and dropped-frame reasons |
32
+ | `BridgeFrameSchema` / `BridgeFrame` | schema / _type_ | discriminated union of v1 bridge wire frames (`request`, `abort`, `response`, `failure`, `hello`) |
33
+ | `BridgeRequestFrameSchema` / `BridgeRequestFrame` | schema / _type_ | window-to-host request frame |
34
+ | `BridgeAbortFrameSchema` / `BridgeAbortFrame` | schema / _type_ | window-to-host cancellation frame |
35
+ | `BridgeResponseFrameSchema` / `BridgeResponseFrame` | schema / _type_ | host-to-window response frame |
36
+ | `BridgeFailureFrameSchema` / `BridgeFailureFrame` | schema / _type_ | host-to-window transport failure frame |
37
+ | `BridgeHelloFrameSchema` / `BridgeHelloFrame` | schema / _type_ | host-to-window startup / restart announcement frame |
38
+ | `BridgeFailureCodeSchema` / `BridgeFailureCode` | schema / _type_ | closed failure codes (`refused`, `unsupported`, `frame-too-large`, `host-busy`, `duplicate-id`, `host-error`) |
39
+ | `BridgeHeaderEntrySchema` / `BridgeHeaderEntry` | schema / _type_ | `[name, value]` header pair preserving repeated `Set-Cookie` entries |