@b00dea/cockpit 0.0.0-stage → 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.
- package/CHANGELOG.md +375 -0
- package/LICENSE +21 -0
- package/README.md +22 -2
- package/bin/cockpit.mjs +33 -0
- package/cockpit.schema.json +2574 -0
- package/dist/autonomy.d.ts +44 -0
- package/dist/autonomy.js +156 -0
- package/dist/bounded-read.d.ts +14 -0
- package/dist/bounded-read.js +42 -0
- package/dist/browser/commands.d.ts +62 -0
- package/dist/browser/commands.js +349 -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 +117 -0
- package/dist/browser/runtime.js +183 -0
- package/dist/browser/surfaces.d.ts +141 -0
- package/dist/browser/surfaces.js +556 -0
- package/dist/browser/ui-gate.d.ts +15 -0
- package/dist/browser/ui-gate.js +18 -0
- package/dist/cli-guard.d.ts +5 -0
- package/dist/cli-guard.js +71 -0
- package/dist/cli-main.d.ts +139 -0
- package/dist/cli-main.js +1405 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +16 -0
- package/dist/command-table.d.ts +113 -0
- package/dist/command-table.js +512 -0
- package/dist/config/load.d.ts +171 -0
- package/dist/config/load.js +345 -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/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 +335 -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/destructive.d.ts +6 -0
- package/dist/environment/application/destructive.js +425 -0
- package/dist/environment/application/doctor.d.ts +89 -0
- package/dist/environment/application/doctor.js +235 -0
- package/dist/environment/application/guard.d.ts +43 -0
- package/dist/environment/application/guard.js +622 -0
- package/dist/environment/application/health.d.ts +134 -0
- package/dist/environment/application/health.js +379 -0
- package/dist/environment/application/lifecycle-context.d.ts +228 -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 +201 -0
- package/dist/environment/application/lifecycle.d.ts +17 -0
- package/dist/environment/application/lifecycle.js +729 -0
- package/dist/environment/application/logs.d.ts +45 -0
- package/dist/environment/application/logs.js +127 -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/claims.d.ts +389 -0
- package/dist/environment/claims.js +1709 -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 +117 -0
- package/dist/environment/compose-topology.js +413 -0
- package/dist/environment/contract.d.ts +489 -0
- package/dist/environment/contract.js +761 -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 +26 -0
- package/dist/environment/executable.js +167 -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 +189 -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 +276 -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 +484 -0
- package/dist/environment/generated-application/shared.js +349 -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 +389 -0
- package/dist/environment/generated-application/surfaces.d.ts +3 -0
- package/dist/environment/generated-application/surfaces.js +699 -0
- package/dist/environment/generated-application/sync.d.ts +6 -0
- package/dist/environment/generated-application/sync.js +109 -0
- package/dist/environment/git-observation.d.ts +183 -0
- package/dist/environment/git-observation.js +544 -0
- package/dist/environment/health-composition.d.ts +11 -0
- package/dist/environment/health-composition.js +628 -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 +308 -0
- package/dist/environment/init-application.js +697 -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 +29 -0
- package/dist/environment/lifecycle-composition.js +675 -0
- package/dist/environment/lifecycle-stage.d.ts +115 -0
- package/dist/environment/lifecycle-stage.js +398 -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/observations.d.ts +46 -0
- package/dist/environment/observations.js +344 -0
- package/dist/environment/operator-application.d.ts +50 -0
- package/dist/environment/operator-application.js +155 -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/read-composition.d.ts +27 -0
- package/dist/environment/read-composition.js +352 -0
- package/dist/environment/readiness-composition.d.ts +38 -0
- package/dist/environment/readiness-composition.js +130 -0
- package/dist/environment/reclaim.d.ts +333 -0
- package/dist/environment/reclaim.js +1835 -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 +505 -0
- package/dist/environment/runtime.js +2335 -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/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-instructions.d.ts +33 -0
- package/dist/environment/sibling-instructions.js +224 -0
- package/dist/environment/sibling-registration.d.ts +45 -0
- package/dist/environment/sibling-registration.js +538 -0
- package/dist/environment/state.d.ts +371 -0
- package/dist/environment/state.js +2013 -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 +96 -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 +102 -0
- package/dist/environment-exec/execute.js +1175 -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 +275 -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/evaluator.d.ts +113 -0
- package/dist/guards/evaluator.js +1226 -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 +40 -0
- package/dist/guards/local-identity.js +123 -0
- package/dist/guards/policy-pin.d.ts +13 -0
- package/dist/guards/policy-pin.js +175 -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 +40 -0
- package/dist/init/command.js +310 -0
- package/dist/init/derive.d.ts +51 -0
- package/dist/init/derive.js +715 -0
- package/dist/init/draft.d.ts +138 -0
- package/dist/init/draft.js +1205 -0
- package/dist/init/render.d.ts +35 -0
- package/dist/init/render.js +82 -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/schema-json.d.ts +1 -0
- package/dist/schema-json.js +177 -0
- package/dist/schema.d.ts +1322 -0
- package/dist/schema.js +934 -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 +180 -0
- package/dist/surfaces/harness-registry.js +117 -0
- package/dist/surfaces/mcp.d.ts +95 -0
- package/dist/surfaces/mcp.js +186 -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 +681 -0
- package/dist/surfaces/render.d.ts +118 -0
- package/dist/surfaces/render.js +633 -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 +512 -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/verdict.d.ts +29 -0
- package/dist/testing/verdict.js +62 -0
- package/dist/work-orders/application.d.ts +99 -0
- package/dist/work-orders/application.js +383 -0
- package/dist/work-orders/composition.d.ts +124 -0
- package/dist/work-orders/composition.js +1010 -0
- package/dist/work-orders/contract.d.ts +61 -0
- package/dist/work-orders/contract.js +122 -0
- package/dist/work-orders/store.d.ts +158 -0
- package/dist/work-orders/store.js +197 -0
- package/docs/README.md +65 -0
- package/docs/architecture.md +136 -0
- package/docs/capability-matrix.md +50 -0
- package/docs/cli-reference.md +599 -0
- package/docs/command-list.md +51 -0
- package/docs/compose-patterns.md +99 -0
- package/docs/concepts.md +171 -0
- package/docs/configuration-essentials.md +172 -0
- package/docs/configuration-reference.md +621 -0
- package/docs/environment.md +760 -0
- package/docs/extending.md +43 -0
- package/docs/faq.md +111 -0
- package/docs/getting-started.md +608 -0
- package/docs/harness-surfaces.md +433 -0
- package/docs/joining-a-team.md +76 -0
- package/docs/release-policy.md +49 -0
- package/docs/safety-and-autonomy.md +419 -0
- package/docs/troubleshooting.md +361 -0
- package/docs/tutorial.md +170 -0
- package/docs/work-and-browser.md +254 -0
- package/libexec/browser-operation.cjs +186 -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 +54 -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 +61 -0
- package/surfaces/skills/procedures/fix.md +81 -0
- package/surfaces/skills/procedures/setup.md +379 -0
- package/surfaces/skills/procedures/work.md +105 -0
|
@@ -0,0 +1,371 @@
|
|
|
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
|
+
export 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
|
+
"operator-confirmed": "operator-confirmed";
|
|
134
|
+
unattributed: "unattributed";
|
|
135
|
+
}>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
export type BootstrapStateRecord = z.infer<typeof BootstrapStateRecordSchema>;
|
|
141
|
+
type AnyStateRecord = StateRecord | BootstrapStateRecord;
|
|
142
|
+
export interface StateAddress {
|
|
143
|
+
readonly path: string;
|
|
144
|
+
readonly stateRoot: string;
|
|
145
|
+
readonly cockpitRoot: string;
|
|
146
|
+
readonly kind: StateRecordKind;
|
|
147
|
+
readonly cockpitId: CockpitId;
|
|
148
|
+
readonly subjectId: string;
|
|
149
|
+
readonly qualifier?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface StateNamespace {
|
|
152
|
+
readonly root: string;
|
|
153
|
+
readonly cockpitRoot: string;
|
|
154
|
+
readonly paths: {
|
|
155
|
+
readonly coordination: (stackId: StackId) => StateAddress;
|
|
156
|
+
readonly lifecycle: (stackId: StackId) => StateAddress;
|
|
157
|
+
readonly dataOutcome: (stackId: StackId) => StateAddress;
|
|
158
|
+
readonly stateLock: string;
|
|
159
|
+
readonly installLock: (cacheId: string) => string;
|
|
160
|
+
readonly cache: (checkoutId: CheckoutId, cacheIdentitySha256: string) => StateAddress;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export interface BootstrapStateAddress {
|
|
164
|
+
readonly path: string;
|
|
165
|
+
readonly stateRoot: string;
|
|
166
|
+
readonly checkoutRoot: string;
|
|
167
|
+
readonly kind: 'bootstrap';
|
|
168
|
+
readonly checkoutId: CheckoutId;
|
|
169
|
+
readonly target: SurfaceTarget;
|
|
170
|
+
}
|
|
171
|
+
export interface BootstrapStateNamespace {
|
|
172
|
+
readonly root: string;
|
|
173
|
+
readonly checkoutRoot: string;
|
|
174
|
+
readonly checkoutId: CheckoutId;
|
|
175
|
+
readonly target: SurfaceTarget;
|
|
176
|
+
readonly paths: {
|
|
177
|
+
readonly bootstrap: (target: SurfaceTarget) => BootstrapStateAddress;
|
|
178
|
+
readonly stateLock: string;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export type StateResult<T> = {
|
|
182
|
+
readonly kind: 'complete';
|
|
183
|
+
readonly value: T;
|
|
184
|
+
} | {
|
|
185
|
+
readonly kind: 'missing';
|
|
186
|
+
readonly path: string;
|
|
187
|
+
} | {
|
|
188
|
+
readonly kind: 'indeterminate';
|
|
189
|
+
readonly code: typeof ENVIRONMENT_CODES.STATE_DURABILITY_INDETERMINATE;
|
|
190
|
+
readonly message: string;
|
|
191
|
+
readonly target: string;
|
|
192
|
+
readonly recovery: string;
|
|
193
|
+
readonly value: T;
|
|
194
|
+
} | {
|
|
195
|
+
readonly kind: 'refusal';
|
|
196
|
+
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;
|
|
197
|
+
readonly message: string;
|
|
198
|
+
readonly target: string;
|
|
199
|
+
readonly recovery?: string;
|
|
200
|
+
};
|
|
201
|
+
export interface SelectStateRootInput {
|
|
202
|
+
readonly platform: 'darwin' | 'linux';
|
|
203
|
+
readonly home: string | undefined;
|
|
204
|
+
readonly xdgStateHome?: string;
|
|
205
|
+
readonly checkoutRoot?: string;
|
|
206
|
+
readonly checkoutRoots?: readonly string[];
|
|
207
|
+
readonly cockpitId: CockpitId;
|
|
208
|
+
readonly uid?: number;
|
|
209
|
+
}
|
|
210
|
+
export interface SelectBootstrapStateRootInput {
|
|
211
|
+
readonly platform: 'darwin' | 'linux';
|
|
212
|
+
readonly home: string | undefined;
|
|
213
|
+
readonly xdgStateHome?: string;
|
|
214
|
+
readonly checkoutRoot: string;
|
|
215
|
+
readonly target: SurfaceTarget;
|
|
216
|
+
readonly uid?: number;
|
|
217
|
+
}
|
|
218
|
+
type LockHolderState = 'live' | 'dead' | 'unknown';
|
|
219
|
+
export interface StateLockInspection {
|
|
220
|
+
readonly holderState: LockHolderState | 'invalid';
|
|
221
|
+
readonly description: string;
|
|
222
|
+
readonly recovery: string;
|
|
223
|
+
}
|
|
224
|
+
export interface StateTransactionOptions {
|
|
225
|
+
readonly ownerId: HolderId | BootstrapLockOwnerId;
|
|
226
|
+
readonly observeHolder?: (holder: {
|
|
227
|
+
readonly ownerId: HolderId | BootstrapLockOwnerId;
|
|
228
|
+
readonly pid: number;
|
|
229
|
+
}) => Promise<LockHolderState>;
|
|
230
|
+
readonly beforePublish?: (temporaryPath: string) => Promise<void>;
|
|
231
|
+
readonly beforeCommit?: () => StateTransactionAbort<unknown> | undefined;
|
|
232
|
+
readonly beforeRelease?: () => Promise<void>;
|
|
233
|
+
readonly beforeLockMetadata?: (operation: 'owner-unlink' | 'tombstone-rmdir' | 'owner-restore-link' | 'backup-unlink') => Promise<void>;
|
|
234
|
+
readonly contentionTimeoutMs?: number;
|
|
235
|
+
}
|
|
236
|
+
export interface StateScopedLock {
|
|
237
|
+
readonly kind: 'state-scoped-lock';
|
|
238
|
+
}
|
|
239
|
+
export interface StateTransactionAbort<T> {
|
|
240
|
+
readonly aborted: true;
|
|
241
|
+
readonly value: T;
|
|
242
|
+
}
|
|
243
|
+
export declare function abortStateTransaction<T>(value: T): StateTransactionAbort<T>;
|
|
244
|
+
type StatePublicationStatus = 'complete' | 'indeterminate';
|
|
245
|
+
export declare function authenticateStatePublication(input: {
|
|
246
|
+
readonly publication: StateResult<AnyStateRecord>;
|
|
247
|
+
readonly address: StateAddress | BootstrapStateAddress;
|
|
248
|
+
}): Readonly<{
|
|
249
|
+
readonly status: StatePublicationStatus;
|
|
250
|
+
readonly record: AnyStateRecord;
|
|
251
|
+
}> | undefined;
|
|
252
|
+
export declare function authenticateStateNamespace(value: unknown): StateNamespace | undefined;
|
|
253
|
+
export declare function authenticateBootstrapStateNamespace(value: unknown): BootstrapStateNamespace | 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
|
+
export interface BootstrapAnswerResetPreview {
|
|
294
|
+
readonly revision: number;
|
|
295
|
+
readonly field: string;
|
|
296
|
+
readonly invalidatedFields: readonly string[];
|
|
297
|
+
readonly previewSha256: string;
|
|
298
|
+
}
|
|
299
|
+
export 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
|
+
export 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
|
+
export 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
|
+
export {};
|