@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/init.js
CHANGED
|
@@ -30,23 +30,47 @@
|
|
|
30
30
|
* @task T4707
|
|
31
31
|
* @epic T4663
|
|
32
32
|
*/
|
|
33
|
-
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
34
|
-
import { copyFile, lstat, mkdir, readFile, symlink, unlink, writeFile } from 'node:fs/promises';
|
|
33
|
+
import { copyFileSync, existsSync, constants as fsConstants, readdirSync, readFileSync, realpathSync, statSync, } from 'node:fs';
|
|
34
|
+
import { appendFile, copyFile, lstat, mkdir, readFile, symlink, unlink, writeFile, } from 'node:fs/promises';
|
|
35
35
|
import { platform } from 'node:os';
|
|
36
|
-
import { basename, dirname, join } from 'node:path';
|
|
36
|
+
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
37
37
|
import { ExitCode } from '@cleocode/contracts';
|
|
38
|
+
import { isAbsolutePath } from '@cleocode/paths';
|
|
38
39
|
import { classifyProject } from './discovery.js';
|
|
39
40
|
import { CleoError } from './errors.js';
|
|
40
|
-
import {
|
|
41
|
+
import { resolveGitDir, resolveHooksDir } from './git/hooks-install.js';
|
|
42
|
+
import { ensureGitHooks, MANAGED_HOOKS } from './hooks.js';
|
|
41
43
|
import { ensureInjection } from './injection.js';
|
|
42
44
|
import { writeMemoryBridge } from './memory/memory-bridge.js';
|
|
43
45
|
import { migrateAgentOutputs } from './migration/agent-outputs.js';
|
|
44
46
|
import { pushWarning } from './output.js';
|
|
45
|
-
import { getAgentsHome, getCleoDirAbsolute, getCleoHome, getProjectRoot, resolveCleoDir, } from './paths.js';
|
|
47
|
+
import { getAgentsHome, getCleoDir, getCleoDirAbsolute, getCleoHome, getProjectRoot, isGitLinkedCheckout, linkedWorktreeMainRoot, recordProjectEncounter, resolveCleoDir, worktreeScope, } from './paths.js';
|
|
48
|
+
import { captureProjectScope } from './project-scope.js';
|
|
46
49
|
// Shared utility imports
|
|
47
50
|
import { ensureBrainDb, ensureCleoGitRepo, ensureCleoOsHub, ensureCleoStructure, ensureConfig, ensureGitignore, ensureProjectContext, ensureProjectGitInitialCommit, ensureProjectInfo, ensureWorktreeInclude, getPackageRoot, removeCleoFromRootGitignore, } from './scaffold.js';
|
|
48
51
|
import { ensureGlobalSchemas } from './schema-management.js';
|
|
49
52
|
import { readJson } from './store/json.js';
|
|
53
|
+
/**
|
|
54
|
+
* Stable machine-readable codes for `cleo init` refusals (T12562). Carried in
|
|
55
|
+
* `CleoError.details.codeName` so the CLI and the dispatch engine can surface
|
|
56
|
+
* them instead of a generic `E_INTERNAL` / "use force=true".
|
|
57
|
+
*
|
|
58
|
+
* @task T12562
|
|
59
|
+
*/
|
|
60
|
+
export const INIT_ERROR_CODES = {
|
|
61
|
+
/** cwd is the initialized project root; `--force` re-initializes it. */
|
|
62
|
+
alreadyInitialized: 'E_ALREADY_INITIALIZED',
|
|
63
|
+
/** cwd is inside an ancestor project; init changed nothing. */
|
|
64
|
+
ancestorProject: 'E_INIT_ANCESTOR_PROJECT',
|
|
65
|
+
/** `--force` resolved to a root other than cwd. */
|
|
66
|
+
forceNotCwd: 'E_INIT_FORCE_NOT_CWD',
|
|
67
|
+
/** cwd is inside a linked git worktree; its project is the main checkout. */
|
|
68
|
+
inWorktree: 'E_INIT_IN_WORKTREE',
|
|
69
|
+
/** cwd is a submodule / separate-git-dir checkout under a CLEO project. */
|
|
70
|
+
gitlinkUnsupported: 'E_INIT_GITLINK_UNSUPPORTED',
|
|
71
|
+
/** The pre-`--force` snapshot could not be taken; nothing was changed. */
|
|
72
|
+
snapshotFailed: 'E_INIT_SNAPSHOT_FAILED',
|
|
73
|
+
};
|
|
50
74
|
// ── Helpers ──────────────────────────────────────────────────────────
|
|
51
75
|
/**
|
|
52
76
|
* Symlink type for directory symlinks.
|
|
@@ -271,7 +295,7 @@ export async function initMcpServer(_projectRoot, _created, _warnings) {
|
|
|
271
295
|
*/
|
|
272
296
|
export async function initCoreSkills(created, warnings) {
|
|
273
297
|
try {
|
|
274
|
-
const { getInstalledProviders,
|
|
298
|
+
const { getInstalledProviders, installResolvedSkill, registerSkillLibraryFromPath } = await import('@cleocode/caamp');
|
|
275
299
|
const providers = getInstalledProviders();
|
|
276
300
|
if (providers.length === 0) {
|
|
277
301
|
return;
|
|
@@ -335,7 +359,13 @@ export async function initCoreSkills(created, warnings) {
|
|
|
335
359
|
continue;
|
|
336
360
|
}
|
|
337
361
|
try {
|
|
338
|
-
|
|
362
|
+
// T12384: bundled skills pass the same gate as every other install.
|
|
363
|
+
const result = await installResolvedSkill({
|
|
364
|
+
localPath: skillSourceDir,
|
|
365
|
+
skillName: skill.name,
|
|
366
|
+
sourceValue: `library:${skill.name}`,
|
|
367
|
+
sourceType: 'library',
|
|
368
|
+
}, { providers, isGlobal: true });
|
|
339
369
|
if (result.success) {
|
|
340
370
|
installed.push(skill.name);
|
|
341
371
|
}
|
|
@@ -359,7 +389,7 @@ export async function initCoreSkills(created, warnings) {
|
|
|
359
389
|
* @task T4684
|
|
360
390
|
* @task T5368
|
|
361
391
|
*/
|
|
362
|
-
export async function initNexusRegistration(projectRoot, created, warnings) {
|
|
392
|
+
export async function initNexusRegistration(projectRoot, created, warnings, opts = {}) {
|
|
363
393
|
try {
|
|
364
394
|
const { shouldAutoRegisterProject } = await import('./nexus/registry-hygiene.js');
|
|
365
395
|
if (!shouldAutoRegisterProject(projectRoot, getCleoHome())) {
|
|
@@ -367,8 +397,26 @@ export async function initNexusRegistration(projectRoot, created, warnings) {
|
|
|
367
397
|
warnings.push('NEXUS registration skipped: project is under a temp directory (register explicitly with `cleo nexus register`)');
|
|
368
398
|
return;
|
|
369
399
|
}
|
|
400
|
+
if (opts.maintenance) {
|
|
401
|
+
// T12470: a maintenance command (`cleo upgrade` / `self-update`) is not
|
|
402
|
+
// an explicit registration. It goes through the encounter, which never
|
|
403
|
+
// mints an identity and never moves an existing row to this checkout.
|
|
404
|
+
const outcome = await recordProjectEncounter(projectRoot);
|
|
405
|
+
if (outcome === 'recorded')
|
|
406
|
+
created.push('NEXUS registration (encounter recorded)');
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
370
409
|
const { nexusReconcile } = await import('./nexus/registry.js');
|
|
371
|
-
const result = await nexusReconcile(projectRoot
|
|
410
|
+
const result = await nexusReconcile(projectRoot, {
|
|
411
|
+
...(opts.forceRebind ? { forceRebind: true } : {}),
|
|
412
|
+
});
|
|
413
|
+
if (result.status === 'candidate') {
|
|
414
|
+
warnings.push(`NEXUS registration: this project is registered at ${result.oldPath}, which still exists; ` +
|
|
415
|
+
'this checkout was recorded as a candidate and the registry was NOT repointed. ' +
|
|
416
|
+
'If this checkout should own the registration, run `cleo doctor project-identity --resolve` ' +
|
|
417
|
+
'or re-run with `--force-rebind`.');
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
372
420
|
if (result.status === 'auto_registered') {
|
|
373
421
|
created.push('NEXUS registration (auto-registered new project)');
|
|
374
422
|
}
|
|
@@ -533,6 +581,345 @@ export async function installHandoffRedirectStubs(projectRoot, created) {
|
|
|
533
581
|
}
|
|
534
582
|
}
|
|
535
583
|
// ── Public API ───────────────────────────────────────────────────────
|
|
584
|
+
/**
|
|
585
|
+
* Canonicalize a path for identity comparison, tolerating a missing path.
|
|
586
|
+
*
|
|
587
|
+
* @param path - Absolute path.
|
|
588
|
+
* @returns The realpath, or the resolved path when it cannot be read.
|
|
589
|
+
*/
|
|
590
|
+
function canonicalPath(path) {
|
|
591
|
+
try {
|
|
592
|
+
return realpathSync(path);
|
|
593
|
+
}
|
|
594
|
+
catch {
|
|
595
|
+
return resolve(path);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Report whether `child` lies strictly below `parent` (by canonical path).
|
|
600
|
+
*
|
|
601
|
+
* @param child - Candidate descendant.
|
|
602
|
+
* @param parent - Candidate ancestor.
|
|
603
|
+
* @returns `true` when `child` is inside `parent` and not equal to it.
|
|
604
|
+
*/
|
|
605
|
+
function isStrictlyInside(child, parent) {
|
|
606
|
+
const rel = relative(canonicalPath(parent), canonicalPath(child));
|
|
607
|
+
return rel !== '' && !rel.startsWith('..') && !isAbsolutePath(rel);
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* The CLEO project that encloses a gitlink checkout (submodule or
|
|
611
|
+
* separate-git-dir), or `undefined` when none does (T12562 · T12558 round 5).
|
|
612
|
+
*
|
|
613
|
+
* The walk starts at the gitlink's PARENT directory, never at the checkout
|
|
614
|
+
* itself: a `.cleo/` inside the checkout — tracked files, or the tombstone a
|
|
615
|
+
* reroot leaves — must not make it look self-contained, because project-root
|
|
616
|
+
* resolution walks past a gitlink root and would still use the enclosing
|
|
617
|
+
* store. A relocation refusal met on the way up is not an enclosing project.
|
|
618
|
+
*
|
|
619
|
+
* @param gitlinkRoot - Root of the gitlink checkout (its `.git` is a file).
|
|
620
|
+
* @returns The enclosing project root, or `undefined`.
|
|
621
|
+
*/
|
|
622
|
+
function enclosingProjectOfGitlink(gitlinkRoot) {
|
|
623
|
+
const parent = dirname(gitlinkRoot);
|
|
624
|
+
if (parent === gitlinkRoot)
|
|
625
|
+
return undefined;
|
|
626
|
+
try {
|
|
627
|
+
const root = getProjectRoot(parent);
|
|
628
|
+
return existsSync(join(root, '.cleo')) && isStrictlyInside(gitlinkRoot, root)
|
|
629
|
+
? root
|
|
630
|
+
: undefined;
|
|
631
|
+
}
|
|
632
|
+
catch {
|
|
633
|
+
return undefined;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Find the nearest git checkout boundary at or above `start`.
|
|
638
|
+
*
|
|
639
|
+
* @param start - Absolute directory to start from.
|
|
640
|
+
* @returns The nearest boundary, or `null` when no `.git` entry exists above.
|
|
641
|
+
*/
|
|
642
|
+
function findGitBoundary(start) {
|
|
643
|
+
let current = start;
|
|
644
|
+
while (true) {
|
|
645
|
+
const gitPath = join(current, '.git');
|
|
646
|
+
try {
|
|
647
|
+
const st = statSync(gitPath);
|
|
648
|
+
if (st.isDirectory())
|
|
649
|
+
return { root: current, kind: 'repo' };
|
|
650
|
+
if (st.isFile()) {
|
|
651
|
+
// A linked worktree shares its main checkout's project; a submodule or
|
|
652
|
+
// separate-git-dir gitlink is its own repository.
|
|
653
|
+
if (!isGitLinkedCheckout(current))
|
|
654
|
+
return { root: current, kind: 'submodule' };
|
|
655
|
+
const mainRoot = linkedWorktreeMainRoot(current);
|
|
656
|
+
return { root: current, kind: 'worktree', ...(mainRoot ? { mainRoot } : {}) };
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
catch {
|
|
660
|
+
// No `.git` here — keep walking.
|
|
661
|
+
}
|
|
662
|
+
const parent = dirname(current);
|
|
663
|
+
if (parent === current)
|
|
664
|
+
return null;
|
|
665
|
+
current = parent;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Choose the directory `cleo init` acts on (T12562).
|
|
670
|
+
*
|
|
671
|
+
* Every other command walks up from a subdirectory to the enclosing project,
|
|
672
|
+
* and keeps doing so. `init` is different because it CREATES a project, so the
|
|
673
|
+
* walk must not silently redirect it: from a child git repository nested under
|
|
674
|
+
* an initialized CLEO root the walk found the parent, and the guard then
|
|
675
|
+
* advised `--force` against the parent's store.
|
|
676
|
+
*
|
|
677
|
+
* Resolution order:
|
|
678
|
+
* 1. `--here` targets the working directory ({@link initProject} still refuses
|
|
679
|
+
* it inside a linked worktree).
|
|
680
|
+
* 2. An active worktree scope, an absolute `CLEO_DIR` or `CLEO_ROOT` /
|
|
681
|
+
* `CLEO_PROJECT_ROOT` pins the target explicitly (unchanged behaviour).
|
|
682
|
+
* 3. A working directory that is its own git root (`.git` is a directory)
|
|
683
|
+
* targets itself: a nested repository is a separate project. A gitlink
|
|
684
|
+
* checkout (linked worktree, submodule, separate-git-dir) does not, because
|
|
685
|
+
* project-root resolution cannot use a store there.
|
|
686
|
+
* 4. Otherwise the existing resolution applies. A plain (non-git)
|
|
687
|
+
* subdirectory of a CLEO project therefore still resolves to that ancestor;
|
|
688
|
+
* {@link initProject} reports it by absolute path and never wipes it.
|
|
689
|
+
*
|
|
690
|
+
* @param opts - `here` forces the working directory; `cwd` overrides `process.cwd()`.
|
|
691
|
+
* @returns The chosen target.
|
|
692
|
+
*
|
|
693
|
+
* @example
|
|
694
|
+
* ```ts
|
|
695
|
+
* resolveInitTarget(); // { projectRoot: '/repo/child', source: 'git-root', isCwd: true, ... }
|
|
696
|
+
* ```
|
|
697
|
+
*
|
|
698
|
+
* @task T12562
|
|
699
|
+
*/
|
|
700
|
+
export function resolveInitTarget(opts = {}) {
|
|
701
|
+
const cwd = resolve(opts.cwd ?? process.cwd()); // CWD-OK: init creates the project at cwd (T12562)
|
|
702
|
+
const cleoDirEnv = getCleoDir();
|
|
703
|
+
const relativeCleoDir = isAbsolutePath(cleoDirEnv) ? '.cleo' : cleoDirEnv;
|
|
704
|
+
const envPinned = isAbsolutePath(cleoDirEnv) ||
|
|
705
|
+
Boolean(process.env['CLEO_ROOT'] ?? process.env['CLEO_PROJECT_ROOT']);
|
|
706
|
+
const pinned = envPinned || worktreeScope.getStore() !== undefined;
|
|
707
|
+
const gitBoundary = findGitBoundary(cwd);
|
|
708
|
+
let cleoDir;
|
|
709
|
+
let source;
|
|
710
|
+
if (opts.here) {
|
|
711
|
+
cleoDir = resolve(cwd, relativeCleoDir);
|
|
712
|
+
source = 'here';
|
|
713
|
+
}
|
|
714
|
+
else if (pinned) {
|
|
715
|
+
// T9803/D009: `bootstrap` is the only sanctioned cwd-relative fallback.
|
|
716
|
+
cleoDir = getCleoDirAbsolute(opts.cwd, { bootstrap: true });
|
|
717
|
+
source = 'pinned';
|
|
718
|
+
}
|
|
719
|
+
else if (gitBoundary?.kind === 'repo' && gitBoundary.root === cwd) {
|
|
720
|
+
cleoDir = resolve(cwd, relativeCleoDir);
|
|
721
|
+
source = 'git-root';
|
|
722
|
+
}
|
|
723
|
+
else {
|
|
724
|
+
cleoDir = getCleoDirAbsolute(opts.cwd, { bootstrap: true });
|
|
725
|
+
source = 'resolved';
|
|
726
|
+
}
|
|
727
|
+
// `cleoDir` is `<root>/.cleo` by default, so its parent is the project root.
|
|
728
|
+
// This also respects an absolute `CLEO_DIR` used by the init-e2e suite.
|
|
729
|
+
const projectRoot = dirname(cleoDir);
|
|
730
|
+
let enclosingProjectRoot;
|
|
731
|
+
if (gitBoundary?.kind === 'submodule') {
|
|
732
|
+
enclosingProjectRoot = enclosingProjectOfGitlink(gitBoundary.root);
|
|
733
|
+
}
|
|
734
|
+
return {
|
|
735
|
+
cleoDir,
|
|
736
|
+
projectRoot,
|
|
737
|
+
cwd,
|
|
738
|
+
source,
|
|
739
|
+
isCwd: canonicalPath(projectRoot) === canonicalPath(cwd),
|
|
740
|
+
envPinned,
|
|
741
|
+
gitBoundary,
|
|
742
|
+
...(enclosingProjectRoot ? { enclosingProjectRoot } : {}),
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Return the stable init refusal code carried by `err`, if any (T12562).
|
|
747
|
+
*
|
|
748
|
+
* @param err - Error thrown by core `initProject`.
|
|
749
|
+
* @returns One of {@link INIT_ERROR_CODES}, or `undefined`.
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* ```ts
|
|
753
|
+
* initErrorCodeName(err); // 'E_INIT_ANCESTOR_PROJECT'
|
|
754
|
+
* ```
|
|
755
|
+
*
|
|
756
|
+
* @task T12562
|
|
757
|
+
*/
|
|
758
|
+
export function initErrorCodeName(err) {
|
|
759
|
+
if (!(err instanceof CleoError))
|
|
760
|
+
return undefined;
|
|
761
|
+
const codeName = err.details?.['codeName'];
|
|
762
|
+
const known = Object.values(INIT_ERROR_CODES);
|
|
763
|
+
return typeof codeName === 'string' && known.includes(codeName) ? codeName : undefined;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Build a `cleo init` refusal carrying its stable code in `details.codeName`.
|
|
767
|
+
*
|
|
768
|
+
* @param codeName - One of {@link INIT_ERROR_CODES}.
|
|
769
|
+
* @param message - Self-contained message; the CLI prints only this line.
|
|
770
|
+
* @param fix - Copy-paste remedy.
|
|
771
|
+
* @param details - Extra structured context.
|
|
772
|
+
* @returns The error to throw.
|
|
773
|
+
*/
|
|
774
|
+
function initRefusal(codeName, message, fix, details) {
|
|
775
|
+
return new CleoError(ExitCode.GENERAL_ERROR, message, {
|
|
776
|
+
fix,
|
|
777
|
+
details: { field: 'cwd', codeName, ...details },
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
/** What `--force` resets, stated once for every message that mentions it. */
|
|
781
|
+
const FORCE_RESETS = '--force resets .cleo/config.json and .cleo/project-info.json to defaults and rewrites ' +
|
|
782
|
+
'.cleo/.gitignore and the managed git hooks (commit-msg, pre-commit, pre-push); it deletes ' +
|
|
783
|
+
'no task, brain or conduit data. It first snapshots the databases (VACUUM INTO) and those ' +
|
|
784
|
+
'files into .cleo/backups/sqlite/ and refuses if the snapshot fails.';
|
|
785
|
+
/**
|
|
786
|
+
* Refuse any init that could touch a project other than the one the operator
|
|
787
|
+
* is standing in (T12562). Every refusal changes nothing.
|
|
788
|
+
*
|
|
789
|
+
* @param target - The resolved target.
|
|
790
|
+
* @param opts - The caller's init options.
|
|
791
|
+
* @param alreadyInitialized - Whether the target already holds a project.
|
|
792
|
+
* @throws {CleoError} With `details.codeName` from {@link INIT_ERROR_CODES}.
|
|
793
|
+
*/
|
|
794
|
+
function assertInitTargetAllowed(target, opts, alreadyInitialized) {
|
|
795
|
+
const { cwd, projectRoot: root, gitBoundary: git } = target;
|
|
796
|
+
const additiveMapOnly = opts.mapCodebase === true && !opts.force;
|
|
797
|
+
// A linked worktree shares its main checkout's project (D009 / T9803): a
|
|
798
|
+
// `.cleo/` inside it is an orphan store. Only an explicit env pin, or the
|
|
799
|
+
// additive map of the already-initialized main project, may proceed.
|
|
800
|
+
if (git?.kind === 'worktree' && !target.envPinned) {
|
|
801
|
+
const main = git.mainRoot;
|
|
802
|
+
const mapsMain = main !== undefined &&
|
|
803
|
+
additiveMapOnly &&
|
|
804
|
+
alreadyInitialized &&
|
|
805
|
+
canonicalPath(root) === canonicalPath(main);
|
|
806
|
+
if (!mapsMain) {
|
|
807
|
+
const whose = main ? ` of ${main}` : '';
|
|
808
|
+
throw initRefusal(INIT_ERROR_CODES.inWorktree, `${cwd} is inside a linked git worktree${whose}. A worktree shares its main ` +
|
|
809
|
+
`checkout's CLEO project, so there is nothing to init here, and a .cleo/ inside a ` +
|
|
810
|
+
'worktree would be an orphan store. Nothing was changed.' +
|
|
811
|
+
(main ? ` If ${main} is not a CLEO project yet, run \`cleo init\` there.` : ''), main
|
|
812
|
+
? `cd ${JSON.stringify(main)} && cleo init`
|
|
813
|
+
: 'Run `cleo init` in the main checkout (`git worktree list` names it).', { resolvedRoot: root, worktreeRoot: git.root, ...(main ? { mainRoot: main } : {}) });
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
// A submodule / separate-git-dir checkout under a CLEO project: project-root
|
|
817
|
+
// resolution walks past a gitlink root, so a store created here would be
|
|
818
|
+
// ignored and every later command would use the superproject's store.
|
|
819
|
+
const enclosing = target.enclosingProjectRoot;
|
|
820
|
+
if (git?.kind === 'submodule' &&
|
|
821
|
+
enclosing !== undefined &&
|
|
822
|
+
!target.envPinned &&
|
|
823
|
+
!(additiveMapOnly && !opts.here)) {
|
|
824
|
+
throw initRefusal(INIT_ERROR_CODES.gitlinkUnsupported, `${git.root} is a submodule / separate-git-dir checkout inside the CLEO project at ` +
|
|
825
|
+
`${enclosing}. CLEO resolves this checkout to ${enclosing}, so every command run here ` +
|
|
826
|
+
`already uses that project's store; a separate store for a gitlink checkout is not ` +
|
|
827
|
+
'supported yet (tracked separately). Nothing was changed.', `Use the project at ${enclosing} (run cleo from anywhere inside it).`, { resolvedRoot: root, repositoryRoot: git.root, enclosingProjectRoot: enclosing });
|
|
828
|
+
}
|
|
829
|
+
// An uninitialized repository between cwd and the ancestor project is the
|
|
830
|
+
// project the operator most likely meant: point there, not at cwd.
|
|
831
|
+
const nestedRepo = git?.kind === 'repo' && isStrictlyInside(git.root, root) ? git.root : undefined;
|
|
832
|
+
// Never advise --force against a root other than cwd (T12562 AC2).
|
|
833
|
+
const separateProjectFix = nestedRepo
|
|
834
|
+
? `cd ${JSON.stringify(nestedRepo)} && cleo init`
|
|
835
|
+
: `cd ${JSON.stringify(cwd)} && cleo init --here`;
|
|
836
|
+
if (opts.force && !target.isCwd) {
|
|
837
|
+
throw initRefusal(INIT_ERROR_CODES.forceNotCwd, `Refusing --force: it would re-initialize ${root}, which is not the current directory ` +
|
|
838
|
+
`(${cwd}). --force only ever acts on the current directory's own project. ` +
|
|
839
|
+
'Nothing was changed.', separateProjectFix, { field: 'force', resolvedRoot: root });
|
|
840
|
+
}
|
|
841
|
+
if (!alreadyInitialized || opts.force || additiveMapOnly)
|
|
842
|
+
return;
|
|
843
|
+
if (target.isCwd) {
|
|
844
|
+
throw initRefusal(INIT_ERROR_CODES.alreadyInitialized, `Project already initialized at ${root}. DANGER ZONE: ${FORCE_RESETS}`, 'cleo init --force', { resolvedRoot: root });
|
|
845
|
+
}
|
|
846
|
+
if (nestedRepo) {
|
|
847
|
+
throw initRefusal(INIT_ERROR_CODES.ancestorProject, `${cwd} is inside the git repository ${nestedRepo}, which is not a CLEO project yet; ` +
|
|
848
|
+
`the nearest CLEO project is ${root}. Nothing was changed. To make that repository ` +
|
|
849
|
+
`its own project, run \`cleo init\` in ${nestedRepo}.`, separateProjectFix, { resolvedRoot: root, repositoryRoot: nestedRepo });
|
|
850
|
+
}
|
|
851
|
+
throw initRefusal(INIT_ERROR_CODES.ancestorProject, `${cwd} is inside the CLEO project already initialized at ${root}. Nothing was ` +
|
|
852
|
+
`changed. To create a separate project in ${cwd}, run \`cleo init --here\` there.`, separateProjectFix, { resolvedRoot: root, source: target.source });
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Every managed git hook a forced re-init could overwrite, as snapshot sources.
|
|
856
|
+
*
|
|
857
|
+
* `ensureGitHooks({ force })` writes `<root>/.git/hooks`. The hooks git
|
|
858
|
+
* actually runs may live elsewhere (a gitlink checkout's git dir, or a custom
|
|
859
|
+
* `core.hooksPath`), so that directory is resolved too and snapshotted when it
|
|
860
|
+
* differs (T12562).
|
|
861
|
+
*
|
|
862
|
+
* @param projRoot - Absolute project root.
|
|
863
|
+
* @returns `[label, sourcePath]` pairs for the snapshot.
|
|
864
|
+
*/
|
|
865
|
+
function managedHookSnapshotSources(projRoot) {
|
|
866
|
+
const literal = join(projRoot, '.git', 'hooks');
|
|
867
|
+
const gitDir = resolveGitDir(projRoot);
|
|
868
|
+
const effective = gitDir ? resolveHooksDir(projRoot, gitDir) : literal;
|
|
869
|
+
const dirs = [['git-hook', literal]];
|
|
870
|
+
if (canonicalPath(effective) !== canonicalPath(literal))
|
|
871
|
+
dirs.push(['hooks-path', effective]);
|
|
872
|
+
return dirs.flatMap(([prefix, dir]) => MANAGED_HOOKS.map((h) => [`${prefix}-${h}`, join(dir, h)]));
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Snapshot everything a forced re-init overwrites, and refuse to continue
|
|
876
|
+
* without a complete snapshot (T12562).
|
|
877
|
+
*
|
|
878
|
+
* Uses the `cleo backup add` path ({@link createBackup}): `VACUUM INTO` for the
|
|
879
|
+
* databases and atomic copies of `config.json` / `project-info.json`, with a
|
|
880
|
+
* restorable `<backupId>.meta.json` sidecar (`cleo restore backup`). The other
|
|
881
|
+
* files `--force` rewrites (`.cleo/.gitignore`, `.cleo/project-context.json`,
|
|
882
|
+
* the managed git hooks) are copied beside it as `<name>.<backupId>`.
|
|
883
|
+
*
|
|
884
|
+
* @param projRoot - Absolute project root being re-initialized.
|
|
885
|
+
* @param cleoDir - Absolute `.cleo/` directory of that root.
|
|
886
|
+
* @returns The backup id written by THIS run.
|
|
887
|
+
* @throws {CleoError} `E_INIT_SNAPSHOT_FAILED` when any required file is missing
|
|
888
|
+
* from this run's snapshot.
|
|
889
|
+
*/
|
|
890
|
+
async function snapshotBeforeForcedReinit(projRoot, cleoDir) {
|
|
891
|
+
const { createBackup } = await import('./system/backup.js');
|
|
892
|
+
const result = await createBackup(projRoot, {
|
|
893
|
+
type: 'pre-force-init',
|
|
894
|
+
note: 'taken by `cleo init --force` before it resets project files (T12562)',
|
|
895
|
+
});
|
|
896
|
+
const required = ['config.json', 'project-info.json'].filter((f) => existsSync(join(cleoDir, f)));
|
|
897
|
+
// `tasks.db` is createBackup's label for the live project store (cleo.db).
|
|
898
|
+
if (existsSync(join(cleoDir, 'cleo.db')) || existsSync(join(cleoDir, 'tasks.db'))) {
|
|
899
|
+
required.push('tasks.db');
|
|
900
|
+
}
|
|
901
|
+
const missing = required.filter((f) => !result.files.includes(f));
|
|
902
|
+
const extras = [
|
|
903
|
+
['.gitignore', join(cleoDir, '.gitignore')],
|
|
904
|
+
['project-context.json', join(cleoDir, 'project-context.json')],
|
|
905
|
+
...managedHookSnapshotSources(projRoot),
|
|
906
|
+
];
|
|
907
|
+
for (const [label, src] of extras) {
|
|
908
|
+
if (!existsSync(src))
|
|
909
|
+
continue;
|
|
910
|
+
try {
|
|
911
|
+
copyFileSync(src, join(result.path, `${label}.${result.backupId}`), fsConstants.COPYFILE_EXCL);
|
|
912
|
+
}
|
|
913
|
+
catch {
|
|
914
|
+
missing.push(label);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (missing.length > 0) {
|
|
918
|
+
throw initRefusal(INIT_ERROR_CODES.snapshotFailed, `Refusing --force: the pre-reset snapshot of ${projRoot} is incomplete (missing: ` +
|
|
919
|
+
`${missing.join(', ')}). Nothing was changed. Run \`cleo backup add\`, then retry.`, 'cleo backup add', { field: 'force', resolvedRoot: projRoot, missing, backupId: result.backupId });
|
|
920
|
+
}
|
|
921
|
+
return result.backupId;
|
|
922
|
+
}
|
|
536
923
|
/**
|
|
537
924
|
* Run update-docs only: refresh all injections without reinitializing.
|
|
538
925
|
* Re-injects CLEO-INJECTION.md into all detected agent instruction files.
|
|
@@ -563,6 +950,33 @@ export async function updateDocs() {
|
|
|
563
950
|
updateDocsOnly: true,
|
|
564
951
|
};
|
|
565
952
|
}
|
|
953
|
+
/**
|
|
954
|
+
* Remove the identity files a relocated project left (or `git checkout`
|
|
955
|
+
* restored) at `root`, so `cleo init --here --new-identity` mints a new id
|
|
956
|
+
* instead of adopting the old one: `.cleo/project-id` and
|
|
957
|
+
* `.cleo/project-info.json` only when they declare `projectId`, and the reroot
|
|
958
|
+
* tombstone. Nothing else is touched.
|
|
959
|
+
*/
|
|
960
|
+
async function retireRelocatedIdentity(root, projectId) {
|
|
961
|
+
const { readPortableProjectId } = await import('@cleocode/paths');
|
|
962
|
+
const tracked = readPortableProjectId(root);
|
|
963
|
+
if (tracked.status === 'valid' && tracked.projectId === projectId) {
|
|
964
|
+
await unlink(join(root, '.cleo', 'project-id'));
|
|
965
|
+
}
|
|
966
|
+
const infoPath = join(root, '.cleo', 'project-info.json');
|
|
967
|
+
if (existsSync(infoPath)) {
|
|
968
|
+
try {
|
|
969
|
+
const info = JSON.parse(await readFile(infoPath, 'utf-8'));
|
|
970
|
+
if (info.projectId === projectId)
|
|
971
|
+
await unlink(infoPath);
|
|
972
|
+
}
|
|
973
|
+
catch {
|
|
974
|
+
// Unparseable: ensureProjectInfo regenerates it.
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
const { PROJECT_TOMBSTONE_FILE } = await import('./project-tombstone.js');
|
|
978
|
+
await unlink(join(root, PROJECT_TOMBSTONE_FILE)).catch(() => undefined);
|
|
979
|
+
}
|
|
566
980
|
/**
|
|
567
981
|
* Run full project initialization.
|
|
568
982
|
*
|
|
@@ -580,43 +994,109 @@ export async function updateDocs() {
|
|
|
580
994
|
* @task T4707
|
|
581
995
|
*/
|
|
582
996
|
export async function initProject(opts = {}) {
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
|
|
588
|
-
const cleoDir
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
//
|
|
592
|
-
//
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
//
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
997
|
+
// T12562: choose the target explicitly instead of trusting the ancestor
|
|
998
|
+
// walk. From a child git repo under an initialized CLEO root the walk
|
|
999
|
+
// resolved the PARENT, the guard below then advised `--force`, and following
|
|
1000
|
+
// that advice re-initialized the parent store.
|
|
1001
|
+
const target = resolveInitTarget({ here: opts.here });
|
|
1002
|
+
const { cleoDir, projectRoot: projRoot } = target;
|
|
1003
|
+
// T12558: relocation state, detected WITHOUT writing or throwing yet.
|
|
1004
|
+
// Resolving from the target reports E_PROJECT_MOVED at a valid reroot
|
|
1005
|
+
// tombstone (at the target or an ancestor it would resolve to); the store
|
|
1006
|
+
// guard's registry arm is checked up front for the same reason.
|
|
1007
|
+
let movedOnResolve;
|
|
1008
|
+
if (!opts.here) {
|
|
1009
|
+
try {
|
|
1010
|
+
getProjectRoot(projRoot);
|
|
1011
|
+
}
|
|
1012
|
+
catch (err) {
|
|
1013
|
+
if (err instanceof CleoError && err.code === ExitCode.PROJECT_MOVED)
|
|
1014
|
+
movedOnResolve = err;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
const { detectRelocatedRoot, allowStoreAtRelocatedRoot } = await import('./store/relocated-store-guard.js');
|
|
1018
|
+
const { resolveDualScopeDbPath } = await import('./store/dual-scope-db.js');
|
|
1019
|
+
const relocated = existsSync(join(cleoDir, 'cleo.db'))
|
|
1020
|
+
? null
|
|
1021
|
+
: detectRelocatedRoot(projRoot, resolveDualScopeDbPath('global'));
|
|
1022
|
+
// T12562: legacy `tasks.db` counts too, so a forced re-init snapshots it.
|
|
1023
|
+
// T12558: at a relocated root (no store) restored tracked files never count,
|
|
1024
|
+
// so #1605's guard never answers "already initialized — use --force" there.
|
|
1025
|
+
const alreadyInitialized = !relocated &&
|
|
1026
|
+
existsSync(cleoDir) &&
|
|
1027
|
+
(existsSync(join(cleoDir, 'cleo.db')) ||
|
|
1028
|
+
existsSync(join(cleoDir, 'tasks.db')) ||
|
|
1029
|
+
existsSync(join(cleoDir, 'config.json')));
|
|
1030
|
+
// #1605's target refusals (worktree, gitlink, force-not-cwd, ancestor) run
|
|
1031
|
+
// FIRST: a relocation opt-out can never reopen a target CLEO cannot use.
|
|
1032
|
+
assertInitTargetAllowed(target, opts, alreadyInitialized);
|
|
1033
|
+
// T12558: relocation refusals, still before any write.
|
|
1034
|
+
if (movedOnResolve)
|
|
1035
|
+
throw movedOnResolve;
|
|
1036
|
+
if (relocated && !opts.here) {
|
|
1037
|
+
const { projectMovedError } = await import('./project-tombstone.js');
|
|
1038
|
+
throw projectMovedError(projRoot, relocated, undefined, relocated.via);
|
|
1039
|
+
}
|
|
1040
|
+
// `--here` alone would ADOPT the relocated project's id and create a SECOND
|
|
1041
|
+
// store for it — two diverging copies of one project. Only a genuinely
|
|
1042
|
+
// separate project (a new id) may start here.
|
|
1043
|
+
if (relocated && !opts.newIdentity) {
|
|
1044
|
+
throw new CleoError(ExitCode.PROJECT_MOVED, `E_PROJECT_MOVED: ${projRoot} is where project ${relocated.projectId} was rerooted from; \`--here\` alone would create a second store for that same project`, {
|
|
1045
|
+
fix: `cd "${relocated.movedTo}" (the live project). To start a DIFFERENT project here, run \`cleo init --here --new-identity\` (mints a new id; commit the new .cleo/project-id).`,
|
|
1046
|
+
details: {
|
|
1047
|
+
field: 'projectRoot',
|
|
1048
|
+
projectId: relocated.projectId,
|
|
1049
|
+
movedFrom: projRoot,
|
|
1050
|
+
movedTo: relocated.movedTo,
|
|
1051
|
+
evidence: relocated.via,
|
|
1052
|
+
},
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
// T12558: `--here --new-identity` at a relocated root — every refusal has
|
|
1056
|
+
// passed. The restored `.cleo/project-id` (and a stale tombstone) belong to
|
|
1057
|
+
// the relocated project; retire them so a new id is minted, not adopted.
|
|
1058
|
+
let retiredProjectId;
|
|
1059
|
+
if (relocated) {
|
|
1060
|
+
allowStoreAtRelocatedRoot(projRoot);
|
|
1061
|
+
retiredProjectId = relocated.projectId;
|
|
1062
|
+
await retireRelocatedIdentity(projRoot, relocated.projectId);
|
|
1063
|
+
const auditPath = join(cleoDir, 'audit', 'relocation-override.jsonl');
|
|
1064
|
+
await mkdir(dirname(auditPath), { recursive: true });
|
|
1065
|
+
await appendFile(auditPath, `${JSON.stringify({
|
|
1066
|
+
timestamp: new Date().toISOString(),
|
|
1067
|
+
action: 'init --here --new-identity',
|
|
1068
|
+
projectRoot: projRoot,
|
|
1069
|
+
projectId: relocated.projectId,
|
|
1070
|
+
movedTo: relocated.movedTo,
|
|
1071
|
+
evidence: relocated.via,
|
|
1072
|
+
newIdentity: true,
|
|
1073
|
+
})}\n`);
|
|
617
1074
|
}
|
|
618
1075
|
const force = !!opts.force;
|
|
1076
|
+
const scope = captureProjectScope(projRoot, worktreeScope.getStore());
|
|
1077
|
+
let preForceBackupId;
|
|
1078
|
+
if (force && alreadyInitialized) {
|
|
1079
|
+
preForceBackupId = await worktreeScope.run(scope, () => snapshotBeforeForcedReinit(projRoot, cleoDir));
|
|
1080
|
+
}
|
|
1081
|
+
// Pin every ambient `getProjectRoot()` / `getCleoDirAbsolute()` inside the
|
|
1082
|
+
// scaffolding steps to the chosen target, so none of them walks back up to
|
|
1083
|
+
// an ancestor project while the target's `.cleo/` is still being created.
|
|
1084
|
+
return worktreeScope.run(scope, () => scaffoldInitTarget(opts, { cleoDir, projRoot, force, preForceBackupId, retiredProjectId }));
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Run the scaffolding half of {@link initProject} against an already-chosen,
|
|
1088
|
+
* already-guarded target.
|
|
1089
|
+
*
|
|
1090
|
+
* @param opts - The caller's init options.
|
|
1091
|
+
* @param target - Resolved `.cleo/` directory, project root, force flag and pre-force backup id.
|
|
1092
|
+
* @returns The init result.
|
|
1093
|
+
*/
|
|
1094
|
+
async function scaffoldInitTarget(opts, target) {
|
|
1095
|
+
const { cleoDir, projRoot, force, retiredProjectId } = target;
|
|
619
1096
|
const created = [];
|
|
1097
|
+
if (target.preForceBackupId) {
|
|
1098
|
+
created.push(`pre-force snapshot: .cleo/backups/sqlite/*.${target.preForceBackupId} (cleo restore backup)`);
|
|
1099
|
+
}
|
|
620
1100
|
const skipped = [];
|
|
621
1101
|
const warnings = [];
|
|
622
1102
|
// Phase 5 — classify the directory BEFORE creating any files so the
|
|
@@ -648,6 +1128,9 @@ export async function initProject(opts = {}) {
|
|
|
648
1128
|
created.push('tasks.db');
|
|
649
1129
|
}
|
|
650
1130
|
catch (err) {
|
|
1131
|
+
// A relocated root is a refusal, never a store "deferred" behind success.
|
|
1132
|
+
if (err instanceof CleoError && err.code === ExitCode.PROJECT_MOVED)
|
|
1133
|
+
throw err;
|
|
651
1134
|
// SQLite init failure is not fatal — will be created on first access
|
|
652
1135
|
created.push(`tasks.db (deferred: ${err instanceof Error ? err.message : String(err)})`);
|
|
653
1136
|
}
|
|
@@ -821,6 +1304,12 @@ export async function initProject(opts = {}) {
|
|
|
821
1304
|
/re-linked|conflict|invalid|coverage missing/.test(projectInfoResult.details)) {
|
|
822
1305
|
warnings.push(`Project identity: ${projectInfoResult.details}`);
|
|
823
1306
|
}
|
|
1307
|
+
if (retiredProjectId) {
|
|
1308
|
+
warnings.push(`.cleo/project-id changed: this is a NEW project, not ${retiredProjectId} (which lives on elsewhere). Commit the new .cleo/project-id.`);
|
|
1309
|
+
// Both projects are registered under this directory's name; say so rather
|
|
1310
|
+
// than rename either one behind the operator's back.
|
|
1311
|
+
warnings.push(`Project name "${basename(projRoot)}" is now ambiguous: ${retiredProjectId} was registered under the same name. Rename this one with \`cleo project rename <new-name>\`.`);
|
|
1312
|
+
}
|
|
824
1313
|
// Project context detection (always run during init)
|
|
825
1314
|
try {
|
|
826
1315
|
const detectResult = await ensureProjectContext(projRoot, { force: !!opts.detect });
|
|
@@ -884,7 +1373,9 @@ export async function initProject(opts = {}) {
|
|
|
884
1373
|
// Note: Core skills installation is global-only (bootstrapGlobalCleo / installSkillsGlobally).
|
|
885
1374
|
// Skills are NOT installed during project-level init — they are installed once globally.
|
|
886
1375
|
// T4684: NEXUS registration (reconcile-based handshake, T5368)
|
|
887
|
-
await initNexusRegistration(projRoot, created, warnings
|
|
1376
|
+
await initNexusRegistration(projRoot, created, warnings, {
|
|
1377
|
+
...(opts.forceRebind ? { forceRebind: true } : {}),
|
|
1378
|
+
});
|
|
888
1379
|
// T5240: Adapter discovery, activation, and install
|
|
889
1380
|
try {
|
|
890
1381
|
const { AdapterManager } = await import('./adapters/index.js');
|