@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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caller-side claim operations: who is claiming, and the lease lifecycle
|
|
3
|
+
* verbs built on the accessor's claim chokepoint (T12502 · epic T12497).
|
|
4
|
+
*
|
|
5
|
+
* The compare-and-set itself lives in the store (`updateTaskFields` with a
|
|
6
|
+
* `TaskClaimGuard`, reached through `DataAccessor.claimTask` /
|
|
7
|
+
* `unclaimTask`). This module resolves the CALLER's identity — its bound
|
|
8
|
+
* session (never the newest-active guess, T12500) and agent id — and maps the
|
|
9
|
+
* CLI flags to a claim mode.
|
|
10
|
+
*
|
|
11
|
+
* @task T12502
|
|
12
|
+
* @epic T12497
|
|
13
|
+
*/
|
|
14
|
+
import type { TaskClaim, TaskClaimMode } from '@cleocode/contracts';
|
|
15
|
+
import type { DataAccessor } from '../store/data-accessor.js';
|
|
16
|
+
/** The identity a claim is recorded under. */
|
|
17
|
+
export interface Claimant {
|
|
18
|
+
/** The caller's bound session, or `null` when unbound (no lease is taken). */
|
|
19
|
+
sessionId: string | null;
|
|
20
|
+
/** The caller's agent identity, or `null`. */
|
|
21
|
+
agentId: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** Explicit overrides for a claim that another session holds. */
|
|
24
|
+
export interface ClaimOverrideFlags {
|
|
25
|
+
/** Take over a lease that has EXPIRED (`--take-over`). Audited. */
|
|
26
|
+
takeOver?: boolean;
|
|
27
|
+
/** Take over even a LIVE lease (`--force-claim`). Audited. */
|
|
28
|
+
forceClaim?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the claimant for the calling process.
|
|
32
|
+
*
|
|
33
|
+
* The session is the caller's BOUND session (connection, `CLEO_SESSION_ID`
|
|
34
|
+
* naming a real row, or the terminal binding) — an unbound caller claims as
|
|
35
|
+
* `null` and holds no lease. The agent id is the explicit one, else the bound
|
|
36
|
+
* session's agent identity, else `CLEO_AGENT_ID`.
|
|
37
|
+
*
|
|
38
|
+
* @param cwd - Project root for session resolution.
|
|
39
|
+
* @param agentId - Explicit agent id (`cleo claim --agent`), when given.
|
|
40
|
+
* @returns The claimant.
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const claimant = await resolveClaimant(projectRoot);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveClaimant(cwd?: string, agentId?: string | null): Promise<Claimant>;
|
|
47
|
+
/**
|
|
48
|
+
* Map override flags to a claim mode.
|
|
49
|
+
*
|
|
50
|
+
* @param flags - `--take-over` / `--force-claim`.
|
|
51
|
+
* @returns `force`, `take-over` or `acquire`.
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* claimModeFor({ takeOver: true }); // 'take-over'
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function claimModeFor(flags: ClaimOverrideFlags): Exclude<TaskClaimMode, 'release'>;
|
|
58
|
+
/**
|
|
59
|
+
* Release `taskId`'s lease when `sessionId` holds it; a no-op otherwise
|
|
60
|
+
* (unclaimed, or held by another session — never an error).
|
|
61
|
+
*
|
|
62
|
+
* @param acc - Task accessor (may be inside a transaction).
|
|
63
|
+
* @param taskId - The task.
|
|
64
|
+
* @param sessionId - The caller's session.
|
|
65
|
+
* @returns `true` when a lease was released.
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* await releaseOwnClaim(acc, 'T1', claimant.sessionId);
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function releaseOwnClaim(acc: DataAccessor, taskId: string, sessionId: string | null): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Heartbeat: extend every lease the session holds by one lease length.
|
|
74
|
+
*
|
|
75
|
+
* @param acc - Task accessor.
|
|
76
|
+
* @param sessionId - The holder session.
|
|
77
|
+
* @param now - Clock override (ISO-8601 UTC) for tests.
|
|
78
|
+
* @returns Number of leases renewed.
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* await renewClaimsForSession(acc, req.sessionId);
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare function renewClaimsForSession(acc: DataAccessor, sessionId: string, now?: string): Promise<number>;
|
|
85
|
+
/**
|
|
86
|
+
* Activity heartbeat for a project (T12502): extend every lease `sessionId`
|
|
87
|
+
* holds there. The CLI dispatcher calls it after each successful mutation by
|
|
88
|
+
* a bound session, so an agent that keeps working keeps its claims.
|
|
89
|
+
*
|
|
90
|
+
* @param projectRoot - Project root.
|
|
91
|
+
* @param sessionId - The session that just did work.
|
|
92
|
+
* @returns Number of leases renewed.
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* await renewProjectSessionClaims(projectRoot, req.sessionId);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function renewProjectSessionClaims(projectRoot: string, sessionId: string): Promise<number>;
|
|
99
|
+
/** What one session heartbeat did (T12540). */
|
|
100
|
+
export interface SessionHeartbeatResult {
|
|
101
|
+
/** `true` when the session's `lastActivity` was written (not throttled or skipped). */
|
|
102
|
+
readonly activityTouched: boolean;
|
|
103
|
+
/** Claim leases extended. */
|
|
104
|
+
readonly leasesRenewed: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The ONE activity heartbeat a bound session's successful mutation triggers
|
|
108
|
+
* (T12540 · T12502): refresh the session's `lastActivity` (throttled to once
|
|
109
|
+
* per `SESSION_ACTIVITY_THROTTLE_MS`) and extend its claim leases. Both halves
|
|
110
|
+
* are best-effort, cheap in the common case (an indexed read, no write lock),
|
|
111
|
+
* and skip rather than wait on a contended lock; a failure of one never stops
|
|
112
|
+
* the other.
|
|
113
|
+
*
|
|
114
|
+
* @param projectRoot - Project root.
|
|
115
|
+
* @param sessionId - The session that just did work.
|
|
116
|
+
* @param nowMs - Clock override for tests.
|
|
117
|
+
* @returns What the beat did.
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* await heartbeatProjectSession(projectRoot, req.sessionId);
|
|
121
|
+
* ```
|
|
122
|
+
* @task T12540
|
|
123
|
+
*/
|
|
124
|
+
export declare function heartbeatProjectSession(projectRoot: string, sessionId: string, nowMs?: number): Promise<SessionHeartbeatResult>;
|
|
125
|
+
/**
|
|
126
|
+
* The sessions among `sessionIds` that hold a LIVE claim lease (T12502). A
|
|
127
|
+
* lease is renewed by every mutation its holder makes (the dispatch
|
|
128
|
+
* heartbeat), so a live lease proves the session did work within one lease
|
|
129
|
+
* length — `session gc` uses this to keep a long-running session that is
|
|
130
|
+
* still working from being orphaned (which would drop its leases).
|
|
131
|
+
*
|
|
132
|
+
* @param projectRoot - Project root.
|
|
133
|
+
* @param sessionIds - Candidate sessions.
|
|
134
|
+
* @param now - ISO-8601 UTC instant for the expiry comparison.
|
|
135
|
+
* @returns The subset holding at least one unexpired lease.
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const alive = await sessionsHoldingLiveClaims(root, ['ses_a', 'ses_b']);
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function sessionsHoldingLiveClaims(projectRoot: string, sessionIds: readonly string[], now?: string): Promise<Set<string>>;
|
|
142
|
+
/**
|
|
143
|
+
* Renew one task's lease for its holder (`cleo claim <id> --renew`).
|
|
144
|
+
*
|
|
145
|
+
* @param acc - Task accessor.
|
|
146
|
+
* @param taskId - The task.
|
|
147
|
+
* @param claimant - The caller; must be the holder.
|
|
148
|
+
* @returns The renewed lease.
|
|
149
|
+
* @throws CleoError `E_TASK_CLAIMED` when another session holds it, or
|
|
150
|
+
* `E_NOT_FOUND` when the caller holds no lease on it.
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* await renewTaskClaim(acc, 'T1', claimant);
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function renewTaskClaim(acc: DataAccessor, taskId: string, claimant: Claimant): Promise<TaskClaim | null>;
|
|
157
|
+
/**
|
|
158
|
+
* What {@link claimSpawnedTask} changed, so a failed spawn can undo it with
|
|
159
|
+
* {@link releaseSpawnClaim} (T12502).
|
|
160
|
+
*/
|
|
161
|
+
export interface SpawnClaimReceipt {
|
|
162
|
+
/** The lease the spawned session now holds, or `null` when the task does not exist. */
|
|
163
|
+
readonly claim: TaskClaim | null;
|
|
164
|
+
/** The lease on the task before the spawn (e.g. the orchestrator's), if any. */
|
|
165
|
+
readonly previous: TaskClaim | null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Claim a task for the agent a spawn is about to start (T12502).
|
|
169
|
+
*
|
|
170
|
+
* The spawned agent's own session takes the lease and records the calling
|
|
171
|
+
* orchestrator session as its spawn-edge parent (`parentSessionId`) and as
|
|
172
|
+
* the trusted spawner (`spawnedBySessionId`, via `setSessionSpawnedBy` —
|
|
173
|
+
* the only edge the claim chokepoint honours). When the
|
|
174
|
+
* orchestrator's session held the lease (it ran `cleo start` or `cleo claim`
|
|
175
|
+
* first), the lease is handed to the spawned session (audited as a
|
|
176
|
+
* hand-off). Parent and child are one claim family: either may take the lease
|
|
177
|
+
* back without an override, so a worker whose calls resolve to the
|
|
178
|
+
* orchestrator's session is not refused by its own spawn. Any other live or
|
|
179
|
+
* expired holder refuses the spawn with `E_TASK_CLAIMED`. A re-spawn reuses
|
|
180
|
+
* the same per-agent session, so it renews its own lease. A task that does
|
|
181
|
+
* not exist is left to the spawn's own validation.
|
|
182
|
+
*
|
|
183
|
+
* @param projectRoot - Project root.
|
|
184
|
+
* @param taskId - The task being spawned.
|
|
185
|
+
* @param identity - The spawned agent's session and agent id.
|
|
186
|
+
* @returns The lease taken and the lease it replaced (for rollback).
|
|
187
|
+
* @throws CleoError `E_TASK_CLAIMED` when another session holds the task.
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* const receipt = await claimSpawnedTask(root, 'T1', { sessionId: s.sessionId, agentId: s.agentId });
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare function claimSpawnedTask(projectRoot: string, taskId: string, identity: {
|
|
194
|
+
sessionId: string;
|
|
195
|
+
agentId: string | null;
|
|
196
|
+
}): Promise<SpawnClaimReceipt>;
|
|
197
|
+
/**
|
|
198
|
+
* Undo {@link claimSpawnedTask} for a spawn that failed after claiming
|
|
199
|
+
* (T12502): release the spawned session's lease and give the task back to
|
|
200
|
+
* the session that held it before (the orchestrator on a hand-off). A lease
|
|
201
|
+
* the spawned session already held before this spawn (a re-spawn) is kept.
|
|
202
|
+
* Best-effort: a failure here never masks the spawn's own error.
|
|
203
|
+
*
|
|
204
|
+
* @param projectRoot - Project root.
|
|
205
|
+
* @param taskId - The task whose spawn failed.
|
|
206
|
+
* @param sessionId - The spawned session.
|
|
207
|
+
* @param receipt - What the claim changed.
|
|
208
|
+
* @returns `true` when the spawn's lease was undone.
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* if (!spawnSucceeded) await releaseSpawnClaim(root, taskId, child.sessionId, receipt);
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function releaseSpawnClaim(projectRoot: string, taskId: string, sessionId: string, receipt: SpawnClaimReceipt): Promise<boolean>;
|
|
215
|
+
//# sourceMappingURL=claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../src/task-work/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAa9D,8CAA8C;AAC9C,MAAM,WAAW,QAAQ;IACvB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAA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GAAG,GAAE,MAAiC,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CActB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAE3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACtD,OAAO,CAAC,iBAAiB,CAAC,CAqB5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caller-side claim operations: who is claiming, and the lease lifecycle
|
|
3
|
+
* verbs built on the accessor's claim chokepoint (T12502 · epic T12497).
|
|
4
|
+
*
|
|
5
|
+
* The compare-and-set itself lives in the store (`updateTaskFields` with a
|
|
6
|
+
* `TaskClaimGuard`, reached through `DataAccessor.claimTask` /
|
|
7
|
+
* `unclaimTask`). This module resolves the CALLER's identity — its bound
|
|
8
|
+
* session (never the newest-active guess, T12500) and agent id — and maps the
|
|
9
|
+
* CLI flags to a claim mode.
|
|
10
|
+
*
|
|
11
|
+
* @task T12502
|
|
12
|
+
* @epic T12497
|
|
13
|
+
*/
|
|
14
|
+
import { and, gt, inArray } from 'drizzle-orm';
|
|
15
|
+
import { getTaskAccessor } from '../store/data-accessor.js';
|
|
16
|
+
import { getSession, resolveBoundSession, setSessionSpawnedBy, touchSessionActivity, updateSession, } from '../store/session-store.js';
|
|
17
|
+
import { getDb } from '../store/sqlite.js';
|
|
18
|
+
import { leaseExpiresAtFrom, taskClaimLeaseMs } from '../store/task-claim.js';
|
|
19
|
+
import * as schema from '../store/tasks-schema.js';
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the claimant for the calling process.
|
|
22
|
+
*
|
|
23
|
+
* The session is the caller's BOUND session (connection, `CLEO_SESSION_ID`
|
|
24
|
+
* naming a real row, or the terminal binding) — an unbound caller claims as
|
|
25
|
+
* `null` and holds no lease. The agent id is the explicit one, else the bound
|
|
26
|
+
* session's agent identity, else `CLEO_AGENT_ID`.
|
|
27
|
+
*
|
|
28
|
+
* @param cwd - Project root for session resolution.
|
|
29
|
+
* @param agentId - Explicit agent id (`cleo claim --agent`), when given.
|
|
30
|
+
* @returns The claimant.
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const claimant = await resolveClaimant(projectRoot);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export async function resolveClaimant(cwd, agentId) {
|
|
37
|
+
const bound = await resolveBoundSession(cwd);
|
|
38
|
+
const session = bound?.session;
|
|
39
|
+
return {
|
|
40
|
+
sessionId: session?.id ?? null,
|
|
41
|
+
agentId: agentId ||
|
|
42
|
+
session?.agentIdentifier ||
|
|
43
|
+
session?.agentHandle ||
|
|
44
|
+
process.env['CLEO_AGENT_ID'] ||
|
|
45
|
+
null,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Map override flags to a claim mode.
|
|
50
|
+
*
|
|
51
|
+
* @param flags - `--take-over` / `--force-claim`.
|
|
52
|
+
* @returns `force`, `take-over` or `acquire`.
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* claimModeFor({ takeOver: true }); // 'take-over'
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function claimModeFor(flags) {
|
|
59
|
+
if (flags.forceClaim)
|
|
60
|
+
return 'force';
|
|
61
|
+
if (flags.takeOver)
|
|
62
|
+
return 'take-over';
|
|
63
|
+
return 'acquire';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Release `taskId`'s lease when `sessionId` holds it; a no-op otherwise
|
|
67
|
+
* (unclaimed, or held by another session — never an error).
|
|
68
|
+
*
|
|
69
|
+
* @param acc - Task accessor (may be inside a transaction).
|
|
70
|
+
* @param taskId - The task.
|
|
71
|
+
* @param sessionId - The caller's session.
|
|
72
|
+
* @returns `true` when a lease was released.
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* await releaseOwnClaim(acc, 'T1', claimant.sessionId);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export async function releaseOwnClaim(acc, taskId, sessionId) {
|
|
79
|
+
if (!sessionId)
|
|
80
|
+
return false;
|
|
81
|
+
const task = await acc.loadSingleTask(taskId);
|
|
82
|
+
if (task?.claim?.sessionId !== sessionId)
|
|
83
|
+
return false;
|
|
84
|
+
return acc.unclaimTask(taskId, { sessionId });
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Heartbeat: extend every lease the session holds by one lease length.
|
|
88
|
+
*
|
|
89
|
+
* @param acc - Task accessor.
|
|
90
|
+
* @param sessionId - The holder session.
|
|
91
|
+
* @param now - Clock override (ISO-8601 UTC) for tests.
|
|
92
|
+
* @returns Number of leases renewed.
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* await renewClaimsForSession(acc, req.sessionId);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export async function renewClaimsForSession(acc, sessionId, now = new Date().toISOString()) {
|
|
99
|
+
return acc.renewSessionClaims(sessionId, leaseExpiresAtFrom(now, taskClaimLeaseMs()));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Activity heartbeat for a project (T12502): extend every lease `sessionId`
|
|
103
|
+
* holds there. The CLI dispatcher calls it after each successful mutation by
|
|
104
|
+
* a bound session, so an agent that keeps working keeps its claims.
|
|
105
|
+
*
|
|
106
|
+
* @param projectRoot - Project root.
|
|
107
|
+
* @param sessionId - The session that just did work.
|
|
108
|
+
* @returns Number of leases renewed.
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* await renewProjectSessionClaims(projectRoot, req.sessionId);
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export async function renewProjectSessionClaims(projectRoot, sessionId) {
|
|
115
|
+
return renewClaimsForSession(await getTaskAccessor(projectRoot), sessionId);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The ONE activity heartbeat a bound session's successful mutation triggers
|
|
119
|
+
* (T12540 · T12502): refresh the session's `lastActivity` (throttled to once
|
|
120
|
+
* per `SESSION_ACTIVITY_THROTTLE_MS`) and extend its claim leases. Both halves
|
|
121
|
+
* are best-effort, cheap in the common case (an indexed read, no write lock),
|
|
122
|
+
* and skip rather than wait on a contended lock; a failure of one never stops
|
|
123
|
+
* the other.
|
|
124
|
+
*
|
|
125
|
+
* @param projectRoot - Project root.
|
|
126
|
+
* @param sessionId - The session that just did work.
|
|
127
|
+
* @param nowMs - Clock override for tests.
|
|
128
|
+
* @returns What the beat did.
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* await heartbeatProjectSession(projectRoot, req.sessionId);
|
|
132
|
+
* ```
|
|
133
|
+
* @task T12540
|
|
134
|
+
*/
|
|
135
|
+
export async function heartbeatProjectSession(projectRoot, sessionId, nowMs = Date.now()) {
|
|
136
|
+
const activityTouched = await touchSessionActivity(sessionId, projectRoot, nowMs).catch(() => false);
|
|
137
|
+
const leasesRenewed = await renewClaimsForSession(await getTaskAccessor(projectRoot), sessionId, new Date(nowMs).toISOString());
|
|
138
|
+
return { activityTouched, leasesRenewed };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The sessions among `sessionIds` that hold a LIVE claim lease (T12502). A
|
|
142
|
+
* lease is renewed by every mutation its holder makes (the dispatch
|
|
143
|
+
* heartbeat), so a live lease proves the session did work within one lease
|
|
144
|
+
* length — `session gc` uses this to keep a long-running session that is
|
|
145
|
+
* still working from being orphaned (which would drop its leases).
|
|
146
|
+
*
|
|
147
|
+
* @param projectRoot - Project root.
|
|
148
|
+
* @param sessionIds - Candidate sessions.
|
|
149
|
+
* @param now - ISO-8601 UTC instant for the expiry comparison.
|
|
150
|
+
* @returns The subset holding at least one unexpired lease.
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* const alive = await sessionsHoldingLiveClaims(root, ['ses_a', 'ses_b']);
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export async function sessionsHoldingLiveClaims(projectRoot, sessionIds, now = new Date().toISOString()) {
|
|
157
|
+
if (sessionIds.length === 0)
|
|
158
|
+
return new Set();
|
|
159
|
+
const db = await getDb(projectRoot);
|
|
160
|
+
const rows = await db
|
|
161
|
+
.selectDistinct({ sessionId: schema.tasks.claimedBySession })
|
|
162
|
+
.from(schema.tasks)
|
|
163
|
+
.where(and(inArray(schema.tasks.claimedBySession, [...sessionIds]), gt(schema.tasks.leaseExpiresAt, now)))
|
|
164
|
+
.all();
|
|
165
|
+
return new Set(rows.flatMap((r) => (r.sessionId ? [r.sessionId] : [])));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Renew one task's lease for its holder (`cleo claim <id> --renew`).
|
|
169
|
+
*
|
|
170
|
+
* @param acc - Task accessor.
|
|
171
|
+
* @param taskId - The task.
|
|
172
|
+
* @param claimant - The caller; must be the holder.
|
|
173
|
+
* @returns The renewed lease.
|
|
174
|
+
* @throws CleoError `E_TASK_CLAIMED` when another session holds it, or
|
|
175
|
+
* `E_NOT_FOUND` when the caller holds no lease on it.
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* await renewTaskClaim(acc, 'T1', claimant);
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export async function renewTaskClaim(acc, taskId, claimant) {
|
|
182
|
+
return acc.claimTask(taskId, { ...claimant, mode: 'renew' });
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Claim a task for the agent a spawn is about to start (T12502).
|
|
186
|
+
*
|
|
187
|
+
* The spawned agent's own session takes the lease and records the calling
|
|
188
|
+
* orchestrator session as its spawn-edge parent (`parentSessionId`) and as
|
|
189
|
+
* the trusted spawner (`spawnedBySessionId`, via `setSessionSpawnedBy` —
|
|
190
|
+
* the only edge the claim chokepoint honours). When the
|
|
191
|
+
* orchestrator's session held the lease (it ran `cleo start` or `cleo claim`
|
|
192
|
+
* first), the lease is handed to the spawned session (audited as a
|
|
193
|
+
* hand-off). Parent and child are one claim family: either may take the lease
|
|
194
|
+
* back without an override, so a worker whose calls resolve to the
|
|
195
|
+
* orchestrator's session is not refused by its own spawn. Any other live or
|
|
196
|
+
* expired holder refuses the spawn with `E_TASK_CLAIMED`. A re-spawn reuses
|
|
197
|
+
* the same per-agent session, so it renews its own lease. A task that does
|
|
198
|
+
* not exist is left to the spawn's own validation.
|
|
199
|
+
*
|
|
200
|
+
* @param projectRoot - Project root.
|
|
201
|
+
* @param taskId - The task being spawned.
|
|
202
|
+
* @param identity - The spawned agent's session and agent id.
|
|
203
|
+
* @returns The lease taken and the lease it replaced (for rollback).
|
|
204
|
+
* @throws CleoError `E_TASK_CLAIMED` when another session holds the task.
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* const receipt = await claimSpawnedTask(root, 'T1', { sessionId: s.sessionId, agentId: s.agentId });
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
export async function claimSpawnedTask(projectRoot, taskId, identity) {
|
|
211
|
+
const acc = await getTaskAccessor(projectRoot);
|
|
212
|
+
const task = await acc.loadSingleTask(taskId);
|
|
213
|
+
if (!task)
|
|
214
|
+
return { claim: null, previous: null };
|
|
215
|
+
const orchestrator = (await resolveBoundSession(projectRoot))?.session;
|
|
216
|
+
if (orchestrator && orchestrator.id !== identity.sessionId) {
|
|
217
|
+
const child = await getSession(identity.sessionId, projectRoot);
|
|
218
|
+
if (child && !child.parentSessionId) {
|
|
219
|
+
await updateSession(identity.sessionId, { parentSessionId: orchestrator.id }, projectRoot);
|
|
220
|
+
}
|
|
221
|
+
// The TRUSTED spawn edge: the claim chokepoint reads this, never the
|
|
222
|
+
// self-declared `parentSessionId`, to let the family share the lease.
|
|
223
|
+
if (child)
|
|
224
|
+
await setSessionSpawnedBy(identity.sessionId, orchestrator.id, projectRoot);
|
|
225
|
+
}
|
|
226
|
+
const claim = await acc.claimTask(taskId, {
|
|
227
|
+
sessionId: identity.sessionId,
|
|
228
|
+
agentId: identity.agentId,
|
|
229
|
+
mode: 'acquire',
|
|
230
|
+
handoffFrom: orchestrator?.id ?? null,
|
|
231
|
+
});
|
|
232
|
+
return { claim, previous: task.claim ?? null };
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Undo {@link claimSpawnedTask} for a spawn that failed after claiming
|
|
236
|
+
* (T12502): release the spawned session's lease and give the task back to
|
|
237
|
+
* the session that held it before (the orchestrator on a hand-off). A lease
|
|
238
|
+
* the spawned session already held before this spawn (a re-spawn) is kept.
|
|
239
|
+
* Best-effort: a failure here never masks the spawn's own error.
|
|
240
|
+
*
|
|
241
|
+
* @param projectRoot - Project root.
|
|
242
|
+
* @param taskId - The task whose spawn failed.
|
|
243
|
+
* @param sessionId - The spawned session.
|
|
244
|
+
* @param receipt - What the claim changed.
|
|
245
|
+
* @returns `true` when the spawn's lease was undone.
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* if (!spawnSucceeded) await releaseSpawnClaim(root, taskId, child.sessionId, receipt);
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
export async function releaseSpawnClaim(projectRoot, taskId, sessionId, receipt) {
|
|
252
|
+
if (!receipt.claim || receipt.previous?.sessionId === sessionId)
|
|
253
|
+
return false;
|
|
254
|
+
try {
|
|
255
|
+
const acc = await getTaskAccessor(projectRoot);
|
|
256
|
+
if (!(await releaseOwnClaim(acc, taskId, sessionId)))
|
|
257
|
+
return false;
|
|
258
|
+
const previous = receipt.previous;
|
|
259
|
+
if (previous) {
|
|
260
|
+
await acc.claimTask(taskId, {
|
|
261
|
+
sessionId: previous.sessionId,
|
|
262
|
+
agentId: previous.agentId,
|
|
263
|
+
mode: 'acquire',
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../src/task-work/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AAkBnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAY,EAAE,OAAu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P,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
* @epic T4454
|
|
6
6
|
*/
|
|
7
7
|
import '../hooks/handlers/index.js';
|
|
8
|
-
import type { KnowledgeCoverage } from '@cleocode/contracts';
|
|
8
|
+
import type { KnowledgeCoverage, TaskClaim } from '@cleocode/contracts';
|
|
9
9
|
import { type StaleFocusPointer } from '../sessions/focus-state-store.js';
|
|
10
10
|
import type { DataAccessor } from '../store/data-accessor.js';
|
|
11
|
+
import { type ClaimOverrideFlags } from './claims.js';
|
|
12
|
+
export type { Claimant, ClaimOverrideFlags, SessionHeartbeatResult, SpawnClaimReceipt, } from './claims.js';
|
|
13
|
+
export { claimModeFor, claimSpawnedTask, heartbeatProjectSession, releaseOwnClaim, releaseSpawnClaim, renewClaimsForSession, renewProjectSessionClaims, renewTaskClaim, resolveClaimant, } from './claims.js';
|
|
11
14
|
/** Result of getting current task. */
|
|
12
15
|
export interface TaskCurrentResult {
|
|
13
16
|
currentTask: string | null;
|
|
@@ -27,7 +30,17 @@ export interface TaskStartResult {
|
|
|
27
30
|
taskId: string;
|
|
28
31
|
taskTitle: string;
|
|
29
32
|
previousTask: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* The claim lease this start holds on the task, or `null` when the caller
|
|
35
|
+
* is not bound to a session (no lease is taken). @task T12502
|
|
36
|
+
*/
|
|
37
|
+
claim: TaskClaim | null;
|
|
30
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Options for {@link startTask}: explicit, audited overrides of another
|
|
41
|
+
* session's claim (T12502).
|
|
42
|
+
*/
|
|
43
|
+
export type StartTaskOptions = ClaimOverrideFlags;
|
|
31
44
|
/** Task work history entry. */
|
|
32
45
|
export interface TaskWorkHistoryEntry {
|
|
33
46
|
taskId: string;
|
|
@@ -39,16 +52,47 @@ export interface TaskWorkHistoryEntry {
|
|
|
39
52
|
* @task T4750
|
|
40
53
|
*/
|
|
41
54
|
export declare function currentTask(cwd?: string, accessor?: DataAccessor): Promise<TaskCurrentResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Refuse to start `taskId` while it has unresolved dependencies — the
|
|
57
|
+
* readiness check {@link startTask} runs before it takes any claim or writes
|
|
58
|
+
* focus. Exported so a composite verb (`pivot`) can run it BEFORE its own
|
|
59
|
+
* side effects instead of discovering the refusal half-way (T12502).
|
|
60
|
+
*
|
|
61
|
+
* @param acc - Task accessor.
|
|
62
|
+
* @param taskId - The task about to be started.
|
|
63
|
+
* @throws CleoError `DEPENDENCY_ERROR` naming the unresolved blockers.
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* await assertTaskStartable(acc, 'T2');
|
|
67
|
+
* ```
|
|
68
|
+
* @task T12502
|
|
69
|
+
*/
|
|
70
|
+
export declare function assertTaskStartable(acc: DataAccessor, taskId: string): Promise<void>;
|
|
42
71
|
/**
|
|
43
72
|
* Start working on a specific task.
|
|
73
|
+
*
|
|
74
|
+
* T12502: the start takes the caller session's claim lease on the task with a
|
|
75
|
+
* compare-and-set inside the same write transaction as the focus write. When
|
|
76
|
+
* another session holds the task the start is refused with `E_TASK_CLAIMED`
|
|
77
|
+
* naming the holder and lease expiry; `takeOver` takes an expired lease and
|
|
78
|
+
* `forceClaim` a live one (both audited). The human `assignee` is not touched.
|
|
79
|
+
* Starting a new task releases the lease this session held on its previous one.
|
|
80
|
+
*
|
|
81
|
+
* @param taskId - Task to start.
|
|
82
|
+
* @param cwd - Project root.
|
|
83
|
+
* @param accessor - Task accessor (tests inject one).
|
|
84
|
+
* @param options - Claim overrides (`--take-over`, `--force-claim`).
|
|
44
85
|
* @task T4462
|
|
45
86
|
* @task T4750
|
|
87
|
+
* @task T12502
|
|
46
88
|
*/
|
|
47
|
-
export declare function startTask(taskId: string, cwd?: string, accessor?: DataAccessor): Promise<TaskStartResult>;
|
|
89
|
+
export declare function startTask(taskId: string, cwd?: string, accessor?: DataAccessor, options?: StartTaskOptions): Promise<TaskStartResult>;
|
|
48
90
|
/**
|
|
49
|
-
* Stop working on the current task.
|
|
91
|
+
* Stop working on the current task. T12502: releases the claim lease the
|
|
92
|
+
* caller's session holds on it (a lease held by another session is left).
|
|
50
93
|
* @task T4462
|
|
51
94
|
* @task T4750
|
|
95
|
+
* @task T12502
|
|
52
96
|
*/
|
|
53
97
|
export declare function stopTask(cwd?: string, accessor?: DataAccessor): Promise<{
|
|
54
98
|
previousTask: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task-work/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task-work/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAiB,MAAM,qBAAqB,CAAC;AAKvF,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAcrB,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,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