@dexto/core 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/agent/DextoAgent.cjs +22 -3
- package/dist/agent/DextoAgent.d.ts +19 -2
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +23 -4
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +5 -1
- package/dist/agent/schemas.cjs +90 -71
- package/dist/agent/schemas.d.ts +5911 -96
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +87 -66
- package/dist/approval/manager.cjs +165 -1
- package/dist/approval/manager.d.ts +91 -2
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +155 -1
- package/dist/approval/schemas.cjs +39 -3
- package/dist/approval/schemas.d.ts +238 -1
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +35 -3
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +26 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -0
- package/dist/context/compaction/factory.cjs +57 -0
- package/dist/context/compaction/factory.d.ts +17 -0
- package/dist/context/compaction/factory.d.ts.map +1 -0
- package/dist/context/compaction/factory.js +34 -0
- package/dist/context/compaction/index.cjs +49 -0
- package/dist/context/compaction/index.d.ts +11 -0
- package/dist/context/compaction/index.d.ts.map +1 -0
- package/dist/context/compaction/index.js +19 -0
- package/dist/context/{compression → compaction}/overflow.cjs +3 -3
- package/dist/context/{compression → compaction}/overflow.d.ts +4 -4
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction}/overflow.js +2 -2
- package/dist/context/compaction/provider.cjs +16 -0
- package/dist/context/compaction/provider.d.ts +48 -0
- package/dist/context/compaction/provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.cjs +48 -0
- package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
- package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.js +24 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
- package/dist/context/compaction/registry.cjs +39 -0
- package/dist/context/compaction/registry.d.ts +19 -0
- package/dist/context/compaction/registry.d.ts.map +1 -0
- package/dist/context/compaction/registry.js +16 -0
- package/dist/context/compaction/schemas.cjs +38 -0
- package/dist/context/compaction/schemas.d.ts +24 -0
- package/dist/context/compaction/schemas.d.ts.map +1 -0
- package/dist/context/compaction/schemas.js +14 -0
- package/dist/context/compaction/strategies/noop.cjs +36 -0
- package/dist/context/compaction/strategies/noop.d.ts +18 -0
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
- package/dist/context/compaction/strategies/noop.js +13 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.cjs +3 -3
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.d.ts +6 -6
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/{compression → compaction/strategies}/reactive-overflow.js +4 -4
- package/dist/context/{compression → compaction}/types.d.ts +4 -4
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/compaction/types.js +0 -0
- package/dist/context/error-codes.cjs +4 -0
- package/dist/context/error-codes.d.ts +4 -0
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +4 -0
- package/dist/context/errors.cjs +40 -0
- package/dist/context/errors.d.ts +14 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +40 -0
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -0
- package/dist/context/types.d.ts +6 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +27 -7
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +27 -7
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +2 -3
- package/dist/events/index.cjs +2 -2
- package/dist/events/index.d.ts +16 -16
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +2 -2
- package/dist/filesystem/filesystem-service.cjs +39 -0
- package/dist/filesystem/filesystem-service.d.ts +32 -0
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +39 -0
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/path-validator.cjs +69 -1
- package/dist/filesystem/path-validator.d.ts +43 -2
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +69 -1
- package/dist/image/define-image.cjs +146 -0
- package/dist/image/define-image.d.ts +71 -0
- package/dist/image/define-image.d.ts.map +1 -0
- package/dist/image/define-image.js +121 -0
- package/dist/image/index.cjs +32 -0
- package/dist/image/index.d.ts +53 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +7 -0
- package/dist/image/types.cjs +16 -0
- package/dist/image/types.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/llm/error-codes.cjs +1 -0
- package/dist/llm/error-codes.d.ts +1 -0
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +1 -0
- package/dist/llm/errors.cjs +24 -0
- package/dist/llm/errors.d.ts +19 -6
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +24 -0
- package/dist/llm/executor/stream-processor.cjs +11 -3
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +11 -3
- package/dist/llm/executor/turn-executor.cjs +50 -23
- package/dist/llm/executor/turn-executor.d.ts +6 -5
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +50 -23
- package/dist/llm/formatters/vercel.cjs +6 -2
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +6 -2
- package/dist/llm/index.cjs +18 -1
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +14 -0
- package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
- package/dist/llm/providers/local/downloader.cjs +291 -0
- package/dist/llm/providers/local/downloader.d.ts +82 -0
- package/dist/llm/providers/local/downloader.d.ts.map +1 -0
- package/dist/llm/providers/local/downloader.js +251 -0
- package/dist/llm/providers/local/error-codes.cjs +57 -0
- package/dist/llm/providers/local/error-codes.d.ts +66 -0
- package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
- package/dist/llm/providers/local/error-codes.js +34 -0
- package/dist/llm/providers/local/errors.cjs +240 -0
- package/dist/llm/providers/local/errors.d.ts +31 -0
- package/dist/llm/providers/local/errors.d.ts.map +1 -0
- package/dist/llm/providers/local/errors.js +217 -0
- package/dist/llm/providers/local/gpu-detector.cjs +214 -0
- package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
- package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
- package/dist/llm/providers/local/gpu-detector.js +178 -0
- package/dist/llm/providers/local/index.cjs +147 -0
- package/dist/llm/providers/local/index.d.ts +21 -0
- package/dist/llm/providers/local/index.d.ts.map +1 -0
- package/dist/llm/providers/local/index.js +126 -0
- package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/node-llama-provider.js +176 -0
- package/dist/llm/providers/local/ollama-provider.cjs +230 -0
- package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
- package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/ollama-provider.js +198 -0
- package/dist/llm/providers/local/registry.cjs +343 -0
- package/dist/llm/providers/local/registry.d.ts +51 -0
- package/dist/llm/providers/local/registry.d.ts.map +1 -0
- package/dist/llm/providers/local/registry.js +312 -0
- package/dist/llm/providers/local/schemas.cjs +169 -0
- package/dist/llm/providers/local/schemas.d.ts +395 -0
- package/dist/llm/providers/local/schemas.d.ts.map +1 -0
- package/dist/llm/providers/local/schemas.js +133 -0
- package/dist/llm/providers/local/types.cjs +16 -0
- package/dist/llm/providers/local/types.d.ts +219 -0
- package/dist/llm/providers/local/types.d.ts.map +1 -0
- package/dist/llm/providers/local/types.js +0 -0
- package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
- package/dist/llm/providers/openrouter-model-registry.js +309 -0
- package/dist/llm/registry.cjs +535 -9
- package/dist/llm/registry.d.ts +26 -0
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +532 -9
- package/dist/llm/resolver.cjs +63 -5
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -6
- package/dist/llm/schemas.cjs +90 -80
- package/dist/llm/schemas.d.ts +158 -22
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +90 -80
- package/dist/llm/services/factory.cjs +87 -13
- package/dist/llm/services/factory.d.ts +4 -1
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +85 -12
- package/dist/llm/services/test-utils.integration.cjs +22 -2
- package/dist/llm/services/test-utils.integration.d.ts +7 -1
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +26 -3
- package/dist/llm/services/vercel.cjs +5 -2
- package/dist/llm/services/vercel.d.ts +3 -2
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +5 -2
- package/dist/llm/types.cjs +11 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +11 -1
- package/dist/mcp/manager.cjs +8 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +8 -0
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +0 -3
- package/dist/memory/schemas.d.ts +1 -1
- package/dist/plugins/error-codes.cjs +3 -0
- package/dist/plugins/error-codes.d.ts +7 -1
- package/dist/plugins/error-codes.d.ts.map +1 -1
- package/dist/plugins/error-codes.js +3 -0
- package/dist/plugins/index.cjs +7 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +6 -1
- package/dist/plugins/manager.cjs +92 -7
- package/dist/plugins/manager.d.ts +10 -3
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +92 -7
- package/dist/plugins/registry.cjs +63 -0
- package/dist/plugins/registry.d.ts +101 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +39 -0
- package/dist/plugins/schemas.cjs +17 -5
- package/dist/plugins/schemas.d.ts +62 -5
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +15 -4
- package/dist/providers/base-registry.cjs +147 -0
- package/dist/providers/base-registry.d.ts +147 -0
- package/dist/providers/base-registry.d.ts.map +1 -0
- package/dist/providers/base-registry.js +123 -0
- package/dist/providers/discovery.cjs +95 -0
- package/dist/providers/discovery.d.ts +94 -0
- package/dist/providers/discovery.d.ts.map +1 -0
- package/dist/providers/discovery.js +70 -0
- package/dist/providers/index.cjs +24 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +3 -3
- package/dist/session/chat-session.cjs +20 -3
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +21 -4
- package/dist/storage/blob/factory.cjs +8 -11
- package/dist/storage/blob/factory.d.ts +32 -6
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +8 -11
- package/dist/storage/blob/index.cjs +56 -0
- package/dist/storage/blob/index.d.ts +45 -0
- package/dist/storage/blob/index.d.ts.map +1 -0
- package/dist/storage/blob/index.js +30 -0
- package/dist/storage/blob/provider.cjs +16 -0
- package/dist/storage/blob/provider.d.ts +50 -0
- package/dist/storage/blob/provider.d.ts.map +1 -0
- package/dist/storage/blob/provider.js +0 -0
- package/dist/storage/blob/providers/index.cjs +31 -0
- package/dist/storage/blob/providers/index.d.ts +8 -0
- package/dist/storage/blob/providers/index.d.ts.map +1 -0
- package/dist/storage/blob/providers/index.js +7 -0
- package/dist/storage/blob/providers/local.cjs +39 -0
- package/dist/storage/blob/providers/local.d.ts +17 -0
- package/dist/storage/blob/providers/local.d.ts.map +1 -0
- package/dist/storage/blob/providers/local.js +16 -0
- package/dist/storage/blob/providers/memory.cjs +39 -0
- package/dist/storage/blob/providers/memory.d.ts +17 -0
- package/dist/storage/blob/providers/memory.d.ts.map +1 -0
- package/dist/storage/blob/providers/memory.js +16 -0
- package/dist/storage/blob/registry.cjs +50 -0
- package/dist/storage/blob/registry.d.ts +42 -0
- package/dist/storage/blob/registry.d.ts.map +1 -0
- package/dist/storage/blob/registry.js +26 -0
- package/dist/storage/blob/schemas.cjs +9 -12
- package/dist/storage/blob/schemas.d.ts +39 -34
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +6 -11
- package/dist/storage/cache/factory.cjs +8 -36
- package/dist/storage/cache/factory.d.ts +32 -7
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +8 -26
- package/dist/storage/cache/index.cjs +53 -0
- package/dist/storage/cache/index.d.ts +44 -0
- package/dist/storage/cache/index.d.ts.map +1 -0
- package/dist/storage/cache/index.js +28 -0
- package/dist/storage/cache/provider.cjs +16 -0
- package/dist/storage/cache/provider.d.ts +56 -0
- package/dist/storage/cache/provider.d.ts.map +1 -0
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.cjs +31 -0
- package/dist/storage/cache/providers/index.d.ts +8 -0
- package/dist/storage/cache/providers/index.d.ts.map +1 -0
- package/dist/storage/cache/providers/index.js +7 -0
- package/dist/storage/cache/providers/memory.cjs +40 -0
- package/dist/storage/cache/providers/memory.d.ts +17 -0
- package/dist/storage/cache/providers/memory.d.ts.map +1 -0
- package/dist/storage/cache/providers/memory.js +17 -0
- package/dist/storage/cache/providers/redis.cjs +66 -0
- package/dist/storage/cache/providers/redis.d.ts +20 -0
- package/dist/storage/cache/providers/redis.d.ts.map +1 -0
- package/dist/storage/cache/providers/redis.js +33 -0
- package/dist/storage/cache/registry.cjs +50 -0
- package/dist/storage/cache/registry.d.ts +42 -0
- package/dist/storage/cache/registry.d.ts.map +1 -0
- package/dist/storage/cache/registry.js +26 -0
- package/dist/storage/cache/schemas.cjs +6 -2
- package/dist/storage/cache/schemas.d.ts +2 -3
- package/dist/storage/cache/schemas.d.ts.map +1 -1
- package/dist/storage/cache/schemas.js +3 -1
- package/dist/storage/database/factory.cjs +8 -47
- package/dist/storage/database/factory.d.ts +34 -8
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +8 -37
- package/dist/storage/database/index.cjs +58 -0
- package/dist/storage/database/index.d.ts +45 -0
- package/dist/storage/database/index.d.ts.map +1 -0
- package/dist/storage/database/index.js +37 -0
- package/dist/storage/database/provider.cjs +16 -0
- package/dist/storage/database/provider.d.ts +56 -0
- package/dist/storage/database/provider.d.ts.map +1 -0
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +34 -0
- package/dist/storage/database/providers/index.d.ts +9 -0
- package/dist/storage/database/providers/index.d.ts.map +1 -0
- package/dist/storage/database/providers/index.js +9 -0
- package/dist/storage/database/providers/memory.cjs +40 -0
- package/dist/storage/database/providers/memory.d.ts +16 -0
- package/dist/storage/database/providers/memory.d.ts.map +1 -0
- package/dist/storage/database/providers/memory.js +17 -0
- package/dist/storage/database/providers/postgres.cjs +62 -0
- package/dist/storage/database/providers/postgres.d.ts +19 -0
- package/dist/storage/database/providers/postgres.d.ts.map +1 -0
- package/dist/storage/database/providers/postgres.js +29 -0
- package/dist/storage/database/providers/sqlite.cjs +66 -0
- package/dist/storage/database/providers/sqlite.d.ts +20 -0
- package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
- package/dist/storage/database/providers/sqlite.js +33 -0
- package/dist/storage/database/registry.cjs +50 -0
- package/dist/storage/database/registry.d.ts +42 -0
- package/dist/storage/database/registry.d.ts.map +1 -0
- package/dist/storage/database/registry.js +26 -0
- package/dist/storage/database/schemas.cjs +8 -2
- package/dist/storage/database/schemas.d.ts +3 -4
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +4 -1
- package/dist/storage/error-codes.cjs +6 -0
- package/dist/storage/error-codes.d.ts +7 -1
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +6 -0
- package/dist/storage/errors.cjs +80 -0
- package/dist/storage/errors.d.ts +24 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +80 -0
- package/dist/storage/index.cjs +47 -4
- package/dist/storage/index.d.ts +34 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +32 -3
- package/dist/storage/schemas.cjs +4 -0
- package/dist/storage/schemas.d.ts +17 -50
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +5 -1
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +3 -3
- package/dist/systemPrompt/in-built-prompts.cjs +7 -6
- package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +6 -5
- package/dist/systemPrompt/registry.cjs +2 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +2 -2
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +13 -13
- package/dist/systemPrompt/schemas.js +2 -2
- package/dist/tools/custom-tool-registry.cjs +64 -0
- package/dist/tools/custom-tool-registry.d.ts +120 -0
- package/dist/tools/custom-tool-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-registry.js +40 -0
- package/dist/tools/custom-tool-schema-registry.cjs +164 -0
- package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
- package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-schema-registry.js +140 -0
- package/dist/tools/error-codes.cjs +3 -0
- package/dist/tools/error-codes.d.ts +4 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +3 -0
- package/dist/tools/errors.cjs +41 -0
- package/dist/tools/errors.d.ts +17 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +41 -0
- package/dist/tools/index.cjs +13 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +11 -1
- package/dist/tools/internal-tools/constants.cjs +3 -9
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +3 -9
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
- package/dist/tools/internal-tools/provider.cjs +150 -23
- package/dist/tools/internal-tools/provider.d.ts +55 -10
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +150 -23
- package/dist/tools/internal-tools/registry.cjs +18 -43
- package/dist/tools/internal-tools/registry.d.ts +4 -4
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +18 -43
- package/dist/tools/schemas.cjs +20 -0
- package/dist/tools/schemas.d.ts +43 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +16 -0
- package/dist/tools/tool-manager.cjs +140 -13
- package/dist/tools/tool-manager.d.ts +22 -3
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +140 -13
- package/dist/tools/types.d.ts +43 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +19 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/redactor.cjs +18 -3
- package/dist/utils/redactor.d.ts +0 -7
- package/dist/utils/redactor.d.ts.map +1 -1
- package/dist/utils/redactor.js +18 -3
- package/dist/utils/service-initializer.cjs +9 -35
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +9 -35
- package/package.json +5 -2
- package/dist/context/compression/overflow.d.ts.map +0 -1
- package/dist/context/compression/reactive-overflow.d.ts.map +0 -1
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -130
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -97
- package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
- package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -127
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -104
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -70
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -47
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -86
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -63
- package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
- package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -63
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -40
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -124
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -103
- package/dist/utils/env-file.cjs +0 -118
- package/dist/utils/env-file.d.ts +0 -5
- package/dist/utils/env-file.d.ts.map +0 -1
- package/dist/utils/env-file.js +0 -85
- /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
- /package/dist/context/{compression → compaction}/types.cjs +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
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 reactive_overflow_provider_exports = {};
|
|
20
|
+
__export(reactive_overflow_provider_exports, {
|
|
21
|
+
ReactiveOverflowConfigSchema: () => ReactiveOverflowConfigSchema,
|
|
22
|
+
reactiveOverflowProvider: () => reactiveOverflowProvider
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(reactive_overflow_provider_exports);
|
|
25
|
+
var import_zod = require("zod");
|
|
26
|
+
var import_reactive_overflow = require("../strategies/reactive-overflow.js");
|
|
27
|
+
const ReactiveOverflowConfigSchema = import_zod.z.object({
|
|
28
|
+
type: import_zod.z.literal("reactive-overflow"),
|
|
29
|
+
enabled: import_zod.z.boolean().default(true).describe("Enable or disable compaction"),
|
|
30
|
+
preserveLastNTurns: import_zod.z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
|
|
31
|
+
maxSummaryTokens: import_zod.z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
|
|
32
|
+
summaryPrompt: import_zod.z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
|
|
33
|
+
}).strict();
|
|
34
|
+
const reactiveOverflowProvider = {
|
|
35
|
+
type: "reactive-overflow",
|
|
36
|
+
configSchema: ReactiveOverflowConfigSchema,
|
|
37
|
+
metadata: {
|
|
38
|
+
displayName: "Reactive Overflow Compaction",
|
|
39
|
+
description: "Generates summaries when context window overflows, preserving recent turns",
|
|
40
|
+
requiresLLM: true,
|
|
41
|
+
isProactive: false
|
|
42
|
+
},
|
|
43
|
+
create(config, context) {
|
|
44
|
+
if (!context.model) {
|
|
45
|
+
throw new Error("ReactiveOverflowStrategy requires LanguageModel");
|
|
46
|
+
}
|
|
47
|
+
const options = {
|
|
48
|
+
preserveLastNTurns: config.preserveLastNTurns,
|
|
49
|
+
maxSummaryTokens: config.maxSummaryTokens
|
|
50
|
+
};
|
|
51
|
+
if (config.summaryPrompt !== void 0) {
|
|
52
|
+
options.summaryPrompt = config.summaryPrompt;
|
|
53
|
+
}
|
|
54
|
+
return new import_reactive_overflow.ReactiveOverflowStrategy(context.model, options, context.logger);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
ReactiveOverflowConfigSchema,
|
|
60
|
+
reactiveOverflowProvider
|
|
61
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CompactionProvider } from '../provider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration schema for reactive overflow compaction
|
|
5
|
+
*/
|
|
6
|
+
export declare const ReactiveOverflowConfigSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"reactive-overflow">;
|
|
8
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
preserveLastNTurns: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
maxSummaryTokens: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
summaryPrompt: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strict", z.ZodTypeAny, {
|
|
13
|
+
type: "reactive-overflow";
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
preserveLastNTurns: number;
|
|
16
|
+
maxSummaryTokens: number;
|
|
17
|
+
summaryPrompt?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
type: "reactive-overflow";
|
|
20
|
+
enabled?: boolean | undefined;
|
|
21
|
+
preserveLastNTurns?: number | undefined;
|
|
22
|
+
maxSummaryTokens?: number | undefined;
|
|
23
|
+
summaryPrompt?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export type ReactiveOverflowConfig = z.output<typeof ReactiveOverflowConfigSchema>;
|
|
26
|
+
/**
|
|
27
|
+
* Provider for reactive overflow compaction strategy.
|
|
28
|
+
*
|
|
29
|
+
* This strategy triggers compaction when context window overflow is detected:
|
|
30
|
+
* - Generates LLM-powered summaries of older messages
|
|
31
|
+
* - Preserves recent turns for context continuity
|
|
32
|
+
* - Falls back to simple text summary if LLM call fails
|
|
33
|
+
* - Adds summary message to history (read-time filtering excludes old messages)
|
|
34
|
+
*/
|
|
35
|
+
export declare const reactiveOverflowProvider: CompactionProvider<'reactive-overflow', ReactiveOverflowConfig>;
|
|
36
|
+
//# sourceMappingURL=reactive-overflow-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive-overflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/providers/reactive-overflow-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAqB5B,CAAC;AAEd,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEnF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAAkB,CACrD,mBAAmB,EACnB,sBAAsB,CA2BzB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ReactiveOverflowStrategy } from "../strategies/reactive-overflow.js";
|
|
4
|
+
const ReactiveOverflowConfigSchema = z.object({
|
|
5
|
+
type: z.literal("reactive-overflow"),
|
|
6
|
+
enabled: z.boolean().default(true).describe("Enable or disable compaction"),
|
|
7
|
+
preserveLastNTurns: z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
|
|
8
|
+
maxSummaryTokens: z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
|
|
9
|
+
summaryPrompt: z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
|
|
10
|
+
}).strict();
|
|
11
|
+
const reactiveOverflowProvider = {
|
|
12
|
+
type: "reactive-overflow",
|
|
13
|
+
configSchema: ReactiveOverflowConfigSchema,
|
|
14
|
+
metadata: {
|
|
15
|
+
displayName: "Reactive Overflow Compaction",
|
|
16
|
+
description: "Generates summaries when context window overflows, preserving recent turns",
|
|
17
|
+
requiresLLM: true,
|
|
18
|
+
isProactive: false
|
|
19
|
+
},
|
|
20
|
+
create(config, context) {
|
|
21
|
+
if (!context.model) {
|
|
22
|
+
throw new Error("ReactiveOverflowStrategy requires LanguageModel");
|
|
23
|
+
}
|
|
24
|
+
const options = {
|
|
25
|
+
preserveLastNTurns: config.preserveLastNTurns,
|
|
26
|
+
maxSummaryTokens: config.maxSummaryTokens
|
|
27
|
+
};
|
|
28
|
+
if (config.summaryPrompt !== void 0) {
|
|
29
|
+
options.summaryPrompt = config.summaryPrompt;
|
|
30
|
+
}
|
|
31
|
+
return new ReactiveOverflowStrategy(context.model, options, context.logger);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
ReactiveOverflowConfigSchema,
|
|
36
|
+
reactiveOverflowProvider
|
|
37
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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 registry_exports = {};
|
|
20
|
+
__export(registry_exports, {
|
|
21
|
+
compactionRegistry: () => compactionRegistry
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(registry_exports);
|
|
24
|
+
var import_errors = require("../errors.js");
|
|
25
|
+
var import_base_registry = require("../../providers/base-registry.js");
|
|
26
|
+
const compactionErrorFactory = {
|
|
27
|
+
alreadyRegistered: (type) => import_errors.ContextError.compactionProviderAlreadyRegistered(type),
|
|
28
|
+
notFound: (type, availableTypes) => import_errors.ContextError.compactionInvalidType(type, availableTypes)
|
|
29
|
+
};
|
|
30
|
+
class CompactionRegistry extends import_base_registry.BaseRegistry {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(compactionErrorFactory);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const compactionRegistry = new CompactionRegistry();
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
compactionRegistry
|
|
39
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CompactionProvider } from './provider.js';
|
|
2
|
+
import { BaseRegistry } from '../../providers/base-registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Global registry for compaction providers.
|
|
5
|
+
*
|
|
6
|
+
* Follows the same pattern as blob storage and tools registries:
|
|
7
|
+
* - Singleton instance exported
|
|
8
|
+
* - Registration before agent initialization
|
|
9
|
+
* - Type-safe provider lookup
|
|
10
|
+
*
|
|
11
|
+
* Extends BaseRegistry for common registry functionality.
|
|
12
|
+
*/
|
|
13
|
+
declare class CompactionRegistry extends BaseRegistry<CompactionProvider<any, any>> {
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
/** Global singleton instance */
|
|
17
|
+
export declare const compactionRegistry: CompactionRegistry;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,YAAY,EAA6B,MAAM,kCAAkC,CAAC;AAY3F;;;;;;;;;GASG;AACH,cAAM,kBAAmB,SAAQ,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;;CAI1E;AAED,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../../chunk-PTJYTZNU.js";
|
|
2
|
+
import { ContextError } from "../errors.js";
|
|
3
|
+
import { BaseRegistry } from "../../providers/base-registry.js";
|
|
4
|
+
const compactionErrorFactory = {
|
|
5
|
+
alreadyRegistered: (type) => ContextError.compactionProviderAlreadyRegistered(type),
|
|
6
|
+
notFound: (type, availableTypes) => ContextError.compactionInvalidType(type, availableTypes)
|
|
7
|
+
};
|
|
8
|
+
class CompactionRegistry extends BaseRegistry {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(compactionErrorFactory);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const compactionRegistry = new CompactionRegistry();
|
|
14
|
+
export {
|
|
15
|
+
compactionRegistry
|
|
16
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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 schemas_exports = {};
|
|
20
|
+
__export(schemas_exports, {
|
|
21
|
+
CompactionConfigSchema: () => CompactionConfigSchema,
|
|
22
|
+
DEFAULT_COMPACTION_CONFIG: () => DEFAULT_COMPACTION_CONFIG
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
25
|
+
var import_zod = require("zod");
|
|
26
|
+
const CompactionConfigSchema = import_zod.z.object({
|
|
27
|
+
type: import_zod.z.string().describe("Compaction provider type"),
|
|
28
|
+
enabled: import_zod.z.boolean().default(true).describe("Enable or disable compaction")
|
|
29
|
+
}).passthrough().describe("Context compaction configuration");
|
|
30
|
+
const DEFAULT_COMPACTION_CONFIG = {
|
|
31
|
+
type: "reactive-overflow",
|
|
32
|
+
enabled: true
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
CompactionConfigSchema,
|
|
37
|
+
DEFAULT_COMPACTION_CONFIG
|
|
38
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Base compaction configuration schema.
|
|
4
|
+
* Uses discriminated union to support different provider types.
|
|
5
|
+
*
|
|
6
|
+
* Each provider registers its own schema with specific validation rules.
|
|
7
|
+
* This schema accepts any configuration with a 'type' field.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CompactionConfigSchema: z.ZodObject<{
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
13
|
+
type: z.ZodString;
|
|
14
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
16
|
+
type: z.ZodString;
|
|
17
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
19
|
+
export type CompactionConfigInput = z.output<typeof CompactionConfigSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Default compaction configuration - uses reactive-overflow strategy
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_COMPACTION_CONFIG: CompactionConfigInput;
|
|
24
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;gCAMc,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,qBAGvC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "../../chunk-PTJYTZNU.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const CompactionConfigSchema = z.object({
|
|
4
|
+
type: z.string().describe("Compaction provider type"),
|
|
5
|
+
enabled: z.boolean().default(true).describe("Enable or disable compaction")
|
|
6
|
+
}).passthrough().describe("Context compaction configuration");
|
|
7
|
+
const DEFAULT_COMPACTION_CONFIG = {
|
|
8
|
+
type: "reactive-overflow",
|
|
9
|
+
enabled: true
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
CompactionConfigSchema,
|
|
13
|
+
DEFAULT_COMPACTION_CONFIG
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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 noop_exports = {};
|
|
20
|
+
__export(noop_exports, {
|
|
21
|
+
NoOpCompactionStrategy: () => NoOpCompactionStrategy
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(noop_exports);
|
|
24
|
+
class NoOpCompactionStrategy {
|
|
25
|
+
name = "noop";
|
|
26
|
+
/**
|
|
27
|
+
* Does nothing - returns empty array (no summary needed)
|
|
28
|
+
*/
|
|
29
|
+
async compact(_history) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
NoOpCompactionStrategy
|
|
36
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ICompactionStrategy } from '../types.js';
|
|
2
|
+
import type { InternalMessage } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* No-op compaction strategy that doesn't perform any compaction.
|
|
5
|
+
*
|
|
6
|
+
* Useful for:
|
|
7
|
+
* - Testing without compaction overhead
|
|
8
|
+
* - Disabling compaction temporarily
|
|
9
|
+
* - Contexts where full history is required
|
|
10
|
+
*/
|
|
11
|
+
export declare class NoOpCompactionStrategy implements ICompactionStrategy {
|
|
12
|
+
readonly name = "noop";
|
|
13
|
+
/**
|
|
14
|
+
* Does nothing - returns empty array (no summary needed)
|
|
15
|
+
*/
|
|
16
|
+
compact(_history: readonly InternalMessage[]): Promise<InternalMessage[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=noop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,QAAQ,CAAC,IAAI,UAAU;IAEvB;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGlF"}
|
|
@@ -22,7 +22,7 @@ __export(reactive_overflow_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(reactive_overflow_exports);
|
|
24
24
|
var import_ai = require("ai");
|
|
25
|
-
var import_types = require("
|
|
25
|
+
var import_types = require("../../types.js");
|
|
26
26
|
const DEFAULT_OPTIONS = {
|
|
27
27
|
preserveLastNTurns: 2,
|
|
28
28
|
maxSummaryTokens: 2e3,
|
|
@@ -58,9 +58,9 @@ class ReactiveOverflowStrategy {
|
|
|
58
58
|
* @param history The full conversation history
|
|
59
59
|
* @returns Array with single summary message to add, or empty if nothing to summarize
|
|
60
60
|
*/
|
|
61
|
-
async
|
|
61
|
+
async compact(history) {
|
|
62
62
|
if (history.length <= 2) {
|
|
63
|
-
this.logger.debug("ReactiveOverflowStrategy: History too short, skipping
|
|
63
|
+
this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compaction");
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
const { toSummarize, toKeep } = this.splitHistory(history);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LanguageModel } from 'ai';
|
|
2
|
-
import type {
|
|
3
|
-
import type { InternalMessage } from '
|
|
4
|
-
import type { IDextoLogger } from '
|
|
2
|
+
import type { ICompactionStrategy } from '../types.js';
|
|
3
|
+
import type { InternalMessage } from '../../types.js';
|
|
4
|
+
import type { IDextoLogger } from '../../../logger/v2/types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Configuration options for ReactiveOverflowStrategy.
|
|
7
7
|
*/
|
|
@@ -24,7 +24,7 @@ export interface ReactiveOverflowOptions {
|
|
|
24
24
|
summaryPrompt?: string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* ReactiveOverflowStrategy implements reactive
|
|
27
|
+
* ReactiveOverflowStrategy implements reactive compaction.
|
|
28
28
|
*
|
|
29
29
|
* Key behaviors:
|
|
30
30
|
* - Triggers on overflow (after actual tokens exceed context limit)
|
|
@@ -42,7 +42,7 @@ export interface ReactiveOverflowOptions {
|
|
|
42
42
|
* and filterCompacted() handles excluding old messages at read-time.
|
|
43
43
|
* This preserves full history for audit/recovery purposes.
|
|
44
44
|
*/
|
|
45
|
-
export declare class ReactiveOverflowStrategy implements
|
|
45
|
+
export declare class ReactiveOverflowStrategy implements ICompactionStrategy {
|
|
46
46
|
readonly name = "reactive-overflow";
|
|
47
47
|
private readonly model;
|
|
48
48
|
private readonly options;
|
|
@@ -59,7 +59,7 @@ export declare class ReactiveOverflowStrategy implements ICompressionStrategy {
|
|
|
59
59
|
* @param history The full conversation history
|
|
60
60
|
* @returns Array with single summary message to add, or empty if nothing to summarize
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
compact(history: readonly InternalMessage[]): Promise<InternalMessage[]>;
|
|
63
63
|
/**
|
|
64
64
|
* Split history into messages to summarize and messages to keep.
|
|
65
65
|
* Keeps the last N turns (user + assistant pairs) intact.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive-overflow.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/reactive-overflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAChE,QAAQ,CAAC,IAAI,uBAAuB;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAE1B,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,uBAAuB,YAAK,EAAE,MAAM,EAAE,YAAY;IAM7F;;;;;;;;;;OAUG;IACG,OAAO,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C9E;;;OAGG;IACH,OAAO,CAAC,YAAY;IA2CpB;;OAEG;YACW,eAAe;IAmB7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2ChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAiChC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "../../../chunk-PTJYTZNU.js";
|
|
2
2
|
import { generateText } from "ai";
|
|
3
|
-
import { isAssistantMessage, isToolMessage } from "
|
|
3
|
+
import { isAssistantMessage, isToolMessage } from "../../types.js";
|
|
4
4
|
const DEFAULT_OPTIONS = {
|
|
5
5
|
preserveLastNTurns: 2,
|
|
6
6
|
maxSummaryTokens: 2e3,
|
|
@@ -36,9 +36,9 @@ class ReactiveOverflowStrategy {
|
|
|
36
36
|
* @param history The full conversation history
|
|
37
37
|
* @returns Array with single summary message to add, or empty if nothing to summarize
|
|
38
38
|
*/
|
|
39
|
-
async
|
|
39
|
+
async compact(history) {
|
|
40
40
|
if (history.length <= 2) {
|
|
41
|
-
this.logger.debug("ReactiveOverflowStrategy: History too short, skipping
|
|
41
|
+
this.logger.debug("ReactiveOverflowStrategy: History too short, skipping compaction");
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
44
44
|
const { toSummarize, toKeep } = this.splitHistory(history);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { InternalMessage } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Compaction strategy interface.
|
|
4
4
|
*
|
|
5
5
|
* Strategies are responsible for reducing conversation history size
|
|
6
6
|
* when context limits are exceeded. The strategy is called by TurnExecutor
|
|
7
7
|
* after detecting overflow via actual token usage from the API.
|
|
8
8
|
*/
|
|
9
|
-
export interface
|
|
9
|
+
export interface ICompactionStrategy {
|
|
10
10
|
/** Human-readable name for logging/UI */
|
|
11
11
|
readonly name: string;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Compacts the provided message history.
|
|
14
14
|
*
|
|
15
15
|
* @param history The current conversation history.
|
|
16
16
|
* @returns Summary messages to add to history (filterCompacted handles the rest).
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
compact(history: readonly InternalMessage[]): Promise<InternalMessage[]> | InternalMessage[];
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC;CAChG"}
|
|
File without changes
|
|
@@ -33,6 +33,10 @@ var ContextErrorCode = /* @__PURE__ */ ((ContextErrorCode2) => {
|
|
|
33
33
|
ContextErrorCode2["TOKEN_COUNT_FAILED"] = "context_token_count_failed";
|
|
34
34
|
ContextErrorCode2["PRESERVE_VALUES_NEGATIVE"] = "context_preserve_values_negative";
|
|
35
35
|
ContextErrorCode2["MIN_MESSAGES_NEGATIVE"] = "context_min_messages_negative";
|
|
36
|
+
ContextErrorCode2["COMPACTION_INVALID_TYPE"] = "context_compaction_invalid_type";
|
|
37
|
+
ContextErrorCode2["COMPACTION_VALIDATION"] = "context_compaction_validation";
|
|
38
|
+
ContextErrorCode2["COMPACTION_MISSING_LLM"] = "context_compaction_missing_llm";
|
|
39
|
+
ContextErrorCode2["COMPACTION_PROVIDER_ALREADY_REGISTERED"] = "context_compaction_provider_already_registered";
|
|
36
40
|
ContextErrorCode2["MESSAGE_NOT_FOUND"] = "context_message_not_found";
|
|
37
41
|
ContextErrorCode2["MESSAGE_NOT_ASSISTANT"] = "context_message_not_assistant";
|
|
38
42
|
ContextErrorCode2["ASSISTANT_CONTENT_NOT_STRING"] = "context_assistant_content_not_string";
|
|
@@ -14,6 +14,10 @@ export declare enum ContextErrorCode {
|
|
|
14
14
|
TOKEN_COUNT_FAILED = "context_token_count_failed",
|
|
15
15
|
PRESERVE_VALUES_NEGATIVE = "context_preserve_values_negative",
|
|
16
16
|
MIN_MESSAGES_NEGATIVE = "context_min_messages_negative",
|
|
17
|
+
COMPACTION_INVALID_TYPE = "context_compaction_invalid_type",
|
|
18
|
+
COMPACTION_VALIDATION = "context_compaction_validation",
|
|
19
|
+
COMPACTION_MISSING_LLM = "context_compaction_missing_llm",
|
|
20
|
+
COMPACTION_PROVIDER_ALREADY_REGISTERED = "context_compaction_provider_already_registered",
|
|
17
21
|
MESSAGE_NOT_FOUND = "context_message_not_found",
|
|
18
22
|
MESSAGE_NOT_ASSISTANT = "context_message_not_assistant",
|
|
19
23
|
ASSISTANT_CONTENT_NOT_STRING = "context_assistant_content_not_string"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/context/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,oBAAoB,iCAAiC;IACrD,qBAAqB,kCAAkC;IAGvD,4BAA4B,yCAAyC;IAGrE,2CAA2C,wDAAwD;IACnG,oCAAoC,iDAAiD;IAGrF,2BAA2B,wCAAwC;IACnE,0BAA0B,uCAAuC;IAGjE,8BAA8B,2CAA2C;IAEzE,kBAAkB,+BAA+B;IAMjD,wBAAwB,qCAAqC;IAC7D,qBAAqB,kCAAkC;
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/context/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAExB,oBAAoB,iCAAiC;IACrD,qBAAqB,kCAAkC;IAGvD,4BAA4B,yCAAyC;IAGrE,2CAA2C,wDAAwD;IACnG,oCAAoC,iDAAiD;IAGrF,2BAA2B,wCAAwC;IACnE,0BAA0B,uCAAuC;IAGjE,8BAA8B,2CAA2C;IAEzE,kBAAkB,+BAA+B;IAMjD,wBAAwB,qCAAqC;IAC7D,qBAAqB,kCAAkC;IACvD,uBAAuB,oCAAoC;IAC3D,qBAAqB,kCAAkC;IACvD,sBAAsB,mCAAmC;IACzD,sCAAsC,mDAAmD;IAGzF,iBAAiB,8BAA8B;IAC/C,qBAAqB,kCAAkC;IACvD,4BAA4B,yCAAyC;CACxE"}
|
|
@@ -11,6 +11,10 @@ var ContextErrorCode = /* @__PURE__ */ ((ContextErrorCode2) => {
|
|
|
11
11
|
ContextErrorCode2["TOKEN_COUNT_FAILED"] = "context_token_count_failed";
|
|
12
12
|
ContextErrorCode2["PRESERVE_VALUES_NEGATIVE"] = "context_preserve_values_negative";
|
|
13
13
|
ContextErrorCode2["MIN_MESSAGES_NEGATIVE"] = "context_min_messages_negative";
|
|
14
|
+
ContextErrorCode2["COMPACTION_INVALID_TYPE"] = "context_compaction_invalid_type";
|
|
15
|
+
ContextErrorCode2["COMPACTION_VALIDATION"] = "context_compaction_validation";
|
|
16
|
+
ContextErrorCode2["COMPACTION_MISSING_LLM"] = "context_compaction_missing_llm";
|
|
17
|
+
ContextErrorCode2["COMPACTION_PROVIDER_ALREADY_REGISTERED"] = "context_compaction_provider_already_registered";
|
|
14
18
|
ContextErrorCode2["MESSAGE_NOT_FOUND"] = "context_message_not_found";
|
|
15
19
|
ContextErrorCode2["MESSAGE_NOT_ASSISTANT"] = "context_message_not_assistant";
|
|
16
20
|
ContextErrorCode2["ASSISTANT_CONTENT_NOT_STRING"] = "context_assistant_content_not_string";
|
package/dist/context/errors.cjs
CHANGED
|
@@ -139,6 +139,46 @@ class ContextError {
|
|
|
139
139
|
"Set minMessagesToKeep to zero or positive value"
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
|
+
static compactionInvalidType(type, available) {
|
|
143
|
+
return new import_errors.DextoRuntimeError(
|
|
144
|
+
import_error_codes.ContextErrorCode.COMPACTION_INVALID_TYPE,
|
|
145
|
+
import_types.ErrorScope.CONTEXT,
|
|
146
|
+
import_types.ErrorType.USER,
|
|
147
|
+
`Unknown compaction provider type: '${type}'`,
|
|
148
|
+
{ type, available },
|
|
149
|
+
`Use one of the available types: ${available.join(", ")}`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
static compactionValidation(type, errors) {
|
|
153
|
+
return new import_errors.DextoRuntimeError(
|
|
154
|
+
import_error_codes.ContextErrorCode.COMPACTION_VALIDATION,
|
|
155
|
+
import_types.ErrorScope.CONTEXT,
|
|
156
|
+
import_types.ErrorType.USER,
|
|
157
|
+
`Invalid configuration for compaction provider '${type}'`,
|
|
158
|
+
{ type, errors },
|
|
159
|
+
"Check the configuration schema for this provider"
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
static compactionMissingLLM(type) {
|
|
163
|
+
return new import_errors.DextoRuntimeError(
|
|
164
|
+
import_error_codes.ContextErrorCode.COMPACTION_MISSING_LLM,
|
|
165
|
+
import_types.ErrorScope.CONTEXT,
|
|
166
|
+
import_types.ErrorType.USER,
|
|
167
|
+
`Compaction provider '${type}' requires LLM service but none provided`,
|
|
168
|
+
{ type },
|
|
169
|
+
"Ensure LLM service is initialized before creating this compaction provider"
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
static compactionProviderAlreadyRegistered(type) {
|
|
173
|
+
return new import_errors.DextoRuntimeError(
|
|
174
|
+
import_error_codes.ContextErrorCode.COMPACTION_PROVIDER_ALREADY_REGISTERED,
|
|
175
|
+
import_types.ErrorScope.CONTEXT,
|
|
176
|
+
import_types.ErrorType.USER,
|
|
177
|
+
`Compaction provider '${type}' is already registered`,
|
|
178
|
+
{ type },
|
|
179
|
+
"Each provider type can only be registered once"
|
|
180
|
+
);
|
|
181
|
+
}
|
|
142
182
|
// Message lookup errors
|
|
143
183
|
static messageNotFound(messageId) {
|
|
144
184
|
return new import_errors.DextoRuntimeError(
|
package/dist/context/errors.d.ts
CHANGED
|
@@ -17,6 +17,20 @@ export declare class ContextError {
|
|
|
17
17
|
cause: string;
|
|
18
18
|
}>;
|
|
19
19
|
static minMessagesNegative(): DextoRuntimeError<{}>;
|
|
20
|
+
static compactionInvalidType(type: string, available: string[]): DextoRuntimeError<{
|
|
21
|
+
type: string;
|
|
22
|
+
available: string[];
|
|
23
|
+
}>;
|
|
24
|
+
static compactionValidation(type: string, errors: unknown): DextoRuntimeError<{
|
|
25
|
+
type: string;
|
|
26
|
+
errors: unknown;
|
|
27
|
+
}>;
|
|
28
|
+
static compactionMissingLLM(type: string): DextoRuntimeError<{
|
|
29
|
+
type: string;
|
|
30
|
+
}>;
|
|
31
|
+
static compactionProviderAlreadyRegistered(type: string): DextoRuntimeError<{
|
|
32
|
+
type: string;
|
|
33
|
+
}>;
|
|
20
34
|
static messageNotFound(messageId: string): DextoRuntimeError<{
|
|
21
35
|
messageId: string;
|
|
22
36
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/context/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IAErB,MAAM,CAAC,kBAAkB;IAWzB,MAAM,CAAC,yBAAyB;IAWhC,MAAM,CAAC,sCAAsC;IAW7C,MAAM,CAAC,gCAAgC;IAWvC,MAAM,CAAC,wBAAwB;IAW/B,MAAM,CAAC,2BAA2B;IAWlC,MAAM,CAAC,uBAAuB;IAW9B,MAAM,CAAC,sBAAsB;IAe7B,MAAM,CAAC,sBAAsB;IAW7B,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM;;;IAWrC,MAAM,CAAC,mBAAmB;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/context/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD;;;GAGG;AACH,qBAAa,YAAY;IAErB,MAAM,CAAC,kBAAkB;IAWzB,MAAM,CAAC,yBAAyB;IAWhC,MAAM,CAAC,sCAAsC;IAW7C,MAAM,CAAC,gCAAgC;IAWvC,MAAM,CAAC,wBAAwB;IAW/B,MAAM,CAAC,2BAA2B;IAWlC,MAAM,CAAC,uBAAuB;IAW9B,MAAM,CAAC,sBAAsB;IAe7B,MAAM,CAAC,sBAAsB;IAW7B,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM;;;IAWrC,MAAM,CAAC,mBAAmB;IAW1B,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;;;;IAW9D,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;;;;IAWzD,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM;;;IAWxC,MAAM,CAAC,mCAAmC,CAAC,IAAI,EAAE,MAAM;;;IAYvD,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM;;;IAUxC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM;;;IAU5C,MAAM,CAAC,yBAAyB;CASnC"}
|