@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
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
|
|
3
|
-
const observeBrainMock = vi.fn();
|
|
4
|
-
|
|
5
|
-
vi.mock('../../../memory/brain-retrieval.js', () => ({
|
|
6
|
-
observeBrain: observeBrainMock,
|
|
7
|
-
}));
|
|
8
|
-
|
|
9
|
-
import { handlePromptSubmit, handleResponseComplete } from '../mcp-hooks.js';
|
|
10
|
-
|
|
11
|
-
describe('mcp hook handlers', () => {
|
|
12
|
-
const originalEnv = process.env['CLEO_BRAIN_CAPTURE_MCP'];
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
observeBrainMock.mockReset();
|
|
16
|
-
delete process.env['CLEO_BRAIN_CAPTURE_MCP'];
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
if (originalEnv !== undefined) {
|
|
21
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = originalEnv;
|
|
22
|
-
} else {
|
|
23
|
-
delete process.env['CLEO_BRAIN_CAPTURE_MCP'];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
describe('handlePromptSubmit', () => {
|
|
28
|
-
it('does NOT call observeBrain by default', async () => {
|
|
29
|
-
await handlePromptSubmit('/tmp/project', {
|
|
30
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
31
|
-
gateway: 'query',
|
|
32
|
-
domain: 'tasks',
|
|
33
|
-
operation: 'find',
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
expect(observeBrainMock).not.toHaveBeenCalled();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('calls observeBrain when CLEO_BRAIN_CAPTURE_MCP=true', async () => {
|
|
40
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = 'true';
|
|
41
|
-
observeBrainMock.mockResolvedValue(undefined);
|
|
42
|
-
|
|
43
|
-
await handlePromptSubmit('/tmp/project', {
|
|
44
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
45
|
-
gateway: 'query',
|
|
46
|
-
domain: 'tasks',
|
|
47
|
-
operation: 'find',
|
|
48
|
-
source: 'agent-alpha',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
expect(observeBrainMock).toHaveBeenCalledTimes(1);
|
|
52
|
-
expect(observeBrainMock).toHaveBeenCalledWith(
|
|
53
|
-
'/tmp/project',
|
|
54
|
-
expect.objectContaining({
|
|
55
|
-
text: expect.stringContaining('Prompt submitted: query:tasks.find from agent-alpha'),
|
|
56
|
-
title: 'Prompt: tasks.find',
|
|
57
|
-
type: 'discovery',
|
|
58
|
-
sourceType: 'agent',
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('swallows brain schema missing error when capture is on', async () => {
|
|
64
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = 'true';
|
|
65
|
-
observeBrainMock.mockRejectedValue(new Error('no such table: brain_observations'));
|
|
66
|
-
|
|
67
|
-
await expect(
|
|
68
|
-
handlePromptSubmit('/tmp/project', {
|
|
69
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
70
|
-
gateway: 'mutate',
|
|
71
|
-
domain: 'tasks',
|
|
72
|
-
operation: 'add',
|
|
73
|
-
}),
|
|
74
|
-
).resolves.toBeUndefined();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('handleResponseComplete', () => {
|
|
79
|
-
it('does NOT call observeBrain by default', async () => {
|
|
80
|
-
await handleResponseComplete('/tmp/project', {
|
|
81
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
82
|
-
gateway: 'query',
|
|
83
|
-
domain: 'tasks',
|
|
84
|
-
operation: 'find',
|
|
85
|
-
success: true,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
expect(observeBrainMock).not.toHaveBeenCalled();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('calls observeBrain when CLEO_BRAIN_CAPTURE_MCP=true', async () => {
|
|
92
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = 'true';
|
|
93
|
-
observeBrainMock.mockResolvedValue(undefined);
|
|
94
|
-
|
|
95
|
-
await handleResponseComplete('/tmp/project', {
|
|
96
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
97
|
-
gateway: 'mutate',
|
|
98
|
-
domain: 'tasks',
|
|
99
|
-
operation: 'complete',
|
|
100
|
-
success: true,
|
|
101
|
-
durationMs: 150,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
expect(observeBrainMock).toHaveBeenCalledTimes(1);
|
|
105
|
-
expect(observeBrainMock).toHaveBeenCalledWith(
|
|
106
|
-
'/tmp/project',
|
|
107
|
-
expect.objectContaining({
|
|
108
|
-
text: expect.stringContaining('Response success: mutate:tasks.complete (150ms)'),
|
|
109
|
-
title: 'Response: tasks.complete',
|
|
110
|
-
type: 'discovery',
|
|
111
|
-
sourceType: 'agent',
|
|
112
|
-
}),
|
|
113
|
-
);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('captures failed responses with error code', async () => {
|
|
117
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = 'true';
|
|
118
|
-
observeBrainMock.mockResolvedValue(undefined);
|
|
119
|
-
|
|
120
|
-
await handleResponseComplete('/tmp/project', {
|
|
121
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
122
|
-
gateway: 'query',
|
|
123
|
-
domain: 'tasks',
|
|
124
|
-
operation: 'show',
|
|
125
|
-
success: false,
|
|
126
|
-
errorCode: 'E_NOT_FOUND',
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const callText = observeBrainMock.mock.calls[0][1].text as string;
|
|
130
|
-
expect(callText).toContain('Response failed');
|
|
131
|
-
expect(callText).toContain('E_NOT_FOUND');
|
|
132
|
-
expect(observeBrainMock.mock.calls[0][1].type).toBe('change');
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('swallows brain schema missing error when capture is on', async () => {
|
|
136
|
-
process.env['CLEO_BRAIN_CAPTURE_MCP'] = 'true';
|
|
137
|
-
observeBrainMock.mockRejectedValue(new Error('SQLITE_ERROR: no such table: brain_decisions'));
|
|
138
|
-
|
|
139
|
-
await expect(
|
|
140
|
-
handleResponseComplete('/tmp/project', {
|
|
141
|
-
timestamp: '2026-03-04T00:00:00.000Z',
|
|
142
|
-
gateway: 'query',
|
|
143
|
-
domain: 'tasks',
|
|
144
|
-
operation: 'find',
|
|
145
|
-
success: true,
|
|
146
|
-
}),
|
|
147
|
-
).resolves.toBeUndefined();
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
});
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Prompt/Response Hook Handlers - Wave 2 of T5237
|
|
3
|
-
*
|
|
4
|
-
* Handlers for onPromptSubmit, onResponseComplete, and system Notification
|
|
5
|
-
* events that capture ALL gateway operations (read and write) to BRAIN.
|
|
6
|
-
* By default, NO brain capture (too noisy). Enable via:
|
|
7
|
-
* - Config: brain.captureMcp = true (checked first)
|
|
8
|
-
* - Env: CLEO_BRAIN_CAPTURE_MCP=true (overrides config)
|
|
9
|
-
* Auto-registers on module load.
|
|
10
|
-
*
|
|
11
|
-
* Note: File-change Notification events (those with filePath + changeType) are
|
|
12
|
-
* handled by file-hooks.ts. This module handles message-bearing system
|
|
13
|
-
* notifications (Notification payloads with a message field).
|
|
14
|
-
*
|
|
15
|
-
* @task T166
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { hooks } from '../registry.js';
|
|
19
|
-
import type {
|
|
20
|
-
NotificationPayload,
|
|
21
|
-
PromptSubmitPayload,
|
|
22
|
-
ResponseCompletePayload,
|
|
23
|
-
} from '../types.js';
|
|
24
|
-
import { isAutoCaptureEnabled, isMissingBrainSchemaError } from './handler-helpers.js';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Check whether MCP-level brain capture is enabled.
|
|
28
|
-
*
|
|
29
|
-
* Resolution order (first truthy wins):
|
|
30
|
-
* 1. CLEO_BRAIN_CAPTURE_MCP env var (explicit override)
|
|
31
|
-
* 2. brain.captureMcp project config value
|
|
32
|
-
*
|
|
33
|
-
* Defaults to false when neither is set (too noisy for normal operation).
|
|
34
|
-
*/
|
|
35
|
-
async function isBrainCaptureEnabled(projectRoot: string): Promise<boolean> {
|
|
36
|
-
const envOverride = process.env['CLEO_BRAIN_CAPTURE_MCP'];
|
|
37
|
-
if (envOverride !== undefined) {
|
|
38
|
-
return envOverride === 'true';
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const { loadConfig } = await import('../../config.js');
|
|
42
|
-
const config = await loadConfig(projectRoot);
|
|
43
|
-
return config.brain?.captureMcp ?? false;
|
|
44
|
-
} catch {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Handle PromptSubmit - optionally capture ALL gateway prompt events to BRAIN.
|
|
51
|
-
*
|
|
52
|
-
* No-op by default. Enable via brain.captureMcp config or CLEO_BRAIN_CAPTURE_MCP env.
|
|
53
|
-
* For selective mutation-only capture, use work-capture-hooks.ts instead.
|
|
54
|
-
*/
|
|
55
|
-
export async function handlePromptSubmit(
|
|
56
|
-
projectRoot: string,
|
|
57
|
-
payload: PromptSubmitPayload,
|
|
58
|
-
): Promise<void> {
|
|
59
|
-
if (!(await isBrainCaptureEnabled(projectRoot))) return;
|
|
60
|
-
|
|
61
|
-
const { observeBrain } = await import('../../memory/brain-retrieval.js');
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
await observeBrain(projectRoot, {
|
|
65
|
-
text: `Prompt submitted: ${payload.gateway}:${payload.domain}.${payload.operation}${payload.source ? ` from ${payload.source}` : ''}`,
|
|
66
|
-
title: `Prompt: ${payload.domain}.${payload.operation}`,
|
|
67
|
-
type: 'discovery',
|
|
68
|
-
sourceType: 'agent',
|
|
69
|
-
});
|
|
70
|
-
} catch (err) {
|
|
71
|
-
if (!isMissingBrainSchemaError(err)) throw err;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Handle ResponseComplete - optionally capture ALL gateway response events to BRAIN.
|
|
77
|
-
*
|
|
78
|
-
* No-op by default. Enable via brain.captureMcp config or CLEO_BRAIN_CAPTURE_MCP env.
|
|
79
|
-
* For selective mutation-only capture, use work-capture-hooks.ts instead.
|
|
80
|
-
*/
|
|
81
|
-
export async function handleResponseComplete(
|
|
82
|
-
projectRoot: string,
|
|
83
|
-
payload: ResponseCompletePayload,
|
|
84
|
-
): Promise<void> {
|
|
85
|
-
if (!(await isBrainCaptureEnabled(projectRoot))) return;
|
|
86
|
-
|
|
87
|
-
const { observeBrain } = await import('../../memory/brain-retrieval.js');
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
await observeBrain(projectRoot, {
|
|
91
|
-
text: `Response ${payload.success ? 'success' : 'failed'}: ${payload.gateway}:${payload.domain}.${payload.operation}${payload.durationMs != null ? ` (${payload.durationMs}ms)` : ''}${payload.errorCode ? ` error: ${payload.errorCode}` : ''}`,
|
|
92
|
-
title: `Response: ${payload.domain}.${payload.operation}`,
|
|
93
|
-
type: payload.success ? 'discovery' : 'change',
|
|
94
|
-
sourceType: 'agent',
|
|
95
|
-
});
|
|
96
|
-
} catch (err) {
|
|
97
|
-
if (!isMissingBrainSchemaError(err)) throw err;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Handle Notification — capture system notifications as BRAIN observations.
|
|
103
|
-
*
|
|
104
|
-
* Only fires for Notification payloads that carry a message field (i.e. system
|
|
105
|
-
* notifications). File-change notifications (filePath + changeType) are
|
|
106
|
-
* handled exclusively by file-hooks.ts and are skipped here to avoid
|
|
107
|
-
* double-capture.
|
|
108
|
-
*
|
|
109
|
-
* Gated behind brain.autoCapture config. Never throws.
|
|
110
|
-
*
|
|
111
|
-
* @param projectRoot - Absolute path to the project root directory.
|
|
112
|
-
* @param payload - Notification event payload.
|
|
113
|
-
*
|
|
114
|
-
* @task T166
|
|
115
|
-
*/
|
|
116
|
-
export async function handleSystemNotification(
|
|
117
|
-
projectRoot: string,
|
|
118
|
-
payload: NotificationPayload,
|
|
119
|
-
): Promise<void> {
|
|
120
|
-
// File-change notifications are handled by file-hooks.ts
|
|
121
|
-
if (payload.filePath || payload.changeType) return;
|
|
122
|
-
// Only handle message-bearing system notifications
|
|
123
|
-
if (!payload.message) return;
|
|
124
|
-
if (!(await isAutoCaptureEnabled(projectRoot))) return;
|
|
125
|
-
|
|
126
|
-
const { observeBrain } = await import('../../memory/brain-retrieval.js');
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
await observeBrain(projectRoot, {
|
|
130
|
-
text: `System notification: ${payload.message}`,
|
|
131
|
-
title: `Notification: ${payload.message.slice(0, 60)}`,
|
|
132
|
-
type: 'discovery',
|
|
133
|
-
sourceSessionId: payload.sessionId,
|
|
134
|
-
sourceType: 'agent',
|
|
135
|
-
});
|
|
136
|
-
} catch (err) {
|
|
137
|
-
if (!isMissingBrainSchemaError(err)) throw err;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Register handlers on module load
|
|
142
|
-
hooks.register({
|
|
143
|
-
id: 'brain-prompt-submit',
|
|
144
|
-
event: 'PromptSubmit',
|
|
145
|
-
handler: handlePromptSubmit,
|
|
146
|
-
priority: 100,
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
hooks.register({
|
|
150
|
-
id: 'brain-response-complete',
|
|
151
|
-
event: 'ResponseComplete',
|
|
152
|
-
handler: handleResponseComplete,
|
|
153
|
-
priority: 100,
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Lower priority (90) so file-hooks.ts (100) runs first for Notification events
|
|
157
|
-
hooks.register({
|
|
158
|
-
id: 'brain-system-notification',
|
|
159
|
-
event: 'Notification',
|
|
160
|
-
handler: handleSystemNotification,
|
|
161
|
-
priority: 90,
|
|
162
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for the Adaptive Validation module.
|
|
3
|
-
*
|
|
4
|
-
* Tests gate focus suggestions, confidence scoring, and prediction storage.
|
|
5
|
-
* All external dependencies are mocked.
|
|
6
|
-
*
|
|
7
|
-
* @task T035
|
|
8
|
-
* @epic T029
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=adaptive-validation.test.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for impact analysis module.
|
|
3
|
-
*
|
|
4
|
-
* Covers:
|
|
5
|
-
* - Simple dependency chains (A->B->C)
|
|
6
|
-
* - Complex graphs (diamond dependencies)
|
|
7
|
-
* - Each change type (cancel, block, complete, reprioritize)
|
|
8
|
-
* - Blast radius calculation
|
|
9
|
-
* - Critical path detection
|
|
10
|
-
* - Edge cases (orphan tasks, circular refs, no deps)
|
|
11
|
-
* - predictImpact: free-text change description matching (T043)
|
|
12
|
-
*
|
|
13
|
-
* @module intelligence
|
|
14
|
-
*/
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=impact.test.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for the Pattern Extraction module.
|
|
3
|
-
*
|
|
4
|
-
* Tests pattern extraction from history, pattern matching against tasks,
|
|
5
|
-
* pattern storage, and stat updates. All external dependencies are mocked.
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=patterns.test.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for WarpChain storage CRUD operations.
|
|
3
|
-
*
|
|
4
|
-
* Covers addChain, showChain, listChains, createInstance,
|
|
5
|
-
* advanceInstance, and showInstance using temp-dir SQLite.
|
|
6
|
-
*
|
|
7
|
-
* @task T5404
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=chain-store.test.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RCASD-IVTR+C Pipeline Integration Test
|
|
3
|
-
*
|
|
4
|
-
* End-to-end test exercising the full RCASD-IVTR+C lifecycle through all 9 stages.
|
|
5
|
-
* This is the final validation test for epic T4798.
|
|
6
|
-
*
|
|
7
|
-
* Test Coverage:
|
|
8
|
-
* 1. Full pipeline flow through all 9 stages
|
|
9
|
-
* 2. Gate enforcement (blocking and allowing transitions)
|
|
10
|
-
* 3. Evidence recording across stages
|
|
11
|
-
* 4. Cross-session resume capability
|
|
12
|
-
* 5. Pipeline completion verification
|
|
13
|
-
*
|
|
14
|
-
* @task T4806
|
|
15
|
-
* @epic T4798
|
|
16
|
-
* @audit T4799 - Validates unified pipeline implementation
|
|
17
|
-
*/
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=pipeline.integration.test.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regression test: lifecycle resume flow schema contract.
|
|
3
|
-
*
|
|
4
|
-
* Guards against T4809 regression where the lifecycle resume flow in
|
|
5
|
-
* src/core/lifecycle/resume.ts queries columns from the SQLite schema
|
|
6
|
-
* defined in src/store/schema.ts. If schema columns are renamed, removed,
|
|
7
|
-
* or have their enum values changed, these tests will catch the mismatch.
|
|
8
|
-
*
|
|
9
|
-
* This test is purely structural — it validates that the Drizzle schema
|
|
10
|
-
* tables export the exact column shapes resume.ts depends on. No database
|
|
11
|
-
* is needed.
|
|
12
|
-
*
|
|
13
|
-
* @task T4809
|
|
14
|
-
*/
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=resume-schema-contract.test.d.ts.map
|
package/src/mcp/index.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP environment detection - CLEO-specific runtime mode resolution.
|
|
3
|
-
*
|
|
4
|
-
* Detects dev-ts vs prod-npm mode by reading ~/.cleo/VERSION.
|
|
5
|
-
* This is the only CLEO-specific concern here — all provider detection,
|
|
6
|
-
* config writing, and MCP server installation is delegated to @cleocode/caamp.
|
|
7
|
-
*
|
|
8
|
-
* @task T4676
|
|
9
|
-
* @epic T4663
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { readFileSync, realpathSync } from 'node:fs';
|
|
13
|
-
import { join } from 'node:path';
|
|
14
|
-
import { getCleoHome } from '../paths.js';
|
|
15
|
-
|
|
16
|
-
/** Resolved environment mode for MCP server config. */
|
|
17
|
-
export interface McpEnvMode {
|
|
18
|
-
mode: 'dev-ts' | 'prod-npm' | 'unknown';
|
|
19
|
-
/** Absolute path to the source directory (dev-ts mode only). */
|
|
20
|
-
source: string | null;
|
|
21
|
-
/** Resolved install channel for npm package invocation. */
|
|
22
|
-
channel: 'stable' | 'beta' | 'dev' | 'unknown';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Resolve MCP server name by channel. */
|
|
26
|
-
export function getMcpServerName(env: McpEnvMode): string {
|
|
27
|
-
if (env.channel === 'dev') return 'cleo-dev';
|
|
28
|
-
if (env.channel === 'beta') return 'cleo-beta';
|
|
29
|
-
return 'cleo';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Detect the current CLEO environment mode by reading ~/.cleo/VERSION.
|
|
34
|
-
*
|
|
35
|
-
* The VERSION file format:
|
|
36
|
-
* Line 1: version number
|
|
37
|
-
* Lines 2+: key=value pairs (mode, source, etc.)
|
|
38
|
-
*
|
|
39
|
-
* @task T4584
|
|
40
|
-
*/
|
|
41
|
-
export function detectEnvMode(): McpEnvMode {
|
|
42
|
-
// Prefer runtime package invocation detection over persisted metadata.
|
|
43
|
-
// This prevents stale ~/.cleo/VERSION mode flags from overriding npm runtime channel.
|
|
44
|
-
// Resolve symlinks: cleo-dev is a symlink chain, process.argv[1] may be the symlink
|
|
45
|
-
// path (~/.local/bin/cleo-dev), not the real path (dist/cli/index.js).
|
|
46
|
-
const rawScriptPath = process.argv[1] ?? '';
|
|
47
|
-
let scriptPath: string;
|
|
48
|
-
try {
|
|
49
|
-
scriptPath = realpathSync(rawScriptPath).replace(/\\/g, '/');
|
|
50
|
-
} catch {
|
|
51
|
-
scriptPath = rawScriptPath.replace(/\\/g, '/');
|
|
52
|
-
}
|
|
53
|
-
const marker = '/node_modules/@cleocode/cleo/';
|
|
54
|
-
const markerIdx = scriptPath.indexOf(marker);
|
|
55
|
-
if (markerIdx >= 0) {
|
|
56
|
-
const pkgRoot = scriptPath.slice(0, markerIdx + marker.length);
|
|
57
|
-
let channel: McpEnvMode['channel'] = 'stable';
|
|
58
|
-
try {
|
|
59
|
-
const pkg = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf-8')) as {
|
|
60
|
-
version?: string;
|
|
61
|
-
};
|
|
62
|
-
channel = (pkg.version ?? '').includes('-beta') ? 'beta' : 'stable';
|
|
63
|
-
} catch {
|
|
64
|
-
channel = 'stable';
|
|
65
|
-
}
|
|
66
|
-
return { mode: 'prod-npm', source: 'npm', channel };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// ADR-016 §2.3: probe ~/.cleo-dev/VERSION first.
|
|
70
|
-
// When the dev installer runs, it writes mode=dev-ts + source=<repo> to ~/.cleo-dev/VERSION.
|
|
71
|
-
// If the current script path matches that source directory, we are running as cleo-dev.
|
|
72
|
-
const devVersionPath = join(process.env['HOME'] ?? '', '.cleo-dev', 'VERSION');
|
|
73
|
-
try {
|
|
74
|
-
const devContent = readFileSync(devVersionPath, 'utf-8');
|
|
75
|
-
const devKv: Record<string, string> = {};
|
|
76
|
-
const devLines = devContent.trim().split('\n');
|
|
77
|
-
for (let i = 1; i < devLines.length; i++) {
|
|
78
|
-
const eq = devLines[i].indexOf('=');
|
|
79
|
-
if (eq > 0) devKv[devLines[i].slice(0, eq).trim()] = devLines[i].slice(eq + 1).trim();
|
|
80
|
-
}
|
|
81
|
-
if (devKv['mode'] === 'dev-ts' && devKv['source']) {
|
|
82
|
-
const devSource = devKv['source'].replace(/\\/g, '/');
|
|
83
|
-
// Match if the running script is inside the registered dev source tree
|
|
84
|
-
if (scriptPath.startsWith(devSource) || scriptPath.includes(devSource)) {
|
|
85
|
-
return { mode: 'dev-ts', source: devKv['source'], channel: 'dev' };
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
// ~/.cleo-dev/VERSION not present — not in dev mode via this path
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const versionPath = join(getCleoHome(), 'VERSION');
|
|
93
|
-
|
|
94
|
-
let content: string;
|
|
95
|
-
try {
|
|
96
|
-
content = readFileSync(versionPath, 'utf-8');
|
|
97
|
-
} catch {
|
|
98
|
-
return { mode: 'unknown', source: null, channel: 'unknown' };
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const kvPairs: Record<string, string> = {};
|
|
102
|
-
const lines = content.trim().split('\n');
|
|
103
|
-
const installedVersion = lines[0]?.trim() ?? '';
|
|
104
|
-
for (let i = 1; i < lines.length; i++) {
|
|
105
|
-
const eqIdx = lines[i].indexOf('=');
|
|
106
|
-
if (eqIdx > 0) {
|
|
107
|
-
kvPairs[lines[i].slice(0, eqIdx).trim()] = lines[i].slice(eqIdx + 1).trim();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const rawMode = kvPairs['mode'] ?? 'unknown';
|
|
112
|
-
const mode = rawMode === 'dev-ts' ? 'dev-ts' : rawMode === 'prod-npm' ? 'prod-npm' : 'unknown';
|
|
113
|
-
|
|
114
|
-
const channel =
|
|
115
|
-
mode === 'dev-ts'
|
|
116
|
-
? 'dev'
|
|
117
|
-
: installedVersion.includes('-beta')
|
|
118
|
-
? 'beta'
|
|
119
|
-
: mode === 'prod-npm'
|
|
120
|
-
? 'stable'
|
|
121
|
-
: 'unknown';
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
mode,
|
|
125
|
-
source: mode === 'dev-ts' ? (kvPairs['source'] ?? null) : null,
|
|
126
|
-
channel,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Generate the MCP server entry for the cleo server based on env mode.
|
|
132
|
-
*
|
|
133
|
-
* Returns a config object compatible with CAAMP's McpServerConfig:
|
|
134
|
-
* - dev-ts: { command: 'node', args: ['<source>/dist/mcp/index.js'] }
|
|
135
|
-
* - prod-npm stable: { command: 'npx', args: ['-y', '@cleocode/cleo@latest', 'mcp'] }
|
|
136
|
-
* - prod-npm beta: { command: 'npx', args: ['-y', '@cleocode/cleo@beta', 'mcp'] }
|
|
137
|
-
*
|
|
138
|
-
* @task T4584
|
|
139
|
-
*/
|
|
140
|
-
export function generateMcpServerEntry(env: McpEnvMode): Record<string, unknown> {
|
|
141
|
-
if (env.mode === 'dev-ts' && env.source) {
|
|
142
|
-
return {
|
|
143
|
-
command: 'node',
|
|
144
|
-
args: [join(env.source, 'dist', 'mcp', 'index.js')],
|
|
145
|
-
env: {},
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (env.channel === 'beta') {
|
|
150
|
-
return {
|
|
151
|
-
command: 'npx',
|
|
152
|
-
args: ['-y', '@cleocode/cleo@beta', 'mcp'],
|
|
153
|
-
env: {},
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// prod-npm stable (or unknown fallback): canonical npx invocation
|
|
158
|
-
return {
|
|
159
|
-
command: 'npx',
|
|
160
|
-
args: ['-y', '@cleocode/cleo@latest', 'mcp'],
|
|
161
|
-
env: {},
|
|
162
|
-
};
|
|
163
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for T134 Brain Memory Automation features.
|
|
3
|
-
*
|
|
4
|
-
* Covers: BrainConfig defaults, buildSummarizationPrompt, ingestStructuredSummary,
|
|
5
|
-
* extractFromTranscript, runBrainMaintenance, EmbeddingQueue, LocalEmbeddingProvider,
|
|
6
|
-
* maybeRefreshMemoryBridge, and generateContextAwareContent.
|
|
7
|
-
*
|
|
8
|
-
* @epic T134
|
|
9
|
-
*/
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=brain-automation.test.d.ts.map
|