@b00dea/cockpit 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +474 -0
- package/LICENSE +21 -0
- package/README.md +25 -2
- package/bin/cockpit.mjs +33 -0
- package/cockpit.schema.json +2644 -0
- package/dist/autonomy.d.ts +45 -0
- package/dist/autonomy.js +173 -0
- package/dist/bounded-read.d.ts +14 -0
- package/dist/bounded-read.js +42 -0
- package/dist/browser/commands.d.ts +117 -0
- package/dist/browser/commands.js +453 -0
- package/dist/browser/package-paths.d.ts +1 -0
- package/dist/browser/package-paths.js +6 -0
- package/dist/browser/proxy.d.ts +22 -0
- package/dist/browser/proxy.js +37 -0
- package/dist/browser/runtime.d.ts +118 -0
- package/dist/browser/runtime.js +186 -0
- package/dist/browser/surfaces.d.ts +141 -0
- package/dist/browser/surfaces.js +561 -0
- package/dist/browser/ui-gate.d.ts +15 -0
- package/dist/browser/ui-gate.js +18 -0
- package/dist/canonical-json.d.ts +2 -0
- package/dist/canonical-json.js +5 -0
- package/dist/cli-guard.d.ts +5 -0
- package/dist/cli-guard.js +71 -0
- package/dist/cli-main.d.ts +176 -0
- package/dist/cli-main.js +1584 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +16 -0
- package/dist/command-table.d.ts +121 -0
- package/dist/command-table.js +664 -0
- package/dist/config/load.d.ts +183 -0
- package/dist/config/load.js +367 -0
- package/dist/config/sibling-toml.d.ts +48 -0
- package/dist/config/sibling-toml.js +160 -0
- package/dist/config/surface-tools-toml.d.ts +9 -0
- package/dist/config/surface-tools-toml.js +37 -0
- package/dist/config/unconfirmed-toml.d.ts +9 -0
- package/dist/config/unconfirmed-toml.js +29 -0
- package/dist/config/verified-write.d.ts +43 -0
- package/dist/config/verified-write.js +89 -0
- package/dist/diagnostics.d.ts +26 -0
- package/dist/diagnostics.js +344 -0
- package/dist/docs/check.d.ts +16 -0
- package/dist/docs/check.js +197 -0
- package/dist/docs/decision-record.d.ts +34 -0
- package/dist/docs/decision-record.js +135 -0
- package/dist/docs/decisions.d.ts +16 -0
- package/dist/docs/decisions.js +103 -0
- package/dist/docs/markdown.d.ts +36 -0
- package/dist/docs/markdown.js +88 -0
- package/dist/docs/references.d.ts +32 -0
- package/dist/docs/references.js +148 -0
- package/dist/emit.d.ts +22 -0
- package/dist/emit.js +43 -0
- package/dist/entrypoint-kinds.d.ts +3 -0
- package/dist/entrypoint-kinds.js +11 -0
- package/dist/environment/application/confirm.d.ts +35 -0
- package/dist/environment/application/confirm.js +122 -0
- package/dist/environment/application/destructive.d.ts +6 -0
- package/dist/environment/application/destructive.js +429 -0
- package/dist/environment/application/doctor.d.ts +94 -0
- package/dist/environment/application/doctor.js +247 -0
- package/dist/environment/application/guard.d.ts +49 -0
- package/dist/environment/application/guard.js +677 -0
- package/dist/environment/application/health.d.ts +143 -0
- package/dist/environment/application/health.js +385 -0
- package/dist/environment/application/lifecycle-context.d.ts +235 -0
- package/dist/environment/application/lifecycle-context.js +154 -0
- package/dist/environment/application/lifecycle-state.d.ts +25 -0
- package/dist/environment/application/lifecycle-state.js +202 -0
- package/dist/environment/application/lifecycle.d.ts +18 -0
- package/dist/environment/application/lifecycle.js +737 -0
- package/dist/environment/application/logs.d.ts +45 -0
- package/dist/environment/application/logs.js +127 -0
- package/dist/environment/application/services.d.ts +60 -0
- package/dist/environment/application/services.js +89 -0
- package/dist/environment/application/setup.d.ts +129 -0
- package/dist/environment/application/setup.js +741 -0
- package/dist/environment/application/shared.d.ts +11 -0
- package/dist/environment/application/shared.js +61 -0
- package/dist/environment/application/siblings.d.ts +43 -0
- package/dist/environment/application/siblings.js +269 -0
- package/dist/environment/claims.d.ts +389 -0
- package/dist/environment/claims.js +1701 -0
- package/dist/environment/codex-hook-trust.d.ts +11 -0
- package/dist/environment/codex-hook-trust.js +185 -0
- package/dist/environment/compose-environment.d.ts +1 -0
- package/dist/environment/compose-environment.js +6 -0
- package/dist/environment/compose-ownership.d.ts +21 -0
- package/dist/environment/compose-ownership.js +117 -0
- package/dist/environment/compose-topology.d.ts +125 -0
- package/dist/environment/compose-topology.js +490 -0
- package/dist/environment/contract.d.ts +522 -0
- package/dist/environment/contract.js +794 -0
- package/dist/environment/declaration.d.ts +14 -0
- package/dist/environment/declaration.js +39 -0
- package/dist/environment/destructive-composition.d.ts +29 -0
- package/dist/environment/destructive-composition.js +333 -0
- package/dist/environment/docker-daemon.d.ts +30 -0
- package/dist/environment/docker-daemon.js +78 -0
- package/dist/environment/docker-endpoint.d.ts +10 -0
- package/dist/environment/docker-endpoint.js +19 -0
- package/dist/environment/env-schema-observation.d.ts +46 -0
- package/dist/environment/env-schema-observation.js +241 -0
- package/dist/environment/evidence.d.ts +136 -0
- package/dist/environment/evidence.js +437 -0
- package/dist/environment/executable.d.ts +38 -0
- package/dist/environment/executable.js +190 -0
- package/dist/environment/generated-application/authorities.d.ts +5 -0
- package/dist/environment/generated-application/authorities.js +61 -0
- package/dist/environment/generated-application/bootstrap-skill.d.ts +16 -0
- package/dist/environment/generated-application/bootstrap-skill.js +328 -0
- package/dist/environment/generated-application/check.d.ts +13 -0
- package/dist/environment/generated-application/check.js +191 -0
- package/dist/environment/generated-application/custom-surface.d.ts +26 -0
- package/dist/environment/generated-application/custom-surface.js +289 -0
- package/dist/environment/generated-application/prepare.d.ts +29 -0
- package/dist/environment/generated-application/prepare.js +278 -0
- package/dist/environment/generated-application/publication.d.ts +33 -0
- package/dist/environment/generated-application/publication.js +547 -0
- package/dist/environment/generated-application/shared.d.ts +492 -0
- package/dist/environment/generated-application/shared.js +354 -0
- package/dist/environment/generated-application/surface-observation.d.ts +4 -0
- package/dist/environment/generated-application/surface-observation.js +69 -0
- package/dist/environment/generated-application/surface-outputs.d.ts +71 -0
- package/dist/environment/generated-application/surface-outputs.js +400 -0
- package/dist/environment/generated-application/surfaces.d.ts +3 -0
- package/dist/environment/generated-application/surfaces.js +704 -0
- package/dist/environment/generated-application/sync.d.ts +6 -0
- package/dist/environment/generated-application/sync.js +124 -0
- package/dist/environment/git-observation.d.ts +202 -0
- package/dist/environment/git-observation.js +553 -0
- package/dist/environment/health-composition.d.ts +12 -0
- package/dist/environment/health-composition.js +645 -0
- package/dist/environment/host-observation.d.ts +56 -0
- package/dist/environment/host-observation.js +52 -0
- package/dist/environment/identity.d.ts +48 -0
- package/dist/environment/identity.js +85 -0
- package/dist/environment/init-application.d.ts +333 -0
- package/dist/environment/init-application.js +726 -0
- package/dist/environment/install-policy-observation.d.ts +71 -0
- package/dist/environment/install-policy-observation.js +284 -0
- package/dist/environment/install-policy.d.ts +48 -0
- package/dist/environment/install-policy.js +96 -0
- package/dist/environment/instance.d.ts +33 -0
- package/dist/environment/instance.js +122 -0
- package/dist/environment/instruction-pointer.d.ts +19 -0
- package/dist/environment/instruction-pointer.js +144 -0
- package/dist/environment/lifecycle-composition.d.ts +31 -0
- package/dist/environment/lifecycle-composition.js +742 -0
- package/dist/environment/lifecycle-stage.d.ts +120 -0
- package/dist/environment/lifecycle-stage.js +408 -0
- package/dist/environment/lifecycle.d.ts +75 -0
- package/dist/environment/lifecycle.js +354 -0
- package/dist/environment/logs.d.ts +132 -0
- package/dist/environment/logs.js +519 -0
- package/dist/environment/map-limit.d.ts +2 -0
- package/dist/environment/map-limit.js +13 -0
- package/dist/environment/mcp-observation.d.ts +9 -0
- package/dist/environment/mcp-observation.js +46 -0
- package/dist/environment/observations.d.ts +46 -0
- package/dist/environment/observations.js +346 -0
- package/dist/environment/operator-application.d.ts +79 -0
- package/dist/environment/operator-application.js +197 -0
- package/dist/environment/ports.d.ts +182 -0
- package/dist/environment/ports.js +1205 -0
- package/dist/environment/posture-observation.d.ts +68 -0
- package/dist/environment/posture-observation.js +253 -0
- package/dist/environment/presence.d.ts +4 -0
- package/dist/environment/presence.js +26 -0
- package/dist/environment/read-composition.d.ts +32 -0
- package/dist/environment/read-composition.js +397 -0
- package/dist/environment/readiness-composition.d.ts +57 -0
- package/dist/environment/readiness-composition.js +151 -0
- package/dist/environment/reclaim.d.ts +370 -0
- package/dist/environment/reclaim.js +1940 -0
- package/dist/environment/repository-identity.d.ts +13 -0
- package/dist/environment/repository-identity.js +108 -0
- package/dist/environment/runtime-measurement-record.d.ts +38 -0
- package/dist/environment/runtime-measurement-record.js +111 -0
- package/dist/environment/runtime-measurement.d.ts +27 -0
- package/dist/environment/runtime-measurement.js +224 -0
- package/dist/environment/runtime-probe-residue.d.ts +43 -0
- package/dist/environment/runtime-probe-residue.js +148 -0
- package/dist/environment/runtime-probe.d.ts +72 -0
- package/dist/environment/runtime-probe.js +725 -0
- package/dist/environment/runtime.d.ts +551 -0
- package/dist/environment/runtime.js +2405 -0
- package/dist/environment/seed.d.ts +16 -0
- package/dist/environment/seed.js +43 -0
- package/dist/environment/selftest-application.d.ts +86 -0
- package/dist/environment/selftest-application.js +713 -0
- package/dist/environment/sensitive.d.ts +3 -0
- package/dist/environment/sensitive.js +48 -0
- package/dist/environment/served-checkout-grants.d.ts +53 -0
- package/dist/environment/served-checkout-grants.js +182 -0
- package/dist/environment/setup-observation.d.ts +62 -0
- package/dist/environment/setup-observation.js +1473 -0
- package/dist/environment/setup.d.ts +43 -0
- package/dist/environment/setup.js +176 -0
- package/dist/environment/sibling-checkouts.d.ts +119 -0
- package/dist/environment/sibling-checkouts.js +254 -0
- package/dist/environment/sibling-instructions.d.ts +33 -0
- package/dist/environment/sibling-instructions.js +224 -0
- package/dist/environment/sibling-observation.d.ts +27 -0
- package/dist/environment/sibling-observation.js +45 -0
- package/dist/environment/sibling-pull.d.ts +23 -0
- package/dist/environment/sibling-pull.js +95 -0
- package/dist/environment/sibling-registration.d.ts +45 -0
- package/dist/environment/sibling-registration.js +538 -0
- package/dist/environment/stack-inputs.d.ts +18 -0
- package/dist/environment/stack-inputs.js +210 -0
- package/dist/environment/stack-inventory-prune.d.ts +31 -0
- package/dist/environment/stack-inventory-prune.js +129 -0
- package/dist/environment/stack-inventory-report.d.ts +44 -0
- package/dist/environment/stack-inventory-report.js +78 -0
- package/dist/environment/stack-inventory.d.ts +94 -0
- package/dist/environment/stack-inventory.js +418 -0
- package/dist/environment/state.d.ts +410 -0
- package/dist/environment/state.js +2153 -0
- package/dist/environment/templates.d.ts +140 -0
- package/dist/environment/templates.js +685 -0
- package/dist/environment/tool-registration.d.ts +9 -0
- package/dist/environment/tool-registration.js +92 -0
- package/dist/environment/upgrade-application.d.ts +19 -0
- package/dist/environment/upgrade-application.js +175 -0
- package/dist/environment-exec/execute.d.ts +105 -0
- package/dist/environment-exec/execute.js +1179 -0
- package/dist/environment-exec/libexec-program.d.ts +6 -0
- package/dist/environment-exec/libexec-program.js +22 -0
- package/dist/environment-exec/verified-digest.d.ts +4 -0
- package/dist/environment-exec/verified-digest.js +16 -0
- package/dist/exact-keys.d.ts +7 -0
- package/dist/exact-keys.js +15 -0
- package/dist/fix-catalogue.d.ts +32 -0
- package/dist/fix-catalogue.js +60 -0
- package/dist/freshness.d.ts +29 -0
- package/dist/freshness.js +75 -0
- package/dist/generated-environment/adopt.d.ts +16 -0
- package/dist/generated-environment/adopt.js +271 -0
- package/dist/generated-environment/command.d.ts +47 -0
- package/dist/generated-environment/command.js +75 -0
- package/dist/generated-environment/transaction.d.ts +186 -0
- package/dist/generated-environment/transaction.js +1770 -0
- package/dist/grading/evaluate.d.ts +71 -0
- package/dist/grading/evaluate.js +403 -0
- package/dist/grading/grade.d.ts +33 -0
- package/dist/grading/grade.js +57 -0
- package/dist/guards/answer-confirmation.d.ts +41 -0
- package/dist/guards/answer-confirmation.js +109 -0
- package/dist/guards/evaluator.d.ts +130 -0
- package/dist/guards/evaluator.js +1258 -0
- package/dist/guards/harness-adapter.d.ts +17 -0
- package/dist/guards/harness-adapter.js +57 -0
- package/dist/guards/host.d.ts +8 -0
- package/dist/guards/host.js +10 -0
- package/dist/guards/invocation-parser.d.ts +66 -0
- package/dist/guards/invocation-parser.js +595 -0
- package/dist/guards/local-identity.d.ts +44 -0
- package/dist/guards/local-identity.js +129 -0
- package/dist/guards/policy-change.d.ts +43 -0
- package/dist/guards/policy-change.js +159 -0
- package/dist/guards/policy-pin.d.ts +13 -0
- package/dist/guards/policy-pin.js +177 -0
- package/dist/guards/protected-locations.d.ts +62 -0
- package/dist/guards/protected-locations.js +461 -0
- package/dist/guards/read-only.d.ts +37 -0
- package/dist/guards/read-only.js +315 -0
- package/dist/init/command.d.ts +41 -0
- package/dist/init/command.js +330 -0
- package/dist/init/derive.d.ts +53 -0
- package/dist/init/derive.js +819 -0
- package/dist/init/draft.d.ts +140 -0
- package/dist/init/draft.js +1228 -0
- package/dist/init/render.d.ts +47 -0
- package/dist/init/render.js +104 -0
- package/dist/init/scaffold.d.ts +53 -0
- package/dist/init/scaffold.js +121 -0
- package/dist/invocation.d.ts +13 -0
- package/dist/invocation.js +20 -0
- package/dist/package-metadata.d.ts +9 -0
- package/dist/package-metadata.js +19 -0
- package/dist/readiness.d.ts +53 -0
- package/dist/readiness.js +88 -0
- package/dist/references/named.d.ts +24 -0
- package/dist/references/named.js +27 -0
- package/dist/refusal.d.ts +15 -0
- package/dist/refusal.js +7 -0
- package/dist/registry-derivation.d.ts +31 -0
- package/dist/registry-derivation.js +32 -0
- package/dist/registry-resolve/command.d.ts +47 -0
- package/dist/registry-resolve/command.js +226 -0
- package/dist/registry-resolve/registry.d.ts +68 -0
- package/dist/registry-resolve/registry.js +292 -0
- package/dist/registry-resolve/render-shell.d.ts +18 -0
- package/dist/registry-resolve/render-shell.js +36 -0
- package/dist/repair.d.ts +29 -0
- package/dist/repair.js +8 -0
- package/dist/repository-path.d.ts +9 -0
- package/dist/repository-path.js +16 -0
- package/dist/schema-json.d.ts +1 -0
- package/dist/schema-json.js +177 -0
- package/dist/schema.d.ts +1289 -0
- package/dist/schema.js +985 -0
- package/dist/setup/command.d.ts +4 -0
- package/dist/setup/command.js +4 -0
- package/dist/sha256.d.ts +1 -0
- package/dist/sha256.js +4 -0
- package/dist/surfaces/adoption.d.ts +41 -0
- package/dist/surfaces/adoption.js +217 -0
- package/dist/surfaces/consumer-instructions.d.ts +20 -0
- package/dist/surfaces/consumer-instructions.js +43 -0
- package/dist/surfaces/contract.d.ts +42 -0
- package/dist/surfaces/contract.js +169 -0
- package/dist/surfaces/core-declarations.d.ts +24 -0
- package/dist/surfaces/core-declarations.js +79 -0
- package/dist/surfaces/development-markers.d.ts +1 -0
- package/dist/surfaces/development-markers.js +18 -0
- package/dist/surfaces/generator-adapter.d.ts +71 -0
- package/dist/surfaces/generator-adapter.js +809 -0
- package/dist/surfaces/harness-registry.d.ts +260 -0
- package/dist/surfaces/harness-registry.js +146 -0
- package/dist/surfaces/mcp.d.ts +145 -0
- package/dist/surfaces/mcp.js +349 -0
- package/dist/surfaces/merge.d.ts +30 -0
- package/dist/surfaces/merge.js +105 -0
- package/dist/surfaces/ownership.d.ts +190 -0
- package/dist/surfaces/ownership.js +795 -0
- package/dist/surfaces/projection.d.ts +136 -0
- package/dist/surfaces/projection.js +716 -0
- package/dist/surfaces/render.d.ts +79 -0
- package/dist/surfaces/render.js +636 -0
- package/dist/surfaces/restrictions.d.ts +130 -0
- package/dist/surfaces/restrictions.js +447 -0
- package/dist/surfaces/selftest.d.ts +162 -0
- package/dist/surfaces/selftest.js +393 -0
- package/dist/surfaces/skill-contract.d.ts +85 -0
- package/dist/surfaces/skill-contract.js +449 -0
- package/dist/surfaces/sync.d.ts +57 -0
- package/dist/surfaces/sync.js +164 -0
- package/dist/team-metadata.d.ts +41 -0
- package/dist/team-metadata.js +513 -0
- package/dist/testing/gates.d.ts +91 -0
- package/dist/testing/gates.js +182 -0
- package/dist/testing/hooks.d.ts +59 -0
- package/dist/testing/hooks.js +139 -0
- package/dist/testing/test-protection.d.ts +34 -0
- package/dist/testing/test-protection.js +137 -0
- package/dist/testing/verdict.d.ts +29 -0
- package/dist/testing/verdict.js +62 -0
- package/dist/testing/weakening.d.ts +15 -0
- package/dist/testing/weakening.js +30 -0
- package/dist/work-orders/application-closure.d.ts +7 -0
- package/dist/work-orders/application-closure.js +76 -0
- package/dist/work-orders/application-context.d.ts +162 -0
- package/dist/work-orders/application-context.js +137 -0
- package/dist/work-orders/application-decisions.d.ts +27 -0
- package/dist/work-orders/application-decisions.js +121 -0
- package/dist/work-orders/application-grading.d.ts +11 -0
- package/dist/work-orders/application-grading.js +212 -0
- package/dist/work-orders/application.d.ts +6 -0
- package/dist/work-orders/application.js +223 -0
- package/dist/work-orders/composition.d.ts +101 -0
- package/dist/work-orders/composition.js +1202 -0
- package/dist/work-orders/contract.d.ts +77 -0
- package/dist/work-orders/contract.js +140 -0
- package/dist/work-orders/decisions.d.ts +23 -0
- package/dist/work-orders/decisions.js +55 -0
- package/dist/work-orders/store.d.ts +207 -0
- package/dist/work-orders/store.js +291 -0
- package/docs/README.md +68 -0
- package/docs/architecture.md +136 -0
- package/docs/capability-matrix.md +58 -0
- package/docs/cli-reference.md +807 -0
- package/docs/command-list.md +62 -0
- package/docs/compose-patterns.md +99 -0
- package/docs/concepts.md +173 -0
- package/docs/configuration-essentials.md +177 -0
- package/docs/configuration-reference.md +636 -0
- package/docs/docs-check.md +76 -0
- package/docs/environment.md +948 -0
- package/docs/extending.md +43 -0
- package/docs/faq.md +113 -0
- package/docs/getting-started.md +692 -0
- package/docs/harness-surfaces.md +500 -0
- package/docs/joining-a-team.md +76 -0
- package/docs/release-policy.md +49 -0
- package/docs/safety-and-autonomy.md +463 -0
- package/docs/troubleshooting.md +382 -0
- package/docs/tutorial.md +171 -0
- package/docs/work-and-browser.md +420 -0
- package/libexec/browser-operation.cjs +270 -0
- package/libexec/fence-marker.cjs +101 -0
- package/libexec/fence-marker.d.cts +24 -0
- package/libexec/fenced-group-runner.cjs +77 -0
- package/libexec/fenced-supervisor.cjs +137 -0
- package/libexec/generated-filesystem.cjs +731 -0
- package/libexec/install-filesystem.cjs +225 -0
- package/libexec/rulesync-generator.NOTICE.md +1112 -0
- package/libexec/rulesync-generator.cjs +743 -0
- package/libexec/surface-generator-worker.cjs +266 -0
- package/libexec/surface-output-reader.cjs +99 -0
- package/libexec/surface-scratch-cleanup.cjs +14 -0
- package/libexec/validate-harness-evidence.d.mts +183 -0
- package/libexec/validate-harness-evidence.mjs +1312 -0
- package/package.json +74 -4
- package/surfaces/README.md +33 -0
- package/surfaces/agents/evaluator.agent.md +76 -0
- package/surfaces/guards/bash-guard.sh +48 -0
- package/surfaces/guards/claude.adapter.json +25 -0
- package/surfaces/guards/codex.adapter.json +24 -0
- package/surfaces/guards/opencode.adapter.json +25 -0
- package/surfaces/references/browser.md +63 -0
- package/surfaces/references/test-data-and-personas.md +84 -0
- package/surfaces/references/testing-tiers.md +11 -0
- package/surfaces/skills/cockpit-browser.skill.md +59 -0
- package/surfaces/skills/cockpit-explain.skill.md +32 -0
- package/surfaces/skills/cockpit-fix.skill.md +37 -0
- package/surfaces/skills/cockpit-setup.skill.md +39 -0
- package/surfaces/skills/cockpit-work.skill.md +34 -0
- package/surfaces/skills/collection.json +5 -0
- package/surfaces/skills/procedures/explain.md +66 -0
- package/surfaces/skills/procedures/fix.md +95 -0
- package/surfaces/skills/procedures/setup.md +452 -0
- package/surfaces/skills/procedures/work.md +134 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type SurfaceTarget } from '../surfaces/contract.js';
|
|
3
|
+
import { type BootstrapLockOwnerId } from './identity.js';
|
|
4
|
+
import { ENVIRONMENT_CODES, type CheckoutId, type CockpitId, type HolderId, type EnvironmentObservation, type StackId } from './contract.js';
|
|
5
|
+
export declare const observationDeclarations: readonly [{
|
|
6
|
+
readonly id: 'config-freshness';
|
|
7
|
+
readonly owner: "environment-state";
|
|
8
|
+
readonly postures: readonly ["environment"];
|
|
9
|
+
readonly stages: readonly [{
|
|
10
|
+
readonly stage: 'bootstrap';
|
|
11
|
+
readonly disposition: 'required';
|
|
12
|
+
}, {
|
|
13
|
+
readonly stage: 'steady';
|
|
14
|
+
readonly disposition: 'required';
|
|
15
|
+
}];
|
|
16
|
+
readonly code: "CONFIG_STALE";
|
|
17
|
+
readonly isIssued: typeof isStateObservation;
|
|
18
|
+
readonly issuedAt: typeof observationIssuedAt;
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: 'config-schema-validity';
|
|
21
|
+
readonly owner: "environment-state";
|
|
22
|
+
readonly postures: readonly ["environment"];
|
|
23
|
+
readonly stages: readonly [{
|
|
24
|
+
readonly stage: 'bootstrap';
|
|
25
|
+
readonly disposition: 'required';
|
|
26
|
+
}, {
|
|
27
|
+
readonly stage: 'steady';
|
|
28
|
+
readonly disposition: 'required';
|
|
29
|
+
}];
|
|
30
|
+
readonly code: "CONFIG_SCHEMA_INVALID";
|
|
31
|
+
readonly isIssued: typeof isStateObservation;
|
|
32
|
+
readonly issuedAt: typeof observationIssuedAt;
|
|
33
|
+
}];
|
|
34
|
+
export declare function isStateObservation(value: unknown): value is EnvironmentObservation;
|
|
35
|
+
declare function observationIssuedAt(value: unknown): number | undefined;
|
|
36
|
+
export declare function observeConfiguration(input: {
|
|
37
|
+
readonly path: string;
|
|
38
|
+
readonly stackId: StackId;
|
|
39
|
+
readonly observedAt: string;
|
|
40
|
+
}): Promise<readonly EnvironmentObservation[]>;
|
|
41
|
+
export declare const SERIALIZED_RECORD_BYTE_LIMIT = 1048576;
|
|
42
|
+
declare const RECORD_KINDS: readonly ['coordination', 'lifecycle', 'lifecycle-history', 'data-outcome', 'cache'];
|
|
43
|
+
declare const StateRecordSchema: z.ZodObject<{
|
|
44
|
+
format: z.ZodLiteral<"cockpit-state/v1">;
|
|
45
|
+
kind: z.ZodEnum<{
|
|
46
|
+
cache: "cache";
|
|
47
|
+
coordination: "coordination";
|
|
48
|
+
"data-outcome": "data-outcome";
|
|
49
|
+
lifecycle: "lifecycle";
|
|
50
|
+
"lifecycle-history": "lifecycle-history";
|
|
51
|
+
}>;
|
|
52
|
+
cockpitId: z.ZodString;
|
|
53
|
+
subjectId: z.ZodString;
|
|
54
|
+
revision: z.ZodNumber;
|
|
55
|
+
updatedAt: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
56
|
+
value: z.ZodJSONSchema;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type StateRecord = z.infer<typeof StateRecordSchema>;
|
|
59
|
+
type StateRecordKind = typeof RECORD_KINDS[number];
|
|
60
|
+
declare const BootstrapStateRecordSchema: z.ZodObject<{
|
|
61
|
+
format: z.ZodLiteral<"cockpit-state/v1">;
|
|
62
|
+
kind: z.ZodLiteral<"bootstrap">;
|
|
63
|
+
checkoutId: z.ZodString;
|
|
64
|
+
target: z.ZodEnum<{
|
|
65
|
+
claudecode: "claudecode";
|
|
66
|
+
codexcli: "codexcli";
|
|
67
|
+
cursor: "cursor";
|
|
68
|
+
grokcli: "grokcli";
|
|
69
|
+
opencode: "opencode";
|
|
70
|
+
}>;
|
|
71
|
+
revision: z.ZodNumber;
|
|
72
|
+
updatedAt: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
73
|
+
value: z.ZodObject<{
|
|
74
|
+
stage: z.ZodEnum<{
|
|
75
|
+
"draft-observed": "draft-observed";
|
|
76
|
+
"draft-prepared": "draft-prepared";
|
|
77
|
+
"environment-verified": "environment-verified";
|
|
78
|
+
"surface-previewed": "surface-previewed";
|
|
79
|
+
"surface-published": "surface-published";
|
|
80
|
+
}>;
|
|
81
|
+
checkoutRoot: z.ZodString;
|
|
82
|
+
target: z.ZodEnum<{
|
|
83
|
+
claudecode: "claudecode";
|
|
84
|
+
codexcli: "codexcli";
|
|
85
|
+
cursor: "cursor";
|
|
86
|
+
grokcli: "grokcli";
|
|
87
|
+
opencode: "opencode";
|
|
88
|
+
}>;
|
|
89
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
90
|
+
path: z.ZodString;
|
|
91
|
+
sha256: z.ZodString;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
commandSha256: z.ZodString;
|
|
94
|
+
previewSha256: z.ZodString;
|
|
95
|
+
published: z.ZodArray<z.ZodObject<{
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
sha256: z.ZodString;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
destination: z.ZodNullable<z.ZodString>;
|
|
100
|
+
artifactBytes: z.ZodNullable<z.ZodString>;
|
|
101
|
+
artifactSha256: z.ZodNullable<z.ZodString>;
|
|
102
|
+
greenfield: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
estate: "estate";
|
|
105
|
+
registry: "registry";
|
|
106
|
+
}>>;
|
|
107
|
+
stage: z.ZodEnum<{
|
|
108
|
+
"answers-recorded": "answers-recorded";
|
|
109
|
+
"question-pending": "question-pending";
|
|
110
|
+
resolved: "resolved";
|
|
111
|
+
}>;
|
|
112
|
+
classification: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
"incomplete-multi-repository": "incomplete-multi-repository";
|
|
114
|
+
"no-runnable-product": "no-runnable-product";
|
|
115
|
+
"one-sibling": "one-sibling";
|
|
116
|
+
"ready-multi-repository": "ready-multi-repository";
|
|
117
|
+
}>>;
|
|
118
|
+
sourceObservationSha256: z.ZodString;
|
|
119
|
+
notice: z.ZodOptional<z.ZodString>;
|
|
120
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
field: z.ZodString;
|
|
123
|
+
source: z.ZodString;
|
|
124
|
+
why: z.ZodString;
|
|
125
|
+
expectedSha256: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.core.$strict>>;
|
|
127
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
128
|
+
questionId: z.ZodString;
|
|
129
|
+
bytes: z.ZodString;
|
|
130
|
+
sha256: z.ZodString;
|
|
131
|
+
provenance: z.ZodEnum<{
|
|
132
|
+
"agent-default": "agent-default";
|
|
133
|
+
derived: "derived";
|
|
134
|
+
"operator-confirmed": "operator-confirmed";
|
|
135
|
+
unattributed: "unattributed";
|
|
136
|
+
}>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
export type BootstrapStateRecord = z.infer<typeof BootstrapStateRecordSchema>;
|
|
142
|
+
type AnyStateRecord = StateRecord | BootstrapStateRecord;
|
|
143
|
+
export interface StateAddress {
|
|
144
|
+
readonly path: string;
|
|
145
|
+
readonly stateRoot: string;
|
|
146
|
+
readonly cockpitRoot: string;
|
|
147
|
+
readonly kind: StateRecordKind;
|
|
148
|
+
readonly cockpitId: CockpitId;
|
|
149
|
+
readonly subjectId: string;
|
|
150
|
+
readonly qualifier?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface StateNamespace {
|
|
153
|
+
readonly root: string;
|
|
154
|
+
readonly cockpitRoot: string;
|
|
155
|
+
readonly paths: {
|
|
156
|
+
readonly coordination: (stackId: StackId) => StateAddress;
|
|
157
|
+
readonly lifecycle: (stackId: StackId) => StateAddress;
|
|
158
|
+
readonly dataOutcome: (stackId: StackId) => StateAddress;
|
|
159
|
+
readonly stateLock: string;
|
|
160
|
+
readonly installLock: (cacheId: string) => string;
|
|
161
|
+
readonly cache: (checkoutId: CheckoutId, cacheIdentitySha256: string) => StateAddress;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface BootstrapStateAddress {
|
|
165
|
+
readonly path: string;
|
|
166
|
+
readonly stateRoot: string;
|
|
167
|
+
readonly checkoutRoot: string;
|
|
168
|
+
readonly kind: 'bootstrap';
|
|
169
|
+
readonly checkoutId: CheckoutId;
|
|
170
|
+
readonly target: SurfaceTarget;
|
|
171
|
+
}
|
|
172
|
+
export interface BootstrapStateNamespace {
|
|
173
|
+
readonly root: string;
|
|
174
|
+
readonly checkoutRoot: string;
|
|
175
|
+
readonly checkoutId: CheckoutId;
|
|
176
|
+
readonly target: SurfaceTarget;
|
|
177
|
+
readonly paths: {
|
|
178
|
+
readonly bootstrap: (target: SurfaceTarget) => BootstrapStateAddress;
|
|
179
|
+
readonly stateLock: string;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export type StateResult<T> = {
|
|
183
|
+
readonly kind: 'complete';
|
|
184
|
+
readonly value: T;
|
|
185
|
+
} | {
|
|
186
|
+
readonly kind: 'missing';
|
|
187
|
+
readonly path: string;
|
|
188
|
+
} | {
|
|
189
|
+
readonly kind: 'indeterminate';
|
|
190
|
+
readonly code: typeof ENVIRONMENT_CODES.STATE_DURABILITY_INDETERMINATE;
|
|
191
|
+
readonly message: string;
|
|
192
|
+
readonly target: string;
|
|
193
|
+
readonly recovery: string;
|
|
194
|
+
readonly value: T;
|
|
195
|
+
} | {
|
|
196
|
+
readonly kind: 'refusal';
|
|
197
|
+
readonly code: typeof ENVIRONMENT_CODES.STATE_ROOT_UNAVAILABLE | typeof ENVIRONMENT_CODES.STATE_FORMAT_UNSUPPORTED | typeof ENVIRONMENT_CODES.STATE_RECORD_MALFORMED | typeof ENVIRONMENT_CODES.STATE_LOCKED;
|
|
198
|
+
readonly message: string;
|
|
199
|
+
readonly target: string;
|
|
200
|
+
readonly recovery?: string;
|
|
201
|
+
};
|
|
202
|
+
interface SelectStateRootInput {
|
|
203
|
+
readonly platform: 'darwin' | 'linux';
|
|
204
|
+
readonly home: string | undefined;
|
|
205
|
+
readonly xdgStateHome?: string;
|
|
206
|
+
readonly checkoutRoot?: string;
|
|
207
|
+
readonly checkoutRoots?: readonly string[];
|
|
208
|
+
readonly cockpitId: CockpitId;
|
|
209
|
+
readonly uid?: number;
|
|
210
|
+
}
|
|
211
|
+
export interface SelectBootstrapStateRootInput {
|
|
212
|
+
readonly platform: 'darwin' | 'linux';
|
|
213
|
+
readonly home: string | undefined;
|
|
214
|
+
readonly xdgStateHome?: string;
|
|
215
|
+
readonly checkoutRoot: string;
|
|
216
|
+
readonly target: SurfaceTarget;
|
|
217
|
+
readonly uid?: number;
|
|
218
|
+
}
|
|
219
|
+
type LockHolderState = 'live' | 'dead' | 'unknown';
|
|
220
|
+
interface StateLockInspection {
|
|
221
|
+
readonly holderState: LockHolderState | 'invalid';
|
|
222
|
+
readonly description: string;
|
|
223
|
+
readonly recovery: string;
|
|
224
|
+
}
|
|
225
|
+
export interface StateTransactionOptions {
|
|
226
|
+
readonly ownerId: HolderId | BootstrapLockOwnerId;
|
|
227
|
+
readonly observeHolder?: (holder: {
|
|
228
|
+
readonly ownerId: HolderId | BootstrapLockOwnerId;
|
|
229
|
+
readonly pid: number;
|
|
230
|
+
}) => Promise<LockHolderState>;
|
|
231
|
+
readonly beforePublish?: (temporaryPath: string) => Promise<void>;
|
|
232
|
+
readonly beforeCommit?: () => StateTransactionAbort<unknown> | undefined;
|
|
233
|
+
readonly beforeRelease?: () => Promise<void>;
|
|
234
|
+
readonly beforeLockMetadata?: (operation: 'owner-unlink' | 'tombstone-rmdir' | 'owner-restore-link' | 'backup-unlink') => Promise<void>;
|
|
235
|
+
readonly contentionTimeoutMs?: number;
|
|
236
|
+
}
|
|
237
|
+
interface StateScopedLock {
|
|
238
|
+
readonly kind: 'state-scoped-lock';
|
|
239
|
+
}
|
|
240
|
+
export interface StateTransactionAbort<T> {
|
|
241
|
+
readonly aborted: true;
|
|
242
|
+
readonly value: T;
|
|
243
|
+
}
|
|
244
|
+
export declare function abortStateTransaction<T>(value: T): StateTransactionAbort<T>;
|
|
245
|
+
type StatePublicationStatus = 'complete' | 'indeterminate';
|
|
246
|
+
export declare function authenticateStatePublication(input: {
|
|
247
|
+
readonly publication: StateResult<AnyStateRecord>;
|
|
248
|
+
readonly address: StateAddress | BootstrapStateAddress;
|
|
249
|
+
}): Readonly<{
|
|
250
|
+
readonly status: StatePublicationStatus;
|
|
251
|
+
readonly record: AnyStateRecord;
|
|
252
|
+
}> | undefined;
|
|
253
|
+
export declare function authenticateStateNamespace(value: unknown): StateNamespace | undefined;
|
|
254
|
+
export declare function issueStateScopedLock(namespace: StateNamespace, input: Readonly<{
|
|
255
|
+
owner: string;
|
|
256
|
+
identity: string;
|
|
257
|
+
}>): StateScopedLock | undefined;
|
|
258
|
+
export declare function withStateRootPortLock<T>(value: StateNamespace, options: Pick<StateTransactionOptions, 'ownerId' | 'observeHolder' | 'contentionTimeoutMs' | 'beforeRelease' | 'beforeLockMetadata'>, operation: () => T | Promise<T>): Promise<StateResult<T>>;
|
|
259
|
+
export type SkippedStateNamespace = Readonly<{
|
|
260
|
+
path: string;
|
|
261
|
+
reason: string;
|
|
262
|
+
}>;
|
|
263
|
+
export declare function withStateNamespaceInventory<T>(value: StateNamespace, operation: (namespaces: readonly StateNamespace[], skipped: readonly SkippedStateNamespace[]) => T | Promise<T>): Promise<StateResult<T>>;
|
|
264
|
+
export declare function lifecycleHistoryAddress(value: StateNamespace, stackId: StackId): StateAddress | undefined;
|
|
265
|
+
export declare function parseCoordinationStateEntry(name: string): Readonly<{
|
|
266
|
+
kind: 'record';
|
|
267
|
+
stackId: StackId;
|
|
268
|
+
} | {
|
|
269
|
+
kind: 'temporary';
|
|
270
|
+
} | {
|
|
271
|
+
kind: 'executor';
|
|
272
|
+
stackId: StackId;
|
|
273
|
+
attemptId: string;
|
|
274
|
+
}> | undefined;
|
|
275
|
+
export declare function snapshotStateNamespace(value: StateNamespace): StateNamespace | undefined;
|
|
276
|
+
export declare function snapshotBootstrapStateNamespace(value: BootstrapStateNamespace): BootstrapStateNamespace | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* The per-user state root, without a cockpit or checkout: what `runtime measure` needs to record a
|
|
279
|
+
* fact about this machine before any stack exists. It is the same root `selectStateRoot` scopes
|
|
280
|
+
* each cockpit under, so every checkout of every cockpit on this machine reaches the same directory.
|
|
281
|
+
*/
|
|
282
|
+
export declare function selectMachineStateRoot(input: Readonly<{
|
|
283
|
+
platform: 'darwin' | 'linux';
|
|
284
|
+
home: string | undefined;
|
|
285
|
+
xdgStateHome?: string;
|
|
286
|
+
uid?: number;
|
|
287
|
+
}>): Promise<StateResult<string>>;
|
|
288
|
+
export declare function selectBootstrapStateRoot(input: SelectBootstrapStateRootInput): Promise<StateResult<BootstrapStateNamespace>>;
|
|
289
|
+
export declare function selectStateRoot(input: SelectStateRootInput): Promise<StateResult<StateNamespace>>;
|
|
290
|
+
export declare function readState(address: BootstrapStateAddress): Promise<StateResult<BootstrapStateRecord>>;
|
|
291
|
+
export declare function readState(address: StateAddress): Promise<StateResult<StateRecord>>;
|
|
292
|
+
export declare function readState(address: StateAddress | BootstrapStateAddress): Promise<StateResult<AnyStateRecord>>;
|
|
293
|
+
interface BootstrapAnswerResetPreview {
|
|
294
|
+
readonly revision: number;
|
|
295
|
+
readonly field: string;
|
|
296
|
+
readonly invalidatedFields: readonly string[];
|
|
297
|
+
readonly previewSha256: string;
|
|
298
|
+
}
|
|
299
|
+
type BootstrapAnswerResetResult = Readonly<{
|
|
300
|
+
kind: 'pending';
|
|
301
|
+
preview: BootstrapAnswerResetPreview;
|
|
302
|
+
}> | Readonly<{
|
|
303
|
+
kind: 'complete';
|
|
304
|
+
preview: BootstrapAnswerResetPreview;
|
|
305
|
+
record: BootstrapStateRecord;
|
|
306
|
+
}> | Readonly<{
|
|
307
|
+
kind: 'refusal';
|
|
308
|
+
code: string;
|
|
309
|
+
message: string;
|
|
310
|
+
target: string;
|
|
311
|
+
}>;
|
|
312
|
+
export declare function resetBootstrapAnswer(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, input: Readonly<{
|
|
313
|
+
ownerId: BootstrapLockOwnerId;
|
|
314
|
+
field: string;
|
|
315
|
+
updatedAt: string;
|
|
316
|
+
acceptedPreviewSha256?: string;
|
|
317
|
+
}>): Promise<BootstrapAnswerResetResult>;
|
|
318
|
+
type BootstrapObservationRefreshRefusal = Readonly<{
|
|
319
|
+
kind: 'refusal';
|
|
320
|
+
reason: 'invalid' | 'stale';
|
|
321
|
+
message: string;
|
|
322
|
+
}>;
|
|
323
|
+
type BootstrapObservationRefreshResult = StateResult<BootstrapStateRecord> | BootstrapObservationRefreshRefusal;
|
|
324
|
+
export declare function refreshBootstrapObservation(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, input: Readonly<{
|
|
325
|
+
ownerId: BootstrapLockOwnerId;
|
|
326
|
+
expectedRevision: number;
|
|
327
|
+
expectedSourceObservationSha256: string;
|
|
328
|
+
greenfield: NonNullable<BootstrapStateRecord['value']['greenfield']>;
|
|
329
|
+
updatedAt: string;
|
|
330
|
+
}>): Promise<BootstrapObservationRefreshResult>;
|
|
331
|
+
type BootstrapPublicationRefreshRefusal = Readonly<{
|
|
332
|
+
kind: 'refusal';
|
|
333
|
+
reason: 'invalid' | 'stale';
|
|
334
|
+
message: string;
|
|
335
|
+
}>;
|
|
336
|
+
type BootstrapPublicationRefreshResult = StateResult<BootstrapStateRecord> | BootstrapPublicationRefreshRefusal;
|
|
337
|
+
export declare function refreshBootstrapPublication(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, input: Readonly<{
|
|
338
|
+
ownerId: BootstrapLockOwnerId;
|
|
339
|
+
expectedRevision: number;
|
|
340
|
+
expectedSources: BootstrapStateRecord['value']['sources'];
|
|
341
|
+
expectedCommandSha256: string;
|
|
342
|
+
expectedPreviewSha256: string;
|
|
343
|
+
expectedPublished: BootstrapStateRecord['value']['published'];
|
|
344
|
+
sources: BootstrapStateRecord['value']['sources'];
|
|
345
|
+
previewSha256: string;
|
|
346
|
+
published: BootstrapStateRecord['value']['published'];
|
|
347
|
+
updatedAt: string;
|
|
348
|
+
}>): Promise<BootstrapPublicationRefreshResult>;
|
|
349
|
+
/**
|
|
350
|
+
* Replaces bootstrap state whose publication is gone from the checkout with a fresh preview record.
|
|
351
|
+
* The caller proves the absence; the expected revision keeps a concurrent init from being discarded.
|
|
352
|
+
*/
|
|
353
|
+
export declare function restartBootstrapState(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, input: Readonly<{
|
|
354
|
+
ownerId: BootstrapLockOwnerId;
|
|
355
|
+
expectedRevision: number;
|
|
356
|
+
updatedAt: string;
|
|
357
|
+
value: Readonly<{
|
|
358
|
+
commandSha256: string;
|
|
359
|
+
previewSha256: string;
|
|
360
|
+
sources: readonly BootstrapStateRecord['value']['sources'][number][];
|
|
361
|
+
}>;
|
|
362
|
+
}>): Promise<StateResult<BootstrapStateRecord> | Readonly<{
|
|
363
|
+
kind: 'stale';
|
|
364
|
+
}>>;
|
|
365
|
+
export declare function inspectStateLock(namespace: StateNamespace | BootstrapStateNamespace, observeHolder?: StateTransactionOptions['observeHolder']): Promise<StateLockInspection>;
|
|
366
|
+
export declare function withStateScopedLock<T>(namespace: StateNamespace, scope: StateScopedLock, options: Pick<StateTransactionOptions, 'ownerId' | 'observeHolder' | 'contentionTimeoutMs' | 'beforeRelease' | 'beforeLockMetadata'>, operation: () => T | Promise<T>): Promise<StateResult<T>>;
|
|
367
|
+
export declare function transactState(namespace: StateNamespace, address: StateAddress, options: StateTransactionOptions, update: (current: StateRecord | null) => StateRecord | Promise<StateRecord>): Promise<StateResult<StateRecord>>;
|
|
368
|
+
export declare function transactState<T>(namespace: StateNamespace, address: StateAddress, options: StateTransactionOptions, update: (current: StateRecord | null) => StateRecord | StateTransactionAbort<T> | Promise<StateRecord | StateTransactionAbort<T>>): Promise<StateResult<StateRecord> | StateTransactionAbort<T>>;
|
|
369
|
+
export declare function transactState(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, options: StateTransactionOptions, update: (current: BootstrapStateRecord | null) => BootstrapStateRecord | Promise<BootstrapStateRecord>): Promise<StateResult<BootstrapStateRecord>>;
|
|
370
|
+
export declare function transactState<T>(namespace: BootstrapStateNamespace, address: BootstrapStateAddress, options: StateTransactionOptions, update: (current: BootstrapStateRecord | null) => BootstrapStateRecord | StateTransactionAbort<T> | Promise<BootstrapStateRecord | StateTransactionAbort<T>>): Promise<StateResult<BootstrapStateRecord> | StateTransactionAbort<T>>;
|
|
371
|
+
/** One of a stack's own record files, by the SHA-256 of its exact bytes. */
|
|
372
|
+
export type StackStateFile = Readonly<{
|
|
373
|
+
kind: 'coordination' | 'lifecycle' | 'lifecycle-history' | 'data-outcome';
|
|
374
|
+
path: string;
|
|
375
|
+
sha256: string;
|
|
376
|
+
}>;
|
|
377
|
+
/** A stack's record files, and its coordination record decoded from the very bytes its file digest binds. */
|
|
378
|
+
type StackStateRead = Readonly<{
|
|
379
|
+
files: readonly StackStateFile[];
|
|
380
|
+
/** Undefined when the stack has no coordination file. */
|
|
381
|
+
coordination: StateResult<StateRecord> | undefined;
|
|
382
|
+
}>;
|
|
383
|
+
/** The record files a stack has under one cockpit's namespace, read as bytes so an unparseable record is listed too. */
|
|
384
|
+
export declare function inspectStackState(value: StateNamespace, stackId: StackId): Promise<StateResult<readonly StackStateFile[]>>;
|
|
385
|
+
/** `inspectStackState`, plus the coordination record decoded from the bytes it read rather than from a second read. */
|
|
386
|
+
export declare function inspectStackRecords(value: StateNamespace, stackId: StackId): Promise<StateResult<StackStateRead>>;
|
|
387
|
+
/** What a guarded removal did: removed the named paths, or found them changed since the preview and left them. */
|
|
388
|
+
type StateRemoval = Readonly<{
|
|
389
|
+
kind: 'removed';
|
|
390
|
+
paths: readonly string[];
|
|
391
|
+
}> | Readonly<{
|
|
392
|
+
kind: 'changed';
|
|
393
|
+
reason: string;
|
|
394
|
+
}>;
|
|
395
|
+
/**
|
|
396
|
+
* Deletes a stack's record files, which releases its port lease, only when each file still holds the
|
|
397
|
+
* exact bytes `expected` names and no other file has appeared. It runs under the root port lock, so
|
|
398
|
+
* no `up` leases ports from a view that still counts the lease, and under the cockpit's own state
|
|
399
|
+
* lock, so no transaction rewrites a record between the check and the removal.
|
|
400
|
+
*/
|
|
401
|
+
export declare function removeStackState(value: StateNamespace, stackId: StackId, expected: readonly StackStateFile[], options: Readonly<{
|
|
402
|
+
ownerId: HolderId;
|
|
403
|
+
}>): Promise<StateResult<StateRemoval>>;
|
|
404
|
+
/** A digest of another cockpit's state folder that this version cannot read: every entry's path, mode, size and modification time. */
|
|
405
|
+
export declare function inspectStateNamespaceFolder(value: StateNamespace, path: string): Promise<StateResult<string>>;
|
|
406
|
+
/** Deletes another cockpit's unreadable state folder, under the root port lock, only while it still matches `fingerprint`. */
|
|
407
|
+
export declare function removeStateNamespaceFolder(value: StateNamespace, path: string, fingerprint: string, options: Readonly<{
|
|
408
|
+
ownerId: HolderId;
|
|
409
|
+
}>): Promise<StateResult<StateRemoval>>;
|
|
410
|
+
export {};
|