@dexto/core 1.5.8 → 1.6.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/README.md +19 -8
- package/dist/agent/DextoAgent.cjs +293 -154
- package/dist/agent/DextoAgent.d.ts +83 -56
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +290 -151
- package/dist/{context/compaction/provider.cjs → agent/agent-options.cjs} +2 -2
- package/dist/agent/agent-options.d.ts +53 -0
- package/dist/agent/agent-options.d.ts.map +1 -0
- package/dist/agent/agentCard.cjs +1 -1
- package/dist/agent/errors.cjs +2 -2
- package/dist/agent/errors.d.ts.map +1 -1
- package/dist/agent/index.cjs +1 -6
- package/dist/agent/index.d.ts +3 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -7
- package/dist/{storage/blob/provider.cjs → agent/runtime-config.cjs} +2 -2
- package/dist/agent/runtime-config.d.ts +53 -0
- package/dist/agent/runtime-config.d.ts.map +1 -0
- package/dist/agent/schemas.cjs +2 -104
- package/dist/agent/schemas.d.ts +10 -9199
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +1 -109
- package/dist/agent/state-manager.d.ts +5 -5
- package/dist/agent/state-manager.d.ts.map +1 -1
- package/dist/approval/error-codes.cjs +1 -1
- package/dist/approval/error-codes.d.ts +1 -1
- package/dist/approval/error-codes.d.ts.map +1 -1
- package/dist/approval/error-codes.js +1 -1
- package/dist/approval/errors.cjs +5 -5
- package/dist/approval/errors.d.ts +2 -2
- package/dist/approval/errors.d.ts.map +1 -1
- package/dist/approval/errors.js +5 -5
- package/dist/approval/index.cjs +8 -8
- package/dist/approval/index.d.ts +2 -2
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +8 -8
- package/dist/approval/manager.cjs +77 -57
- package/dist/approval/manager.d.ts +41 -43
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +75 -55
- package/dist/approval/schemas.cjs +26 -25
- package/dist/approval/schemas.d.ts +35 -15
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +22 -21
- package/dist/approval/types.cjs +1 -1
- package/dist/approval/types.d.ts +14 -14
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/context/compaction/index.cjs +2 -23
- package/dist/context/compaction/index.d.ts +1 -7
- package/dist/context/compaction/index.d.ts.map +1 -1
- package/dist/context/compaction/index.js +1 -16
- package/dist/context/compaction/strategies/noop.cjs +19 -1
- package/dist/context/compaction/strategies/noop.d.ts +13 -3
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -1
- package/dist/context/compaction/strategies/noop.js +19 -1
- package/dist/context/compaction/strategies/{reactive-overflow.cjs → reactive-overflow-compaction.cjs} +67 -64
- package/dist/context/compaction/strategies/{reactive-overflow.d.ts → reactive-overflow-compaction.d.ts} +19 -36
- package/dist/context/compaction/strategies/reactive-overflow-compaction.d.ts.map +1 -0
- package/dist/context/compaction/strategies/{reactive-overflow.js → reactive-overflow-compaction.js} +63 -60
- package/dist/context/compaction/types.d.ts +40 -8
- package/dist/context/compaction/types.d.ts.map +1 -1
- package/dist/context/manager.cjs +4 -2
- package/dist/context/manager.d.ts +4 -3
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +4 -2
- package/dist/context/types.d.ts +2 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +2 -2
- package/dist/context/utils.d.ts +14 -14
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/errors/result-bridge.d.ts +2 -2
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/types.cjs +1 -1
- package/dist/errors/types.d.ts +3 -3
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +11 -1
- package/dist/events/index.d.ts +43 -7
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +11 -1
- package/dist/{plugins → hooks}/builtins/content-policy.cjs +7 -6
- package/dist/hooks/builtins/content-policy.d.ts +24 -0
- package/dist/hooks/builtins/content-policy.d.ts.map +1 -0
- package/dist/{plugins → hooks}/builtins/content-policy.js +6 -5
- package/dist/{plugins → hooks}/builtins/response-sanitizer.cjs +3 -3
- package/dist/hooks/builtins/response-sanitizer.d.ts +22 -0
- package/dist/hooks/builtins/response-sanitizer.d.ts.map +1 -0
- package/dist/{plugins → hooks}/builtins/response-sanitizer.js +2 -2
- package/dist/hooks/error-codes.cjs +43 -0
- package/dist/hooks/error-codes.d.ts +34 -0
- package/dist/hooks/error-codes.d.ts.map +1 -0
- package/dist/hooks/error-codes.js +20 -0
- package/dist/{storage/cache/providers/memory.cjs → hooks/index.cjs} +15 -18
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/manager.cjs +354 -0
- package/dist/hooks/manager.d.ts +103 -0
- package/dist/hooks/manager.d.ts.map +1 -0
- package/dist/hooks/manager.js +331 -0
- package/dist/{plugins → hooks}/types.d.ts +36 -34
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/index.browser.cjs +13 -12
- package/dist/index.browser.d.ts +5 -5
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +8 -7
- package/dist/index.cjs +5 -7
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/llm/errors.cjs +1 -1
- package/dist/llm/executor/stream-processor.cjs +131 -11
- package/dist/llm/executor/stream-processor.d.ts +7 -5
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +131 -11
- package/dist/llm/executor/turn-executor.cjs +49 -54
- package/dist/llm/executor/turn-executor.d.ts +7 -8
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +49 -54
- package/dist/llm/formatters/vercel.cjs +2 -2
- package/dist/llm/formatters/vercel.d.ts +2 -2
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/providers/local/schemas.d.ts +10 -10
- package/dist/llm/registry/auto-update.d.ts +2 -2
- package/dist/llm/registry/auto-update.d.ts.map +1 -1
- package/dist/llm/registry/index.d.ts +3 -3
- package/dist/llm/registry/index.d.ts.map +1 -1
- package/dist/llm/resolver.cjs +2 -2
- package/dist/llm/resolver.d.ts +4 -4
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/schemas.cjs +67 -104
- package/dist/llm/schemas.d.ts +6 -145
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +64 -101
- package/dist/llm/services/factory.cjs +2 -3
- package/dist/llm/services/factory.d.ts +3 -4
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +2 -3
- package/dist/llm/services/vercel.cjs +7 -14
- package/dist/llm/services/vercel.d.ts +6 -7
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +7 -14
- package/dist/llm/validation.cjs +1 -1
- package/dist/llm/validation.d.ts +2 -2
- package/dist/llm/validation.d.ts.map +1 -1
- package/dist/logger/browser.cjs +4 -4
- package/dist/logger/browser.d.ts +4 -4
- package/dist/logger/browser.d.ts.map +1 -1
- package/dist/logger/browser.js +3 -3
- package/dist/{context/compaction/providers/noop-provider.cjs → logger/default-logger-factory.cjs} +16 -22
- package/dist/logger/default-logger-factory.d.ts +301 -0
- package/dist/logger/default-logger-factory.d.ts.map +1 -0
- package/dist/logger/default-logger-factory.js +18 -0
- package/dist/logger/factory.d.ts +2 -2
- package/dist/logger/factory.d.ts.map +1 -1
- package/dist/logger/index.cjs +7 -2
- package/dist/logger/index.d.ts +5 -3
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +8 -2
- package/dist/logger/logger.cjs +4 -4
- package/dist/logger/logger.d.ts +4 -4
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +3 -3
- package/dist/logger/v2/dexto-logger.d.ts +3 -3
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/schemas.d.ts +12 -12
- package/dist/logger/v2/test-utils.d.ts +5 -5
- package/dist/logger/v2/test-utils.d.ts.map +1 -1
- package/dist/logger/v2/transport-factory.d.ts +3 -3
- package/dist/logger/v2/transport-factory.d.ts.map +1 -1
- package/dist/logger/v2/transports/console-transport.d.ts +2 -2
- package/dist/logger/v2/transports/console-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/file-transport.d.ts +2 -2
- package/dist/logger/v2/transports/file-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/silent-transport.d.ts +2 -2
- package/dist/logger/v2/transports/silent-transport.d.ts.map +1 -1
- package/dist/logger/v2/types.cjs +1 -1
- package/dist/logger/v2/types.d.ts +8 -8
- package/dist/logger/v2/types.d.ts.map +1 -1
- package/dist/logger/v2/types.js +1 -1
- package/dist/mcp/errors.cjs +2 -2
- package/dist/mcp/errors.d.ts.map +1 -1
- package/dist/mcp/manager.cjs +16 -11
- package/dist/mcp/manager.d.ts +16 -13
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +17 -12
- package/dist/mcp/mcp-client.cjs +25 -20
- package/dist/mcp/mcp-client.d.ts +5 -5
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +20 -15
- package/dist/mcp/resolver.cjs +1 -1
- package/dist/mcp/schemas.cjs +5 -5
- package/dist/mcp/schemas.d.ts +4 -4
- package/dist/mcp/schemas.js +2 -2
- package/dist/mcp/types.d.ts +7 -7
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/memory/manager.d.ts +2 -2
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/schemas.d.ts +2 -2
- package/dist/prompts/errors.cjs +3 -3
- package/dist/prompts/errors.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.d.ts +3 -3
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.cjs +15 -29
- package/dist/prompts/providers/config-prompt-provider.d.ts +3 -3
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +15 -29
- package/dist/prompts/providers/custom-prompt-provider.d.ts +2 -2
- package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/mcp-prompt-provider.d.ts +2 -2
- package/dist/prompts/providers/mcp-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/schemas.d.ts +4 -4
- package/dist/resources/{internal-provider.cjs → agent-resources-provider.cjs} +16 -16
- package/dist/resources/{internal-provider.d.ts → agent-resources-provider.d.ts} +6 -6
- package/dist/resources/agent-resources-provider.d.ts.map +1 -0
- package/dist/resources/{internal-provider.js → agent-resources-provider.js} +13 -13
- package/dist/resources/errors.cjs +2 -2
- package/dist/resources/errors.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.d.ts +2 -2
- package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
- package/dist/resources/handlers/factory.d.ts +3 -3
- package/dist/resources/handlers/factory.d.ts.map +1 -1
- package/dist/resources/handlers/filesystem-handler.d.ts +2 -2
- package/dist/resources/handlers/filesystem-handler.d.ts.map +1 -1
- package/dist/resources/index.cjs +7 -9
- package/dist/resources/index.d.ts +3 -3
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +5 -10
- package/dist/resources/manager.cjs +77 -74
- package/dist/resources/manager.d.ts +16 -7
- package/dist/resources/manager.d.ts.map +1 -1
- package/dist/resources/manager.js +77 -74
- package/dist/resources/schemas.cjs +6 -26
- package/dist/resources/schemas.d.ts +8 -100
- package/dist/resources/schemas.d.ts.map +1 -1
- package/dist/resources/schemas.js +4 -23
- package/dist/search/search-service.d.ts +2 -2
- package/dist/search/search-service.d.ts.map +1 -1
- package/dist/session/chat-session.cjs +15 -25
- package/dist/session/chat-session.d.ts +7 -5
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +16 -26
- package/dist/session/errors.cjs +2 -2
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/history/database.cjs +1 -1
- package/dist/session/history/database.d.ts +4 -4
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/factory.d.ts +3 -3
- package/dist/session/history/factory.d.ts.map +1 -1
- package/dist/session/history/memory.d.ts +4 -4
- package/dist/session/history/memory.d.ts.map +1 -1
- package/dist/session/history/types.d.ts +2 -2
- package/dist/session/history/types.d.ts.map +1 -1
- package/dist/session/index.cjs +3 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +2 -0
- package/dist/session/message-queue.d.ts +2 -2
- package/dist/session/message-queue.d.ts.map +1 -1
- package/dist/session/session-manager.cjs +67 -9
- package/dist/session/session-manager.d.ts +46 -7
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +67 -9
- package/dist/session/title-generator.cjs +2 -2
- package/dist/session/title-generator.d.ts +2 -2
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/storage/blob/index.cjs +0 -40
- package/dist/storage/blob/index.d.ts +2 -44
- package/dist/storage/blob/index.d.ts.map +1 -1
- package/dist/storage/blob/index.js +0 -30
- package/dist/storage/cache/index.cjs +0 -37
- package/dist/storage/cache/index.d.ts +0 -42
- package/dist/storage/cache/index.d.ts.map +1 -1
- package/dist/storage/cache/index.js +0 -28
- package/dist/storage/database/index.cjs +0 -42
- package/dist/storage/database/index.d.ts +0 -43
- package/dist/storage/database/index.d.ts.map +1 -1
- package/dist/storage/database/index.js +0 -37
- package/dist/storage/error-codes.cjs +1 -6
- package/dist/storage/error-codes.d.ts +2 -7
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +1 -6
- package/dist/storage/errors.cjs +18 -82
- package/dist/storage/errors.d.ts +4 -24
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +16 -80
- package/dist/storage/index.cjs +8 -69
- package/dist/storage/index.d.ts +11 -66
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +6 -50
- package/dist/storage/storage-manager.cjs +9 -25
- package/dist/storage/storage-manager.d.ts +11 -15
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +8 -23
- package/dist/storage/types.d.ts +0 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/systemPrompt/contributors.d.ts +4 -4
- package/dist/systemPrompt/contributors.d.ts.map +1 -1
- package/dist/systemPrompt/errors.cjs +2 -2
- package/dist/systemPrompt/errors.d.ts.map +1 -1
- package/dist/systemPrompt/manager.cjs +1 -5
- package/dist/systemPrompt/manager.d.ts +2 -3
- package/dist/systemPrompt/manager.d.ts.map +1 -1
- package/dist/systemPrompt/manager.js +1 -5
- package/dist/telemetry/index.cjs +3 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/utils.d.ts +4 -4
- package/dist/telemetry/utils.d.ts.map +1 -1
- package/dist/test-utils/in-memory-storage.cjs +288 -0
- package/dist/test-utils/in-memory-storage.js +252 -0
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts +3 -3
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts +4 -4
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts.map +1 -1
- package/dist/tools/{internal-tools/constants.cjs → define-tool.cjs} +8 -13
- package/dist/tools/define-tool.d.ts +11 -0
- package/dist/tools/define-tool.d.ts.map +1 -0
- package/dist/tools/define-tool.js +7 -0
- package/dist/tools/error-codes.cjs +2 -2
- package/dist/tools/error-codes.d.ts +2 -2
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +2 -2
- package/dist/tools/errors.cjs +11 -23
- package/dist/tools/errors.d.ts +4 -10
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +9 -21
- package/dist/tools/index.cjs +3 -8
- package/dist/tools/index.d.ts +2 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -7
- package/dist/{storage/blob/providers/index.cjs → tools/pattern-utils.cjs} +11 -9
- package/dist/tools/pattern-utils.d.ts +20 -0
- package/dist/tools/pattern-utils.d.ts.map +1 -0
- package/dist/tools/pattern-utils.js +10 -0
- package/dist/tools/schemas.cjs +14 -40
- package/dist/tools/schemas.d.ts +6 -50
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +11 -32
- package/dist/tools/tool-call-metadata.cjs +3 -3
- package/dist/tools/tool-call-metadata.d.ts +1 -1
- package/dist/tools/tool-call-metadata.d.ts.map +1 -1
- package/dist/tools/tool-call-metadata.js +3 -3
- package/dist/tools/tool-manager.cjs +376 -327
- package/dist/tools/tool-manager.d.ts +63 -80
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +376 -331
- package/dist/tools/types.d.ts +112 -13
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/error-conversion.d.ts +2 -2
- package/dist/utils/error-conversion.d.ts.map +1 -1
- package/dist/utils/path.d.ts +2 -2
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/result.cjs +1 -1
- package/dist/utils/result.d.ts.map +1 -1
- package/dist/utils/schema.cjs +9 -5
- package/dist/utils/schema.d.ts +4 -2
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +9 -5
- package/dist/utils/service-initializer.cjs +51 -56
- package/dist/utils/service-initializer.d.ts +17 -14
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +51 -56
- package/dist/{storage/cache/providers/index.cjs → workspace/error-codes.cjs} +8 -9
- package/dist/workspace/error-codes.d.ts +5 -0
- package/dist/workspace/error-codes.d.ts.map +1 -0
- package/dist/workspace/error-codes.js +7 -0
- package/dist/{storage/blob/factory.cjs → workspace/errors.cjs} +20 -14
- package/dist/workspace/errors.d.ts +5 -0
- package/dist/workspace/errors.d.ts.map +1 -0
- package/dist/workspace/errors.js +21 -0
- package/dist/{image → workspace}/index.cjs +12 -10
- package/dist/workspace/index.d.ts +5 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +9 -0
- package/dist/workspace/manager.cjs +113 -0
- package/dist/workspace/manager.d.ts +18 -0
- package/dist/workspace/manager.d.ts.map +1 -0
- package/dist/workspace/manager.js +90 -0
- package/dist/workspace/types.d.ts +14 -0
- package/dist/workspace/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/context/compaction/factory.cjs +0 -57
- package/dist/context/compaction/factory.d.ts +0 -17
- package/dist/context/compaction/factory.d.ts.map +0 -1
- package/dist/context/compaction/factory.js +0 -34
- package/dist/context/compaction/provider.d.ts +0 -48
- package/dist/context/compaction/provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/noop-provider.d.ts +0 -24
- package/dist/context/compaction/providers/noop-provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/noop-provider.js +0 -24
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +0 -76
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +0 -51
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/reactive-overflow-provider.js +0 -52
- package/dist/context/compaction/registry.cjs +0 -39
- package/dist/context/compaction/registry.d.ts +0 -19
- package/dist/context/compaction/registry.d.ts.map +0 -1
- package/dist/context/compaction/registry.js +0 -16
- package/dist/context/compaction/schemas.cjs +0 -58
- package/dist/context/compaction/schemas.d.ts +0 -69
- package/dist/context/compaction/schemas.d.ts.map +0 -1
- package/dist/context/compaction/schemas.js +0 -34
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +0 -1
- package/dist/image/define-image.cjs +0 -146
- package/dist/image/define-image.d.ts +0 -71
- package/dist/image/define-image.d.ts.map +0 -1
- package/dist/image/define-image.js +0 -121
- package/dist/image/index.d.ts +0 -53
- package/dist/image/index.d.ts.map +0 -1
- package/dist/image/index.js +0 -7
- package/dist/image/types.d.ts +0 -246
- package/dist/image/types.d.ts.map +0 -1
- package/dist/llm/services/test-utils.integration.cjs +0 -237
- package/dist/llm/services/test-utils.integration.d.ts +0 -48
- package/dist/llm/services/test-utils.integration.d.ts.map +0 -1
- package/dist/llm/services/test-utils.integration.js +0 -214
- package/dist/plugins/builtins/content-policy.d.ts +0 -26
- package/dist/plugins/builtins/content-policy.d.ts.map +0 -1
- package/dist/plugins/builtins/response-sanitizer.d.ts +0 -25
- package/dist/plugins/builtins/response-sanitizer.d.ts.map +0 -1
- package/dist/plugins/error-codes.cjs +0 -43
- package/dist/plugins/error-codes.d.ts +0 -34
- package/dist/plugins/error-codes.d.ts.map +0 -1
- package/dist/plugins/error-codes.js +0 -20
- package/dist/plugins/index.cjs +0 -61
- package/dist/plugins/index.d.ts +0 -21
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -30
- package/dist/plugins/loader.cjs +0 -171
- package/dist/plugins/loader.d.ts +0 -30
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js +0 -145
- package/dist/plugins/manager.cjs +0 -473
- package/dist/plugins/manager.d.ts +0 -106
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -450
- package/dist/plugins/registrations/builtins.cjs +0 -51
- package/dist/plugins/registrations/builtins.d.ts +0 -17
- package/dist/plugins/registrations/builtins.d.ts.map +0 -1
- package/dist/plugins/registrations/builtins.js +0 -28
- package/dist/plugins/registry.cjs +0 -63
- package/dist/plugins/registry.d.ts +0 -101
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -39
- package/dist/plugins/schemas.cjs +0 -73
- package/dist/plugins/schemas.d.ts +0 -195
- package/dist/plugins/schemas.d.ts.map +0 -1
- package/dist/plugins/schemas.js +0 -47
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/providers/base-registry.cjs +0 -147
- package/dist/providers/base-registry.d.ts +0 -147
- package/dist/providers/base-registry.d.ts.map +0 -1
- package/dist/providers/base-registry.js +0 -123
- package/dist/providers/discovery.cjs +0 -109
- package/dist/providers/discovery.d.ts +0 -96
- package/dist/providers/discovery.d.ts.map +0 -1
- package/dist/providers/discovery.js +0 -84
- package/dist/providers/index.cjs +0 -24
- package/dist/providers/index.d.ts +0 -32
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -2
- package/dist/resources/internal-provider.d.ts.map +0 -1
- package/dist/storage/blob/factory.d.ts +0 -37
- package/dist/storage/blob/factory.d.ts.map +0 -1
- package/dist/storage/blob/factory.js +0 -15
- package/dist/storage/blob/local-blob-store.cjs +0 -496
- package/dist/storage/blob/local-blob-store.d.ts +0 -58
- package/dist/storage/blob/local-blob-store.d.ts.map +0 -1
- package/dist/storage/blob/local-blob-store.js +0 -463
- package/dist/storage/blob/memory-blob-store.cjs +0 -326
- package/dist/storage/blob/memory-blob-store.d.ts +0 -66
- package/dist/storage/blob/memory-blob-store.d.ts.map +0 -1
- package/dist/storage/blob/memory-blob-store.js +0 -303
- package/dist/storage/blob/provider.d.ts +0 -50
- package/dist/storage/blob/provider.d.ts.map +0 -1
- package/dist/storage/blob/providers/index.d.ts +0 -8
- package/dist/storage/blob/providers/index.d.ts.map +0 -1
- package/dist/storage/blob/providers/index.js +0 -7
- package/dist/storage/blob/providers/local.cjs +0 -39
- package/dist/storage/blob/providers/local.d.ts +0 -17
- package/dist/storage/blob/providers/local.d.ts.map +0 -1
- package/dist/storage/blob/providers/local.js +0 -16
- package/dist/storage/blob/providers/memory.cjs +0 -39
- package/dist/storage/blob/providers/memory.d.ts +0 -17
- package/dist/storage/blob/providers/memory.d.ts.map +0 -1
- package/dist/storage/blob/providers/memory.js +0 -16
- package/dist/storage/blob/registry.cjs +0 -50
- package/dist/storage/blob/registry.d.ts +0 -42
- package/dist/storage/blob/registry.d.ts.map +0 -1
- package/dist/storage/blob/registry.js +0 -26
- package/dist/storage/blob/schemas.cjs +0 -52
- package/dist/storage/blob/schemas.d.ts +0 -85
- package/dist/storage/blob/schemas.d.ts.map +0 -1
- package/dist/storage/blob/schemas.js +0 -26
- package/dist/storage/cache/factory.cjs +0 -38
- package/dist/storage/cache/factory.d.ts +0 -37
- package/dist/storage/cache/factory.d.ts.map +0 -1
- package/dist/storage/cache/factory.js +0 -15
- package/dist/storage/cache/memory-cache-store.cjs +0 -107
- package/dist/storage/cache/memory-cache-store.d.ts +0 -26
- package/dist/storage/cache/memory-cache-store.d.ts.map +0 -1
- package/dist/storage/cache/memory-cache-store.js +0 -84
- package/dist/storage/cache/provider.cjs +0 -16
- package/dist/storage/cache/provider.d.ts +0 -56
- package/dist/storage/cache/provider.d.ts.map +0 -1
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.d.ts +0 -8
- package/dist/storage/cache/providers/index.d.ts.map +0 -1
- package/dist/storage/cache/providers/index.js +0 -7
- package/dist/storage/cache/providers/memory.d.ts +0 -17
- package/dist/storage/cache/providers/memory.d.ts.map +0 -1
- package/dist/storage/cache/providers/memory.js +0 -17
- package/dist/storage/cache/providers/redis.cjs +0 -66
- package/dist/storage/cache/providers/redis.d.ts +0 -20
- package/dist/storage/cache/providers/redis.d.ts.map +0 -1
- package/dist/storage/cache/providers/redis.js +0 -33
- package/dist/storage/cache/redis-store.cjs +0 -173
- package/dist/storage/cache/redis-store.d.ts +0 -32
- package/dist/storage/cache/redis-store.d.ts.map +0 -1
- package/dist/storage/cache/redis-store.js +0 -150
- package/dist/storage/cache/registry.cjs +0 -50
- package/dist/storage/cache/registry.d.ts +0 -42
- package/dist/storage/cache/registry.d.ts.map +0 -1
- package/dist/storage/cache/registry.js +0 -26
- package/dist/storage/cache/schemas.cjs +0 -81
- package/dist/storage/cache/schemas.d.ts +0 -150
- package/dist/storage/cache/schemas.d.ts.map +0 -1
- package/dist/storage/cache/schemas.js +0 -55
- package/dist/storage/database/factory.cjs +0 -38
- package/dist/storage/database/factory.d.ts +0 -39
- package/dist/storage/database/factory.d.ts.map +0 -1
- package/dist/storage/database/factory.js +0 -15
- package/dist/storage/database/memory-database-store.cjs +0 -122
- package/dist/storage/database/memory-database-store.d.ts +0 -29
- package/dist/storage/database/memory-database-store.d.ts.map +0 -1
- package/dist/storage/database/memory-database-store.js +0 -99
- package/dist/storage/database/postgres-store.cjs +0 -342
- package/dist/storage/database/postgres-store.d.ts +0 -55
- package/dist/storage/database/postgres-store.d.ts.map +0 -1
- package/dist/storage/database/postgres-store.js +0 -319
- package/dist/storage/database/provider.cjs +0 -16
- package/dist/storage/database/provider.d.ts +0 -56
- package/dist/storage/database/provider.d.ts.map +0 -1
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +0 -34
- package/dist/storage/database/providers/index.d.ts +0 -9
- package/dist/storage/database/providers/index.d.ts.map +0 -1
- package/dist/storage/database/providers/index.js +0 -9
- package/dist/storage/database/providers/memory.cjs +0 -40
- package/dist/storage/database/providers/memory.d.ts +0 -16
- package/dist/storage/database/providers/memory.d.ts.map +0 -1
- package/dist/storage/database/providers/memory.js +0 -17
- package/dist/storage/database/providers/postgres.cjs +0 -62
- package/dist/storage/database/providers/postgres.d.ts +0 -19
- package/dist/storage/database/providers/postgres.d.ts.map +0 -1
- package/dist/storage/database/providers/postgres.js +0 -29
- package/dist/storage/database/providers/sqlite.cjs +0 -66
- package/dist/storage/database/providers/sqlite.d.ts +0 -20
- package/dist/storage/database/providers/sqlite.d.ts.map +0 -1
- package/dist/storage/database/providers/sqlite.js +0 -33
- package/dist/storage/database/registry.cjs +0 -50
- package/dist/storage/database/registry.d.ts +0 -42
- package/dist/storage/database/registry.d.ts.map +0 -1
- package/dist/storage/database/registry.js +0 -26
- package/dist/storage/database/schemas.cjs +0 -97
- package/dist/storage/database/schemas.d.ts +0 -226
- package/dist/storage/database/schemas.d.ts.map +0 -1
- package/dist/storage/database/schemas.js +0 -70
- package/dist/storage/database/sqlite-store.cjs +0 -270
- package/dist/storage/database/sqlite-store.d.ts +0 -33
- package/dist/storage/database/sqlite-store.d.ts.map +0 -1
- package/dist/storage/database/sqlite-store.js +0 -237
- package/dist/storage/schemas.cjs +0 -57
- package/dist/storage/schemas.d.ts +0 -347
- package/dist/storage/schemas.d.ts.map +0 -1
- package/dist/storage/schemas.js +0 -37
- package/dist/tools/bash-pattern-utils.cjs +0 -91
- package/dist/tools/bash-pattern-utils.d.ts +0 -58
- package/dist/tools/bash-pattern-utils.d.ts.map +0 -1
- package/dist/tools/bash-pattern-utils.js +0 -64
- package/dist/tools/custom-tool-registry.cjs +0 -64
- package/dist/tools/custom-tool-registry.d.ts +0 -126
- package/dist/tools/custom-tool-registry.d.ts.map +0 -1
- package/dist/tools/custom-tool-registry.js +0 -40
- package/dist/tools/custom-tool-schema-registry.cjs +0 -164
- package/dist/tools/custom-tool-schema-registry.d.ts +0 -86
- package/dist/tools/custom-tool-schema-registry.d.ts.map +0 -1
- package/dist/tools/custom-tool-schema-registry.js +0 -140
- package/dist/tools/internal-tools/constants.d.ts +0 -12
- package/dist/tools/internal-tools/constants.d.ts.map +0 -1
- package/dist/tools/internal-tools/constants.js +0 -12
- package/dist/tools/internal-tools/implementations/ask-user-tool.cjs +0 -57
- package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts +0 -18
- package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/ask-user-tool.js +0 -34
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.cjs +0 -192
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts +0 -33
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +0 -169
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +0 -113
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +0 -30
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +0 -90
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.cjs +0 -140
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts +0 -24
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.js +0 -117
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +0 -91
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +0 -24
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +0 -68
- package/dist/tools/internal-tools/implementations/search-history-tool.cjs +0 -61
- package/dist/tools/internal-tools/implementations/search-history-tool.d.ts +0 -7
- package/dist/tools/internal-tools/implementations/search-history-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/search-history-tool.js +0 -38
- package/dist/tools/internal-tools/index.cjs +0 -26
- package/dist/tools/internal-tools/index.d.ts +0 -4
- package/dist/tools/internal-tools/index.d.ts.map +0 -1
- package/dist/tools/internal-tools/index.js +0 -3
- package/dist/tools/internal-tools/provider.cjs +0 -324
- package/dist/tools/internal-tools/provider.d.ts +0 -116
- package/dist/tools/internal-tools/provider.d.ts.map +0 -1
- package/dist/tools/internal-tools/provider.js +0 -301
- package/dist/tools/internal-tools/registry.cjs +0 -71
- package/dist/tools/internal-tools/registry.d.ts +0 -91
- package/dist/tools/internal-tools/registry.d.ts.map +0 -1
- package/dist/tools/internal-tools/registry.js +0 -47
- /package/dist/{context/compaction/provider.js → agent/agent-options.js} +0 -0
- /package/dist/{image/types.js → agent/runtime-config.js} +0 -0
- /package/dist/{image → hooks}/types.cjs +0 -0
- /package/dist/{plugins → hooks}/types.js +0 -0
- /package/dist/{plugins → workspace}/types.cjs +0 -0
- /package/dist/{storage/blob/provider.js → workspace/types.js} +0 -0
package/dist/agent/DextoAgent.js
CHANGED
|
@@ -9,13 +9,11 @@ import { setMaxListeners } from "events";
|
|
|
9
9
|
import { SkillsContributor } from "../systemPrompt/contributors.js";
|
|
10
10
|
import { expandMessageReferences } from "../resources/index.js";
|
|
11
11
|
import { expandBlobReferences } from "../context/utils.js";
|
|
12
|
+
import { StorageManager } from "../storage/index.js";
|
|
12
13
|
import { PromptManager } from "../prompts/index.js";
|
|
13
14
|
import { SessionError } from "../session/index.js";
|
|
14
|
-
import { createLogger } from "../logger/factory.js";
|
|
15
|
-
import { DextoLogComponent } from "../logger/v2/types.js";
|
|
16
15
|
import { InstrumentClass } from "../telemetry/decorators.js";
|
|
17
16
|
import { trace, context, propagation } from "@opentelemetry/api";
|
|
18
|
-
import { LLMUpdatesSchema } from "../llm/schemas.js";
|
|
19
17
|
import { resolveAndValidateLLMConfig } from "../llm/resolver.js";
|
|
20
18
|
import { validateInputForLLM } from "../llm/validation.js";
|
|
21
19
|
import { LLMError } from "../llm/errors.js";
|
|
@@ -34,7 +32,16 @@ import {
|
|
|
34
32
|
getAllModelsForProvider
|
|
35
33
|
} from "../llm/registry/index.js";
|
|
36
34
|
import { createAgentServices } from "../utils/service-initializer.js";
|
|
37
|
-
import {
|
|
35
|
+
import { LLMConfigSchema, LLMUpdatesSchema } from "../llm/schemas.js";
|
|
36
|
+
import { ServersConfigSchema } from "../mcp/schemas.js";
|
|
37
|
+
import { MemoriesConfigSchema } from "../memory/schemas.js";
|
|
38
|
+
import { PromptsSchema } from "../prompts/schemas.js";
|
|
39
|
+
import { ResourcesConfigSchema } from "../resources/schemas.js";
|
|
40
|
+
import { SessionConfigSchema } from "../session/schemas.js";
|
|
41
|
+
import { SystemPromptConfigSchema } from "../systemPrompt/schemas.js";
|
|
42
|
+
import { ElicitationConfigSchema, PermissionsConfigSchema } from "../tools/schemas.js";
|
|
43
|
+
import { OtelConfigurationSchema } from "../telemetry/schemas.js";
|
|
44
|
+
import { AgentCardSchema } from "./schemas.js";
|
|
38
45
|
import {
|
|
39
46
|
AgentEventBus
|
|
40
47
|
} from "../events/index.js";
|
|
@@ -47,6 +54,7 @@ const requiredServices = [
|
|
|
47
54
|
"agentEventBus",
|
|
48
55
|
"stateManager",
|
|
49
56
|
"sessionManager",
|
|
57
|
+
"workspaceManager",
|
|
50
58
|
"searchService",
|
|
51
59
|
"memoryManager"
|
|
52
60
|
];
|
|
@@ -58,50 +66,14 @@ _DextoAgent_decorators = [InstrumentClass({
|
|
|
58
66
|
"getConfig",
|
|
59
67
|
"getEffectiveConfig",
|
|
60
68
|
"registerSubscriber",
|
|
69
|
+
"on",
|
|
70
|
+
"once",
|
|
71
|
+
"off",
|
|
72
|
+
"emit",
|
|
61
73
|
"ensureStarted"
|
|
62
74
|
]
|
|
63
75
|
})];
|
|
64
|
-
class
|
|
65
|
-
/**
|
|
66
|
-
* Creates a DextoAgent instance.
|
|
67
|
-
*
|
|
68
|
-
* @param config - Agent configuration (validated and enriched)
|
|
69
|
-
* @param configPath - Optional path to config file (for relative path resolution)
|
|
70
|
-
* @param options - Validation options
|
|
71
|
-
* @param options.strict - When true (default), enforces API key and baseURL requirements.
|
|
72
|
-
* When false, allows missing credentials for interactive configuration.
|
|
73
|
-
*/
|
|
74
|
-
constructor(config, configPath, options) {
|
|
75
|
-
this.configPath = configPath;
|
|
76
|
-
const schema = options?.strict === false ? createAgentConfigSchema({ strict: false }) : AgentConfigSchema;
|
|
77
|
-
this.config = schema.parse(config);
|
|
78
|
-
this.logger = createLogger({
|
|
79
|
-
config: this.config.logger,
|
|
80
|
-
agentId: this.config.agentId,
|
|
81
|
-
component: DextoLogComponent.AGENT
|
|
82
|
-
});
|
|
83
|
-
const serviceOverrides = {};
|
|
84
|
-
if (options?.sessionLoggerFactory) {
|
|
85
|
-
serviceOverrides.sessionLoggerFactory = options.sessionLoggerFactory;
|
|
86
|
-
}
|
|
87
|
-
if (options && "mcpAuthProviderFactory" in options) {
|
|
88
|
-
serviceOverrides.mcpAuthProviderFactory = options.mcpAuthProviderFactory ?? null;
|
|
89
|
-
}
|
|
90
|
-
if (options?.toolManager) {
|
|
91
|
-
serviceOverrides.toolManager = options.toolManager;
|
|
92
|
-
}
|
|
93
|
-
if (options?.toolManagerFactory) {
|
|
94
|
-
serviceOverrides.toolManagerFactory = options.toolManagerFactory;
|
|
95
|
-
}
|
|
96
|
-
if (Object.keys(serviceOverrides).length > 0) {
|
|
97
|
-
this.serviceOverrides = serviceOverrides;
|
|
98
|
-
}
|
|
99
|
-
if (options?.mcpAuthProviderFactory) {
|
|
100
|
-
this.mcpAuthProviderFactory = options.mcpAuthProviderFactory;
|
|
101
|
-
}
|
|
102
|
-
this.agentEventBus = new AgentEventBus();
|
|
103
|
-
this.logger.info("DextoAgent created.");
|
|
104
|
-
}
|
|
76
|
+
let _DextoAgent = class _DextoAgent {
|
|
105
77
|
/**
|
|
106
78
|
* These services are public for use by the outside world
|
|
107
79
|
* This gives users the option to use methods of the services directly if they know what they are doing
|
|
@@ -113,6 +85,7 @@ class DextoAgent {
|
|
|
113
85
|
promptManager;
|
|
114
86
|
stateManager;
|
|
115
87
|
sessionManager;
|
|
88
|
+
workspaceManager;
|
|
116
89
|
toolManager;
|
|
117
90
|
resourceManager;
|
|
118
91
|
memoryManager;
|
|
@@ -135,9 +108,87 @@ class DextoAgent {
|
|
|
135
108
|
// Active stream controllers per session - allows cancel() to abort iterators
|
|
136
109
|
activeStreamControllers = /* @__PURE__ */ new Map();
|
|
137
110
|
// Host overrides for service initialization (e.g. session logger factory)
|
|
138
|
-
|
|
111
|
+
overrides;
|
|
112
|
+
// DI-provided local tools.
|
|
113
|
+
tools;
|
|
114
|
+
compactionStrategy;
|
|
139
115
|
// Logger instance for this agent (dependency injection)
|
|
140
116
|
logger;
|
|
117
|
+
/**
|
|
118
|
+
* Validate + normalize runtime settings.
|
|
119
|
+
*
|
|
120
|
+
* This is the single validation boundary for programmatic (code-first) construction.
|
|
121
|
+
* Host layers may validate earlier (e.g. YAML parsing), but core always normalizes
|
|
122
|
+
* runtime settings before use.
|
|
123
|
+
*/
|
|
124
|
+
static validateConfig(options) {
|
|
125
|
+
return {
|
|
126
|
+
agentId: options.agentId,
|
|
127
|
+
llm: LLMConfigSchema.parse(options.llm),
|
|
128
|
+
systemPrompt: SystemPromptConfigSchema.parse(options.systemPrompt),
|
|
129
|
+
mcpServers: ServersConfigSchema.parse(options.mcpServers ?? {}),
|
|
130
|
+
sessions: SessionConfigSchema.parse(options.sessions ?? {}),
|
|
131
|
+
permissions: PermissionsConfigSchema.parse(options.permissions ?? {}),
|
|
132
|
+
elicitation: ElicitationConfigSchema.parse(options.elicitation ?? {}),
|
|
133
|
+
resources: ResourcesConfigSchema.parse(options.resources ?? []),
|
|
134
|
+
prompts: PromptsSchema.parse(options.prompts),
|
|
135
|
+
...options.agentCard !== void 0 && {
|
|
136
|
+
agentCard: AgentCardSchema.parse(options.agentCard)
|
|
137
|
+
},
|
|
138
|
+
...options.greeting !== void 0 && { greeting: options.greeting },
|
|
139
|
+
...options.telemetry !== void 0 && {
|
|
140
|
+
telemetry: OtelConfigurationSchema.parse(options.telemetry)
|
|
141
|
+
},
|
|
142
|
+
...options.memories !== void 0 && {
|
|
143
|
+
memories: MemoriesConfigSchema.parse(options.memories)
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates a DextoAgent instance.
|
|
149
|
+
*
|
|
150
|
+
* Constructor options are DI-first:
|
|
151
|
+
* - runtime settings (validated + defaulted by core)
|
|
152
|
+
* - concrete services (logger/tools/hooks/storage backends)
|
|
153
|
+
* - optional internal service overrides (session logging, auth factories, etc.)
|
|
154
|
+
*/
|
|
155
|
+
constructor(options) {
|
|
156
|
+
const {
|
|
157
|
+
logger,
|
|
158
|
+
storage,
|
|
159
|
+
tools: toolsInput,
|
|
160
|
+
hooks: hooksInput,
|
|
161
|
+
compaction,
|
|
162
|
+
overrides: overridesInput,
|
|
163
|
+
...runtimeSettings
|
|
164
|
+
} = options;
|
|
165
|
+
const tools = toolsInput ?? [];
|
|
166
|
+
const hooks = hooksInput ?? [];
|
|
167
|
+
this.config = _DextoAgent.validateConfig(runtimeSettings);
|
|
168
|
+
this.logger = logger;
|
|
169
|
+
this.tools = tools;
|
|
170
|
+
this.compactionStrategy = compaction ?? null;
|
|
171
|
+
const overrides = { ...overridesInput ?? {} };
|
|
172
|
+
if (overrides.storageManager === void 0) {
|
|
173
|
+
overrides.storageManager = new StorageManager(
|
|
174
|
+
{
|
|
175
|
+
cache: storage.cache,
|
|
176
|
+
database: storage.database,
|
|
177
|
+
blobStore: storage.blob
|
|
178
|
+
},
|
|
179
|
+
this.logger
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
if (overrides.hooks === void 0) {
|
|
183
|
+
overrides.hooks = hooks;
|
|
184
|
+
}
|
|
185
|
+
this.overrides = overrides;
|
|
186
|
+
if (overrides.mcpAuthProviderFactory !== void 0) {
|
|
187
|
+
this.mcpAuthProviderFactory = overrides.mcpAuthProviderFactory;
|
|
188
|
+
}
|
|
189
|
+
this.agentEventBus = new AgentEventBus();
|
|
190
|
+
this.logger.info("DextoAgent created.");
|
|
191
|
+
}
|
|
141
192
|
/**
|
|
142
193
|
* Starts the agent by initializing all async services.
|
|
143
194
|
* This method handles storage backends, MCP connections, session manager initialization, and other async operations.
|
|
@@ -153,10 +204,10 @@ class DextoAgent {
|
|
|
153
204
|
this.logger.info("Starting DextoAgent...");
|
|
154
205
|
const services = await createAgentServices(
|
|
155
206
|
this.config,
|
|
156
|
-
this.configPath,
|
|
157
207
|
this.logger,
|
|
158
208
|
this.agentEventBus,
|
|
159
|
-
this.
|
|
209
|
+
this.overrides,
|
|
210
|
+
this.compactionStrategy
|
|
160
211
|
);
|
|
161
212
|
if (this.mcpAuthProviderFactory) {
|
|
162
213
|
services.mcpManager.setAuthProviderFactory(this.mcpAuthProviderFactory);
|
|
@@ -168,11 +219,11 @@ class DextoAgent {
|
|
|
168
219
|
);
|
|
169
220
|
}
|
|
170
221
|
}
|
|
171
|
-
const needsHandler = this.config.
|
|
222
|
+
const needsHandler = this.config.permissions.mode === "manual" || this.config.elicitation.enabled;
|
|
172
223
|
if (needsHandler && !this.approvalHandler) {
|
|
173
224
|
const reasons = [];
|
|
174
|
-
if (this.config.
|
|
175
|
-
reasons.push('
|
|
225
|
+
if (this.config.permissions.mode === "manual") {
|
|
226
|
+
reasons.push('permissions mode is "manual"');
|
|
176
227
|
}
|
|
177
228
|
if (this.config.elicitation.enabled) {
|
|
178
229
|
reasons.push("elicitation is enabled");
|
|
@@ -181,7 +232,7 @@ class DextoAgent {
|
|
|
181
232
|
`An approval handler is required but not configured (${reasons.join(" and ")}).
|
|
182
233
|
Either:
|
|
183
234
|
\u2022 Call agent.setApprovalHandler() before starting
|
|
184
|
-
\u2022 Set
|
|
235
|
+
\u2022 Set permissions: { mode: "auto-approve" } or { mode: "auto-deny" }
|
|
185
236
|
\u2022 Disable elicitation: { enabled: false }`
|
|
186
237
|
);
|
|
187
238
|
}
|
|
@@ -195,6 +246,7 @@ Either:
|
|
|
195
246
|
systemPromptManager: services.systemPromptManager,
|
|
196
247
|
stateManager: services.stateManager,
|
|
197
248
|
sessionManager: services.sessionManager,
|
|
249
|
+
workspaceManager: services.workspaceManager,
|
|
198
250
|
memoryManager: services.memoryManager,
|
|
199
251
|
services
|
|
200
252
|
});
|
|
@@ -208,9 +260,27 @@ Either:
|
|
|
208
260
|
);
|
|
209
261
|
await promptManager.initialize();
|
|
210
262
|
Object.assign(this, { promptManager });
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
263
|
+
const toolExecutionStorage = {
|
|
264
|
+
blob: services.storageManager.getBlobStore(),
|
|
265
|
+
database: services.storageManager.getDatabase(),
|
|
266
|
+
cache: services.storageManager.getCache()
|
|
267
|
+
};
|
|
268
|
+
const toolExecutionServices = {
|
|
269
|
+
approval: services.approvalManager,
|
|
270
|
+
search: services.searchService,
|
|
271
|
+
resources: services.resourceManager,
|
|
272
|
+
prompts: promptManager,
|
|
273
|
+
mcp: services.mcpManager,
|
|
274
|
+
taskForker: null
|
|
275
|
+
};
|
|
276
|
+
services.toolManager.setToolExecutionContextFactory((baseContext) => ({
|
|
277
|
+
...baseContext,
|
|
278
|
+
agent: this,
|
|
279
|
+
storage: toolExecutionStorage,
|
|
280
|
+
services: toolExecutionServices
|
|
281
|
+
}));
|
|
282
|
+
const agentTools = this.tools;
|
|
283
|
+
if (agentTools.some((t) => t.id === "invoke_skill")) {
|
|
214
284
|
const skillsContributor = new SkillsContributor(
|
|
215
285
|
"skills",
|
|
216
286
|
50,
|
|
@@ -221,6 +291,7 @@ Either:
|
|
|
221
291
|
services.systemPromptManager.addContributor(skillsContributor);
|
|
222
292
|
this.logger.debug("Added SkillsContributor to system prompt");
|
|
223
293
|
}
|
|
294
|
+
services.toolManager.setTools(agentTools);
|
|
224
295
|
await services.toolManager.initialize();
|
|
225
296
|
this.searchService = services.searchService;
|
|
226
297
|
this._isStarted = true;
|
|
@@ -264,13 +335,22 @@ Either:
|
|
|
264
335
|
shutdownErrors.push(new Error(`SessionManager cleanup failed: ${err.message}`));
|
|
265
336
|
}
|
|
266
337
|
try {
|
|
267
|
-
if (this.
|
|
268
|
-
await this.
|
|
269
|
-
this.logger.debug("
|
|
338
|
+
if (this.toolManager) {
|
|
339
|
+
await this.toolManager.cleanup();
|
|
340
|
+
this.logger.debug("ToolManager cleaned up successfully");
|
|
270
341
|
}
|
|
271
342
|
} catch (error) {
|
|
272
343
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
273
|
-
shutdownErrors.push(new Error(`
|
|
344
|
+
shutdownErrors.push(new Error(`ToolManager cleanup failed: ${err.message}`));
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
if (this.services?.hookManager) {
|
|
348
|
+
await this.services.hookManager.cleanup();
|
|
349
|
+
this.logger.debug("HookManager cleaned up successfully");
|
|
350
|
+
}
|
|
351
|
+
} catch (error) {
|
|
352
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
353
|
+
shutdownErrors.push(new Error(`HookManager cleanup failed: ${err.message}`));
|
|
274
354
|
}
|
|
275
355
|
try {
|
|
276
356
|
if (this.mcpManager) {
|
|
@@ -281,6 +361,15 @@ Either:
|
|
|
281
361
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
282
362
|
shutdownErrors.push(new Error(`MCPManager disconnect failed: ${err.message}`));
|
|
283
363
|
}
|
|
364
|
+
try {
|
|
365
|
+
if (this.resourceManager) {
|
|
366
|
+
this.resourceManager.cleanup();
|
|
367
|
+
this.logger.debug("ResourceManager cleaned up successfully");
|
|
368
|
+
}
|
|
369
|
+
} catch (error) {
|
|
370
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
371
|
+
shutdownErrors.push(new Error(`ResourceManager cleanup failed: ${err.message}`));
|
|
372
|
+
}
|
|
284
373
|
try {
|
|
285
374
|
if (this.services?.storageManager) {
|
|
286
375
|
await this.services.storageManager.disconnect();
|
|
@@ -319,6 +408,26 @@ Either:
|
|
|
319
408
|
subscriber.subscribe(this.agentEventBus);
|
|
320
409
|
}
|
|
321
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* Convenience event subscription APIs (typed delegates to {@link AgentEventBus}).
|
|
413
|
+
*
|
|
414
|
+
* Prefer these over reaching into the internal event bus directly.
|
|
415
|
+
*/
|
|
416
|
+
on(event, listener, options) {
|
|
417
|
+
this.agentEventBus.on(event, listener, options);
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
once(event, listener, options) {
|
|
421
|
+
this.agentEventBus.once(event, listener, options);
|
|
422
|
+
return this;
|
|
423
|
+
}
|
|
424
|
+
off(event, listener) {
|
|
425
|
+
this.agentEventBus.off(event, listener);
|
|
426
|
+
return this;
|
|
427
|
+
}
|
|
428
|
+
emit(event, ...args) {
|
|
429
|
+
return this.agentEventBus.emit(event, ...args);
|
|
430
|
+
}
|
|
322
431
|
/**
|
|
323
432
|
* Restart the agent by stopping and starting it.
|
|
324
433
|
* Automatically re-subscribes all registered event subscribers to the new event bus.
|
|
@@ -571,6 +680,14 @@ Either:
|
|
|
571
680
|
};
|
|
572
681
|
this.agentEventBus.on("llm:tool-call", toolCallListener, { signal: cleanupSignal });
|
|
573
682
|
listeners.push({ event: "llm:tool-call", listener: toolCallListener });
|
|
683
|
+
const toolCallPartialListener = (data) => {
|
|
684
|
+
if (data.sessionId !== sessionId) return;
|
|
685
|
+
eventQueue.push({ name: "llm:tool-call-partial", ...data });
|
|
686
|
+
};
|
|
687
|
+
this.agentEventBus.on("llm:tool-call-partial", toolCallPartialListener, {
|
|
688
|
+
signal: cleanupSignal
|
|
689
|
+
});
|
|
690
|
+
listeners.push({ event: "llm:tool-call-partial", listener: toolCallPartialListener });
|
|
574
691
|
const toolResultListener = (data) => {
|
|
575
692
|
if (data.sessionId !== sessionId) return;
|
|
576
693
|
eventQueue.push({ name: "llm:tool-result", ...data });
|
|
@@ -948,6 +1065,36 @@ Either:
|
|
|
948
1065
|
}
|
|
949
1066
|
return !!streamController;
|
|
950
1067
|
}
|
|
1068
|
+
// ============= WORKSPACE MANAGEMENT =============
|
|
1069
|
+
/**
|
|
1070
|
+
* Sets the active workspace for this runtime.
|
|
1071
|
+
* The workspace context is persisted and emitted via the agent event bus.
|
|
1072
|
+
*/
|
|
1073
|
+
async setWorkspace(input) {
|
|
1074
|
+
this.ensureStarted();
|
|
1075
|
+
return await this.workspaceManager.setWorkspace(input);
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Gets the currently active workspace, if any.
|
|
1079
|
+
*/
|
|
1080
|
+
async getWorkspace() {
|
|
1081
|
+
this.ensureStarted();
|
|
1082
|
+
return await this.workspaceManager.getWorkspace();
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Clears the active workspace for this runtime.
|
|
1086
|
+
*/
|
|
1087
|
+
async clearWorkspace() {
|
|
1088
|
+
this.ensureStarted();
|
|
1089
|
+
await this.workspaceManager.clearWorkspace();
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Lists all known workspaces in storage.
|
|
1093
|
+
*/
|
|
1094
|
+
async listWorkspaces() {
|
|
1095
|
+
this.ensureStarted();
|
|
1096
|
+
return await this.workspaceManager.listWorkspaces();
|
|
1097
|
+
}
|
|
951
1098
|
// ============= SESSION MANAGEMENT =============
|
|
952
1099
|
/**
|
|
953
1100
|
* Creates a new chat session or returns an existing one.
|
|
@@ -1232,7 +1379,11 @@ Either:
|
|
|
1232
1379
|
estimatedTokens: originalTokens,
|
|
1233
1380
|
sessionId
|
|
1234
1381
|
});
|
|
1235
|
-
const summaryMessages = await compactionStrategy.compact(history
|
|
1382
|
+
const summaryMessages = await compactionStrategy.compact(history, {
|
|
1383
|
+
sessionId,
|
|
1384
|
+
model: llmService.getLanguageModel(),
|
|
1385
|
+
logger: session.logger
|
|
1386
|
+
});
|
|
1236
1387
|
if (summaryMessages.length === 0) {
|
|
1237
1388
|
this.logger.debug(`Compaction skipped for session ${sessionId} - nothing to compact`);
|
|
1238
1389
|
this.agentEventBus.emit("context:compacted", {
|
|
@@ -1303,16 +1454,12 @@ Either:
|
|
|
1303
1454
|
);
|
|
1304
1455
|
const history = await contextManager.getHistory();
|
|
1305
1456
|
const runtimeConfig = this.stateManager.getRuntimeConfig(sessionId);
|
|
1306
|
-
const compactionConfig = runtimeConfig.compaction;
|
|
1307
1457
|
const modelContextWindow = contextManager.getMaxInputTokens();
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
}
|
|
1312
|
-
const
|
|
1313
|
-
if (thresholdPercent < 1) {
|
|
1314
|
-
maxContextTokens = Math.floor(maxContextTokens * thresholdPercent);
|
|
1315
|
-
}
|
|
1458
|
+
const compactionStrategy = this.compactionStrategy;
|
|
1459
|
+
const compactionSettings = compactionStrategy?.getSettings();
|
|
1460
|
+
const thresholdPercent = compactionSettings && compactionSettings.enabled ? compactionSettings.thresholdPercent : 1;
|
|
1461
|
+
const modelLimits = compactionStrategy ? compactionStrategy.getModelLimits(modelContextWindow) : { contextWindow: modelContextWindow };
|
|
1462
|
+
const maxContextTokens = thresholdPercent < 1 ? Math.floor(modelLimits.contextWindow * thresholdPercent) : modelLimits.contextWindow;
|
|
1316
1463
|
const hasSummary = history.some(
|
|
1317
1464
|
(msg) => msg.metadata?.isSummary === true || msg.metadata?.isSessionSummary === true
|
|
1318
1465
|
);
|
|
@@ -1594,6 +1741,70 @@ Either:
|
|
|
1594
1741
|
throw MCPError.connectionFailed(name, errorMessage);
|
|
1595
1742
|
}
|
|
1596
1743
|
}
|
|
1744
|
+
/**
|
|
1745
|
+
* Updates an existing MCP server configuration and reconnects if needed.
|
|
1746
|
+
* This is used when editing server params (timeout, headers, env, etc.).
|
|
1747
|
+
*
|
|
1748
|
+
* @param name The name of the server to update.
|
|
1749
|
+
* @param config The updated configuration object.
|
|
1750
|
+
* @throws MCPError if validation fails or reconnect fails.
|
|
1751
|
+
*/
|
|
1752
|
+
async updateMcpServer(name, config) {
|
|
1753
|
+
this.ensureStarted();
|
|
1754
|
+
const currentConfig = this.stateManager.getRuntimeConfig().mcpServers[name];
|
|
1755
|
+
if (!currentConfig) {
|
|
1756
|
+
throw MCPError.serverNotFound(name);
|
|
1757
|
+
}
|
|
1758
|
+
const existingServerNames = Object.keys(this.stateManager.getRuntimeConfig().mcpServers);
|
|
1759
|
+
const validation = resolveAndValidateMcpServerConfig(name, config, existingServerNames);
|
|
1760
|
+
const validatedConfig = ensureOk(validation, this.logger);
|
|
1761
|
+
this.stateManager.setMcpServer(name, validatedConfig);
|
|
1762
|
+
const shouldEnable = validatedConfig.enabled !== false;
|
|
1763
|
+
const hasClient = this.mcpManager.getClients().has(name);
|
|
1764
|
+
if (!shouldEnable) {
|
|
1765
|
+
if (hasClient) {
|
|
1766
|
+
await this.mcpManager.removeClient(name);
|
|
1767
|
+
await this.toolManager.refresh();
|
|
1768
|
+
}
|
|
1769
|
+
this.logger.info(`MCP server '${name}' updated (disabled)`);
|
|
1770
|
+
return;
|
|
1771
|
+
}
|
|
1772
|
+
try {
|
|
1773
|
+
if (hasClient) {
|
|
1774
|
+
await this.mcpManager.removeClient(name);
|
|
1775
|
+
}
|
|
1776
|
+
await this.mcpManager.connectServer(name, validatedConfig);
|
|
1777
|
+
await this.toolManager.refresh();
|
|
1778
|
+
this.agentEventBus.emit("mcp:server-connected", { name, success: true });
|
|
1779
|
+
this.agentEventBus.emit("tools:available-updated", {
|
|
1780
|
+
tools: Object.keys(await this.toolManager.getAllTools()),
|
|
1781
|
+
source: "mcp"
|
|
1782
|
+
});
|
|
1783
|
+
this.logger.info(`MCP server '${name}' updated and reconnected successfully`);
|
|
1784
|
+
const warnings = validation.issues.filter((i) => i.severity === "warning");
|
|
1785
|
+
if (warnings.length > 0) {
|
|
1786
|
+
this.logger.warn(
|
|
1787
|
+
`MCP server updated with warnings: ${warnings.map((w) => w.message).join(", ")}`
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
} catch (error) {
|
|
1791
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1792
|
+
this.logger.error(`Failed to update MCP server '${name}': ${errorMessage}`);
|
|
1793
|
+
this.stateManager.setMcpServer(name, currentConfig);
|
|
1794
|
+
if (currentConfig.enabled !== false) {
|
|
1795
|
+
try {
|
|
1796
|
+
await this.mcpManager.connectServer(name, currentConfig);
|
|
1797
|
+
await this.toolManager.refresh();
|
|
1798
|
+
} catch (reconnectError) {
|
|
1799
|
+
const reconnectMsg = reconnectError instanceof Error ? reconnectError.message : String(reconnectError);
|
|
1800
|
+
this.logger.error(
|
|
1801
|
+
`Failed to restore MCP server '${name}' after update error: ${reconnectMsg}`
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
throw MCPError.connectionFailed(name, errorMessage);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1597
1808
|
/**
|
|
1598
1809
|
* @deprecated Use `addMcpServer` instead. This method will be removed in a future version.
|
|
1599
1810
|
*/
|
|
@@ -2101,90 +2312,17 @@ Either:
|
|
|
2101
2312
|
this.ensureStarted();
|
|
2102
2313
|
return sessionId ? this.stateManager.getRuntimeConfig(sessionId) : this.stateManager.getRuntimeConfig();
|
|
2103
2314
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
*/
|
|
2110
|
-
getAgentFilePath() {
|
|
2111
|
-
if (!this.configPath) {
|
|
2112
|
-
throw AgentError.noConfigPath();
|
|
2113
|
-
}
|
|
2114
|
-
return this.configPath;
|
|
2115
|
-
}
|
|
2116
|
-
/**
|
|
2117
|
-
* Reloads the agent configuration with a new config object.
|
|
2118
|
-
* Validates the new config, detects what changed, and automatically
|
|
2119
|
-
* restarts the agent if necessary to apply the changes.
|
|
2120
|
-
*
|
|
2121
|
-
* @param newConfig The new agent configuration to apply
|
|
2122
|
-
* @returns Object containing whether agent was restarted and list of changes applied
|
|
2123
|
-
* @throws Error if config is invalid or restart fails
|
|
2124
|
-
*
|
|
2125
|
-
* TODO: improve hot reload capabilites so that we don't always require a restart
|
|
2126
|
-
*/
|
|
2127
|
-
async reload(newConfig) {
|
|
2128
|
-
this.logger.info("Reloading agent configuration");
|
|
2129
|
-
const oldConfig = this.config;
|
|
2130
|
-
const validated = AgentConfigSchema.parse(newConfig);
|
|
2131
|
-
const changesApplied = this.detectConfigChanges(oldConfig, validated);
|
|
2132
|
-
this.config = validated;
|
|
2133
|
-
let restarted = false;
|
|
2134
|
-
if (changesApplied.length > 0) {
|
|
2135
|
-
this.logger.info(
|
|
2136
|
-
`Configuration changed. Restarting agent to apply: ${changesApplied.join(", ")}`
|
|
2137
|
-
);
|
|
2138
|
-
await this.restart();
|
|
2139
|
-
restarted = true;
|
|
2140
|
-
this.logger.info("Agent restarted successfully with new configuration");
|
|
2141
|
-
} else {
|
|
2142
|
-
this.logger.info("Agent configuration reloaded successfully (no changes detected)");
|
|
2143
|
-
}
|
|
2144
|
-
return {
|
|
2145
|
-
restarted,
|
|
2146
|
-
changesApplied
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
/**
|
|
2150
|
-
* Detects configuration changes that require a full agent restart.
|
|
2151
|
-
* Pure comparison logic - no file I/O.
|
|
2152
|
-
* Returns an array of change descriptions.
|
|
2153
|
-
*
|
|
2154
|
-
* @param oldConfig Previous validated configuration
|
|
2155
|
-
* @param newConfig New validated configuration
|
|
2156
|
-
* @returns Array of restart-required change descriptions
|
|
2157
|
-
*/
|
|
2158
|
-
detectConfigChanges(oldConfig, newConfig) {
|
|
2159
|
-
const changes = [];
|
|
2160
|
-
if (JSON.stringify(oldConfig.storage) !== JSON.stringify(newConfig.storage)) {
|
|
2161
|
-
changes.push("Storage backend");
|
|
2162
|
-
}
|
|
2163
|
-
if (JSON.stringify(oldConfig.sessions) !== JSON.stringify(newConfig.sessions)) {
|
|
2164
|
-
changes.push("Session configuration");
|
|
2165
|
-
}
|
|
2166
|
-
if (JSON.stringify(oldConfig.systemPrompt) !== JSON.stringify(newConfig.systemPrompt)) {
|
|
2167
|
-
changes.push("System prompt");
|
|
2168
|
-
}
|
|
2169
|
-
if (JSON.stringify(oldConfig.toolConfirmation) !== JSON.stringify(newConfig.toolConfirmation)) {
|
|
2170
|
-
changes.push("Tool confirmation");
|
|
2171
|
-
}
|
|
2172
|
-
if (JSON.stringify(oldConfig.internalTools) !== JSON.stringify(newConfig.internalTools)) {
|
|
2173
|
-
changes.push("Internal tools");
|
|
2174
|
-
}
|
|
2175
|
-
if (JSON.stringify(oldConfig.mcpServers) !== JSON.stringify(newConfig.mcpServers)) {
|
|
2176
|
-
changes.push("MCP servers");
|
|
2177
|
-
}
|
|
2178
|
-
if (oldConfig.llm.provider !== newConfig.llm.provider || oldConfig.llm.model !== newConfig.llm.model || oldConfig.llm.apiKey !== newConfig.llm.apiKey) {
|
|
2179
|
-
changes.push("LLM configuration");
|
|
2180
|
-
}
|
|
2181
|
-
return changes;
|
|
2315
|
+
getMcpServerConfig(name) {
|
|
2316
|
+
this.ensureStarted();
|
|
2317
|
+
const config = this.stateManager.getRuntimeConfig().mcpServers[name];
|
|
2318
|
+
if (config) return config;
|
|
2319
|
+
return this.mcpManager.getServerConfig(name);
|
|
2182
2320
|
}
|
|
2183
2321
|
// ============= APPROVAL HANDLER API =============
|
|
2184
2322
|
/**
|
|
2185
2323
|
* Set a custom approval handler for manual approval mode.
|
|
2186
2324
|
*
|
|
2187
|
-
* When `
|
|
2325
|
+
* When `permissions.mode` is set to 'manual', an approval handler must be
|
|
2188
2326
|
* provided to process tool confirmation requests. The handler will be called
|
|
2189
2327
|
* whenever a tool execution requires user approval.
|
|
2190
2328
|
*
|
|
@@ -2257,10 +2395,11 @@ Either:
|
|
|
2257
2395
|
// - Memory and context management across sessions
|
|
2258
2396
|
// - Tool chaining and workflow automation
|
|
2259
2397
|
// - Agent collaboration and delegation
|
|
2260
|
-
}
|
|
2398
|
+
};
|
|
2261
2399
|
_init = __decoratorStart(null);
|
|
2262
|
-
|
|
2263
|
-
__runInitializers(_init, 1,
|
|
2400
|
+
_DextoAgent = __decorateElement(_init, 0, "DextoAgent", _DextoAgent_decorators, _DextoAgent);
|
|
2401
|
+
__runInitializers(_init, 1, _DextoAgent);
|
|
2402
|
+
let DextoAgent = _DextoAgent;
|
|
2264
2403
|
export {
|
|
2265
2404
|
DextoAgent
|
|
2266
2405
|
};
|
|
@@ -12,5 +12,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
12
12
|
return to;
|
|
13
13
|
};
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var
|
|
16
|
-
module.exports = __toCommonJS(
|
|
15
|
+
var agent_options_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(agent_options_exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BlobStore } from '../storage/blob/types.js';
|
|
2
|
+
import type { Cache } from '../storage/cache/types.js';
|
|
3
|
+
import type { Database } from '../storage/database/types.js';
|
|
4
|
+
import type { CompactionStrategy } from '../context/compaction/types.js';
|
|
5
|
+
import type { Logger } from '../logger/v2/types.js';
|
|
6
|
+
import type { Hook } from '../hooks/types.js';
|
|
7
|
+
import type { Tool } from '../tools/types.js';
|
|
8
|
+
import type { InitializeServicesOptions } from '../utils/service-initializer.js';
|
|
9
|
+
import type { DextoAgentConfigInput } from './runtime-config.js';
|
|
10
|
+
/**
|
|
11
|
+
* Constructor options for {@link DextoAgent}.
|
|
12
|
+
*
|
|
13
|
+
* This is the DI-first surface that replaces passing YAML-derived provider configs into core.
|
|
14
|
+
* Product layers (CLI/server/platform) are responsible for:
|
|
15
|
+
* - parsing/validating YAML into config sections
|
|
16
|
+
* - applying image defaults
|
|
17
|
+
* - resolving tool/storage/hook/compaction/logger instances via image factories
|
|
18
|
+
*
|
|
19
|
+
* Core normalizes + validates runtime settings (LLM/MCP/sessions/etc.) and receives concrete instances.
|
|
20
|
+
*/
|
|
21
|
+
export interface DextoAgentOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Optional service overrides for host environments (e.g. tests, servers).
|
|
24
|
+
* This preserves the existing override pattern while we migrate to a DI-first resolver.
|
|
25
|
+
*/
|
|
26
|
+
overrides?: InitializeServicesOptions | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Logger instance scoped to this agent.
|
|
29
|
+
*
|
|
30
|
+
* Product layers should typically create this from `config.logger` via `createLogger()`,
|
|
31
|
+
* but may supply a custom implementation.
|
|
32
|
+
*/
|
|
33
|
+
logger: Logger;
|
|
34
|
+
/** Concrete storage backends (DI-first). */
|
|
35
|
+
storage: {
|
|
36
|
+
blob: BlobStore;
|
|
37
|
+
database: Database;
|
|
38
|
+
cache: Cache;
|
|
39
|
+
};
|
|
40
|
+
/** Concrete tool implementations (DI-first). */
|
|
41
|
+
tools?: Tool[] | undefined;
|
|
42
|
+
/** Concrete hooks installed for the agent (DI-first). */
|
|
43
|
+
hooks?: Hook[] | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Context compaction controller (DI-first).
|
|
46
|
+
*
|
|
47
|
+
* If omitted/null, automatic compaction is disabled.
|
|
48
|
+
*/
|
|
49
|
+
compaction?: CompactionStrategy | null | undefined;
|
|
50
|
+
}
|
|
51
|
+
export interface DextoAgentOptions extends DextoAgentConfigInput {
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=agent-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-options.d.ts","sourceRoot":"","sources":["../../src/agent/agent-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAW9B;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAElD;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,4CAA4C;IAC5C,OAAO,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;IAE/D,gDAAgD;IAChD,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAE3B,yDAAyD;IACzD,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAE3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;CAAG"}
|
package/dist/agent/agentCard.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(agentCard_exports, {
|
|
|
21
21
|
createAgentCard: () => createAgentCard
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(agentCard_exports);
|
|
24
|
-
var import_schemas = require("./schemas.
|
|
24
|
+
var import_schemas = require("./schemas.js");
|
|
25
25
|
const DEFAULT_AGENT_DESCRIPTION = "Dexto is an AI assistant capable of chat and task delegation, accessible via multiple protocols.";
|
|
26
26
|
function createAgentCard(context, overrides) {
|
|
27
27
|
const { defaultName, defaultVersion, defaultBaseUrl } = context;
|