@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
|
@@ -136,6 +136,7 @@ export function createCaptureOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
136
136
|
counterExample: entry.counterExample,
|
|
137
137
|
why: entry.why,
|
|
138
138
|
tier: finalTier,
|
|
139
|
+
origin: 'user',
|
|
139
140
|
});
|
|
140
141
|
const scopeMeta = scopeResult
|
|
141
142
|
? {
|
|
@@ -227,7 +228,44 @@ export function createCaptureOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
|
|
230
|
-
|
|
231
|
+
// Auto-suggest links for captured entries (Zettelkasten enrichment)
|
|
232
|
+
let suggestedLinks: Array<{
|
|
233
|
+
entryId: string;
|
|
234
|
+
title: string;
|
|
235
|
+
suggestedType: string;
|
|
236
|
+
score: number;
|
|
237
|
+
}> = [];
|
|
238
|
+
try {
|
|
239
|
+
if (captured > 0) {
|
|
240
|
+
const firstCaptured = results.find((r) => r.action === 'capture');
|
|
241
|
+
if (firstCaptured) {
|
|
242
|
+
const { LinkManager } = await import('../vault/linking.js');
|
|
243
|
+
const lm = new LinkManager(vault.getProvider());
|
|
244
|
+
const suggestions = lm.suggestLinks(firstCaptured.id, 3);
|
|
245
|
+
suggestedLinks = suggestions
|
|
246
|
+
.filter(
|
|
247
|
+
(s) => s.entryId !== firstCaptured.id && !s.entryId.endsWith(firstCaptured.id),
|
|
248
|
+
)
|
|
249
|
+
.map((s) => ({
|
|
250
|
+
entryId: s.entryId,
|
|
251
|
+
title: s.title,
|
|
252
|
+
suggestedType: s.suggestedType,
|
|
253
|
+
score: s.score,
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
} catch {
|
|
258
|
+
/* never break capture for suggestions */
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
captured,
|
|
263
|
+
proposed,
|
|
264
|
+
rejected,
|
|
265
|
+
duplicated,
|
|
266
|
+
results,
|
|
267
|
+
...(suggestedLinks.length > 0 ? { suggestedLinks } : {}),
|
|
268
|
+
};
|
|
231
269
|
},
|
|
232
270
|
},
|
|
233
271
|
|
|
@@ -307,6 +345,7 @@ export function createCaptureOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
307
345
|
description,
|
|
308
346
|
tags,
|
|
309
347
|
tier: finalTier,
|
|
348
|
+
origin: 'user',
|
|
310
349
|
});
|
|
311
350
|
if (captureResult.blocked) {
|
|
312
351
|
return {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain operations — 5 ops for composable multi-step workflows.
|
|
3
|
+
*
|
|
4
|
+
* Ops: chain_execute, chain_status, chain_resume, chain_list, chain_step_approve
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
9
|
+
import type { AgentRuntime } from './types.js';
|
|
10
|
+
import { chainDefSchema } from '../flows/chain-types.js';
|
|
11
|
+
|
|
12
|
+
export function createChainOps(runtime: AgentRuntime): OpDefinition[] {
|
|
13
|
+
const { chainRunner } = runtime;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Dispatch function that routes op calls to the appropriate facade handler.
|
|
17
|
+
* Looks up the op across all registered facades.
|
|
18
|
+
*/
|
|
19
|
+
const createDispatch = (allOps: OpDefinition[]) => {
|
|
20
|
+
return async (op: string, params: Record<string, unknown>): Promise<unknown> => {
|
|
21
|
+
const opDef = allOps.find((o) => o.name === op);
|
|
22
|
+
if (!opDef) throw new Error(`Unknown op: ${op}`);
|
|
23
|
+
return opDef.handler(params);
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// We need access to all ops for dispatch. The plan facade passes them in.
|
|
28
|
+
// For now, store a reference that gets set after facade registration.
|
|
29
|
+
let allOps: OpDefinition[] = [];
|
|
30
|
+
|
|
31
|
+
const ops: OpDefinition[] = [
|
|
32
|
+
{
|
|
33
|
+
name: 'chain_execute',
|
|
34
|
+
description:
|
|
35
|
+
"Execute a multi-step chain workflow. Steps run sequentially, each step's output feeds the next via $variable references. " +
|
|
36
|
+
'Gates (user-approval, auto-test, vault-check) can pause execution.',
|
|
37
|
+
auth: 'write',
|
|
38
|
+
schema: z.object({
|
|
39
|
+
chain: chainDefSchema.describe('Chain definition with steps'),
|
|
40
|
+
input: z
|
|
41
|
+
.record(z.unknown())
|
|
42
|
+
.optional()
|
|
43
|
+
.default({})
|
|
44
|
+
.describe('Initial input params (accessible as $input.*)'),
|
|
45
|
+
startFromStep: z.string().optional().describe('Skip to a specific step ID'),
|
|
46
|
+
}),
|
|
47
|
+
handler: async (params) => {
|
|
48
|
+
const chainDef = params.chain as z.infer<typeof chainDefSchema>;
|
|
49
|
+
const input = (params.input as Record<string, unknown>) ?? {};
|
|
50
|
+
const dispatch = createDispatch(allOps);
|
|
51
|
+
return chainRunner.execute(
|
|
52
|
+
chainDef,
|
|
53
|
+
input,
|
|
54
|
+
dispatch,
|
|
55
|
+
undefined,
|
|
56
|
+
params.startFromStep as string | undefined,
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'chain_status',
|
|
62
|
+
description:
|
|
63
|
+
'Get the current status of a chain instance — steps completed, paused gates, outputs.',
|
|
64
|
+
auth: 'read',
|
|
65
|
+
schema: z.object({
|
|
66
|
+
instanceId: z.string().describe('Chain instance ID'),
|
|
67
|
+
}),
|
|
68
|
+
handler: async (params) => {
|
|
69
|
+
const instance = chainRunner.getInstance(params.instanceId as string);
|
|
70
|
+
if (!instance) return { error: `Chain instance not found: ${params.instanceId}` };
|
|
71
|
+
return instance;
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'chain_resume',
|
|
76
|
+
description: 'Resume a paused chain from where it stopped (after a gate approval).',
|
|
77
|
+
auth: 'write',
|
|
78
|
+
schema: z.object({
|
|
79
|
+
instanceId: z.string().describe('Chain instance ID to resume'),
|
|
80
|
+
chain: chainDefSchema.describe('Chain definition (needed to know remaining steps)'),
|
|
81
|
+
}),
|
|
82
|
+
handler: async (params) => {
|
|
83
|
+
const chainDef = params.chain as z.infer<typeof chainDefSchema>;
|
|
84
|
+
const dispatch = createDispatch(allOps);
|
|
85
|
+
return chainRunner.resume(params.instanceId as string, chainDef, dispatch);
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'chain_list',
|
|
90
|
+
description: 'List all chain instances — running, paused, completed, failed.',
|
|
91
|
+
auth: 'read',
|
|
92
|
+
schema: z.object({
|
|
93
|
+
limit: z.number().optional().default(20),
|
|
94
|
+
}),
|
|
95
|
+
handler: async (params) => {
|
|
96
|
+
return chainRunner.list(params.limit as number);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'chain_step_approve',
|
|
101
|
+
description: 'Approve a gate-paused step and resume chain execution from the next step.',
|
|
102
|
+
auth: 'write',
|
|
103
|
+
schema: z.object({
|
|
104
|
+
instanceId: z.string().describe('Chain instance ID'),
|
|
105
|
+
chain: chainDefSchema.describe('Chain definition (needed to continue execution)'),
|
|
106
|
+
}),
|
|
107
|
+
handler: async (params) => {
|
|
108
|
+
const chainDef = params.chain as z.infer<typeof chainDefSchema>;
|
|
109
|
+
const dispatch = createDispatch(allOps);
|
|
110
|
+
return chainRunner.approve(params.instanceId as string, chainDef, dispatch);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
|
|
115
|
+
// Expose a setter for wiring all ops after facade registration
|
|
116
|
+
(ops as OpDefinition[] & { _setAllOps: (o: OpDefinition[]) => void })._setAllOps = (o) => {
|
|
117
|
+
allOps = o;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return ops;
|
|
121
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLAUDE.md injection helpers — marker-based, idempotent section management.
|
|
3
|
+
*
|
|
4
|
+
* Supports injecting agent sections into existing CLAUDE.md files
|
|
5
|
+
* (project-level or global ~/.claude/CLAUDE.md) using HTML comment markers.
|
|
6
|
+
*
|
|
7
|
+
* Marker format: <!-- agent:{agentId}:mode --> ... <!-- /agent:{agentId}:mode -->
|
|
8
|
+
* This allows multiple Soleri agents to coexist in the same CLAUDE.md.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { AgentRuntimeConfig } from './types.js';
|
|
12
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
13
|
+
|
|
14
|
+
// ─── Types ────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export interface AgentSection {
|
|
17
|
+
agentId: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type InjectionPosition = 'start' | 'end' | 'after-title';
|
|
22
|
+
|
|
23
|
+
interface FacadeSummary {
|
|
24
|
+
name: string;
|
|
25
|
+
ops: string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ─── Marker Helpers ───────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
function startMarker(agentId: string): string {
|
|
31
|
+
return `<!-- agent:${agentId}:mode -->`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function endMarker(agentId: string): string {
|
|
35
|
+
return `<!-- /agent:${agentId}:mode -->`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Check if content already has sections for this agent.
|
|
40
|
+
*/
|
|
41
|
+
export function hasSections(content: string, agentId: string): boolean {
|
|
42
|
+
return content.includes(startMarker(agentId)) && content.includes(endMarker(agentId));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Remove existing agent sections from content.
|
|
47
|
+
*/
|
|
48
|
+
export function removeSections(content: string, agentId: string): string {
|
|
49
|
+
const start = startMarker(agentId);
|
|
50
|
+
const end = endMarker(agentId);
|
|
51
|
+
|
|
52
|
+
const startIdx = content.indexOf(start);
|
|
53
|
+
const endIdx = content.indexOf(end);
|
|
54
|
+
|
|
55
|
+
if (startIdx === -1 || endIdx === -1) return content;
|
|
56
|
+
|
|
57
|
+
const before = content.slice(0, startIdx).trimEnd();
|
|
58
|
+
const after = content.slice(endIdx + end.length).trimStart();
|
|
59
|
+
|
|
60
|
+
return before + (after ? '\n\n' + after : '\n');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Inject a section into content at the specified position.
|
|
65
|
+
*/
|
|
66
|
+
export function injectAtPosition(
|
|
67
|
+
content: string,
|
|
68
|
+
section: string,
|
|
69
|
+
position: InjectionPosition,
|
|
70
|
+
): string {
|
|
71
|
+
switch (position) {
|
|
72
|
+
case 'start':
|
|
73
|
+
return section + '\n\n' + content;
|
|
74
|
+
|
|
75
|
+
case 'end':
|
|
76
|
+
return content.trimEnd() + '\n\n' + section + '\n';
|
|
77
|
+
|
|
78
|
+
case 'after-title': {
|
|
79
|
+
const lines = content.split('\n');
|
|
80
|
+
// Find first # heading
|
|
81
|
+
const titleIdx = lines.findIndex((line) => /^#\s/.test(line));
|
|
82
|
+
if (titleIdx === -1) {
|
|
83
|
+
// No title found — prepend
|
|
84
|
+
return section + '\n\n' + content;
|
|
85
|
+
}
|
|
86
|
+
// Insert after title line (and any blank line following it)
|
|
87
|
+
let insertIdx = titleIdx + 1;
|
|
88
|
+
while (insertIdx < lines.length && lines[insertIdx].trim() === '') {
|
|
89
|
+
insertIdx++;
|
|
90
|
+
}
|
|
91
|
+
lines.splice(insertIdx, 0, '', section, '');
|
|
92
|
+
return lines.join('\n');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Wrap content in agent markers.
|
|
99
|
+
*/
|
|
100
|
+
export function wrapInMarkers(agentId: string, content: string): string {
|
|
101
|
+
return `${startMarker(agentId)}\n${content}\n${endMarker(agentId)}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ─── Content Composition ──────────────────────────────────────────────
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Compose agent mode section from runtime config.
|
|
108
|
+
*/
|
|
109
|
+
export function composeAgentModeSection(config: AgentRuntimeConfig): string {
|
|
110
|
+
const { agentId } = config;
|
|
111
|
+
const name = agentId.charAt(0).toUpperCase() + agentId.slice(1);
|
|
112
|
+
|
|
113
|
+
return [
|
|
114
|
+
`## ${name} Mode`,
|
|
115
|
+
'',
|
|
116
|
+
`**Activate:** "Hello, ${name}!" → \`${agentId}_core op:activate params:{ projectPath: "." }\``,
|
|
117
|
+
`**Deactivate:** "Goodbye, ${name}!" → \`${agentId}_core op:activate params:{ deactivate: true }\``,
|
|
118
|
+
'',
|
|
119
|
+
`On activation, adopt the returned persona. Stay in character until deactivated.`,
|
|
120
|
+
].join('\n');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Compose integration section with tools table and session protocol.
|
|
125
|
+
*/
|
|
126
|
+
export function composeIntegrationSection(
|
|
127
|
+
config: AgentRuntimeConfig,
|
|
128
|
+
facades?: FacadeSummary[],
|
|
129
|
+
): string {
|
|
130
|
+
const { agentId } = config;
|
|
131
|
+
const name = agentId.charAt(0).toUpperCase() + agentId.slice(1);
|
|
132
|
+
|
|
133
|
+
const lines: string[] = [
|
|
134
|
+
`## ${name} Integration`,
|
|
135
|
+
'',
|
|
136
|
+
`On session start: \`${agentId}_core op:register params:{ projectPath: "." }\``,
|
|
137
|
+
'',
|
|
138
|
+
'### Essential Tools',
|
|
139
|
+
'',
|
|
140
|
+
'| Facade | Key Ops |',
|
|
141
|
+
'|--------|---------|',
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
if (facades && facades.length > 0) {
|
|
145
|
+
for (const f of facades) {
|
|
146
|
+
const opsStr = f.ops
|
|
147
|
+
.slice(0, 5)
|
|
148
|
+
.map((o) => `\`${o}\``)
|
|
149
|
+
.join(', ');
|
|
150
|
+
const suffix = f.ops.length > 5 ? ', ...' : '';
|
|
151
|
+
lines.push(`| \`${f.name}\` | ${opsStr}${suffix} |`);
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
// Default facade table
|
|
155
|
+
lines.push(
|
|
156
|
+
`| \`${agentId}_vault\` | \`search_intelligent\`, \`capture_knowledge\`, \`capture_quick\` |`,
|
|
157
|
+
);
|
|
158
|
+
lines.push(
|
|
159
|
+
`| \`${agentId}_plan\` | \`create_plan\`, \`approve_plan\`, \`plan_split\`, \`plan_reconcile\` |`,
|
|
160
|
+
);
|
|
161
|
+
lines.push(`| \`${agentId}_brain\` | \`recommend\`, \`strengths\`, \`feedback\` |`);
|
|
162
|
+
lines.push(`| \`${agentId}_memory\` | \`memory_search\`, \`session_capture\` |`);
|
|
163
|
+
lines.push(
|
|
164
|
+
`| \`${agentId}_admin\` | \`admin_health\`, \`admin_tool_list\`, \`admin_setup_global\` |`,
|
|
165
|
+
);
|
|
166
|
+
lines.push(`| \`${agentId}_curator\` | \`curator_groom\`, \`curator_status\` |`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
lines.push('');
|
|
170
|
+
lines.push(`> Full list: \`${agentId}_admin op:admin_tool_list\``);
|
|
171
|
+
|
|
172
|
+
return lines.join('\n');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Build full injection content (mode + integration, wrapped in markers).
|
|
177
|
+
*/
|
|
178
|
+
export function buildInjectionContent(
|
|
179
|
+
config: AgentRuntimeConfig,
|
|
180
|
+
options: { includeIntegration?: boolean; facades?: FacadeSummary[] } = {},
|
|
181
|
+
): string {
|
|
182
|
+
const { includeIntegration = true, facades } = options;
|
|
183
|
+
|
|
184
|
+
const sections = [composeAgentModeSection(config)];
|
|
185
|
+
|
|
186
|
+
if (includeIntegration) {
|
|
187
|
+
sections.push(composeIntegrationSection(config, facades));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return wrapInMarkers(config.agentId, sections.join('\n\n'));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ─── Engine Rules ────────────────────────────────────────────────────
|
|
194
|
+
|
|
195
|
+
const ENGINE_RULES_START = '<!-- soleri:engine-rules -->';
|
|
196
|
+
const ENGINE_RULES_END = '<!-- /soleri:engine-rules -->';
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Check if engine rules are present in content.
|
|
200
|
+
*/
|
|
201
|
+
export function hasEngineRules(content: string): boolean {
|
|
202
|
+
return content.includes(ENGINE_RULES_START) && content.includes(ENGINE_RULES_END);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Inject or update engine rules in content.
|
|
207
|
+
*/
|
|
208
|
+
export function injectEngineRulesBlock(content: string, engineRulesContent: string): string {
|
|
209
|
+
if (hasEngineRules(content)) {
|
|
210
|
+
// Replace existing
|
|
211
|
+
const startIdx = content.indexOf(ENGINE_RULES_START);
|
|
212
|
+
const endIdx = content.indexOf(ENGINE_RULES_END);
|
|
213
|
+
const before = content.slice(0, startIdx);
|
|
214
|
+
const after = content.slice(endIdx + ENGINE_RULES_END.length);
|
|
215
|
+
return before + engineRulesContent + after;
|
|
216
|
+
}
|
|
217
|
+
// Append
|
|
218
|
+
return content.trimEnd() + '\n\n' + engineRulesContent + '\n';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Extract facade summaries from an ops array (for tools table generation).
|
|
223
|
+
*/
|
|
224
|
+
export function extractFacadeSummaries(
|
|
225
|
+
agentId: string,
|
|
226
|
+
opsMap: Map<string, OpDefinition[]>,
|
|
227
|
+
): FacadeSummary[] {
|
|
228
|
+
const summaries: FacadeSummary[] = [];
|
|
229
|
+
for (const [suffix, ops] of opsMap) {
|
|
230
|
+
summaries.push({
|
|
231
|
+
name: `${agentId}_${suffix}`,
|
|
232
|
+
ops: ops.map((o) => o.name),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return summaries;
|
|
236
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Extra curator operations —
|
|
2
|
+
* Extra curator operations — 8 ops that extend the 8 base curator ops in core-ops.ts.
|
|
3
3
|
*
|
|
4
|
-
* Groups: entry history (2), queue stats (1), metadata enrichment (1), hybrid detection (1)
|
|
4
|
+
* Groups: entry history (2), queue stats (1), metadata enrichment (1), hybrid detection (1),
|
|
5
|
+
* pipeline status (1), schedule start (1), schedule stop (1).
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import { z } from 'zod';
|
|
@@ -9,7 +10,8 @@ import type { OpDefinition } from '../facades/types.js';
|
|
|
9
10
|
import type { AgentRuntime } from './types.js';
|
|
10
11
|
|
|
11
12
|
export function createCuratorExtraOps(runtime: AgentRuntime): OpDefinition[] {
|
|
12
|
-
const { curator } = runtime;
|
|
13
|
+
const { curator, jobQueue, pipelineRunner } = runtime;
|
|
14
|
+
let consolidationInterval: ReturnType<typeof setInterval> | null = null;
|
|
13
15
|
|
|
14
16
|
return [
|
|
15
17
|
// ─── Entry History ──────────────────────────────────────────────
|
|
@@ -81,5 +83,86 @@ export function createCuratorExtraOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
81
83
|
return curator.detectContradictionsHybrid(params.threshold as number | undefined);
|
|
82
84
|
},
|
|
83
85
|
},
|
|
86
|
+
|
|
87
|
+
// ─── Pipeline & Scheduling (#210) ────────────────────────────────
|
|
88
|
+
{
|
|
89
|
+
name: 'curator_pipeline_status',
|
|
90
|
+
description:
|
|
91
|
+
'Get job queue and pipeline runner status — pending/running/completed/failed counts, runner state, tick count.',
|
|
92
|
+
auth: 'read',
|
|
93
|
+
handler: async () => {
|
|
94
|
+
return {
|
|
95
|
+
queue: jobQueue.getStats(),
|
|
96
|
+
runner: pipelineRunner.getStatus(),
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'curator_enqueue_pipeline',
|
|
102
|
+
description:
|
|
103
|
+
'Enqueue a processing pipeline for a vault entry — tag-normalize → dedup-check → auto-link. ' +
|
|
104
|
+
'Jobs execute in DAG order via the background pipeline runner.',
|
|
105
|
+
auth: 'write',
|
|
106
|
+
schema: z.object({
|
|
107
|
+
entryId: z.string().describe('Vault entry ID to process'),
|
|
108
|
+
}),
|
|
109
|
+
handler: async (params) => {
|
|
110
|
+
const entryId = params.entryId as string;
|
|
111
|
+
const pipelineId = `pipe-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
112
|
+
const step1 = jobQueue.enqueue('tag-normalize', { entryId, pipelineId });
|
|
113
|
+
const step2 = jobQueue.enqueue('dedup-check', { entryId, pipelineId, dependsOn: [step1] });
|
|
114
|
+
const step3 = jobQueue.enqueue('auto-link', { entryId, pipelineId, dependsOn: [step2] });
|
|
115
|
+
return { pipelineId, jobs: [step1, step2, step3] };
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'curator_schedule_start',
|
|
120
|
+
description:
|
|
121
|
+
'Start periodic consolidation — runs curator.consolidate() at the specified interval. ' +
|
|
122
|
+
'Also starts the pipeline runner for background job processing.',
|
|
123
|
+
auth: 'write',
|
|
124
|
+
schema: z.object({
|
|
125
|
+
intervalMinutes: z
|
|
126
|
+
.number()
|
|
127
|
+
.optional()
|
|
128
|
+
.default(60)
|
|
129
|
+
.describe('Consolidation interval in minutes (default: 60)'),
|
|
130
|
+
}),
|
|
131
|
+
handler: async (params) => {
|
|
132
|
+
const intervalMs = (params.intervalMinutes as number) * 60 * 1000;
|
|
133
|
+
|
|
134
|
+
// Start pipeline runner
|
|
135
|
+
pipelineRunner.start();
|
|
136
|
+
|
|
137
|
+
// Start consolidation scheduler
|
|
138
|
+
if (consolidationInterval) clearInterval(consolidationInterval);
|
|
139
|
+
consolidationInterval = setInterval(() => {
|
|
140
|
+
try {
|
|
141
|
+
curator.consolidate();
|
|
142
|
+
} catch {
|
|
143
|
+
/* best-effort */
|
|
144
|
+
}
|
|
145
|
+
}, intervalMs);
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
started: true,
|
|
149
|
+
pipelineRunner: pipelineRunner.getStatus(),
|
|
150
|
+
consolidationIntervalMs: intervalMs,
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'curator_schedule_stop',
|
|
156
|
+
description: 'Stop periodic consolidation and pipeline runner.',
|
|
157
|
+
auth: 'write',
|
|
158
|
+
handler: async () => {
|
|
159
|
+
pipelineRunner.stop();
|
|
160
|
+
if (consolidationInterval) {
|
|
161
|
+
clearInterval(consolidationInterval);
|
|
162
|
+
consolidationInterval = null;
|
|
163
|
+
}
|
|
164
|
+
return { stopped: true };
|
|
165
|
+
},
|
|
166
|
+
},
|
|
84
167
|
];
|
|
85
168
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Domain facade factory — creates
|
|
2
|
+
* Domain facade factory — creates domain facades with optional pack support.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Without packs: every domain gets the standard 5 ops (get_patterns, search,
|
|
5
|
+
* get_entry, capture, remove).
|
|
6
|
+
*
|
|
7
|
+
* With packs: pack ops are PRIMARY, standard 5 ops are FALLBACK for any op
|
|
8
|
+
* name not defined by the pack. Pack standalone facades are registered as
|
|
9
|
+
* additional MCP tools.
|
|
6
10
|
*/
|
|
7
11
|
|
|
8
12
|
import { z } from 'zod';
|
|
9
13
|
import type { FacadeConfig, OpDefinition } from '../facades/types.js';
|
|
10
14
|
import type { AgentRuntime } from './types.js';
|
|
15
|
+
import type { DomainPack } from '../domain-packs/types.js';
|
|
11
16
|
|
|
12
17
|
function capitalize(s: string): string {
|
|
13
18
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
@@ -200,16 +205,77 @@ export function createDomainFacade(
|
|
|
200
205
|
}
|
|
201
206
|
|
|
202
207
|
/**
|
|
203
|
-
* Create domain facades for all domains.
|
|
208
|
+
* Create domain facades for all domains, with optional pack support.
|
|
209
|
+
*
|
|
210
|
+
* When packs are provided:
|
|
211
|
+
* - For each domain, check if any pack claims it via pack.domains[]
|
|
212
|
+
* - If a pack claims the domain: pack ops are PRIMARY, standard 5 ops are
|
|
213
|
+
* FALLBACK (only for op names not defined by the pack)
|
|
214
|
+
* - Pack standalone facades (pack.facades[]) are registered as additional
|
|
215
|
+
* MCP tools with agentId prefix
|
|
216
|
+
* - Domains not claimed by any pack get the standard 5 ops (OCP)
|
|
217
|
+
*
|
|
218
|
+
* When packs is undefined or empty: identical to previous behavior.
|
|
204
219
|
*
|
|
205
220
|
* @param runtime - The agent runtime
|
|
206
221
|
* @param agentId - Agent identifier
|
|
207
222
|
* @param domains - Array of domain names
|
|
223
|
+
* @param packs - Optional array of loaded domain packs
|
|
208
224
|
*/
|
|
209
225
|
export function createDomainFacades(
|
|
210
226
|
runtime: AgentRuntime,
|
|
211
227
|
agentId: string,
|
|
212
228
|
domains: string[],
|
|
229
|
+
packs?: DomainPack[],
|
|
213
230
|
): FacadeConfig[] {
|
|
214
|
-
|
|
231
|
+
// Build a map: domain name → pack that claims it
|
|
232
|
+
const packByDomain = new Map<string, DomainPack>();
|
|
233
|
+
if (packs) {
|
|
234
|
+
for (const pack of packs) {
|
|
235
|
+
for (const domain of pack.domains) {
|
|
236
|
+
packByDomain.set(domain, pack);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Create domain facades (with pack merge when applicable)
|
|
242
|
+
const domainFacades = domains.map((domain) => {
|
|
243
|
+
const pack = packByDomain.get(domain);
|
|
244
|
+
if (!pack) {
|
|
245
|
+
// No pack claims this domain — standard 5-op facade (OCP)
|
|
246
|
+
return createDomainFacade(runtime, agentId, domain);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Pack claims this domain — merge ops
|
|
250
|
+
const standardFacade = createDomainFacade(runtime, agentId, domain);
|
|
251
|
+
const packOpNames = new Set(pack.ops.map((op) => op.name));
|
|
252
|
+
|
|
253
|
+
// Pack ops are primary; standard ops are fallback for unclaimed names
|
|
254
|
+
const mergedOps: OpDefinition[] = [
|
|
255
|
+
...pack.ops,
|
|
256
|
+
...standardFacade.ops.filter((op) => !packOpNames.has(op.name)),
|
|
257
|
+
];
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
...standardFacade,
|
|
261
|
+
ops: mergedOps,
|
|
262
|
+
};
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Collect standalone facades from packs (prefixed with agentId)
|
|
266
|
+
const standaloneFacades: FacadeConfig[] = [];
|
|
267
|
+
if (packs) {
|
|
268
|
+
for (const pack of packs) {
|
|
269
|
+
if (pack.facades) {
|
|
270
|
+
for (const facade of pack.facades) {
|
|
271
|
+
standaloneFacades.push({
|
|
272
|
+
...facade,
|
|
273
|
+
name: `${agentId}_${facade.name}`,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return [...domainFacades, ...standaloneFacades];
|
|
215
281
|
}
|
|
@@ -8,6 +8,8 @@ import type { OpDefinition } from '../../facades/types.js';
|
|
|
8
8
|
import type { AgentRuntime } from '../types.js';
|
|
9
9
|
import { createAdminOps } from '../admin-ops.js';
|
|
10
10
|
import { createAdminExtraOps } from '../admin-extra-ops.js';
|
|
11
|
+
import { createAdminSetupOps } from '../admin-setup-ops.js';
|
|
12
|
+
import { createSessionBriefingOps } from '../session-briefing.js';
|
|
11
13
|
import { createPluginOps } from '../plugin-ops.js';
|
|
12
14
|
import { createPackOps } from '../pack-ops.js';
|
|
13
15
|
import { createTelemetryOps } from '../telemetry-ops.js';
|
|
@@ -100,6 +102,8 @@ export function createAdminFacadeOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
100
102
|
// ─── Satellite ops ───────────────────────────────────────────
|
|
101
103
|
...createAdminOps(runtime),
|
|
102
104
|
...createAdminExtraOps(runtime),
|
|
105
|
+
...createAdminSetupOps(runtime),
|
|
106
|
+
...createSessionBriefingOps(runtime),
|
|
103
107
|
];
|
|
104
108
|
|
|
105
109
|
// Plugin ops must mutate the same live op array that MCP dispatch reads.
|