@dexto/core 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/agent/DextoAgent.cjs +22 -3
- package/dist/agent/DextoAgent.d.ts +19 -2
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +23 -4
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +5 -1
- package/dist/agent/schemas.cjs +90 -71
- package/dist/agent/schemas.d.ts +5959 -96
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +87 -66
- package/dist/approval/manager.cjs +165 -1
- package/dist/approval/manager.d.ts +91 -2
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +155 -1
- package/dist/approval/schemas.cjs +39 -3
- package/dist/approval/schemas.d.ts +238 -1
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +35 -3
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +26 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -0
- package/dist/context/compaction/factory.cjs +57 -0
- package/dist/context/compaction/factory.d.ts +17 -0
- package/dist/context/compaction/factory.d.ts.map +1 -0
- package/dist/context/compaction/factory.js +34 -0
- package/dist/context/compaction/index.cjs +49 -0
- package/dist/context/compaction/index.d.ts +11 -0
- package/dist/context/compaction/index.d.ts.map +1 -0
- package/dist/context/compaction/index.js +19 -0
- package/dist/context/{compression → compaction}/overflow.cjs +3 -3
- package/dist/context/{compression → compaction}/overflow.d.ts +4 -4
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction}/overflow.js +2 -2
- package/dist/context/compaction/provider.cjs +16 -0
- package/dist/context/compaction/provider.d.ts +48 -0
- package/dist/context/compaction/provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.cjs +48 -0
- package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
- package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.js +24 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
- package/dist/context/compaction/registry.cjs +39 -0
- package/dist/context/compaction/registry.d.ts +19 -0
- package/dist/context/compaction/registry.d.ts.map +1 -0
- package/dist/context/compaction/registry.js +16 -0
- package/dist/context/compaction/schemas.cjs +38 -0
- package/dist/context/compaction/schemas.d.ts +24 -0
- package/dist/context/compaction/schemas.d.ts.map +1 -0
- package/dist/context/compaction/schemas.js +14 -0
- package/dist/context/compaction/strategies/noop.cjs +36 -0
- package/dist/context/compaction/strategies/noop.d.ts +18 -0
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
- package/dist/context/compaction/strategies/noop.js +13 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.cjs +3 -3
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.d.ts +6 -6
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.js +4 -4
- package/dist/context/{compression → compaction}/types.d.ts +4 -4
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/compaction/types.js +0 -0
- package/dist/context/error-codes.cjs +4 -0
- package/dist/context/error-codes.d.ts +4 -0
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +4 -0
- package/dist/context/errors.cjs +40 -0
- package/dist/context/errors.d.ts +14 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +40 -0
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/types.d.ts +6 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +27 -7
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +27 -7
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +2 -3
- package/dist/events/index.cjs +6 -3
- package/dist/events/index.d.ts +35 -19
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +5 -3
- package/dist/filesystem/filesystem-service.cjs +39 -0
- package/dist/filesystem/filesystem-service.d.ts +32 -0
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +39 -0
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/path-validator.cjs +69 -1
- package/dist/filesystem/path-validator.d.ts +43 -2
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +69 -1
- package/dist/image/define-image.cjs +146 -0
- package/dist/image/define-image.d.ts +71 -0
- package/dist/image/define-image.d.ts.map +1 -0
- package/dist/image/define-image.js +121 -0
- package/dist/image/index.cjs +32 -0
- package/dist/image/index.d.ts +53 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +7 -0
- package/dist/image/types.cjs +16 -0
- package/dist/image/types.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/llm/error-codes.cjs +1 -0
- package/dist/llm/error-codes.d.ts +1 -0
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +1 -0
- package/dist/llm/errors.cjs +24 -0
- package/dist/llm/errors.d.ts +19 -6
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +24 -0
- package/dist/llm/executor/provider-options.cjs +87 -0
- package/dist/llm/executor/provider-options.d.ts +49 -0
- package/dist/llm/executor/provider-options.d.ts.map +1 -0
- package/dist/llm/executor/provider-options.js +63 -0
- package/dist/llm/executor/stream-processor.cjs +22 -11
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +22 -11
- package/dist/llm/executor/turn-executor.cjs +60 -23
- package/dist/llm/executor/turn-executor.d.ts +7 -5
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +60 -23
- package/dist/llm/formatters/vercel.cjs +15 -3
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +15 -3
- package/dist/llm/index.cjs +18 -1
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +14 -0
- package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
- package/dist/llm/providers/local/downloader.cjs +291 -0
- package/dist/llm/providers/local/downloader.d.ts +82 -0
- package/dist/llm/providers/local/downloader.d.ts.map +1 -0
- package/dist/llm/providers/local/downloader.js +251 -0
- package/dist/llm/providers/local/error-codes.cjs +57 -0
- package/dist/llm/providers/local/error-codes.d.ts +66 -0
- package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
- package/dist/llm/providers/local/error-codes.js +34 -0
- package/dist/llm/providers/local/errors.cjs +240 -0
- package/dist/llm/providers/local/errors.d.ts +31 -0
- package/dist/llm/providers/local/errors.d.ts.map +1 -0
- package/dist/llm/providers/local/errors.js +217 -0
- package/dist/llm/providers/local/gpu-detector.cjs +214 -0
- package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
- package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
- package/dist/llm/providers/local/gpu-detector.js +178 -0
- package/dist/llm/providers/local/index.cjs +147 -0
- package/dist/llm/providers/local/index.d.ts +21 -0
- package/dist/llm/providers/local/index.d.ts.map +1 -0
- package/dist/llm/providers/local/index.js +126 -0
- package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/node-llama-provider.js +176 -0
- package/dist/llm/providers/local/ollama-provider.cjs +230 -0
- package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
- package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/ollama-provider.js +198 -0
- package/dist/llm/providers/local/registry.cjs +343 -0
- package/dist/llm/providers/local/registry.d.ts +51 -0
- package/dist/llm/providers/local/registry.d.ts.map +1 -0
- package/dist/llm/providers/local/registry.js +312 -0
- package/dist/llm/providers/local/schemas.cjs +169 -0
- package/dist/llm/providers/local/schemas.d.ts +395 -0
- package/dist/llm/providers/local/schemas.d.ts.map +1 -0
- package/dist/llm/providers/local/schemas.js +133 -0
- package/dist/llm/providers/local/types.cjs +16 -0
- package/dist/llm/providers/local/types.d.ts +219 -0
- package/dist/llm/providers/local/types.d.ts.map +1 -0
- package/dist/llm/providers/local/types.js +0 -0
- package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
- package/dist/llm/providers/openrouter-model-registry.js +309 -0
- package/dist/llm/registry.cjs +604 -9
- package/dist/llm/registry.d.ts +35 -0
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +600 -9
- package/dist/llm/resolver.cjs +63 -5
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -6
- package/dist/llm/schemas.cjs +107 -81
- package/dist/llm/schemas.d.ts +181 -22
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +107 -81
- package/dist/llm/services/factory.cjs +87 -13
- package/dist/llm/services/factory.d.ts +4 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +85 -12
- package/dist/llm/services/test-utils.integration.cjs +22 -2
- package/dist/llm/services/test-utils.integration.d.ts +7 -1
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +26 -3
- package/dist/llm/services/vercel.cjs +8 -3
- package/dist/llm/services/vercel.d.ts +3 -2
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +8 -3
- package/dist/llm/types.cjs +11 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +11 -1
- package/dist/logger/logger.cjs +7 -3
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +7 -3
- package/dist/mcp/manager.cjs +8 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +8 -0
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +0 -3
- package/dist/memory/schemas.d.ts +3 -3
- package/dist/plugins/error-codes.cjs +3 -0
- package/dist/plugins/error-codes.d.ts +7 -1
- package/dist/plugins/error-codes.d.ts.map +1 -1
- package/dist/plugins/error-codes.js +3 -0
- package/dist/plugins/index.cjs +7 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +6 -1
- package/dist/plugins/manager.cjs +92 -7
- package/dist/plugins/manager.d.ts +10 -3
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +92 -7
- package/dist/plugins/registry.cjs +63 -0
- package/dist/plugins/registry.d.ts +101 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +39 -0
- package/dist/plugins/schemas.cjs +17 -5
- package/dist/plugins/schemas.d.ts +62 -5
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +15 -4
- package/dist/providers/base-registry.cjs +147 -0
- package/dist/providers/base-registry.d.ts +147 -0
- package/dist/providers/base-registry.d.ts.map +1 -0
- package/dist/providers/base-registry.js +123 -0
- package/dist/providers/discovery.cjs +109 -0
- package/dist/providers/discovery.d.ts +96 -0
- package/dist/providers/discovery.d.ts.map +1 -0
- package/dist/providers/discovery.js +84 -0
- package/dist/providers/index.cjs +24 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +3 -3
- package/dist/session/chat-session.cjs +20 -3
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +21 -4
- package/dist/session/history/database.cjs +49 -15
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +49 -15
- package/dist/session/session-manager.cjs +2 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +2 -1
- package/dist/storage/blob/factory.cjs +8 -11
- package/dist/storage/blob/factory.d.ts +32 -6
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +8 -11
- package/dist/storage/blob/index.cjs +56 -0
- package/dist/storage/blob/index.d.ts +45 -0
- package/dist/storage/blob/index.d.ts.map +1 -0
- package/dist/storage/blob/index.js +30 -0
- package/dist/storage/blob/provider.cjs +16 -0
- package/dist/storage/blob/provider.d.ts +50 -0
- package/dist/storage/blob/provider.d.ts.map +1 -0
- package/dist/storage/blob/provider.js +0 -0
- package/dist/storage/blob/providers/index.cjs +31 -0
- package/dist/storage/blob/providers/index.d.ts +8 -0
- package/dist/storage/blob/providers/index.d.ts.map +1 -0
- package/dist/storage/blob/providers/index.js +7 -0
- package/dist/storage/blob/providers/local.cjs +39 -0
- package/dist/storage/blob/providers/local.d.ts +17 -0
- package/dist/storage/blob/providers/local.d.ts.map +1 -0
- package/dist/storage/blob/providers/local.js +16 -0
- package/dist/storage/blob/providers/memory.cjs +39 -0
- package/dist/storage/blob/providers/memory.d.ts +17 -0
- package/dist/storage/blob/providers/memory.d.ts.map +1 -0
- package/dist/storage/blob/providers/memory.js +16 -0
- package/dist/storage/blob/registry.cjs +50 -0
- package/dist/storage/blob/registry.d.ts +42 -0
- package/dist/storage/blob/registry.d.ts.map +1 -0
- package/dist/storage/blob/registry.js +26 -0
- package/dist/storage/blob/schemas.cjs +9 -12
- package/dist/storage/blob/schemas.d.ts +39 -34
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +6 -11
- package/dist/storage/cache/factory.cjs +8 -36
- package/dist/storage/cache/factory.d.ts +32 -7
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +8 -26
- package/dist/storage/cache/index.cjs +53 -0
- package/dist/storage/cache/index.d.ts +44 -0
- package/dist/storage/cache/index.d.ts.map +1 -0
- package/dist/storage/cache/index.js +28 -0
- package/dist/storage/cache/provider.cjs +16 -0
- package/dist/storage/cache/provider.d.ts +56 -0
- package/dist/storage/cache/provider.d.ts.map +1 -0
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.cjs +31 -0
- package/dist/storage/cache/providers/index.d.ts +8 -0
- package/dist/storage/cache/providers/index.d.ts.map +1 -0
- package/dist/storage/cache/providers/index.js +7 -0
- package/dist/storage/cache/providers/memory.cjs +40 -0
- package/dist/storage/cache/providers/memory.d.ts +17 -0
- package/dist/storage/cache/providers/memory.d.ts.map +1 -0
- package/dist/storage/cache/providers/memory.js +17 -0
- package/dist/storage/cache/providers/redis.cjs +66 -0
- package/dist/storage/cache/providers/redis.d.ts +20 -0
- package/dist/storage/cache/providers/redis.d.ts.map +1 -0
- package/dist/storage/cache/providers/redis.js +33 -0
- package/dist/storage/cache/registry.cjs +50 -0
- package/dist/storage/cache/registry.d.ts +42 -0
- package/dist/storage/cache/registry.d.ts.map +1 -0
- package/dist/storage/cache/registry.js +26 -0
- package/dist/storage/cache/schemas.cjs +6 -2
- package/dist/storage/cache/schemas.d.ts +2 -3
- package/dist/storage/cache/schemas.d.ts.map +1 -1
- package/dist/storage/cache/schemas.js +3 -1
- package/dist/storage/database/factory.cjs +8 -47
- package/dist/storage/database/factory.d.ts +34 -8
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +8 -37
- package/dist/storage/database/index.cjs +58 -0
- package/dist/storage/database/index.d.ts +45 -0
- package/dist/storage/database/index.d.ts.map +1 -0
- package/dist/storage/database/index.js +37 -0
- package/dist/storage/database/postgres-store.cjs +174 -78
- package/dist/storage/database/postgres-store.d.ts +19 -0
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +174 -78
- package/dist/storage/database/provider.cjs +16 -0
- package/dist/storage/database/provider.d.ts +56 -0
- package/dist/storage/database/provider.d.ts.map +1 -0
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +34 -0
- package/dist/storage/database/providers/index.d.ts +9 -0
- package/dist/storage/database/providers/index.d.ts.map +1 -0
- package/dist/storage/database/providers/index.js +9 -0
- package/dist/storage/database/providers/memory.cjs +40 -0
- package/dist/storage/database/providers/memory.d.ts +16 -0
- package/dist/storage/database/providers/memory.d.ts.map +1 -0
- package/dist/storage/database/providers/memory.js +17 -0
- package/dist/storage/database/providers/postgres.cjs +62 -0
- package/dist/storage/database/providers/postgres.d.ts +19 -0
- package/dist/storage/database/providers/postgres.d.ts.map +1 -0
- package/dist/storage/database/providers/postgres.js +29 -0
- package/dist/storage/database/providers/sqlite.cjs +66 -0
- package/dist/storage/database/providers/sqlite.d.ts +20 -0
- package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
- package/dist/storage/database/providers/sqlite.js +33 -0
- package/dist/storage/database/registry.cjs +50 -0
- package/dist/storage/database/registry.d.ts +42 -0
- package/dist/storage/database/registry.d.ts.map +1 -0
- package/dist/storage/database/registry.js +26 -0
- package/dist/storage/database/schemas.cjs +12 -3
- package/dist/storage/database/schemas.d.ts +11 -4
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +8 -2
- package/dist/storage/error-codes.cjs +6 -0
- package/dist/storage/error-codes.d.ts +7 -1
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +6 -0
- package/dist/storage/errors.cjs +80 -0
- package/dist/storage/errors.d.ts +24 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +80 -0
- package/dist/storage/index.cjs +47 -4
- package/dist/storage/index.d.ts +34 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +32 -3
- package/dist/storage/schemas.cjs +4 -0
- package/dist/storage/schemas.d.ts +24 -50
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +5 -1
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +3 -3
- package/dist/systemPrompt/in-built-prompts.cjs +7 -6
- package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +6 -5
- package/dist/systemPrompt/registry.cjs +2 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +2 -2
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +13 -13
- package/dist/systemPrompt/schemas.js +2 -2
- package/dist/tools/custom-tool-registry.cjs +64 -0
- package/dist/tools/custom-tool-registry.d.ts +126 -0
- package/dist/tools/custom-tool-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-registry.js +40 -0
- package/dist/tools/custom-tool-schema-registry.cjs +164 -0
- package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
- package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-schema-registry.js +140 -0
- package/dist/tools/error-codes.cjs +3 -0
- package/dist/tools/error-codes.d.ts +4 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +3 -0
- package/dist/tools/errors.cjs +41 -0
- package/dist/tools/errors.d.ts +17 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +41 -0
- package/dist/tools/index.cjs +13 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +11 -1
- package/dist/tools/internal-tools/constants.cjs +3 -9
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +3 -9
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
- package/dist/tools/internal-tools/provider.cjs +153 -23
- package/dist/tools/internal-tools/provider.d.ts +55 -10
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +153 -23
- package/dist/tools/internal-tools/registry.cjs +18 -43
- package/dist/tools/internal-tools/registry.d.ts +4 -4
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +18 -43
- package/dist/tools/schemas.cjs +20 -0
- package/dist/tools/schemas.d.ts +43 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +16 -0
- package/dist/tools/tool-manager.cjs +140 -13
- package/dist/tools/tool-manager.d.ts +22 -3
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +140 -13
- package/dist/tools/types.d.ts +43 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +19 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/redactor.cjs +18 -3
- package/dist/utils/redactor.d.ts +0 -7
- package/dist/utils/redactor.d.ts.map +1 -1
- package/dist/utils/redactor.js +18 -3
- package/dist/utils/service-initializer.cjs +9 -35
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +9 -35
- package/package.json +5 -2
- package/dist/context/compression/overflow.d.ts.map +0 -1
- package/dist/context/compression/reactive-overflow.d.ts.map +0 -1
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -130
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -97
- package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
- package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -127
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -104
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -70
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -47
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -86
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -63
- package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
- package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -63
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -40
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -124
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -103
- package/dist/utils/env-file.cjs +0 -118
- package/dist/utils/env-file.d.ts +0 -5
- package/dist/utils/env-file.d.ts.map +0 -1
- package/dist/utils/env-file.js +0 -85
- /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
- /package/dist/context/{compression → compaction}/types.cjs +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import "../chunk-PTJYTZNU.js";
|
|
2
|
+
function defineImage(definition) {
|
|
3
|
+
if (!definition.name) {
|
|
4
|
+
throw new Error("Image definition must have a name");
|
|
5
|
+
}
|
|
6
|
+
if (!definition.version) {
|
|
7
|
+
throw new Error("Image definition must have a version");
|
|
8
|
+
}
|
|
9
|
+
if (!definition.description) {
|
|
10
|
+
throw new Error("Image definition must have a description");
|
|
11
|
+
}
|
|
12
|
+
for (const [category, config] of Object.entries(definition.providers)) {
|
|
13
|
+
if (!config) continue;
|
|
14
|
+
if (!config.providers && !config.register) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
`Provider category '${category}' must have either 'providers' array or 'register' function`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return definition;
|
|
21
|
+
}
|
|
22
|
+
function defineProviderCategory(config) {
|
|
23
|
+
if (!config.providers && !config.register) {
|
|
24
|
+
throw new Error("Provider category must have either providers or register function");
|
|
25
|
+
}
|
|
26
|
+
return config;
|
|
27
|
+
}
|
|
28
|
+
function validateImageDefinition(definition) {
|
|
29
|
+
if (!definition.name || typeof definition.name !== "string") {
|
|
30
|
+
throw new Error("Image name must be a non-empty string");
|
|
31
|
+
}
|
|
32
|
+
if (!definition.version || typeof definition.version !== "string") {
|
|
33
|
+
throw new Error("Image version must be a non-empty string");
|
|
34
|
+
}
|
|
35
|
+
if (!definition.description || typeof definition.description !== "string") {
|
|
36
|
+
throw new Error("Image description must be a non-empty string");
|
|
37
|
+
}
|
|
38
|
+
const versionRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/;
|
|
39
|
+
if (!versionRegex.test(definition.version)) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Image version '${definition.version}' is not valid semver. Expected format: x.y.z`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const validTargets = [
|
|
45
|
+
"local-development",
|
|
46
|
+
"cloud-production",
|
|
47
|
+
"edge-serverless",
|
|
48
|
+
"embedded-iot",
|
|
49
|
+
"enterprise",
|
|
50
|
+
"custom"
|
|
51
|
+
];
|
|
52
|
+
if (definition.target && !validTargets.includes(definition.target)) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Invalid target '${definition.target}'. Valid targets: ${validTargets.join(", ")}`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const hasProviders = definition.providers && Object.values(definition.providers).some((config) => config !== void 0);
|
|
58
|
+
if (!hasProviders && !definition.extends) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
"Image must either define at least one provider category or extend a base image"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
for (const [category, config] of Object.entries(definition.providers)) {
|
|
64
|
+
if (!config) continue;
|
|
65
|
+
if (!config.providers && !config.register) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`Provider category '${category}' must have either 'providers' array or 'register' function`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (config.providers && !Array.isArray(config.providers)) {
|
|
71
|
+
throw new Error(`Provider category '${category}' providers must be an array`);
|
|
72
|
+
}
|
|
73
|
+
if (config.register && typeof config.register !== "function") {
|
|
74
|
+
throw new Error(`Provider category '${category}' register must be a function`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const validConstraints = [
|
|
78
|
+
"filesystem-required",
|
|
79
|
+
"network-required",
|
|
80
|
+
"offline-capable",
|
|
81
|
+
"serverless-compatible",
|
|
82
|
+
"cold-start-optimized",
|
|
83
|
+
"low-memory",
|
|
84
|
+
"edge-compatible",
|
|
85
|
+
"browser-compatible"
|
|
86
|
+
];
|
|
87
|
+
if (definition.constraints) {
|
|
88
|
+
if (!Array.isArray(definition.constraints)) {
|
|
89
|
+
throw new Error("Image constraints must be an array");
|
|
90
|
+
}
|
|
91
|
+
for (const constraint of definition.constraints) {
|
|
92
|
+
if (!validConstraints.includes(constraint)) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`Invalid constraint '${constraint}'. Valid constraints: ${validConstraints.join(", ")}`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (definition.utils) {
|
|
100
|
+
for (const [name, path] of Object.entries(definition.utils)) {
|
|
101
|
+
if (typeof path !== "string") {
|
|
102
|
+
throw new Error(`Utility '${name}' path must be a string`);
|
|
103
|
+
}
|
|
104
|
+
if (!path.startsWith("./")) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Utility '${name}' path must be relative (start with './'). Got: ${path}`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (definition.extends) {
|
|
112
|
+
if (typeof definition.extends !== "string") {
|
|
113
|
+
throw new Error("Image extends must be a string (parent image name)");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
defineImage,
|
|
119
|
+
defineProviderCategory,
|
|
120
|
+
validateImageDefinition
|
|
121
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 image_exports = {};
|
|
20
|
+
__export(image_exports, {
|
|
21
|
+
defineImage: () => import_define_image.defineImage,
|
|
22
|
+
defineProviderCategory: () => import_define_image.defineProviderCategory,
|
|
23
|
+
validateImageDefinition: () => import_define_image.validateImageDefinition
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(image_exports);
|
|
26
|
+
var import_define_image = require("./define-image.js");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
defineImage,
|
|
30
|
+
defineProviderCategory,
|
|
31
|
+
validateImageDefinition
|
|
32
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Image Infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Provides types and helpers for defining Dexto base images.
|
|
5
|
+
* Base images are pre-configured backend surfaces that bundle providers,
|
|
6
|
+
* utilities, and defaults for specific deployment targets.
|
|
7
|
+
*
|
|
8
|
+
* @example Creating a base image
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // dexto.image.ts
|
|
11
|
+
* import { defineImage } from '@dexto/core';
|
|
12
|
+
*
|
|
13
|
+
* export default defineImage({
|
|
14
|
+
* name: 'local',
|
|
15
|
+
* version: '1.0.0',
|
|
16
|
+
* description: 'Local development base image',
|
|
17
|
+
* target: 'local-development',
|
|
18
|
+
*
|
|
19
|
+
* providers: {
|
|
20
|
+
* blobStore: {
|
|
21
|
+
* providers: [localBlobProvider],
|
|
22
|
+
* },
|
|
23
|
+
* database: {
|
|
24
|
+
* register: async () => {
|
|
25
|
+
* const { sqliteProvider } = await import('./providers/database.js');
|
|
26
|
+
* databaseRegistry.register(sqliteProvider);
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* },
|
|
30
|
+
*
|
|
31
|
+
* defaults: {
|
|
32
|
+
* storage: {
|
|
33
|
+
* blob: { type: 'local', storePath: './data/blobs' },
|
|
34
|
+
* database: { type: 'sqlite', path: './data/agent.db' },
|
|
35
|
+
* },
|
|
36
|
+
* },
|
|
37
|
+
*
|
|
38
|
+
* constraints: ['filesystem-required', 'offline-capable'],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Using a base image
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // my-app/src/index.ts
|
|
45
|
+
* import { createAgent, enrichConfigForLocal } from '@dexto/image-local';
|
|
46
|
+
*
|
|
47
|
+
* const config = enrichConfigForLocal(rawConfig);
|
|
48
|
+
* const agent = createAgent(config); // Providers already registered!
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export type { ImageProvider, ProviderMetadata, ProviderRegistrationFn, ProviderCategoryConfig, ImageDefinition, ImageTarget, ImageConstraint, ImageDefaults, ImageMetadata, ImageBuildResult, ImageBuildOptions, } from './types.js';
|
|
52
|
+
export { defineImage, defineProviderCategory, validateImageDefinition } from './define-image.js';
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/image/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,YAAY,EACR,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dexto Base Image Definition
|
|
3
|
+
*
|
|
4
|
+
* Base images are pre-configured backend surfaces that bundle providers,
|
|
5
|
+
* utilities, and defaults for specific deployment targets.
|
|
6
|
+
*
|
|
7
|
+
* Like Alpine Linux or Ubuntu, but for AI agents.
|
|
8
|
+
*/
|
|
9
|
+
import type { z } from 'zod';
|
|
10
|
+
/**
|
|
11
|
+
* Generic provider interface that all provider types should extend.
|
|
12
|
+
* Provides common structure for type-safe provider registration.
|
|
13
|
+
*
|
|
14
|
+
* Note: This is a simplified interface for image definitions.
|
|
15
|
+
* Actual provider implementations should use the specific provider
|
|
16
|
+
* interfaces from their respective modules (e.g., BlobStoreProvider).
|
|
17
|
+
*/
|
|
18
|
+
export interface ImageProvider<TType extends string = string> {
|
|
19
|
+
/** Unique type identifier for this provider (e.g., 'sqlite', 'local', 's3') */
|
|
20
|
+
type: TType;
|
|
21
|
+
/** Zod schema for validating provider configuration */
|
|
22
|
+
configSchema: z.ZodType<any>;
|
|
23
|
+
/** Factory function to create provider instance */
|
|
24
|
+
create: (config: any, deps: any) => any;
|
|
25
|
+
/** Optional metadata about the provider */
|
|
26
|
+
metadata?: ProviderMetadata;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Metadata about a provider's characteristics and requirements
|
|
30
|
+
*/
|
|
31
|
+
export interface ProviderMetadata {
|
|
32
|
+
/** Human-readable display name */
|
|
33
|
+
displayName?: string;
|
|
34
|
+
/** Brief description of what this provider does */
|
|
35
|
+
description?: string;
|
|
36
|
+
/** Whether this provider requires network connectivity */
|
|
37
|
+
requiresNetwork?: boolean;
|
|
38
|
+
/** Whether this provider requires filesystem access */
|
|
39
|
+
requiresFilesystem?: boolean;
|
|
40
|
+
/** Persistence level of storage providers */
|
|
41
|
+
persistenceLevel?: 'ephemeral' | 'persistent';
|
|
42
|
+
/** Platforms this provider is compatible with */
|
|
43
|
+
platforms?: ('node' | 'browser' | 'edge' | 'worker')[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Registry function that registers providers on module initialization.
|
|
47
|
+
* Called automatically when the image is imported.
|
|
48
|
+
*/
|
|
49
|
+
export type ProviderRegistrationFn = () => void | Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Configuration for a single provider category in an image.
|
|
52
|
+
* Supports both direct provider objects and registration functions.
|
|
53
|
+
*/
|
|
54
|
+
export interface ProviderCategoryConfig {
|
|
55
|
+
/** Direct provider objects to register */
|
|
56
|
+
providers?: ImageProvider[];
|
|
57
|
+
/** Registration function for complex initialization */
|
|
58
|
+
register?: ProviderRegistrationFn;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Complete image definition structure.
|
|
62
|
+
* This is what dexto.image.ts exports.
|
|
63
|
+
*/
|
|
64
|
+
export interface ImageDefinition {
|
|
65
|
+
/** Unique name for this image (e.g., 'local', 'cloud', 'edge') */
|
|
66
|
+
name: string;
|
|
67
|
+
/** Semantic version of this image */
|
|
68
|
+
version: string;
|
|
69
|
+
/** Brief description of this image's purpose and target environment */
|
|
70
|
+
description: string;
|
|
71
|
+
/** Target deployment environment (for documentation and validation) */
|
|
72
|
+
target?: ImageTarget;
|
|
73
|
+
/**
|
|
74
|
+
* Provider categories to register.
|
|
75
|
+
* Each category can include direct providers or a registration function.
|
|
76
|
+
*/
|
|
77
|
+
providers: {
|
|
78
|
+
/** Blob storage providers (e.g., local filesystem, S3, R2) */
|
|
79
|
+
blobStore?: ProviderCategoryConfig;
|
|
80
|
+
/** Database providers (e.g., SQLite, PostgreSQL, D1) */
|
|
81
|
+
database?: ProviderCategoryConfig;
|
|
82
|
+
/** Cache providers (e.g., in-memory, Redis, KV) */
|
|
83
|
+
cache?: ProviderCategoryConfig;
|
|
84
|
+
/** Custom tool providers (e.g., datetime helpers, API integrations) */
|
|
85
|
+
customTools?: ProviderCategoryConfig;
|
|
86
|
+
/** Plugin providers (e.g., audit logging, content filtering) */
|
|
87
|
+
plugins?: ProviderCategoryConfig;
|
|
88
|
+
/** Compression strategy providers (e.g., sliding window, summarization) */
|
|
89
|
+
compression?: ProviderCategoryConfig;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Default configuration values.
|
|
93
|
+
* Used when agent config doesn't specify values.
|
|
94
|
+
* Merged with agent config during agent creation.
|
|
95
|
+
*/
|
|
96
|
+
defaults?: ImageDefaults;
|
|
97
|
+
/**
|
|
98
|
+
* Runtime constraints this image requires.
|
|
99
|
+
* Used for validation and error messages.
|
|
100
|
+
*/
|
|
101
|
+
constraints?: ImageConstraint[];
|
|
102
|
+
/**
|
|
103
|
+
* Utilities exported by this image.
|
|
104
|
+
* Maps utility name to file path (relative to image root).
|
|
105
|
+
*
|
|
106
|
+
* Example:
|
|
107
|
+
* {
|
|
108
|
+
* configEnrichment: './utils/config.js',
|
|
109
|
+
* lifecycle: './utils/lifecycle.js'
|
|
110
|
+
* }
|
|
111
|
+
*/
|
|
112
|
+
utils?: Record<string, string>;
|
|
113
|
+
/**
|
|
114
|
+
* Selective named exports from packages.
|
|
115
|
+
* Allows re-exporting specific types and values from dependencies.
|
|
116
|
+
*
|
|
117
|
+
* Example:
|
|
118
|
+
* {
|
|
119
|
+
* '@dexto/core': ['logger', 'createAgentCard', 'type DextoAgent'],
|
|
120
|
+
* '@dexto/utils': ['formatDate', 'parseConfig']
|
|
121
|
+
* }
|
|
122
|
+
*/
|
|
123
|
+
exports?: Record<string, string[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Parent image to extend (for image inheritance).
|
|
126
|
+
* Optional: enables creating specialized images from base images.
|
|
127
|
+
*/
|
|
128
|
+
extends?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Target deployment environments for images.
|
|
132
|
+
* Helps users choose the right image for their use case.
|
|
133
|
+
*/
|
|
134
|
+
export type ImageTarget = 'local-development' | 'cloud-production' | 'edge-serverless' | 'embedded-iot' | 'enterprise' | 'custom';
|
|
135
|
+
/**
|
|
136
|
+
* Runtime constraints that an image requires.
|
|
137
|
+
* Used for validation and helpful error messages.
|
|
138
|
+
*/
|
|
139
|
+
export type ImageConstraint = 'filesystem-required' | 'network-required' | 'offline-capable' | 'serverless-compatible' | 'cold-start-optimized' | 'low-memory' | 'edge-compatible' | 'browser-compatible';
|
|
140
|
+
/**
|
|
141
|
+
* Default configuration values provided by an image.
|
|
142
|
+
* These are used when agent config doesn't specify values.
|
|
143
|
+
*/
|
|
144
|
+
export interface ImageDefaults {
|
|
145
|
+
/** Default storage configuration */
|
|
146
|
+
storage?: {
|
|
147
|
+
database?: {
|
|
148
|
+
type: string;
|
|
149
|
+
[key: string]: any;
|
|
150
|
+
};
|
|
151
|
+
blob?: {
|
|
152
|
+
type: string;
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
};
|
|
155
|
+
cache?: {
|
|
156
|
+
type: string;
|
|
157
|
+
[key: string]: any;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
/** Default logging configuration */
|
|
161
|
+
logging?: {
|
|
162
|
+
level?: 'debug' | 'info' | 'warn' | 'error';
|
|
163
|
+
fileLogging?: boolean;
|
|
164
|
+
[key: string]: any;
|
|
165
|
+
};
|
|
166
|
+
/** Default LLM configuration */
|
|
167
|
+
llm?: {
|
|
168
|
+
provider?: string;
|
|
169
|
+
model?: string;
|
|
170
|
+
[key: string]: any;
|
|
171
|
+
};
|
|
172
|
+
/** Default tool configuration */
|
|
173
|
+
tools?: {
|
|
174
|
+
internalTools?: string[];
|
|
175
|
+
[key: string]: any;
|
|
176
|
+
};
|
|
177
|
+
/** Other default values */
|
|
178
|
+
[key: string]: any;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Metadata about a built image (generated by bundler).
|
|
182
|
+
* Included in the compiled image output.
|
|
183
|
+
*/
|
|
184
|
+
export interface ImageMetadata {
|
|
185
|
+
/** Image name */
|
|
186
|
+
name: string;
|
|
187
|
+
/** Image version */
|
|
188
|
+
version: string;
|
|
189
|
+
/** Description */
|
|
190
|
+
description: string;
|
|
191
|
+
/** Target environment */
|
|
192
|
+
target?: ImageTarget;
|
|
193
|
+
/** Runtime constraints */
|
|
194
|
+
constraints: ImageConstraint[];
|
|
195
|
+
/** Build timestamp */
|
|
196
|
+
builtAt: string;
|
|
197
|
+
/** Core version this image was built for */
|
|
198
|
+
coreVersion: string;
|
|
199
|
+
/** Base image this extends (if any) */
|
|
200
|
+
extends?: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Result of building an image.
|
|
204
|
+
* Contains the generated code and metadata.
|
|
205
|
+
*/
|
|
206
|
+
export interface ImageBuildResult {
|
|
207
|
+
/** Generated JavaScript code for the image entry point */
|
|
208
|
+
code: string;
|
|
209
|
+
/** Generated TypeScript definitions */
|
|
210
|
+
types: string;
|
|
211
|
+
/** Image metadata */
|
|
212
|
+
metadata: ImageMetadata;
|
|
213
|
+
/** Warnings encountered during build */
|
|
214
|
+
warnings?: string[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Options for building an image.
|
|
218
|
+
*/
|
|
219
|
+
export interface ImageBuildOptions {
|
|
220
|
+
/** Path to dexto.image.ts file */
|
|
221
|
+
imagePath: string;
|
|
222
|
+
/** Output directory for built image */
|
|
223
|
+
outDir: string;
|
|
224
|
+
/** Whether to generate source maps */
|
|
225
|
+
sourcemap?: boolean;
|
|
226
|
+
/** Whether to minify output */
|
|
227
|
+
minify?: boolean;
|
|
228
|
+
/** Additional validation rules */
|
|
229
|
+
strict?: boolean;
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/image/types.ts"],"names":[],"mappings":"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"}
|
|
File without changes
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,8 @@ __reExport(index_exports, require("./approval/index.js"), module.exports);
|
|
|
43
43
|
__reExport(index_exports, require("./memory/index.js"), module.exports);
|
|
44
44
|
__reExport(index_exports, require("./plugins/index.js"), module.exports);
|
|
45
45
|
__reExport(index_exports, require("./telemetry/index.js"), module.exports);
|
|
46
|
+
__reExport(index_exports, require("./providers/index.js"), module.exports);
|
|
47
|
+
__reExport(index_exports, require("./image/index.js"), module.exports);
|
|
46
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
49
|
0 && (module.exports = {
|
|
48
50
|
getFileMediaKind,
|
|
@@ -65,5 +67,7 @@ __reExport(index_exports, require("./telemetry/index.js"), module.exports);
|
|
|
65
67
|
...require("./approval/index.js"),
|
|
66
68
|
...require("./memory/index.js"),
|
|
67
69
|
...require("./plugins/index.js"),
|
|
68
|
-
...require("./telemetry/index.js")
|
|
70
|
+
...require("./telemetry/index.js"),
|
|
71
|
+
...require("./providers/index.js"),
|
|
72
|
+
...require("./image/index.js")
|
|
69
73
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -40,4 +40,6 @@ export * from './approval/index.js';
|
|
|
40
40
|
export * from './memory/index.js';
|
|
41
41
|
export * from './plugins/index.js';
|
|
42
42
|
export * from './telemetry/index.js';
|
|
43
|
+
export * from './providers/index.js';
|
|
44
|
+
export * from './image/index.js';
|
|
43
45
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,cAAc,kBAAkB,CAAC;AAUjC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGvE,cAAc,oBAAoB,CAAC;AAGnC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,cAAc,kBAAkB,CAAC;AAUjC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGvE,cAAc,oBAAoB,CAAC;AAGnC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,8 @@ export * from "./approval/index.js";
|
|
|
19
19
|
export * from "./memory/index.js";
|
|
20
20
|
export * from "./plugins/index.js";
|
|
21
21
|
export * from "./telemetry/index.js";
|
|
22
|
+
export * from "./providers/index.js";
|
|
23
|
+
export * from "./image/index.js";
|
|
22
24
|
export {
|
|
23
25
|
getFileMediaKind,
|
|
24
26
|
getResourceKind
|
package/dist/llm/error-codes.cjs
CHANGED
|
@@ -27,6 +27,7 @@ var LLMErrorCode = /* @__PURE__ */ ((LLMErrorCode2) => {
|
|
|
27
27
|
LLMErrorCode2["API_KEY_CANDIDATE_MISSING"] = "llm_api_key_candidate_missing";
|
|
28
28
|
LLMErrorCode2["BASE_URL_MISSING"] = "llm_base_url_missing";
|
|
29
29
|
LLMErrorCode2["BASE_URL_INVALID"] = "llm_base_url_invalid";
|
|
30
|
+
LLMErrorCode2["CONFIG_MISSING"] = "llm_config_missing";
|
|
30
31
|
LLMErrorCode2["MODEL_INCOMPATIBLE"] = "llm_model_incompatible";
|
|
31
32
|
LLMErrorCode2["MODEL_UNKNOWN"] = "llm_model_unknown";
|
|
32
33
|
LLMErrorCode2["PROVIDER_UNSUPPORTED"] = "llm_provider_unsupported";
|
|
@@ -8,6 +8,7 @@ export declare enum LLMErrorCode {
|
|
|
8
8
|
API_KEY_CANDIDATE_MISSING = "llm_api_key_candidate_missing",
|
|
9
9
|
BASE_URL_MISSING = "llm_base_url_missing",
|
|
10
10
|
BASE_URL_INVALID = "llm_base_url_invalid",
|
|
11
|
+
CONFIG_MISSING = "llm_config_missing",// Required config (e.g., GOOGLE_VERTEX_PROJECT)
|
|
11
12
|
MODEL_INCOMPATIBLE = "llm_model_incompatible",
|
|
12
13
|
MODEL_UNKNOWN = "llm_model_unknown",
|
|
13
14
|
PROVIDER_UNSUPPORTED = "llm_provider_unsupported",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/llm/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,YAAY;IAEpB,eAAe,wBAAwB;IACvC,eAAe,wBAAwB,CAAE,0BAA0B;IACnE,yBAAyB,kCAAkC;IAC3D,gBAAgB,yBAAyB;IACzC,gBAAgB,yBAAyB;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/llm/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,YAAY;IAEpB,eAAe,wBAAwB;IACvC,eAAe,wBAAwB,CAAE,0BAA0B;IACnE,yBAAyB,kCAAkC;IAC3D,gBAAgB,yBAAyB;IACzC,gBAAgB,yBAAyB;IACzC,cAAc,uBAAuB,CAAE,gDAAgD;IAGvF,kBAAkB,2BAA2B;IAC7C,aAAa,sBAAsB;IACnC,oBAAoB,6BAA6B;IAGjD,sBAAsB,+BAA+B;IACrD,uBAAuB,gCAAgC;IACvD,kBAAkB,2BAA2B;IAG7C,eAAe,wBAAwB;IACvC,mBAAmB,4BAA4B;IAG/C,aAAa,sBAAsB;IACnC,iBAAiB,0BAA0B;IAG3C,oBAAoB,6BAA6B,CAAE,+CAA+C;IAGlG,sBAAsB,+BAA+B;CACxD"}
|
package/dist/llm/error-codes.js
CHANGED
|
@@ -5,6 +5,7 @@ var LLMErrorCode = /* @__PURE__ */ ((LLMErrorCode2) => {
|
|
|
5
5
|
LLMErrorCode2["API_KEY_CANDIDATE_MISSING"] = "llm_api_key_candidate_missing";
|
|
6
6
|
LLMErrorCode2["BASE_URL_MISSING"] = "llm_base_url_missing";
|
|
7
7
|
LLMErrorCode2["BASE_URL_INVALID"] = "llm_base_url_invalid";
|
|
8
|
+
LLMErrorCode2["CONFIG_MISSING"] = "llm_config_missing";
|
|
8
9
|
LLMErrorCode2["MODEL_INCOMPATIBLE"] = "llm_model_incompatible";
|
|
9
10
|
LLMErrorCode2["MODEL_UNKNOWN"] = "llm_model_unknown";
|
|
10
11
|
LLMErrorCode2["PROVIDER_UNSUPPORTED"] = "llm_provider_unsupported";
|
package/dist/llm/errors.cjs
CHANGED
|
@@ -46,6 +46,15 @@ class LLMError {
|
|
|
46
46
|
{ provider }
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
|
+
static missingConfig(provider, configName) {
|
|
50
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
51
|
+
import_error_codes.LLMErrorCode.CONFIG_MISSING,
|
|
52
|
+
import_types.ErrorScope.LLM,
|
|
53
|
+
import_types2.ErrorType.USER,
|
|
54
|
+
`Provider '${provider}' requires ${configName}`,
|
|
55
|
+
{ provider, configName }
|
|
56
|
+
);
|
|
57
|
+
}
|
|
49
58
|
static unsupportedProvider(provider) {
|
|
50
59
|
const availableProviders = (0, import_registry.getSupportedProviders)();
|
|
51
60
|
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
@@ -56,6 +65,21 @@ class LLMError {
|
|
|
56
65
|
{ provider, availableProviders }
|
|
57
66
|
);
|
|
58
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Runtime error when API key is missing for a provider that requires it.
|
|
70
|
+
* This occurs when relaxed validation allowed the app to start without an API key,
|
|
71
|
+
* and the user then tries to use the LLM functionality.
|
|
72
|
+
*/
|
|
73
|
+
static apiKeyMissing(provider, envVar) {
|
|
74
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
75
|
+
import_error_codes.LLMErrorCode.API_KEY_MISSING,
|
|
76
|
+
import_types.ErrorScope.LLM,
|
|
77
|
+
import_types2.ErrorType.USER,
|
|
78
|
+
`API key required for provider '${provider}'`,
|
|
79
|
+
{ provider, envVar },
|
|
80
|
+
`Set the ${envVar} environment variable or configure it in Settings`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
59
83
|
static modelProviderUnknown(model) {
|
|
60
84
|
const availableProviders = (0, import_registry.getSupportedProviders)();
|
|
61
85
|
return new import_DextoRuntimeError.DextoRuntimeError(
|
package/dist/llm/errors.d.ts
CHANGED
|
@@ -9,23 +9,36 @@ import type { LLMProvider } from './types.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class LLMError {
|
|
11
11
|
static unknownModel(provider: LLMProvider, model: string): DextoRuntimeError<{
|
|
12
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
12
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
13
13
|
model: string;
|
|
14
14
|
}>;
|
|
15
15
|
static baseUrlMissing(provider: LLMProvider): DextoRuntimeError<{
|
|
16
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
16
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
17
|
+
}>;
|
|
18
|
+
static missingConfig(provider: LLMProvider, configName: string): DextoRuntimeError<{
|
|
19
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
20
|
+
configName: string;
|
|
17
21
|
}>;
|
|
18
22
|
static unsupportedProvider(provider: string): DextoRuntimeError<{
|
|
19
23
|
provider: string;
|
|
20
|
-
availableProviders: ("openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere")[];
|
|
24
|
+
availableProviders: ("openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama")[];
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Runtime error when API key is missing for a provider that requires it.
|
|
28
|
+
* This occurs when relaxed validation allowed the app to start without an API key,
|
|
29
|
+
* and the user then tries to use the LLM functionality.
|
|
30
|
+
*/
|
|
31
|
+
static apiKeyMissing(provider: LLMProvider, envVar: string): DextoRuntimeError<{
|
|
32
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
33
|
+
envVar: string;
|
|
21
34
|
}>;
|
|
22
35
|
static modelProviderUnknown(model: string): DextoRuntimeError<{
|
|
23
36
|
model: string;
|
|
24
|
-
availableProviders: ("openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere")[];
|
|
37
|
+
availableProviders: ("openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama")[];
|
|
25
38
|
}>;
|
|
26
39
|
static rateLimitExceeded(provider: LLMProvider, retryAfter?: number): DextoRuntimeError<{
|
|
27
40
|
details: {
|
|
28
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
41
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
29
42
|
retryAfter: number | undefined;
|
|
30
43
|
};
|
|
31
44
|
recovery: string;
|
|
@@ -33,7 +46,7 @@ export declare class LLMError {
|
|
|
33
46
|
static generationFailed(error: string, provider: LLMProvider, model: string): DextoRuntimeError<{
|
|
34
47
|
details: {
|
|
35
48
|
error: string;
|
|
36
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
49
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
37
50
|
model: string;
|
|
38
51
|
};
|
|
39
52
|
}>;
|
package/dist/llm/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/llm/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAMnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,qBAAa,QAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;IAUxD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW;;;IAU3C,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM;;;;IAW3C,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM;;;;IAczC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM;;;;;;;IAgBnE,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;;;;IAW3E,MAAM,CAAC,kBAAkB;CAU5B"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/llm/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAMnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,qBAAa,QAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;IAUxD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW;;;IAU3C,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM;;;;IAU9D,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM;;;;IAW3C;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM;;;;IAW1D,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM;;;;IAczC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM;;;;;;;IAgBnE,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;;;;IAW3E,MAAM,CAAC,kBAAkB;CAU5B"}
|