stitchkit 0.100.1 → 0.100.3

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 (233) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/README.md +2 -1
  3. package/dist/application/process-lifecycle-transitions.d.ts +13 -2
  4. package/dist/application/process-lifecycle-transitions.d.ts.map +1 -1
  5. package/dist/application/process-lifecycle.d.ts +2 -1
  6. package/dist/application/process-lifecycle.d.ts.map +1 -1
  7. package/dist/entrypoints/agent-runtime/browser.js +119 -119
  8. package/dist/entrypoints/agent-runtime/coding-tools.js +15 -20
  9. package/dist/entrypoints/agent-runtime/harness.js +55 -63
  10. package/dist/entrypoints/agent-runtime/openrouter.js +6 -6
  11. package/dist/entrypoints/agent-runtime/sandbox.js +20 -25
  12. package/dist/entrypoints/agent-runtime/sqlite/bun.js +11 -13
  13. package/dist/entrypoints/agent-runtime/sqlite/node.js +11 -13
  14. package/dist/entrypoints/agent-runtime/testing.js +32 -34
  15. package/dist/entrypoints/agent-runtime.js +395 -402
  16. package/dist/entrypoints/application/diagnostic-journal.js +26 -27
  17. package/dist/entrypoints/application/directory-inbox.js +16 -17
  18. package/dist/entrypoints/application/grammy.js +13 -13
  19. package/dist/entrypoints/application/opentelemetry.js +13 -13
  20. package/dist/entrypoints/application/schemas.js +24 -24
  21. package/dist/entrypoints/application.d.ts +1 -1
  22. package/dist/entrypoints/application.d.ts.map +1 -1
  23. package/dist/entrypoints/application.js +218 -214
  24. package/dist/entrypoints/bin/upgrade-cli.js +2 -2
  25. package/dist/entrypoints/cli.js +81 -84
  26. package/dist/entrypoints/contract.js +54 -57
  27. package/dist/entrypoints/declaration.js +22 -22
  28. package/dist/entrypoints/files.js +18 -21
  29. package/dist/entrypoints/geo.js +7 -8
  30. package/dist/entrypoints/google.js +2 -2
  31. package/dist/entrypoints/index.js +150 -154
  32. package/dist/entrypoints/live.js +45 -47
  33. package/dist/entrypoints/node.js +68 -74
  34. package/dist/entrypoints/oauth.js +6 -6
  35. package/dist/entrypoints/observability.d.ts +1 -0
  36. package/dist/entrypoints/observability.d.ts.map +1 -1
  37. package/dist/entrypoints/observability.js +115 -87
  38. package/dist/entrypoints/primitives.js +35 -35
  39. package/dist/entrypoints/react/keyboard.d.ts +4 -0
  40. package/dist/entrypoints/react/keyboard.d.ts.map +1 -0
  41. package/dist/entrypoints/react/keyboard.js +397 -0
  42. package/dist/entrypoints/react.js +10 -10
  43. package/dist/entrypoints/release.js +7 -7
  44. package/dist/entrypoints/remote.js +15 -17
  45. package/dist/entrypoints/server.js +198 -200
  46. package/dist/entrypoints/telegram/html.d.ts +5 -0
  47. package/dist/entrypoints/telegram/html.d.ts.map +1 -0
  48. package/dist/entrypoints/telegram/html.js +26 -0
  49. package/dist/entrypoints/telegram/screens.d.ts +14 -0
  50. package/dist/entrypoints/telegram/screens.d.ts.map +1 -0
  51. package/dist/entrypoints/telegram/screens.js +2028 -0
  52. package/dist/entrypoints/telegram.d.ts +5 -1
  53. package/dist/entrypoints/telegram.d.ts.map +1 -1
  54. package/dist/entrypoints/telegram.js +548 -156
  55. package/dist/entrypoints/testing.js +75 -79
  56. package/dist/entrypoints/tools/connections.js +30 -32
  57. package/dist/entrypoints/tools/contract.js +18 -20
  58. package/dist/entrypoints/tools/invoker.js +12 -17
  59. package/dist/entrypoints/tools.js +223 -229
  60. package/dist/entrypoints/tracking/server.js +6 -6
  61. package/dist/entrypoints/tracking.js +40 -42
  62. package/dist/entrypoints/voice.js +3 -3
  63. package/dist/{index-eaysmdtq.js → index-0ndk4555.js} +56 -56
  64. package/dist/{index-2bxbyab0.js → index-1bx1xv1k.js} +1 -1
  65. package/dist/{index-p5r7qpdd.js → index-1eeqpadm.js} +4 -4
  66. package/dist/{index-hadmp193.js → index-3ct7hhq6.js} +210 -210
  67. package/dist/{index-e01r054k.js → index-45tdvqa3.js} +26 -26
  68. package/dist/{index-dce5wxcq.js → index-4s0fep5q.js} +8 -8
  69. package/dist/index-50ejfz75.js +9 -0
  70. package/dist/{index-m9zn6cpq.js → index-5107q189.js} +12 -12
  71. package/dist/{index-sbdmyz75.js → index-5cc6r990.js} +3 -3
  72. package/dist/index-6k1svmjh.js +141 -0
  73. package/dist/{index-c6bxbsnc.js → index-7kxw1awn.js} +2 -2
  74. package/dist/{index-0r0fbk7z.js → index-7z9ym7t8.js} +28 -28
  75. package/dist/{index-p7hgdyhb.js → index-814xpr6d.js} +2 -2
  76. package/dist/{index-gtj3zc53.js → index-8kzct1d6.js} +99 -99
  77. package/dist/{index-1zbbzgfh.js → index-9pw0a51a.js} +4 -4
  78. package/dist/{index-79z7m7dt.js → index-a9pd417t.js} +35 -35
  79. package/dist/{index-ham5sz8m.js → index-aaj97r4y.js} +45 -45
  80. package/dist/{index-s812ycat.js → index-aan6hqb9.js} +3 -3
  81. package/dist/{index-10x2hbx0.js → index-adhgd4pe.js} +44 -44
  82. package/dist/{index-2gxzjvyr.js → index-afjvjyck.js} +23 -23
  83. package/dist/{index-qmy6zq75.js → index-ahvsksw5.js} +16 -16
  84. package/dist/{index-hr4tzbwq.js → index-ap3gqe56.js} +3 -3
  85. package/dist/{index-znfs20ss.js → index-b2bz0kdm.js} +16 -16
  86. package/dist/{index-r066jx76.js → index-c6aagrbd.js} +148 -120
  87. package/dist/{index-k30h66yd.js → index-ck71tbcf.js} +9 -9
  88. package/dist/{index-eqqvgdb3.js → index-ct75c3at.js} +2 -2
  89. package/dist/{index-gw8bmyaj.js → index-djjhhgjk.js} +41 -41
  90. package/dist/{index-8qt2m66q.js → index-dvwj1f43.js} +43 -43
  91. package/dist/{index-fhwqwxe0.js → index-ej331hah.js} +1 -1
  92. package/dist/{index-9t3dffv2.js → index-ewbaywk5.js} +5 -5
  93. package/dist/{index-7p1f0vp2.js → index-fyphpknh.js} +25 -25
  94. package/dist/{index-83bdg97s.js → index-g149e9pk.js} +1 -1
  95. package/dist/{index-ngfhvfpd.js → index-g6a3na27.js} +4 -4
  96. package/dist/{index-qwhynv6x.js → index-h124epcf.js} +20 -20
  97. package/dist/{index-h6eeys1v.js → index-h97tqqp1.js} +9 -9
  98. package/dist/{index-zcgf3gqf.js → index-hby4qhax.js} +10 -10
  99. package/dist/{index-5jrd0yng.js → index-j8aw2c0e.js} +4 -4
  100. package/dist/{index-d8m8zpd8.js → index-jzczzcsb.js} +14 -14
  101. package/dist/index-kqnd6a85.js +26 -0
  102. package/dist/{index-35mh5bhj.js → index-kw1ws0cs.js} +12 -12
  103. package/dist/{index-yw4fzmdz.js → index-kzz6rq0w.js} +28 -17
  104. package/dist/{index-4gcnakhx.js → index-m38ej7e5.js} +2 -2
  105. package/dist/{index-ndddxtyx.js → index-m79yr938.js} +19 -19
  106. package/dist/{index-5p2m7we1.js → index-m9fndta6.js} +11 -11
  107. package/dist/index-mnkk1ffz.js +150 -0
  108. package/dist/index-n15jny5b.js +4 -0
  109. package/dist/{index-2vtcmrj9.js → index-n53mswt3.js} +20 -20
  110. package/dist/{index-bt14acb5.js → index-n5yqxd3d.js} +21 -21
  111. package/dist/{index-bm5rx7n6.js → index-n9tyz8z3.js} +12 -12
  112. package/dist/index-nmaqxdx7.js +463 -0
  113. package/dist/{index-mqv3b5rh.js → index-nx6eazt0.js} +30 -30
  114. package/dist/{index-3z73fh2c.js → index-q0th8q0z.js} +9 -9
  115. package/dist/{index-v260df89.js → index-qjeggp8w.js} +20 -20
  116. package/dist/{index-zfrhfn82.js → index-r1z0rd9c.js} +20 -20
  117. package/dist/{index-wqgjfstn.js → index-r5c4fedv.js} +3 -3
  118. package/dist/{index-cyktc4bp.js → index-r5hsgkz5.js} +118 -118
  119. package/dist/{index-0b1ess5e.js → index-r7a7r7ha.js} +1 -1
  120. package/dist/{index-1j8pm5t0.js → index-rfkh44ss.js} +15 -15
  121. package/dist/index-rz3z13e9.js +47 -0
  122. package/dist/{index-k6gpggb9.js → index-s80awwsw.js} +35 -35
  123. package/dist/{index-vqr7f7v8.js → index-ssmd41kh.js} +124 -124
  124. package/dist/{index-ensd0r74.js → index-v14qqmys.js} +41 -41
  125. package/dist/{index-paz6sgdp.js → index-v4a2fjtk.js} +36 -36
  126. package/dist/{index-d9pk3td4.js → index-w0eqdhyd.js} +14 -14
  127. package/dist/{index-5qn1kx34.js → index-w575evhq.js} +29 -29
  128. package/dist/{index-3gye9wzb.js → index-w5s3xftz.js} +26 -26
  129. package/dist/{index-tm88avnj.js → index-wykebpn9.js} +3 -3
  130. package/dist/{index-sh3s86na.js → index-xkhk5d6g.js} +17 -17
  131. package/dist/{index-6k1937bx.js → index-xqhede6x.js} +4 -4
  132. package/dist/{index-f4fx2tza.js → index-zs4ms3th.js} +181 -181
  133. package/dist/{index-k5hsfc3j.js → index-zsvzhjtk.js} +1 -1
  134. package/dist/observability/bounded-logger.d.ts +2 -0
  135. package/dist/observability/bounded-logger.d.ts.map +1 -1
  136. package/dist/observability/sanitize.d.ts +6 -0
  137. package/dist/observability/sanitize.d.ts.map +1 -1
  138. package/dist/observability/secret-values.d.ts +25 -0
  139. package/dist/observability/secret-values.d.ts.map +1 -0
  140. package/dist/react/keyboard/hooks.d.ts +71 -0
  141. package/dist/react/keyboard/hooks.d.ts.map +1 -0
  142. package/dist/react/keyboard/layers.d.ts +98 -0
  143. package/dist/react/keyboard/layers.d.ts.map +1 -0
  144. package/dist/react/keyboard/zone.d.ts +139 -0
  145. package/dist/react/keyboard/zone.d.ts.map +1 -0
  146. package/dist/telegram/crypto.d.ts +16 -0
  147. package/dist/telegram/crypto.d.ts.map +1 -0
  148. package/dist/telegram/html/check.d.ts +26 -0
  149. package/dist/telegram/html/check.d.ts.map +1 -0
  150. package/dist/telegram/html/nodes.d.ts +70 -0
  151. package/dist/telegram/html/nodes.d.ts.map +1 -0
  152. package/dist/telegram/html/parse.d.ts +35 -0
  153. package/dist/telegram/html/parse.d.ts.map +1 -0
  154. package/dist/telegram/html/render.d.ts +39 -0
  155. package/dist/telegram/html/render.d.ts.map +1 -0
  156. package/dist/telegram/init-data.d.ts.map +1 -1
  157. package/dist/telegram/operator-channel.d.ts +36 -3
  158. package/dist/telegram/operator-channel.d.ts.map +1 -1
  159. package/dist/telegram/screens/callback-codec.d.ts +34 -0
  160. package/dist/telegram/screens/callback-codec.d.ts.map +1 -0
  161. package/dist/telegram/screens/dispatch.d.ts +22 -0
  162. package/dist/telegram/screens/dispatch.d.ts.map +1 -0
  163. package/dist/telegram/screens/display.d.ts +70 -0
  164. package/dist/telegram/screens/display.d.ts.map +1 -0
  165. package/dist/telegram/screens/execute.d.ts +57 -0
  166. package/dist/telegram/screens/execute.d.ts.map +1 -0
  167. package/dist/telegram/screens/html.d.ts +36 -0
  168. package/dist/telegram/screens/html.d.ts.map +1 -0
  169. package/dist/telegram/screens/outcome.d.ts +74 -0
  170. package/dist/telegram/screens/outcome.d.ts.map +1 -0
  171. package/dist/telegram/screens/path.d.ts +29 -0
  172. package/dist/telegram/screens/path.d.ts.map +1 -0
  173. package/dist/telegram/screens/reconcile.d.ts +67 -0
  174. package/dist/telegram/screens/reconcile.d.ts.map +1 -0
  175. package/dist/telegram/screens/registry.d.ts +23 -0
  176. package/dist/telegram/screens/registry.d.ts.map +1 -0
  177. package/dist/telegram/screens/render.d.ts +70 -0
  178. package/dist/telegram/screens/render.d.ts.map +1 -0
  179. package/dist/telegram/screens/runtime.d.ts +133 -0
  180. package/dist/telegram/screens/runtime.d.ts.map +1 -0
  181. package/dist/telegram/screens/screen-types.d.ts +130 -0
  182. package/dist/telegram/screens/screen-types.d.ts.map +1 -0
  183. package/dist/telegram/screens/screen.d.ts +138 -0
  184. package/dist/telegram/screens/screen.d.ts.map +1 -0
  185. package/dist/telegram/screens/state.d.ts +115 -0
  186. package/dist/telegram/screens/state.d.ts.map +1 -0
  187. package/dist/telegram/screens/telegram-screens.d.ts +18 -0
  188. package/dist/telegram/screens/telegram-screens.d.ts.map +1 -0
  189. package/dist/telegram/screens/test-chat-telegram.d.ts +47 -0
  190. package/dist/telegram/screens/test-chat-telegram.d.ts.map +1 -0
  191. package/dist/telegram/screens/test-chat.d.ts +66 -0
  192. package/dist/telegram/screens/test-chat.d.ts.map +1 -0
  193. package/dist/telegram/screens/view.d.ts +89 -0
  194. package/dist/telegram/screens/view.d.ts.map +1 -0
  195. package/dist/telegram/send-failure.d.ts +19 -0
  196. package/dist/telegram/send-failure.d.ts.map +1 -1
  197. package/dist/telegram/update-intake.d.ts +78 -0
  198. package/dist/telegram/update-intake.d.ts.map +1 -0
  199. package/dist/telegram/update-store-sqlite.d.ts +26 -0
  200. package/dist/telegram/update-store-sqlite.d.ts.map +1 -0
  201. package/dist/telegram/update-store.d.ts +67 -0
  202. package/dist/telegram/update-store.d.ts.map +1 -0
  203. package/dist/telegram/webhook.d.ts +105 -0
  204. package/dist/telegram/webhook.d.ts.map +1 -0
  205. package/dist/tools/cli/args-fields.d.ts +8 -0
  206. package/dist/tools/cli/args-fields.d.ts.map +1 -1
  207. package/dist/tools/cli/args-route.d.ts.map +1 -1
  208. package/dist/tools/cli/args.d.ts.map +1 -1
  209. package/dist/tools/cli/help.d.ts.map +1 -1
  210. package/llms/application.2.txt +26 -1
  211. package/llms/application.txt +18 -27
  212. package/llms/cli.txt +8 -2
  213. package/llms/observability.txt +2 -1
  214. package/llms/react-keyboard.txt +193 -0
  215. package/llms/stitchkit.txt +7 -1
  216. package/llms/telegram-html.txt +35 -0
  217. package/llms/telegram-screens.txt +365 -0
  218. package/llms/telegram.txt +160 -4
  219. package/llms-full.txt +755 -11
  220. package/llms.txt +11 -6
  221. package/package.json +17 -2
  222. package/dist/index-2k4yrqkc.js +0 -9
  223. package/dist/index-crykmqkr.js +0 -26
  224. package/dist/index-y64k3s0h.js +0 -150
  225. package/dist/index-y91ry9h2.js +0 -4
  226. /package/dist/{index-hffjpmq9.js → index-9jfdm5tg.js} +0 -0
  227. /package/dist/{index-zjjyynm3.js → index-d4pa2bgs.js} +0 -0
  228. /package/dist/{index-rxfy4cq7.js → index-dwfv9a85.js} +0 -0
  229. /package/dist/{index-5jm36zv1.js → index-gfk7nrht.js} +0 -0
  230. /package/dist/{index-b9aefrqd.js → index-n1dqr7gf.js} +0 -0
  231. /package/dist/{index-q3pyb9n0.js → index-sykb5ag7.js} +0 -0
  232. /package/dist/{index-48ffdxgk.js → index-xhzq2qvj.js} +0 -0
  233. /package/dist/{index-kzfs85xp.js → index-zsarb5xp.js} +0 -0
