@cleocode/core 2026.3.76 → 2026.4.2
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/agents/agent-schema.d.ts.map +1 -1
- package/dist/audit.d.ts +1 -1
- package/dist/audit.d.ts.map +1 -1
- package/dist/bootstrap.d.ts +2 -2
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/caamp/adapter.d.ts +6 -49
- package/dist/caamp/adapter.d.ts.map +1 -1
- package/dist/caamp/index.d.ts +2 -2
- package/dist/caamp/index.d.ts.map +1 -1
- package/dist/code/index.d.ts +10 -0
- package/dist/code/index.d.ts.map +1 -0
- package/dist/code/outline.d.ts +51 -0
- package/dist/code/outline.d.ts.map +1 -0
- package/dist/code/parser.d.ts +32 -0
- package/dist/code/parser.d.ts.map +1 -0
- package/dist/code/search.d.ts +42 -0
- package/dist/code/search.d.ts.map +1 -0
- package/dist/code/unfold.d.ts +44 -0
- package/dist/code/unfold.d.ts.map +1 -0
- package/dist/compliance/protocol-enforcement.d.ts +1 -1
- package/dist/compliance/protocol-rules.d.ts +1 -1
- package/dist/compliance/protocol-types.d.ts +2 -3
- package/dist/compliance/protocol-types.d.ts.map +1 -1
- package/dist/conduit/conduit-client.d.ts +14 -0
- package/dist/conduit/conduit-client.d.ts.map +1 -1
- package/dist/conduit/factory.d.ts +11 -1
- package/dist/conduit/factory.d.ts.map +1 -1
- package/dist/conduit/http-transport.d.ts +17 -5
- package/dist/conduit/http-transport.d.ts.map +1 -1
- package/dist/conduit/index.d.ts +5 -2
- package/dist/conduit/index.d.ts.map +1 -1
- package/dist/conduit/local-transport.d.ts +91 -0
- package/dist/conduit/local-transport.d.ts.map +1 -0
- package/dist/conduit/sse-transport.d.ts +68 -0
- package/dist/conduit/sse-transport.d.ts.map +1 -0
- package/dist/crypto/credentials.d.ts.map +1 -1
- package/dist/error-catalog.d.ts +3 -3
- package/dist/error-catalog.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/hooks/handlers/index.d.ts +2 -2
- package/dist/hooks/handlers/index.d.ts.map +1 -1
- package/dist/hooks/handlers/notification-hooks.d.ts +31 -0
- package/dist/hooks/handlers/notification-hooks.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4646 -3476
- package/dist/index.js.map +4 -4
- package/dist/init.d.ts +6 -6
- package/dist/init.d.ts.map +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/internal.d.ts +7 -5
- package/dist/internal.d.ts.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/tree-sitter-languages.d.ts +29 -0
- package/dist/lib/tree-sitter-languages.d.ts.map +1 -0
- package/dist/logger.d.ts +3 -3
- package/dist/memory/brain-links.d.ts.map +1 -1
- package/dist/memory/brain-maintenance.d.ts +13 -0
- package/dist/memory/brain-maintenance.d.ts.map +1 -1
- package/dist/memory/brain-retrieval.d.ts +1 -1
- package/dist/memory/brain-retrieval.d.ts.map +1 -1
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/engine-compat.d.ts +392 -25
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/index.d.ts +416 -3
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/metrics/token-service.d.ts +3 -3
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/orchestration/hierarchy.d.ts +32 -0
- package/dist/orchestration/hierarchy.d.ts.map +1 -0
- package/dist/orchestration/index.d.ts +1 -0
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/paths.d.ts +335 -2
- package/dist/paths.d.ts.map +1 -1
- package/dist/routing/capability-matrix.d.ts +3 -3
- package/dist/routing/capability-matrix.d.ts.map +1 -1
- package/dist/scaffold.d.ts +422 -11
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/security/input-sanitization.d.ts +2 -2
- package/dist/skills/dynamic-skill-generator.d.ts +3 -2
- package/dist/skills/dynamic-skill-generator.d.ts.map +1 -1
- package/dist/skills/routing-table.d.ts +4 -4
- package/dist/skills/routing-table.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts +10 -433
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/cross-db-cleanup.d.ts +34 -0
- package/dist/store/cross-db-cleanup.d.ts.map +1 -1
- package/dist/store/provider.d.ts +1 -1
- package/dist/store/signaldock-sqlite.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite.d.ts +1 -1
- package/dist/store/task-store.d.ts.map +1 -1
- package/dist/store/tasks-schema.d.ts +4 -228
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/validation-schemas.d.ts +4 -5
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/system/archive-analytics.d.ts +1 -1
- package/dist/system/health.d.ts +2 -2
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/runtime.d.ts +2 -1
- package/dist/system/runtime.d.ts.map +1 -1
- package/dist/tasks/list.d.ts +1 -1
- package/dist/tasks/list.d.ts.map +1 -1
- package/dist/tasks/task-ops.d.ts +415 -3
- package/dist/tasks/task-ops.d.ts.map +1 -1
- package/dist/templates/parser.d.ts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/upgrade.d.ts +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/validation/operation-gate-validators.d.ts +1 -1
- package/dist/validation/operation-verification-gates.d.ts +3 -3
- package/dist/validation/param-utils.d.ts +6 -5
- package/dist/validation/param-utils.d.ts.map +1 -1
- package/dist/validation/validate-ops.d.ts +1 -1
- package/dist/validation/validate-ops.d.ts.map +1 -1
- package/package.json +19 -7
- package/src/__tests__/caamp-skill-install.test.js +0 -15
- package/src/__tests__/caamp-skill-install.test.js.map +1 -1
- package/src/__tests__/caamp-skill-install.test.ts +0 -16
- package/src/__tests__/injection-mvi-tiers.test.js +7 -7
- package/src/__tests__/injection-mvi-tiers.test.js.map +1 -1
- package/src/__tests__/injection-mvi-tiers.test.ts +55 -103
- package/src/agents/agent-schema.ts +2 -5
- package/src/audit.ts +2 -2
- package/src/bootstrap.ts +5 -39
- package/src/caamp/adapter.ts +3 -219
- package/src/caamp/index.ts +1 -13
- package/src/cant/__tests__/cant-agent-parse.test.d.ts.map +1 -0
- package/src/cant/__tests__/cant-agent-parse.test.js +77 -0
- package/src/cant/__tests__/cant-agent-parse.test.js.map +1 -0
- package/src/code/index.ts +10 -0
- package/src/code/outline.ts +214 -0
- package/src/code/parser.ts +331 -0
- package/src/code/search.ts +173 -0
- package/src/code/unfold.ts +204 -0
- package/src/codebase-map/analyzers/architecture.ts +2 -2
- package/src/compliance/protocol-enforcement.ts +1 -1
- package/src/compliance/protocol-rules.ts +1 -1
- package/src/compliance/protocol-types.ts +2 -3
- package/src/conduit/__tests__/dual-api-e2e.test.d.ts.map +1 -0
- package/src/conduit/__tests__/dual-api-e2e.test.js +178 -0
- package/src/conduit/__tests__/dual-api-e2e.test.js.map +1 -0
- package/src/conduit/__tests__/dual-api-e2e.test.ts +212 -0
- package/src/conduit/__tests__/local-credential-flow.test.d.ts.map +1 -0
- package/src/conduit/__tests__/local-credential-flow.test.js +185 -0
- package/src/conduit/__tests__/local-credential-flow.test.js.map +1 -0
- package/src/conduit/__tests__/local-credential-flow.test.ts +230 -0
- package/src/conduit/__tests__/local-transport.test.d.ts.map +1 -0
- package/src/conduit/__tests__/local-transport.test.js +404 -0
- package/src/conduit/__tests__/local-transport.test.js.map +1 -0
- package/src/conduit/__tests__/local-transport.test.ts +509 -0
- package/src/conduit/__tests__/sse-transport.test.d.ts.map +1 -0
- package/src/conduit/__tests__/sse-transport.test.js +291 -0
- package/src/conduit/__tests__/sse-transport.test.js.map +1 -0
- package/src/conduit/__tests__/sse-transport.test.ts +344 -0
- package/src/conduit/conduit-client.ts +14 -0
- package/src/conduit/factory.ts +29 -8
- package/src/conduit/http-transport.ts +78 -16
- package/src/conduit/index.ts +5 -2
- package/src/conduit/local-transport.ts +309 -0
- package/src/conduit/sse-transport.ts +382 -0
- package/src/crypto/credentials.ts +59 -13
- package/src/error-catalog.ts +3 -3
- package/src/errors.ts +1 -1
- package/src/hooks/__tests__/provider-hooks.test.js +4 -4
- package/src/hooks/__tests__/provider-hooks.test.js.map +1 -1
- package/src/hooks/__tests__/provider-hooks.test.ts +4 -4
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +2 -2
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +1 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.ts +6 -4
- package/src/hooks/handlers/index.ts +2 -6
- package/src/hooks/handlers/notification-hooks.ts +65 -0
- package/src/index.ts +2 -1
- package/src/init.ts +14 -54
- package/src/injection.ts +4 -3
- package/src/internal.ts +7 -5
- package/src/lib/index.ts +8 -0
- package/src/lib/tree-sitter-languages.ts +88 -0
- package/src/logger.ts +5 -5
- package/src/memory/__tests__/brain-links.test.js +13 -0
- package/src/memory/__tests__/brain-links.test.js.map +1 -1
- package/src/memory/__tests__/brain-links.test.ts +14 -0
- package/src/memory/__tests__/brain-retrieval.test.js +9 -0
- package/src/memory/__tests__/brain-retrieval.test.js.map +1 -1
- package/src/memory/__tests__/brain-retrieval.test.ts +10 -0
- package/src/memory/__tests__/session-memory.test.js +16 -0
- package/src/memory/__tests__/session-memory.test.js.map +1 -1
- package/src/memory/__tests__/session-memory.test.ts +17 -0
- package/src/memory/brain-links.ts +17 -0
- package/src/memory/brain-maintenance.ts +33 -1
- package/src/memory/brain-retrieval.ts +19 -3
- package/src/memory/decisions.ts +18 -2
- package/src/memory/engine-compat.ts +392 -25
- package/src/memory/index.ts +417 -4
- package/src/metrics/token-service.ts +4 -4
- package/src/migration/index.ts +1 -1
- package/src/orchestration/hierarchy.ts +202 -0
- package/src/orchestration/index.ts +1 -0
- package/src/paths.ts +340 -5
- package/src/routing/capability-matrix.ts +49 -49
- package/src/scaffold.ts +428 -70
- package/src/security/input-sanitization.ts +4 -4
- package/src/sessions/__tests__/session-grade.integration.test.js +9 -9
- package/src/sessions/__tests__/session-grade.integration.test.ts +9 -9
- package/src/sessions/__tests__/session-grade.test.js +10 -10
- package/src/sessions/__tests__/session-grade.test.js.map +1 -1
- package/src/sessions/__tests__/session-grade.test.ts +10 -10
- package/src/sessions/session-grade.ts +4 -4
- package/src/skills/__tests__/dynamic-skill-generator.test.js +24 -26
- package/src/skills/__tests__/dynamic-skill-generator.test.js.map +1 -1
- package/src/skills/__tests__/dynamic-skill-generator.test.ts +24 -26
- package/src/skills/__tests__/routing-table.test.js +22 -22
- package/src/skills/__tests__/routing-table.test.js.map +1 -1
- package/src/skills/__tests__/routing-table.test.ts +23 -23
- package/src/skills/dynamic-skill-generator.ts +13 -24
- package/src/skills/routing-table.ts +4 -4
- package/src/store/__tests__/data-safety-central.test.js +8 -0
- package/src/store/__tests__/data-safety-central.test.js.map +1 -1
- package/src/store/__tests__/data-safety-central.test.ts +8 -0
- package/src/store/__tests__/safety-accessor.test.js +8 -0
- package/src/store/__tests__/safety-accessor.test.js.map +1 -1
- package/src/store/__tests__/safety-accessor.test.ts +8 -0
- package/src/store/agent-registry-accessor.ts +284 -108
- package/src/store/cross-db-cleanup.ts +175 -1
- package/src/store/provider.ts +2 -2
- package/src/store/signaldock-sqlite.ts +262 -60
- package/src/store/sqlite-data-accessor.ts +3 -0
- package/src/store/sqlite.ts +2 -2
- package/src/store/task-store.ts +8 -1
- package/src/store/tasks-schema.ts +5 -40
- package/src/system/__tests__/health.test.js +2 -2
- package/src/system/__tests__/health.test.js.map +1 -1
- package/src/system/__tests__/health.test.ts +2 -2
- package/src/system/archive-analytics.ts +1 -1
- package/src/system/health.ts +43 -19
- package/src/system/inject-generate.ts +20 -20
- package/src/system/runtime.ts +5 -4
- package/src/tasks/atomicity.ts +1 -1
- package/src/tasks/list.ts +1 -1
- package/src/tasks/task-ops.ts +415 -3
- package/src/templates/parser.ts +1 -1
- package/src/ui/index.ts +4 -4
- package/src/upgrade.ts +3 -14
- package/src/validation/operation-gate-validators.ts +1 -1
- package/src/validation/operation-verification-gates.ts +3 -3
- package/src/validation/param-utils.ts +11 -10
- package/src/validation/validate-ops.ts +6 -6
- package/templates/CLEO-INJECTION.md +38 -110
- package/dist/hooks/handlers/mcp-hooks.d.ts +0 -48
- package/dist/hooks/handlers/mcp-hooks.d.ts.map +0 -1
- package/dist/mcp/index.d.ts +0 -42
- package/dist/mcp/index.d.ts.map +0 -1
- package/src/__tests__/audit-prune.test.d.ts +0 -2
- package/src/__tests__/caamp-skill-install.test.d.ts +0 -14
- package/src/__tests__/cli-mcp-parity.integration.test.d.ts +0 -34
- package/src/__tests__/cli-mcp-parity.integration.test.d.ts.map +0 -1
- package/src/__tests__/cli-mcp-parity.integration.test.js +0 -898
- package/src/__tests__/cli-mcp-parity.integration.test.js.map +0 -1
- package/src/__tests__/cli-parity.test.d.ts +0 -9
- package/src/__tests__/config.test.d.ts +0 -7
- package/src/__tests__/core-parity.test.d.ts +0 -17
- package/src/__tests__/error-catalog.test.d.ts +0 -2
- package/src/__tests__/golden-parity.test.d.ts +0 -12
- package/src/__tests__/hooks.test.d.ts +0 -5
- package/src/__tests__/human-output.test.d.ts +0 -12
- package/src/__tests__/index-api-compat.test.d.ts +0 -2
- package/src/__tests__/init-e2e.test.d.ts +0 -12
- package/src/__tests__/injection-chain.test.d.ts +0 -18
- package/src/__tests__/injection-mvi-tiers.test.d.ts +0 -14
- package/src/__tests__/injection-shared.test.d.ts +0 -10
- package/src/__tests__/lafs-conformance.test.d.ts +0 -18
- package/src/__tests__/logger.test.d.ts +0 -2
- package/src/__tests__/mcp-install-verify.test.d.ts +0 -13
- package/src/__tests__/mcp-install-verify.test.d.ts.map +0 -1
- package/src/__tests__/mcp-install-verify.test.js +0 -177
- package/src/__tests__/mcp-install-verify.test.js.map +0 -1
- package/src/__tests__/mcp-install-verify.test.ts +0 -217
- package/src/__tests__/paths.test.d.ts +0 -7
- package/src/__tests__/project-info.test.d.ts +0 -2
- package/src/__tests__/rcsd-pipeline-e2e.test.d.ts +0 -14
- package/src/__tests__/remote.test.d.ts +0 -6
- package/src/__tests__/scaffold.test.d.ts +0 -6
- package/src/__tests__/schema-management.test.d.ts +0 -5
- package/src/__tests__/schema.test.d.ts +0 -2
- package/src/__tests__/sharing.test.d.ts +0 -6
- package/src/__tests__/snapshot.test.d.ts +0 -6
- package/src/__tests__/upgrade.test.d.ts +0 -7
- package/src/adapters/__tests__/discovery.test.d.ts +0 -6
- package/src/adapters/__tests__/manager.test.d.ts +0 -6
- package/src/agents/__tests__/agent-registry.test.d.ts +0 -12
- package/src/agents/__tests__/capacity.test.d.ts +0 -7
- package/src/agents/__tests__/execution-learning.test.d.ts +0 -14
- package/src/agents/__tests__/health-monitor.test.d.ts +0 -10
- package/src/agents/__tests__/registry.test.d.ts +0 -8
- package/src/agents/__tests__/retry.test.d.ts +0 -7
- package/src/compliance/__tests__/sync.test.d.ts +0 -5
- package/src/hooks/__tests__/provider-hooks.test.d.ts +0 -2
- package/src/hooks/__tests__/registry.test.d.ts +0 -2
- package/src/hooks/handlers/__tests__/error-hooks.test.d.ts +0 -2
- package/src/hooks/handlers/__tests__/file-hooks.test.d.ts +0 -2
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.d.ts +0 -13
- package/src/hooks/handlers/__tests__/mcp-hooks.test.d.ts +0 -2
- package/src/hooks/handlers/__tests__/mcp-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/mcp-hooks.test.js +0 -119
- package/src/hooks/handlers/__tests__/mcp-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/mcp-hooks.test.ts +0 -150
- package/src/hooks/handlers/__tests__/session-hooks.test.d.ts +0 -2
- package/src/hooks/handlers/__tests__/task-hooks.test.d.ts +0 -2
- package/src/hooks/handlers/mcp-hooks.ts +0 -162
- package/src/intelligence/__tests__/adaptive-validation.test.d.ts +0 -11
- package/src/intelligence/__tests__/impact.test.d.ts +0 -16
- package/src/intelligence/__tests__/patterns.test.d.ts +0 -8
- package/src/intelligence/__tests__/prediction.test.d.ts +0 -8
- package/src/lib/__tests__/retry.test.d.ts +0 -7
- package/src/lifecycle/__tests__/chain-store.test.d.ts +0 -10
- package/src/lifecycle/__tests__/consolidate-rcasd.test.d.ts +0 -7
- package/src/lifecycle/__tests__/default-chain.test.d.ts +0 -7
- package/src/lifecycle/__tests__/frontmatter.test.d.ts +0 -7
- package/src/lifecycle/__tests__/lifecycle.test.d.ts +0 -7
- package/src/lifecycle/__tests__/pipeline.integration.test.d.ts +0 -19
- package/src/lifecycle/__tests__/rcasd-paths.test.d.ts +0 -7
- package/src/lifecycle/__tests__/resume-schema-contract.test.d.ts +0 -16
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.d.ts +0 -7
- package/src/lifecycle/__tests__/tessera-engine.test.d.ts +0 -10
- package/src/mcp/index.ts +0 -163
- package/src/memory/__tests__/auto-extract.test.d.ts +0 -7
- package/src/memory/__tests__/brain-automation.test.d.ts +0 -11
- package/src/memory/__tests__/brain-embedding.test.d.ts +0 -2
- package/src/memory/__tests__/brain-links.test.d.ts +0 -8
- package/src/memory/__tests__/brain-migration.test.d.ts +0 -8
- package/src/memory/__tests__/brain-retrieval.test.d.ts +0 -10
- package/src/memory/__tests__/brain-search.test.d.ts +0 -8
- package/src/memory/__tests__/claude-mem-migration.test.d.ts +0 -12
- package/src/memory/__tests__/decisions.test.d.ts +0 -8
- package/src/memory/__tests__/engine-compat.test.d.ts +0 -12
- package/src/memory/__tests__/memory-bridge.test.d.ts +0 -10
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.d.ts +0 -13
- package/src/memory/__tests__/session-memory.test.d.ts +0 -9
- package/src/metrics/__tests__/model-provider-registry.test.d.ts +0 -2
- package/src/metrics/__tests__/provider-detection.test.d.ts +0 -2
- package/src/migration/__tests__/checksum.test.d.ts +0 -8
- package/src/migration/__tests__/logger.test.d.ts +0 -5
- package/src/migration/__tests__/migration-failure.integration.test.d.ts +0 -15
- package/src/migration/__tests__/migration.test.d.ts +0 -13
- package/src/migration/__tests__/state.test.d.ts +0 -8
- package/src/migration/__tests__/validate.test.d.ts +0 -8
- package/src/nexus/__tests__/deps.test.d.ts +0 -7
- package/src/nexus/__tests__/nexus-e2e.test.d.ts +0 -12
- package/src/nexus/__tests__/permissions.test.d.ts +0 -7
- package/src/nexus/__tests__/query.test.d.ts +0 -7
- package/src/nexus/__tests__/reconcile.test.d.ts +0 -7
- package/src/nexus/__tests__/registry.test.d.ts +0 -7
- package/src/nexus/__tests__/transfer.test.d.ts +0 -8
- package/src/observability/__tests__/index.test.d.ts +0 -7
- package/src/observability/__tests__/log-filter.test.d.ts +0 -7
- package/src/observability/__tests__/log-parser.test.d.ts +0 -7
- package/src/observability/__tests__/log-reader.test.d.ts +0 -7
- package/src/orchestration/__tests__/autonomous-spec.test.d.ts +0 -9
- package/src/orchestration/__tests__/orchestration.test.d.ts +0 -7
- package/src/orchestration/__tests__/protocol-validators.test.d.ts +0 -9
- package/src/phases/__tests__/deps.test.d.ts +0 -7
- package/src/phases/__tests__/phases.test.d.ts +0 -7
- package/src/release/__tests__/artifacts.test.d.ts +0 -7
- package/src/release/__tests__/cancel-release.test.d.ts +0 -10
- package/src/release/__tests__/changelog-writer.test.d.ts +0 -6
- package/src/release/__tests__/push-policy.test.d.ts +0 -14
- package/src/release/__tests__/release.test.d.ts +0 -11
- package/src/sequence/__tests__/allocate.test.d.ts +0 -6
- package/src/sessions/__tests__/briefing-blocked.test.d.ts +0 -6
- package/src/sessions/__tests__/briefing.test.d.ts +0 -11
- package/src/sessions/__tests__/handoff-integration.test.d.ts +0 -8
- package/src/sessions/__tests__/handoff.test.d.ts +0 -11
- package/src/sessions/__tests__/index.test.d.ts +0 -2
- package/src/sessions/__tests__/session-cleanup.test.d.ts +0 -7
- package/src/sessions/__tests__/session-edge-cases.test.d.ts +0 -9
- package/src/sessions/__tests__/session-find.test.d.ts +0 -9
- package/src/sessions/__tests__/session-grade.integration.test.d.ts +0 -11
- package/src/sessions/__tests__/session-grade.test.d.ts +0 -6
- package/src/sessions/__tests__/session-memory-bridge.test.d.ts +0 -2
- package/src/sessions/__tests__/sessions.test.d.ts +0 -7
- package/src/skills/__tests__/discovery.test.d.ts +0 -6
- package/src/skills/__tests__/dispatch.test.d.ts +0 -6
- package/src/skills/__tests__/dynamic-skill-generator.test.d.ts +0 -2
- package/src/skills/__tests__/manifests.test.d.ts +0 -6
- package/src/skills/__tests__/precedence.test.d.ts +0 -6
- package/src/skills/__tests__/routing-table.test.d.ts +0 -2
- package/src/skills/__tests__/skill-paths.test.d.ts +0 -7
- package/src/skills/__tests__/test-utility.test.d.ts +0 -7
- package/src/skills/__tests__/token.test.d.ts +0 -6
- package/src/skills/__tests__/validation.test.d.ts +0 -6
- package/src/skills/__tests__/version.test.d.ts +0 -5
- package/src/skills/injection/__tests__/subagent.test.d.ts +0 -2
- package/src/skills/orchestrator/__tests__/spawn-tier.test.d.ts +0 -2
- package/src/spawn/__tests__/adapter-registry.test.d.ts +0 -2
- package/src/stats/__tests__/stats.test.d.ts +0 -7
- package/src/sticky/__tests__/purge.test.d.ts +0 -9
- package/src/store/__tests__/atomic.test.d.ts +0 -7
- package/src/store/__tests__/backup.test.d.ts +0 -7
- package/src/store/__tests__/brain-accessor-pageindex.test.d.ts +0 -12
- package/src/store/__tests__/brain-accessor.test.d.ts +0 -10
- package/src/store/__tests__/brain-pageindex.test.d.ts +0 -11
- package/src/store/__tests__/brain-schema.test.d.ts +0 -11
- package/src/store/__tests__/brain-vec.test.d.ts +0 -11
- package/src/store/__tests__/collision-detection.test.d.ts +0 -11
- package/src/store/__tests__/data-safety-central.test.d.ts +0 -20
- package/src/store/__tests__/db-helpers.test.d.ts +0 -7
- package/src/store/__tests__/e2e-safety-integration.test.d.ts +0 -13
- package/src/store/__tests__/git-checkpoint.test.d.ts +0 -7
- package/src/store/__tests__/idempotent-migration.test.d.ts +0 -5
- package/src/store/__tests__/import-logging.test.d.ts +0 -7
- package/src/store/__tests__/import-sort.test.d.ts +0 -7
- package/src/store/__tests__/json.test.d.ts +0 -7
- package/src/store/__tests__/lifecycle-schema-parity.test.d.ts +0 -2
- package/src/store/__tests__/migration-integration.test.d.ts +0 -15
- package/src/store/__tests__/migration-retry.test.d.ts +0 -10
- package/src/store/__tests__/migration-safety.test.d.ts +0 -21
- package/src/store/__tests__/migration-sqlite.test.d.ts +0 -11
- package/src/store/__tests__/performance-safety.test.d.ts +0 -17
- package/src/store/__tests__/project-detect.test.d.ts +0 -6
- package/src/store/__tests__/project-registry.test.d.ts +0 -7
- package/src/store/__tests__/provider.test.d.ts +0 -9
- package/src/store/__tests__/relations.test.d.ts +0 -9
- package/src/store/__tests__/safety-accessor.test.d.ts +0 -18
- package/src/store/__tests__/sequence-validation.test.d.ts +0 -11
- package/src/store/__tests__/session-store.test.d.ts +0 -11
- package/src/store/__tests__/sqlite-backup.test.d.ts +0 -14
- package/src/store/__tests__/sqlite.test.d.ts +0 -11
- package/src/store/__tests__/task-store.test.d.ts +0 -11
- package/src/store/__tests__/test-db-helper.d.ts +0 -61
- package/src/store/__tests__/write-verification.test.d.ts +0 -11
- package/src/system/__tests__/cleanup.test.d.ts +0 -2
- package/src/system/__tests__/health.test.d.ts +0 -2
- package/src/task-work/__tests__/start-deps.test.d.ts +0 -6
- package/src/tasks/__tests__/add.test.d.ts +0 -7
- package/src/tasks/__tests__/archive.test.d.ts +0 -7
- package/src/tasks/__tests__/assignee.test.d.ts +0 -14
- package/src/tasks/__tests__/atomicity.test.d.ts +0 -6
- package/src/tasks/__tests__/cancel-ops.test.d.ts +0 -7
- package/src/tasks/__tests__/complete-unblocks.test.d.ts +0 -6
- package/src/tasks/__tests__/complete.test.d.ts +0 -7
- package/src/tasks/__tests__/delete.test.d.ts +0 -7
- package/src/tasks/__tests__/dependency-check.test.d.ts +0 -7
- package/src/tasks/__tests__/deps-ready.test.d.ts +0 -6
- package/src/tasks/__tests__/epic-enforcement.test.d.ts +0 -15
- package/src/tasks/__tests__/find.test.d.ts +0 -7
- package/src/tasks/__tests__/graph-ops.test.d.ts +0 -7
- package/src/tasks/__tests__/hierarchy-policy.test.d.ts +0 -6
- package/src/tasks/__tests__/hierarchy.test.d.ts +0 -7
- package/src/tasks/__tests__/id-generator.test.d.ts +0 -2
- package/src/tasks/__tests__/labels.test.d.ts +0 -7
- package/src/tasks/__tests__/list.test.d.ts +0 -7
- package/src/tasks/__tests__/minimal-test.test.d.ts +0 -2
- package/src/tasks/__tests__/phase-tracking.test.d.ts +0 -7
- package/src/tasks/__tests__/pipeline-stage.test.d.ts +0 -14
- package/src/tasks/__tests__/plan-priority.test.d.ts +0 -10
- package/src/tasks/__tests__/priority-normalization.test.d.ts +0 -7
- package/src/tasks/__tests__/relates.test.d.ts +0 -9
- package/src/tasks/__tests__/show-deps.test.d.ts +0 -6
- package/src/tasks/__tests__/show.test.d.ts +0 -7
- package/src/tasks/__tests__/staleness.test.d.ts +0 -7
- package/src/tasks/__tests__/task-ops-depends.test.d.ts +0 -6
- package/src/tasks/__tests__/update.test.d.ts +0 -7
- package/src/validation/__tests__/chain-validation.test.d.ts +0 -7
- package/src/validation/__tests__/compliance.test.d.ts +0 -7
- package/src/validation/__tests__/docs-sync.test.d.ts +0 -7
- package/src/validation/__tests__/doctor-gitignore.test.d.ts +0 -7
- package/src/validation/__tests__/doctor-injection.test.d.ts +0 -11
- package/src/validation/__tests__/doctor.test.d.ts +0 -7
- package/src/validation/__tests__/engine.test.d.ts +0 -7
- package/src/validation/__tests__/manifest.test.d.ts +0 -7
- package/src/validation/__tests__/protocol-common.test.d.ts +0 -7
- package/src/validation/__tests__/verification.test.d.ts +0 -7
package/src/paths.ts
CHANGED
|
@@ -17,6 +17,20 @@ import { getPlatformPaths } from './system/platform-paths.js';
|
|
|
17
17
|
/**
|
|
18
18
|
* Check if a CLEO project is initialized at the given root.
|
|
19
19
|
* Checks for tasks.db.
|
|
20
|
+
*
|
|
21
|
+
* @param projectRoot - Absolute path to check; defaults to the resolved project root
|
|
22
|
+
* @returns True if .cleo/ and tasks.db exist at the given root
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* A project is considered initialized when both the .cleo/ directory and
|
|
26
|
+
* the tasks.db SQLite database file are present.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* if (isProjectInitialized('/my/project')) {
|
|
31
|
+
* console.log('CLEO project found');
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
20
34
|
*/
|
|
21
35
|
export function isProjectInitialized(projectRoot?: string): boolean {
|
|
22
36
|
const root = projectRoot ?? getProjectRoot();
|
|
@@ -29,6 +43,17 @@ export function isProjectInitialized(projectRoot?: string): boolean {
|
|
|
29
43
|
* Respects CLEO_HOME env var; otherwise uses the OS-appropriate data path
|
|
30
44
|
* via env-paths (XDG_DATA_HOME on Linux, Library/Application Support on macOS,
|
|
31
45
|
* %LOCALAPPDATA% on Windows).
|
|
46
|
+
*
|
|
47
|
+
* @returns Absolute path to the global CLEO data directory
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Delegates to `getPlatformPaths().data` which uses the `env-paths` package
|
|
51
|
+
* for XDG-compliant path resolution across operating systems.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const home = getCleoHome(); // e.g. "/home/user/.local/share/cleo"
|
|
56
|
+
* ```
|
|
32
57
|
*/
|
|
33
58
|
export function getCleoHome(): string {
|
|
34
59
|
return getPlatformPaths().data;
|
|
@@ -36,6 +61,17 @@ export function getCleoHome(): string {
|
|
|
36
61
|
|
|
37
62
|
/**
|
|
38
63
|
* Get the global CLEO templates directory.
|
|
64
|
+
*
|
|
65
|
+
* @returns Absolute path to the templates directory under CLEO home
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* Returns `{cleoHome}/templates` where CLEO-INJECTION.md and other global
|
|
69
|
+
* templates are stored.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const dir = getCleoTemplatesDir(); // e.g. "/home/user/.local/share/cleo/templates"
|
|
74
|
+
* ```
|
|
39
75
|
*/
|
|
40
76
|
export function getCleoTemplatesDir(): string {
|
|
41
77
|
return join(getCleoHome(), 'templates');
|
|
@@ -43,6 +79,17 @@ export function getCleoTemplatesDir(): string {
|
|
|
43
79
|
|
|
44
80
|
/**
|
|
45
81
|
* Get the global CLEO schemas directory.
|
|
82
|
+
*
|
|
83
|
+
* @returns Absolute path to the schemas directory under CLEO home
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* Returns `{cleoHome}/schemas`. Note that schemas are typically read at
|
|
87
|
+
* runtime from the npm package root, not this global directory.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const dir = getCleoSchemasDir();
|
|
92
|
+
* ```
|
|
46
93
|
*/
|
|
47
94
|
export function getCleoSchemasDir(): string {
|
|
48
95
|
return join(getCleoHome(), 'schemas');
|
|
@@ -50,6 +97,16 @@ export function getCleoSchemasDir(): string {
|
|
|
50
97
|
|
|
51
98
|
/**
|
|
52
99
|
* Get the global CLEO docs directory.
|
|
100
|
+
*
|
|
101
|
+
* @returns Absolute path to the docs directory under CLEO home
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* Returns `{cleoHome}/docs` for global documentation storage.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const dir = getCleoDocsDir();
|
|
109
|
+
* ```
|
|
53
110
|
*/
|
|
54
111
|
export function getCleoDocsDir(): string {
|
|
55
112
|
return join(getCleoHome(), 'docs');
|
|
@@ -58,6 +115,19 @@ export function getCleoDocsDir(): string {
|
|
|
58
115
|
/**
|
|
59
116
|
* Get the project CLEO data directory (relative).
|
|
60
117
|
* Respects CLEO_DIR env var, defaults to ".cleo".
|
|
118
|
+
*
|
|
119
|
+
* @param cwd - Optional working directory; when provided, returns absolute path
|
|
120
|
+
* @returns Relative or absolute path to the project's .cleo directory
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* If `cwd` is provided, delegates to `getCleoDirAbsolute`. Otherwise returns
|
|
124
|
+
* the `CLEO_DIR` env var or the default ".cleo" relative path.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const rel = getCleoDir(); // ".cleo"
|
|
129
|
+
* const abs = getCleoDir('/project'); // "/project/.cleo"
|
|
130
|
+
* ```
|
|
61
131
|
*/
|
|
62
132
|
export function getCleoDir(cwd?: string): string {
|
|
63
133
|
if (cwd) {
|
|
@@ -68,6 +138,18 @@ export function getCleoDir(cwd?: string): string {
|
|
|
68
138
|
|
|
69
139
|
/**
|
|
70
140
|
* Get the absolute path to the project CLEO directory.
|
|
141
|
+
*
|
|
142
|
+
* @param cwd - Optional working directory to resolve against; defaults to process.cwd()
|
|
143
|
+
* @returns Absolute path to the project's .cleo directory
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* If CLEO_DIR is already absolute, returns it directly. Otherwise resolves
|
|
147
|
+
* it relative to the provided cwd or process.cwd().
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const dir = getCleoDirAbsolute('/my/project'); // "/my/project/.cleo"
|
|
152
|
+
* ```
|
|
71
153
|
*/
|
|
72
154
|
export function getCleoDirAbsolute(cwd?: string): string {
|
|
73
155
|
const cleoDir = getCleoDir();
|
|
@@ -81,6 +163,18 @@ export function getCleoDirAbsolute(cwd?: string): string {
|
|
|
81
163
|
* Get the project root from the CLEO directory.
|
|
82
164
|
* Respects CLEO_ROOT env var, then derives from CLEO_DIR.
|
|
83
165
|
* If CLEO_DIR is ".cleo", the project root is its parent.
|
|
166
|
+
*
|
|
167
|
+
* @param cwd - Optional working directory hint
|
|
168
|
+
* @returns Absolute path to the project root
|
|
169
|
+
*
|
|
170
|
+
* @remarks
|
|
171
|
+
* Resolution order: CLEO_ROOT env var (if no cwd), parent of the resolved
|
|
172
|
+
* .cleo directory (if it ends with /.cleo), or the cwd/process.cwd() fallback.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```typescript
|
|
176
|
+
* const root = getProjectRoot(); // "/home/user/projects/myapp"
|
|
177
|
+
* ```
|
|
84
178
|
*/
|
|
85
179
|
export function getProjectRoot(cwd?: string): string {
|
|
86
180
|
if (!cwd && process.env['CLEO_ROOT']) {
|
|
@@ -95,13 +189,28 @@ export function getProjectRoot(cwd?: string): string {
|
|
|
95
189
|
|
|
96
190
|
/**
|
|
97
191
|
* Resolve a project-relative path to an absolute path.
|
|
192
|
+
*
|
|
193
|
+
* @param relativePath - Path to resolve (relative, absolute, or tilde-prefixed)
|
|
194
|
+
* @param cwd - Optional working directory for project root resolution
|
|
195
|
+
* @returns Absolute resolved path
|
|
196
|
+
*
|
|
197
|
+
* @remarks
|
|
198
|
+
* Returns absolute paths unchanged. Expands leading tilde (`~/`) to the user's
|
|
199
|
+
* home directory. Resolves other relative paths against the project root.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* resolveProjectPath('src/index.ts'); // "/project/src/index.ts"
|
|
204
|
+
* resolveProjectPath('~/notes.md'); // "/home/user/notes.md"
|
|
205
|
+
* resolveProjectPath('/absolute/path'); // "/absolute/path"
|
|
206
|
+
* ```
|
|
98
207
|
*/
|
|
99
208
|
export function resolveProjectPath(relativePath: string, cwd?: string): string {
|
|
100
209
|
if (isAbsolutePath(relativePath)) {
|
|
101
210
|
return relativePath;
|
|
102
211
|
}
|
|
103
|
-
// Expand leading tilde
|
|
104
|
-
if (relativePath.startsWith('~/') || relativePath === '~') {
|
|
212
|
+
// Expand leading tilde (handles both ~/ on Unix and ~\ on Windows)
|
|
213
|
+
if (relativePath.startsWith('~/') || relativePath.startsWith('~\\') || relativePath === '~') {
|
|
105
214
|
return resolve(homedir(), relativePath.slice(2));
|
|
106
215
|
}
|
|
107
216
|
return resolve(getProjectRoot(cwd), relativePath);
|
|
@@ -119,6 +228,17 @@ export function resolveProjectPath(relativePath: string, cwd?: string): string {
|
|
|
119
228
|
* // NEW (correct):
|
|
120
229
|
* const accessor = await getAccessor(cwd);
|
|
121
230
|
* const data = await accessor.queryTasks({});
|
|
231
|
+
*
|
|
232
|
+
* @param cwd - Optional working directory for path resolution
|
|
233
|
+
* @returns Absolute path to the tasks.db file
|
|
234
|
+
*
|
|
235
|
+
* @remarks
|
|
236
|
+
* Returns `{cleoDir}/tasks.db`. Prefer `getAccessor()` for actual data access.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const dbPath = getTaskPath('/project');
|
|
241
|
+
* ```
|
|
122
242
|
*/
|
|
123
243
|
export function getTaskPath(cwd?: string): string {
|
|
124
244
|
return join(getCleoDirAbsolute(cwd), 'tasks.db');
|
|
@@ -126,6 +246,17 @@ export function getTaskPath(cwd?: string): string {
|
|
|
126
246
|
|
|
127
247
|
/**
|
|
128
248
|
* Get the path to the project's config.json file.
|
|
249
|
+
*
|
|
250
|
+
* @param cwd - Optional working directory for path resolution
|
|
251
|
+
* @returns Absolute path to the project config.json
|
|
252
|
+
*
|
|
253
|
+
* @remarks
|
|
254
|
+
* Returns `{cleoDir}/config.json`.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```typescript
|
|
258
|
+
* const configPath = getConfigPath('/project');
|
|
259
|
+
* ```
|
|
129
260
|
*/
|
|
130
261
|
export function getConfigPath(cwd?: string): string {
|
|
131
262
|
return join(getCleoDirAbsolute(cwd), 'config.json');
|
|
@@ -133,6 +264,17 @@ export function getConfigPath(cwd?: string): string {
|
|
|
133
264
|
|
|
134
265
|
/**
|
|
135
266
|
* Get the path to the project's sessions.json file.
|
|
267
|
+
*
|
|
268
|
+
* @param cwd - Optional working directory for path resolution
|
|
269
|
+
* @returns Absolute path to the sessions.json file
|
|
270
|
+
*
|
|
271
|
+
* @remarks
|
|
272
|
+
* Returns `{cleoDir}/sessions.json`.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* const sessionsPath = getSessionsPath('/project');
|
|
277
|
+
* ```
|
|
136
278
|
*/
|
|
137
279
|
export function getSessionsPath(cwd?: string): string {
|
|
138
280
|
return join(getCleoDirAbsolute(cwd), 'sessions.json');
|
|
@@ -140,6 +282,17 @@ export function getSessionsPath(cwd?: string): string {
|
|
|
140
282
|
|
|
141
283
|
/**
|
|
142
284
|
* Get the path to the project's archive file.
|
|
285
|
+
*
|
|
286
|
+
* @param cwd - Optional working directory for path resolution
|
|
287
|
+
* @returns Absolute path to the tasks-archive.json file
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* Returns `{cleoDir}/tasks-archive.json` where archived tasks are stored.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* const archivePath = getArchivePath('/project');
|
|
295
|
+
* ```
|
|
143
296
|
*/
|
|
144
297
|
export function getArchivePath(cwd?: string): string {
|
|
145
298
|
return join(getCleoDirAbsolute(cwd), 'tasks-archive.json');
|
|
@@ -148,6 +301,18 @@ export function getArchivePath(cwd?: string): string {
|
|
|
148
301
|
/**
|
|
149
302
|
* Get the path to the project's log file.
|
|
150
303
|
* Canonical structured runtime log path (pino).
|
|
304
|
+
*
|
|
305
|
+
* @param cwd - Optional working directory for path resolution
|
|
306
|
+
* @returns Absolute path to the cleo.log file
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* Returns `{cleoDir}/logs/cleo.log`. Used by pino for structured JSON logging.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const logPath = getLogPath('/project');
|
|
314
|
+
* ```
|
|
315
|
+
*
|
|
151
316
|
* @task T4644
|
|
152
317
|
*/
|
|
153
318
|
export function getLogPath(cwd?: string): string {
|
|
@@ -156,6 +321,17 @@ export function getLogPath(cwd?: string): string {
|
|
|
156
321
|
|
|
157
322
|
/**
|
|
158
323
|
* Get the backup directory for operational backups.
|
|
324
|
+
*
|
|
325
|
+
* @param cwd - Optional working directory for path resolution
|
|
326
|
+
* @returns Absolute path to the operational backups directory
|
|
327
|
+
*
|
|
328
|
+
* @remarks
|
|
329
|
+
* Returns `{cleoDir}/backups/operational`.
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```typescript
|
|
333
|
+
* const backupDir = getBackupDir('/project');
|
|
334
|
+
* ```
|
|
159
335
|
*/
|
|
160
336
|
export function getBackupDir(cwd?: string): string {
|
|
161
337
|
return join(getCleoDirAbsolute(cwd), 'backups', 'operational');
|
|
@@ -163,6 +339,16 @@ export function getBackupDir(cwd?: string): string {
|
|
|
163
339
|
|
|
164
340
|
/**
|
|
165
341
|
* Get the global config file path.
|
|
342
|
+
*
|
|
343
|
+
* @returns Absolute path to the global config.json in CLEO home
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* Returns `{cleoHome}/config.json` for global CLEO configuration.
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* ```typescript
|
|
350
|
+
* const globalConfig = getGlobalConfigPath();
|
|
351
|
+
* ```
|
|
166
352
|
*/
|
|
167
353
|
export function getGlobalConfigPath(): string {
|
|
168
354
|
return join(getCleoHome(), 'config.json');
|
|
@@ -183,6 +369,18 @@ const DEFAULT_AGENT_OUTPUTS_DIR = '.cleo/agent-outputs';
|
|
|
183
369
|
* 3. config.directories.agentOutputs (deprecated)
|
|
184
370
|
* 4. Default: '.cleo/agent-outputs'
|
|
185
371
|
*
|
|
372
|
+
* @param cwd - Optional working directory for path resolution
|
|
373
|
+
* @returns Relative or absolute path to the agent outputs directory
|
|
374
|
+
*
|
|
375
|
+
* @remarks
|
|
376
|
+
* Checks config fields in priority order: `agentOutputs.directory`, `research.outputDir`,
|
|
377
|
+
* `directories.agentOutputs`. Falls back to `.cleo/agent-outputs`.
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* const dir = getAgentOutputsDir('/project');
|
|
382
|
+
* ```
|
|
383
|
+
*
|
|
186
384
|
* @task T4700
|
|
187
385
|
*/
|
|
188
386
|
export function getAgentOutputsDir(cwd?: string): string {
|
|
@@ -221,6 +419,19 @@ export function getAgentOutputsDir(cwd?: string): string {
|
|
|
221
419
|
|
|
222
420
|
/**
|
|
223
421
|
* Get the absolute path to the agent outputs directory.
|
|
422
|
+
*
|
|
423
|
+
* @param cwd - Optional working directory for path resolution
|
|
424
|
+
* @returns Absolute path to the agent outputs directory
|
|
425
|
+
*
|
|
426
|
+
* @remarks
|
|
427
|
+
* Resolves the output of `getAgentOutputsDir()` against the project root
|
|
428
|
+
* if it is not already absolute.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* const absDir = getAgentOutputsAbsolute('/project');
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
224
435
|
* @task T4700
|
|
225
436
|
*/
|
|
226
437
|
export function getAgentOutputsAbsolute(cwd?: string): string {
|
|
@@ -237,6 +448,18 @@ export function getAgentOutputsAbsolute(cwd?: string): string {
|
|
|
237
448
|
* Checks config.agentOutputs.manifestFile for custom filename,
|
|
238
449
|
* defaults to 'MANIFEST.jsonl'.
|
|
239
450
|
*
|
|
451
|
+
* @param cwd - Optional working directory for path resolution
|
|
452
|
+
* @returns Absolute path to the MANIFEST.jsonl file
|
|
453
|
+
*
|
|
454
|
+
* @remarks
|
|
455
|
+
* Checks `config.agentOutputs.manifestFile` for a custom filename,
|
|
456
|
+
* defaults to `MANIFEST.jsonl` in the agent outputs directory.
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```typescript
|
|
460
|
+
* const manifestPath = getManifestPath('/project');
|
|
461
|
+
* ```
|
|
462
|
+
*
|
|
240
463
|
* @task T4700
|
|
241
464
|
*/
|
|
242
465
|
export function getManifestPath(cwd?: string): string {
|
|
@@ -262,6 +485,18 @@ export function getManifestPath(cwd?: string): string {
|
|
|
262
485
|
|
|
263
486
|
/**
|
|
264
487
|
* Get the absolute path to the MANIFEST.archive.jsonl file.
|
|
488
|
+
*
|
|
489
|
+
* @param cwd - Optional working directory for path resolution
|
|
490
|
+
* @returns Absolute path to the MANIFEST.archive.jsonl file
|
|
491
|
+
*
|
|
492
|
+
* @remarks
|
|
493
|
+
* Returns the archive manifest path in the agent outputs directory.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```typescript
|
|
497
|
+
* const archivePath = getManifestArchivePath('/project');
|
|
498
|
+
* ```
|
|
499
|
+
*
|
|
265
500
|
* @task T4700
|
|
266
501
|
*/
|
|
267
502
|
export function getManifestArchivePath(cwd?: string): string {
|
|
@@ -276,6 +511,20 @@ export function getManifestArchivePath(cwd?: string): string {
|
|
|
276
511
|
|
|
277
512
|
/**
|
|
278
513
|
* Check if a path is absolute (POSIX or Windows).
|
|
514
|
+
*
|
|
515
|
+
* @param path - Filesystem path to check
|
|
516
|
+
* @returns True if the path is absolute on any supported OS
|
|
517
|
+
*
|
|
518
|
+
* @remarks
|
|
519
|
+
* Recognizes POSIX absolute paths (`/...`), Windows drive letters (`C:\...`),
|
|
520
|
+
* and UNC paths (`\\...`).
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```typescript
|
|
524
|
+
* isAbsolutePath('/usr/bin'); // true
|
|
525
|
+
* isAbsolutePath('C:\\Users'); // true
|
|
526
|
+
* isAbsolutePath('./relative'); // false
|
|
527
|
+
* ```
|
|
279
528
|
*/
|
|
280
529
|
export function isAbsolutePath(path: string): boolean {
|
|
281
530
|
// POSIX absolute
|
|
@@ -294,6 +543,16 @@ export function isAbsolutePath(path: string): boolean {
|
|
|
294
543
|
/**
|
|
295
544
|
* Get the OS log directory for CLEO global logs.
|
|
296
545
|
* Linux: ~/.local/state/cleo | macOS: ~/Library/Logs/cleo | Windows: %LOCALAPPDATA%\cleo\Log
|
|
546
|
+
*
|
|
547
|
+
* @returns Absolute path to the OS-appropriate log directory
|
|
548
|
+
*
|
|
549
|
+
* @remarks
|
|
550
|
+
* Delegates to `getPlatformPaths().log` for XDG-compliant resolution.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```typescript
|
|
554
|
+
* const logDir = getCleoLogDir();
|
|
555
|
+
* ```
|
|
297
556
|
*/
|
|
298
557
|
export function getCleoLogDir(): string {
|
|
299
558
|
return getPlatformPaths().log;
|
|
@@ -302,6 +561,16 @@ export function getCleoLogDir(): string {
|
|
|
302
561
|
/**
|
|
303
562
|
* Get the OS cache directory for CLEO.
|
|
304
563
|
* Linux: ~/.cache/cleo | macOS: ~/Library/Caches/cleo | Windows: %LOCALAPPDATA%\cleo\Cache
|
|
564
|
+
*
|
|
565
|
+
* @returns Absolute path to the OS-appropriate cache directory
|
|
566
|
+
*
|
|
567
|
+
* @remarks
|
|
568
|
+
* Delegates to `getPlatformPaths().cache` for XDG-compliant resolution.
|
|
569
|
+
*
|
|
570
|
+
* @example
|
|
571
|
+
* ```typescript
|
|
572
|
+
* const cacheDir = getCleoCacheDir();
|
|
573
|
+
* ```
|
|
305
574
|
*/
|
|
306
575
|
export function getCleoCacheDir(): string {
|
|
307
576
|
return getPlatformPaths().cache;
|
|
@@ -309,6 +578,16 @@ export function getCleoCacheDir(): string {
|
|
|
309
578
|
|
|
310
579
|
/**
|
|
311
580
|
* Get the OS temp directory for CLEO ephemeral files.
|
|
581
|
+
*
|
|
582
|
+
* @returns Absolute path to the OS-appropriate temp directory
|
|
583
|
+
*
|
|
584
|
+
* @remarks
|
|
585
|
+
* Delegates to `getPlatformPaths().temp` for platform-specific resolution.
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
* ```typescript
|
|
589
|
+
* const tempDir = getCleoTempDir();
|
|
590
|
+
* ```
|
|
312
591
|
*/
|
|
313
592
|
export function getCleoTempDir(): string {
|
|
314
593
|
return getPlatformPaths().temp;
|
|
@@ -317,6 +596,16 @@ export function getCleoTempDir(): string {
|
|
|
317
596
|
/**
|
|
318
597
|
* Get the OS config directory for CLEO.
|
|
319
598
|
* Linux: ~/.config/cleo | macOS: ~/Library/Preferences/cleo | Windows: %APPDATA%\cleo\Config
|
|
599
|
+
*
|
|
600
|
+
* @returns Absolute path to the OS-appropriate config directory
|
|
601
|
+
*
|
|
602
|
+
* @remarks
|
|
603
|
+
* Delegates to `getPlatformPaths().config` for XDG-compliant resolution.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```typescript
|
|
607
|
+
* const configDir = getCleoConfigDir();
|
|
608
|
+
* ```
|
|
320
609
|
*/
|
|
321
610
|
export function getCleoConfigDir(): string {
|
|
322
611
|
return getPlatformPaths().config;
|
|
@@ -331,12 +620,27 @@ export function getCleoConfigDir(): string {
|
|
|
331
620
|
* Linux: ~/.local/share/cleo/templates
|
|
332
621
|
* macOS: ~/Library/Application Support/cleo/templates
|
|
333
622
|
* Windows: ~/AppData/Local/cleo/Data/templates (approximate)
|
|
623
|
+
*
|
|
624
|
+
* @returns Tilde-prefixed path like "~/.local/share/cleo/templates"
|
|
625
|
+
*
|
|
626
|
+
* @remarks
|
|
627
|
+
* Returns the absolute path if the home directory is not a prefix
|
|
628
|
+
* (unlikely but handled). Always uses forward slashes after the tilde
|
|
629
|
+
* for cross-platform compatibility in `@`-reference resolution.
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* ```typescript
|
|
633
|
+
* const tildePath = getCleoTemplatesTildePath();
|
|
634
|
+
* // "~/.local/share/cleo/templates"
|
|
635
|
+
* ```
|
|
334
636
|
*/
|
|
335
637
|
export function getCleoTemplatesTildePath(): string {
|
|
336
638
|
const absPath = getCleoTemplatesDir();
|
|
337
639
|
const home = homedir();
|
|
338
640
|
if (absPath.startsWith(home)) {
|
|
339
|
-
|
|
641
|
+
// Always use forward slash after tilde for cross-platform @-reference resolution
|
|
642
|
+
const relative = absPath.slice(home.length).replace(/\\/g, '/');
|
|
643
|
+
return `~${relative}`;
|
|
340
644
|
}
|
|
341
645
|
return absPath;
|
|
342
646
|
}
|
|
@@ -348,6 +652,16 @@ export function getCleoTemplatesTildePath(): string {
|
|
|
348
652
|
/**
|
|
349
653
|
* Get the global agents hub directory.
|
|
350
654
|
* Respects AGENTS_HOME env var, defaults to ~/.agents.
|
|
655
|
+
*
|
|
656
|
+
* @returns Absolute path to the agents hub directory
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* Returns `AGENTS_HOME` env var if set, otherwise `~/.agents`.
|
|
660
|
+
*
|
|
661
|
+
* @example
|
|
662
|
+
* ```typescript
|
|
663
|
+
* const agentsHome = getAgentsHome(); // "/home/user/.agents"
|
|
664
|
+
* ```
|
|
351
665
|
*/
|
|
352
666
|
export function getAgentsHome(): string {
|
|
353
667
|
return process.env['AGENTS_HOME'] ?? join(homedir(), '.agents');
|
|
@@ -355,6 +669,17 @@ export function getAgentsHome(): string {
|
|
|
355
669
|
|
|
356
670
|
/**
|
|
357
671
|
* Get the Claude Code agents directory (~/.claude/agents by default).
|
|
672
|
+
*
|
|
673
|
+
* @returns Absolute path to the Claude agents directory
|
|
674
|
+
*
|
|
675
|
+
* @remarks
|
|
676
|
+
* Respects `CLAUDE_HOME` env var for the parent directory.
|
|
677
|
+
*
|
|
678
|
+
* @example
|
|
679
|
+
* ```typescript
|
|
680
|
+
* const dir = getClaudeAgentsDir();
|
|
681
|
+
* ```
|
|
682
|
+
*
|
|
358
683
|
* @deprecated Use AdapterPathProvider.getAgentInstallDir() from the active adapter instead.
|
|
359
684
|
*/
|
|
360
685
|
export function getClaudeAgentsDir(): string {
|
|
@@ -364,9 +689,19 @@ export function getClaudeAgentsDir(): string {
|
|
|
364
689
|
|
|
365
690
|
/**
|
|
366
691
|
* Get the claude-mem SQLite database path.
|
|
367
|
-
*
|
|
368
|
-
*
|
|
692
|
+
*
|
|
693
|
+
* @returns Absolute path to the claude-mem.db file
|
|
694
|
+
*
|
|
695
|
+
* @remarks
|
|
696
|
+
* Respects `CLAUDE_MEM_DB` env var, defaults to `~/.claude-mem/claude-mem.db`.
|
|
369
697
|
* This is a third-party tool path; homedir() is correct here (no env-paths standard).
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* ```typescript
|
|
701
|
+
* const dbPath = getClaudeMemDbPath();
|
|
702
|
+
* ```
|
|
703
|
+
*
|
|
704
|
+
* @deprecated Use AdapterPathProvider.getMemoryDbPath() from the active adapter instead.
|
|
370
705
|
*/
|
|
371
706
|
export function getClaudeMemDbPath(): string {
|
|
372
707
|
return process.env['CLAUDE_MEM_DB'] ?? join(homedir(), '.claude-mem', 'claude-mem.db');
|