stitchkit 0.93.0 → 0.94.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1082) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/README.md +5 -2
  3. package/dist/agent-runtime/children-control.d.ts +6 -0
  4. package/dist/agent-runtime/children-control.d.ts.map +1 -0
  5. package/dist/agent-runtime/children-spawn.d.ts +6 -0
  6. package/dist/agent-runtime/children-spawn.d.ts.map +1 -0
  7. package/dist/agent-runtime/children-state.d.ts +46 -0
  8. package/dist/agent-runtime/children-state.d.ts.map +1 -0
  9. package/dist/agent-runtime/children-usage.d.ts +8 -0
  10. package/dist/agent-runtime/children-usage.d.ts.map +1 -0
  11. package/dist/agent-runtime/children.d.ts +11 -14
  12. package/dist/agent-runtime/children.d.ts.map +1 -1
  13. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
  14. package/dist/agent-runtime/coding-tool-contract.d.ts +2 -1
  15. package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
  16. package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
  17. package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
  18. package/dist/agent-runtime/contained-darwin.d.ts +38 -0
  19. package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
  20. package/dist/agent-runtime/contained-files.d.ts +11 -26
  21. package/dist/agent-runtime/contained-files.d.ts.map +1 -1
  22. package/dist/agent-runtime/contained-scan.d.ts +21 -0
  23. package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
  24. package/dist/agent-runtime/contained-write.d.ts +9 -0
  25. package/dist/agent-runtime/contained-write.d.ts.map +1 -0
  26. package/dist/agent-runtime/deferred-tool-types.d.ts +4 -3
  27. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  28. package/dist/agent-runtime/events.d.ts +1 -1
  29. package/dist/agent-runtime/events.d.ts.map +1 -1
  30. package/dist/agent-runtime/harness-control.d.ts +0 -1
  31. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  32. package/dist/agent-runtime/harness.d.ts +0 -5
  33. package/dist/agent-runtime/harness.d.ts.map +1 -1
  34. package/dist/agent-runtime/managed-tools.d.ts +3 -2
  35. package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
  36. package/dist/agent-runtime/observability.d.ts +1 -1
  37. package/dist/agent-runtime/observability.d.ts.map +1 -1
  38. package/dist/agent-runtime/openrouter.d.ts +29 -0
  39. package/dist/agent-runtime/openrouter.d.ts.map +1 -0
  40. package/dist/agent-runtime/projections.d.ts +1 -1
  41. package/dist/agent-runtime/projections.d.ts.map +1 -1
  42. package/dist/agent-runtime/run-acquisition.d.ts +17 -0
  43. package/dist/agent-runtime/run-acquisition.d.ts.map +1 -0
  44. package/dist/agent-runtime/run-execution-state.d.ts +133 -0
  45. package/dist/agent-runtime/run-execution-state.d.ts.map +1 -0
  46. package/dist/agent-runtime/run-execution.d.ts +17 -33
  47. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  48. package/dist/agent-runtime/run-failure.d.ts +18 -0
  49. package/dist/agent-runtime/run-failure.d.ts.map +1 -0
  50. package/dist/agent-runtime/run-model-attempts.d.ts +6 -0
  51. package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -0
  52. package/dist/agent-runtime/run-prompt-history.d.ts +58 -0
  53. package/dist/agent-runtime/run-prompt-history.d.ts.map +1 -0
  54. package/dist/agent-runtime/run-provider-ledger.d.ts +26 -0
  55. package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -0
  56. package/dist/agent-runtime/run-stream-parts.d.ts +17 -0
  57. package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -0
  58. package/dist/agent-runtime/run-terminal.d.ts +11 -0
  59. package/dist/agent-runtime/run-terminal.d.ts.map +1 -0
  60. package/dist/agent-runtime/run-turn-preparation.d.ts +22 -0
  61. package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -0
  62. package/dist/agent-runtime/runtime-admission-gate.d.ts +29 -0
  63. package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -0
  64. package/dist/agent-runtime/runtime-control.d.ts +9 -0
  65. package/dist/agent-runtime/runtime-control.d.ts.map +1 -0
  66. package/dist/agent-runtime/runtime-recovery.d.ts +10 -0
  67. package/dist/agent-runtime/runtime-recovery.d.ts.map +1 -0
  68. package/dist/agent-runtime/runtime-state.d.ts +36 -0
  69. package/dist/agent-runtime/runtime-state.d.ts.map +1 -0
  70. package/dist/agent-runtime/runtime-submit.d.ts +5 -0
  71. package/dist/agent-runtime/runtime-submit.d.ts.map +1 -0
  72. package/dist/agent-runtime/runtime.d.ts +10 -5
  73. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  74. package/dist/agent-runtime/schedule-records.d.ts +34 -0
  75. package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
  76. package/dist/agent-runtime/schedules.d.ts +34 -0
  77. package/dist/agent-runtime/schedules.d.ts.map +1 -1
  78. package/dist/agent-runtime/sqlite-bun.d.ts +12 -0
  79. package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -0
  80. package/dist/agent-runtime/sqlite-events.d.ts +5 -0
  81. package/dist/agent-runtime/sqlite-events.d.ts.map +1 -0
  82. package/dist/agent-runtime/sqlite-history.d.ts +7 -0
  83. package/dist/agent-runtime/sqlite-history.d.ts.map +1 -0
  84. package/dist/agent-runtime/sqlite-ledger.d.ts +7 -0
  85. package/dist/agent-runtime/sqlite-ledger.d.ts.map +1 -0
  86. package/dist/agent-runtime/sqlite-node.d.ts +12 -0
  87. package/dist/agent-runtime/sqlite-node.d.ts.map +1 -0
  88. package/dist/agent-runtime/sqlite-reads.d.ts +14 -0
  89. package/dist/agent-runtime/sqlite-reads.d.ts.map +1 -0
  90. package/dist/agent-runtime/sqlite-rows.d.ts +178 -0
  91. package/dist/agent-runtime/sqlite-rows.d.ts.map +1 -0
  92. package/dist/agent-runtime/sqlite-schema.d.ts +7 -0
  93. package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -0
  94. package/dist/agent-runtime/sqlite-transactions.d.ts +25 -0
  95. package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -0
  96. package/dist/agent-runtime/sqlite.d.ts +10 -6
  97. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  98. package/dist/agent-runtime/store-archive.d.ts +16 -0
  99. package/dist/agent-runtime/store-archive.d.ts.map +1 -0
  100. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
  101. package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
  102. package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
  103. package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
  104. package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
  105. package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
  106. package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
  107. package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
  108. package/dist/agent-runtime/store-conformance.d.ts +40 -0
  109. package/dist/agent-runtime/store-conformance.d.ts.map +1 -0
  110. package/dist/agent-runtime/store-create.d.ts +11 -0
  111. package/dist/agent-runtime/store-create.d.ts.map +1 -0
  112. package/dist/agent-runtime/store-driver-contract.d.ts +814 -0
  113. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -0
  114. package/dist/agent-runtime/store-events.d.ts +7 -89
  115. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  116. package/dist/agent-runtime/store-memory.d.ts +4 -0
  117. package/dist/agent-runtime/store-memory.d.ts.map +1 -0
  118. package/dist/agent-runtime/store-mutate.d.ts +13 -0
  119. package/dist/agent-runtime/store-mutate.d.ts.map +1 -0
  120. package/dist/agent-runtime/store-purge.d.ts +1 -1
  121. package/dist/agent-runtime/store-purge.d.ts.map +1 -1
  122. package/dist/agent-runtime/store-reads.d.ts +29 -0
  123. package/dist/agent-runtime/store-reads.d.ts.map +1 -0
  124. package/dist/agent-runtime/store-reduce-history.d.ts +10 -0
  125. package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -0
  126. package/dist/agent-runtime/store-reduce-run.d.ts +14 -0
  127. package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -0
  128. package/dist/agent-runtime/store-reduce-shared.d.ts +76 -0
  129. package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -0
  130. package/dist/agent-runtime/store-reduce-terminal.d.ts +6 -0
  131. package/dist/agent-runtime/store-reduce-terminal.d.ts.map +1 -0
  132. package/dist/agent-runtime/store-reducer.d.ts +24 -0
  133. package/dist/agent-runtime/store-reducer.d.ts.map +1 -0
  134. package/dist/agent-runtime/store-snapshot.d.ts +19 -0
  135. package/dist/agent-runtime/store-snapshot.d.ts.map +1 -0
  136. package/dist/agent-runtime/store.d.ts +1 -1
  137. package/dist/agent-runtime/store.d.ts.map +1 -1
  138. package/dist/application/admission-rate.d.ts +21 -0
  139. package/dist/application/admission-rate.d.ts.map +1 -0
  140. package/dist/application/admission-run.d.ts +8 -0
  141. package/dist/application/admission-run.d.ts.map +1 -0
  142. package/dist/application/admission.d.ts +1 -1
  143. package/dist/application/admission.d.ts.map +1 -1
  144. package/dist/application/diagnostic-journal-lock.d.ts +9 -34
  145. package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
  146. package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
  147. package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
  148. package/dist/application/events.d.ts +1 -1
  149. package/dist/application/events.d.ts.map +1 -1
  150. package/dist/application/file-state-store.d.ts +23 -0
  151. package/dist/application/file-state-store.d.ts.map +1 -0
  152. package/dist/application/health.d.ts +1 -1
  153. package/dist/application/health.d.ts.map +1 -1
  154. package/dist/application/kernel-admission.d.ts +8 -0
  155. package/dist/application/kernel-admission.d.ts.map +1 -0
  156. package/dist/application/kernel-contract.d.ts +142 -0
  157. package/dist/application/kernel-contract.d.ts.map +1 -0
  158. package/dist/application/kernel-resource-context.d.ts +24 -0
  159. package/dist/application/kernel-resource-context.d.ts.map +1 -0
  160. package/dist/application/kernel-restart.d.ts +5 -0
  161. package/dist/application/kernel-restart.d.ts.map +1 -0
  162. package/dist/application/kernel-rollback.d.ts +4 -0
  163. package/dist/application/kernel-rollback.d.ts.map +1 -0
  164. package/dist/application/kernel-shutdown.d.ts +6 -0
  165. package/dist/application/kernel-shutdown.d.ts.map +1 -0
  166. package/dist/application/kernel-start.d.ts +20 -0
  167. package/dist/application/kernel-start.d.ts.map +1 -0
  168. package/dist/application/kernel-state.d.ts +116 -0
  169. package/dist/application/kernel-state.d.ts.map +1 -0
  170. package/dist/application/kernel.d.ts +9 -140
  171. package/dist/application/kernel.d.ts.map +1 -1
  172. package/dist/application/latest-sink.d.ts +1 -1
  173. package/dist/application/latest-sink.d.ts.map +1 -1
  174. package/dist/application/notification-outbox.d.ts.map +1 -1
  175. package/dist/application/opentelemetry.d.ts +1 -1
  176. package/dist/application/opentelemetry.d.ts.map +1 -1
  177. package/dist/application/schedule.d.ts +0 -1
  178. package/dist/application/schedule.d.ts.map +1 -1
  179. package/dist/application/watch-hub-core.d.ts +122 -0
  180. package/dist/application/watch-hub-core.d.ts.map +1 -0
  181. package/dist/application/watch-hub.d.ts +3 -3
  182. package/dist/application/watch-hub.d.ts.map +1 -1
  183. package/dist/browser/client-executors.d.ts +14 -0
  184. package/dist/browser/client-executors.d.ts.map +1 -0
  185. package/dist/browser/client-multipart.d.ts +1 -1
  186. package/dist/browser/client-multipart.d.ts.map +1 -1
  187. package/dist/browser/client-url.d.ts +1 -1
  188. package/dist/browser/client-url.d.ts.map +1 -1
  189. package/dist/browser/client.d.ts +3 -2
  190. package/dist/browser/client.d.ts.map +1 -1
  191. package/dist/browser/contract-stream.d.ts +1 -1
  192. package/dist/browser/contract-stream.d.ts.map +1 -1
  193. package/dist/browser/http-fetch.d.ts +22 -0
  194. package/dist/browser/http-fetch.d.ts.map +1 -0
  195. package/dist/browser/http.d.ts +2 -4
  196. package/dist/browser/http.d.ts.map +1 -1
  197. package/dist/browser/live-state-core.d.ts +63 -0
  198. package/dist/browser/live-state-core.d.ts.map +1 -0
  199. package/dist/browser/live-state.d.ts.map +1 -1
  200. package/dist/browser/realtime-client.d.ts +26 -0
  201. package/dist/browser/realtime-client.d.ts.map +1 -0
  202. package/dist/browser/resumable.d.ts +1 -28
  203. package/dist/browser/resumable.d.ts.map +1 -1
  204. package/dist/browser/retained.d.ts.map +1 -0
  205. package/dist/browser/socket-io-connection.d.ts +82 -0
  206. package/dist/browser/socket-io-connection.d.ts.map +1 -0
  207. package/dist/browser/socket-io-peer.d.ts +20 -0
  208. package/dist/browser/socket-io-peer.d.ts.map +1 -0
  209. package/dist/browser/socket-io-trace.d.ts +31 -0
  210. package/dist/browser/socket-io-trace.d.ts.map +1 -0
  211. package/dist/browser/socket-io.d.ts +24 -18
  212. package/dist/browser/socket-io.d.ts.map +1 -1
  213. package/dist/browser/stream.d.ts +14 -2
  214. package/dist/browser/stream.d.ts.map +1 -1
  215. package/dist/contract/client-types.d.ts +134 -0
  216. package/dist/contract/client-types.d.ts.map +1 -0
  217. package/dist/contract/define-validation.d.ts +30 -0
  218. package/dist/contract/define-validation.d.ts.map +1 -0
  219. package/dist/contract/define.d.ts +47 -394
  220. package/dist/contract/define.d.ts.map +1 -1
  221. package/dist/contract/normalize.d.ts +56 -0
  222. package/dist/contract/normalize.d.ts.map +1 -0
  223. package/dist/contract/runtime-context.d.ts +131 -0
  224. package/dist/contract/runtime-context.d.ts.map +1 -0
  225. package/dist/contract/tool-options.d.ts +105 -0
  226. package/dist/contract/tool-options.d.ts.map +1 -0
  227. package/dist/contract/tool-view.d.ts +148 -0
  228. package/dist/contract/tool-view.d.ts.map +1 -0
  229. package/dist/declaration/declaration.d.ts.map +1 -0
  230. package/dist/durability/contract.d.ts +259 -0
  231. package/dist/durability/contract.d.ts.map +1 -0
  232. package/dist/durability/effect.d.ts +24 -0
  233. package/dist/durability/effect.d.ts.map +1 -0
  234. package/dist/durability/engine.d.ts +14 -0
  235. package/dist/durability/engine.d.ts.map +1 -0
  236. package/dist/durability/events.d.ts +103 -0
  237. package/dist/durability/events.d.ts.map +1 -0
  238. package/dist/durability/json.d.ts +3 -0
  239. package/dist/durability/json.d.ts.map +1 -0
  240. package/dist/durability/ledger.d.ts +27 -0
  241. package/dist/durability/ledger.d.ts.map +1 -0
  242. package/dist/durability/parks.d.ts +22 -0
  243. package/dist/durability/parks.d.ts.map +1 -0
  244. package/dist/durability/scheduler.d.ts +30 -0
  245. package/dist/durability/scheduler.d.ts.map +1 -0
  246. package/dist/entrypoints/agent-runtime/browser.d.ts +5 -0
  247. package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -0
  248. package/dist/entrypoints/agent-runtime/browser.js +124 -0
  249. package/dist/entrypoints/agent-runtime/coding-tools.d.ts +2 -0
  250. package/dist/entrypoints/agent-runtime/coding-tools.d.ts.map +1 -0
  251. package/dist/entrypoints/agent-runtime/coding-tools.js +22 -0
  252. package/dist/entrypoints/agent-runtime/harness.d.ts +2 -0
  253. package/dist/entrypoints/agent-runtime/harness.d.ts.map +1 -0
  254. package/dist/entrypoints/agent-runtime/harness.js +739 -0
  255. package/dist/entrypoints/agent-runtime/openrouter.d.ts +2 -0
  256. package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -0
  257. package/dist/entrypoints/agent-runtime/openrouter.js +270 -0
  258. package/dist/entrypoints/agent-runtime/sandbox.d.ts +5 -0
  259. package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -0
  260. package/dist/entrypoints/agent-runtime/sandbox.js +797 -0
  261. package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts +2 -0
  262. package/dist/entrypoints/agent-runtime/sqlite/bun.d.ts.map +1 -0
  263. package/dist/entrypoints/agent-runtime/sqlite/bun.js +44 -0
  264. package/dist/entrypoints/agent-runtime/sqlite/node.d.ts +2 -0
  265. package/dist/entrypoints/agent-runtime/sqlite/node.d.ts.map +1 -0
  266. package/dist/entrypoints/agent-runtime/sqlite/node.js +46 -0
  267. package/dist/entrypoints/agent-runtime/testing.d.ts +4 -0
  268. package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -0
  269. package/dist/entrypoints/agent-runtime/testing.js +1116 -0
  270. package/dist/entrypoints/agent-runtime.d.ts +42 -0
  271. package/dist/entrypoints/agent-runtime.d.ts.map +1 -0
  272. package/dist/entrypoints/agent-runtime.js +2670 -0
  273. package/dist/entrypoints/application/diagnostic-journal.d.ts +21 -0
  274. package/dist/entrypoints/application/diagnostic-journal.d.ts.map +1 -0
  275. package/dist/entrypoints/application/diagnostic-journal.js +492 -0
  276. package/dist/entrypoints/application/grammy.d.ts +2 -0
  277. package/dist/entrypoints/application/grammy.d.ts.map +1 -0
  278. package/dist/entrypoints/application/grammy.js +169 -0
  279. package/dist/entrypoints/application/opentelemetry.d.ts +2 -0
  280. package/dist/entrypoints/application/opentelemetry.d.ts.map +1 -0
  281. package/dist/entrypoints/application/opentelemetry.js +250 -0
  282. package/dist/entrypoints/application/schemas.d.ts +15 -0
  283. package/dist/entrypoints/application/schemas.d.ts.map +1 -0
  284. package/dist/entrypoints/application/schemas.js +27 -0
  285. package/dist/entrypoints/application.d.ts +23 -0
  286. package/dist/entrypoints/application.d.ts.map +1 -0
  287. package/dist/entrypoints/application.js +2016 -0
  288. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -0
  289. package/dist/entrypoints/bin/upgrade-cli.js +177 -0
  290. package/dist/entrypoints/cli.d.ts +44 -0
  291. package/dist/entrypoints/cli.d.ts.map +1 -0
  292. package/dist/entrypoints/cli.js +773 -0
  293. package/dist/entrypoints/contract.d.ts +12 -0
  294. package/dist/entrypoints/contract.d.ts.map +1 -0
  295. package/dist/entrypoints/contract.js +64 -0
  296. package/dist/entrypoints/declaration.d.ts +2 -0
  297. package/dist/entrypoints/declaration.d.ts.map +1 -0
  298. package/dist/entrypoints/declaration.js +183 -0
  299. package/dist/entrypoints/files.d.ts +5 -0
  300. package/dist/entrypoints/files.d.ts.map +1 -0
  301. package/dist/entrypoints/files.js +111 -0
  302. package/dist/entrypoints/geo.d.ts +3 -0
  303. package/dist/entrypoints/geo.d.ts.map +1 -0
  304. package/dist/entrypoints/geo.js +245 -0
  305. package/dist/entrypoints/google.d.ts +2 -0
  306. package/dist/entrypoints/google.d.ts.map +1 -0
  307. package/dist/entrypoints/google.js +175 -0
  308. package/dist/entrypoints/index.d.ts +17 -0
  309. package/dist/entrypoints/index.d.ts.map +1 -0
  310. package/dist/entrypoints/index.js +764 -0
  311. package/dist/entrypoints/live.d.ts +19 -0
  312. package/dist/entrypoints/live.d.ts.map +1 -0
  313. package/dist/entrypoints/live.js +302 -0
  314. package/dist/entrypoints/node.d.ts +19 -0
  315. package/dist/entrypoints/node.d.ts.map +1 -0
  316. package/dist/entrypoints/node.js +308 -0
  317. package/dist/entrypoints/oauth.d.ts +2 -0
  318. package/dist/entrypoints/oauth.d.ts.map +1 -0
  319. package/dist/entrypoints/oauth.js +170 -0
  320. package/dist/entrypoints/observability.d.ts +19 -0
  321. package/dist/entrypoints/observability.d.ts.map +1 -0
  322. package/dist/entrypoints/observability.js +567 -0
  323. package/dist/entrypoints/primitives.d.ts +3 -0
  324. package/dist/entrypoints/primitives.d.ts.map +1 -0
  325. package/dist/entrypoints/primitives.js +749 -0
  326. package/dist/entrypoints/react.d.ts +5 -0
  327. package/dist/entrypoints/react.d.ts.map +1 -0
  328. package/dist/entrypoints/react.js +403 -0
  329. package/dist/entrypoints/release.d.ts +15 -0
  330. package/dist/entrypoints/release.d.ts.map +1 -0
  331. package/dist/entrypoints/release.js +196 -0
  332. package/dist/entrypoints/remote.d.ts +9 -0
  333. package/dist/entrypoints/remote.d.ts.map +1 -0
  334. package/dist/entrypoints/remote.js +66 -0
  335. package/dist/entrypoints/server.d.ts +39 -0
  336. package/dist/entrypoints/server.d.ts.map +1 -0
  337. package/dist/entrypoints/server.js +2009 -0
  338. package/dist/entrypoints/telegram.d.ts +3 -0
  339. package/dist/entrypoints/telegram.d.ts.map +1 -0
  340. package/dist/entrypoints/telegram.js +224 -0
  341. package/dist/entrypoints/testing.d.ts +10 -0
  342. package/dist/entrypoints/testing.d.ts.map +1 -0
  343. package/dist/entrypoints/testing.js +1377 -0
  344. package/dist/entrypoints/tools/connections.d.ts +19 -0
  345. package/dist/entrypoints/tools/connections.d.ts.map +1 -0
  346. package/dist/entrypoints/tools/connections.js +1110 -0
  347. package/dist/entrypoints/tools/contract.d.ts +29 -0
  348. package/dist/entrypoints/tools/contract.d.ts.map +1 -0
  349. package/dist/entrypoints/tools/contract.js +24 -0
  350. package/dist/entrypoints/tools/invoker.d.ts +9 -0
  351. package/dist/entrypoints/tools/invoker.d.ts.map +1 -0
  352. package/dist/entrypoints/tools/invoker.js +20 -0
  353. package/dist/entrypoints/tools.d.ts +54 -0
  354. package/dist/entrypoints/tools.d.ts.map +1 -0
  355. package/dist/entrypoints/tools.js +3009 -0
  356. package/dist/entrypoints/tracking/server.d.ts +15 -0
  357. package/dist/entrypoints/tracking/server.d.ts.map +1 -0
  358. package/dist/entrypoints/tracking.d.ts +24 -0
  359. package/dist/entrypoints/tracking.d.ts.map +1 -0
  360. package/dist/entrypoints/tracking.js +1140 -0
  361. package/dist/files/boundary.d.ts.map +1 -1
  362. package/dist/files/file-io.d.ts +14 -0
  363. package/dist/files/file-io.d.ts.map +1 -0
  364. package/dist/google/google.d.ts.map +1 -0
  365. package/dist/index-0b1ess5e.js +38 -0
  366. package/dist/index-1j8pm5t0.js +412 -0
  367. package/dist/index-1zbbzgfh.js +89 -0
  368. package/dist/index-2bxbyab0.js +47 -0
  369. package/dist/index-2gxzjvyr.js +266 -0
  370. package/dist/index-35mh5bhj.js +177 -0
  371. package/dist/index-48ffdxgk.js +6 -0
  372. package/dist/index-4gcnakhx.js +82 -0
  373. package/dist/index-55hkhm67.js +343 -0
  374. package/dist/index-79z7m7dt.js +675 -0
  375. package/dist/index-7f68ghdn.js +3618 -0
  376. package/dist/index-7p1f0vp2.js +154 -0
  377. package/dist/index-83bdg97s.js +16 -0
  378. package/dist/index-863ea9jb.js +154 -0
  379. package/dist/index-8p52kd5p.js +242 -0
  380. package/dist/index-d9pk3td4.js +326 -0
  381. package/dist/index-dce5wxcq.js +63 -0
  382. package/dist/index-e01r054k.js +105 -0
  383. package/dist/index-ensd0r74.js +595 -0
  384. package/dist/index-eqqvgdb3.js +46 -0
  385. package/dist/index-gxrt5h6v.js +341 -0
  386. package/dist/index-h6eeys1v.js +211 -0
  387. package/dist/index-ham5sz8m.js +734 -0
  388. package/dist/index-het2he5g.js +1387 -0
  389. package/dist/index-hffjpmq9.js +30 -0
  390. package/dist/index-hmp4800j.js +51 -0
  391. package/dist/index-k30h66yd.js +317 -0
  392. package/dist/index-k5hsfc3j.js +31 -0
  393. package/dist/index-khtgb21r.js +92 -0
  394. package/dist/index-m9zn6cpq.js +51 -0
  395. package/dist/index-ndddxtyx.js +324 -0
  396. package/dist/index-ngfhvfpd.js +30 -0
  397. package/dist/index-np4m8hd3.js +1205 -0
  398. package/dist/index-p3vsv1fb.js +3493 -0
  399. package/dist/index-p5r7qpdd.js +85 -0
  400. package/dist/index-p9e0w8hs.js +1084 -0
  401. package/dist/index-p9sh0xx4.js +64 -0
  402. package/dist/index-paz6sgdp.js +371 -0
  403. package/dist/index-px2gm2jp.js +448 -0
  404. package/dist/index-qwhynv6x.js +103 -0
  405. package/dist/index-s812ycat.js +65 -0
  406. package/dist/index-sp1tzwnb.js +281 -0
  407. package/dist/index-t9rhjr9f.js +2306 -0
  408. package/dist/index-v260df89.js +342 -0
  409. package/dist/index-w906953s.js +946 -0
  410. package/dist/index-wdkt63w3.js +214 -0
  411. package/dist/index-wqgjfstn.js +18 -0
  412. package/dist/index-wsm5w4ee.js +1023 -0
  413. package/dist/index-xw3s75nj.js +100 -0
  414. package/dist/index-yw4fzmdz.js +268 -0
  415. package/dist/index-zfrhfn82.js +85 -0
  416. package/dist/index-znfs20ss.js +98 -0
  417. package/dist/internal/atomic-file.d.ts +23 -2
  418. package/dist/internal/atomic-file.d.ts.map +1 -1
  419. package/dist/internal/backoff.d.ts +29 -0
  420. package/dist/internal/backoff.d.ts.map +1 -0
  421. package/dist/internal/canonical-json.d.ts +21 -11
  422. package/dist/internal/canonical-json.d.ts.map +1 -1
  423. package/dist/internal/channel.d.ts.map +1 -0
  424. package/dist/internal/exclusive-lock.d.ts +51 -0
  425. package/dist/internal/exclusive-lock.d.ts.map +1 -0
  426. package/dist/internal/logger.d.ts.map +1 -0
  427. package/dist/internal/process-identity.d.ts +47 -0
  428. package/dist/internal/process-identity.d.ts.map +1 -0
  429. package/dist/internal/request.d.ts.map +1 -0
  430. package/dist/internal/stable-digest.d.ts +0 -43
  431. package/dist/internal/stable-digest.d.ts.map +1 -1
  432. package/dist/internal/typed.d.ts +0 -8
  433. package/dist/internal/typed.d.ts.map +1 -1
  434. package/dist/internal/with-exclusive-lock.d.ts +67 -0
  435. package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
  436. package/dist/internal/zod-issues.d.ts +38 -0
  437. package/dist/internal/zod-issues.d.ts.map +1 -0
  438. package/dist/json-schema/dialect.d.ts +17 -0
  439. package/dist/json-schema/dialect.d.ts.map +1 -0
  440. package/dist/json-schema/json-schema.d.ts.map +1 -0
  441. package/dist/live/watch-client.d.ts.map +1 -1
  442. package/dist/live/watch-delta.d.ts.map +1 -1
  443. package/dist/oauth/authorization-code.d.ts +57 -0
  444. package/dist/oauth/authorization-code.d.ts.map +1 -0
  445. package/dist/observability/audit.d.ts +3 -3
  446. package/dist/observability/audit.d.ts.map +1 -1
  447. package/dist/observability/bounded-logger.d.ts +1 -1
  448. package/dist/observability/bounded-logger.d.ts.map +1 -1
  449. package/dist/observability/bounded-sink.d.ts +81 -0
  450. package/dist/observability/bounded-sink.d.ts.map +1 -0
  451. package/dist/observability/context.d.ts +1 -1
  452. package/dist/observability/context.d.ts.map +1 -1
  453. package/dist/observability/event.d.ts +2 -1
  454. package/dist/observability/event.d.ts.map +1 -1
  455. package/dist/observability/work.d.ts +1 -1
  456. package/dist/observability/work.d.ts.map +1 -1
  457. package/dist/primitives/audit.d.ts +1 -1
  458. package/dist/primitives/audit.d.ts.map +1 -1
  459. package/dist/primitives/export-operation.d.ts +4 -2
  460. package/dist/primitives/export-operation.d.ts.map +1 -1
  461. package/dist/realtime/registry.d.ts +0 -5
  462. package/dist/realtime/registry.d.ts.map +1 -1
  463. package/dist/realtime/socket.d.ts +1 -1
  464. package/dist/realtime/socket.d.ts.map +1 -1
  465. package/dist/server/bun.d.ts +0 -1
  466. package/dist/server/bun.d.ts.map +1 -1
  467. package/dist/server/context-contribution.d.ts +1 -1
  468. package/dist/server/context-contribution.d.ts.map +1 -1
  469. package/dist/server/context.d.ts +2 -2
  470. package/dist/server/context.d.ts.map +1 -1
  471. package/dist/server/contract-method.d.ts +15 -0
  472. package/dist/server/contract-method.d.ts.map +1 -0
  473. package/dist/server/contract-stream.d.ts +1 -1
  474. package/dist/server/contract-stream.d.ts.map +1 -1
  475. package/dist/server/create.d.ts +8 -0
  476. package/dist/server/create.d.ts.map +1 -1
  477. package/dist/server/endpoint-dispatch.d.ts +10 -0
  478. package/dist/server/endpoint-dispatch.d.ts.map +1 -0
  479. package/dist/server/endpoint-response.d.ts +19 -0
  480. package/dist/server/endpoint-response.d.ts.map +1 -0
  481. package/dist/server/error-dispatch.d.ts +17 -1
  482. package/dist/server/error-dispatch.d.ts.map +1 -1
  483. package/dist/server/error-hook.d.ts +2 -2
  484. package/dist/server/error-hook.d.ts.map +1 -1
  485. package/dist/server/handler-state.d.ts +44 -0
  486. package/dist/server/handler-state.d.ts.map +1 -0
  487. package/dist/server/implement-registry.d.ts +54 -0
  488. package/dist/server/implement-registry.d.ts.map +1 -0
  489. package/dist/server/implement.d.ts +9 -55
  490. package/dist/server/implement.d.ts.map +1 -1
  491. package/dist/server/middleware/auth.d.ts +1 -31
  492. package/dist/server/middleware/auth.d.ts.map +1 -1
  493. package/dist/server/middleware/cors.d.ts +17 -0
  494. package/dist/server/middleware/cors.d.ts.map +1 -1
  495. package/dist/server/middleware/jwt.d.ts +31 -0
  496. package/dist/server/middleware/jwt.d.ts.map +1 -0
  497. package/dist/server/middleware/trust-fence.d.ts +1 -1
  498. package/dist/server/middleware/trust-fence.d.ts.map +1 -1
  499. package/dist/server/multipart-reader.d.ts +22 -0
  500. package/dist/server/multipart-reader.d.ts.map +1 -0
  501. package/dist/server/multipart.d.ts +1 -1
  502. package/dist/server/multipart.d.ts.map +1 -1
  503. package/dist/server/oauth/cimd.d.ts +88 -0
  504. package/dist/server/oauth/cimd.d.ts.map +1 -0
  505. package/dist/server/oauth/endpoints.d.ts +39 -0
  506. package/dist/server/oauth/endpoints.d.ts.map +1 -0
  507. package/dist/server/oauth/metadata.d.ts +28 -0
  508. package/dist/server/oauth/metadata.d.ts.map +1 -0
  509. package/dist/server/oauth/provider.d.ts +117 -0
  510. package/dist/server/oauth/provider.d.ts.map +1 -0
  511. package/dist/server/realtime.d.ts +1 -1
  512. package/dist/server/realtime.d.ts.map +1 -1
  513. package/dist/server/request-completion.d.ts +16 -0
  514. package/dist/server/request-completion.d.ts.map +1 -0
  515. package/dist/server/response-metadata.d.ts +1 -1
  516. package/dist/server/response-metadata.d.ts.map +1 -1
  517. package/dist/server/route-table.d.ts +9 -0
  518. package/dist/server/route-table.d.ts.map +1 -0
  519. package/dist/server/stream.d.ts +0 -13
  520. package/dist/server/stream.d.ts.map +1 -1
  521. package/dist/server/streaming-pump.d.ts +66 -0
  522. package/dist/server/streaming-pump.d.ts.map +1 -0
  523. package/dist/server/streaming-route.d.ts +12 -5
  524. package/dist/server/streaming-route.d.ts.map +1 -1
  525. package/dist/server/types.d.ts +10 -4
  526. package/dist/server/types.d.ts.map +1 -1
  527. package/dist/server/unix-client-bun.d.ts.map +1 -1
  528. package/dist/server/unix-client-http1.d.ts +76 -0
  529. package/dist/server/unix-client-http1.d.ts.map +1 -0
  530. package/dist/server/unix-client.d.ts.map +1 -1
  531. package/dist/testing/handler-clients.d.ts +32 -0
  532. package/dist/testing/handler-clients.d.ts.map +1 -0
  533. package/dist/testing/managed-resource-conformance-scenarios.d.ts.map +1 -1
  534. package/dist/testing/realtime-probe.d.ts +33 -0
  535. package/dist/testing/realtime-probe.d.ts.map +1 -0
  536. package/dist/testing/surface-conformance.d.ts +2 -32
  537. package/dist/testing/surface-conformance.d.ts.map +1 -1
  538. package/dist/testing/surface-manifest-digest.d.ts +44 -0
  539. package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
  540. package/dist/testing/surface-manifest.d.ts +30 -4
  541. package/dist/testing/surface-manifest.d.ts.map +1 -1
  542. package/dist/tools/agent.d.ts +1 -1
  543. package/dist/tools/agent.d.ts.map +1 -1
  544. package/dist/tools/cli/args-fields.d.ts +31 -0
  545. package/dist/tools/cli/args-fields.d.ts.map +1 -0
  546. package/dist/tools/cli/args-route.d.ts +42 -0
  547. package/dist/tools/cli/args-route.d.ts.map +1 -0
  548. package/dist/tools/cli/args-view.d.ts +32 -0
  549. package/dist/tools/cli/args-view.d.ts.map +1 -0
  550. package/dist/tools/cli/args.d.ts +80 -0
  551. package/dist/tools/cli/args.d.ts.map +1 -0
  552. package/dist/tools/cli/argument-error.d.ts +5 -0
  553. package/dist/tools/cli/argument-error.d.ts.map +1 -0
  554. package/dist/tools/cli/checkpoint.d.ts +24 -0
  555. package/dist/tools/cli/checkpoint.d.ts.map +1 -0
  556. package/dist/tools/cli/command.d.ts +70 -0
  557. package/dist/tools/cli/command.d.ts.map +1 -0
  558. package/dist/tools/cli/config.d.ts +90 -0
  559. package/dist/tools/cli/config.d.ts.map +1 -0
  560. package/dist/tools/cli/create-cli.d.ts +36 -0
  561. package/dist/tools/cli/create-cli.d.ts.map +1 -0
  562. package/dist/tools/cli/download.d.ts +8 -0
  563. package/dist/tools/cli/download.d.ts.map +1 -0
  564. package/dist/tools/cli/format.d.ts +50 -0
  565. package/dist/tools/cli/format.d.ts.map +1 -0
  566. package/dist/tools/cli/help.d.ts +24 -0
  567. package/dist/tools/cli/help.d.ts.map +1 -0
  568. package/dist/tools/cli/installer.d.ts +34 -0
  569. package/dist/tools/cli/installer.d.ts.map +1 -0
  570. package/dist/tools/cli/invoke.d.ts +144 -0
  571. package/dist/tools/cli/invoke.d.ts.map +1 -0
  572. package/dist/tools/cli/io.d.ts +10 -0
  573. package/dist/tools/cli/io.d.ts.map +1 -0
  574. package/dist/tools/cli/managed-surface.d.ts +30 -0
  575. package/dist/tools/cli/managed-surface.d.ts.map +1 -0
  576. package/dist/tools/cli/manifest.d.ts +80 -0
  577. package/dist/tools/cli/manifest.d.ts.map +1 -0
  578. package/dist/tools/cli/policy.d.ts +27 -0
  579. package/dist/tools/cli/policy.d.ts.map +1 -0
  580. package/dist/tools/cli/prepare.d.ts +14 -0
  581. package/dist/tools/cli/prepare.d.ts.map +1 -0
  582. package/dist/tools/cli/profile.d.ts +40 -0
  583. package/dist/tools/cli/profile.d.ts.map +1 -0
  584. package/dist/tools/cli/run-managed.d.ts +5 -0
  585. package/dist/tools/cli/run-managed.d.ts.map +1 -0
  586. package/dist/tools/cli/run-native.d.ts +9 -0
  587. package/dist/tools/cli/run-native.d.ts.map +1 -0
  588. package/dist/tools/cli/session.d.ts +40 -0
  589. package/dist/tools/cli/session.d.ts.map +1 -0
  590. package/dist/tools/cli/signature.d.ts +81 -0
  591. package/dist/tools/cli/signature.d.ts.map +1 -0
  592. package/dist/tools/cli/stream.d.ts +93 -0
  593. package/dist/tools/cli/stream.d.ts.map +1 -0
  594. package/dist/tools/cli/update.d.ts +145 -0
  595. package/dist/tools/cli/update.d.ts.map +1 -0
  596. package/dist/tools/cli/view.d.ts +12 -0
  597. package/dist/tools/cli/view.d.ts.map +1 -0
  598. package/dist/tools/cli/wait.d.ts +54 -0
  599. package/dist/tools/cli/wait.d.ts.map +1 -0
  600. package/dist/tools/connections/runtime.d.ts +1 -1
  601. package/dist/tools/connections/runtime.d.ts.map +1 -1
  602. package/dist/tools/connections/types.d.ts +3 -3
  603. package/dist/tools/connections/types.d.ts.map +1 -1
  604. package/dist/tools/durability-context.d.ts +1 -1
  605. package/dist/tools/durability-context.d.ts.map +1 -1
  606. package/dist/tools/execute-args.d.ts +23 -0
  607. package/dist/tools/execute-args.d.ts.map +1 -0
  608. package/dist/tools/execute-hooks.d.ts +146 -0
  609. package/dist/tools/execute-hooks.d.ts.map +1 -0
  610. package/dist/tools/execute-result.d.ts +40 -0
  611. package/dist/tools/execute-result.d.ts.map +1 -0
  612. package/dist/tools/execute.d.ts +31 -193
  613. package/dist/tools/execute.d.ts.map +1 -1
  614. package/dist/tools/internal/surface-projector.d.ts +9 -6
  615. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  616. package/dist/tools/internal/tool-view.d.ts +41 -0
  617. package/dist/tools/internal/tool-view.d.ts.map +1 -0
  618. package/dist/tools/invoker.d.ts +13 -4
  619. package/dist/tools/invoker.d.ts.map +1 -1
  620. package/dist/tools/lifecycle.d.ts +1 -1
  621. package/dist/tools/lifecycle.d.ts.map +1 -1
  622. package/dist/tools/list-names.d.ts +3 -3
  623. package/dist/tools/list-names.d.ts.map +1 -1
  624. package/dist/tools/manifest.d.ts +2 -2
  625. package/dist/tools/manifest.d.ts.map +1 -1
  626. package/dist/tools/mcp/app.d.ts +62 -0
  627. package/dist/tools/mcp/app.d.ts.map +1 -0
  628. package/dist/tools/mcp/catalog.d.ts +68 -0
  629. package/dist/tools/mcp/catalog.d.ts.map +1 -0
  630. package/dist/tools/mcp/handler.d.ts +46 -0
  631. package/dist/tools/mcp/handler.d.ts.map +1 -0
  632. package/dist/tools/mcp/mount.d.ts +152 -0
  633. package/dist/tools/mcp/mount.d.ts.map +1 -0
  634. package/dist/tools/mcp/prepare.d.ts +76 -0
  635. package/dist/tools/mcp/prepare.d.ts.map +1 -0
  636. package/dist/tools/mcp/progress.d.ts +46 -0
  637. package/dist/tools/mcp/progress.d.ts.map +1 -0
  638. package/dist/tools/mcp/register.d.ts +36 -0
  639. package/dist/tools/mcp/register.d.ts.map +1 -0
  640. package/dist/tools/mcp/round-context.d.ts +38 -0
  641. package/dist/tools/mcp/round-context.d.ts.map +1 -0
  642. package/dist/tools/mcp/round-policy.d.ts +33 -0
  643. package/dist/tools/mcp/round-policy.d.ts.map +1 -0
  644. package/dist/tools/mcp/round.d.ts +53 -0
  645. package/dist/tools/mcp/round.d.ts.map +1 -0
  646. package/dist/tools/mcp/runtime-tools.d.ts +25 -0
  647. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -0
  648. package/dist/tools/mcp/stdio-signals.d.ts +33 -0
  649. package/dist/tools/mcp/stdio-signals.d.ts.map +1 -0
  650. package/dist/tools/mcp/stdio.d.ts +20 -0
  651. package/dist/tools/mcp/stdio.d.ts.map +1 -0
  652. package/dist/tools/mcp/trace.d.ts +12 -0
  653. package/dist/tools/mcp/trace.d.ts.map +1 -0
  654. package/dist/tools/mount.d.ts +14 -7
  655. package/dist/tools/mount.d.ts.map +1 -1
  656. package/dist/tools/native-definition.d.ts +4 -3
  657. package/dist/tools/native-definition.d.ts.map +1 -1
  658. package/dist/tools/operations/async-operation-binding-types.d.ts +127 -0
  659. package/dist/tools/operations/async-operation-binding-types.d.ts.map +1 -0
  660. package/dist/tools/operations/async-operation-binding.d.ts +28 -0
  661. package/dist/tools/operations/async-operation-binding.d.ts.map +1 -0
  662. package/dist/tools/operations/async-operation-canonical-types.d.ts +110 -0
  663. package/dist/tools/operations/async-operation-canonical-types.d.ts.map +1 -0
  664. package/dist/tools/operations/async-operation-canonical.d.ts +7 -0
  665. package/dist/tools/operations/async-operation-canonical.d.ts.map +1 -0
  666. package/dist/tools/operations/async-operation-contract.d.ts.map +1 -0
  667. package/dist/tools/operations/async-operation-id.d.ts +23 -0
  668. package/dist/tools/operations/async-operation-id.d.ts.map +1 -0
  669. package/dist/tools/operations/async-operation-runtime-tools.d.ts +41 -0
  670. package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -0
  671. package/dist/tools/operations/async-operation-runtime-types.d.ts +69 -0
  672. package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -0
  673. package/dist/tools/operations/async-operation-runtime.d.ts +5 -0
  674. package/dist/tools/operations/async-operation-runtime.d.ts.map +1 -0
  675. package/dist/tools/operations/define-wait-tool.d.ts +22 -0
  676. package/dist/tools/operations/define-wait-tool.d.ts.map +1 -0
  677. package/dist/tools/operations/mount-wait.d.ts.map +1 -0
  678. package/dist/tools/operations/wait-core.d.ts.map +1 -0
  679. package/dist/tools/remote.d.ts +1 -1
  680. package/dist/tools/remote.d.ts.map +1 -1
  681. package/dist/tools/runtime-tool.d.ts +13 -4
  682. package/dist/tools/runtime-tool.d.ts.map +1 -1
  683. package/dist/tools/schema/coerce.d.ts.map +1 -0
  684. package/dist/tools/schema/flatten-join.d.ts.map +1 -0
  685. package/dist/tools/schema/flatten.d.ts.map +1 -0
  686. package/dist/tools/schema/portable-formats.d.ts.map +1 -0
  687. package/dist/tools/schema/presentation.d.ts +24 -0
  688. package/dist/tools/schema/presentation.d.ts.map +1 -0
  689. package/dist/tools/schema/schema.d.ts.map +1 -0
  690. package/dist/tools/schema/untyped-properties.d.ts.map +1 -0
  691. package/dist/tools/surface.d.ts +2 -3
  692. package/dist/tools/surface.d.ts.map +1 -1
  693. package/dist/tools/tool-logger.d.ts +1 -1
  694. package/dist/tools/tool-logger.d.ts.map +1 -1
  695. package/dist/tools/toolkit.d.ts +4 -4
  696. package/dist/tools/toolkit.d.ts.map +1 -1
  697. package/dist/tools/transfer/define-download-tool.d.ts +18 -0
  698. package/dist/tools/transfer/define-download-tool.d.ts.map +1 -0
  699. package/dist/tools/transfer/define-upload-tool.d.ts +16 -0
  700. package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -0
  701. package/dist/tools/transfer/define-view-file-tool.d.ts +10 -0
  702. package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -0
  703. package/dist/tools/transfer/download-core.d.ts +20 -0
  704. package/dist/tools/transfer/download-core.d.ts.map +1 -0
  705. package/dist/tools/transfer/managed-file-error.d.ts +6 -0
  706. package/dist/tools/transfer/managed-file-error.d.ts.map +1 -0
  707. package/dist/tools/transfer/mount-download.d.ts +41 -0
  708. package/dist/tools/transfer/mount-download.d.ts.map +1 -0
  709. package/dist/tools/transfer/mount-upload.d.ts +21 -0
  710. package/dist/tools/transfer/mount-upload.d.ts.map +1 -0
  711. package/dist/tools/transfer/native-result.d.ts.map +1 -0
  712. package/dist/tools/transfer/upload-core.d.ts +4 -0
  713. package/dist/tools/transfer/upload-core.d.ts.map +1 -0
  714. package/dist/tools/transfer/view-file-contract.d.ts.map +1 -0
  715. package/dist/tools/transfer/view-file.d.ts +62 -0
  716. package/dist/tools/transfer/view-file.d.ts.map +1 -0
  717. package/dist/tools/transports.d.ts +1 -1
  718. package/dist/tools/transports.d.ts.map +1 -1
  719. package/dist/tracking/client-listeners.d.ts +30 -0
  720. package/dist/tracking/client-listeners.d.ts.map +1 -0
  721. package/dist/tracking/client-visit.d.ts +61 -0
  722. package/dist/tracking/client-visit.d.ts.map +1 -0
  723. package/dist/tracking/client.d.ts +3 -2
  724. package/dist/tracking/client.d.ts.map +1 -1
  725. package/dist/tracking/contract.d.ts +1 -1
  726. package/dist/tracking/contract.d.ts.map +1 -1
  727. package/llms/agent-runtime-browser.txt +33 -0
  728. package/llms/agent-runtime-coding-tools.txt +58 -0
  729. package/llms/agent-runtime-harness.txt +45 -0
  730. package/llms/agent-runtime-openrouter.txt +22 -0
  731. package/llms/agent-runtime-sandbox.txt +159 -0
  732. package/llms/agent-runtime-sqlite-bun.txt +29 -0
  733. package/llms/agent-runtime-sqlite-node.txt +26 -0
  734. package/llms/agent-runtime-testing.txt +30 -0
  735. package/llms/agent-runtime.2.txt +550 -0
  736. package/llms/agent-runtime.3.txt +311 -0
  737. package/llms/agent-runtime.txt +893 -0
  738. package/llms/application-diagnostic-journal.txt +30 -0
  739. package/llms/application-grammy.txt +27 -0
  740. package/llms/application-opentelemetry.txt +27 -0
  741. package/llms/application-schemas.txt +42 -0
  742. package/llms/application.2.txt +487 -0
  743. package/llms/application.txt +886 -0
  744. package/llms/cli.2.txt +80 -0
  745. package/llms/cli.txt +948 -0
  746. package/llms/contract.txt +606 -0
  747. package/llms/declaration.txt +286 -0
  748. package/llms/files.txt +33 -0
  749. package/llms/geo.txt +114 -0
  750. package/llms/google.txt +27 -0
  751. package/llms/live.txt +471 -0
  752. package/llms/node.txt +43 -0
  753. package/llms/oauth.txt +136 -0
  754. package/llms/observability.txt +893 -0
  755. package/llms/primitives.txt +158 -0
  756. package/llms/react.txt +184 -0
  757. package/llms/release.txt +176 -0
  758. package/llms/remote.txt +25 -0
  759. package/llms/server.2.txt +361 -0
  760. package/llms/server.3.txt +1031 -0
  761. package/llms/server.4.txt +905 -0
  762. package/llms/server.5.txt +250 -0
  763. package/llms/server.txt +996 -0
  764. package/llms/stitchkit.2.txt +836 -0
  765. package/llms/stitchkit.3.txt +147 -0
  766. package/llms/stitchkit.txt +260 -0
  767. package/llms/telegram.txt +30 -0
  768. package/llms/testing.txt +676 -0
  769. package/llms/tools-connections.txt +45 -0
  770. package/llms/tools-contract.txt +9 -0
  771. package/llms/tools-invoker.txt +9 -0
  772. package/llms/tools.2.txt +647 -0
  773. package/llms/tools.3.txt +288 -0
  774. package/llms/tools.txt +966 -0
  775. package/llms/tracking-server.txt +32 -0
  776. package/llms/tracking.txt +263 -0
  777. package/llms/upgrading-0.37.0-0.50.0.txt +947 -0
  778. package/llms/upgrading-0.53.0-0.67.0.txt +1174 -0
  779. package/llms/upgrading-0.68.0-0.94.0.txt +1159 -0
  780. package/llms/upgrading.txt +215 -0
  781. package/llms-full.txt +312 -77
  782. package/llms.txt +54 -5
  783. package/package.json +84 -83
  784. package/dist/agent-runtime/durability-contract.d.ts +0 -176
  785. package/dist/agent-runtime/durability-contract.d.ts.map +0 -1
  786. package/dist/agent-runtime/durability-json.d.ts +0 -3
  787. package/dist/agent-runtime/durability-json.d.ts.map +0 -1
  788. package/dist/agent-runtime/durability-ledger.d.ts +0 -16
  789. package/dist/agent-runtime/durability-ledger.d.ts.map +0 -1
  790. package/dist/agent-runtime/durability-scheduler.d.ts +0 -29
  791. package/dist/agent-runtime/durability-scheduler.d.ts.map +0 -1
  792. package/dist/agent-runtime/durability.d.ts +0 -14
  793. package/dist/agent-runtime/durability.d.ts.map +0 -1
  794. package/dist/agent-runtime/store-driver.d.ts +0 -814
  795. package/dist/agent-runtime/store-driver.d.ts.map +0 -1
  796. package/dist/agent-runtime-browser.d.ts +0 -5
  797. package/dist/agent-runtime-browser.d.ts.map +0 -1
  798. package/dist/agent-runtime-browser.js +0 -124
  799. package/dist/agent-runtime-coding-tools.d.ts +0 -2
  800. package/dist/agent-runtime-coding-tools.d.ts.map +0 -1
  801. package/dist/agent-runtime-coding-tools.js +0 -23
  802. package/dist/agent-runtime-harness.d.ts +0 -2
  803. package/dist/agent-runtime-harness.d.ts.map +0 -1
  804. package/dist/agent-runtime-harness.js +0 -729
  805. package/dist/agent-runtime-openrouter.d.ts +0 -29
  806. package/dist/agent-runtime-openrouter.d.ts.map +0 -1
  807. package/dist/agent-runtime-openrouter.js +0 -270
  808. package/dist/agent-runtime-sandbox.d.ts +0 -5
  809. package/dist/agent-runtime-sandbox.d.ts.map +0 -1
  810. package/dist/agent-runtime-sandbox.js +0 -798
  811. package/dist/agent-runtime-sqlite-bun.d.ts +0 -11
  812. package/dist/agent-runtime-sqlite-bun.d.ts.map +0 -1
  813. package/dist/agent-runtime-sqlite-bun.js +0 -42
  814. package/dist/agent-runtime-sqlite-node.d.ts +0 -11
  815. package/dist/agent-runtime-sqlite-node.d.ts.map +0 -1
  816. package/dist/agent-runtime-sqlite-node.js +0 -44
  817. package/dist/agent-runtime-testing.d.ts +0 -3
  818. package/dist/agent-runtime-testing.d.ts.map +0 -1
  819. package/dist/agent-runtime-testing.js +0 -156
  820. package/dist/agent-runtime.d.ts +0 -38
  821. package/dist/agent-runtime.d.ts.map +0 -1
  822. package/dist/agent-runtime.js +0 -2607
  823. package/dist/application/channel.d.ts.map +0 -1
  824. package/dist/application-diagnostic-journal.d.ts +0 -21
  825. package/dist/application-diagnostic-journal.d.ts.map +0 -1
  826. package/dist/application-diagnostic-journal.js +0 -632
  827. package/dist/application-grammy.d.ts +0 -2
  828. package/dist/application-grammy.d.ts.map +0 -1
  829. package/dist/application-grammy.js +0 -169
  830. package/dist/application-opentelemetry.d.ts +0 -2
  831. package/dist/application-opentelemetry.d.ts.map +0 -1
  832. package/dist/application-opentelemetry.js +0 -250
  833. package/dist/application-schemas.d.ts +0 -15
  834. package/dist/application-schemas.d.ts.map +0 -1
  835. package/dist/application-schemas.js +0 -27
  836. package/dist/application.d.ts +0 -22
  837. package/dist/application.d.ts.map +0 -1
  838. package/dist/application.js +0 -1977
  839. package/dist/cli.d.ts +0 -41
  840. package/dist/cli.d.ts.map +0 -1
  841. package/dist/cli.js +0 -753
  842. package/dist/contract/index.d.ts +0 -8
  843. package/dist/contract/index.d.ts.map +0 -1
  844. package/dist/contract/index.js +0 -55
  845. package/dist/declaration.d.ts.map +0 -1
  846. package/dist/declaration.js +0 -183
  847. package/dist/files.d.ts +0 -3
  848. package/dist/files.d.ts.map +0 -1
  849. package/dist/files.js +0 -15
  850. package/dist/geo.d.ts +0 -3
  851. package/dist/geo.d.ts.map +0 -1
  852. package/dist/geo.js +0 -245
  853. package/dist/google.d.ts.map +0 -1
  854. package/dist/google.js +0 -175
  855. package/dist/index-0a349c33.js +0 -470
  856. package/dist/index-0j3vcp5m.js +0 -28
  857. package/dist/index-2c2bjw3s.js +0 -51
  858. package/dist/index-2na0qrfn.js +0 -214
  859. package/dist/index-2qzskm8h.js +0 -63
  860. package/dist/index-3bmnp41g.js +0 -2169
  861. package/dist/index-3xwxfj4z.js +0 -334
  862. package/dist/index-4fpa9dy2.js +0 -51
  863. package/dist/index-6kyksz9y.js +0 -268
  864. package/dist/index-77fekveh.js +0 -44
  865. package/dist/index-7gnkny4z.js +0 -326
  866. package/dist/index-7zbps32p.js +0 -89
  867. package/dist/index-9f8ztey6.js +0 -588
  868. package/dist/index-a11g2kry.js +0 -866
  869. package/dist/index-a916km3r.js +0 -45
  870. package/dist/index-actkayzn.js +0 -367
  871. package/dist/index-bn2cjajt.js +0 -524
  872. package/dist/index-bx75zwt7.js +0 -63
  873. package/dist/index-cby4ar3v.js +0 -46
  874. package/dist/index-cnyk6te3.js +0 -77
  875. package/dist/index-cxqhvq21.js +0 -413
  876. package/dist/index-e0znv5gn.js +0 -176
  877. package/dist/index-e42wzzz5.js +0 -154
  878. package/dist/index-f477k430.js +0 -324
  879. package/dist/index-f9mb610r.js +0 -177
  880. package/dist/index-fadnxwna.js +0 -1046
  881. package/dist/index-fq77yfzc.js +0 -1303
  882. package/dist/index-h9etkkyk.js +0 -1126
  883. package/dist/index-hrbajay7.js +0 -1196
  884. package/dist/index-kw9t5ayn.js +0 -507
  885. package/dist/index-mzvgxp0n.js +0 -80
  886. package/dist/index-n0f51dfn.js +0 -3170
  887. package/dist/index-p13mwz16.js +0 -16
  888. package/dist/index-s8cnx02s.js +0 -90
  889. package/dist/index-sr93cwf9.js +0 -325
  890. package/dist/index-tmwcrptx.js +0 -85
  891. package/dist/index-v5573g1k.js +0 -142
  892. package/dist/index-vjpvjqpn.js +0 -86
  893. package/dist/index-vk3kq9sb.js +0 -3344
  894. package/dist/index-wc4x00bn.js +0 -103
  895. package/dist/index-wnfk50r0.js +0 -211
  896. package/dist/index-yewwh1w4.js +0 -647
  897. package/dist/index-yn8remb1.js +0 -290
  898. package/dist/index-ywd0y6m1.js +0 -394
  899. package/dist/index-zwkgfq1s.js +0 -345
  900. package/dist/index.d.ts +0 -14
  901. package/dist/index.d.ts.map +0 -1
  902. package/dist/index.js +0 -632
  903. package/dist/internal/errors.d.ts +0 -92
  904. package/dist/internal/errors.d.ts.map +0 -1
  905. package/dist/internal/observability-sink.d.ts +0 -81
  906. package/dist/internal/observability-sink.d.ts.map +0 -1
  907. package/dist/live.d.ts +0 -19
  908. package/dist/live.d.ts.map +0 -1
  909. package/dist/live.js +0 -282
  910. package/dist/logger.d.ts.map +0 -1
  911. package/dist/node.d.ts +0 -18
  912. package/dist/node.d.ts.map +0 -1
  913. package/dist/node.js +0 -303
  914. package/dist/oauth.d.ts +0 -57
  915. package/dist/oauth.d.ts.map +0 -1
  916. package/dist/oauth.js +0 -170
  917. package/dist/observability/index.d.ts +0 -19
  918. package/dist/observability/index.d.ts.map +0 -1
  919. package/dist/observability/index.js +0 -569
  920. package/dist/primitives.d.ts +0 -3
  921. package/dist/primitives.d.ts.map +0 -1
  922. package/dist/primitives.js +0 -754
  923. package/dist/react.d.ts +0 -5
  924. package/dist/react.d.ts.map +0 -1
  925. package/dist/react.js +0 -403
  926. package/dist/release.d.ts +0 -15
  927. package/dist/release.d.ts.map +0 -1
  928. package/dist/release.js +0 -196
  929. package/dist/remote.d.ts +0 -9
  930. package/dist/remote.d.ts.map +0 -1
  931. package/dist/remote.js +0 -88
  932. package/dist/retained.d.ts.map +0 -1
  933. package/dist/server/file-state-store.d.ts +0 -23
  934. package/dist/server/file-state-store.d.ts.map +0 -1
  935. package/dist/server/index.d.ts +0 -36
  936. package/dist/server/index.d.ts.map +0 -1
  937. package/dist/server/index.js +0 -1745
  938. package/dist/server/request.d.ts.map +0 -1
  939. package/dist/telegram.d.ts +0 -3
  940. package/dist/telegram.d.ts.map +0 -1
  941. package/dist/telegram.js +0 -224
  942. package/dist/testing/agent-store-conformance.d.ts +0 -40
  943. package/dist/testing/agent-store-conformance.d.ts.map +0 -1
  944. package/dist/testing.d.ts +0 -39
  945. package/dist/testing.d.ts.map +0 -1
  946. package/dist/testing.js +0 -2209
  947. package/dist/tool-invoker.d.ts +0 -9
  948. package/dist/tool-invoker.d.ts.map +0 -1
  949. package/dist/tool-invoker.js +0 -21
  950. package/dist/tools/async-operation-contract.d.ts.map +0 -1
  951. package/dist/tools/async-operation.d.ts +0 -332
  952. package/dist/tools/async-operation.d.ts.map +0 -1
  953. package/dist/tools/cli-args.d.ts +0 -143
  954. package/dist/tools/cli-args.d.ts.map +0 -1
  955. package/dist/tools/cli-checkpoint.d.ts +0 -24
  956. package/dist/tools/cli-checkpoint.d.ts.map +0 -1
  957. package/dist/tools/cli-command.d.ts +0 -70
  958. package/dist/tools/cli-command.d.ts.map +0 -1
  959. package/dist/tools/cli-format.d.ts +0 -49
  960. package/dist/tools/cli-format.d.ts.map +0 -1
  961. package/dist/tools/cli-installer.d.ts +0 -34
  962. package/dist/tools/cli-installer.d.ts.map +0 -1
  963. package/dist/tools/cli-invoke.d.ts +0 -143
  964. package/dist/tools/cli-invoke.d.ts.map +0 -1
  965. package/dist/tools/cli-manifest.d.ts +0 -80
  966. package/dist/tools/cli-manifest.d.ts.map +0 -1
  967. package/dist/tools/cli-policy.d.ts +0 -27
  968. package/dist/tools/cli-policy.d.ts.map +0 -1
  969. package/dist/tools/cli-profile.d.ts +0 -40
  970. package/dist/tools/cli-profile.d.ts.map +0 -1
  971. package/dist/tools/cli-signature.d.ts +0 -81
  972. package/dist/tools/cli-signature.d.ts.map +0 -1
  973. package/dist/tools/cli-stream.d.ts +0 -93
  974. package/dist/tools/cli-stream.d.ts.map +0 -1
  975. package/dist/tools/cli-update.d.ts +0 -126
  976. package/dist/tools/cli-update.d.ts.map +0 -1
  977. package/dist/tools/cli-view.d.ts +0 -12
  978. package/dist/tools/cli-view.d.ts.map +0 -1
  979. package/dist/tools/cli-wait.d.ts +0 -54
  980. package/dist/tools/cli-wait.d.ts.map +0 -1
  981. package/dist/tools/cli.d.ts +0 -94
  982. package/dist/tools/cli.d.ts.map +0 -1
  983. package/dist/tools/coerce.d.ts.map +0 -1
  984. package/dist/tools/connections/index.d.ts +0 -20
  985. package/dist/tools/connections/index.d.ts.map +0 -1
  986. package/dist/tools/connections/index.js +0 -1107
  987. package/dist/tools/define-download-tool.d.ts +0 -18
  988. package/dist/tools/define-download-tool.d.ts.map +0 -1
  989. package/dist/tools/define-upload-tool.d.ts +0 -16
  990. package/dist/tools/define-upload-tool.d.ts.map +0 -1
  991. package/dist/tools/define-view-file-tool.d.ts +0 -10
  992. package/dist/tools/define-view-file-tool.d.ts.map +0 -1
  993. package/dist/tools/define-wait-tool.d.ts +0 -22
  994. package/dist/tools/define-wait-tool.d.ts.map +0 -1
  995. package/dist/tools/download-core.d.ts +0 -20
  996. package/dist/tools/download-core.d.ts.map +0 -1
  997. package/dist/tools/flatten-join.d.ts.map +0 -1
  998. package/dist/tools/flatten.d.ts.map +0 -1
  999. package/dist/tools/json-schema-dialect.d.ts +0 -17
  1000. package/dist/tools/json-schema-dialect.d.ts.map +0 -1
  1001. package/dist/tools/json-schema.d.ts.map +0 -1
  1002. package/dist/tools/managed-file-error.d.ts +0 -6
  1003. package/dist/tools/managed-file-error.d.ts.map +0 -1
  1004. package/dist/tools/mcp-app.d.ts +0 -62
  1005. package/dist/tools/mcp-app.d.ts.map +0 -1
  1006. package/dist/tools/mcp-catalog.d.ts +0 -68
  1007. package/dist/tools/mcp-catalog.d.ts.map +0 -1
  1008. package/dist/tools/mcp-handler.d.ts +0 -46
  1009. package/dist/tools/mcp-handler.d.ts.map +0 -1
  1010. package/dist/tools/mcp-prepare.d.ts +0 -75
  1011. package/dist/tools/mcp-prepare.d.ts.map +0 -1
  1012. package/dist/tools/mcp-progress.d.ts +0 -46
  1013. package/dist/tools/mcp-progress.d.ts.map +0 -1
  1014. package/dist/tools/mcp-round-policy.d.ts +0 -33
  1015. package/dist/tools/mcp-round-policy.d.ts.map +0 -1
  1016. package/dist/tools/mcp-round.d.ts +0 -61
  1017. package/dist/tools/mcp-round.d.ts.map +0 -1
  1018. package/dist/tools/mcp-stdio-signals.d.ts +0 -33
  1019. package/dist/tools/mcp-stdio-signals.d.ts.map +0 -1
  1020. package/dist/tools/mcp-stdio.d.ts +0 -20
  1021. package/dist/tools/mcp-stdio.d.ts.map +0 -1
  1022. package/dist/tools/mcp-trace.d.ts +0 -12
  1023. package/dist/tools/mcp-trace.d.ts.map +0 -1
  1024. package/dist/tools/mcp.d.ts +0 -152
  1025. package/dist/tools/mcp.d.ts.map +0 -1
  1026. package/dist/tools/mount-download.d.ts +0 -41
  1027. package/dist/tools/mount-download.d.ts.map +0 -1
  1028. package/dist/tools/mount-upload.d.ts +0 -21
  1029. package/dist/tools/mount-upload.d.ts.map +0 -1
  1030. package/dist/tools/mount-wait.d.ts.map +0 -1
  1031. package/dist/tools/native-mcp.d.ts +0 -20
  1032. package/dist/tools/native-mcp.d.ts.map +0 -1
  1033. package/dist/tools/native-result.d.ts.map +0 -1
  1034. package/dist/tools/oauth-metadata.d.ts +0 -28
  1035. package/dist/tools/oauth-metadata.d.ts.map +0 -1
  1036. package/dist/tools/oauth-provider.d.ts +0 -184
  1037. package/dist/tools/oauth-provider.d.ts.map +0 -1
  1038. package/dist/tools/portable-formats.d.ts.map +0 -1
  1039. package/dist/tools/presentation.d.ts +0 -22
  1040. package/dist/tools/presentation.d.ts.map +0 -1
  1041. package/dist/tools/schema.d.ts.map +0 -1
  1042. package/dist/tools/untyped-properties.d.ts.map +0 -1
  1043. package/dist/tools/upload-core.d.ts +0 -4
  1044. package/dist/tools/upload-core.d.ts.map +0 -1
  1045. package/dist/tools/view-file-contract.d.ts.map +0 -1
  1046. package/dist/tools/view-file.d.ts +0 -62
  1047. package/dist/tools/view-file.d.ts.map +0 -1
  1048. package/dist/tools/wait-core.d.ts.map +0 -1
  1049. package/dist/tools-contract.d.ts +0 -29
  1050. package/dist/tools-contract.d.ts.map +0 -1
  1051. package/dist/tools-contract.js +0 -24
  1052. package/dist/tools.d.ts +0 -50
  1053. package/dist/tools.d.ts.map +0 -1
  1054. package/dist/tools.js +0 -2930
  1055. package/dist/tracking-server.d.ts +0 -15
  1056. package/dist/tracking-server.d.ts.map +0 -1
  1057. package/dist/tracking.d.ts +0 -24
  1058. package/dist/tracking.d.ts.map +0 -1
  1059. package/dist/tracking.js +0 -1092
  1060. package/dist/upgrade-cli.d.ts.map +0 -1
  1061. package/dist/upgrade-cli.js +0 -177
  1062. /package/dist/{retained.d.ts → browser/retained.d.ts} +0 -0
  1063. /package/dist/{declaration.d.ts → declaration/declaration.d.ts} +0 -0
  1064. /package/dist/{upgrade-cli.d.ts → entrypoints/bin/upgrade-cli.d.ts} +0 -0
  1065. /package/dist/{tracking-server.js → entrypoints/tracking/server.js} +0 -0
  1066. /package/dist/{google.d.ts → google/google.d.ts} +0 -0
  1067. /package/dist/{index-pq95qkbf.js → index-5jm36zv1.js} +0 -0
  1068. /package/dist/{application → internal}/channel.d.ts +0 -0
  1069. /package/dist/{logger.d.ts → internal/logger.d.ts} +0 -0
  1070. /package/dist/{server → internal}/request.d.ts +0 -0
  1071. /package/dist/{tools → json-schema}/json-schema.d.ts +0 -0
  1072. /package/dist/tools/{async-operation-contract.d.ts → operations/async-operation-contract.d.ts} +0 -0
  1073. /package/dist/tools/{mount-wait.d.ts → operations/mount-wait.d.ts} +0 -0
  1074. /package/dist/tools/{wait-core.d.ts → operations/wait-core.d.ts} +0 -0
  1075. /package/dist/tools/{coerce.d.ts → schema/coerce.d.ts} +0 -0
  1076. /package/dist/tools/{flatten-join.d.ts → schema/flatten-join.d.ts} +0 -0
  1077. /package/dist/tools/{flatten.d.ts → schema/flatten.d.ts} +0 -0
  1078. /package/dist/tools/{portable-formats.d.ts → schema/portable-formats.d.ts} +0 -0
  1079. /package/dist/tools/{schema.d.ts → schema/schema.d.ts} +0 -0
  1080. /package/dist/tools/{untyped-properties.d.ts → schema/untyped-properties.d.ts} +0 -0
  1081. /package/dist/tools/{native-result.d.ts → transfer/native-result.d.ts} +0 -0
  1082. /package/dist/tools/{view-file-contract.d.ts → transfer/view-file-contract.d.ts} +0 -0
