@soleri/core 9.0.4 → 9.3.0
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/data/flows/build.flow.yaml +8 -9
- package/data/flows/deliver.flow.yaml +9 -10
- package/data/flows/design.flow.yaml +3 -4
- package/data/flows/enhance.flow.yaml +5 -6
- package/data/flows/explore.flow.yaml +3 -4
- package/data/flows/fix.flow.yaml +5 -6
- package/data/flows/plan.flow.yaml +4 -5
- package/data/flows/review.flow.yaml +3 -4
- package/dist/brain/intelligence.d.ts +27 -0
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +160 -14
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/learning-radar.d.ts +4 -0
- package/dist/brain/learning-radar.d.ts.map +1 -1
- package/dist/brain/learning-radar.js +20 -1
- package/dist/brain/learning-radar.js.map +1 -1
- package/dist/brain/strength-scorer.d.ts +31 -0
- package/dist/brain/strength-scorer.d.ts.map +1 -0
- package/dist/brain/strength-scorer.js +264 -0
- package/dist/brain/strength-scorer.js.map +1 -0
- package/dist/chat/agent-loop.d.ts.map +1 -1
- package/dist/chat/agent-loop.js +2 -0
- package/dist/chat/agent-loop.js.map +1 -1
- package/dist/chat/notifications.d.ts.map +1 -1
- package/dist/chat/notifications.js +2 -0
- package/dist/chat/notifications.js.map +1 -1
- package/dist/claudemd/compose.js +1 -1
- package/dist/claudemd/compose.js.map +1 -1
- package/dist/control/intent-router.d.ts.map +1 -1
- package/dist/control/intent-router.js +12 -4
- package/dist/control/intent-router.js.map +1 -1
- package/dist/curator/contradiction-detector.d.ts +27 -0
- package/dist/curator/contradiction-detector.d.ts.map +1 -0
- package/dist/curator/contradiction-detector.js +62 -0
- package/dist/curator/contradiction-detector.js.map +1 -0
- package/dist/curator/curator.d.ts +3 -4
- package/dist/curator/curator.d.ts.map +1 -1
- package/dist/curator/curator.js +94 -453
- package/dist/curator/curator.js.map +1 -1
- package/dist/curator/duplicate-detector.d.ts +14 -0
- package/dist/curator/duplicate-detector.d.ts.map +1 -0
- package/dist/curator/duplicate-detector.js +77 -0
- package/dist/curator/duplicate-detector.js.map +1 -0
- package/dist/curator/health-audit.d.ts +15 -0
- package/dist/curator/health-audit.d.ts.map +1 -0
- package/dist/curator/health-audit.js +97 -0
- package/dist/curator/health-audit.js.map +1 -0
- package/dist/curator/metadata-enricher.d.ts +17 -0
- package/dist/curator/metadata-enricher.d.ts.map +1 -0
- package/dist/curator/metadata-enricher.js +60 -0
- package/dist/curator/metadata-enricher.js.map +1 -0
- package/dist/curator/schema.d.ts +7 -0
- package/dist/curator/schema.d.ts.map +1 -0
- package/dist/curator/schema.js +62 -0
- package/dist/curator/schema.js.map +1 -0
- package/dist/curator/tag-manager.d.ts +36 -0
- package/dist/curator/tag-manager.d.ts.map +1 -0
- package/dist/curator/tag-manager.js +78 -0
- package/dist/curator/tag-manager.js.map +1 -0
- package/dist/engine/bin/soleri-engine.js +24 -3
- package/dist/engine/bin/soleri-engine.js.map +1 -1
- package/dist/engine/core-ops.d.ts.map +1 -1
- package/dist/engine/core-ops.js +23 -8
- package/dist/engine/core-ops.js.map +1 -1
- package/dist/engine/module-manifest.d.ts.map +1 -1
- package/dist/engine/module-manifest.js +42 -2
- package/dist/engine/module-manifest.js.map +1 -1
- package/dist/engine/register-engine.d.ts.map +1 -1
- package/dist/engine/register-engine.js +50 -2
- package/dist/engine/register-engine.js.map +1 -1
- package/dist/errors/retry.d.ts.map +1 -1
- package/dist/errors/retry.js +2 -0
- package/dist/errors/retry.js.map +1 -1
- package/dist/facades/types.d.ts +1 -1
- package/dist/flows/chain-types.d.ts +18 -18
- package/dist/flows/gate-evaluator.d.ts.map +1 -1
- package/dist/flows/gate-evaluator.js +22 -0
- package/dist/flows/gate-evaluator.js.map +1 -1
- package/dist/flows/types.d.ts +157 -28
- package/dist/flows/types.d.ts.map +1 -1
- package/dist/flows/types.js +4 -0
- package/dist/flows/types.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/intake/intake-pipeline.d.ts.map +1 -1
- package/dist/intake/intake-pipeline.js +1 -0
- package/dist/intake/intake-pipeline.js.map +1 -1
- package/dist/intake/text-ingester.d.ts.map +1 -1
- package/dist/intake/text-ingester.js +2 -0
- package/dist/intake/text-ingester.js.map +1 -1
- package/dist/llm/key-pool.d.ts +1 -1
- package/dist/llm/key-pool.d.ts.map +1 -1
- package/dist/llm/key-pool.js +3 -4
- package/dist/llm/key-pool.js.map +1 -1
- package/dist/llm/utils.d.ts.map +1 -1
- package/dist/llm/utils.js +2 -0
- package/dist/llm/utils.js.map +1 -1
- package/dist/migrations/migration-runner.test-helpers.d.ts +13 -0
- package/dist/migrations/migration-runner.test-helpers.d.ts.map +1 -0
- package/dist/migrations/migration-runner.test-helpers.js +47 -0
- package/dist/migrations/migration-runner.test-helpers.js.map +1 -0
- package/dist/operator/operator-profile.d.ts +44 -0
- package/dist/operator/operator-profile.d.ts.map +1 -0
- package/dist/operator/operator-profile.js +383 -0
- package/dist/operator/operator-profile.js.map +1 -0
- package/dist/operator/operator-signals.d.ts +45 -0
- package/dist/operator/operator-signals.d.ts.map +1 -0
- package/dist/operator/operator-signals.js +228 -0
- package/dist/operator/operator-signals.js.map +1 -0
- package/dist/operator/operator-types.d.ts +360 -0
- package/dist/operator/operator-types.d.ts.map +1 -0
- package/dist/operator/operator-types.js +24 -0
- package/dist/operator/operator-types.js.map +1 -0
- package/dist/packs/types.d.ts +27 -27
- package/dist/paths.d.ts +40 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +98 -0
- package/dist/paths.js.map +1 -0
- package/dist/persistence/index.d.ts +1 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +1 -1
- package/dist/persistence/index.js.map +1 -1
- package/dist/persistence/sqlite-provider.d.ts +2 -0
- package/dist/persistence/sqlite-provider.d.ts.map +1 -1
- package/dist/persistence/sqlite-provider.js +8 -5
- package/dist/persistence/sqlite-provider.js.map +1 -1
- package/dist/planning/evidence-collector.d.ts +13 -1
- package/dist/planning/evidence-collector.d.ts.map +1 -1
- package/dist/planning/evidence-collector.js +33 -0
- package/dist/planning/evidence-collector.js.map +1 -1
- package/dist/planning/gap-analysis.d.ts +5 -4
- package/dist/planning/gap-analysis.d.ts.map +1 -1
- package/dist/planning/gap-analysis.js +7 -341
- package/dist/planning/gap-analysis.js.map +1 -1
- package/dist/planning/gap-passes.d.ts +19 -0
- package/dist/planning/gap-passes.d.ts.map +1 -0
- package/dist/planning/gap-passes.js +174 -0
- package/dist/planning/gap-passes.js.map +1 -0
- package/dist/planning/gap-patterns.d.ts +29 -0
- package/dist/planning/gap-patterns.d.ts.map +1 -0
- package/dist/planning/gap-patterns.js +175 -0
- package/dist/planning/gap-patterns.js.map +1 -0
- package/dist/planning/gap-types.d.ts +1 -1
- package/dist/planning/gap-types.d.ts.map +1 -1
- package/dist/planning/gap-types.js +1 -0
- package/dist/planning/gap-types.js.map +1 -1
- package/dist/planning/github-projection.d.ts +122 -0
- package/dist/planning/github-projection.d.ts.map +1 -0
- package/dist/planning/github-projection.js +313 -0
- package/dist/planning/github-projection.js.map +1 -0
- package/dist/planning/impact-analyzer.d.ts +26 -0
- package/dist/planning/impact-analyzer.d.ts.map +1 -0
- package/dist/planning/impact-analyzer.js +201 -0
- package/dist/planning/impact-analyzer.js.map +1 -0
- package/dist/planning/plan-lifecycle.d.ts +136 -0
- package/dist/planning/plan-lifecycle.d.ts.map +1 -0
- package/dist/planning/plan-lifecycle.js +309 -0
- package/dist/planning/plan-lifecycle.js.map +1 -0
- package/dist/planning/planner-types.d.ts +202 -0
- package/dist/planning/planner-types.d.ts.map +1 -0
- package/dist/planning/planner-types.js +6 -0
- package/dist/planning/planner-types.js.map +1 -0
- package/dist/planning/planner.d.ts +31 -383
- package/dist/planning/planner.d.ts.map +1 -1
- package/dist/planning/planner.js +151 -832
- package/dist/planning/planner.js.map +1 -1
- package/dist/planning/rationalization-detector.d.ts +32 -0
- package/dist/planning/rationalization-detector.d.ts.map +1 -0
- package/dist/planning/rationalization-detector.js +89 -0
- package/dist/planning/rationalization-detector.js.map +1 -0
- package/dist/planning/reconciliation-engine.d.ts +47 -0
- package/dist/planning/reconciliation-engine.d.ts.map +1 -0
- package/dist/planning/reconciliation-engine.js +128 -0
- package/dist/planning/reconciliation-engine.js.map +1 -0
- package/dist/planning/task-verifier.d.ts +85 -0
- package/dist/planning/task-verifier.d.ts.map +1 -0
- package/dist/planning/task-verifier.js +235 -0
- package/dist/planning/task-verifier.js.map +1 -0
- package/dist/plugins/types.d.ts +4 -4
- package/dist/runtime/admin-ops.d.ts +2 -2
- package/dist/runtime/admin-ops.d.ts.map +1 -1
- package/dist/runtime/admin-ops.js +44 -17
- package/dist/runtime/admin-ops.js.map +1 -1
- package/dist/runtime/admin-setup-ops.d.ts.map +1 -1
- package/dist/runtime/admin-setup-ops.js +22 -46
- package/dist/runtime/admin-setup-ops.js.map +1 -1
- package/dist/runtime/archive-ops.d.ts +10 -0
- package/dist/runtime/archive-ops.d.ts.map +1 -0
- package/dist/runtime/archive-ops.js +310 -0
- package/dist/runtime/archive-ops.js.map +1 -0
- package/dist/runtime/branching-ops.d.ts +12 -0
- package/dist/runtime/branching-ops.d.ts.map +1 -0
- package/dist/runtime/branching-ops.js +100 -0
- package/dist/runtime/branching-ops.js.map +1 -0
- package/dist/runtime/capture-ops.d.ts.map +1 -1
- package/dist/runtime/capture-ops.js +42 -7
- package/dist/runtime/capture-ops.js.map +1 -1
- package/dist/runtime/claude-md-helpers.js +1 -1
- package/dist/runtime/claude-md-helpers.js.map +1 -1
- package/dist/runtime/context-health.d.ts +31 -0
- package/dist/runtime/context-health.d.ts.map +1 -0
- package/dist/runtime/context-health.js +57 -0
- package/dist/runtime/context-health.js.map +1 -0
- package/dist/runtime/facades/archive-facade.d.ts +10 -0
- package/dist/runtime/facades/archive-facade.d.ts.map +1 -0
- package/dist/runtime/facades/archive-facade.js +11 -0
- package/dist/runtime/facades/archive-facade.js.map +1 -0
- package/dist/runtime/facades/brain-facade.d.ts.map +1 -1
- package/dist/runtime/facades/brain-facade.js +2 -0
- package/dist/runtime/facades/brain-facade.js.map +1 -1
- package/dist/runtime/facades/branching-facade.d.ts +7 -0
- package/dist/runtime/facades/branching-facade.d.ts.map +1 -0
- package/dist/runtime/facades/branching-facade.js +8 -0
- package/dist/runtime/facades/branching-facade.js.map +1 -0
- package/dist/runtime/facades/chat-facade.d.ts +7 -0
- package/dist/runtime/facades/chat-facade.d.ts.map +1 -1
- package/dist/runtime/facades/chat-facade.js +15 -800
- package/dist/runtime/facades/chat-facade.js.map +1 -1
- package/dist/runtime/facades/chat-service-ops.d.ts +9 -0
- package/dist/runtime/facades/chat-service-ops.d.ts.map +1 -0
- package/dist/runtime/facades/chat-service-ops.js +332 -0
- package/dist/runtime/facades/chat-service-ops.js.map +1 -0
- package/dist/runtime/facades/chat-session-ops.d.ts +8 -0
- package/dist/runtime/facades/chat-session-ops.d.ts.map +1 -0
- package/dist/runtime/facades/chat-session-ops.js +136 -0
- package/dist/runtime/facades/chat-session-ops.js.map +1 -0
- package/dist/runtime/facades/chat-state.d.ts +31 -0
- package/dist/runtime/facades/chat-state.d.ts.map +1 -0
- package/dist/runtime/facades/chat-state.js +32 -0
- package/dist/runtime/facades/chat-state.js.map +1 -0
- package/dist/runtime/facades/chat-transport-ops.d.ts +9 -0
- package/dist/runtime/facades/chat-transport-ops.d.ts.map +1 -0
- package/dist/runtime/facades/chat-transport-ops.js +337 -0
- package/dist/runtime/facades/chat-transport-ops.js.map +1 -0
- package/dist/runtime/facades/control-facade.d.ts.map +1 -1
- package/dist/runtime/facades/control-facade.js +4 -1
- package/dist/runtime/facades/control-facade.js.map +1 -1
- package/dist/runtime/facades/index.d.ts.map +1 -1
- package/dist/runtime/facades/index.js +48 -0
- package/dist/runtime/facades/index.js.map +1 -1
- package/dist/runtime/facades/intake-facade.d.ts +9 -0
- package/dist/runtime/facades/intake-facade.d.ts.map +1 -0
- package/dist/runtime/facades/intake-facade.js +11 -0
- package/dist/runtime/facades/intake-facade.js.map +1 -0
- package/dist/runtime/facades/links-facade.d.ts +9 -0
- package/dist/runtime/facades/links-facade.d.ts.map +1 -0
- package/dist/runtime/facades/links-facade.js +10 -0
- package/dist/runtime/facades/links-facade.js.map +1 -0
- package/dist/runtime/facades/memory-facade.d.ts.map +1 -1
- package/dist/runtime/facades/memory-facade.js +75 -6
- package/dist/runtime/facades/memory-facade.js.map +1 -1
- package/dist/runtime/facades/operator-facade.d.ts +8 -0
- package/dist/runtime/facades/operator-facade.d.ts.map +1 -0
- package/dist/runtime/facades/operator-facade.js +220 -0
- package/dist/runtime/facades/operator-facade.js.map +1 -0
- package/dist/runtime/facades/orchestrate-facade.js +3 -3
- package/dist/runtime/facades/orchestrate-facade.js.map +1 -1
- package/dist/runtime/facades/plan-facade.d.ts.map +1 -1
- package/dist/runtime/facades/plan-facade.js +42 -6
- package/dist/runtime/facades/plan-facade.js.map +1 -1
- package/dist/runtime/facades/review-facade.d.ts +7 -0
- package/dist/runtime/facades/review-facade.d.ts.map +1 -0
- package/dist/runtime/facades/review-facade.js +8 -0
- package/dist/runtime/facades/review-facade.js.map +1 -0
- package/dist/runtime/facades/sync-facade.d.ts +7 -0
- package/dist/runtime/facades/sync-facade.d.ts.map +1 -0
- package/dist/runtime/facades/sync-facade.js +8 -0
- package/dist/runtime/facades/sync-facade.js.map +1 -0
- package/dist/runtime/facades/tier-facade.d.ts +7 -0
- package/dist/runtime/facades/tier-facade.d.ts.map +1 -0
- package/dist/runtime/facades/tier-facade.js +8 -0
- package/dist/runtime/facades/tier-facade.js.map +1 -0
- package/dist/runtime/facades/vault-facade.d.ts +12 -1
- package/dist/runtime/facades/vault-facade.d.ts.map +1 -1
- package/dist/runtime/facades/vault-facade.js +55 -251
- package/dist/runtime/facades/vault-facade.js.map +1 -1
- package/dist/runtime/github-integration.d.ts +49 -0
- package/dist/runtime/github-integration.d.ts.map +1 -0
- package/dist/runtime/github-integration.js +120 -0
- package/dist/runtime/github-integration.js.map +1 -0
- package/dist/runtime/grading-ops.js +1 -1
- package/dist/runtime/grading-ops.js.map +1 -1
- package/dist/runtime/memory-extra-ops.d.ts.map +1 -1
- package/dist/runtime/memory-extra-ops.js +6 -2
- package/dist/runtime/memory-extra-ops.js.map +1 -1
- package/dist/runtime/orchestrate-ops.d.ts.map +1 -1
- package/dist/runtime/orchestrate-ops.js +386 -37
- package/dist/runtime/orchestrate-ops.js.map +1 -1
- package/dist/runtime/planning-extra-ops.d.ts.map +1 -1
- package/dist/runtime/planning-extra-ops.js +69 -4
- package/dist/runtime/planning-extra-ops.js.map +1 -1
- package/dist/runtime/review-ops.d.ts +10 -0
- package/dist/runtime/review-ops.d.ts.map +1 -0
- package/dist/runtime/review-ops.js +97 -0
- package/dist/runtime/review-ops.js.map +1 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +29 -12
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/session-briefing.d.ts +3 -0
- package/dist/runtime/session-briefing.d.ts.map +1 -1
- package/dist/runtime/session-briefing.js +72 -1
- package/dist/runtime/session-briefing.js.map +1 -1
- package/dist/runtime/sync-ops.d.ts +12 -0
- package/dist/runtime/sync-ops.d.ts.map +1 -0
- package/dist/runtime/sync-ops.js +288 -0
- package/dist/runtime/sync-ops.js.map +1 -0
- package/dist/runtime/tier-ops.d.ts +13 -0
- package/dist/runtime/tier-ops.d.ts.map +1 -0
- package/dist/runtime/tier-ops.js +110 -0
- package/dist/runtime/tier-ops.js.map +1 -0
- package/dist/runtime/types.d.ts +10 -4
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.d.ts +5 -4
- package/dist/runtime/vault-extra-ops.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.js +5 -300
- package/dist/runtime/vault-extra-ops.js.map +1 -1
- package/dist/runtime/vault-sharing-ops.d.ts +4 -4
- package/dist/runtime/vault-sharing-ops.d.ts.map +1 -1
- package/dist/runtime/vault-sharing-ops.js +5 -300
- package/dist/runtime/vault-sharing-ops.js.map +1 -1
- package/dist/skills/sync-skills.d.ts +27 -0
- package/dist/skills/sync-skills.d.ts.map +1 -0
- package/dist/skills/sync-skills.js +81 -0
- package/dist/skills/sync-skills.js.map +1 -0
- package/dist/update-check.d.ts +14 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +96 -0
- package/dist/update-check.js.map +1 -0
- package/dist/vault/linking.d.ts +10 -12
- package/dist/vault/linking.d.ts.map +1 -1
- package/dist/vault/linking.js +140 -161
- package/dist/vault/linking.js.map +1 -1
- package/dist/vault/vault-entries.d.ts +69 -0
- package/dist/vault/vault-entries.d.ts.map +1 -0
- package/dist/vault/vault-entries.js +299 -0
- package/dist/vault/vault-entries.js.map +1 -0
- package/dist/vault/vault-interfaces.d.ts +153 -0
- package/dist/vault/vault-interfaces.d.ts.map +1 -0
- package/dist/vault/vault-interfaces.js +2 -0
- package/dist/vault/vault-interfaces.js.map +1 -0
- package/dist/vault/vault-maintenance.d.ts +40 -0
- package/dist/vault/vault-maintenance.d.ts.map +1 -0
- package/dist/vault/vault-maintenance.js +146 -0
- package/dist/vault/vault-maintenance.js.map +1 -0
- package/dist/vault/vault-markdown-sync.d.ts +22 -0
- package/dist/vault/vault-markdown-sync.d.ts.map +1 -0
- package/dist/vault/vault-markdown-sync.js +143 -0
- package/dist/vault/vault-markdown-sync.js.map +1 -0
- package/dist/vault/vault-memories.d.ts +61 -0
- package/dist/vault/vault-memories.d.ts.map +1 -0
- package/dist/vault/vault-memories.js +242 -0
- package/dist/vault/vault-memories.js.map +1 -0
- package/dist/vault/vault-schema.d.ts +9 -0
- package/dist/vault/vault-schema.d.ts.map +1 -0
- package/dist/vault/vault-schema.js +205 -0
- package/dist/vault/vault-schema.js.map +1 -0
- package/dist/vault/vault.d.ts +29 -81
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +82 -931
- package/dist/vault/vault.js.map +1 -1
- package/package.json +7 -7
- package/src/agency/agency-manager.test.ts +620 -0
- package/src/agency/default-rules.test.ts +236 -0
- package/src/{__tests__ → brain}/brain-intelligence.test.ts +37 -14
- package/src/{__tests__ → brain}/brain.test.ts +1 -1
- package/src/brain/intelligence.ts +196 -15
- package/src/brain/learning-radar.ts +22 -1
- package/src/{__tests__ → brain}/second-brain-features.test.ts +4 -4
- package/src/{__tests__ → brain}/session-lifecycle.test.ts +2 -2
- package/src/capabilities/chain-mapping.test.ts +66 -0
- package/src/capabilities/registry.test.ts +359 -0
- package/src/chat/agent-loop.test.ts +384 -0
- package/src/chat/agent-loop.ts +2 -0
- package/src/{__tests__ → chat}/chat-differentiators.test.ts +3 -3
- package/src/{__tests__ → chat}/chat-enhanced.test.ts +4 -4
- package/src/{__tests__ → chat}/chat-transport.test.ts +6 -6
- package/src/chat/mcp-bridge.test.ts +178 -0
- package/src/chat/notifications.ts +2 -0
- package/src/chat/output-compressor.test.ts +164 -0
- package/src/claudemd/compose.test.ts +178 -0
- package/src/claudemd/compose.ts +1 -1
- package/src/claudemd/inject.test.ts +201 -0
- package/src/context/context-engine.test.ts +506 -0
- package/src/control/identity-manager.test.ts +305 -0
- package/src/control/intent-router.test.ts +360 -0
- package/src/control/intent-router.ts +13 -4
- package/src/curator/classifier.test.ts +110 -0
- package/src/curator/contradiction-detector.test.ts +205 -0
- package/src/curator/contradiction-detector.ts +87 -0
- package/src/{__tests__ → curator}/curator-pipeline-e2e.test.ts +10 -10
- package/src/{__tests__ → curator}/curator.test.ts +77 -1
- package/src/curator/curator.ts +160 -600
- package/src/curator/duplicate-detector.test.ts +245 -0
- package/src/curator/duplicate-detector.ts +103 -0
- package/src/curator/health-audit.ts +126 -0
- package/src/curator/metadata-enricher.ts +84 -0
- package/src/curator/quality-gate.test.ts +175 -0
- package/src/curator/schema.ts +65 -0
- package/src/curator/tag-manager.test.ts +173 -0
- package/src/curator/tag-manager.ts +109 -0
- package/src/domain-packs/inject-rules.test.ts +117 -0
- package/src/domain-packs/knowledge-installer.test.ts +163 -0
- package/src/domain-packs/loader.test.ts +86 -0
- package/src/domain-packs/pack-runtime.test.ts +140 -0
- package/src/domain-packs/skills-installer.test.ts +135 -0
- package/src/domain-packs/token-resolver.test.ts +148 -0
- package/src/domain-packs/types.test.ts +144 -0
- package/src/enforcement/adapters/claude-code.test.ts +216 -0
- package/src/enforcement/registry.test.ts +258 -0
- package/src/engine/bin/soleri-engine.ts +30 -4
- package/src/engine/core-ops.test.ts +254 -0
- package/src/engine/core-ops.ts +25 -8
- package/src/engine/module-manifest.test.ts +125 -0
- package/src/engine/module-manifest.ts +42 -2
- package/src/engine/register-engine.test.ts +235 -0
- package/src/engine/register-engine.ts +50 -3
- package/src/errors/classify.test.ts +203 -0
- package/src/errors/retry.test.ts +153 -0
- package/src/errors/retry.ts +2 -0
- package/src/errors/types.test.ts +108 -0
- package/src/events/event-bus.test.ts +149 -0
- package/src/extensions/middleware.test.ts +234 -0
- package/src/facades/facade-factory.test.ts +470 -0
- package/src/flows/chain-runner.test.ts +273 -0
- package/src/flows/context-router.test.ts +52 -0
- package/src/flows/dispatch-registry.test.ts +128 -0
- package/src/flows/epilogue.test.ts +113 -0
- package/src/flows/executor.test.ts +263 -0
- package/src/flows/gate-evaluator.test.ts +200 -0
- package/src/flows/gate-evaluator.ts +23 -0
- package/src/flows/types.ts +4 -0
- package/src/governance/governance.test.ts +842 -0
- package/src/{__tests__ → health}/health-registry.test.ts +75 -55
- package/src/health/vault-integrity.test.ts +110 -0
- package/src/index.ts +92 -0
- package/src/intake/content-classifier.test.ts +279 -0
- package/src/intake/dedup-gate.test.ts +147 -0
- package/src/intake/intake-pipeline.test.ts +508 -0
- package/src/intake/intake-pipeline.ts +1 -0
- package/src/intake/text-ingester.test.ts +200 -0
- package/src/intake/text-ingester.ts +2 -0
- package/src/llm/key-pool.test.ts +234 -0
- package/src/llm/key-pool.ts +3 -4
- package/src/llm/llm-client.test.ts +342 -0
- package/src/llm/oauth-discovery.test.ts +180 -0
- package/src/llm/utils.test.ts +371 -0
- package/src/llm/utils.ts +2 -0
- package/src/{__tests__ → logging}/logger.test.ts +44 -62
- package/src/loop/loop-manager.test.ts +515 -0
- package/src/migrations/migration-runner.edge-cases.test.ts +314 -0
- package/src/migrations/migration-runner.test-helpers.ts +64 -0
- package/src/migrations/migration-runner.test.ts +385 -0
- package/src/operator/auto-signal-pipeline.test.ts +207 -0
- package/src/operator/operator-profile-extended.test.ts +330 -0
- package/src/operator/operator-profile.test.ts +332 -0
- package/src/operator/operator-profile.ts +485 -0
- package/src/operator/operator-signals-extended.test.ts +257 -0
- package/src/operator/operator-signals.test.ts +277 -0
- package/src/operator/operator-signals.ts +262 -0
- package/src/operator/operator-types.ts +444 -0
- package/src/operator/prompts/hook-precompact-operator-dispatch.md +98 -0
- package/src/operator/prompts/subagent-soft-signal-extractor.md +130 -0
- package/src/operator/prompts/subagent-synthesis-cognition.md +190 -0
- package/src/operator/prompts/subagent-synthesis-communication.md +146 -0
- package/src/operator/prompts/subagent-synthesis-technical.md +170 -0
- package/src/operator/prompts/subagent-synthesis-trust.md +149 -0
- package/src/{__tests__ → packs}/pack-lockfile.test.ts +3 -3
- package/src/{__tests__ → packs}/pack-system.test.ts +2 -2
- package/src/paths.ts +115 -0
- package/src/persistence/index.ts +1 -1
- package/src/persistence/sqlite-provider.test.ts +540 -0
- package/src/persistence/sqlite-provider.ts +8 -5
- package/src/persona/defaults.test.ts +55 -0
- package/src/persona/loader.test.ts +67 -0
- package/src/persona/prompt-generator.test.ts +127 -0
- package/src/planning/evidence-collector.test.ts +515 -0
- package/src/planning/evidence-collector.ts +47 -0
- package/src/planning/gap-analysis-alternatives.test.ts +199 -0
- package/src/planning/gap-analysis.ts +21 -636
- package/src/planning/gap-passes.test.ts +554 -0
- package/src/planning/gap-passes.ts +367 -0
- package/src/planning/gap-patterns.test.ts +394 -0
- package/src/planning/gap-patterns.ts +317 -0
- package/src/planning/gap-types.ts +4 -1
- package/src/planning/github-projection.test.ts +182 -0
- package/src/planning/github-projection.ts +446 -0
- package/src/planning/impact-analyzer.test.ts +167 -0
- package/src/planning/impact-analyzer.ts +251 -0
- package/src/planning/plan-lifecycle.test.ts +379 -0
- package/src/planning/plan-lifecycle.ts +377 -0
- package/src/planning/planner-types.ts +215 -0
- package/src/{__tests__ → planning}/planner.test.ts +179 -15
- package/src/planning/planner.ts +221 -1112
- package/src/planning/rationalization-detector.test.ts +156 -0
- package/src/planning/rationalization-detector.ts +136 -0
- package/src/planning/reconciliation-engine.test.ts +158 -0
- package/src/planning/reconciliation-engine.ts +161 -0
- package/src/planning/task-verifier.test.ts +267 -0
- package/src/planning/task-verifier.ts +309 -0
- package/src/planning/verification-protocol.test.ts +201 -0
- package/src/playbooks/generic/generic-playbooks.test.ts +438 -0
- package/src/playbooks/index.test.ts +77 -0
- package/src/playbooks/playbook-executor.test.ts +253 -0
- package/src/playbooks/playbook-registry.test.ts +232 -0
- package/src/playbooks/playbook-seeder.test.ts +153 -0
- package/src/plugins/plugin-loader.test.ts +217 -0
- package/src/plugins/plugin-registry.test.ts +284 -0
- package/src/project/project-registry.test.ts +439 -0
- package/src/prompts/parser.test.ts +100 -0
- package/src/prompts/template-manager.test.ts +112 -0
- package/src/{__tests__ → queue}/async-infrastructure.test.ts +3 -3
- package/src/queue/job-queue.test.ts +327 -0
- package/src/queue/pipeline-runner.test.ts +209 -0
- package/src/runtime/admin-extra-ops.test.ts +513 -0
- package/src/runtime/admin-ops.test.ts +255 -0
- package/src/runtime/admin-ops.ts +45 -17
- package/src/runtime/admin-setup-ops.test.ts +327 -0
- package/src/runtime/admin-setup-ops.ts +26 -42
- package/src/runtime/archive-ops.test.ts +272 -0
- package/src/runtime/archive-ops.ts +347 -0
- package/src/runtime/branching-ops.test.ts +144 -0
- package/src/runtime/branching-ops.ts +107 -0
- package/src/runtime/capture-ops.test.ts +419 -0
- package/src/runtime/capture-ops.ts +50 -8
- package/src/runtime/chain-ops.test.ts +159 -0
- package/src/runtime/claude-md-helpers.test.ts +189 -0
- package/src/runtime/claude-md-helpers.ts +1 -1
- package/src/runtime/context-health.test.ts +76 -0
- package/src/runtime/context-health.ts +83 -0
- package/src/runtime/curator-extra-ops.test.ts +204 -0
- package/src/runtime/deprecation.test.ts +98 -0
- package/src/runtime/domain-ops.test.ts +278 -0
- package/src/runtime/facades/admin-facade.test.ts +330 -0
- package/src/runtime/facades/agency-facade.test.ts +278 -0
- package/src/runtime/facades/archive-facade.test.ts +308 -0
- package/src/runtime/facades/archive-facade.ts +14 -0
- package/src/runtime/facades/brain-facade.test.ts +818 -0
- package/src/runtime/facades/brain-facade.ts +2 -0
- package/src/runtime/facades/branching-facade.test.ts +43 -0
- package/src/runtime/facades/branching-facade.ts +11 -0
- package/src/runtime/facades/chat-facade.test.ts +219 -0
- package/src/runtime/facades/chat-facade.ts +15 -906
- package/src/runtime/facades/chat-service-ops.test.ts +381 -0
- package/src/runtime/facades/chat-service-ops.ts +376 -0
- package/src/runtime/facades/chat-session-ops.test.ts +212 -0
- package/src/runtime/facades/chat-session-ops.ts +146 -0
- package/src/runtime/facades/chat-state.ts +60 -0
- package/src/runtime/facades/chat-transport-ops.test.ts +336 -0
- package/src/runtime/facades/chat-transport-ops.ts +379 -0
- package/src/runtime/facades/context-facade.test.ts +123 -0
- package/src/runtime/facades/control-facade.test.ts +436 -0
- package/src/runtime/facades/control-facade.ts +6 -1
- package/src/runtime/facades/curator-facade.test.ts +303 -0
- package/src/runtime/facades/index.ts +48 -0
- package/src/runtime/facades/intake-facade.test.ts +215 -0
- package/src/runtime/facades/intake-facade.ts +14 -0
- package/src/runtime/facades/links-facade.test.ts +203 -0
- package/src/runtime/facades/links-facade.ts +13 -0
- package/src/runtime/facades/loop-facade.test.ts +262 -0
- package/src/runtime/facades/memory-facade.test.ts +283 -0
- package/src/runtime/facades/memory-facade.ts +78 -6
- package/src/runtime/facades/operator-facade.test.ts +221 -0
- package/src/runtime/facades/operator-facade.ts +244 -0
- package/src/runtime/facades/orchestrate-facade.test.ts +191 -0
- package/src/runtime/facades/orchestrate-facade.ts +3 -3
- package/src/runtime/facades/plan-facade.test.ts +283 -0
- package/src/runtime/facades/plan-facade.ts +47 -6
- package/src/runtime/facades/review-facade.test.ts +82 -0
- package/src/runtime/facades/review-facade.ts +11 -0
- package/src/runtime/facades/sync-facade.test.ts +113 -0
- package/src/runtime/facades/sync-facade.ts +11 -0
- package/src/runtime/facades/tier-facade.test.ts +47 -0
- package/src/runtime/facades/tier-facade.ts +11 -0
- package/src/runtime/facades/vault-facade.test.ts +563 -0
- package/src/runtime/facades/vault-facade.ts +66 -265
- package/src/runtime/feature-flags.test.ts +140 -0
- package/src/runtime/github-integration.test.ts +89 -0
- package/src/runtime/github-integration.ts +162 -0
- package/src/runtime/grading-ops.test.ts +172 -0
- package/src/runtime/grading-ops.ts +1 -1
- package/src/runtime/intake-ops.test.ts +261 -0
- package/src/runtime/loop-ops.test.ts +248 -0
- package/src/runtime/memory-cross-project-ops.test.ts +188 -0
- package/src/runtime/memory-extra-ops.test.ts +453 -0
- package/src/runtime/memory-extra-ops.ts +6 -2
- package/src/runtime/orchestrate-ops.test.ts +302 -0
- package/src/runtime/orchestrate-ops.ts +461 -45
- package/src/runtime/pack-ops.test.ts +175 -0
- package/src/runtime/planning-extra-ops.test.ts +593 -0
- package/src/runtime/planning-extra-ops.ts +74 -4
- package/src/{__tests__ → runtime}/playbook-ops-execution.test.ts +3 -3
- package/src/runtime/playbook-ops.test.ts +285 -0
- package/src/runtime/plugin-ops.test.ts +259 -0
- package/src/runtime/project-ops.test.ts +255 -0
- package/src/runtime/review-ops.test.ts +142 -0
- package/src/runtime/review-ops.ts +99 -0
- package/src/runtime/runtime.test.ts +363 -0
- package/src/runtime/runtime.ts +41 -12
- package/src/runtime/session-briefing.test.ts +431 -0
- package/src/runtime/session-briefing.ts +86 -1
- package/src/runtime/sync-ops.test.ts +212 -0
- package/src/runtime/sync-ops.ts +325 -0
- package/src/runtime/telemetry-ops.test.ts +157 -0
- package/src/runtime/tier-ops.test.ts +159 -0
- package/src/runtime/tier-ops.ts +119 -0
- package/src/runtime/types.ts +10 -4
- package/src/runtime/vault-extra-ops.test.ts +270 -0
- package/src/runtime/vault-extra-ops.ts +5 -332
- package/src/runtime/vault-linking-ops.test.ts +237 -0
- package/src/runtime/vault-sharing-ops.test.ts +127 -0
- package/src/runtime/vault-sharing-ops.ts +5 -329
- package/src/skills/sync-skills.ts +98 -0
- package/src/streams/normalize.test.ts +95 -0
- package/src/streams/replayable-stream.test.ts +166 -0
- package/src/telemetry/telemetry.test.ts +143 -0
- package/src/transport/http-server.test.ts +394 -0
- package/src/transport/lsp-server.test.ts +458 -0
- package/src/transport/rate-limiter.test.ts +126 -0
- package/src/transport/session-manager.test.ts +133 -0
- package/src/transport/token-auth.test.ts +136 -0
- package/src/transport/ws-server.test.ts +297 -0
- package/src/update-check.ts +111 -0
- package/src/vault/__tests__/vault-characterization.test.ts +579 -0
- package/src/vault/content-hash.test.ts +78 -0
- package/src/vault/git-vault-sync.test.ts +234 -0
- package/src/vault/knowledge-review.test.ts +269 -0
- package/src/vault/linking.test.ts +391 -0
- package/src/vault/linking.ts +188 -181
- package/src/vault/obsidian-sync.test.ts +345 -0
- package/src/vault/playbook.test.ts +152 -0
- package/src/vault/scope-detector.test.ts +185 -0
- package/src/vault/vault-branching.test.ts +252 -0
- package/src/{__tests__ → vault}/vault-connect.test.ts +1 -1
- package/src/vault/vault-entries.ts +426 -0
- package/src/vault/vault-maintenance.ts +200 -0
- package/src/vault/vault-manager.test.ts +206 -0
- package/src/vault/vault-markdown-sync.test.ts +203 -0
- package/src/vault/vault-markdown-sync.ts +163 -0
- package/src/vault/vault-memories.ts +339 -0
- package/src/{__tests__ → vault}/vault-scaling.test.ts +1 -1
- package/src/vault/vault-schema.ts +238 -0
- package/src/{__tests__ → vault}/vault-sharing.test.ts +4 -4
- package/src/{__tests__ → vault}/vault.test.ts +2 -2
- package/src/vault/vault.ts +87 -1123
- package/dist/cognee/client.d.ts +0 -43
- package/dist/cognee/client.d.ts.map +0 -1
- package/dist/cognee/client.js +0 -375
- package/dist/cognee/client.js.map +0 -1
- package/dist/cognee/sync-manager.d.ts +0 -153
- package/dist/cognee/sync-manager.d.ts.map +0 -1
- package/dist/cognee/sync-manager.js +0 -390
- package/dist/cognee/sync-manager.js.map +0 -1
- package/dist/cognee/types.d.ts +0 -62
- package/dist/cognee/types.d.ts.map +0 -1
- package/dist/cognee/types.js +0 -3
- package/dist/cognee/types.js.map +0 -1
- package/dist/governance/index.d.ts +0 -3
- package/dist/governance/index.d.ts.map +0 -1
- package/dist/governance/index.js +0 -2
- package/dist/governance/index.js.map +0 -1
- package/dist/health/doctor-checks.d.ts +0 -15
- package/dist/health/doctor-checks.d.ts.map +0 -1
- package/dist/health/doctor-checks.js +0 -98
- package/dist/health/doctor-checks.js.map +0 -1
- package/dist/persistence/postgres-provider.d.ts +0 -81
- package/dist/persistence/postgres-provider.d.ts.map +0 -1
- package/dist/persistence/postgres-provider.js +0 -256
- package/dist/persistence/postgres-provider.js.map +0 -1
- package/dist/runtime/cognee-sync-ops.d.ts +0 -12
- package/dist/runtime/cognee-sync-ops.d.ts.map +0 -1
- package/dist/runtime/cognee-sync-ops.js +0 -93
- package/dist/runtime/cognee-sync-ops.js.map +0 -1
- package/dist/runtime/core-ops.d.ts +0 -23
- package/dist/runtime/core-ops.d.ts.map +0 -1
- package/dist/runtime/core-ops.js +0 -1296
- package/dist/runtime/core-ops.js.map +0 -1
- package/dist/runtime/facades/cognee-facade.d.ts +0 -8
- package/dist/runtime/facades/cognee-facade.d.ts.map +0 -1
- package/dist/runtime/facades/cognee-facade.js +0 -156
- package/dist/runtime/facades/cognee-facade.js.map +0 -1
- package/src/__tests__/admin-extra-ops.test.ts +0 -484
- package/src/__tests__/admin-ops.test.ts +0 -268
- package/src/__tests__/admin-setup-ops.test.ts +0 -355
- package/src/__tests__/agency-manager.test.ts +0 -374
- package/src/__tests__/agent-loop.test.ts +0 -256
- package/src/__tests__/capture-ops.test.ts +0 -784
- package/src/__tests__/claudemd.test.ts +0 -282
- package/src/__tests__/content-hash.test.ts +0 -60
- package/src/__tests__/context-engine.test.ts +0 -251
- package/src/__tests__/core-ops.test.ts +0 -550
- package/src/__tests__/curator-extra-ops.test.ts +0 -383
- package/src/__tests__/deprecation.test.ts +0 -78
- package/src/__tests__/domain-ops.test.ts +0 -226
- package/src/__tests__/domain-packs.test.ts +0 -421
- package/src/__tests__/enforcement.test.ts +0 -153
- package/src/__tests__/errors.test.ts +0 -388
- package/src/__tests__/extensions.test.ts +0 -233
- package/src/__tests__/facade-factory.test.ts +0 -271
- package/src/__tests__/feature-flags.test.ts +0 -137
- package/src/__tests__/flows.test.ts +0 -604
- package/src/__tests__/git-vault-sync.test.ts +0 -230
- package/src/__tests__/governance.test.ts +0 -522
- package/src/__tests__/grading-ops.test.ts +0 -361
- package/src/__tests__/identity-manager.test.ts +0 -243
- package/src/__tests__/intake-pipeline.test.ts +0 -162
- package/src/__tests__/intent-router.test.ts +0 -222
- package/src/__tests__/knowledge-review.test.ts +0 -104
- package/src/__tests__/llm-client.test.ts +0 -69
- package/src/__tests__/llm.test.ts +0 -556
- package/src/__tests__/loader.test.ts +0 -176
- package/src/__tests__/loop-ops.test.ts +0 -469
- package/src/__tests__/lsp-transport.test.ts +0 -442
- package/src/__tests__/memory-cross-project-ops.test.ts +0 -248
- package/src/__tests__/memory-extra-ops.test.ts +0 -352
- package/src/__tests__/migration-runner.test.ts +0 -170
- package/src/__tests__/module-manifest-drift.test.ts +0 -59
- package/src/__tests__/normalize.test.ts +0 -85
- package/src/__tests__/obsidian-sync.test.ts +0 -354
- package/src/__tests__/orchestrate-ops.test.ts +0 -289
- package/src/__tests__/pack-ops.test.ts +0 -146
- package/src/__tests__/persistence.test.ts +0 -291
- package/src/__tests__/planning-extra-ops.test.ts +0 -706
- package/src/__tests__/playbook-executor.test.ts +0 -249
- package/src/__tests__/playbook-registry.test.ts +0 -326
- package/src/__tests__/playbook-seeder.test.ts +0 -163
- package/src/__tests__/playbook.test.ts +0 -389
- package/src/__tests__/plugin-ops.test.ts +0 -411
- package/src/__tests__/plugin-system.test.ts +0 -509
- package/src/__tests__/project-ops.test.ts +0 -381
- package/src/__tests__/replayable-stream.test.ts +0 -177
- package/src/__tests__/runtime.test.ts +0 -95
- package/src/__tests__/scope-detector.test.ts +0 -121
- package/src/__tests__/template-manager.test.ts +0 -222
- package/src/__tests__/token-resolver.test.ts +0 -79
- package/src/__tests__/transport.test.ts +0 -758
- package/src/__tests__/vault-branching.test.ts +0 -274
- package/src/__tests__/vault-extra-ops.test.ts +0 -482
- package/src/__tests__/vault-integrity.test.ts +0 -71
- package/src/__tests__/vault-manager.test.ts +0 -238
- package/src/__tests__/ws-transport.test.ts +0 -479
- package/src/engine/index.ts +0 -21
- package/src/persona/index.ts +0 -9
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LSP Transport Tests — lsp-server.ts
|
|
3
|
-
*
|
|
4
|
-
* Tests the LSP JSON-RPC server using in-memory PassThrough streams.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { describe, test, expect, afterEach, vi } from 'vitest';
|
|
8
|
-
import { PassThrough } from 'node:stream';
|
|
9
|
-
import { LspServer } from '../transport/index.js';
|
|
10
|
-
import type {
|
|
11
|
-
LspServerCallbacks,
|
|
12
|
-
LspCompletionItem,
|
|
13
|
-
LspDiagnostic,
|
|
14
|
-
LspHover,
|
|
15
|
-
LspCodeAction,
|
|
16
|
-
} from '../transport/index.js';
|
|
17
|
-
|
|
18
|
-
// =============================================================================
|
|
19
|
-
// HELPERS
|
|
20
|
-
// =============================================================================
|
|
21
|
-
|
|
22
|
-
/** Encode a message in LSP wire format */
|
|
23
|
-
function encodeLsp(obj: unknown): string {
|
|
24
|
-
const json = JSON.stringify(obj);
|
|
25
|
-
const len = Buffer.byteLength(json, 'utf-8');
|
|
26
|
-
return `Content-Length: ${len}\r\n\r\n${json}`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Parse one LSP response from a buffer string. Returns parsed JSON and remaining buffer. */
|
|
30
|
-
function parseLspResponse(buffer: string): { message: any; remaining: string } | null {
|
|
31
|
-
const headerEnd = buffer.indexOf('\r\n\r\n');
|
|
32
|
-
if (headerEnd < 0) return null;
|
|
33
|
-
|
|
34
|
-
const headers = buffer.substring(0, headerEnd);
|
|
35
|
-
const match = headers.match(/Content-Length:\s*(\d+)/i);
|
|
36
|
-
if (!match) return null;
|
|
37
|
-
|
|
38
|
-
const contentLength = parseInt(match[1], 10);
|
|
39
|
-
const bodyStart = headerEnd + 4;
|
|
40
|
-
const bodyBytes = Buffer.from(buffer.substring(bodyStart), 'utf-8');
|
|
41
|
-
if (bodyBytes.length < contentLength) return null;
|
|
42
|
-
|
|
43
|
-
const body = bodyBytes.subarray(0, contentLength).toString('utf-8');
|
|
44
|
-
const remaining = bodyBytes.subarray(contentLength).toString('utf-8');
|
|
45
|
-
|
|
46
|
-
return { message: JSON.parse(body), remaining };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Collect all LSP messages from output stream until timeout */
|
|
50
|
-
function collectMessages(output: PassThrough, count = 1, timeoutMs = 3000): Promise<any[]> {
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
const messages: any[] = [];
|
|
53
|
-
let buffer = '';
|
|
54
|
-
const timer = setTimeout(() => {
|
|
55
|
-
if (messages.length > 0) resolve(messages);
|
|
56
|
-
else reject(new Error(`Timeout waiting for ${count} messages, got ${messages.length}`));
|
|
57
|
-
}, timeoutMs);
|
|
58
|
-
|
|
59
|
-
output.on('data', (chunk: Buffer) => {
|
|
60
|
-
buffer += chunk.toString();
|
|
61
|
-
let parsed = parseLspResponse(buffer);
|
|
62
|
-
while (parsed) {
|
|
63
|
-
messages.push(parsed.message);
|
|
64
|
-
buffer = parsed.remaining;
|
|
65
|
-
if (messages.length >= count) {
|
|
66
|
-
clearTimeout(timer);
|
|
67
|
-
resolve(messages);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
parsed = parseLspResponse(buffer);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** Send a request and get the response */
|
|
77
|
-
async function sendRequest(
|
|
78
|
-
input: PassThrough,
|
|
79
|
-
output: PassThrough,
|
|
80
|
-
method: string,
|
|
81
|
-
id: number,
|
|
82
|
-
params?: unknown,
|
|
83
|
-
): Promise<any> {
|
|
84
|
-
const promise = collectMessages(output, 1);
|
|
85
|
-
input.write(encodeLsp({ jsonrpc: '2.0', id, method, params }));
|
|
86
|
-
const [response] = await promise;
|
|
87
|
-
return response;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Send a notification (no response expected) */
|
|
91
|
-
function sendNotification(input: PassThrough, method: string, params?: unknown): void {
|
|
92
|
-
input.write(encodeLsp({ jsonrpc: '2.0', method, params }));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// =============================================================================
|
|
96
|
-
// TESTS
|
|
97
|
-
// =============================================================================
|
|
98
|
-
|
|
99
|
-
describe('LspServer', () => {
|
|
100
|
-
let server: LspServer | undefined;
|
|
101
|
-
let input: PassThrough;
|
|
102
|
-
let output: PassThrough;
|
|
103
|
-
|
|
104
|
-
function createTestServer(
|
|
105
|
-
overrides: Partial<LspServerCallbacks> = {},
|
|
106
|
-
capabilities?: import('../transport/types.js').LspCapabilities,
|
|
107
|
-
): LspServer {
|
|
108
|
-
input = new PassThrough();
|
|
109
|
-
output = new PassThrough();
|
|
110
|
-
const callbacks: LspServerCallbacks = {
|
|
111
|
-
onCompletion: overrides.onCompletion,
|
|
112
|
-
onHover: overrides.onHover,
|
|
113
|
-
onDiagnostics: overrides.onDiagnostics,
|
|
114
|
-
onCodeAction: overrides.onCodeAction,
|
|
115
|
-
onInitialize: overrides.onInitialize,
|
|
116
|
-
onDocumentChange: overrides.onDocumentChange,
|
|
117
|
-
onShutdown: overrides.onShutdown,
|
|
118
|
-
};
|
|
119
|
-
server = new LspServer({ capabilities }, callbacks, input, output);
|
|
120
|
-
return server;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
afterEach(async () => {
|
|
124
|
-
if (server) {
|
|
125
|
-
await server.stop();
|
|
126
|
-
server = undefined;
|
|
127
|
-
}
|
|
128
|
-
input?.destroy();
|
|
129
|
-
output?.destroy();
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test('constructs without error', () => {
|
|
133
|
-
const s = createTestServer();
|
|
134
|
-
expect(s).toBeDefined();
|
|
135
|
-
expect(s.isRunning).toBe(false);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
test('start and stop', async () => {
|
|
139
|
-
const s = createTestServer();
|
|
140
|
-
s.start();
|
|
141
|
-
expect(s.isRunning).toBe(true);
|
|
142
|
-
await s.stop();
|
|
143
|
-
expect(s.isRunning).toBe(false);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test('initialize returns server capabilities', async () => {
|
|
147
|
-
const s = createTestServer({
|
|
148
|
-
onInitialize: async () => ({ name: 'test-agent', version: '1.0.0' }),
|
|
149
|
-
});
|
|
150
|
-
s.start();
|
|
151
|
-
|
|
152
|
-
const response = await sendRequest(input, output, 'initialize', 1, {
|
|
153
|
-
capabilities: {},
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
expect(response.jsonrpc).toBe('2.0');
|
|
157
|
-
expect(response.id).toBe(1);
|
|
158
|
-
expect(response.result.serverInfo.name).toBe('test-agent');
|
|
159
|
-
expect(response.result.serverInfo.version).toBe('1.0.0');
|
|
160
|
-
expect(response.result.capabilities.textDocumentSync).toBeDefined();
|
|
161
|
-
expect(response.result.capabilities.completionProvider).toBeDefined();
|
|
162
|
-
expect(response.result.capabilities.hoverProvider).toBe(true);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
test('initialize with default server info', async () => {
|
|
166
|
-
const s = createTestServer();
|
|
167
|
-
s.start();
|
|
168
|
-
|
|
169
|
-
const response = await sendRequest(input, output, 'initialize', 1, {
|
|
170
|
-
capabilities: {},
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
expect(response.result.serverInfo.name).toBe('soleri-lsp');
|
|
174
|
-
expect(response.result.serverInfo.version).toBe('0.1.0');
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
test('initialize respects disabled capabilities', async () => {
|
|
178
|
-
const s = createTestServer({}, { completions: false, hover: false, codeActions: false });
|
|
179
|
-
s.start();
|
|
180
|
-
|
|
181
|
-
const response = await sendRequest(input, output, 'initialize', 1, {
|
|
182
|
-
capabilities: {},
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
expect(response.result.capabilities.completionProvider).toBeUndefined();
|
|
186
|
-
expect(response.result.capabilities.hoverProvider).toBeUndefined();
|
|
187
|
-
expect(response.result.capabilities.codeActionProvider).toBeUndefined();
|
|
188
|
-
// textDocumentSync always present
|
|
189
|
-
expect(response.result.capabilities.textDocumentSync).toBeDefined();
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
test('completion returns items', async () => {
|
|
193
|
-
const items: LspCompletionItem[] = [
|
|
194
|
-
{ label: '@pattern', kind: 15, detail: 'Design pattern', insertText: '@pattern' },
|
|
195
|
-
{ label: '@antipattern', kind: 15, detail: 'Anti-pattern' },
|
|
196
|
-
];
|
|
197
|
-
const s = createTestServer({
|
|
198
|
-
onCompletion: async () => items,
|
|
199
|
-
});
|
|
200
|
-
s.start();
|
|
201
|
-
|
|
202
|
-
// Must initialize first
|
|
203
|
-
await sendRequest(input, output, 'initialize', 1, { capabilities: {} });
|
|
204
|
-
|
|
205
|
-
const response = await sendRequest(input, output, 'textDocument/completion', 2, {
|
|
206
|
-
textDocument: { uri: 'file:///test.ts' },
|
|
207
|
-
position: { line: 0, character: 1 },
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
expect(response.id).toBe(2);
|
|
211
|
-
expect(response.result).toHaveLength(2);
|
|
212
|
-
expect(response.result[0].label).toBe('@pattern');
|
|
213
|
-
expect(response.result[1].label).toBe('@antipattern');
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
test('completion returns empty when disabled', async () => {
|
|
217
|
-
const s = createTestServer(
|
|
218
|
-
{ onCompletion: async () => [{ label: 'should-not-appear' }] },
|
|
219
|
-
{ completions: false },
|
|
220
|
-
);
|
|
221
|
-
s.start();
|
|
222
|
-
|
|
223
|
-
const response = await sendRequest(input, output, 'textDocument/completion', 1, {
|
|
224
|
-
textDocument: { uri: 'file:///test.ts' },
|
|
225
|
-
position: { line: 0, character: 0 },
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
expect(response.result).toEqual([]);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
test('hover returns documentation', async () => {
|
|
232
|
-
const hover: LspHover = {
|
|
233
|
-
contents: { kind: 'markdown', value: '# Pattern\nUse semantic tokens.' },
|
|
234
|
-
};
|
|
235
|
-
const s = createTestServer({
|
|
236
|
-
onHover: async () => hover,
|
|
237
|
-
});
|
|
238
|
-
s.start();
|
|
239
|
-
|
|
240
|
-
const response = await sendRequest(input, output, 'textDocument/hover', 1, {
|
|
241
|
-
textDocument: { uri: 'file:///test.ts' },
|
|
242
|
-
position: { line: 5, character: 10 },
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
expect(response.result.contents.kind).toBe('markdown');
|
|
246
|
-
expect(response.result.contents.value).toContain('semantic tokens');
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
test('hover returns null when no info', async () => {
|
|
250
|
-
const s = createTestServer({
|
|
251
|
-
onHover: async () => null,
|
|
252
|
-
});
|
|
253
|
-
s.start();
|
|
254
|
-
|
|
255
|
-
const response = await sendRequest(input, output, 'textDocument/hover', 1, {
|
|
256
|
-
textDocument: { uri: 'file:///test.ts' },
|
|
257
|
-
position: { line: 0, character: 0 },
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
expect(response.result).toBeNull();
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
test('diagnostics published on document open', async () => {
|
|
264
|
-
const diagnostics: LspDiagnostic[] = [
|
|
265
|
-
{
|
|
266
|
-
range: { start: { line: 0, character: 0 }, end: { line: 0, character: 10 } },
|
|
267
|
-
severity: 2,
|
|
268
|
-
source: 'soleri',
|
|
269
|
-
message: 'Hardcoded color detected',
|
|
270
|
-
code: 'no-raw-color',
|
|
271
|
-
},
|
|
272
|
-
];
|
|
273
|
-
const s = createTestServer({
|
|
274
|
-
onDiagnostics: async () => diagnostics,
|
|
275
|
-
});
|
|
276
|
-
s.start();
|
|
277
|
-
|
|
278
|
-
// Send didOpen notification — this triggers diagnostics push
|
|
279
|
-
const promise = collectMessages(output, 1);
|
|
280
|
-
sendNotification(input, 'textDocument/didOpen', {
|
|
281
|
-
textDocument: { uri: 'file:///test.ts', text: 'color: #ff0000;' },
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
const [notification] = await promise;
|
|
285
|
-
expect(notification.method).toBe('textDocument/publishDiagnostics');
|
|
286
|
-
expect(notification.params.uri).toBe('file:///test.ts');
|
|
287
|
-
expect(notification.params.diagnostics).toHaveLength(1);
|
|
288
|
-
expect(notification.params.diagnostics[0].message).toBe('Hardcoded color detected');
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
test('diagnostics published on document change', async () => {
|
|
292
|
-
const s = createTestServer({
|
|
293
|
-
onDiagnostics: async (_uri, content) => {
|
|
294
|
-
if (content.includes('#')) {
|
|
295
|
-
return [
|
|
296
|
-
{
|
|
297
|
-
range: { start: { line: 0, character: 0 }, end: { line: 0, character: 7 } },
|
|
298
|
-
severity: 2,
|
|
299
|
-
message: 'Raw color',
|
|
300
|
-
source: 'soleri',
|
|
301
|
-
},
|
|
302
|
-
];
|
|
303
|
-
}
|
|
304
|
-
return [];
|
|
305
|
-
},
|
|
306
|
-
});
|
|
307
|
-
s.start();
|
|
308
|
-
|
|
309
|
-
const promise = collectMessages(output, 1);
|
|
310
|
-
sendNotification(input, 'textDocument/didChange', {
|
|
311
|
-
textDocument: { uri: 'file:///test.css' },
|
|
312
|
-
contentChanges: [{ text: 'background: #000;' }],
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
const [notification] = await promise;
|
|
316
|
-
expect(notification.params.diagnostics).toHaveLength(1);
|
|
317
|
-
expect(notification.params.diagnostics[0].message).toBe('Raw color');
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
test('code actions returned when enabled', async () => {
|
|
321
|
-
const actions: LspCodeAction[] = [
|
|
322
|
-
{
|
|
323
|
-
title: 'Replace with semantic token',
|
|
324
|
-
kind: 'quickfix',
|
|
325
|
-
command: { title: 'Fix', command: 'soleri.replaceToken', arguments: ['bg-surface'] },
|
|
326
|
-
},
|
|
327
|
-
];
|
|
328
|
-
const s = createTestServer({ onCodeAction: async () => actions }, { codeActions: true });
|
|
329
|
-
s.start();
|
|
330
|
-
|
|
331
|
-
const response = await sendRequest(input, output, 'textDocument/codeAction', 1, {
|
|
332
|
-
textDocument: { uri: 'file:///test.ts' },
|
|
333
|
-
range: { start: { line: 0, character: 0 }, end: { line: 0, character: 10 } },
|
|
334
|
-
context: { diagnostics: [] },
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
expect(response.result).toHaveLength(1);
|
|
338
|
-
expect(response.result[0].title).toBe('Replace with semantic token');
|
|
339
|
-
expect(response.result[0].command.command).toBe('soleri.replaceToken');
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
test('unknown method returns MethodNotFound', async () => {
|
|
343
|
-
const s = createTestServer();
|
|
344
|
-
s.start();
|
|
345
|
-
|
|
346
|
-
const response = await sendRequest(input, output, 'custom/unknownMethod', 99);
|
|
347
|
-
|
|
348
|
-
expect(response.error).toBeDefined();
|
|
349
|
-
expect(response.error.code).toBe(-32601);
|
|
350
|
-
expect(response.error.message).toContain('Method not found');
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
test('shutdown calls callback', async () => {
|
|
354
|
-
const onShutdown = vi.fn(async () => {});
|
|
355
|
-
const s = createTestServer({ onShutdown });
|
|
356
|
-
s.start();
|
|
357
|
-
|
|
358
|
-
const response = await sendRequest(input, output, 'shutdown', 1);
|
|
359
|
-
|
|
360
|
-
expect(response.result).toBeNull();
|
|
361
|
-
expect(onShutdown).toHaveBeenCalledTimes(1);
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
test('exit stops the server', async () => {
|
|
365
|
-
const s = createTestServer();
|
|
366
|
-
s.start();
|
|
367
|
-
expect(s.isRunning).toBe(true);
|
|
368
|
-
|
|
369
|
-
sendNotification(input, 'exit');
|
|
370
|
-
|
|
371
|
-
// Wait a tick for the notification to be processed
|
|
372
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
373
|
-
expect(s.isRunning).toBe(false);
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
test('notify sends notification to client', async () => {
|
|
377
|
-
const s = createTestServer();
|
|
378
|
-
s.start();
|
|
379
|
-
|
|
380
|
-
const promise = collectMessages(output, 1);
|
|
381
|
-
s.notify('custom/event', { data: 'test' });
|
|
382
|
-
|
|
383
|
-
const [notification] = await promise;
|
|
384
|
-
expect(notification.method).toBe('custom/event');
|
|
385
|
-
expect(notification.params.data).toBe('test');
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
test('publishDiagnostics sends proper notification', async () => {
|
|
389
|
-
const s = createTestServer();
|
|
390
|
-
s.start();
|
|
391
|
-
|
|
392
|
-
const promise = collectMessages(output, 1);
|
|
393
|
-
s.publishDiagnostics('file:///test.ts', [
|
|
394
|
-
{
|
|
395
|
-
range: { start: { line: 1, character: 0 }, end: { line: 1, character: 5 } },
|
|
396
|
-
severity: 1,
|
|
397
|
-
message: 'Error found',
|
|
398
|
-
},
|
|
399
|
-
]);
|
|
400
|
-
|
|
401
|
-
const [notification] = await promise;
|
|
402
|
-
expect(notification.method).toBe('textDocument/publishDiagnostics');
|
|
403
|
-
expect(notification.params.uri).toBe('file:///test.ts');
|
|
404
|
-
expect(notification.params.diagnostics[0].severity).toBe(1);
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
test('handles multiple sequential messages', async () => {
|
|
408
|
-
let callCount = 0;
|
|
409
|
-
const s = createTestServer({
|
|
410
|
-
onCompletion: async () => {
|
|
411
|
-
callCount++;
|
|
412
|
-
return [{ label: `item-${callCount}` }];
|
|
413
|
-
},
|
|
414
|
-
});
|
|
415
|
-
s.start();
|
|
416
|
-
|
|
417
|
-
const r1 = await sendRequest(input, output, 'textDocument/completion', 1, {
|
|
418
|
-
textDocument: { uri: 'file:///a.ts' },
|
|
419
|
-
position: { line: 0, character: 0 },
|
|
420
|
-
});
|
|
421
|
-
expect(r1.result[0].label).toBe('item-1');
|
|
422
|
-
|
|
423
|
-
const r2 = await sendRequest(input, output, 'textDocument/completion', 2, {
|
|
424
|
-
textDocument: { uri: 'file:///b.ts' },
|
|
425
|
-
position: { line: 0, character: 0 },
|
|
426
|
-
});
|
|
427
|
-
expect(r2.result[0].label).toBe('item-2');
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
test('onDocumentChange called on didOpen', async () => {
|
|
431
|
-
const onDocumentChange = vi.fn(async () => {});
|
|
432
|
-
const s = createTestServer({ onDocumentChange }, { diagnostics: false });
|
|
433
|
-
s.start();
|
|
434
|
-
|
|
435
|
-
sendNotification(input, 'textDocument/didOpen', {
|
|
436
|
-
textDocument: { uri: 'file:///test.ts', text: 'const x = 1;' },
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
await vi.waitFor(() => expect(onDocumentChange).toHaveBeenCalledTimes(1));
|
|
440
|
-
expect(onDocumentChange).toHaveBeenCalledWith('file:///test.ts', expect.any(String));
|
|
441
|
-
});
|
|
442
|
-
});
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import { mkdirSync, rmSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { createAgentRuntime } from '../runtime/runtime.js';
|
|
6
|
-
import { createSemanticFacades } from '../runtime/facades/index.js';
|
|
7
|
-
import type { AgentRuntime } from '../runtime/types.js';
|
|
8
|
-
import type { OpDefinition } from '../facades/types.js';
|
|
9
|
-
|
|
10
|
-
describe('Memory Cross-Project Ops', () => {
|
|
11
|
-
let runtime: AgentRuntime;
|
|
12
|
-
let ops: OpDefinition[];
|
|
13
|
-
let tempDir: string;
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
tempDir = join(tmpdir(), 'cross-project-test-' + Date.now());
|
|
17
|
-
mkdirSync(tempDir, { recursive: true });
|
|
18
|
-
runtime = createAgentRuntime({
|
|
19
|
-
agentId: 'test-cross-project',
|
|
20
|
-
vaultPath: ':memory:',
|
|
21
|
-
plansPath: join(tempDir, 'plans.json'),
|
|
22
|
-
});
|
|
23
|
-
ops = createSemanticFacades(runtime, 'test').flatMap(f => f.ops);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
afterEach(() => {
|
|
27
|
-
runtime.close();
|
|
28
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
function findOp(name: string): OpDefinition {
|
|
32
|
-
const op = ops.find((o) => o.name === name);
|
|
33
|
-
if (!op) throw new Error(`Op "${name}" not found`);
|
|
34
|
-
return op;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
describe('memory_promote_to_global', () => {
|
|
38
|
-
it('should add _global tag to a vault entry', async () => {
|
|
39
|
-
// Add an entry first
|
|
40
|
-
runtime.vault.add({
|
|
41
|
-
id: 'test-entry-1',
|
|
42
|
-
type: 'pattern',
|
|
43
|
-
domain: 'testing',
|
|
44
|
-
title: 'Test Pattern',
|
|
45
|
-
severity: 'suggestion',
|
|
46
|
-
description: 'A test pattern for cross-project sharing',
|
|
47
|
-
tags: ['test'],
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const result = (await findOp('memory_promote_to_global').handler({
|
|
51
|
-
entryId: 'test-entry-1',
|
|
52
|
-
})) as { promoted: boolean; tags: string[] };
|
|
53
|
-
|
|
54
|
-
expect(result.promoted).toBe(true);
|
|
55
|
-
expect(result.tags).toContain('_global');
|
|
56
|
-
expect(result.tags).toContain('test');
|
|
57
|
-
|
|
58
|
-
// Verify the entry actually has the tag
|
|
59
|
-
const entry = runtime.vault.get('test-entry-1');
|
|
60
|
-
expect(entry!.tags).toContain('_global');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should return error for non-existent entry', async () => {
|
|
64
|
-
const result = (await findOp('memory_promote_to_global').handler({
|
|
65
|
-
entryId: 'nonexistent',
|
|
66
|
-
})) as { promoted: boolean; error: string };
|
|
67
|
-
|
|
68
|
-
expect(result.promoted).toBe(false);
|
|
69
|
-
expect(result.error).toContain('not found');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should not duplicate _global tag', async () => {
|
|
73
|
-
runtime.vault.add({
|
|
74
|
-
id: 'test-entry-2',
|
|
75
|
-
type: 'pattern',
|
|
76
|
-
domain: 'testing',
|
|
77
|
-
title: 'Already Global',
|
|
78
|
-
severity: 'suggestion',
|
|
79
|
-
description: 'Already promoted',
|
|
80
|
-
tags: ['_global'],
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
const result = (await findOp('memory_promote_to_global').handler({
|
|
84
|
-
entryId: 'test-entry-2',
|
|
85
|
-
})) as { promoted: boolean; message: string };
|
|
86
|
-
|
|
87
|
-
expect(result.promoted).toBe(false);
|
|
88
|
-
expect(result.message).toContain('already promoted');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe('memory_configure', () => {
|
|
93
|
-
it('should configure cross-project settings', async () => {
|
|
94
|
-
// Register a project first
|
|
95
|
-
runtime.projectRegistry.register('/test/project-a', 'project-a');
|
|
96
|
-
|
|
97
|
-
const result = (await findOp('memory_configure').handler({
|
|
98
|
-
projectPath: '/test/project-a',
|
|
99
|
-
crossProjectEnabled: true,
|
|
100
|
-
extraPaths: ['/test/shared'],
|
|
101
|
-
})) as { configured: boolean; memoryConfig: Record<string, unknown> };
|
|
102
|
-
|
|
103
|
-
expect(result.configured).toBe(true);
|
|
104
|
-
expect(result.memoryConfig.crossProjectEnabled).toBe(true);
|
|
105
|
-
expect(result.memoryConfig.extraPaths).toEqual(['/test/shared']);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('should return error for unregistered project', async () => {
|
|
109
|
-
const result = (await findOp('memory_configure').handler({
|
|
110
|
-
projectPath: '/unregistered/path',
|
|
111
|
-
crossProjectEnabled: true,
|
|
112
|
-
})) as { configured: boolean; error: string };
|
|
113
|
-
|
|
114
|
-
expect(result.configured).toBe(false);
|
|
115
|
-
expect(result.error).toContain('not registered');
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('should preserve existing metadata when updating config', async () => {
|
|
119
|
-
runtime.projectRegistry.register('/test/project-b', 'project-b', { custom: 'value' });
|
|
120
|
-
|
|
121
|
-
await findOp('memory_configure').handler({
|
|
122
|
-
projectPath: '/test/project-b',
|
|
123
|
-
crossProjectEnabled: false,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
const project = runtime.projectRegistry.getByPath('/test/project-b');
|
|
127
|
-
expect(project!.metadata.custom).toBe('value');
|
|
128
|
-
expect((project!.metadata.memoryConfig as Record<string, unknown>).crossProjectEnabled).toBe(
|
|
129
|
-
false,
|
|
130
|
-
);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
describe('memory_cross_project_search', () => {
|
|
135
|
-
it('should search current project memories', async () => {
|
|
136
|
-
runtime.projectRegistry.register('/test/current', 'current');
|
|
137
|
-
|
|
138
|
-
// Capture a memory
|
|
139
|
-
runtime.vault.captureMemory({
|
|
140
|
-
projectPath: '/test/current',
|
|
141
|
-
type: 'lesson',
|
|
142
|
-
context: 'testing',
|
|
143
|
-
summary: 'Always use vitest for TypeScript projects',
|
|
144
|
-
topics: ['testing', 'vitest'],
|
|
145
|
-
filesModified: [],
|
|
146
|
-
toolsUsed: [],
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
const result = (await findOp('memory_cross_project_search').handler({
|
|
150
|
-
query: 'vitest',
|
|
151
|
-
projectPath: '/test/current',
|
|
152
|
-
})) as { memories: Array<{ weight: number; source: string }>; totalResults: number };
|
|
153
|
-
|
|
154
|
-
expect(result.memories.length).toBeGreaterThanOrEqual(1);
|
|
155
|
-
expect(result.memories[0].weight).toBe(1.0);
|
|
156
|
-
expect(result.memories[0].source).toBe('current');
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('should include global entries in results', async () => {
|
|
160
|
-
runtime.projectRegistry.register('/test/current', 'current');
|
|
161
|
-
|
|
162
|
-
// Add a global entry
|
|
163
|
-
runtime.vault.add({
|
|
164
|
-
id: 'global-pattern',
|
|
165
|
-
type: 'pattern',
|
|
166
|
-
domain: 'testing',
|
|
167
|
-
title: 'Global Testing Pattern',
|
|
168
|
-
severity: 'suggestion',
|
|
169
|
-
description: 'A globally promoted testing pattern for vitest',
|
|
170
|
-
tags: ['_global', 'testing'],
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
const result = (await findOp('memory_cross_project_search').handler({
|
|
174
|
-
query: 'testing',
|
|
175
|
-
projectPath: '/test/current',
|
|
176
|
-
})) as { globalEntries: Array<{ weight: number; source: string }> };
|
|
177
|
-
|
|
178
|
-
expect(result.globalEntries.length).toBeGreaterThanOrEqual(1);
|
|
179
|
-
expect(result.globalEntries[0].weight).toBe(0.9);
|
|
180
|
-
expect(result.globalEntries[0].source).toBe('global');
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it('should search linked project memories', async () => {
|
|
184
|
-
const projA = runtime.projectRegistry.register('/test/project-a', 'project-a');
|
|
185
|
-
const projB = runtime.projectRegistry.register('/test/project-b', 'project-b');
|
|
186
|
-
runtime.projectRegistry.link(projA.id, projB.id, 'related');
|
|
187
|
-
|
|
188
|
-
// Configure cross-project for project A
|
|
189
|
-
await findOp('memory_configure').handler({
|
|
190
|
-
projectPath: '/test/project-a',
|
|
191
|
-
crossProjectEnabled: true,
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// Capture memory in project B
|
|
195
|
-
runtime.vault.captureMemory({
|
|
196
|
-
projectPath: '/test/project-b',
|
|
197
|
-
type: 'lesson',
|
|
198
|
-
context: 'architecture',
|
|
199
|
-
summary: 'Use facade pattern for clean separation',
|
|
200
|
-
topics: ['architecture', 'facade'],
|
|
201
|
-
filesModified: [],
|
|
202
|
-
toolsUsed: [],
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
const result = (await findOp('memory_cross_project_search').handler({
|
|
206
|
-
query: 'facade',
|
|
207
|
-
projectPath: '/test/project-a',
|
|
208
|
-
})) as {
|
|
209
|
-
linkedMemories: Array<{ weight: number; source: string; linkedProject: string }>;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
expect(result.linkedMemories.length).toBeGreaterThanOrEqual(1);
|
|
213
|
-
expect(result.linkedMemories[0].weight).toBe(0.8);
|
|
214
|
-
expect(result.linkedMemories[0].source).toBe('linked');
|
|
215
|
-
expect(result.linkedMemories[0].linkedProject).toBe('/test/project-b');
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
it('should respect crossProjectEnabled=false', async () => {
|
|
219
|
-
const projA = runtime.projectRegistry.register('/test/disabled-a', 'disabled-a');
|
|
220
|
-
const projB = runtime.projectRegistry.register('/test/disabled-b', 'disabled-b');
|
|
221
|
-
runtime.projectRegistry.link(projA.id, projB.id, 'related');
|
|
222
|
-
|
|
223
|
-
// Explicitly disable cross-project
|
|
224
|
-
await findOp('memory_configure').handler({
|
|
225
|
-
projectPath: '/test/disabled-a',
|
|
226
|
-
crossProjectEnabled: false,
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
// Capture memory in project B
|
|
230
|
-
runtime.vault.captureMemory({
|
|
231
|
-
projectPath: '/test/disabled-b',
|
|
232
|
-
type: 'lesson',
|
|
233
|
-
context: 'testing',
|
|
234
|
-
summary: 'This should not appear in cross-project search',
|
|
235
|
-
topics: ['hidden'],
|
|
236
|
-
filesModified: [],
|
|
237
|
-
toolsUsed: [],
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
const result = (await findOp('memory_cross_project_search').handler({
|
|
241
|
-
query: 'hidden',
|
|
242
|
-
projectPath: '/test/disabled-a',
|
|
243
|
-
})) as { linkedMemories: unknown[] };
|
|
244
|
-
|
|
245
|
-
expect(result.linkedMemories).toEqual([]);
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
});
|