@@ -1,103 +1,101 @@
1
1
  import {
2
- ActivityIdSchema,
3
- ActivityLiveStateSchema,
4
- ActivitySnapshotSchema,
5
- ActivityStageIdSchema,
6
- ActivityStageSnapshotSchema,
7
- ActivityTokenBrand,
8
- ApplicationSnapshotSinkStatusSchema,
9
- ManagedScheduleDescriptorSchema,
10
- ManagedScheduleErrorPolicySchema,
11
- ManagedScheduleOverlapSchema,
12
- ManagedScheduleStatusSchema,
13
- createActivityProjection,
14
- createApplicationSnapshotSink,
15
- createManagedSchedule
16
- } from "../index-ensd0r74.js";
2
+ BoundedChannelPolicySchema2,
3
+ BoundedChannelStateSchema2,
4
+ BoundedChannelSnapshotSchema2,
5
+ BoundedChannelReaderError2,
6
+ createBoundedChannel2,
7
+ CreditWindowSnapshotSchema2,
8
+ createCreditWindow2
9
+ } from "../index-w0eqdhyd.js";
17
10
  import {
18
- DirectoryInboxRejectionReasonSchema,
19
- DirectoryInboxStateSchema
20
- } from "../index-5jrd0yng.js";
11
+ createBoundedSinkManager
12
+ } from "../index-h97tqqp1.js";
21
13
  import {
22
- DiagnosticJournalCloseResultSchema,
23
- DiagnosticJournalFailurePhaseSchema,
24
- DiagnosticJournalFrameSchema,
25
- DiagnosticJournalLimitsSchema,
26
- DiagnosticJournalLockPolicySchema,
27
- DiagnosticJournalRefusalReasonSchema,
28
- DiagnosticJournalStateSchema,
29
- DiagnosticJournalStatusSchema,
30
- DiagnosticJournalSubmitResultSchema,
31
- DiagnosticJournalWaitResultSchema,
32
- readDiagnosticJournalLockDiagnosis
33
- } from "../index-qwhynv6x.js";
34
- import"../index-5jm36zv1.js";
14
+ ApplicationSnapshotSinkStatusSchema2,
15
+ createApplicationSnapshotSink2,
16
+ ActivityIdSchema2,
17
+ ActivityStageIdSchema2,
18
+ ActivityStageSnapshotSchema2,
19
+ ActivitySnapshotSchema2,
20
+ ActivityLiveStateSchema2,
21
+ ActivityTokenBrand2,
22
+ createActivityProjection2,
23
+ ManagedScheduleOverlapSchema2,
24
+ ManagedScheduleErrorPolicySchema2,
25
+ ManagedScheduleDescriptorSchema2,
26
+ ManagedScheduleStatusSchema2,
27
+ createManagedSchedule2
28
+ } from "../index-v14qqmys.js";
35
29
  import {
36
- ApplicationAdmissionError,
37
- ApplicationRestartInputSchema,
38
- ApplicationRestartOutcomeSchema,
39
- ApplicationRestartResultSchema,
40
- ApplicationShutdownBudgetSchema,
41
- ApplicationShutdownOptionsSchema,
42
- createApplication
43
- } from "../index-5qn1kx34.js";
30
+ backoffDelay,
31
+ createBackoff2
32
+ } from "../index-g6a3na27.js";
44
33
  import {
45
- ApplicationAdmissionSnapshotSchema,
46
- ApplicationHealthSchema,
47
- ApplicationIdSchema,
48
- ApplicationLifecycleSchema,
49
- ApplicationResourceShutdownSchema,
50
- ApplicationShutdownResultSchema,
51
- ApplicationSnapshotSchema,
52
- ApplicationStatusProjectionSchema,
53
- ManagedResourceSnapshotSchema,
54
- ManagedResourceStateSchema,
55
- projectApplicationStatus
56
- } from "../index-3gye9wzb.js";
34
+ DiagnosticJournalLimitsSchema2,
35
+ DiagnosticJournalLockPolicySchema2,
36
+ DiagnosticJournalStateSchema2,
37
+ DiagnosticJournalRefusalReasonSchema2,
38
+ DiagnosticJournalFailurePhaseSchema2,
39
+ DiagnosticJournalStatusSchema2,
40
+ DiagnosticJournalSubmitResultSchema2,
41
+ DiagnosticJournalWaitResultSchema2,
42
+ DiagnosticJournalCloseResultSchema2,
43
+ DiagnosticJournalFrameSchema2,
44
+ readDiagnosticJournalLockDiagnosis2
45
+ } from "../index-h124epcf.js";
57
46
  import {
58
- defineManagedResource,
59
- managedResourceDependencyId
60
- } from "../index-2k4yrqkc.js";
61
- import"../index-3z73fh2c.js";
47
+ DirectoryInboxRejectionReasonSchema2,
48
+ DirectoryInboxStateSchema2
49
+ } from "../index-j8aw2c0e.js";
62
50
  import {
63
- createBoundedSinkManager
64
- } from "../index-h6eeys1v.js";
51
+ ApplicationIdSchema2,
52
+ ApplicationLifecycleSchema2,
53
+ ApplicationHealthSchema2,
54
+ ManagedResourceStateSchema2,
55
+ ApplicationAdmissionSnapshotSchema2,
56
+ ManagedResourceSnapshotSchema2,
57
+ ApplicationSnapshotSchema2,
58
+ ApplicationStatusProjectionSchema2,
59
+ projectApplicationStatus2,
60
+ ApplicationResourceShutdownSchema2,
61
+ ApplicationShutdownResultSchema2
62
+ } from "../index-w5s3xftz.js";
65
63
  import {
66
- backoffDelay,
67
- createBackoff
68
- } from "../index-ngfhvfpd.js";
64
+ AppError2
65
+ } from "../index-n53mswt3.js";
66
+ import"../index-q0th8q0z.js";
69
67
  import {
70
- withDeadline
71
- } from "../index-b9aefrqd.js";
68
+ ApplicationShutdownOptionsSchema2,
69
+ ApplicationShutdownBudgetSchema2,
70
+ ApplicationRestartInputSchema2,
71
+ ApplicationRestartOutcomeSchema2,
72
+ ApplicationRestartResultSchema2,
73
+ ApplicationAdmissionError2,
74
+ createApplication2
75
+ } from "../index-w575evhq.js";
76
+ import {
77
+ measureSize2
78
+ } from "../index-kzz6rq0w.js";
79
+ import"../index-rfkh44ss.js";
72
80
  import {
73
- deltaWins,
74
81
  diff,
75
- watchKeyString
76
- } from "../index-k6gpggb9.js";
77
- import"../index-1j8pm5t0.js";
82
+ deltaWins,
83
+ watchKeyString2
84
+ } from "../index-s80awwsw.js";
85
+ import"../index-gfk7nrht.js";
78
86
  import {
79
- BoundedChannelPolicySchema,
80
- BoundedChannelReaderError,
81
- BoundedChannelSnapshotSchema,
82
- BoundedChannelStateSchema,
83
- CreditWindowSnapshotSchema,
84
- createBoundedChannel,
85
- createCreditWindow
86
- } from "../index-d9pk3td4.js";
87
+ managedResourceDependencyId2,
88
+ defineManagedResource2
89
+ } from "../index-50ejfz75.js";
87
90
  import {
88
- measureSize
89
- } from "../index-yw4fzmdz.js";
91
+ withDeadline
92
+ } from "../index-n1dqr7gf.js";
90
93
  import {
91
94
  argumentsDigest
92
- } from "../index-0b1ess5e.js";
93
- import {
94
- AppError
95
- } from "../index-2vtcmrj9.js";
95
+ } from "../index-r7a7r7ha.js";
96
96
  import {
97
97
  serializeCanonicalJson
98
- } from "../index-k5hsfc3j.js";
99
- import"../index-kzfs85xp.js";
100
- import"../index-hffjpmq9.js";
98
+ } from "../index-zsvzhjtk.js";
101
99
  // src/application/admission.ts
