@dexto/core 1.4.0 → 1.5.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 +36 -0
- package/dist/agent/DextoAgent.cjs +22 -3
- package/dist/agent/DextoAgent.d.ts +19 -2
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +23 -4
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +5 -1
- package/dist/agent/schemas.cjs +90 -71
- package/dist/agent/schemas.d.ts +5911 -96
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +87 -66
- package/dist/approval/manager.cjs +165 -1
- package/dist/approval/manager.d.ts +91 -2
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +155 -1
- package/dist/approval/schemas.cjs +39 -3
- package/dist/approval/schemas.d.ts +238 -1
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +35 -3
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +26 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -0
- package/dist/context/compaction/factory.cjs +57 -0
- package/dist/context/compaction/factory.d.ts +17 -0
- package/dist/context/compaction/factory.d.ts.map +1 -0
- package/dist/context/compaction/factory.js +34 -0
- package/dist/context/compaction/index.cjs +49 -0
- package/dist/context/compaction/index.d.ts +11 -0
- package/dist/context/compaction/index.d.ts.map +1 -0
- package/dist/context/compaction/index.js +19 -0
- package/dist/context/{compression → compaction}/overflow.cjs +3 -3
- package/dist/context/{compression → compaction}/overflow.d.ts +4 -4
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction}/overflow.js +2 -2
- package/dist/context/compaction/provider.cjs +16 -0
- package/dist/context/compaction/provider.d.ts +48 -0
- package/dist/context/compaction/provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.cjs +48 -0
- package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
- package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.js +24 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
- package/dist/context/compaction/registry.cjs +39 -0
- package/dist/context/compaction/registry.d.ts +19 -0
- package/dist/context/compaction/registry.d.ts.map +1 -0
- package/dist/context/compaction/registry.js +16 -0
- package/dist/context/compaction/schemas.cjs +38 -0
- package/dist/context/compaction/schemas.d.ts +24 -0
- package/dist/context/compaction/schemas.d.ts.map +1 -0
- package/dist/context/compaction/schemas.js +14 -0
- package/dist/context/compaction/strategies/noop.cjs +36 -0
- package/dist/context/compaction/strategies/noop.d.ts +18 -0
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
- package/dist/context/compaction/strategies/noop.js +13 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.cjs +3 -3
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.d.ts +6 -6
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.js +4 -4
- package/dist/context/{compression → compaction}/types.d.ts +4 -4
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/compaction/types.js +0 -0
- package/dist/context/error-codes.cjs +4 -0
- package/dist/context/error-codes.d.ts +4 -0
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +4 -0
- package/dist/context/errors.cjs +40 -0
- package/dist/context/errors.d.ts +14 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +40 -0
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/types.d.ts +6 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +27 -7
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +27 -7
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +2 -3
- package/dist/events/index.cjs +2 -2
- package/dist/events/index.d.ts +16 -16
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +2 -2
- package/dist/filesystem/filesystem-service.cjs +39 -0
- package/dist/filesystem/filesystem-service.d.ts +32 -0
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +39 -0
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/path-validator.cjs +69 -1
- package/dist/filesystem/path-validator.d.ts +43 -2
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +69 -1
- package/dist/image/define-image.cjs +146 -0
- package/dist/image/define-image.d.ts +71 -0
- package/dist/image/define-image.d.ts.map +1 -0
- package/dist/image/define-image.js +121 -0
- package/dist/image/index.cjs +32 -0
- package/dist/image/index.d.ts +53 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +7 -0
- package/dist/image/types.cjs +16 -0
- package/dist/image/types.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/llm/error-codes.cjs +1 -0
- package/dist/llm/error-codes.d.ts +1 -0
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +1 -0
- package/dist/llm/errors.cjs +24 -0
- package/dist/llm/errors.d.ts +19 -6
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +24 -0
- package/dist/llm/executor/stream-processor.cjs +11 -3
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +11 -3
- package/dist/llm/executor/turn-executor.cjs +50 -23
- package/dist/llm/executor/turn-executor.d.ts +6 -5
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +50 -23
- package/dist/llm/formatters/vercel.cjs +6 -2
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +6 -2
- package/dist/llm/index.cjs +18 -1
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +14 -0
- package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
- package/dist/llm/providers/local/downloader.cjs +291 -0
- package/dist/llm/providers/local/downloader.d.ts +82 -0
- package/dist/llm/providers/local/downloader.d.ts.map +1 -0
- package/dist/llm/providers/local/downloader.js +251 -0
- package/dist/llm/providers/local/error-codes.cjs +57 -0
- package/dist/llm/providers/local/error-codes.d.ts +66 -0
- package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
- package/dist/llm/providers/local/error-codes.js +34 -0
- package/dist/llm/providers/local/errors.cjs +240 -0
- package/dist/llm/providers/local/errors.d.ts +31 -0
- package/dist/llm/providers/local/errors.d.ts.map +1 -0
- package/dist/llm/providers/local/errors.js +217 -0
- package/dist/llm/providers/local/gpu-detector.cjs +214 -0
- package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
- package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
- package/dist/llm/providers/local/gpu-detector.js +178 -0
- package/dist/llm/providers/local/index.cjs +147 -0
- package/dist/llm/providers/local/index.d.ts +21 -0
- package/dist/llm/providers/local/index.d.ts.map +1 -0
- package/dist/llm/providers/local/index.js +126 -0
- package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/node-llama-provider.js +176 -0
- package/dist/llm/providers/local/ollama-provider.cjs +230 -0
- package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
- package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/ollama-provider.js +198 -0
- package/dist/llm/providers/local/registry.cjs +343 -0
- package/dist/llm/providers/local/registry.d.ts +51 -0
- package/dist/llm/providers/local/registry.d.ts.map +1 -0
- package/dist/llm/providers/local/registry.js +312 -0
- package/dist/llm/providers/local/schemas.cjs +169 -0
- package/dist/llm/providers/local/schemas.d.ts +395 -0
- package/dist/llm/providers/local/schemas.d.ts.map +1 -0
- package/dist/llm/providers/local/schemas.js +133 -0
- package/dist/llm/providers/local/types.cjs +16 -0
- package/dist/llm/providers/local/types.d.ts +219 -0
- package/dist/llm/providers/local/types.d.ts.map +1 -0
- package/dist/llm/providers/local/types.js +0 -0
- package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
- package/dist/llm/providers/openrouter-model-registry.js +309 -0
- package/dist/llm/registry.cjs +535 -9
- package/dist/llm/registry.d.ts +26 -0
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +532 -9
- package/dist/llm/resolver.cjs +63 -5
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -6
- package/dist/llm/schemas.cjs +90 -80
- package/dist/llm/schemas.d.ts +158 -22
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +90 -80
- package/dist/llm/services/factory.cjs +87 -13
- package/dist/llm/services/factory.d.ts +4 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +85 -12
- package/dist/llm/services/test-utils.integration.cjs +22 -2
- package/dist/llm/services/test-utils.integration.d.ts +7 -1
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +26 -3
- package/dist/llm/services/vercel.cjs +5 -2
- package/dist/llm/services/vercel.d.ts +3 -2
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +5 -2
- package/dist/llm/types.cjs +11 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +11 -1
- package/dist/mcp/manager.cjs +8 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +8 -0
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +0 -3
- package/dist/memory/schemas.d.ts +1 -1
- package/dist/plugins/error-codes.cjs +3 -0
- package/dist/plugins/error-codes.d.ts +7 -1
- package/dist/plugins/error-codes.d.ts.map +1 -1
- package/dist/plugins/error-codes.js +3 -0
- package/dist/plugins/index.cjs +7 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +6 -1
- package/dist/plugins/manager.cjs +92 -7
- package/dist/plugins/manager.d.ts +10 -3
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +92 -7
- package/dist/plugins/registry.cjs +63 -0
- package/dist/plugins/registry.d.ts +101 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +39 -0
- package/dist/plugins/schemas.cjs +17 -5
- package/dist/plugins/schemas.d.ts +62 -5
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +15 -4
- package/dist/providers/base-registry.cjs +147 -0
- package/dist/providers/base-registry.d.ts +147 -0
- package/dist/providers/base-registry.d.ts.map +1 -0
- package/dist/providers/base-registry.js +123 -0
- package/dist/providers/discovery.cjs +95 -0
- package/dist/providers/discovery.d.ts +94 -0
- package/dist/providers/discovery.d.ts.map +1 -0
- package/dist/providers/discovery.js +70 -0
- package/dist/providers/index.cjs +24 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +3 -3
- package/dist/session/chat-session.cjs +20 -3
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +21 -4
- package/dist/storage/blob/factory.cjs +8 -11
- package/dist/storage/blob/factory.d.ts +32 -6
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +8 -11
- package/dist/storage/blob/index.cjs +56 -0
- package/dist/storage/blob/index.d.ts +45 -0
- package/dist/storage/blob/index.d.ts.map +1 -0
- package/dist/storage/blob/index.js +30 -0
- package/dist/storage/blob/provider.cjs +16 -0
- package/dist/storage/blob/provider.d.ts +50 -0
- package/dist/storage/blob/provider.d.ts.map +1 -0
- package/dist/storage/blob/provider.js +0 -0
- package/dist/storage/blob/providers/index.cjs +31 -0
- package/dist/storage/blob/providers/index.d.ts +8 -0
- package/dist/storage/blob/providers/index.d.ts.map +1 -0
- package/dist/storage/blob/providers/index.js +7 -0
- package/dist/storage/blob/providers/local.cjs +39 -0
- package/dist/storage/blob/providers/local.d.ts +17 -0
- package/dist/storage/blob/providers/local.d.ts.map +1 -0
- package/dist/storage/blob/providers/local.js +16 -0
- package/dist/storage/blob/providers/memory.cjs +39 -0
- package/dist/storage/blob/providers/memory.d.ts +17 -0
- package/dist/storage/blob/providers/memory.d.ts.map +1 -0
- package/dist/storage/blob/providers/memory.js +16 -0
- package/dist/storage/blob/registry.cjs +50 -0
- package/dist/storage/blob/registry.d.ts +42 -0
- package/dist/storage/blob/registry.d.ts.map +1 -0
- package/dist/storage/blob/registry.js +26 -0
- package/dist/storage/blob/schemas.cjs +9 -12
- package/dist/storage/blob/schemas.d.ts +39 -34
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +6 -11
- package/dist/storage/cache/factory.cjs +8 -36
- package/dist/storage/cache/factory.d.ts +32 -7
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +8 -26
- package/dist/storage/cache/index.cjs +53 -0
- package/dist/storage/cache/index.d.ts +44 -0
- package/dist/storage/cache/index.d.ts.map +1 -0
- package/dist/storage/cache/index.js +28 -0
- package/dist/storage/cache/provider.cjs +16 -0
- package/dist/storage/cache/provider.d.ts +56 -0
- package/dist/storage/cache/provider.d.ts.map +1 -0
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.cjs +31 -0
- package/dist/storage/cache/providers/index.d.ts +8 -0
- package/dist/storage/cache/providers/index.d.ts.map +1 -0
- package/dist/storage/cache/providers/index.js +7 -0
- package/dist/storage/cache/providers/memory.cjs +40 -0
- package/dist/storage/cache/providers/memory.d.ts +17 -0
- package/dist/storage/cache/providers/memory.d.ts.map +1 -0
- package/dist/storage/cache/providers/memory.js +17 -0
- package/dist/storage/cache/providers/redis.cjs +66 -0
- package/dist/storage/cache/providers/redis.d.ts +20 -0
- package/dist/storage/cache/providers/redis.d.ts.map +1 -0
- package/dist/storage/cache/providers/redis.js +33 -0
- package/dist/storage/cache/registry.cjs +50 -0
- package/dist/storage/cache/registry.d.ts +42 -0
- package/dist/storage/cache/registry.d.ts.map +1 -0
- package/dist/storage/cache/registry.js +26 -0
- package/dist/storage/cache/schemas.cjs +6 -2
- package/dist/storage/cache/schemas.d.ts +2 -3
- package/dist/storage/cache/schemas.d.ts.map +1 -1
- package/dist/storage/cache/schemas.js +3 -1
- package/dist/storage/database/factory.cjs +8 -47
- package/dist/storage/database/factory.d.ts +34 -8
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +8 -37
- package/dist/storage/database/index.cjs +58 -0
- package/dist/storage/database/index.d.ts +45 -0
- package/dist/storage/database/index.d.ts.map +1 -0
- package/dist/storage/database/index.js +37 -0
- package/dist/storage/database/provider.cjs +16 -0
- package/dist/storage/database/provider.d.ts +56 -0
- package/dist/storage/database/provider.d.ts.map +1 -0
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +34 -0
- package/dist/storage/database/providers/index.d.ts +9 -0
- package/dist/storage/database/providers/index.d.ts.map +1 -0
- package/dist/storage/database/providers/index.js +9 -0
- package/dist/storage/database/providers/memory.cjs +40 -0
- package/dist/storage/database/providers/memory.d.ts +16 -0
- package/dist/storage/database/providers/memory.d.ts.map +1 -0
- package/dist/storage/database/providers/memory.js +17 -0
- package/dist/storage/database/providers/postgres.cjs +62 -0
- package/dist/storage/database/providers/postgres.d.ts +19 -0
- package/dist/storage/database/providers/postgres.d.ts.map +1 -0
- package/dist/storage/database/providers/postgres.js +29 -0
- package/dist/storage/database/providers/sqlite.cjs +66 -0
- package/dist/storage/database/providers/sqlite.d.ts +20 -0
- package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
- package/dist/storage/database/providers/sqlite.js +33 -0
- package/dist/storage/database/registry.cjs +50 -0
- package/dist/storage/database/registry.d.ts +42 -0
- package/dist/storage/database/registry.d.ts.map +1 -0
- package/dist/storage/database/registry.js +26 -0
- package/dist/storage/database/schemas.cjs +8 -2
- package/dist/storage/database/schemas.d.ts +3 -4
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +4 -1
- package/dist/storage/error-codes.cjs +6 -0
- package/dist/storage/error-codes.d.ts +7 -1
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +6 -0
- package/dist/storage/errors.cjs +80 -0
- package/dist/storage/errors.d.ts +24 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +80 -0
- package/dist/storage/index.cjs +47 -4
- package/dist/storage/index.d.ts +34 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +32 -3
- package/dist/storage/schemas.cjs +4 -0
- package/dist/storage/schemas.d.ts +17 -50
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +5 -1
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +3 -3
- package/dist/systemPrompt/in-built-prompts.cjs +7 -6
- package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +6 -5
- package/dist/systemPrompt/registry.cjs +2 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +2 -2
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +13 -13
- package/dist/systemPrompt/schemas.js +2 -2
- package/dist/tools/custom-tool-registry.cjs +64 -0
- package/dist/tools/custom-tool-registry.d.ts +120 -0
- package/dist/tools/custom-tool-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-registry.js +40 -0
- package/dist/tools/custom-tool-schema-registry.cjs +164 -0
- package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
- package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-schema-registry.js +140 -0
- package/dist/tools/error-codes.cjs +3 -0
- package/dist/tools/error-codes.d.ts +4 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +3 -0
- package/dist/tools/errors.cjs +41 -0
- package/dist/tools/errors.d.ts +17 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +41 -0
- package/dist/tools/index.cjs +13 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +11 -1
- package/dist/tools/internal-tools/constants.cjs +3 -9
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +3 -9
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
- package/dist/tools/internal-tools/provider.cjs +150 -23
- package/dist/tools/internal-tools/provider.d.ts +55 -10
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +150 -23
- package/dist/tools/internal-tools/registry.cjs +18 -43
- package/dist/tools/internal-tools/registry.d.ts +4 -4
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +18 -43
- package/dist/tools/schemas.cjs +20 -0
- package/dist/tools/schemas.d.ts +43 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +16 -0
- package/dist/tools/tool-manager.cjs +140 -13
- package/dist/tools/tool-manager.d.ts +22 -3
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +140 -13
- package/dist/tools/types.d.ts +43 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +19 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/redactor.cjs +18 -3
- package/dist/utils/redactor.d.ts +0 -7
- package/dist/utils/redactor.d.ts.map +1 -1
- package/dist/utils/redactor.js +18 -3
- package/dist/utils/service-initializer.cjs +9 -35
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +9 -35
- package/package.json +5 -2
- package/dist/context/compression/overflow.d.ts.map +0 -1
- package/dist/context/compression/reactive-overflow.d.ts.map +0 -1
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -130
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -97
- package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
- package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -127
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -104
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -70
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -47
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -86
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -63
- package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
- package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -63
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -40
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -124
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -103
- package/dist/utils/env-file.cjs +0 -118
- package/dist/utils/env-file.d.ts +0 -5
- package/dist/utils/env-file.d.ts.map +0 -1
- package/dist/utils/env-file.js +0 -85
- /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
- /package/dist/context/{compression → compaction}/types.cjs +0 -0
package/dist/llm/schemas.d.ts
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Options for LLM config validation
|
|
4
|
+
*/
|
|
5
|
+
export interface LLMValidationOptions {
|
|
6
|
+
/**
|
|
7
|
+
* When true, enforces API key and baseURL requirements.
|
|
8
|
+
* When false (relaxed mode), allows missing API keys/baseURLs for interactive configuration.
|
|
9
|
+
*
|
|
10
|
+
* Use strict mode for:
|
|
11
|
+
* - Server/API mode (headless, needs full config)
|
|
12
|
+
* - MCP mode (headless)
|
|
13
|
+
*
|
|
14
|
+
* Use relaxed mode for:
|
|
15
|
+
* - Web UI (user can configure via settings)
|
|
16
|
+
* - CLI (user can configure interactively)
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
strict?: boolean;
|
|
21
|
+
}
|
|
2
22
|
/** Business rules + compatibility checks */
|
|
3
23
|
export declare const LLMConfigBaseSchema: z.ZodObject<{
|
|
4
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
24
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
5
25
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
6
|
-
apiKey: z.ZodEffects<z.ZodString, string, string
|
|
26
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
7
27
|
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
8
28
|
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
9
29
|
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -12,9 +32,9 @@ export declare const LLMConfigBaseSchema: z.ZodObject<{
|
|
|
12
32
|
allowedMediaTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
33
|
}, "strict", z.ZodTypeAny, {
|
|
14
34
|
model: string;
|
|
15
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
16
|
-
apiKey: string;
|
|
35
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
17
36
|
maxIterations: number;
|
|
37
|
+
apiKey?: string | undefined;
|
|
18
38
|
baseURL?: string | undefined;
|
|
19
39
|
maxInputTokens?: number | undefined;
|
|
20
40
|
maxOutputTokens?: number | undefined;
|
|
@@ -22,8 +42,8 @@ export declare const LLMConfigBaseSchema: z.ZodObject<{
|
|
|
22
42
|
allowedMediaTypes?: string[] | undefined;
|
|
23
43
|
}, {
|
|
24
44
|
model: string;
|
|
25
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
26
|
-
apiKey
|
|
45
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
46
|
+
apiKey?: string | undefined;
|
|
27
47
|
maxIterations?: number | undefined;
|
|
28
48
|
baseURL?: string | undefined;
|
|
29
49
|
maxInputTokens?: number | undefined;
|
|
@@ -31,10 +51,71 @@ export declare const LLMConfigBaseSchema: z.ZodObject<{
|
|
|
31
51
|
temperature?: number | undefined;
|
|
32
52
|
allowedMediaTypes?: string[] | undefined;
|
|
33
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Creates an LLM config schema with configurable validation strictness.
|
|
56
|
+
*
|
|
57
|
+
* @param options.strict - When true (default), enforces API key and baseURL requirements.
|
|
58
|
+
* When false, allows missing credentials for interactive configuration.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createLLMConfigSchema(options?: LLMValidationOptions): z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
61
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
62
|
+
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
63
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
64
|
+
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
65
|
+
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
66
|
+
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
allowedMediaTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
70
|
+
}, "strict", z.ZodTypeAny, {
|
|
71
|
+
model: string;
|
|
72
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
73
|
+
maxIterations: number;
|
|
74
|
+
apiKey?: string | undefined;
|
|
75
|
+
baseURL?: string | undefined;
|
|
76
|
+
maxInputTokens?: number | undefined;
|
|
77
|
+
maxOutputTokens?: number | undefined;
|
|
78
|
+
temperature?: number | undefined;
|
|
79
|
+
allowedMediaTypes?: string[] | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
model: string;
|
|
82
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
83
|
+
apiKey?: string | undefined;
|
|
84
|
+
maxIterations?: number | undefined;
|
|
85
|
+
baseURL?: string | undefined;
|
|
86
|
+
maxInputTokens?: number | undefined;
|
|
87
|
+
maxOutputTokens?: number | undefined;
|
|
88
|
+
temperature?: number | undefined;
|
|
89
|
+
allowedMediaTypes?: string[] | undefined;
|
|
90
|
+
}>, {
|
|
91
|
+
model: string;
|
|
92
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
93
|
+
maxIterations: number;
|
|
94
|
+
apiKey?: string | undefined;
|
|
95
|
+
baseURL?: string | undefined;
|
|
96
|
+
maxInputTokens?: number | undefined;
|
|
97
|
+
maxOutputTokens?: number | undefined;
|
|
98
|
+
temperature?: number | undefined;
|
|
99
|
+
allowedMediaTypes?: string[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
model: string;
|
|
102
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
103
|
+
apiKey?: string | undefined;
|
|
104
|
+
maxIterations?: number | undefined;
|
|
105
|
+
baseURL?: string | undefined;
|
|
106
|
+
maxInputTokens?: number | undefined;
|
|
107
|
+
maxOutputTokens?: number | undefined;
|
|
108
|
+
temperature?: number | undefined;
|
|
109
|
+
allowedMediaTypes?: string[] | undefined;
|
|
110
|
+
}>, "ValidatedLLMConfig">;
|
|
111
|
+
/**
|
|
112
|
+
* Default LLM config schema with strict validation (backwards compatible).
|
|
113
|
+
* Use createLLMConfigSchema({ strict: false }) for relaxed validation.
|
|
114
|
+
*/
|
|
34
115
|
export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
35
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
116
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
36
117
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
37
|
-
apiKey: z.ZodEffects<z.ZodString, string, string
|
|
118
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
38
119
|
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
39
120
|
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
40
121
|
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -43,9 +124,9 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
|
43
124
|
allowedMediaTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
44
125
|
}, "strict", z.ZodTypeAny, {
|
|
45
126
|
model: string;
|
|
46
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
47
|
-
apiKey: string;
|
|
127
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
48
128
|
maxIterations: number;
|
|
129
|
+
apiKey?: string | undefined;
|
|
49
130
|
baseURL?: string | undefined;
|
|
50
131
|
maxInputTokens?: number | undefined;
|
|
51
132
|
maxOutputTokens?: number | undefined;
|
|
@@ -53,8 +134,8 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
|
53
134
|
allowedMediaTypes?: string[] | undefined;
|
|
54
135
|
}, {
|
|
55
136
|
model: string;
|
|
56
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
57
|
-
apiKey
|
|
137
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
138
|
+
apiKey?: string | undefined;
|
|
58
139
|
maxIterations?: number | undefined;
|
|
59
140
|
baseURL?: string | undefined;
|
|
60
141
|
maxInputTokens?: number | undefined;
|
|
@@ -63,9 +144,9 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
|
63
144
|
allowedMediaTypes?: string[] | undefined;
|
|
64
145
|
}>, {
|
|
65
146
|
model: string;
|
|
66
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
67
|
-
apiKey: string;
|
|
147
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
68
148
|
maxIterations: number;
|
|
149
|
+
apiKey?: string | undefined;
|
|
69
150
|
baseURL?: string | undefined;
|
|
70
151
|
maxInputTokens?: number | undefined;
|
|
71
152
|
maxOutputTokens?: number | undefined;
|
|
@@ -73,8 +154,63 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
|
73
154
|
allowedMediaTypes?: string[] | undefined;
|
|
74
155
|
}, {
|
|
75
156
|
model: string;
|
|
76
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
77
|
-
apiKey
|
|
157
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
158
|
+
apiKey?: string | undefined;
|
|
159
|
+
maxIterations?: number | undefined;
|
|
160
|
+
baseURL?: string | undefined;
|
|
161
|
+
maxInputTokens?: number | undefined;
|
|
162
|
+
maxOutputTokens?: number | undefined;
|
|
163
|
+
temperature?: number | undefined;
|
|
164
|
+
allowedMediaTypes?: string[] | undefined;
|
|
165
|
+
}>, "ValidatedLLMConfig">;
|
|
166
|
+
/**
|
|
167
|
+
* Relaxed LLM config schema that allows missing API keys and baseURLs.
|
|
168
|
+
* Use this for interactive modes (CLI, WebUI) where users can configure later.
|
|
169
|
+
*/
|
|
170
|
+
export declare const LLMConfigSchemaRelaxed: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
171
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
172
|
+
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
173
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
174
|
+
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
175
|
+
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
176
|
+
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
allowedMediaTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
model: string;
|
|
182
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
183
|
+
maxIterations: number;
|
|
184
|
+
apiKey?: string | undefined;
|
|
185
|
+
baseURL?: string | undefined;
|
|
186
|
+
maxInputTokens?: number | undefined;
|
|
187
|
+
maxOutputTokens?: number | undefined;
|
|
188
|
+
temperature?: number | undefined;
|
|
189
|
+
allowedMediaTypes?: string[] | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
model: string;
|
|
192
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
193
|
+
apiKey?: string | undefined;
|
|
194
|
+
maxIterations?: number | undefined;
|
|
195
|
+
baseURL?: string | undefined;
|
|
196
|
+
maxInputTokens?: number | undefined;
|
|
197
|
+
maxOutputTokens?: number | undefined;
|
|
198
|
+
temperature?: number | undefined;
|
|
199
|
+
allowedMediaTypes?: string[] | undefined;
|
|
200
|
+
}>, {
|
|
201
|
+
model: string;
|
|
202
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
203
|
+
maxIterations: number;
|
|
204
|
+
apiKey?: string | undefined;
|
|
205
|
+
baseURL?: string | undefined;
|
|
206
|
+
maxInputTokens?: number | undefined;
|
|
207
|
+
maxOutputTokens?: number | undefined;
|
|
208
|
+
temperature?: number | undefined;
|
|
209
|
+
allowedMediaTypes?: string[] | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
model: string;
|
|
212
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
213
|
+
apiKey?: string | undefined;
|
|
78
214
|
maxIterations?: number | undefined;
|
|
79
215
|
baseURL?: string | undefined;
|
|
80
216
|
maxInputTokens?: number | undefined;
|
|
@@ -85,9 +221,9 @@ export declare const LLMConfigSchema: z.ZodBranded<z.ZodEffects<z.ZodObject<{
|
|
|
85
221
|
export type LLMConfig = z.input<typeof LLMConfigSchema>;
|
|
86
222
|
export type ValidatedLLMConfig = z.output<typeof LLMConfigSchema>;
|
|
87
223
|
export declare const LLMUpdatesSchema: z.ZodEffects<z.ZodObject<{
|
|
88
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
224
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
89
225
|
model: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
90
|
-
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string
|
|
226
|
+
apiKey: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
91
227
|
maxIterations: z.ZodOptional<z.ZodNumber>;
|
|
92
228
|
baseURL: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>>;
|
|
93
229
|
maxInputTokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -96,7 +232,7 @@ export declare const LLMUpdatesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
96
232
|
allowedMediaTypes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
97
233
|
}, "strip", z.ZodTypeAny, {
|
|
98
234
|
model?: string | undefined;
|
|
99
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
235
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
100
236
|
apiKey?: string | undefined;
|
|
101
237
|
maxIterations?: number | undefined;
|
|
102
238
|
baseURL?: string | undefined;
|
|
@@ -106,7 +242,7 @@ export declare const LLMUpdatesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
106
242
|
allowedMediaTypes?: string[] | undefined;
|
|
107
243
|
}, {
|
|
108
244
|
model?: string | undefined;
|
|
109
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
245
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
110
246
|
apiKey?: string | undefined;
|
|
111
247
|
maxIterations?: number | undefined;
|
|
112
248
|
baseURL?: string | undefined;
|
|
@@ -116,7 +252,7 @@ export declare const LLMUpdatesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
116
252
|
allowedMediaTypes?: string[] | undefined;
|
|
117
253
|
}>, {
|
|
118
254
|
model?: string | undefined;
|
|
119
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
255
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
120
256
|
apiKey?: string | undefined;
|
|
121
257
|
maxIterations?: number | undefined;
|
|
122
258
|
baseURL?: string | undefined;
|
|
@@ -126,7 +262,7 @@ export declare const LLMUpdatesSchema: z.ZodEffects<z.ZodObject<{
|
|
|
126
262
|
allowedMediaTypes?: string[] | undefined;
|
|
127
263
|
}, {
|
|
128
264
|
model?: string | undefined;
|
|
129
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
265
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
130
266
|
apiKey?: string | undefined;
|
|
131
267
|
maxIterations?: number | undefined;
|
|
132
268
|
baseURL?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/llm/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/llm/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAsDD,4CAA4C;AAG5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcnB,CAAC;AAEd;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA4IvE;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA0C,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2C,CAAC;AAG/E,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;AAIlE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYvB,CAAC;AACP,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/llm/schemas.js
CHANGED
|
@@ -9,18 +9,19 @@ import {
|
|
|
9
9
|
supportsBaseURL,
|
|
10
10
|
requiresBaseURL,
|
|
11
11
|
acceptsAnyModel,
|
|
12
|
+
supportsCustomModels,
|
|
12
13
|
getSupportedModels,
|
|
13
14
|
isValidProviderModel,
|
|
14
|
-
getMaxInputTokensForModel
|
|
15
|
+
getMaxInputTokensForModel,
|
|
16
|
+
requiresApiKey
|
|
15
17
|
} from "./registry.js";
|
|
16
18
|
import { LLM_PROVIDERS } from "./types.js";
|
|
17
19
|
const LLMConfigFields = {
|
|
18
20
|
provider: z.enum(LLM_PROVIDERS).describe("LLM provider (e.g., 'openai', 'anthropic', 'google', 'groq')"),
|
|
19
21
|
model: NonEmptyTrimmed.describe("Specific model name for the selected provider"),
|
|
20
22
|
// Expand $ENV refs and trim; final validation happens with provider context
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
),
|
|
23
|
+
// Optional for providers that don't need API keys (Ollama, vLLM, etc.)
|
|
24
|
+
apiKey: EnvExpandedString().optional().describe("API key for provider; can be given directly or via $ENV reference"),
|
|
24
25
|
maxIterations: z.coerce.number().int().positive().describe("Max iterations for agentic loops"),
|
|
25
26
|
baseURL: OptionalURL.describe(
|
|
26
27
|
"Base URL for provider (e.g., https://api.openai.com/v1). Only certain providers support this."
|
|
@@ -35,6 +36,7 @@ const LLMConfigFields = {
|
|
|
35
36
|
const LLMConfigBaseSchema = z.object({
|
|
36
37
|
provider: LLMConfigFields.provider,
|
|
37
38
|
model: LLMConfigFields.model,
|
|
39
|
+
// apiKey is optional at schema level - validated based on provider in superRefine
|
|
38
40
|
apiKey: LLMConfigFields.apiKey,
|
|
39
41
|
// Apply defaults only for complete config validation
|
|
40
42
|
maxIterations: z.coerce.number().int().positive().default(50),
|
|
@@ -44,108 +46,114 @@ const LLMConfigBaseSchema = z.object({
|
|
|
44
46
|
temperature: LLMConfigFields.temperature,
|
|
45
47
|
allowedMediaTypes: LLMConfigFields.allowedMediaTypes
|
|
46
48
|
}).strict();
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
path: ["apiKey"],
|
|
55
|
-
message: `Missing API key for provider '${data.provider}' \u2013 set $${primaryVar}`,
|
|
56
|
-
params: {
|
|
57
|
-
code: LLMErrorCode.API_KEY_MISSING,
|
|
58
|
-
scope: ErrorScope.LLM,
|
|
59
|
-
type: ErrorType.USER,
|
|
60
|
-
provider: data.provider,
|
|
61
|
-
envVar: primaryVar
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
if (baseURLIsSet) {
|
|
66
|
-
if (!supportsBaseURL(data.provider)) {
|
|
49
|
+
function createLLMConfigSchema(options = {}) {
|
|
50
|
+
const { strict = true } = options;
|
|
51
|
+
return LLMConfigBaseSchema.superRefine((data, ctx) => {
|
|
52
|
+
const baseURLIsSet = data.baseURL != null && data.baseURL.trim() !== "";
|
|
53
|
+
const maxInputTokensIsSet = data.maxInputTokens != null;
|
|
54
|
+
if (strict && requiresApiKey(data.provider) && !data.apiKey?.trim()) {
|
|
55
|
+
const primaryVar = getPrimaryApiKeyEnvVar(data.provider);
|
|
67
56
|
ctx.addIssue({
|
|
68
57
|
code: z.ZodIssueCode.custom,
|
|
69
|
-
path: ["
|
|
70
|
-
message: `
|
|
58
|
+
path: ["apiKey"],
|
|
59
|
+
message: `Missing API key for provider '${data.provider}' \u2013 set $${primaryVar}`,
|
|
71
60
|
params: {
|
|
72
|
-
code: LLMErrorCode.
|
|
61
|
+
code: LLMErrorCode.API_KEY_MISSING,
|
|
73
62
|
scope: ErrorScope.LLM,
|
|
74
|
-
type: ErrorType.USER
|
|
63
|
+
type: ErrorType.USER,
|
|
64
|
+
provider: data.provider,
|
|
65
|
+
envVar: primaryVar
|
|
75
66
|
}
|
|
76
67
|
});
|
|
77
68
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
code: z.ZodIssueCode.custom,
|
|
81
|
-
path: ["baseURL"],
|
|
82
|
-
message: `Provider '${data.provider}' requires a 'baseURL'.`,
|
|
83
|
-
params: {
|
|
84
|
-
code: LLMErrorCode.BASE_URL_MISSING,
|
|
85
|
-
scope: ErrorScope.LLM,
|
|
86
|
-
type: ErrorType.USER
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
} else {
|
|
90
|
-
if (!acceptsAnyModel(data.provider)) {
|
|
91
|
-
const supportedModelsList = getSupportedModels(data.provider);
|
|
92
|
-
if (!isValidProviderModel(data.provider, data.model)) {
|
|
69
|
+
if (baseURLIsSet) {
|
|
70
|
+
if (!supportsBaseURL(data.provider)) {
|
|
93
71
|
ctx.addIssue({
|
|
94
72
|
code: z.ZodIssueCode.custom,
|
|
95
|
-
path: ["
|
|
96
|
-
message: `
|
|
73
|
+
path: ["provider"],
|
|
74
|
+
message: `Provider '${data.provider}' does not support baseURL. Use an 'openai-compatible' provider if you need a custom base URL.`,
|
|
97
75
|
params: {
|
|
98
|
-
code: LLMErrorCode.
|
|
76
|
+
code: LLMErrorCode.BASE_URL_INVALID,
|
|
99
77
|
scope: ErrorScope.LLM,
|
|
100
78
|
type: ErrorType.USER
|
|
101
79
|
}
|
|
102
80
|
});
|
|
103
81
|
}
|
|
82
|
+
} else if (strict && requiresBaseURL(data.provider)) {
|
|
83
|
+
ctx.addIssue({
|
|
84
|
+
code: z.ZodIssueCode.custom,
|
|
85
|
+
path: ["baseURL"],
|
|
86
|
+
message: `Provider '${data.provider}' requires a 'baseURL'.`,
|
|
87
|
+
params: {
|
|
88
|
+
code: LLMErrorCode.BASE_URL_MISSING,
|
|
89
|
+
scope: ErrorScope.LLM,
|
|
90
|
+
type: ErrorType.USER
|
|
91
|
+
}
|
|
92
|
+
});
|
|
104
93
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
if (data.
|
|
94
|
+
if (!baseURLIsSet || supportsBaseURL(data.provider)) {
|
|
95
|
+
if (!acceptsAnyModel(data.provider) && !supportsCustomModels(data.provider)) {
|
|
96
|
+
const supportedModelsList = getSupportedModels(data.provider);
|
|
97
|
+
if (!isValidProviderModel(data.provider, data.model)) {
|
|
109
98
|
ctx.addIssue({
|
|
110
99
|
code: z.ZodIssueCode.custom,
|
|
111
|
-
path: ["
|
|
112
|
-
message: `
|
|
100
|
+
path: ["model"],
|
|
101
|
+
message: `Model '${data.model}' is not supported for provider '${data.provider}'. Supported: ${supportedModelsList.join(", ")}`,
|
|
113
102
|
params: {
|
|
114
|
-
code: LLMErrorCode.
|
|
103
|
+
code: LLMErrorCode.MODEL_INCOMPATIBLE,
|
|
115
104
|
scope: ErrorScope.LLM,
|
|
116
105
|
type: ErrorType.USER
|
|
117
106
|
}
|
|
118
107
|
});
|
|
119
108
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
code:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
109
|
+
}
|
|
110
|
+
if (maxInputTokensIsSet && !acceptsAnyModel(data.provider) && !supportsCustomModels(data.provider)) {
|
|
111
|
+
try {
|
|
112
|
+
const cap = getMaxInputTokensForModel(data.provider, data.model);
|
|
113
|
+
if (data.maxInputTokens > cap) {
|
|
114
|
+
ctx.addIssue({
|
|
115
|
+
code: z.ZodIssueCode.custom,
|
|
116
|
+
path: ["maxInputTokens"],
|
|
117
|
+
message: `Max input tokens for model '${data.model}' is ${cap}. You provided ${data.maxInputTokens}`,
|
|
118
|
+
params: {
|
|
119
|
+
code: LLMErrorCode.TOKENS_EXCEEDED,
|
|
120
|
+
scope: ErrorScope.LLM,
|
|
121
|
+
type: ErrorType.USER
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
} catch (error) {
|
|
126
|
+
if (error instanceof DextoRuntimeError && error.code === LLMErrorCode.MODEL_UNKNOWN) {
|
|
127
|
+
ctx.addIssue({
|
|
128
|
+
code: z.ZodIssueCode.custom,
|
|
129
|
+
path: ["model"],
|
|
130
|
+
message: error.message,
|
|
131
|
+
params: {
|
|
132
|
+
code: error.code,
|
|
133
|
+
scope: error.scope,
|
|
134
|
+
type: error.type
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
139
|
+
ctx.addIssue({
|
|
140
|
+
code: z.ZodIssueCode.custom,
|
|
141
|
+
path: ["model"],
|
|
142
|
+
message,
|
|
143
|
+
params: {
|
|
144
|
+
code: LLMErrorCode.REQUEST_INVALID_SCHEMA,
|
|
145
|
+
scope: ErrorScope.LLM,
|
|
146
|
+
type: ErrorType.SYSTEM
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
144
150
|
}
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
153
|
+
}).brand();
|
|
154
|
+
}
|
|
155
|
+
const LLMConfigSchema = createLLMConfigSchema({ strict: true });
|
|
156
|
+
const LLMConfigSchemaRelaxed = createLLMConfigSchema({ strict: false });
|
|
149
157
|
const LLMUpdatesSchema = z.object({ ...LLMConfigFields }).partial().superRefine((data, ctx) => {
|
|
150
158
|
if (!data.model && !data.provider) {
|
|
151
159
|
ctx.addIssue({
|
|
@@ -158,5 +166,7 @@ const LLMUpdatesSchema = z.object({ ...LLMConfigFields }).partial().superRefine(
|
|
|
158
166
|
export {
|
|
159
167
|
LLMConfigBaseSchema,
|
|
160
168
|
LLMConfigSchema,
|
|
161
|
-
|
|
169
|
+
LLMConfigSchemaRelaxed,
|
|
170
|
+
LLMUpdatesSchema,
|
|
171
|
+
createLLMConfigSchema
|
|
162
172
|
};
|