@soleri/core 2.12.0 → 8.0.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 +128 -0
- package/data/flows/deliver.flow.yaml +110 -0
- package/data/flows/design.flow.yaml +108 -0
- package/data/flows/enhance.flow.yaml +90 -0
- package/data/flows/explore.flow.yaml +84 -0
- package/data/flows/fix.flow.yaml +90 -0
- package/data/flows/plan.flow.yaml +87 -0
- package/data/flows/review.flow.yaml +90 -0
- package/dist/agency/agency-manager.d.ts +27 -1
- package/dist/agency/agency-manager.d.ts.map +1 -1
- package/dist/agency/agency-manager.js +180 -9
- package/dist/agency/agency-manager.js.map +1 -1
- package/dist/agency/default-rules.d.ts +7 -0
- package/dist/agency/default-rules.d.ts.map +1 -0
- package/dist/agency/default-rules.js +79 -0
- package/dist/agency/default-rules.js.map +1 -0
- package/dist/agency/types.d.ts +48 -0
- package/dist/agency/types.d.ts.map +1 -1
- package/dist/brain/brain.d.ts +17 -2
- package/dist/brain/brain.d.ts.map +1 -1
- package/dist/brain/brain.js +118 -8
- package/dist/brain/brain.js.map +1 -1
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +16 -2
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/knowledge-synthesizer.d.ts +37 -0
- package/dist/brain/knowledge-synthesizer.d.ts.map +1 -0
- package/dist/brain/knowledge-synthesizer.js +161 -0
- package/dist/brain/knowledge-synthesizer.js.map +1 -0
- package/dist/brain/learning-radar.d.ts +96 -0
- package/dist/brain/learning-radar.d.ts.map +1 -0
- package/dist/brain/learning-radar.js +202 -0
- package/dist/brain/learning-radar.js.map +1 -0
- package/dist/brain/types.d.ts +15 -0
- package/dist/brain/types.d.ts.map +1 -1
- package/dist/capabilities/chain-mapping.d.ts +21 -0
- package/dist/capabilities/chain-mapping.d.ts.map +1 -0
- package/dist/capabilities/chain-mapping.js +86 -0
- package/dist/capabilities/chain-mapping.js.map +1 -0
- package/dist/capabilities/index.d.ts +10 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +8 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +95 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +227 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/capabilities/types.d.ts +106 -0
- package/dist/capabilities/types.d.ts.map +1 -0
- package/dist/capabilities/types.js +12 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/context/context-engine.d.ts.map +1 -1
- package/dist/context/context-engine.js +82 -17
- package/dist/context/context-engine.js.map +1 -1
- package/dist/context/types.d.ts +5 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/control/intent-router.d.ts +12 -1
- package/dist/control/intent-router.d.ts.map +1 -1
- package/dist/control/intent-router.js +126 -2
- package/dist/control/intent-router.js.map +1 -1
- package/dist/control/types.d.ts +17 -0
- package/dist/control/types.d.ts.map +1 -1
- package/dist/curator/classifier.d.ts +18 -0
- package/dist/curator/classifier.d.ts.map +1 -0
- package/dist/curator/classifier.js +61 -0
- package/dist/curator/classifier.js.map +1 -0
- package/dist/curator/quality-gate.d.ts +29 -0
- package/dist/curator/quality-gate.d.ts.map +1 -0
- package/dist/curator/quality-gate.js +88 -0
- package/dist/curator/quality-gate.js.map +1 -0
- package/dist/domain-packs/index.d.ts +8 -0
- package/dist/domain-packs/index.d.ts.map +1 -0
- package/dist/domain-packs/index.js +8 -0
- package/dist/domain-packs/index.js.map +1 -0
- package/dist/domain-packs/inject-rules.d.ts +24 -0
- package/dist/domain-packs/inject-rules.d.ts.map +1 -0
- package/dist/domain-packs/inject-rules.js +65 -0
- package/dist/domain-packs/inject-rules.js.map +1 -0
- package/dist/domain-packs/knowledge-installer.d.ts +27 -0
- package/dist/domain-packs/knowledge-installer.d.ts.map +1 -0
- package/dist/domain-packs/knowledge-installer.js +89 -0
- package/dist/domain-packs/knowledge-installer.js.map +1 -0
- package/dist/domain-packs/loader.d.ts +28 -0
- package/dist/domain-packs/loader.d.ts.map +1 -0
- package/dist/domain-packs/loader.js +105 -0
- package/dist/domain-packs/loader.js.map +1 -0
- package/dist/domain-packs/pack-runtime.d.ts +80 -0
- package/dist/domain-packs/pack-runtime.d.ts.map +1 -0
- package/dist/domain-packs/pack-runtime.js +36 -0
- package/dist/domain-packs/pack-runtime.js.map +1 -0
- package/dist/domain-packs/skills-installer.d.ts +21 -0
- package/dist/domain-packs/skills-installer.d.ts.map +1 -0
- package/dist/domain-packs/skills-installer.js +38 -0
- package/dist/domain-packs/skills-installer.js.map +1 -0
- package/dist/domain-packs/token-resolver.d.ts +37 -0
- package/dist/domain-packs/token-resolver.d.ts.map +1 -0
- package/dist/domain-packs/token-resolver.js +109 -0
- package/dist/domain-packs/token-resolver.js.map +1 -0
- package/dist/domain-packs/types.d.ts +91 -0
- package/dist/domain-packs/types.d.ts.map +1 -0
- package/dist/domain-packs/types.js +122 -0
- package/dist/domain-packs/types.js.map +1 -0
- package/dist/engine/bin/soleri-engine.d.ts +12 -0
- package/dist/engine/bin/soleri-engine.d.ts.map +1 -0
- package/dist/engine/bin/soleri-engine.js +184 -0
- package/dist/engine/bin/soleri-engine.js.map +1 -0
- package/dist/engine/core-ops.d.ts +27 -0
- package/dist/engine/core-ops.d.ts.map +1 -0
- package/dist/engine/core-ops.js +159 -0
- package/dist/engine/core-ops.js.map +1 -0
- package/dist/engine/index.d.ts +19 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/register-engine.d.ts +54 -0
- package/dist/engine/register-engine.d.ts.map +1 -0
- package/dist/engine/register-engine.js +270 -0
- package/dist/engine/register-engine.js.map +1 -0
- package/dist/engine/test-helpers.d.ts +30 -0
- package/dist/engine/test-helpers.d.ts.map +1 -0
- package/dist/engine/test-helpers.js +59 -0
- package/dist/engine/test-helpers.js.map +1 -0
- package/dist/events/event-bus.d.ts +30 -0
- package/dist/events/event-bus.d.ts.map +1 -0
- package/dist/events/event-bus.js +51 -0
- package/dist/events/event-bus.js.map +1 -0
- package/dist/flows/chain-runner.d.ts +46 -0
- package/dist/flows/chain-runner.d.ts.map +1 -0
- package/dist/flows/chain-runner.js +271 -0
- package/dist/flows/chain-runner.js.map +1 -0
- package/dist/flows/chain-types.d.ts +103 -0
- package/dist/flows/chain-types.d.ts.map +1 -0
- package/dist/flows/chain-types.js +23 -0
- package/dist/flows/chain-types.js.map +1 -0
- package/dist/flows/context-router.d.ts +39 -0
- package/dist/flows/context-router.d.ts.map +1 -0
- package/dist/flows/context-router.js +206 -0
- package/dist/flows/context-router.js.map +1 -0
- package/dist/flows/dispatch-registry.d.ts +24 -0
- package/dist/flows/dispatch-registry.d.ts.map +1 -0
- package/dist/flows/dispatch-registry.js +70 -0
- package/dist/flows/dispatch-registry.js.map +1 -0
- package/dist/flows/epilogue.d.ts +24 -0
- package/dist/flows/epilogue.d.ts.map +1 -0
- package/dist/flows/epilogue.js +52 -0
- package/dist/flows/epilogue.js.map +1 -0
- package/dist/flows/executor.d.ts +25 -0
- package/dist/flows/executor.d.ts.map +1 -0
- package/dist/flows/executor.js +153 -0
- package/dist/flows/executor.js.map +1 -0
- package/dist/flows/gate-evaluator.d.ts +26 -0
- package/dist/flows/gate-evaluator.d.ts.map +1 -0
- package/dist/flows/gate-evaluator.js +162 -0
- package/dist/flows/gate-evaluator.js.map +1 -0
- package/dist/flows/index.d.ts +14 -0
- package/dist/flows/index.d.ts.map +1 -0
- package/dist/flows/index.js +20 -0
- package/dist/flows/index.js.map +1 -0
- package/dist/flows/loader.d.ts +17 -0
- package/dist/flows/loader.d.ts.map +1 -0
- package/dist/flows/loader.js +61 -0
- package/dist/flows/loader.js.map +1 -0
- package/dist/flows/plan-builder.d.ts +40 -0
- package/dist/flows/plan-builder.d.ts.map +1 -0
- package/dist/flows/plan-builder.js +213 -0
- package/dist/flows/plan-builder.js.map +1 -0
- package/dist/flows/probes.d.ts +11 -0
- package/dist/flows/probes.d.ts.map +1 -0
- package/dist/flows/probes.js +62 -0
- package/dist/flows/probes.js.map +1 -0
- package/dist/flows/types.d.ts +950 -0
- package/dist/flows/types.d.ts.map +1 -0
- package/dist/flows/types.js +105 -0
- package/dist/flows/types.js.map +1 -0
- package/dist/health/doctor-checks.d.ts +15 -0
- package/dist/health/doctor-checks.d.ts.map +1 -0
- package/dist/health/doctor-checks.js +98 -0
- package/dist/health/doctor-checks.js.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/intake/text-ingester.d.ts +52 -0
- package/dist/intake/text-ingester.d.ts.map +1 -0
- package/dist/intake/text-ingester.js +181 -0
- package/dist/intake/text-ingester.js.map +1 -0
- package/dist/intelligence/loader.d.ts +19 -0
- package/dist/intelligence/loader.d.ts.map +1 -1
- package/dist/intelligence/loader.js +35 -0
- package/dist/intelligence/loader.js.map +1 -1
- package/dist/intelligence/types.d.ts +1 -0
- package/dist/intelligence/types.d.ts.map +1 -1
- package/dist/llm/llm-client.d.ts.map +1 -1
- package/dist/llm/llm-client.js +37 -1
- package/dist/llm/llm-client.js.map +1 -1
- package/dist/llm/oauth-discovery.d.ts +26 -0
- package/dist/llm/oauth-discovery.d.ts.map +1 -0
- package/dist/llm/oauth-discovery.js +149 -0
- package/dist/llm/oauth-discovery.js.map +1 -0
- package/dist/packs/types.d.ts +58 -19
- package/dist/packs/types.d.ts.map +1 -1
- package/dist/packs/types.js +14 -0
- package/dist/packs/types.js.map +1 -1
- package/dist/planning/evidence-collector.d.ts +41 -0
- package/dist/planning/evidence-collector.d.ts.map +1 -0
- package/dist/planning/evidence-collector.js +194 -0
- package/dist/planning/evidence-collector.js.map +1 -0
- package/dist/planning/planner.d.ts +4 -0
- package/dist/planning/planner.d.ts.map +1 -1
- package/dist/planning/planner.js +11 -0
- package/dist/planning/planner.js.map +1 -1
- package/dist/playbooks/generic/onboarding.d.ts +9 -0
- package/dist/playbooks/generic/onboarding.d.ts.map +1 -0
- package/dist/playbooks/generic/onboarding.js +74 -0
- package/dist/playbooks/generic/onboarding.js.map +1 -0
- package/dist/playbooks/playbook-registry.d.ts.map +1 -1
- package/dist/playbooks/playbook-registry.js +2 -0
- package/dist/playbooks/playbook-registry.js.map +1 -1
- package/dist/queue/job-queue.d.ts +92 -0
- package/dist/queue/job-queue.d.ts.map +1 -0
- package/dist/queue/job-queue.js +180 -0
- package/dist/queue/job-queue.js.map +1 -0
- package/dist/queue/pipeline-runner.d.ts +62 -0
- package/dist/queue/pipeline-runner.d.ts.map +1 -0
- package/dist/queue/pipeline-runner.js +126 -0
- package/dist/queue/pipeline-runner.js.map +1 -0
- package/dist/runtime/admin-extra-ops.d.ts.map +1 -1
- package/dist/runtime/admin-extra-ops.js +15 -9
- package/dist/runtime/admin-extra-ops.js.map +1 -1
- package/dist/runtime/admin-ops.js +4 -4
- package/dist/runtime/admin-ops.js.map +1 -1
- package/dist/runtime/admin-setup-ops.d.ts +20 -0
- package/dist/runtime/admin-setup-ops.d.ts.map +1 -0
- package/dist/runtime/admin-setup-ops.js +583 -0
- package/dist/runtime/admin-setup-ops.js.map +1 -0
- package/dist/runtime/capture-ops.d.ts.map +1 -1
- package/dist/runtime/capture-ops.js +33 -1
- package/dist/runtime/capture-ops.js.map +1 -1
- package/dist/runtime/chain-ops.d.ts +9 -0
- package/dist/runtime/chain-ops.d.ts.map +1 -0
- package/dist/runtime/chain-ops.js +107 -0
- package/dist/runtime/chain-ops.js.map +1 -0
- package/dist/runtime/claude-md-helpers.d.ts +65 -0
- package/dist/runtime/claude-md-helpers.d.ts.map +1 -0
- package/dist/runtime/claude-md-helpers.js +173 -0
- package/dist/runtime/claude-md-helpers.js.map +1 -0
- package/dist/runtime/curator-extra-ops.d.ts +3 -2
- package/dist/runtime/curator-extra-ops.d.ts.map +1 -1
- package/dist/runtime/curator-extra-ops.js +81 -3
- package/dist/runtime/curator-extra-ops.js.map +1 -1
- package/dist/runtime/domain-ops.d.ts +21 -5
- package/dist/runtime/domain-ops.d.ts.map +1 -1
- package/dist/runtime/domain-ops.js +64 -6
- package/dist/runtime/domain-ops.js.map +1 -1
- package/dist/runtime/facades/admin-facade.d.ts.map +1 -1
- package/dist/runtime/facades/admin-facade.js +4 -0
- package/dist/runtime/facades/admin-facade.js.map +1 -1
- package/dist/runtime/facades/agency-facade.d.ts.map +1 -1
- package/dist/runtime/facades/agency-facade.js +64 -0
- package/dist/runtime/facades/agency-facade.js.map +1 -1
- package/dist/runtime/facades/brain-facade.d.ts.map +1 -1
- package/dist/runtime/facades/brain-facade.js +122 -1
- package/dist/runtime/facades/brain-facade.js.map +1 -1
- package/dist/runtime/facades/cognee-facade.d.ts.map +1 -1
- package/dist/runtime/facades/cognee-facade.js +3 -1
- package/dist/runtime/facades/cognee-facade.js.map +1 -1
- package/dist/runtime/facades/control-facade.d.ts.map +1 -1
- package/dist/runtime/facades/control-facade.js +42 -0
- 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 +10 -6
- package/dist/runtime/facades/index.js.map +1 -1
- package/dist/runtime/facades/memory-facade.d.ts.map +1 -1
- package/dist/runtime/facades/memory-facade.js +20 -2
- package/dist/runtime/facades/memory-facade.js.map +1 -1
- package/dist/runtime/facades/plan-facade.d.ts.map +1 -1
- package/dist/runtime/facades/plan-facade.js +2 -0
- package/dist/runtime/facades/plan-facade.js.map +1 -1
- package/dist/runtime/facades/vault-facade.d.ts.map +1 -1
- package/dist/runtime/facades/vault-facade.js +27 -5
- package/dist/runtime/facades/vault-facade.js.map +1 -1
- package/dist/runtime/intake-ops.d.ts +7 -5
- package/dist/runtime/intake-ops.d.ts.map +1 -1
- package/dist/runtime/intake-ops.js +98 -5
- package/dist/runtime/intake-ops.js.map +1 -1
- package/dist/runtime/memory-extra-ops.d.ts +6 -3
- package/dist/runtime/memory-extra-ops.d.ts.map +1 -1
- package/dist/runtime/memory-extra-ops.js +292 -4
- package/dist/runtime/memory-extra-ops.js.map +1 -1
- package/dist/runtime/orchestrate-ops.d.ts +8 -7
- package/dist/runtime/orchestrate-ops.d.ts.map +1 -1
- package/dist/runtime/orchestrate-ops.js +217 -61
- 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 +85 -0
- package/dist/runtime/planning-extra-ops.js.map +1 -1
- package/dist/runtime/playbook-ops.js +1 -1
- package/dist/runtime/playbook-ops.js.map +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +165 -18
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/session-briefing.d.ts +23 -0
- package/dist/runtime/session-briefing.d.ts.map +1 -0
- package/dist/runtime/session-briefing.js +140 -0
- package/dist/runtime/session-briefing.js.map +1 -0
- package/dist/runtime/types.d.ts +29 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-linking-ops.d.ts +13 -0
- package/dist/runtime/vault-linking-ops.d.ts.map +1 -0
- package/dist/runtime/vault-linking-ops.js +365 -0
- package/dist/runtime/vault-linking-ops.js.map +1 -0
- package/dist/vault/linking.d.ts +46 -0
- package/dist/vault/linking.d.ts.map +1 -0
- package/dist/vault/linking.js +275 -0
- package/dist/vault/linking.js.map +1 -0
- package/dist/vault/vault-types.d.ts +37 -0
- package/dist/vault/vault-types.d.ts.map +1 -1
- package/dist/vault/vault.d.ts +37 -0
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +152 -9
- package/dist/vault/vault.js.map +1 -1
- package/package.json +4 -1
- package/src/__tests__/admin-extra-ops.test.ts +1 -1
- package/src/__tests__/admin-ops.test.ts +2 -1
- package/src/__tests__/admin-setup-ops.test.ts +355 -0
- package/src/__tests__/async-infrastructure.test.ts +307 -0
- package/src/__tests__/cognee-client-gaps.test.ts +474 -0
- package/src/__tests__/cognee-hybrid-search.test.ts +492 -0
- package/src/__tests__/cognee-sync-manager-deep.test.ts +654 -0
- package/src/__tests__/cognee-sync-manager.test.ts +1 -0
- package/src/__tests__/core-ops.test.ts +9 -61
- package/src/__tests__/curator-extra-ops.test.ts +6 -2
- package/src/__tests__/curator-pipeline-e2e.test.ts +358 -0
- package/src/__tests__/domain-packs.test.ts +421 -0
- package/src/__tests__/flows.test.ts +604 -0
- package/src/__tests__/memory-extra-ops.test.ts +2 -2
- package/src/__tests__/planning-extra-ops.test.ts +2 -2
- package/src/__tests__/playbook-registry.test.ts +2 -2
- package/src/__tests__/playbook-seeder.test.ts +8 -8
- package/src/__tests__/playbook.test.ts +5 -5
- package/src/__tests__/second-brain-features.test.ts +583 -0
- package/src/__tests__/token-resolver.test.ts +79 -0
- package/src/agency/agency-manager.ts +217 -9
- package/src/agency/default-rules.ts +83 -0
- package/src/agency/types.ts +61 -0
- package/src/brain/brain.ts +110 -8
- package/src/brain/intelligence.ts +21 -2
- package/src/brain/knowledge-synthesizer.ts +218 -0
- package/src/brain/learning-radar.ts +340 -0
- package/src/brain/types.ts +16 -0
- package/src/capabilities/chain-mapping.ts +93 -0
- package/src/capabilities/index.ts +21 -0
- package/src/capabilities/registry.ts +290 -0
- package/src/capabilities/types.ts +143 -0
- package/src/context/context-engine.ts +114 -15
- package/src/context/types.ts +5 -0
- package/src/control/intent-router.ts +153 -2
- package/src/control/types.ts +10 -0
- package/src/curator/classifier.ts +88 -0
- package/src/curator/quality-gate.ts +129 -0
- package/src/domain-packs/index.ts +27 -0
- package/src/domain-packs/inject-rules.ts +74 -0
- package/src/domain-packs/knowledge-installer.ts +116 -0
- package/src/domain-packs/loader.ts +124 -0
- package/src/domain-packs/pack-runtime.ts +99 -0
- package/src/domain-packs/skills-installer.ts +56 -0
- package/src/domain-packs/token-resolver.ts +126 -0
- package/src/domain-packs/types.ts +229 -0
- package/src/engine/__tests__/register-engine.test.ts +104 -0
- package/src/engine/bin/soleri-engine.ts +218 -0
- package/src/engine/core-ops.ts +178 -0
- package/src/engine/index.ts +19 -0
- package/src/engine/register-engine.ts +385 -0
- package/src/engine/test-helpers.ts +83 -0
- package/src/events/event-bus.ts +58 -0
- package/src/flows/chain-runner.ts +369 -0
- package/src/flows/chain-types.ts +57 -0
- package/src/flows/context-router.ts +257 -0
- package/src/flows/dispatch-registry.ts +80 -0
- package/src/flows/epilogue.ts +65 -0
- package/src/flows/executor.ts +182 -0
- package/src/flows/gate-evaluator.ts +171 -0
- package/src/flows/index.ts +52 -0
- package/src/flows/loader.ts +63 -0
- package/src/flows/plan-builder.ts +250 -0
- package/src/flows/probes.ts +70 -0
- package/src/flows/types.ts +217 -0
- package/src/health/doctor-checks.ts +115 -0
- package/src/index.ts +68 -1
- package/src/intake/text-ingester.ts +234 -0
- package/src/intelligence/loader.ts +38 -0
- package/src/intelligence/types.ts +1 -0
- package/src/llm/llm-client.ts +38 -1
- package/src/llm/oauth-discovery.ts +169 -0
- package/src/packs/types.ts +19 -0
- package/src/planning/evidence-collector.ts +247 -0
- package/src/planning/planner.ts +11 -0
- package/src/playbooks/generic/onboarding.ts +79 -0
- package/src/playbooks/playbook-registry.ts +2 -0
- package/src/queue/job-queue.ts +281 -0
- package/src/queue/pipeline-runner.ts +149 -0
- package/src/runtime/admin-extra-ops.ts +14 -8
- package/src/runtime/admin-ops.ts +4 -4
- package/src/runtime/admin-setup-ops.ts +664 -0
- package/src/runtime/capture-ops.ts +40 -1
- package/src/runtime/chain-ops.ts +121 -0
- package/src/runtime/claude-md-helpers.ts +236 -0
- package/src/runtime/curator-extra-ops.ts +86 -3
- package/src/runtime/domain-ops.ts +71 -5
- package/src/runtime/facades/admin-facade.ts +4 -0
- package/src/runtime/facades/agency-facade.ts +68 -0
- package/src/runtime/facades/brain-facade.ts +142 -1
- package/src/runtime/facades/cognee-facade.ts +3 -1
- package/src/runtime/facades/control-facade.ts +45 -0
- package/src/runtime/facades/index.ts +12 -6
- package/src/runtime/facades/memory-facade.ts +20 -2
- package/src/runtime/facades/plan-facade.ts +2 -0
- package/src/runtime/facades/vault-facade.ts +30 -5
- package/src/runtime/intake-ops.ts +107 -5
- package/src/runtime/memory-extra-ops.ts +312 -4
- package/src/runtime/orchestrate-ops.ts +261 -65
- package/src/runtime/planning-extra-ops.ts +94 -0
- package/src/runtime/playbook-ops.ts +1 -1
- package/src/runtime/runtime.ts +164 -19
- package/src/runtime/session-briefing.ts +161 -0
- package/src/runtime/types.ts +29 -2
- package/src/runtime/vault-linking-ops.ts +452 -0
- package/src/vault/linking.ts +333 -0
- package/src/vault/vault-types.ts +46 -0
- package/src/vault/vault.ts +173 -11
package/src/vault/vault.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { PersistenceProvider } from '../persistence/types.js';
|
|
|
2
2
|
import { SQLitePersistenceProvider } from '../persistence/sqlite-provider.js';
|
|
3
3
|
import type { IntelligenceEntry } from '../intelligence/types.js';
|
|
4
4
|
import { computeContentHash } from './content-hash.js';
|
|
5
|
+
import type { LinkManager } from './linking.js';
|
|
5
6
|
|
|
6
7
|
export interface SearchResult {
|
|
7
8
|
entry: IntelligenceEntry;
|
|
@@ -29,6 +30,16 @@ export interface Memory {
|
|
|
29
30
|
topics: string[];
|
|
30
31
|
filesModified: string[];
|
|
31
32
|
toolsUsed: string[];
|
|
33
|
+
/** What the user was trying to accomplish. */
|
|
34
|
+
intent: string | null;
|
|
35
|
+
/** Key decisions made and their rationale. */
|
|
36
|
+
decisions: string[];
|
|
37
|
+
/** Where things stand at capture time. */
|
|
38
|
+
currentState: string | null;
|
|
39
|
+
/** What should happen next session. */
|
|
40
|
+
nextSteps: string[];
|
|
41
|
+
/** Vault entries that informed this session. */
|
|
42
|
+
vaultEntriesReferenced: string[];
|
|
32
43
|
createdAt: number;
|
|
33
44
|
archivedAt: number | null;
|
|
34
45
|
}
|
|
@@ -42,6 +53,10 @@ export class Vault {
|
|
|
42
53
|
private provider: PersistenceProvider;
|
|
43
54
|
private sqliteProvider: SQLitePersistenceProvider | null;
|
|
44
55
|
private syncManager: import('../cognee/sync-manager.js').CogneeSyncManager | null = null;
|
|
56
|
+
private linkManager: LinkManager | null = null;
|
|
57
|
+
private autoLinkEnabled = true;
|
|
58
|
+
/** Minimum number of FTS5 suggestions to auto-link. Top N are linked. */
|
|
59
|
+
private autoLinkMaxLinks = 3;
|
|
45
60
|
|
|
46
61
|
/**
|
|
47
62
|
* Create a Vault with a PersistenceProvider or a SQLite path (backward compat).
|
|
@@ -67,6 +82,28 @@ export class Vault {
|
|
|
67
82
|
this.syncManager = mgr;
|
|
68
83
|
}
|
|
69
84
|
|
|
85
|
+
setLinkManager(mgr: LinkManager, opts?: { enabled?: boolean; maxLinks?: number }): void {
|
|
86
|
+
this.linkManager = mgr;
|
|
87
|
+
if (opts?.enabled !== undefined) this.autoLinkEnabled = opts.enabled;
|
|
88
|
+
if (opts?.maxLinks !== undefined) this.autoLinkMaxLinks = opts.maxLinks;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Auto-link a newly added entry using FTS5 suggestions.
|
|
93
|
+
* Called after seed() for each entry. Creates links for top N suggestions.
|
|
94
|
+
*/
|
|
95
|
+
private autoLink(entryId: string): void {
|
|
96
|
+
if (!this.linkManager || !this.autoLinkEnabled) return;
|
|
97
|
+
try {
|
|
98
|
+
const suggestions = this.linkManager.suggestLinks(entryId, this.autoLinkMaxLinks);
|
|
99
|
+
for (const s of suggestions) {
|
|
100
|
+
this.linkManager.addLink(entryId, s.entryId, s.suggestedType, `auto: ${s.reason}`);
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
// Auto-linking is best-effort — never block ingestion
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
70
107
|
/** Backward-compatible factory. */
|
|
71
108
|
static createWithSQLite(dbPath: string = ':memory:'): Vault {
|
|
72
109
|
return new Vault(dbPath);
|
|
@@ -140,7 +177,23 @@ export class Vault {
|
|
|
140
177
|
CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
|
|
141
178
|
id, context, summary, topics,
|
|
142
179
|
content='memories', content_rowid='rowid', tokenize='porter unicode61'
|
|
143
|
-
);
|
|
180
|
+
);`);
|
|
181
|
+
|
|
182
|
+
// Add new columns if they don't exist (backward-compatible migration)
|
|
183
|
+
const memCols = this.provider
|
|
184
|
+
.all<{ name: string }>(`PRAGMA table_info(memories)`)
|
|
185
|
+
.map((r) => r.name);
|
|
186
|
+
if (!memCols.includes('intent')) {
|
|
187
|
+
this.provider.execSql(`
|
|
188
|
+
ALTER TABLE memories ADD COLUMN intent TEXT;
|
|
189
|
+
ALTER TABLE memories ADD COLUMN decisions TEXT NOT NULL DEFAULT '[]';
|
|
190
|
+
ALTER TABLE memories ADD COLUMN current_state TEXT;
|
|
191
|
+
ALTER TABLE memories ADD COLUMN next_steps TEXT NOT NULL DEFAULT '[]';
|
|
192
|
+
ALTER TABLE memories ADD COLUMN vault_entries_referenced TEXT NOT NULL DEFAULT '[]';
|
|
193
|
+
`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
this.provider.execSql(`
|
|
144
197
|
CREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN
|
|
145
198
|
INSERT INTO memories_fts(rowid,id,context,summary,topics) VALUES(new.rowid,new.id,new.context,new.summary,new.topics);
|
|
146
199
|
END;
|
|
@@ -178,6 +231,7 @@ export class Vault {
|
|
|
178
231
|
`);
|
|
179
232
|
this.migrateBrainSchema();
|
|
180
233
|
this.migrateTemporalSchema();
|
|
234
|
+
this.migrateOriginColumn();
|
|
181
235
|
this.migrateContentHash();
|
|
182
236
|
this.migrateTierColumn();
|
|
183
237
|
}
|
|
@@ -206,6 +260,17 @@ export class Vault {
|
|
|
206
260
|
}
|
|
207
261
|
}
|
|
208
262
|
|
|
263
|
+
private migrateOriginColumn(): void {
|
|
264
|
+
try {
|
|
265
|
+
this.provider.run(
|
|
266
|
+
"ALTER TABLE entries ADD COLUMN origin TEXT NOT NULL DEFAULT 'user' CHECK(origin IN ('agent', 'pack', 'user'))",
|
|
267
|
+
);
|
|
268
|
+
} catch {
|
|
269
|
+
// Column already exists
|
|
270
|
+
}
|
|
271
|
+
this.provider.execSql('CREATE INDEX IF NOT EXISTS idx_entries_origin ON entries(origin)');
|
|
272
|
+
}
|
|
273
|
+
|
|
209
274
|
private migrateContentHash(): void {
|
|
210
275
|
try {
|
|
211
276
|
this.provider.run('ALTER TABLE entries ADD COLUMN content_hash TEXT');
|
|
@@ -293,12 +358,12 @@ export class Vault {
|
|
|
293
358
|
|
|
294
359
|
seed(entries: IntelligenceEntry[]): number {
|
|
295
360
|
const sql = `
|
|
296
|
-
INSERT INTO entries (id,type,domain,title,severity,description,context,example,counter_example,why,tags,applies_to,valid_from,valid_until,content_hash,tier)
|
|
297
|
-
VALUES (@id,@type,@domain,@title,@severity,@description,@context,@example,@counterExample,@why,@tags,@appliesTo,@validFrom,@validUntil,@contentHash,@tier)
|
|
361
|
+
INSERT INTO entries (id,type,domain,title,severity,description,context,example,counter_example,why,tags,applies_to,valid_from,valid_until,content_hash,tier,origin)
|
|
362
|
+
VALUES (@id,@type,@domain,@title,@severity,@description,@context,@example,@counterExample,@why,@tags,@appliesTo,@validFrom,@validUntil,@contentHash,@tier,@origin)
|
|
298
363
|
ON CONFLICT(id) DO UPDATE SET type=excluded.type,domain=excluded.domain,title=excluded.title,severity=excluded.severity,
|
|
299
364
|
description=excluded.description,context=excluded.context,example=excluded.example,counter_example=excluded.counter_example,
|
|
300
365
|
why=excluded.why,tags=excluded.tags,applies_to=excluded.applies_to,valid_from=excluded.valid_from,valid_until=excluded.valid_until,
|
|
301
|
-
content_hash=excluded.content_hash,tier=excluded.tier,updated_at=unixepoch()
|
|
366
|
+
content_hash=excluded.content_hash,tier=excluded.tier,origin=excluded.origin,updated_at=unixepoch()
|
|
302
367
|
`;
|
|
303
368
|
return this.provider.transaction(() => {
|
|
304
369
|
let count = 0;
|
|
@@ -320,16 +385,42 @@ export class Vault {
|
|
|
320
385
|
validUntil: entry.validUntil ?? null,
|
|
321
386
|
contentHash: computeContentHash(entry),
|
|
322
387
|
tier: entry.tier ?? 'agent',
|
|
388
|
+
origin: entry.origin ?? 'agent',
|
|
323
389
|
});
|
|
324
390
|
count++;
|
|
325
391
|
if (this.syncManager) {
|
|
326
392
|
this.syncManager.enqueue('ingest', entry.id, entry);
|
|
327
393
|
}
|
|
328
394
|
}
|
|
395
|
+
// Auto-link after all entries are inserted (so they can link to each other).
|
|
396
|
+
// Skip for large batches (>100) — use relink_vault for bulk imports.
|
|
397
|
+
if (entries.length <= 100) {
|
|
398
|
+
for (const entry of entries) {
|
|
399
|
+
this.autoLink(entry.id);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
329
402
|
return count;
|
|
330
403
|
});
|
|
331
404
|
}
|
|
332
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Install a knowledge pack — seeds entries with origin:'pack' and content-hash dedup.
|
|
408
|
+
* Packs are installable domain knowledge (UX laws, design tokens, clean code rules).
|
|
409
|
+
* Unlike seed(), this forces origin:'pack' regardless of what the entry says.
|
|
410
|
+
*/
|
|
411
|
+
installPack(entries: IntelligenceEntry[]): { installed: number; skipped: number } {
|
|
412
|
+
let installed = 0;
|
|
413
|
+
let skipped = 0;
|
|
414
|
+
// Tag all entries with origin:'pack' and seed — seed() handles its own transaction
|
|
415
|
+
const tagged = entries.map((e) => ({ ...e, origin: 'pack' as const }));
|
|
416
|
+
const results = this.seedDedup(tagged);
|
|
417
|
+
for (const r of results) {
|
|
418
|
+
if (r.action === 'inserted') installed++;
|
|
419
|
+
else skipped++;
|
|
420
|
+
}
|
|
421
|
+
return { installed, skipped };
|
|
422
|
+
}
|
|
423
|
+
|
|
333
424
|
/**
|
|
334
425
|
* Seed entries with content-hash dedup. Returns per-entry results.
|
|
335
426
|
* Unlike seed(), skips entries whose content already exists in the vault.
|
|
@@ -360,6 +451,7 @@ export class Vault {
|
|
|
360
451
|
domain?: string;
|
|
361
452
|
type?: string;
|
|
362
453
|
severity?: string;
|
|
454
|
+
origin?: 'agent' | 'pack' | 'user';
|
|
363
455
|
limit?: number;
|
|
364
456
|
includeExpired?: boolean;
|
|
365
457
|
},
|
|
@@ -379,6 +471,10 @@ export class Vault {
|
|
|
379
471
|
filters.push('e.severity = @severity');
|
|
380
472
|
fp.severity = options.severity;
|
|
381
473
|
}
|
|
474
|
+
if (options?.origin) {
|
|
475
|
+
filters.push('e.origin = @origin');
|
|
476
|
+
fp.origin = options.origin;
|
|
477
|
+
}
|
|
382
478
|
if (!options?.includeExpired) {
|
|
383
479
|
const now = Math.floor(Date.now() / 1000);
|
|
384
480
|
filters.push('(e.valid_until IS NULL OR e.valid_until > @now)');
|
|
@@ -386,14 +482,30 @@ export class Vault {
|
|
|
386
482
|
fp.now = now;
|
|
387
483
|
}
|
|
388
484
|
const wc = filters.length > 0 ? `AND ${filters.join(' AND ')}` : '';
|
|
485
|
+
|
|
486
|
+
// Build FTS5 query: use OR between terms for broader matching,
|
|
487
|
+
// with title column boosted 3x for relevance ranking.
|
|
488
|
+
// FTS5 BM25 with default AND degrades with more entries because
|
|
489
|
+
// fewer documents match ALL terms simultaneously.
|
|
490
|
+
const ftsQuery = buildFtsQuery(query);
|
|
491
|
+
|
|
389
492
|
try {
|
|
390
493
|
const rows = this.provider.all<Record<string, unknown>>(
|
|
391
|
-
`SELECT e.*,
|
|
392
|
-
{ query, limit, ...fp },
|
|
494
|
+
`SELECT e.*, bm25(entries_fts, 5.0, 10.0, 3.0, 1.0, 2.0) as score FROM entries_fts fts JOIN entries e ON e.rowid = fts.rowid WHERE entries_fts MATCH @query ${wc} ORDER BY score ASC LIMIT @limit`,
|
|
495
|
+
{ query: ftsQuery, limit, ...fp },
|
|
393
496
|
);
|
|
394
497
|
return rows.map(rowToSearchResult);
|
|
395
498
|
} catch {
|
|
396
|
-
|
|
499
|
+
// Fallback: try original query if FTS5 syntax fails
|
|
500
|
+
try {
|
|
501
|
+
const rows = this.provider.all<Record<string, unknown>>(
|
|
502
|
+
`SELECT e.*, -rank as score FROM entries_fts fts JOIN entries e ON e.rowid = fts.rowid WHERE entries_fts MATCH @query ${wc} ORDER BY score DESC LIMIT @limit`,
|
|
503
|
+
{ query, limit, ...fp },
|
|
504
|
+
);
|
|
505
|
+
return rows.map(rowToSearchResult);
|
|
506
|
+
} catch {
|
|
507
|
+
return [];
|
|
508
|
+
}
|
|
397
509
|
}
|
|
398
510
|
}
|
|
399
511
|
|
|
@@ -408,6 +520,7 @@ export class Vault {
|
|
|
408
520
|
domain?: string;
|
|
409
521
|
type?: string;
|
|
410
522
|
severity?: string;
|
|
523
|
+
origin?: 'agent' | 'pack' | 'user';
|
|
411
524
|
tags?: string[];
|
|
412
525
|
limit?: number;
|
|
413
526
|
offset?: number;
|
|
@@ -427,6 +540,10 @@ export class Vault {
|
|
|
427
540
|
filters.push('severity = @severity');
|
|
428
541
|
params.severity = options.severity;
|
|
429
542
|
}
|
|
543
|
+
if (options?.origin) {
|
|
544
|
+
filters.push('origin = @origin');
|
|
545
|
+
params.origin = options.origin;
|
|
546
|
+
}
|
|
430
547
|
if (options?.tags?.length) {
|
|
431
548
|
const c = options.tags.map((t, i) => {
|
|
432
549
|
params[`tag${i}`] = `%"${t}"%`;
|
|
@@ -619,7 +736,7 @@ export class Vault {
|
|
|
619
736
|
}
|
|
620
737
|
return {
|
|
621
738
|
total: rows.length,
|
|
622
|
-
buckets: bucketDefs.map((b, i) => ({
|
|
739
|
+
buckets: bucketDefs.map((b, i) => Object.assign({}, b, { count: counts[i] })),
|
|
623
740
|
oldestTimestamp: oldest,
|
|
624
741
|
newestTimestamp: newest,
|
|
625
742
|
};
|
|
@@ -670,7 +787,8 @@ export class Vault {
|
|
|
670
787
|
captureMemory(memory: Omit<Memory, 'id' | 'createdAt' | 'archivedAt'>): Memory {
|
|
671
788
|
const id = `mem-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
672
789
|
this.provider.run(
|
|
673
|
-
`INSERT INTO memories (id, project_path, type, context, summary, topics, files_modified, tools_used
|
|
790
|
+
`INSERT INTO memories (id, project_path, type, context, summary, topics, files_modified, tools_used, intent, decisions, current_state, next_steps, vault_entries_referenced)
|
|
791
|
+
VALUES (@id, @projectPath, @type, @context, @summary, @topics, @filesModified, @toolsUsed, @intent, @decisions, @currentState, @nextSteps, @vaultEntriesReferenced)`,
|
|
674
792
|
{
|
|
675
793
|
id,
|
|
676
794
|
projectPath: memory.projectPath,
|
|
@@ -680,6 +798,11 @@ export class Vault {
|
|
|
680
798
|
topics: JSON.stringify(memory.topics),
|
|
681
799
|
filesModified: JSON.stringify(memory.filesModified),
|
|
682
800
|
toolsUsed: JSON.stringify(memory.toolsUsed),
|
|
801
|
+
intent: memory.intent ?? null,
|
|
802
|
+
decisions: JSON.stringify(memory.decisions ?? []),
|
|
803
|
+
currentState: memory.currentState ?? null,
|
|
804
|
+
nextSteps: JSON.stringify(memory.nextSteps ?? []),
|
|
805
|
+
vaultEntriesReferenced: JSON.stringify(memory.vaultEntriesReferenced ?? []),
|
|
683
806
|
},
|
|
684
807
|
);
|
|
685
808
|
return this.getMemory(id)!;
|
|
@@ -687,7 +810,7 @@ export class Vault {
|
|
|
687
810
|
|
|
688
811
|
searchMemories(
|
|
689
812
|
query: string,
|
|
690
|
-
options?: { type?: string; projectPath?: string; limit?: number },
|
|
813
|
+
options?: { type?: string; projectPath?: string; intent?: string; limit?: number },
|
|
691
814
|
): Memory[] {
|
|
692
815
|
const limit = options?.limit ?? 10;
|
|
693
816
|
const filters: string[] = ['m.archived_at IS NULL'];
|
|
@@ -700,6 +823,10 @@ export class Vault {
|
|
|
700
823
|
filters.push('m.project_path = @projectPath');
|
|
701
824
|
fp.projectPath = options.projectPath;
|
|
702
825
|
}
|
|
826
|
+
if (options?.intent) {
|
|
827
|
+
filters.push('m.intent = @intent');
|
|
828
|
+
fp.intent = options.intent;
|
|
829
|
+
}
|
|
703
830
|
const wc = filters.length > 0 ? `AND ${filters.join(' AND ')}` : '';
|
|
704
831
|
try {
|
|
705
832
|
const rows = this.provider.all<Record<string, unknown>>(
|
|
@@ -1133,13 +1260,43 @@ function rowToEntry(row: Record<string, unknown>): IntelligenceEntry {
|
|
|
1133
1260
|
tags: JSON.parse((row.tags as string) || '[]'),
|
|
1134
1261
|
appliesTo: JSON.parse((row.applies_to as string) || '[]'),
|
|
1135
1262
|
tier: (row.tier as IntelligenceEntry['tier']) ?? undefined,
|
|
1263
|
+
origin: (row.origin as IntelligenceEntry['origin']) ?? undefined,
|
|
1136
1264
|
validFrom: (row.valid_from as number) ?? undefined,
|
|
1137
1265
|
validUntil: (row.valid_until as number) ?? undefined,
|
|
1138
1266
|
};
|
|
1139
1267
|
}
|
|
1140
1268
|
|
|
1141
1269
|
function rowToSearchResult(row: Record<string, unknown>): SearchResult {
|
|
1142
|
-
|
|
1270
|
+
// bm25() returns negative scores (lower = better), normalize to positive
|
|
1271
|
+
const rawScore = row.score as number;
|
|
1272
|
+
const score = rawScore < 0 ? -rawScore : rawScore;
|
|
1273
|
+
return { entry: rowToEntry(row), score };
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* Build an FTS5 query from natural language input.
|
|
1278
|
+
*
|
|
1279
|
+
* Converts "React render performance memo" to:
|
|
1280
|
+
* {title}: (react OR render OR performance OR memo) OR (react OR render OR performance OR memo)
|
|
1281
|
+
*
|
|
1282
|
+
* Uses OR matching (not AND) so results include partial matches.
|
|
1283
|
+
* FTS5 BM25 ranks documents with more matching terms higher.
|
|
1284
|
+
* Title column is boosted via bm25() weights in the SQL query.
|
|
1285
|
+
*/
|
|
1286
|
+
function buildFtsQuery(query: string): string {
|
|
1287
|
+
const terms = query
|
|
1288
|
+
.toLowerCase()
|
|
1289
|
+
.split(/\s+/)
|
|
1290
|
+
.filter((t) => t.length >= 2)
|
|
1291
|
+
.map((t) => t.replace(/[^a-z0-9]/g, ''))
|
|
1292
|
+
.filter(Boolean);
|
|
1293
|
+
|
|
1294
|
+
if (terms.length === 0) return query;
|
|
1295
|
+
if (terms.length === 1) return terms[0];
|
|
1296
|
+
|
|
1297
|
+
// Use OR to match any term — BM25 ranks by how many terms match
|
|
1298
|
+
const orTerms = terms.join(' OR ');
|
|
1299
|
+
return orTerms;
|
|
1143
1300
|
}
|
|
1144
1301
|
|
|
1145
1302
|
function rowToMemory(row: Record<string, unknown>): Memory {
|
|
@@ -1152,6 +1309,11 @@ function rowToMemory(row: Record<string, unknown>): Memory {
|
|
|
1152
1309
|
topics: JSON.parse((row.topics as string) || '[]'),
|
|
1153
1310
|
filesModified: JSON.parse((row.files_modified as string) || '[]'),
|
|
1154
1311
|
toolsUsed: JSON.parse((row.tools_used as string) || '[]'),
|
|
1312
|
+
intent: (row.intent as string) ?? null,
|
|
1313
|
+
decisions: JSON.parse((row.decisions as string) || '[]'),
|
|
1314
|
+
currentState: (row.current_state as string) ?? null,
|
|
1315
|
+
nextSteps: JSON.parse((row.next_steps as string) || '[]'),
|
|
1316
|
+
vaultEntriesReferenced: JSON.parse((row.vault_entries_referenced as string) || '[]'),
|
|
1155
1317
|
createdAt: row.created_at as number,
|
|
1156
1318
|
archivedAt: (row.archived_at as number) ?? null,
|
|
1157
1319
|
};
|