@cleocode/core 2026.9.19 → 2026.9.21
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/adapters/discovery.d.ts.map +1 -1
- package/dist/adapters/discovery.js +3 -10
- package/dist/adapters/discovery.js.map +1 -1
- package/dist/adrs/link-pipeline.js +2 -2
- package/dist/adrs/link-pipeline.js.map +1 -1
- package/dist/adrs/parse.js +3 -3
- package/dist/adrs/parse.js.map +1 -1
- package/dist/agents/invoke-meta-agent.d.ts.map +1 -1
- package/dist/agents/invoke-meta-agent.js +8 -4
- package/dist/agents/invoke-meta-agent.js.map +1 -1
- package/dist/bootstrap.d.ts +5 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +41 -21
- package/dist/bootstrap.js.map +1 -1
- package/dist/cloud/crypto.d.ts +47 -0
- package/dist/cloud/crypto.d.ts.map +1 -0
- package/dist/cloud/crypto.js +223 -0
- package/dist/cloud/crypto.js.map +1 -0
- package/dist/cloud/http.d.ts +52 -0
- package/dist/cloud/http.d.ts.map +1 -0
- package/dist/cloud/http.js +98 -0
- package/dist/cloud/http.js.map +1 -0
- package/dist/cloud/index.d.ts +19 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +19 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/journal.d.ts +169 -0
- package/dist/cloud/journal.d.ts.map +1 -0
- package/dist/cloud/journal.js +428 -0
- package/dist/cloud/journal.js.map +1 -0
- package/dist/cloud/keys.d.ts +213 -0
- package/dist/cloud/keys.d.ts.map +1 -0
- package/dist/cloud/keys.js +362 -0
- package/dist/cloud/keys.js.map +1 -0
- package/dist/cloud/manifest-check.d.ts +36 -0
- package/dist/cloud/manifest-check.d.ts.map +1 -0
- package/dist/cloud/manifest-check.js +70 -0
- package/dist/cloud/manifest-check.js.map +1 -0
- package/dist/cloud/projects.d.ts +13 -0
- package/dist/cloud/projects.d.ts.map +1 -0
- package/dist/cloud/projects.js +11 -0
- package/dist/cloud/projects.js.map +1 -0
- package/dist/cloud/signing.d.ts +105 -0
- package/dist/cloud/signing.d.ts.map +1 -0
- package/dist/cloud/signing.js +117 -0
- package/dist/cloud/signing.js.map +1 -0
- package/dist/cloud/streams.d.ts +6 -0
- package/dist/cloud/streams.d.ts.map +1 -0
- package/dist/cloud/streams.js +5 -0
- package/dist/cloud/streams.js.map +1 -0
- package/dist/decide/audit.d.ts +131 -0
- package/dist/decide/audit.d.ts.map +1 -0
- package/dist/decide/audit.js +98 -0
- package/dist/decide/audit.js.map +1 -0
- package/dist/decide/budget.d.ts +91 -0
- package/dist/decide/budget.d.ts.map +1 -0
- package/dist/decide/budget.js +194 -0
- package/dist/decide/budget.js.map +1 -0
- package/dist/decide/cache.d.ts +49 -0
- package/dist/decide/cache.d.ts.map +1 -0
- package/dist/decide/cache.js +87 -0
- package/dist/decide/cache.js.map +1 -0
- package/dist/decide/client.d.ts +103 -0
- package/dist/decide/client.d.ts.map +1 -0
- package/dist/decide/client.js +262 -0
- package/dist/decide/client.js.map +1 -0
- package/dist/decide/credentials.d.ts +159 -0
- package/dist/decide/credentials.d.ts.map +1 -0
- package/dist/decide/credentials.js +383 -0
- package/dist/decide/credentials.js.map +1 -0
- package/dist/decide/index.d.ts +18 -0
- package/dist/decide/index.d.ts.map +1 -0
- package/dist/decide/index.js +18 -0
- package/dist/decide/index.js.map +1 -0
- package/dist/decide/jev-wire.d.ts +155 -0
- package/dist/decide/jev-wire.d.ts.map +1 -0
- package/dist/decide/jev-wire.js +420 -0
- package/dist/decide/jev-wire.js.map +1 -0
- package/dist/decide/operations.d.ts +152 -0
- package/dist/decide/operations.d.ts.map +1 -0
- package/dist/decide/operations.js +199 -0
- package/dist/decide/operations.js.map +1 -0
- package/dist/decide/provider.d.ts +90 -0
- package/dist/decide/provider.d.ts.map +1 -0
- package/dist/decide/provider.js +43 -0
- package/dist/decide/provider.js.map +1 -0
- package/dist/decide/site.d.ts +148 -0
- package/dist/decide/site.d.ts.map +1 -0
- package/dist/decide/site.js +181 -0
- package/dist/decide/site.js.map +1 -0
- package/dist/decide/transport.d.ts +67 -0
- package/dist/decide/transport.d.ts.map +1 -0
- package/dist/decide/transport.js +350 -0
- package/dist/decide/transport.js.map +1 -0
- package/dist/docs/export-document.js +5908 -2436
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.js.map +1 -1
- package/dist/docs/projection.d.ts.map +1 -1
- package/dist/docs/projection.js +2 -3
- package/dist/docs/projection.js.map +1 -1
- package/dist/docs/publish-pr.d.ts +69 -1
- package/dist/docs/publish-pr.d.ts.map +1 -1
- package/dist/docs/publish-pr.js +112 -10
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts +13 -8
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +39 -26
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/index.d.ts +2 -0
- package/dist/doctor/index.d.ts.map +1 -1
- package/dist/doctor/index.js +1 -0
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/knowledge.d.ts.map +1 -1
- package/dist/doctor/knowledge.js +5 -15
- package/dist/doctor/knowledge.js.map +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts.map +1 -1
- package/dist/doctor/nexus-schema-residency.js +3 -0
- package/dist/doctor/nexus-schema-residency.js.map +1 -1
- package/dist/doctor/project-identity.d.ts +44 -1
- package/dist/doctor/project-identity.d.ts.map +1 -1
- package/dist/doctor/project-identity.js +237 -10
- package/dist/doctor/project-identity.js.map +1 -1
- package/dist/doctor/projects.d.ts +170 -0
- package/dist/doctor/projects.d.ts.map +1 -0
- package/dist/doctor/projects.js +1075 -0
- package/dist/doctor/projects.js.map +1 -0
- package/dist/doctor/twin-collapse.d.ts +97 -0
- package/dist/doctor/twin-collapse.d.ts.map +1 -0
- package/dist/doctor/twin-collapse.js +168 -0
- package/dist/doctor/twin-collapse.js.map +1 -0
- package/dist/doctor/worktree-orphans.d.ts.map +1 -1
- package/dist/doctor/worktree-orphans.js +13 -29
- package/dist/doctor/worktree-orphans.js.map +1 -1
- package/dist/doctor/worktree-stores.d.ts +128 -0
- package/dist/doctor/worktree-stores.d.ts.map +1 -0
- package/dist/doctor/worktree-stores.js +374 -0
- package/dist/doctor/worktree-stores.js.map +1 -0
- package/dist/engine/engine-ops.d.ts.map +1 -1
- package/dist/engine/engine-ops.js +59 -23
- package/dist/engine/engine-ops.js.map +1 -1
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/error-catalog.js +21 -0
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-registry.d.ts.map +1 -1
- package/dist/error-registry.js +40 -0
- package/dist/error-registry.js.map +1 -1
- package/dist/gc/cleanup.d.ts.map +1 -1
- package/dist/gc/cleanup.js +32 -19
- package/dist/gc/cleanup.js.map +1 -1
- package/dist/git/bounded-git.d.ts +170 -0
- package/dist/git/bounded-git.d.ts.map +1 -0
- package/dist/git/bounded-git.js +371 -0
- package/dist/git/bounded-git.js.map +1 -0
- package/dist/git/work-tree.d.ts +20 -0
- package/dist/git/work-tree.d.ts.map +1 -1
- package/dist/git/work-tree.js +20 -2
- package/dist/git/work-tree.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts +11 -26
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +18 -47
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/hooks/payload-schemas.d.ts +2 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/init/engine-ops.d.ts.map +1 -1
- package/dist/init/engine-ops.js +23 -1
- package/dist/init/engine-ops.js.map +1 -1
- package/dist/init.d.ts +158 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +535 -44
- package/dist/init.js.map +1 -1
- package/dist/injection.d.ts +55 -0
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +102 -6
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +9 -5
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +8 -4
- package/dist/internal.js.map +1 -1
- package/dist/issue/diagnostics.d.ts.map +1 -1
- package/dist/issue/diagnostics.js +2 -1
- package/dist/issue/diagnostics.js.map +1 -1
- package/dist/lib/concurrency.d.ts +25 -0
- package/dist/lib/concurrency.d.ts.map +1 -0
- package/dist/lib/concurrency.js +43 -0
- package/dist/lib/concurrency.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lifecycle/engine-ops.d.ts.map +1 -1
- package/dist/lifecycle/engine-ops.js +4 -2
- package/dist/lifecycle/engine-ops.js.map +1 -1
- package/dist/lifecycle/stage-guidance.d.ts +5 -0
- package/dist/lifecycle/stage-guidance.d.ts.map +1 -1
- package/dist/lifecycle/stage-guidance.js +14 -4
- package/dist/lifecycle/stage-guidance.js.map +1 -1
- package/dist/llm/catalog-cache.d.ts +3 -2
- package/dist/llm/catalog-cache.d.ts.map +1 -1
- package/dist/llm/catalog-cache.js +5 -5
- package/dist/llm/catalog-cache.js.map +1 -1
- package/dist/llm/credentials.d.ts +4 -4
- package/dist/llm/credentials.js +6 -6
- package/dist/llm/credentials.js.map +1 -1
- package/dist/llm/plugin-facade.js +4312 -1798
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/stable-device-id.d.ts.map +1 -1
- package/dist/llm/stable-device-id.js +3 -5
- package/dist/llm/stable-device-id.js.map +1 -1
- package/dist/memory/attention.d.ts.map +1 -1
- package/dist/memory/attention.js +30 -30
- package/dist/memory/attention.js.map +1 -1
- package/dist/memory/decision-contradiction.d.ts +152 -0
- package/dist/memory/decision-contradiction.d.ts.map +1 -0
- package/dist/memory/decision-contradiction.js +273 -0
- package/dist/memory/decision-contradiction.js.map +1 -0
- package/dist/memory/decisions.d.ts +42 -11
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +153 -56
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/dialectic-evaluator.d.ts +7 -0
- package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
- package/dist/memory/dialectic-evaluator.js +23 -8
- package/dist/memory/dialectic-evaluator.js.map +1 -1
- package/dist/memory/dispatch-trace-format.d.ts +39 -0
- package/dist/memory/dispatch-trace-format.d.ts.map +1 -0
- package/dist/memory/dispatch-trace-format.js +54 -0
- package/dist/memory/dispatch-trace-format.js.map +1 -0
- package/dist/memory/dispatch-trace.d.ts.map +1 -1
- package/dist/memory/dispatch-trace.js +1 -27
- package/dist/memory/dispatch-trace.js.map +1 -1
- package/dist/memory/engine-compat.d.ts +2 -0
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +1 -0
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/memory/import-from-provider.js +3 -3
- package/dist/memory/import-from-provider.js.map +1 -1
- package/dist/memory/learnings.d.ts +2 -2
- package/dist/memory/observation-type-decision.d.ts +96 -0
- package/dist/memory/observation-type-decision.d.ts.map +1 -0
- package/dist/memory/observation-type-decision.js +218 -0
- package/dist/memory/observation-type-decision.js.map +1 -0
- package/dist/memory/redaction.js +2 -0
- package/dist/memory/redaction.js.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts +9 -2
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.js +42 -11
- package/dist/memory/retrieval/build-retrieval-bundle.js.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.d.ts +5 -0
- package/dist/memory/retrieval/get-current-session-id.d.ts.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.js +7 -2
- package/dist/memory/retrieval/get-current-session-id.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +30 -29
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +42 -29
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/assessment-projection.d.ts +76 -0
- package/dist/nexus/assessment-projection.d.ts.map +1 -0
- package/dist/nexus/assessment-projection.js +143 -0
- package/dist/nexus/assessment-projection.js.map +1 -0
- package/dist/nexus/assessment-store.d.ts +14 -2
- package/dist/nexus/assessment-store.d.ts.map +1 -1
- package/dist/nexus/assessment-store.js +21 -3
- package/dist/nexus/assessment-store.js.map +1 -1
- package/dist/nexus/checkout-nonce.d.ts +48 -0
- package/dist/nexus/checkout-nonce.d.ts.map +1 -0
- package/dist/nexus/checkout-nonce.js +84 -0
- package/dist/nexus/checkout-nonce.js.map +1 -0
- package/dist/nexus/devices.d.ts +93 -0
- package/dist/nexus/devices.d.ts.map +1 -0
- package/dist/nexus/devices.js +141 -0
- package/dist/nexus/devices.js.map +1 -0
- package/dist/nexus/freshness.d.ts.map +1 -1
- package/dist/nexus/freshness.js +25 -6
- package/dist/nexus/freshness.js.map +1 -1
- package/dist/nexus/git-state.d.ts +225 -0
- package/dist/nexus/git-state.d.ts.map +1 -0
- package/dist/nexus/git-state.js +677 -0
- package/dist/nexus/git-state.js.map +1 -0
- package/dist/nexus/graph-manifest.d.ts +20 -4
- package/dist/nexus/graph-manifest.d.ts.map +1 -1
- package/dist/nexus/graph-manifest.js +40 -5
- package/dist/nexus/graph-manifest.js.map +1 -1
- package/dist/nexus/identity.d.ts +68 -23
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +99 -22
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +5 -2
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +10 -4
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/knowledge.d.ts +5 -0
- package/dist/nexus/knowledge.d.ts.map +1 -1
- package/dist/nexus/knowledge.js +26 -2
- package/dist/nexus/knowledge.js.map +1 -1
- package/dist/nexus/legacy-alias.d.ts +60 -0
- package/dist/nexus/legacy-alias.d.ts.map +1 -0
- package/dist/nexus/legacy-alias.js +68 -0
- package/dist/nexus/legacy-alias.js.map +1 -0
- package/dist/nexus/migrate-json-to-sqlite.js +2 -2
- package/dist/nexus/migrate-json-to-sqlite.js.map +1 -1
- package/dist/nexus/ops.d.ts +1 -0
- package/dist/nexus/ops.d.ts.map +1 -1
- package/dist/nexus/path-map.d.ts +264 -20
- package/dist/nexus/path-map.d.ts.map +1 -1
- package/dist/nexus/path-map.js +580 -44
- package/dist/nexus/path-map.js.map +1 -1
- package/dist/nexus/projects-clean.d.ts +9 -1
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +126 -14
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/projects-scan.d.ts +56 -1
- package/dist/nexus/projects-scan.d.ts.map +1 -1
- package/dist/nexus/projects-scan.js +144 -3
- package/dist/nexus/projects-scan.js.map +1 -1
- package/dist/nexus/registry-hygiene.d.ts +18 -2
- package/dist/nexus/registry-hygiene.d.ts.map +1 -1
- package/dist/nexus/registry-hygiene.js +37 -11
- package/dist/nexus/registry-hygiene.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +47 -0
- package/dist/nexus/registry-roots.d.ts.map +1 -0
- package/dist/nexus/registry-roots.js +79 -0
- package/dist/nexus/registry-roots.js.map +1 -0
- package/dist/nexus/registry.d.ts +50 -9
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +311 -156
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/stored-roots.d.ts +106 -0
- package/dist/nexus/stored-roots.d.ts.map +1 -0
- package/dist/nexus/stored-roots.js +180 -0
- package/dist/nexus/stored-roots.js.map +1 -0
- package/dist/nexus/transfer.d.ts.map +1 -1
- package/dist/nexus/transfer.js +3 -0
- package/dist/nexus/transfer.js.map +1 -1
- package/dist/nexus/user-profile-hygiene.d.ts +168 -0
- package/dist/nexus/user-profile-hygiene.d.ts.map +1 -0
- package/dist/nexus/user-profile-hygiene.js +305 -0
- package/dist/nexus/user-profile-hygiene.js.map +1 -0
- package/dist/nexus/user-profile.d.ts +53 -2
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +106 -4
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +5 -1
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts +12 -0
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +152 -57
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/classify-readiness.d.ts +37 -1
- package/dist/orchestration/classify-readiness.d.ts.map +1 -1
- package/dist/orchestration/classify-readiness.js +48 -19
- package/dist/orchestration/classify-readiness.js.map +1 -1
- package/dist/orchestration/index.d.ts +3 -2
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +2 -1
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/owner-decision-readiness.d.ts +88 -0
- package/dist/orchestration/owner-decision-readiness.d.ts.map +1 -0
- package/dist/orchestration/owner-decision-readiness.js +152 -0
- package/dist/orchestration/owner-decision-readiness.js.map +1 -0
- package/dist/orchestration/psyche-memory-budget.d.ts +105 -0
- package/dist/orchestration/psyche-memory-budget.d.ts.map +1 -0
- package/dist/orchestration/psyche-memory-budget.js +383 -0
- package/dist/orchestration/psyche-memory-budget.js.map +1 -0
- package/dist/orchestration/spawn-prompt.d.ts +12 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +141 -179
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/spawn.d.ts +7 -0
- package/dist/orchestration/spawn.d.ts.map +1 -1
- package/dist/orchestration/spawn.js +1 -0
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/paths.d.ts +24 -8
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +135 -71
- package/dist/paths.js.map +1 -1
- package/dist/platform.d.ts +6 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +8 -19
- package/dist/platform.js.map +1 -1
- package/dist/project-info.d.ts +18 -0
- package/dist/project-info.d.ts.map +1 -1
- package/dist/project-info.js +29 -1
- package/dist/project-info.js.map +1 -1
- package/dist/project-lifecycle.d.ts +91 -32
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/project-lifecycle.js +639 -75
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/project-scope.d.ts +86 -4
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +226 -13
- package/dist/project-scope.js.map +1 -1
- package/dist/project-tombstone.d.ts +111 -0
- package/dist/project-tombstone.d.ts.map +1 -0
- package/dist/project-tombstone.js +220 -0
- package/dist/project-tombstone.js.map +1 -0
- package/dist/release/artifacts.d.ts.map +1 -1
- package/dist/release/artifacts.js +14 -9
- package/dist/release/artifacts.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +223 -0
- package/dist/release/ci-evidence.d.ts.map +1 -0
- package/dist/release/ci-evidence.js +652 -0
- package/dist/release/ci-evidence.js.map +1 -0
- package/dist/release/engine-ops.d.ts.map +1 -1
- package/dist/release/engine-ops.js +3 -3
- package/dist/release/engine-ops.js.map +1 -1
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +7 -6
- package/dist/release/plan.js.map +1 -1
- package/dist/release/pr-evidence.d.ts +38 -0
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +67 -11
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +3 -2
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/release-manifest.d.ts +2 -1
- package/dist/release/release-manifest.d.ts.map +1 -1
- package/dist/release/release-manifest.js +6 -5
- package/dist/release/release-manifest.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts +4 -0
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +57 -0
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/resources/spawn-wrapper.d.ts +8 -1
- package/dist/resources/spawn-wrapper.d.ts.map +1 -1
- package/dist/resources/spawn-wrapper.js +42 -5
- package/dist/resources/spawn-wrapper.js.map +1 -1
- 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/sagas/index.d.ts +1 -1
- package/dist/sagas/index.d.ts.map +1 -1
- package/dist/sagas/index.js +1 -1
- package/dist/sagas/index.js.map +1 -1
- package/dist/sagas/reconcile.d.ts +24 -4
- package/dist/sagas/reconcile.d.ts.map +1 -1
- package/dist/sagas/reconcile.js +226 -100
- package/dist/sagas/reconcile.js.map +1 -1
- package/dist/scaffold/ensure-config.d.ts.map +1 -1
- package/dist/scaffold/ensure-config.js +31 -1
- package/dist/scaffold/ensure-config.js.map +1 -1
- package/dist/scaffold/project-identity.d.ts +2 -8
- package/dist/scaffold/project-identity.d.ts.map +1 -1
- package/dist/scaffold/project-identity.js +5 -21
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/security/input-sanitization.d.ts +9 -1
- package/dist/security/input-sanitization.d.ts.map +1 -1
- package/dist/security/input-sanitization.js +12 -2
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +4321 -1807
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/propose-tick.d.ts.map +1 -1
- package/dist/sentient/propose-tick.js +4 -2
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +6 -23
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/engine-ops.d.ts +9 -0
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +110 -18
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/assumptions.d.ts.map +1 -1
- package/dist/sessions/assumptions.js +7 -4
- package/dist/sessions/assumptions.js.map +1 -1
- package/dist/sessions/briefing.d.ts +6 -0
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +12 -1
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/decisions.d.ts +38 -3
- package/dist/sessions/decisions.d.ts.map +1 -1
- package/dist/sessions/decisions.js +235 -21
- package/dist/sessions/decisions.js.map +1 -1
- package/dist/sessions/drift-watchdog.d.ts.map +1 -1
- package/dist/sessions/drift-watchdog.js +4 -2
- package/dist/sessions/drift-watchdog.js.map +1 -1
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +33 -4
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.d.ts +26 -0
- package/dist/sessions/session-end-snapshot-entry.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot-entry.js +59 -0
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -0
- package/dist/sessions/session-end-snapshot.d.ts +114 -0
- package/dist/sessions/session-end-snapshot.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot.js +446 -0
- package/dist/sessions/session-end-snapshot.js.map +1 -0
- package/dist/sessions/session-manifest-mirror.d.ts.map +1 -1
- package/dist/sessions/session-manifest-mirror.js +10 -17
- package/dist/sessions/session-manifest-mirror.js.map +1 -1
- package/dist/sessions/session-switch.d.ts.map +1 -1
- package/dist/sessions/session-switch.js +5 -3
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/sessions/snapshot.d.ts.map +1 -1
- package/dist/sessions/snapshot.js +5 -4
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/sessions/terminal-identity.d.ts +169 -0
- package/dist/sessions/terminal-identity.d.ts.map +1 -0
- package/dist/sessions/terminal-identity.js +273 -0
- package/dist/sessions/terminal-identity.js.map +1 -0
- package/dist/setup/sections/verification.d.ts +1 -1
- package/dist/setup/sections/verification.d.ts.map +1 -1
- package/dist/setup/sections/verification.js +11 -15
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/skills/discovery.d.ts +8 -2
- package/dist/skills/discovery.d.ts.map +1 -1
- package/dist/skills/discovery.js +15 -3
- package/dist/skills/discovery.js.map +1 -1
- package/dist/skills/dispatch.d.ts +5 -2
- package/dist/skills/dispatch.d.ts.map +1 -1
- package/dist/skills/dispatch.js +5 -2
- package/dist/skills/dispatch.js.map +1 -1
- package/dist/skills/doctor.d.ts.map +1 -1
- package/dist/skills/doctor.js +5 -1
- package/dist/skills/doctor.js.map +1 -1
- package/dist/skills/federated-search.js +2 -2
- package/dist/skills/federated-search.js.map +1 -1
- package/dist/skills/index.d.ts +3 -3
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/install.d.ts +15 -2
- package/dist/skills/install.d.ts.map +1 -1
- package/dist/skills/install.js +21 -5
- package/dist/skills/install.js.map +1 -1
- package/dist/skills/migration.d.ts +5 -5
- package/dist/skills/migration.d.ts.map +1 -1
- package/dist/skills/migration.js +7 -9
- package/dist/skills/migration.js.map +1 -1
- package/dist/skills/orchestrator/startup.d.ts.map +1 -1
- package/dist/skills/orchestrator/startup.js +4 -2
- package/dist/skills/orchestrator/startup.js.map +1 -1
- package/dist/skills/skill-paths.d.ts +30 -3
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/skills/skill-paths.js +28 -9
- package/dist/skills/skill-paths.js.map +1 -1
- package/dist/skills/skill-root.d.ts +60 -11
- package/dist/skills/skill-root.d.ts.map +1 -1
- package/dist/skills/skill-root.js +100 -14
- package/dist/skills/skill-root.js.map +1 -1
- package/dist/skills/skills-guard.js +5 -5
- package/dist/skills/skills-guard.js.map +1 -1
- package/dist/skills/types.d.ts +23 -0
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/types.js.map +1 -1
- package/dist/spawn/agent-identity.d.ts +51 -2
- package/dist/spawn/agent-identity.d.ts.map +1 -1
- package/dist/spawn/agent-identity.js +89 -26
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +56 -79
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/spawn/index.d.ts +2 -2
- package/dist/spawn/index.d.ts.map +1 -1
- package/dist/spawn/index.js +1 -1
- package/dist/spawn/index.js.map +1 -1
- package/dist/spawn/worktree-lock-holder.d.ts +37 -0
- package/dist/spawn/worktree-lock-holder.d.ts.map +1 -0
- package/dist/spawn/worktree-lock-holder.js +41 -0
- package/dist/spawn/worktree-lock-holder.js.map +1 -0
- package/dist/sticky/convert.d.ts.map +1 -1
- package/dist/sticky/convert.js +16 -4
- package/dist/sticky/convert.js.map +1 -1
- package/dist/store/attachment-store.d.ts +14 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +11 -1
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/backup-inspect.d.ts +7 -3
- package/dist/store/backup-inspect.d.ts.map +1 -1
- package/dist/store/backup-inspect.js +18 -7
- package/dist/store/backup-inspect.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +60 -0
- package/dist/store/backup-sidecar.d.ts.map +1 -0
- package/dist/store/backup-sidecar.js +96 -0
- package/dist/store/backup-sidecar.js.map +1 -0
- package/dist/store/data-accessor.d.ts +1 -1
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +6 -6
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts +13 -4
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +31 -4
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +10 -0
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.js +4 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -1
- package/dist/store/exodus/migrate.js +1 -1
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/reconcile.js +1 -1
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +4 -3
- package/dist/store/exodus/runtime-targets.d.ts.map +1 -1
- package/dist/store/exodus/runtime-targets.js +4 -3
- package/dist/store/exodus/runtime-targets.js.map +1 -1
- package/dist/store/import-logging.d.ts.map +1 -1
- package/dist/store/import-logging.js +5 -4
- package/dist/store/import-logging.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +2 -7
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +1 -0
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +1 -0
- package/dist/store/lock.js.map +1 -1
- package/dist/store/memory-accessor.d.ts +8 -3
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +29 -13
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +5 -0
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +11 -6
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts +13 -8
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +75 -31
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +2 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +7 -3
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/pre-repair-snapshot.d.ts +77 -0
- package/dist/store/pre-repair-snapshot.d.ts.map +1 -0
- package/dist/store/pre-repair-snapshot.js +122 -0
- package/dist/store/pre-repair-snapshot.js.map +1 -0
- package/dist/store/regenerators.d.ts +2 -1
- package/dist/store/regenerators.d.ts.map +1 -1
- package/dist/store/regenerators.js +17 -3
- package/dist/store/regenerators.js.map +1 -1
- package/dist/store/relocated-store-guard.d.ts +71 -0
- package/dist/store/relocated-store-guard.d.ts.map +1 -0
- package/dist/store/relocated-store-guard.js +138 -0
- package/dist/store/relocated-store-guard.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +2 -2
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +2 -2
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +2 -2
- package/dist/store/schema/audit.d.ts +5 -5
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/models-catalog.d.ts +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +686 -0
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +175 -7
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-project/audit.d.ts +5 -5
- package/dist/store/schema/cleo-project/docs.d.ts +3 -3
- package/dist/store/schema/cleo-project/lifecycle.d.ts +3 -3
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +6 -6
- package/dist/store/schema/cleo-shared/brain.d.ts +26 -26
- package/dist/store/schema/lifecycle.d.ts +3 -3
- package/dist/store/schema/manifest.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts +26 -26
- package/dist/store/schema/nexus-schema.d.ts +696 -2
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +175 -19
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/skills-schema.d.ts +2 -2
- package/dist/store/schema/tasks.d.ts +5 -5
- package/dist/store/session-binding-schema.d.ts +132 -0
- package/dist/store/session-binding-schema.d.ts.map +1 -0
- package/dist/store/session-binding-schema.js +53 -0
- package/dist/store/session-binding-schema.js.map +1 -0
- package/dist/store/session-store.d.ts +262 -4
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +486 -26
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/snapshot-gate.d.ts +239 -0
- package/dist/store/snapshot-gate.d.ts.map +1 -0
- package/dist/store/snapshot-gate.js +398 -0
- package/dist/store/snapshot-gate.js.map +1 -0
- package/dist/store/split-brain-import.js +2 -2
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +55 -13
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +414 -106
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +15 -0
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +63 -4
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +53 -5
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/store-write-guard.d.ts +28 -0
- package/dist/store/store-write-guard.d.ts.map +1 -0
- package/dist/store/store-write-guard.js +50 -0
- package/dist/store/store-write-guard.js.map +1 -0
- package/dist/store/table-classification.d.ts +143 -0
- package/dist/store/table-classification.d.ts.map +1 -0
- package/dist/store/table-classification.js +1866 -0
- package/dist/store/table-classification.js.map +1 -0
- package/dist/store/task-version.d.ts +72 -0
- package/dist/store/task-version.d.ts.map +1 -0
- package/dist/store/task-version.js +93 -0
- package/dist/store/task-version.js.map +1 -0
- package/dist/store/tasks-schema.d.ts +1 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +13 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +10 -3
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +12 -3
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +275 -0
- package/dist/store/twin-collapse.d.ts.map +1 -0
- package/dist/store/twin-collapse.js +805 -0
- package/dist/store/twin-collapse.js.map +1 -0
- package/dist/store/umbrella-data-accessor.d.ts +2 -2
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +2 -2
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +63 -63
- package/dist/store/worktree-isolation-guard.d.ts +46 -24
- package/dist/store/worktree-isolation-guard.d.ts.map +1 -1
- package/dist/store/worktree-isolation-guard.js +69 -50
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +3 -67
- package/dist/system/backup.js.map +1 -1
- package/dist/system/cleo-link.d.ts +163 -0
- package/dist/system/cleo-link.d.ts.map +1 -0
- package/dist/system/cleo-link.js +246 -0
- package/dist/system/cleo-link.js.map +1 -0
- package/dist/system/dependencies.d.ts.map +1 -1
- package/dist/system/dependencies.js +26 -41
- package/dist/system/dependencies.js.map +1 -1
- package/dist/system/global-delivery.d.ts +205 -0
- package/dist/system/global-delivery.d.ts.map +1 -0
- package/dist/system/global-delivery.js +320 -0
- package/dist/system/global-delivery.js.map +1 -0
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +29 -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 +1 -20
- package/dist/system/project-health.js.map +1 -1
- package/dist/system/runtime.d.ts.map +1 -1
- package/dist/system/runtime.js +2 -12
- package/dist/system/runtime.js.map +1 -1
- package/dist/system/safestop.d.ts.map +1 -1
- package/dist/system/safestop.js +5 -2
- package/dist/system/safestop.js.map +1 -1
- package/dist/system/skill-fixtures.d.ts +200 -0
- package/dist/system/skill-fixtures.d.ts.map +1 -0
- package/dist/system/skill-fixtures.js +331 -0
- package/dist/system/skill-fixtures.js.map +1 -0
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +4 -2
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +173 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -0
- package/dist/tasks/affected-packages.js +389 -0
- package/dist/tasks/affected-packages.js.map +1 -0
- package/dist/tasks/change-set.d.ts +151 -0
- package/dist/tasks/change-set.d.ts.map +1 -0
- package/dist/tasks/change-set.js +634 -0
- package/dist/tasks/change-set.js.map +1 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +10 -5
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/done-plan.d.ts +103 -0
- package/dist/tasks/done-plan.d.ts.map +1 -0
- package/dist/tasks/done-plan.js +541 -0
- package/dist/tasks/done-plan.js.map +1 -0
- package/dist/tasks/done-record.d.ts +127 -0
- package/dist/tasks/done-record.d.ts.map +1 -0
- package/dist/tasks/done-record.js +373 -0
- package/dist/tasks/done-record.js.map +1 -0
- package/dist/tasks/duplicate-detector.d.ts +68 -11
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +314 -58
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/evidence-paths.d.ts +78 -0
- package/dist/tasks/evidence-paths.d.ts.map +1 -0
- package/dist/tasks/evidence-paths.js +150 -0
- package/dist/tasks/evidence-paths.js.map +1 -0
- package/dist/tasks/evidence.d.ts +55 -0
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +223 -26
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-preview.d.ts +5 -0
- package/dist/tasks/gate-preview.d.ts.map +1 -1
- package/dist/tasks/gate-preview.js +25 -21
- package/dist/tasks/gate-preview.js.map +1 -1
- package/dist/tasks/gate-result-cache.d.ts +205 -0
- package/dist/tasks/gate-result-cache.d.ts.map +1 -0
- package/dist/tasks/gate-result-cache.js +285 -0
- package/dist/tasks/gate-result-cache.js.map +1 -0
- package/dist/tasks/gate-runner.d.ts +126 -3
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +483 -28
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/session-scope.d.ts +3 -1
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +18 -3
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +23 -6
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +146 -8
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-vacuity.d.ts +71 -0
- package/dist/tasks/tool-vacuity.d.ts.map +1 -0
- package/dist/tasks/tool-vacuity.js +334 -0
- package/dist/tasks/tool-vacuity.js.map +1 -0
- package/dist/tasks/update.d.ts +8 -0
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +159 -78
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +18 -2
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +20 -2
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +64 -4
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/doctor/index.d.ts +1 -1
- package/dist/validation/doctor/index.d.ts.map +1 -1
- package/dist/validation/doctor/index.js +1 -1
- package/dist/validation/doctor/index.js.map +1 -1
- package/dist/validation/doctor/utils.d.ts.map +1 -1
- package/dist/validation/doctor/utils.js +7 -2
- package/dist/validation/doctor/utils.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +15 -0
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +249 -98
- package/dist/validation/engine-ops.js.map +1 -1
- package/migrations/drizzle-cleo-global/20260927000000_t12469-project-locations/migration.sql +121 -0
- package/migrations/drizzle-cleo-global/20260927010000_t12543-user-profile-project-scope/migration.sql +23 -0
- package/migrations/drizzle-cleo-global/20260928010000_t12470-location-candidates/migration.sql +72 -0
- package/migrations/drizzle-cleo-global/20260928020000_t12510-nexus-devices/migration.sql +34 -0
- package/migrations/drizzle-cleo-global/20260928030000_t12511-project-git-state/migration.sql +62 -0
- package/migrations/drizzle-cleo-project/20260927000000_t12499-session-terminal-bindings/migration.sql +34 -0
- package/migrations/drizzle-cleo-project/20260928000000_t12500-binding-provider-flag/migration.sql +15 -0
- package/package.json +23 -13
- package/schemas/config.schema.json +54 -0
- package/schemas/project-context.schema.json +51 -3
- package/schemas/project-info.schema.json +28 -1
- package/templates/CLEO-INJECTION.md +40 -332
- package/templates/CLEO-REFERENCE.md +303 -0
- package/templates/workflows/README.md +36 -14
- package/templates/workflows/release-prepare.yml.tmpl +7 -0
package/dist/nexus/path-map.js
CHANGED
|
@@ -1,87 +1,623 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Project locations (`nexus_project_locations`) — every place a project has
|
|
3
|
+
* been seen, on every device.
|
|
3
4
|
*
|
|
4
|
-
* The registry
|
|
5
|
-
* `project_path` names
|
|
6
|
-
*
|
|
7
|
-
* so two checkouts of one project coexist
|
|
5
|
+
* The registry is keyed by the immutable `project_id` alone (ADR-094 ·
|
|
6
|
+
* T12469); its `project_path` names only the checkout encountered most
|
|
7
|
+
* recently. This table records every checkout as one row per
|
|
8
|
+
* `(project_id, device_id, path)`, so two checkouts of one project coexist and
|
|
9
|
+
* the same project on two devices keeps one registry row.
|
|
10
|
+
*
|
|
11
|
+
* Rows are never deleted because a directory vanished. When a project is
|
|
12
|
+
* recorded, this device's other `live` locations of it whose directory is gone
|
|
13
|
+
* move to `missing`; a location whose path now holds a different project moves
|
|
14
|
+
* to `superseded`. History therefore survives for consumers that need former
|
|
15
|
+
* paths (legacy path-derived credential candidates, T12475).
|
|
8
16
|
*
|
|
9
17
|
* Every writer that records a checkout in the registry records it here in the
|
|
10
18
|
* same transaction: encounter registration, `nexusRegister`, `nexusReconcile`
|
|
11
|
-
* and `nexusMoveProject`.
|
|
12
|
-
*
|
|
19
|
+
* and `nexusMoveProject`. Only an explicit unregister or clean removes rows.
|
|
20
|
+
*
|
|
21
|
+
* ## Compatibility with older binaries sharing the global store
|
|
22
|
+
*
|
|
23
|
+
* Older binaries still read the registry by path (`WHERE project_path = ?
|
|
24
|
+
* LIMIT 1`, and an owner filter of path OR hash OR id). Two registry rows at
|
|
25
|
+
* one path would make them pick a stale row and fail (`E_PROJECT_ID_DRIFT`,
|
|
26
|
+
* identity conflicts). So when a path changes hands, the previous holder's
|
|
27
|
+
* registry row is re-homed in the same transaction ({@link rehomeDisplacedRows}):
|
|
28
|
+
* to its most recent other live location on this device, or, if it has none,
|
|
29
|
+
* to the non-path sentinel {@link supersededRegistryPath} — which no path
|
|
30
|
+
* lookup can match. At most one registry row ever names a real path.
|
|
31
|
+
*
|
|
32
|
+
* The legacy `nexus_project_paths` map is dual-written (upsert only) for one
|
|
33
|
+
* release so older binaries keep reading a current map; drop it with a later
|
|
34
|
+
* migration once those binaries are gone.
|
|
13
35
|
*
|
|
14
36
|
* @task T12354
|
|
37
|
+
* @task T12469
|
|
38
|
+
*/
|
|
39
|
+
import { existsSync, lstatSync, readdirSync } from 'node:fs';
|
|
40
|
+
import { lstat, readdir } from 'node:fs/promises';
|
|
41
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
42
|
+
import { canonicalizePath, readDeclaredProjectIdentity } from '@cleocode/paths';
|
|
43
|
+
import { and, desc, eq, inArray, ne } from 'drizzle-orm';
|
|
44
|
+
import { getStableDeviceId } from '../llm/stable-device-id.js';
|
|
45
|
+
import { projectLocations, projectPaths, projectRegistry } from '../store/schema/nexus-schema.js';
|
|
46
|
+
import { generateProjectHash } from './hash.js';
|
|
47
|
+
import { withinBudget } from './projects-scan.js';
|
|
48
|
+
import { registryStorePath } from './registry-hygiene.js';
|
|
49
|
+
/**
|
|
50
|
+
* Device id carried by rows the T12469 migration backfilled. SQL cannot read
|
|
51
|
+
* the device id, and the global store is device-local, so every such row
|
|
52
|
+
* belongs to this device; {@link adoptLocalDeviceRows} re-keys them.
|
|
53
|
+
*/
|
|
54
|
+
export const LOCAL_DEVICE_SENTINEL = 'local';
|
|
55
|
+
/**
|
|
56
|
+
* Key of a {@link ProjectCheckoutRecord.probed} entry.
|
|
57
|
+
*
|
|
58
|
+
* @param projectId - Project the holding was probed for.
|
|
59
|
+
* @param path - Probed path.
|
|
60
|
+
* @returns The map key.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* probed.set(holdingKey(id, path), await probeProjectHolding(path, id, 2000));
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function holdingKey(projectId, path) {
|
|
68
|
+
return `${projectId}\u0000${path}`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Return this device's stable id — the persisted `<cleoHome>/device-id`
|
|
72
|
+
* (T9321). Reused rather than minting a second device identity.
|
|
73
|
+
*
|
|
74
|
+
* @returns Opaque stable device id.
|
|
75
|
+
*/
|
|
76
|
+
export function currentDeviceId() {
|
|
77
|
+
return getStableDeviceId();
|
|
78
|
+
}
|
|
79
|
+
/** Prefix of the registry `project_path` sentinel for a row with no live location. */
|
|
80
|
+
export const SUPERSEDED_PATH_PREFIX = 'superseded:';
|
|
81
|
+
/**
|
|
82
|
+
* Registry `project_path` for a project whose last checkout now holds another
|
|
83
|
+
* project and which has no other live location. Not an absolute path, so no
|
|
84
|
+
* path lookup (current or older binary) can match it; unique per id.
|
|
85
|
+
*
|
|
86
|
+
* @param projectId - Immutable project id.
|
|
87
|
+
* @returns `superseded:<projectId>`.
|
|
88
|
+
*/
|
|
89
|
+
export function supersededRegistryPath(projectId) {
|
|
90
|
+
return `${SUPERSEDED_PATH_PREFIX}${projectId}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Whether a registry `project_path` is the {@link supersededRegistryPath} sentinel.
|
|
94
|
+
*
|
|
95
|
+
* @param projectPath - Stored registry path.
|
|
96
|
+
* @returns `true` for the sentinel.
|
|
97
|
+
*/
|
|
98
|
+
export function isSupersededRegistryPath(projectPath) {
|
|
99
|
+
return projectPath.startsWith(SUPERSEDED_PATH_PREFIX);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether `path` still holds `projectId`:
|
|
103
|
+
*
|
|
104
|
+
* - `no` — PROVABLY not: `.cleo/` is absent (ENOENT / ENOTDIR), or it
|
|
105
|
+
* declares a different id. A directory the project was moved or rerooted
|
|
106
|
+
* out of (or whose `.cleo/` was moved back out by hand).
|
|
107
|
+
* - `unknown` — cannot tell (EACCES, EPERM, EIO, …). A checkout made
|
|
108
|
+
* unreadable by `chmod 000` is NOT gone; treating it as vanished would let a
|
|
109
|
+
* same-nonce backup copy take its registry row (T12558 round 4).
|
|
110
|
+
* - `yes` — `.cleo/` is there and declares this id (or nothing).
|
|
111
|
+
*/
|
|
112
|
+
export function projectHolding(path, projectId) {
|
|
113
|
+
const cleoDir = join(path, '.cleo');
|
|
114
|
+
try {
|
|
115
|
+
lstatSync(cleoDir);
|
|
116
|
+
readdirSync(cleoDir);
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
const code = error.code;
|
|
120
|
+
return code === 'ENOENT' || code === 'ENOTDIR' ? 'no' : 'unknown';
|
|
121
|
+
}
|
|
122
|
+
const declared = readDeclaredProjectIdentity(path);
|
|
123
|
+
return declared === null || declared.projectId === projectId ? 'yes' : 'no';
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* {@link projectHolding} with a time budget, for machine-wide scans
|
|
127
|
+
* (T12471): a hung mount answers `unknown` after `timeoutMs` instead of
|
|
128
|
+
* stalling the caller. Same tri-state rules — only ENOENT/ENOTDIR prove the
|
|
129
|
+
* project gone.
|
|
130
|
+
*
|
|
131
|
+
* @param path - Checkout root to probe.
|
|
132
|
+
* @param projectId - Id the checkout should hold.
|
|
133
|
+
* @param timeoutMs - Budget for the directory probe.
|
|
134
|
+
* @returns `yes`, `no`, or `unknown` (unreadable or timed out).
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* if ((await probeProjectHolding(row.projectPath, row.projectId, 2000)) === 'no') markGone(row);
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export async function probeProjectHolding(path, projectId, timeoutMs) {
|
|
142
|
+
const cleoDir = join(path, '.cleo');
|
|
143
|
+
const probe = async () => {
|
|
144
|
+
try {
|
|
145
|
+
await lstat(cleoDir);
|
|
146
|
+
await readdir(cleoDir);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
const code = error.code;
|
|
151
|
+
return code === 'ENOENT' || code === 'ENOTDIR' ? 'no' : 'unknown';
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const settled = await withinBudget(probe(), timeoutMs);
|
|
155
|
+
if (settled === 'timeout')
|
|
156
|
+
return 'unknown';
|
|
157
|
+
if (settled !== null)
|
|
158
|
+
return settled;
|
|
159
|
+
const declared = readDeclaredProjectIdentity(path);
|
|
160
|
+
return declared === null || declared.projectId === projectId ? 'yes' : 'no';
|
|
161
|
+
}
|
|
162
|
+
/** `true` when `inner` is strictly inside `outer`, compared through symlinks. */
|
|
163
|
+
function isStrictlyInside(outer, inner) {
|
|
164
|
+
const rel = relative(canonicalizePath(outer), canonicalizePath(inner));
|
|
165
|
+
return rel.length > 0 && rel !== '..' && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
|
|
166
|
+
}
|
|
167
|
+
/** Primary-key predicate for one location row. */
|
|
168
|
+
function locationKey(projectId, deviceId, path) {
|
|
169
|
+
return and(eq(projectLocations.projectId, projectId), eq(projectLocations.deviceId, deviceId), eq(projectLocations.path, path));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Re-key migration-backfilled rows (device id {@link LOCAL_DEVICE_SENTINEL})
|
|
173
|
+
* to `deviceId`, merging with any row already recorded under the real id.
|
|
174
|
+
*
|
|
175
|
+
* @param db - Registry handle or transaction.
|
|
176
|
+
* @param deviceId - This device's stable id.
|
|
177
|
+
* @returns Number of sentinel rows adopted.
|
|
15
178
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
179
|
+
export function adoptLocalDeviceRows(db, deviceId) {
|
|
180
|
+
if (deviceId === LOCAL_DEVICE_SENTINEL)
|
|
181
|
+
return 0;
|
|
182
|
+
const sentinelRows = db
|
|
183
|
+
.select()
|
|
184
|
+
.from(projectLocations)
|
|
185
|
+
.where(eq(projectLocations.deviceId, LOCAL_DEVICE_SENTINEL))
|
|
186
|
+
.all();
|
|
187
|
+
for (const row of sentinelRows) {
|
|
188
|
+
const existing = db
|
|
189
|
+
.select()
|
|
190
|
+
.from(projectLocations)
|
|
191
|
+
.where(locationKey(row.projectId, deviceId, row.path))
|
|
192
|
+
.get();
|
|
193
|
+
if (existing) {
|
|
194
|
+
db.update(projectLocations)
|
|
195
|
+
.set({
|
|
196
|
+
firstSeen: existing.firstSeen < row.firstSeen ? existing.firstSeen : row.firstSeen,
|
|
197
|
+
lastSeen: existing.lastSeen > row.lastSeen ? existing.lastSeen : row.lastSeen,
|
|
198
|
+
})
|
|
199
|
+
.where(locationKey(row.projectId, deviceId, row.path))
|
|
200
|
+
.run();
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
db.insert(projectLocations)
|
|
204
|
+
.values({ ...row, deviceId })
|
|
205
|
+
.run();
|
|
206
|
+
}
|
|
207
|
+
db.delete(projectLocations)
|
|
208
|
+
.where(locationKey(row.projectId, LOCAL_DEVICE_SENTINEL, row.path))
|
|
209
|
+
.run();
|
|
210
|
+
}
|
|
211
|
+
return sentinelRows.length;
|
|
212
|
+
}
|
|
19
213
|
/**
|
|
20
|
-
* Record a checkout
|
|
214
|
+
* Record a checkout as a `live` location, supersede other projects' claims on
|
|
215
|
+
* the same path, and mark this project's vanished paths on this device
|
|
216
|
+
* `missing`. Nothing is deleted.
|
|
21
217
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* registry writers' immediate transactions.
|
|
218
|
+
* Runs synchronously so it composes with the registry writers' immediate
|
|
219
|
+
* transactions.
|
|
25
220
|
*
|
|
26
221
|
* @param db - Registry handle or transaction.
|
|
27
222
|
* @param record - The checkout encountered.
|
|
28
|
-
* @returns
|
|
223
|
+
* @returns Counts of rows moved to `missing` and `superseded`.
|
|
29
224
|
*/
|
|
30
225
|
export function recordProjectCheckout(db, record) {
|
|
31
|
-
|
|
226
|
+
const deviceId = record.deviceId ?? currentDeviceId();
|
|
227
|
+
adoptLocalDeviceRows(db, deviceId);
|
|
228
|
+
const evidence = confirmedColumns(record);
|
|
229
|
+
db.insert(projectLocations)
|
|
32
230
|
.values({
|
|
33
|
-
projectPath: record.projectPath,
|
|
34
231
|
projectId: record.projectId,
|
|
35
|
-
|
|
232
|
+
deviceId,
|
|
233
|
+
path: record.projectPath,
|
|
36
234
|
firstSeen: record.now,
|
|
37
235
|
lastSeen: record.now,
|
|
236
|
+
state: 'live',
|
|
237
|
+
...evidence,
|
|
38
238
|
})
|
|
39
239
|
.onConflictDoUpdate({
|
|
40
|
-
target:
|
|
41
|
-
set: {
|
|
240
|
+
target: [projectLocations.projectId, projectLocations.deviceId, projectLocations.path],
|
|
241
|
+
set: { lastSeen: record.now, state: 'live', ...evidence },
|
|
42
242
|
})
|
|
43
243
|
.run();
|
|
244
|
+
// A path holds one project at a time: other projects' claims on it end.
|
|
245
|
+
const superseded = Number(db
|
|
246
|
+
.update(projectLocations)
|
|
247
|
+
.set({ state: 'superseded' })
|
|
248
|
+
.where(and(eq(projectLocations.deviceId, deviceId), eq(projectLocations.path, record.projectPath), ne(projectLocations.projectId, record.projectId), ne(projectLocations.state, 'superseded')))
|
|
249
|
+
.run().changes);
|
|
44
250
|
const siblings = db
|
|
45
|
-
.select({
|
|
46
|
-
.from(
|
|
47
|
-
.where(and(eq(
|
|
251
|
+
.select({ path: projectLocations.path })
|
|
252
|
+
.from(projectLocations)
|
|
253
|
+
.where(and(eq(projectLocations.projectId, record.projectId), eq(projectLocations.deviceId, deviceId), eq(projectLocations.state, 'live'), ne(projectLocations.path, record.projectPath)))
|
|
48
254
|
.all();
|
|
49
|
-
let
|
|
255
|
+
let markedMissing = 0;
|
|
50
256
|
for (const sibling of siblings) {
|
|
51
|
-
|
|
257
|
+
// Only a PROVABLY vanished location is marked missing; an unreadable one
|
|
258
|
+
// (`unknown`) keeps its state.
|
|
259
|
+
const holding = record.probed?.get(holdingKey(record.projectId, sibling.path)) ??
|
|
260
|
+
projectHolding(sibling.path, record.projectId);
|
|
261
|
+
if (holding !== 'no')
|
|
52
262
|
continue;
|
|
53
|
-
db.
|
|
54
|
-
|
|
263
|
+
db.update(projectLocations)
|
|
264
|
+
.set({ state: 'missing' })
|
|
265
|
+
.where(locationKey(record.projectId, deviceId, sibling.path))
|
|
266
|
+
.run();
|
|
267
|
+
markedMissing++;
|
|
268
|
+
}
|
|
269
|
+
rehomeDisplacedRows(db, record.projectId, record.projectPath, deviceId, record.probed);
|
|
270
|
+
// Legacy path map, dual-written for older binaries (upsert only; see header).
|
|
271
|
+
db.insert(projectPaths)
|
|
272
|
+
.values({
|
|
273
|
+
projectPath: record.projectPath,
|
|
274
|
+
projectId: record.projectId,
|
|
275
|
+
projectHash: record.projectHash ?? generateProjectHash(record.projectPath),
|
|
276
|
+
firstSeen: record.now,
|
|
277
|
+
lastSeen: record.now,
|
|
278
|
+
})
|
|
279
|
+
.onConflictDoUpdate({
|
|
280
|
+
target: projectPaths.projectPath,
|
|
281
|
+
set: {
|
|
282
|
+
projectId: record.projectId,
|
|
283
|
+
projectHash: record.projectHash ?? generateProjectHash(record.projectPath),
|
|
284
|
+
lastSeen: record.now,
|
|
285
|
+
},
|
|
286
|
+
})
|
|
287
|
+
.run();
|
|
288
|
+
return { markedMissing, superseded };
|
|
289
|
+
}
|
|
290
|
+
/** The non-null displayed-evidence fields of a record, as location columns. */
|
|
291
|
+
function evidenceColumns(evidence) {
|
|
292
|
+
return {
|
|
293
|
+
...(evidence?.gitRootCommit ? { gitRootCommit: evidence.gitRootCommit } : {}),
|
|
294
|
+
...(evidence?.gitRemote ? { gitRemote: evidence.gitRemote } : {}),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/** A confirmed record's evidence plus its nonce, as location columns. */
|
|
298
|
+
function confirmedColumns(record) {
|
|
299
|
+
return {
|
|
300
|
+
...evidenceColumns(record.evidence),
|
|
301
|
+
...(record.checkoutNonce ? { checkoutNonce: record.checkoutNonce } : {}),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Decide how an encounter may bind a checkout (see {@link EncounterBinding}).
|
|
306
|
+
*
|
|
307
|
+
* @param db - Registry handle or transaction.
|
|
308
|
+
* @param record - The encountered checkout and its evidence.
|
|
309
|
+
* @returns The permitted binding.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```ts
|
|
313
|
+
* const binding = decideEncounterBinding(tx, { projectId, projectPath, now, evidence });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
export function decideEncounterBinding(db, record) {
|
|
317
|
+
const deviceId = record.deviceId ?? currentDeviceId();
|
|
318
|
+
const row = db
|
|
319
|
+
.select({ projectPath: projectRegistry.projectPath })
|
|
320
|
+
.from(projectRegistry)
|
|
321
|
+
.where(eq(projectRegistry.projectId, record.projectId))
|
|
322
|
+
.get();
|
|
323
|
+
if (!row || row.projectPath === record.projectPath)
|
|
324
|
+
return 'bind';
|
|
325
|
+
const here = db
|
|
326
|
+
.select({ state: projectLocations.state, checkoutNonce: projectLocations.checkoutNonce })
|
|
327
|
+
.from(projectLocations)
|
|
328
|
+
.where(and(eq(projectLocations.projectId, record.projectId), inArray(projectLocations.deviceId, [deviceId, LOCAL_DEVICE_SENTINEL]), eq(projectLocations.path, record.projectPath)))
|
|
329
|
+
.all();
|
|
330
|
+
if (here.some((location) => location.state === 'live'))
|
|
331
|
+
return 'refresh';
|
|
332
|
+
const oldPath = row.projectPath;
|
|
333
|
+
if (isSupersededRegistryPath(oldPath))
|
|
334
|
+
return 'candidate';
|
|
335
|
+
// Proof of a move is the checkout's NONCE alone (T12470): local, untracked
|
|
336
|
+
// state that a real `mv` or a restore of `.cleo/` carries and a clone
|
|
337
|
+
// cannot have. Root commit and remote are forgeable (a clone shares them, a
|
|
338
|
+
// bare `git init` can add any remote, `refs/replace` fakes a root commit),
|
|
339
|
+
// so they are displayed evidence only and never promote.
|
|
340
|
+
const nonce = record.checkoutNonce ?? null;
|
|
341
|
+
const previous = () => db
|
|
342
|
+
.select({ checkoutNonce: projectLocations.checkoutNonce })
|
|
343
|
+
.from(projectLocations)
|
|
344
|
+
.where(and(eq(projectLocations.projectId, record.projectId), inArray(projectLocations.deviceId, [deviceId, LOCAL_DEVICE_SENTINEL]), eq(projectLocations.path, oldPath)))
|
|
345
|
+
.all();
|
|
346
|
+
// The old path still holding the project (not merely existing — a reroot
|
|
347
|
+
// undone by hand leaves the child directory behind, empty of `.cleo/`), or
|
|
348
|
+
// being unreadable, means this is a second checkout, not a move.
|
|
349
|
+
if (projectHolding(oldPath, record.projectId) !== 'no') {
|
|
350
|
+
// T12558 round 4: the ORIGINAL checkout coming back. It was once
|
|
351
|
+
// confirmed here (only a confirmed location records a nonce — candidates
|
|
352
|
+
// never do), it still carries that nonce, and the current holder's nonce
|
|
353
|
+
// differs — so the holder is not a copy of it. Hand the row back rather
|
|
354
|
+
// than leave the original stuck behind a stranger.
|
|
355
|
+
if (nonce !== null &&
|
|
356
|
+
here.some((location) => location.checkoutNonce === nonce) &&
|
|
357
|
+
!previous().some((location) => location.checkoutNonce === nonce)) {
|
|
358
|
+
return 'promote';
|
|
359
|
+
}
|
|
360
|
+
return 'candidate';
|
|
361
|
+
}
|
|
362
|
+
if (nonce === null)
|
|
363
|
+
return 'candidate';
|
|
364
|
+
return previous().some((location) => location.checkoutNonce === nonce) ? 'promote' : 'candidate';
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Record an UNCONFIRMED location of a project (T12470): the checkout declares
|
|
368
|
+
* the id, but nothing has confirmed it. The registry row, its path and its
|
|
369
|
+
* permissions are not touched, and no other project's claim on the path ends.
|
|
370
|
+
* A location that is already `live` stays `live`.
|
|
371
|
+
*
|
|
372
|
+
* @param db - Registry handle or transaction.
|
|
373
|
+
* @param record - The encountered checkout.
|
|
374
|
+
* @returns `true` when the candidate was recorded for the first time.
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```ts
|
|
378
|
+
* recordCandidateLocation(tx, { projectId, projectPath, now, evidence });
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
export function recordCandidateLocation(db, record) {
|
|
382
|
+
const deviceId = record.deviceId ?? currentDeviceId();
|
|
383
|
+
adoptLocalDeviceRows(db, deviceId);
|
|
384
|
+
const key = locationKey(record.projectId, deviceId, record.projectPath);
|
|
385
|
+
const existing = db
|
|
386
|
+
.select({ state: projectLocations.state })
|
|
387
|
+
.from(projectLocations)
|
|
388
|
+
.where(key)
|
|
389
|
+
.get();
|
|
390
|
+
const evidence = evidenceColumns(record.evidence);
|
|
391
|
+
if (!existing) {
|
|
392
|
+
db.insert(projectLocations)
|
|
393
|
+
.values({
|
|
394
|
+
projectId: record.projectId,
|
|
395
|
+
deviceId,
|
|
396
|
+
path: record.projectPath,
|
|
397
|
+
firstSeen: record.now,
|
|
398
|
+
lastSeen: record.now,
|
|
399
|
+
state: 'candidate',
|
|
400
|
+
...evidence,
|
|
401
|
+
})
|
|
402
|
+
.run();
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
// T12558: a `missing` location the project was explicitly moved AWAY from
|
|
406
|
+
// (reroot/move demoted it) stays `missing` while the project is live at
|
|
407
|
+
// another existing path on this device. A `git checkout -- .` at the old
|
|
408
|
+
// root restores the tracked id and makes every command an encounter here;
|
|
409
|
+
// flipping the row to `candidate` would disarm the store guard that refuses
|
|
410
|
+
// to create an empty store at a relocated root.
|
|
411
|
+
// Round 4: only in REROOT geometry (the live location is strictly inside
|
|
412
|
+
// this path) and only for a nonce-less encounter (restored tracked files —
|
|
413
|
+
// a real checkout carries its untracked nonce). Anywhere else a path that
|
|
414
|
+
// holds the project is a `candidate`, never stuck at `missing`.
|
|
415
|
+
const keepMissing = existing.state === 'missing' &&
|
|
416
|
+
(record.checkoutNonce ?? null) === null &&
|
|
417
|
+
hasOtherLiveLocation(db, record, deviceId);
|
|
418
|
+
db.update(projectLocations)
|
|
419
|
+
.set({
|
|
420
|
+
lastSeen: record.now,
|
|
421
|
+
...(existing.state === 'live' || keepMissing ? {} : { state: 'candidate' }),
|
|
422
|
+
...evidence,
|
|
423
|
+
})
|
|
424
|
+
.where(key)
|
|
425
|
+
.run();
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Whether `record.projectId` has a `live` location on this device STRICTLY
|
|
430
|
+
* INSIDE this path (the project was rerooted into it) that still PROVES it
|
|
431
|
+
* holds the project — the directory declares the same id. Mere existence is not enough: after a reroot is undone by hand
|
|
432
|
+
* the child directory still exists but no longer holds `.cleo/`, and the old
|
|
433
|
+
* root must then be able to become a location again (T12558 round 3).
|
|
434
|
+
*/
|
|
435
|
+
function hasOtherLiveLocation(db, record, deviceId) {
|
|
436
|
+
return db
|
|
437
|
+
.select({ path: projectLocations.path })
|
|
438
|
+
.from(projectLocations)
|
|
439
|
+
.where(and(eq(projectLocations.projectId, record.projectId), eq(projectLocations.deviceId, deviceId), eq(projectLocations.state, 'live'), ne(projectLocations.path, record.projectPath)))
|
|
440
|
+
.all()
|
|
441
|
+
.some((location) => isStrictlyInside(record.projectPath, location.path) &&
|
|
442
|
+
existsSync(location.path) &&
|
|
443
|
+
readDeclaredProjectIdentity(location.path)?.projectId === record.projectId);
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Demote a location this device no longer treats as the project's home
|
|
447
|
+
* (T12556 · T12558). `cleo project move` leaves the source tree behind as a
|
|
448
|
+
* `candidate` (it still declares the id but is no longer confirmed);
|
|
449
|
+
* `cleo project reroot` leaves the old root with no `.cleo/` at all, so it is
|
|
450
|
+
* `missing`. A location that was never recorded is recorded in that state so
|
|
451
|
+
* the history is complete. The registry row is not touched.
|
|
452
|
+
*
|
|
453
|
+
* @param db - Registry handle or transaction.
|
|
454
|
+
* @param record - The location to demote.
|
|
455
|
+
* @param state - `candidate` (still declares the id) or `missing` (does not).
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* ```ts
|
|
459
|
+
* demoteProjectLocation(tx, { projectId, projectPath: oldRoot, now }, 'missing');
|
|
460
|
+
* ```
|
|
461
|
+
*/
|
|
462
|
+
export function demoteProjectLocation(db, record, state) {
|
|
463
|
+
const deviceId = record.deviceId ?? currentDeviceId();
|
|
464
|
+
adoptLocalDeviceRows(db, deviceId);
|
|
465
|
+
db.insert(projectLocations)
|
|
466
|
+
.values({
|
|
467
|
+
projectId: record.projectId,
|
|
468
|
+
deviceId,
|
|
469
|
+
path: record.projectPath,
|
|
470
|
+
firstSeen: record.now,
|
|
471
|
+
lastSeen: record.now,
|
|
472
|
+
state,
|
|
473
|
+
})
|
|
474
|
+
.onConflictDoUpdate({
|
|
475
|
+
target: [projectLocations.projectId, projectLocations.deviceId, projectLocations.path],
|
|
476
|
+
set: { state },
|
|
477
|
+
})
|
|
478
|
+
.run();
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Refresh an already-confirmed location without repointing the registry row.
|
|
482
|
+
*
|
|
483
|
+
* @param db - Registry handle or transaction.
|
|
484
|
+
* @param record - The encountered checkout.
|
|
485
|
+
*/
|
|
486
|
+
export function touchProjectLocation(db, record) {
|
|
487
|
+
const deviceId = record.deviceId ?? currentDeviceId();
|
|
488
|
+
adoptLocalDeviceRows(db, deviceId);
|
|
489
|
+
db.update(projectLocations)
|
|
490
|
+
.set({ lastSeen: record.now, ...confirmedColumns(record) })
|
|
491
|
+
.where(locationKey(record.projectId, deviceId, record.projectPath))
|
|
492
|
+
.run();
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Explicitly confirm a checkout as a project's live location and point the
|
|
496
|
+
* registry row at it (T12470) — the promotion path for a `candidate` used by
|
|
497
|
+
* `cleo doctor project-identity --resolve`. Permissions stay on the row.
|
|
498
|
+
*
|
|
499
|
+
* @param db - Registry handle or transaction.
|
|
500
|
+
* @param record - The checkout to confirm.
|
|
501
|
+
* @returns `false` when the project has no registry row to point.
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* ```ts
|
|
505
|
+
* confirmProjectLocation(tx, { projectId, projectPath, now, evidence });
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
export function confirmProjectLocation(db, record) {
|
|
509
|
+
const row = db
|
|
510
|
+
.select({ projectId: projectRegistry.projectId })
|
|
511
|
+
.from(projectRegistry)
|
|
512
|
+
.where(eq(projectRegistry.projectId, record.projectId))
|
|
513
|
+
.get();
|
|
514
|
+
if (!row)
|
|
515
|
+
return false;
|
|
516
|
+
db.update(projectRegistry)
|
|
517
|
+
.set({
|
|
518
|
+
projectPath: record.projectPath,
|
|
519
|
+
projectHash: generateProjectHash(record.projectPath),
|
|
520
|
+
lastSeen: record.now,
|
|
521
|
+
brainDbPath: registryStorePath(record.projectPath),
|
|
522
|
+
tasksDbPath: registryStorePath(record.projectPath),
|
|
523
|
+
})
|
|
524
|
+
.where(eq(projectRegistry.projectId, record.projectId))
|
|
525
|
+
.run();
|
|
526
|
+
recordProjectCheckout(db, record);
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Keep at most one registry row per real path: move every OTHER project's
|
|
531
|
+
* registry row that still names `projectPath` to that project's most recent
|
|
532
|
+
* other live location on this device, or to its
|
|
533
|
+
* {@link supersededRegistryPath} sentinel when it has none.
|
|
534
|
+
*
|
|
535
|
+
* @param db - Registry handle or transaction.
|
|
536
|
+
* @param projectId - The project that now holds `projectPath`.
|
|
537
|
+
* @param projectPath - The path that changed hands.
|
|
538
|
+
* @param deviceId - This device's stable id.
|
|
539
|
+
* @param probed - Holdings probed before the transaction ({@link holdingKey}).
|
|
540
|
+
* @returns Number of registry rows re-homed.
|
|
541
|
+
*/
|
|
542
|
+
export function rehomeDisplacedRows(db, projectId, projectPath, deviceId, probed) {
|
|
543
|
+
const displaced = db
|
|
544
|
+
.select({ projectId: projectRegistry.projectId })
|
|
545
|
+
.from(projectRegistry)
|
|
546
|
+
.where(and(eq(projectRegistry.projectPath, projectPath), ne(projectRegistry.projectId, projectId)))
|
|
547
|
+
.all();
|
|
548
|
+
for (const row of displaced) {
|
|
549
|
+
const candidates = db
|
|
550
|
+
.select({ path: projectLocations.path })
|
|
551
|
+
.from(projectLocations)
|
|
552
|
+
.where(and(eq(projectLocations.projectId, row.projectId), eq(projectLocations.deviceId, deviceId), eq(projectLocations.state, 'live'), ne(projectLocations.path, projectPath)))
|
|
553
|
+
.orderBy(desc(projectLocations.lastSeen))
|
|
554
|
+
.all();
|
|
555
|
+
// A candidate must exist on disk and not already name another registry row.
|
|
556
|
+
// A pre-probed holding answers without touching the filesystem (T12471):
|
|
557
|
+
// only a location that still holds the displaced project may take its row.
|
|
558
|
+
const present = (path) => {
|
|
559
|
+
const holding = probed?.get(holdingKey(row.projectId, path));
|
|
560
|
+
return holding === undefined ? existsSync(path) : holding === 'yes';
|
|
561
|
+
};
|
|
562
|
+
const home = candidates.find((c) => present(c.path) &&
|
|
563
|
+
db
|
|
564
|
+
.select({ projectId: projectRegistry.projectId })
|
|
565
|
+
.from(projectRegistry)
|
|
566
|
+
.where(eq(projectRegistry.projectPath, c.path))
|
|
567
|
+
.all().length === 0)?.path;
|
|
568
|
+
const nextPath = home ?? supersededRegistryPath(row.projectId);
|
|
569
|
+
db.update(projectRegistry)
|
|
570
|
+
.set({
|
|
571
|
+
projectPath: nextPath,
|
|
572
|
+
projectHash: generateProjectHash(nextPath),
|
|
573
|
+
brainDbPath: home ? registryStorePath(home) : null,
|
|
574
|
+
tasksDbPath: home ? registryStorePath(home) : null,
|
|
575
|
+
})
|
|
576
|
+
.where(eq(projectRegistry.projectId, row.projectId))
|
|
577
|
+
.run();
|
|
55
578
|
}
|
|
56
|
-
return
|
|
579
|
+
return displaced.length;
|
|
57
580
|
}
|
|
58
581
|
/**
|
|
59
|
-
* List every recorded
|
|
582
|
+
* List every recorded location of a project, newest first.
|
|
60
583
|
*
|
|
61
584
|
* @param projectId - Immutable project id.
|
|
62
|
-
* @
|
|
63
|
-
*
|
|
585
|
+
* @param opts - `allDevices: true` includes other devices' locations; by
|
|
586
|
+
* default only this device's are listed.
|
|
587
|
+
* @returns Locations with their state and an `exists` flag (checked only for
|
|
588
|
+
* this device's rows; `false` for another device's).
|
|
64
589
|
* @example
|
|
65
590
|
* ```ts
|
|
66
591
|
* const checkouts = await listProjectCheckouts(projectId);
|
|
592
|
+
* const live = checkouts.filter((c) => c.state === 'live');
|
|
67
593
|
* ```
|
|
68
594
|
*/
|
|
69
|
-
export async function listProjectCheckouts(projectId) {
|
|
595
|
+
export async function listProjectCheckouts(projectId, opts = {}) {
|
|
70
596
|
const { getNexusRegistryDb } = await import('../store/nexus-sqlite.js');
|
|
71
597
|
const { getCleoHome } = await import('../paths.js');
|
|
72
598
|
const db = await getNexusRegistryDb(getCleoHome());
|
|
73
|
-
|
|
599
|
+
const deviceId = currentDeviceId();
|
|
600
|
+
const out = [];
|
|
601
|
+
for (const row of db
|
|
74
602
|
.select()
|
|
75
|
-
.from(
|
|
76
|
-
.where(eq(
|
|
77
|
-
.orderBy(desc(
|
|
78
|
-
.all()
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
603
|
+
.from(projectLocations)
|
|
604
|
+
.where(eq(projectLocations.projectId, projectId))
|
|
605
|
+
.orderBy(desc(projectLocations.lastSeen))
|
|
606
|
+
.all()) {
|
|
607
|
+
// Migration-backfilled rows are this device's until adopted.
|
|
608
|
+
const local = row.deviceId === deviceId || row.deviceId === LOCAL_DEVICE_SENTINEL;
|
|
609
|
+
if (!local && !opts.allDevices)
|
|
610
|
+
continue;
|
|
611
|
+
out.push({
|
|
612
|
+
projectPath: row.path,
|
|
613
|
+
projectHash: generateProjectHash(row.path),
|
|
614
|
+
firstSeen: row.firstSeen,
|
|
615
|
+
lastSeen: row.lastSeen,
|
|
616
|
+
exists: local && existsSync(row.path),
|
|
617
|
+
deviceId: local ? deviceId : row.deviceId,
|
|
618
|
+
state: row.state,
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
return out;
|
|
86
622
|
}
|
|
87
623
|
//# sourceMappingURL=path-map.js.map
|