@b00dea/cockpit 0.0.0-bootstrap.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/CHANGELOG.md +375 -0
  2. package/LICENSE +21 -0
  3. package/README.md +21 -1
  4. package/bin/cockpit.mjs +33 -0
  5. package/cockpit.schema.json +2574 -0
  6. package/dist/autonomy.d.ts +44 -0
  7. package/dist/autonomy.js +156 -0
  8. package/dist/bounded-read.d.ts +14 -0
  9. package/dist/bounded-read.js +42 -0
  10. package/dist/browser/commands.d.ts +62 -0
  11. package/dist/browser/commands.js +349 -0
  12. package/dist/browser/package-paths.d.ts +1 -0
  13. package/dist/browser/package-paths.js +6 -0
  14. package/dist/browser/proxy.d.ts +22 -0
  15. package/dist/browser/proxy.js +37 -0
  16. package/dist/browser/runtime.d.ts +117 -0
  17. package/dist/browser/runtime.js +183 -0
  18. package/dist/browser/surfaces.d.ts +141 -0
  19. package/dist/browser/surfaces.js +556 -0
  20. package/dist/browser/ui-gate.d.ts +15 -0
  21. package/dist/browser/ui-gate.js +18 -0
  22. package/dist/cli-guard.d.ts +5 -0
  23. package/dist/cli-guard.js +71 -0
  24. package/dist/cli-main.d.ts +139 -0
  25. package/dist/cli-main.js +1405 -0
  26. package/dist/cli.d.ts +3 -0
  27. package/dist/cli.js +16 -0
  28. package/dist/command-table.d.ts +113 -0
  29. package/dist/command-table.js +512 -0
  30. package/dist/config/load.d.ts +171 -0
  31. package/dist/config/load.js +345 -0
  32. package/dist/config/sibling-toml.d.ts +48 -0
  33. package/dist/config/sibling-toml.js +160 -0
  34. package/dist/config/surface-tools-toml.d.ts +9 -0
  35. package/dist/config/surface-tools-toml.js +37 -0
  36. package/dist/config/verified-write.d.ts +43 -0
  37. package/dist/config/verified-write.js +89 -0
  38. package/dist/diagnostics.d.ts +26 -0
  39. package/dist/diagnostics.js +335 -0
  40. package/dist/emit.d.ts +22 -0
  41. package/dist/emit.js +43 -0
  42. package/dist/entrypoint-kinds.d.ts +3 -0
  43. package/dist/entrypoint-kinds.js +11 -0
  44. package/dist/environment/application/destructive.d.ts +6 -0
  45. package/dist/environment/application/destructive.js +425 -0
  46. package/dist/environment/application/doctor.d.ts +89 -0
  47. package/dist/environment/application/doctor.js +235 -0
  48. package/dist/environment/application/guard.d.ts +43 -0
  49. package/dist/environment/application/guard.js +622 -0
  50. package/dist/environment/application/health.d.ts +134 -0
  51. package/dist/environment/application/health.js +379 -0
  52. package/dist/environment/application/lifecycle-context.d.ts +228 -0
  53. package/dist/environment/application/lifecycle-context.js +154 -0
  54. package/dist/environment/application/lifecycle-state.d.ts +25 -0
  55. package/dist/environment/application/lifecycle-state.js +201 -0
  56. package/dist/environment/application/lifecycle.d.ts +17 -0
  57. package/dist/environment/application/lifecycle.js +729 -0
  58. package/dist/environment/application/logs.d.ts +45 -0
  59. package/dist/environment/application/logs.js +127 -0
  60. package/dist/environment/application/setup.d.ts +129 -0
  61. package/dist/environment/application/setup.js +741 -0
  62. package/dist/environment/application/shared.d.ts +11 -0
  63. package/dist/environment/application/shared.js +61 -0
  64. package/dist/environment/claims.d.ts +389 -0
  65. package/dist/environment/claims.js +1709 -0
  66. package/dist/environment/codex-hook-trust.d.ts +11 -0
  67. package/dist/environment/codex-hook-trust.js +185 -0
  68. package/dist/environment/compose-environment.d.ts +1 -0
  69. package/dist/environment/compose-environment.js +6 -0
  70. package/dist/environment/compose-ownership.d.ts +21 -0
  71. package/dist/environment/compose-ownership.js +117 -0
  72. package/dist/environment/compose-topology.d.ts +117 -0
  73. package/dist/environment/compose-topology.js +413 -0
  74. package/dist/environment/contract.d.ts +489 -0
  75. package/dist/environment/contract.js +761 -0
  76. package/dist/environment/declaration.d.ts +14 -0
  77. package/dist/environment/declaration.js +39 -0
  78. package/dist/environment/destructive-composition.d.ts +29 -0
  79. package/dist/environment/destructive-composition.js +333 -0
  80. package/dist/environment/docker-daemon.d.ts +30 -0
  81. package/dist/environment/docker-daemon.js +78 -0
  82. package/dist/environment/docker-endpoint.d.ts +10 -0
  83. package/dist/environment/docker-endpoint.js +19 -0
  84. package/dist/environment/env-schema-observation.d.ts +46 -0
  85. package/dist/environment/env-schema-observation.js +241 -0
  86. package/dist/environment/evidence.d.ts +136 -0
  87. package/dist/environment/evidence.js +437 -0
  88. package/dist/environment/executable.d.ts +26 -0
  89. package/dist/environment/executable.js +167 -0
  90. package/dist/environment/generated-application/authorities.d.ts +5 -0
  91. package/dist/environment/generated-application/authorities.js +61 -0
  92. package/dist/environment/generated-application/bootstrap-skill.d.ts +16 -0
  93. package/dist/environment/generated-application/bootstrap-skill.js +328 -0
  94. package/dist/environment/generated-application/check.d.ts +13 -0
  95. package/dist/environment/generated-application/check.js +189 -0
  96. package/dist/environment/generated-application/custom-surface.d.ts +26 -0
  97. package/dist/environment/generated-application/custom-surface.js +289 -0
  98. package/dist/environment/generated-application/prepare.d.ts +29 -0
  99. package/dist/environment/generated-application/prepare.js +276 -0
  100. package/dist/environment/generated-application/publication.d.ts +33 -0
  101. package/dist/environment/generated-application/publication.js +547 -0
  102. package/dist/environment/generated-application/shared.d.ts +484 -0
  103. package/dist/environment/generated-application/shared.js +349 -0
  104. package/dist/environment/generated-application/surface-observation.d.ts +4 -0
  105. package/dist/environment/generated-application/surface-observation.js +69 -0
  106. package/dist/environment/generated-application/surface-outputs.d.ts +71 -0
  107. package/dist/environment/generated-application/surface-outputs.js +389 -0
  108. package/dist/environment/generated-application/surfaces.d.ts +3 -0
  109. package/dist/environment/generated-application/surfaces.js +699 -0
  110. package/dist/environment/generated-application/sync.d.ts +6 -0
  111. package/dist/environment/generated-application/sync.js +109 -0
  112. package/dist/environment/git-observation.d.ts +183 -0
  113. package/dist/environment/git-observation.js +544 -0
  114. package/dist/environment/health-composition.d.ts +11 -0
  115. package/dist/environment/health-composition.js +628 -0
  116. package/dist/environment/host-observation.d.ts +56 -0
  117. package/dist/environment/host-observation.js +52 -0
  118. package/dist/environment/identity.d.ts +48 -0
  119. package/dist/environment/identity.js +85 -0
  120. package/dist/environment/init-application.d.ts +308 -0
  121. package/dist/environment/init-application.js +697 -0
  122. package/dist/environment/install-policy-observation.d.ts +71 -0
  123. package/dist/environment/install-policy-observation.js +284 -0
  124. package/dist/environment/install-policy.d.ts +48 -0
  125. package/dist/environment/install-policy.js +96 -0
  126. package/dist/environment/instance.d.ts +33 -0
  127. package/dist/environment/instance.js +122 -0
  128. package/dist/environment/instruction-pointer.d.ts +19 -0
  129. package/dist/environment/instruction-pointer.js +144 -0
  130. package/dist/environment/lifecycle-composition.d.ts +29 -0
  131. package/dist/environment/lifecycle-composition.js +675 -0
  132. package/dist/environment/lifecycle-stage.d.ts +115 -0
  133. package/dist/environment/lifecycle-stage.js +398 -0
  134. package/dist/environment/lifecycle.d.ts +75 -0
  135. package/dist/environment/lifecycle.js +354 -0
  136. package/dist/environment/logs.d.ts +132 -0
  137. package/dist/environment/logs.js +519 -0
  138. package/dist/environment/observations.d.ts +46 -0
  139. package/dist/environment/observations.js +344 -0
  140. package/dist/environment/operator-application.d.ts +50 -0
  141. package/dist/environment/operator-application.js +155 -0
  142. package/dist/environment/ports.d.ts +182 -0
  143. package/dist/environment/ports.js +1205 -0
  144. package/dist/environment/posture-observation.d.ts +68 -0
  145. package/dist/environment/posture-observation.js +253 -0
  146. package/dist/environment/read-composition.d.ts +27 -0
  147. package/dist/environment/read-composition.js +352 -0
  148. package/dist/environment/readiness-composition.d.ts +38 -0
  149. package/dist/environment/readiness-composition.js +130 -0
  150. package/dist/environment/reclaim.d.ts +333 -0
  151. package/dist/environment/reclaim.js +1835 -0
  152. package/dist/environment/repository-identity.d.ts +13 -0
  153. package/dist/environment/repository-identity.js +108 -0
  154. package/dist/environment/runtime-measurement-record.d.ts +38 -0
  155. package/dist/environment/runtime-measurement-record.js +111 -0
  156. package/dist/environment/runtime-measurement.d.ts +27 -0
  157. package/dist/environment/runtime-measurement.js +224 -0
  158. package/dist/environment/runtime-probe-residue.d.ts +43 -0
  159. package/dist/environment/runtime-probe-residue.js +148 -0
  160. package/dist/environment/runtime-probe.d.ts +72 -0
  161. package/dist/environment/runtime-probe.js +725 -0
  162. package/dist/environment/runtime.d.ts +505 -0
  163. package/dist/environment/runtime.js +2335 -0
  164. package/dist/environment/seed.d.ts +16 -0
  165. package/dist/environment/seed.js +43 -0
  166. package/dist/environment/selftest-application.d.ts +86 -0
  167. package/dist/environment/selftest-application.js +713 -0
  168. package/dist/environment/sensitive.d.ts +3 -0
  169. package/dist/environment/sensitive.js +48 -0
  170. package/dist/environment/setup-observation.d.ts +62 -0
  171. package/dist/environment/setup-observation.js +1473 -0
  172. package/dist/environment/setup.d.ts +43 -0
  173. package/dist/environment/setup.js +176 -0
  174. package/dist/environment/sibling-instructions.d.ts +33 -0
  175. package/dist/environment/sibling-instructions.js +224 -0
  176. package/dist/environment/sibling-registration.d.ts +45 -0
  177. package/dist/environment/sibling-registration.js +538 -0
  178. package/dist/environment/state.d.ts +371 -0
  179. package/dist/environment/state.js +2013 -0
  180. package/dist/environment/templates.d.ts +140 -0
  181. package/dist/environment/templates.js +685 -0
  182. package/dist/environment/tool-registration.d.ts +9 -0
  183. package/dist/environment/tool-registration.js +96 -0
  184. package/dist/environment/upgrade-application.d.ts +19 -0
  185. package/dist/environment/upgrade-application.js +175 -0
  186. package/dist/environment-exec/execute.d.ts +102 -0
  187. package/dist/environment-exec/execute.js +1175 -0
  188. package/dist/environment-exec/libexec-program.d.ts +6 -0
  189. package/dist/environment-exec/libexec-program.js +22 -0
  190. package/dist/environment-exec/verified-digest.d.ts +4 -0
  191. package/dist/environment-exec/verified-digest.js +16 -0
  192. package/dist/exact-keys.d.ts +7 -0
  193. package/dist/exact-keys.js +15 -0
  194. package/dist/fix-catalogue.d.ts +32 -0
  195. package/dist/fix-catalogue.js +60 -0
  196. package/dist/freshness.d.ts +29 -0
  197. package/dist/freshness.js +75 -0
  198. package/dist/generated-environment/adopt.d.ts +16 -0
  199. package/dist/generated-environment/adopt.js +275 -0
  200. package/dist/generated-environment/command.d.ts +47 -0
  201. package/dist/generated-environment/command.js +75 -0
  202. package/dist/generated-environment/transaction.d.ts +186 -0
  203. package/dist/generated-environment/transaction.js +1770 -0
  204. package/dist/grading/evaluate.d.ts +71 -0
  205. package/dist/grading/evaluate.js +403 -0
  206. package/dist/grading/grade.d.ts +33 -0
  207. package/dist/grading/grade.js +57 -0
  208. package/dist/guards/evaluator.d.ts +113 -0
  209. package/dist/guards/evaluator.js +1226 -0
  210. package/dist/guards/harness-adapter.d.ts +17 -0
  211. package/dist/guards/harness-adapter.js +57 -0
  212. package/dist/guards/host.d.ts +8 -0
  213. package/dist/guards/host.js +10 -0
  214. package/dist/guards/invocation-parser.d.ts +66 -0
  215. package/dist/guards/invocation-parser.js +595 -0
  216. package/dist/guards/local-identity.d.ts +40 -0
  217. package/dist/guards/local-identity.js +123 -0
  218. package/dist/guards/policy-pin.d.ts +13 -0
  219. package/dist/guards/policy-pin.js +175 -0
  220. package/dist/guards/protected-locations.d.ts +62 -0
  221. package/dist/guards/protected-locations.js +461 -0
  222. package/dist/guards/read-only.d.ts +37 -0
  223. package/dist/guards/read-only.js +315 -0
  224. package/dist/init/command.d.ts +40 -0
  225. package/dist/init/command.js +310 -0
  226. package/dist/init/derive.d.ts +51 -0
  227. package/dist/init/derive.js +715 -0
  228. package/dist/init/draft.d.ts +138 -0
  229. package/dist/init/draft.js +1205 -0
  230. package/dist/init/render.d.ts +35 -0
  231. package/dist/init/render.js +82 -0
  232. package/dist/init/scaffold.d.ts +53 -0
  233. package/dist/init/scaffold.js +121 -0
  234. package/dist/invocation.d.ts +13 -0
  235. package/dist/invocation.js +20 -0
  236. package/dist/package-metadata.d.ts +9 -0
  237. package/dist/package-metadata.js +19 -0
  238. package/dist/readiness.d.ts +53 -0
  239. package/dist/readiness.js +88 -0
  240. package/dist/references/named.d.ts +24 -0
  241. package/dist/references/named.js +27 -0
  242. package/dist/refusal.d.ts +15 -0
  243. package/dist/refusal.js +7 -0
  244. package/dist/registry-derivation.d.ts +31 -0
  245. package/dist/registry-derivation.js +32 -0
  246. package/dist/registry-resolve/command.d.ts +47 -0
  247. package/dist/registry-resolve/command.js +226 -0
  248. package/dist/registry-resolve/registry.d.ts +68 -0
  249. package/dist/registry-resolve/registry.js +292 -0
  250. package/dist/registry-resolve/render-shell.d.ts +18 -0
  251. package/dist/registry-resolve/render-shell.js +36 -0
  252. package/dist/repair.d.ts +29 -0
  253. package/dist/repair.js +8 -0
  254. package/dist/schema-json.d.ts +1 -0
  255. package/dist/schema-json.js +177 -0
  256. package/dist/schema.d.ts +1322 -0
  257. package/dist/schema.js +934 -0
  258. package/dist/setup/command.d.ts +4 -0
  259. package/dist/setup/command.js +4 -0
  260. package/dist/sha256.d.ts +1 -0
  261. package/dist/sha256.js +4 -0
  262. package/dist/surfaces/adoption.d.ts +41 -0
  263. package/dist/surfaces/adoption.js +217 -0
  264. package/dist/surfaces/consumer-instructions.d.ts +20 -0
  265. package/dist/surfaces/consumer-instructions.js +43 -0
  266. package/dist/surfaces/contract.d.ts +42 -0
  267. package/dist/surfaces/contract.js +169 -0
  268. package/dist/surfaces/core-declarations.d.ts +24 -0
  269. package/dist/surfaces/core-declarations.js +79 -0
  270. package/dist/surfaces/development-markers.d.ts +1 -0
  271. package/dist/surfaces/development-markers.js +18 -0
  272. package/dist/surfaces/generator-adapter.d.ts +71 -0
  273. package/dist/surfaces/generator-adapter.js +809 -0
  274. package/dist/surfaces/harness-registry.d.ts +180 -0
  275. package/dist/surfaces/harness-registry.js +117 -0
  276. package/dist/surfaces/mcp.d.ts +95 -0
  277. package/dist/surfaces/mcp.js +186 -0
  278. package/dist/surfaces/merge.d.ts +30 -0
  279. package/dist/surfaces/merge.js +105 -0
  280. package/dist/surfaces/ownership.d.ts +190 -0
  281. package/dist/surfaces/ownership.js +795 -0
  282. package/dist/surfaces/projection.d.ts +136 -0
  283. package/dist/surfaces/projection.js +681 -0
  284. package/dist/surfaces/render.d.ts +118 -0
  285. package/dist/surfaces/render.js +633 -0
  286. package/dist/surfaces/restrictions.d.ts +130 -0
  287. package/dist/surfaces/restrictions.js +447 -0
  288. package/dist/surfaces/selftest.d.ts +162 -0
  289. package/dist/surfaces/selftest.js +393 -0
  290. package/dist/surfaces/skill-contract.d.ts +85 -0
  291. package/dist/surfaces/skill-contract.js +449 -0
  292. package/dist/surfaces/sync.d.ts +57 -0
  293. package/dist/surfaces/sync.js +164 -0
  294. package/dist/team-metadata.d.ts +41 -0
  295. package/dist/team-metadata.js +512 -0
  296. package/dist/testing/gates.d.ts +91 -0
  297. package/dist/testing/gates.js +182 -0
  298. package/dist/testing/hooks.d.ts +59 -0
  299. package/dist/testing/hooks.js +139 -0
  300. package/dist/testing/verdict.d.ts +29 -0
  301. package/dist/testing/verdict.js +62 -0
  302. package/dist/work-orders/application.d.ts +99 -0
  303. package/dist/work-orders/application.js +383 -0
  304. package/dist/work-orders/composition.d.ts +124 -0
  305. package/dist/work-orders/composition.js +1010 -0
  306. package/dist/work-orders/contract.d.ts +61 -0
  307. package/dist/work-orders/contract.js +122 -0
  308. package/dist/work-orders/store.d.ts +158 -0
  309. package/dist/work-orders/store.js +197 -0
  310. package/docs/README.md +65 -0
  311. package/docs/architecture.md +136 -0
  312. package/docs/capability-matrix.md +50 -0
  313. package/docs/cli-reference.md +599 -0
  314. package/docs/command-list.md +51 -0
  315. package/docs/compose-patterns.md +99 -0
  316. package/docs/concepts.md +171 -0
  317. package/docs/configuration-essentials.md +172 -0
  318. package/docs/configuration-reference.md +621 -0
  319. package/docs/environment.md +760 -0
  320. package/docs/extending.md +43 -0
  321. package/docs/faq.md +111 -0
  322. package/docs/getting-started.md +608 -0
  323. package/docs/harness-surfaces.md +433 -0
  324. package/docs/joining-a-team.md +76 -0
  325. package/docs/release-policy.md +49 -0
  326. package/docs/safety-and-autonomy.md +419 -0
  327. package/docs/troubleshooting.md +361 -0
  328. package/docs/tutorial.md +170 -0
  329. package/docs/work-and-browser.md +254 -0
  330. package/libexec/browser-operation.cjs +186 -0
  331. package/libexec/fence-marker.cjs +101 -0
  332. package/libexec/fence-marker.d.cts +24 -0
  333. package/libexec/fenced-group-runner.cjs +77 -0
  334. package/libexec/fenced-supervisor.cjs +137 -0
  335. package/libexec/generated-filesystem.cjs +731 -0
  336. package/libexec/install-filesystem.cjs +225 -0
  337. package/libexec/rulesync-generator.NOTICE.md +1112 -0
  338. package/libexec/rulesync-generator.cjs +743 -0
  339. package/libexec/surface-generator-worker.cjs +266 -0
  340. package/libexec/surface-output-reader.cjs +99 -0
  341. package/libexec/surface-scratch-cleanup.cjs +14 -0
  342. package/libexec/validate-harness-evidence.d.mts +183 -0
  343. package/libexec/validate-harness-evidence.mjs +1312 -0
  344. package/package.json +76 -1
  345. package/surfaces/README.md +33 -0
  346. package/surfaces/agents/evaluator.agent.md +76 -0
  347. package/surfaces/guards/bash-guard.sh +48 -0
  348. package/surfaces/guards/claude.adapter.json +25 -0
  349. package/surfaces/guards/codex.adapter.json +24 -0
  350. package/surfaces/guards/opencode.adapter.json +25 -0
  351. package/surfaces/references/browser.md +63 -0
  352. package/surfaces/references/test-data-and-personas.md +84 -0
  353. package/surfaces/references/testing-tiers.md +11 -0
  354. package/surfaces/skills/cockpit-browser.skill.md +54 -0
  355. package/surfaces/skills/cockpit-explain.skill.md +32 -0
  356. package/surfaces/skills/cockpit-fix.skill.md +37 -0
  357. package/surfaces/skills/cockpit-setup.skill.md +39 -0
  358. package/surfaces/skills/cockpit-work.skill.md +34 -0
  359. package/surfaces/skills/collection.json +5 -0
  360. package/surfaces/skills/procedures/explain.md +61 -0
  361. package/surfaces/skills/procedures/fix.md +81 -0
  362. package/surfaces/skills/procedures/setup.md +379 -0
  363. package/surfaces/skills/procedures/work.md +105 -0
