@cleocode/core 2026.5.134 → 2026.6.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/binaries/README.md +49 -27
- package/dist/agents/{agent-registry.d.ts → agent-capacity-tracker.d.ts} +2 -2
- package/dist/agents/agent-capacity-tracker.d.ts.map +1 -0
- package/dist/agents/{agent-registry.js → agent-capacity-tracker.js} +2 -2
- package/dist/agents/agent-capacity-tracker.js.map +1 -0
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +4 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/seed-install.d.ts +1 -1
- package/dist/agents/seed-install.d.ts.map +1 -1
- package/dist/agents/seed-install.js +42 -36
- package/dist/agents/seed-install.js.map +1 -1
- package/dist/caamp-export.d.ts +18 -0
- package/dist/caamp-export.d.ts.map +1 -0
- package/dist/caamp-export.js +18 -0
- package/dist/caamp-export.js.map +1 -0
- package/dist/conduit/http-transport.d.ts +7 -13
- package/dist/conduit/http-transport.d.ts.map +1 -1
- package/dist/conduit/http-transport.js +12 -59
- package/dist/conduit/http-transport.js.map +1 -1
- package/dist/conduit/local-transport.d.ts +1 -1
- package/dist/conduit/local-transport.d.ts.map +1 -1
- package/dist/conduit/local-transport.js +69 -43
- package/dist/conduit/local-transport.js.map +1 -1
- package/dist/dispatch/mutate-projection.d.ts.map +1 -1
- package/dist/dispatch/mutate-projection.js +11 -0
- package/dist/dispatch/mutate-projection.js.map +1 -1
- package/dist/docs/docs-read-model.d.ts +7 -0
- package/dist/docs/docs-read-model.d.ts.map +1 -1
- package/dist/docs/docs-read-model.js +5 -0
- package/dist/docs/docs-read-model.js.map +1 -1
- package/dist/docs/export-document.js +40526 -281
- package/dist/docs/export-document.js.map +6 -1
- package/dist/docs/supersede.d.ts.map +1 -1
- package/dist/docs/supersede.js +12 -7
- package/dist/docs/supersede.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +10 -9
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/git-shim-export.d.ts +18 -0
- package/dist/git-shim-export.d.ts.map +1 -0
- package/dist/git-shim-export.js +18 -0
- package/dist/git-shim-export.js.map +1 -0
- package/dist/hooks/payload-schemas.d.ts +2 -2
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +39 -32
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +11 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +14 -5
- package/dist/internal.js.map +1 -1
- package/dist/lafs-export.d.ts +18 -0
- package/dist/lafs-export.d.ts.map +1 -0
- package/dist/lafs-export.js +18 -0
- package/dist/lafs-export.js.map +1 -0
- package/dist/lifecycle/effective-stage.js +1 -1
- package/dist/lifecycle/index.js +1 -1
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/rollup.js +1 -1
- package/dist/llm/credential-pool.d.ts +17 -0
- package/dist/llm/credential-pool.d.ts.map +1 -1
- package/dist/llm/credential-pool.js +40 -1
- package/dist/llm/credential-pool.js.map +1 -1
- package/dist/llm/plugin-facade.d.ts.map +1 -1
- package/dist/llm/plugin-facade.js +43392 -354
- package/dist/llm/plugin-facade.js.map +6 -1
- package/dist/llm/role-executor.d.ts +8 -0
- package/dist/llm/role-executor.d.ts.map +1 -1
- package/dist/llm/role-executor.js +96 -4
- package/dist/llm/role-executor.js.map +1 -1
- package/dist/llm/role-resolver.d.ts.map +1 -1
- package/dist/llm/role-resolver.js +56 -1
- package/dist/llm/role-resolver.js.map +1 -1
- package/dist/llm/transports/codex-oauth-headers.d.ts +51 -0
- package/dist/llm/transports/codex-oauth-headers.d.ts.map +1 -0
- package/dist/llm/transports/codex-oauth-headers.js +89 -0
- package/dist/llm/transports/codex-oauth-headers.js.map +1 -0
- package/dist/memory/claude-mem-migration.d.ts.map +1 -1
- package/dist/memory/claude-mem-migration.js +1 -3
- package/dist/memory/claude-mem-migration.js.map +1 -1
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +77 -23
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
- package/dist/memory/graph-memory-bridge.js +12 -6
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/learnings.d.ts +2 -2
- package/dist/memory/nexus-plasticity.d.ts +21 -9
- package/dist/memory/nexus-plasticity.d.ts.map +1 -1
- package/dist/memory/nexus-plasticity.js +44 -22
- package/dist/memory/nexus-plasticity.js.map +1 -1
- package/dist/memory/patterns.d.ts +2 -2
- package/dist/memory/redaction.d.ts +19 -3
- package/dist/memory/redaction.d.ts.map +1 -1
- package/dist/memory/redaction.js +64 -129
- package/dist/memory/redaction.js.map +6 -1
- package/dist/metrics/token-service.d.ts +8 -2
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/metrics/token-service.js +1 -1
- package/dist/metrics/token-service.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +6 -8
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.js +3 -3
- package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
- package/dist/nexus/clusters.d.ts.map +1 -1
- package/dist/nexus/clusters.js +3 -2
- package/dist/nexus/clusters.js.map +1 -1
- package/dist/nexus/context.d.ts.map +1 -1
- package/dist/nexus/context.js +10 -16
- package/dist/nexus/context.js.map +1 -1
- package/dist/nexus/diff.d.ts.map +1 -1
- package/dist/nexus/diff.js +6 -4
- package/dist/nexus/diff.js.map +1 -1
- package/dist/nexus/export.d.ts.map +1 -1
- package/dist/nexus/export.js +7 -4
- package/dist/nexus/export.js.map +1 -1
- package/dist/nexus/flows.d.ts.map +1 -1
- package/dist/nexus/flows.js +3 -1
- package/dist/nexus/flows.js.map +1 -1
- package/dist/nexus/impact.d.ts +1 -1
- package/dist/nexus/impact.d.ts.map +1 -1
- package/dist/nexus/impact.js +31 -17
- package/dist/nexus/impact.js.map +1 -1
- package/dist/nexus/living-brain.d.ts.map +1 -1
- package/dist/nexus/living-brain.js +27 -15
- package/dist/nexus/living-brain.js.map +1 -1
- package/dist/nexus/nexus-bridge.d.ts.map +1 -1
- package/dist/nexus/nexus-bridge.js +28 -29
- package/dist/nexus/nexus-bridge.js.map +1 -1
- package/dist/nexus/plasticity-queries.d.ts +4 -2
- package/dist/nexus/plasticity-queries.d.ts.map +1 -1
- package/dist/nexus/plasticity-queries.js +27 -15
- package/dist/nexus/plasticity-queries.js.map +1 -1
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +6 -2
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +65 -30
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/route-analysis.d.ts +3 -2
- package/dist/nexus/route-analysis.d.ts.map +1 -1
- package/dist/nexus/route-analysis.js +11 -10
- package/dist/nexus/route-analysis.js.map +1 -1
- package/dist/nexus/sigil.d.ts.map +1 -1
- package/dist/nexus/sigil.js +60 -13
- package/dist/nexus/sigil.js.map +1 -1
- package/dist/nexus/user-profile.d.ts +2 -1
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +8 -4
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/index.d.ts +1 -1
- package/dist/orchestrate/index.d.ts.map +1 -1
- package/dist/orchestrate/index.js +1 -1
- package/dist/orchestrate/index.js.map +1 -1
- package/dist/orchestrate/plan.d.ts +3 -3
- package/dist/orchestrate/plan.d.ts.map +1 -1
- package/dist/orchestrate/plan.js +7 -7
- package/dist/orchestrate/plan.js.map +1 -1
- package/dist/orchestrate/spawn-ops.js +2 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/classify.d.ts +2 -2
- package/dist/orchestration/classify.js +3 -3
- package/dist/orchestration/classify.js.map +1 -1
- package/dist/orchestration/validate-spawn.d.ts.map +1 -1
- package/dist/orchestration/validate-spawn.js +5 -5
- package/dist/orchestration/validate-spawn.js.map +1 -1
- package/dist/paths-export.d.ts +18 -0
- package/dist/paths-export.d.ts.map +1 -0
- package/dist/paths-export.js +18 -0
- package/dist/paths-export.js.map +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +24 -11
- package/dist/paths.js.map +1 -1
- package/dist/playbooks/index.d.ts +1 -0
- package/dist/playbooks/index.d.ts.map +1 -1
- package/dist/playbooks/index.js +4 -0
- package/dist/playbooks/index.js.map +1 -1
- package/dist/playbooks/skill-node-executor.d.ts +155 -0
- package/dist/playbooks/skill-node-executor.d.ts.map +1 -0
- package/dist/playbooks/skill-node-executor.js +156 -0
- package/dist/playbooks/skill-node-executor.js.map +1 -0
- package/dist/repair.d.ts +3 -7
- package/dist/repair.d.ts.map +1 -1
- package/dist/repair.js +5 -43
- package/dist/repair.js.map +1 -1
- package/dist/sagas/migrate-containment.js +7 -7
- package/dist/sagas/migrate-containment.js.map +1 -1
- package/dist/scaffold/ensure-dirs.d.ts +8 -2
- package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
- package/dist/scaffold/ensure-dirs.js +24 -11
- package/dist/scaffold/ensure-dirs.js.map +1 -1
- package/dist/scaffold/project-detection.d.ts +5 -1
- package/dist/scaffold/project-detection.d.ts.map +1 -1
- package/dist/scaffold/project-detection.js +9 -5
- package/dist/scaffold/project-detection.js.map +1 -1
- package/dist/sentient/hygiene-scan.js +6 -6
- package/dist/sentient/hygiene-scan.js.map +1 -1
- package/dist/sentient/proposal-dedup.js +2 -2
- package/dist/sentient/proposal-rate-limiter.js +1 -1
- package/dist/sentient/propose-tick.js +5 -5
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sentient/stage-drift-tick.js +3 -3
- package/dist/sentient/stage-drift-tick.js.map +1 -1
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +6 -2
- package/dist/sequence/index.js.map +1 -1
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +18 -4
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/setup/sections/verification.js +2 -2
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/shutdown.d.ts +91 -0
- package/dist/shutdown.d.ts.map +1 -0
- package/dist/shutdown.js +120 -0
- package/dist/shutdown.js.map +1 -0
- package/dist/skills/index.d.ts +2 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/skill-executor-adapter.d.ts +136 -0
- package/dist/skills/skill-executor-adapter.d.ts.map +1 -0
- package/dist/skills/skill-executor-adapter.js +137 -0
- package/dist/skills/skill-executor-adapter.js.map +1 -0
- package/dist/skills/usage-recorder.d.ts.map +1 -1
- package/dist/skills/usage-recorder.js +30 -0
- package/dist/skills/usage-recorder.js.map +1 -1
- package/dist/skills-export.d.ts +23 -0
- package/dist/skills-export.d.ts.map +1 -0
- package/dist/skills-export.js +23 -0
- package/dist/skills-export.js.map +1 -0
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +8 -3
- package/dist/stats/index.js.map +1 -1
- package/dist/store/agent-doctor.d.ts +3 -3
- package/dist/store/agent-doctor.d.ts.map +1 -1
- package/dist/store/agent-doctor.js +18 -13
- package/dist/store/agent-doctor.js.map +1 -1
- package/dist/store/agent-install.d.ts +6 -5
- package/dist/store/agent-install.d.ts.map +1 -1
- package/dist/store/agent-install.js +20 -16
- package/dist/store/agent-install.js.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts +66 -28
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +248 -167
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/agent-registry-store.d.ts +242 -0
- package/dist/store/agent-registry-store.d.ts.map +1 -0
- package/dist/store/agent-registry-store.js +501 -0
- package/dist/store/agent-registry-store.js.map +1 -0
- package/dist/store/agent-resolver.d.ts +8 -8
- package/dist/store/agent-resolver.d.ts.map +1 -1
- package/dist/store/agent-resolver.js +19 -17
- package/dist/store/agent-resolver.js.map +1 -1
- package/dist/store/backup-pack.d.ts.map +1 -1
- package/dist/store/backup-pack.js +24 -8
- package/dist/store/backup-pack.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts +181 -74
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +307 -528
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/cross-db-cleanup.d.ts +5 -5
- package/dist/store/cross-db-cleanup.d.ts.map +1 -1
- package/dist/store/cross-db-cleanup.js +12 -10
- package/dist/store/cross-db-cleanup.js.map +1 -1
- package/dist/store/data-accessor.d.ts +4 -4
- package/dist/store/data-accessor.js +5 -5
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts +83 -1
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +257 -0
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/db-helpers.d.ts +8 -2
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +6 -2
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +46 -4
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +103 -9
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts +116 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js +274 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -0
- package/dist/store/exodus/index.d.ts +3 -1
- package/dist/store/exodus/index.d.ts.map +1 -1
- package/dist/store/exodus/index.js +3 -1
- package/dist/store/exodus/index.js.map +1 -1
- package/dist/store/exodus/migrate.d.ts +120 -1
- package/dist/store/exodus/migrate.d.ts.map +1 -1
- package/dist/store/exodus/migrate.js +923 -119
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts +189 -0
- package/dist/store/exodus/on-open.d.ts.map +1 -0
- package/dist/store/exodus/on-open.js +464 -0
- package/dist/store/exodus/on-open.js.map +1 -0
- package/dist/store/exodus/table-name-map.d.ts +173 -0
- package/dist/store/exodus/table-name-map.d.ts.map +1 -0
- package/dist/store/exodus/table-name-map.js +660 -0
- package/dist/store/exodus/table-name-map.js.map +1 -0
- package/dist/store/exodus/verify-migration.d.ts +72 -0
- package/dist/store/exodus/verify-migration.d.ts.map +1 -0
- package/dist/store/exodus/verify-migration.js +678 -0
- package/dist/store/exodus/verify-migration.js.map +1 -0
- package/dist/store/exodus/verify.d.ts +32 -8
- package/dist/store/exodus/verify.d.ts.map +1 -1
- package/dist/store/exodus/verify.js +48 -142
- package/dist/store/exodus/verify.js.map +1 -1
- package/dist/store/index.d.ts +2 -3
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +2 -3
- package/dist/store/index.js.map +1 -1
- package/dist/store/memory-accessor.d.ts +31 -0
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +38 -0
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts +86 -13
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +326 -528
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.d.ts +1 -1
- package/dist/store/migrate-signaldock-to-conduit.d.ts.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.js +126 -35
- package/dist/store/migrate-signaldock-to-conduit.js.map +1 -1
- package/dist/store/migration-manager.d.ts +49 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +167 -67
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-sqlite.d.ts +1 -1
- package/dist/store/migration-sqlite.d.ts.map +1 -1
- package/dist/store/migration-sqlite.js +32 -3
- package/dist/store/migration-sqlite.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts +152 -29
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +496 -177
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/nexus-validation-schemas.d.ts +32 -32
- package/dist/store/open-cleo-db.d.ts +37 -40
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +76 -153
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/role-accessors-impl.d.ts +4 -4
- package/dist/store/role-accessors-impl.d.ts.map +1 -1
- package/dist/store/role-accessors-impl.js +18 -15
- package/dist/store/role-accessors-impl.js.map +1 -1
- package/dist/store/schema/{signaldock-schema.d.ts → agent-registry-schema.d.ts} +15 -5
- package/dist/store/schema/agent-registry-schema.d.ts.map +1 -0
- package/dist/store/schema/{signaldock-schema.js → agent-registry-schema.js} +15 -5
- package/dist/store/schema/agent-registry-schema.js.map +1 -0
- package/dist/store/schema/agent-schema.d.ts +1 -1
- package/dist/store/schema/agent-schema.js +4 -4
- package/dist/store/schema/agent-schema.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +1 -1
- package/dist/store/schema/audit.d.ts +15 -5
- package/dist/store/schema/audit.d.ts.map +1 -1
- package/dist/store/schema/audit.js +12 -2
- package/dist/store/schema/audit.js.map +1 -1
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/{signaldock.d.ts → agent-registry.d.ts} +277 -271
- package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/{signaldock.js → agent-registry.js} +136 -125
- package/dist/store/schema/cleo-global/agent-registry.js.map +1 -0
- package/dist/store/schema/cleo-global/index.d.ts +29 -22
- package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/index.js +29 -22
- package/dist/store/schema/cleo-global/index.js.map +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +36 -1034
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +32 -337
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +16 -0
- package/dist/store/schema/cleo-global/skills.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/skills.js +11 -0
- package/dist/store/schema/cleo-global/skills.js.map +1 -1
- package/dist/store/schema/{cleo-project → cleo-global}/telemetry.d.ts +33 -17
- package/dist/store/schema/cleo-global/telemetry.d.ts.map +1 -0
- package/dist/store/schema/{cleo-project → cleo-global}/telemetry.js +30 -18
- package/dist/store/schema/cleo-global/telemetry.js.map +1 -0
- package/dist/store/schema/cleo-project/audit.d.ts +8 -8
- package/dist/store/schema/cleo-project/audit.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/audit.js +2 -6
- package/dist/store/schema/cleo-project/audit.js.map +1 -1
- package/dist/store/schema/cleo-project/docs.d.ts +1 -1
- package/dist/store/schema/cleo-project/index.d.ts +29 -12
- package/dist/store/schema/cleo-project/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/index.js +29 -12
- package/dist/store/schema/cleo-project/index.js.map +1 -1
- package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
- package/dist/store/schema/cleo-project/nexus-graph.d.ts +1067 -0
- package/dist/store/schema/cleo-project/nexus-graph.d.ts.map +1 -0
- package/dist/store/schema/cleo-project/nexus-graph.js +407 -0
- package/dist/store/schema/cleo-project/nexus-graph.js.map +1 -0
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts +385 -0
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -0
- package/dist/store/schema/cleo-project/provenance-orphans.js +142 -0
- package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -0
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-project/runtime.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +3 -3
- package/dist/store/schema/cleo-shared/brain.d.ts +711 -494
- package/dist/store/schema/cleo-shared/brain.d.ts.map +1 -1
- package/dist/store/schema/cleo-shared/brain.js +215 -134
- package/dist/store/schema/cleo-shared/brain.js.map +1 -1
- package/dist/store/schema/conduit-schema.d.ts +63 -51
- package/dist/store/schema/conduit-schema.d.ts.map +1 -1
- package/dist/store/schema/conduit-schema.js +23 -11
- package/dist/store/schema/conduit-schema.js.map +1 -1
- package/dist/store/schema/goal.d.ts +3 -2
- package/dist/store/schema/goal.d.ts.map +1 -1
- package/dist/store/schema/goal.js +3 -2
- package/dist/store/schema/goal.js.map +1 -1
- package/dist/store/schema/index.d.ts +1 -0
- package/dist/store/schema/index.d.ts.map +1 -1
- package/dist/store/schema/index.js +1 -0
- package/dist/store/schema/index.js.map +1 -1
- package/dist/store/schema/lifecycle.d.ts +2 -2
- package/dist/store/schema/memory-schema.d.ts +2 -2
- package/dist/store/schema/nexus-schema.d.ts +174 -115
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +175 -55
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/schema-utils.d.ts +78 -0
- package/dist/store/schema/schema-utils.d.ts.map +1 -0
- package/dist/store/schema/schema-utils.js +49 -0
- package/dist/store/schema/schema-utils.js.map +1 -0
- package/dist/store/schema/skills-schema.d.ts +81 -44
- package/dist/store/schema/skills-schema.d.ts.map +1 -1
- package/dist/store/schema/skills-schema.js +49 -16
- package/dist/store/schema/skills-schema.js.map +1 -1
- package/dist/store/schema/tasks.d.ts +3 -3
- package/dist/store/skills-db.d.ts +90 -50
- package/dist/store/skills-db.d.ts.map +1 -1
- package/dist/store/skills-db.js +132 -146
- package/dist/store/skills-db.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +2 -2
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +11 -10
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +25 -18
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +72 -12
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +153 -89
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/tasks-schema.d.ts +4 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +60 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +2 -2
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +10 -5
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/umbrella-data-accessor.d.ts +17 -6
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +8 -8
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +241 -208
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +11 -6
- package/dist/system/health.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +58 -12
- package/dist/system/project-health.js.map +1 -1
- package/dist/tasks/add.d.ts +8 -0
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +101 -0
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/cancelled-child-waiver-audit.d.ts +47 -0
- package/dist/tasks/cancelled-child-waiver-audit.d.ts.map +1 -0
- package/dist/tasks/cancelled-child-waiver-audit.js +34 -0
- package/dist/tasks/cancelled-child-waiver-audit.js.map +1 -0
- package/dist/tasks/complete.d.ts +22 -2
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +71 -6
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/compute-task-view.js +1 -1
- package/dist/tasks/session-scope.d.ts +5 -0
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +4 -0
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tools/guard.d.ts +71 -1
- package/dist/tools/guard.d.ts.map +1 -1
- package/dist/tools/guard.js +73 -1
- package/dist/tools/guard.js.map +1 -1
- package/dist/tools/index.d.ts +21 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +25 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +22 -13
- package/dist/upgrade.js.map +1 -1
- package/dist/workgraph/containment.js +18 -18
- package/dist/workgraph/relations.js +2 -2
- package/dist/worktree/list.d.ts +1 -1
- package/dist/worktree/list.d.ts.map +1 -1
- package/dist/worktree/list.js +19 -21
- package/dist/worktree/list.js.map +1 -1
- package/dist/worktree-export.d.ts +18 -0
- package/dist/worktree-export.d.ts.map +1 -0
- package/dist/worktree-export.js +18 -0
- package/dist/worktree-export.js.map +1 -0
- package/migrations/drizzle-agent-registry/20260412000000_initial-global-agent-registry/migration.sql +29 -0
- package/migrations/drizzle-brain/20260601000001_t11522-brain-task-observations/migration.sql +28 -0
- package/migrations/drizzle-brain/20260601000002_t11522-inline-only-brain-tables/migration.sql +75 -0
- package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/migration.sql +49 -144
- package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/snapshot.json +8 -8
- package/migrations/drizzle-cleo-global/20260531000002_t11546-brain-usage-log/migration.sql +16 -0
- package/migrations/drizzle-cleo-global/20260601000001_t11544-skills-usage-project-id/migration.sql +12 -0
- package/migrations/drizzle-cleo-global/20260602000001_t11622-agent-registry-rename/migration.sql +80 -0
- package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/migration.sql +26 -167
- package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/snapshot.json +8 -8
- package/migrations/drizzle-cleo-project/20260531000002_t11546-brain-usage-log/migration.sql +21 -0
- package/migrations/drizzle-cleo-project/20260601000001_t11549-agent-credentials-brain-release-links/migration.sql +49 -0
- package/migrations/drizzle-cleo-project/20260601000002_t11538-project-nexus-graph/migration.sql +140 -0
- package/migrations/drizzle-cleo-project/20260602000002_t11649-token-usage-transport-mcp/migration.sql +146 -0
- package/migrations/drizzle-conduit/20260601000003_t11523-conduit-inline-schema/migration.sql +82 -0
- package/migrations/drizzle-nexus/20260421200001_t1165-baseline-reset/migration.sql +26 -8
- package/migrations/drizzle-nexus/20260601000001_t11545-nexus-relation-weights-partition/migration.sql +97 -0
- package/package.json +45 -13
- package/scripts/install-supervisor-binary.mjs +50 -201
- package/scripts/napi-binary-picker.mjs +267 -0
- package/dist/agents/agent-registry.d.ts.map +0 -1
- package/dist/agents/agent-registry.js.map +0 -1
- package/dist/store/data-safety.d.ts +0 -92
- package/dist/store/data-safety.d.ts.map +0 -1
- package/dist/store/data-safety.js +0 -274
- package/dist/store/data-safety.js.map +0 -1
- package/dist/store/schema/cleo-global/signaldock.d.ts.map +0 -1
- package/dist/store/schema/cleo-global/signaldock.js.map +0 -1
- package/dist/store/schema/cleo-project/telemetry.d.ts.map +0 -1
- package/dist/store/schema/cleo-project/telemetry.js.map +0 -1
- package/dist/store/schema/signaldock-schema.d.ts.map +0 -1
- package/dist/store/schema/signaldock-schema.js.map +0 -1
- package/dist/store/signaldock-sqlite.d.ts +0 -173
- package/dist/store/signaldock-sqlite.d.ts.map +0 -1
- package/dist/store/signaldock-sqlite.js +0 -445
- package/dist/store/signaldock-sqlite.js.map +0 -1
- package/migrations/drizzle-nexus/20260318205558_initial/migration.sql +0 -46
- package/migrations/drizzle-nexus/20260412000001_t529-nexus-graph-tables/migration.sql +0 -49
- package/migrations/drizzle-nexus/20260415000001_t622-project-registry-paths/migration.sql +0 -12
- package/migrations/drizzle-nexus/20260419000001_t998-nexus-plasticity/migration.sql +0 -13
- package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/migration.sql +0 -16
- package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/snapshot.json +0 -1531
- package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/migration.sql +0 -13
- package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/snapshot.json +0 -1652
- package/migrations/drizzle-nexus/20260504000001_t1839-fts5-nexus-symbols/migration.sql +0 -68
- package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/migration.sql +0 -20
- package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/snapshot.json +0 -1652
- package/migrations/drizzle-nexus/20260526222449_t11025-project-id-aliases/migration.sql +0 -16
- package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/migration.sql +0 -209
- package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/snapshot.json +0 -2060
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-user skills
|
|
2
|
+
* Per-user skills registry lifecycle module — opener, helpers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* and `brain.db` under `getCleoHome()` (e.g. `~/.local/share/cleo/skills.db`).
|
|
6
|
-
* It stores the per-user skills registry described in
|
|
4
|
+
* The per-user skills registry is a global-tier domain described in
|
|
7
5
|
* `docs/architecture/SG-CLEO-SKILLS-architecture-v3.md` §4.
|
|
8
6
|
*
|
|
9
|
-
* ##
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
7
|
+
* ## E6-L5 — thin-facade migration (T11525)
|
|
8
|
+
*
|
|
9
|
+
* `openSkillsDb()` is now a thin facade that delegates the database open to
|
|
10
|
+
* {@link openDualScopeDb}('global') — the canonical dual-scope chokepoint
|
|
11
|
+
* (E3/E4 · T11512/T11517) already adopted by the tasks (E6-L1), brain (E6-L2),
|
|
12
|
+
* conduit (E6-L3), and nexus (E6-L4) domains. The skills registry tables now
|
|
13
|
+
* live inside the consolidated GLOBAL `cleo.db` under `getCleoHome()`, sharing
|
|
14
|
+
* the SAME native handle the nexus / signaldock global domains use — NOT a
|
|
15
|
+
* separate `skills.db` file.
|
|
16
|
+
*
|
|
17
|
+
* ## Why prefixed `skills_*` tables (no establishLegacy rebuild)
|
|
18
|
+
*
|
|
19
|
+
* Unlike nexus (E6-L4), the skills registry does NOT run its legacy
|
|
20
|
+
* `drizzle-skills` migration on the shared handle. That migration created BARE
|
|
21
|
+
* `skills` / `skill_usage` / … tables — and the bare `skills` name COLLIDES with
|
|
22
|
+
* the signaldock domain's own legacy `skills` slug-catalog now that both share
|
|
23
|
+
* one `cleo.db`. The consolidated `drizzle-cleo-global` migration already creates
|
|
24
|
+
* the registry tables under the domain-prefixed names (`skills_skills`,
|
|
25
|
+
* `skills_skill_usage`, …), column-identical to the legacy shape plus additive
|
|
26
|
+
* enum/timestamp/boolean CHECK constraints that ACCEPT every value the runtime
|
|
27
|
+
* writers produce (ISO-8601 text, 0/1 booleans — verified). So skills-db simply
|
|
28
|
+
* binds the (now prefix-renamed) `skillsSchema` drizzle queries to those
|
|
29
|
+
* already-created consolidated tables. No drop+rebuild is needed because there is
|
|
30
|
+
* no consolidated-vs-legacy shape incompatibility (the L4 precondition is absent).
|
|
31
|
+
*
|
|
32
|
+
* The residency MOVE of skills global→project and the exodus data copy from the
|
|
33
|
+
* legacy standalone `skills.db` are SEPARATE later tasks (T11553 / T11538).
|
|
27
34
|
*
|
|
28
35
|
* @task T9651
|
|
36
|
+
* @task T11525 - E6-L5: route openSkillsDb through openDualScopeDb('global') (SG-DB-SUBSTRATE-V2)
|
|
29
37
|
* @epic T9571
|
|
38
|
+
* @epic T11249
|
|
30
39
|
* @saga T9560
|
|
31
40
|
* @adr ADR-068, ADR-069
|
|
32
41
|
* @architecture docs/architecture/SG-CLEO-SKILLS-architecture-v3.md §4
|
|
@@ -35,46 +44,58 @@ import type { DatabaseSync } from 'node:sqlite';
|
|
|
35
44
|
import type { NodeSQLiteDatabase } from 'drizzle-orm/node-sqlite';
|
|
36
45
|
import * as skillsSchema from './schema/skills-schema.js';
|
|
37
46
|
import { type NewSkillRow, type SkillRow, type SkillSourceType } from './schema/skills-schema.js';
|
|
38
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Legacy standalone skills.db file name within `getCleoHome()`.
|
|
49
|
+
*
|
|
50
|
+
* E6-L5 (T11525): the live skills registry now consolidates into the shared
|
|
51
|
+
* GLOBAL `cleo.db`; this literal is retained only for the backup/exodus paths
|
|
52
|
+
* that still read the pre-cutover standalone file.
|
|
53
|
+
*/
|
|
39
54
|
export declare const SKILLS_DB_FILENAME = "skills.db";
|
|
40
|
-
/** Schema version
|
|
55
|
+
/** Schema version constant. Retained for compatibility with external re-exporters. */
|
|
41
56
|
export declare const SKILLS_SCHEMA_VERSION = "2026.5.81";
|
|
42
57
|
/**
|
|
43
|
-
* Resolve the canonical filesystem path for
|
|
58
|
+
* Resolve the canonical filesystem path for the skills registry DB.
|
|
44
59
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
60
|
+
* E6-L5 (T11525): resolves `getCleoHome()` + `cleo.db` — the consolidated GLOBAL
|
|
61
|
+
* `cleo.db` that now hosts the `skills_*` registry tables (the same path
|
|
62
|
+
* {@link openDualScopeDb}('global') opens). Always returns a path under
|
|
63
|
+
* `getCleoHome()`. Throws if the resolved path somehow escapes that prefix — that
|
|
64
|
+
* would indicate a regression in `getCleoHome()` itself and MUST be fixed at the
|
|
65
|
+
* source, not silently tolerated.
|
|
49
66
|
*
|
|
50
|
-
* @returns Absolute path to `
|
|
67
|
+
* @returns Absolute path to the consolidated `cleo.db`.
|
|
51
68
|
* @throws {Error} If the resolved path is not under `getCleoHome()`.
|
|
52
69
|
*/
|
|
53
70
|
export declare function getDefaultSkillsDbPath(): string;
|
|
54
|
-
/**
|
|
55
|
-
* Resolve the absolute path to the `drizzle-skills` migrations folder.
|
|
56
|
-
*
|
|
57
|
-
* Delegates to {@link resolveCorePackageMigrationsFolder} which handles the
|
|
58
|
-
* three install layouts (workspace dev, bundled dist, global install) via
|
|
59
|
-
* `import.meta.resolve()` with a `createRequire().resolve()` fallback.
|
|
60
|
-
*/
|
|
61
|
-
export declare function resolveSkillsMigrationsFolder(): string;
|
|
62
71
|
/**
|
|
63
72
|
* Options for {@link openSkillsDb}.
|
|
64
73
|
*/
|
|
65
74
|
export interface OpenSkillsDbOptions {
|
|
66
75
|
/**
|
|
67
76
|
* Override the on-disk path. Used by tests; production callers should
|
|
68
|
-
* leave this `undefined` to let the module resolve
|
|
77
|
+
* leave this `undefined` to let the module resolve {@link getDefaultSkillsDbPath}.
|
|
78
|
+
*
|
|
79
|
+
* E6-L5 (T11525): the override path is opened as a consolidated GLOBAL
|
|
80
|
+
* `cleo.db` (the prefixed `skills_*` tables are created by the consolidated
|
|
81
|
+
* migration) via {@link openDualScopeDbAtPath}, so a test passing
|
|
82
|
+
* `<tmpdir>/skills.db` materialises an isolated consolidated DB at that exact
|
|
83
|
+
* path — distinct cache key from the canonical `cleo.db`.
|
|
69
84
|
*/
|
|
70
85
|
path?: string;
|
|
71
86
|
}
|
|
72
87
|
/**
|
|
73
|
-
* Open (or first-time materialise)
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
88
|
+
* Open (or first-time materialise) the skills registry and return the Drizzle
|
|
89
|
+
* handle bound to the prefixed `skills_*` tables.
|
|
90
|
+
*
|
|
91
|
+
* E6-L5 (T11525): delegates the physical open to {@link openDualScopeDb}('global')
|
|
92
|
+
* (or {@link openDualScopeDbAtPath} for the test `{ path }` override) — the
|
|
93
|
+
* canonical dual-scope chokepoint — and re-wraps its native handle with the
|
|
94
|
+
* prefix-renamed `skillsSchema` drizzle instance. The consolidated
|
|
95
|
+
* `drizzle-cleo-global` migration creates the `skills_*` tables; this module does
|
|
96
|
+
* NOT run the legacy `drizzle-skills` migration (which would create the
|
|
97
|
+
* signaldock-colliding bare `skills` table). Idempotent: repeated calls with the
|
|
98
|
+
* same effective path return the cached singleton.
|
|
78
99
|
*
|
|
79
100
|
* @example
|
|
80
101
|
* ```typescript
|
|
@@ -85,21 +106,40 @@ export interface OpenSkillsDbOptions {
|
|
|
85
106
|
* ```
|
|
86
107
|
*
|
|
87
108
|
* @param options - Override the default path (test-only).
|
|
88
|
-
* @returns A Drizzle ORM handle bound to the four
|
|
109
|
+
* @returns A Drizzle ORM handle bound to the four `skills_*` registry tables.
|
|
89
110
|
*
|
|
90
111
|
* @task T9651
|
|
112
|
+
* @task T11525
|
|
91
113
|
*/
|
|
92
114
|
export declare function openSkillsDb(options?: OpenSkillsDbOptions): Promise<NodeSQLiteDatabase<typeof skillsSchema>>;
|
|
93
115
|
/**
|
|
94
|
-
*
|
|
116
|
+
* Drop the skills-domain singleton references and trigger the coordinated close
|
|
117
|
+
* of the shared GLOBAL `cleo.db` handle via the dual-scope cache.
|
|
118
|
+
*
|
|
119
|
+
* ## E6-L5 (T11525) — shared-handle close rule
|
|
120
|
+
*
|
|
121
|
+
* `_skillsNativeDb` is the SHARED consolidated GLOBAL `cleo.db` handle owned by
|
|
122
|
+
* {@link openDualScopeDb}('global') and co-owned by the nexus / signaldock global
|
|
123
|
+
* domains. This function MUST NOT call `.close()` on it directly — doing so would
|
|
124
|
+
* tear the handle out from under those siblings (the exact bug class L4 fixed at
|
|
125
|
+
* `dual-scope-db.ts`). Instead it evicts the GLOBAL-scope entry from the
|
|
126
|
+
* dual-scope cache (a single coordinated close) and drops the local references.
|
|
95
127
|
*
|
|
96
|
-
* Safe to call multiple times. Used by `cleo backup restore
|
|
97
|
-
*
|
|
128
|
+
* Safe to call multiple times. Used by `cleo backup restore` and tests that
|
|
129
|
+
* mkdtemp a fresh location between cases.
|
|
130
|
+
*
|
|
131
|
+
* @task T9651
|
|
132
|
+
* @task T11525
|
|
98
133
|
*/
|
|
99
134
|
export declare function closeSkillsDb(): void;
|
|
100
135
|
/**
|
|
101
|
-
* Reset singleton state
|
|
102
|
-
*
|
|
136
|
+
* Reset singleton state — used between tests to force a re-open against a new
|
|
137
|
+
* tmpdir. E6-L5: identical to {@link closeSkillsDb} (both go through the
|
|
138
|
+
* scope-filtered dual-scope cache reset; neither closes the shared handle
|
|
139
|
+
* directly).
|
|
140
|
+
*
|
|
141
|
+
* @task T9651
|
|
142
|
+
* @task T11525
|
|
103
143
|
*/
|
|
104
144
|
export declare function resetSkillsDbState(): void;
|
|
105
145
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-db.d.ts","sourceRoot":"","sources":["../../src/store/skills-db.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skills-db.d.ts","sourceRoot":"","sources":["../../src/store/skills-db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAUlE,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,EAErB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAejD;;;;;;;;;;;;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O,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/store/skills-db.js
CHANGED
|
@@ -1,51 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-user skills
|
|
2
|
+
* Per-user skills registry lifecycle module — opener, helpers.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* and `brain.db` under `getCleoHome()` (e.g. `~/.local/share/cleo/skills.db`).
|
|
6
|
-
* It stores the per-user skills registry described in
|
|
4
|
+
* The per-user skills registry is a global-tier domain described in
|
|
7
5
|
* `docs/architecture/SG-CLEO-SKILLS-architecture-v3.md` §4.
|
|
8
6
|
*
|
|
9
|
-
* ##
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
7
|
+
* ## E6-L5 — thin-facade migration (T11525)
|
|
8
|
+
*
|
|
9
|
+
* `openSkillsDb()` is now a thin facade that delegates the database open to
|
|
10
|
+
* {@link openDualScopeDb}('global') — the canonical dual-scope chokepoint
|
|
11
|
+
* (E3/E4 · T11512/T11517) already adopted by the tasks (E6-L1), brain (E6-L2),
|
|
12
|
+
* conduit (E6-L3), and nexus (E6-L4) domains. The skills registry tables now
|
|
13
|
+
* live inside the consolidated GLOBAL `cleo.db` under `getCleoHome()`, sharing
|
|
14
|
+
* the SAME native handle the nexus / signaldock global domains use — NOT a
|
|
15
|
+
* separate `skills.db` file.
|
|
16
|
+
*
|
|
17
|
+
* ## Why prefixed `skills_*` tables (no establishLegacy rebuild)
|
|
18
|
+
*
|
|
19
|
+
* Unlike nexus (E6-L4), the skills registry does NOT run its legacy
|
|
20
|
+
* `drizzle-skills` migration on the shared handle. That migration created BARE
|
|
21
|
+
* `skills` / `skill_usage` / … tables — and the bare `skills` name COLLIDES with
|
|
22
|
+
* the signaldock domain's own legacy `skills` slug-catalog now that both share
|
|
23
|
+
* one `cleo.db`. The consolidated `drizzle-cleo-global` migration already creates
|
|
24
|
+
* the registry tables under the domain-prefixed names (`skills_skills`,
|
|
25
|
+
* `skills_skill_usage`, …), column-identical to the legacy shape plus additive
|
|
26
|
+
* enum/timestamp/boolean CHECK constraints that ACCEPT every value the runtime
|
|
27
|
+
* writers produce (ISO-8601 text, 0/1 booleans — verified). So skills-db simply
|
|
28
|
+
* binds the (now prefix-renamed) `skillsSchema` drizzle queries to those
|
|
29
|
+
* already-created consolidated tables. No drop+rebuild is needed because there is
|
|
30
|
+
* no consolidated-vs-legacy shape incompatibility (the L4 precondition is absent).
|
|
31
|
+
*
|
|
32
|
+
* The residency MOVE of skills global→project and the exodus data copy from the
|
|
33
|
+
* legacy standalone `skills.db` are SEPARATE later tasks (T11553 / T11538).
|
|
27
34
|
*
|
|
28
35
|
* @task T9651
|
|
36
|
+
* @task T11525 - E6-L5: route openSkillsDb through openDualScopeDb('global') (SG-DB-SUBSTRATE-V2)
|
|
29
37
|
* @epic T9571
|
|
38
|
+
* @epic T11249
|
|
30
39
|
* @saga T9560
|
|
31
40
|
* @adr ADR-068, ADR-069
|
|
32
41
|
* @architecture docs/architecture/SG-CLEO-SKILLS-architecture-v3.md §4
|
|
33
42
|
*/
|
|
34
|
-
import {
|
|
35
|
-
import { dirname, join } from 'node:path';
|
|
43
|
+
import { join } from 'node:path';
|
|
36
44
|
import { and, eq } from 'drizzle-orm';
|
|
37
|
-
import { readMigrationFiles } from 'drizzle-orm/migrator';
|
|
38
45
|
import { drizzle } from 'drizzle-orm/node-sqlite';
|
|
39
46
|
import { getCleoHome } from '../paths.js';
|
|
40
47
|
import { getCurrentWriteOrigin } from '../sentient/skill-provenance.js';
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
// E6-L5 (T11525): dual-scope chokepoint — the skills registry opens the
|
|
49
|
+
// consolidated GLOBAL `cleo.db` through here. openDualScopeDb manages the
|
|
50
|
+
// DatabaseSync lifecycle, pragmas, and consolidated migrations (which create the
|
|
51
|
+
// prefixed `skills_*` tables). We extract the native handle and re-wrap it with
|
|
52
|
+
// the prefix-renamed skills schema so existing callers compile unchanged.
|
|
53
|
+
import { _resetDualScopeDbCache, openDualScopeDb, openDualScopeDbAtPath } from './dual-scope-db.js';
|
|
43
54
|
import * as skillsSchema from './schema/skills-schema.js';
|
|
44
55
|
import { skills as skillsTable, } from './schema/skills-schema.js';
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Legacy standalone skills.db file name within `getCleoHome()`.
|
|
58
|
+
*
|
|
59
|
+
* E6-L5 (T11525): the live skills registry now consolidates into the shared
|
|
60
|
+
* GLOBAL `cleo.db`; this literal is retained only for the backup/exodus paths
|
|
61
|
+
* that still read the pre-cutover standalone file.
|
|
62
|
+
*/
|
|
47
63
|
export const SKILLS_DB_FILENAME = 'skills.db';
|
|
48
|
-
/** Schema version
|
|
64
|
+
/** Schema version constant. Retained for compatibility with external re-exporters. */
|
|
49
65
|
export const SKILLS_SCHEMA_VERSION = '2026.5.81';
|
|
50
66
|
// ---------------------------------------------------------------------------
|
|
51
67
|
// Singleton state — one open handle per process, reset across tests.
|
|
@@ -58,110 +74,46 @@ let _skillsInitPromise = null;
|
|
|
58
74
|
// Path resolution
|
|
59
75
|
// ---------------------------------------------------------------------------
|
|
60
76
|
/**
|
|
61
|
-
* Resolve the canonical filesystem path for
|
|
77
|
+
* Resolve the canonical filesystem path for the skills registry DB.
|
|
62
78
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
79
|
+
* E6-L5 (T11525): resolves `getCleoHome()` + `cleo.db` — the consolidated GLOBAL
|
|
80
|
+
* `cleo.db` that now hosts the `skills_*` registry tables (the same path
|
|
81
|
+
* {@link openDualScopeDb}('global') opens). Always returns a path under
|
|
82
|
+
* `getCleoHome()`. Throws if the resolved path somehow escapes that prefix — that
|
|
83
|
+
* would indicate a regression in `getCleoHome()` itself and MUST be fixed at the
|
|
84
|
+
* source, not silently tolerated.
|
|
67
85
|
*
|
|
68
|
-
* @returns Absolute path to `
|
|
86
|
+
* @returns Absolute path to the consolidated `cleo.db`.
|
|
69
87
|
* @throws {Error} If the resolved path is not under `getCleoHome()`.
|
|
70
88
|
*/
|
|
71
89
|
export function getDefaultSkillsDbPath() {
|
|
90
|
+
// Resolve via THIS module's getCleoHome binding so the path and the guard are
|
|
91
|
+
// self-consistent — see the same note on signaldock-sqlite.getGlobalAgentRegistryDbPath
|
|
92
|
+
// (T11525). resolveDualScopeDbPath('global') builds the identical path but binds
|
|
93
|
+
// getCleoHome through dual-scope-db's module graph, which can diverge under
|
|
94
|
+
// per-test vi.doMock timing.
|
|
72
95
|
const cleoHome = getCleoHome();
|
|
73
|
-
const dbPath = join(cleoHome,
|
|
96
|
+
const dbPath = join(cleoHome, 'cleo.db');
|
|
74
97
|
if (!dbPath.startsWith(cleoHome)) {
|
|
98
|
+
/* c8 ignore next 6 — unreachable: dbPath is built FROM cleoHome above. */
|
|
75
99
|
throw new Error(`BUG: getDefaultSkillsDbPath() resolved to "${dbPath}" which is NOT under ` +
|
|
76
|
-
`getCleoHome() ("${cleoHome}"). skills
|
|
100
|
+
`getCleoHome() ("${cleoHome}"). The skills registry is global-only per ` +
|
|
77
101
|
`SG-CLEO-SKILLS-architecture-v3.md §4. Fix the caller, do not suppress.`);
|
|
78
102
|
}
|
|
79
103
|
return dbPath;
|
|
80
104
|
}
|
|
81
105
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// ---------------------------------------------------------------------------
|
|
94
|
-
/**
|
|
95
|
-
* Apply the drizzle journal + pending migrations to the open `skills.db`.
|
|
96
|
-
*
|
|
97
|
-
* Uses the same retry-on-BUSY loop as `nexus-sqlite.ts` so concurrent CLI
|
|
98
|
-
* invocations don't trip over each other during first-install bootstrap.
|
|
99
|
-
*
|
|
100
|
-
* @task T9651
|
|
101
|
-
*/
|
|
102
|
-
function runSkillsMigrations(nativeDb, db) {
|
|
103
|
-
const migrationsFolder = resolveSkillsMigrationsFolder();
|
|
104
|
-
// Bootstrap: if the table exists from a prior bare-SQL apply but the
|
|
105
|
-
// drizzle journal hasn't been seeded, mark the initial migration as
|
|
106
|
-
// already applied. This mirrors the nexus-sqlite Scenario-1 bootstrap.
|
|
107
|
-
if (tableExists(nativeDb, 'skills') && !tableExists(nativeDb, '__drizzle_migrations')) {
|
|
108
|
-
const migrations = readMigrationFiles({ migrationsFolder });
|
|
109
|
-
const baseline = migrations[0];
|
|
110
|
-
if (baseline) {
|
|
111
|
-
nativeDb
|
|
112
|
-
.prepare(`CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id INTEGER PRIMARY KEY AUTOINCREMENT, hash text NOT NULL, created_at numeric)`)
|
|
113
|
-
.run();
|
|
114
|
-
nativeDb
|
|
115
|
-
.prepare(`INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES ('${baseline.hash}', ${baseline.folderMillis})`)
|
|
116
|
-
.run();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
// Reconcile any partial / out-of-band migrations before the regular run.
|
|
120
|
-
reconcileJournal(nativeDb, migrationsFolder, 'skills', 'skills');
|
|
121
|
-
const MAX_RETRIES = 5;
|
|
122
|
-
const BASE_DELAY_MS = 100;
|
|
123
|
-
const MAX_DELAY_MS = 2000;
|
|
124
|
-
let lastError;
|
|
125
|
-
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
126
|
-
try {
|
|
127
|
-
migrateWithRetry(db, migrationsFolder, nativeDb, 'skills', 'skills');
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
catch (err) {
|
|
131
|
-
if (!isSqliteBusy(err) || attempt === MAX_RETRIES)
|
|
132
|
-
throw err;
|
|
133
|
-
lastError = err;
|
|
134
|
-
const delay = Math.min(BASE_DELAY_MS * 2 ** (attempt - 1) * (1 + Math.random() * 0.5), MAX_DELAY_MS);
|
|
135
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, Math.round(delay));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/* c8 ignore next */
|
|
139
|
-
throw lastError;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Stamp the `_skills_meta.schema_version` sentinel so the next process can
|
|
143
|
-
* take a fast-path through `ensureSkillsDb`.
|
|
144
|
-
*/
|
|
145
|
-
function writeSkillsSchemaVersionSentinel(nativeDb) {
|
|
146
|
-
try {
|
|
147
|
-
nativeDb.exec(`CREATE TABLE IF NOT EXISTS _skills_meta (
|
|
148
|
-
key TEXT PRIMARY KEY,
|
|
149
|
-
value TEXT NOT NULL,
|
|
150
|
-
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
|
|
151
|
-
);
|
|
152
|
-
INSERT OR REPLACE INTO _skills_meta (key, value, updated_at)
|
|
153
|
-
VALUES ('schema_version', '${SKILLS_SCHEMA_VERSION}', strftime('%s', 'now'));`);
|
|
154
|
-
}
|
|
155
|
-
catch {
|
|
156
|
-
// Non-fatal — the next open will simply take the fall-through path.
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Open (or first-time materialise) `skills.db` and return the Drizzle handle.
|
|
161
|
-
*
|
|
162
|
-
* Idempotent: repeated calls with the same effective path return the cached
|
|
163
|
-
* singleton. Concurrent callers share a single in-flight init promise so
|
|
164
|
-
* migrations never race.
|
|
106
|
+
* Open (or first-time materialise) the skills registry and return the Drizzle
|
|
107
|
+
* handle bound to the prefixed `skills_*` tables.
|
|
108
|
+
*
|
|
109
|
+
* E6-L5 (T11525): delegates the physical open to {@link openDualScopeDb}('global')
|
|
110
|
+
* (or {@link openDualScopeDbAtPath} for the test `{ path }` override) — the
|
|
111
|
+
* canonical dual-scope chokepoint — and re-wraps its native handle with the
|
|
112
|
+
* prefix-renamed `skillsSchema` drizzle instance. The consolidated
|
|
113
|
+
* `drizzle-cleo-global` migration creates the `skills_*` tables; this module does
|
|
114
|
+
* NOT run the legacy `drizzle-skills` migration (which would create the
|
|
115
|
+
* signaldock-colliding bare `skills` table). Idempotent: repeated calls with the
|
|
116
|
+
* same effective path return the cached singleton.
|
|
165
117
|
*
|
|
166
118
|
* @example
|
|
167
119
|
* ```typescript
|
|
@@ -172,9 +124,10 @@ function writeSkillsSchemaVersionSentinel(nativeDb) {
|
|
|
172
124
|
* ```
|
|
173
125
|
*
|
|
174
126
|
* @param options - Override the default path (test-only).
|
|
175
|
-
* @returns A Drizzle ORM handle bound to the four
|
|
127
|
+
* @returns A Drizzle ORM handle bound to the four `skills_*` registry tables.
|
|
176
128
|
*
|
|
177
129
|
* @task T9651
|
|
130
|
+
* @task T11525
|
|
178
131
|
*/
|
|
179
132
|
export async function openSkillsDb(options) {
|
|
180
133
|
// Fast-path: if no explicit override was requested AND a singleton already
|
|
@@ -182,7 +135,7 @@ export async function openSkillsDb(options) {
|
|
|
182
135
|
// is important for tests that open the DB at a tmpdir via `{path:...}` and
|
|
183
136
|
// then exercise helpers that call `openSkillsDb()` with no args; without
|
|
184
137
|
// this guard the helper call would swap the singleton over to the real
|
|
185
|
-
//
|
|
138
|
+
// consolidated cleo.db path and leak writes outside the test sandbox.
|
|
186
139
|
if (_skillsDb && !options?.path)
|
|
187
140
|
return _skillsDb;
|
|
188
141
|
const requestedPath = options?.path ?? getDefaultSkillsDbPath();
|
|
@@ -190,21 +143,39 @@ export async function openSkillsDb(options) {
|
|
|
190
143
|
if (_skillsDb && _skillsDbPath !== requestedPath) {
|
|
191
144
|
resetSkillsDbState();
|
|
192
145
|
}
|
|
146
|
+
// Liveness guard (T11525): the skills registry SHARES the consolidated GLOBAL
|
|
147
|
+
// `cleo.db` handle with the nexus / signaldock domains. A sibling may have
|
|
148
|
+
// closed + re-opened the shared handle while our singleton still references the
|
|
149
|
+
// now-closed one. Detect a stale (closed) handle and drop the singleton so we
|
|
150
|
+
// re-derive from the live dual-scope cache below.
|
|
151
|
+
if (_skillsDb && (_skillsNativeDb === null || !_skillsNativeDb.isOpen)) {
|
|
152
|
+
resetSkillsDbState();
|
|
153
|
+
}
|
|
193
154
|
if (_skillsDb)
|
|
194
155
|
return _skillsDb;
|
|
195
156
|
if (_skillsInitPromise)
|
|
196
157
|
return _skillsInitPromise;
|
|
197
158
|
_skillsInitPromise = (async () => {
|
|
198
159
|
_skillsDbPath = requestedPath;
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
160
|
+
// ── Dual-scope chokepoint delegation (T11525 · E6-L5) ───────────────────
|
|
161
|
+
// openDualScopeDb('global') applies the pragma SSoT, creates the directory,
|
|
162
|
+
// runs the consolidated cleo-global migrations (which create the prefixed
|
|
163
|
+
// `skills_*` tables), and manages the singleton cache. The `{ path }` test
|
|
164
|
+
// override routes through the path-aware sibling against an isolated file.
|
|
165
|
+
const dualHandle = options?.path
|
|
166
|
+
? await openDualScopeDbAtPath('global', options.path)
|
|
167
|
+
: await openDualScopeDb('global');
|
|
168
|
+
// Extract the underlying DatabaseSync. Drizzle exposes it via `$client`.
|
|
169
|
+
const nativeDb = dualHandle.db.$client ?? null;
|
|
170
|
+
if (!nativeDb) {
|
|
171
|
+
throw new Error('E6-L5: openDualScopeDb returned a handle without $client — ' +
|
|
172
|
+
'cannot extract DatabaseSync for the skills-schema wrapping.');
|
|
202
173
|
}
|
|
203
|
-
const nativeDb = openNativeDatabase(requestedPath);
|
|
204
174
|
_skillsNativeDb = nativeDb;
|
|
175
|
+
// Wrap the native handle with the prefix-renamed skills schema so existing
|
|
176
|
+
// callers (skillsSchema.* queries) bind to the consolidated `skills_*`
|
|
177
|
+
// tables the dual-scope migration already created.
|
|
205
178
|
const db = drizzle({ client: nativeDb, schema: skillsSchema });
|
|
206
|
-
runSkillsMigrations(nativeDb, db);
|
|
207
|
-
writeSkillsSchemaVersionSentinel(nativeDb);
|
|
208
179
|
_skillsDb = db;
|
|
209
180
|
return db;
|
|
210
181
|
})();
|
|
@@ -216,33 +187,48 @@ export async function openSkillsDb(options) {
|
|
|
216
187
|
}
|
|
217
188
|
}
|
|
218
189
|
/**
|
|
219
|
-
*
|
|
190
|
+
* Drop the skills-domain singleton references and trigger the coordinated close
|
|
191
|
+
* of the shared GLOBAL `cleo.db` handle via the dual-scope cache.
|
|
192
|
+
*
|
|
193
|
+
* ## E6-L5 (T11525) — shared-handle close rule
|
|
220
194
|
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
195
|
+
* `_skillsNativeDb` is the SHARED consolidated GLOBAL `cleo.db` handle owned by
|
|
196
|
+
* {@link openDualScopeDb}('global') and co-owned by the nexus / signaldock global
|
|
197
|
+
* domains. This function MUST NOT call `.close()` on it directly — doing so would
|
|
198
|
+
* tear the handle out from under those siblings (the exact bug class L4 fixed at
|
|
199
|
+
* `dual-scope-db.ts`). Instead it evicts the GLOBAL-scope entry from the
|
|
200
|
+
* dual-scope cache (a single coordinated close) and drops the local references.
|
|
201
|
+
*
|
|
202
|
+
* Safe to call multiple times. Used by `cleo backup restore` and tests that
|
|
203
|
+
* mkdtemp a fresh location between cases.
|
|
204
|
+
*
|
|
205
|
+
* @task T9651
|
|
206
|
+
* @task T11525
|
|
223
207
|
*/
|
|
224
208
|
export function closeSkillsDb() {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
_skillsNativeDb.close();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
catch {
|
|
232
|
-
// Ignore — the singleton is about to be reset.
|
|
233
|
-
}
|
|
234
|
-
_skillsNativeDb = null;
|
|
235
|
-
}
|
|
209
|
+
// Drop only the local references. The scope-filtered cache reset performs the
|
|
210
|
+
// single coordinated close of the shared GLOBAL handle.
|
|
211
|
+
_skillsNativeDb = null;
|
|
236
212
|
_skillsDb = null;
|
|
237
213
|
_skillsDbPath = null;
|
|
214
|
+
_skillsInitPromise = null;
|
|
215
|
+
_resetDualScopeDbCache('global');
|
|
238
216
|
}
|
|
239
217
|
/**
|
|
240
|
-
* Reset singleton state
|
|
241
|
-
*
|
|
218
|
+
* Reset singleton state — used between tests to force a re-open against a new
|
|
219
|
+
* tmpdir. E6-L5: identical to {@link closeSkillsDb} (both go through the
|
|
220
|
+
* scope-filtered dual-scope cache reset; neither closes the shared handle
|
|
221
|
+
* directly).
|
|
222
|
+
*
|
|
223
|
+
* @task T9651
|
|
224
|
+
* @task T11525
|
|
242
225
|
*/
|
|
243
226
|
export function resetSkillsDbState() {
|
|
244
|
-
|
|
227
|
+
_skillsNativeDb = null;
|
|
228
|
+
_skillsDb = null;
|
|
229
|
+
_skillsDbPath = null;
|
|
245
230
|
_skillsInitPromise = null;
|
|
231
|
+
_resetDualScopeDbCache('global');
|
|
246
232
|
}
|
|
247
233
|
/**
|
|
248
234
|
* Return the raw `node:sqlite` handle for the open skills.db (or null if
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-db.js","sourceRoot":"","sources":["../../src/store/skills-db.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skills-db.js","sourceRoot":"","sources":["../../src/store/skills-db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,wEAAwE;AACxE,0EAA0E;AAC1E,iFAAiF;AACjF,gF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K,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,oBAAoB;QACpB,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,CAAC,IAAI,yBAAyB,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,GAAG,MAAM,YAAY,EAAE,CAAC;IAChC,MAAM,eAAe,GAAG,OAAO,EAAE,cAAc;QAC7C,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC;QACxD,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,SAAS,GAAG,eAAe;QAC/B,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,eAAe,CAAC;QAC9D,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3C,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;AACxF,CAAC;AAOD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -46,7 +46,7 @@ import { type DbInventoryEntry, type DbRole } from '@cleocode/contracts';
|
|
|
46
46
|
*
|
|
47
47
|
* - `chokepoint-opener` — role has a canonical opener (`getDb`,
|
|
48
48
|
* `getBrainDb`, `ensureConduitDb`,
|
|
49
|
-
* `getNexusDb`, `
|
|
49
|
+
* `getNexusDb`, `ensureGlobalAgentRegistryDb`,
|
|
50
50
|
* `getTelemetryDb`, `openSkillsDb`).
|
|
51
51
|
* - `raw-file-vacuum-readonly` — role has NO live opener; the file is
|
|
52
52
|
* opened read-only via a one-shot
|
|
@@ -78,7 +78,7 @@ export interface VacuumOptions {
|
|
|
78
78
|
*
|
|
79
79
|
* Debounced by default (30s). Pass `force: true` to bypass debounce. This
|
|
80
80
|
* function is retained for backward compatibility with existing call sites
|
|
81
|
-
* in `data-safety
|
|
81
|
+
* in `data-safety-central.ts` that only snapshot tasks.db.
|
|
82
82
|
*
|
|
83
83
|
* Prefer {@link vacuumIntoBackupAll} for new code — it snapshots every
|
|
84
84
|
* inventory-registered database and shares the same debounce + rotation
|