@dexto/core 1.3.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 +53 -9
- package/dist/agent/DextoAgent.cjs +570 -210
- package/dist/agent/DextoAgent.d.ts +175 -35
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +568 -208
- package/dist/agent/agentCard.js +1 -1
- package/dist/agent/error-codes.cjs +1 -0
- package/dist/agent/error-codes.d.ts +2 -1
- package/dist/agent/error-codes.d.ts.map +1 -1
- package/dist/agent/error-codes.js +2 -1
- package/dist/agent/errors.cjs +13 -0
- package/dist/agent/errors.d.ts +4 -0
- package/dist/agent/errors.d.ts.map +1 -1
- package/dist/agent/errors.js +14 -1
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +6 -2
- package/dist/agent/schemas.cjs +90 -68
- package/dist/agent/schemas.d.ts +5998 -146
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +90 -65
- package/dist/agent/state-manager.cjs +5 -5
- package/dist/agent/state-manager.d.ts +4 -4
- package/dist/agent/state-manager.js +6 -6
- package/dist/agent/types.d.ts +24 -10
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/approval/error-codes.js +1 -1
- package/dist/approval/errors.js +1 -1
- package/dist/approval/factory.js +1 -1
- package/dist/approval/index.js +1 -1
- package/dist/approval/manager.cjs +234 -4
- package/dist/approval/manager.d.ts +131 -4
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +225 -5
- package/dist/approval/schemas.cjs +57 -7
- package/dist/approval/schemas.d.ts +344 -33
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +54 -8
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +32 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +2 -1
- package/dist/{chunk-C6A6W6XS.js → chunk-PTJYTZNU.js} +44 -1
- 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/compaction/overflow.cjs +43 -0
- package/dist/context/compaction/overflow.d.ts +33 -0
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/compaction/overflow.js +19 -0
- 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/{llm/tokenizer/factory.cjs → context/compaction/registry.cjs} +15 -20
- 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/{llm/tokenizer/types.cjs → context/compaction/strategies/noop.cjs} +12 -9
- 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/compaction/strategies/reactive-overflow.cjs +201 -0
- package/dist/context/compaction/strategies/reactive-overflow.d.ts +81 -0
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/compaction/strategies/reactive-overflow.js +178 -0
- package/dist/context/compaction/types.d.ts +20 -0
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/error-codes.cjs +7 -0
- package/dist/context/error-codes.d.ts +8 -1
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +8 -1
- package/dist/context/errors.cjs +68 -0
- package/dist/context/errors.d.ts +21 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +69 -1
- 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 +2 -1
- package/dist/context/manager.cjs +280 -323
- package/dist/context/manager.d.ts +65 -111
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +280 -328
- package/dist/context/media-helpers.js +1 -1
- package/dist/context/types.cjs +49 -0
- package/dist/context/types.d.ts +187 -72
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +35 -0
- package/dist/context/utils.cjs +293 -290
- package/dist/context/utils.d.ts +32 -18
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +293 -290
- package/dist/errors/DextoBaseError.js +1 -1
- package/dist/errors/DextoRuntimeError.js +1 -1
- package/dist/errors/DextoValidationError.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +3 -4
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +18 -1
- package/dist/events/index.d.ts +149 -12
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +19 -2
- package/dist/filesystem/error-codes.js +1 -1
- package/dist/filesystem/errors.js +1 -1
- 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 +40 -1
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/index.js +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 +70 -2
- 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/{llm/tokenizer/default.cjs → image/index.cjs} +10 -19
- 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.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.browser.cjs +23 -8
- package/dist/index.browser.d.ts +4 -3
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +20 -3
- 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 +3 -1
- package/dist/llm/error-codes.cjs +1 -1
- package/dist/llm/error-codes.d.ts +1 -1
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +2 -2
- package/dist/llm/errors.cjs +34 -10
- package/dist/llm/errors.d.ts +23 -11
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +36 -12
- package/dist/llm/executor/stream-processor.cjs +375 -0
- package/dist/llm/executor/stream-processor.d.ts +55 -0
- package/dist/llm/executor/stream-processor.d.ts.map +1 -0
- package/dist/llm/executor/stream-processor.js +352 -0
- package/dist/llm/executor/tool-output-truncator.cjs +75 -0
- package/dist/llm/executor/tool-output-truncator.d.ts +27 -0
- package/dist/llm/executor/tool-output-truncator.d.ts.map +1 -0
- package/dist/llm/executor/tool-output-truncator.js +48 -0
- package/dist/llm/executor/turn-executor.cjs +780 -0
- package/dist/llm/executor/turn-executor.d.ts +167 -0
- package/dist/llm/executor/turn-executor.d.ts.map +1 -0
- package/dist/llm/executor/turn-executor.js +711 -0
- package/dist/llm/executor/types.cjs +16 -0
- package/dist/llm/executor/types.d.ts +27 -0
- package/dist/llm/executor/types.d.ts.map +1 -0
- package/dist/llm/executor/types.js +0 -0
- package/dist/llm/formatters/vercel.cjs +26 -188
- package/dist/llm/formatters/vercel.d.ts +2 -14
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +25 -187
- 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 +569 -52
- package/dist/llm/registry.d.ts +79 -39
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +564 -49
- package/dist/llm/resolver.cjs +62 -34
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -38
- package/dist/llm/schemas.cjs +92 -97
- package/dist/llm/schemas.d.ts +162 -39
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +93 -100
- package/dist/llm/services/factory.cjs +88 -103
- package/dist/llm/services/factory.d.ts +17 -4
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +87 -93
- package/dist/llm/services/test-utils.integration.cjs +28 -10
- 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 +33 -12
- package/dist/llm/services/types.d.ts +1 -28
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +58 -469
- package/dist/llm/services/vercel.d.ts +39 -21
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +60 -476
- package/dist/llm/types.cjs +11 -4
- package/dist/llm/types.d.ts +9 -9
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +12 -4
- package/dist/llm/validation.js +1 -1
- package/dist/logger/browser.js +1 -1
- package/dist/logger/factory.js +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/logger.js +1 -1
- package/dist/logger/v2/dexto-logger.cjs +34 -6
- package/dist/logger/v2/dexto-logger.d.ts +20 -2
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/dexto-logger.js +35 -7
- package/dist/logger/v2/error-codes.js +1 -1
- package/dist/logger/v2/errors.js +1 -1
- package/dist/logger/v2/schemas.js +1 -1
- package/dist/logger/v2/test-utils.cjs +70 -0
- package/dist/logger/v2/test-utils.d.ts +17 -0
- package/dist/logger/v2/test-utils.d.ts.map +1 -0
- package/dist/logger/v2/test-utils.js +46 -0
- package/dist/logger/v2/transport-factory.js +1 -1
- package/dist/logger/v2/transports/console-transport.js +1 -1
- package/dist/logger/v2/transports/file-transport.cjs +6 -0
- package/dist/logger/v2/transports/file-transport.d.ts +4 -0
- package/dist/logger/v2/transports/file-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/file-transport.js +7 -1
- package/dist/logger/v2/types.cjs +1 -0
- package/dist/logger/v2/types.d.ts +18 -2
- package/dist/logger/v2/types.d.ts.map +1 -1
- package/dist/logger/v2/types.js +2 -1
- package/dist/mcp/error-codes.cjs +1 -0
- package/dist/mcp/error-codes.d.ts +1 -0
- package/dist/mcp/error-codes.d.ts.map +1 -1
- package/dist/mcp/error-codes.js +2 -1
- package/dist/mcp/errors.cjs +13 -0
- package/dist/mcp/errors.d.ts +7 -0
- package/dist/mcp/errors.d.ts.map +1 -1
- package/dist/mcp/errors.js +14 -1
- package/dist/mcp/manager.cjs +12 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +13 -1
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +1 -4
- package/dist/mcp/resolver.js +1 -1
- package/dist/mcp/schemas.cjs +6 -0
- package/dist/mcp/schemas.d.ts +52 -0
- package/dist/mcp/schemas.d.ts.map +1 -1
- package/dist/mcp/schemas.js +6 -1
- package/dist/memory/error-codes.js +1 -1
- package/dist/memory/errors.js +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/manager.js +1 -1
- package/dist/memory/schemas.d.ts +3 -3
- package/dist/memory/schemas.js +1 -1
- package/dist/plugins/builtins/content-policy.js +1 -1
- package/dist/plugins/builtins/response-sanitizer.js +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 +4 -1
- 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 +7 -2
- package/dist/plugins/loader.js +1 -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 +93 -8
- package/dist/plugins/registrations/builtins.js +1 -1
- 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 +65 -8
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +16 -5
- package/dist/plugins/types.d.ts +0 -1
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/process/command-validator.js +1 -1
- package/dist/process/error-codes.js +1 -1
- package/dist/process/errors.js +1 -1
- package/dist/process/index.js +1 -1
- package/dist/process/process-service.cjs +78 -26
- package/dist/process/process-service.d.ts +6 -1
- package/dist/process/process-service.d.ts.map +1 -1
- package/dist/process/process-service.js +79 -27
- package/dist/process/types.d.ts +2 -2
- package/dist/process/types.d.ts.map +1 -1
- package/dist/prompts/error-codes.cjs +1 -0
- package/dist/prompts/error-codes.d.ts +2 -1
- package/dist/prompts/error-codes.d.ts.map +1 -1
- package/dist/prompts/error-codes.js +2 -1
- package/dist/prompts/errors.cjs +15 -0
- package/dist/prompts/errors.d.ts +4 -0
- package/dist/prompts/errors.d.ts.map +1 -1
- package/dist/prompts/errors.js +16 -1
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/name-validation.js +1 -1
- package/dist/prompts/prompt-manager.cjs +13 -2
- package/dist/prompts/prompt-manager.d.ts +7 -0
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.js +14 -3
- package/dist/prompts/providers/config-prompt-provider.cjs +12 -3
- package/dist/prompts/providers/config-prompt-provider.d.ts +2 -1
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +13 -4
- package/dist/prompts/providers/custom-prompt-provider.js +1 -1
- package/dist/prompts/providers/mcp-prompt-provider.js +1 -1
- package/dist/prompts/schemas.d.ts +12 -0
- package/dist/prompts/schemas.d.ts.map +1 -1
- package/dist/prompts/schemas.js +1 -1
- package/dist/prompts/types.d.ts +2 -0
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/utils.js +1 -1
- 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/error-codes.js +1 -1
- package/dist/resources/errors.js +1 -1
- package/dist/resources/handlers/blob-handler.js +1 -1
- package/dist/resources/handlers/factory.js +1 -1
- package/dist/resources/handlers/filesystem-handler.js +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/resources/internal-provider.js +1 -1
- package/dist/resources/manager.js +1 -1
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +4 -4
- package/dist/resources/schemas.js +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/search-service.js +1 -1
- package/dist/session/chat-session.cjs +169 -54
- package/dist/session/chat-session.d.ts +69 -29
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +171 -56
- package/dist/session/error-codes.js +1 -1
- package/dist/session/errors.js +1 -1
- package/dist/session/history/database.cjs +134 -21
- package/dist/session/history/database.d.ts +37 -8
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +135 -22
- package/dist/session/history/factory.js +1 -1
- package/dist/session/history/memory.cjs +18 -0
- package/dist/session/history/memory.d.ts +8 -0
- package/dist/session/history/memory.d.ts.map +1 -1
- package/dist/session/history/memory.js +19 -1
- package/dist/session/history/types.d.ts +13 -1
- package/dist/session/history/types.d.ts.map +1 -1
- package/dist/session/index.cjs +3 -0
- package/dist/session/index.d.ts +3 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +3 -1
- package/dist/session/message-queue.cjs +201 -0
- package/dist/session/message-queue.d.ts +114 -0
- package/dist/session/message-queue.d.ts.map +1 -0
- package/dist/session/message-queue.js +178 -0
- package/dist/session/schemas.js +1 -1
- package/dist/session/session-manager.cjs +57 -7
- package/dist/session/session-manager.d.ts +18 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +58 -8
- package/dist/session/title-generator.cjs +4 -8
- package/dist/session/title-generator.d.ts +1 -2
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/session/title-generator.js +5 -9
- package/dist/session/types.cjs +16 -0
- package/dist/session/types.d.ts +14 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +0 -0
- 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 +9 -12
- 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/local-blob-store.js +1 -1
- package/dist/storage/blob/memory-blob-store.js +1 -1
- 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 +7 -12
- 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 +9 -27
- 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/memory-cache-store.js +1 -1
- 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/redis-store.js +1 -1
- package/dist/{llm/tokenizer/google.cjs → storage/cache/registry.cjs} +23 -25
- 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 +4 -2
- 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 +9 -38
- 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/memory-database-store.js +1 -1
- package/dist/storage/database/postgres-store.cjs +12 -0
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +13 -1
- 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 +5 -2
- package/dist/storage/database/sqlite-store.js +1 -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 +7 -1
- 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 +81 -1
- 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 +33 -4
- 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 +6 -2
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +4 -4
- package/dist/systemPrompt/contributors.js +1 -1
- package/dist/systemPrompt/error-codes.js +1 -1
- package/dist/systemPrompt/errors.js +1 -1
- 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 +7 -6
- package/dist/systemPrompt/index.js +1 -1
- package/dist/systemPrompt/manager.js +1 -1
- 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 +3 -3
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +18 -18
- package/dist/systemPrompt/schemas.js +3 -3
- package/dist/telemetry/decorators.js +1 -1
- package/dist/telemetry/error-codes.js +1 -1
- package/dist/telemetry/errors.js +1 -1
- package/dist/telemetry/exporters.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/schemas.js +1 -1
- package/dist/telemetry/telemetry.js +1 -1
- package/dist/telemetry/utils.js +1 -1
- package/dist/tools/bash-pattern-utils.cjs +91 -0
- package/dist/tools/bash-pattern-utils.d.ts +58 -0
- package/dist/tools/bash-pattern-utils.d.ts.map +1 -0
- package/dist/tools/bash-pattern-utils.js +64 -0
- package/dist/tools/confirmation/allowed-tools-provider/factory.js +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.js +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.js +1 -1
- 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/display-types.cjs +60 -0
- package/dist/tools/display-types.d.ts +133 -0
- package/dist/tools/display-types.d.ts.map +1 -0
- package/dist/tools/display-types.js +32 -0
- package/dist/tools/error-codes.cjs +5 -0
- package/dist/tools/error-codes.d.ts +6 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +6 -1
- package/dist/tools/errors.cjs +71 -0
- package/dist/tools/errors.d.ts +33 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +72 -1
- package/dist/tools/index.cjs +15 -1
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +13 -2
- 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 +4 -10
- package/dist/tools/internal-tools/implementations/ask-user-tool.cjs +1 -1
- package/dist/tools/internal-tools/implementations/ask-user-tool.js +2 -2
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +1 -1
- 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/implementations/search-history-tool.js +1 -1
- package/dist/tools/internal-tools/provider.cjs +175 -31
- package/dist/tools/internal-tools/provider.d.ts +62 -14
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +176 -32
- package/dist/tools/internal-tools/registry.cjs +19 -43
- package/dist/tools/internal-tools/registry.d.ts +32 -11
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +20 -44
- package/dist/tools/schemas.cjs +36 -6
- package/dist/tools/schemas.d.ts +74 -5
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +30 -6
- package/dist/tools/tool-manager.cjs +279 -30
- package/dist/tools/tool-manager.d.ts +45 -4
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +284 -31
- package/dist/tools/types.d.ts +63 -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 +20 -2
- package/dist/utils/async-context.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/{llm/tokenizer/anthropic.cjs → utils/defer.cjs} +19 -20
- package/dist/utils/defer.d.ts +63 -0
- package/dist/utils/defer.d.ts.map +1 -0
- package/dist/utils/defer.js +19 -0
- package/dist/utils/error-conversion.js +1 -1
- package/dist/utils/execution-context.js +1 -1
- package/dist/utils/fs-walk.js +1 -1
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/path.js +1 -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 +19 -4
- package/dist/utils/result.js +1 -1
- package/dist/utils/safe-stringify.js +1 -1
- package/dist/utils/schema-metadata.js +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/service-initializer.cjs +15 -37
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +16 -38
- package/dist/utils/user-info.js +1 -1
- package/dist/utils/zod-schema-converter.js +1 -1
- package/package.json +10 -8
- package/dist/context/compression/middle-removal.cjs +0 -95
- package/dist/context/compression/middle-removal.d.ts +0 -47
- package/dist/context/compression/middle-removal.d.ts.map +0 -1
- package/dist/context/compression/middle-removal.js +0 -72
- package/dist/context/compression/oldest-removal.cjs +0 -83
- package/dist/context/compression/oldest-removal.d.ts +0 -42
- package/dist/context/compression/oldest-removal.d.ts.map +0 -1
- package/dist/context/compression/oldest-removal.js +0 -60
- package/dist/context/compression/types.d.ts +0 -18
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/llm/formatters/anthropic.cjs +0 -257
- package/dist/llm/formatters/anthropic.d.ts +0 -46
- package/dist/llm/formatters/anthropic.d.ts.map +0 -1
- package/dist/llm/formatters/anthropic.js +0 -239
- package/dist/llm/formatters/factory.cjs +0 -50
- package/dist/llm/formatters/factory.d.ts +0 -10
- package/dist/llm/formatters/factory.d.ts.map +0 -1
- package/dist/llm/formatters/factory.js +0 -27
- package/dist/llm/formatters/openai.cjs +0 -203
- package/dist/llm/formatters/openai.d.ts +0 -39
- package/dist/llm/formatters/openai.d.ts.map +0 -1
- package/dist/llm/formatters/openai.js +0 -184
- package/dist/llm/formatters/types.d.ts +0 -41
- package/dist/llm/formatters/types.d.ts.map +0 -1
- package/dist/llm/services/anthropic.cjs +0 -511
- package/dist/llm/services/anthropic.d.ts +0 -48
- package/dist/llm/services/anthropic.d.ts.map +0 -1
- package/dist/llm/services/anthropic.js +0 -447
- package/dist/llm/services/openai.cjs +0 -611
- package/dist/llm/services/openai.d.ts +0 -48
- package/dist/llm/services/openai.d.ts.map +0 -1
- package/dist/llm/services/openai.js +0 -547
- package/dist/llm/tokenizer/anthropic.d.ts +0 -19
- package/dist/llm/tokenizer/anthropic.d.ts.map +0 -1
- package/dist/llm/tokenizer/anthropic.js +0 -20
- package/dist/llm/tokenizer/default.d.ts +0 -14
- package/dist/llm/tokenizer/default.d.ts.map +0 -1
- package/dist/llm/tokenizer/default.js +0 -18
- package/dist/llm/tokenizer/factory.d.ts +0 -12
- package/dist/llm/tokenizer/factory.d.ts.map +0 -1
- package/dist/llm/tokenizer/factory.js +0 -21
- package/dist/llm/tokenizer/google.d.ts +0 -29
- package/dist/llm/tokenizer/google.d.ts.map +0 -1
- package/dist/llm/tokenizer/google.js +0 -29
- package/dist/llm/tokenizer/openai.cjs +0 -115
- package/dist/llm/tokenizer/openai.d.ts +0 -41
- package/dist/llm/tokenizer/openai.d.ts.map +0 -1
- package/dist/llm/tokenizer/openai.js +0 -91
- package/dist/llm/tokenizer/types.d.ts +0 -18
- package/dist/llm/tokenizer/types.d.ts.map +0 -1
- package/dist/llm/tokenizer/types.js +0 -10
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -106
- 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 -73
- 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 -62
- 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 -39
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -57
- 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 -34
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -71
- 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 -48
- 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 -55
- 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 -32
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -56
- 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 -33
- 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/formatters → context/compaction}/types.js +0 -0
- /package/dist/{llm/formatters → image}/types.cjs +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error codes for local model operations.
|
|
3
|
+
* Format: LOCAL_XXX where XXX groups by category:
|
|
4
|
+
* - 001-009: Installation errors
|
|
5
|
+
* - 010-019: Download errors
|
|
6
|
+
* - 020-029: Model errors
|
|
7
|
+
* - 030-039: GPU errors
|
|
8
|
+
* - 040-049: Ollama errors
|
|
9
|
+
*/
|
|
10
|
+
export declare enum LocalModelErrorCode {
|
|
11
|
+
/** node-llama-cpp package is not installed */
|
|
12
|
+
NODE_LLAMA_NOT_INSTALLED = "LOCAL_001",
|
|
13
|
+
/** Failed to install node-llama-cpp */
|
|
14
|
+
NODE_LLAMA_INSTALL_FAILED = "LOCAL_002",
|
|
15
|
+
/** CMake not found (required for building from source) */
|
|
16
|
+
CMAKE_NOT_FOUND = "LOCAL_003",
|
|
17
|
+
/** Build from source failed */
|
|
18
|
+
BUILD_FAILED = "LOCAL_004",
|
|
19
|
+
/** Model download failed */
|
|
20
|
+
DOWNLOAD_FAILED = "LOCAL_010",
|
|
21
|
+
/** Download was interrupted */
|
|
22
|
+
DOWNLOAD_INTERRUPTED = "LOCAL_011",
|
|
23
|
+
/** Downloaded file hash doesn't match expected */
|
|
24
|
+
DOWNLOAD_HASH_MISMATCH = "LOCAL_012",
|
|
25
|
+
/** Insufficient disk space for download */
|
|
26
|
+
INSUFFICIENT_DISK_SPACE = "LOCAL_013",
|
|
27
|
+
/** HuggingFace authentication required for gated model */
|
|
28
|
+
HF_AUTH_REQUIRED = "LOCAL_014",
|
|
29
|
+
/** Network error during download */
|
|
30
|
+
NETWORK_ERROR = "LOCAL_015",
|
|
31
|
+
/** Model not found in registry */
|
|
32
|
+
MODEL_NOT_FOUND = "LOCAL_020",
|
|
33
|
+
/** Model not downloaded locally */
|
|
34
|
+
MODEL_NOT_DOWNLOADED = "LOCAL_021",
|
|
35
|
+
/** Failed to load model */
|
|
36
|
+
MODEL_LOAD_FAILED = "LOCAL_022",
|
|
37
|
+
/** Model file is corrupted */
|
|
38
|
+
MODEL_CORRUPT = "LOCAL_023",
|
|
39
|
+
/** Invalid GGUF format */
|
|
40
|
+
INVALID_GGUF = "LOCAL_024",
|
|
41
|
+
/** Model context too large for available memory */
|
|
42
|
+
CONTEXT_TOO_LARGE = "LOCAL_025",
|
|
43
|
+
/** No GPU acceleration available */
|
|
44
|
+
GPU_NOT_AVAILABLE = "LOCAL_030",
|
|
45
|
+
/** Insufficient VRAM for model */
|
|
46
|
+
INSUFFICIENT_VRAM = "LOCAL_031",
|
|
47
|
+
/** GPU driver error */
|
|
48
|
+
GPU_DRIVER_ERROR = "LOCAL_032",
|
|
49
|
+
/** Metal not available (macOS only) */
|
|
50
|
+
METAL_NOT_AVAILABLE = "LOCAL_033",
|
|
51
|
+
/** CUDA not available */
|
|
52
|
+
CUDA_NOT_AVAILABLE = "LOCAL_034",
|
|
53
|
+
/** Vulkan not available */
|
|
54
|
+
VULKAN_NOT_AVAILABLE = "LOCAL_035",
|
|
55
|
+
/** Ollama server is not running */
|
|
56
|
+
OLLAMA_NOT_RUNNING = "LOCAL_040",
|
|
57
|
+
/** Model not found on Ollama server */
|
|
58
|
+
OLLAMA_MODEL_NOT_FOUND = "LOCAL_041",
|
|
59
|
+
/** Failed to pull model from Ollama */
|
|
60
|
+
OLLAMA_PULL_FAILED = "LOCAL_042",
|
|
61
|
+
/** Ollama API error */
|
|
62
|
+
OLLAMA_API_ERROR = "LOCAL_043",
|
|
63
|
+
/** Ollama version incompatible */
|
|
64
|
+
OLLAMA_VERSION_INCOMPATIBLE = "LOCAL_044"
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../../../src/llm/providers/local/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,oBAAY,mBAAmB;IAE3B,8CAA8C;IAC9C,wBAAwB,cAAc;IACtC,uCAAuC;IACvC,yBAAyB,cAAc;IACvC,0DAA0D;IAC1D,eAAe,cAAc;IAC7B,+BAA+B;IAC/B,YAAY,cAAc;IAG1B,4BAA4B;IAC5B,eAAe,cAAc;IAC7B,+BAA+B;IAC/B,oBAAoB,cAAc;IAClC,kDAAkD;IAClD,sBAAsB,cAAc;IACpC,2CAA2C;IAC3C,uBAAuB,cAAc;IACrC,0DAA0D;IAC1D,gBAAgB,cAAc;IAC9B,oCAAoC;IACpC,aAAa,cAAc;IAG3B,kCAAkC;IAClC,eAAe,cAAc;IAC7B,mCAAmC;IACnC,oBAAoB,cAAc;IAClC,2BAA2B;IAC3B,iBAAiB,cAAc;IAC/B,8BAA8B;IAC9B,aAAa,cAAc;IAC3B,0BAA0B;IAC1B,YAAY,cAAc;IAC1B,mDAAmD;IACnD,iBAAiB,cAAc;IAG/B,oCAAoC;IACpC,iBAAiB,cAAc;IAC/B,kCAAkC;IAClC,iBAAiB,cAAc;IAC/B,uBAAuB;IACvB,gBAAgB,cAAc;IAC9B,uCAAuC;IACvC,mBAAmB,cAAc;IACjC,yBAAyB;IACzB,kBAAkB,cAAc;IAChC,2BAA2B;IAC3B,oBAAoB,cAAc;IAGlC,mCAAmC;IACnC,kBAAkB,cAAc;IAChC,uCAAuC;IACvC,sBAAsB,cAAc;IACpC,uCAAuC;IACvC,kBAAkB,cAAc;IAChC,uBAAuB;IACvB,gBAAgB,cAAc;IAC9B,kCAAkC;IAClC,2BAA2B,cAAc;CAC5C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
+
var LocalModelErrorCode = /* @__PURE__ */ ((LocalModelErrorCode2) => {
|
|
3
|
+
LocalModelErrorCode2["NODE_LLAMA_NOT_INSTALLED"] = "LOCAL_001";
|
|
4
|
+
LocalModelErrorCode2["NODE_LLAMA_INSTALL_FAILED"] = "LOCAL_002";
|
|
5
|
+
LocalModelErrorCode2["CMAKE_NOT_FOUND"] = "LOCAL_003";
|
|
6
|
+
LocalModelErrorCode2["BUILD_FAILED"] = "LOCAL_004";
|
|
7
|
+
LocalModelErrorCode2["DOWNLOAD_FAILED"] = "LOCAL_010";
|
|
8
|
+
LocalModelErrorCode2["DOWNLOAD_INTERRUPTED"] = "LOCAL_011";
|
|
9
|
+
LocalModelErrorCode2["DOWNLOAD_HASH_MISMATCH"] = "LOCAL_012";
|
|
10
|
+
LocalModelErrorCode2["INSUFFICIENT_DISK_SPACE"] = "LOCAL_013";
|
|
11
|
+
LocalModelErrorCode2["HF_AUTH_REQUIRED"] = "LOCAL_014";
|
|
12
|
+
LocalModelErrorCode2["NETWORK_ERROR"] = "LOCAL_015";
|
|
13
|
+
LocalModelErrorCode2["MODEL_NOT_FOUND"] = "LOCAL_020";
|
|
14
|
+
LocalModelErrorCode2["MODEL_NOT_DOWNLOADED"] = "LOCAL_021";
|
|
15
|
+
LocalModelErrorCode2["MODEL_LOAD_FAILED"] = "LOCAL_022";
|
|
16
|
+
LocalModelErrorCode2["MODEL_CORRUPT"] = "LOCAL_023";
|
|
17
|
+
LocalModelErrorCode2["INVALID_GGUF"] = "LOCAL_024";
|
|
18
|
+
LocalModelErrorCode2["CONTEXT_TOO_LARGE"] = "LOCAL_025";
|
|
19
|
+
LocalModelErrorCode2["GPU_NOT_AVAILABLE"] = "LOCAL_030";
|
|
20
|
+
LocalModelErrorCode2["INSUFFICIENT_VRAM"] = "LOCAL_031";
|
|
21
|
+
LocalModelErrorCode2["GPU_DRIVER_ERROR"] = "LOCAL_032";
|
|
22
|
+
LocalModelErrorCode2["METAL_NOT_AVAILABLE"] = "LOCAL_033";
|
|
23
|
+
LocalModelErrorCode2["CUDA_NOT_AVAILABLE"] = "LOCAL_034";
|
|
24
|
+
LocalModelErrorCode2["VULKAN_NOT_AVAILABLE"] = "LOCAL_035";
|
|
25
|
+
LocalModelErrorCode2["OLLAMA_NOT_RUNNING"] = "LOCAL_040";
|
|
26
|
+
LocalModelErrorCode2["OLLAMA_MODEL_NOT_FOUND"] = "LOCAL_041";
|
|
27
|
+
LocalModelErrorCode2["OLLAMA_PULL_FAILED"] = "LOCAL_042";
|
|
28
|
+
LocalModelErrorCode2["OLLAMA_API_ERROR"] = "LOCAL_043";
|
|
29
|
+
LocalModelErrorCode2["OLLAMA_VERSION_INCOMPATIBLE"] = "LOCAL_044";
|
|
30
|
+
return LocalModelErrorCode2;
|
|
31
|
+
})(LocalModelErrorCode || {});
|
|
32
|
+
export {
|
|
33
|
+
LocalModelErrorCode
|
|
34
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
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 errors_exports = {};
|
|
20
|
+
__export(errors_exports, {
|
|
21
|
+
LocalModelError: () => LocalModelError
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(errors_exports);
|
|
24
|
+
var import_DextoRuntimeError = require("../../../errors/DextoRuntimeError.js");
|
|
25
|
+
var import_types = require("../../../errors/types.js");
|
|
26
|
+
var import_error_codes = require("./error-codes.js");
|
|
27
|
+
const SCOPE = "local-models";
|
|
28
|
+
const LocalModelError = {
|
|
29
|
+
// Installation errors
|
|
30
|
+
nodeLlamaNotInstalled() {
|
|
31
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
32
|
+
import_error_codes.LocalModelErrorCode.NODE_LLAMA_NOT_INSTALLED,
|
|
33
|
+
SCOPE,
|
|
34
|
+
import_types.ErrorType.NOT_FOUND,
|
|
35
|
+
'node-llama-cpp is not installed. Run `dexto setup` and select "local" provider to install it.',
|
|
36
|
+
{},
|
|
37
|
+
'Run `dexto setup` and select "local" provider to install local model support'
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
nodeLlamaInstallFailed(error) {
|
|
41
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
42
|
+
import_error_codes.LocalModelErrorCode.NODE_LLAMA_INSTALL_FAILED,
|
|
43
|
+
SCOPE,
|
|
44
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
45
|
+
`Failed to install node-llama-cpp: ${error}`,
|
|
46
|
+
{ error },
|
|
47
|
+
"Check your Node.js version and try again. CMake may be required for your platform."
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
cmakeNotFound() {
|
|
51
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
52
|
+
import_error_codes.LocalModelErrorCode.CMAKE_NOT_FOUND,
|
|
53
|
+
SCOPE,
|
|
54
|
+
import_types.ErrorType.NOT_FOUND,
|
|
55
|
+
"CMake is required to build node-llama-cpp from source but was not found.",
|
|
56
|
+
{},
|
|
57
|
+
"Install CMake: brew install cmake (macOS), apt install cmake (Linux), or download from cmake.org (Windows)"
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
// Download errors
|
|
61
|
+
downloadFailed(modelId, error) {
|
|
62
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
63
|
+
import_error_codes.LocalModelErrorCode.DOWNLOAD_FAILED,
|
|
64
|
+
SCOPE,
|
|
65
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
66
|
+
`Failed to download model '${modelId}': ${error}`,
|
|
67
|
+
{ modelId, error },
|
|
68
|
+
"Check your internet connection and try again"
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
downloadInterrupted(modelId) {
|
|
72
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
73
|
+
import_error_codes.LocalModelErrorCode.DOWNLOAD_INTERRUPTED,
|
|
74
|
+
SCOPE,
|
|
75
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
76
|
+
`Download of model '${modelId}' was interrupted`,
|
|
77
|
+
{ modelId },
|
|
78
|
+
"Run the download command again to resume"
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
hashMismatch(modelId, expected, actual) {
|
|
82
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
83
|
+
import_error_codes.LocalModelErrorCode.DOWNLOAD_HASH_MISMATCH,
|
|
84
|
+
SCOPE,
|
|
85
|
+
import_types.ErrorType.USER,
|
|
86
|
+
`Downloaded model '${modelId}' has invalid hash. Expected: ${expected}, Got: ${actual}`,
|
|
87
|
+
{ modelId, expected, actual },
|
|
88
|
+
"Delete the file and download again"
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
insufficientDiskSpace(modelId, required, available) {
|
|
92
|
+
const requiredGB = (required / (1024 * 1024 * 1024)).toFixed(1);
|
|
93
|
+
const availableGB = (available / (1024 * 1024 * 1024)).toFixed(1);
|
|
94
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
95
|
+
import_error_codes.LocalModelErrorCode.INSUFFICIENT_DISK_SPACE,
|
|
96
|
+
SCOPE,
|
|
97
|
+
import_types.ErrorType.USER,
|
|
98
|
+
`Insufficient disk space to download '${modelId}'. Required: ${requiredGB}GB, Available: ${availableGB}GB`,
|
|
99
|
+
{ modelId, required, available },
|
|
100
|
+
"Free up disk space or choose a smaller model"
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
hfAuthRequired(modelId) {
|
|
104
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
105
|
+
import_error_codes.LocalModelErrorCode.HF_AUTH_REQUIRED,
|
|
106
|
+
SCOPE,
|
|
107
|
+
import_types.ErrorType.FORBIDDEN,
|
|
108
|
+
`Model '${modelId}' is a gated model and requires HuggingFace authentication`,
|
|
109
|
+
{ modelId },
|
|
110
|
+
"Set HF_TOKEN environment variable or run `huggingface-cli login`"
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
// Model errors
|
|
114
|
+
modelNotFound(modelId) {
|
|
115
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
116
|
+
import_error_codes.LocalModelErrorCode.MODEL_NOT_FOUND,
|
|
117
|
+
SCOPE,
|
|
118
|
+
import_types.ErrorType.NOT_FOUND,
|
|
119
|
+
`Model '${modelId}' not found in local model registry`,
|
|
120
|
+
{ modelId },
|
|
121
|
+
'Run `dexto setup` and select "local" to see available models'
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
modelNotDownloaded(modelId) {
|
|
125
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
126
|
+
import_error_codes.LocalModelErrorCode.MODEL_NOT_DOWNLOADED,
|
|
127
|
+
SCOPE,
|
|
128
|
+
import_types.ErrorType.NOT_FOUND,
|
|
129
|
+
`Model '${modelId}' is not downloaded. Download it first.`,
|
|
130
|
+
{ modelId },
|
|
131
|
+
'Run `dexto setup` and select "local" to download models'
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
modelLoadFailed(modelId, error) {
|
|
135
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
136
|
+
import_error_codes.LocalModelErrorCode.MODEL_LOAD_FAILED,
|
|
137
|
+
SCOPE,
|
|
138
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
139
|
+
`Failed to load model '${modelId}': ${error}`,
|
|
140
|
+
{ modelId, error },
|
|
141
|
+
"The model file may be corrupted. Try re-downloading it."
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
modelCorrupt(modelId, filePath) {
|
|
145
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
146
|
+
import_error_codes.LocalModelErrorCode.MODEL_CORRUPT,
|
|
147
|
+
SCOPE,
|
|
148
|
+
import_types.ErrorType.USER,
|
|
149
|
+
`Model file for '${modelId}' appears to be corrupted`,
|
|
150
|
+
{ modelId, filePath },
|
|
151
|
+
`Delete ${filePath} and download the model again`
|
|
152
|
+
);
|
|
153
|
+
},
|
|
154
|
+
contextTooLarge(modelId, requested, maxSupported) {
|
|
155
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
156
|
+
import_error_codes.LocalModelErrorCode.CONTEXT_TOO_LARGE,
|
|
157
|
+
SCOPE,
|
|
158
|
+
import_types.ErrorType.USER,
|
|
159
|
+
`Requested context size ${requested} exceeds model's maximum of ${maxSupported}`,
|
|
160
|
+
{ modelId, requested, maxSupported },
|
|
161
|
+
`Use a context size of ${maxSupported} or less`
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
// GPU errors
|
|
165
|
+
gpuNotAvailable() {
|
|
166
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
167
|
+
import_error_codes.LocalModelErrorCode.GPU_NOT_AVAILABLE,
|
|
168
|
+
SCOPE,
|
|
169
|
+
import_types.ErrorType.NOT_FOUND,
|
|
170
|
+
"No GPU acceleration available. Running on CPU.",
|
|
171
|
+
{},
|
|
172
|
+
"For better performance, ensure GPU drivers are installed"
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
insufficientVRAM(modelId, required, available) {
|
|
176
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
177
|
+
import_error_codes.LocalModelErrorCode.INSUFFICIENT_VRAM,
|
|
178
|
+
SCOPE,
|
|
179
|
+
import_types.ErrorType.USER,
|
|
180
|
+
`Model '${modelId}' requires ${required}GB VRAM but only ${available}GB available`,
|
|
181
|
+
{ modelId, required, available },
|
|
182
|
+
"Use a smaller quantization or reduce GPU layers"
|
|
183
|
+
);
|
|
184
|
+
},
|
|
185
|
+
gpuDriverError(error) {
|
|
186
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
187
|
+
import_error_codes.LocalModelErrorCode.GPU_DRIVER_ERROR,
|
|
188
|
+
SCOPE,
|
|
189
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
190
|
+
`GPU driver error: ${error}`,
|
|
191
|
+
{ error },
|
|
192
|
+
"Update your GPU drivers"
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
// Ollama errors
|
|
196
|
+
ollamaNotRunning(url) {
|
|
197
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
198
|
+
import_error_codes.LocalModelErrorCode.OLLAMA_NOT_RUNNING,
|
|
199
|
+
SCOPE,
|
|
200
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
201
|
+
`Ollama server is not running at ${url}`,
|
|
202
|
+
{ url },
|
|
203
|
+
"Start Ollama with `ollama serve` or ensure it is running"
|
|
204
|
+
);
|
|
205
|
+
},
|
|
206
|
+
ollamaModelNotFound(modelName) {
|
|
207
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
208
|
+
import_error_codes.LocalModelErrorCode.OLLAMA_MODEL_NOT_FOUND,
|
|
209
|
+
SCOPE,
|
|
210
|
+
import_types.ErrorType.NOT_FOUND,
|
|
211
|
+
`Model '${modelName}' not found on Ollama server`,
|
|
212
|
+
{ modelName },
|
|
213
|
+
`Pull the model with \`ollama pull ${modelName}\``
|
|
214
|
+
);
|
|
215
|
+
},
|
|
216
|
+
ollamaPullFailed(modelName, error) {
|
|
217
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
218
|
+
import_error_codes.LocalModelErrorCode.OLLAMA_PULL_FAILED,
|
|
219
|
+
SCOPE,
|
|
220
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
221
|
+
`Failed to pull model '${modelName}' from Ollama: ${error}`,
|
|
222
|
+
{ modelName, error },
|
|
223
|
+
"Check your internet connection and Ollama server status"
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
ollamaApiError(error) {
|
|
227
|
+
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
228
|
+
import_error_codes.LocalModelErrorCode.OLLAMA_API_ERROR,
|
|
229
|
+
SCOPE,
|
|
230
|
+
import_types.ErrorType.THIRD_PARTY,
|
|
231
|
+
`Ollama API error: ${error}`,
|
|
232
|
+
{ error },
|
|
233
|
+
"Check Ollama server logs for details"
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
238
|
+
0 && (module.exports = {
|
|
239
|
+
LocalModelError
|
|
240
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error factory for local model errors.
|
|
3
|
+
* Follows the project's error factory pattern.
|
|
4
|
+
*/
|
|
5
|
+
import { DextoRuntimeError } from '../../../errors/DextoRuntimeError.js';
|
|
6
|
+
/**
|
|
7
|
+
* Error factory for local model operations.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LocalModelError: {
|
|
10
|
+
nodeLlamaNotInstalled(): DextoRuntimeError;
|
|
11
|
+
nodeLlamaInstallFailed(error: string): DextoRuntimeError;
|
|
12
|
+
cmakeNotFound(): DextoRuntimeError;
|
|
13
|
+
downloadFailed(modelId: string, error: string): DextoRuntimeError;
|
|
14
|
+
downloadInterrupted(modelId: string): DextoRuntimeError;
|
|
15
|
+
hashMismatch(modelId: string, expected: string, actual: string): DextoRuntimeError;
|
|
16
|
+
insufficientDiskSpace(modelId: string, required: number, available: number): DextoRuntimeError;
|
|
17
|
+
hfAuthRequired(modelId: string): DextoRuntimeError;
|
|
18
|
+
modelNotFound(modelId: string): DextoRuntimeError;
|
|
19
|
+
modelNotDownloaded(modelId: string): DextoRuntimeError;
|
|
20
|
+
modelLoadFailed(modelId: string, error: string): DextoRuntimeError;
|
|
21
|
+
modelCorrupt(modelId: string, filePath: string): DextoRuntimeError;
|
|
22
|
+
contextTooLarge(modelId: string, requested: number, maxSupported: number): DextoRuntimeError;
|
|
23
|
+
gpuNotAvailable(): DextoRuntimeError;
|
|
24
|
+
insufficientVRAM(modelId: string, required: number, available: number): DextoRuntimeError;
|
|
25
|
+
gpuDriverError(error: string): DextoRuntimeError;
|
|
26
|
+
ollamaNotRunning(url: string): DextoRuntimeError;
|
|
27
|
+
ollamaModelNotFound(modelName: string): DextoRuntimeError;
|
|
28
|
+
ollamaPullFailed(modelName: string, error: string): DextoRuntimeError;
|
|
29
|
+
ollamaApiError(error: string): DextoRuntimeError;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/llm/providers/local/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAMzE;;GAEG;AACH,eAAO,MAAM,eAAe;6BAEC,iBAAiB;kCAWZ,MAAM,GAAG,iBAAiB;qBAWvC,iBAAiB;4BAYV,MAAM,SAAS,MAAM,GAAG,iBAAiB;iCAWpC,MAAM,GAAG,iBAAiB;0BAWjC,MAAM,YAAY,MAAM,UAAU,MAAM,GAAG,iBAAiB;mCAWnD,MAAM,YAAY,MAAM,aAAa,MAAM,GAAG,iBAAiB;4BAatE,MAAM,GAAG,iBAAiB;2BAY3B,MAAM,GAAG,iBAAiB;gCAWrB,MAAM,GAAG,iBAAiB;6BAW7B,MAAM,SAAS,MAAM,GAAG,iBAAiB;0BAW5C,MAAM,YAAY,MAAM,GAAG,iBAAiB;6BAWzC,MAAM,aAAa,MAAM,gBAAgB,MAAM,GAAG,iBAAiB;uBAYzE,iBAAiB;8BAWV,MAAM,YAAY,MAAM,aAAa,MAAM,GAAG,iBAAiB;0BAWnE,MAAM,GAAG,iBAAiB;0BAY1B,MAAM,GAAG,iBAAiB;mCAWjB,MAAM,GAAG,iBAAiB;gCAW7B,MAAM,SAAS,MAAM,GAAG,iBAAiB;0BAW/C,MAAM,GAAG,iBAAiB;CAUnD,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
+
import { DextoRuntimeError } from "../../../errors/DextoRuntimeError.js";
|
|
3
|
+
import { ErrorType } from "../../../errors/types.js";
|
|
4
|
+
import { LocalModelErrorCode } from "./error-codes.js";
|
|
5
|
+
const SCOPE = "local-models";
|
|
6
|
+
const LocalModelError = {
|
|
7
|
+
// Installation errors
|
|
8
|
+
nodeLlamaNotInstalled() {
|
|
9
|
+
return new DextoRuntimeError(
|
|
10
|
+
LocalModelErrorCode.NODE_LLAMA_NOT_INSTALLED,
|
|
11
|
+
SCOPE,
|
|
12
|
+
ErrorType.NOT_FOUND,
|
|
13
|
+
'node-llama-cpp is not installed. Run `dexto setup` and select "local" provider to install it.',
|
|
14
|
+
{},
|
|
15
|
+
'Run `dexto setup` and select "local" provider to install local model support'
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
nodeLlamaInstallFailed(error) {
|
|
19
|
+
return new DextoRuntimeError(
|
|
20
|
+
LocalModelErrorCode.NODE_LLAMA_INSTALL_FAILED,
|
|
21
|
+
SCOPE,
|
|
22
|
+
ErrorType.THIRD_PARTY,
|
|
23
|
+
`Failed to install node-llama-cpp: ${error}`,
|
|
24
|
+
{ error },
|
|
25
|
+
"Check your Node.js version and try again. CMake may be required for your platform."
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
cmakeNotFound() {
|
|
29
|
+
return new DextoRuntimeError(
|
|
30
|
+
LocalModelErrorCode.CMAKE_NOT_FOUND,
|
|
31
|
+
SCOPE,
|
|
32
|
+
ErrorType.NOT_FOUND,
|
|
33
|
+
"CMake is required to build node-llama-cpp from source but was not found.",
|
|
34
|
+
{},
|
|
35
|
+
"Install CMake: brew install cmake (macOS), apt install cmake (Linux), or download from cmake.org (Windows)"
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
// Download errors
|
|
39
|
+
downloadFailed(modelId, error) {
|
|
40
|
+
return new DextoRuntimeError(
|
|
41
|
+
LocalModelErrorCode.DOWNLOAD_FAILED,
|
|
42
|
+
SCOPE,
|
|
43
|
+
ErrorType.THIRD_PARTY,
|
|
44
|
+
`Failed to download model '${modelId}': ${error}`,
|
|
45
|
+
{ modelId, error },
|
|
46
|
+
"Check your internet connection and try again"
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
downloadInterrupted(modelId) {
|
|
50
|
+
return new DextoRuntimeError(
|
|
51
|
+
LocalModelErrorCode.DOWNLOAD_INTERRUPTED,
|
|
52
|
+
SCOPE,
|
|
53
|
+
ErrorType.THIRD_PARTY,
|
|
54
|
+
`Download of model '${modelId}' was interrupted`,
|
|
55
|
+
{ modelId },
|
|
56
|
+
"Run the download command again to resume"
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
hashMismatch(modelId, expected, actual) {
|
|
60
|
+
return new DextoRuntimeError(
|
|
61
|
+
LocalModelErrorCode.DOWNLOAD_HASH_MISMATCH,
|
|
62
|
+
SCOPE,
|
|
63
|
+
ErrorType.USER,
|
|
64
|
+
`Downloaded model '${modelId}' has invalid hash. Expected: ${expected}, Got: ${actual}`,
|
|
65
|
+
{ modelId, expected, actual },
|
|
66
|
+
"Delete the file and download again"
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
insufficientDiskSpace(modelId, required, available) {
|
|
70
|
+
const requiredGB = (required / (1024 * 1024 * 1024)).toFixed(1);
|
|
71
|
+
const availableGB = (available / (1024 * 1024 * 1024)).toFixed(1);
|
|
72
|
+
return new DextoRuntimeError(
|
|
73
|
+
LocalModelErrorCode.INSUFFICIENT_DISK_SPACE,
|
|
74
|
+
SCOPE,
|
|
75
|
+
ErrorType.USER,
|
|
76
|
+
`Insufficient disk space to download '${modelId}'. Required: ${requiredGB}GB, Available: ${availableGB}GB`,
|
|
77
|
+
{ modelId, required, available },
|
|
78
|
+
"Free up disk space or choose a smaller model"
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
hfAuthRequired(modelId) {
|
|
82
|
+
return new DextoRuntimeError(
|
|
83
|
+
LocalModelErrorCode.HF_AUTH_REQUIRED,
|
|
84
|
+
SCOPE,
|
|
85
|
+
ErrorType.FORBIDDEN,
|
|
86
|
+
`Model '${modelId}' is a gated model and requires HuggingFace authentication`,
|
|
87
|
+
{ modelId },
|
|
88
|
+
"Set HF_TOKEN environment variable or run `huggingface-cli login`"
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
// Model errors
|
|
92
|
+
modelNotFound(modelId) {
|
|
93
|
+
return new DextoRuntimeError(
|
|
94
|
+
LocalModelErrorCode.MODEL_NOT_FOUND,
|
|
95
|
+
SCOPE,
|
|
96
|
+
ErrorType.NOT_FOUND,
|
|
97
|
+
`Model '${modelId}' not found in local model registry`,
|
|
98
|
+
{ modelId },
|
|
99
|
+
'Run `dexto setup` and select "local" to see available models'
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
modelNotDownloaded(modelId) {
|
|
103
|
+
return new DextoRuntimeError(
|
|
104
|
+
LocalModelErrorCode.MODEL_NOT_DOWNLOADED,
|
|
105
|
+
SCOPE,
|
|
106
|
+
ErrorType.NOT_FOUND,
|
|
107
|
+
`Model '${modelId}' is not downloaded. Download it first.`,
|
|
108
|
+
{ modelId },
|
|
109
|
+
'Run `dexto setup` and select "local" to download models'
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
modelLoadFailed(modelId, error) {
|
|
113
|
+
return new DextoRuntimeError(
|
|
114
|
+
LocalModelErrorCode.MODEL_LOAD_FAILED,
|
|
115
|
+
SCOPE,
|
|
116
|
+
ErrorType.THIRD_PARTY,
|
|
117
|
+
`Failed to load model '${modelId}': ${error}`,
|
|
118
|
+
{ modelId, error },
|
|
119
|
+
"The model file may be corrupted. Try re-downloading it."
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
modelCorrupt(modelId, filePath) {
|
|
123
|
+
return new DextoRuntimeError(
|
|
124
|
+
LocalModelErrorCode.MODEL_CORRUPT,
|
|
125
|
+
SCOPE,
|
|
126
|
+
ErrorType.USER,
|
|
127
|
+
`Model file for '${modelId}' appears to be corrupted`,
|
|
128
|
+
{ modelId, filePath },
|
|
129
|
+
`Delete ${filePath} and download the model again`
|
|
130
|
+
);
|
|
131
|
+
},
|
|
132
|
+
contextTooLarge(modelId, requested, maxSupported) {
|
|
133
|
+
return new DextoRuntimeError(
|
|
134
|
+
LocalModelErrorCode.CONTEXT_TOO_LARGE,
|
|
135
|
+
SCOPE,
|
|
136
|
+
ErrorType.USER,
|
|
137
|
+
`Requested context size ${requested} exceeds model's maximum of ${maxSupported}`,
|
|
138
|
+
{ modelId, requested, maxSupported },
|
|
139
|
+
`Use a context size of ${maxSupported} or less`
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
// GPU errors
|
|
143
|
+
gpuNotAvailable() {
|
|
144
|
+
return new DextoRuntimeError(
|
|
145
|
+
LocalModelErrorCode.GPU_NOT_AVAILABLE,
|
|
146
|
+
SCOPE,
|
|
147
|
+
ErrorType.NOT_FOUND,
|
|
148
|
+
"No GPU acceleration available. Running on CPU.",
|
|
149
|
+
{},
|
|
150
|
+
"For better performance, ensure GPU drivers are installed"
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
insufficientVRAM(modelId, required, available) {
|
|
154
|
+
return new DextoRuntimeError(
|
|
155
|
+
LocalModelErrorCode.INSUFFICIENT_VRAM,
|
|
156
|
+
SCOPE,
|
|
157
|
+
ErrorType.USER,
|
|
158
|
+
`Model '${modelId}' requires ${required}GB VRAM but only ${available}GB available`,
|
|
159
|
+
{ modelId, required, available },
|
|
160
|
+
"Use a smaller quantization or reduce GPU layers"
|
|
161
|
+
);
|
|
162
|
+
},
|
|
163
|
+
gpuDriverError(error) {
|
|
164
|
+
return new DextoRuntimeError(
|
|
165
|
+
LocalModelErrorCode.GPU_DRIVER_ERROR,
|
|
166
|
+
SCOPE,
|
|
167
|
+
ErrorType.THIRD_PARTY,
|
|
168
|
+
`GPU driver error: ${error}`,
|
|
169
|
+
{ error },
|
|
170
|
+
"Update your GPU drivers"
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
// Ollama errors
|
|
174
|
+
ollamaNotRunning(url) {
|
|
175
|
+
return new DextoRuntimeError(
|
|
176
|
+
LocalModelErrorCode.OLLAMA_NOT_RUNNING,
|
|
177
|
+
SCOPE,
|
|
178
|
+
ErrorType.THIRD_PARTY,
|
|
179
|
+
`Ollama server is not running at ${url}`,
|
|
180
|
+
{ url },
|
|
181
|
+
"Start Ollama with `ollama serve` or ensure it is running"
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
ollamaModelNotFound(modelName) {
|
|
185
|
+
return new DextoRuntimeError(
|
|
186
|
+
LocalModelErrorCode.OLLAMA_MODEL_NOT_FOUND,
|
|
187
|
+
SCOPE,
|
|
188
|
+
ErrorType.NOT_FOUND,
|
|
189
|
+
`Model '${modelName}' not found on Ollama server`,
|
|
190
|
+
{ modelName },
|
|
191
|
+
`Pull the model with \`ollama pull ${modelName}\``
|
|
192
|
+
);
|
|
193
|
+
},
|
|
194
|
+
ollamaPullFailed(modelName, error) {
|
|
195
|
+
return new DextoRuntimeError(
|
|
196
|
+
LocalModelErrorCode.OLLAMA_PULL_FAILED,
|
|
197
|
+
SCOPE,
|
|
198
|
+
ErrorType.THIRD_PARTY,
|
|
199
|
+
`Failed to pull model '${modelName}' from Ollama: ${error}`,
|
|
200
|
+
{ modelName, error },
|
|
201
|
+
"Check your internet connection and Ollama server status"
|
|
202
|
+
);
|
|
203
|
+
},
|
|
204
|
+
ollamaApiError(error) {
|
|
205
|
+
return new DextoRuntimeError(
|
|
206
|
+
LocalModelErrorCode.OLLAMA_API_ERROR,
|
|
207
|
+
SCOPE,
|
|
208
|
+
ErrorType.THIRD_PARTY,
|
|
209
|
+
`Ollama API error: ${error}`,
|
|
210
|
+
{ error },
|
|
211
|
+
"Check Ollama server logs for details"
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
LocalModelError
|
|
217
|
+
};
|