@dexto/core 1.5.8 → 1.6.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 +19 -8
- package/dist/agent/DextoAgent.cjs +318 -159
- package/dist/agent/DextoAgent.d.ts +94 -56
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +315 -156
- 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 +8 -9197
- 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 +163 -83
- package/dist/approval/manager.d.ts +50 -43
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +161 -81
- package/dist/approval/schemas.cjs +47 -32
- package/dist/approval/schemas.d.ts +291 -97
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +43 -28
- 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 +5 -3
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +4 -2
- package/dist/context/types.d.ts +3 -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 +48 -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 +26 -45
- 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 +8 -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 +12 -12
- 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 +10 -149
- 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 +8 -15
- 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 +8 -15
- 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.cjs +35 -0
- package/dist/logger/v2/dexto-logger.d.ts +22 -3
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/dexto-logger.js +35 -0
- package/dist/logger/v2/schemas.d.ts +6 -6
- package/dist/logger/v2/test-utils.cjs +2 -0
- 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/test-utils.js +2 -0
- 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 +22 -9
- 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 +19 -19
- 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 +7 -7
- 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/in-built-prompts.cjs +5 -5
- package/dist/systemPrompt/in-built-prompts.d.ts +1 -1
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +5 -5
- 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/systemPrompt/schemas.d.ts +5 -5
- package/dist/systemPrompt/types.d.ts +11 -0
- package/dist/systemPrompt/types.d.ts.map +1 -1
- 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/display-types.d.ts +10 -0
- package/dist/tools/display-types.d.ts.map +1 -1
- 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 +6 -9
- package/dist/tools/index.d.ts +3 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -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/{storage/cache/factory.cjs → tools/presentation.cjs} +26 -15
- package/dist/tools/presentation.d.ts +11 -0
- package/dist/tools/presentation.d.ts.map +1 -0
- package/dist/tools/presentation.js +24 -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 +608 -392
- package/dist/tools/tool-manager.d.ts +79 -98
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +608 -396
- package/dist/tools/types.d.ts +223 -45
- 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.cjs +10 -1
- package/dist/utils/path.d.ts +7 -4
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +10 -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.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
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import "../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { DextoAgent } from "../../agent/DextoAgent.js";
|
|
3
|
-
import {
|
|
4
|
-
resolveApiKeyForProvider,
|
|
5
|
-
getPrimaryApiKeyEnvVar,
|
|
6
|
-
PROVIDER_API_KEY_MAP
|
|
7
|
-
} from "../../utils/api-key-resolver.js";
|
|
8
|
-
async function createTestEnvironment(config, sessionId = "test-session") {
|
|
9
|
-
const agent = new DextoAgent(config);
|
|
10
|
-
await agent.start();
|
|
11
|
-
return {
|
|
12
|
-
agent,
|
|
13
|
-
sessionId,
|
|
14
|
-
cleanup: async () => {
|
|
15
|
-
if (agent.isStarted()) {
|
|
16
|
-
await agent.stop();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const TestConfigs = {
|
|
22
|
-
/**
|
|
23
|
-
* Creates OpenAI test config
|
|
24
|
-
*/
|
|
25
|
-
createOpenAIConfig() {
|
|
26
|
-
const provider = "openai";
|
|
27
|
-
const apiKey = resolveApiKeyForProvider(provider);
|
|
28
|
-
if (!apiKey) {
|
|
29
|
-
throw new Error(
|
|
30
|
-
`${getPrimaryApiKeyEnvVar(provider)} environment variable is required for OpenAI integration tests`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
systemPrompt: "You are a helpful assistant for testing purposes.",
|
|
35
|
-
llm: {
|
|
36
|
-
provider,
|
|
37
|
-
model: "gpt-4o-mini",
|
|
38
|
-
// Use cheapest non-reasoning model for testing
|
|
39
|
-
apiKey,
|
|
40
|
-
maxOutputTokens: 1e3,
|
|
41
|
-
// Enough for reasoning models (reasoning + answer)
|
|
42
|
-
temperature: 0,
|
|
43
|
-
// Deterministic responses
|
|
44
|
-
maxIterations: 1
|
|
45
|
-
// Minimal tool iterations
|
|
46
|
-
},
|
|
47
|
-
mcpServers: {},
|
|
48
|
-
storage: {
|
|
49
|
-
cache: { type: "in-memory" },
|
|
50
|
-
database: { type: "in-memory" },
|
|
51
|
-
blob: { type: "local", storePath: "/tmp/test-blobs" }
|
|
52
|
-
},
|
|
53
|
-
sessions: {
|
|
54
|
-
maxSessions: 10,
|
|
55
|
-
sessionTTL: 6e4
|
|
56
|
-
// 60s for tests
|
|
57
|
-
},
|
|
58
|
-
logger: {
|
|
59
|
-
level: "info",
|
|
60
|
-
transports: [{ type: "console" }]
|
|
61
|
-
},
|
|
62
|
-
toolConfirmation: {
|
|
63
|
-
mode: "auto-approve",
|
|
64
|
-
// Tests don't have interactive approval
|
|
65
|
-
timeout: 12e4
|
|
66
|
-
},
|
|
67
|
-
elicitation: {
|
|
68
|
-
enabled: false,
|
|
69
|
-
// Tests don't handle elicitation
|
|
70
|
-
timeout: 12e4
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* Creates Anthropic test config
|
|
76
|
-
*/
|
|
77
|
-
createAnthropicConfig() {
|
|
78
|
-
const provider = "anthropic";
|
|
79
|
-
const apiKey = resolveApiKeyForProvider(provider);
|
|
80
|
-
if (!apiKey) {
|
|
81
|
-
throw new Error(
|
|
82
|
-
`${getPrimaryApiKeyEnvVar(provider)} environment variable is required for Anthropic integration tests`
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
systemPrompt: "You are a helpful assistant for testing purposes.",
|
|
87
|
-
llm: {
|
|
88
|
-
provider,
|
|
89
|
-
model: "claude-haiku-4-5-20251001",
|
|
90
|
-
// Use cheapest model for testing
|
|
91
|
-
apiKey,
|
|
92
|
-
maxOutputTokens: 1e3,
|
|
93
|
-
// Enough for reasoning models (reasoning + answer)
|
|
94
|
-
temperature: 0,
|
|
95
|
-
maxIterations: 1
|
|
96
|
-
},
|
|
97
|
-
mcpServers: {},
|
|
98
|
-
storage: {
|
|
99
|
-
cache: { type: "in-memory" },
|
|
100
|
-
database: { type: "in-memory" },
|
|
101
|
-
blob: { type: "local", storePath: "/tmp/test-blobs" }
|
|
102
|
-
},
|
|
103
|
-
sessions: {
|
|
104
|
-
maxSessions: 10,
|
|
105
|
-
sessionTTL: 6e4
|
|
106
|
-
},
|
|
107
|
-
logger: {
|
|
108
|
-
level: "info",
|
|
109
|
-
transports: [{ type: "console" }]
|
|
110
|
-
},
|
|
111
|
-
toolConfirmation: {
|
|
112
|
-
mode: "auto-approve",
|
|
113
|
-
// Tests don't have interactive approval
|
|
114
|
-
timeout: 12e4
|
|
115
|
-
},
|
|
116
|
-
elicitation: {
|
|
117
|
-
enabled: false,
|
|
118
|
-
// Tests don't handle elicitation
|
|
119
|
-
timeout: 12e4
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
/**
|
|
124
|
-
* Creates Vercel test config - parametric for different providers/models
|
|
125
|
-
*/
|
|
126
|
-
createVercelConfig(provider = "openai", model) {
|
|
127
|
-
const apiKey = resolveApiKeyForProvider(provider);
|
|
128
|
-
if (!apiKey && providerRequiresApiKey(provider)) {
|
|
129
|
-
throw new Error(
|
|
130
|
-
`${getPrimaryApiKeyEnvVar(provider)} environment variable is required for Vercel integration tests with ${provider}`
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
const defaultModels = {
|
|
134
|
-
openai: "gpt-4o-mini",
|
|
135
|
-
anthropic: "claude-haiku-4-5-20251001",
|
|
136
|
-
google: "gemini-2.0-flash",
|
|
137
|
-
groq: "llama-3.1-8b-instant",
|
|
138
|
-
xai: "grok-beta",
|
|
139
|
-
cohere: "command-r",
|
|
140
|
-
minimax: "MiniMax-M2.1",
|
|
141
|
-
glm: "glm-4.7",
|
|
142
|
-
"openai-compatible": "gpt-5-mini",
|
|
143
|
-
openrouter: "anthropic/claude-3.5-haiku",
|
|
144
|
-
// OpenRouter model format: provider/model
|
|
145
|
-
litellm: "gpt-4",
|
|
146
|
-
// LiteLLM model names follow the provider's convention
|
|
147
|
-
glama: "openai/gpt-4o",
|
|
148
|
-
// Glama model format: provider/model
|
|
149
|
-
vertex: "gemini-2.5-pro",
|
|
150
|
-
// Vertex AI uses ADC auth, not API keys
|
|
151
|
-
bedrock: "anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
152
|
-
// Bedrock uses AWS credentials, not API keys
|
|
153
|
-
local: "llama-3.2-3b-q4",
|
|
154
|
-
// Native node-llama-cpp GGUF models
|
|
155
|
-
ollama: "llama3.2",
|
|
156
|
-
// Ollama server models
|
|
157
|
-
"dexto-nova": "anthropic/claude-4.5-sonnet"
|
|
158
|
-
// Dexto gateway (OpenRouter model format)
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
systemPrompt: "You are a helpful assistant for testing purposes.",
|
|
162
|
-
llm: {
|
|
163
|
-
provider,
|
|
164
|
-
model: model || defaultModels[provider],
|
|
165
|
-
apiKey,
|
|
166
|
-
maxOutputTokens: 1e3,
|
|
167
|
-
// Enough for reasoning models (reasoning + answer)
|
|
168
|
-
temperature: 0,
|
|
169
|
-
maxIterations: 1
|
|
170
|
-
},
|
|
171
|
-
mcpServers: {},
|
|
172
|
-
storage: {
|
|
173
|
-
cache: { type: "in-memory" },
|
|
174
|
-
database: { type: "in-memory" },
|
|
175
|
-
blob: { type: "local", storePath: "/tmp/test-blobs" }
|
|
176
|
-
},
|
|
177
|
-
sessions: {
|
|
178
|
-
maxSessions: 10,
|
|
179
|
-
sessionTTL: 6e4
|
|
180
|
-
},
|
|
181
|
-
logger: {
|
|
182
|
-
level: "info",
|
|
183
|
-
transports: [{ type: "console" }]
|
|
184
|
-
},
|
|
185
|
-
toolConfirmation: {
|
|
186
|
-
mode: "auto-approve",
|
|
187
|
-
// Tests don't have interactive approval
|
|
188
|
-
timeout: 12e4
|
|
189
|
-
},
|
|
190
|
-
elicitation: {
|
|
191
|
-
enabled: false,
|
|
192
|
-
// Tests don't handle elicitation
|
|
193
|
-
timeout: 12e4
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
function providerRequiresApiKey(provider) {
|
|
199
|
-
const envVars = PROVIDER_API_KEY_MAP[provider];
|
|
200
|
-
return envVars && envVars.length > 0;
|
|
201
|
-
}
|
|
202
|
-
function requiresApiKey(provider) {
|
|
203
|
-
return !!resolveApiKeyForProvider(provider);
|
|
204
|
-
}
|
|
205
|
-
async function cleanupTestEnvironment(_env) {
|
|
206
|
-
await _env.cleanup();
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
TestConfigs,
|
|
210
|
-
cleanupTestEnvironment,
|
|
211
|
-
createTestEnvironment,
|
|
212
|
-
providerRequiresApiKey,
|
|
213
|
-
requiresApiKey
|
|
214
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { DextoPlugin, PluginResult, BeforeLLMRequestPayload, PluginExecutionContext } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration options for the ContentPolicy plugin
|
|
4
|
-
*/
|
|
5
|
-
export interface ContentPolicyConfig {
|
|
6
|
-
maxInputChars?: number;
|
|
7
|
-
redactEmails?: boolean;
|
|
8
|
-
redactApiKeys?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* ContentPolicy Plugin
|
|
12
|
-
*
|
|
13
|
-
* Enforces content policies on LLM requests including:
|
|
14
|
-
* - Abusive language detection (blocking)
|
|
15
|
-
* - Input length limits
|
|
16
|
-
* - Email address redaction
|
|
17
|
-
* - API key redaction
|
|
18
|
-
*
|
|
19
|
-
* Ported from feat/hooks content-policy hook implementation
|
|
20
|
-
*/
|
|
21
|
-
export declare class ContentPolicyPlugin implements DextoPlugin {
|
|
22
|
-
private config;
|
|
23
|
-
initialize(config: Record<string, any>): Promise<void>;
|
|
24
|
-
beforeLLMRequest(payload: BeforeLLMRequestPayload, _context: PluginExecutionContext): Promise<PluginResult>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=content-policy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-policy.d.ts","sourceRoot":"","sources":["../../../src/plugins/builtins/content-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,WAAW,EACX,YAAY,EAEZ,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAgBD;;;;;;;;;;GAUG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACnD,OAAO,CAAC,MAAM,CAA2C;IAEnD,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtD,gBAAgB,CAClB,OAAO,EAAE,uBAAuB,EAChC,QAAQ,EAAE,sBAAsB,GACjC,OAAO,CAAC,YAAY,CAAC;CA6E3B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { DextoPlugin, BeforeResponsePayload, PluginExecutionContext, PluginResult } from '../types.js';
|
|
2
|
-
export interface ResponseSanitizerConfig {
|
|
3
|
-
redactEmails?: boolean;
|
|
4
|
-
redactApiKeys?: boolean;
|
|
5
|
-
maxResponseLength?: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Response sanitizer built-in plugin
|
|
9
|
-
*
|
|
10
|
-
* This plugin redacts sensitive information from LLM responses to prevent accidental leakage:
|
|
11
|
-
* - Email addresses
|
|
12
|
-
* - API keys and tokens
|
|
13
|
-
* - Optional: Truncates responses that exceed length limits
|
|
14
|
-
*
|
|
15
|
-
* This demonstrates how plugins can modify response content before it's sent to users,
|
|
16
|
-
* using the beforeResponse extension point.
|
|
17
|
-
*/
|
|
18
|
-
export declare class ResponseSanitizerPlugin implements DextoPlugin {
|
|
19
|
-
private redactEmails;
|
|
20
|
-
private redactApiKeys;
|
|
21
|
-
private maxResponseLength;
|
|
22
|
-
initialize(config: Record<string, any>): Promise<void>;
|
|
23
|
-
beforeResponse(payload: BeforeResponsePayload, _context: PluginExecutionContext): Promise<PluginResult>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=response-sanitizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response-sanitizer.d.ts","sourceRoot":"","sources":["../../../src/plugins/builtins/response-sanitizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EAEf,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,uBAAuB;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAQD;;;;;;;;;;GAUG;AACH,qBAAa,uBAAwB,YAAW,WAAW;IACvD,OAAO,CAAC,YAAY,CAAkC;IACtD,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,iBAAiB,CAAsC;IAEzD,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtD,cAAc,CAChB,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,sBAAsB,GACjC,OAAO,CAAC,YAAY,CAAC;CAyE3B"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var error_codes_exports = {};
|
|
20
|
-
__export(error_codes_exports, {
|
|
21
|
-
PluginErrorCode: () => PluginErrorCode
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(error_codes_exports);
|
|
24
|
-
var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
|
|
25
|
-
PluginErrorCode2["PLUGIN_LOAD_FAILED"] = "PLUGIN_LOAD_FAILED";
|
|
26
|
-
PluginErrorCode2["PLUGIN_INVALID_SHAPE"] = "PLUGIN_INVALID_SHAPE";
|
|
27
|
-
PluginErrorCode2["PLUGIN_INSTANTIATION_FAILED"] = "PLUGIN_INSTANTIATION_FAILED";
|
|
28
|
-
PluginErrorCode2["PLUGIN_INITIALIZATION_FAILED"] = "PLUGIN_INITIALIZATION_FAILED";
|
|
29
|
-
PluginErrorCode2["PLUGIN_CONFIGURATION_INVALID"] = "PLUGIN_CONFIGURATION_INVALID";
|
|
30
|
-
PluginErrorCode2["PLUGIN_EXECUTION_FAILED"] = "PLUGIN_EXECUTION_FAILED";
|
|
31
|
-
PluginErrorCode2["PLUGIN_EXECUTION_TIMEOUT"] = "PLUGIN_EXECUTION_TIMEOUT";
|
|
32
|
-
PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
|
|
33
|
-
PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
|
|
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";
|
|
38
|
-
return PluginErrorCode2;
|
|
39
|
-
})(PluginErrorCode || {});
|
|
40
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 && (module.exports = {
|
|
42
|
-
PluginErrorCode
|
|
43
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin-specific error codes
|
|
3
|
-
* Used for plugin loading, validation, and execution errors
|
|
4
|
-
*/
|
|
5
|
-
export declare enum PluginErrorCode {
|
|
6
|
-
/** Plugin file not found or cannot be loaded */
|
|
7
|
-
PLUGIN_LOAD_FAILED = "PLUGIN_LOAD_FAILED",
|
|
8
|
-
/** Plugin does not implement required interface */
|
|
9
|
-
PLUGIN_INVALID_SHAPE = "PLUGIN_INVALID_SHAPE",
|
|
10
|
-
/** Plugin constructor threw an error */
|
|
11
|
-
PLUGIN_INSTANTIATION_FAILED = "PLUGIN_INSTANTIATION_FAILED",
|
|
12
|
-
/** Plugin initialization failed */
|
|
13
|
-
PLUGIN_INITIALIZATION_FAILED = "PLUGIN_INITIALIZATION_FAILED",
|
|
14
|
-
/** Plugin configuration is invalid */
|
|
15
|
-
PLUGIN_CONFIGURATION_INVALID = "PLUGIN_CONFIGURATION_INVALID",
|
|
16
|
-
/** Plugin execution failed */
|
|
17
|
-
PLUGIN_EXECUTION_FAILED = "PLUGIN_EXECUTION_FAILED",
|
|
18
|
-
/** Plugin execution timed out */
|
|
19
|
-
PLUGIN_EXECUTION_TIMEOUT = "PLUGIN_EXECUTION_TIMEOUT",
|
|
20
|
-
/** Plugin blocked execution */
|
|
21
|
-
PLUGIN_BLOCKED_EXECUTION = "PLUGIN_BLOCKED_EXECUTION",
|
|
22
|
-
/** Duplicate plugin priority */
|
|
23
|
-
PLUGIN_DUPLICATE_PRIORITY = "PLUGIN_DUPLICATE_PRIORITY",
|
|
24
|
-
/** Required dependency not installed for plugin loading */
|
|
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"
|
|
32
|
-
}
|
|
33
|
-
export type { PluginErrorCode as default };
|
|
34
|
-
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "../chunk-PTJYTZNU.js";
|
|
2
|
-
var PluginErrorCode = /* @__PURE__ */ ((PluginErrorCode2) => {
|
|
3
|
-
PluginErrorCode2["PLUGIN_LOAD_FAILED"] = "PLUGIN_LOAD_FAILED";
|
|
4
|
-
PluginErrorCode2["PLUGIN_INVALID_SHAPE"] = "PLUGIN_INVALID_SHAPE";
|
|
5
|
-
PluginErrorCode2["PLUGIN_INSTANTIATION_FAILED"] = "PLUGIN_INSTANTIATION_FAILED";
|
|
6
|
-
PluginErrorCode2["PLUGIN_INITIALIZATION_FAILED"] = "PLUGIN_INITIALIZATION_FAILED";
|
|
7
|
-
PluginErrorCode2["PLUGIN_CONFIGURATION_INVALID"] = "PLUGIN_CONFIGURATION_INVALID";
|
|
8
|
-
PluginErrorCode2["PLUGIN_EXECUTION_FAILED"] = "PLUGIN_EXECUTION_FAILED";
|
|
9
|
-
PluginErrorCode2["PLUGIN_EXECUTION_TIMEOUT"] = "PLUGIN_EXECUTION_TIMEOUT";
|
|
10
|
-
PluginErrorCode2["PLUGIN_BLOCKED_EXECUTION"] = "PLUGIN_BLOCKED_EXECUTION";
|
|
11
|
-
PluginErrorCode2["PLUGIN_DUPLICATE_PRIORITY"] = "PLUGIN_DUPLICATE_PRIORITY";
|
|
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";
|
|
16
|
-
return PluginErrorCode2;
|
|
17
|
-
})(PluginErrorCode || {});
|
|
18
|
-
export {
|
|
19
|
-
PluginErrorCode
|
|
20
|
-
};
|
package/dist/plugins/index.cjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var plugins_exports = {};
|
|
20
|
-
__export(plugins_exports, {
|
|
21
|
-
BuiltInPluginConfigSchema: () => import_schemas.BuiltInPluginConfigSchema,
|
|
22
|
-
ContentPolicyPlugin: () => import_content_policy.ContentPolicyPlugin,
|
|
23
|
-
CustomPluginConfigSchema: () => import_schemas.CustomPluginConfigSchema,
|
|
24
|
-
PluginErrorCode: () => import_error_codes.PluginErrorCode,
|
|
25
|
-
PluginManager: () => import_manager.PluginManager,
|
|
26
|
-
PluginRegistry: () => import_registry.PluginRegistry,
|
|
27
|
-
PluginsConfigSchema: () => import_schemas.PluginsConfigSchema,
|
|
28
|
-
RegistryPluginConfigSchema: () => import_schemas.RegistryPluginConfigSchema,
|
|
29
|
-
ResponseSanitizerPlugin: () => import_response_sanitizer.ResponseSanitizerPlugin,
|
|
30
|
-
loadPluginModule: () => import_loader.loadPluginModule,
|
|
31
|
-
pluginRegistry: () => import_registry.pluginRegistry,
|
|
32
|
-
registerBuiltInPlugins: () => import_builtins.registerBuiltInPlugins,
|
|
33
|
-
resolvePluginPath: () => import_loader.resolvePluginPath,
|
|
34
|
-
validatePluginShape: () => import_loader.validatePluginShape
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(plugins_exports);
|
|
37
|
-
var import_manager = require("./manager.js");
|
|
38
|
-
var import_schemas = require("./schemas.js");
|
|
39
|
-
var import_registry = require("./registry.js");
|
|
40
|
-
var import_error_codes = require("./error-codes.js");
|
|
41
|
-
var import_loader = require("./loader.js");
|
|
42
|
-
var import_builtins = require("./registrations/builtins.js");
|
|
43
|
-
var import_content_policy = require("./builtins/content-policy.js");
|
|
44
|
-
var import_response_sanitizer = require("./builtins/response-sanitizer.js");
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
BuiltInPluginConfigSchema,
|
|
48
|
-
ContentPolicyPlugin,
|
|
49
|
-
CustomPluginConfigSchema,
|
|
50
|
-
PluginErrorCode,
|
|
51
|
-
PluginManager,
|
|
52
|
-
PluginRegistry,
|
|
53
|
-
PluginsConfigSchema,
|
|
54
|
-
RegistryPluginConfigSchema,
|
|
55
|
-
ResponseSanitizerPlugin,
|
|
56
|
-
loadPluginModule,
|
|
57
|
-
pluginRegistry,
|
|
58
|
-
registerBuiltInPlugins,
|
|
59
|
-
resolvePluginPath,
|
|
60
|
-
validatePluginShape
|
|
61
|
-
});
|
package/dist/plugins/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin System
|
|
3
|
-
*
|
|
4
|
-
* Unified plugin architecture for extending agent behavior at key extension points.
|
|
5
|
-
* Replaces the hooks system from PR #385 with a more flexible plugin model.
|
|
6
|
-
*/
|
|
7
|
-
export type { DextoPlugin, PluginConfig, PluginExecutionContext, PluginResult, PluginNotice, ExtensionPoint, BeforeLLMRequestPayload, BeforeToolCallPayload, AfterToolResultPayload, BeforeResponsePayload, } from './types.js';
|
|
8
|
-
export { PluginManager } from './manager.js';
|
|
9
|
-
export type { PluginManagerOptions, ExecutionContextOptions } from './manager.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';
|
|
14
|
-
export { PluginErrorCode } from './error-codes.js';
|
|
15
|
-
export { loadPluginModule, resolvePluginPath, validatePluginShape } from './loader.js';
|
|
16
|
-
export { registerBuiltInPlugins } from './registrations/builtins.js';
|
|
17
|
-
export { ContentPolicyPlugin } from './builtins/content-policy.js';
|
|
18
|
-
export type { ContentPolicyConfig } from './builtins/content-policy.js';
|
|
19
|
-
export { ResponseSanitizerPlugin } from './builtins/response-sanitizer.js';
|
|
20
|
-
export type { ResponseSanitizerConfig } from './builtins/response-sanitizer.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAAC;AAC7C,YAAY,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGlF,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,GAC7B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGhG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/plugins/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "../chunk-PTJYTZNU.js";
|
|
2
|
-
import { PluginManager } from "./manager.js";
|
|
3
|
-
import {
|
|
4
|
-
CustomPluginConfigSchema,
|
|
5
|
-
BuiltInPluginConfigSchema,
|
|
6
|
-
PluginsConfigSchema,
|
|
7
|
-
RegistryPluginConfigSchema
|
|
8
|
-
} from "./schemas.js";
|
|
9
|
-
import { PluginRegistry, pluginRegistry } from "./registry.js";
|
|
10
|
-
import { PluginErrorCode } from "./error-codes.js";
|
|
11
|
-
import { loadPluginModule, resolvePluginPath, validatePluginShape } from "./loader.js";
|
|
12
|
-
import { registerBuiltInPlugins } from "./registrations/builtins.js";
|
|
13
|
-
import { ContentPolicyPlugin } from "./builtins/content-policy.js";
|
|
14
|
-
import { ResponseSanitizerPlugin } from "./builtins/response-sanitizer.js";
|
|
15
|
-
export {
|
|
16
|
-
BuiltInPluginConfigSchema,
|
|
17
|
-
ContentPolicyPlugin,
|
|
18
|
-
CustomPluginConfigSchema,
|
|
19
|
-
PluginErrorCode,
|
|
20
|
-
PluginManager,
|
|
21
|
-
PluginRegistry,
|
|
22
|
-
PluginsConfigSchema,
|
|
23
|
-
RegistryPluginConfigSchema,
|
|
24
|
-
ResponseSanitizerPlugin,
|
|
25
|
-
loadPluginModule,
|
|
26
|
-
pluginRegistry,
|
|
27
|
-
registerBuiltInPlugins,
|
|
28
|
-
resolvePluginPath,
|
|
29
|
-
validatePluginShape
|
|
30
|
-
};
|
package/dist/plugins/loader.cjs
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var loader_exports = {};
|
|
20
|
-
__export(loader_exports, {
|
|
21
|
-
loadPluginModule: () => loadPluginModule,
|
|
22
|
-
resolvePluginPath: () => resolvePluginPath,
|
|
23
|
-
validatePluginShape: () => validatePluginShape
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(loader_exports);
|
|
26
|
-
var import_path = require("path");
|
|
27
|
-
var import_url = require("url");
|
|
28
|
-
var import_errors = require("../errors/index.js");
|
|
29
|
-
var import_error_codes = require("./error-codes.js");
|
|
30
|
-
const import_meta = {};
|
|
31
|
-
function validatePluginShape(PluginClass, pluginName) {
|
|
32
|
-
if (typeof PluginClass !== "function" || !PluginClass.prototype) {
|
|
33
|
-
throw new import_errors.DextoRuntimeError(
|
|
34
|
-
import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
|
|
35
|
-
import_errors.ErrorScope.PLUGIN,
|
|
36
|
-
import_errors.ErrorType.USER,
|
|
37
|
-
`Plugin '${pluginName}' default export must be a class or constructor function`
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const proto = PluginClass.prototype;
|
|
41
|
-
const extensionPoints = [
|
|
42
|
-
"beforeLLMRequest",
|
|
43
|
-
"beforeToolCall",
|
|
44
|
-
"afterToolResult",
|
|
45
|
-
"beforeResponse"
|
|
46
|
-
];
|
|
47
|
-
const hasExtensionPoint = extensionPoints.some((point) => typeof proto[point] === "function");
|
|
48
|
-
if (!hasExtensionPoint) {
|
|
49
|
-
throw new import_errors.DextoRuntimeError(
|
|
50
|
-
import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
|
|
51
|
-
import_errors.ErrorScope.PLUGIN,
|
|
52
|
-
import_errors.ErrorType.USER,
|
|
53
|
-
`Plugin '${pluginName}' must implement at least one extension point method`,
|
|
54
|
-
{ availableExtensionPoints: extensionPoints }
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
if ("initialize" in proto && typeof proto.initialize !== "function") {
|
|
58
|
-
throw new import_errors.DextoRuntimeError(
|
|
59
|
-
import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
|
|
60
|
-
import_errors.ErrorScope.PLUGIN,
|
|
61
|
-
import_errors.ErrorType.USER,
|
|
62
|
-
`Plugin '${pluginName}' initialize property must be a function (found ${typeof proto.initialize})`
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
if ("cleanup" in proto && typeof proto.cleanup !== "function") {
|
|
66
|
-
throw new import_errors.DextoRuntimeError(
|
|
67
|
-
import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
|
|
68
|
-
import_errors.ErrorScope.PLUGIN,
|
|
69
|
-
import_errors.ErrorType.USER,
|
|
70
|
-
`Plugin '${pluginName}' cleanup property must be a function (found ${typeof proto.cleanup})`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function resolvePluginPath(modulePath, configDir) {
|
|
75
|
-
if (!(0, import_path.isAbsolute)(modulePath)) {
|
|
76
|
-
throw new import_errors.DextoRuntimeError(
|
|
77
|
-
import_error_codes.PluginErrorCode.PLUGIN_CONFIGURATION_INVALID,
|
|
78
|
-
import_errors.ErrorScope.PLUGIN,
|
|
79
|
-
import_errors.ErrorType.USER,
|
|
80
|
-
"Plugin module path must be absolute (got '" + modulePath + "'). Use ${{dexto.agent_dir}} template variable for agent-relative paths.",
|
|
81
|
-
{
|
|
82
|
-
modulePath,
|
|
83
|
-
configDir,
|
|
84
|
-
hint: 'Example: module: "${{dexto.agent_dir}}/plugins/my-plugin.ts"'
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
return modulePath;
|
|
89
|
-
}
|
|
90
|
-
async function loadPluginModule(modulePath, pluginName) {
|
|
91
|
-
try {
|
|
92
|
-
let pluginModule;
|
|
93
|
-
if (modulePath.endsWith(".ts") || modulePath.endsWith(".tsx")) {
|
|
94
|
-
if (typeof process === "undefined" || !process.versions?.node) {
|
|
95
|
-
throw new import_errors.DextoRuntimeError(
|
|
96
|
-
import_error_codes.PluginErrorCode.PLUGIN_LOAD_FAILED,
|
|
97
|
-
import_errors.ErrorScope.PLUGIN,
|
|
98
|
-
import_errors.ErrorType.SYSTEM,
|
|
99
|
-
`Cannot load TypeScript plugin '${pluginName}' in browser environment. Plugins with .ts extension require Node.js runtime.`,
|
|
100
|
-
{ modulePath, pluginName }
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
const tsxPackage = "tsx/esm/api";
|
|
104
|
-
let tsx;
|
|
105
|
-
try {
|
|
106
|
-
tsx = await import(
|
|
107
|
-
/* webpackIgnore: true */
|
|
108
|
-
tsxPackage
|
|
109
|
-
);
|
|
110
|
-
} catch (importError) {
|
|
111
|
-
const err = importError;
|
|
112
|
-
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
113
|
-
throw new import_errors.DextoRuntimeError(
|
|
114
|
-
import_error_codes.PluginErrorCode.PLUGIN_DEPENDENCY_NOT_INSTALLED,
|
|
115
|
-
import_errors.ErrorScope.PLUGIN,
|
|
116
|
-
import_errors.ErrorType.USER,
|
|
117
|
-
`Cannot load TypeScript plugin '${pluginName}': tsx package is not installed.
|
|
118
|
-
Install with: npm install tsx
|
|
119
|
-
Or pre-compile your plugin to .js for production use.`,
|
|
120
|
-
{ modulePath, pluginName, packageName: "tsx" }
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
throw importError;
|
|
124
|
-
}
|
|
125
|
-
const moduleUrl = (0, import_url.pathToFileURL)(modulePath).href;
|
|
126
|
-
pluginModule = await tsx.tsImport(moduleUrl, import_meta.url);
|
|
127
|
-
} else {
|
|
128
|
-
const moduleUrl = (0, import_url.pathToFileURL)(modulePath).href;
|
|
129
|
-
pluginModule = await import(
|
|
130
|
-
/* webpackIgnore: true */
|
|
131
|
-
moduleUrl
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
let PluginClass = pluginModule.default;
|
|
135
|
-
if (PluginClass && typeof PluginClass === "object" && "default" in PluginClass) {
|
|
136
|
-
PluginClass = PluginClass.default;
|
|
137
|
-
}
|
|
138
|
-
if (!PluginClass) {
|
|
139
|
-
throw new import_errors.DextoRuntimeError(
|
|
140
|
-
import_error_codes.PluginErrorCode.PLUGIN_INVALID_SHAPE,
|
|
141
|
-
import_errors.ErrorScope.PLUGIN,
|
|
142
|
-
import_errors.ErrorType.USER,
|
|
143
|
-
`Plugin '${pluginName}' at '${modulePath}' has no default export. Ensure your plugin exports a class as default.`,
|
|
144
|
-
{ modulePath, pluginName }
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
validatePluginShape(PluginClass, pluginName);
|
|
148
|
-
return PluginClass;
|
|
149
|
-
} catch (error) {
|
|
150
|
-
if (error instanceof import_errors.DextoRuntimeError) {
|
|
151
|
-
throw error;
|
|
152
|
-
}
|
|
153
|
-
throw new import_errors.DextoRuntimeError(
|
|
154
|
-
import_error_codes.PluginErrorCode.PLUGIN_LOAD_FAILED,
|
|
155
|
-
import_errors.ErrorScope.PLUGIN,
|
|
156
|
-
import_errors.ErrorType.SYSTEM,
|
|
157
|
-
`Failed to load plugin '${pluginName}' from '${modulePath}': ${error instanceof Error ? error.message : String(error)}`,
|
|
158
|
-
{
|
|
159
|
-
modulePath,
|
|
160
|
-
pluginName,
|
|
161
|
-
originalError: error instanceof Error ? error.message : String(error)
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
167
|
-
0 && (module.exports = {
|
|
168
|
-
loadPluginModule,
|
|
169
|
-
resolvePluginPath,
|
|
170
|
-
validatePluginShape
|
|
171
|
-
});
|