102
100
  import { z } from "zod";
103
101
 
@@ -490,7 +488,7 @@ import { z as z2 } from "zod";
490
488
 
491
489
  // src/internal/coalesced-task.ts
492
490
  function createCoalescedTask(config) {
493
- const backoff = createBackoff(config.backoff);
491
+ const backoff = createBackoff2(config.backoff);
494
492
  let running = false;
495
493
  let dirty = false;
496
494
  let closed = false;
@@ -574,7 +572,7 @@ class ChangeSubscription {
574
572
  this.interval = z2.number().int().min(10).max(3600000).parse(config.reconcileIntervalMs);
575
573
  this.timeout = z2.number().int().min(1).max(3600000).parse(config.timeoutMs ?? 30000);
576
574
  const policy = config.backoff ?? { minDelayMs: 250, maxDelayMs: 30000, jitter: 0.2 };
577
- this.backoff = createBackoff(policy);
575
+ this.backoff = createBackoff2(policy);
578
576
  this.tasks = new Map(this.keys.map((key) => [
579
577
  key,
580
578
  createCoalescedTask({
@@ -785,7 +783,7 @@ class ChangeSubscription {
785
783
  }
786
784
  function changeSubscriptionResource(config) {
787
785
  const subscription = new ChangeSubscription(config);
788
- return defineManagedResource({
786
+ return defineManagedResource2({
789
787
  id: config.id,
790
788
  start: (context) => subscription.start(context),
791
789
  close: () => subscription.close(),
@@ -874,14 +872,14 @@ function createDecisionPipeline(policies, config) {
874
872
  import { z as z4 } from "zod";
875
873
  var ApplicationLifecycleEventSchema = z4.object({
876
874
  type: z4.literal("application-state"),
877
- applicationId: ApplicationIdSchema,
875
+ applicationId: ApplicationIdSchema2,
878
876
  epoch: z4.string().uuid(),
879
877
  revision: z4.number().int().nonnegative(),
880
- lifecycle: ApplicationLifecycleSchema,
881
- health: ApplicationHealthSchema,
878
+ lifecycle: ApplicationLifecycleSchema2,
879
+ health: ApplicationHealthSchema2,
882
880
  ready: z4.boolean(),
883
881
  capturedAt: z4.string().datetime({ offset: true }),
884
- resources: z4.array(ManagedResourceSnapshotSchema).readonly()
882
+ resources: z4.array(ManagedResourceSnapshotSchema2).readonly()
885
883
  }).strict().readonly();
886
884
  function applicationLifecycleEvent(snapshot) {
887
885
  return ApplicationLifecycleEventSchema.parse({
@@ -925,7 +923,7 @@ function createApplicationHealthHandler(application, options) {
925
923
  return () => {
926
924
  const snapshot = application.getSnapshot();
927
925
  const healthy = parsed.kind === "readiness" ? snapshot.ready : snapshot.lifecycle !== "failed" && snapshot.lifecycle !== "stopped";
928
- return Response.json(projectApplicationStatus(snapshot), {
926
+ return Response.json(projectApplicationStatus2(snapshot), {
929
927
  status: healthy ? 200 : 503,
930
928
  ...healthy ? {} : { headers: { "Retry-After": String(parsed.retryAfterSeconds) } }
931
929
  });
@@ -934,7 +932,7 @@ function createApplicationHealthHandler(application, options) {
934
932
  function createApplicationOperationalHandlers(application, options = {}) {
935
933
  const parsed = ApplicationOperationalHandlersOptionsSchema.parse(options);
936
934
  return {
937
- status: () => Response.json(projectApplicationStatus(application.getSnapshot())),
935
+ status: () => Response.json(projectApplicationStatus2(application.getSnapshot())),
938
936
  readiness: createApplicationHealthHandler(application, {
939
937
  kind: "readiness",
940
938
  retryAfterSeconds: parsed.retryAfterSeconds
@@ -1118,7 +1116,7 @@ import { z as z7 } from "zod";
1118
1116
 
1119
1117
  // src/application/notification-outbox-state.ts
1120
1118
  import { z as z6 } from "zod";
1121
- var sizeOf = (value) => measureSize(value).responseBytes;
1119
+ var sizeOf = (value) => measureSize2(value).responseBytes;
1122
1120
  var DEFAULT_OUTBOX_BACKOFF = {
1123
1121
  minDelayMs: 1000,
1124
1122
  maxDelayMs: 60000,
@@ -1220,18 +1218,18 @@ async function deliverNotification(input) {
1220
1218
  const project = projectionFor(config, plan.version);
1221
1219
  if (!project)
1222
1220
  throw new NotificationPlanVersionError(plan.version);
1223
- const owns = (current2) => current2.key === item.key && current2.leaseId === item.leaseId;
1221
+ const owns = (current) => current.key === item.key && current.leaseId === item.leaseId;
1224
1222
  const checkpoint = async (change) => input.store.update((state) => {
1225
1223
  if (!state)
1226
1224
  throw new Error("Outbox state disappeared");
1227
- const live2 = state.queue.find(owns);
1228
- if (!live2?.delivery)
1225
+ const live = state.queue.find(owns);
1226
+ if (!live?.delivery)
1229
1227
  return { state, result: false };
1230
- const delivery = NotificationDeliveryStateSchema.parse(change(live2.delivery));
1228
+ const delivery = NotificationDeliveryStateSchema.parse(change(live.delivery));
1231
1229
  return {
1232
1230
  state: input.bounded({
1233
1231
  ...state,
1234
- queue: state.queue.map((row) => row === live2 ? {
1232
+ queue: state.queue.map((row) => row === live ? {
1235
1233
  ...row,
1236
1234
  delivery,
1237
1235
  leaseUntil: new Date(input.clock().getTime() + input.leaseMs).toISOString()
@@ -1534,7 +1532,7 @@ function createNotificationOutbox(config) {
1534
1532
  };
1535
1533
  }
1536
1534
  function notificationOutboxResource(outbox, config = {}) {
1537
- return defineManagedResource({
1535
+ return defineManagedResource2({
1538
1536
  id: config.id ?? "notification-outbox",
1539
1537
  start() {
1540
1538
  outbox.start();
@@ -1613,7 +1611,8 @@ function previousExitOf(previous, run, overlap) {
1613
1611
  return ended;
1614
1612
  if (previous.pid === run.pid)
1615
1613
  return "hot-reload";
1616
- if (isVersionChange(previous.version, run.version) || overlap === "handoff")
1614
+ const declared = isVersionChange(previous.version, run.version) ? overlap.versionChange : overlap.sameVersion;
1615
+ if (declared === "handoff")
1617
1616
  return "handoff";
1618
1617
  return previous.readyAt === null ? "startup-failed" : "abnormal";
1619
1618
  }
@@ -1623,7 +1622,8 @@ function closeAbandoned(candidate, previous, previousExit, run, overlap) {
1623
1622
  const closed = { ...candidate, stoppedAt: run.startedAt };
1624
1623
  if (candidate.pid === run.pid)
1625
1624
  return { ...closed, termination: "hot-reload" };
1626
- if (overlap === "handoff")
1625
+ const overlapsThisBuild = overlap.versionChange === "handoff" || !isVersionChange(candidate.version, run.version);
1626
+ if (overlap.sameVersion === "handoff" && overlapsThisBuild)
1627
1627
  return candidate;
1628
1628
  if (candidate.runId === previous?.runId && previousExit === "handoff")
1629
1629
  return candidate;
@@ -1634,7 +1634,10 @@ function closeAbandoned(candidate, previous, previousExit, run, overlap) {
1634
1634
  }
1635
1635
  function transitionProcessStart(source, input) {
1636
1636
  const retain = RetainSchema.parse(input.retain ?? 20);
1637
- const overlap = input.sameVersionOverlap ?? "abnormal";
1637
+ const overlap = {
1638
+ sameVersion: input.sameVersionOverlap ?? "abnormal",
1639
+ versionChange: input.versionChangeOverlap ?? "handoff"
1640
+ };
1638
1641
  const state = normalizeLifecycleState(source, 1000);
1639
1642
  const run = LifecycleRunSchema.parse({
1640
1643
  runId: input.runId,
@@ -1815,7 +1818,8 @@ function createProcessLifecycleLedger(config) {
1815
1818
  version,
1816
1819
  now: clock().toISOString(),
1817
1820
  retain,
1818
- sameVersionOverlap: config.sameVersionOverlap
1821
+ sameVersionOverlap: config.sameVersionOverlap,
1822
+ versionChangeOverlap: config.versionChangeOverlap
1819
1823
  });
1820
1824
  return { state: transition.state, result: transition.fact };
1821
1825
  });
@@ -1895,7 +1899,7 @@ function lifecycleLedgerResource(ledger, config) {
1895
1899
  shutdown = undefined;
1896
1900
  }
1897
1901
  };
1898
- return defineManagedResource({
1902
+ return defineManagedResource2({
1899
1903
  id: config.id ?? "lifecycle",
1900
1904
  async start() {
1901
1905
  stopped = false;
@@ -2114,7 +2118,7 @@ function managedServerResource(config) {
2114
2118
  });
2115
2119
  return shutdownPromise;
2116
2120
  };
2117
- return defineManagedResource({
2121
+ return defineManagedResource2({
2118
2122
  id: config.id,
2119
2123
  ...config.dependsOn && { dependsOn: config.dependsOn },
2120
2124
  ...config.required !== undefined && { required: config.required },
@@ -2254,7 +2258,7 @@ class WatchHubCore {
2254
2258
  return true;
2255
2259
  } catch (error) {
2256
2260
  this.config.logger?.warn?.("[stitchkit] watch subscriber threw", {
2257
- key: watchKeyString(key),
2261
+ key: watchKeyString2(key),
2258
2262
  error: error instanceof Error ? error.message : String(error)
2259
2263
  });
2260
2264
  return false;
@@ -2306,10 +2310,10 @@ class WatchHubCore {
2306
2310
  key: source.key,
2307
2311
  phase: "unavailable",
2308
2312
  reason: "source-error",
2309
- ...AppError.is(error) ? { code: error.code, message: error.message } : { message: "The watched read failed" }
2313
+ ...AppError2.is(error) ? { code: error.code, message: error.message } : { message: "The watched read failed" }
2310
2314
  });
2311
2315
  this.config.logger?.warn?.("[stitchkit] watched read failed", {
2312
- key: watchKeyString(source.key),
2316
+ key: watchKeyString2(source.key),
2313
2317
  error
2314
2318
  });
2315
2319
  }
@@ -2414,7 +2418,7 @@ class WatchHubCore {
2414
2418
  reason: `${key.service}.${key.action} is not watchable`
2415
2419
  };
2416
2420
  }
2417
- const route = watchKeyString(key);
2421
+ const route = watchKeyString2(key);
2418
2422
  const id = sourceId(scope?.key, key);
2419
2423
  if (keys.has(route))
2420
2424
  return { accepted: true };
@@ -2455,7 +2459,7 @@ class WatchHubCore {
2455
2459
  return { accepted: true };
2456
2460
  },
2457
2461
  close: (key) => {
2458
- const route = watchKeyString(key);
2462
+ const route = watchKeyString2(key);
2459
2463
  const id = keys.get(route);
2460
2464
  if (id === undefined)
2461
2465
  return;
@@ -2508,7 +2512,7 @@ function sharedKey(key) {
2508
2512
  return shared;
2509
2513
  }
2510
2514
  function sourceId(scope, key) {
2511
- return JSON.stringify([scope ?? null, watchKeyString(sharedKey(key))]);
2515
+ return JSON.stringify([scope ?? null, watchKeyString2(sharedKey(key))]);
2512
2516
  }
2513
2517
 
2514
2518
  // src/application/watch-hub.ts
@@ -2530,108 +2534,108 @@ function createWatchHub(config) {
2530
2534
  };
2531
2535
  }
2532
2536
  export {
2533
- watchKey,
2534
- transitionProcessStart,
2535
- transitionProcessShutdown,
2536
- transitionProcessReady,
2537
- transitionProcessDraining,
2538
- sqliteKeyspaceBackend,
2539
- readDiagnosticJournalLockDiagnosis,
2540
- projectApplicationStatus,
2541
- openKeyspace,
2542
- notificationOutboxStateSchema,
2543
- notificationOutboxResource,
2544
- memoryKeyspaceBackend,
2545
- managedServerResource,
2546
- managedResourceDependencyId,
2547
- lifecycleLedgerResource,
2548
- keyspaceResource,
2549
- defineManagedResource,
2550
- defineKeyspace,
2551
- createWatchHub,
2552
- createRevisionSignal,
2553
- createProcessLifecycleLedger,
2554
- createNotificationOutbox,
2555
- createManagedSchedule,
2556
- createDecisionPipeline,
2557
- createCreditWindow,
2558
- createBoundedChannel,
2559
- createBoundedAdmission,
2560
- createApplicationSnapshotSink,
2561
- createApplicationOperationalHandlers,
2562
- createApplicationHealthHandler,
2563
- createApplicationEventSink,
2564
- createApplication,
2565
- createActivityProjection,
2566
- changeSubscriptionResource,
2567
- applicationLifecycleEvent,
2568
- RevisionSignalWaitResultSchema,
2569
- RevisionSignalWaitOutcomeSchema,
2570
- RevisionSignalStateSchema,
2571
- RevisionSignalSnapshotSchema,
2572
- RevisionSignalAdvanceResultSchema,
2573
- PreviousExitSchema,
2574
- PolicyDecisionSchema,
2575
- NotificationPlanVersionError,
2576
- NotificationDeliveryStateSchema,
2577
- ManagedScheduleStatusSchema,
2578
- ManagedScheduleOverlapSchema,
2579
- ManagedScheduleErrorPolicySchema,
2580
- ManagedScheduleDescriptorSchema,
2581
- ManagedResourceStateSchema,
2582
- ManagedResourceSnapshotSchema,
2583
- LifecycleTerminationSchema,
2584
- LifecycleStateSchema,
2585
- LifecycleRunSchema,
2586
- DirectoryInboxStateSchema,
2587
- DirectoryInboxRejectionReasonSchema,
2588
- DiagnosticJournalWaitResultSchema,
2589
- DiagnosticJournalSubmitResultSchema,
2590
- DiagnosticJournalStatusSchema,
2591
- DiagnosticJournalStateSchema,
2592
- DiagnosticJournalRefusalReasonSchema,
2593
- DiagnosticJournalLockPolicySchema,
2594
- DiagnosticJournalLimitsSchema,
2595
- DiagnosticJournalFrameSchema,
2596
- DiagnosticJournalFailurePhaseSchema,
2597
- DiagnosticJournalCloseResultSchema,
2598
- DecisionUndecidedError,
2599
- DecisionPolicyError,
2600
- CreditWindowSnapshotSchema,
2601
- BoundedRateBudgetSchema,
2602
- BoundedOperationWaitError,
2603
- BoundedChannelStateSchema,
2604
- BoundedChannelSnapshotSchema,
2605
- BoundedChannelReaderError,
2606
- BoundedChannelPolicySchema,
2607
- BoundedAdmissionStateSchema,
2608
- BoundedAdmissionSnapshotSchema,
2609
- BoundedAdmissionRefusalReasonSchema,
2610
- BoundedAdmissionRefusalError,
2611
- BoundedAdmissionPolicySchema,
2612
- BoundedAdmissionPerKeyLimitsSchema,
2613
- ApplicationStatusProjectionSchema,
2614
- ApplicationSnapshotSinkStatusSchema,
2615
- ApplicationSnapshotSchema,
2616
- ApplicationShutdownResultSchema,
2617
- ApplicationShutdownOptionsSchema,
2618
- ApplicationShutdownBudgetSchema,
2619
- ApplicationRestartResultSchema,
2620
- ApplicationRestartOutcomeSchema,
2621
- ApplicationRestartInputSchema,
2622
- ApplicationResourceShutdownSchema,
2623
- ApplicationOperationalHandlersOptionsSchema,
2624
- ApplicationLifecycleSchema,
2625
- ApplicationLifecycleEventSchema,
2626
- ApplicationIdSchema,
2627
- ApplicationHealthSchema,
2537
+ ActivityIdSchema2 as ActivityIdSchema,
2538
+ ActivityLiveStateSchema2 as ActivityLiveStateSchema,
2539
+ ActivitySnapshotSchema2 as ActivitySnapshotSchema,
2540
+ ActivityStageIdSchema2 as ActivityStageIdSchema,
2541
+ ActivityStageSnapshotSchema2 as ActivityStageSnapshotSchema,
2542
+ ActivityTokenBrand2 as ActivityTokenBrand,
2543
+ ApplicationAdmissionError2 as ApplicationAdmissionError,
2544
+ ApplicationAdmissionSnapshotSchema2 as ApplicationAdmissionSnapshotSchema,
2628
2545
  ApplicationHealthHandlerOptionsSchema,
2629
- ApplicationAdmissionSnapshotSchema,
2630
- ApplicationAdmissionError,
2631
- ActivityTokenBrand,
2632
- ActivityStageSnapshotSchema,
2633
- ActivityStageIdSchema,
2634
- ActivitySnapshotSchema,
2635
- ActivityLiveStateSchema,
2636
- ActivityIdSchema
2546
+ ApplicationHealthSchema2 as ApplicationHealthSchema,
2547
+ ApplicationIdSchema2 as ApplicationIdSchema,
2548
+ ApplicationLifecycleEventSchema,
2549
+ ApplicationLifecycleSchema2 as ApplicationLifecycleSchema,
2550
+ ApplicationOperationalHandlersOptionsSchema,
2551
+ ApplicationResourceShutdownSchema2 as ApplicationResourceShutdownSchema,
2552
+ ApplicationRestartInputSchema2 as ApplicationRestartInputSchema,
2553
+ ApplicationRestartOutcomeSchema2 as ApplicationRestartOutcomeSchema,
2554
+ ApplicationRestartResultSchema2 as ApplicationRestartResultSchema,
2555
+ ApplicationShutdownBudgetSchema2 as ApplicationShutdownBudgetSchema,
2556
+ ApplicationShutdownOptionsSchema2 as ApplicationShutdownOptionsSchema,
2557
+ ApplicationShutdownResultSchema2 as ApplicationShutdownResultSchema,
2558
+ ApplicationSnapshotSchema2 as ApplicationSnapshotSchema,
2559
+ ApplicationSnapshotSinkStatusSchema2 as ApplicationSnapshotSinkStatusSchema,
2560
+ ApplicationStatusProjectionSchema2 as ApplicationStatusProjectionSchema,
2561
+ BoundedAdmissionPerKeyLimitsSchema,
2562
+ BoundedAdmissionPolicySchema,
2563
+ BoundedAdmissionRefusalError,
2564
+ BoundedAdmissionRefusalReasonSchema,
2565
+ BoundedAdmissionSnapshotSchema,
2566
+ BoundedAdmissionStateSchema,
2567
+ BoundedChannelPolicySchema2 as BoundedChannelPolicySchema,
2568
+ BoundedChannelReaderError2 as BoundedChannelReaderError,
2569
+ BoundedChannelSnapshotSchema2 as BoundedChannelSnapshotSchema,
2570
+ BoundedChannelStateSchema2 as BoundedChannelStateSchema,
2571
+ BoundedOperationWaitError,
2572
+ BoundedRateBudgetSchema,
2573
+ CreditWindowSnapshotSchema2 as CreditWindowSnapshotSchema,
2574
+ DecisionPolicyError,
2575
+ DecisionUndecidedError,
2576
+ DiagnosticJournalCloseResultSchema2 as DiagnosticJournalCloseResultSchema,
2577
+ DiagnosticJournalFailurePhaseSchema2 as DiagnosticJournalFailurePhaseSchema,
2578
+ DiagnosticJournalFrameSchema2 as DiagnosticJournalFrameSchema,
2579
+ DiagnosticJournalLimitsSchema2 as DiagnosticJournalLimitsSchema,
2580
+ DiagnosticJournalLockPolicySchema2 as DiagnosticJournalLockPolicySchema,
2581
+ DiagnosticJournalRefusalReasonSchema2 as DiagnosticJournalRefusalReasonSchema,
2582
+ DiagnosticJournalStateSchema2 as DiagnosticJournalStateSchema,
2583
+ DiagnosticJournalStatusSchema2 as DiagnosticJournalStatusSchema,
2584
+ DiagnosticJournalSubmitResultSchema2 as DiagnosticJournalSubmitResultSchema,
2585
+ DiagnosticJournalWaitResultSchema2 as DiagnosticJournalWaitResultSchema,
2586
+ DirectoryInboxRejectionReasonSchema2 as DirectoryInboxRejectionReasonSchema,
2587
+ DirectoryInboxStateSchema2 as DirectoryInboxStateSchema,
2588
+ LifecycleRunSchema,
2589
+ LifecycleStateSchema,
2590
+ LifecycleTerminationSchema,
2591
+ ManagedResourceSnapshotSchema2 as ManagedResourceSnapshotSchema,
2592
+ ManagedResourceStateSchema2 as ManagedResourceStateSchema,
2593
+ ManagedScheduleDescriptorSchema2 as ManagedScheduleDescriptorSchema,
2594
+ ManagedScheduleErrorPolicySchema2 as ManagedScheduleErrorPolicySchema,
2595
+ ManagedScheduleOverlapSchema2 as ManagedScheduleOverlapSchema,
2596
+ ManagedScheduleStatusSchema2 as ManagedScheduleStatusSchema,
2597
+ NotificationDeliveryStateSchema,
2598
+ NotificationPlanVersionError,
2599
+ PolicyDecisionSchema,
2600
+ PreviousExitSchema,
2601
+ RevisionSignalAdvanceResultSchema,
2602
+ RevisionSignalSnapshotSchema,
2603
+ RevisionSignalStateSchema,
2604
+ RevisionSignalWaitOutcomeSchema,
2605
+ RevisionSignalWaitResultSchema,
2606
+ applicationLifecycleEvent,
2607
+ changeSubscriptionResource,
2608
+ createActivityProjection2 as createActivityProjection,
2609
+ createApplication2 as createApplication,
2610
+ createApplicationEventSink,
2611
+ createApplicationHealthHandler,
2612
+ createApplicationOperationalHandlers,
2613
+ createApplicationSnapshotSink2 as createApplicationSnapshotSink,
2614
+ createBoundedAdmission,
2615
+ createBoundedChannel2 as createBoundedChannel,
2616
+ createCreditWindow2 as createCreditWindow,
2617
+ createDecisionPipeline,
2618
+ createManagedSchedule2 as createManagedSchedule,
2619
+ createNotificationOutbox,
2620
+ createProcessLifecycleLedger,
2621
+ createRevisionSignal,
2622
+ createWatchHub,
2623
+ defineKeyspace,
2624
+ defineManagedResource2 as defineManagedResource,
2625
+ keyspaceResource,
2626
+ lifecycleLedgerResource,
2627
+ managedResourceDependencyId2 as managedResourceDependencyId,
2628
+ managedServerResource,
2629
+ memoryKeyspaceBackend,
2630
+ notificationOutboxResource,
2631
+ notificationOutboxStateSchema,
2632
+ openKeyspace,
2633
+ projectApplicationStatus2 as projectApplicationStatus,
2634
+ readDiagnosticJournalLockDiagnosis2 as readDiagnosticJournalLockDiagnosis,
2635
+ sqliteKeyspaceBackend,
2636
+ transitionProcessDraining,
2637
+ transitionProcessReady,
2638
+ transitionProcessShutdown,
2639
+ transitionProcessStart,
2640
+ watchKey
2637
2641
  };
@@ -172,6 +172,6 @@ if (isDirectInvocation(process.argv[1], fileURLToPath(import.meta.url))) {
172
172
  }
173
173
  }
174
174
  export {
175
- runUpgradeCli,
176
- isDirectInvocation
175
+ isDirectInvocation,
176
+ runUpgradeCli
177
177
  };