@@ -0,0 +1,335 @@
1
+ import { snapshotJson } from './environment/contract.js';
2
+ import { admitDiagnosticFix, bindConfigPath, cockpitCommand, initCommand } from './fix-catalogue.js';
3
+ const COMMON_REFUSAL_GUIDANCE = Object.freeze({
4
+ INIT_CANONICAL_OWNERSHIP_MISSING: Object.freeze({
5
+ why: 'init cannot safely resume when its recorded bootstrap state and generated ownership disagree',
6
+ fix: `restore the committed ownership metadata, then rerun ${initCommand()} with the root, target and options you ran it with`,
7
+ }),
8
+ SURFACE_SOURCE_UNAVAILABLE: Object.freeze({
9
+ why: 'generated instructions cannot be trusted without the declared sibling source',
10
+ fix: `restore the named sibling checkout at its declared path, then rerun ${cockpitCommand('sync')}`,
11
+ }),
12
+ SURFACE_OWNERSHIP_INVALID: Object.freeze({
13
+ why: 'cockpit cannot prove which generated settings it is allowed to replace',
14
+ fix: `restore the last committed generated ownership metadata, then rerun ${cockpitCommand('sync')}`,
15
+ }),
16
+ SURFACE_STATE_CONFLICT: Object.freeze({
17
+ why: 'sync would overwrite content that cockpit did not write',
18
+ fix: `for a generated file you edited, move the change into cockpit.toml or a surface overlay, then ask the person who owns the cockpit before you undo the edit or delete the file, and rerun ${cockpitCommand('sync')}; for the team's own .claude/settings.json, .codex/config.toml or .codex/hooks.json, have a human approve ${cockpitCommand('sync', { args: '--adopt <path>' })}`,
19
+ }),
20
+ GENERATED_ARTIFACT_DRIFT: Object.freeze({
21
+ why: 'generated files no longer match the canonical cockpit configuration',
22
+ fix: `run ${cockpitCommand('sync')}, then retry`,
23
+ }),
24
+ GENERATED_OWNERSHIP_INVALID: Object.freeze({
25
+ why: 'publication cannot safely update files without authenticated ownership metadata',
26
+ fix: `restore the committed ownership metadata and rerun ${cockpitCommand('sync')}`,
27
+ }),
28
+ GUARD_AUTHORITY_UNAVAILABLE: Object.freeze({
29
+ why: 'the guard cannot make a safe allow or deny decision without current generated authority',
30
+ fix: `restore cockpit.toml and the generated guard files, then have a human run ${cockpitCommand('sync')}`,
31
+ }),
32
+ GUARD_REFUSED: Object.freeze({
33
+ why: 'the requested command is outside the current cockpit guard policy',
34
+ fix: `follow the refusal reason or ask a human to change cockpit.toml and run ${cockpitCommand('sync')}`,
35
+ }),
36
+ RUNTIME_UNAVAILABLE: Object.freeze({
37
+ why: 'cockpit cannot start or inspect the declared environment without a container runtime it can reach and identify',
38
+ fix: 'start the configured container runtime and verify docker info succeeds, then retry',
39
+ }),
40
+ RUNTIME_UNMEASURED: Object.freeze({
41
+ why: 'this machine has no passing measurement for the current runtime, so cockpit cannot vouch for its mounts, labels, health and teardown',
42
+ fix: `run ${cockpitCommand('runtime measure', { args: '--image <local-image>' })}, which records the result for this machine only, then retry`,
43
+ }),
44
+ CLAIM_CO_TENANT: Object.freeze({
45
+ why: 'another holder still owns or is using the same stack',
46
+ fix: `for a failed up attempt, run ${cockpitCommand('up')} to resume or ${cockpitCommand('down')} to release; otherwise end each cockpit session the message names (let its command finish, or stop the named process), then retry; a session whose process is gone is released by the next up, sleep, down or reset`,
47
+ }),
48
+ PORT_FAMILY_COLLISION: Object.freeze({
49
+ why: 'one or more ports selected for this stack are already in use',
50
+ fix: 'stop the named listener or release the inactive stack, then retry',
51
+ }),
52
+ PORT_LEASE_EXHAUSTED: Object.freeze({
53
+ why: 'every declared port family is leased or occupied',
54
+ fix: 'release an inactive stack or extend ports.count after checking host capacity',
55
+ }),
56
+ SETUP_MANUAL_MISSING: Object.freeze({
57
+ why: 'a manually managed sibling must already exist before cockpit can wire it',
58
+ fix: `create the named checkout at its declared path, then run ${cockpitCommand('setup')} again`,
59
+ }),
60
+ SETUP_REMOTE_MISMATCH: Object.freeze({
61
+ why: 'rewiring an existing checkout to a different repository could replace the wrong source',
62
+ fix: `correct the checkout remote or the sibling declaration, then run ${cockpitCommand('setup')} again`,
63
+ }),
64
+ SETUP_REMOTE_UNRESOLVABLE: Object.freeze({
65
+ why: 'a relative local remote that cannot be resolved cannot be compared with, or cloned into, a checkout',
66
+ fix: `make the remote path readable or declare an absolute path or URL, then run ${cockpitCommand('setup')} again`,
67
+ }),
68
+ });
69
+ // Command-line mistakes (as opposed to failed work) get a pointer to the relevant --help.
70
+ const USAGE_ERROR_CODE = /^CLI_(?:USAGE_INVALID|UNKNOWN_COMMAND|COMMAND_REQUIRED)$|_(?:DUPLICATE|UNSUPPORTED)$/;
71
+ function escapeForTerminal(value) {
72
+ return value.replace(/[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u2028-\u202e\u2066-\u2069]/g, (character) => {
73
+ if (/[\u0080-\u009f\u061c\u200e\u200f\u2028-\u202e\u2066-\u2069]/.test(character)) {
74
+ return `\\u${character.codePointAt(0).toString(16).padStart(4, '0')}`;
75
+ }
76
+ const escaped = JSON.stringify(character);
77
+ return escaped.slice(1, -1);
78
+ });
79
+ }
80
+ function terminalSafeJson(value, space) {
81
+ // JSON already escapes C0; the remaining terminal controls must retain their JSON value.
82
+ return JSON.stringify(value, null, space).replace(/[\u007f-\u009f\u061c\u200e\u200f\u2028-\u202e\u2066-\u2069]/g, (character) => `\\u${character.codePointAt(0).toString(16).padStart(4, '0')}`);
83
+ }
84
+ function humanLines(value, depth) {
85
+ const indent = ' '.repeat(depth);
86
+ if (value === null)
87
+ return [`${indent}none`];
88
+ if (typeof value === 'string')
89
+ return [`${indent}${escapeForTerminal(value)}`];
90
+ if (typeof value === 'boolean' || typeof value === 'number')
91
+ return [`${indent}${String(value)}`];
92
+ if (Array.isArray(value)) {
93
+ if (value.length === 0)
94
+ return [`${indent}(none)`];
95
+ return value.flatMap((item) => {
96
+ if (item === null || typeof item !== 'object') {
97
+ const [line] = humanLines(item, 0);
98
+ return [`${indent}- ${line}`];
99
+ }
100
+ return [`${indent}-`, ...humanLines(item, depth + 1)];
101
+ });
102
+ }
103
+ const entries = Object.entries(value);
104
+ if (entries.length === 0)
105
+ return [`${indent}(none)`];
106
+ return entries.flatMap(([key, item]) => {
107
+ const label = `${indent}${escapeForTerminal(key)}:`;
108
+ if (item === null || typeof item !== 'object') {
109
+ const [line] = humanLines(item, 0);
110
+ return [`${label} ${line}`];
111
+ }
112
+ return [label, ...humanLines(item, depth + 1)];
113
+ });
114
+ }
115
+ export function renderHumanValue(value) {
116
+ const captured = snapshotJson(value);
117
+ return captured === undefined ? 'Result is not available as bounded human-readable text.\n'
118
+ : `${humanLines(captured, 0).join('\n')}\n`;
119
+ }
120
+ function projectDiagnostics(input, context) {
121
+ const diagnostics = new Map();
122
+ const guidance = new Map();
123
+ for (const source of input) {
124
+ const { severity, code, target, fix } = source;
125
+ const admitted = admitDiagnosticFix(source, context);
126
+ const identity = { code, ...(target === undefined ? {} : { target }) };
127
+ const message = bindConfigPath(source.message, context);
128
+ const diagnostic = { severity, ...identity, message, ...(admitted ? { fix: admitted.command } : {}) };
129
+ diagnostics.set(JSON.stringify(diagnostic), diagnostic);
130
+ if (fix !== undefined && !admitted) {
131
+ const row = { ...identity, text: bindConfigPath(fix, context) };
132
+ guidance.set(JSON.stringify(row), row);
133
+ }
134
+ else if (fix === undefined && Object.prototype.hasOwnProperty.call(COMMON_REFUSAL_GUIDANCE, code)) {
135
+ const row = { ...identity, text: bindConfigPath(COMMON_REFUSAL_GUIDANCE[code].fix, context) };
136
+ guidance.set(JSON.stringify(row), row);
137
+ }
138
+ }
139
+ return { diagnostics: [...diagnostics.values()], guidance: [...guidance.values()] };
140
+ }
141
+ // What each lifecycle `change` means to the person who ran the command; `--json` keeps the raw value.
142
+ const LIFECYCLE_CHANGES = Object.freeze({
143
+ up: Object.freeze({ started: 'Stack started', resumed: 'Stack resumed', unchanged: 'Stack already running' }),
144
+ sleep: Object.freeze({
145
+ stopped: 'Stack stopped',
146
+ retained: "Released this checkout's hold; another holder keeps the stack running",
147
+ unchanged: 'Nothing to stop: no session holds the stack',
148
+ }),
149
+ down: Object.freeze({ removed: 'Stack removed' }),
150
+ reset: Object.freeze({ unchanged: 'Nothing to reset' }),
151
+ });
152
+ function resetTargetLines(targets) {
153
+ return targets.map(({ kind, identity, declaration }) => ` ${escapeForTerminal(`${String(kind)} ${String(identity)}${declaration === identity ? '' : ` (${String(declaration)})`}`)}\n`).join('');
154
+ }
155
+ // A successful up, sleep, down or preflight printed nothing in human mode, so a person could not
156
+ // tell success from a command that never ran. One line says what happened; anything outside the
157
+ // known result shape prints nothing rather than a guess.
158
+ function lifecycleSummary(command, result) {
159
+ if (command === 'preflight') {
160
+ if (typeof result.verdict !== 'string' || !Array.isArray(result.checks))
161
+ return '';
162
+ const counts = new Map();
163
+ for (const check of result.checks) {
164
+ const verdict = String(check?.verdict).replaceAll('-', ' ');
165
+ counts.set(verdict, (counts.get(verdict) ?? 0) + 1);
166
+ }
167
+ const tally = [...counts].map(([verdict, count]) => `${count} ${verdict === 'pass' ? count === 1 ? 'check passes' : 'checks pass' : verdict}`);
168
+ return escapeForTerminal(`Preflight ${result.verdict === 'pass' ? 'passed' : result.verdict}: ${tally.join(', ') || 'no checks'}.`) + '\n';
169
+ }
170
+ // A plain reset only previews; printing nothing left a person unable to tell an empty plan from
171
+ // one that would delete their data volume.
172
+ if (command === 'reset' && typeof result.planDigest === 'string' && Array.isArray(result.targets)) {
173
+ if (typeof result.stackId !== 'string')
174
+ return '';
175
+ const targets = result.targets;
176
+ if (targets.length === 0)
177
+ return `${escapeForTerminal(`Nothing to reset (${result.stackId}).`)}\n`;
178
+ return `${escapeForTerminal(`Reset would remove ${targets.length} ${targets.length === 1 ? 'target' : 'targets'} (${result.stackId}); plan ${result.planDigest}:`)}\n`
179
+ + `${resetTargetLines(targets)}Nothing was changed. To apply this plan, run the same command with --interactive and approve it.\n`;
180
+ }
181
+ // An applied reset printed nothing, so a person could not tell that their data was gone.
182
+ if (command === 'reset' && result.change === 'reset' && Array.isArray(result.targets)) {
183
+ if (typeof result.stackId !== 'string')
184
+ return '';
185
+ const targets = result.targets;
186
+ return `${escapeForTerminal(`Reset removed ${targets.length} ${targets.length === 1 ? 'target' : 'targets'} (${result.stackId}):`)}\n`
187
+ + resetTargetLines(targets)
188
+ + 'The next up recreates the removed volumes and, where environment.seed is declared, runs the seed to fill them.\n';
189
+ }
190
+ const headline = Object.hasOwn(LIFECYCLE_CHANGES, command) && typeof result.change === 'string'
191
+ && Object.hasOwn(LIFECYCLE_CHANGES[command], result.change) ? LIFECYCLE_CHANGES[command][result.change] : undefined;
192
+ if (headline === undefined || typeof result.stackId !== 'string')
193
+ return '';
194
+ const cold = result.coldStart;
195
+ const timing = typeof cold?.measuredMillis === 'number' && typeof cold.limitMillis === 'number'
196
+ ? `; cold start ${(cold.measuredMillis / 1000).toFixed(1)}s of the ${Math.round(cold.limitMillis / 1000)}s limit` : '';
197
+ const entrypoints = Array.isArray(result.entrypoints) ? result.entrypoints
198
+ .filter(({ name, value }) => typeof name === 'string' && typeof value === 'string')
199
+ .map(({ name, value }) => ` ${escapeForTerminal(String(name))}: ${escapeForTerminal(String(value))}\n`) : [];
200
+ return `${escapeForTerminal(`${headline} (${result.stackId})${timing}.`)}\n${entrypoints.join('')}`;
201
+ }
202
+ function plural(count, one, many = `${one}s`) {
203
+ return `${count} ${count === 1 ? one : many}`;
204
+ }
205
+ // Doctor's full result is a structured report for scripts; printed whole it buried the findings
206
+ // under thousands of lines. A person gets one line per area and the commands that show the detail.
207
+ function doctorSummary(result, diagnostics, fixContext) {
208
+ if (typeof result.verdict !== 'string' || !Array.isArray(result.checks))
209
+ return renderHumanValue(result);
210
+ const lines = [];
211
+ const errors = diagnostics.filter(({ severity }) => severity === 'error').length;
212
+ const warnings = diagnostics.filter(({ severity }) => severity === 'warning').length;
213
+ const findings = [errors > 0 ? plural(errors, 'error') : '', warnings > 0 ? plural(warnings, 'warning') : ''].filter(Boolean);
214
+ lines.push(`Doctor: ${result.verdict}. ${findings.length === 0 ? 'No findings.' : `Findings: ${findings.join(' and ')}, listed below.`}`);
215
+ const tally = new Map();
216
+ for (const check of result.checks) {
217
+ const verdict = String(check?.verdict).replaceAll('-', ' ');
218
+ tally.set(verdict, (tally.get(verdict) ?? 0) + 1);
219
+ }
220
+ lines.push(`Checks: ${[...tally].map(([verdict, count]) => `${count} ${verdict}`).join(', ') || 'none ran'}.`);
221
+ if (Array.isArray(result.comparisons) && result.comparisons.length > 0)
222
+ lines.push(`Remote comparisons: ${result.comparisons.length}.`);
223
+ const freshness = result.freshness;
224
+ if (freshness?.local) {
225
+ const changes = Array.isArray(freshness.changes) ? freshness.changes.length : 0;
226
+ const refused = freshness.local.kind !== 'complete' && Array.isArray(freshness.local.diagnostics)
227
+ ? freshness.local.diagnostics.map(({ code }) => String(code)) : [];
228
+ lines.push(`Generated files: ${refused.length > 0 ? `check refused (${refused.join(', ')})`
229
+ : changes === 0 ? 'current' : `${plural(changes, 'change')} pending`}.`);
230
+ }
231
+ const overrides = result.surfaceOverrides;
232
+ if (overrides?.kind === 'complete' && Array.isArray(overrides.activeOverrides) && Array.isArray(overrides.changedOverrideOriginals)) {
233
+ const active = overrides.activeOverrides.map(({ name }) => String(name));
234
+ const changed = overrides.changedOverrideOriginals.map(({ name }) => String(name));
235
+ lines.push(`Surface overrides: ${active.length === 0 ? 'none' : `${active.length} active (${active.join(', ')})`}`
236
+ + `${changed.length === 0 ? '' : `; ${changed.length} changed upstream (${changed.join(', ')})`}.`);
237
+ }
238
+ else if (overrides)
239
+ lines.push(`Surface overrides: not inspected (${String(overrides.code)}).`);
240
+ if (Array.isArray(result.declarations) && result.declarations.length > 0) {
241
+ const rows = result.declarations;
242
+ const named = (state) => rows.filter(row => row.state === state).map(row => String(row.subject).replaceAll('-', ' '));
243
+ const declared = named('declared');
244
+ const absent = named('not-declared');
245
+ lines.push(`Declared: ${declared.join(', ') || 'nothing'}${absent.length === 0 ? '' : `; not declared: ${absent.join(', ')}`}.`);
246
+ }
247
+ const readiness = result.readiness;
248
+ if (readiness && Array.isArray(readiness.gaps)) {
249
+ const gaps = readiness.gaps;
250
+ const clear = Array.isArray(readiness.noFinding) ? readiness.noFinding.length : 0;
251
+ lines.push(`Readiness: ${gaps.length === 0 ? 'no gaps' : plural(gaps.length, 'gap')}; ${plural(clear, 'other prerequisite')} with no finding.`);
252
+ for (const gap of gaps) {
253
+ const codes = Array.isArray(gap.findings) ? [...new Set(gap.findings.map(({ code }) => String(code)))] : [];
254
+ lines.push(` ${String(gap.level)} ${String(gap.id)}: ${String(gap.needs)} (${codes.join(', ')})`);
255
+ }
256
+ }
257
+ const release = freshness?.release;
258
+ if (release?.kind === 'known') {
259
+ lines.push(`Release: ${release.currency === 'same-version' ? `${String(release.installedVersion)} is the latest`
260
+ : `${String(release.latestVersion)} is published; ${String(release.installedVersion)} is installed`}.`);
261
+ }
262
+ else if (release?.kind === 'unknown')
263
+ lines.push(`Release: unknown (${String(release.reason)}).`);
264
+ lines.push(`Full report: ${bindConfigPath(cockpitCommand('doctor', { args: '--json' }), fixContext)}`);
265
+ lines.push(`Generated file detail: ${bindConfigPath(cockpitCommand('check'), fixContext)}`);
266
+ return `${lines.map(escapeForTerminal).join('\n')}\n`;
267
+ }
268
+ export function renderHumanDiagnostics(diagnostics, review, fixContext, usageHint) {
269
+ if (review) {
270
+ const { command, outcome } = review;
271
+ if (outcome.result === null || typeof outcome.result !== 'object')
272
+ return '';
273
+ // Work, grade, browser and test commands return their whole result as the answer, and an unmet gate,
274
+ // grade or step returns one with a failing status: the person needs that evidence either way.
275
+ if (command !== undefined && /^(?:(?:work|browser) |test-run$|grade$)/.test(command))
276
+ return renderHumanValue(outcome.result);
277
+ if (outcome.status !== 0)
278
+ return '';
279
+ if (command === 'sync' && 'dryRun' in outcome.result && outcome.result.dryRun === true
280
+ && 'changes' in outcome.result && Array.isArray(outcome.result.changes)) {
281
+ const changes = outcome.result.changes;
282
+ if (!changes.every((change) => change && (change.operation === 'write' || change.operation === 'remove')
283
+ && typeof change.path === 'string'))
284
+ return '';
285
+ const stale = 'staleRemoval' in outcome.result ? outcome.result.staleRemoval : undefined;
286
+ const approval = typeof stale?.digest === 'string' && /^[a-f0-9]{64}$/.test(stale.digest)
287
+ ? `${escapeForTerminal(`Stale-removal digest ${stale.digest}: to approve these removals, a person runs `
288
+ + `${bindConfigPath(cockpitCommand('sync', { args: '--interactive' }), fixContext)} in a terminal and types it.`)}\n` : '';
289
+ return (changes.length === 0 ? 'No generated changes.\n'
290
+ : `${changes.map((change) => `${change.operation} ${terminalSafeJson(change.path)}`).join('\n')}\n`) + approval;
291
+ }
292
+ if (command === 'logs' && 'records' in outcome.result && Array.isArray(outcome.result.records)) {
293
+ const records = outcome.result.records;
294
+ return records.length === 0 ? 'No log records.\n'
295
+ : `${records.map(record => escapeForTerminal(`${String(record.timestamp)} ${String(record.stream)} ${String(record.message)}`)).join('\n')}\n`;
296
+ }
297
+ if (command === 'doctor') {
298
+ return doctorSummary(outcome.result, outcome.diagnostics ?? [], fixContext);
299
+ }
300
+ if (command === 'selftest' || command === 'upgrade' || command === 'init') {
301
+ return renderHumanValue(outcome.result);
302
+ }
303
+ return command === undefined ? '' : lifecycleSummary(command, outcome.result);
304
+ }
305
+ if (diagnostics.length === 0)
306
+ return '';
307
+ const projected = projectDiagnostics(diagnostics, fixContext);
308
+ const hint = usageHint !== undefined && diagnostics.some(({ code }) => USAGE_ERROR_CODE.test(code)) ? usageHint : '';
309
+ return `${projected.diagnostics
310
+ .map((diagnostic) => {
311
+ const target = diagnostic.target ? ` [${escapeForTerminal(diagnostic.target)}]` : '';
312
+ const guidance = projected.guidance.filter(row => row.code === diagnostic.code && row.target === diagnostic.target);
313
+ const common = Object.prototype.hasOwnProperty.call(COMMON_REFUSAL_GUIDANCE, diagnostic.code)
314
+ ? COMMON_REFUSAL_GUIDANCE[diagnostic.code]
315
+ : undefined;
316
+ if (common) {
317
+ const fix = diagnostic.fix ?? guidance[0]?.text ?? bindConfigPath(common.fix, fixContext);
318
+ return `${diagnostic.severity.toUpperCase()} ${escapeForTerminal(diagnostic.code)}${target}\n`
319
+ + `What failed: ${escapeForTerminal(diagnostic.message)}\n`
320
+ + `Why it matters: ${escapeForTerminal(common.why)}\n`
321
+ + `Fix: ${escapeForTerminal(fix)}`;
322
+ }
323
+ const fix = diagnostic.fix ? ` Fix: ${escapeForTerminal(diagnostic.fix)}` : '';
324
+ const renderedGuidance = guidance.map(row => ` Guidance: ${escapeForTerminal(row.text)}`).join('');
325
+ return `${diagnostic.severity.toUpperCase()} ${escapeForTerminal(diagnostic.code)}${target}: ${escapeForTerminal(diagnostic.message)}${fix}${renderedGuidance}`;
326
+ })
327
+ .join('\n')}\n${hint}`;
328
+ }
329
+ export function renderJsonResponse(outcome, fixContext) {
330
+ const { result, diagnostics, evidence, progress, invocation } = outcome;
331
+ const projected = projectDiagnostics(diagnostics, fixContext);
332
+ return `${terminalSafeJson({ result, diagnostics: projected.diagnostics,
333
+ ...(projected.guidance.length === 0 ? {} : { guidance: projected.guidance }), ...(evidence === undefined ? {} : { evidence }),
334
+ ...(progress === undefined ? {} : { progress }), ...(invocation === undefined ? {} : { invocation }) })}\n`;
335
+ }
package/dist/emit.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { CockpitConfig } from './schema.js';
2
+ import type { DocumentedSibling, Gap } from './registry-resolve/registry.js';
3
+ /**
4
+ * Render a config as `cockpit.toml`.
5
+ *
6
+ * The round trip this closes is the acceptance test for the whole schema: a registry read
7
+ * out of an existing harness, emitted here, and parsed back must mean the same thing. Until
8
+ * this existed the "round trip" stopped at an in-memory object, which proves the parser
9
+ * agrees with itself and nothing else.
10
+ */
11
+ export declare function emitToml(config: CockpitConfig): string;
12
+ /**
13
+ * Render the gaps a registry draft could not answer, as commented TOML.
14
+ *
15
+ * Deliberately emitted as comments rather than placeholder values: a placeholder is a value,
16
+ * and a value is indistinguishable from an answer the moment the file is read by anything
17
+ * other than the person who generated it. A blocking gap keeps the config invalid on
18
+ * purpose, so the schema refuses it until a human writes the real answer.
19
+ */
20
+ export declare function emitGaps(gaps: readonly Gap[]): string;
21
+ /** The sibling rows as the schema wants them, dropping fields the source did not carry. */
22
+ export declare function toSiblingRows(siblings: readonly DocumentedSibling[]): Record<string, unknown>[];
package/dist/emit.js ADDED
@@ -0,0 +1,43 @@
1
+ import { stringify } from 'smol-toml';
2
+ /**
3
+ * Render a config as `cockpit.toml`.
4
+ *
5
+ * The round trip this closes is the acceptance test for the whole schema: a registry read
6
+ * out of an existing harness, emitted here, and parsed back must mean the same thing. Until
7
+ * this existed the "round trip" stopped at an in-memory object, which proves the parser
8
+ * agrees with itself and nothing else.
9
+ */
10
+ export function emitToml(config) {
11
+ return stringify(config);
12
+ }
13
+ /**
14
+ * Render the gaps a registry draft could not answer, as commented TOML.
15
+ *
16
+ * Deliberately emitted as comments rather than placeholder values: a placeholder is a value,
17
+ * and a value is indistinguishable from an answer the moment the file is read by anything
18
+ * other than the person who generated it. A blocking gap keeps the config invalid on
19
+ * purpose, so the schema refuses it until a human writes the real answer.
20
+ */
21
+ export function emitGaps(gaps) {
22
+ if (gaps.length === 0)
23
+ return '';
24
+ const lines = ['# Gaps — cockpit could not read these from its sources.', '#'];
25
+ for (const g of gaps) {
26
+ const mark = g.blocking ? 'REQUIRED' : 'optional';
27
+ lines.push(`# [${mark}] ${g.slug}.${g.field}: ${g.why}`);
28
+ }
29
+ return lines.join('\n') + '\n';
30
+ }
31
+ /** The sibling rows as the schema wants them, dropping fields the source did not carry. */
32
+ export function toSiblingRows(siblings) {
33
+ return siblings.map((s) => ({
34
+ slug: s.slug,
35
+ dir: s.dir,
36
+ ...(s.remote ? { remote: s.remote } : {}),
37
+ ...(s.branch ? { branch: s.branch } : {}),
38
+ mount: s.mount.value,
39
+ acquire: s.acquire.value,
40
+ var: s.var,
41
+ purpose: s.purpose,
42
+ }));
43
+ }
@@ -0,0 +1,3 @@
1
+ export declare const ENTRYPOINT_KINDS: readonly ["entrypoint", "origin", "callback_url", "advertised_listener", "cors_origin", "public_base_url"];
2
+ export type EntrypointKind = (typeof ENTRYPOINT_KINDS)[number];
3
+ export declare function isEntrypointKind(value: unknown): value is EntrypointKind;
@@ -0,0 +1,11 @@
1
+ export const ENTRYPOINT_KINDS = Object.freeze([
2
+ 'entrypoint',
3
+ 'origin',
4
+ 'callback_url',
5
+ 'advertised_listener',
6
+ 'cors_origin',
7
+ 'public_base_url',
8
+ ]);
9
+ export function isEntrypointKind(value) {
10
+ return typeof value === 'string' && ENTRYPOINT_KINDS.includes(value);
11
+ }
@@ -0,0 +1,6 @@
1
+ import { type DownCommandAdapters, type DownCommandInput, type DownCommandResult, type OperatorResetSession, type ResetCommandAdapters, type ResetCommandInput, type ResetCommandResult } from './lifecycle-context.js';
2
+ export declare function runDown(input: DownCommandInput, adapters: DownCommandAdapters): Promise<DownCommandResult>;
3
+ export declare function runReset(input: ResetCommandInput, adapters: ResetCommandAdapters): Promise<ResetCommandResult>;
4
+ export declare function beginOperatorReset(input: ResetCommandInput, adapters: ResetCommandAdapters): Promise<OperatorResetSession | Extract<ResetCommandResult, {
5
+ kind: 'refusal';
6
+ }>>;