@dexto/core 1.4.0 → 1.5.1
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/README.md +36 -0
- package/dist/agent/DextoAgent.cjs +22 -3
- package/dist/agent/DextoAgent.d.ts +19 -2
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +23 -4
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +5 -1
- package/dist/agent/schemas.cjs +90 -71
- package/dist/agent/schemas.d.ts +5959 -96
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +87 -66
- package/dist/approval/manager.cjs +165 -1
- package/dist/approval/manager.d.ts +91 -2
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +155 -1
- package/dist/approval/schemas.cjs +39 -3
- package/dist/approval/schemas.d.ts +238 -1
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +35 -3
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +26 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -0
- package/dist/context/compaction/factory.cjs +57 -0
- package/dist/context/compaction/factory.d.ts +17 -0
- package/dist/context/compaction/factory.d.ts.map +1 -0
- package/dist/context/compaction/factory.js +34 -0
- package/dist/context/compaction/index.cjs +49 -0
- package/dist/context/compaction/index.d.ts +11 -0
- package/dist/context/compaction/index.d.ts.map +1 -0
- package/dist/context/compaction/index.js +19 -0
- package/dist/context/{compression → compaction}/overflow.cjs +3 -3
- package/dist/context/{compression → compaction}/overflow.d.ts +4 -4
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction}/overflow.js +2 -2
- package/dist/context/compaction/provider.cjs +16 -0
- package/dist/context/compaction/provider.d.ts +48 -0
- package/dist/context/compaction/provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.cjs +48 -0
- package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
- package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.js +24 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
- package/dist/context/compaction/registry.cjs +39 -0
- package/dist/context/compaction/registry.d.ts +19 -0
- package/dist/context/compaction/registry.d.ts.map +1 -0
- package/dist/context/compaction/registry.js +16 -0
- package/dist/context/compaction/schemas.cjs +38 -0
- package/dist/context/compaction/schemas.d.ts +24 -0
- package/dist/context/compaction/schemas.d.ts.map +1 -0
- package/dist/context/compaction/schemas.js +14 -0
- package/dist/context/compaction/strategies/noop.cjs +36 -0
- package/dist/context/compaction/strategies/noop.d.ts +18 -0
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
- package/dist/context/compaction/strategies/noop.js +13 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.cjs +3 -3
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.d.ts +6 -6
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.js +4 -4
- package/dist/context/{compression → compaction}/types.d.ts +4 -4
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/compaction/types.js +0 -0
- package/dist/context/error-codes.cjs +4 -0
- package/dist/context/error-codes.d.ts +4 -0
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +4 -0
- package/dist/context/errors.cjs +40 -0
- package/dist/context/errors.d.ts +14 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +40 -0
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/types.d.ts +6 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +27 -7
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +27 -7
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +2 -3
- package/dist/events/index.cjs +6 -3
- package/dist/events/index.d.ts +35 -19
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +5 -3
- package/dist/filesystem/filesystem-service.cjs +39 -0
- package/dist/filesystem/filesystem-service.d.ts +32 -0
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +39 -0
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/path-validator.cjs +69 -1
- package/dist/filesystem/path-validator.d.ts +43 -2
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +69 -1
- package/dist/image/define-image.cjs +146 -0
- package/dist/image/define-image.d.ts +71 -0
- package/dist/image/define-image.d.ts.map +1 -0
- package/dist/image/define-image.js +121 -0
- package/dist/image/index.cjs +32 -0
- package/dist/image/index.d.ts +53 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +7 -0
- package/dist/image/types.cjs +16 -0
- package/dist/image/types.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/llm/error-codes.cjs +1 -0
- package/dist/llm/error-codes.d.ts +1 -0
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +1 -0
- package/dist/llm/errors.cjs +24 -0
- package/dist/llm/errors.d.ts +19 -6
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +24 -0
- package/dist/llm/executor/provider-options.cjs +87 -0
- package/dist/llm/executor/provider-options.d.ts +49 -0
- package/dist/llm/executor/provider-options.d.ts.map +1 -0
- package/dist/llm/executor/provider-options.js +63 -0
- package/dist/llm/executor/stream-processor.cjs +22 -11
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +22 -11
- package/dist/llm/executor/turn-executor.cjs +60 -23
- package/dist/llm/executor/turn-executor.d.ts +7 -5
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +60 -23
- package/dist/llm/formatters/vercel.cjs +15 -3
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +15 -3
- package/dist/llm/index.cjs +18 -1
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +14 -0
- package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
- package/dist/llm/providers/local/downloader.cjs +291 -0
- package/dist/llm/providers/local/downloader.d.ts +82 -0
- package/dist/llm/providers/local/downloader.d.ts.map +1 -0
- package/dist/llm/providers/local/downloader.js +251 -0
- package/dist/llm/providers/local/error-codes.cjs +57 -0
- package/dist/llm/providers/local/error-codes.d.ts +66 -0
- package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
- package/dist/llm/providers/local/error-codes.js +34 -0
- package/dist/llm/providers/local/errors.cjs +240 -0
- package/dist/llm/providers/local/errors.d.ts +31 -0
- package/dist/llm/providers/local/errors.d.ts.map +1 -0
- package/dist/llm/providers/local/errors.js +217 -0
- package/dist/llm/providers/local/gpu-detector.cjs +214 -0
- package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
- package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
- package/dist/llm/providers/local/gpu-detector.js +178 -0
- package/dist/llm/providers/local/index.cjs +147 -0
- package/dist/llm/providers/local/index.d.ts +21 -0
- package/dist/llm/providers/local/index.d.ts.map +1 -0
- package/dist/llm/providers/local/index.js +126 -0
- package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/node-llama-provider.js +176 -0
- package/dist/llm/providers/local/ollama-provider.cjs +230 -0
- package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
- package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/ollama-provider.js +198 -0
- package/dist/llm/providers/local/registry.cjs +343 -0
- package/dist/llm/providers/local/registry.d.ts +51 -0
- package/dist/llm/providers/local/registry.d.ts.map +1 -0
- package/dist/llm/providers/local/registry.js +312 -0
- package/dist/llm/providers/local/schemas.cjs +169 -0
- package/dist/llm/providers/local/schemas.d.ts +395 -0
- package/dist/llm/providers/local/schemas.d.ts.map +1 -0
- package/dist/llm/providers/local/schemas.js +133 -0
- package/dist/llm/providers/local/types.cjs +16 -0
- package/dist/llm/providers/local/types.d.ts +219 -0
- package/dist/llm/providers/local/types.d.ts.map +1 -0
- package/dist/llm/providers/local/types.js +0 -0
- package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
- package/dist/llm/providers/openrouter-model-registry.js +309 -0
- package/dist/llm/registry.cjs +604 -9
- package/dist/llm/registry.d.ts +35 -0
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +600 -9
- package/dist/llm/resolver.cjs +63 -5
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -6
- package/dist/llm/schemas.cjs +107 -81
- package/dist/llm/schemas.d.ts +181 -22
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +107 -81
- package/dist/llm/services/factory.cjs +87 -13
- package/dist/llm/services/factory.d.ts +4 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +85 -12
- package/dist/llm/services/test-utils.integration.cjs +22 -2
- package/dist/llm/services/test-utils.integration.d.ts +7 -1
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +26 -3
- package/dist/llm/services/vercel.cjs +8 -3
- package/dist/llm/services/vercel.d.ts +3 -2
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +8 -3
- package/dist/llm/types.cjs +11 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +11 -1
- package/dist/logger/logger.cjs +7 -3
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +7 -3
- package/dist/mcp/manager.cjs +8 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +8 -0
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +0 -3
- package/dist/memory/schemas.d.ts +3 -3
- package/dist/plugins/error-codes.cjs +3 -0
- package/dist/plugins/error-codes.d.ts +7 -1
- package/dist/plugins/error-codes.d.ts.map +1 -1
- package/dist/plugins/error-codes.js +3 -0
- package/dist/plugins/index.cjs +7 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +6 -1
- package/dist/plugins/manager.cjs +92 -7
- package/dist/plugins/manager.d.ts +10 -3
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +92 -7
- package/dist/plugins/registry.cjs +63 -0
- package/dist/plugins/registry.d.ts +101 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +39 -0
- package/dist/plugins/schemas.cjs +17 -5
- package/dist/plugins/schemas.d.ts +62 -5
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +15 -4
- package/dist/providers/base-registry.cjs +147 -0
- package/dist/providers/base-registry.d.ts +147 -0
- package/dist/providers/base-registry.d.ts.map +1 -0
- package/dist/providers/base-registry.js +123 -0
- package/dist/providers/discovery.cjs +109 -0
- package/dist/providers/discovery.d.ts +96 -0
- package/dist/providers/discovery.d.ts.map +1 -0
- package/dist/providers/discovery.js +84 -0
- package/dist/providers/index.cjs +24 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +3 -3
- package/dist/session/chat-session.cjs +20 -3
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +21 -4
- package/dist/session/history/database.cjs +49 -15
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +49 -15
- package/dist/session/session-manager.cjs +2 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +2 -1
- package/dist/storage/blob/factory.cjs +8 -11
- package/dist/storage/blob/factory.d.ts +32 -6
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +8 -11
- package/dist/storage/blob/index.cjs +56 -0
- package/dist/storage/blob/index.d.ts +45 -0
- package/dist/storage/blob/index.d.ts.map +1 -0
- package/dist/storage/blob/index.js +30 -0
- package/dist/storage/blob/provider.cjs +16 -0
- package/dist/storage/blob/provider.d.ts +50 -0
- package/dist/storage/blob/provider.d.ts.map +1 -0
- package/dist/storage/blob/provider.js +0 -0
- package/dist/storage/blob/providers/index.cjs +31 -0
- package/dist/storage/blob/providers/index.d.ts +8 -0
- package/dist/storage/blob/providers/index.d.ts.map +1 -0
- package/dist/storage/blob/providers/index.js +7 -0
- package/dist/storage/blob/providers/local.cjs +39 -0
- package/dist/storage/blob/providers/local.d.ts +17 -0
- package/dist/storage/blob/providers/local.d.ts.map +1 -0
- package/dist/storage/blob/providers/local.js +16 -0
- package/dist/storage/blob/providers/memory.cjs +39 -0
- package/dist/storage/blob/providers/memory.d.ts +17 -0
- package/dist/storage/blob/providers/memory.d.ts.map +1 -0
- package/dist/storage/blob/providers/memory.js +16 -0
- package/dist/storage/blob/registry.cjs +50 -0
- package/dist/storage/blob/registry.d.ts +42 -0
- package/dist/storage/blob/registry.d.ts.map +1 -0
- package/dist/storage/blob/registry.js +26 -0
- package/dist/storage/blob/schemas.cjs +9 -12
- package/dist/storage/blob/schemas.d.ts +39 -34
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +6 -11
- package/dist/storage/cache/factory.cjs +8 -36
- package/dist/storage/cache/factory.d.ts +32 -7
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +8 -26
- package/dist/storage/cache/index.cjs +53 -0
- package/dist/storage/cache/index.d.ts +44 -0
- package/dist/storage/cache/index.d.ts.map +1 -0
- package/dist/storage/cache/index.js +28 -0
- package/dist/storage/cache/provider.cjs +16 -0
- package/dist/storage/cache/provider.d.ts +56 -0
- package/dist/storage/cache/provider.d.ts.map +1 -0
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.cjs +31 -0
- package/dist/storage/cache/providers/index.d.ts +8 -0
- package/dist/storage/cache/providers/index.d.ts.map +1 -0
- package/dist/storage/cache/providers/index.js +7 -0
- package/dist/storage/cache/providers/memory.cjs +40 -0
- package/dist/storage/cache/providers/memory.d.ts +17 -0
- package/dist/storage/cache/providers/memory.d.ts.map +1 -0
- package/dist/storage/cache/providers/memory.js +17 -0
- package/dist/storage/cache/providers/redis.cjs +66 -0
- package/dist/storage/cache/providers/redis.d.ts +20 -0
- package/dist/storage/cache/providers/redis.d.ts.map +1 -0
- package/dist/storage/cache/providers/redis.js +33 -0
- package/dist/storage/cache/registry.cjs +50 -0
- package/dist/storage/cache/registry.d.ts +42 -0
- package/dist/storage/cache/registry.d.ts.map +1 -0
- package/dist/storage/cache/registry.js +26 -0
- package/dist/storage/cache/schemas.cjs +6 -2
- package/dist/storage/cache/schemas.d.ts +2 -3
- package/dist/storage/cache/schemas.d.ts.map +1 -1
- package/dist/storage/cache/schemas.js +3 -1
- package/dist/storage/database/factory.cjs +8 -47
- package/dist/storage/database/factory.d.ts +34 -8
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +8 -37
- package/dist/storage/database/index.cjs +58 -0
- package/dist/storage/database/index.d.ts +45 -0
- package/dist/storage/database/index.d.ts.map +1 -0
- package/dist/storage/database/index.js +37 -0
- package/dist/storage/database/postgres-store.cjs +174 -78
- package/dist/storage/database/postgres-store.d.ts +19 -0
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +174 -78
- package/dist/storage/database/provider.cjs +16 -0
- package/dist/storage/database/provider.d.ts +56 -0
- package/dist/storage/database/provider.d.ts.map +1 -0
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +34 -0
- package/dist/storage/database/providers/index.d.ts +9 -0
- package/dist/storage/database/providers/index.d.ts.map +1 -0
- package/dist/storage/database/providers/index.js +9 -0
- package/dist/storage/database/providers/memory.cjs +40 -0
- package/dist/storage/database/providers/memory.d.ts +16 -0
- package/dist/storage/database/providers/memory.d.ts.map +1 -0
- package/dist/storage/database/providers/memory.js +17 -0
- package/dist/storage/database/providers/postgres.cjs +62 -0
- package/dist/storage/database/providers/postgres.d.ts +19 -0
- package/dist/storage/database/providers/postgres.d.ts.map +1 -0
- package/dist/storage/database/providers/postgres.js +29 -0
- package/dist/storage/database/providers/sqlite.cjs +66 -0
- package/dist/storage/database/providers/sqlite.d.ts +20 -0
- package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
- package/dist/storage/database/providers/sqlite.js +33 -0
- package/dist/storage/database/registry.cjs +50 -0
- package/dist/storage/database/registry.d.ts +42 -0
- package/dist/storage/database/registry.d.ts.map +1 -0
- package/dist/storage/database/registry.js +26 -0
- package/dist/storage/database/schemas.cjs +12 -3
- package/dist/storage/database/schemas.d.ts +11 -4
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +8 -2
- package/dist/storage/error-codes.cjs +6 -0
- package/dist/storage/error-codes.d.ts +7 -1
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +6 -0
- package/dist/storage/errors.cjs +80 -0
- package/dist/storage/errors.d.ts +24 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +80 -0
- package/dist/storage/index.cjs +47 -4
- package/dist/storage/index.d.ts +34 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +32 -3
- package/dist/storage/schemas.cjs +4 -0
- package/dist/storage/schemas.d.ts +24 -50
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +5 -1
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +3 -3
- package/dist/systemPrompt/in-built-prompts.cjs +7 -6
- package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +6 -5
- package/dist/systemPrompt/registry.cjs +2 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +2 -2
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +13 -13
- package/dist/systemPrompt/schemas.js +2 -2
- package/dist/tools/custom-tool-registry.cjs +64 -0
- package/dist/tools/custom-tool-registry.d.ts +126 -0
- package/dist/tools/custom-tool-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-registry.js +40 -0
- package/dist/tools/custom-tool-schema-registry.cjs +164 -0
- package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
- package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-schema-registry.js +140 -0
- package/dist/tools/error-codes.cjs +3 -0
- package/dist/tools/error-codes.d.ts +4 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +3 -0
- package/dist/tools/errors.cjs +41 -0
- package/dist/tools/errors.d.ts +17 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +41 -0
- package/dist/tools/index.cjs +13 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +11 -1
- package/dist/tools/internal-tools/constants.cjs +3 -9
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +3 -9
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
- package/dist/tools/internal-tools/provider.cjs +153 -23
- package/dist/tools/internal-tools/provider.d.ts +55 -10
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +153 -23
- package/dist/tools/internal-tools/registry.cjs +18 -43
- package/dist/tools/internal-tools/registry.d.ts +4 -4
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +18 -43
- package/dist/tools/schemas.cjs +20 -0
- package/dist/tools/schemas.d.ts +43 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +16 -0
- package/dist/tools/tool-manager.cjs +140 -13
- package/dist/tools/tool-manager.d.ts +22 -3
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +140 -13
- package/dist/tools/types.d.ts +43 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +19 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/redactor.cjs +18 -3
- package/dist/utils/redactor.d.ts +0 -7
- package/dist/utils/redactor.d.ts.map +1 -1
- package/dist/utils/redactor.js +18 -3
- package/dist/utils/service-initializer.cjs +9 -35
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +9 -35
- package/package.json +5 -2
- package/dist/context/compression/overflow.d.ts.map +0 -1
- package/dist/context/compression/reactive-overflow.d.ts.map +0 -1
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -130
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -97
- package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
- package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -127
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -104
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -70
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -47
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -86
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -63
- package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
- package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -63
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -40
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -124
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -103
- package/dist/utils/env-file.cjs +0 -118
- package/dist/utils/env-file.d.ts +0 -5
- package/dist/utils/env-file.d.ts.map +0 -1
- package/dist/utils/env-file.js +0 -85
- /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
- /package/dist/context/{compression → compaction}/types.cjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","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iBAAiB,CAAC,QAAQ,EAAE,GAAG;IAkB/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAUpC,UAAU,CAAC,MAAM,EAAE,GAAG;IA4EtB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAatB,cAAc,IAAI,MAAM,GAAG,IAAI;IAK/B,QAAQ,IAAI,MAAM;IAKlB,kBAAkB,CAAC,IAAI,EAAE;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACtD,iBAAiB,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAC9C,SAAS,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;IAyDD,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAkB9C;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
package/dist/logger/logger.js
CHANGED
|
@@ -342,9 +342,13 @@ ${chalk.white(JSON.stringify(args, null, 2))}`,
|
|
|
342
342
|
console.log(`\u{1F4AC} ${chalk.bold("Session:")} ${chalk.blue(info.sessionId)}`);
|
|
343
343
|
}
|
|
344
344
|
if (info.logLevel && info.logFile) {
|
|
345
|
-
|
|
346
|
-
`\u{1F4CB} ${chalk.bold("Log Level:")} ${chalk.cyan(info.logLevel)}
|
|
347
|
-
|
|
345
|
+
if (process.env.DEXTO_PRIVACY_MODE === "true") {
|
|
346
|
+
console.log(`\u{1F4CB} ${chalk.bold("Log Level:")} ${chalk.cyan(info.logLevel)}`);
|
|
347
|
+
} else {
|
|
348
|
+
console.log(
|
|
349
|
+
`\u{1F4CB} ${chalk.bold("Log Level:")} ${chalk.cyan(info.logLevel)} ${chalk.dim(`(file: ${info.logFile})`)}`
|
|
350
|
+
);
|
|
351
|
+
}
|
|
348
352
|
}
|
|
349
353
|
}
|
|
350
354
|
displayError(message, error) {
|
package/dist/mcp/manager.cjs
CHANGED
|
@@ -335,6 +335,14 @@ class MCPManager {
|
|
|
335
335
|
this.logger.silly(`MCP tools: ${JSON.stringify(allTools, null, 2)}`);
|
|
336
336
|
return allTools;
|
|
337
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Get all MCP tools with their server metadata.
|
|
340
|
+
* This returns the internal tool cache entries which include server names.
|
|
341
|
+
* @returns Map of tool names to their cache entries (includes serverName, client, and definition)
|
|
342
|
+
*/
|
|
343
|
+
getAllToolsWithServerInfo() {
|
|
344
|
+
return new Map(this.toolCache);
|
|
345
|
+
}
|
|
338
346
|
/**
|
|
339
347
|
* Parse a qualified tool name to extract server name and actual tool name.
|
|
340
348
|
* Uses distinctive delimiter to avoid ambiguity and splits on last occurrence.
|
package/dist/mcp/manager.d.ts
CHANGED
|
@@ -4,7 +4,17 @@ import { GetPromptResult, ReadResourceResult } from '@modelcontextprotocol/sdk/t
|
|
|
4
4
|
import { IMCPClient, MCPResolvedResource } from './types.js';
|
|
5
5
|
import { ToolSet } from '../tools/types.js';
|
|
6
6
|
import type { PromptDefinition } from '../prompts/types.js';
|
|
7
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
7
8
|
import type { ApprovalManager } from '../approval/manager.js';
|
|
9
|
+
type ToolCacheEntry = {
|
|
10
|
+
serverName: string;
|
|
11
|
+
client: IMCPClient;
|
|
12
|
+
definition: {
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
parameters: JSONSchema7;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
8
18
|
export declare class MCPManager {
|
|
9
19
|
private clients;
|
|
10
20
|
private connectionErrors;
|
|
@@ -93,6 +103,12 @@ export declare class MCPManager {
|
|
|
93
103
|
* @returns Promise resolving to a ToolSet mapping tool names to Tool definitions
|
|
94
104
|
*/
|
|
95
105
|
getAllTools(): Promise<ToolSet>;
|
|
106
|
+
/**
|
|
107
|
+
* Get all MCP tools with their server metadata.
|
|
108
|
+
* This returns the internal tool cache entries which include server names.
|
|
109
|
+
* @returns Map of tool names to their cache entries (includes serverName, client, and definition)
|
|
110
|
+
*/
|
|
111
|
+
getAllToolsWithServerInfo(): Map<string, ToolCacheEntry>;
|
|
96
112
|
/**
|
|
97
113
|
* Parse a qualified tool name to extract server name and actual tool name.
|
|
98
114
|
* Uses distinctive delimiter to avoid ambiguity and splits on last occurrence.
|
|
@@ -228,4 +244,5 @@ export declare class MCPManager {
|
|
|
228
244
|
*/
|
|
229
245
|
private handleToolsListChanged;
|
|
230
246
|
}
|
|
247
|
+
export {};
|
|
231
248
|
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/mcp/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAU,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAsB,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/mcp/manager.ts"],"names":[],"mappings":"AACA,OAAO,EA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G,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQxD;;OAEG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIzC;;OAEG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAUjE;;;;OAIG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQpE;;;;OAIG;IACG,oBAAoB,CAAC,aAAa,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwDhF;;;;;;OAMG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgClF;;;OAGG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAIrC;;;OAGG;IACH,oBAAoB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAIjD;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAc9B;;;OAGG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B/C;;;;OAIG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+DhD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBpC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA4BhC;;OAEG;YACW,qBAAqB;IAuCnC;;OAEG;YACW,wBAAwB;IAkDtC;;OAEG;YACW,sBAAsB;CA4HvC"}
|
package/dist/mcp/manager.js
CHANGED
|
@@ -313,6 +313,14 @@ class MCPManager {
|
|
|
313
313
|
this.logger.silly(`MCP tools: ${JSON.stringify(allTools, null, 2)}`);
|
|
314
314
|
return allTools;
|
|
315
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* Get all MCP tools with their server metadata.
|
|
318
|
+
* This returns the internal tool cache entries which include server names.
|
|
319
|
+
* @returns Map of tool names to their cache entries (includes serverName, client, and definition)
|
|
320
|
+
*/
|
|
321
|
+
getAllToolsWithServerInfo() {
|
|
322
|
+
return new Map(this.toolCache);
|
|
323
|
+
}
|
|
316
324
|
/**
|
|
317
325
|
* Parse a qualified tool name to extract server name and actual tool name.
|
|
318
326
|
* Uses distinctive delimiter to avoid ambiguity and splits on last occurrence.
|
package/dist/mcp/mcp-client.cjs
CHANGED
|
@@ -114,7 +114,6 @@ class MCPClient extends import_events.EventEmitter {
|
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
capabilities: {
|
|
117
|
-
tools: {},
|
|
118
117
|
elicitation: {}
|
|
119
118
|
// Enable elicitation capability
|
|
120
119
|
}
|
|
@@ -154,7 +153,6 @@ class MCPClient extends import_events.EventEmitter {
|
|
|
154
153
|
},
|
|
155
154
|
{
|
|
156
155
|
capabilities: {
|
|
157
|
-
tools: {},
|
|
158
156
|
elicitation: {}
|
|
159
157
|
// Enable elicitation capability
|
|
160
158
|
}
|
|
@@ -193,7 +191,6 @@ class MCPClient extends import_events.EventEmitter {
|
|
|
193
191
|
{ name: "Dexto-http-mcp-client", version: "1.0.0" },
|
|
194
192
|
{
|
|
195
193
|
capabilities: {
|
|
196
|
-
tools: {},
|
|
197
194
|
elicitation: {}
|
|
198
195
|
// Enable elicitation capability
|
|
199
196
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAInE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,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CjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAK7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAKhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;OAEG;IACH,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IAQ1D;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAoGlC"}
|
package/dist/mcp/mcp-client.js
CHANGED
|
@@ -96,7 +96,6 @@ class MCPClient extends EventEmitter {
|
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
capabilities: {
|
|
99
|
-
tools: {},
|
|
100
99
|
elicitation: {}
|
|
101
100
|
// Enable elicitation capability
|
|
102
101
|
}
|
|
@@ -136,7 +135,6 @@ class MCPClient extends EventEmitter {
|
|
|
136
135
|
},
|
|
137
136
|
{
|
|
138
137
|
capabilities: {
|
|
139
|
-
tools: {},
|
|
140
138
|
elicitation: {}
|
|
141
139
|
// Enable elicitation capability
|
|
142
140
|
}
|
|
@@ -175,7 +173,6 @@ class MCPClient extends EventEmitter {
|
|
|
175
173
|
{ name: "Dexto-http-mcp-client", version: "1.0.0" },
|
|
176
174
|
{
|
|
177
175
|
capabilities: {
|
|
178
|
-
tools: {},
|
|
179
176
|
elicitation: {}
|
|
180
177
|
// Enable elicitation capability
|
|
181
178
|
}
|
package/dist/memory/schemas.d.ts
CHANGED
|
@@ -28,8 +28,8 @@ export declare const MemorySchema: z.ZodObject<{
|
|
|
28
28
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
29
29
|
}, "strict", z.ZodTypeAny, {
|
|
30
30
|
content: string;
|
|
31
|
-
id: string;
|
|
32
31
|
createdAt: number;
|
|
32
|
+
id: string;
|
|
33
33
|
updatedAt: number;
|
|
34
34
|
metadata?: z.objectOutputType<{
|
|
35
35
|
source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
|
|
@@ -38,8 +38,8 @@ export declare const MemorySchema: z.ZodObject<{
|
|
|
38
38
|
tags?: string[] | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
content: string;
|
|
41
|
-
id: string;
|
|
42
41
|
createdAt: number;
|
|
42
|
+
id: string;
|
|
43
43
|
updatedAt: number;
|
|
44
44
|
metadata?: z.objectInputType<{
|
|
45
45
|
source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
|
|
@@ -143,8 +143,8 @@ export declare const MemoriesConfigSchema: z.ZodObject<{
|
|
|
143
143
|
limit?: number | undefined;
|
|
144
144
|
}, {
|
|
145
145
|
enabled?: boolean | undefined;
|
|
146
|
-
limit?: number | undefined;
|
|
147
146
|
priority?: number | undefined;
|
|
147
|
+
limit?: number | undefined;
|
|
148
148
|
includeTimestamps?: boolean | undefined;
|
|
149
149
|
includeTags?: boolean | undefined;
|
|
150
150
|
pinnedOnly?: boolean | undefined;
|
|
@@ -32,6 +32,9 @@ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
|
|
|
32
32
|
PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
|
|
33
33
|
PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
|
|
34
34
|
PluginErrorCode2["PLUGIN_DEPENDENCY_NOT_INSTALLED"] = "PLUGIN_DEPENDENCY_NOT_INSTALLED";
|
|
35
|
+
PluginErrorCode2["PLUGIN_PROVIDER_ALREADY_REGISTERED"] = "PLUGIN_PROVIDER_ALREADY_REGISTERED";
|
|
36
|
+
PluginErrorCode2["PLUGIN_PROVIDER_NOT_FOUND"] = "PLUGIN_PROVIDER_NOT_FOUND";
|
|
37
|
+
PluginErrorCode2["PLUGIN_PROVIDER_VALIDATION_FAILED"] = "PLUGIN_PROVIDER_VALIDATION_FAILED";
|
|
35
38
|
return PluginErrorCode2;
|
|
36
39
|
})(PluginErrorCode || {});
|
|
37
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -22,7 +22,13 @@ export declare enum PluginErrorCode {
|
|
|
22
22
|
/** Duplicate plugin priority */
|
|
23
23
|
PLUGIN_DUPLICATE_PRIORITY = "PLUGIN_DUPLICATE_PRIORITY",
|
|
24
24
|
/** Required dependency not installed for plugin loading */
|
|
25
|
-
PLUGIN_DEPENDENCY_NOT_INSTALLED = "PLUGIN_DEPENDENCY_NOT_INSTALLED"
|
|
25
|
+
PLUGIN_DEPENDENCY_NOT_INSTALLED = "PLUGIN_DEPENDENCY_NOT_INSTALLED",
|
|
26
|
+
/** Plugin provider already registered in registry */
|
|
27
|
+
PLUGIN_PROVIDER_ALREADY_REGISTERED = "PLUGIN_PROVIDER_ALREADY_REGISTERED",
|
|
28
|
+
/** Plugin provider not found in registry */
|
|
29
|
+
PLUGIN_PROVIDER_NOT_FOUND = "PLUGIN_PROVIDER_NOT_FOUND",
|
|
30
|
+
/** Plugin provider configuration validation failed */
|
|
31
|
+
PLUGIN_PROVIDER_VALIDATION_FAILED = "PLUGIN_PROVIDER_VALIDATION_FAILED"
|
|
26
32
|
}
|
|
27
33
|
export type { PluginErrorCode as default };
|
|
28
34
|
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/plugins/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACvB,gDAAgD;IAChD,kBAAkB,uBAAuB;IAEzC,mDAAmD;IACnD,oBAAoB,yBAAyB;IAE7C,wCAAwC;IACxC,2BAA2B,gCAAgC;IAE3D,mCAAmC;IACnC,4BAA4B,iCAAiC;IAE7D,sCAAsC;IACtC,4BAA4B,iCAAiC;IAE7D,8BAA8B;IAC9B,uBAAuB,4BAA4B;IAEnD,iCAAiC;IACjC,wBAAwB,6BAA6B;IAErD,+BAA+B;IAC/B,wBAAwB,6BAA6B;IAErD,gCAAgC;IAChC,yBAAyB,8BAA8B;IAEvD,2DAA2D;IAC3D,+BAA+B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/plugins/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACvB,gDAAgD;IAChD,kBAAkB,uBAAuB;IAEzC,mDAAmD;IACnD,oBAAoB,yBAAyB;IAE7C,wCAAwC;IACxC,2BAA2B,gCAAgC;IAE3D,mCAAmC;IACnC,4BAA4B,iCAAiC;IAE7D,sCAAsC;IACtC,4BAA4B,iCAAiC;IAE7D,8BAA8B;IAC9B,uBAAuB,4BAA4B;IAEnD,iCAAiC;IACjC,wBAAwB,6BAA6B;IAErD,+BAA+B;IAC/B,wBAAwB,6BAA6B;IAErD,gCAAgC;IAChC,yBAAyB,8BAA8B;IAEvD,2DAA2D;IAC3D,+BAA+B,oCAAoC;IAEnE,qDAAqD;IACrD,kCAAkC,uCAAuC;IAEzE,4CAA4C;IAC5C,yBAAyB,8BAA8B;IAEvD,sDAAsD;IACtD,iCAAiC,sCAAsC;CAC1E;AAED,YAAY,EAAE,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -10,6 +10,9 @@ var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
|
|
|
10
10
|
PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
|
|
11
11
|
PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
|
|
12
12
|
PluginErrorCode2["PLUGIN_DEPENDENCY_NOT_INSTALLED"] = "PLUGIN_DEPENDENCY_NOT_INSTALLED";
|
|
13
|
+
PluginErrorCode2["PLUGIN_PROVIDER_ALREADY_REGISTERED"] = "PLUGIN_PROVIDER_ALREADY_REGISTERED";
|
|
14
|
+
PluginErrorCode2["PLUGIN_PROVIDER_NOT_FOUND"] = "PLUGIN_PROVIDER_NOT_FOUND";
|
|
15
|
+
PluginErrorCode2["PLUGIN_PROVIDER_VALIDATION_FAILED"] = "PLUGIN_PROVIDER_VALIDATION_FAILED";
|
|
13
16
|
return PluginErrorCode2;
|
|
14
17
|
})(PluginErrorCode || {});
|
|
15
18
|
export {
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -23,9 +23,12 @@ __export(plugins_exports, {
|
|
|
23
23
|
CustomPluginConfigSchema: () => import_schemas.CustomPluginConfigSchema,
|
|
24
24
|
PluginErrorCode: () => import_error_codes.PluginErrorCode,
|
|
25
25
|
PluginManager: () => import_manager.PluginManager,
|
|
26
|
+
PluginRegistry: () => import_registry.PluginRegistry,
|
|
26
27
|
PluginsConfigSchema: () => import_schemas.PluginsConfigSchema,
|
|
28
|
+
RegistryPluginConfigSchema: () => import_schemas.RegistryPluginConfigSchema,
|
|
27
29
|
ResponseSanitizerPlugin: () => import_response_sanitizer.ResponseSanitizerPlugin,
|
|
28
30
|
loadPluginModule: () => import_loader.loadPluginModule,
|
|
31
|
+
pluginRegistry: () => import_registry.pluginRegistry,
|
|
29
32
|
registerBuiltInPlugins: () => import_builtins.registerBuiltInPlugins,
|
|
30
33
|
resolvePluginPath: () => import_loader.resolvePluginPath,
|
|
31
34
|
validatePluginShape: () => import_loader.validatePluginShape
|
|
@@ -33,6 +36,7 @@ __export(plugins_exports, {
|
|
|
33
36
|
module.exports = __toCommonJS(plugins_exports);
|
|
34
37
|
var import_manager = require("./manager.js");
|
|
35
38
|
var import_schemas = require("./schemas.js");
|
|
39
|
+
var import_registry = require("./registry.js");
|
|
36
40
|
var import_error_codes = require("./error-codes.js");
|
|
37
41
|
var import_loader = require("./loader.js");
|
|
38
42
|
var import_builtins = require("./registrations/builtins.js");
|
|
@@ -45,9 +49,12 @@ var import_response_sanitizer = require("./builtins/response-sanitizer.js");
|
|
|
45
49
|
CustomPluginConfigSchema,
|
|
46
50
|
PluginErrorCode,
|
|
47
51
|
PluginManager,
|
|
52
|
+
PluginRegistry,
|
|
48
53
|
PluginsConfigSchema,
|
|
54
|
+
RegistryPluginConfigSchema,
|
|
49
55
|
ResponseSanitizerPlugin,
|
|
50
56
|
loadPluginModule,
|
|
57
|
+
pluginRegistry,
|
|
51
58
|
registerBuiltInPlugins,
|
|
52
59
|
resolvePluginPath,
|
|
53
60
|
validatePluginShape
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
export type { DextoPlugin, PluginConfig, PluginExecutionContext, PluginResult, PluginNotice, ExtensionPoint, BeforeLLMRequestPayload, BeforeToolCallPayload, AfterToolResultPayload, BeforeResponsePayload, } from './types.js';
|
|
8
8
|
export { PluginManager } from './manager.js';
|
|
9
9
|
export type { PluginManagerOptions, ExecutionContextOptions } from './manager.js';
|
|
10
|
-
export { CustomPluginConfigSchema, BuiltInPluginConfigSchema, PluginsConfigSchema, } from './schemas.js';
|
|
11
|
-
export type { PluginsConfig, ValidatedPluginsConfig } from './schemas.js';
|
|
10
|
+
export { CustomPluginConfigSchema, BuiltInPluginConfigSchema, PluginsConfigSchema, RegistryPluginConfigSchema, } from './schemas.js';
|
|
11
|
+
export type { PluginsConfig, ValidatedPluginsConfig, RegistryPluginConfig } from './schemas.js';
|
|
12
|
+
export { PluginRegistry, pluginRegistry } from './registry.js';
|
|
13
|
+
export type { PluginProvider, PluginCreationContext } from './registry.js';
|
|
12
14
|
export { PluginErrorCode } from './error-codes.js';
|
|
13
15
|
export { loadPluginModule, resolvePluginPath, validatePluginShape } from './loader.js';
|
|
14
16
|
export { registerBuiltInPlugins } from './registrations/builtins.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACR,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAA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-3,8 +3,10 @@ import { PluginManager } from "./manager.js";
|
|
|
3
3
|
import {
|
|
4
4
|
CustomPluginConfigSchema,
|
|
5
5
|
BuiltInPluginConfigSchema,
|
|
6
|
-
PluginsConfigSchema
|
|
6
|
+
PluginsConfigSchema,
|
|
7
|
+
RegistryPluginConfigSchema
|
|
7
8
|
} from "./schemas.js";
|
|
9
|
+
import { PluginRegistry, pluginRegistry } from "./registry.js";
|
|
8
10
|
import { PluginErrorCode } from "./error-codes.js";
|
|
9
11
|
import { loadPluginModule, resolvePluginPath, validatePluginShape } from "./loader.js";
|
|
10
12
|
import { registerBuiltInPlugins } from "./registrations/builtins.js";
|
|
@@ -16,9 +18,12 @@ export {
|
|
|
16
18
|
CustomPluginConfigSchema,
|
|
17
19
|
PluginErrorCode,
|
|
18
20
|
PluginManager,
|
|
21
|
+
PluginRegistry,
|
|
19
22
|
PluginsConfigSchema,
|
|
23
|
+
RegistryPluginConfigSchema,
|
|
20
24
|
ResponseSanitizerPlugin,
|
|
21
25
|
loadPluginModule,
|
|
26
|
+
pluginRegistry,
|
|
22
27
|
registerBuiltInPlugins,
|
|
23
28
|
resolvePluginPath,
|
|
24
29
|
validatePluginShape
|
package/dist/plugins/manager.cjs
CHANGED
|
@@ -25,6 +25,7 @@ var import_errors = require("../errors/index.js");
|
|
|
25
25
|
var import_error_codes = require("./error-codes.js");
|
|
26
26
|
var import_loader = require("./loader.js");
|
|
27
27
|
var import_async_context = require("../utils/async-context.js");
|
|
28
|
+
var import_registry = require("./registry.js");
|
|
28
29
|
var import_types = require("../logger/v2/types.js");
|
|
29
30
|
class PluginManager {
|
|
30
31
|
plugins = /* @__PURE__ */ new Map();
|
|
@@ -73,12 +74,18 @@ class PluginManager {
|
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
75
76
|
* Initialize all plugins from configuration
|
|
76
|
-
* Loads custom plugins
|
|
77
|
+
* Loads custom plugins (file-based), registry plugins (programmatic), validates priorities,
|
|
78
|
+
* sorts by priority, and calls initialize()
|
|
77
79
|
*
|
|
78
|
-
*
|
|
80
|
+
* TODO: Consider adding an MCP server-like convention for plugin discovery.
|
|
81
|
+
* Instead of requiring explicit file paths, plugins could be connected as
|
|
82
|
+
* plugin servers to the PluginManager.
|
|
83
|
+
*
|
|
84
|
+
* @param customPlugins - Array of custom plugin configurations from YAML (file-based)
|
|
85
|
+
* @param registryPlugins - Array of registry plugin configurations from YAML (programmatic)
|
|
79
86
|
* @throws {DextoRuntimeError} If any plugin fails to load or initialize (fail-fast)
|
|
80
87
|
*/
|
|
81
|
-
async initialize(customPlugins = []) {
|
|
88
|
+
async initialize(customPlugins = [], registryPlugins = []) {
|
|
82
89
|
if (this.initialized) {
|
|
83
90
|
throw new import_errors.DextoRuntimeError(
|
|
84
91
|
import_error_codes.PluginErrorCode.PLUGIN_CONFIGURATION_INVALID,
|
|
@@ -88,9 +95,19 @@ class PluginManager {
|
|
|
88
95
|
);
|
|
89
96
|
}
|
|
90
97
|
const priorities = /* @__PURE__ */ new Set();
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
const allPluginConfigs = [
|
|
99
|
+
...Array.from(this.plugins.values()).map((p) => p.config),
|
|
100
|
+
...customPlugins,
|
|
101
|
+
...registryPlugins.map((r) => ({
|
|
102
|
+
name: r.type,
|
|
103
|
+
module: `<registry:${r.type}>`,
|
|
104
|
+
enabled: r.enabled,
|
|
105
|
+
blocking: r.blocking,
|
|
106
|
+
priority: r.priority,
|
|
107
|
+
config: r.config
|
|
108
|
+
}))
|
|
109
|
+
];
|
|
110
|
+
for (const config of allPluginConfigs) {
|
|
94
111
|
if (!config.enabled) continue;
|
|
95
112
|
if (priorities.has(config.priority)) {
|
|
96
113
|
throw new import_errors.DextoRuntimeError(
|
|
@@ -100,12 +117,80 @@ class PluginManager {
|
|
|
100
117
|
`Duplicate plugin priority: ${config.priority}. Each plugin must have a unique priority.`,
|
|
101
118
|
{
|
|
102
119
|
priority: config.priority,
|
|
103
|
-
hint: "Ensure all enabled plugins (built-in and
|
|
120
|
+
hint: "Ensure all enabled plugins (built-in, custom, and registry) have unique priority values."
|
|
104
121
|
}
|
|
105
122
|
);
|
|
106
123
|
}
|
|
107
124
|
priorities.add(config.priority);
|
|
108
125
|
}
|
|
126
|
+
for (const registryConfig of registryPlugins) {
|
|
127
|
+
if (!registryConfig.enabled) {
|
|
128
|
+
this.logger.debug(`Skipping disabled registry plugin: ${registryConfig.type}`);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const provider = import_registry.pluginRegistry.get(registryConfig.type);
|
|
133
|
+
if (!provider) {
|
|
134
|
+
throw new import_errors.DextoRuntimeError(
|
|
135
|
+
import_error_codes.PluginErrorCode.PLUGIN_PROVIDER_NOT_FOUND,
|
|
136
|
+
import_errors.ErrorScope.PLUGIN,
|
|
137
|
+
import_errors.ErrorType.USER,
|
|
138
|
+
`Plugin provider '${registryConfig.type}' not found in registry`,
|
|
139
|
+
{
|
|
140
|
+
type: registryConfig.type,
|
|
141
|
+
available: import_registry.pluginRegistry.getTypes()
|
|
142
|
+
},
|
|
143
|
+
`Available plugin providers: ${import_registry.pluginRegistry.getTypes().join(", ") || "none"}. Register the provider using pluginRegistry.register() before agent initialization.`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
const validatedConfig = provider.configSchema.safeParse({
|
|
147
|
+
type: registryConfig.type,
|
|
148
|
+
...registryConfig.config
|
|
149
|
+
});
|
|
150
|
+
if (!validatedConfig.success) {
|
|
151
|
+
throw new import_errors.DextoRuntimeError(
|
|
152
|
+
import_error_codes.PluginErrorCode.PLUGIN_PROVIDER_VALIDATION_FAILED,
|
|
153
|
+
import_errors.ErrorScope.PLUGIN,
|
|
154
|
+
import_errors.ErrorType.USER,
|
|
155
|
+
`Invalid configuration for plugin provider '${registryConfig.type}'`,
|
|
156
|
+
{
|
|
157
|
+
type: registryConfig.type,
|
|
158
|
+
errors: validatedConfig.error.errors
|
|
159
|
+
},
|
|
160
|
+
"Check the configuration schema for this plugin provider"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
const creationContext = {
|
|
164
|
+
config: registryConfig.config || {},
|
|
165
|
+
blocking: registryConfig.blocking,
|
|
166
|
+
priority: registryConfig.priority
|
|
167
|
+
};
|
|
168
|
+
const plugin = provider.create(validatedConfig.data, creationContext);
|
|
169
|
+
const loadedPlugin = {
|
|
170
|
+
plugin,
|
|
171
|
+
config: {
|
|
172
|
+
name: registryConfig.type,
|
|
173
|
+
module: `<registry:${registryConfig.type}>`,
|
|
174
|
+
enabled: registryConfig.enabled,
|
|
175
|
+
blocking: registryConfig.blocking,
|
|
176
|
+
priority: registryConfig.priority,
|
|
177
|
+
config: registryConfig.config
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
this.plugins.set(registryConfig.type, loadedPlugin);
|
|
181
|
+
this.logger.info(`Registry plugin loaded: ${registryConfig.type}`);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
if (error instanceof import_errors.DextoRuntimeError) {
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
throw new import_errors.DextoRuntimeError(
|
|
187
|
+
import_error_codes.PluginErrorCode.PLUGIN_INITIALIZATION_FAILED,
|
|
188
|
+
import_errors.ErrorScope.PLUGIN,
|
|
189
|
+
import_errors.ErrorType.SYSTEM,
|
|
190
|
+
`Failed to load registry plugin '${registryConfig.type}': ${error instanceof Error ? error.message : String(error)}`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
109
194
|
for (const pluginConfig of customPlugins) {
|
|
110
195
|
if (!pluginConfig.enabled) {
|
|
111
196
|
this.logger.debug(`Skipping disabled plugin: ${pluginConfig.name}`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RegistryPluginConfig } from './schemas.js';
|
|
1
2
|
import type { ExtensionPoint, PluginConfig } from './types.js';
|
|
2
3
|
import type { AgentEventBus } from '../events/index.js';
|
|
3
4
|
import type { StorageManager } from '../storage/index.js';
|
|
@@ -56,12 +57,18 @@ export declare class PluginManager {
|
|
|
56
57
|
registerBuiltin(name: string, PluginClass: any, config: Omit<PluginConfig, 'module'>): void;
|
|
57
58
|
/**
|
|
58
59
|
* Initialize all plugins from configuration
|
|
59
|
-
* Loads custom plugins
|
|
60
|
+
* Loads custom plugins (file-based), registry plugins (programmatic), validates priorities,
|
|
61
|
+
* sorts by priority, and calls initialize()
|
|
60
62
|
*
|
|
61
|
-
*
|
|
63
|
+
* TODO: Consider adding an MCP server-like convention for plugin discovery.
|
|
64
|
+
* Instead of requiring explicit file paths, plugins could be connected as
|
|
65
|
+
* plugin servers to the PluginManager.
|
|
66
|
+
*
|
|
67
|
+
* @param customPlugins - Array of custom plugin configurations from YAML (file-based)
|
|
68
|
+
* @param registryPlugins - Array of registry plugin configurations from YAML (programmatic)
|
|
62
69
|
* @throws {DextoRuntimeError} If any plugin fails to load or initialize (fail-fast)
|
|
63
70
|
*/
|
|
64
|
-
initialize(customPlugins?: PluginConfig[]): Promise<void>;
|
|
71
|
+
initialize(customPlugins?: PluginConfig[], registryPlugins?: RegistryPluginConfig[]): Promise<void>;
|
|
65
72
|
/**
|
|
66
73
|
* Register a plugin to the extension points it implements
|
|
67
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/plugins/manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/plugins/manager.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EACR,cAAc,EAEd,YAAY,EAGf,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,q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;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAkBjC;;;;;;;;;OASG;IACG,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9C,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,CAAC,CAAC;IAoKb;;;OAGG;YACW,kBAAkB;IA8BhC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B;;OAEG;IACH,QAAQ,IAAI;QACR,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,gBAAgB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;KACpD;CAcJ"}
|
package/dist/plugins/manager.js
CHANGED
|
@@ -3,6 +3,7 @@ import { DextoRuntimeError, ErrorScope, ErrorType } from "../errors/index.js";
|
|
|
3
3
|
import { PluginErrorCode } from "./error-codes.js";
|
|
4
4
|
import { loadPluginModule, resolvePluginPath } from "./loader.js";
|
|
5
5
|
import { getContext } from "../utils/async-context.js";
|
|
6
|
+
import { pluginRegistry } from "./registry.js";
|
|
6
7
|
import { DextoLogComponent } from "../logger/v2/types.js";
|
|
7
8
|
class PluginManager {
|
|
8
9
|
plugins = /* @__PURE__ */ new Map();
|
|
@@ -51,12 +52,18 @@ class PluginManager {
|
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Initialize all plugins from configuration
|
|
54
|
-
* Loads custom plugins
|
|
55
|
+
* Loads custom plugins (file-based), registry plugins (programmatic), validates priorities,
|
|
56
|
+
* sorts by priority, and calls initialize()
|
|
55
57
|
*
|
|
56
|
-
*
|
|
58
|
+
* TODO: Consider adding an MCP server-like convention for plugin discovery.
|
|
59
|
+
* Instead of requiring explicit file paths, plugins could be connected as
|
|
60
|
+
* plugin servers to the PluginManager.
|
|
61
|
+
*
|
|
62
|
+
* @param customPlugins - Array of custom plugin configurations from YAML (file-based)
|
|
63
|
+
* @param registryPlugins - Array of registry plugin configurations from YAML (programmatic)
|
|
57
64
|
* @throws {DextoRuntimeError} If any plugin fails to load or initialize (fail-fast)
|
|
58
65
|
*/
|
|
59
|
-
async initialize(customPlugins = []) {
|
|
66
|
+
async initialize(customPlugins = [], registryPlugins = []) {
|
|
60
67
|
if (this.initialized) {
|
|
61
68
|
throw new DextoRuntimeError(
|
|
62
69
|
PluginErrorCode.PLUGIN_CONFIGURATION_INVALID,
|
|
@@ -66,9 +73,19 @@ class PluginManager {
|
|
|
66
73
|
);
|
|
67
74
|
}
|
|
68
75
|
const priorities = /* @__PURE__ */ new Set();
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
const allPluginConfigs = [
|
|
77
|
+
...Array.from(this.plugins.values()).map((p) => p.config),
|
|
78
|
+
...customPlugins,
|
|
79
|
+
...registryPlugins.map((r) => ({
|
|
80
|
+
name: r.type,
|
|
81
|
+
module: `<registry:${r.type}>`,
|
|
82
|
+
enabled: r.enabled,
|
|
83
|
+
blocking: r.blocking,
|
|
84
|
+
priority: r.priority,
|
|
85
|
+
config: r.config
|
|
86
|
+
}))
|
|
87
|
+
];
|
|
88
|
+
for (const config of allPluginConfigs) {
|
|
72
89
|
if (!config.enabled) continue;
|
|
73
90
|
if (priorities.has(config.priority)) {
|
|
74
91
|
throw new DextoRuntimeError(
|
|
@@ -78,12 +95,80 @@ class PluginManager {
|
|
|
78
95
|
`Duplicate plugin priority: ${config.priority}. Each plugin must have a unique priority.`,
|
|
79
96
|
{
|
|
80
97
|
priority: config.priority,
|
|
81
|
-
hint: "Ensure all enabled plugins (built-in and
|
|
98
|
+
hint: "Ensure all enabled plugins (built-in, custom, and registry) have unique priority values."
|
|
82
99
|
}
|
|
83
100
|
);
|
|
84
101
|
}
|
|
85
102
|
priorities.add(config.priority);
|
|
86
103
|
}
|
|
104
|
+
for (const registryConfig of registryPlugins) {
|
|
105
|
+
if (!registryConfig.enabled) {
|
|
106
|
+
this.logger.debug(`Skipping disabled registry plugin: ${registryConfig.type}`);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const provider = pluginRegistry.get(registryConfig.type);
|
|
111
|
+
if (!provider) {
|
|
112
|
+
throw new DextoRuntimeError(
|
|
113
|
+
PluginErrorCode.PLUGIN_PROVIDER_NOT_FOUND,
|
|
114
|
+
ErrorScope.PLUGIN,
|
|
115
|
+
ErrorType.USER,
|
|
116
|
+
`Plugin provider '${registryConfig.type}' not found in registry`,
|
|
117
|
+
{
|
|
118
|
+
type: registryConfig.type,
|
|
119
|
+
available: pluginRegistry.getTypes()
|
|
120
|
+
},
|
|
121
|
+
`Available plugin providers: ${pluginRegistry.getTypes().join(", ") || "none"}. Register the provider using pluginRegistry.register() before agent initialization.`
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
const validatedConfig = provider.configSchema.safeParse({
|
|
125
|
+
type: registryConfig.type,
|
|
126
|
+
...registryConfig.config
|
|
127
|
+
});
|
|
128
|
+
if (!validatedConfig.success) {
|
|
129
|
+
throw new DextoRuntimeError(
|
|
130
|
+
PluginErrorCode.PLUGIN_PROVIDER_VALIDATION_FAILED,
|
|
131
|
+
ErrorScope.PLUGIN,
|
|
132
|
+
ErrorType.USER,
|
|
133
|
+
`Invalid configuration for plugin provider '${registryConfig.type}'`,
|
|
134
|
+
{
|
|
135
|
+
type: registryConfig.type,
|
|
136
|
+
errors: validatedConfig.error.errors
|
|
137
|
+
},
|
|
138
|
+
"Check the configuration schema for this plugin provider"
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
const creationContext = {
|
|
142
|
+
config: registryConfig.config || {},
|
|
143
|
+
blocking: registryConfig.blocking,
|
|
144
|
+
priority: registryConfig.priority
|
|
145
|
+
};
|
|
146
|
+
const plugin = provider.create(validatedConfig.data, creationContext);
|
|
147
|
+
const loadedPlugin = {
|
|
148
|
+
plugin,
|
|
149
|
+
config: {
|
|
150
|
+
name: registryConfig.type,
|
|
151
|
+
module: `<registry:${registryConfig.type}>`,
|
|
152
|
+
enabled: registryConfig.enabled,
|
|
153
|
+
blocking: registryConfig.blocking,
|
|
154
|
+
priority: registryConfig.priority,
|
|
155
|
+
config: registryConfig.config
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
this.plugins.set(registryConfig.type, loadedPlugin);
|
|
159
|
+
this.logger.info(`Registry plugin loaded: ${registryConfig.type}`);
|
|
160
|
+
} catch (error) {
|
|
161
|
+
if (error instanceof DextoRuntimeError) {
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
throw new DextoRuntimeError(
|
|
165
|
+
PluginErrorCode.PLUGIN_INITIALIZATION_FAILED,
|
|
166
|
+
ErrorScope.PLUGIN,
|
|
167
|
+
ErrorType.SYSTEM,
|
|
168
|
+
`Failed to load registry plugin '${registryConfig.type}': ${error instanceof Error ? error.message : String(error)}`
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
87
172
|
for (const pluginConfig of customPlugins) {
|
|
88
173
|
if (!pluginConfig.enabled) {
|
|
89
174
|
this.logger.debug(`Skipping disabled plugin: ${pluginConfig.name}`);
|