@hop-top/kit 0.5.0-alpha.1 → 0.5.0-alpha.11

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 (293) hide show
  1. package/CHANGELOG.md +275 -0
  2. package/LICENSE +1 -1
  3. package/LICENSE-cobra.txt +174 -0
  4. package/NOTICE +15 -0
  5. package/README.md +55 -259
  6. package/dist/aim-DZHwwiIc.d.ts +139 -0
  7. package/dist/aim.d.ts +1 -116
  8. package/dist/aim.js +13 -414
  9. package/dist/alias-D9_qFlyP.d.ts +174 -0
  10. package/dist/alias.d.ts +2 -73
  11. package/dist/alias.js +27 -207
  12. package/dist/api-DAexsu2H.d.ts +77 -0
  13. package/dist/api.d.ts +1 -62
  14. package/dist/api.js +10 -164
  15. package/dist/auth-2-jfgiHn.d.ts +34 -0
  16. package/dist/auth.d.ts +1 -26
  17. package/dist/auth.js +6 -40
  18. package/dist/chunk-3FIKGFKI.js +54 -0
  19. package/dist/chunk-4FMALWYB.js +669 -0
  20. package/dist/chunk-4GPCWBBA.js +143 -0
  21. package/dist/chunk-4UE5TCMQ.js +104 -0
  22. package/dist/chunk-65VPWMPV.js +1134 -0
  23. package/dist/chunk-6HFAEZ52.js +29 -0
  24. package/dist/chunk-6SVOHNIC.js +17 -0
  25. package/dist/chunk-BDNNPRX6.js +41 -0
  26. package/dist/chunk-BRNEKPWX.js +37 -0
  27. package/dist/chunk-BXJ2J27B.js +219 -0
  28. package/dist/chunk-CSJWB6D3.js +151 -0
  29. package/dist/chunk-CXBZTONY.js +65 -0
  30. package/dist/chunk-EE4M2UOF.js +818 -0
  31. package/dist/chunk-GFRAYYRD.js +817 -0
  32. package/dist/chunk-IVQHLI56.js +1890 -0
  33. package/dist/chunk-IZ6Q4SE3.js +178 -0
  34. package/dist/chunk-JKMQSAJP.js +174 -0
  35. package/dist/chunk-K7E34Q3A.js +1445 -0
  36. package/dist/chunk-KVG7YCTS.js +115 -0
  37. package/dist/chunk-L23O2FFE.js +51 -0
  38. package/dist/chunk-MFVUENZR.js +1549 -0
  39. package/dist/chunk-ML7D5DWY.js +263 -0
  40. package/dist/chunk-MQXYDYRD.js +968 -0
  41. package/dist/chunk-POR5L2DG.js +247 -0
  42. package/dist/chunk-QJVSKKRQ.js +369 -0
  43. package/dist/chunk-QQQYCWSC.js +240 -0
  44. package/dist/chunk-R5U7XKVJ.js +16 -0
  45. package/dist/chunk-RYKLVOVK.js +309 -0
  46. package/dist/chunk-SNVGDYX7.js +187 -0
  47. package/dist/chunk-T6OZMPPV.js +68 -0
  48. package/dist/chunk-UKZIAQA7.js +26 -0
  49. package/dist/chunk-VGOA5Y7S.js +251 -0
  50. package/dist/chunk-VWGP4NVJ.js +513 -0
  51. package/dist/chunk-WBVO43HU.js +355 -0
  52. package/dist/chunk-WUOAQVOA.js +86 -0
  53. package/dist/chunk-XJTRY453.js +868 -0
  54. package/dist/chunk-YOBAUCVN.js +583 -0
  55. package/dist/cli-RSRk1M36.d.ts +707 -0
  56. package/dist/cli.d.ts +7 -309
  57. package/dist/cli.js +125 -945
  58. package/dist/completion-csVun6SP.d.ts +112 -0
  59. package/dist/completion-values-By-mnjNt.d.ts +142 -0
  60. package/dist/completion-values.d.ts +1 -0
  61. package/dist/completion-values.js +29 -0
  62. package/dist/completion.d.ts +3 -0
  63. package/dist/completion.js +34 -0
  64. package/dist/compliance-AxFf-uMy.d.ts +60 -0
  65. package/dist/compliance.d.ts +1 -0
  66. package/dist/compliance.js +17 -0
  67. package/dist/config-CaK60ByQ.d.ts +241 -0
  68. package/dist/config.d.ts +1 -97
  69. package/dist/config.js +8 -78
  70. package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
  71. package/dist/errcorrect.d.ts +1 -37
  72. package/dist/errcorrect.js +8 -68
  73. package/dist/error-Do8Qji43.d.ts +231 -0
  74. package/dist/id/index.d.ts +2 -83
  75. package/dist/id/index.js +14 -65
  76. package/dist/index-BKJZClJx.d.ts +1486 -0
  77. package/dist/index-C3Zw4wDJ.d.ts +359 -0
  78. package/dist/index-CGE5yLBj.d.ts +328 -0
  79. package/dist/index-VLDcI5NF.d.ts +95 -0
  80. package/dist/index.d.ts +37 -0
  81. package/dist/index.js +132 -0
  82. package/dist/llm-DYuR7_uX.d.ts +1069 -0
  83. package/dist/llm-anthropic-Cd_I2xXB.d.ts +67 -0
  84. package/dist/llm-anthropic.d.ts +2 -0
  85. package/dist/llm-anthropic.js +13 -0
  86. package/dist/llm-openai-DyFrucmV.d.ts +87 -0
  87. package/dist/llm-openai.d.ts +2 -0
  88. package/dist/llm-openai.js +19 -0
  89. package/dist/llm.d.ts +1 -188
  90. package/dist/llm.js +101 -356
  91. package/dist/log-CkaxMX3U.d.ts +115 -0
  92. package/dist/log.d.ts +2 -0
  93. package/dist/log.js +14 -0
  94. package/dist/mcp/index.d.ts +4 -0
  95. package/dist/mcp/index.js +185 -0
  96. package/dist/netpolicy-Brx5XZUB.d.ts +151 -0
  97. package/dist/netpolicy.d.ts +1 -0
  98. package/dist/netpolicy.js +25 -0
  99. package/dist/output-CjZWmL8s.d.ts +420 -0
  100. package/dist/output.d.ts +3 -213
  101. package/dist/output.js +135 -447
  102. package/dist/parity-CvMuYcVI.d.ts +61 -0
  103. package/dist/progress-CAzyxeWl.d.ts +38 -0
  104. package/dist/progress.d.ts +1 -30
  105. package/dist/progress.js +6 -55
  106. package/dist/provenance-SMFHm5gx.d.ts +30 -0
  107. package/dist/provenance.d.ts +1 -24
  108. package/dist/provenance.js +6 -31
  109. package/dist/routellm-B0nv59mH.d.ts +111 -0
  110. package/dist/routellm.d.ts +2 -64
  111. package/dist/routellm.js +13 -255
  112. package/dist/rpc-D31Lg0Kc.d.ts +32 -0
  113. package/dist/rpc.d.ts +2 -25
  114. package/dist/rpc.js +4 -98
  115. package/dist/safety-CUaYEjZc.d.ts +30 -0
  116. package/dist/safety.d.ts +1 -24
  117. package/dist/safety.js +6 -43
  118. package/dist/scope-BrhYB4ij.d.ts +141 -0
  119. package/dist/scope.d.ts +1 -121
  120. package/dist/scope.js +20 -377
  121. package/dist/serve-D8yWMrTc.d.ts +646 -0
  122. package/dist/serve.d.ts +3 -0
  123. package/dist/serve.js +75 -0
  124. package/dist/sqlstore.js +6 -39
  125. package/dist/stream-CrjeCp0M.d.ts +44 -0
  126. package/dist/stream.d.ts +1 -35
  127. package/dist/stream.js +8 -51
  128. package/dist/telemetry/index.d.ts +1 -315
  129. package/dist/telemetry/index.js +26 -599
  130. package/dist/toolspec-DcPwwoAZ.d.ts +368 -0
  131. package/dist/toolspec.d.ts +2 -0
  132. package/dist/toolspec.js +37 -0
  133. package/dist/tui/index.d.ts +6 -298
  134. package/dist/tui/index.js +17 -381
  135. package/dist/upgrade-C3RWGwRi.d.ts +125 -0
  136. package/dist/upgrade.d.ts +1 -95
  137. package/dist/upgrade.js +6 -114
  138. package/dist/xdg-DB7Shoib.d.ts +179 -0
  139. package/dist/xdg.d.ts +1 -169
  140. package/dist/xdg.js +14 -128
  141. package/package.json +192 -24
  142. package/src/README.md +15 -0
  143. package/src/alias.conformance.test.ts +250 -0
  144. package/src/alias.test.ts +206 -2
  145. package/src/alias.ts +196 -21
  146. package/src/cli.help-command.test.ts +105 -0
  147. package/src/cli.offline.test.ts +93 -0
  148. package/src/cli.parity.test.ts +192 -0
  149. package/src/cli.root.conformance.test.ts +166 -0
  150. package/src/cli.test.ts +95 -1
  151. package/src/cli.ts +234 -25
  152. package/src/completion-scripts.ts +16 -0
  153. package/src/completion-values.test.ts +76 -16
  154. package/src/completion-values.ts +170 -66
  155. package/src/completion.conformance.test.ts +298 -0
  156. package/src/completion.test.ts +268 -145
  157. package/src/completion.ts +772 -121
  158. package/src/compliance.test.ts +196 -2
  159. package/src/compliance.ts +440 -20
  160. package/src/config-merge.test.ts +425 -0
  161. package/src/config.test.ts +228 -1
  162. package/src/config.ts +429 -16
  163. package/src/delegation.test.ts +299 -0
  164. package/src/delegation.ts +807 -0
  165. package/src/gen/crud_pb.ts +7 -7
  166. package/src/id/README.md +38 -0
  167. package/src/id/contract.test.ts +1 -1
  168. package/src/id/index.test.ts +1 -1
  169. package/src/id/index.ts +3 -2
  170. package/src/index.test.ts +71 -0
  171. package/src/index.ts +46 -0
  172. package/src/llm-anthropic.conformance.test.ts +1135 -0
  173. package/src/llm-anthropic.test.ts +152 -0
  174. package/src/llm-anthropic.ts +940 -0
  175. package/src/llm-choice-hermetic.test.ts +335 -0
  176. package/src/llm-config.test.ts +232 -0
  177. package/src/llm-config.ts +106 -0
  178. package/src/llm-endpoint.ts +254 -0
  179. package/src/llm-error.ts +17 -0
  180. package/src/llm-errors.ts +152 -0
  181. package/src/llm-file.ts +126 -0
  182. package/src/llm-http.ts +317 -0
  183. package/src/llm-keys.ts +167 -0
  184. package/src/llm-media.conformance.test.ts +87 -0
  185. package/src/llm-media.test.ts +279 -0
  186. package/src/llm-media.ts +322 -0
  187. package/src/llm-openai.conformance.test.ts +407 -0
  188. package/src/llm-openai.test.ts +510 -0
  189. package/src/llm-openai.ts +708 -0
  190. package/src/llm-payload.ts +155 -0
  191. package/src/llm-quote.ts +46 -0
  192. package/src/llm-routellm.conformance.test.ts +44 -0
  193. package/src/llm-toolnames.conformance.test.ts +112 -0
  194. package/src/llm-toolnames.test.ts +132 -0
  195. package/src/llm-toolnames.ts +298 -0
  196. package/src/llm-uri.ts +99 -0
  197. package/src/llm.test.ts +43 -15
  198. package/src/llm.toolcall.test.ts +175 -0
  199. package/src/llm.ts +602 -190
  200. package/src/log.parity.test.ts +105 -0
  201. package/src/log.test.ts +270 -1
  202. package/src/log.ts +228 -49
  203. package/src/mcp/README.md +63 -0
  204. package/src/mcp/args-separator.test.ts +164 -0
  205. package/src/mcp/args.test.ts +223 -0
  206. package/src/mcp/args.ts +160 -0
  207. package/src/mcp/audit.test.ts +520 -0
  208. package/src/mcp/audit.ts +70 -0
  209. package/src/mcp/bridge.test.ts +250 -0
  210. package/src/mcp/bridge.ts +286 -0
  211. package/src/mcp/conformance.test.ts +357 -0
  212. package/src/mcp/dispatch.ts +359 -0
  213. package/src/mcp/identity.test.ts +166 -0
  214. package/src/mcp/identity.ts +72 -0
  215. package/src/mcp/index.ts +176 -0
  216. package/src/mcp/legacy-notify.test.ts +59 -0
  217. package/src/mcp/legacy.ts +367 -0
  218. package/src/mcp/mcp.test.ts +707 -0
  219. package/src/mcp/modern-confirm.test.ts +520 -0
  220. package/src/mcp/modern-confirm.ts +484 -0
  221. package/src/mcp/modern.ts +788 -0
  222. package/src/mcp/stdio.test.ts +313 -0
  223. package/src/mcp/stdio.ts +254 -0
  224. package/src/mcp/tasks.ts +82 -0
  225. package/src/mcp/testtree.ts +250 -0
  226. package/src/mcp/toolname.test.ts +147 -0
  227. package/src/mcp/types.ts +689 -0
  228. package/src/netpolicy.test.ts +280 -0
  229. package/src/netpolicy.ts +256 -0
  230. package/src/output/README.md +46 -0
  231. package/src/output/builtins.ts +5 -5
  232. package/src/output/dispatch.ts +10 -2
  233. package/src/output/error.ts +459 -0
  234. package/src/output/formatter.ts +29 -5
  235. package/src/output/formatters/README.md +50 -0
  236. package/src/output/formatters/csv.ts +48 -12
  237. package/src/output/formatters/json.ts +4 -25
  238. package/src/output/formatters/project.ts +34 -0
  239. package/src/output/formatters/table.ts +8 -6
  240. package/src/output/formatters/text.ts +7 -3
  241. package/src/output/formatters/yaml.ts +5 -22
  242. package/src/output/projection.test.ts +298 -0
  243. package/src/output/projection.ts +33 -59
  244. package/src/output/template.ts +11 -21
  245. package/src/output.surface.test.ts +41 -0
  246. package/src/output.ts +64 -3
  247. package/src/plan.ts +89 -0
  248. package/src/policy.ts +472 -0
  249. package/src/published-types.test.ts +133 -0
  250. package/src/routellm.test.ts +209 -28
  251. package/src/routellm.toolcall.test.ts +521 -0
  252. package/src/routellm.ts +213 -177
  253. package/src/router/README.md +44 -0
  254. package/src/router/server.test.ts +41 -0
  255. package/src/router/server.ts +11 -0
  256. package/src/safety.test.ts +19 -9
  257. package/src/scope-defaults.json +29 -29
  258. package/src/serve.test.ts +1257 -0
  259. package/src/serve.ts +1665 -0
  260. package/src/sideeffect.ts +105 -0
  261. package/src/telemetry/README.md +48 -0
  262. package/src/telemetry/client.test.ts +31 -0
  263. package/src/telemetry/client.ts +12 -6
  264. package/src/telemetry/offline.test.ts +64 -0
  265. package/src/toolspec-internal.ts +279 -0
  266. package/src/toolspec-manifest.test.ts +167 -0
  267. package/src/toolspec-manifest.ts +415 -0
  268. package/src/toolspec-spec-schemas.ts +12 -0
  269. package/src/toolspec-spec.test.ts +273 -0
  270. package/src/toolspec-spec.ts +458 -0
  271. package/src/toolspec.from-command.test.ts +350 -0
  272. package/src/toolspec.test.ts +2 -2
  273. package/src/toolspec.ts +222 -0
  274. package/src/triton/README.md +34 -0
  275. package/src/tui/README.md +42 -0
  276. package/src/tui/parity.test.ts +120 -31
  277. package/src/tui/parity.ts +58 -7
  278. package/src/upgrade.test.ts +291 -0
  279. package/src/upgrade.ts +116 -7
  280. package/src/wizard.test.ts +7 -7
  281. package/test/llm/conformance-helpers.ts +100 -0
  282. package/test/output/csv.test.ts +164 -0
  283. package/test/output/dispatch.test.ts +1 -2
  284. package/test/output/error.test.ts +277 -0
  285. package/test/output/smoke-capture.ts +2 -2
  286. package/test/output/smoke.test.ts +2 -2
  287. package/test/output/taxonomy-contract.test.ts +148 -0
  288. package/test/setup-env.ts +16 -0
  289. package/test/toolspec/fixture.ts +79 -0
  290. package/tsconfig.json +3 -1
  291. package/tsconfig.test.json +10 -0
  292. package/vitest.config.ts +9 -0
  293. package/src/tui/parity.json +0 -74
