@cleocode/core 2026.9.20 → 2026.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/discovery.d.ts.map +1 -1
- package/dist/adapters/discovery.js +3 -10
- package/dist/adapters/discovery.js.map +1 -1
- package/dist/adrs/link-pipeline.js +2 -2
- package/dist/adrs/link-pipeline.js.map +1 -1
- package/dist/adrs/parse.js +3 -3
- package/dist/adrs/parse.js.map +1 -1
- package/dist/agents/invoke-meta-agent.d.ts.map +1 -1
- package/dist/agents/invoke-meta-agent.js +8 -4
- package/dist/agents/invoke-meta-agent.js.map +1 -1
- package/dist/agents/scaffold.d.ts.map +1 -1
- package/dist/agents/scaffold.js +0 -1
- package/dist/agents/scaffold.js.map +1 -1
- package/dist/bootstrap.d.ts +5 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +45 -21
- package/dist/bootstrap.js.map +1 -1
- package/dist/cloud/crypto.d.ts +47 -0
- package/dist/cloud/crypto.d.ts.map +1 -0
- package/dist/cloud/crypto.js +223 -0
- package/dist/cloud/crypto.js.map +1 -0
- package/dist/cloud/http.d.ts +52 -0
- package/dist/cloud/http.d.ts.map +1 -0
- package/dist/cloud/http.js +98 -0
- package/dist/cloud/http.js.map +1 -0
- package/dist/cloud/index.d.ts +19 -0
- package/dist/cloud/index.d.ts.map +1 -0
- package/dist/cloud/index.js +19 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/journal.d.ts +169 -0
- package/dist/cloud/journal.d.ts.map +1 -0
- package/dist/cloud/journal.js +428 -0
- package/dist/cloud/journal.js.map +1 -0
- package/dist/cloud/keys.d.ts +213 -0
- package/dist/cloud/keys.d.ts.map +1 -0
- package/dist/cloud/keys.js +362 -0
- package/dist/cloud/keys.js.map +1 -0
- package/dist/cloud/manifest-check.d.ts +36 -0
- package/dist/cloud/manifest-check.d.ts.map +1 -0
- package/dist/cloud/manifest-check.js +70 -0
- package/dist/cloud/manifest-check.js.map +1 -0
- package/dist/cloud/projects.d.ts +13 -0
- package/dist/cloud/projects.d.ts.map +1 -0
- package/dist/cloud/projects.js +11 -0
- package/dist/cloud/projects.js.map +1 -0
- package/dist/cloud/signing.d.ts +105 -0
- package/dist/cloud/signing.d.ts.map +1 -0
- package/dist/cloud/signing.js +117 -0
- package/dist/cloud/signing.js.map +1 -0
- package/dist/cloud/streams.d.ts +6 -0
- package/dist/cloud/streams.d.ts.map +1 -0
- package/dist/cloud/streams.js +5 -0
- package/dist/cloud/streams.js.map +1 -0
- package/dist/decide/audit.d.ts +131 -0
- package/dist/decide/audit.d.ts.map +1 -0
- package/dist/decide/audit.js +98 -0
- package/dist/decide/audit.js.map +1 -0
- package/dist/decide/budget.d.ts +91 -0
- package/dist/decide/budget.d.ts.map +1 -0
- package/dist/decide/budget.js +194 -0
- package/dist/decide/budget.js.map +1 -0
- package/dist/decide/cache.d.ts +49 -0
- package/dist/decide/cache.d.ts.map +1 -0
- package/dist/decide/cache.js +87 -0
- package/dist/decide/cache.js.map +1 -0
- package/dist/decide/client.d.ts +103 -0
- package/dist/decide/client.d.ts.map +1 -0
- package/dist/decide/client.js +262 -0
- package/dist/decide/client.js.map +1 -0
- package/dist/decide/credentials.d.ts +159 -0
- package/dist/decide/credentials.d.ts.map +1 -0
- package/dist/decide/credentials.js +383 -0
- package/dist/decide/credentials.js.map +1 -0
- package/dist/decide/index.d.ts +18 -0
- package/dist/decide/index.d.ts.map +1 -0
- package/dist/decide/index.js +18 -0
- package/dist/decide/index.js.map +1 -0
- package/dist/decide/jev-wire.d.ts +155 -0
- package/dist/decide/jev-wire.d.ts.map +1 -0
- package/dist/decide/jev-wire.js +420 -0
- package/dist/decide/jev-wire.js.map +1 -0
- package/dist/decide/operations.d.ts +152 -0
- package/dist/decide/operations.d.ts.map +1 -0
- package/dist/decide/operations.js +199 -0
- package/dist/decide/operations.js.map +1 -0
- package/dist/decide/provider.d.ts +90 -0
- package/dist/decide/provider.d.ts.map +1 -0
- package/dist/decide/provider.js +43 -0
- package/dist/decide/provider.js.map +1 -0
- package/dist/decide/site.d.ts +148 -0
- package/dist/decide/site.d.ts.map +1 -0
- package/dist/decide/site.js +181 -0
- package/dist/decide/site.js.map +1 -0
- package/dist/decide/transport.d.ts +67 -0
- package/dist/decide/transport.d.ts.map +1 -0
- package/dist/decide/transport.js +350 -0
- package/dist/decide/transport.js.map +1 -0
- package/dist/dispatch/mutate-projection.d.ts.map +1 -1
- package/dist/dispatch/mutate-projection.js +5 -0
- package/dist/dispatch/mutate-projection.js.map +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +25 -9
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/export-document.js +5963 -2406
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.js.map +1 -1
- package/dist/docs/projection.d.ts.map +1 -1
- package/dist/docs/projection.js +2 -3
- package/dist/docs/projection.js.map +1 -1
- package/dist/docs/publish-pr.d.ts +69 -1
- package/dist/docs/publish-pr.d.ts.map +1 -1
- package/dist/docs/publish-pr.js +112 -10
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts +13 -8
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +39 -26
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/index.d.ts +2 -0
- package/dist/doctor/index.d.ts.map +1 -1
- package/dist/doctor/index.js +1 -0
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/knowledge.d.ts +16 -1
- package/dist/doctor/knowledge.d.ts.map +1 -1
- package/dist/doctor/knowledge.js +58 -32
- package/dist/doctor/knowledge.js.map +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts.map +1 -1
- package/dist/doctor/nexus-schema-residency.js +3 -0
- package/dist/doctor/nexus-schema-residency.js.map +1 -1
- package/dist/doctor/project-identity.d.ts +44 -1
- package/dist/doctor/project-identity.d.ts.map +1 -1
- package/dist/doctor/project-identity.js +237 -10
- package/dist/doctor/project-identity.js.map +1 -1
- package/dist/doctor/projects.d.ts +170 -0
- package/dist/doctor/projects.d.ts.map +1 -0
- package/dist/doctor/projects.js +1075 -0
- package/dist/doctor/projects.js.map +1 -0
- package/dist/doctor/twin-collapse.d.ts +97 -0
- package/dist/doctor/twin-collapse.d.ts.map +1 -0
- package/dist/doctor/twin-collapse.js +168 -0
- package/dist/doctor/twin-collapse.js.map +1 -0
- package/dist/doctor/worktree-orphans.d.ts.map +1 -1
- package/dist/doctor/worktree-orphans.js +13 -29
- package/dist/doctor/worktree-orphans.js.map +1 -1
- package/dist/doctor/worktree-stores.d.ts +128 -0
- package/dist/doctor/worktree-stores.d.ts.map +1 -0
- package/dist/doctor/worktree-stores.js +374 -0
- package/dist/doctor/worktree-stores.js.map +1 -0
- package/dist/engine/engine-ops.d.ts +36 -6
- package/dist/engine/engine-ops.d.ts.map +1 -1
- package/dist/engine/engine-ops.js +115 -14
- package/dist/engine/engine-ops.js.map +1 -1
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/error-catalog.js +21 -0
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-registry.d.ts.map +1 -1
- package/dist/error-registry.js +40 -0
- package/dist/error-registry.js.map +1 -1
- package/dist/gateway-client/generated/types.gen.d.ts +1 -1
- package/dist/gc/cleanup.d.ts.map +1 -1
- package/dist/gc/cleanup.js +32 -19
- package/dist/gc/cleanup.js.map +1 -1
- package/dist/git/bounded-git.d.ts +170 -0
- package/dist/git/bounded-git.d.ts.map +1 -0
- package/dist/git/bounded-git.js +371 -0
- package/dist/git/bounded-git.js.map +1 -0
- package/dist/git/work-tree.d.ts +20 -0
- package/dist/git/work-tree.d.ts.map +1 -1
- package/dist/git/work-tree.js +20 -2
- package/dist/git/work-tree.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts +11 -26
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +18 -47
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/hooks/payload-schemas.d.ts +2 -2
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/init/engine-ops.d.ts.map +1 -1
- package/dist/init/engine-ops.js +23 -1
- package/dist/init/engine-ops.js.map +1 -1
- package/dist/init.d.ts +158 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +578 -53
- package/dist/init.js.map +1 -1
- package/dist/inject/index.d.ts.map +1 -1
- package/dist/inject/index.js +8 -3
- package/dist/inject/index.js.map +1 -1
- package/dist/injection.d.ts +55 -0
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +102 -6
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +11 -7
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +9 -5
- package/dist/internal.js.map +1 -1
- package/dist/issue/diagnostics.d.ts.map +1 -1
- package/dist/issue/diagnostics.js +2 -1
- package/dist/issue/diagnostics.js.map +1 -1
- package/dist/lib/concurrency.d.ts +25 -0
- package/dist/lib/concurrency.d.ts.map +1 -0
- package/dist/lib/concurrency.js +43 -0
- package/dist/lib/concurrency.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lifecycle/engine-ops.d.ts.map +1 -1
- package/dist/lifecycle/engine-ops.js +4 -2
- package/dist/lifecycle/engine-ops.js.map +1 -1
- package/dist/lifecycle/stage-guidance.d.ts +5 -0
- package/dist/lifecycle/stage-guidance.d.ts.map +1 -1
- package/dist/lifecycle/stage-guidance.js +14 -4
- package/dist/lifecycle/stage-guidance.js.map +1 -1
- package/dist/llm/catalog-cache.d.ts +3 -2
- package/dist/llm/catalog-cache.d.ts.map +1 -1
- package/dist/llm/catalog-cache.js +5 -5
- package/dist/llm/catalog-cache.js.map +1 -1
- package/dist/llm/credentials.d.ts +4 -4
- package/dist/llm/credentials.js +6 -6
- package/dist/llm/credentials.js.map +1 -1
- package/dist/llm/plugin-facade.js +4400 -1801
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/stable-device-id.d.ts.map +1 -1
- package/dist/llm/stable-device-id.js +3 -5
- package/dist/llm/stable-device-id.js.map +1 -1
- package/dist/memory/attention.js +31 -31
- package/dist/memory/attention.js.map +1 -1
- package/dist/memory/decision-contradiction.d.ts +152 -0
- package/dist/memory/decision-contradiction.d.ts.map +1 -0
- package/dist/memory/decision-contradiction.js +273 -0
- package/dist/memory/decision-contradiction.js.map +1 -0
- package/dist/memory/decisions.d.ts +42 -11
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +153 -56
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/dialectic-evaluator.d.ts +7 -0
- package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
- package/dist/memory/dialectic-evaluator.js +23 -8
- package/dist/memory/dialectic-evaluator.js.map +1 -1
- package/dist/memory/dispatch-trace-format.d.ts +39 -0
- package/dist/memory/dispatch-trace-format.d.ts.map +1 -0
- package/dist/memory/dispatch-trace-format.js +54 -0
- package/dist/memory/dispatch-trace-format.js.map +1 -0
- package/dist/memory/dispatch-trace.d.ts.map +1 -1
- package/dist/memory/dispatch-trace.js +1 -27
- package/dist/memory/dispatch-trace.js.map +1 -1
- package/dist/memory/engine-compat.d.ts +2 -0
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +1 -0
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/memory/import-from-provider.js +3 -3
- package/dist/memory/import-from-provider.js.map +1 -1
- package/dist/memory/learnings.d.ts +2 -2
- package/dist/memory/observation-type-decision.d.ts +96 -0
- package/dist/memory/observation-type-decision.d.ts.map +1 -0
- package/dist/memory/observation-type-decision.js +218 -0
- package/dist/memory/observation-type-decision.js.map +1 -0
- package/dist/memory/redaction.js +2 -0
- package/dist/memory/redaction.js.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts +9 -2
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.js +42 -11
- package/dist/memory/retrieval/build-retrieval-bundle.js.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.d.ts +5 -0
- package/dist/memory/retrieval/get-current-session-id.d.ts.map +1 -1
- package/dist/memory/retrieval/get-current-session-id.js +7 -2
- package/dist/memory/retrieval/get-current-session-id.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +30 -29
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts +38 -0
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +136 -48
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/assessment-projection.d.ts +76 -0
- package/dist/nexus/assessment-projection.d.ts.map +1 -0
- package/dist/nexus/assessment-projection.js +143 -0
- package/dist/nexus/assessment-projection.js.map +1 -0
- package/dist/nexus/assessment-store.d.ts +14 -2
- package/dist/nexus/assessment-store.d.ts.map +1 -1
- package/dist/nexus/assessment-store.js +21 -3
- package/dist/nexus/assessment-store.js.map +1 -1
- package/dist/nexus/checkout-nonce.d.ts +48 -0
- package/dist/nexus/checkout-nonce.d.ts.map +1 -0
- package/dist/nexus/checkout-nonce.js +84 -0
- package/dist/nexus/checkout-nonce.js.map +1 -0
- package/dist/nexus/devices.d.ts +93 -0
- package/dist/nexus/devices.d.ts.map +1 -0
- package/dist/nexus/devices.js +141 -0
- package/dist/nexus/devices.js.map +1 -0
- package/dist/nexus/freshness.d.ts.map +1 -1
- package/dist/nexus/freshness.js +25 -6
- package/dist/nexus/freshness.js.map +1 -1
- package/dist/nexus/git-state.d.ts +225 -0
- package/dist/nexus/git-state.d.ts.map +1 -0
- package/dist/nexus/git-state.js +677 -0
- package/dist/nexus/git-state.js.map +1 -0
- package/dist/nexus/graph-manifest.d.ts +20 -4
- package/dist/nexus/graph-manifest.d.ts.map +1 -1
- package/dist/nexus/graph-manifest.js +40 -5
- package/dist/nexus/graph-manifest.js.map +1 -1
- package/dist/nexus/identity.d.ts +68 -23
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +99 -22
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +5 -2
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +10 -4
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/knowledge.d.ts +5 -0
- package/dist/nexus/knowledge.d.ts.map +1 -1
- package/dist/nexus/knowledge.js +40 -5
- package/dist/nexus/knowledge.js.map +1 -1
- package/dist/nexus/legacy-alias.d.ts +60 -0
- package/dist/nexus/legacy-alias.d.ts.map +1 -0
- package/dist/nexus/legacy-alias.js +68 -0
- package/dist/nexus/legacy-alias.js.map +1 -0
- package/dist/nexus/migrate-json-to-sqlite.js +2 -2
- package/dist/nexus/migrate-json-to-sqlite.js.map +1 -1
- package/dist/nexus/ops.d.ts +1 -0
- package/dist/nexus/ops.d.ts.map +1 -1
- package/dist/nexus/path-map.d.ts +264 -20
- package/dist/nexus/path-map.d.ts.map +1 -1
- package/dist/nexus/path-map.js +580 -44
- package/dist/nexus/path-map.js.map +1 -1
- package/dist/nexus/projects-clean.d.ts +9 -1
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +126 -14
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/projects-scan.d.ts +56 -1
- package/dist/nexus/projects-scan.d.ts.map +1 -1
- package/dist/nexus/projects-scan.js +144 -3
- package/dist/nexus/projects-scan.js.map +1 -1
- package/dist/nexus/registry-hygiene.d.ts +18 -2
- package/dist/nexus/registry-hygiene.d.ts.map +1 -1
- package/dist/nexus/registry-hygiene.js +37 -11
- package/dist/nexus/registry-hygiene.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +47 -0
- package/dist/nexus/registry-roots.d.ts.map +1 -0
- package/dist/nexus/registry-roots.js +79 -0
- package/dist/nexus/registry-roots.js.map +1 -0
- package/dist/nexus/registry.d.ts +50 -9
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +311 -156
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/stored-roots.d.ts +171 -0
- package/dist/nexus/stored-roots.d.ts.map +1 -0
- package/dist/nexus/stored-roots.js +253 -0
- package/dist/nexus/stored-roots.js.map +1 -0
- package/dist/nexus/transfer.d.ts.map +1 -1
- package/dist/nexus/transfer.js +3 -0
- package/dist/nexus/transfer.js.map +1 -1
- package/dist/nexus/user-profile-hygiene.d.ts +168 -0
- package/dist/nexus/user-profile-hygiene.d.ts.map +1 -0
- package/dist/nexus/user-profile-hygiene.js +305 -0
- package/dist/nexus/user-profile-hygiene.js.map +1 -0
- package/dist/nexus/user-profile.d.ts +53 -2
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +106 -4
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/lifecycle-ops.d.ts.map +1 -1
- package/dist/orchestrate/lifecycle-ops.js +4 -1
- package/dist/orchestrate/lifecycle-ops.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +5 -1
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/plan.d.ts.map +1 -1
- package/dist/orchestrate/plan.js +5 -2
- package/dist/orchestrate/plan.js.map +1 -1
- package/dist/orchestrate/query-ops.d.ts +7 -2
- package/dist/orchestrate/query-ops.d.ts.map +1 -1
- package/dist/orchestrate/query-ops.js +17 -6
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts +12 -0
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +157 -71
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/bootstrap.d.ts.map +1 -1
- package/dist/orchestration/bootstrap.js +4 -2
- package/dist/orchestration/bootstrap.js.map +1 -1
- package/dist/orchestration/classify-readiness.d.ts +37 -1
- package/dist/orchestration/classify-readiness.d.ts.map +1 -1
- package/dist/orchestration/classify-readiness.js +48 -19
- package/dist/orchestration/classify-readiness.js.map +1 -1
- package/dist/orchestration/index.d.ts +4 -2
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +6 -4
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/lead-rollup.d.ts +8 -5
- package/dist/orchestration/lead-rollup.d.ts.map +1 -1
- package/dist/orchestration/lead-rollup.js +32 -15
- package/dist/orchestration/lead-rollup.js.map +1 -1
- package/dist/orchestration/owner-decision-readiness.d.ts +88 -0
- package/dist/orchestration/owner-decision-readiness.d.ts.map +1 -0
- package/dist/orchestration/owner-decision-readiness.js +152 -0
- package/dist/orchestration/owner-decision-readiness.js.map +1 -0
- package/dist/orchestration/parallel.d.ts.map +1 -1
- package/dist/orchestration/parallel.js +10 -17
- package/dist/orchestration/parallel.js.map +1 -1
- package/dist/orchestration/psyche-memory-budget.d.ts +105 -0
- package/dist/orchestration/psyche-memory-budget.d.ts.map +1 -0
- package/dist/orchestration/psyche-memory-budget.js +383 -0
- package/dist/orchestration/psyche-memory-budget.js.map +1 -0
- package/dist/orchestration/spawn-prompt.d.ts +16 -2
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +144 -181
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/spawn.d.ts +7 -0
- package/dist/orchestration/spawn.d.ts.map +1 -1
- package/dist/orchestration/spawn.js +1 -0
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/orchestration/status.d.ts +8 -3
- package/dist/orchestration/status.d.ts.map +1 -1
- package/dist/orchestration/status.js +9 -6
- package/dist/orchestration/status.js.map +1 -1
- package/dist/orchestration/wave-topic.d.ts +54 -0
- package/dist/orchestration/wave-topic.d.ts.map +1 -0
- package/dist/orchestration/wave-topic.js +68 -0
- package/dist/orchestration/wave-topic.js.map +1 -0
- package/dist/orchestration/waves.d.ts +47 -8
- package/dist/orchestration/waves.d.ts.map +1 -1
- package/dist/orchestration/waves.js +152 -43
- package/dist/orchestration/waves.js.map +1 -1
- package/dist/paths.d.ts +24 -8
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +135 -71
- package/dist/paths.js.map +1 -1
- package/dist/phases/index.d.ts.map +1 -1
- package/dist/phases/index.js +6 -2
- package/dist/phases/index.js.map +1 -1
- package/dist/platform.d.ts +6 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +8 -19
- package/dist/platform.js.map +1 -1
- package/dist/project-info.d.ts +18 -0
- package/dist/project-info.d.ts.map +1 -1
- package/dist/project-info.js +29 -1
- package/dist/project-info.js.map +1 -1
- package/dist/project-lifecycle.d.ts +91 -32
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/project-lifecycle.js +639 -75
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/project-scope.d.ts +104 -4
- package/dist/project-scope.d.ts.map +1 -1
- package/dist/project-scope.js +263 -13
- package/dist/project-scope.js.map +1 -1
- package/dist/project-tombstone.d.ts +111 -0
- package/dist/project-tombstone.d.ts.map +1 -0
- package/dist/project-tombstone.js +220 -0
- package/dist/project-tombstone.js.map +1 -0
- package/dist/release/artifacts.d.ts.map +1 -1
- package/dist/release/artifacts.js +14 -9
- package/dist/release/artifacts.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +233 -0
- package/dist/release/ci-evidence.d.ts.map +1 -0
- package/dist/release/ci-evidence.js +668 -0
- package/dist/release/ci-evidence.js.map +1 -0
- package/dist/release/engine-ops.d.ts.map +1 -1
- package/dist/release/engine-ops.js +3 -3
- package/dist/release/engine-ops.js.map +1 -1
- package/dist/release/github-pr.d.ts +30 -0
- package/dist/release/github-pr.d.ts.map +1 -1
- package/dist/release/github-pr.js +40 -0
- package/dist/release/github-pr.js.map +1 -1
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +11 -7
- package/dist/release/plan.js.map +1 -1
- package/dist/release/pr-evidence.d.ts +38 -0
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +79 -15
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +3 -2
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/release-manifest.d.ts +2 -1
- package/dist/release/release-manifest.d.ts.map +1 -1
- package/dist/release/release-manifest.js +6 -5
- package/dist/release/release-manifest.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts +4 -0
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +57 -0
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/resources/spawn-wrapper.d.ts +8 -1
- package/dist/resources/spawn-wrapper.d.ts.map +1 -1
- package/dist/resources/spawn-wrapper.js +42 -5
- package/dist/resources/spawn-wrapper.js.map +1 -1
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +1 -0
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/sagas/index.d.ts +1 -1
- package/dist/sagas/index.d.ts.map +1 -1
- package/dist/sagas/index.js +1 -1
- package/dist/sagas/index.js.map +1 -1
- package/dist/sagas/reconcile.d.ts +24 -4
- package/dist/sagas/reconcile.d.ts.map +1 -1
- package/dist/sagas/reconcile.js +226 -100
- package/dist/sagas/reconcile.js.map +1 -1
- package/dist/scaffold/ensure-config.d.ts.map +1 -1
- package/dist/scaffold/ensure-config.js +31 -1
- package/dist/scaffold/ensure-config.js.map +1 -1
- package/dist/scaffold/project-identity.d.ts +2 -8
- package/dist/scaffold/project-identity.d.ts.map +1 -1
- package/dist/scaffold/project-identity.js +5 -21
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/security/input-sanitization.d.ts +9 -1
- package/dist/security/input-sanitization.d.ts.map +1 -1
- package/dist/security/input-sanitization.js +20 -3
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +4409 -1810
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/propose-tick.d.ts.map +1 -1
- package/dist/sentient/propose-tick.js +4 -2
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +6 -23
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/engine-ops.d.ts +15 -0
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +146 -22
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/assumptions.d.ts.map +1 -1
- package/dist/sessions/assumptions.js +7 -4
- package/dist/sessions/assumptions.js.map +1 -1
- package/dist/sessions/briefing.d.ts +23 -0
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +59 -9
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/decisions.d.ts +38 -3
- package/dist/sessions/decisions.d.ts.map +1 -1
- package/dist/sessions/decisions.js +235 -21
- package/dist/sessions/decisions.js.map +1 -1
- package/dist/sessions/drift-watchdog.d.ts.map +1 -1
- package/dist/sessions/drift-watchdog.js +8 -5
- package/dist/sessions/drift-watchdog.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts +89 -1
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +97 -1
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/sessions/index.d.ts +2 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +34 -5
- 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 -3
- package/dist/sessions/session-drift.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.d.ts +26 -0
- package/dist/sessions/session-end-snapshot-entry.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot-entry.js +59 -0
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -0
- package/dist/sessions/session-end-snapshot.d.ts +114 -0
- package/dist/sessions/session-end-snapshot.d.ts.map +1 -0
- package/dist/sessions/session-end-snapshot.js +446 -0
- package/dist/sessions/session-end-snapshot.js.map +1 -0
- package/dist/sessions/session-manifest-mirror.d.ts.map +1 -1
- package/dist/sessions/session-manifest-mirror.js +10 -17
- package/dist/sessions/session-manifest-mirror.js.map +1 -1
- package/dist/sessions/session-switch.d.ts.map +1 -1
- package/dist/sessions/session-switch.js +5 -3
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/sessions/snapshot.d.ts.map +1 -1
- package/dist/sessions/snapshot.js +5 -4
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/sessions/terminal-identity.d.ts +169 -0
- package/dist/sessions/terminal-identity.d.ts.map +1 -0
- package/dist/sessions/terminal-identity.js +273 -0
- package/dist/sessions/terminal-identity.js.map +1 -0
- package/dist/setup/sections/verification.d.ts +1 -1
- package/dist/setup/sections/verification.d.ts.map +1 -1
- package/dist/setup/sections/verification.js +11 -15
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/skills/discovery.d.ts +20 -3
- package/dist/skills/discovery.d.ts.map +1 -1
- package/dist/skills/discovery.js +41 -4
- package/dist/skills/discovery.js.map +1 -1
- package/dist/skills/dispatch.d.ts +5 -2
- package/dist/skills/dispatch.d.ts.map +1 -1
- package/dist/skills/dispatch.js +5 -2
- package/dist/skills/dispatch.js.map +1 -1
- package/dist/skills/doctor.d.ts.map +1 -1
- package/dist/skills/doctor.js +5 -1
- package/dist/skills/doctor.js.map +1 -1
- package/dist/skills/federated-search.js +2 -2
- package/dist/skills/federated-search.js.map +1 -1
- package/dist/skills/index.d.ts +3 -3
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/migration.d.ts +5 -5
- package/dist/skills/migration.d.ts.map +1 -1
- package/dist/skills/migration.js +7 -9
- package/dist/skills/migration.js.map +1 -1
- package/dist/skills/orchestrator/startup.d.ts.map +1 -1
- package/dist/skills/orchestrator/startup.js +14 -7
- package/dist/skills/orchestrator/startup.js.map +1 -1
- package/dist/skills/prune-bundled.d.ts +267 -0
- package/dist/skills/prune-bundled.d.ts.map +1 -0
- package/dist/skills/prune-bundled.js +536 -0
- package/dist/skills/prune-bundled.js.map +1 -0
- package/dist/skills/skill-paths.d.ts +30 -3
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/skills/skill-paths.js +28 -9
- package/dist/skills/skill-paths.js.map +1 -1
- package/dist/skills/skill-root.d.ts +60 -11
- package/dist/skills/skill-root.d.ts.map +1 -1
- package/dist/skills/skill-root.js +100 -14
- package/dist/skills/skill-root.js.map +1 -1
- package/dist/skills/skills-guard.js +5 -5
- package/dist/skills/skills-guard.js.map +1 -1
- package/dist/skills/types.d.ts +32 -1
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/types.js +17 -34
- package/dist/skills/types.js.map +1 -1
- package/dist/spawn/agent-identity.d.ts +51 -2
- package/dist/spawn/agent-identity.d.ts.map +1 -1
- package/dist/spawn/agent-identity.js +89 -26
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/spawn/branch-lock.d.ts.map +1 -1
- package/dist/spawn/branch-lock.js +80 -79
- package/dist/spawn/branch-lock.js.map +1 -1
- package/dist/spawn/index.d.ts +2 -2
- package/dist/spawn/index.d.ts.map +1 -1
- package/dist/spawn/index.js +1 -1
- package/dist/spawn/index.js.map +1 -1
- package/dist/spawn/worktree-lock-holder.d.ts +37 -0
- package/dist/spawn/worktree-lock-holder.d.ts.map +1 -0
- package/dist/spawn/worktree-lock-holder.js +41 -0
- package/dist/spawn/worktree-lock-holder.js.map +1 -0
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +4 -2
- package/dist/stats/index.js.map +1 -1
- package/dist/sticky/convert.d.ts.map +1 -1
- package/dist/sticky/convert.js +16 -4
- package/dist/sticky/convert.js.map +1 -1
- package/dist/store/attachment-store.d.ts +14 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +11 -1
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/backup-inspect.d.ts +7 -3
- package/dist/store/backup-inspect.d.ts.map +1 -1
- package/dist/store/backup-inspect.js +18 -7
- package/dist/store/backup-inspect.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +60 -0
- package/dist/store/backup-sidecar.d.ts.map +1 -0
- package/dist/store/backup-sidecar.js +96 -0
- package/dist/store/backup-sidecar.js.map +1 -0
- package/dist/store/data-accessor.d.ts +1 -1
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +6 -6
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts +13 -4
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +31 -4
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +10 -0
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.js +4 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -1
- package/dist/store/exodus/migrate.js +1 -1
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/reconcile.js +1 -1
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +4 -3
- package/dist/store/exodus/runtime-targets.d.ts.map +1 -1
- package/dist/store/exodus/runtime-targets.js +4 -3
- package/dist/store/exodus/runtime-targets.js.map +1 -1
- package/dist/store/import-logging.d.ts.map +1 -1
- package/dist/store/import-logging.js +5 -4
- package/dist/store/import-logging.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +2 -7
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +1 -0
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +1 -0
- package/dist/store/lock.js.map +1 -1
- package/dist/store/memory-accessor.d.ts +8 -3
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +29 -13
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +5 -0
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +11 -6
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts +13 -8
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +75 -31
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +2 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +7 -3
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/pre-repair-snapshot.d.ts +77 -0
- package/dist/store/pre-repair-snapshot.d.ts.map +1 -0
- package/dist/store/pre-repair-snapshot.js +122 -0
- package/dist/store/pre-repair-snapshot.js.map +1 -0
- package/dist/store/regenerators.d.ts +2 -1
- package/dist/store/regenerators.d.ts.map +1 -1
- package/dist/store/regenerators.js +17 -3
- package/dist/store/regenerators.js.map +1 -1
- package/dist/store/relocated-store-guard.d.ts +71 -0
- package/dist/store/relocated-store-guard.d.ts.map +1 -0
- package/dist/store/relocated-store-guard.js +138 -0
- package/dist/store/relocated-store-guard.js.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +2 -2
- package/dist/store/safety-data-accessor.d.ts.map +1 -1
- package/dist/store/safety-data-accessor.js +2 -2
- package/dist/store/safety-data-accessor.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +2 -2
- package/dist/store/schema/audit.d.ts +5 -5
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/models-catalog.d.ts +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +686 -0
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +175 -7
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-project/audit.d.ts +5 -5
- package/dist/store/schema/cleo-project/docs.d.ts +3 -3
- package/dist/store/schema/cleo-project/lifecycle.d.ts +3 -3
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +6 -6
- package/dist/store/schema/cleo-shared/brain.d.ts +26 -26
- package/dist/store/schema/lifecycle.d.ts +3 -3
- package/dist/store/schema/manifest.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts +26 -26
- package/dist/store/schema/nexus-schema.d.ts +696 -2
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +175 -19
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/skills-schema.d.ts +2 -2
- package/dist/store/schema/tasks.d.ts +5 -5
- package/dist/store/session-binding-schema.d.ts +132 -0
- package/dist/store/session-binding-schema.d.ts.map +1 -0
- package/dist/store/session-binding-schema.js +53 -0
- package/dist/store/session-binding-schema.js.map +1 -0
- package/dist/store/session-store.d.ts +262 -4
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +486 -26
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/skills-db.d.ts +17 -0
- package/dist/store/skills-db.d.ts.map +1 -1
- package/dist/store/skills-db.js +30 -0
- package/dist/store/skills-db.js.map +1 -1
- package/dist/store/snapshot-gate.d.ts +239 -0
- package/dist/store/snapshot-gate.d.ts.map +1 -0
- package/dist/store/snapshot-gate.js +401 -0
- package/dist/store/snapshot-gate.js.map +1 -0
- package/dist/store/split-brain-import.js +2 -2
- package/dist/store/split-brain-import.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +55 -13
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +414 -106
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +15 -0
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +73 -4
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +15 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +75 -5
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/store-write-guard.d.ts +28 -0
- package/dist/store/store-write-guard.d.ts.map +1 -0
- package/dist/store/store-write-guard.js +50 -0
- package/dist/store/store-write-guard.js.map +1 -0
- package/dist/store/table-classification.d.ts +143 -0
- package/dist/store/table-classification.d.ts.map +1 -0
- package/dist/store/table-classification.js +1866 -0
- package/dist/store/table-classification.js.map +1 -0
- package/dist/store/task-version.d.ts +72 -0
- package/dist/store/task-version.d.ts.map +1 -0
- package/dist/store/task-version.js +93 -0
- package/dist/store/task-version.js.map +1 -0
- package/dist/store/tasks-schema.d.ts +1 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +13 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +10 -3
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +12 -3
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +320 -0
- package/dist/store/twin-collapse.d.ts.map +1 -0
- package/dist/store/twin-collapse.js +931 -0
- package/dist/store/twin-collapse.js.map +1 -0
- package/dist/store/umbrella-data-accessor.d.ts +2 -2
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +2 -2
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +63 -63
- package/dist/store/worktree-isolation-guard.d.ts +46 -24
- package/dist/store/worktree-isolation-guard.d.ts.map +1 -1
- package/dist/store/worktree-isolation-guard.js +71 -50
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +3 -67
- package/dist/system/backup.js.map +1 -1
- package/dist/system/cleo-link.d.ts +163 -0
- package/dist/system/cleo-link.d.ts.map +1 -0
- package/dist/system/cleo-link.js +246 -0
- package/dist/system/cleo-link.js.map +1 -0
- package/dist/system/dependencies.d.ts.map +1 -1
- package/dist/system/dependencies.js +3 -6
- package/dist/system/dependencies.js.map +1 -1
- package/dist/system/global-delivery.d.ts +205 -0
- package/dist/system/global-delivery.d.ts.map +1 -0
- package/dist/system/global-delivery.js +320 -0
- package/dist/system/global-delivery.js.map +1 -0
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +29 -6
- package/dist/system/health.js.map +1 -1
- package/dist/system/inject-generate.d.ts.map +1 -1
- package/dist/system/inject-generate.js +4 -4
- package/dist/system/inject-generate.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +1 -20
- package/dist/system/project-health.js.map +1 -1
- package/dist/system/runtime.d.ts.map +1 -1
- package/dist/system/runtime.js +2 -12
- package/dist/system/runtime.js.map +1 -1
- package/dist/system/safestop.d.ts.map +1 -1
- package/dist/system/safestop.js +5 -2
- package/dist/system/safestop.js.map +1 -1
- package/dist/system/skill-fixtures.d.ts +200 -0
- package/dist/system/skill-fixtures.d.ts.map +1 -0
- package/dist/system/skill-fixtures.js +331 -0
- package/dist/system/skill-fixtures.js.map +1 -0
- package/dist/task-work/index.d.ts +6 -0
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +6 -3
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +4 -2
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +218 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -0
- package/dist/tasks/affected-packages.js +496 -0
- package/dist/tasks/affected-packages.js.map +1 -0
- package/dist/tasks/affected-scope.d.ts +59 -0
- package/dist/tasks/affected-scope.d.ts.map +1 -0
- package/dist/tasks/affected-scope.js +81 -0
- package/dist/tasks/affected-scope.js.map +1 -0
- package/dist/tasks/analyze.d.ts.map +1 -1
- package/dist/tasks/analyze.js +7 -2
- package/dist/tasks/analyze.js.map +1 -1
- package/dist/tasks/change-set.d.ts +175 -0
- package/dist/tasks/change-set.d.ts.map +1 -0
- package/dist/tasks/change-set.js +753 -0
- package/dist/tasks/change-set.js.map +1 -0
- package/dist/tasks/complete.d.ts +10 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +59 -5
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/component-pr.d.ts +106 -0
- package/dist/tasks/component-pr.d.ts.map +1 -0
- package/dist/tasks/component-pr.js +190 -0
- package/dist/tasks/component-pr.js.map +1 -0
- package/dist/tasks/done-plan.d.ts +123 -0
- package/dist/tasks/done-plan.d.ts.map +1 -0
- package/dist/tasks/done-plan.js +696 -0
- package/dist/tasks/done-plan.js.map +1 -0
- package/dist/tasks/done-record.d.ts +127 -0
- package/dist/tasks/done-record.d.ts.map +1 -0
- package/dist/tasks/done-record.js +302 -0
- package/dist/tasks/done-record.js.map +1 -0
- package/dist/tasks/duplicate-detector.d.ts +68 -11
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +314 -58
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/evidence-paths.d.ts +78 -0
- package/dist/tasks/evidence-paths.d.ts.map +1 -0
- package/dist/tasks/evidence-paths.js +150 -0
- package/dist/tasks/evidence-paths.js.map +1 -0
- package/dist/tasks/evidence.d.ts +101 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +278 -31
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-preview.d.ts +5 -0
- package/dist/tasks/gate-preview.d.ts.map +1 -1
- package/dist/tasks/gate-preview.js +25 -21
- package/dist/tasks/gate-preview.js.map +1 -1
- package/dist/tasks/gate-result-cache.d.ts +205 -0
- package/dist/tasks/gate-result-cache.d.ts.map +1 -0
- package/dist/tasks/gate-result-cache.js +285 -0
- package/dist/tasks/gate-result-cache.js.map +1 -0
- package/dist/tasks/gate-runner.d.ts +126 -3
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +483 -28
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/session-scope.d.ts +3 -1
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +18 -3
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tasks/task-next.d.ts +4 -0
- package/dist/tasks/task-next.d.ts.map +1 -1
- package/dist/tasks/task-next.js +32 -28
- package/dist/tasks/task-next.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +23 -6
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +146 -8
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-vacuity.d.ts +71 -0
- package/dist/tasks/tool-vacuity.d.ts.map +1 -0
- package/dist/tasks/tool-vacuity.js +334 -0
- package/dist/tasks/tool-vacuity.js.map +1 -0
- package/dist/tasks/update.d.ts +8 -0
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +159 -78
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +18 -2
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +20 -2
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +64 -4
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/doctor/index.d.ts +1 -1
- package/dist/validation/doctor/index.d.ts.map +1 -1
- package/dist/validation/doctor/index.js +1 -1
- package/dist/validation/doctor/index.js.map +1 -1
- package/dist/validation/doctor/utils.d.ts.map +1 -1
- package/dist/validation/doctor/utils.js +7 -2
- package/dist/validation/doctor/utils.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +24 -1
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +272 -98
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/validation/validate-ops.d.ts.map +1 -1
- package/dist/validation/validate-ops.js +9 -3
- package/dist/validation/validate-ops.js.map +1 -1
- package/dist/worktree/worktree-adopt.d.ts.map +1 -1
- package/dist/worktree/worktree-adopt.js +5 -2
- package/dist/worktree/worktree-adopt.js.map +1 -1
- package/migrations/drizzle-cleo-global/20260927000000_t12469-project-locations/migration.sql +121 -0
- package/migrations/drizzle-cleo-global/20260927010000_t12543-user-profile-project-scope/migration.sql +23 -0
- package/migrations/drizzle-cleo-global/20260928010000_t12470-location-candidates/migration.sql +72 -0
- package/migrations/drizzle-cleo-global/20260928020000_t12510-nexus-devices/migration.sql +34 -0
- package/migrations/drizzle-cleo-global/20260928030000_t12511-project-git-state/migration.sql +62 -0
- package/migrations/drizzle-cleo-project/20260927000000_t12499-session-terminal-bindings/migration.sql +34 -0
- package/migrations/drizzle-cleo-project/20260928000000_t12500-binding-provider-flag/migration.sql +15 -0
- package/package.json +23 -13
- package/schemas/config.schema.json +54 -0
- package/schemas/project-context.schema.json +51 -3
- package/schemas/project-info.schema.json +28 -1
- package/templates/CLEO-INJECTION.md +40 -332
- package/templates/CLEO-REFERENCE.md +303 -0
- package/templates/workflows/README.md +36 -14
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git state probe for project locations (`nexus_project_git_state`, T12511).
|
|
3
|
+
*
|
|
4
|
+
* For every location of every project on THIS device, record branch, HEAD,
|
|
5
|
+
* detached/shallow, dirty and untracked counts, upstream, ahead/behind, remote
|
|
6
|
+
* URL and remote head, and when the remote was last fetched. Other devices
|
|
7
|
+
* sharing the store read those rows to answer "which machines is this project
|
|
8
|
+
* on, where, and in what state".
|
|
9
|
+
*
|
|
10
|
+
* ## Bounded
|
|
11
|
+
*
|
|
12
|
+
* - Locations are probed {@link GIT_STATE_DEFAULTS.concurrency} at a time.
|
|
13
|
+
* - Every git call of one location shares ONE deadline ({@link GitStateProbeOptions.timeoutMs}).
|
|
14
|
+
* Git runs in its own process group, and on expiry the whole group is
|
|
15
|
+
* SIGKILLed — a credential helper or ssh child that inherited git's pipes
|
|
16
|
+
* would otherwise keep the call alive after git itself died.
|
|
17
|
+
* - `GIT_TERMINAL_PROMPT=0` and `GIT_OPTIONAL_LOCKS=0`: git never waits on a
|
|
18
|
+
* prompt, and `status` never takes `index.lock` (so it neither blocks nor is
|
|
19
|
+
* blocked by a concurrent `git` in the same checkout).
|
|
20
|
+
*
|
|
21
|
+
* ## No network unless asked
|
|
22
|
+
*
|
|
23
|
+
* `git fetch` runs only with `fetch: true`. Otherwise ahead/behind and the
|
|
24
|
+
* remote head come from the local tracking ref — i.e. the LAST fetch — and
|
|
25
|
+
* `remoteFetchedAt` is that fetch's instant (the newest `FETCH_HEAD` mtime of
|
|
26
|
+
* the worktree and common git dirs). `remoteStale` is set when that instant is
|
|
27
|
+
* unknown or older than {@link GitStateProbeOptions.staleAfterMs}, so a
|
|
28
|
+
* `behind: 0` is never presented as current on the strength of an old fetch.
|
|
29
|
+
*
|
|
30
|
+
* ## Errors are rows
|
|
31
|
+
*
|
|
32
|
+
* A location that cannot be probed — missing directory, EACCES, not a git
|
|
33
|
+
* repo, timeout, git failure — still yields a row, with `probeErrorCode` and
|
|
34
|
+
* `probeError` set and every field that WAS learned kept. Nothing throws out
|
|
35
|
+
* of {@link probeGitState}; nothing is filtered out of {@link probeGitStates}.
|
|
36
|
+
*
|
|
37
|
+
* @task T12511
|
|
38
|
+
* @epic T12496
|
|
39
|
+
*/
|
|
40
|
+
import { constants as fsConstants } from 'node:fs';
|
|
41
|
+
import { access, readFile, realpath, stat } from 'node:fs/promises';
|
|
42
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
43
|
+
import { and, eq, inArray, ne } from 'drizzle-orm';
|
|
44
|
+
import { DEADLINE_EXCEEDED, DEFAULT_GIT_MAX_OUTPUT_BYTES, filterConfig, GitOutputBudget, runBoundedGit, withDeadline, } from '../git/bounded-git.js';
|
|
45
|
+
import { parseConfiguredGitRoot } from '../git/work-tree.js';
|
|
46
|
+
import { runWithConcurrency } from '../lib/concurrency.js';
|
|
47
|
+
import { projectGitState, projectLocations, projectRegistry, } from '../store/schema/nexus-schema.js';
|
|
48
|
+
import { adoptLocalDeviceRows, currentDeviceId } from './path-map.js';
|
|
49
|
+
/** Defaults and limits for the git state probe. */
|
|
50
|
+
export const GIT_STATE_DEFAULTS = {
|
|
51
|
+
/** Locations probed at once. */
|
|
52
|
+
concurrency: 8,
|
|
53
|
+
/** Upper bound on `concurrency`. */
|
|
54
|
+
maxConcurrency: 64,
|
|
55
|
+
/** Per-location budget without a fetch, ms. */
|
|
56
|
+
timeoutMs: 10_000,
|
|
57
|
+
/** Per-location budget with a fetch, ms. */
|
|
58
|
+
fetchTimeoutMs: 30_000,
|
|
59
|
+
/** A fetch older than this is stale, ms (24 h). */
|
|
60
|
+
staleAfterMs: 24 * 60 * 60 * 1000,
|
|
61
|
+
/** Git output held in memory at once across the whole run, bytes. */
|
|
62
|
+
runOutputBudgetBytes: 64 * 1024 * 1024,
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Parse `git status --porcelain=v2 --branch -z`.
|
|
66
|
+
*
|
|
67
|
+
* @param raw - NUL-separated status output.
|
|
68
|
+
* @returns Branch headers and entry counts.
|
|
69
|
+
*/
|
|
70
|
+
export function parsePorcelainV2Status(raw) {
|
|
71
|
+
const parsed = {
|
|
72
|
+
headSha: null,
|
|
73
|
+
branch: null,
|
|
74
|
+
detached: false,
|
|
75
|
+
upstream: null,
|
|
76
|
+
ahead: null,
|
|
77
|
+
behind: null,
|
|
78
|
+
dirtyCount: 0,
|
|
79
|
+
untrackedCount: 0,
|
|
80
|
+
};
|
|
81
|
+
const fields = raw.split('\0');
|
|
82
|
+
for (let i = 0; i < fields.length; i++) {
|
|
83
|
+
const f = fields[i];
|
|
84
|
+
if (f.startsWith('# branch.oid ')) {
|
|
85
|
+
const oid = f.slice('# branch.oid '.length);
|
|
86
|
+
parsed.headSha = oid === '(initial)' ? null : oid;
|
|
87
|
+
}
|
|
88
|
+
else if (f.startsWith('# branch.head ')) {
|
|
89
|
+
const head = f.slice('# branch.head '.length);
|
|
90
|
+
parsed.detached = head === '(detached)';
|
|
91
|
+
parsed.branch = parsed.detached ? null : head;
|
|
92
|
+
}
|
|
93
|
+
else if (f.startsWith('# branch.upstream ')) {
|
|
94
|
+
parsed.upstream = f.slice('# branch.upstream '.length);
|
|
95
|
+
}
|
|
96
|
+
else if (f.startsWith('# branch.ab ')) {
|
|
97
|
+
const m = /^\+(\d+) -(\d+)$/.exec(f.slice('# branch.ab '.length));
|
|
98
|
+
if (m) {
|
|
99
|
+
parsed.ahead = Number(m[1]);
|
|
100
|
+
parsed.behind = Number(m[2]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (f.startsWith('1 ') || f.startsWith('u ')) {
|
|
104
|
+
parsed.dirtyCount++;
|
|
105
|
+
}
|
|
106
|
+
else if (f.startsWith('2 ')) {
|
|
107
|
+
parsed.dirtyCount++;
|
|
108
|
+
i++; // a rename/copy entry is followed by its original path
|
|
109
|
+
}
|
|
110
|
+
else if (f.startsWith('? ')) {
|
|
111
|
+
parsed.untrackedCount++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return parsed;
|
|
115
|
+
}
|
|
116
|
+
/** Remote a branch tracks, every remote's URL, and every filter driver name. */
|
|
117
|
+
function parseProbeConfig(raw) {
|
|
118
|
+
const branchRemote = new Map();
|
|
119
|
+
const remoteUrl = new Map();
|
|
120
|
+
const filters = new Set();
|
|
121
|
+
// `-z`: each entry is `key\nvalue\0`.
|
|
122
|
+
for (const entry of raw.split('\0')) {
|
|
123
|
+
const nl = entry.indexOf('\n');
|
|
124
|
+
const key = nl < 0 ? entry : entry.slice(0, nl);
|
|
125
|
+
const value = nl < 0 ? '' : entry.slice(nl + 1);
|
|
126
|
+
if (key.startsWith('branch.') && key.endsWith('.remote')) {
|
|
127
|
+
branchRemote.set(key.slice('branch.'.length, -'.remote'.length), value);
|
|
128
|
+
}
|
|
129
|
+
else if (key.startsWith('remote.') && key.endsWith('.url')) {
|
|
130
|
+
const name = key.slice('remote.'.length, -'.url'.length);
|
|
131
|
+
if (!remoteUrl.has(name))
|
|
132
|
+
remoteUrl.set(name, value);
|
|
133
|
+
}
|
|
134
|
+
else if (key.startsWith('filter.')) {
|
|
135
|
+
const name = key.slice('filter.'.length, key.lastIndexOf('.'));
|
|
136
|
+
if (name.length > 0)
|
|
137
|
+
filters.add(name);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { branchRemote, remoteUrl, filters };
|
|
141
|
+
}
|
|
142
|
+
/** Schemes whose userinfo user is an account name, not a credential. */
|
|
143
|
+
const SSH_SCHEMES = new Set(['ssh', 'git+ssh', 'ssh+git']);
|
|
144
|
+
/**
|
|
145
|
+
* Remove credentials from a remote URL before it is stored or shown.
|
|
146
|
+
*
|
|
147
|
+
* - `scheme://user:pass@host/…` (http, https, ftp, git, …) → `scheme://host/…`:
|
|
148
|
+
* for these schemes even a bare user is typically a token.
|
|
149
|
+
* - `ssh://user:pass@host/…` → `ssh://user@host/…`: the ssh login (`git`) is not
|
|
150
|
+
* a secret; a password is.
|
|
151
|
+
* - scp-style `user:pass@host:path` → `user@host:path`.
|
|
152
|
+
* - A query string or fragment is dropped (`?access_token=…`).
|
|
153
|
+
* - Local paths and `file://` are otherwise unchanged.
|
|
154
|
+
*
|
|
155
|
+
* @param raw - Configured remote URL.
|
|
156
|
+
* @returns The URL without secrets.
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* redactRemoteUrl('https://alice:ghp_x@github.com/o/r.git'); // 'https://github.com/o/r.git'
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export function redactRemoteUrl(raw) {
|
|
163
|
+
// A query or fragment can carry a token (`?access_token=…`); a remote URL
|
|
164
|
+
// never needs one to identify the repository.
|
|
165
|
+
const url = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(raw) ? raw.replace(/[?#].*$/s, '') : raw;
|
|
166
|
+
const withScheme = /^([a-zA-Z][a-zA-Z0-9+.-]*):\/\/([^/?#]*)@(.*)$/s.exec(url);
|
|
167
|
+
if (withScheme) {
|
|
168
|
+
const [, scheme = '', userinfo = '', rest = ''] = withScheme;
|
|
169
|
+
if (!SSH_SCHEMES.has(scheme.toLowerCase()))
|
|
170
|
+
return `${scheme}://${rest}`;
|
|
171
|
+
const user = userinfo.split(':')[0] ?? '';
|
|
172
|
+
return user.length > 0 ? `${scheme}://${user}@${rest}` : `${scheme}://${rest}`;
|
|
173
|
+
}
|
|
174
|
+
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(url))
|
|
175
|
+
return url;
|
|
176
|
+
const scp = /^([^@/]+)@([^/:]+:.*)$/s.exec(url);
|
|
177
|
+
if (scp) {
|
|
178
|
+
const [, userinfo = '', rest = ''] = scp;
|
|
179
|
+
return `${userinfo.split(':')[0]}@${rest}`;
|
|
180
|
+
}
|
|
181
|
+
return url;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Apply {@link redactRemoteUrl} to every URL embedded in free text (git's
|
|
185
|
+
* stderr quotes the remote URL verbatim, credentials included).
|
|
186
|
+
*
|
|
187
|
+
* @param text - Message text.
|
|
188
|
+
* @returns The text with URL credentials removed.
|
|
189
|
+
*/
|
|
190
|
+
export function redactUrlsInText(text) {
|
|
191
|
+
return text.replace(/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s'"<>]+/g, (url) => redactRemoteUrl(url));
|
|
192
|
+
}
|
|
193
|
+
/** Newest mtime among the given files, or `null` when none exists. */
|
|
194
|
+
async function newestMtime(paths) {
|
|
195
|
+
let newest = null;
|
|
196
|
+
for (const p of paths) {
|
|
197
|
+
try {
|
|
198
|
+
const s = await stat(p);
|
|
199
|
+
if (newest === null || s.mtime > newest)
|
|
200
|
+
newest = s.mtime;
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// absent — never fetched from this git dir
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return newest;
|
|
207
|
+
}
|
|
208
|
+
/** First meaningful line of git's stderr, for a row's `probeError`. */
|
|
209
|
+
function gitMessage(run, fallback) {
|
|
210
|
+
const line = run.stderr
|
|
211
|
+
.split('\n')
|
|
212
|
+
.map((l) => l.trim())
|
|
213
|
+
.find((l) => l.length > 0);
|
|
214
|
+
return line ?? `${fallback} (exit ${String(run.code)})`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Probe one location. Never throws: every failure is a row with
|
|
218
|
+
* `probeErrorCode` set.
|
|
219
|
+
*
|
|
220
|
+
* @param target - The location.
|
|
221
|
+
* @param options - Timeout, fetch, staleness, clock and git overrides.
|
|
222
|
+
* @returns The location's git state.
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* const row = await probeGitState({ projectId: 'p', deviceId: 'd', path: '/w/p' });
|
|
226
|
+
* if (row.probeErrorCode) console.error(row.probeError);
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
export async function probeGitState(target, options = {}) {
|
|
230
|
+
const now = options.now ?? (() => new Date());
|
|
231
|
+
const gitBin = options.gitBin ?? 'git';
|
|
232
|
+
const maxOutputBytes = options.maxOutputBytes ?? DEFAULT_GIT_MAX_OUTPUT_BYTES;
|
|
233
|
+
const doFetch = options.fetch === true;
|
|
234
|
+
const timeoutMs = options.timeoutMs ??
|
|
235
|
+
(doFetch ? GIT_STATE_DEFAULTS.fetchTimeoutMs : GIT_STATE_DEFAULTS.timeoutMs);
|
|
236
|
+
const staleAfterMs = options.staleAfterMs ?? GIT_STATE_DEFAULTS.staleAfterMs;
|
|
237
|
+
const started = Date.now();
|
|
238
|
+
const deadline = started + timeoutMs;
|
|
239
|
+
const probedAt = now();
|
|
240
|
+
const row = {
|
|
241
|
+
projectId: target.projectId,
|
|
242
|
+
projectName: target.projectName ?? null,
|
|
243
|
+
deviceId: target.deviceId,
|
|
244
|
+
current: true,
|
|
245
|
+
path: target.path,
|
|
246
|
+
gitRoot: null,
|
|
247
|
+
branch: null,
|
|
248
|
+
headSha: null,
|
|
249
|
+
detached: false,
|
|
250
|
+
shallow: false,
|
|
251
|
+
dirtyCount: null,
|
|
252
|
+
untrackedCount: null,
|
|
253
|
+
upstream: null,
|
|
254
|
+
ahead: null,
|
|
255
|
+
behind: null,
|
|
256
|
+
remoteName: null,
|
|
257
|
+
remoteUrl: null,
|
|
258
|
+
remoteHeadSha: null,
|
|
259
|
+
remoteFetchedAt: null,
|
|
260
|
+
remoteStale: false,
|
|
261
|
+
probedAt: probedAt.toISOString(),
|
|
262
|
+
durationMs: 0,
|
|
263
|
+
probeErrorCode: null,
|
|
264
|
+
probeError: null,
|
|
265
|
+
};
|
|
266
|
+
const fail = (code, message) => {
|
|
267
|
+
row.probeErrorCode = code;
|
|
268
|
+
row.probeError = redactUrlsInText(message);
|
|
269
|
+
row.durationMs = Date.now() - started;
|
|
270
|
+
return row;
|
|
271
|
+
};
|
|
272
|
+
const failRun = (run, what) => {
|
|
273
|
+
if (run.timedOut) {
|
|
274
|
+
return fail('E_GIT_TIMEOUT', `${what} exceeded ${timeoutMs}ms; git process group killed`);
|
|
275
|
+
}
|
|
276
|
+
if (run.overflowed) {
|
|
277
|
+
return fail('E_GIT_FAILED', `${what} output exceeded ${maxOutputBytes} bytes (or the run-wide output budget); killed`);
|
|
278
|
+
}
|
|
279
|
+
if (run.spawnError !== null)
|
|
280
|
+
return fail('E_GIT_FAILED', `cannot run git: ${run.stderr}`);
|
|
281
|
+
return fail('E_GIT_FAILED', gitMessage(run, what));
|
|
282
|
+
};
|
|
283
|
+
const git = (args, cwd, config = []) => runBoundedGit(args, { cwd, deadline, gitBin, maxOutputBytes, config, budget: options.budget });
|
|
284
|
+
const fsTimeout = (what) => fail('E_GIT_TIMEOUT', `${what} of ${target.path} exceeded ${timeoutMs}ms (filesystem)`);
|
|
285
|
+
// 1. The directory itself — bounded: a dead mount must not stall the row.
|
|
286
|
+
try {
|
|
287
|
+
const s = await withDeadline(stat(target.path), deadline);
|
|
288
|
+
if (s === DEADLINE_EXCEEDED)
|
|
289
|
+
return fsTimeout('stat');
|
|
290
|
+
if (!s.isDirectory())
|
|
291
|
+
return fail('E_PATH_MISSING', `not a directory: ${target.path}`);
|
|
292
|
+
const ok = await withDeadline(access(target.path, fsConstants.R_OK | fsConstants.X_OK), deadline);
|
|
293
|
+
if (ok === DEADLINE_EXCEEDED)
|
|
294
|
+
return fsTimeout('access');
|
|
295
|
+
}
|
|
296
|
+
catch (e) {
|
|
297
|
+
const code = e.code;
|
|
298
|
+
if (code === 'ENOENT' || code === 'ENOTDIR') {
|
|
299
|
+
return fail('E_PATH_MISSING', `directory does not exist: ${target.path}`);
|
|
300
|
+
}
|
|
301
|
+
if (code === 'EACCES' || code === 'EPERM') {
|
|
302
|
+
return fail('E_PATH_ACCESS', `${code}: cannot read ${target.path}`);
|
|
303
|
+
}
|
|
304
|
+
return fail('E_PATH_ACCESS', `${code ?? 'error'}: ${e.message}`);
|
|
305
|
+
}
|
|
306
|
+
// 2. Which work tree: the path, else its declared evidence.gitRoot (a CLEO
|
|
307
|
+
// root that parents several repositories — gh#1462 · T12308).
|
|
308
|
+
const revParseArgs = [
|
|
309
|
+
'rev-parse',
|
|
310
|
+
'--absolute-git-dir',
|
|
311
|
+
'--git-common-dir',
|
|
312
|
+
'--is-shallow-repository',
|
|
313
|
+
'--show-toplevel',
|
|
314
|
+
];
|
|
315
|
+
let runDir = target.path;
|
|
316
|
+
let rev = await git(revParseArgs, runDir);
|
|
317
|
+
if (rev.code !== 0 && !rev.timedOut && rev.spawnError === null) {
|
|
318
|
+
if (/not a git repository/i.test(rev.stderr)) {
|
|
319
|
+
const contextFile = join(target.path, '.cleo', 'project-context.json');
|
|
320
|
+
const raw = await withDeadline(readFile(contextFile, 'utf-8').catch(() => null), deadline);
|
|
321
|
+
if (raw === DEADLINE_EXCEEDED)
|
|
322
|
+
return fsTimeout('reading .cleo/project-context.json');
|
|
323
|
+
const declared = raw === null ? null : parseConfiguredGitRoot(raw);
|
|
324
|
+
if (declared === null) {
|
|
325
|
+
return fail('E_NOT_GIT_REPO', `not inside a git work tree: ${target.path}`);
|
|
326
|
+
}
|
|
327
|
+
runDir = isAbsolute(declared) ? declared : resolve(target.path, declared);
|
|
328
|
+
rev = await git(revParseArgs, runDir);
|
|
329
|
+
if (rev.code !== 0 && !rev.timedOut && !rev.overflowed) {
|
|
330
|
+
return fail('E_NOT_GIT_REPO', `declared git root ${runDir} (from .cleo/project-context.json evidence.gitRoot="${declared}") is not a git work tree: ${gitMessage(rev, 'git rev-parse')}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (rev.code !== 0)
|
|
335
|
+
return failRun(rev, 'git rev-parse');
|
|
336
|
+
const [gitDir, commonDirRaw, shallow, toplevel] = rev.stdout.trim().split('\n');
|
|
337
|
+
row.shallow = shallow === 'true';
|
|
338
|
+
row.gitRoot = toplevel ?? runDir;
|
|
339
|
+
const commonDir = commonDirRaw === undefined
|
|
340
|
+
? undefined
|
|
341
|
+
: isAbsolute(commonDirRaw)
|
|
342
|
+
? commonDirRaw
|
|
343
|
+
: resolve(runDir, commonDirRaw);
|
|
344
|
+
// 3. Remotes and filter drivers. Reading config runs no repository code;
|
|
345
|
+
// the filter names are what lets every later call disable them.
|
|
346
|
+
const config = await git([
|
|
347
|
+
'config',
|
|
348
|
+
'-z',
|
|
349
|
+
'--get-regexp',
|
|
350
|
+
'^(branch\\..+\\.remote|remote\\..+\\.url|filter\\..+\\.(clean|smudge|process))$',
|
|
351
|
+
], runDir);
|
|
352
|
+
// exit 1 = nothing matched (no remotes, no filters).
|
|
353
|
+
if (config.code !== 0 && config.code !== 1)
|
|
354
|
+
return failRun(config, 'git config');
|
|
355
|
+
const cfg = parseProbeConfig(config.code === 0 ? config.stdout : '');
|
|
356
|
+
const noFilters = filterConfig(cfg.filters);
|
|
357
|
+
// 4. Optional fetch — non-fatal: the row still describes the local state
|
|
358
|
+
// and the previous fetch.
|
|
359
|
+
let fetchFailure = null;
|
|
360
|
+
if (doFetch) {
|
|
361
|
+
const fetched = await git([
|
|
362
|
+
'fetch',
|
|
363
|
+
'--quiet',
|
|
364
|
+
'--no-recurse-submodules',
|
|
365
|
+
// Beats `remote.<name>.uploadpack`; a config override does not (the
|
|
366
|
+
// first configured value wins for that key).
|
|
367
|
+
'--upload-pack=git-upload-pack',
|
|
368
|
+
], runDir, noFilters);
|
|
369
|
+
if (fetched.timedOut)
|
|
370
|
+
return failRun(fetched, 'git fetch');
|
|
371
|
+
if (fetched.code !== 0)
|
|
372
|
+
fetchFailure = gitMessage(fetched, 'git fetch');
|
|
373
|
+
}
|
|
374
|
+
// 5. Status. Submodule work trees are not entered (`dirty`): a child git
|
|
375
|
+
// there would read that repository's own, unenumerated filters.
|
|
376
|
+
const status = await git(
|
|
377
|
+
// --no-renames: rename detection reads blob contents, which in a partial
|
|
378
|
+
// clone means a lazy fetch (GIT_NO_LAZY_FETCH also forbids it).
|
|
379
|
+
['status', '--porcelain=v2', '--branch', '-z', '--ignore-submodules=dirty', '--no-renames'], runDir, noFilters);
|
|
380
|
+
if (status.code !== 0)
|
|
381
|
+
return failRun(status, 'git status');
|
|
382
|
+
const parsed = parsePorcelainV2Status(status.stdout);
|
|
383
|
+
row.headSha = parsed.headSha;
|
|
384
|
+
row.branch = parsed.branch;
|
|
385
|
+
row.detached = parsed.detached;
|
|
386
|
+
row.upstream = parsed.upstream;
|
|
387
|
+
row.ahead = parsed.ahead;
|
|
388
|
+
row.behind = parsed.behind;
|
|
389
|
+
row.dirtyCount = parsed.dirtyCount;
|
|
390
|
+
row.untrackedCount = parsed.untrackedCount;
|
|
391
|
+
const tracked = parsed.branch !== null ? cfg.branchRemote.get(parsed.branch) : undefined;
|
|
392
|
+
row.remoteName =
|
|
393
|
+
tracked ?? (cfg.remoteUrl.has('origin') ? 'origin' : ([...cfg.remoteUrl.keys()][0] ?? null));
|
|
394
|
+
const url = row.remoteName !== null ? cfg.remoteUrl.get(row.remoteName) : undefined;
|
|
395
|
+
// Never store or share a token or password embedded in the URL.
|
|
396
|
+
row.remoteUrl = url === undefined ? null : redactRemoteUrl(url);
|
|
397
|
+
// 6. Upstream tracking-ref commit (as of the last fetch).
|
|
398
|
+
if (parsed.upstream !== null) {
|
|
399
|
+
const up = await git(['rev-parse', '--verify', '--quiet', '@{upstream}'], runDir);
|
|
400
|
+
if (up.timedOut || up.overflowed)
|
|
401
|
+
return failRun(up, 'git rev-parse @{upstream}');
|
|
402
|
+
// exit 1: upstream configured but its tracking ref is gone — leave null.
|
|
403
|
+
if (up.code === 0)
|
|
404
|
+
row.remoteHeadSha = up.stdout.trim() || null;
|
|
405
|
+
}
|
|
406
|
+
// 7. Remote freshness: FETCH_HEAD is per-worktree, the tracking refs are
|
|
407
|
+
// shared, so a fetch from any worktree of this repo counts.
|
|
408
|
+
const fetchedAt = await withDeadline(newestMtime([gitDir, commonDir]
|
|
409
|
+
.filter((d) => typeof d === 'string' && d.length > 0)
|
|
410
|
+
.map((d) => join(d, 'FETCH_HEAD'))), deadline);
|
|
411
|
+
if (fetchedAt === DEADLINE_EXCEEDED)
|
|
412
|
+
return fsTimeout('stat of FETCH_HEAD');
|
|
413
|
+
row.remoteFetchedAt = fetchedAt?.toISOString() ?? null;
|
|
414
|
+
row.remoteStale = isRemoteStale(row, probedAt, staleAfterMs);
|
|
415
|
+
if (fetchFailure !== null)
|
|
416
|
+
return fail('E_FETCH_FAILED', fetchFailure);
|
|
417
|
+
row.durationMs = Date.now() - started;
|
|
418
|
+
return row;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Whether a row's remote state is stale at `now`: it has a remote, and its
|
|
422
|
+
* last fetch is unknown or older than `staleAfterMs`. A repository with no
|
|
423
|
+
* remote has nothing to be stale against.
|
|
424
|
+
*
|
|
425
|
+
* @param row - Row with `remoteName` and `remoteFetchedAt`.
|
|
426
|
+
* @param now - Reference instant.
|
|
427
|
+
* @param staleAfterMs - Staleness window.
|
|
428
|
+
* @returns `true` when the remote fields should not be trusted as current.
|
|
429
|
+
*/
|
|
430
|
+
export function isRemoteStale(row, now, staleAfterMs) {
|
|
431
|
+
if (row.remoteName === null && row.upstream === null)
|
|
432
|
+
return false;
|
|
433
|
+
if (row.remoteFetchedAt === null)
|
|
434
|
+
return true;
|
|
435
|
+
return now.getTime() - Date.parse(row.remoteFetchedAt) > staleAfterMs;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Probe many locations with bounded concurrency. Every target yields exactly
|
|
439
|
+
* one row, in input order.
|
|
440
|
+
*
|
|
441
|
+
* @param targets - Locations to probe.
|
|
442
|
+
* @param options - Concurrency, timeout, fetch and staleness options.
|
|
443
|
+
* @returns One row per target.
|
|
444
|
+
* @example
|
|
445
|
+
* ```ts
|
|
446
|
+
* const rows = await probeGitStates(targets, { concurrency: 8, timeoutMs: 5000 });
|
|
447
|
+
* ```
|
|
448
|
+
*/
|
|
449
|
+
export async function probeGitStates(targets, options = {}) {
|
|
450
|
+
return runWithConcurrency(targets, clampConcurrency(options.concurrency), (t) => probeGitState(t, options));
|
|
451
|
+
}
|
|
452
|
+
/** Clamp a requested concurrency to `1..maxConcurrency`, defaulting when absent. */
|
|
453
|
+
function clampConcurrency(requested) {
|
|
454
|
+
const n = requested === undefined || !Number.isFinite(requested)
|
|
455
|
+
? GIT_STATE_DEFAULTS.concurrency
|
|
456
|
+
: Math.trunc(requested);
|
|
457
|
+
return Math.min(GIT_STATE_DEFAULTS.maxConcurrency, Math.max(1, n));
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* This device's locations worth probing: `live` and `missing` (a missing one
|
|
461
|
+
* yields an `E_PATH_MISSING` row, which is the fact another device wants).
|
|
462
|
+
*
|
|
463
|
+
* @param db - Global registry handle.
|
|
464
|
+
* @param deviceId - This device's id.
|
|
465
|
+
* @returns Probe targets with project names.
|
|
466
|
+
*/
|
|
467
|
+
export function listLocalProbeTargets(db, deviceId) {
|
|
468
|
+
adoptLocalDeviceRows(db, deviceId);
|
|
469
|
+
return db
|
|
470
|
+
.select({
|
|
471
|
+
projectId: projectLocations.projectId,
|
|
472
|
+
deviceId: projectLocations.deviceId,
|
|
473
|
+
path: projectLocations.path,
|
|
474
|
+
projectName: projectRegistry.name,
|
|
475
|
+
})
|
|
476
|
+
.from(projectLocations)
|
|
477
|
+
.leftJoin(projectRegistry, eq(projectRegistry.projectId, projectLocations.projectId))
|
|
478
|
+
.where(and(eq(projectLocations.deviceId, deviceId), inArray(projectLocations.state, ['live', 'missing'])))
|
|
479
|
+
.orderBy(projectLocations.projectId, projectLocations.path)
|
|
480
|
+
.all();
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Upsert probe rows into `nexus_project_git_state`, one transaction. With
|
|
484
|
+
* `pruneDeviceId`, that device's rows not in `rows` are deleted in the same
|
|
485
|
+
* transaction.
|
|
486
|
+
*
|
|
487
|
+
* @param db - Global registry handle.
|
|
488
|
+
* @param rows - Probe results.
|
|
489
|
+
* @param options - `pruneDeviceId`: the device whose full row set `rows` is.
|
|
490
|
+
*/
|
|
491
|
+
export function recordGitStates(db, rows, options = {}) {
|
|
492
|
+
if (rows.length === 0 && options.pruneDeviceId === undefined)
|
|
493
|
+
return;
|
|
494
|
+
db.transaction((tx) => {
|
|
495
|
+
if (options.pruneDeviceId !== undefined) {
|
|
496
|
+
// A row whose location is no longer probed (superseded, deleted,
|
|
497
|
+
// deduplicated) must not linger as this device's current state.
|
|
498
|
+
const keep = new Set(rows.map((r) => `${r.projectId}\0${r.path}`));
|
|
499
|
+
const existing = tx
|
|
500
|
+
.select({ projectId: projectGitState.projectId, path: projectGitState.path })
|
|
501
|
+
.from(projectGitState)
|
|
502
|
+
.where(eq(projectGitState.deviceId, options.pruneDeviceId))
|
|
503
|
+
.all();
|
|
504
|
+
for (const e of existing) {
|
|
505
|
+
if (keep.has(`${e.projectId}\0${e.path}`))
|
|
506
|
+
continue;
|
|
507
|
+
tx.delete(projectGitState)
|
|
508
|
+
.where(and(eq(projectGitState.projectId, e.projectId), eq(projectGitState.deviceId, options.pruneDeviceId), eq(projectGitState.path, e.path)))
|
|
509
|
+
.run();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
for (const r of rows) {
|
|
513
|
+
const values = {
|
|
514
|
+
gitRoot: r.gitRoot,
|
|
515
|
+
branch: r.branch,
|
|
516
|
+
headSha: r.headSha,
|
|
517
|
+
detached: r.detached,
|
|
518
|
+
shallow: r.shallow,
|
|
519
|
+
dirtyCount: r.dirtyCount,
|
|
520
|
+
untrackedCount: r.untrackedCount,
|
|
521
|
+
upstream: r.upstream,
|
|
522
|
+
ahead: r.ahead,
|
|
523
|
+
behind: r.behind,
|
|
524
|
+
remoteName: r.remoteName,
|
|
525
|
+
remoteUrl: r.remoteUrl,
|
|
526
|
+
remoteHeadSha: r.remoteHeadSha,
|
|
527
|
+
remoteFetchedAt: r.remoteFetchedAt,
|
|
528
|
+
probedAt: r.probedAt,
|
|
529
|
+
durationMs: r.durationMs,
|
|
530
|
+
probeErrorCode: r.probeErrorCode,
|
|
531
|
+
probeError: r.probeError,
|
|
532
|
+
};
|
|
533
|
+
tx.insert(projectGitState)
|
|
534
|
+
.values({ projectId: r.projectId, deviceId: r.deviceId, path: r.path, ...values })
|
|
535
|
+
.onConflictDoUpdate({
|
|
536
|
+
target: [projectGitState.projectId, projectGitState.deviceId, projectGitState.path],
|
|
537
|
+
set: values,
|
|
538
|
+
})
|
|
539
|
+
.run();
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Read recorded git state rows, recomputing `remoteStale` at `now`.
|
|
545
|
+
*
|
|
546
|
+
* @param db - Global registry handle.
|
|
547
|
+
* @param options - `excludeDeviceId` to skip one device (this one), clock and window.
|
|
548
|
+
* @returns Stored rows, by project then device then path.
|
|
549
|
+
*/
|
|
550
|
+
export function listGitStates(db, options = {}) {
|
|
551
|
+
const now = options.now ?? new Date();
|
|
552
|
+
const staleAfterMs = options.staleAfterMs ?? GIT_STATE_DEFAULTS.staleAfterMs;
|
|
553
|
+
const self = currentDeviceId();
|
|
554
|
+
return db
|
|
555
|
+
.select({ row: projectGitState, projectName: projectRegistry.name })
|
|
556
|
+
.from(projectGitState)
|
|
557
|
+
.leftJoin(projectRegistry, eq(projectRegistry.projectId, projectGitState.projectId))
|
|
558
|
+
.where(options.excludeDeviceId !== undefined
|
|
559
|
+
? ne(projectGitState.deviceId, options.excludeDeviceId)
|
|
560
|
+
: undefined)
|
|
561
|
+
.orderBy(projectGitState.projectId, projectGitState.deviceId, projectGitState.path)
|
|
562
|
+
.all()
|
|
563
|
+
.map(({ row, projectName }) => storedToState(row, projectName, self, now, staleAfterMs));
|
|
564
|
+
}
|
|
565
|
+
/** Convert a stored row to the contract shape. */
|
|
566
|
+
function storedToState(row, projectName, self, now, staleAfterMs) {
|
|
567
|
+
const state = {
|
|
568
|
+
projectId: row.projectId,
|
|
569
|
+
projectName,
|
|
570
|
+
deviceId: row.deviceId,
|
|
571
|
+
current: row.deviceId === self,
|
|
572
|
+
path: row.path,
|
|
573
|
+
gitRoot: row.gitRoot,
|
|
574
|
+
branch: row.branch,
|
|
575
|
+
headSha: row.headSha,
|
|
576
|
+
detached: row.detached,
|
|
577
|
+
shallow: row.shallow,
|
|
578
|
+
dirtyCount: row.dirtyCount,
|
|
579
|
+
untrackedCount: row.untrackedCount,
|
|
580
|
+
upstream: row.upstream,
|
|
581
|
+
ahead: row.ahead,
|
|
582
|
+
behind: row.behind,
|
|
583
|
+
remoteName: row.remoteName,
|
|
584
|
+
remoteUrl: row.remoteUrl,
|
|
585
|
+
remoteHeadSha: row.remoteHeadSha,
|
|
586
|
+
remoteFetchedAt: row.remoteFetchedAt,
|
|
587
|
+
remoteStale: false,
|
|
588
|
+
probedAt: row.probedAt,
|
|
589
|
+
durationMs: row.durationMs,
|
|
590
|
+
probeErrorCode: row.probeErrorCode,
|
|
591
|
+
probeError: row.probeError,
|
|
592
|
+
};
|
|
593
|
+
state.remoteStale = isRemoteStale(state, now, staleAfterMs);
|
|
594
|
+
return state;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Drop targets of the same project whose paths resolve to the same directory
|
|
598
|
+
* (a symlink and its target, `/tmp` and `/private/tmp`), keeping the first.
|
|
599
|
+
* Each `realpath` is bounded by `timeoutMs`; an unresolvable path is kept
|
|
600
|
+
* as-is so its probe records the error.
|
|
601
|
+
*/
|
|
602
|
+
async function dedupeByRealPath(targets, concurrency, timeoutMs) {
|
|
603
|
+
const real = await runWithConcurrency(targets, concurrency, async (t) => {
|
|
604
|
+
const r = await withDeadline(realpath(t.path).catch(() => t.path), Date.now() + timeoutMs);
|
|
605
|
+
return r === DEADLINE_EXCEEDED ? t.path : r;
|
|
606
|
+
});
|
|
607
|
+
const seen = new Set();
|
|
608
|
+
return targets.filter((t, i) => {
|
|
609
|
+
const key = `${t.projectId}\0${real[i] ?? t.path}`;
|
|
610
|
+
if (seen.has(key))
|
|
611
|
+
return false;
|
|
612
|
+
seen.add(key);
|
|
613
|
+
return true;
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Probe and record every location on this device, and return the fresh rows
|
|
618
|
+
* together with the last recorded rows of every other device.
|
|
619
|
+
*
|
|
620
|
+
* @param db - Global registry handle.
|
|
621
|
+
* @param params - Fetch, concurrency, timeout and staleness.
|
|
622
|
+
* @param overrides - Device id, clock and git executable (tests).
|
|
623
|
+
* @returns The status result.
|
|
624
|
+
* @example
|
|
625
|
+
* ```ts
|
|
626
|
+
* const res = await runProjectsGitStatus(await getNexusRegistryDb(getCleoHome()), {});
|
|
627
|
+
* ```
|
|
628
|
+
*/
|
|
629
|
+
export async function runProjectsGitStatus(db, params = {}, overrides = {}) {
|
|
630
|
+
const started = Date.now();
|
|
631
|
+
const deviceId = overrides.deviceId ?? currentDeviceId();
|
|
632
|
+
const fetch = params.fetch === true;
|
|
633
|
+
const concurrency = clampConcurrency(params.concurrency);
|
|
634
|
+
const timeoutMs = params.timeoutMs !== undefined && params.timeoutMs > 0
|
|
635
|
+
? Math.trunc(params.timeoutMs)
|
|
636
|
+
: fetch
|
|
637
|
+
? GIT_STATE_DEFAULTS.fetchTimeoutMs
|
|
638
|
+
: GIT_STATE_DEFAULTS.timeoutMs;
|
|
639
|
+
const staleAfterMs = params.staleAfterMs !== undefined && params.staleAfterMs >= 0
|
|
640
|
+
? params.staleAfterMs
|
|
641
|
+
: GIT_STATE_DEFAULTS.staleAfterMs;
|
|
642
|
+
const targets = await dedupeByRealPath(listLocalProbeTargets(db, deviceId), concurrency, timeoutMs);
|
|
643
|
+
const rows = await probeGitStates(targets, {
|
|
644
|
+
budget: new GitOutputBudget(GIT_STATE_DEFAULTS.runOutputBudgetBytes),
|
|
645
|
+
fetch,
|
|
646
|
+
concurrency,
|
|
647
|
+
timeoutMs,
|
|
648
|
+
staleAfterMs,
|
|
649
|
+
now: overrides.now,
|
|
650
|
+
gitBin: overrides.gitBin,
|
|
651
|
+
});
|
|
652
|
+
recordGitStates(db, rows, { pruneDeviceId: deviceId });
|
|
653
|
+
const otherDevices = listGitStates(db, {
|
|
654
|
+
excludeDeviceId: deviceId,
|
|
655
|
+
now: overrides.now?.(),
|
|
656
|
+
staleAfterMs,
|
|
657
|
+
});
|
|
658
|
+
return {
|
|
659
|
+
rows,
|
|
660
|
+
otherDevices,
|
|
661
|
+
count: rows.length,
|
|
662
|
+
deviceId,
|
|
663
|
+
fetched: fetch,
|
|
664
|
+
concurrency,
|
|
665
|
+
timeoutMs,
|
|
666
|
+
staleAfterMs,
|
|
667
|
+
durationMs: Date.now() - started,
|
|
668
|
+
summary: {
|
|
669
|
+
ok: rows.filter((r) => r.probeErrorCode === null).length,
|
|
670
|
+
errored: rows.filter((r) => r.probeErrorCode !== null).length,
|
|
671
|
+
timedOut: rows.filter((r) => r.probeErrorCode === 'E_GIT_TIMEOUT').length,
|
|
672
|
+
dirty: rows.filter((r) => (r.dirtyCount ?? 0) + (r.untrackedCount ?? 0) > 0).length,
|
|
673
|
+
remoteStale: rows.filter((r) => r.remoteStale).length,
|
|
674
|
+
},
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
//# sourceMappingURL=git-state.js.map
|