@cleocode/core 2026.9.23 → 2026.9.25
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/admin/import-tasks.d.ts.map +1 -1
- package/dist/admin/import-tasks.js +35 -6
- package/dist/admin/import-tasks.js.map +1 -1
- package/dist/admin/import.d.ts.map +1 -1
- package/dist/admin/import.js +25 -6
- package/dist/admin/import.js.map +1 -1
- package/dist/audit-prune.d.ts +32 -0
- package/dist/audit-prune.d.ts.map +1 -1
- package/dist/audit-prune.js +37 -3
- package/dist/audit-prune.js.map +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/cloud/crypto.d.ts +1 -2
- package/dist/cloud/crypto.d.ts.map +1 -1
- package/dist/cloud/crypto.js +1 -11
- package/dist/cloud/crypto.js.map +1 -1
- package/dist/cloud/http.d.ts +8 -0
- package/dist/cloud/http.d.ts.map +1 -1
- package/dist/cloud/http.js +8 -1
- package/dist/cloud/http.js.map +1 -1
- package/dist/cloud/index.d.ts +6 -1
- package/dist/cloud/index.d.ts.map +1 -1
- package/dist/cloud/index.js +6 -1
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/nexus-auth.d.ts +169 -0
- package/dist/cloud/nexus-auth.d.ts.map +1 -0
- package/dist/cloud/nexus-auth.js +372 -0
- package/dist/cloud/nexus-auth.js.map +1 -0
- package/dist/cloud/nexus-credentials.d.ts +188 -0
- package/dist/cloud/nexus-credentials.d.ts.map +1 -0
- package/dist/cloud/nexus-credentials.js +323 -0
- package/dist/cloud/nexus-credentials.js.map +1 -0
- package/dist/cloud/nexus-link.d.ts +85 -0
- package/dist/cloud/nexus-link.d.ts.map +1 -0
- package/dist/cloud/nexus-link.js +226 -0
- package/dist/cloud/nexus-link.js.map +1 -0
- package/dist/cloud/presence.d.ts +88 -0
- package/dist/cloud/presence.d.ts.map +1 -0
- package/dist/cloud/presence.js +137 -0
- package/dist/cloud/presence.js.map +1 -0
- package/dist/cloud/projects.d.ts +3 -1
- package/dist/cloud/projects.d.ts.map +1 -1
- package/dist/cloud/projects.js +4 -2
- package/dist/cloud/projects.js.map +1 -1
- package/dist/cloud/uuidv7.d.ts +9 -0
- package/dist/cloud/uuidv7.d.ts.map +1 -0
- package/dist/cloud/uuidv7.js +19 -0
- package/dist/cloud/uuidv7.js.map +1 -0
- package/dist/crypto/credentials.d.ts +14 -4
- package/dist/crypto/credentials.d.ts.map +1 -1
- package/dist/crypto/credentials.js +15 -1
- package/dist/crypto/credentials.js.map +1 -1
- package/dist/decide/bench/dataset.d.ts +125 -0
- package/dist/decide/bench/dataset.d.ts.map +1 -0
- package/dist/decide/bench/dataset.js +457 -0
- package/dist/decide/bench/dataset.js.map +1 -0
- package/dist/decide/bench/index.d.ts +23 -0
- package/dist/decide/bench/index.d.ts.map +1 -0
- package/dist/decide/bench/index.js +23 -0
- package/dist/decide/bench/index.js.map +1 -0
- package/dist/decide/bench/metrics.d.ts +55 -0
- package/dist/decide/bench/metrics.d.ts.map +1 -0
- package/dist/decide/bench/metrics.js +100 -0
- package/dist/decide/bench/metrics.js.map +1 -0
- package/dist/decide/bench/operation.d.ts +119 -0
- package/dist/decide/bench/operation.d.ts.map +1 -0
- package/dist/decide/bench/operation.js +171 -0
- package/dist/decide/bench/operation.js.map +1 -0
- package/dist/decide/bench/profiles.d.ts +102 -0
- package/dist/decide/bench/profiles.d.ts.map +1 -0
- package/dist/decide/bench/profiles.js +175 -0
- package/dist/decide/bench/profiles.js.map +1 -0
- package/dist/decide/bench/questions.d.ts +40 -0
- package/dist/decide/bench/questions.d.ts.map +1 -0
- package/dist/decide/bench/questions.js +107 -0
- package/dist/decide/bench/questions.js.map +1 -0
- package/dist/decide/bench/report.d.ts +21 -0
- package/dist/decide/bench/report.d.ts.map +1 -0
- package/dist/decide/bench/report.js +125 -0
- package/dist/decide/bench/report.js.map +1 -0
- package/dist/decide/bench/runner.d.ts +208 -0
- package/dist/decide/bench/runner.d.ts.map +1 -0
- package/dist/decide/bench/runner.js +336 -0
- package/dist/decide/bench/runner.js.map +1 -0
- package/dist/decide/bench/source.d.ts +21 -0
- package/dist/decide/bench/source.d.ts.map +1 -0
- package/dist/decide/bench/source.js +67 -0
- package/dist/decide/bench/source.js.map +1 -0
- package/dist/decide/bench/spot-check.d.ts +117 -0
- package/dist/decide/bench/spot-check.d.ts.map +1 -0
- package/dist/decide/bench/spot-check.js +221 -0
- package/dist/decide/bench/spot-check.js.map +1 -0
- package/dist/decide/bench/stats.d.ts +57 -0
- package/dist/decide/bench/stats.d.ts.map +1 -0
- package/dist/decide/bench/stats.js +82 -0
- package/dist/decide/bench/stats.js.map +1 -0
- package/dist/decide/bench/types.d.ts +216 -0
- package/dist/decide/bench/types.d.ts.map +1 -0
- package/dist/decide/bench/types.js +104 -0
- package/dist/decide/bench/types.js.map +1 -0
- package/dist/decide/client.d.ts +35 -1
- package/dist/decide/client.d.ts.map +1 -1
- package/dist/decide/client.js +135 -35
- package/dist/decide/client.js.map +1 -1
- package/dist/decide/credentials.d.ts +177 -17
- package/dist/decide/credentials.d.ts.map +1 -1
- package/dist/decide/credentials.js +505 -41
- package/dist/decide/credentials.js.map +1 -1
- package/dist/decide/index.d.ts +8 -8
- package/dist/decide/index.d.ts.map +1 -1
- package/dist/decide/index.js +8 -8
- package/dist/decide/index.js.map +1 -1
- package/dist/decide/jev-wire.d.ts +55 -19
- package/dist/decide/jev-wire.d.ts.map +1 -1
- package/dist/decide/jev-wire.js +116 -37
- package/dist/decide/jev-wire.js.map +1 -1
- package/dist/decide/operations.d.ts +63 -12
- package/dist/decide/operations.d.ts.map +1 -1
- package/dist/decide/operations.js +116 -58
- package/dist/decide/operations.js.map +1 -1
- package/dist/decide/provider-state.d.ts +85 -12
- package/dist/decide/provider-state.d.ts.map +1 -1
- package/dist/decide/provider-state.js +154 -21
- package/dist/decide/provider-state.js.map +1 -1
- package/dist/decide/provider.d.ts +5 -0
- package/dist/decide/provider.d.ts.map +1 -1
- package/dist/decide/provider.js.map +1 -1
- package/dist/decide/providers.d.ts +15 -2
- package/dist/decide/providers.d.ts.map +1 -1
- package/dist/decide/providers.js +22 -6
- package/dist/decide/providers.js.map +1 -1
- package/dist/decide/sites/registry.d.ts +22 -0
- package/dist/decide/sites/registry.d.ts.map +1 -1
- package/dist/decide/sites/registry.js +23 -0
- package/dist/decide/sites/registry.js.map +1 -1
- package/dist/decide/wizard.d.ts +12 -4
- package/dist/decide/wizard.d.ts.map +1 -1
- package/dist/decide/wizard.js +79 -26
- package/dist/decide/wizard.js.map +1 -1
- package/dist/dispatch/mvi-projection.d.ts +15 -2
- package/dist/dispatch/mvi-projection.d.ts.map +1 -1
- package/dist/dispatch/mvi-projection.js +73 -12
- package/dist/dispatch/mvi-projection.js.map +1 -1
- package/dist/docs/adr-allocator.d.ts +2 -2
- package/dist/docs/adr-allocator.d.ts.map +1 -1
- package/dist/docs/adr-allocator.js +17 -4
- package/dist/docs/adr-allocator.js.map +1 -1
- package/dist/docs/blob-consolidation.js +1 -1
- package/dist/docs/blob-consolidation.js.map +1 -1
- package/dist/docs/display-alias.d.ts +1 -1
- package/dist/docs/display-alias.d.ts.map +1 -1
- package/dist/docs/display-alias.js +7 -4
- package/dist/docs/display-alias.js.map +1 -1
- package/dist/docs/docs-inconsistency-detector.js +1 -1
- package/dist/docs/docs-inconsistency-detector.js.map +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +6 -1
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/export-document.js +18058 -14538
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/numbering.js +1 -1
- package/dist/docs/numbering.js.map +1 -1
- package/dist/docs/supersede.d.ts.map +1 -1
- package/dist/docs/supersede.js +6 -3
- package/dist/docs/supersede.js.map +1 -1
- package/dist/docs/version-ssot.js +1 -1
- package/dist/docs/version-ssot.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +39 -24
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/knowledge-summary.d.ts +10 -3
- package/dist/doctor/knowledge-summary.d.ts.map +1 -1
- package/dist/doctor/knowledge-summary.js +10 -3
- package/dist/doctor/knowledge-summary.js.map +1 -1
- package/dist/doctor/orphan-ac-bindings.d.ts +64 -0
- package/dist/doctor/orphan-ac-bindings.d.ts.map +1 -0
- package/dist/doctor/orphan-ac-bindings.js +59 -0
- package/dist/doctor/orphan-ac-bindings.js.map +1 -0
- package/dist/doctor/project-identity.d.ts +128 -37
- package/dist/doctor/project-identity.d.ts.map +1 -1
- package/dist/doctor/project-identity.js +476 -63
- package/dist/doctor/project-identity.js.map +1 -1
- package/dist/doctor/projects.d.ts.map +1 -1
- package/dist/doctor/projects.js +43 -29
- package/dist/doctor/projects.js.map +1 -1
- package/dist/doctor/row-identity.d.ts +31 -0
- package/dist/doctor/row-identity.d.ts.map +1 -0
- package/dist/doctor/row-identity.js +93 -0
- package/dist/doctor/row-identity.js.map +1 -0
- package/dist/doctor/twin-collapse.d.ts +108 -2
- package/dist/doctor/twin-collapse.d.ts.map +1 -1
- package/dist/doctor/twin-collapse.js +309 -7
- package/dist/doctor/twin-collapse.js.map +1 -1
- package/dist/error-catalog.js +2 -2
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-registry.js +1 -1
- package/dist/error-registry.js.map +1 -1
- package/dist/gateway-client/generated/types.gen.d.ts +22 -2
- package/dist/gateway-client/generated/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +20 -11
- package/dist/init.js.map +1 -1
- package/dist/inject/index.d.ts.map +1 -1
- package/dist/inject/index.js +2 -3
- package/dist/inject/index.js.map +1 -1
- package/dist/internal.d.ts +5 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +6 -4
- package/dist/internal.js.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.d.ts.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.js +10 -0
- package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
- package/dist/llm/credential-remove-entry.d.ts +59 -0
- package/dist/llm/credential-remove-entry.d.ts.map +1 -0
- package/dist/llm/credential-remove-entry.js +101 -0
- package/dist/llm/credential-remove-entry.js.map +1 -0
- package/dist/llm/oauth/device-code.d.ts +26 -6
- package/dist/llm/oauth/device-code.d.ts.map +1 -1
- package/dist/llm/oauth/device-code.js +44 -12
- package/dist/llm/oauth/device-code.js.map +1 -1
- package/dist/llm/plugin-facade.js +18202 -14682
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/memory/attention.d.ts.map +1 -1
- package/dist/memory/attention.js +5 -3
- package/dist/memory/attention.js.map +1 -1
- package/dist/memory/decisions.d.ts +48 -3
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +98 -14
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +19 -10
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/learnings.d.ts +6 -6
- package/dist/memory/manifest-identity.d.ts +171 -0
- package/dist/memory/manifest-identity.d.ts.map +1 -0
- package/dist/memory/manifest-identity.js +345 -0
- package/dist/memory/manifest-identity.js.map +1 -0
- package/dist/memory/mental-model-queue.d.ts +14 -4
- package/dist/memory/mental-model-queue.d.ts.map +1 -1
- package/dist/memory/mental-model-queue.js +64 -35
- package/dist/memory/mental-model-queue.js.map +1 -1
- package/dist/memory/patterns.d.ts +4 -4
- package/dist/memory/pipeline-manifest-sqlite.d.ts +47 -5
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.js +130 -14
- package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +2 -0
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/memory/transcript-scanner.js +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.d.ts.map +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js +5 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js.map +1 -1
- package/dist/nexus/deps.d.ts.map +1 -1
- package/dist/nexus/deps.js +7 -14
- package/dist/nexus/deps.js.map +1 -1
- package/dist/nexus/discover.d.ts.map +1 -1
- package/dist/nexus/discover.js +6 -9
- package/dist/nexus/discover.js.map +1 -1
- package/dist/nexus/fleet-status.d.ts +83 -0
- package/dist/nexus/fleet-status.d.ts.map +1 -0
- package/dist/nexus/fleet-status.js +414 -0
- package/dist/nexus/fleet-status.js.map +1 -0
- package/dist/nexus/git-state.d.ts +15 -0
- package/dist/nexus/git-state.d.ts.map +1 -1
- package/dist/nexus/git-state.js +77 -3
- package/dist/nexus/git-state.js.map +1 -1
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +4 -0
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +4 -1
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +7 -1
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/migrate-json-to-sqlite.d.ts +3 -2
- package/dist/nexus/migrate-json-to-sqlite.d.ts.map +1 -1
- package/dist/nexus/migrate-json-to-sqlite.js +9 -17
- 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/project-activity.d.ts +104 -0
- package/dist/nexus/project-activity.d.ts.map +1 -0
- package/dist/nexus/project-activity.js +150 -0
- package/dist/nexus/project-activity.js.map +1 -0
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +22 -11
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/projects-scan.d.ts.map +1 -1
- package/dist/nexus/projects-scan.js +8 -13
- package/dist/nexus/projects-scan.js.map +1 -1
- package/dist/nexus/query.d.ts +2 -2
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +8 -31
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry-errors.d.ts +61 -0
- package/dist/nexus/registry-errors.d.ts.map +1 -0
- package/dist/nexus/registry-errors.js +85 -0
- package/dist/nexus/registry-errors.js.map +1 -0
- package/dist/nexus/registry-roots.d.ts +5 -2
- package/dist/nexus/registry-roots.d.ts.map +1 -1
- package/dist/nexus/registry-roots.js +8 -10
- package/dist/nexus/registry-roots.js.map +1 -1
- package/dist/nexus/registry.d.ts +48 -5
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +151 -85
- package/dist/nexus/registry.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts +4 -0
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +75 -12
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/query-ops.d.ts.map +1 -1
- package/dist/orchestrate/query-ops.js +29 -27
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +29 -3
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestrate/worktree-complete.d.ts.map +1 -1
- package/dist/orchestrate/worktree-complete.js +40 -2
- package/dist/orchestrate/worktree-complete.js.map +1 -1
- package/dist/orchestration/bootstrap.d.ts.map +1 -1
- package/dist/orchestration/bootstrap.js +20 -14
- package/dist/orchestration/bootstrap.js.map +1 -1
- package/dist/orchestration/index.d.ts +15 -1
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +25 -6
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/lead-rollup.d.ts +7 -1
- package/dist/orchestration/lead-rollup.d.ts.map +1 -1
- package/dist/orchestration/lead-rollup.js +6 -3
- package/dist/orchestration/lead-rollup.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts +26 -0
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +63 -92
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/waves.d.ts +21 -10
- package/dist/orchestration/waves.d.ts.map +1 -1
- package/dist/orchestration/waves.js +38 -35
- package/dist/orchestration/waves.js.map +1 -1
- package/dist/paths.d.ts +9 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +30 -13
- package/dist/paths.js.map +1 -1
- package/dist/phases/index.d.ts +1 -1
- package/dist/phases/index.d.ts.map +1 -1
- package/dist/phases/index.js +3 -4
- package/dist/phases/index.js.map +1 -1
- package/dist/project-info.d.ts +40 -3
- package/dist/project-info.d.ts.map +1 -1
- package/dist/project-info.js +74 -6
- package/dist/project-info.js.map +1 -1
- package/dist/project-lifecycle.d.ts +28 -7
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/project-lifecycle.js +114 -47
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/project-scope.d.ts +70 -3
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +154 -15
- package/dist/project-scope.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +190 -0
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +436 -4
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/release/open.d.ts +12 -2
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +32 -3
- package/dist/release/open.js.map +1 -1
- package/dist/release/preflight-skip.d.ts +73 -0
- package/dist/release/preflight-skip.d.ts.map +1 -0
- package/dist/release/preflight-skip.js +254 -0
- package/dist/release/preflight-skip.js.map +1 -0
- package/dist/render/decide/index.d.ts +51 -0
- package/dist/render/decide/index.d.ts.map +1 -0
- package/dist/render/decide/index.js +289 -0
- package/dist/render/decide/index.js.map +1 -0
- package/dist/render/index.d.ts +1 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts +5 -0
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +53 -0
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/scaffold/ensure-config.d.ts +14 -6
- package/dist/scaffold/ensure-config.d.ts.map +1 -1
- package/dist/scaffold/ensure-config.js +39 -17
- package/dist/scaffold/ensure-config.js.map +1 -1
- package/dist/scaffold/project-identity.d.ts +115 -23
- package/dist/scaffold/project-identity.d.ts.map +1 -1
- package/dist/scaffold/project-identity.js +196 -44
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/sdk/validator-ac-pull.d.ts.map +1 -1
- package/dist/sdk/validator-ac-pull.js +2 -1
- package/dist/sdk/validator-ac-pull.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +18221 -14701
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/cross-project-hygiene.d.ts +17 -6
- package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
- package/dist/sentient/cross-project-hygiene.js +22 -11
- package/dist/sentient/cross-project-hygiene.js.map +1 -1
- package/dist/sentient/propose-tick.d.ts.map +1 -1
- package/dist/sentient/propose-tick.js +2 -3
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sentient/stage-drift-tick.d.ts.map +1 -1
- package/dist/sentient/stage-drift-tick.js +2 -3
- package/dist/sentient/stage-drift-tick.js.map +1 -1
- package/dist/session/engine-ops.d.ts +13 -4
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +38 -45
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/briefing.d.ts +7 -3
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +10 -10
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/drift-watchdog.d.ts.map +1 -1
- package/dist/sessions/drift-watchdog.js +11 -19
- package/dist/sessions/drift-watchdog.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts +103 -26
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +166 -37
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/sessions/handoff.d.ts.map +1 -1
- package/dist/sessions/handoff.js +9 -18
- package/dist/sessions/handoff.js.map +1 -1
- package/dist/sessions/index.d.ts +4 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +35 -6
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-drift.d.ts.map +1 -1
- package/dist/sessions/session-drift.js +4 -2
- package/dist/sessions/session-drift.js.map +1 -1
- package/dist/sessions/session-view.d.ts +8 -1
- package/dist/sessions/session-view.d.ts.map +1 -1
- package/dist/sessions/session-view.js +9 -2
- package/dist/sessions/session-view.js.map +1 -1
- package/dist/setup/config-json-merge.d.ts.map +1 -1
- package/dist/setup/config-json-merge.js +1 -0
- package/dist/setup/config-json-merge.js.map +1 -1
- package/dist/setup/index.d.ts +4 -2
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js +6 -2
- package/dist/setup/index.js.map +1 -1
- package/dist/setup/sections/nexus-account.d.ts +32 -0
- package/dist/setup/sections/nexus-account.d.ts.map +1 -0
- package/dist/setup/sections/nexus-account.js +64 -0
- package/dist/setup/sections/nexus-account.js.map +1 -0
- package/dist/setup/wizard.d.ts +1 -1
- package/dist/setup/wizard.d.ts.map +1 -1
- package/dist/setup/wizard.js.map +1 -1
- package/dist/skills/manifests/research.js +2 -0
- package/dist/skills/manifests/research.js.map +1 -1
- package/dist/skills/orchestrator/startup.d.ts.map +1 -1
- package/dist/skills/orchestrator/startup.js +18 -31
- package/dist/skills/orchestrator/startup.js.map +1 -1
- package/dist/skills/orchestrator/validator.d.ts.map +1 -1
- package/dist/skills/orchestrator/validator.js +9 -2
- package/dist/skills/orchestrator/validator.js.map +1 -1
- package/dist/skills/validation.d.ts +4 -1
- package/dist/skills/validation.d.ts.map +1 -1
- package/dist/skills/validation.js +11 -3
- package/dist/skills/validation.js.map +1 -1
- package/dist/snapshot/index.d.ts.map +1 -1
- package/dist/snapshot/index.js +60 -53
- package/dist/snapshot/index.js.map +1 -1
- package/dist/spawn/agent-identity.d.ts +33 -1
- package/dist/spawn/agent-identity.d.ts.map +1 -1
- package/dist/spawn/agent-identity.js +53 -1
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts +111 -7
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +296 -8
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/spawn/index.d.ts +1 -1
- 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/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +3 -4
- package/dist/stats/index.js.map +1 -1
- package/dist/status/index.d.ts +12 -3
- package/dist/status/index.d.ts.map +1 -1
- package/dist/status/index.js +47 -5
- package/dist/status/index.js.map +1 -1
- package/dist/store/ac-binding-prune.d.ts +144 -0
- package/dist/store/ac-binding-prune.d.ts.map +1 -0
- package/dist/store/ac-binding-prune.js +293 -0
- package/dist/store/ac-binding-prune.js.map +1 -0
- package/dist/store/agent-registry-store.d.ts.map +1 -1
- package/dist/store/agent-registry-store.js +3 -2
- package/dist/store/agent-registry-store.js.map +1 -1
- package/dist/store/attachment-repair.d.ts.map +1 -1
- package/dist/store/attachment-repair.js +42 -3
- package/dist/store/attachment-repair.js.map +1 -1
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +30 -46
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/backup-recover-brain.d.ts +4 -0
- package/dist/store/backup-recover-brain.d.ts.map +1 -1
- package/dist/store/backup-recover-brain.js +2 -0
- package/dist/store/backup-recover-brain.js.map +1 -1
- package/dist/store/backup-recover.d.ts +9 -0
- package/dist/store/backup-recover.d.ts.map +1 -1
- package/dist/store/backup-recover.js +28 -1
- package/dist/store/backup-recover.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +115 -2
- package/dist/store/backup-sidecar.d.ts.map +1 -1
- package/dist/store/backup-sidecar.js +263 -3
- package/dist/store/backup-sidecar.js.map +1 -1
- package/dist/store/blob-keep.d.ts +135 -0
- package/dist/store/blob-keep.d.ts.map +1 -0
- package/dist/store/blob-keep.js +283 -0
- package/dist/store/blob-keep.js.map +1 -0
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +3 -2
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/converters.d.ts.map +1 -1
- package/dist/store/converters.js +11 -0
- package/dist/store/converters.js.map +1 -1
- package/dist/store/credential-transfer.d.ts +37 -5
- package/dist/store/credential-transfer.d.ts.map +1 -1
- package/dist/store/credential-transfer.js +76 -18
- package/dist/store/credential-transfer.js.map +1 -1
- 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.map +1 -1
- package/dist/store/db-helpers.d.ts +35 -11
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +107 -38
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/display-id-alias.d.ts +529 -0
- package/dist/store/display-id-alias.d.ts.map +1 -0
- package/dist/store/display-id-alias.js +1063 -0
- package/dist/store/display-id-alias.js.map +1 -0
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +21 -0
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts.map +1 -1
- package/dist/store/exodus/on-open.js +35 -0
- package/dist/store/exodus/on-open.js.map +1 -1
- package/dist/store/exodus/reconcile.d.ts.map +1 -1
- package/dist/store/exodus/reconcile.js +7 -2
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/recovery.d.ts.map +1 -1
- package/dist/store/exodus/recovery.js +20 -1
- package/dist/store/exodus/recovery.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +3 -3
- package/dist/store/exodus/runtime-targets.js +3 -3
- package/dist/store/import-remap.d.ts +12 -1
- package/dist/store/import-remap.d.ts.map +1 -1
- package/dist/store/import-remap.js +14 -0
- package/dist/store/import-remap.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts +3 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +22 -3
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/memory-accessor.js +1 -1
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/migration-manager.d.ts +61 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +102 -4
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/nexus-validation-schemas.d.ts +64 -0
- package/dist/store/nexus-validation-schemas.d.ts.map +1 -1
- package/dist/store/portable-bundle-import.d.ts +8 -0
- package/dist/store/portable-bundle-import.d.ts.map +1 -1
- package/dist/store/portable-bundle-import.js +10 -0
- package/dist/store/portable-bundle-import.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +1 -0
- 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 +15 -14
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/pre-repair-snapshot.d.ts +4 -1
- package/dist/store/pre-repair-snapshot.d.ts.map +1 -1
- package/dist/store/pre-repair-snapshot.js +5 -1
- package/dist/store/pre-repair-snapshot.js.map +1 -1
- package/dist/store/regenerators.d.ts +4 -2
- package/dist/store/regenerators.d.ts.map +1 -1
- package/dist/store/regenerators.js +7 -3
- package/dist/store/regenerators.js.map +1 -1
- package/dist/store/repair-malformed-dbs.d.ts +4 -0
- package/dist/store/repair-malformed-dbs.d.ts.map +1 -1
- package/dist/store/repair-malformed-dbs.js +3 -0
- package/dist/store/repair-malformed-dbs.js.map +1 -1
- package/dist/store/row-identity-flag.d.ts +26 -0
- package/dist/store/row-identity-flag.d.ts.map +1 -0
- package/dist/store/row-identity-flag.js +31 -0
- package/dist/store/row-identity-flag.js.map +1 -0
- package/dist/store/row-identity-registry.d.ts +61 -0
- package/dist/store/row-identity-registry.d.ts.map +1 -0
- package/dist/store/row-identity-registry.js +198 -0
- package/dist/store/row-identity-registry.js.map +1 -0
- package/dist/store/row-identity.d.ts +390 -0
- package/dist/store/row-identity.d.ts.map +1 -0
- package/dist/store/row-identity.js +1240 -0
- package/dist/store/row-identity.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +10 -3
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +15 -4
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +1 -1
- package/dist/store/schema/audit.d.ts +4 -4
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +49 -1
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +17 -0
- 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 +4 -4
- package/dist/store/schema/cleo-project/docs.d.ts +17 -1
- package/dist/store/schema/cleo-project/docs.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/docs.js +10 -0
- package/dist/store/schema/cleo-project/docs.js.map +1 -1
- package/dist/store/schema/cleo-project/lifecycle.d.ts +4 -4
- package/dist/store/schema/cleo-project/nexus-graph.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/runtime.d.ts +3 -3
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +87 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.js +35 -0
- package/dist/store/schema/cleo-project/tasks-core-batch2.js.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +263 -7
- package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/tasks-core.js +77 -2
- package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
- package/dist/store/schema/cleo-shared/brain.d.ts +7 -7
- package/dist/store/schema/lifecycle.d.ts +4 -4
- package/dist/store/schema/manifest.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts +6 -6
- package/dist/store/schema/nexus-schema.d.ts +51 -3
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +28 -7
- 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 +6 -6
- package/dist/store/session-store.d.ts +65 -0
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +108 -7
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/split-brain-import.d.ts +2 -14
- package/dist/store/split-brain-import.d.ts.map +1 -1
- package/dist/store/split-brain-import.js +4 -19
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +279 -2
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +789 -91
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +15 -3
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +52 -20
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/store-write-guard.d.ts +9 -3
- package/dist/store/store-write-guard.d.ts.map +1 -1
- package/dist/store/store-write-guard.js +25 -4
- package/dist/store/store-write-guard.js.map +1 -1
- package/dist/store/sync/clock-store.d.ts +67 -0
- package/dist/store/sync/clock-store.d.ts.map +1 -0
- package/dist/store/sync/clock-store.js +117 -0
- package/dist/store/sync/clock-store.js.map +1 -0
- package/dist/store/sync/flags.d.ts +51 -0
- package/dist/store/sync/flags.d.ts.map +1 -0
- package/dist/store/sync/flags.js +81 -0
- package/dist/store/sync/flags.js.map +1 -0
- package/dist/store/sync/hlc.d.ts +115 -0
- package/dist/store/sync/hlc.d.ts.map +1 -0
- package/dist/store/sync/hlc.js +172 -0
- package/dist/store/sync/hlc.js.map +1 -0
- package/dist/store/sync/index.d.ts +20 -0
- package/dist/store/sync/index.d.ts.map +1 -0
- package/dist/store/sync/index.js +20 -0
- package/dist/store/sync/index.js.map +1 -0
- package/dist/store/sync/replica-registry.d.ts +85 -0
- package/dist/store/sync/replica-registry.d.ts.map +1 -0
- package/dist/store/sync/replica-registry.js +147 -0
- package/dist/store/sync/replica-registry.js.map +1 -0
- package/dist/store/sync/replica.d.ts +181 -0
- package/dist/store/sync/replica.d.ts.map +1 -0
- package/dist/store/sync/replica.js +305 -0
- package/dist/store/sync/replica.js.map +1 -0
- package/dist/store/sync/schema.d.ts +68 -0
- package/dist/store/sync/schema.d.ts.map +1 -0
- package/dist/store/sync/schema.js +130 -0
- package/dist/store/sync/schema.js.map +1 -0
- package/dist/store/sync/skew-hold.d.ts +71 -0
- package/dist/store/sync/skew-hold.d.ts.map +1 -0
- package/dist/store/sync/skew-hold.js +89 -0
- package/dist/store/sync/skew-hold.js.map +1 -0
- package/dist/store/table-classification.d.ts +11 -9
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +127 -33
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/task-claim.d.ts +144 -0
- package/dist/store/task-claim.d.ts.map +1 -0
- package/dist/store/task-claim.js +195 -0
- package/dist/store/task-claim.js.map +1 -0
- package/dist/store/task-version.d.ts +43 -5
- package/dist/store/task-version.d.ts.map +1 -1
- package/dist/store/task-version.js +113 -17
- package/dist/store/task-version.js.map +1 -1
- package/dist/store/tasks-schema.d.ts +2 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +1 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +10 -2
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +450 -22
- package/dist/store/twin-collapse.d.ts.map +1 -1
- package/dist/store/twin-collapse.js +1552 -49
- package/dist/store/twin-collapse.js.map +1 -1
- package/dist/store/umbrella-data-accessor.d.ts +10 -3
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +14 -4
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +402 -50
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/store/with-retry.d.ts +36 -0
- package/dist/store/with-retry.d.ts.map +1 -1
- package/dist/store/with-retry.js +51 -0
- package/dist/store/with-retry.js.map +1 -1
- package/dist/store/worktree-build-guard.d.ts +13 -4
- package/dist/store/worktree-build-guard.d.ts.map +1 -1
- package/dist/store/worktree-build-guard.js +21 -10
- package/dist/store/worktree-build-guard.js.map +1 -1
- package/dist/store/worktree-isolation-guard.d.ts +121 -10
- package/dist/store/worktree-isolation-guard.d.ts.map +1 -1
- package/dist/store/worktree-isolation-guard.js +155 -34
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/system/backup.d.ts +7 -0
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +5 -0
- package/dist/system/backup.js.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +6 -1
- package/dist/system/health.js.map +1 -1
- package/dist/system/inject-generate.d.ts.map +1 -1
- package/dist/system/inject-generate.js +23 -10
- package/dist/system/inject-generate.js.map +1 -1
- package/dist/system/project-health.d.ts +17 -2
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +19 -6
- package/dist/system/project-health.js.map +1 -1
- package/dist/task-tools/index.d.ts +1 -1
- package/dist/task-tools/index.d.ts.map +1 -1
- package/dist/task-tools/index.js +1 -1
- package/dist/task-tools/index.js.map +1 -1
- package/dist/task-tools/score-task-priority.d.ts +38 -0
- package/dist/task-tools/score-task-priority.d.ts.map +1 -1
- package/dist/task-tools/score-task-priority.js +51 -0
- package/dist/task-tools/score-task-priority.js.map +1 -1
- package/dist/task-work/claims.d.ts +215 -0
- package/dist/task-work/claims.d.ts.map +1 -0
- package/dist/task-work/claims.js +272 -0
- package/dist/task-work/claims.js.map +1 -0
- package/dist/task-work/index.d.ts +47 -3
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +74 -41
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
- package/dist/tasks/ac-coverage-gate.js +3 -0
- package/dist/tasks/ac-coverage-gate.js.map +1 -1
- package/dist/tasks/ac-table.d.ts +35 -7
- package/dist/tasks/ac-table.d.ts.map +1 -1
- package/dist/tasks/ac-table.js +119 -14
- package/dist/tasks/ac-table.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +51 -4
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/analyze.d.ts.map +1 -1
- package/dist/tasks/analyze.js +3 -4
- package/dist/tasks/analyze.js.map +1 -1
- package/dist/tasks/backfill-child-projections.js +47 -6
- package/dist/tasks/backfill-child-projections.js.map +1 -1
- package/dist/tasks/change-set.d.ts +5 -0
- package/dist/tasks/change-set.d.ts.map +1 -1
- package/dist/tasks/change-set.js +59 -3
- package/dist/tasks/change-set.js.map +1 -1
- package/dist/tasks/complete.d.ts +16 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +33 -8
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/completion-evaluation.d.ts.map +1 -1
- package/dist/tasks/completion-evaluation.js +3 -0
- package/dist/tasks/completion-evaluation.js.map +1 -1
- package/dist/tasks/component-pr.d.ts +162 -1
- package/dist/tasks/component-pr.d.ts.map +1 -1
- package/dist/tasks/component-pr.js +560 -59
- package/dist/tasks/component-pr.js.map +1 -1
- package/dist/tasks/done-record.d.ts +14 -1
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +37 -0
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/duplicate-detector.d.ts +20 -1
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +10 -2
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/engine-wrap-ops.d.ts +19 -10
- package/dist/tasks/engine-wrap-ops.d.ts.map +1 -1
- package/dist/tasks/engine-wrap-ops.js +38 -10
- package/dist/tasks/engine-wrap-ops.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +14 -3
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/graph-ops.d.ts +9 -2
- package/dist/tasks/graph-ops.d.ts.map +1 -1
- package/dist/tasks/graph-ops.js +24 -32
- package/dist/tasks/graph-ops.js.map +1 -1
- package/dist/tasks/plan.d.ts.map +1 -1
- package/dist/tasks/plan.js +16 -60
- package/dist/tasks/plan.js.map +1 -1
- package/dist/tasks/task-context.d.ts.map +1 -1
- package/dist/tasks/task-context.js +13 -0
- package/dist/tasks/task-context.js.map +1 -1
- package/dist/tasks/task-import.d.ts.map +1 -1
- package/dist/tasks/task-import.js +21 -12
- package/dist/tasks/task-import.js.map +1 -1
- package/dist/tasks/task-next.d.ts +25 -2
- package/dist/tasks/task-next.d.ts.map +1 -1
- package/dist/tasks/task-next.js +32 -13
- package/dist/tasks/task-next.js.map +1 -1
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +7 -5
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +48 -9
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/compliance.d.ts +5 -1
- package/dist/validation/compliance.d.ts.map +1 -1
- package/dist/validation/compliance.js +24 -3
- package/dist/validation/compliance.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +20 -6
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +51 -8
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/protocol-common.d.ts +47 -2
- package/dist/validation/protocol-common.d.ts.map +1 -1
- package/dist/validation/protocol-common.js +86 -21
- package/dist/validation/protocol-common.js.map +1 -1
- package/dist/validation/validate-ops.d.ts.map +1 -1
- package/dist/validation/validate-ops.js +2 -3
- package/dist/validation/validate-ops.js.map +1 -1
- package/migrations/README.md +12 -0
- package/migrations/drizzle-cleo-global/20260929010000_t12512-registry-probed-opened/migration.sql +35 -0
- package/migrations/drizzle-cleo-global/20260929020000_t12721-git-state-head-committed-at/migration.sql +25 -0
- package/migrations/drizzle-cleo-project/20260928120000_t12341-row-uids/migration.sql +169 -0
- package/migrations/drizzle-cleo-project/20260929000000_t12535-docs-attachments-union-shape/migration.sql +21 -0
- package/migrations/drizzle-cleo-project/20260929120000_t12502-task-claim-leases/migration.sql +77 -0
- package/migrations/drizzle-cleo-project/20260929130000_t12736-claim-lease-iso-repair/migration.sql +37 -0
- package/migrations/sync-journal/20260929140000_t12342-sync-clock/migration.sql +42 -0
- package/package.json +23 -13
- package/schemas/project-info.schema.json +10 -4
- package/templates/CLEO-INJECTION.md +1 -1
- package/templates/CLEO-REFERENCE.md +7 -3
- package/templates/cleo-gitignore +11 -0
- package/templates/workflows/release-prepare.yml.tmpl +156 -10
|
@@ -39,13 +39,13 @@ export interface SearchLearningParams {
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function storeLearning(projectRoot: string, params: StoreLearningParams): Promise<{
|
|
41
41
|
applicableTypes: any;
|
|
42
|
-
source: string;
|
|
43
42
|
id: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
source: string;
|
|
44
45
|
confidence: number;
|
|
45
46
|
qualityScore: number | null;
|
|
46
|
-
createdAt: string;
|
|
47
47
|
updatedAt: string | null;
|
|
48
|
-
memoryTier: "
|
|
48
|
+
memoryTier: "medium" | "short" | "long" | null;
|
|
49
49
|
memoryType: "semantic" | "episodic" | "procedural" | null;
|
|
50
50
|
verified: boolean;
|
|
51
51
|
validAt: string;
|
|
@@ -97,13 +97,13 @@ export declare function storeLearning(projectRoot: string, params: StoreLearning
|
|
|
97
97
|
*/
|
|
98
98
|
export declare function searchLearnings(projectRoot: string, params?: SearchLearningParams): Promise<{
|
|
99
99
|
applicableTypes: any;
|
|
100
|
-
source: string;
|
|
101
100
|
id: string;
|
|
101
|
+
createdAt: string;
|
|
102
|
+
source: string;
|
|
102
103
|
confidence: number;
|
|
103
104
|
qualityScore: number | null;
|
|
104
|
-
createdAt: string;
|
|
105
105
|
updatedAt: string | null;
|
|
106
|
-
memoryTier: "
|
|
106
|
+
memoryTier: "medium" | "short" | "long" | null;
|
|
107
107
|
memoryType: "semantic" | "episodic" | "procedural" | null;
|
|
108
108
|
verified: boolean;
|
|
109
109
|
validAt: string;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest identity validation — the entry id, the linked task ids and the
|
|
3
|
+
* file reference of a `pipeline_manifest` entry (T12829).
|
|
4
|
+
*
|
|
5
|
+
* Before this module `cleo manifest append` stored whatever it was given: a
|
|
6
|
+
* `--task` of `T99999` (no such task), a 900-character JSON blob, or
|
|
7
|
+
* `../../x`. The shorthand builder turns `--task` into both the entry id and
|
|
8
|
+
* the `file` reference (`.cleo/agent-outputs/<task>-<type>-<stamp>.md`), and
|
|
9
|
+
* `cleo manifest show` reads `file` relative to the project root. So the blob
|
|
10
|
+
* became an unreadable path (ENAMETOOLONG), and a `../` task made `show` read
|
|
11
|
+
* a file outside the project. Nothing is written to that path; the defect is
|
|
12
|
+
* an unvalidated identity that later flows into a filesystem read.
|
|
13
|
+
*
|
|
14
|
+
* Every check here is pure except {@link findMissingLinkedTasks}, which reads
|
|
15
|
+
* the task store. Append rejects a problem before writing; show refuses a
|
|
16
|
+
* malformed id or unsafe file before touching the filesystem; `cleo doctor
|
|
17
|
+
* manifest-rows` reports rows stored before these checks existed.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
* @task T12829
|
|
21
|
+
*/
|
|
22
|
+
/** Longest accepted manifest entry id. */
|
|
23
|
+
export declare const MANIFEST_ENTRY_ID_MAX_LENGTH = 200;
|
|
24
|
+
/**
|
|
25
|
+
* Accepted manifest entry id characters: an alphanumeric first character,
|
|
26
|
+
* then alphanumerics and `.`, `_`, `:`, `@`, `+`, `-`. No path separator,
|
|
27
|
+
* whitespace or control character can appear, so an id can never name a
|
|
28
|
+
* path outside the directory it is joined onto.
|
|
29
|
+
*/
|
|
30
|
+
export declare const MANIFEST_ENTRY_ID_PATTERN: RegExp;
|
|
31
|
+
/** Longest accepted `file` reference. */
|
|
32
|
+
export declare const MANIFEST_FILE_MAX_LENGTH = 1024;
|
|
33
|
+
/** Longest accepted single path segment of a `file` reference (filesystem NAME_MAX). */
|
|
34
|
+
export declare const MANIFEST_FILE_SEGMENT_MAX_BYTES = 255;
|
|
35
|
+
/**
|
|
36
|
+
* Whether `value` is acceptable as a manifest linked task id: the canonical
|
|
37
|
+
* `T<digits>` shape, or a structured `T…` id CLEO mints and stores
|
|
38
|
+
* (`isStorableTaskId`, at most 64 characters, no whitespace or separators).
|
|
39
|
+
* A JSON blob, a path, or an over-long value is never accepted.
|
|
40
|
+
*
|
|
41
|
+
* @param value - Candidate task id.
|
|
42
|
+
* @returns `true` when the value can name a task.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isManifestTaskId(value: unknown): value is string;
|
|
45
|
+
/** One identity problem found in a manifest entry. */
|
|
46
|
+
export interface ManifestIdentityIssue {
|
|
47
|
+
/** The entry field at fault. */
|
|
48
|
+
field: 'id' | 'linked_tasks' | 'file';
|
|
49
|
+
/** `E_VALIDATION` for a malformed value; `E_NOT_FOUND` for a well-formed task id with no task. */
|
|
50
|
+
code: 'E_VALIDATION' | 'E_NOT_FOUND';
|
|
51
|
+
/** The offending value, truncated to 120 characters for display. */
|
|
52
|
+
value: string;
|
|
53
|
+
/** What is wrong. */
|
|
54
|
+
message: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Why a manifest entry id is unacceptable, or `null` when it is fine.
|
|
58
|
+
*
|
|
59
|
+
* @param id - Candidate entry id.
|
|
60
|
+
* @returns A reason, or `null`.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* manifestEntryIdProblem('T123-implementation-20260929'); // null
|
|
64
|
+
* manifestEntryIdProblem('../../x'); // 'must start with ...'
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function manifestEntryIdProblem(id: unknown): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* Why a manifest `file` reference is unsafe, or `null` when it is fine.
|
|
70
|
+
*
|
|
71
|
+
* Lexical checks only: an absolute, drive, UNC or backslash path is refused,
|
|
72
|
+
* and the reference joined onto `root` must stay inside `root`. A symbolic
|
|
73
|
+
* link inside the project can still point outside it, so every reader goes
|
|
74
|
+
* through {@link resolveContainedFile} / {@link readContainedFile}, which
|
|
75
|
+
* resolve real paths. URI references are left to `show`, which accepts only
|
|
76
|
+
* `cleo://docs/<reference>`.
|
|
77
|
+
*
|
|
78
|
+
* @param file - Candidate `file` value.
|
|
79
|
+
* @param root - Directory the reference is resolved against.
|
|
80
|
+
* @returns A reason, or `null`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function manifestFileProblem(file: unknown, root: string): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* Format checks for a manifest entry's id, linked task ids and file reference
|
|
85
|
+
* (an absent `file` is not checked). Pure: no store access. Pair with {@link findMissingLinkedTasks} to check
|
|
86
|
+
* that the linked tasks exist.
|
|
87
|
+
*
|
|
88
|
+
* @param entry - The entry's identity fields.
|
|
89
|
+
* @param root - Directory `file` is resolved against (the project root).
|
|
90
|
+
* @returns Every problem found; empty when the entry is well formed.
|
|
91
|
+
*/
|
|
92
|
+
export declare function manifestIdentityIssues(entry: {
|
|
93
|
+
id?: unknown;
|
|
94
|
+
linked_tasks?: unknown;
|
|
95
|
+
file?: unknown;
|
|
96
|
+
}, root: string): ManifestIdentityIssue[];
|
|
97
|
+
/**
|
|
98
|
+
* The well-formed linked task ids that name no task in the project store
|
|
99
|
+
* (archived tasks count as existing).
|
|
100
|
+
*
|
|
101
|
+
* @param taskIds - Linked task ids; malformed ones are skipped (format checks report them).
|
|
102
|
+
* @param projectRoot - Project whose task store is consulted.
|
|
103
|
+
* @returns The ids with no task, in input order, without duplicates.
|
|
104
|
+
*/
|
|
105
|
+
export declare function findMissingLinkedTasks(taskIds: readonly string[], projectRoot: string): Promise<string[]>;
|
|
106
|
+
/** Outcome of resolving a manifest `file` reference against a directory on disk. */
|
|
107
|
+
export type ContainedFileResolution =
|
|
108
|
+
/** The reference names an existing path whose real location is inside the real root. */
|
|
109
|
+
{
|
|
110
|
+
status: 'ok';
|
|
111
|
+
realPath: string;
|
|
112
|
+
}
|
|
113
|
+
/** Nothing exists at the reference (including a dangling symbolic link). Never read. */
|
|
114
|
+
| {
|
|
115
|
+
status: 'not-found';
|
|
116
|
+
}
|
|
117
|
+
/** The reference is malformed or resolves outside the root. Never read. */
|
|
118
|
+
| {
|
|
119
|
+
status: 'unsafe';
|
|
120
|
+
reason: string;
|
|
121
|
+
};
|
|
122
|
+
/** Outcome of reading a manifest `file` reference; `ok` carries the content. */
|
|
123
|
+
export type ContainedFileRead = {
|
|
124
|
+
status: 'ok';
|
|
125
|
+
realPath: string;
|
|
126
|
+
content: string;
|
|
127
|
+
} | {
|
|
128
|
+
status: 'not-found';
|
|
129
|
+
} | {
|
|
130
|
+
status: 'unsafe';
|
|
131
|
+
reason: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Resolve a manifest `file` reference to its real path, requiring it to stay
|
|
135
|
+
* inside `root` after every symbolic link is followed (T12829).
|
|
136
|
+
*
|
|
137
|
+
* {@link manifestFileProblem} is lexical: `link/secret.txt` passes when
|
|
138
|
+
* `link` is an in-project symlink to a directory outside the project. This
|
|
139
|
+
* resolves both the root and the target with `realpathSync` and requires the
|
|
140
|
+
* real target under the real root. A missing target (or a dangling link) is
|
|
141
|
+
* `not-found` and must not be read; a URI reference is `unsafe` here because
|
|
142
|
+
* it is not a filesystem path.
|
|
143
|
+
*
|
|
144
|
+
* @param root - Directory the reference is resolved against.
|
|
145
|
+
* @param file - The stored `file` reference.
|
|
146
|
+
* @returns The resolution; only `ok` may be read, and only via `realPath`.
|
|
147
|
+
* @throws The underlying filesystem error for anything other than not-found or a link loop.
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* resolveContainedFile('/proj', 'link/secret.txt'); // { status: 'unsafe', ... } when link -> ../outside
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare function resolveContainedFile(root: string, file: unknown): ContainedFileResolution;
|
|
154
|
+
/**
|
|
155
|
+
* Read a manifest `file` reference as UTF-8 text, only when its real path is
|
|
156
|
+
* inside `root` (see {@link resolveContainedFile}).
|
|
157
|
+
*
|
|
158
|
+
* The resolved real path is opened once, without following a final symbolic
|
|
159
|
+
* link and without blocking on a FIFO, and the content is read through that
|
|
160
|
+
* file descriptor. After opening, the path is re-resolved and must still name
|
|
161
|
+
* the same inode, so a component swapped for a link between the check and the
|
|
162
|
+
* open is refused rather than read.
|
|
163
|
+
*
|
|
164
|
+
* @param root - Directory the reference is resolved against.
|
|
165
|
+
* @param file - The stored `file` reference.
|
|
166
|
+
* @returns The content, or why it was not read.
|
|
167
|
+
* @throws The underlying filesystem error for failures other than not-found
|
|
168
|
+
* (a directory throws `EISDIR`).
|
|
169
|
+
*/
|
|
170
|
+
export declare function readContainedFile(root: string, file: unknown): ContainedFileRead;
|
|
171
|
+
//# sourceMappingURL=manifest-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-identity.d.ts","sourceRoot":"","sources":["../../src/memory/manifest-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAcH,0CAA0C;AAC1C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAoC,CAAC;AAE3E,yCAAyC;AACzC,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,wFAAwF;AACxF,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAqBnD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAGhE;AAED,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,gCAAgC;IAChC,KAAK,EAAE,IAAI,GAAG,cAAc,GAAG,MAAM,CAAC;IACtC,kGAAkG;IAClG,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC;IACrC,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CASjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAsB9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE;IAAE,EAAE,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAC/D,IAAI,EAAE,MAAM,GACX,qBAAqB,EAAE,CA2CzB;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB;AAED,oFAAoF;AACpF,MAAM,MAAM,uBAAuB;AACjC,wFAAwF;AACtF;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AACpC,wFAAwF;GACtF;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE;AACzB,2EAA2E;GACzE;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA8BzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,uBAAuB,CAwBzF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAmChF"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest identity validation — the entry id, the linked task ids and the
|
|
3
|
+
* file reference of a `pipeline_manifest` entry (T12829).
|
|
4
|
+
*
|
|
5
|
+
* Before this module `cleo manifest append` stored whatever it was given: a
|
|
6
|
+
* `--task` of `T99999` (no such task), a 900-character JSON blob, or
|
|
7
|
+
* `../../x`. The shorthand builder turns `--task` into both the entry id and
|
|
8
|
+
* the `file` reference (`.cleo/agent-outputs/<task>-<type>-<stamp>.md`), and
|
|
9
|
+
* `cleo manifest show` reads `file` relative to the project root. So the blob
|
|
10
|
+
* became an unreadable path (ENAMETOOLONG), and a `../` task made `show` read
|
|
11
|
+
* a file outside the project. Nothing is written to that path; the defect is
|
|
12
|
+
* an unvalidated identity that later flows into a filesystem read.
|
|
13
|
+
*
|
|
14
|
+
* Every check here is pure except {@link findMissingLinkedTasks}, which reads
|
|
15
|
+
* the task store. Append rejects a problem before writing; show refuses a
|
|
16
|
+
* malformed id or unsafe file before touching the filesystem; `cleo doctor
|
|
17
|
+
* manifest-rows` reports rows stored before these checks existed.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
* @task T12829
|
|
21
|
+
*/
|
|
22
|
+
import { closeSync, constants as fsConstants, fstatSync, openSync, readFileSync, realpathSync, statSync, } from 'node:fs';
|
|
23
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
24
|
+
import { isStorableTaskId, isTaskId } from '@cleocode/contracts';
|
|
25
|
+
/** Longest accepted manifest entry id. */
|
|
26
|
+
export const MANIFEST_ENTRY_ID_MAX_LENGTH = 200;
|
|
27
|
+
/**
|
|
28
|
+
* Accepted manifest entry id characters: an alphanumeric first character,
|
|
29
|
+
* then alphanumerics and `.`, `_`, `:`, `@`, `+`, `-`. No path separator,
|
|
30
|
+
* whitespace or control character can appear, so an id can never name a
|
|
31
|
+
* path outside the directory it is joined onto.
|
|
32
|
+
*/
|
|
33
|
+
export const MANIFEST_ENTRY_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@+-]*$/;
|
|
34
|
+
/** Longest accepted `file` reference. */
|
|
35
|
+
export const MANIFEST_FILE_MAX_LENGTH = 1024;
|
|
36
|
+
/** Longest accepted single path segment of a `file` reference (filesystem NAME_MAX). */
|
|
37
|
+
export const MANIFEST_FILE_SEGMENT_MAX_BYTES = 255;
|
|
38
|
+
/** A URI-shaped `file` reference (`cleo://docs/...`); `show` validates these itself. */
|
|
39
|
+
const URI_REFERENCE = /^[a-z][a-z\d+.-]*:/i;
|
|
40
|
+
/** A Windows drive path (`C:\x`, `C:/x`, drive-relative `C:x`), which is a path and not a URI. */
|
|
41
|
+
const WINDOWS_DRIVE = /^[a-z]:/i;
|
|
42
|
+
/** A UNC-looking reference (`\\server\share`, `//server/share`). */
|
|
43
|
+
const UNC_REFERENCE = /^[\\/]{2}/;
|
|
44
|
+
/** Control characters, which no id or path reference may contain. */
|
|
45
|
+
const CONTROL_CHARS = /[\x00-\x1f\x7f]/;
|
|
46
|
+
/**
|
|
47
|
+
* Structured task ids CLEO mints on purpose alongside the canonical `T<digits>`
|
|
48
|
+
* (`T-RECONCILE-FOLLOWUP-v2026.5.63-6`, see `isStorableTaskId`): a `T`, then
|
|
49
|
+
* letters, digits, `.`, `_` and `-` only.
|
|
50
|
+
*/
|
|
51
|
+
const STRUCTURED_TASK_ID = /^T[A-Za-z0-9._-]+$/;
|
|
52
|
+
/**
|
|
53
|
+
* Whether `value` is acceptable as a manifest linked task id: the canonical
|
|
54
|
+
* `T<digits>` shape, or a structured `T…` id CLEO mints and stores
|
|
55
|
+
* (`isStorableTaskId`, at most 64 characters, no whitespace or separators).
|
|
56
|
+
* A JSON blob, a path, or an over-long value is never accepted.
|
|
57
|
+
*
|
|
58
|
+
* @param value - Candidate task id.
|
|
59
|
+
* @returns `true` when the value can name a task.
|
|
60
|
+
*/
|
|
61
|
+
export function isManifestTaskId(value) {
|
|
62
|
+
if (isTaskId(value))
|
|
63
|
+
return true;
|
|
64
|
+
return typeof value === 'string' && isStorableTaskId(value) && STRUCTURED_TASK_ID.test(value);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Truncate a value for display in an issue so a huge input cannot flood output.
|
|
68
|
+
*
|
|
69
|
+
* @param value - Raw value.
|
|
70
|
+
* @returns At most 120 characters, with an ellipsis and the full length when cut.
|
|
71
|
+
*/
|
|
72
|
+
function preview(value) {
|
|
73
|
+
return value.length <= 120 ? value : `${value.slice(0, 120)}… (${value.length} chars)`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Why a manifest entry id is unacceptable, or `null` when it is fine.
|
|
77
|
+
*
|
|
78
|
+
* @param id - Candidate entry id.
|
|
79
|
+
* @returns A reason, or `null`.
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* manifestEntryIdProblem('T123-implementation-20260929'); // null
|
|
83
|
+
* manifestEntryIdProblem('../../x'); // 'must start with ...'
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function manifestEntryIdProblem(id) {
|
|
87
|
+
if (typeof id !== 'string' || id === '')
|
|
88
|
+
return 'id must be a non-empty string';
|
|
89
|
+
if (id.length > MANIFEST_ENTRY_ID_MAX_LENGTH) {
|
|
90
|
+
return `id is ${id.length} characters; the maximum is ${MANIFEST_ENTRY_ID_MAX_LENGTH}`;
|
|
91
|
+
}
|
|
92
|
+
if (!MANIFEST_ENTRY_ID_PATTERN.test(id)) {
|
|
93
|
+
return 'id must start with a letter or digit and contain only letters, digits and . _ : @ + -';
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Why a manifest `file` reference is unsafe, or `null` when it is fine.
|
|
99
|
+
*
|
|
100
|
+
* Lexical checks only: an absolute, drive, UNC or backslash path is refused,
|
|
101
|
+
* and the reference joined onto `root` must stay inside `root`. A symbolic
|
|
102
|
+
* link inside the project can still point outside it, so every reader goes
|
|
103
|
+
* through {@link resolveContainedFile} / {@link readContainedFile}, which
|
|
104
|
+
* resolve real paths. URI references are left to `show`, which accepts only
|
|
105
|
+
* `cleo://docs/<reference>`.
|
|
106
|
+
*
|
|
107
|
+
* @param file - Candidate `file` value.
|
|
108
|
+
* @param root - Directory the reference is resolved against.
|
|
109
|
+
* @returns A reason, or `null`.
|
|
110
|
+
*/
|
|
111
|
+
export function manifestFileProblem(file, root) {
|
|
112
|
+
if (typeof file !== 'string' || file === '')
|
|
113
|
+
return 'file must be a non-empty string';
|
|
114
|
+
if (file.length > MANIFEST_FILE_MAX_LENGTH) {
|
|
115
|
+
return `file is ${file.length} characters; the maximum is ${MANIFEST_FILE_MAX_LENGTH}`;
|
|
116
|
+
}
|
|
117
|
+
if (CONTROL_CHARS.test(file))
|
|
118
|
+
return 'file must not contain control characters';
|
|
119
|
+
if (UNC_REFERENCE.test(file))
|
|
120
|
+
return 'file must not be a UNC path';
|
|
121
|
+
if (file.includes('\\'))
|
|
122
|
+
return 'file must not contain a backslash';
|
|
123
|
+
if (WINDOWS_DRIVE.test(file))
|
|
124
|
+
return 'file must not be a Windows drive path';
|
|
125
|
+
if (file.startsWith('/') || isAbsolute(file))
|
|
126
|
+
return 'file must be a relative path';
|
|
127
|
+
if (URI_REFERENCE.test(file))
|
|
128
|
+
return null;
|
|
129
|
+
const tooLong = file
|
|
130
|
+
.split(/[\\/]/)
|
|
131
|
+
.find((segment) => Buffer.byteLength(segment, 'utf8') > MANIFEST_FILE_SEGMENT_MAX_BYTES);
|
|
132
|
+
if (tooLong !== undefined) {
|
|
133
|
+
return `file has a path segment longer than ${MANIFEST_FILE_SEGMENT_MAX_BYTES} bytes`;
|
|
134
|
+
}
|
|
135
|
+
const rel = relative(root, join(root, file));
|
|
136
|
+
if (rel === '' || rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel)) {
|
|
137
|
+
return 'file must resolve to a path inside the project';
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Format checks for a manifest entry's id, linked task ids and file reference
|
|
143
|
+
* (an absent `file` is not checked). Pure: no store access. Pair with {@link findMissingLinkedTasks} to check
|
|
144
|
+
* that the linked tasks exist.
|
|
145
|
+
*
|
|
146
|
+
* @param entry - The entry's identity fields.
|
|
147
|
+
* @param root - Directory `file` is resolved against (the project root).
|
|
148
|
+
* @returns Every problem found; empty when the entry is well formed.
|
|
149
|
+
*/
|
|
150
|
+
export function manifestIdentityIssues(entry, root) {
|
|
151
|
+
const issues = [];
|
|
152
|
+
const idProblem = manifestEntryIdProblem(entry.id);
|
|
153
|
+
if (idProblem) {
|
|
154
|
+
issues.push({
|
|
155
|
+
field: 'id',
|
|
156
|
+
code: 'E_VALIDATION',
|
|
157
|
+
value: preview(String(entry.id ?? '')),
|
|
158
|
+
message: idProblem,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (entry.linked_tasks !== undefined) {
|
|
162
|
+
if (!Array.isArray(entry.linked_tasks)) {
|
|
163
|
+
issues.push({
|
|
164
|
+
field: 'linked_tasks',
|
|
165
|
+
code: 'E_VALIDATION',
|
|
166
|
+
value: preview(String(entry.linked_tasks)),
|
|
167
|
+
message: 'linked_tasks must be an array of task ids',
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
for (const taskId of entry.linked_tasks) {
|
|
172
|
+
if (!isManifestTaskId(taskId)) {
|
|
173
|
+
issues.push({
|
|
174
|
+
field: 'linked_tasks',
|
|
175
|
+
code: 'E_VALIDATION',
|
|
176
|
+
value: preview(String(taskId)),
|
|
177
|
+
message: 'linked task id must be a task id such as T1234',
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// An absent file is the caller's required-field check; only a present one is resolved.
|
|
184
|
+
const fileProblem = entry.file === undefined ? null : manifestFileProblem(entry.file, root);
|
|
185
|
+
if (fileProblem) {
|
|
186
|
+
issues.push({
|
|
187
|
+
field: 'file',
|
|
188
|
+
code: 'E_VALIDATION',
|
|
189
|
+
value: preview(String(entry.file ?? '')),
|
|
190
|
+
message: fileProblem,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return issues;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The well-formed linked task ids that name no task in the project store
|
|
197
|
+
* (archived tasks count as existing).
|
|
198
|
+
*
|
|
199
|
+
* @param taskIds - Linked task ids; malformed ones are skipped (format checks report them).
|
|
200
|
+
* @param projectRoot - Project whose task store is consulted.
|
|
201
|
+
* @returns The ids with no task, in input order, without duplicates.
|
|
202
|
+
*/
|
|
203
|
+
export async function findMissingLinkedTasks(taskIds, projectRoot) {
|
|
204
|
+
const wellFormed = [...new Set(taskIds.filter((id) => isManifestTaskId(id)))];
|
|
205
|
+
if (wellFormed.length === 0)
|
|
206
|
+
return [];
|
|
207
|
+
const { getTaskAccessor } = await import('../store/data-accessor.js');
|
|
208
|
+
const accessor = await getTaskAccessor(projectRoot);
|
|
209
|
+
const missing = [];
|
|
210
|
+
for (const id of wellFormed) {
|
|
211
|
+
if (!(await accessor.taskExists(id)))
|
|
212
|
+
missing.push(id);
|
|
213
|
+
}
|
|
214
|
+
return missing;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The error code carried by a thrown filesystem error, when it has one.
|
|
218
|
+
*
|
|
219
|
+
* @param error - Caught value.
|
|
220
|
+
* @returns The `code` string, or `undefined`.
|
|
221
|
+
*/
|
|
222
|
+
function errnoCode(error) {
|
|
223
|
+
return error instanceof Error && 'code' in error && typeof error.code === 'string'
|
|
224
|
+
? error.code
|
|
225
|
+
: undefined;
|
|
226
|
+
}
|
|
227
|
+
/** Filesystem errors that mean "nothing is there" for a manifest reference. */
|
|
228
|
+
const NOT_FOUND_CODES = new Set(['ENOENT', 'ENOTDIR']);
|
|
229
|
+
/**
|
|
230
|
+
* Whether `realTarget` lies strictly inside `realRoot` (separator-safe: a
|
|
231
|
+
* sibling `/proj-evil` is not inside `/proj`).
|
|
232
|
+
*
|
|
233
|
+
* @param realRoot - Real (symlink-free) root directory.
|
|
234
|
+
* @param realTarget - Real (symlink-free) candidate path.
|
|
235
|
+
* @returns `true` when the target is a descendant of the root.
|
|
236
|
+
*/
|
|
237
|
+
function isInsideRealRoot(realRoot, realTarget) {
|
|
238
|
+
const prefix = realRoot.endsWith(sep) ? realRoot : `${realRoot}${sep}`;
|
|
239
|
+
return realTarget.startsWith(prefix);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Resolve a manifest `file` reference to its real path, requiring it to stay
|
|
243
|
+
* inside `root` after every symbolic link is followed (T12829).
|
|
244
|
+
*
|
|
245
|
+
* {@link manifestFileProblem} is lexical: `link/secret.txt` passes when
|
|
246
|
+
* `link` is an in-project symlink to a directory outside the project. This
|
|
247
|
+
* resolves both the root and the target with `realpathSync` and requires the
|
|
248
|
+
* real target under the real root. A missing target (or a dangling link) is
|
|
249
|
+
* `not-found` and must not be read; a URI reference is `unsafe` here because
|
|
250
|
+
* it is not a filesystem path.
|
|
251
|
+
*
|
|
252
|
+
* @param root - Directory the reference is resolved against.
|
|
253
|
+
* @param file - The stored `file` reference.
|
|
254
|
+
* @returns The resolution; only `ok` may be read, and only via `realPath`.
|
|
255
|
+
* @throws The underlying filesystem error for anything other than not-found or a link loop.
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* resolveContainedFile('/proj', 'link/secret.txt'); // { status: 'unsafe', ... } when link -> ../outside
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
export function resolveContainedFile(root, file) {
|
|
262
|
+
const problem = manifestFileProblem(file, root);
|
|
263
|
+
if (problem)
|
|
264
|
+
return { status: 'unsafe', reason: problem };
|
|
265
|
+
if (typeof file !== 'string' || URI_REFERENCE.test(file)) {
|
|
266
|
+
return { status: 'unsafe', reason: 'file must be a filesystem path, not a URI' };
|
|
267
|
+
}
|
|
268
|
+
let realRoot;
|
|
269
|
+
let realTarget;
|
|
270
|
+
try {
|
|
271
|
+
realRoot = realpathSync(root);
|
|
272
|
+
realTarget = realpathSync(join(realRoot, file));
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
const code = errnoCode(error);
|
|
276
|
+
if (code !== undefined && NOT_FOUND_CODES.has(code))
|
|
277
|
+
return { status: 'not-found' };
|
|
278
|
+
if (code === 'ELOOP')
|
|
279
|
+
return { status: 'unsafe', reason: 'file is a symbolic link loop' };
|
|
280
|
+
throw error;
|
|
281
|
+
}
|
|
282
|
+
if (!isInsideRealRoot(realRoot, realTarget)) {
|
|
283
|
+
return {
|
|
284
|
+
status: 'unsafe',
|
|
285
|
+
reason: 'file resolves (through a symbolic link) outside the project',
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return { status: 'ok', realPath: realTarget };
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Read a manifest `file` reference as UTF-8 text, only when its real path is
|
|
292
|
+
* inside `root` (see {@link resolveContainedFile}).
|
|
293
|
+
*
|
|
294
|
+
* The resolved real path is opened once, without following a final symbolic
|
|
295
|
+
* link and without blocking on a FIFO, and the content is read through that
|
|
296
|
+
* file descriptor. After opening, the path is re-resolved and must still name
|
|
297
|
+
* the same inode, so a component swapped for a link between the check and the
|
|
298
|
+
* open is refused rather than read.
|
|
299
|
+
*
|
|
300
|
+
* @param root - Directory the reference is resolved against.
|
|
301
|
+
* @param file - The stored `file` reference.
|
|
302
|
+
* @returns The content, or why it was not read.
|
|
303
|
+
* @throws The underlying filesystem error for failures other than not-found
|
|
304
|
+
* (a directory throws `EISDIR`).
|
|
305
|
+
*/
|
|
306
|
+
export function readContainedFile(root, file) {
|
|
307
|
+
const resolved = resolveContainedFile(root, file);
|
|
308
|
+
if (resolved.status !== 'ok')
|
|
309
|
+
return resolved;
|
|
310
|
+
const flags = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0) | (fsConstants.O_NONBLOCK ?? 0);
|
|
311
|
+
let fd;
|
|
312
|
+
try {
|
|
313
|
+
fd = openSync(resolved.realPath, flags);
|
|
314
|
+
}
|
|
315
|
+
catch (error) {
|
|
316
|
+
const code = errnoCode(error);
|
|
317
|
+
if (code !== undefined && NOT_FOUND_CODES.has(code))
|
|
318
|
+
return { status: 'not-found' };
|
|
319
|
+
if (code === 'ELOOP') {
|
|
320
|
+
return { status: 'unsafe', reason: 'file changed into a symbolic link while being read' };
|
|
321
|
+
}
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
const opened = fstatSync(fd);
|
|
326
|
+
// A directory falls through to the read, which fails with EISDIR like any
|
|
327
|
+
// other read failure; a FIFO, socket or device is never read.
|
|
328
|
+
if (!opened.isFile() && !opened.isDirectory()) {
|
|
329
|
+
return { status: 'unsafe', reason: 'file is not a regular file' };
|
|
330
|
+
}
|
|
331
|
+
const again = resolveContainedFile(root, file);
|
|
332
|
+
if (again.status !== 'ok' || again.realPath !== resolved.realPath) {
|
|
333
|
+
return { status: 'unsafe', reason: 'file changed while being read' };
|
|
334
|
+
}
|
|
335
|
+
const current = statSync(again.realPath);
|
|
336
|
+
if (current.dev !== opened.dev || current.ino !== opened.ino) {
|
|
337
|
+
return { status: 'unsafe', reason: 'file changed while being read' };
|
|
338
|
+
}
|
|
339
|
+
return { status: 'ok', realPath: resolved.realPath, content: readFileSync(fd, 'utf-8') };
|
|
340
|
+
}
|
|
341
|
+
finally {
|
|
342
|
+
closeSync(fd);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=manifest-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-identity.js","sourceRoot":"","sources":["../../src/memory/manifest-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,gBAAgB,E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,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC;IAC3F,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -7,10 +7,20 @@
|
|
|
7
7
|
* decouples the hot path (agent execution) from I/O latency.
|
|
8
8
|
*
|
|
9
9
|
* The queue is drained to brain.db either:
|
|
10
|
-
* 1.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* 1. Promptly — every `enqueue` schedules a drain on the next macrotask
|
|
11
|
+
* (`setImmediate`, NOT unref'd), so observations enqueued in the same tick
|
|
12
|
+
* are written as one batch and the caller's promise always settles (T12817).
|
|
13
|
+
* 2. Periodically — every {@link FLUSH_INTERVAL_MS} milliseconds via a timer
|
|
14
|
+
* (backstop; unref'd).
|
|
15
|
+
* 3. On high watermark — when the queue exceeds {@link FLUSH_WATERMARK} entries.
|
|
16
|
+
* 4. On process exit — SIGINT, SIGTERM, and 'exit' hooks perform a best-effort
|
|
17
|
+
* flush.
|
|
18
|
+
*
|
|
19
|
+
* T12817: before the prompt drain existed, the ONLY drain a one-shot process
|
|
20
|
+
* could reach was the unref'd 5 s timer. `enqueue()` returned a promise that
|
|
21
|
+
* only that timer could settle, so an awaited `cleo memory observe --agent X`
|
|
22
|
+
* left the event loop empty: Node exited 0 with zero bytes on stdout and the
|
|
23
|
+
* `'exit'` hook's async drain never ran — the observation was silently lost.
|
|
14
24
|
*
|
|
15
25
|
* Observations without an `agent` field continue to use the existing synchronous
|
|
16
26
|
* path in observeBrain() and are never routed here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mental-model-queue.d.ts","sourceRoot":"","sources":["../../src/memory/mental-model-queue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mental-model-queue.d.ts","sourceRoot":"","sources":["../../src/memory/mental-model-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AA4BnF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,OAAO,CACL,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE/B;;;;;;;OAOG;IACH,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzB,2DAA2D;IAC3D,IAAI,IAAI,MAAM,CAAC;CAChB;AA8KD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBA8B9B,CAAC;AAMF;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAoBrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAI5E"}
|