@@ -0,0 +1,886 @@
1
+ # stitchkit/application — stitchkit docs slice, part 1 of 2
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
+ > Continues in `llms/application.2.txt`.
6
+
7
+ Parts of this slice:
8
+ - `llms/application.txt`: Guide: Managed application kernel (docs/guide/application-kernel.md)
9
+ - `llms/application.2.txt`: Guide: Application migration recipes (docs/guide/application-migration-recipes.md) · API reference: `stitchkit/application` (docs/api/reference.md)
10
+
11
+ ==============================================================================
12
+ # Guide: Managed application kernel (docs/guide/application-kernel.md)
13
+ ==============================================================================
14
+
15
+ ---
16
+ title: Managed application kernel
17
+ description: Compose process-local resources, schedules, readiness, drain and optional provider adapters without building a second job platform.
18
+ type: architecture
19
+ status: active
20
+ created: 2026-08-23
21
+ updated: 2026-09-04 14:11 +07:00
22
+ ---
23
+
24
+ # Managed application kernel
25
+
26
+ > **Maturity: evolving.** This surface is still finding its shape and may be
27
+ > redefined in any minor release — always with a `### ⚠️ Breaking changes` entry
28
+ > and a migration section, never silently. The server, contract and client
29
+ > surfaces it composes are stable.
30
+
31
+ Use `stitchkit/application` when several process-local resources must become
32
+ ready and shut down as one application. Keep using the lower-level server and
33
+ signal APIs when one managed server is already the complete lifecycle boundary.
34
+
35
+ The neutral entrypoint is server-only and works on Bun and Node ≥ 22. It does
36
+ not import provider SDKs.
37
+
38
+ For complete database, poller, queue-consumer and operational-publisher
39
+ cutovers, continue with the executable
40
+ [application migration recipes](./application-migration-recipes.md).
41
+
42
+ ## Minimal composition
43
+
44
+ ```ts
45
+ import {
46
+ createApplication,
47
+ createManagedSchedule,
48
+ defineManagedResource,
49
+ managedServerResource,
50
+ } from 'stitchkit/application'
51
+ import { bindProcessSignals } from 'stitchkit/server'
52
+
53
+ const database = defineManagedResource({
54
+ id: 'database',
55
+ required: true,
56
+ start: async ({ signal, reportHealth }) => {
57
+ await db.connect({ signal })
58
+ reportHealth('healthy')
59
+ },
60
+ close: () => db.disconnect(),
61
+ })
62
+
63
+ const cleanup = createManagedSchedule({
64
+ id: 'cleanup',
65
+ dependsOn: ['database'],
66
+ everyMs: 60_000,
67
+ startAfterMs: 60_000,
68
+ overlap: { mode: 'skip' },
69
+ errorPolicy: 'continue',
70
+ run: ({ signal }) => removeExpiredRecords(signal),
71
+ })
72
+
73
+ const http = managedServerResource({
74
+ id: 'http',
75
+ dependsOn: [database],
76
+ // Called during `start`, after `database` is ready. The factory receives the
77
+ // same declared-dependency and startup-signal context as any resource.
78
+ server: (context) => {
79
+ const db = context.use(database)
80
+ return createServer({ port: env.PORT, services: createServices(db) })
81
+ },
82
+ })
83
+
84
+ const app = createApplication({
85
+ id: 'service',
86
+ resources: [database, http, cleanup],
87
+ // One number for how long this application may take to stop. `shutdown()`
88
+ // with no options and the signal path both spend it.
89
+ shutdown: { gracePeriodMs: 30_000, forceTimeoutMs: 5_000 },
90
+ })
91
+
92
+ const signals = bindProcessSignals(app, {
93
+ onComplete: (result) => {
94
+ process.exitCode = result.outcome === 'clean' ? 0 : 1
95
+ },
96
+ })
97
+
98
+ await app.start()
99
+ ```
100
+
101
+ **Bind before you start, and the order is load-bearing.** Reading it the other way
102
+ round — start serving, then arrange for shutdown — leaves a window between the
103
+ first accepted request and the first listener, and a supervisor that sends
104
+ `SIGTERM` inside that window kills the process outright: exit 143, no shutdown
105
+ chain, no `onComplete`, nothing drained. The window is small and opens exactly
106
+ when the machine is busiest, which is when a supervisor is most likely to be
107
+ restarting something. `bindProcessSignals` does not start anything, so there is
108
+ no cost to binding first.
109
+
110
+ The exact resource callbacks are typed by their public configuration. The
111
+ important ownership rule is stable: the application decides what the
112
+ database/server/provider objects are and how they are configured; Stitchkit
113
+ orders their process-local lifecycle and decides *when* they come into
114
+ existence.
115
+
116
+ ## Resource authoring
117
+
118
+ Give every resource a stable, bounded ID and list its dependencies explicitly.
119
+ The graph is validated before any start. Required resources may depend only on
120
+ required resources; an optional integration cannot silently become a required
121
+ dependency.
122
+
123
+ Start and readiness are different. A connection can finish setup and return a
124
+ ready handle. A poller can return a handle immediately, settle `ready` later,
125
+ and keep a long-lived `completion` promise. Stitchkit observes both.
126
+
127
+ Once Stitchkit invokes start/activation, cleanup is guaranteed to be attempted.
128
+ Write `close` so it is safe when setup was partial:
129
+
130
+ ```ts
131
+ let cacheClient: CacheClient | undefined
132
+
133
+ const cache = defineManagedResource({
134
+ id: 'cache',
135
+ required: false,
136
+ start: async ({ signal, reportHealth }) => {
137
+ cacheClient = new CacheClient()
138
+ await cacheClient.connect(signal)
139
+ reportHealth('healthy')
140
+ },
141
+ close: async () => {
142
+ await cacheClient?.close()
143
+ cacheClient = undefined
144
+ },
145
+ })
146
+ ```
147
+
148
+ Invoking `start` makes the descriptor rollback-eligible immediately. Its
149
+ `close` callback must therefore clean side effects even when `start` rejects
150
+ before returning a runtime handle. The kernel calls cleanup once and continues
151
+ cleaning other attempted resources even if one close fails.
152
+
153
+ ### Handing a resource to the resources that depend on it
154
+
155
+ `dependsOn` says *when*. To say *what*, return a `value` from `start` and read
156
+ it with `context.use(...)`:
157
+
158
+ ```ts
159
+ const database = defineManagedResource({
160
+ id: 'database',
161
+ start: async ({ signal }) => ({ value: await connect(env.DATABASE_URL, signal) }),
162
+ })
163
+
164
+ const worker = defineManagedResource({
165
+ id: 'worker',
166
+ dependsOn: [database],
167
+ start: (context) => {
168
+ const db = context.use(database) // Connection — not Connection | null
169
+ return { completion: consume(db, context.signal) }
170
+ },
171
+ })
172
+ ```
173
+
174
+ Declare the dependency with the **resource**, not its id, whenever you intend to
175
+ read from it: that is the form `use` can type, and it keeps the declaration and
176
+ the read from drifting apart. A string still works when all you need is order.
177
+
178
+ `managedServerResource` follows the same rule. Its factory receives this context
179
+ during `start`, so constructing routes from a database/service/socket value does
180
+ not need an outer mutable handoff or a custom `start` override. A zero-argument
181
+ factory remains valid when it needs only ordering, and an already-running handle
182
+ can still be passed directly. → ADR 0121.
183
+
184
+ The value is published when `start` resolves and stays readable for the rest of
185
+ the application's life — from `activate` and from the shutdown phases too, where
186
+ a dependant may still need the handle it was given.
187
+
188
+ `use` refuses two things, both loudly: a resource that was never declared in
189
+ `dependsOn` (it happens to work whenever declaration order is lucky), and a
190
+ resource that published nothing. The second is refused by the compiler as well —
191
+ reading a value off a resource with no `value` in its `start` does not type.
192
+
193
+ ## Readiness and health
194
+
195
+ `await app.start()` resolves only after every required resource is ready and
196
+ every required post-ready activation has succeeded. Lifecycle `ready` is
197
+ published before activation so schedules never arm during `starting`;
198
+ application admission opens only after successful activation. Optional failure
199
+ may retain lifecycle `ready`, but snapshot health is `degraded`, never
200
+ `healthy`.
201
+
202
+ Readiness is not hidden polling. A resource reports health changes through its
203
+ lifecycle context; the application decides when a database/provider probe runs.
204
+
205
+ **A `reportHealth` call inside `start` is kept.** A resource that says nothing
206
+ is assumed healthy once it is ready; one that reports its own health has already
207
+ answered the question, and the answer stands. (It used to be overwritten — and
208
+ the example above hides that, because `healthy` is the same value that
209
+ overwrote it.)
210
+
211
+ **Reporting the same health again is not a change.** A resource may confirm its
212
+ health on a timer; a report with the value it already reported publishes
213
+ nothing — no new revision, no `changedAt`, no subscriber call. A change of value
214
+ publishes once, as does the first report that confirms the `healthy` the kernel
215
+ assumed at readiness.
216
+
217
+ **A resource is required unless you write `required: false`.** That default is
218
+ what makes the next sentence bite.
219
+
220
+ **Readiness requires every required resource to be healthy**, so "ready but
221
+ degraded" is unreachable for a required resource by construction: an
222
+ application whose required resource reports anything but `healthy` refuses to
223
+ start, and says which resource and in what state. The refusal distinguishes the
224
+ two ways to get there — a resource that was never healthy is pointed at
225
+ `required: false`; one that was healthy and stopped is pointed at
226
+ `onResourceFailure`. A resource that is *expected* to start
227
+ degraded — up, but still dialling something external — belongs behind
228
+ `required: false`, where it keeps its own health and does not gate the
229
+ application:
230
+
231
+ ```ts
232
+ defineManagedResource({
233
+ id: 'dialling',
234
+ required: false,
235
+ start: ({ reportHealth }) => { reportHealth('degraded') },
236
+ })
237
+ ```
238
+
239
+ An optional resource reporting non-healthy does not gate readiness, but it does
240
+ move the application **aggregate** to `degraded` — which a readiness endpoint
241
+ mapping `degraded` to non-200 will notice.
242
+
243
+ If startup fails, every resource that was already started is closed in reverse
244
+ order. The rollback runs **one** phase — `close` — not the five a real shutdown
245
+ runs, and `close` receives the same deadlines a shutdown would give it, so a
246
+ server drains what is in flight instead of aborting it.
247
+
248
+ Those deadlines come from the application's declared budget, and it is worth
249
+ knowing what they cost. With nothing in flight the rollback returns at once: a
250
+ grace period is a ceiling, not a sleep. With something in flight it waits for
251
+ it — that is the point — and with something that **never finishes**, a hung
252
+ upstream or a client that ignores a close frame, it waits out the whole budget
253
+ before forcing. Under the default 30s+5s that turns a failed `start()` that used
254
+ to reject in milliseconds into one that can take 35 seconds to reject.
255
+
256
+ An application that would rather hear about a broken start immediately says so,
257
+ in the one place both stopping paths read:
258
+
259
+ ```ts
260
+ createApplication({
261
+ id: 'app',
262
+ resources,
263
+ // Applies to `shutdown()` called with no options AND to the rollback of a
264
+ // failed `start()`, which has no call site of its own to be told.
265
+ shutdown: { gracePeriodMs: 5_000, forceTimeoutMs: 1_000 },
266
+ })
267
+ ```
268
+
269
+ The budget is a real bound, not just a number handed to each resource: a `close`
270
+ that never returns is abandoned when the budget runs out, reported as a `close`
271
+ failure, and the startup error stays the `cause` of the `AggregateError` that
272
+ `start()` rejects with. Without that, one unresponsive resource could keep a
273
+ failed startup from ever reporting why it failed.
274
+
275
+ A required long-lived completion that rejects after startup makes readiness
276
+ false and health unhealthy. Stitchkit records the failure but does not restart
277
+ the resource or process.
278
+
279
+ `ApplicationResourceShutdown.failures` names the phase that failed — `start`,
280
+ `ready`, `completion`, `admission`, `drain`, `close`, `force` — and nothing
281
+ else. To learn *why*, pass `onResourceFailure`:
282
+
283
+ ```ts
284
+ createApplication({
285
+ id: 'app',
286
+ resources,
287
+ onResourceFailure: ({ resourceId, phase, error }) => {
288
+ log.error({ resourceId, phase, err: error }, 'managed resource failed')
289
+ },
290
+ })
291
+ ```
292
+
293
+ It fires for every phase, including the one place the cause would otherwise be
294
+ lost entirely: an **optional** resource failing to start. A required one
295
+ rethrows, so its cause reaches you anyway; an optional one is swallowed on
296
+ purpose, because the application keeps running. A throwing observer cannot
297
+ break the lifecycle it observes.
298
+
299
+ `createApplicationHealthHandler` publishes an `ApplicationStatusProjection`
300
+ through a Fetch-compatible handler, suitable for a raw route on Bun or Node.
301
+ The projection carries the verdict — the application's own `id`, `lifecycle`,
302
+ `health`, `ready`, `capturedAt` and resource **counts** — and never the internal
303
+ topology: no per-resource ids, no `dependsOn` edges, no process `epoch`, no
304
+ admission counters.
305
+ Those stay in `getSnapshot()`, which never leaves the process, and in whatever
306
+ telemetry you wire to it. Product-specific probes may be composed beside it; do
307
+ not put secrets or raw provider failures in the response.
308
+
309
+ For the conventional three-route surface, reuse the same semantics instead of
310
+ copying them into the application:
311
+
312
+ ```ts
313
+ const operational = createApplicationOperationalHandlers(app)
314
+
315
+ const rawRoutes = [
316
+ { method: 'GET', path: '/status', handler: operational.status },
317
+ { method: 'GET', path: '/ready', handler: operational.readiness },
318
+ { method: 'GET', path: '/live', handler: operational.liveness },
319
+ ]
320
+ ```
321
+
322
+ `status` always returns the current published projection with HTTP 200,
323
+ including while starting, draining or stopped. To read the full snapshot — every
324
+ resource, its dependency edges and the live counters — call `app.getSnapshot()`
325
+ in-process; there is no option that publishes it over HTTP, because these routes
326
+ are meant to be reachable. The two probes retain the existing
327
+ readiness/liveness status and `Retry-After` policy.
328
+
329
+ Applications that already own an OpenTelemetry SDK may inject its `Meter` into
330
+ the isolated adapter:
331
+
332
+ ```ts
333
+ import { createApplicationOpenTelemetry } from 'stitchkit/application/opentelemetry'
334
+
335
+ const telemetry = createApplicationOpenTelemetry({
336
+ meter,
337
+ application: app,
338
+ activities: [activity],
339
+ schedules: [schedule],
340
+ })
341
+
342
+ // During application cleanup:
343
+ telemetry.close()
344
+ ```
345
+
346
+ The adapter registers fixed observable gauges and pulls the latest canonical
347
+ snapshots on every collection. It owns no exporter, SDK lifecycle, cache,
348
+ subscription or polling loop. Attributes are limited to declared application,
349
+ resource, activity, stage and schedule IDs plus bounded framework states;
350
+ epoch, revision, timestamps, failures and product/provider identities are never
351
+ metric attributes. Install `@opentelemetry/api` only when this entrypoint is
352
+ used; the neutral `stitchkit/application` graph remains peer-free.
353
+
354
+ Every instrument uses unit `1` and reports an absolute current/lifetime value:
355
+
356
+ | Instruments | Meaning |
357
+ |---|---|
358
+ | `stitchkit.application.lifecycle`, `.ready` | current lifecycle/health fact and readiness |
359
+ | `stitchkit.application.admission.accepting`, `.accepted`, `.completed`, `.pending` | current gate and absolute lifetime admission counts |
360
+ | `stitchkit.application.resource.ready` | readiness for each declared resource with required/state/health attributes |
361
+ | `stitchkit.application.schedule.accepting`, `.active`, `.queued`, `.runs_started`, `.runs_completed`, `.runs_failed`, `.ticks_skipped` | current schedule state and absolute run/tick counts |
362
+ | `stitchkit.application.activity.active`, `.queued`, `.completed`, `.failed` | absolute stage projections for declared activity sources |
363
+
364
+ ## Replacing part of the graph without stopping the process
365
+
366
+ `restart` takes down one resource **and everything that depends on it**, then
367
+ brings that subtree back. Everything else keeps running, and the process epoch
368
+ does not move.
369
+
370
+ ```ts
371
+ const result = await app.restart({ resourceId: 'database' })
372
+
373
+ result.outcome // 'restarted' | 'failed' | 'refused'
374
+ result.affected // ['database', 'repository', 'api'] — in start order
375
+ ```
376
+
377
+ The dependants come down with it because they are holding what the resource
378
+ published. A repository that kept running across a database replacement holds a
379
+ pool that has been closed: it still typechecks, still has methods, and fails at
380
+ whatever moment the first call happens. There is no version of this where a
381
+ dependant keeps a live handle, so the subtree — not the resource — is the unit.
382
+
383
+ A leaf restart affects one resource, and an independent neighbour is never
384
+ touched:
385
+
386
+ ```ts
387
+ await app.restart({ resourceId: 'cache' })
388
+ // mailer and database were not stopped, not started, not activated
389
+ ```
390
+
391
+ **Refused is not failed.** An unknown id, a restart during shutdown, and a
392
+ restart before the application is ready all return `refused` with a reason and
393
+ touch nothing. `failed` means the subtree came down and the new generation did
394
+ not come up — and the result agrees with the snapshot: if any affected resource
395
+ ends the restart in `failed`, so does the restart, including an optional one
396
+ whose failure the start loop does not re-throw.
397
+
398
+ **The close phase is bounded**, by the application's shutdown budget or by one
399
+ this call names:
400
+
401
+ ```ts
402
+ await app.restart({ resourceId: 'database', gracePeriodMs: 5_000, forceTimeoutMs: 2_000 })
403
+ ```
404
+
405
+ **A resource has to be able to start twice.** The kernel calls `start` again, so
406
+ a resource holding state across its own lifetime rebuilds it there. The ones this
407
+ framework ships do — a schedule re-arms, a keyspace opens a new generation and
408
+ re-loads, a managed server built from a factory gets a fresh server. A managed
409
+ server given a server *instance* cannot, and says so by name rather than
410
+ republishing something it has shut down. Give a keyspace a
411
+ `backend: () => …` factory when its backend cannot be re-opened after `close()`.
412
+
413
+ → [ADR 0157](../decisions/0157-a-restartable-resource-begins-a-generation.md).
414
+
415
+ Restarts of overlapping subtrees queue behind each other rather than being
416
+ refused. Two callers asking at once is ordinary; two generations of one resource
417
+ alive at once is the thing this must make impossible.
418
+
419
+ ```ts
420
+ // Both succeed, one complete pass after the other.
421
+ await Promise.all([
422
+ app.restart({ resourceId: 'database' }),
423
+ app.restart({ resourceId: 'database' }),
424
+ ])
425
+ ```
426
+
427
+ What a restart is **not** is a process restart: it replaces resources, and does
428
+ not re-read configuration the kernel captured when it was constructed.
429
+
430
+ → [ADR 0154](../decisions/0154-the-unit-of-a-restart-is-the-subtree.md).
431
+
432
+ ## Decisions a policy set makes together
433
+
434
+ `createDecisionPipeline` runs an ordered list of policies that each vote
435
+ `allow`, `deny` (with a reason) or `defer`. The first terminal verdict wins and
436
+ the rest do not run.
437
+
438
+ ```ts
439
+ import { createDecisionPipeline } from 'stitchkit/application'
440
+
441
+ const pipeline = createDecisionPipeline<{ userId: string; scope: string }>([
442
+ { id: 'banned', decide: (r) => (isBanned(r.userId)
443
+ ? { outcome: 'deny', reason: 'account suspended' }
444
+ : { outcome: 'defer' }) },
445
+ { id: 'scope', decide: (r) => (r.scope === 'admin'
446
+ ? { outcome: 'allow' }
447
+ : { outcome: 'defer' }) },
448
+ { id: 'default', decide: () => ({ outcome: 'deny', reason: 'no policy allowed this' }) },
449
+ ], { policyTimeoutMs: 2_000 })
450
+
451
+ const result = await pipeline.decide(request)
452
+ result.outcome // 'allow' | 'deny' — never 'defer'
453
+ result.trace // the policies that actually ran, in order
454
+ ```
455
+
456
+ Three things are deliberate.
457
+
458
+ **A deny carries a reason, by schema.** `{ outcome: 'deny' }` alone does not
459
+ typecheck. A refusal whose cause exists only in the log of whoever refused is a
460
+ support ticket.
461
+
462
+ **The trace is what ran, not what was declared.** It stops at the terminal
463
+ verdict. When something was denied the question is which policy denied it and
464
+ what the ones before it said, and a trace listing policies that never ran would
465
+ answer that wrongly while looking complete.
466
+
467
+ **Every policy deferring raises.** `DecisionUndecidedError`, not a default —
468
+ defaulting to `allow` turns an incomplete policy set into an open door, and
469
+ defaulting to `deny` turns it into an outage whose cause reads as a legitimate
470
+ refusal.
471
+
472
+ **A policy that does not answer raises too.** A non-decision, a throw, and running
473
+ past `policyTimeoutMs` are one error — `DecisionPolicyError`, naming the policy
474
+ and carrying the trace so far — because they are indistinguishable downstream and
475
+ handling one but not the others is how a broken policy becomes a skipped one. The
476
+ chain stops there rather than falling through to whatever the next policy would
477
+ have said.
478
+
479
+ `policyTimeoutMs` is required and has no default. Pick a number your slowest
480
+ policy comfortably beats. The framework will not choose it for you: a policy that
481
+ never settles hangs every caller of the operation it guards, and a default here
482
+ is a number nobody chose applied to code the framework has never seen.
483
+
484
+ The same `allow`/`deny`/`defer` type is what an event topic declared
485
+ `mode: 'decision'` uses in `stitchkit/live` — one vocabulary, because a listener
486
+ voting on an event and a policy voting on a request are answering the same
487
+ question.
488
+
489
+ → [ADR 0155](../decisions/0155-one-decision-vocabulary-and-an-unanswered-question-is-an-error.md).
490
+
491
+ ## Admission and graceful shutdown
492
+
493
+ Use the application operation lease for work that is not already counted by a
494
+ managed resource:
495
+
496
+ ```ts
497
+ const operation = app.admission.acquire()
498
+ if (!operation) return Response.json({ error: 'unavailable' }, { status: 503 })
499
+
500
+ try {
501
+ await performAcceptedWork()
502
+ } finally {
503
+ operation.release()
504
+ }
505
+ ```
506
+
507
+ `release()` is idempotent. Admission and counter increment are atomic, so work
508
+ cannot slip between the shutdown check and drain accounting.
509
+
510
+ `managedServerResource` already owns contract/streaming-route response lifetimes. It cancels
511
+ their supplied signals at admission close and awaits source cleanup before dependent resources
512
+ close. Do not add application admission leases or a second cancellation registry for those
513
+ streams. A source that ignores cancellation or fails its cleanup prevents a clean shutdown;
514
+ the existing grace and force budgets still bound the result.
515
+
516
+ ### Bounded operation admission
517
+
518
+ Compose `createBoundedAdmission` when accepted work also competes for a finite
519
+ process-local resource:
520
+
521
+ ```ts
522
+ const generations = createBoundedAdmission({
523
+ upstream: app.admission,
524
+ policy: {
525
+ global: { maxConcurrent: 8, rate: { limit: 120, intervalMs: 60_000 } },
526
+ perKey: { maxConcurrent: 1, maxKeys: 2_000 },
527
+ },
528
+ })
529
+
530
+ await generations.run(accountId, ({ signal }) => generate({ signal }), {
531
+ signal: request.signal,
532
+ timeoutMs: 30_000,
533
+ })
534
+ ```
535
+
536
+ Acquisition is no-queue and atomic across every configured budget. Refusal names
537
+ the exact bound; only a rate refusal carries `retryAfterMs`. `maxKeys` keeps the
538
+ per-key registry finite, and expired idle entries are retired.
539
+
540
+ The caller timeout is a wait budget, not proof that the resource stopped. It
541
+ aborts the signal and settles the caller, but the lease remains active until the
542
+ underlying Promise actually settles. `drain()` therefore reports real work;
543
+ `force()` closes admission and reports remaining work without claiming to have
544
+ terminated it. → ADR 0118.
545
+
546
+ ### Bounded revision wake-up
547
+
548
+ Use `createRevisionSignal` when several operations need to wait for the same
549
+ process-local fact to change, but the change itself is not a queue item:
550
+
551
+ ```ts
552
+ const connectionsChanged = createRevisionSignal({ maxWaiters: 256 })
553
+
554
+ const observed = connectionsChanged.getSnapshot().revision
555
+ const result = await connectionsChanged.wait(observed, {
556
+ signal: request.signal,
557
+ timeoutMs: 10_000,
558
+ })
559
+
560
+ // After changing the canonical connection state:
561
+ connectionsChanged.advance()
562
+ ```
563
+
564
+ `wait(after)` resolves immediately when the signal is already newer than
565
+ `after`; this closes the race between reading a snapshot and registering the
566
+ wait. Waiting on the current revision parks one operation, up to `maxWaiters`.
567
+ Every terminal result carries the revision it observed and distinguishes
568
+ `changed`, `timed-out`, `aborted`, `closed` and `capacity`. A future `after` is
569
+ a caller error rather than a revision the signal could honestly promise to
570
+ reach.
571
+
572
+ One advance wakes every older waiter. It is not consumed by the first reader,
573
+ does not retain event payloads and has no replay history. A bounded channel is
574
+ for delivering items to one reader; a credit window grants a finite resource.
575
+
576
+ The signal is already its whole lifecycle handle. Call its idempotent `close()`
577
+ from the `close` phase of the managed resource that owns the changing fact;
578
+ there is no second managed-resource wrapper around the same state. → ADR 0163.
579
+
580
+ ### Bounded delivery and byte credit
581
+
582
+ `createBoundedChannel` is for one asynchronous reader when an event bus is not a
583
+ queue:
584
+
585
+ ```ts
586
+ const output = createBoundedChannel<string>({
587
+ policy: 'ordered',
588
+ maxItems: 64,
589
+ maxBytes: 256 * 1024,
590
+ sizeOf: (value) => new TextEncoder().encode(value).byteLength,
591
+ })
592
+
593
+ const progress = createBoundedChannel<{ revision: number }>({
594
+ policy: 'latest',
595
+ maxItems: 1,
596
+ maxBytes: 128,
597
+ sizeOf: () => 128,
598
+ })
599
+ ```
600
+
601
+ `ordered` never overwrites accepted values; overflow is a reasoned refusal.
602
+ `latest` retains exactly one pending replaceable value and reports
603
+ `coalesced`. Offers never create a hidden writer queue, and only one `next()` may
604
+ wait. Close chooses `drain` (default) or `discard`; abort discards; failure
605
+ rejects the parked and all later reads.
606
+
607
+ `createCreditWindow({ capacityBytes })` is the smaller primitive for a protocol
608
+ that already owns its queue but needs exact byte permission. Each credit lease
609
+ replenishes once; it is flow-control credit, not a durable acknowledgement. The
610
+ application snapshot sink now shares the same latest-value mechanics without
611
+ changing its revision or status contract. → ADR 0119.
612
+
613
+ ### Bounded local diagnostic journal
614
+
615
+ Use `createDiagnosticJournal` when a process needs finite, ordered local metadata evidence and the
616
+ deployment log pipeline is not the right boundary:
617
+
618
+ It lives at `stitchkit/application/diagnostic-journal`, not in the main barrel:
619
+ it is the one part of the kernel that spawns, locks and writes files, and while it
620
+ was exported from `stitchkit/application` that single line made the whole
621
+ entrypoint unusable in a browser bundle. Its schemas stay in
622
+ `stitchkit/application`.
623
+
624
+ ```ts
625
+ import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
626
+ import { z } from 'zod'
627
+
628
+ const journal = await createDiagnosticJournal({
629
+ eventSchema: z.object({
630
+ kind: z.enum(['resource_failed', 'recovery_started']),
631
+ resource: z.string().max(80),
632
+ }).strict(),
633
+ path: '/var/lib/example/diagnostic.jsonl', // operator configuration, never request data
634
+ limits: {
635
+ maxEventBytes: 4 * 1024,
636
+ maxPendingItems: 128,
637
+ maxPendingBytes: 512 * 1024,
638
+ maxFileBytes: 8 * 1024 * 1024,
639
+ maxFiles: 4,
640
+ },
641
+ onFailure: (failure) => internalLogger.error(failure),
642
+ })
643
+
644
+ const result = journal.submit({ kind: 'recovery_started', resource: 'database' })
645
+ if (result.outcome === 'refused') internalCounter.add(1, { reason: result.reason })
646
+
647
+ // During managed-resource close. Timeout ends this wait, not the physical append.
648
+ await journal.close({ timeoutMs: 5_000 })
649
+ ```
650
+
651
+ The owner schema and JSON serialization run synchronously before admission. Accepted frames carry
652
+ a process epoch and contiguous sequence and retain their complete bytes inside both pending limits
653
+ until their append attempt settles. Capacity, invalid, oversized, closed and terminal-failure
654
+ refusals are explicit; accepted ordered frames are never evicted.
655
+
656
+ The absolute path's parent must already exist and be operator-controlled. One manager owns it via
657
+ an exclusive `.lock`; new files use mode `0600` by default. `maxFiles` includes the active file,
658
+ and a non-newline startup tail is rotated intact rather than guessed or repaired. An abrupt process
659
+ death may leave the lock for an operator to remove only after proving the former owner is gone.
660
+
661
+ `flush()` means every accepted append through that call's boundary settled. It is not `fsync`, a
662
+ durable receipt, exactly-once execution or remote delivery. Timeout/cancellation bound only the
663
+ waiter; the writer retains physical capacity until settlement. There is no reader or upload API.
664
+ Use a durable application store or deployment-owned log collector when restart recovery, replay or
665
+ aggregation is required. → [ADR 0134](../decisions/0134-diagnostic-journal-is-bounded-local-evidence.md).
666
+
667
+ Shutdown performs one phase barrier at a time: stop admission everywhere,
668
+ cancel future schedules, drain admitted work, then close in reverse stable
669
+ topological order. Every hook shares the same grace deadline. Forced cleanup
670
+ shares one force deadline. Repeated `shutdown()` calls return the cached promise;
671
+ a repeated process signal forces that same chain.
672
+
673
+ Do not add a second `process.on('SIGTERM')` handler around the application.
674
+ `bindProcessSignals(app)` is the force/escalation owner. Exit code and hard-exit
675
+ policy remain application/supervisor choices.
676
+
677
+ **Where the budget comes from on the signal path.** `bindProcessSignals(app)`
678
+ with no `shutdown` forwards nothing, so the application spends the budget it
679
+ declared in `createApplication({ shutdown })`. Pass `shutdown` to the binding
680
+ only to override that budget for signals specifically; passing one key overrides
681
+ that key alone and leaves the other at the declaration. Declare the budget once,
682
+ on the application — repeating it in both places is how the two numbers start to
683
+ disagree, and the operator's supervisor timeout is calculated from the one they
684
+ can read.
685
+
686
+ ## Managed schedules
687
+
688
+ Schedules activate only after top-level readiness:
689
+
690
+ ```ts
691
+ createManagedSchedule({
692
+ id: 'reconcile',
693
+ everyMs: 5_000,
694
+ startAfterMs: 0,
695
+ overlap: { mode: 'queue-one' },
696
+ errorPolicy: 'continue',
697
+ onError: (error) => internalLogger.error(error),
698
+ run: ({ signal }) => reconcile(signal),
699
+ })
700
+ ```
701
+
702
+ - `skip` ignores a due tick while one execution is active.
703
+ - `queue-one` retains one successor; additional due ticks coalesce.
704
+ - `parallel` requires `maxConcurrent`; overflow skips rather than creating a
705
+ hidden queue.
706
+
707
+ The callback receives the application shutdown signal. Normal shutdown waits
708
+ for admitted executions; force aborts the shared signal. There are no retries,
709
+ cron/timezone rules, persisted cursors, backfill or cross-process locks. Put
710
+ those semantics in a durable application scheduler when they are required.
711
+ Schedule cadence stays monotonic, while status snapshots expose ISO wall-clock
712
+ `capturedAt`, `changedAt` and next/last-run timestamps for portable observation.
713
+
714
+ ## Operational projection
715
+
716
+ Declare aggregate activity stages, then update them with anonymous handles:
717
+
718
+ ```ts
719
+ const generations = createActivityProjection({
720
+ id: 'generation',
721
+ stages: ['queued', 'running', 'finalizing'],
722
+ })
723
+
724
+ const activity = generations.open('queued', 'queued')
725
+ generations.transition(activity, { stage: 'running', state: 'active' })
726
+ generations.transition(activity, { stage: 'finalizing', state: 'active' })
727
+ generations.complete(activity)
728
+ ```
729
+
730
+ Item identity is deliberately absent from the snapshot. Observers receive
731
+ aggregate counts with application identity, process epoch, revision and
732
+ timestamps. Calling a terminal method twice does not double-count.
733
+
734
+ ```ts
735
+ const sink = createApplicationSnapshotSink({
736
+ write: (snapshot) => publishOperationalSnapshot(snapshot),
737
+ })
738
+
739
+ const unsubscribe = generations.subscribe((snapshot) => {
740
+ sink.publish(snapshot)
741
+ })
742
+
743
+ // During application cleanup:
744
+ unsubscribe()
745
+ await sink.close()
746
+ ```
747
+
748
+ The sink replays the current absolute value and coalesces obsolete pending
749
+ revisions behind a slow write. Sink failure is observable but cannot fail the
750
+ application operation that changed the projection.
751
+
752
+ ## Optional grammY adapter
753
+
754
+ Install grammY only in an application that imports the adapter:
755
+
756
+ ```ts
757
+ import { Bot } from 'grammy'
758
+ import {
759
+ createGrammyWebhookResource,
760
+ grammyPollingResource,
761
+ } from 'stitchkit/application/grammy'
762
+ ```
763
+
764
+ For simple long polling, pass an already-configured bot:
765
+
766
+ ```ts
767
+ const bot = new Bot(env.BOT_TOKEN)
768
+ bot.command('start', (ctx) => ctx.reply('Hello'))
769
+ bot.catch(({ error }) => internalLogger.error(error))
770
+
771
+ const telegram = grammyPollingResource({
772
+ id: 'telegram',
773
+ bot,
774
+ required: true,
775
+ })
776
+ ```
777
+
778
+ Readiness follows grammY's `onStart`. Shutdown calls `bot.stop()` once and then
779
+ awaits the retained `bot.start()` promise, because grammY documents that
780
+ `stop()` alone does not wait for middleware completion.
781
+
782
+ For webhook ingress, `createGrammyWebhookResource` wraps provider-owned update
783
+ handling with admission and drain. The application still mounts the HTTP route,
784
+ verifies/configures its webhook and chooses the grammY framework adapter. An
785
+ update accepted before shutdown may finish; a later update is rejected.
786
+
787
+ The adapter never reads the token/env, installs commands, changes `bot.catch`,
788
+ chooses retry plugins, drops pending updates, sends outbound messages or stores
789
+ updates. A durable inbox/retry worker remains an application component, not a
790
+ mode of this adapter.
791
+
792
+ ## What disappears from an application
793
+
794
+ A typical small service can replace roughly 120–220 lines of generic signal,
795
+ timer, admission and close bookkeeping with resource declarations. A larger
796
+ multi-resource service commonly carries 250–450 generic lifecycle lines plus
797
+ 15–30 lines for each periodic timer. These are directional review estimates,
798
+ not an API guarantee.
799
+
800
+ The responsibility change is more important than line count:
801
+
802
+ | Before | After |
803
+ |---|---|
804
+ | hand-written phase enum and readiness waiters | `createApplication` snapshot |
805
+ | `process.on` signal loop and escalation | `bindProcessSignals(app)` |
806
+ | interval/timeout handles and overlap flag | `createManagedSchedule` |
807
+ | global in-flight counter and drain waiter set | application operation leases |
808
+ | manual stop/close fan-out | resource graph + bounded shutdown |
809
+ | progress delta events | absolute activity projection |
810
+
811
+ Durable job tables, lifecycle journals/outboxes, provider inboxes and business
812
+ retry rules do **not** disappear. They were never process-local glue and remain
813
+ application-owned.
814
+
815
+ ## Durable process facts and owner notifications
816
+
817
+ `createProcessLifecycleLedger` records a bounded versioned list of process runs.
818
+ Start, readiness and shutdown target both `runId` and `pid`, so hot reload and
819
+ PID reuse cannot close the wrong generation. A start classifies what happened to
820
+ the newest run before it, and the classification is decided by three facts —
821
+ whether that run recorded its own exit, whether the pid is the same, and whether
822
+ the version changed:
823
+
824
+ | newest run | same pid | version | `previousExit` | predecessor's `termination` |
825
+ |---|---|---|---|---|
826
+ | none | — | — | `first-boot` | — |
827
+ | recorded `stoppedAt` | — | — | `clean` / `forced` / `abnormal` as recorded | unchanged |
828
+ | still `active` | yes | — | `hot-reload` | `hot-reload`, closed at the new start |
829
+ | still `active` | no | changed | `handoff` | stays `active`; it records its own stop later |
830
+ | still `active` | no | same | `abnormal` (default) | `abnormal`, closed at the new start — an upper bound, the crash time is unknown |
831
+
832
+ A version of `unknown` on either side is never a version change, so a dev build
833
+ after a crashed release reads `abnormal`, not `handoff`. `forced` means the
834
+ process itself acknowledged a kill; `abnormal` means a successor found it dead.
835
+
836
+ The last row is a choice, and the default is the single-process deployment:
837
+ one process per build, a new pid of the same build means the old one stopped
838
+ answering. Where two processes of **one** build overlap on purpose — a
839
+ cluster, a zero-downtime reload of the same build — pass
840
+ `sameVersionOverlap: 'handoff'` to the ledger, and the predecessor stays
841
+ `active` until it records its own shutdown. The cost of that setting is
842
+ symmetric: a real crash under it is reported as a handoff and the dead run
843
+ stays `active` in the ledger until retention drops it. The list is kept in the
844
+ order the transitions wrote it — every write goes through one atomic update,
845
+ so that order is the causal one, and a successor whose clock lags its
846
+ predecessor still finds it at the head; `startedAt` is data, not the sort key.
847
+ Retention (`retain`, default 20) drops finished runs first and an active one —
848
+ a live handoff predecessor — only when nothing finished is left. Facts are
849
+ published through the ledger's own subscription and resource value;
850
+ `ApplicationEventSink` remains the strict application-state stream.
851
+
852
+ `createNotificationOutbox` is the transport-neutral durable delivery side. It
853
+ persists before send, claims an item with an expiring lease, carries one stable
854
+ idempotency key into the transport, retries under an injected clock and records
855
+ terminal drops. The guarantee is at-least-once: a crash after remote acceptance
856
+ but before the receipt is persisted may redeliver, so transports should use the
857
+ key when they support deduplication. The retry budget is sized for the outage
858
+ an owner notification has to outlive, not for a flaky call: the default backoff
859
+ doubles from one second and caps at sixty (`backoffDelay`, the one formula the
860
+ client's resumable streams also use, with jitter 0), and the 99 waits between
861
+ the default `maxAttempts` of 100 sum to 1+2+4+8+16+32 s plus 93 × 60 s — about
862
+ 94 minutes — before `onDropped` sees `attempt-limit`.
863
+ `state()` is a read and never fails on the bounds a transition enforces — a file
864
+ that grew past `maxStateBytes` under an older limit is inspectable and is
865
+ trimmed by the next transition. Two bounds do fail loudly: `enqueue` past
866
+ `maxQueue` throws rather than dropping silently, and a `backoffMs` that returns
867
+ `NaN`, a negative or an infinite delay rejects the flush. `stop()` lets the
868
+ send in flight finish and claims nothing more; a `send` without its own
869
+ deadline holds `stop()` — and so the resource's `force()` — for that one call,
870
+ so give the transport a timeout. Superseding a key that is being sent right now
871
+ does not recall it: the send completes, and only its receipt is not written.
872
+
873
+ Both primitives depend on the structural `StateStore`. On a server,
874
+ `createFileStateStore` supplies the shared Zod-validated JSON adapter with an
875
+ inter-process lock, unique temporary file, fsync and atomic rename. The lock
876
+ is a file with a heartbeat: the holder refreshes its mtime every third of
877
+ `staleLockMs` (default 3 s), a contender waits up to `lockTimeoutMs` (default
878
+ 10 s), and the stale bound must sit inside the timeout — otherwise a crashed
879
+ holder blocks every update until the lock ages out, which the constructor
880
+ refuses. A lock whose heartbeat is stale is reclaimed once its recorded pid is
881
+ gone; a live or unverifiable pid (a reused number, another user's process)
882
+ keeps it for ten stale bounds — and never fewer than thirty missed heartbeats,
883
+ so a scheduler stall on a loaded host cannot pull a live lock from under its
884
+ holder — after which the heartbeat wins and the lock is abandoned. Temporary files a crashed writer left beside the state are swept on
885
+ the store's first update. Ledger corruption may be declared reconstructable;
886
+ an outbox must fail closed rather than silently discard pending delivery.