@cleocode/core 2026.10.1 → 2026.10.2
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/dist/build-provenance.json +2 -2
- package/dist/cloud/journal.d.ts +9 -5
- package/dist/cloud/journal.d.ts.map +1 -1
- package/dist/cloud/journal.js +29 -8
- package/dist/cloud/journal.js.map +1 -1
- package/dist/cloud/manifest-check.d.ts +140 -4
- package/dist/cloud/manifest-check.d.ts.map +1 -1
- package/dist/cloud/manifest-check.js +309 -10
- package/dist/cloud/manifest-check.js.map +1 -1
- package/dist/cloud/nexus-attach.d.ts +25 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -1
- package/dist/cloud/nexus-attach.js +81 -6
- package/dist/cloud/nexus-attach.js.map +1 -1
- package/dist/cloud/nexus-cloud-activity.d.ts +37 -0
- package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-activity.js +79 -0
- package/dist/cloud/nexus-cloud-activity.js.map +1 -0
- package/dist/cloud/nexus-cloud-status.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud-status.js +36 -0
- package/dist/cloud/nexus-cloud-status.js.map +1 -1
- package/dist/cloud/nexus-device.d.ts +1 -1
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +5 -0
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-home.d.ts +74 -0
- package/dist/cloud/nexus-home.d.ts.map +1 -0
- package/dist/cloud/nexus-home.js +97 -0
- package/dist/cloud/nexus-home.js.map +1 -0
- package/dist/cloud/nexus-vault-keys.d.ts +129 -0
- package/dist/cloud/nexus-vault-keys.d.ts.map +1 -0
- package/dist/cloud/nexus-vault-keys.js +277 -0
- package/dist/cloud/nexus-vault-keys.js.map +1 -0
- package/dist/cloud/nexus-vault-state.d.ts +121 -0
- package/dist/cloud/nexus-vault-state.d.ts.map +1 -0
- package/dist/cloud/nexus-vault-state.js +274 -0
- package/dist/cloud/nexus-vault-state.js.map +1 -0
- package/dist/cloud/nexus-vault.d.ts +160 -0
- package/dist/cloud/nexus-vault.d.ts.map +1 -0
- package/dist/cloud/nexus-vault.js +1733 -0
- package/dist/cloud/nexus-vault.js.map +1 -0
- package/dist/cloud/signing.d.ts +24 -8
- package/dist/cloud/signing.d.ts.map +1 -1
- package/dist/cloud/signing.js +61 -15
- package/dist/cloud/signing.js.map +1 -1
- package/dist/docs/export-document.js +8137 -3318
- package/dist/docs/export-document.js.map +3 -3
- package/dist/doctor/migrations.d.ts +75 -0
- package/dist/doctor/migrations.d.ts.map +1 -0
- package/dist/doctor/migrations.js +136 -0
- package/dist/doctor/migrations.js.map +1 -0
- package/dist/doctor/sync-sealer.d.ts +48 -0
- package/dist/doctor/sync-sealer.d.ts.map +1 -0
- package/dist/doctor/sync-sealer.js +109 -0
- package/dist/doctor/sync-sealer.js.map +1 -0
- package/dist/doctor/sync-triggers.d.ts +53 -0
- package/dist/doctor/sync-triggers.d.ts.map +1 -0
- package/dist/doctor/sync-triggers.js +157 -0
- package/dist/doctor/sync-triggers.js.map +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +5 -1
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/llm/plugin-facade.js +8442 -3623
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/nexus/projects-clean.d.ts +3 -0
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +9 -3
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +3 -1
- package/dist/nexus/registry-roots.d.ts.map +1 -1
- package/dist/nexus/registry-roots.js +5 -2
- package/dist/nexus/registry-roots.js.map +1 -1
- package/dist/nexus/registry.d.ts +8 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +24 -10
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/workspace.d.ts +4 -1
- package/dist/nexus/workspace.d.ts.map +1 -1
- package/dist/nexus/workspace.js +10 -4
- package/dist/nexus/workspace.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +7 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestrate/worker-verify.d.ts +121 -12
- package/dist/orchestrate/worker-verify.d.ts.map +1 -1
- package/dist/orchestrate/worker-verify.js +172 -21
- package/dist/orchestrate/worker-verify.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +15 -9
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +9 -0
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +9 -2
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/resources/backend.d.ts +15 -3
- package/dist/resources/backend.d.ts.map +1 -1
- package/dist/resources/backend.js +7 -3
- package/dist/resources/backend.js.map +1 -1
- package/dist/resources/darwin-backend.d.ts +142 -0
- package/dist/resources/darwin-backend.d.ts.map +1 -0
- package/dist/resources/darwin-backend.js +288 -0
- package/dist/resources/darwin-backend.js.map +1 -0
- package/dist/resources/governor.d.ts +44 -1
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +100 -36
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/heavy-command.d.ts +132 -0
- package/dist/resources/heavy-command.d.ts.map +1 -0
- package/dist/resources/heavy-command.js +768 -0
- package/dist/resources/heavy-command.js.map +1 -0
- package/dist/resources/monitor.d.ts +50 -1
- package/dist/resources/monitor.d.ts.map +1 -1
- package/dist/resources/monitor.js +83 -1
- package/dist/resources/monitor.js.map +1 -1
- package/dist/resources/run-admission.d.ts +303 -0
- package/dist/resources/run-admission.d.ts.map +1 -0
- package/dist/resources/run-admission.js +648 -0
- package/dist/resources/run-admission.js.map +1 -0
- package/dist/resources/run-class.d.ts +111 -0
- package/dist/resources/run-class.d.ts.map +1 -0
- package/dist/resources/run-class.js +658 -0
- package/dist/resources/run-class.js.map +1 -0
- package/dist/resources/run-governed.d.ts +158 -0
- package/dist/resources/run-governed.d.ts.map +1 -0
- package/dist/resources/run-governed.js +406 -0
- package/dist/resources/run-governed.js.map +1 -0
- package/dist/resources/slot-holder.d.ts +267 -0
- package/dist/resources/slot-holder.d.ts.map +1 -0
- package/dist/resources/slot-holder.js +505 -0
- package/dist/resources/slot-holder.js.map +1 -0
- package/dist/resources/tool-groups.d.ts +74 -0
- package/dist/resources/tool-groups.d.ts.map +1 -0
- package/dist/resources/tool-groups.js +118 -0
- package/dist/resources/tool-groups.js.map +1 -0
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +1 -0
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +8446 -3627
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/cross-project-hygiene.d.ts +3 -2
- package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
- package/dist/sentient/cross-project-hygiene.js +5 -2
- package/dist/sentient/cross-project-hygiene.js.map +1 -1
- package/dist/sentient/state.d.ts +7 -0
- package/dist/sentient/state.d.ts.map +1 -1
- package/dist/sentient/state.js.map +1 -1
- package/dist/sentient/tick.d.ts +14 -2
- package/dist/sentient/tick.d.ts.map +1 -1
- package/dist/sentient/tick.js +63 -4
- package/dist/sentient/tick.js.map +1 -1
- package/dist/store/backup-recover.d.ts.map +1 -1
- package/dist/store/backup-recover.js +5 -0
- package/dist/store/backup-recover.js.map +1 -1
- package/dist/store/data-accessor.d.ts +1 -0
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +7 -0
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +23 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +126 -36
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/recovery.d.ts.map +1 -1
- package/dist/store/exodus/recovery.js +15 -0
- package/dist/store/exodus/recovery.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +5 -0
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +8 -1
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +10 -2
- package/dist/store/lock.js.map +1 -1
- package/dist/store/migration-manager.d.ts +5 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +11 -0
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-runner.d.ts +158 -0
- package/dist/store/migration-runner.d.ts.map +1 -0
- package/dist/store/migration-runner.js +493 -0
- package/dist/store/migration-runner.js.map +1 -0
- package/dist/store/portable-bundle-import.d.ts +15 -1
- package/dist/store/portable-bundle-import.d.ts.map +1 -1
- package/dist/store/portable-bundle-import.js +24 -4
- package/dist/store/portable-bundle-import.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts +43 -0
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +79 -5
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts +20 -0
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +38 -3
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts +33 -0
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +34 -7
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/row-identity-registry.d.ts +137 -7
- package/dist/store/row-identity-registry.d.ts.map +1 -1
- package/dist/store/row-identity-registry.js +364 -9
- package/dist/store/row-identity-registry.js.map +1 -1
- package/dist/store/row-identity.d.ts.map +1 -1
- package/dist/store/row-identity.js +9 -10
- package/dist/store/row-identity.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +10 -0
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +31 -0
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +5 -1
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/sync/capture.d.ts +203 -0
- package/dist/store/sync/capture.d.ts.map +1 -0
- package/dist/store/sync/capture.js +562 -0
- package/dist/store/sync/capture.js.map +1 -0
- package/dist/store/sync/clock-store.d.ts.map +1 -1
- package/dist/store/sync/clock-store.js +2 -0
- package/dist/store/sync/clock-store.js.map +1 -1
- package/dist/store/sync/fk-orphans.d.ts +133 -0
- package/dist/store/sync/fk-orphans.d.ts.map +1 -0
- package/dist/store/sync/fk-orphans.js +265 -0
- package/dist/store/sync/fk-orphans.js.map +1 -0
- package/dist/store/sync/flags.d.ts +7 -0
- package/dist/store/sync/flags.d.ts.map +1 -1
- package/dist/store/sync/flags.js +16 -0
- package/dist/store/sync/flags.js.map +1 -1
- package/dist/store/sync/hlc.d.ts.map +1 -1
- package/dist/store/sync/hlc.js +4 -0
- package/dist/store/sync/hlc.js.map +1 -1
- package/dist/store/sync/identity-fill.d.ts +45 -0
- package/dist/store/sync/identity-fill.d.ts.map +1 -0
- package/dist/store/sync/identity-fill.js +85 -0
- package/dist/store/sync/identity-fill.js.map +1 -0
- package/dist/store/sync/machinery.d.ts +27 -0
- package/dist/store/sync/machinery.d.ts.map +1 -0
- package/dist/store/sync/machinery.js +44 -0
- package/dist/store/sync/machinery.js.map +1 -0
- package/dist/store/sync/netting.d.ts +120 -0
- package/dist/store/sync/netting.d.ts.map +1 -0
- package/dist/store/sync/netting.js +336 -0
- package/dist/store/sync/netting.js.map +1 -0
- package/dist/store/sync/replica.d.ts +27 -2
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +47 -3
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/schema.d.ts +12 -0
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +21 -0
- package/dist/store/sync/schema.js.map +1 -1
- package/dist/store/sync/seal-backlog.d.ts +21 -0
- package/dist/store/sync/seal-backlog.d.ts.map +1 -0
- package/dist/store/sync/seal-backlog.js +24 -0
- package/dist/store/sync/seal-backlog.js.map +1 -0
- package/dist/store/sync/sealer-values.d.ts +34 -0
- package/dist/store/sync/sealer-values.d.ts.map +1 -0
- package/dist/store/sync/sealer-values.js +53 -0
- package/dist/store/sync/sealer-values.js.map +1 -0
- package/dist/store/sync/sealer.d.ts +145 -0
- package/dist/store/sync/sealer.d.ts.map +1 -0
- package/dist/store/sync/sealer.js +906 -0
- package/dist/store/sync/sealer.js.map +1 -0
- package/dist/store/sync/structural.d.ts +63 -0
- package/dist/store/sync/structural.d.ts.map +1 -0
- package/dist/store/sync/structural.js +180 -0
- package/dist/store/sync/structural.js.map +1 -0
- package/dist/store/sync/timestamps.d.ts +92 -0
- package/dist/store/sync/timestamps.d.ts.map +1 -0
- package/dist/store/sync/timestamps.js +228 -0
- package/dist/store/sync/timestamps.js.map +1 -0
- package/dist/store/sync/tombstones.d.ts +75 -0
- package/dist/store/sync/tombstones.d.ts.map +1 -0
- package/dist/store/sync/tombstones.js +103 -0
- package/dist/store/sync/tombstones.js.map +1 -0
- package/dist/store/sync/trigger-classes.d.ts +221 -0
- package/dist/store/sync/trigger-classes.d.ts.map +1 -0
- package/dist/store/sync/trigger-classes.js +441 -0
- package/dist/store/sync/trigger-classes.js.map +1 -0
- package/dist/store/sync/trigger-suspend-at-path.d.ts +23 -0
- package/dist/store/sync/trigger-suspend-at-path.d.ts.map +1 -0
- package/dist/store/sync/trigger-suspend-at-path.js +44 -0
- package/dist/store/sync/trigger-suspend-at-path.js.map +1 -0
- package/dist/store/sync/writer-version.d.ts +43 -0
- package/dist/store/sync/writer-version.d.ts.map +1 -0
- package/dist/store/sync/writer-version.js +90 -0
- package/dist/store/sync/writer-version.js.map +1 -0
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +102 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/trigger-suspend-schema.d.ts +44 -0
- package/dist/store/trigger-suspend-schema.d.ts.map +1 -0
- package/dist/store/trigger-suspend-schema.js +25 -0
- package/dist/store/trigger-suspend-schema.js.map +1 -0
- package/dist/store/vault-manifest.d.ts +365 -0
- package/dist/store/vault-manifest.d.ts.map +1 -0
- package/dist/store/vault-manifest.js +812 -0
- package/dist/store/vault-manifest.js.map +1 -0
- package/dist/store/writer-lease.d.ts +31 -0
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +65 -2
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +21 -0
- package/dist/system/health.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +3 -1
- package/dist/system/project-health.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +58 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +75 -6
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/affected-scope.d.ts +150 -23
- package/dist/tasks/affected-scope.d.ts.map +1 -1
- package/dist/tasks/affected-scope.js +320 -32
- package/dist/tasks/affected-scope.js.map +1 -1
- package/dist/tasks/change-set.d.ts +96 -0
- package/dist/tasks/change-set.d.ts.map +1 -1
- package/dist/tasks/change-set.js +169 -4
- package/dist/tasks/change-set.js.map +1 -1
- package/dist/tasks/complete-ci.d.ts +115 -0
- package/dist/tasks/complete-ci.d.ts.map +1 -0
- package/dist/tasks/complete-ci.js +171 -0
- package/dist/tasks/complete-ci.js.map +1 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +50 -17
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/compute-task-view.d.ts.map +1 -1
- package/dist/tasks/compute-task-view.js +7 -0
- package/dist/tasks/compute-task-view.js.map +1 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +51 -30
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/done-record.d.ts +6 -0
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +9 -3
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/evidence.d.ts +3 -2
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +143 -12
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-notes.d.ts +22 -0
- package/dist/tasks/gate-notes.d.ts.map +1 -0
- package/dist/tasks/gate-notes.js +33 -0
- package/dist/tasks/gate-notes.js.map +1 -0
- package/dist/tasks/index.d.ts +2 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +2 -1
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/test-run-binding.d.ts +117 -0
- package/dist/tasks/test-run-binding.d.ts.map +1 -0
- package/dist/tasks/test-run-binding.js +365 -0
- package/dist/tasks/test-run-binding.js.map +1 -0
- package/dist/tasks/tool-cache-env.d.ts +123 -0
- package/dist/tasks/tool-cache-env.d.ts.map +1 -0
- package/dist/tasks/tool-cache-env.js +287 -0
- package/dist/tasks/tool-cache-env.js.map +1 -0
- package/dist/tasks/tool-cache-failed-first.d.ts +155 -0
- package/dist/tasks/tool-cache-failed-first.d.ts.map +1 -0
- package/dist/tasks/tool-cache-failed-first.js +285 -0
- package/dist/tasks/tool-cache-failed-first.js.map +1 -0
- package/dist/tasks/tool-cache.d.ts +375 -55
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +912 -303
- package/dist/tasks/tool-cache.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +4 -3
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +15 -4
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-semaphore.d.ts +67 -7
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +134 -56
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +4 -0
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +6 -0
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +8 -0
- package/dist/validation/engine-ops.js.map +1 -1
- package/migrations/drizzle-cleo-project/20260930170000_t12819-trigger-suspend-clause/migration.sql +367 -0
- package/migrations/sync-journal/20260930120000_t12343-capture/migration.sql +47 -0
- package/migrations/sync-journal/20261001170000_t12984-sealer/migration.sql +101 -0
- package/package.json +13 -13
- package/templates/CLEO-INJECTION.md +5 -5
- package/templates/CLEO-REFERENCE.md +8 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-vault-state.d.ts","sourceRoot":"","sources":["../../src/cloud/nexus-vault-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAc/D,QAAA,MAAM,iBAAiB;IACrB,uDAAuD;;IAEvD,yFAAyF;;;IAGzF;;;OAGG;;;;;;;IAUH;;;;OAIG;;IAEH;;;;OAIG;;iBAEH,CAAC;AAcH,iDAAiD;AACjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAKjE,4CAA4C;AAC5C,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM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AM,EACjB,kBAAkB,EAAE,MAAM,GAAG,IAAI,EACjC,MAAM,GAAE;QAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAAO,GACxF,IAAI;IAuBP,sEAAsE;IACtE,UAAU,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE;QACL,gBAAgB,EAAE,MAAM,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAC/B,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KAC1C,GACA,IAAI;CAcR"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This machine's cloud vault state (`<cleoHome>/nexus-vault.json`):
|
|
3
|
+
* secret-free, machine-local bookkeeping the vault needs between runs.
|
|
4
|
+
*
|
|
5
|
+
* - Per account: the signer {@link TrustState} learned from
|
|
6
|
+
* `certifiedSigners` (trust only tightens, so it must survive restarts).
|
|
7
|
+
* - Per (stream, local store): the snapshot this store last pushed or
|
|
8
|
+
* restored, which decides "behind" (another device pushed since) and
|
|
9
|
+
* "pending changes" (this store changed since).
|
|
10
|
+
*
|
|
11
|
+
* Every read-modify-write runs under a lock file and writes atomically (temp
|
|
12
|
+
* file + rename). A file this version cannot read (truncated, invalid, or
|
|
13
|
+
* written by a newer CLEO) is moved aside with a warning, never reset in
|
|
14
|
+
* place, so a downgrade or a torn write cannot silently discard the signer
|
|
15
|
+
* pins. Nothing here is secret: keys and tokens stay in the sealed device
|
|
16
|
+
* store.
|
|
17
|
+
*
|
|
18
|
+
* @task T12336
|
|
19
|
+
* @epic T12322
|
|
20
|
+
*/
|
|
21
|
+
import fs from 'node:fs';
|
|
22
|
+
import path from 'node:path';
|
|
23
|
+
import { resolveNexusVaultStatePath } from '@cleocode/paths';
|
|
24
|
+
import lockfile from 'proper-lockfile';
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { initialTrustState } from './keys.js';
|
|
27
|
+
const trustStateSchema = z.object({
|
|
28
|
+
keyVersion: z.number().int().nonnegative(),
|
|
29
|
+
pins: z.record(z.string(), z.object({
|
|
30
|
+
replicas: z.record(z.string(), z.number().int().nonnegative()),
|
|
31
|
+
checkpoints: z.record(z.string(), z.number().int().nonnegative()),
|
|
32
|
+
})),
|
|
33
|
+
revoked: z.array(z.string()),
|
|
34
|
+
});
|
|
35
|
+
const streamStateSchema = z.looseObject({
|
|
36
|
+
/** The snapshot this store last pushed or restored. */
|
|
37
|
+
lastCheckpointId: z.string().nullable(),
|
|
38
|
+
/** Its coversSeq: an older snapshot is never restored over it without `--checkpoint`. */
|
|
39
|
+
lastCoversSeq: z.number().int().nonnegative(),
|
|
40
|
+
updatedAt: z.string(),
|
|
41
|
+
/**
|
|
42
|
+
* A push from this store that had not recorded its snapshot yet: the parent it
|
|
43
|
+
* pushed over (T13007). Cleared when the snapshot is recorded.
|
|
44
|
+
*/
|
|
45
|
+
pushInFlight: z
|
|
46
|
+
.object({
|
|
47
|
+
parentCheckpointId: z.string().nullable(),
|
|
48
|
+
at: z.string(),
|
|
49
|
+
/** The pushed snapshot's marks and per-path digests, for a recovered push (#1773 R6). */
|
|
50
|
+
gitTracked: z.array(z.string()).optional(),
|
|
51
|
+
files: z.record(z.string(), z.string()).optional(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
/**
|
|
55
|
+
* Paths (relative to the section root) the last synced snapshot marks as
|
|
56
|
+
* git-tracked: git's job, so they are left out of every file comparison
|
|
57
|
+
* with it, and a machine without git carries the marks on (T13019).
|
|
58
|
+
*/
|
|
59
|
+
gitTracked: z.array(z.string()).optional(),
|
|
60
|
+
/**
|
|
61
|
+
* The last synced snapshot's plain files, path to digest (a prefix of the
|
|
62
|
+
* vault file digest), so a later comparison judges each file on its own,
|
|
63
|
+
* whatever either side's git tracks (T13038).
|
|
64
|
+
*/
|
|
65
|
+
files: z.record(z.string(), z.string()).optional(),
|
|
66
|
+
});
|
|
67
|
+
const accountStateSchema = z.looseObject({
|
|
68
|
+
trust: trustStateSchema,
|
|
69
|
+
streams: z.record(z.string(), streamStateSchema).default({}),
|
|
70
|
+
});
|
|
71
|
+
const stateSchema = z.looseObject({
|
|
72
|
+
version: z.literal(1),
|
|
73
|
+
accounts: z.record(z.string(), accountStateSchema).default({}),
|
|
74
|
+
});
|
|
75
|
+
/** Key of one account in the state file. */
|
|
76
|
+
const accountKey = (apiUrl, userId) => `${apiUrl} ${userId}`;
|
|
77
|
+
/** Key of one local store on one stream. */
|
|
78
|
+
export const vaultStreamKey = (streamId, storeRoot) => `${streamId}|${path.resolve(storeRoot)}`;
|
|
79
|
+
/** How long a state access waits for another process's lock. */
|
|
80
|
+
const LOCK_WAIT_MS = 15_000;
|
|
81
|
+
/** Age after which a lock whose holder stopped refreshing it may be taken over. */
|
|
82
|
+
const LOCK_STALE_MS = 10_000;
|
|
83
|
+
/** Warning code: the state file was unreadable or newer, and was moved aside. */
|
|
84
|
+
export const W_NEXUS_VAULT_STATE_MOVED = 'W_NEXUS_VAULT_STATE_MOVED';
|
|
85
|
+
function sleepSync(ms) {
|
|
86
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Read/modify/write access to the vault state file.
|
|
90
|
+
*/
|
|
91
|
+
export class NexusVaultState {
|
|
92
|
+
/** Absolute path of the state file. */
|
|
93
|
+
path;
|
|
94
|
+
warnings = [];
|
|
95
|
+
/** @param filePath - Override for tests; defaults to {@link resolveNexusVaultStatePath}. */
|
|
96
|
+
constructor(filePath) {
|
|
97
|
+
this.path = filePath ?? resolveNexusVaultStatePath();
|
|
98
|
+
}
|
|
99
|
+
/** Warnings raised since the last call (a moved-aside file), for the command's result. */
|
|
100
|
+
drainWarnings() {
|
|
101
|
+
const out = this.warnings;
|
|
102
|
+
this.warnings = [];
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
/** Run `fn` holding the state file's lock. */
|
|
106
|
+
locked(fn) {
|
|
107
|
+
fs.mkdirSync(path.dirname(this.path), { recursive: true });
|
|
108
|
+
const deadline = Date.now() + LOCK_WAIT_MS;
|
|
109
|
+
let release;
|
|
110
|
+
for (;;) {
|
|
111
|
+
try {
|
|
112
|
+
release = lockfile.lockSync(this.path, { realpath: false, stale: LOCK_STALE_MS });
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
const code = err.code;
|
|
117
|
+
if (code !== 'ELOCKED' || Date.now() > deadline) {
|
|
118
|
+
throw new Error(`cannot lock the cloud vault state ${this.path}: ${err instanceof Error ? err.message : String(err)}`);
|
|
119
|
+
}
|
|
120
|
+
sleepSync(25);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
return fn();
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
release();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Move an unusable file aside (never overwrite it) and start empty. */
|
|
131
|
+
moveAside(why) {
|
|
132
|
+
const aside = `${this.path}.${why}-${new Date().toISOString().replace(/[:.]/g, '-')}`;
|
|
133
|
+
fs.renameSync(this.path, aside);
|
|
134
|
+
this.warnings.push({
|
|
135
|
+
code: W_NEXUS_VAULT_STATE_MOVED,
|
|
136
|
+
message: why === 'newer'
|
|
137
|
+
? `the cloud vault state was written by a newer CLEO; it was moved to ${aside} and this machine starts with empty vault state (re-run with the newer CLEO, or restore that file after upgrading)`
|
|
138
|
+
: `the cloud vault state could not be read; it was moved to ${aside} and this machine starts with empty vault state (signer trust is re-learned on the next command; the next push or pull resyncs)`,
|
|
139
|
+
});
|
|
140
|
+
return { version: 1, accounts: {} };
|
|
141
|
+
}
|
|
142
|
+
read() {
|
|
143
|
+
let raw;
|
|
144
|
+
try {
|
|
145
|
+
raw = fs.readFileSync(this.path, 'utf8');
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
if (err.code === 'ENOENT')
|
|
149
|
+
return { version: 1, accounts: {} };
|
|
150
|
+
throw err;
|
|
151
|
+
}
|
|
152
|
+
let json;
|
|
153
|
+
try {
|
|
154
|
+
json = JSON.parse(raw);
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return this.moveAside('unreadable');
|
|
158
|
+
}
|
|
159
|
+
const version = json !== null && typeof json === 'object' ? json.version : null;
|
|
160
|
+
if (typeof version === 'number' && version > 1)
|
|
161
|
+
return this.moveAside('newer');
|
|
162
|
+
const parsed = stateSchema.safeParse(json);
|
|
163
|
+
return parsed.success ? parsed.data : this.moveAside('unreadable');
|
|
164
|
+
}
|
|
165
|
+
write(state) {
|
|
166
|
+
const tmp = `${this.path}.${process.pid}.${Date.now()}.tmp`;
|
|
167
|
+
const fd = fs.openSync(tmp, 'w', 0o600);
|
|
168
|
+
try {
|
|
169
|
+
fs.writeSync(fd, `${JSON.stringify(state, null, 2)}\n`);
|
|
170
|
+
fs.fsyncSync(fd);
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
fs.closeSync(fd);
|
|
174
|
+
}
|
|
175
|
+
fs.renameSync(tmp, this.path);
|
|
176
|
+
}
|
|
177
|
+
/** Read, let `fn` change the state, and write it back, all under the lock. */
|
|
178
|
+
update(fn) {
|
|
179
|
+
return this.locked(() => {
|
|
180
|
+
const state = this.read();
|
|
181
|
+
const out = fn(state);
|
|
182
|
+
this.write(state);
|
|
183
|
+
return out;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/** Read under the lock (moving an unusable file aside). */
|
|
187
|
+
snapshot() {
|
|
188
|
+
return this.locked(() => this.read());
|
|
189
|
+
}
|
|
190
|
+
account(state, apiUrl, userId) {
|
|
191
|
+
const k = accountKey(apiUrl, userId);
|
|
192
|
+
state.accounts[k] ??= { trust: initialTrustState(), streams: {} };
|
|
193
|
+
return state.accounts[k];
|
|
194
|
+
}
|
|
195
|
+
/** The account's persisted signer trust state. */
|
|
196
|
+
trust(apiUrl, userId) {
|
|
197
|
+
const s = this.snapshot();
|
|
198
|
+
return structuredClone(this.account(s, apiUrl, userId).trust);
|
|
199
|
+
}
|
|
200
|
+
/** Persist the trust state returned by `certifiedSigners`. */
|
|
201
|
+
saveTrust(apiUrl, userId, trust) {
|
|
202
|
+
this.update((s) => {
|
|
203
|
+
this.account(s, apiUrl, userId).trust = structuredClone(trust);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Read the account's trust state, let `fn` evaluate it, and persist the
|
|
208
|
+
* trust it returns, all under one lock.
|
|
209
|
+
*
|
|
210
|
+
* @param apiUrl - Account API URL.
|
|
211
|
+
* @param userId - Account user id.
|
|
212
|
+
* @param fn - Receives the current trust; returns the trust to store and a result.
|
|
213
|
+
* @returns `fn`'s result.
|
|
214
|
+
*/
|
|
215
|
+
updateTrust(apiUrl, userId, fn) {
|
|
216
|
+
return this.update((s) => {
|
|
217
|
+
const a = this.account(s, apiUrl, userId);
|
|
218
|
+
const { trust, result } = fn(structuredClone(a.trust));
|
|
219
|
+
a.trust = structuredClone(trust);
|
|
220
|
+
return result;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/** What `storeRoot` last synced with on `streamId`, or `null`. */
|
|
224
|
+
stream(apiUrl, userId, streamId, storeRoot) {
|
|
225
|
+
const s = this.snapshot();
|
|
226
|
+
return this.account(s, apiUrl, userId).streams[vaultStreamKey(streamId, storeRoot)] ?? null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Record that a push from `storeRoot` is about to create a snapshot over
|
|
230
|
+
* `parentCheckpointId` (T13007). {@link saveStream} clears the mark; when a
|
|
231
|
+
* crash loses that write, the mark tells the next command that the head
|
|
232
|
+
* this device and replica pushed over that parent is this store's own, and
|
|
233
|
+
* what that snapshot marks and holds (`pushed`), so recovering it loses no
|
|
234
|
+
* per-path digest.
|
|
235
|
+
*/
|
|
236
|
+
markPushInFlight(apiUrl, userId, streamId, storeRoot, parentCheckpointId, pushed = {}) {
|
|
237
|
+
this.update((s) => {
|
|
238
|
+
const streams = this.account(s, apiUrl, userId).streams;
|
|
239
|
+
const key = vaultStreamKey(streamId, storeRoot);
|
|
240
|
+
const prior = streams[key];
|
|
241
|
+
streams[key] = {
|
|
242
|
+
...prior,
|
|
243
|
+
lastCheckpointId: prior?.lastCheckpointId ?? null,
|
|
244
|
+
lastCoversSeq: prior?.lastCoversSeq ?? 0,
|
|
245
|
+
// Never synced: any fork is news to this store.
|
|
246
|
+
updatedAt: prior?.updatedAt ?? new Date(0).toISOString(),
|
|
247
|
+
pushInFlight: {
|
|
248
|
+
parentCheckpointId,
|
|
249
|
+
at: new Date().toISOString(),
|
|
250
|
+
...(pushed.gitTracked !== undefined && pushed.gitTracked.length > 0
|
|
251
|
+
? { gitTracked: [...pushed.gitTracked].sort() }
|
|
252
|
+
: {}),
|
|
253
|
+
...(pushed.files !== undefined ? { files: { ...pushed.files } } : {}),
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/** Record that `storeRoot` now holds `checkpointId` on `streamId`. */
|
|
259
|
+
saveStream(apiUrl, userId, streamId, storeRoot, value) {
|
|
260
|
+
const { gitTracked, files, ...rest } = value;
|
|
261
|
+
this.update((s) => {
|
|
262
|
+
// In the schema's key order, so a later read-modify-write keeps the bytes.
|
|
263
|
+
this.account(s, apiUrl, userId).streams[vaultStreamKey(streamId, storeRoot)] = {
|
|
264
|
+
...rest,
|
|
265
|
+
updatedAt: new Date().toISOString(),
|
|
266
|
+
...(gitTracked !== undefined && gitTracked.length > 0
|
|
267
|
+
? { gitTracked: [...gitTracked].sort() }
|
|
268
|
+
: {}),
|
|
269
|
+
...(files !== undefined ? { files: { ...files } } : {}),
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=nexus-vault-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-vault-state.js","sourceRoot":"","sources":["../../src/cloud/nexus-vault-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,WAAW,CAAC;AAE/D,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,CACZ,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9D,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;KAClE,CAAC,CACH;IACD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW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AC;IAED,sEAAsE;IACtE,UAAU,CACR,MAAc,EACd,MAAc,EACd,QAAgB,EAChB,SAAiB,EACjB,KAKC;QAED,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YAChB,2EAA2E;YAC3E,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG;gBAC7E,GAAG,IAAI;gBACP,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACnC,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;oBACnD,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE;oBACxC,CAAC,CAAC,EAAE,CAAC;gBACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACxD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cloud vault: encrypted snapshots of a project's (or this account's
|
|
3
|
+
* global) CLEO store on Cleo Nexus, with lineage, a single-writer lease and
|
|
4
|
+
* verified restore (T12336 protocol, T12337 CLI, T12338 lease handoff).
|
|
5
|
+
*
|
|
6
|
+
* A snapshot is a checkpoint on the store's journal stream (`project:<id>`,
|
|
7
|
+
* or the account's `home:<userId>`):
|
|
8
|
+
*
|
|
9
|
+
* - **Bundle**: the store's portable bundle (`exportPortableBundle`, no
|
|
10
|
+
* secrets; for the global store without machine-local state or the config
|
|
11
|
+
* home), sealed with the stream data key and uploaded as a blob. The data
|
|
12
|
+
* key derives from the account master key, which is escrowed on Cleo Nexus
|
|
13
|
+
* (released only to your approved devices; see `nexus-vault-keys.ts` for the
|
|
14
|
+
* threat model), so this is encrypted at rest, not zero-knowledge.
|
|
15
|
+
* - **Manifest** (plaintext): per-table row counts and keyed hashes of the
|
|
16
|
+
* store's syncing tables (`buildVaultManifest`). The server checks counts
|
|
17
|
+
* reconcile with the journal; only key holders can check hashes.
|
|
18
|
+
* - **Lineage**: each snapshot names its parent; the server refuses one that
|
|
19
|
+
* does not descend from the stream head (E_LINEAGE). The client refuses
|
|
20
|
+
* earlier, with `E_NEXUS_VAULT_BEHIND`, when the head is not the snapshot
|
|
21
|
+
* this store last pushed or restored: another device wrote since.
|
|
22
|
+
* - **Counts**: a non-genesis snapshot's counts must equal the parent's plus
|
|
23
|
+
* the per-table deltas of the journal segments between them. A push whose
|
|
24
|
+
* counts changed appends one signed "vault delta" segment carrying exactly
|
|
25
|
+
* the difference (the journal sync of Stage C will carry real ops).
|
|
26
|
+
* - **Lease**: a push takes the stream's `writer` lease. Another device's
|
|
27
|
+
* live lease refuses the push (`E_NEXUS_VAULT_LEASE_HELD`); `--force`
|
|
28
|
+
* takes it, and the server labels the take as a fork from the holder.
|
|
29
|
+
* - **Fork label**: a `--force` push over a head this store had not synced,
|
|
30
|
+
* or over another device's lease, carries `zz_vault_fork` (0 rows) in its
|
|
31
|
+
* signed manifest, so every device's verify still sees the fork after the
|
|
32
|
+
* lease is released (T13007).
|
|
33
|
+
* - **Stream format** (T13034): the vault writes checkpoint/v2 and stamps
|
|
34
|
+
* `SYNC_SCHEMA_VERSION` (shared with the change journal) on its segments
|
|
35
|
+
* and manifests. It reads and verifies the segment/v3 and checkpoint/v3 the
|
|
36
|
+
* journal writes, and refuses a push onto a stream whose head snapshot is
|
|
37
|
+
* checkpoint/v3 (the server's `E_STREAM_VERSION` ratchet) or that holds a
|
|
38
|
+
* newer sync schema before it writes anything
|
|
39
|
+
* (`E_NEXUS_VAULT_STREAM_UPGRADED`).
|
|
40
|
+
*
|
|
41
|
+
* Restore downloads, verifies the author's signature, decrypts, and checks
|
|
42
|
+
* every table's count and hash against the manifest before anything is
|
|
43
|
+
* placed; this machine's `local-only` rows are carried into the snapshot so
|
|
44
|
+
* machine state (replica binding, registry paths) is never overwritten, and
|
|
45
|
+
* what the snapshot no longer lists is removed afterwards (T13004).
|
|
46
|
+
*
|
|
47
|
+
* Nothing here blocks normal commands: the vault runs only when asked.
|
|
48
|
+
*
|
|
49
|
+
* @task T12336
|
|
50
|
+
* @task T12337
|
|
51
|
+
* @task T12338
|
|
52
|
+
* @epic T12322
|
|
53
|
+
*/
|
|
54
|
+
import type { CloudLeaseReleaseResult, CloudPushResult, CloudRestoreResult, CloudVaultScope, CloudVaultStatusResult, CloudVerifyResult } from '@cleocode/contracts';
|
|
55
|
+
import { type NexusVaultOptions } from './nexus-vault-keys.js';
|
|
56
|
+
/** Default lease length of a push: long enough for a large upload, short enough to hand off. */
|
|
57
|
+
export declare const NEXUS_VAULT_LEASE_TTL_SECONDS = 900;
|
|
58
|
+
/**
|
|
59
|
+
* Global-home paths a vault snapshot never carries (T12968): this machine's
|
|
60
|
+
* identity and runtime state, and the content CLEO's installer writes for its
|
|
61
|
+
* own version (T13022: templates, harness skills, hooks, extensions, the
|
|
62
|
+
* model catalog, migration markers, the CleoOS hub extensions and identity,
|
|
63
|
+
* and the CANT starter bundle the CleoOS postinstall rewrites, T13038).
|
|
64
|
+
* A global pull must leave them as they are, so the bundle does not hold them
|
|
65
|
+
* at all. The config home is left out too.
|
|
66
|
+
*/
|
|
67
|
+
export declare const VAULT_GLOBAL_EXCLUSIONS: {
|
|
68
|
+
readonly dirs: {
|
|
69
|
+
readonly state: "machine-local state (on macOS the replica registries live here); never in a vault snapshot";
|
|
70
|
+
readonly keys: "machine-local keys (evidence cache key); never in a vault snapshot";
|
|
71
|
+
readonly 'rate-limit-state': "machine-local rate-limit counters; never in a vault snapshot";
|
|
72
|
+
readonly templates: "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
73
|
+
readonly skills: "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
74
|
+
readonly hooks: "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
75
|
+
readonly extensions: "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
76
|
+
readonly 'pi-extensions': "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
77
|
+
readonly 'llm-catalog': "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
78
|
+
readonly '.migrations': "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
79
|
+
readonly 'cant/starter': "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
80
|
+
};
|
|
81
|
+
readonly files: {
|
|
82
|
+
readonly 'CLEOOS-IDENTITY.md': "installed by this machine's CLEO version (devices on other versions would downgrade it); never in a vault snapshot";
|
|
83
|
+
readonly 'device-id': "this machine's stable device id; never in a vault snapshot";
|
|
84
|
+
readonly 'web-server.json': "machine-local web server runtime state; never in a vault snapshot";
|
|
85
|
+
readonly 'sentient-state.json': "machine-local daemon state; never in a vault snapshot";
|
|
86
|
+
readonly 'device-heartbeat.stamp': "machine-local heartbeat; never in a vault snapshot";
|
|
87
|
+
readonly 'nexus.db': "machine-local code index (rebuilt per machine); never in a vault snapshot";
|
|
88
|
+
readonly 'exodus-complete': "machine-local migration marker; never in a vault snapshot";
|
|
89
|
+
readonly 'telemetry-config.json': "this install's telemetry opt-in and anonymous id; never in a vault snapshot";
|
|
90
|
+
readonly 'decide/spend.json': "this machine's decision spend ledger (in-flight reservations); never in a vault snapshot";
|
|
91
|
+
readonly 'decide/budget.json': "this machine's decision request token bucket; never in a vault snapshot";
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
/** Options shared by the vault commands. */
|
|
95
|
+
export interface NexusVaultCommandOptions extends NexusVaultOptions {
|
|
96
|
+
/** `project` (the current project, default) or `global` (this account's global store). */
|
|
97
|
+
scope?: CloudVaultScope;
|
|
98
|
+
}
|
|
99
|
+
/** Options of {@link restoreNexusVault}. */
|
|
100
|
+
export interface NexusVaultRestoreOptions extends NexusVaultCommandOptions {
|
|
101
|
+
/** `pull`: bring this store to the head; `restore`: any snapshot (`checkpointId`), or a project onto a new machine. */
|
|
102
|
+
mode: 'pull' | 'restore';
|
|
103
|
+
/** A specific snapshot (restore only). */
|
|
104
|
+
checkpointId?: string;
|
|
105
|
+
/** Overwrite local changes (a safety backup is taken first). */
|
|
106
|
+
force?: boolean;
|
|
107
|
+
/** Restore a project this machine does not have: its server id. */
|
|
108
|
+
projectId?: string;
|
|
109
|
+
/** Where to place a project restored onto this machine (default: the current directory). */
|
|
110
|
+
into?: string;
|
|
111
|
+
/** Called after a project restore to attach this store (defaults to `linkProjectToNexus`). */
|
|
112
|
+
relink?: (projectRoot: string) => Promise<string[]>;
|
|
113
|
+
}
|
|
114
|
+
/** Safety bundles kept per store under `backups/vault`; older ones are removed (T13007). */
|
|
115
|
+
export declare const NEXUS_VAULT_SAFETY_BUNDLES_KEPT = 10;
|
|
116
|
+
/**
|
|
117
|
+
* `cleo cloud push`: snapshot this store into the vault under the write lease.
|
|
118
|
+
*
|
|
119
|
+
* @param opts - Scope, `force` (take the lease, push over a newer head as a labelled fork),
|
|
120
|
+
* `hold` (keep the writer lease after the push instead of releasing it) and overrides.
|
|
121
|
+
* @returns What was pushed.
|
|
122
|
+
* @throws {NexusAccountError} `E_NEXUS_VAULT_LEASE_HELD`, `E_NEXUS_VAULT_BEHIND`, `E_NEXUS_VAULT_REFUSED`,
|
|
123
|
+
* `E_NEXUS_VAULT_STREAM_UPGRADED`, `E_NEXUS_VAULT_NOT_LINKED`, `E_NEXUS_VAULT_KEY_UNAVAILABLE`, or a
|
|
124
|
+
* mapped API error.
|
|
125
|
+
*/
|
|
126
|
+
export declare function pushNexusVault(opts?: NexusVaultCommandOptions & {
|
|
127
|
+
force?: boolean;
|
|
128
|
+
hold?: boolean;
|
|
129
|
+
}): Promise<CloudPushResult>;
|
|
130
|
+
/**
|
|
131
|
+
* `cleo cloud pull` / `cleo cloud restore`: verify and activate a snapshot.
|
|
132
|
+
*
|
|
133
|
+
* @param opts - Mode, snapshot, project and target overrides.
|
|
134
|
+
* @returns What was restored.
|
|
135
|
+
* @throws {NexusAccountError} `E_NEXUS_VAULT_LOCAL_CHANGES`, `E_NEXUS_VAULT_VERIFY_FAILED`,
|
|
136
|
+
* `E_NEXUS_VAULT_EMPTY`, `E_NEXUS_VAULT_KEY_UNAVAILABLE`, or a mapped API error.
|
|
137
|
+
*/
|
|
138
|
+
export declare function restoreNexusVault(opts: NexusVaultRestoreOptions): Promise<CloudRestoreResult>;
|
|
139
|
+
/**
|
|
140
|
+
* `cleo cloud vault`: the vault's lineage, last push per device, pending changes and leases.
|
|
141
|
+
*
|
|
142
|
+
* @param opts - Scope and overrides.
|
|
143
|
+
* @returns The vault status.
|
|
144
|
+
*/
|
|
145
|
+
export declare function nexusVaultStatus(opts?: NexusVaultCommandOptions): Promise<CloudVaultStatusResult>;
|
|
146
|
+
/**
|
|
147
|
+
* `cleo cloud verify`: compare this store with the cloud and every device's newest snapshot.
|
|
148
|
+
*
|
|
149
|
+
* @param opts - Scope and overrides.
|
|
150
|
+
* @returns The verdict and per-table comparison.
|
|
151
|
+
*/
|
|
152
|
+
export declare function verifyNexusVault(opts?: NexusVaultCommandOptions): Promise<CloudVerifyResult>;
|
|
153
|
+
/**
|
|
154
|
+
* `cleo cloud lease release`: hand the write lease back.
|
|
155
|
+
*
|
|
156
|
+
* @param opts - Scope and overrides.
|
|
157
|
+
* @returns Whether a lease was released.
|
|
158
|
+
*/
|
|
159
|
+
export declare function releaseNexusVaultLease(opts?: NexusVaultCommandOptions): Promise<CloudLeaseReleaseResult>;
|
|
160
|
+
//# sourceMappingURL=nexus-vault.d.ts.map
|
|
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