@@ -0,0 +1,646 @@
1
+ import { Command } from 'commander';
2
+ import { C as CliError, a as CODE_TRANSIENT } from './error-Do8Qji43.js';
3
+
4
+ /**
5
+ * @module serve
6
+ * @package @hop-top/kit
7
+ *
8
+ * Serve hierarchy and service lifecycle — the TypeScript port of the
9
+ * contract in `docs/contracts/serve-lifecycle.md`, §"Cross-language
10
+ * parity".
11
+ *
12
+ * `<tool> serve` supervises every configured and enabled service;
13
+ * `<tool> serve <service>` selects exactly one and overrides aggregate
14
+ * enablement. Both forms share one lifecycle implementation, so a
15
+ * service started by the selector observes the same readiness,
16
+ * shutdown, and exit semantics as the same service started by the
17
+ * supervisor.
18
+ *
19
+ * The Go reference is `go/console/serve`. This module mirrors the
20
+ * behavior the contract makes cross-language, and deliberately does
21
+ * not mirror what the contract rules out — there is no REST/OpenAPI
22
+ * projection, no socket service, no command-tree reflection, and no
23
+ * permission/provenance/audit surface here, because those depend on
24
+ * Go-only machinery.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { createCLI } from '@hop-top/kit/cli';
29
+ * import { ServiceRegistry, registerServe } from '@hop-top/kit/serve';
30
+ *
31
+ * const registry = new ServiceRegistry();
32
+ * registry.register({
33
+ * name: 'api',
34
+ * async start(signal, ready) {
35
+ * ready();
36
+ * await new Promise<void>(r => signal.addEventListener('abort', () => r(), { once: true }));
37
+ * },
38
+ * ready: () => true,
39
+ * async stop() {},
40
+ * });
41
+ *
42
+ * const { program } = createCLI({ name: 'mytool', version: '1.0.0', description: 'My tool' });
43
+ * registerServe(program, { registry, configs: { api: { enabled: true } } });
44
+ * program.parse();
45
+ * ```
46
+ */
47
+
48
+ /**
49
+ * Service identifier grammar: lowercase ASCII, digits, and internal
50
+ * hyphens. An identifier is a CLI word, a config key segment, and an
51
+ * event payload value at once, which is why the grammar is contract
52
+ * rather than a local convention.
53
+ */
54
+ declare const NAME_PATTERN: RegExp;
55
+ /**
56
+ * Names reserved for selector vocabulary. Registering one would make
57
+ * `serve <name>` ambiguous with a future aggregate form, and is why
58
+ * `--list` is a flag rather than a `serve list` child.
59
+ */
60
+ declare const RESERVED_NAMES: readonly string[];
61
+ /** Reports whether `name` is one of the reserved selector words. */
62
+ declare function isReservedName(name: string): boolean;
63
+ /**
64
+ * Validates a service identifier, returning an error message or
65
+ * `null`. Mirrors Go's `serve.ValidateName`.
66
+ */
67
+ declare function validateName(name: string): string | null;
68
+ /**
69
+ * One long-running thing a tool can serve.
70
+ *
71
+ * The four required capabilities are the contract's minimum: a name, a
72
+ * start that runs until aborted or failed, a readiness report, and a
73
+ * stop. Go expresses them as an interface; here they are properties on
74
+ * a plain object, which the contract explicitly permits — what is
75
+ * fixed is the capability set and each one's behavior, not a method
76
+ * table.
77
+ */
78
+ interface Service {
79
+ /**
80
+ * Stable service identifier. Must satisfy {@link validateName} and
81
+ * must not change across releases: renaming one is a breaking change
82
+ * to the command surface, the config file, and any subscriber.
83
+ */
84
+ name: string;
85
+ /**
86
+ * Begins serving. Resolves when `signal` aborts (a clean stop) and
87
+ * rejects when the service fails.
88
+ *
89
+ * `ready` must be called exactly once, after every acquisition that
90
+ * can fail deterministically has succeeded — the listener bound, the
91
+ * file created, the subscription attached. Calling it more than once
92
+ * is ignored rather than an error; the supervisor reports ready at
93
+ * most once per start either way.
94
+ */
95
+ start(signal: AbortSignal, ready: () => void): Promise<void>;
96
+ /**
97
+ * Whether the service is currently accepting work. Readiness, not
98
+ * liveness: a ready service may be idle, and may later fail.
99
+ */
100
+ ready(): boolean;
101
+ /**
102
+ * Drains in-flight work and releases resources. The supervisor
103
+ * bounds it by the stop timeout and abandons a stop that exceeds it,
104
+ * so an implementation must respect `signal` rather than assume it
105
+ * will be allowed to finish.
106
+ */
107
+ stop(signal: AbortSignal): Promise<void>;
108
+ /**
109
+ * Optional configuration gate — the second of the three validation
110
+ * gates. Returns an error message, or `null` when the resolved
111
+ * configuration is complete and usable.
112
+ */
113
+ validate?(): string | null;
114
+ /**
115
+ * Optional ordering declaration. Start order is topological over
116
+ * these, ties broken by registration order; stop order is the exact
117
+ * reverse of the order services actually started.
118
+ */
119
+ dependsOn?(): string[];
120
+ /**
121
+ * Optional address declaration. Read once the service reports ready
122
+ * and carried into the readiness event, so an operator learns where
123
+ * the service actually bound — including a port the kernel picked
124
+ * for a wildcard address, which configuration cannot reveal.
125
+ */
126
+ addr?(): string;
127
+ /**
128
+ * Optional policy declaration: the `kit/side-effect` and
129
+ * `kit/network` classes, in that order. A service that omits it is
130
+ * unclassified and passes the policy gate.
131
+ */
132
+ class?(): [sideEffect: string, network: string];
133
+ }
134
+ /**
135
+ * The third validation gate. A service whose declared class the gate
136
+ * denies is refused at `UNAUTHORIZED`, exit 5.
137
+ *
138
+ * The contract requires the gate, not Go's YAML-driven
139
+ * side-effect × network table: a two-argument predicate satisfies it.
140
+ * A registry with no gate passes every service, because a tool that
141
+ * has wired no policy has expressed no restriction.
142
+ */
143
+ interface PolicyGate {
144
+ allow(sideEffect: string, network: string): {
145
+ ok: boolean;
146
+ reason?: string;
147
+ };
148
+ }
149
+ /**
150
+ * Thrown when a registration is rejected at construction time.
151
+ *
152
+ * A duplicate name or an invalid one is a wiring bug in the tool's
153
+ * entry point, not a runtime condition: it surfaces on the first run
154
+ * rather than at the first `serve`, and there is no last-writer-wins
155
+ * path. Go panics; throwing is this port's equivalent. What the
156
+ * contract forbids is letting execution survive it as a warning.
157
+ */
158
+ declare class ServiceRegistrationError extends Error {
159
+ constructor(message: string);
160
+ }
161
+ /**
162
+ * The seam kit-owned and adopter-owned services register into. A tool
163
+ * builds one before the root command parses; the supervisor reads it.
164
+ */
165
+ declare class ServiceRegistry {
166
+ private readonly byName;
167
+ private readonly order;
168
+ /**
169
+ * Adds `svc` under its name.
170
+ *
171
+ * Throws on an invalid name and on a duplicate. An adopter
172
+ * deliberately replacing a kit-shipped service calls
173
+ * {@link ServiceRegistry.override} instead — the documented escape
174
+ * hatch, and the only path that accepts a duplicate name.
175
+ */
176
+ register(svc: Service): void;
177
+ /**
178
+ * Registers `svc`, replacing any service already under its name and
179
+ * keeping that name's original position in {@link list}.
180
+ *
181
+ * Still throws on an invalid name: override lifts the collision
182
+ * rule, not the grammar.
183
+ */
184
+ override(svc: Service): void;
185
+ /** The service registered under `name`, if any. */
186
+ lookup(name: string): Service | undefined;
187
+ /** Every registered identifier, in registration order. */
188
+ names(): string[];
189
+ /** Every registered service, in registration order. */
190
+ list(): Service[];
191
+ /** Number of registered services. */
192
+ get size(): number;
193
+ }
194
+ /** Default budget from start to readiness. `services.<name>.ready_timeout`. */
195
+ declare const DEFAULT_READY_TIMEOUT_MS = 30000;
196
+ /** Default budget for one stop. `services.<name>.stop_timeout`. */
197
+ declare const DEFAULT_STOP_TIMEOUT_MS = 30000;
198
+ /** Default total shutdown budget. `services.shutdown_timeout`. */
199
+ declare const DEFAULT_SHUTDOWN_TIMEOUT_MS = 60000;
200
+ /**
201
+ * The resolved `services.<name>` block for one service. Only the
202
+ * lifecycle keys are modeled; service-specific keys live in the same
203
+ * block and are read by the service itself.
204
+ */
205
+ interface ServiceConfig {
206
+ /**
207
+ * `services.<name>.enabled`. Decides whether the supervisor form
208
+ * starts this service. Defaults to `false`: a service that starts
209
+ * listening because a dependency upgrade added it to the registry is
210
+ * an unrequested open port.
211
+ */
212
+ enabled?: boolean;
213
+ /** `services.<name>.ready_timeout`, in milliseconds. */
214
+ readyTimeoutMs?: number;
215
+ /** `services.<name>.stop_timeout`, in milliseconds. */
216
+ stopTimeoutMs?: number;
217
+ }
218
+ /** The supervisor's answer to "one service failed while others run". */
219
+ type FailurePolicy = 'fail-fast' | 'isolate';
220
+ /** `services.failure_policy` default. */
221
+ declare const DEFAULT_FAILURE_POLICY: FailurePolicy;
222
+ /** Reports whether `p` is a declared failure policy. */
223
+ declare function isFailurePolicy(p: string): p is FailurePolicy;
224
+ /** The supervisor-scoped half of the `services` block. */
225
+ interface SupervisorConfig {
226
+ failurePolicy?: FailurePolicy;
227
+ shutdownTimeoutMs?: number;
228
+ }
229
+ /** The kinds of ending a serve run can have. */
230
+ type LifecycleOutcome = 'clean-stop' | 'invalid-selection' | 'config-invalid' | 'no-services' | 'unknown-service' | 'policy-denied' | 'start-failed' | 'runtime-crash' | 'shutdown-timeout';
231
+ /**
232
+ * Process exit code for `o`. An outcome with no table row is treated
233
+ * as a generic failure rather than a success, so a kind added without
234
+ * a row fails loudly instead of silently exiting 0.
235
+ */
236
+ declare function exitCodeFor(o: LifecycleOutcome): number;
237
+ /** The `CODE_*` string for `o`, for the rendered error envelope. */
238
+ declare function codeFor(o: LifecycleOutcome): string;
239
+ /** Whether `o` exits non-zero. */
240
+ declare function isFailure(o: LifecycleOutcome): boolean;
241
+ /**
242
+ * The outcome the process should exit on given everything observed.
243
+ *
244
+ * "Worst" is severity, not exit-code magnitude: any failure beats a
245
+ * clean stop, and among failures the first observed wins, because it
246
+ * is the one that explains the rest. Under `isolate` a process may
247
+ * survive several failures, and the exit code must reflect the worst
248
+ * outcome across the whole run rather than the last one.
249
+ */
250
+ declare function worstOutcome(observed: readonly LifecycleOutcome[]): LifecycleOutcome;
251
+ /** A parsed `serve` invocation. */
252
+ interface ResolveRequest {
253
+ /**
254
+ * Positional arguments after the `serve` word. Empty is the
255
+ * supervisor form, exactly one the selector form, two or more a
256
+ * usage error.
257
+ */
258
+ args: readonly string[];
259
+ /**
260
+ * Resolved `services.<name>` block per service. A service with no
261
+ * entry is not configured, and the supervisor form skips it.
262
+ */
263
+ configs?: Readonly<Record<string, ServiceConfig>>;
264
+ /** The third validation gate. Omitted passes everything. */
265
+ policy?: PolicyGate;
266
+ }
267
+ /** The result of resolving a request against a registry. */
268
+ interface ResolveOutcome {
269
+ /** Identifiers to run, in registration order. Empty when `error` is set. */
270
+ selected: string[];
271
+ /**
272
+ * True when the selector form was used. Under it `selected` holds
273
+ * exactly one name and aggregate enablement was overridden rather
274
+ * than consulted.
275
+ */
276
+ explicit: boolean;
277
+ /**
278
+ * Configured-but-disabled services the supervisor form passed over.
279
+ * Skipping is not an error and must not affect the exit code.
280
+ */
281
+ skipped: string[];
282
+ /** The refusal, already carrying its code and exit code. */
283
+ error?: CliError;
284
+ /** The outcome the refusal corresponds to. */
285
+ outcome?: LifecycleOutcome;
286
+ }
287
+ /**
288
+ * Turns a `serve` invocation into a runnable set, applying the
289
+ * hierarchy and the override rule. Pure: nothing is started, nothing
290
+ * binds, nothing is written.
291
+ *
292
+ * Selector form runs the named service **even when
293
+ * `services.<name>.enabled` is false**, provided all three gates pass
294
+ * in order — registration, then configuration, then policy.
295
+ * Enablement is not a gate there: an operator naming a service on the
296
+ * command line has already made the decision the flag exists to
297
+ * automate.
298
+ *
299
+ * Supervisor form runs every service that is both configured and
300
+ * enabled, in registration order, skipping a disabled one silently.
301
+ * Resolving to zero services is a usage error, not a clean exit: a
302
+ * process that exits 0 without listening is indistinguishable from a
303
+ * successful start to systemd or a container runtime.
304
+ */
305
+ declare function resolve(registry: ServiceRegistry, req: ResolveRequest): ResolveOutcome;
306
+ /**
307
+ * `selected` in topological order over the optional `dependsOn`
308
+ * declarations, ties broken by the order in `selected` (which
309
+ * {@link resolve} returns in registration order).
310
+ *
311
+ * A dependency naming a service outside `selected` is ignored rather
312
+ * than an error: under the selector form exactly one service runs, and
313
+ * its dependencies are the operator's business, not a reason to refuse
314
+ * a deliberate single-service start.
315
+ *
316
+ * A dependency cycle throws, in the same class as a name collision: it
317
+ * is a wiring bug that can only be fixed by editing the registrations,
318
+ * and there is no order the supervisor could pick that would be right.
319
+ */
320
+ declare function startOrder(registry: ServiceRegistry, selected: readonly string[]): string[];
321
+ /** The 2-segment source.category prefix serve events publish under. */
322
+ declare const DEFAULT_TOPIC_PREFIX = "kit.serve";
323
+ /** Action segments. A bare `ready` does not validate; do not use one. */
324
+ declare const ACTION_STARTED = "started";
325
+ declare const ACTION_READY_REPORTED = "ready_reported";
326
+ declare const ACTION_FAILED = "failed";
327
+ declare const ACTION_STOPPED = "stopped";
328
+ /**
329
+ * Object segments. The service identifier travels in the payload, not
330
+ * the topic, so subscribers are not forced to re-bind when a tool
331
+ * gains a service.
332
+ */
333
+ declare const OBJECT_SERVICE = "service";
334
+ declare const OBJECT_SUPERVISOR = "supervisor";
335
+ /**
336
+ * The conformant topic set for `prefix`, keyed `<object>.<action>`.
337
+ * These strings are contract: a subscriber is written against them and
338
+ * does not know which language published.
339
+ */
340
+ declare function defaultTopics(prefix?: string): Record<string, string>;
341
+ /** The body of every serve lifecycle event. */
342
+ interface EventPayload {
343
+ /** Service the event concerns. Absent for supervisor-scoped events. */
344
+ service?: string;
345
+ /** Failure text for a `failed` event. Never in the topic. */
346
+ error?: string;
347
+ /** Why, for events that have a reason. */
348
+ reason?: string;
349
+ /** Milliseconds since the supervisor began the run. */
350
+ elapsed_ms: number;
351
+ /** Where the service accepts work, on `ready_reported` only. */
352
+ address?: string;
353
+ }
354
+ /**
355
+ * The narrow slice of a bus the supervisor needs. Omitting one means
356
+ * events are not published; the log counterpart still runs, so a tool
357
+ * with no bus still produces an operator-legible startup trace.
358
+ */
359
+ interface Publisher {
360
+ publish(event: {
361
+ topic: string;
362
+ source: string;
363
+ payload: EventPayload;
364
+ }): void;
365
+ }
366
+ /**
367
+ * The narrow slice of a structured logger the supervisor needs. It
368
+ * matches the shape `@hop-top/kit/log` returns, so a kit logger
369
+ * satisfies it without an adapter.
370
+ */
371
+ interface ServeLogger {
372
+ info(msg: string, ...keyvals: unknown[]): void;
373
+ error(msg: string, ...keyvals: unknown[]): void;
374
+ }
375
+ /** What one supervised run produced. */
376
+ interface RunResult {
377
+ /** The worst outcome observed, which is what the process exits on. */
378
+ outcome: LifecycleOutcome;
379
+ /** The rendered failure carrying code and exit code; absent on a clean stop. */
380
+ error?: CliError;
381
+ /** Identifiers whose start was invoked, in invocation order. */
382
+ started: string[];
383
+ /** Identifiers that reported ready, in report order. */
384
+ ready: string[];
385
+ /** Identifier to the error it failed with. */
386
+ failed: Record<string, string>;
387
+ /** The process exit code for this run. */
388
+ exitCode: number;
389
+ }
390
+ /** Options for {@link Supervisor}. */
391
+ interface SupervisorOptions {
392
+ config?: SupervisorConfig;
393
+ publisher?: Publisher;
394
+ logger?: ServeLogger;
395
+ topics?: Record<string, string>;
396
+ eventSource?: string;
397
+ /** Replaces the notion of elapsed time. Tests use it; production does not. */
398
+ now?: () => number;
399
+ /**
400
+ * Aborts the drain. A second signal fires this, so an operator can
401
+ * escalate without reaching for SIGKILL.
402
+ */
403
+ escalate?: AbortSignal;
404
+ }
405
+ /**
406
+ * Runs a resolved set of services under one lifecycle: ordered start,
407
+ * per-service readiness, policy-driven reaction to failure, and
408
+ * ordered stop bounded by the configured budgets.
409
+ *
410
+ * A Supervisor holds no module-level state, so two can run
411
+ * concurrently in one process — which is exactly what a test does.
412
+ */
413
+ declare class Supervisor {
414
+ private readonly registry;
415
+ private readonly failurePolicy;
416
+ private readonly shutdownTimeoutMs;
417
+ private readonly emitter;
418
+ private readonly now;
419
+ private readonly escalate?;
420
+ constructor(registry: ServiceRegistry, opts?: SupervisorOptions);
421
+ /**
422
+ * Starts every service in `selected`, waits for the run to end, and
423
+ * stops everything in reverse start order.
424
+ *
425
+ * The run ends when `signal` aborts (the clean path: a signal, or
426
+ * the caller's own shutdown), when a failure trips the failure
427
+ * policy, or when every started service has returned. Run always
428
+ * performs the ordered stop before returning, so a caller never has
429
+ * to clean up after it.
430
+ *
431
+ * `selected` is normally {@link ResolveOutcome.selected}; run does
432
+ * not re-resolve and does not consult enablement, because the
433
+ * decision the caller already made is the one to honor.
434
+ */
435
+ run(signal: AbortSignal, selected: readonly string[], configs?: Readonly<Record<string, ServiceConfig>>): Promise<RunResult>;
436
+ /**
437
+ * Starts each service in order, waiting for each to report ready
438
+ * (or fail, or exhaust its budget) before starting the next.
439
+ *
440
+ * Serial start is what makes `dependsOn` mean anything: a dependent
441
+ * must not begin acquiring before its dependency is accepting work.
442
+ * Returns true when a start failure short-circuits the sequence.
443
+ */
444
+ private startAll;
445
+ /**
446
+ * Blocks until `name` reports ready, fails, or exhausts its
447
+ * readiness budget. A service that has not reported ready within the
448
+ * budget is a start failure.
449
+ */
450
+ private awaitReady;
451
+ /**
452
+ * Publishes the supervisor-scoped readiness event once every started
453
+ * service is ready.
454
+ */
455
+ private emitAggregateReady;
456
+ /**
457
+ * Blocks while the services run. Returns when the run signal aborts,
458
+ * when the failure policy trips, or when the last running service
459
+ * has exited.
460
+ */
461
+ private await_;
462
+ /**
463
+ * Invokes stop in the exact reverse of the order services actually
464
+ * started, one at a time, so a dependent is always fully stopped
465
+ * before its dependency.
466
+ *
467
+ * Each stop is bounded by that service's budget. One that exceeds it
468
+ * is abandoned — logged, emitted as failed, and the supervisor
469
+ * proceeds to the next rather than blocking the whole shutdown on
470
+ * one straggler. Exceeding the total budget ends the sequence with
471
+ * `shutdown-timeout`.
472
+ */
473
+ private stopAll;
474
+ /** Bounds one stop by its budget and by whatever remains of the total. */
475
+ private stopOne;
476
+ private addrOf;
477
+ /** Assembles the result from everything the run observed. */
478
+ private finish;
479
+ }
480
+ /**
481
+ * Holds the Node event loop open for as long as a run is live.
482
+ *
483
+ * Neither a `process.on(signal)` listener nor an `AbortSignal` listener
484
+ * refs the loop: a supervisor whose services are all parked on their
485
+ * abort signal has no referenced handle, and Node exits 0 the moment
486
+ * the synchronous part of `run` yields. That is the failure the
487
+ * contract's zero-services rule exists to prevent, arriving by another
488
+ * route — a process that exits 0 without listening is
489
+ * indistinguishable from a successful start to systemd or a container
490
+ * runtime.
491
+ *
492
+ * A long referenced interval is the cheapest handle that survives every
493
+ * platform; it is cleared the moment the run ends, so it never delays
494
+ * an exit.
495
+ */
496
+ declare class LoopKeepAlive {
497
+ private handle?;
498
+ hold(): void;
499
+ release(): void;
500
+ /**
501
+ * Whether a referenced handle is currently held.
502
+ *
503
+ * Node's `process._getActiveHandles()` does not report timers, so
504
+ * this is the only honest way to observe the property that matters.
505
+ */
506
+ get held(): boolean;
507
+ }
508
+ /** The signals the supervisor listens for. SIGKILL is not catchable. */
509
+ declare const SHUTDOWN_SIGNALS: readonly NodeJS.Signals[];
510
+ /**
511
+ * A signal handler pair: `signal` aborts on the first SIGINT/SIGTERM,
512
+ * `escalate` on a second of either kind.
513
+ *
514
+ * The first signal begins graceful shutdown; a second aborts the
515
+ * drain, so an operator can escalate without reaching for SIGKILL.
516
+ * `stop` removes the process listeners and must be called, or the
517
+ * handlers outlive the run.
518
+ */
519
+ declare function signalController(): {
520
+ signal: AbortSignal;
521
+ escalate: AbortSignal;
522
+ stop: () => void;
523
+ };
524
+ /**
525
+ * Applies `--enable` / `--disable` on top of the resolved
526
+ * `services.<name>` blocks, returning a new map.
527
+ *
528
+ * An unconfigured service becomes configured the moment an operator
529
+ * names it in `--enable`: the flag is the aggregate equivalent of the
530
+ * selector's override rule. `--disable` on a configured service clears
531
+ * its enablement so the supervisor form skips it silently; on an
532
+ * unconfigured service it is a no-op. Enable wins over disable for the
533
+ * same name — the affirmative act is the more specific one.
534
+ */
535
+ declare function applyEnableDisable(configs: Readonly<Record<string, ServiceConfig>>, enable: readonly string[], disable: readonly string[]): Record<string, ServiceConfig>;
536
+ /**
537
+ * Applies `--ready-timeout` / `--stop-timeout` across every resolved
538
+ * service, returning a new map. The flags map onto the per-service
539
+ * keys, so a flag set on the supervisor form applies the same budget
540
+ * to every member of the set — which is what an operator tuning a
541
+ * whole process, rather than one service, is asking for.
542
+ */
543
+ declare function applyTimeoutOverrides(configs: Readonly<Record<string, ServiceConfig>>, readyTimeoutMs?: number, stopTimeoutMs?: number): Record<string, ServiceConfig>;
544
+ /**
545
+ * Parses a duration flag value into milliseconds, or `null` when it
546
+ * does not parse. Accepts Go's value+unit sequence (`30s`, `1m30s`,
547
+ * `500ms`) and a bare number, read as seconds the way the config keys
548
+ * are. The spelling accepted here is not contract; the flag names are.
549
+ */
550
+ declare function parseDurationMs(raw: string): number | null;
551
+ /** Options for {@link registerServe}. */
552
+ interface RegisterServeOptions {
553
+ /** The seam services were registered into. */
554
+ registry: ServiceRegistry;
555
+ /** Resolved `services.<name>` blocks, keyed by identifier. */
556
+ configs?: Readonly<Record<string, ServiceConfig>>;
557
+ /** The supervisor-scoped half of the `services` block. */
558
+ config?: SupervisorConfig;
559
+ /** The third validation gate. */
560
+ policy?: PolicyGate;
561
+ publisher?: Publisher;
562
+ logger?: ServeLogger;
563
+ /** Where `--list` writes. Defaults to `process.stdout`. */
564
+ stdout?: {
565
+ write(s: string): unknown;
566
+ };
567
+ /**
568
+ * Called with the run's exit code instead of exiting the process.
569
+ * Tests supply one; production omits it and the command sets
570
+ * `process.exitCode`.
571
+ */
572
+ onExit?: (code: number, error?: CliError) => void;
573
+ }
574
+ /**
575
+ * Mounts the kit-owned `serve` command on `program`.
576
+ *
577
+ * With no positional argument it is the supervisor over every
578
+ * configured and enabled service; with exactly one it is the selector,
579
+ * which overrides aggregate enablement. Two or more is a usage error
580
+ * at exit 2 — the arity refusal is owned here rather than left to
581
+ * commander, whose own excess-argument error exits 1.
582
+ *
583
+ * The inspection form is the `--list` flag, not a `list` child:
584
+ * `list` is reserved selector vocabulary, so a `serve list` child
585
+ * would be indistinguishable from the selector form naming a service
586
+ * called `list`.
587
+ */
588
+ declare function registerServe(program: Command, opts: RegisterServeOptions): Command;
589
+
590
+ declare const serve_ACTION_FAILED: typeof ACTION_FAILED;
591
+ declare const serve_ACTION_READY_REPORTED: typeof ACTION_READY_REPORTED;
592
+ declare const serve_ACTION_STARTED: typeof ACTION_STARTED;
593
+ declare const serve_ACTION_STOPPED: typeof ACTION_STOPPED;
594
+ declare const serve_CODE_TRANSIENT: typeof CODE_TRANSIENT;
595
+ declare const serve_DEFAULT_FAILURE_POLICY: typeof DEFAULT_FAILURE_POLICY;
596
+ declare const serve_DEFAULT_READY_TIMEOUT_MS: typeof DEFAULT_READY_TIMEOUT_MS;
597
+ declare const serve_DEFAULT_SHUTDOWN_TIMEOUT_MS: typeof DEFAULT_SHUTDOWN_TIMEOUT_MS;
598
+ declare const serve_DEFAULT_STOP_TIMEOUT_MS: typeof DEFAULT_STOP_TIMEOUT_MS;
599
+ declare const serve_DEFAULT_TOPIC_PREFIX: typeof DEFAULT_TOPIC_PREFIX;
600
+ type serve_EventPayload = EventPayload;
601
+ type serve_FailurePolicy = FailurePolicy;
602
+ type serve_LifecycleOutcome = LifecycleOutcome;
603
+ type serve_LoopKeepAlive = LoopKeepAlive;
604
+ declare const serve_LoopKeepAlive: typeof LoopKeepAlive;
605
+ declare const serve_NAME_PATTERN: typeof NAME_PATTERN;
606
+ declare const serve_OBJECT_SERVICE: typeof OBJECT_SERVICE;
607
+ declare const serve_OBJECT_SUPERVISOR: typeof OBJECT_SUPERVISOR;
608
+ type serve_PolicyGate = PolicyGate;
609
+ type serve_Publisher = Publisher;
610
+ declare const serve_RESERVED_NAMES: typeof RESERVED_NAMES;
611
+ type serve_RegisterServeOptions = RegisterServeOptions;
612
+ type serve_ResolveOutcome = ResolveOutcome;
613
+ type serve_ResolveRequest = ResolveRequest;
614
+ type serve_RunResult = RunResult;
615
+ declare const serve_SHUTDOWN_SIGNALS: typeof SHUTDOWN_SIGNALS;
616
+ type serve_ServeLogger = ServeLogger;
617
+ type serve_Service = Service;
618
+ type serve_ServiceConfig = ServiceConfig;
619
+ type serve_ServiceRegistrationError = ServiceRegistrationError;
620
+ declare const serve_ServiceRegistrationError: typeof ServiceRegistrationError;
621
+ type serve_ServiceRegistry = ServiceRegistry;
622
+ declare const serve_ServiceRegistry: typeof ServiceRegistry;
623
+ type serve_Supervisor = Supervisor;
624
+ declare const serve_Supervisor: typeof Supervisor;
625
+ type serve_SupervisorConfig = SupervisorConfig;
626
+ type serve_SupervisorOptions = SupervisorOptions;
627
+ declare const serve_applyEnableDisable: typeof applyEnableDisable;
628
+ declare const serve_applyTimeoutOverrides: typeof applyTimeoutOverrides;
629
+ declare const serve_codeFor: typeof codeFor;
630
+ declare const serve_defaultTopics: typeof defaultTopics;
631
+ declare const serve_exitCodeFor: typeof exitCodeFor;
632
+ declare const serve_isFailure: typeof isFailure;
633
+ declare const serve_isFailurePolicy: typeof isFailurePolicy;
634
+ declare const serve_isReservedName: typeof isReservedName;
635
+ declare const serve_parseDurationMs: typeof parseDurationMs;
636
+ declare const serve_registerServe: typeof registerServe;
637
+ declare const serve_resolve: typeof resolve;
638
+ declare const serve_signalController: typeof signalController;
639
+ declare const serve_startOrder: typeof startOrder;
640
+ declare const serve_validateName: typeof validateName;
641
+ declare const serve_worstOutcome: typeof worstOutcome;
642
+ declare namespace serve {
643
+ export { serve_ACTION_FAILED as ACTION_FAILED, serve_ACTION_READY_REPORTED as ACTION_READY_REPORTED, serve_ACTION_STARTED as ACTION_STARTED, serve_ACTION_STOPPED as ACTION_STOPPED, serve_CODE_TRANSIENT as CODE_TRANSIENT, serve_DEFAULT_FAILURE_POLICY as DEFAULT_FAILURE_POLICY, serve_DEFAULT_READY_TIMEOUT_MS as DEFAULT_READY_TIMEOUT_MS, serve_DEFAULT_SHUTDOWN_TIMEOUT_MS as DEFAULT_SHUTDOWN_TIMEOUT_MS, serve_DEFAULT_STOP_TIMEOUT_MS as DEFAULT_STOP_TIMEOUT_MS, serve_DEFAULT_TOPIC_PREFIX as DEFAULT_TOPIC_PREFIX, type serve_EventPayload as EventPayload, type serve_FailurePolicy as FailurePolicy, type serve_LifecycleOutcome as LifecycleOutcome, serve_LoopKeepAlive as LoopKeepAlive, serve_NAME_PATTERN as NAME_PATTERN, serve_OBJECT_SERVICE as OBJECT_SERVICE, serve_OBJECT_SUPERVISOR as OBJECT_SUPERVISOR, type serve_PolicyGate as PolicyGate, type serve_Publisher as Publisher, serve_RESERVED_NAMES as RESERVED_NAMES, type serve_RegisterServeOptions as RegisterServeOptions, type serve_ResolveOutcome as ResolveOutcome, type serve_ResolveRequest as ResolveRequest, type serve_RunResult as RunResult, serve_SHUTDOWN_SIGNALS as SHUTDOWN_SIGNALS, type serve_ServeLogger as ServeLogger, type serve_Service as Service, type serve_ServiceConfig as ServiceConfig, serve_ServiceRegistrationError as ServiceRegistrationError, serve_ServiceRegistry as ServiceRegistry, serve_Supervisor as Supervisor, type serve_SupervisorConfig as SupervisorConfig, type serve_SupervisorOptions as SupervisorOptions, serve_applyEnableDisable as applyEnableDisable, serve_applyTimeoutOverrides as applyTimeoutOverrides, serve_codeFor as codeFor, serve_defaultTopics as defaultTopics, serve_exitCodeFor as exitCodeFor, serve_isFailure as isFailure, serve_isFailurePolicy as isFailurePolicy, serve_isReservedName as isReservedName, serve_parseDurationMs as parseDurationMs, serve_registerServe as registerServe, serve_resolve as resolve, serve_signalController as signalController, serve_startOrder as startOrder, serve_validateName as validateName, serve_worstOutcome as worstOutcome };
644
+ }
645
+
646
+ export { ACTION_FAILED as A, defaultTopics as B, exitCodeFor as C, DEFAULT_FAILURE_POLICY as D, type EventPayload as E, type FailurePolicy as F, isFailure as G, isFailurePolicy as H, isReservedName as I, parseDurationMs as J, registerServe as K, type LifecycleOutcome as L, resolve as M, NAME_PATTERN as N, OBJECT_SERVICE as O, type PolicyGate as P, signalController as Q, RESERVED_NAMES as R, SHUTDOWN_SIGNALS as S, startOrder as T, validateName as U, worstOutcome as V, ACTION_READY_REPORTED as a, ACTION_STARTED as b, ACTION_STOPPED as c, DEFAULT_READY_TIMEOUT_MS as d, DEFAULT_SHUTDOWN_TIMEOUT_MS as e, DEFAULT_STOP_TIMEOUT_MS as f, DEFAULT_TOPIC_PREFIX as g, LoopKeepAlive as h, OBJECT_SUPERVISOR as i, type Publisher as j, type RegisterServeOptions as k, type ResolveOutcome as l, type ResolveRequest as m, type RunResult as n, type ServeLogger as o, type Service as p, type ServiceConfig as q, ServiceRegistrationError as r, serve as s, ServiceRegistry as t, Supervisor as u, type SupervisorConfig as v, type SupervisorOptions as w, applyEnableDisable as x, applyTimeoutOverrides as y, codeFor as z };
@@ -0,0 +1,3 @@
1
+ import 'commander';
2
+ export { a as CODE_TRANSIENT } from './error-Do8Qji43.js';
3
+ export { A as ACTION_FAILED, a as ACTION_READY_REPORTED, b as ACTION_STARTED, c as ACTION_STOPPED, D as DEFAULT_FAILURE_POLICY, d as DEFAULT_READY_TIMEOUT_MS, e as DEFAULT_SHUTDOWN_TIMEOUT_MS, f as DEFAULT_STOP_TIMEOUT_MS, g as DEFAULT_TOPIC_PREFIX, E as EventPayload, F as FailurePolicy, L as LifecycleOutcome, h as LoopKeepAlive, N as NAME_PATTERN, O as OBJECT_SERVICE, i as OBJECT_SUPERVISOR, P as PolicyGate, j as Publisher, R as RESERVED_NAMES, k as RegisterServeOptions, l as ResolveOutcome, m as ResolveRequest, n as RunResult, S as SHUTDOWN_SIGNALS, o as ServeLogger, p as Service, q as ServiceConfig, r as ServiceRegistrationError, t as ServiceRegistry, u as Supervisor, v as SupervisorConfig, w as SupervisorOptions, x as applyEnableDisable, y as applyTimeoutOverrides, z as codeFor, B as defaultTopics, C as exitCodeFor, G as isFailure, H as isFailurePolicy, I as isReservedName, J as parseDurationMs, K as registerServe, M as resolve, Q as signalController, T as startOrder, U as validateName, V as worstOutcome } from './serve-D8yWMrTc.js';