@soleri/core 2.10.0 → 2.11.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/dist/agency/agency-manager.d.ts +47 -0
- package/dist/agency/agency-manager.d.ts.map +1 -0
- package/dist/agency/agency-manager.js +281 -0
- package/dist/agency/agency-manager.js.map +1 -0
- package/dist/agency/index.d.ts +3 -0
- package/dist/agency/index.d.ts.map +1 -0
- package/dist/agency/index.js +2 -0
- package/dist/agency/index.js.map +1 -0
- package/dist/agency/types.d.ts +69 -0
- package/dist/agency/types.d.ts.map +1 -0
- package/dist/agency/types.js +5 -0
- package/dist/agency/types.js.map +1 -0
- package/dist/brain/brain.d.ts +0 -1
- package/dist/brain/brain.d.ts.map +1 -1
- package/dist/brain/brain.js +14 -0
- package/dist/brain/brain.js.map +1 -1
- package/dist/brain/intelligence.d.ts +5 -1
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +83 -0
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/types.d.ts +21 -0
- package/dist/brain/types.d.ts.map +1 -1
- package/dist/chat/agent-loop-types.d.ts +82 -0
- package/dist/chat/agent-loop-types.d.ts.map +1 -0
- package/dist/chat/agent-loop-types.js +8 -0
- package/dist/chat/agent-loop-types.js.map +1 -0
- package/dist/chat/agent-loop.d.ts +19 -0
- package/dist/chat/agent-loop.d.ts.map +1 -0
- package/dist/chat/agent-loop.js +261 -0
- package/dist/chat/agent-loop.js.map +1 -0
- package/dist/chat/auth-manager.d.ts +49 -0
- package/dist/chat/auth-manager.d.ts.map +1 -0
- package/dist/chat/auth-manager.js +152 -0
- package/dist/chat/auth-manager.js.map +1 -0
- package/dist/chat/browser-session.d.ts +86 -0
- package/dist/chat/browser-session.d.ts.map +1 -0
- package/dist/chat/browser-session.js +143 -0
- package/dist/chat/browser-session.js.map +1 -0
- package/dist/chat/cancellation.d.ts +54 -0
- package/dist/chat/cancellation.d.ts.map +1 -0
- package/dist/chat/cancellation.js +80 -0
- package/dist/chat/cancellation.js.map +1 -0
- package/dist/chat/chat-session.d.ts +86 -0
- package/dist/chat/chat-session.d.ts.map +1 -0
- package/dist/chat/chat-session.js +252 -0
- package/dist/chat/chat-session.js.map +1 -0
- package/dist/chat/file-handler.d.ts +63 -0
- package/dist/chat/file-handler.d.ts.map +1 -0
- package/dist/chat/file-handler.js +182 -0
- package/dist/chat/file-handler.js.map +1 -0
- package/dist/chat/fragment-buffer.d.ts +49 -0
- package/dist/chat/fragment-buffer.d.ts.map +1 -0
- package/dist/chat/fragment-buffer.js +130 -0
- package/dist/chat/fragment-buffer.js.map +1 -0
- package/dist/chat/index.d.ts +24 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +15 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/mcp-bridge.d.ts +60 -0
- package/dist/chat/mcp-bridge.d.ts.map +1 -0
- package/dist/chat/mcp-bridge.js +111 -0
- package/dist/chat/mcp-bridge.js.map +1 -0
- package/dist/chat/notifications.d.ts +82 -0
- package/dist/chat/notifications.d.ts.map +1 -0
- package/dist/chat/notifications.js +119 -0
- package/dist/chat/notifications.js.map +1 -0
- package/dist/chat/output-compressor.d.ts +30 -0
- package/dist/chat/output-compressor.d.ts.map +1 -0
- package/dist/chat/output-compressor.js +95 -0
- package/dist/chat/output-compressor.js.map +1 -0
- package/dist/chat/queue.d.ts +91 -0
- package/dist/chat/queue.d.ts.map +1 -0
- package/dist/chat/queue.js +146 -0
- package/dist/chat/queue.js.map +1 -0
- package/dist/chat/response-chunker.d.ts +29 -0
- package/dist/chat/response-chunker.d.ts.map +1 -0
- package/dist/chat/response-chunker.js +163 -0
- package/dist/chat/response-chunker.js.map +1 -0
- package/dist/chat/self-update.d.ts +62 -0
- package/dist/chat/self-update.d.ts.map +1 -0
- package/dist/chat/self-update.js +90 -0
- package/dist/chat/self-update.js.map +1 -0
- package/dist/chat/types.d.ts +105 -0
- package/dist/chat/types.d.ts.map +1 -0
- package/dist/chat/types.js +8 -0
- package/dist/chat/types.js.map +1 -0
- package/dist/chat/voice.d.ts +39 -0
- package/dist/chat/voice.d.ts.map +1 -0
- package/dist/chat/voice.js +80 -0
- package/dist/chat/voice.js.map +1 -0
- package/dist/claudemd/compose.d.ts +31 -0
- package/dist/claudemd/compose.d.ts.map +1 -0
- package/dist/claudemd/compose.js +105 -0
- package/dist/claudemd/compose.js.map +1 -0
- package/dist/claudemd/index.d.ts +5 -0
- package/dist/claudemd/index.d.ts.map +1 -0
- package/dist/claudemd/index.js +3 -0
- package/dist/claudemd/index.js.map +1 -0
- package/dist/claudemd/inject.d.ts +31 -0
- package/dist/claudemd/inject.d.ts.map +1 -0
- package/dist/claudemd/inject.js +157 -0
- package/dist/claudemd/inject.js.map +1 -0
- package/dist/claudemd/types.d.ts +41 -0
- package/dist/claudemd/types.d.ts.map +1 -0
- package/dist/claudemd/types.js +5 -0
- package/dist/claudemd/types.js.map +1 -0
- package/dist/context/context-engine.d.ts +31 -0
- package/dist/context/context-engine.d.ts.map +1 -0
- package/dist/context/context-engine.js +245 -0
- package/dist/context/context-engine.js.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/types.d.ts +54 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/context/types.js +5 -0
- package/dist/context/types.js.map +1 -0
- package/dist/enforcement/adapters/claude-code.d.ts +18 -0
- package/dist/enforcement/adapters/claude-code.d.ts.map +1 -0
- package/dist/enforcement/adapters/claude-code.js +106 -0
- package/dist/enforcement/adapters/claude-code.js.map +1 -0
- package/dist/enforcement/adapters/index.d.ts +2 -0
- package/dist/enforcement/adapters/index.d.ts.map +1 -0
- package/dist/enforcement/adapters/index.js +2 -0
- package/dist/enforcement/adapters/index.js.map +1 -0
- package/dist/enforcement/index.d.ts +4 -0
- package/dist/enforcement/index.d.ts.map +1 -0
- package/dist/enforcement/index.js +3 -0
- package/dist/enforcement/index.js.map +1 -0
- package/dist/enforcement/registry.d.ts +23 -0
- package/dist/enforcement/registry.d.ts.map +1 -0
- package/dist/enforcement/registry.js +63 -0
- package/dist/enforcement/registry.js.map +1 -0
- package/dist/enforcement/types.d.ts +51 -0
- package/dist/enforcement/types.d.ts.map +1 -0
- package/dist/enforcement/types.js +8 -0
- package/dist/enforcement/types.js.map +1 -0
- package/dist/facades/facade-factory.d.ts +10 -3
- package/dist/facades/facade-factory.d.ts.map +1 -1
- package/dist/facades/facade-factory.js +94 -5
- package/dist/facades/facade-factory.js.map +1 -1
- package/dist/facades/types.d.ts +15 -1
- package/dist/facades/types.d.ts.map +1 -1
- package/dist/facades/types.js +6 -0
- package/dist/facades/types.js.map +1 -1
- package/dist/health/health-registry.d.ts +40 -0
- package/dist/health/health-registry.d.ts.map +1 -0
- package/dist/health/health-registry.js +134 -0
- package/dist/health/health-registry.js.map +1 -0
- package/dist/health/index.d.ts +5 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/health/index.js +3 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/vault-integrity.d.ts +13 -0
- package/dist/health/vault-integrity.d.ts.map +1 -0
- package/dist/health/vault-integrity.js +49 -0
- package/dist/health/vault-integrity.js.map +1 -0
- package/dist/index.d.ts +67 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -3
- package/dist/index.js.map +1 -1
- package/dist/intake/intake-pipeline.d.ts +0 -7
- package/dist/intake/intake-pipeline.d.ts.map +1 -1
- package/dist/intake/intake-pipeline.js +1 -1
- package/dist/intake/intake-pipeline.js.map +1 -1
- package/dist/intelligence/types.d.ts +1 -0
- package/dist/intelligence/types.d.ts.map +1 -1
- package/dist/migrations/index.d.ts +6 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +5 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/migration-runner.d.ts +51 -0
- package/dist/migrations/migration-runner.d.ts.map +1 -0
- package/dist/migrations/migration-runner.js +141 -0
- package/dist/migrations/migration-runner.js.map +1 -0
- package/dist/packs/index.d.ts +10 -0
- package/dist/packs/index.d.ts.map +1 -0
- package/dist/packs/index.js +8 -0
- package/dist/packs/index.js.map +1 -0
- package/dist/packs/lockfile.d.ts +97 -0
- package/dist/packs/lockfile.d.ts.map +1 -0
- package/dist/packs/lockfile.js +129 -0
- package/dist/packs/lockfile.js.map +1 -0
- package/dist/packs/pack-installer.d.ts +41 -0
- package/dist/packs/pack-installer.d.ts.map +1 -0
- package/dist/packs/pack-installer.js +253 -0
- package/dist/packs/pack-installer.js.map +1 -0
- package/dist/packs/resolver.d.ts +51 -0
- package/dist/packs/resolver.d.ts.map +1 -0
- package/dist/packs/resolver.js +195 -0
- package/dist/packs/resolver.js.map +1 -0
- package/dist/packs/types.d.ts +186 -0
- package/dist/packs/types.d.ts.map +1 -0
- package/dist/packs/types.js +69 -0
- package/dist/packs/types.js.map +1 -0
- package/dist/persistence/postgres-provider.d.ts +42 -7
- package/dist/persistence/postgres-provider.d.ts.map +1 -1
- package/dist/persistence/postgres-provider.js +187 -46
- package/dist/persistence/postgres-provider.js.map +1 -1
- package/dist/playbooks/index.d.ts +2 -0
- package/dist/playbooks/index.d.ts.map +1 -1
- package/dist/playbooks/index.js +2 -0
- package/dist/playbooks/index.js.map +1 -1
- package/dist/playbooks/playbook-executor.d.ts +100 -0
- package/dist/playbooks/playbook-executor.d.ts.map +1 -0
- package/dist/playbooks/playbook-executor.js +207 -0
- package/dist/playbooks/playbook-executor.js.map +1 -0
- package/dist/plugins/index.d.ts +7 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +7 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +28 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +150 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +58 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +157 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/types.d.ts +180 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +48 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/runtime/admin-extra-ops.d.ts.map +1 -1
- package/dist/runtime/admin-extra-ops.js +181 -8
- package/dist/runtime/admin-extra-ops.js.map +1 -1
- package/dist/runtime/capture-ops.d.ts.map +1 -1
- package/dist/runtime/capture-ops.js +106 -7
- package/dist/runtime/capture-ops.js.map +1 -1
- package/dist/runtime/deprecation.d.ts +33 -0
- package/dist/runtime/deprecation.d.ts.map +1 -0
- package/dist/runtime/deprecation.js +41 -0
- package/dist/runtime/deprecation.js.map +1 -0
- package/dist/runtime/facades/admin-facade.d.ts.map +1 -1
- package/dist/runtime/facades/admin-facade.js +12 -1
- package/dist/runtime/facades/admin-facade.js.map +1 -1
- package/dist/runtime/facades/agency-facade.d.ts +7 -0
- package/dist/runtime/facades/agency-facade.d.ts.map +1 -0
- package/dist/runtime/facades/agency-facade.js +103 -0
- package/dist/runtime/facades/agency-facade.js.map +1 -0
- package/dist/runtime/facades/brain-facade.d.ts.map +1 -1
- package/dist/runtime/facades/brain-facade.js +58 -0
- package/dist/runtime/facades/brain-facade.js.map +1 -1
- package/dist/runtime/facades/chat-facade.d.ts +7 -0
- package/dist/runtime/facades/chat-facade.d.ts.map +1 -0
- package/dist/runtime/facades/chat-facade.js +808 -0
- package/dist/runtime/facades/chat-facade.js.map +1 -0
- package/dist/runtime/facades/context-facade.d.ts +7 -0
- package/dist/runtime/facades/context-facade.d.ts.map +1 -0
- package/dist/runtime/facades/context-facade.js +45 -0
- package/dist/runtime/facades/context-facade.js.map +1 -0
- package/dist/runtime/facades/index.d.ts.map +1 -1
- package/dist/runtime/facades/index.js +18 -0
- package/dist/runtime/facades/index.js.map +1 -1
- package/dist/runtime/facades/vault-facade.d.ts.map +1 -1
- package/dist/runtime/facades/vault-facade.js +247 -1
- package/dist/runtime/facades/vault-facade.js.map +1 -1
- package/dist/runtime/feature-flags.d.ts +18 -0
- package/dist/runtime/feature-flags.d.ts.map +1 -0
- package/dist/runtime/feature-flags.js +90 -0
- package/dist/runtime/feature-flags.js.map +1 -0
- package/dist/runtime/pack-ops.d.ts +9 -0
- package/dist/runtime/pack-ops.d.ts.map +1 -0
- package/dist/runtime/pack-ops.js +76 -0
- package/dist/runtime/pack-ops.js.map +1 -0
- package/dist/runtime/playbook-ops.d.ts +3 -7
- package/dist/runtime/playbook-ops.d.ts.map +1 -1
- package/dist/runtime/playbook-ops.js +101 -10
- package/dist/runtime/playbook-ops.js.map +1 -1
- package/dist/runtime/plugin-ops.d.ts +9 -0
- package/dist/runtime/plugin-ops.d.ts.map +1 -0
- package/dist/runtime/plugin-ops.js +235 -0
- package/dist/runtime/plugin-ops.js.map +1 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +72 -5
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/telemetry-ops.d.ts +10 -0
- package/dist/runtime/telemetry-ops.d.ts.map +1 -0
- package/dist/runtime/telemetry-ops.js +53 -0
- package/dist/runtime/telemetry-ops.js.map +1 -0
- package/dist/runtime/types.d.ts +35 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-sharing-ops.d.ts +13 -0
- package/dist/runtime/vault-sharing-ops.d.ts.map +1 -0
- package/dist/runtime/vault-sharing-ops.js +345 -0
- package/dist/runtime/vault-sharing-ops.js.map +1 -0
- package/dist/streams/index.d.ts +1 -1
- package/dist/streams/index.d.ts.map +1 -1
- package/dist/streams/index.js +1 -1
- package/dist/streams/index.js.map +1 -1
- package/dist/streams/replayable-stream.d.ts +13 -1
- package/dist/streams/replayable-stream.d.ts.map +1 -1
- package/dist/streams/replayable-stream.js +27 -3
- package/dist/streams/replayable-stream.js.map +1 -1
- package/dist/text/similarity.d.ts +0 -1
- package/dist/text/similarity.d.ts.map +1 -1
- package/dist/text/similarity.js +1 -1
- package/dist/text/similarity.js.map +1 -1
- package/dist/transport/http-server.d.ts +56 -0
- package/dist/transport/http-server.d.ts.map +1 -0
- package/dist/transport/http-server.js +210 -0
- package/dist/transport/http-server.js.map +1 -0
- package/dist/transport/index.d.ts +11 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +10 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/lsp-server.d.ts +140 -0
- package/dist/transport/lsp-server.d.ts.map +1 -0
- package/dist/transport/lsp-server.js +239 -0
- package/dist/transport/lsp-server.js.map +1 -0
- package/dist/transport/rate-limiter.d.ts +35 -0
- package/dist/transport/rate-limiter.d.ts.map +1 -0
- package/dist/transport/rate-limiter.js +72 -0
- package/dist/transport/rate-limiter.js.map +1 -0
- package/dist/transport/session-manager.d.ts +49 -0
- package/dist/transport/session-manager.d.ts.map +1 -0
- package/dist/transport/session-manager.js +83 -0
- package/dist/transport/session-manager.js.map +1 -0
- package/dist/transport/token-auth.d.ts +29 -0
- package/dist/transport/token-auth.d.ts.map +1 -0
- package/dist/transport/token-auth.js +84 -0
- package/dist/transport/token-auth.js.map +1 -0
- package/dist/transport/types.d.ts +61 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +5 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/transport/ws-server.d.ts +78 -0
- package/dist/transport/ws-server.d.ts.map +1 -0
- package/dist/transport/ws-server.js +342 -0
- package/dist/transport/ws-server.js.map +1 -0
- package/dist/vault/git-vault-sync.d.ts +107 -0
- package/dist/vault/git-vault-sync.d.ts.map +1 -0
- package/dist/vault/git-vault-sync.js +251 -0
- package/dist/vault/git-vault-sync.js.map +1 -0
- package/dist/vault/knowledge-review.d.ts +67 -0
- package/dist/vault/knowledge-review.d.ts.map +1 -0
- package/dist/vault/knowledge-review.js +133 -0
- package/dist/vault/knowledge-review.js.map +1 -0
- package/dist/vault/obsidian-sync.d.ts +94 -0
- package/dist/vault/obsidian-sync.d.ts.map +1 -0
- package/dist/vault/obsidian-sync.js +247 -0
- package/dist/vault/obsidian-sync.js.map +1 -0
- package/dist/vault/scope-detector.d.ts +31 -0
- package/dist/vault/scope-detector.d.ts.map +1 -0
- package/dist/vault/scope-detector.js +182 -0
- package/dist/vault/scope-detector.js.map +1 -0
- package/dist/vault/vault-branching.d.ts +71 -0
- package/dist/vault/vault-branching.d.ts.map +1 -0
- package/dist/vault/vault-branching.js +180 -0
- package/dist/vault/vault-branching.js.map +1 -0
- package/dist/vault/vault-manager.d.ts +89 -0
- package/dist/vault/vault-manager.d.ts.map +1 -0
- package/dist/vault/vault-manager.js +199 -0
- package/dist/vault/vault-manager.js.map +1 -0
- package/dist/vault/vault-types.d.ts +30 -0
- package/dist/vault/vault-types.d.ts.map +1 -0
- package/dist/vault/vault-types.js +10 -0
- package/dist/vault/vault-types.js.map +1 -0
- package/dist/vault/vault.d.ts +10 -0
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +36 -3
- package/dist/vault/vault.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/admin-extra-ops.test.ts +31 -11
- package/src/__tests__/agency-manager.test.ts +374 -0
- package/src/__tests__/agent-loop.test.ts +256 -0
- package/src/__tests__/capture-ops.test.ts +275 -0
- package/src/__tests__/chat-differentiators.test.ts +251 -0
- package/src/__tests__/chat-enhanced.test.ts +390 -0
- package/src/__tests__/chat-transport.test.ts +665 -0
- package/src/__tests__/claudemd.test.ts +282 -0
- package/src/__tests__/context-engine.test.ts +256 -0
- package/src/__tests__/core-ops.test.ts +97 -5
- package/src/__tests__/deprecation.test.ts +78 -0
- package/src/__tests__/enforcement.test.ts +153 -0
- package/src/__tests__/facade-factory.test.ts +271 -0
- package/src/__tests__/feature-flags.test.ts +138 -0
- package/src/__tests__/git-vault-sync.test.ts +230 -0
- package/src/__tests__/health-registry.test.ts +173 -0
- package/src/__tests__/knowledge-review.test.ts +104 -0
- package/src/__tests__/lsp-transport.test.ts +442 -0
- package/src/__tests__/migration-runner.test.ts +170 -0
- package/src/__tests__/normalize.test.ts +10 -0
- package/src/__tests__/obsidian-sync.test.ts +354 -0
- package/src/__tests__/pack-lockfile.test.ts +261 -0
- package/src/__tests__/pack-ops.test.ts +146 -0
- package/src/__tests__/pack-system.test.ts +423 -0
- package/src/__tests__/playbook-executor.test.ts +249 -0
- package/src/__tests__/playbook-ops-execution.test.ts +189 -0
- package/src/__tests__/plugin-ops.test.ts +411 -0
- package/src/__tests__/plugin-system.test.ts +509 -0
- package/src/__tests__/postgres-provider.test.ts +64 -6
- package/src/__tests__/replayable-stream.test.ts +112 -1
- package/src/__tests__/scope-detector.test.ts +121 -0
- package/src/__tests__/session-lifecycle.test.ts +259 -0
- package/src/__tests__/transport.test.ts +758 -0
- package/src/__tests__/vault-branching.test.ts +274 -0
- package/src/__tests__/vault-connect.test.ts +179 -0
- package/src/__tests__/vault-integrity.test.ts +71 -0
- package/src/__tests__/vault-manager.test.ts +238 -0
- package/src/__tests__/vault-scaling.test.ts +281 -0
- package/src/__tests__/vault-sharing.test.ts +270 -0
- package/src/__tests__/ws-transport.test.ts +479 -0
- package/src/agency/agency-manager.ts +326 -0
- package/src/agency/index.ts +13 -0
- package/src/agency/types.ts +88 -0
- package/src/brain/brain.ts +15 -11
- package/src/brain/intelligence.ts +103 -0
- package/src/brain/types.ts +26 -0
- package/src/chat/agent-loop-types.ts +99 -0
- package/src/chat/agent-loop.ts +357 -0
- package/src/chat/auth-manager.ts +171 -0
- package/src/chat/browser-session.ts +188 -0
- package/src/chat/cancellation.ts +99 -0
- package/src/chat/chat-session.ts +283 -0
- package/src/chat/file-handler.ts +230 -0
- package/src/chat/fragment-buffer.ts +160 -0
- package/src/chat/index.ts +72 -0
- package/src/chat/mcp-bridge.ts +135 -0
- package/src/chat/notifications.ts +164 -0
- package/src/chat/output-compressor.ts +116 -0
- package/src/chat/queue.ts +208 -0
- package/src/chat/response-chunker.ts +200 -0
- package/src/chat/self-update.ts +117 -0
- package/src/chat/types.ts +126 -0
- package/src/chat/voice.ts +134 -0
- package/src/claudemd/compose.ts +142 -0
- package/src/claudemd/index.ts +17 -0
- package/src/claudemd/inject.ts +170 -0
- package/src/claudemd/types.ts +45 -0
- package/src/context/context-engine.ts +302 -0
- package/src/context/index.ts +11 -0
- package/src/context/types.ts +69 -0
- package/src/enforcement/adapters/claude-code.ts +135 -0
- package/src/enforcement/adapters/index.ts +1 -0
- package/src/enforcement/index.ts +10 -0
- package/src/enforcement/registry.ts +82 -0
- package/src/enforcement/types.ts +56 -0
- package/src/facades/facade-factory.ts +138 -5
- package/src/facades/types.ts +21 -0
- package/src/health/health-registry.ts +165 -0
- package/src/health/index.ts +11 -0
- package/src/health/vault-integrity.ts +66 -0
- package/src/index.ts +294 -2
- package/src/intake/intake-pipeline.ts +1 -1
- package/src/intelligence/types.ts +1 -0
- package/src/migrations/index.ts +6 -0
- package/src/migrations/migration-runner.ts +185 -0
- package/src/packs/index.ts +20 -0
- package/src/packs/lockfile.ts +180 -0
- package/src/packs/pack-installer.ts +289 -0
- package/src/packs/resolver.ts +237 -0
- package/src/packs/types.ts +125 -0
- package/src/persistence/postgres-provider.ts +211 -58
- package/src/playbooks/index.ts +11 -0
- package/src/playbooks/playbook-executor.ts +301 -0
- package/src/plugins/index.ts +19 -0
- package/src/plugins/plugin-loader.ts +183 -0
- package/src/plugins/plugin-registry.ts +187 -0
- package/src/plugins/types.ts +119 -0
- package/src/runtime/admin-extra-ops.ts +193 -8
- package/src/runtime/capture-ops.ts +113 -8
- package/src/runtime/deprecation.ts +58 -0
- package/src/runtime/facades/admin-facade.ts +16 -1
- package/src/runtime/facades/agency-facade.ts +111 -0
- package/src/runtime/facades/brain-facade.ts +60 -0
- package/src/runtime/facades/chat-facade.ts +918 -0
- package/src/runtime/facades/context-facade.ts +55 -0
- package/src/runtime/facades/index.ts +22 -1
- package/src/runtime/facades/vault-facade.ts +261 -1
- package/src/runtime/feature-flags.ts +101 -0
- package/src/runtime/pack-ops.ts +85 -0
- package/src/runtime/playbook-ops.ts +113 -9
- package/src/runtime/plugin-ops.ts +258 -0
- package/src/runtime/runtime.ts +84 -5
- package/src/runtime/telemetry-ops.ts +57 -0
- package/src/runtime/types.ts +35 -0
- package/src/runtime/vault-sharing-ops.ts +372 -0
- package/src/streams/index.ts +1 -1
- package/src/streams/replayable-stream.ts +34 -3
- package/src/text/similarity.ts +1 -1
- package/src/transport/http-server.ts +269 -0
- package/src/transport/index.ts +48 -0
- package/src/transport/lsp-server.ts +401 -0
- package/src/transport/rate-limiter.ts +97 -0
- package/src/transport/session-manager.ts +120 -0
- package/src/transport/token-auth.ts +96 -0
- package/src/transport/types.ts +66 -0
- package/src/transport/ws-server.ts +415 -0
- package/src/vault/git-vault-sync.ts +318 -0
- package/src/vault/knowledge-review.ts +221 -0
- package/src/vault/obsidian-sync.ts +346 -0
- package/src/vault/scope-detector.ts +219 -0
- package/src/vault/vault-branching.ts +264 -0
- package/src/vault/vault-manager.ts +237 -0
- package/src/vault/vault-types.ts +50 -0
- package/src/vault/vault.ts +41 -3
- package/src/governance/index.ts +0 -18
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Playbook Operations —
|
|
2
|
+
* Playbook Operations — 8 ops for playbook management and execution.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* New ops:
|
|
8
|
-
* playbook_match — match playbooks by intent + text
|
|
9
|
-
* playbook_seed — seed built-in playbooks into vault
|
|
4
|
+
* Management: playbook_list, playbook_get, playbook_create, playbook_match, playbook_seed
|
|
5
|
+
* Execution: playbook_start, playbook_step, playbook_complete
|
|
10
6
|
*/
|
|
11
7
|
|
|
12
8
|
import { z } from 'zod';
|
|
@@ -17,11 +13,13 @@ import {
|
|
|
17
13
|
matchPlaybooks,
|
|
18
14
|
seedDefaultPlaybooks,
|
|
19
15
|
entryToPlaybookDefinition,
|
|
16
|
+
getBuiltinPlaybook,
|
|
17
|
+
getAllBuiltinPlaybooks,
|
|
20
18
|
} from '../playbooks/index.js';
|
|
21
19
|
import type { PlaybookIntent } from '../playbooks/index.js';
|
|
22
20
|
|
|
23
21
|
export function createPlaybookOps(runtime: AgentRuntime): OpDefinition[] {
|
|
24
|
-
const { vault } = runtime;
|
|
22
|
+
const { vault, playbookExecutor } = runtime;
|
|
25
23
|
|
|
26
24
|
return [
|
|
27
25
|
// ─── playbook_list ──────────────────────────────────────────────
|
|
@@ -155,7 +153,7 @@ export function createPlaybookOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
155
153
|
},
|
|
156
154
|
},
|
|
157
155
|
|
|
158
|
-
// ─── playbook_seed
|
|
156
|
+
// ─── playbook_seed ─────────────────────────────────────────────
|
|
159
157
|
{
|
|
160
158
|
name: 'playbook_seed',
|
|
161
159
|
description:
|
|
@@ -165,5 +163,111 @@ export function createPlaybookOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
165
163
|
return seedDefaultPlaybooks(vault);
|
|
166
164
|
},
|
|
167
165
|
},
|
|
166
|
+
|
|
167
|
+
// ─── playbook_start ──────────────────────────────────────────
|
|
168
|
+
{
|
|
169
|
+
name: 'playbook_start',
|
|
170
|
+
description:
|
|
171
|
+
'Start a playbook execution session. Returns the first step, tools, and gates. Use playbook_step to advance through steps.',
|
|
172
|
+
auth: 'write',
|
|
173
|
+
schema: z.object({
|
|
174
|
+
playbookId: z
|
|
175
|
+
.string()
|
|
176
|
+
.optional()
|
|
177
|
+
.describe('Built-in or vault playbook ID to start directly.'),
|
|
178
|
+
intent: z
|
|
179
|
+
.enum(['BUILD', 'FIX', 'REVIEW', 'PLAN', 'IMPROVE', 'DELIVER'])
|
|
180
|
+
.optional()
|
|
181
|
+
.describe('Auto-match a playbook by intent. Ignored if playbookId is provided.'),
|
|
182
|
+
text: z.string().optional().describe('Context text for auto-matching. Used with intent.'),
|
|
183
|
+
}),
|
|
184
|
+
handler: async (params) => {
|
|
185
|
+
const playbookId = params.playbookId as string | undefined;
|
|
186
|
+
const intent = params.intent as PlaybookIntent | undefined;
|
|
187
|
+
const text = (params.text as string | undefined) ?? '';
|
|
188
|
+
|
|
189
|
+
if (playbookId) {
|
|
190
|
+
// Direct start by ID — check built-in first, then vault
|
|
191
|
+
const builtin = getBuiltinPlaybook(playbookId);
|
|
192
|
+
if (builtin) {
|
|
193
|
+
return playbookExecutor.start(builtin);
|
|
194
|
+
}
|
|
195
|
+
const entry = vault.get(playbookId);
|
|
196
|
+
if (entry && entry.type === 'playbook') {
|
|
197
|
+
const def = entryToPlaybookDefinition(entry);
|
|
198
|
+
if (def) return playbookExecutor.start(def);
|
|
199
|
+
}
|
|
200
|
+
return { error: `Playbook not found: ${playbookId}` };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (intent || text) {
|
|
204
|
+
// Auto-match
|
|
205
|
+
const vaultEntries = vault.list({ type: 'playbook', limit: 200 });
|
|
206
|
+
const vaultPlaybooks = vaultEntries
|
|
207
|
+
.map((e) => entryToPlaybookDefinition(e))
|
|
208
|
+
.filter((p): p is NonNullable<typeof p> => p !== null);
|
|
209
|
+
|
|
210
|
+
const match = matchPlaybooks(intent, text, vaultPlaybooks);
|
|
211
|
+
if (!match.playbook) {
|
|
212
|
+
return {
|
|
213
|
+
error: 'No matching playbook found',
|
|
214
|
+
available: getAllBuiltinPlaybooks().map((p) => ({ id: p.id, title: p.title })),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return playbookExecutor.start(match.playbook);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return {
|
|
221
|
+
error: 'Provide playbookId or intent/text for auto-matching',
|
|
222
|
+
available: getAllBuiltinPlaybooks().map((p) => ({ id: p.id, title: p.title })),
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
// ─── playbook_step ───────────────────────────────────────────
|
|
228
|
+
{
|
|
229
|
+
name: 'playbook_step',
|
|
230
|
+
description:
|
|
231
|
+
'Advance to the next step in an active playbook session. Marks the current step as done (or skipped) and returns the next step.',
|
|
232
|
+
auth: 'write',
|
|
233
|
+
schema: z.object({
|
|
234
|
+
sessionId: z.string().describe('Active playbook session ID from playbook_start.'),
|
|
235
|
+
output: z.string().optional().describe('Summary of what was accomplished in this step.'),
|
|
236
|
+
skip: z.boolean().optional().describe('Skip this step instead of completing it.'),
|
|
237
|
+
}),
|
|
238
|
+
handler: async (params) => {
|
|
239
|
+
return playbookExecutor.step(params.sessionId as string, {
|
|
240
|
+
output: params.output as string | undefined,
|
|
241
|
+
skip: params.skip as boolean | undefined,
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
// ─── playbook_complete ───────────────────────────────────────
|
|
247
|
+
{
|
|
248
|
+
name: 'playbook_complete',
|
|
249
|
+
description:
|
|
250
|
+
'Complete (or abort) a playbook session. Validates completion gates and returns a summary with pass/fail status.',
|
|
251
|
+
auth: 'write',
|
|
252
|
+
schema: z.object({
|
|
253
|
+
sessionId: z.string().describe('Active playbook session ID.'),
|
|
254
|
+
abort: z
|
|
255
|
+
.boolean()
|
|
256
|
+
.optional()
|
|
257
|
+
.describe('Abort instead of completing. Skips remaining steps.'),
|
|
258
|
+
gateResults: z
|
|
259
|
+
.record(z.boolean())
|
|
260
|
+
.optional()
|
|
261
|
+
.describe(
|
|
262
|
+
'Gate check results: { "gate-check-type": true/false }. Unmapped gates are treated as failed.',
|
|
263
|
+
),
|
|
264
|
+
}),
|
|
265
|
+
handler: async (params) => {
|
|
266
|
+
return playbookExecutor.complete(params.sessionId as string, {
|
|
267
|
+
abort: params.abort as boolean | undefined,
|
|
268
|
+
gateResults: params.gateResults as Record<string, boolean> | undefined,
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
},
|
|
168
272
|
];
|
|
169
273
|
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Operations — 5 ops for runtime plugin management.
|
|
3
|
+
*
|
|
4
|
+
* plugin_list, plugin_load, plugin_activate, plugin_deactivate, plugin_status
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
9
|
+
import type { AgentRuntime } from './types.js';
|
|
10
|
+
import { loadPlugins, validateDependencies, sortByDependencies } from '../plugins/index.js';
|
|
11
|
+
|
|
12
|
+
export function createPluginOps(runtime: AgentRuntime, opSink?: OpDefinition[]): OpDefinition[] {
|
|
13
|
+
const { pluginRegistry, config } = runtime;
|
|
14
|
+
const injectedByPlugin = new Map<string, OpDefinition[]>();
|
|
15
|
+
|
|
16
|
+
const injectPluginOps = (pluginId: string): { injected: number; error?: string } => {
|
|
17
|
+
if (!opSink) return { injected: 0 };
|
|
18
|
+
if (injectedByPlugin.has(pluginId)) {
|
|
19
|
+
return { injected: injectedByPlugin.get(pluginId)?.length ?? 0 };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const plugin = pluginRegistry.get(pluginId);
|
|
23
|
+
if (!plugin) return { injected: 0, error: `Plugin not found: ${pluginId}` };
|
|
24
|
+
|
|
25
|
+
const pluginOps = plugin.facades.flatMap((f) => f.ops);
|
|
26
|
+
const existing = new Set(opSink.map((o) => o.name));
|
|
27
|
+
const collisions = pluginOps.filter((o) => existing.has(o.name)).map((o) => o.name);
|
|
28
|
+
if (collisions.length > 0) {
|
|
29
|
+
return {
|
|
30
|
+
injected: 0,
|
|
31
|
+
error: `Plugin op name collision: ${collisions.join(', ')}`,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
opSink.push(...pluginOps);
|
|
36
|
+
injectedByPlugin.set(pluginId, pluginOps);
|
|
37
|
+
return { injected: pluginOps.length };
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const removePluginOps = (pluginId: string): number => {
|
|
41
|
+
const injected = injectedByPlugin.get(pluginId);
|
|
42
|
+
if (!injected || !opSink) return 0;
|
|
43
|
+
const names = new Set(injected.map((o) => o.name));
|
|
44
|
+
for (let i = opSink.length - 1; i >= 0; i--) {
|
|
45
|
+
if (names.has(opSink[i].name)) {
|
|
46
|
+
opSink.splice(i, 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
injectedByPlugin.delete(pluginId);
|
|
50
|
+
return names.size;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return [
|
|
54
|
+
// ─── plugin_list ──────────────────────────────────────────────────
|
|
55
|
+
{
|
|
56
|
+
name: 'plugin_list',
|
|
57
|
+
description: 'List all registered plugins with their status, version, and facade count.',
|
|
58
|
+
auth: 'read',
|
|
59
|
+
handler: async () => {
|
|
60
|
+
const plugins = pluginRegistry.list();
|
|
61
|
+
return {
|
|
62
|
+
plugins: plugins.map((p) => ({
|
|
63
|
+
id: p.id,
|
|
64
|
+
name: p.manifest.name,
|
|
65
|
+
version: p.manifest.version,
|
|
66
|
+
domain: p.manifest.domain,
|
|
67
|
+
status: p.status,
|
|
68
|
+
provenance: p.provenance,
|
|
69
|
+
facades: p.facades.length,
|
|
70
|
+
ops: p.facades.reduce((sum, f) => sum + f.ops.length, 0),
|
|
71
|
+
error: p.error,
|
|
72
|
+
})),
|
|
73
|
+
count: plugins.length,
|
|
74
|
+
active: plugins.filter((p) => p.status === 'active').length,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// ─── plugin_load ──────────────────────────────────────────────────
|
|
80
|
+
{
|
|
81
|
+
name: 'plugin_load',
|
|
82
|
+
description:
|
|
83
|
+
'Scan plugin directories and load all valid plugins. Validates manifests and checks dependencies. Does not activate — call plugin_activate separately.',
|
|
84
|
+
auth: 'admin',
|
|
85
|
+
schema: z.object({
|
|
86
|
+
projectPath: z.string().optional().describe('Project path for project-level plugins.'),
|
|
87
|
+
extraDirs: z
|
|
88
|
+
.array(z.string())
|
|
89
|
+
.optional()
|
|
90
|
+
.describe('Additional directories to scan for plugins.'),
|
|
91
|
+
}),
|
|
92
|
+
handler: async (params) => {
|
|
93
|
+
const projectPath = (params.projectPath as string | undefined) ?? process.cwd();
|
|
94
|
+
const extraDirs = (params.extraDirs as string[] | undefined) ?? [];
|
|
95
|
+
|
|
96
|
+
const result = loadPlugins(config.agentId, projectPath, extraDirs);
|
|
97
|
+
|
|
98
|
+
const loadErrors = result.errors;
|
|
99
|
+
const dependencyErrors = validateDependencies(result.loaded).map((e) => ({
|
|
100
|
+
id: e.pluginId,
|
|
101
|
+
dependency: e.missingDep,
|
|
102
|
+
error: `Plugin "${e.pluginId}" requires "${e.missingDep}" which is not available`,
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
// Sort by dependency order and register
|
|
106
|
+
const registered: string[] = [];
|
|
107
|
+
const regErrors: Array<{ id: string; error: string }> = [];
|
|
108
|
+
|
|
109
|
+
if (dependencyErrors.length === 0) {
|
|
110
|
+
const sorted = sortByDependencies(result.loaded);
|
|
111
|
+
for (const plugin of sorted) {
|
|
112
|
+
try {
|
|
113
|
+
// Skip already registered
|
|
114
|
+
if (pluginRegistry.get(plugin.manifest.id)) continue;
|
|
115
|
+
pluginRegistry.register(plugin);
|
|
116
|
+
registered.push(plugin.manifest.id);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
regErrors.push({
|
|
119
|
+
id: plugin.manifest.id,
|
|
120
|
+
error: e instanceof Error ? e.message : String(e),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const errors = [
|
|
127
|
+
...loadErrors,
|
|
128
|
+
...dependencyErrors.map((e) => ({ directory: '', error: e.error })),
|
|
129
|
+
...regErrors.map((e) => ({ directory: '', error: e.error })),
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
registered,
|
|
134
|
+
registeredCount: registered.length,
|
|
135
|
+
loadErrors,
|
|
136
|
+
dependencyErrors,
|
|
137
|
+
registrationErrors: regErrors,
|
|
138
|
+
errors,
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
// ─── plugin_activate ──────────────────────────────────────────────
|
|
144
|
+
{
|
|
145
|
+
name: 'plugin_activate',
|
|
146
|
+
description:
|
|
147
|
+
'Activate a registered plugin — builds its facades and makes ops available. Optionally activate all registered plugins.',
|
|
148
|
+
auth: 'admin',
|
|
149
|
+
schema: z.object({
|
|
150
|
+
pluginId: z.string().optional().describe('Plugin ID to activate. Omit to activate all.'),
|
|
151
|
+
}),
|
|
152
|
+
handler: async (params) => {
|
|
153
|
+
const pluginId = params.pluginId as string | undefined;
|
|
154
|
+
|
|
155
|
+
if (pluginId) {
|
|
156
|
+
const plugin = pluginRegistry.get(pluginId);
|
|
157
|
+
if (!plugin) return { error: `Plugin not found: ${pluginId}` };
|
|
158
|
+
|
|
159
|
+
const result = await pluginRegistry.activate(pluginId, {
|
|
160
|
+
runtime,
|
|
161
|
+
manifest: plugin.manifest,
|
|
162
|
+
directory: plugin.directory,
|
|
163
|
+
});
|
|
164
|
+
const injected = result.status === 'active' ? injectPluginOps(pluginId) : { injected: 0 };
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
id: result.id,
|
|
168
|
+
status: result.status,
|
|
169
|
+
facades: result.facades.length,
|
|
170
|
+
ops: result.facades.reduce((sum, f) => sum + f.ops.length, 0),
|
|
171
|
+
injectedOps: injected.injected,
|
|
172
|
+
injectionError: injected.error,
|
|
173
|
+
error: result.error,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Activate all registered plugins
|
|
178
|
+
const pending = pluginRegistry.list().filter((plugin) => plugin.status !== 'active');
|
|
179
|
+
const results = await Promise.all(
|
|
180
|
+
pending.map(async (plugin) => {
|
|
181
|
+
const activated = await pluginRegistry.activate(plugin.id, {
|
|
182
|
+
runtime,
|
|
183
|
+
manifest: plugin.manifest,
|
|
184
|
+
directory: plugin.directory,
|
|
185
|
+
});
|
|
186
|
+
const injected =
|
|
187
|
+
activated.status === 'active' ? injectPluginOps(plugin.id) : { injected: 0 };
|
|
188
|
+
return {
|
|
189
|
+
id: activated.id,
|
|
190
|
+
status: activated.status,
|
|
191
|
+
error: activated.error ?? injected.error,
|
|
192
|
+
};
|
|
193
|
+
}),
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
activated: results.filter((r) => r.status === 'active').length,
|
|
198
|
+
errors: results.filter((r) => r.status === 'error'),
|
|
199
|
+
results,
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
// ─── plugin_deactivate ────────────────────────────────────────────
|
|
205
|
+
{
|
|
206
|
+
name: 'plugin_deactivate',
|
|
207
|
+
description: 'Deactivate a plugin — removes its facades from the runtime.',
|
|
208
|
+
auth: 'admin',
|
|
209
|
+
schema: z.object({
|
|
210
|
+
pluginId: z.string().describe('Plugin ID to deactivate.'),
|
|
211
|
+
}),
|
|
212
|
+
handler: async (params) => {
|
|
213
|
+
const pluginId = params.pluginId as string;
|
|
214
|
+
const success = pluginRegistry.deactivate(pluginId);
|
|
215
|
+
if (!success) return { error: `Plugin not found: ${pluginId}` };
|
|
216
|
+
const removedOps = removePluginOps(pluginId);
|
|
217
|
+
return { deactivated: true, id: pluginId, removedOps };
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
// ─── plugin_status ────────────────────────────────────────────────
|
|
222
|
+
{
|
|
223
|
+
name: 'plugin_status',
|
|
224
|
+
description:
|
|
225
|
+
'Get detailed status of a specific plugin including manifest, facades, and activation state.',
|
|
226
|
+
auth: 'read',
|
|
227
|
+
schema: z.object({
|
|
228
|
+
pluginId: z.string().describe('Plugin ID to inspect.'),
|
|
229
|
+
}),
|
|
230
|
+
handler: async (params) => {
|
|
231
|
+
const pluginId = params.pluginId as string;
|
|
232
|
+
const plugin = pluginRegistry.get(pluginId);
|
|
233
|
+
if (!plugin) return { error: `Plugin not found: ${pluginId}` };
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
id: plugin.id,
|
|
237
|
+
name: plugin.manifest.name,
|
|
238
|
+
version: plugin.manifest.version,
|
|
239
|
+
description: plugin.manifest.description,
|
|
240
|
+
domain: plugin.manifest.domain,
|
|
241
|
+
status: plugin.status,
|
|
242
|
+
provenance: plugin.provenance,
|
|
243
|
+
directory: plugin.directory,
|
|
244
|
+
error: plugin.error,
|
|
245
|
+
dependencies: plugin.manifest.dependencies,
|
|
246
|
+
facades: plugin.facades.map((f) => ({
|
|
247
|
+
name: f.name,
|
|
248
|
+
description: f.description,
|
|
249
|
+
ops: f.ops.map((o) => o.name),
|
|
250
|
+
})),
|
|
251
|
+
intelligence: plugin.manifest.intelligence.length,
|
|
252
|
+
registeredAt: plugin.registeredAt,
|
|
253
|
+
activatedAt: plugin.activatedAt,
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
];
|
|
258
|
+
}
|
package/src/runtime/runtime.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { homedir } from 'node:os';
|
|
12
|
-
import { Vault } from '../vault/vault.js';
|
|
13
12
|
import { Brain } from '../brain/brain.js';
|
|
14
13
|
import { BrainIntelligence } from '../brain/intelligence.js';
|
|
15
14
|
import { Planner } from '../planning/planner.js';
|
|
@@ -27,8 +26,19 @@ import { IntakePipeline } from '../intake/intake-pipeline.js';
|
|
|
27
26
|
import { Telemetry } from '../telemetry/telemetry.js';
|
|
28
27
|
import { ProjectRegistry } from '../project/project-registry.js';
|
|
29
28
|
import { TemplateManager } from '../prompts/template-manager.js';
|
|
30
|
-
import { existsSync } from 'node:fs';
|
|
29
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
31
30
|
import { createLogger } from '../logging/logger.js';
|
|
31
|
+
import { FeatureFlags } from './feature-flags.js';
|
|
32
|
+
import { HealthRegistry } from '../health/health-registry.js';
|
|
33
|
+
import { checkVaultIntegrity } from '../health/vault-integrity.js';
|
|
34
|
+
import { PlaybookExecutor } from '../playbooks/playbook-executor.js';
|
|
35
|
+
import { PluginRegistry } from '../plugins/plugin-registry.js';
|
|
36
|
+
import { PackInstaller } from '../packs/pack-installer.js';
|
|
37
|
+
import { VaultManager } from '../vault/vault-manager.js';
|
|
38
|
+
import { VaultBranching } from '../vault/vault-branching.js';
|
|
39
|
+
import { ContextEngine } from '../context/context-engine.js';
|
|
40
|
+
import { AgencyManager } from '../agency/agency-manager.js';
|
|
41
|
+
import { KnowledgeReview } from '../vault/knowledge-review.js';
|
|
32
42
|
import type { AgentRuntimeConfig, AgentRuntime } from './types.js';
|
|
33
43
|
|
|
34
44
|
/**
|
|
@@ -48,8 +58,21 @@ export function createAgentRuntime(config: AgentRuntimeConfig): AgentRuntime {
|
|
|
48
58
|
// Logger — structured output to stderr
|
|
49
59
|
const logger = createLogger({ level: config.logLevel, prefix: `[${agentId}]` });
|
|
50
60
|
|
|
51
|
-
// Vault —
|
|
52
|
-
const
|
|
61
|
+
// Vault Manager — multi-tier vault orchestration
|
|
62
|
+
const vaultManager = new VaultManager({ agentId });
|
|
63
|
+
|
|
64
|
+
// Vault — persistent SQLite knowledge store (agent tier)
|
|
65
|
+
const vault = vaultManager.open('agent', vaultPath);
|
|
66
|
+
|
|
67
|
+
// Shared vault — cross-agent intelligence (lower priority than agent vault)
|
|
68
|
+
try {
|
|
69
|
+
const sharedVaultDir = join(homedir(), '.soleri');
|
|
70
|
+
mkdirSync(sharedVaultDir, { recursive: true });
|
|
71
|
+
const sharedVaultPath = config.sharedVaultPath ?? join(sharedVaultDir, 'vault.db');
|
|
72
|
+
vaultManager.connect('shared', sharedVaultPath, 0.6);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
logger.warn(`Shared vault unavailable: ${err instanceof Error ? err.message : String(err)}`);
|
|
75
|
+
}
|
|
53
76
|
|
|
54
77
|
// Seed intelligence data if dataDir provided
|
|
55
78
|
if (config.dataDir) {
|
|
@@ -120,6 +143,51 @@ export function createAgentRuntime(config: AgentRuntimeConfig): AgentRuntime {
|
|
|
120
143
|
// Intake Pipeline — PDF/book ingestion with LLM classification
|
|
121
144
|
const intakePipeline = new IntakePipeline(vault.getProvider(), vault, llmClient);
|
|
122
145
|
|
|
146
|
+
// Playbook Executor — in-memory step-by-step workflow sessions
|
|
147
|
+
const playbookExecutor = new PlaybookExecutor();
|
|
148
|
+
|
|
149
|
+
// Plugin Registry — dynamic facade loading
|
|
150
|
+
const pluginRegistry = new PluginRegistry();
|
|
151
|
+
|
|
152
|
+
// Pack Installer — knowledge pack management
|
|
153
|
+
const packInstaller = new PackInstaller(vault, pluginRegistry);
|
|
154
|
+
|
|
155
|
+
// Vault Branching — experiment with knowledge changes before merging
|
|
156
|
+
const vaultBranching = new VaultBranching(vault);
|
|
157
|
+
|
|
158
|
+
// Context Engine — entity extraction, knowledge retrieval, confidence scoring
|
|
159
|
+
const contextEngine = new ContextEngine(vault, brain, brainIntelligence, cognee);
|
|
160
|
+
|
|
161
|
+
// Agency Manager — proactive file watching, pattern surfacing (disabled by default)
|
|
162
|
+
const agencyManager = new AgencyManager(vault);
|
|
163
|
+
|
|
164
|
+
// Knowledge Review — team review workflows (submit/approve/reject)
|
|
165
|
+
const knowledgeReview = new KnowledgeReview(vault.getProvider());
|
|
166
|
+
|
|
167
|
+
// Health Registry — centralized subsystem status tracking
|
|
168
|
+
const health = new HealthRegistry();
|
|
169
|
+
health.register('vault', 'healthy');
|
|
170
|
+
health.register('brain', 'healthy');
|
|
171
|
+
health.register('cognee', cognee.getStatus()?.available ? 'healthy' : 'degraded');
|
|
172
|
+
health.register(
|
|
173
|
+
'llm',
|
|
174
|
+
llmClient.isAvailable().openai || llmClient.isAvailable().anthropic ? 'healthy' : 'degraded',
|
|
175
|
+
);
|
|
176
|
+
health.register('planner', 'healthy');
|
|
177
|
+
|
|
178
|
+
// Vault integrity check on startup (non-fatal)
|
|
179
|
+
try {
|
|
180
|
+
const integrity = checkVaultIntegrity(vault.getProvider());
|
|
181
|
+
if (!integrity.schemaValid || !integrity.ftsValid) {
|
|
182
|
+
health.update('vault', 'degraded', integrity.errors.join('; '));
|
|
183
|
+
if (integrity.ftsRebuilt) {
|
|
184
|
+
logger.info('Vault FTS index rebuilt automatically');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} catch {
|
|
188
|
+
// Integrity check itself failed — vault may still work
|
|
189
|
+
}
|
|
190
|
+
|
|
123
191
|
return {
|
|
124
192
|
config,
|
|
125
193
|
logger,
|
|
@@ -140,11 +208,22 @@ export function createAgentRuntime(config: AgentRuntimeConfig): AgentRuntime {
|
|
|
140
208
|
templateManager,
|
|
141
209
|
syncManager,
|
|
142
210
|
intakePipeline,
|
|
211
|
+
authPolicy: { mode: 'permissive', callerLevel: 'admin' },
|
|
212
|
+
flags: new FeatureFlags(join(agentHome, 'flags.json')),
|
|
213
|
+
health,
|
|
214
|
+
playbookExecutor,
|
|
215
|
+
pluginRegistry,
|
|
216
|
+
packInstaller,
|
|
217
|
+
vaultManager,
|
|
218
|
+
vaultBranching,
|
|
219
|
+
contextEngine,
|
|
220
|
+
agencyManager,
|
|
221
|
+
knowledgeReview,
|
|
143
222
|
createdAt: Date.now(),
|
|
144
223
|
close: () => {
|
|
145
224
|
syncManager.close();
|
|
146
225
|
cognee.resetPendingCognify();
|
|
147
|
-
|
|
226
|
+
vaultManager.close();
|
|
148
227
|
},
|
|
149
228
|
};
|
|
150
229
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extended telemetry ops — error aggregation and slow op detection.
|
|
3
|
+
*
|
|
4
|
+
* Complements admin_telemetry, admin_telemetry_recent, admin_telemetry_reset
|
|
5
|
+
* in admin-extra-ops with higher-level analysis.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
10
|
+
import type { AgentRuntime } from './types.js';
|
|
11
|
+
|
|
12
|
+
export function createTelemetryOps(runtime: AgentRuntime): OpDefinition[] {
|
|
13
|
+
const { telemetry } = runtime;
|
|
14
|
+
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
name: 'telemetry_errors',
|
|
18
|
+
description: 'Get recent errors grouped by op name with error details.',
|
|
19
|
+
auth: 'read' as const,
|
|
20
|
+
handler: async () => {
|
|
21
|
+
const stats = telemetry.getStats();
|
|
22
|
+
const recent = telemetry.getRecent(200);
|
|
23
|
+
const errors = recent.filter((c) => !c.success);
|
|
24
|
+
return {
|
|
25
|
+
errorCount: errors.length,
|
|
26
|
+
errorsByOp: stats.errorsByOp,
|
|
27
|
+
recentErrors: errors.slice(0, 20).map((e) => ({
|
|
28
|
+
op: e.op,
|
|
29
|
+
facade: e.facade,
|
|
30
|
+
error: e.error,
|
|
31
|
+
timestamp: e.timestamp,
|
|
32
|
+
})),
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'telemetry_slow_ops',
|
|
38
|
+
description: 'Get the slowest ops by average duration, filtered by threshold.',
|
|
39
|
+
auth: 'read' as const,
|
|
40
|
+
schema: z.object({
|
|
41
|
+
threshold: z
|
|
42
|
+
.number()
|
|
43
|
+
.optional()
|
|
44
|
+
.default(100)
|
|
45
|
+
.describe('Minimum avg duration in ms to report'),
|
|
46
|
+
}),
|
|
47
|
+
handler: async (params) => {
|
|
48
|
+
const stats = telemetry.getStats();
|
|
49
|
+
const threshold = (params.threshold as number) ?? 100;
|
|
50
|
+
return {
|
|
51
|
+
slowOps: stats.slowestOps.filter((o) => o.avgMs >= threshold),
|
|
52
|
+
avgDurationMs: stats.avgDurationMs,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
package/src/runtime/types.ts
CHANGED
|
@@ -17,6 +17,17 @@ import type { CogneeSyncManager } from '../cognee/sync-manager.js';
|
|
|
17
17
|
import type { IntakePipeline } from '../intake/intake-pipeline.js';
|
|
18
18
|
import type { Logger } from '../logging/logger.js';
|
|
19
19
|
import type { LogLevel } from '../logging/types.js';
|
|
20
|
+
import type { AuthPolicy } from '../facades/types.js';
|
|
21
|
+
import type { FeatureFlags } from './feature-flags.js';
|
|
22
|
+
import type { HealthRegistry } from '../health/health-registry.js';
|
|
23
|
+
import type { PlaybookExecutor } from '../playbooks/playbook-executor.js';
|
|
24
|
+
import type { PluginRegistry } from '../plugins/plugin-registry.js';
|
|
25
|
+
import type { PackInstaller } from '../packs/pack-installer.js';
|
|
26
|
+
import type { VaultManager } from '../vault/vault-manager.js';
|
|
27
|
+
import type { VaultBranching } from '../vault/vault-branching.js';
|
|
28
|
+
import type { ContextEngine } from '../context/context-engine.js';
|
|
29
|
+
import type { AgencyManager } from '../agency/agency-manager.js';
|
|
30
|
+
import type { KnowledgeReview } from '../vault/knowledge-review.js';
|
|
20
31
|
|
|
21
32
|
/**
|
|
22
33
|
* Configuration for creating an agent runtime.
|
|
@@ -35,6 +46,8 @@ export interface AgentRuntimeConfig {
|
|
|
35
46
|
templatesDir?: string;
|
|
36
47
|
/** Minimum log level. Default: 'info' (or SOLERI_LOG_LEVEL env var). */
|
|
37
48
|
logLevel?: LogLevel;
|
|
49
|
+
/** Path to shared global vault. Default: ~/.soleri/vault.db */
|
|
50
|
+
sharedVaultPath?: string;
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
/**
|
|
@@ -61,6 +74,28 @@ export interface AgentRuntime {
|
|
|
61
74
|
templateManager: TemplateManager;
|
|
62
75
|
syncManager: CogneeSyncManager;
|
|
63
76
|
intakePipeline: IntakePipeline;
|
|
77
|
+
/** Mutable auth policy — controls facade dispatch enforcement. */
|
|
78
|
+
authPolicy: AuthPolicy;
|
|
79
|
+
/** Feature flags — file-based + env var + runtime toggles. */
|
|
80
|
+
flags: FeatureFlags;
|
|
81
|
+
/** Centralized health registry — subsystem status tracking. */
|
|
82
|
+
health: HealthRegistry;
|
|
83
|
+
/** Playbook executor — in-memory step-by-step workflow sessions. */
|
|
84
|
+
playbookExecutor: PlaybookExecutor;
|
|
85
|
+
/** Plugin registry — dynamic facade loading without re-scaffold. */
|
|
86
|
+
pluginRegistry: PluginRegistry;
|
|
87
|
+
/** Pack installer — knowledge pack installation and management. */
|
|
88
|
+
packInstaller: PackInstaller;
|
|
89
|
+
/** Vault manager — multi-tier vault orchestration with cascading search. */
|
|
90
|
+
vaultManager: VaultManager;
|
|
91
|
+
/** Vault branching — experiment with knowledge changes before merging. */
|
|
92
|
+
vaultBranching: VaultBranching;
|
|
93
|
+
/** Context engine — entity extraction, knowledge retrieval, confidence scoring. */
|
|
94
|
+
contextEngine: ContextEngine;
|
|
95
|
+
/** Agency manager — proactive file watching, pattern surfacing, warning detection. */
|
|
96
|
+
agencyManager: AgencyManager;
|
|
97
|
+
/** Knowledge review — team review workflows (submit/approve/reject). */
|
|
98
|
+
knowledgeReview: KnowledgeReview;
|
|
64
99
|
/** Timestamp (ms since epoch) when this runtime was created. */
|
|
65
100
|
createdAt: number;
|
|
66
101
|
/** Close the vault database connection. Call on shutdown. */
|