@dexto/core 1.5.8 → 1.6.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 +19 -8
- package/dist/agent/DextoAgent.cjs +293 -154
- package/dist/agent/DextoAgent.d.ts +83 -56
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +290 -151
- package/dist/{context/compaction/provider.cjs → agent/agent-options.cjs} +2 -2
- package/dist/agent/agent-options.d.ts +53 -0
- package/dist/agent/agent-options.d.ts.map +1 -0
- package/dist/agent/agentCard.cjs +1 -1
- package/dist/agent/errors.cjs +2 -2
- package/dist/agent/errors.d.ts.map +1 -1
- package/dist/agent/index.cjs +1 -6
- package/dist/agent/index.d.ts +3 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -7
- package/dist/{storage/blob/provider.cjs → agent/runtime-config.cjs} +2 -2
- package/dist/agent/runtime-config.d.ts +53 -0
- package/dist/agent/runtime-config.d.ts.map +1 -0
- package/dist/agent/schemas.cjs +2 -104
- package/dist/agent/schemas.d.ts +10 -9199
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +1 -109
- package/dist/agent/state-manager.d.ts +5 -5
- package/dist/agent/state-manager.d.ts.map +1 -1
- package/dist/approval/error-codes.cjs +1 -1
- package/dist/approval/error-codes.d.ts +1 -1
- package/dist/approval/error-codes.d.ts.map +1 -1
- package/dist/approval/error-codes.js +1 -1
- package/dist/approval/errors.cjs +5 -5
- package/dist/approval/errors.d.ts +2 -2
- package/dist/approval/errors.d.ts.map +1 -1
- package/dist/approval/errors.js +5 -5
- package/dist/approval/index.cjs +8 -8
- package/dist/approval/index.d.ts +2 -2
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +8 -8
- package/dist/approval/manager.cjs +77 -57
- package/dist/approval/manager.d.ts +41 -43
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +75 -55
- package/dist/approval/schemas.cjs +26 -25
- package/dist/approval/schemas.d.ts +35 -15
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +22 -21
- package/dist/approval/types.cjs +1 -1
- package/dist/approval/types.d.ts +14 -14
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/context/compaction/index.cjs +2 -23
- package/dist/context/compaction/index.d.ts +1 -7
- package/dist/context/compaction/index.d.ts.map +1 -1
- package/dist/context/compaction/index.js +1 -16
- package/dist/context/compaction/strategies/noop.cjs +19 -1
- package/dist/context/compaction/strategies/noop.d.ts +13 -3
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -1
- package/dist/context/compaction/strategies/noop.js +19 -1
- package/dist/context/compaction/strategies/{reactive-overflow.cjs → reactive-overflow-compaction.cjs} +67 -64
- package/dist/context/compaction/strategies/{reactive-overflow.d.ts → reactive-overflow-compaction.d.ts} +19 -36
- package/dist/context/compaction/strategies/reactive-overflow-compaction.d.ts.map +1 -0
- package/dist/context/compaction/strategies/{reactive-overflow.js → reactive-overflow-compaction.js} +63 -60
- package/dist/context/compaction/types.d.ts +40 -8
- package/dist/context/compaction/types.d.ts.map +1 -1
- package/dist/context/manager.cjs +4 -2
- package/dist/context/manager.d.ts +4 -3
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +4 -2
- package/dist/context/types.d.ts +2 -0
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +2 -2
- package/dist/context/utils.d.ts +14 -14
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/errors/result-bridge.d.ts +2 -2
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/types.cjs +1 -1
- package/dist/errors/types.d.ts +3 -3
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +11 -1
- package/dist/events/index.d.ts +43 -7
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +11 -1
- package/dist/{plugins → hooks}/builtins/content-policy.cjs +7 -6
- package/dist/hooks/builtins/content-policy.d.ts +24 -0
- package/dist/hooks/builtins/content-policy.d.ts.map +1 -0
- package/dist/{plugins → hooks}/builtins/content-policy.js +6 -5
- package/dist/{plugins → hooks}/builtins/response-sanitizer.cjs +3 -3
- package/dist/hooks/builtins/response-sanitizer.d.ts +22 -0
- package/dist/hooks/builtins/response-sanitizer.d.ts.map +1 -0
- package/dist/{plugins → hooks}/builtins/response-sanitizer.js +2 -2
- package/dist/hooks/error-codes.cjs +43 -0
- package/dist/hooks/error-codes.d.ts +34 -0
- package/dist/hooks/error-codes.d.ts.map +1 -0
- package/dist/hooks/error-codes.js +20 -0
- package/dist/{storage/cache/providers/memory.cjs → hooks/index.cjs} +15 -18
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/manager.cjs +354 -0
- package/dist/hooks/manager.d.ts +103 -0
- package/dist/hooks/manager.d.ts.map +1 -0
- package/dist/hooks/manager.js +331 -0
- package/dist/{plugins → hooks}/types.d.ts +36 -34
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/index.browser.cjs +13 -12
- package/dist/index.browser.d.ts +5 -5
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +8 -7
- package/dist/index.cjs +5 -7
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/llm/errors.cjs +1 -1
- package/dist/llm/executor/stream-processor.cjs +131 -11
- package/dist/llm/executor/stream-processor.d.ts +7 -5
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +131 -11
- package/dist/llm/executor/turn-executor.cjs +49 -54
- package/dist/llm/executor/turn-executor.d.ts +7 -8
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +49 -54
- package/dist/llm/formatters/vercel.cjs +2 -2
- package/dist/llm/formatters/vercel.d.ts +2 -2
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/providers/local/schemas.d.ts +10 -10
- package/dist/llm/registry/auto-update.d.ts +2 -2
- package/dist/llm/registry/auto-update.d.ts.map +1 -1
- package/dist/llm/registry/index.d.ts +3 -3
- package/dist/llm/registry/index.d.ts.map +1 -1
- package/dist/llm/resolver.cjs +2 -2
- package/dist/llm/resolver.d.ts +4 -4
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/schemas.cjs +67 -104
- package/dist/llm/schemas.d.ts +6 -145
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +64 -101
- package/dist/llm/services/factory.cjs +2 -3
- package/dist/llm/services/factory.d.ts +3 -4
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +2 -3
- package/dist/llm/services/vercel.cjs +7 -14
- package/dist/llm/services/vercel.d.ts +6 -7
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +7 -14
- package/dist/llm/validation.cjs +1 -1
- package/dist/llm/validation.d.ts +2 -2
- package/dist/llm/validation.d.ts.map +1 -1
- package/dist/logger/browser.cjs +4 -4
- package/dist/logger/browser.d.ts +4 -4
- package/dist/logger/browser.d.ts.map +1 -1
- package/dist/logger/browser.js +3 -3
- package/dist/{context/compaction/providers/noop-provider.cjs → logger/default-logger-factory.cjs} +16 -22
- package/dist/logger/default-logger-factory.d.ts +301 -0
- package/dist/logger/default-logger-factory.d.ts.map +1 -0
- package/dist/logger/default-logger-factory.js +18 -0
- package/dist/logger/factory.d.ts +2 -2
- package/dist/logger/factory.d.ts.map +1 -1
- package/dist/logger/index.cjs +7 -2
- package/dist/logger/index.d.ts +5 -3
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +8 -2
- package/dist/logger/logger.cjs +4 -4
- package/dist/logger/logger.d.ts +4 -4
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +3 -3
- package/dist/logger/v2/dexto-logger.d.ts +3 -3
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/schemas.d.ts +12 -12
- package/dist/logger/v2/test-utils.d.ts +5 -5
- package/dist/logger/v2/test-utils.d.ts.map +1 -1
- package/dist/logger/v2/transport-factory.d.ts +3 -3
- package/dist/logger/v2/transport-factory.d.ts.map +1 -1
- package/dist/logger/v2/transports/console-transport.d.ts +2 -2
- package/dist/logger/v2/transports/console-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/file-transport.d.ts +2 -2
- package/dist/logger/v2/transports/file-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/silent-transport.d.ts +2 -2
- package/dist/logger/v2/transports/silent-transport.d.ts.map +1 -1
- package/dist/logger/v2/types.cjs +1 -1
- package/dist/logger/v2/types.d.ts +8 -8
- package/dist/logger/v2/types.d.ts.map +1 -1
- package/dist/logger/v2/types.js +1 -1
- package/dist/mcp/errors.cjs +2 -2
- package/dist/mcp/errors.d.ts.map +1 -1
- package/dist/mcp/manager.cjs +16 -11
- package/dist/mcp/manager.d.ts +16 -13
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +17 -12
- package/dist/mcp/mcp-client.cjs +25 -20
- package/dist/mcp/mcp-client.d.ts +5 -5
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +20 -15
- package/dist/mcp/resolver.cjs +1 -1
- package/dist/mcp/schemas.cjs +5 -5
- package/dist/mcp/schemas.d.ts +4 -4
- package/dist/mcp/schemas.js +2 -2
- package/dist/mcp/types.d.ts +7 -7
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/memory/manager.d.ts +2 -2
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/schemas.d.ts +2 -2
- package/dist/prompts/errors.cjs +3 -3
- package/dist/prompts/errors.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.d.ts +3 -3
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.cjs +15 -29
- package/dist/prompts/providers/config-prompt-provider.d.ts +3 -3
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +15 -29
- package/dist/prompts/providers/custom-prompt-provider.d.ts +2 -2
- package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/mcp-prompt-provider.d.ts +2 -2
- package/dist/prompts/providers/mcp-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/schemas.d.ts +4 -4
- package/dist/resources/{internal-provider.cjs → agent-resources-provider.cjs} +16 -16
- package/dist/resources/{internal-provider.d.ts → agent-resources-provider.d.ts} +6 -6
- package/dist/resources/agent-resources-provider.d.ts.map +1 -0
- package/dist/resources/{internal-provider.js → agent-resources-provider.js} +13 -13
- package/dist/resources/errors.cjs +2 -2
- package/dist/resources/errors.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.d.ts +2 -2
- package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
- package/dist/resources/handlers/factory.d.ts +3 -3
- package/dist/resources/handlers/factory.d.ts.map +1 -1
- package/dist/resources/handlers/filesystem-handler.d.ts +2 -2
- package/dist/resources/handlers/filesystem-handler.d.ts.map +1 -1
- package/dist/resources/index.cjs +7 -9
- package/dist/resources/index.d.ts +3 -3
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +5 -10
- package/dist/resources/manager.cjs +77 -74
- package/dist/resources/manager.d.ts +16 -7
- package/dist/resources/manager.d.ts.map +1 -1
- package/dist/resources/manager.js +77 -74
- package/dist/resources/schemas.cjs +6 -26
- package/dist/resources/schemas.d.ts +8 -100
- package/dist/resources/schemas.d.ts.map +1 -1
- package/dist/resources/schemas.js +4 -23
- package/dist/search/search-service.d.ts +2 -2
- package/dist/search/search-service.d.ts.map +1 -1
- package/dist/session/chat-session.cjs +15 -25
- package/dist/session/chat-session.d.ts +7 -5
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +16 -26
- package/dist/session/errors.cjs +2 -2
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/history/database.cjs +1 -1
- package/dist/session/history/database.d.ts +4 -4
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/factory.d.ts +3 -3
- package/dist/session/history/factory.d.ts.map +1 -1
- package/dist/session/history/memory.d.ts +4 -4
- package/dist/session/history/memory.d.ts.map +1 -1
- package/dist/session/history/types.d.ts +2 -2
- package/dist/session/history/types.d.ts.map +1 -1
- package/dist/session/index.cjs +3 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +2 -0
- package/dist/session/message-queue.d.ts +2 -2
- package/dist/session/message-queue.d.ts.map +1 -1
- package/dist/session/session-manager.cjs +67 -9
- package/dist/session/session-manager.d.ts +46 -7
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +67 -9
- package/dist/session/title-generator.cjs +2 -2
- package/dist/session/title-generator.d.ts +2 -2
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/storage/blob/index.cjs +0 -40
- package/dist/storage/blob/index.d.ts +2 -44
- package/dist/storage/blob/index.d.ts.map +1 -1
- package/dist/storage/blob/index.js +0 -30
- package/dist/storage/cache/index.cjs +0 -37
- package/dist/storage/cache/index.d.ts +0 -42
- package/dist/storage/cache/index.d.ts.map +1 -1
- package/dist/storage/cache/index.js +0 -28
- package/dist/storage/database/index.cjs +0 -42
- package/dist/storage/database/index.d.ts +0 -43
- package/dist/storage/database/index.d.ts.map +1 -1
- package/dist/storage/database/index.js +0 -37
- package/dist/storage/error-codes.cjs +1 -6
- package/dist/storage/error-codes.d.ts +2 -7
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +1 -6
- package/dist/storage/errors.cjs +18 -82
- package/dist/storage/errors.d.ts +4 -24
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +16 -80
- package/dist/storage/index.cjs +8 -69
- package/dist/storage/index.d.ts +11 -66
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +6 -50
- package/dist/storage/storage-manager.cjs +9 -25
- package/dist/storage/storage-manager.d.ts +11 -15
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +8 -23
- package/dist/storage/types.d.ts +0 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/systemPrompt/contributors.d.ts +4 -4
- package/dist/systemPrompt/contributors.d.ts.map +1 -1
- package/dist/systemPrompt/errors.cjs +2 -2
- package/dist/systemPrompt/errors.d.ts.map +1 -1
- package/dist/systemPrompt/manager.cjs +1 -5
- package/dist/systemPrompt/manager.d.ts +2 -3
- package/dist/systemPrompt/manager.d.ts.map +1 -1
- package/dist/systemPrompt/manager.js +1 -5
- package/dist/telemetry/index.cjs +3 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/utils.d.ts +4 -4
- package/dist/telemetry/utils.d.ts.map +1 -1
- package/dist/test-utils/in-memory-storage.cjs +288 -0
- package/dist/test-utils/in-memory-storage.js +252 -0
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts +3 -3
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts +4 -4
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts +2 -2
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts.map +1 -1
- package/dist/tools/{internal-tools/constants.cjs → define-tool.cjs} +8 -13
- package/dist/tools/define-tool.d.ts +11 -0
- package/dist/tools/define-tool.d.ts.map +1 -0
- package/dist/tools/define-tool.js +7 -0
- package/dist/tools/error-codes.cjs +2 -2
- package/dist/tools/error-codes.d.ts +2 -2
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +2 -2
- package/dist/tools/errors.cjs +11 -23
- package/dist/tools/errors.d.ts +4 -10
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +9 -21
- package/dist/tools/index.cjs +3 -8
- package/dist/tools/index.d.ts +2 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -7
- package/dist/{storage/blob/providers/index.cjs → tools/pattern-utils.cjs} +11 -9
- package/dist/tools/pattern-utils.d.ts +20 -0
- package/dist/tools/pattern-utils.d.ts.map +1 -0
- package/dist/tools/pattern-utils.js +10 -0
- package/dist/tools/schemas.cjs +14 -40
- package/dist/tools/schemas.d.ts +6 -50
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +11 -32
- package/dist/tools/tool-call-metadata.cjs +3 -3
- package/dist/tools/tool-call-metadata.d.ts +1 -1
- package/dist/tools/tool-call-metadata.d.ts.map +1 -1
- package/dist/tools/tool-call-metadata.js +3 -3
- package/dist/tools/tool-manager.cjs +376 -327
- package/dist/tools/tool-manager.d.ts +63 -80
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +376 -331
- package/dist/tools/types.d.ts +112 -13
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/error-conversion.d.ts +2 -2
- package/dist/utils/error-conversion.d.ts.map +1 -1
- package/dist/utils/path.d.ts +2 -2
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/result.cjs +1 -1
- package/dist/utils/result.d.ts.map +1 -1
- package/dist/utils/schema.cjs +9 -5
- package/dist/utils/schema.d.ts +4 -2
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +9 -5
- package/dist/utils/service-initializer.cjs +51 -56
- package/dist/utils/service-initializer.d.ts +17 -14
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +51 -56
- package/dist/{storage/cache/providers/index.cjs → workspace/error-codes.cjs} +8 -9
- package/dist/workspace/error-codes.d.ts +5 -0
- package/dist/workspace/error-codes.d.ts.map +1 -0
- package/dist/workspace/error-codes.js +7 -0
- package/dist/{storage/blob/factory.cjs → workspace/errors.cjs} +20 -14
- package/dist/workspace/errors.d.ts +5 -0
- package/dist/workspace/errors.d.ts.map +1 -0
- package/dist/workspace/errors.js +21 -0
- package/dist/{image → workspace}/index.cjs +12 -10
- package/dist/workspace/index.d.ts +5 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +9 -0
- package/dist/workspace/manager.cjs +113 -0
- package/dist/workspace/manager.d.ts +18 -0
- package/dist/workspace/manager.d.ts.map +1 -0
- package/dist/workspace/manager.js +90 -0
- package/dist/workspace/types.d.ts +14 -0
- package/dist/workspace/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/context/compaction/factory.cjs +0 -57
- package/dist/context/compaction/factory.d.ts +0 -17
- package/dist/context/compaction/factory.d.ts.map +0 -1
- package/dist/context/compaction/factory.js +0 -34
- package/dist/context/compaction/provider.d.ts +0 -48
- package/dist/context/compaction/provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/noop-provider.d.ts +0 -24
- package/dist/context/compaction/providers/noop-provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/noop-provider.js +0 -24
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +0 -76
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +0 -51
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +0 -1
- package/dist/context/compaction/providers/reactive-overflow-provider.js +0 -52
- package/dist/context/compaction/registry.cjs +0 -39
- package/dist/context/compaction/registry.d.ts +0 -19
- package/dist/context/compaction/registry.d.ts.map +0 -1
- package/dist/context/compaction/registry.js +0 -16
- package/dist/context/compaction/schemas.cjs +0 -58
- package/dist/context/compaction/schemas.d.ts +0 -69
- package/dist/context/compaction/schemas.d.ts.map +0 -1
- package/dist/context/compaction/schemas.js +0 -34
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +0 -1
- package/dist/image/define-image.cjs +0 -146
- package/dist/image/define-image.d.ts +0 -71
- package/dist/image/define-image.d.ts.map +0 -1
- package/dist/image/define-image.js +0 -121
- package/dist/image/index.d.ts +0 -53
- package/dist/image/index.d.ts.map +0 -1
- package/dist/image/index.js +0 -7
- package/dist/image/types.d.ts +0 -246
- package/dist/image/types.d.ts.map +0 -1
- package/dist/llm/services/test-utils.integration.cjs +0 -237
- package/dist/llm/services/test-utils.integration.d.ts +0 -48
- package/dist/llm/services/test-utils.integration.d.ts.map +0 -1
- package/dist/llm/services/test-utils.integration.js +0 -214
- package/dist/plugins/builtins/content-policy.d.ts +0 -26
- package/dist/plugins/builtins/content-policy.d.ts.map +0 -1
- package/dist/plugins/builtins/response-sanitizer.d.ts +0 -25
- package/dist/plugins/builtins/response-sanitizer.d.ts.map +0 -1
- package/dist/plugins/error-codes.cjs +0 -43
- package/dist/plugins/error-codes.d.ts +0 -34
- package/dist/plugins/error-codes.d.ts.map +0 -1
- package/dist/plugins/error-codes.js +0 -20
- package/dist/plugins/index.cjs +0 -61
- package/dist/plugins/index.d.ts +0 -21
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -30
- package/dist/plugins/loader.cjs +0 -171
- package/dist/plugins/loader.d.ts +0 -30
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js +0 -145
- package/dist/plugins/manager.cjs +0 -473
- package/dist/plugins/manager.d.ts +0 -106
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -450
- package/dist/plugins/registrations/builtins.cjs +0 -51
- package/dist/plugins/registrations/builtins.d.ts +0 -17
- package/dist/plugins/registrations/builtins.d.ts.map +0 -1
- package/dist/plugins/registrations/builtins.js +0 -28
- package/dist/plugins/registry.cjs +0 -63
- package/dist/plugins/registry.d.ts +0 -101
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -39
- package/dist/plugins/schemas.cjs +0 -73
- package/dist/plugins/schemas.d.ts +0 -195
- package/dist/plugins/schemas.d.ts.map +0 -1
- package/dist/plugins/schemas.js +0 -47
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/providers/base-registry.cjs +0 -147
- package/dist/providers/base-registry.d.ts +0 -147
- package/dist/providers/base-registry.d.ts.map +0 -1
- package/dist/providers/base-registry.js +0 -123
- package/dist/providers/discovery.cjs +0 -109
- package/dist/providers/discovery.d.ts +0 -96
- package/dist/providers/discovery.d.ts.map +0 -1
- package/dist/providers/discovery.js +0 -84
- package/dist/providers/index.cjs +0 -24
- package/dist/providers/index.d.ts +0 -32
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -2
- package/dist/resources/internal-provider.d.ts.map +0 -1
- package/dist/storage/blob/factory.d.ts +0 -37
- package/dist/storage/blob/factory.d.ts.map +0 -1
- package/dist/storage/blob/factory.js +0 -15
- package/dist/storage/blob/local-blob-store.cjs +0 -496
- package/dist/storage/blob/local-blob-store.d.ts +0 -58
- package/dist/storage/blob/local-blob-store.d.ts.map +0 -1
- package/dist/storage/blob/local-blob-store.js +0 -463
- package/dist/storage/blob/memory-blob-store.cjs +0 -326
- package/dist/storage/blob/memory-blob-store.d.ts +0 -66
- package/dist/storage/blob/memory-blob-store.d.ts.map +0 -1
- package/dist/storage/blob/memory-blob-store.js +0 -303
- package/dist/storage/blob/provider.d.ts +0 -50
- package/dist/storage/blob/provider.d.ts.map +0 -1
- package/dist/storage/blob/providers/index.d.ts +0 -8
- package/dist/storage/blob/providers/index.d.ts.map +0 -1
- package/dist/storage/blob/providers/index.js +0 -7
- package/dist/storage/blob/providers/local.cjs +0 -39
- package/dist/storage/blob/providers/local.d.ts +0 -17
- package/dist/storage/blob/providers/local.d.ts.map +0 -1
- package/dist/storage/blob/providers/local.js +0 -16
- package/dist/storage/blob/providers/memory.cjs +0 -39
- package/dist/storage/blob/providers/memory.d.ts +0 -17
- package/dist/storage/blob/providers/memory.d.ts.map +0 -1
- package/dist/storage/blob/providers/memory.js +0 -16
- package/dist/storage/blob/registry.cjs +0 -50
- package/dist/storage/blob/registry.d.ts +0 -42
- package/dist/storage/blob/registry.d.ts.map +0 -1
- package/dist/storage/blob/registry.js +0 -26
- package/dist/storage/blob/schemas.cjs +0 -52
- package/dist/storage/blob/schemas.d.ts +0 -85
- package/dist/storage/blob/schemas.d.ts.map +0 -1
- package/dist/storage/blob/schemas.js +0 -26
- package/dist/storage/cache/factory.cjs +0 -38
- package/dist/storage/cache/factory.d.ts +0 -37
- package/dist/storage/cache/factory.d.ts.map +0 -1
- package/dist/storage/cache/factory.js +0 -15
- package/dist/storage/cache/memory-cache-store.cjs +0 -107
- package/dist/storage/cache/memory-cache-store.d.ts +0 -26
- package/dist/storage/cache/memory-cache-store.d.ts.map +0 -1
- package/dist/storage/cache/memory-cache-store.js +0 -84
- package/dist/storage/cache/provider.cjs +0 -16
- package/dist/storage/cache/provider.d.ts +0 -56
- package/dist/storage/cache/provider.d.ts.map +0 -1
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.d.ts +0 -8
- package/dist/storage/cache/providers/index.d.ts.map +0 -1
- package/dist/storage/cache/providers/index.js +0 -7
- package/dist/storage/cache/providers/memory.d.ts +0 -17
- package/dist/storage/cache/providers/memory.d.ts.map +0 -1
- package/dist/storage/cache/providers/memory.js +0 -17
- package/dist/storage/cache/providers/redis.cjs +0 -66
- package/dist/storage/cache/providers/redis.d.ts +0 -20
- package/dist/storage/cache/providers/redis.d.ts.map +0 -1
- package/dist/storage/cache/providers/redis.js +0 -33
- package/dist/storage/cache/redis-store.cjs +0 -173
- package/dist/storage/cache/redis-store.d.ts +0 -32
- package/dist/storage/cache/redis-store.d.ts.map +0 -1
- package/dist/storage/cache/redis-store.js +0 -150
- package/dist/storage/cache/registry.cjs +0 -50
- package/dist/storage/cache/registry.d.ts +0 -42
- package/dist/storage/cache/registry.d.ts.map +0 -1
- package/dist/storage/cache/registry.js +0 -26
- package/dist/storage/cache/schemas.cjs +0 -81
- package/dist/storage/cache/schemas.d.ts +0 -150
- package/dist/storage/cache/schemas.d.ts.map +0 -1
- package/dist/storage/cache/schemas.js +0 -55
- package/dist/storage/database/factory.cjs +0 -38
- package/dist/storage/database/factory.d.ts +0 -39
- package/dist/storage/database/factory.d.ts.map +0 -1
- package/dist/storage/database/factory.js +0 -15
- package/dist/storage/database/memory-database-store.cjs +0 -122
- package/dist/storage/database/memory-database-store.d.ts +0 -29
- package/dist/storage/database/memory-database-store.d.ts.map +0 -1
- package/dist/storage/database/memory-database-store.js +0 -99
- package/dist/storage/database/postgres-store.cjs +0 -342
- package/dist/storage/database/postgres-store.d.ts +0 -55
- package/dist/storage/database/postgres-store.d.ts.map +0 -1
- package/dist/storage/database/postgres-store.js +0 -319
- package/dist/storage/database/provider.cjs +0 -16
- package/dist/storage/database/provider.d.ts +0 -56
- package/dist/storage/database/provider.d.ts.map +0 -1
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +0 -34
- package/dist/storage/database/providers/index.d.ts +0 -9
- package/dist/storage/database/providers/index.d.ts.map +0 -1
- package/dist/storage/database/providers/index.js +0 -9
- package/dist/storage/database/providers/memory.cjs +0 -40
- package/dist/storage/database/providers/memory.d.ts +0 -16
- package/dist/storage/database/providers/memory.d.ts.map +0 -1
- package/dist/storage/database/providers/memory.js +0 -17
- package/dist/storage/database/providers/postgres.cjs +0 -62
- package/dist/storage/database/providers/postgres.d.ts +0 -19
- package/dist/storage/database/providers/postgres.d.ts.map +0 -1
- package/dist/storage/database/providers/postgres.js +0 -29
- package/dist/storage/database/providers/sqlite.cjs +0 -66
- package/dist/storage/database/providers/sqlite.d.ts +0 -20
- package/dist/storage/database/providers/sqlite.d.ts.map +0 -1
- package/dist/storage/database/providers/sqlite.js +0 -33
- package/dist/storage/database/registry.cjs +0 -50
- package/dist/storage/database/registry.d.ts +0 -42
- package/dist/storage/database/registry.d.ts.map +0 -1
- package/dist/storage/database/registry.js +0 -26
- package/dist/storage/database/schemas.cjs +0 -97
- package/dist/storage/database/schemas.d.ts +0 -226
- package/dist/storage/database/schemas.d.ts.map +0 -1
- package/dist/storage/database/schemas.js +0 -70
- package/dist/storage/database/sqlite-store.cjs +0 -270
- package/dist/storage/database/sqlite-store.d.ts +0 -33
- package/dist/storage/database/sqlite-store.d.ts.map +0 -1
- package/dist/storage/database/sqlite-store.js +0 -237
- package/dist/storage/schemas.cjs +0 -57
- package/dist/storage/schemas.d.ts +0 -347
- package/dist/storage/schemas.d.ts.map +0 -1
- package/dist/storage/schemas.js +0 -37
- package/dist/tools/bash-pattern-utils.cjs +0 -91
- package/dist/tools/bash-pattern-utils.d.ts +0 -58
- package/dist/tools/bash-pattern-utils.d.ts.map +0 -1
- package/dist/tools/bash-pattern-utils.js +0 -64
- package/dist/tools/custom-tool-registry.cjs +0 -64
- package/dist/tools/custom-tool-registry.d.ts +0 -126
- package/dist/tools/custom-tool-registry.d.ts.map +0 -1
- package/dist/tools/custom-tool-registry.js +0 -40
- package/dist/tools/custom-tool-schema-registry.cjs +0 -164
- package/dist/tools/custom-tool-schema-registry.d.ts +0 -86
- package/dist/tools/custom-tool-schema-registry.d.ts.map +0 -1
- package/dist/tools/custom-tool-schema-registry.js +0 -140
- package/dist/tools/internal-tools/constants.d.ts +0 -12
- package/dist/tools/internal-tools/constants.d.ts.map +0 -1
- package/dist/tools/internal-tools/constants.js +0 -12
- package/dist/tools/internal-tools/implementations/ask-user-tool.cjs +0 -57
- package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts +0 -18
- package/dist/tools/internal-tools/implementations/ask-user-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/ask-user-tool.js +0 -34
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.cjs +0 -192
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts +0 -33
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +0 -169
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +0 -113
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +0 -30
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +0 -90
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.cjs +0 -140
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts +0 -24
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/invoke-skill-tool.js +0 -117
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +0 -91
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +0 -24
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +0 -68
- package/dist/tools/internal-tools/implementations/search-history-tool.cjs +0 -61
- package/dist/tools/internal-tools/implementations/search-history-tool.d.ts +0 -7
- package/dist/tools/internal-tools/implementations/search-history-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/search-history-tool.js +0 -38
- package/dist/tools/internal-tools/index.cjs +0 -26
- package/dist/tools/internal-tools/index.d.ts +0 -4
- package/dist/tools/internal-tools/index.d.ts.map +0 -1
- package/dist/tools/internal-tools/index.js +0 -3
- package/dist/tools/internal-tools/provider.cjs +0 -324
- package/dist/tools/internal-tools/provider.d.ts +0 -116
- package/dist/tools/internal-tools/provider.d.ts.map +0 -1
- package/dist/tools/internal-tools/provider.js +0 -301
- package/dist/tools/internal-tools/registry.cjs +0 -71
- package/dist/tools/internal-tools/registry.d.ts +0 -91
- package/dist/tools/internal-tools/registry.d.ts.map +0 -1
- package/dist/tools/internal-tools/registry.js +0 -47
- /package/dist/{context/compaction/provider.js → agent/agent-options.js} +0 -0
- /package/dist/{image/types.js → agent/runtime-config.js} +0 -0
- /package/dist/{image → hooks}/types.cjs +0 -0
- /package/dist/{plugins → hooks}/types.js +0 -0
- /package/dist/{plugins → workspace}/types.cjs +0 -0
- /package/dist/{storage/blob/provider.js → workspace/types.js} +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var factory_exports = {};
|
|
20
|
-
__export(factory_exports, {
|
|
21
|
-
createCompactionStrategy: () => createCompactionStrategy
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(factory_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
var import_registry = require("./registry.js");
|
|
26
|
-
var import_errors = require("../errors.js");
|
|
27
|
-
async function createCompactionStrategy(config, context) {
|
|
28
|
-
if (config.enabled === false) {
|
|
29
|
-
context.logger.info(`Compaction provider '${config.type}' is disabled`);
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const provider = import_registry.compactionRegistry.get(config.type);
|
|
33
|
-
if (!provider) {
|
|
34
|
-
const available = import_registry.compactionRegistry.getTypes();
|
|
35
|
-
throw import_errors.ContextError.compactionInvalidType(config.type, available);
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
const validatedConfig = provider.configSchema.parse(config);
|
|
39
|
-
if (provider.metadata?.requiresLLM && !context.model) {
|
|
40
|
-
throw import_errors.ContextError.compactionMissingLLM(config.type);
|
|
41
|
-
}
|
|
42
|
-
const strategy = await provider.create(validatedConfig, context);
|
|
43
|
-
context.logger.info(
|
|
44
|
-
`Created compaction strategy: ${provider.metadata?.displayName || config.type}`
|
|
45
|
-
);
|
|
46
|
-
return strategy;
|
|
47
|
-
} catch (error) {
|
|
48
|
-
if (error instanceof import_zod.z.ZodError) {
|
|
49
|
-
throw import_errors.ContextError.compactionValidation(config.type, error.errors);
|
|
50
|
-
}
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
createCompactionStrategy
|
|
57
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ICompactionStrategy } from './types.js';
|
|
2
|
-
import type { CompactionContext, CompactionConfig } from './provider.js';
|
|
3
|
-
/**
|
|
4
|
-
* Create a compaction strategy from configuration.
|
|
5
|
-
*
|
|
6
|
-
* Follows the same pattern as blob storage and tools:
|
|
7
|
-
* - Validates provider exists
|
|
8
|
-
* - Validates configuration with Zod schema
|
|
9
|
-
* - Checks LLM requirements
|
|
10
|
-
* - Creates strategy instance
|
|
11
|
-
*
|
|
12
|
-
* @param config - Compaction configuration from agent config
|
|
13
|
-
* @param context - Context with logger and optional LanguageModel
|
|
14
|
-
* @returns Strategy instance or null if disabled
|
|
15
|
-
*/
|
|
16
|
-
export declare function createCompactionStrategy(config: CompactionConfig, context: CompactionContext): Promise<ICompactionStrategy | null>;
|
|
17
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIzE;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAqCrC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { compactionRegistry } from "./registry.js";
|
|
4
|
-
import { ContextError } from "../errors.js";
|
|
5
|
-
async function createCompactionStrategy(config, context) {
|
|
6
|
-
if (config.enabled === false) {
|
|
7
|
-
context.logger.info(`Compaction provider '${config.type}' is disabled`);
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const provider = compactionRegistry.get(config.type);
|
|
11
|
-
if (!provider) {
|
|
12
|
-
const available = compactionRegistry.getTypes();
|
|
13
|
-
throw ContextError.compactionInvalidType(config.type, available);
|
|
14
|
-
}
|
|
15
|
-
try {
|
|
16
|
-
const validatedConfig = provider.configSchema.parse(config);
|
|
17
|
-
if (provider.metadata?.requiresLLM && !context.model) {
|
|
18
|
-
throw ContextError.compactionMissingLLM(config.type);
|
|
19
|
-
}
|
|
20
|
-
const strategy = await provider.create(validatedConfig, context);
|
|
21
|
-
context.logger.info(
|
|
22
|
-
`Created compaction strategy: ${provider.metadata?.displayName || config.type}`
|
|
23
|
-
);
|
|
24
|
-
return strategy;
|
|
25
|
-
} catch (error) {
|
|
26
|
-
if (error instanceof z.ZodError) {
|
|
27
|
-
throw ContextError.compactionValidation(config.type, error.errors);
|
|
28
|
-
}
|
|
29
|
-
throw error;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
createCompactionStrategy
|
|
34
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { LanguageModel } from 'ai';
|
|
3
|
-
import type { ICompactionStrategy } from './types.js';
|
|
4
|
-
import type { IDextoLogger } from '../../logger/v2/types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Context provided to compaction strategy creation
|
|
7
|
-
*/
|
|
8
|
-
export interface CompactionContext {
|
|
9
|
-
logger: IDextoLogger;
|
|
10
|
-
model?: LanguageModel;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Provider interface for compaction strategies.
|
|
14
|
-
*
|
|
15
|
-
* Follows the same pattern as blob storage and tools providers:
|
|
16
|
-
* - Type discriminator for config validation
|
|
17
|
-
* - Zod schema for runtime validation
|
|
18
|
-
* - Factory function to create instances
|
|
19
|
-
* - Metadata for discovery and UI
|
|
20
|
-
*
|
|
21
|
-
* TConfig should be the output type (z.output) with defaults applied
|
|
22
|
-
*/
|
|
23
|
-
export interface CompactionProvider<TType extends string = string, TConfig extends CompactionConfig = CompactionConfig> {
|
|
24
|
-
/** Unique identifier for this strategy type */
|
|
25
|
-
type: TType;
|
|
26
|
-
/** Zod schema for validating configuration - accepts input, produces TConfig output */
|
|
27
|
-
configSchema: z.ZodType<TConfig, z.ZodTypeDef, any>;
|
|
28
|
-
/** Metadata for discovery and UI */
|
|
29
|
-
metadata?: {
|
|
30
|
-
displayName: string;
|
|
31
|
-
description: string;
|
|
32
|
-
requiresLLM: boolean;
|
|
33
|
-
isProactive: boolean;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Create a compaction strategy instance
|
|
37
|
-
* @param config - Validated configuration with defaults applied (output type)
|
|
38
|
-
*/
|
|
39
|
-
create(config: TConfig, context: CompactionContext): ICompactionStrategy | Promise<ICompactionStrategy>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Base configuration for all compaction strategies
|
|
43
|
-
*/
|
|
44
|
-
export interface CompactionConfig {
|
|
45
|
-
type: string;
|
|
46
|
-
enabled?: boolean;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB,CAC/B,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,OAAO,SAAS,gBAAgB,GAAG,gBAAgB;IAEnD,+CAA+C;IAC/C,IAAI,EAAE,KAAK,CAAC;IAEZ,uFAAuF;IACvF,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IAEpD,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,OAAO,CAAC;QACrB,WAAW,EAAE,OAAO,CAAC;KACxB,CAAC;IAEF;;;OAGG;IACH,MAAM,CACF,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,iBAAiB,GAC3B,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { CompactionProvider } from '../provider.js';
|
|
3
|
-
/**
|
|
4
|
-
* Configuration schema for no-op compaction
|
|
5
|
-
*/
|
|
6
|
-
export declare const NoOpConfigSchema: z.ZodObject<{
|
|
7
|
-
type: z.ZodLiteral<"noop">;
|
|
8
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
-
}, "strict", z.ZodTypeAny, {
|
|
10
|
-
type: "noop";
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
}, {
|
|
13
|
-
type: "noop";
|
|
14
|
-
enabled?: boolean | undefined;
|
|
15
|
-
}>;
|
|
16
|
-
export type NoOpConfig = z.output<typeof NoOpConfigSchema>;
|
|
17
|
-
/**
|
|
18
|
-
* Provider for no-op compaction strategy.
|
|
19
|
-
*
|
|
20
|
-
* This strategy disables compaction entirely, keeping full conversation history.
|
|
21
|
-
* Useful for testing, debugging, or contexts where full history is required.
|
|
22
|
-
*/
|
|
23
|
-
export declare const noopProvider: CompactionProvider<'noop', NoOpConfig>;
|
|
24
|
-
//# sourceMappingURL=noop-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noop-provider.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/providers/noop-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,gBAAgB;;;;;;;;;EAKhB,CAAC;AAEd,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAa/D,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { NoOpCompactionStrategy } from "../strategies/noop.js";
|
|
4
|
-
const NoOpConfigSchema = z.object({
|
|
5
|
-
type: z.literal("noop"),
|
|
6
|
-
enabled: z.boolean().default(true).describe("Enable or disable compaction")
|
|
7
|
-
}).strict();
|
|
8
|
-
const noopProvider = {
|
|
9
|
-
type: "noop",
|
|
10
|
-
configSchema: NoOpConfigSchema,
|
|
11
|
-
metadata: {
|
|
12
|
-
displayName: "No Compaction",
|
|
13
|
-
description: "Disables compaction entirely, keeping full conversation history",
|
|
14
|
-
requiresLLM: false,
|
|
15
|
-
isProactive: false
|
|
16
|
-
},
|
|
17
|
-
create(_config, _context) {
|
|
18
|
-
return new NoOpCompactionStrategy();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
NoOpConfigSchema,
|
|
23
|
-
noopProvider
|
|
24
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var 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
|
-
/**
|
|
31
|
-
* Maximum context tokens before compaction triggers.
|
|
32
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
33
|
-
* Useful for capping context size below the model's maximum limit.
|
|
34
|
-
*/
|
|
35
|
-
maxContextTokens: import_zod.z.number().positive().optional().describe(
|
|
36
|
-
"Maximum context tokens before compaction triggers. Overrides model context window when set."
|
|
37
|
-
),
|
|
38
|
-
/**
|
|
39
|
-
* Percentage of context window that triggers compaction (0.1 to 1.0).
|
|
40
|
-
* Default is 1.0 (100%), meaning compaction triggers when context is full.
|
|
41
|
-
*/
|
|
42
|
-
thresholdPercent: import_zod.z.number().min(0.1).max(1).default(1).describe(
|
|
43
|
-
"Percentage of context window that triggers compaction (0.1 to 1.0, default 1.0)"
|
|
44
|
-
),
|
|
45
|
-
preserveLastNTurns: import_zod.z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
|
|
46
|
-
maxSummaryTokens: import_zod.z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
|
|
47
|
-
summaryPrompt: import_zod.z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
|
|
48
|
-
}).strict();
|
|
49
|
-
const reactiveOverflowProvider = {
|
|
50
|
-
type: "reactive-overflow",
|
|
51
|
-
configSchema: ReactiveOverflowConfigSchema,
|
|
52
|
-
metadata: {
|
|
53
|
-
displayName: "Reactive Overflow Compaction",
|
|
54
|
-
description: "Generates summaries when context window overflows, preserving recent turns",
|
|
55
|
-
requiresLLM: true,
|
|
56
|
-
isProactive: false
|
|
57
|
-
},
|
|
58
|
-
create(config, context) {
|
|
59
|
-
if (!context.model) {
|
|
60
|
-
throw new Error("ReactiveOverflowStrategy requires LanguageModel");
|
|
61
|
-
}
|
|
62
|
-
const options = {
|
|
63
|
-
preserveLastNTurns: config.preserveLastNTurns,
|
|
64
|
-
maxSummaryTokens: config.maxSummaryTokens
|
|
65
|
-
};
|
|
66
|
-
if (config.summaryPrompt !== void 0) {
|
|
67
|
-
options.summaryPrompt = config.summaryPrompt;
|
|
68
|
-
}
|
|
69
|
-
return new import_reactive_overflow.ReactiveOverflowStrategy(context.model, options, context.logger);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
ReactiveOverflowConfigSchema,
|
|
75
|
-
reactiveOverflowProvider
|
|
76
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
/**
|
|
10
|
-
* Maximum context tokens before compaction triggers.
|
|
11
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
12
|
-
* Useful for capping context size below the model's maximum limit.
|
|
13
|
-
*/
|
|
14
|
-
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
15
|
-
/**
|
|
16
|
-
* Percentage of context window that triggers compaction (0.1 to 1.0).
|
|
17
|
-
* Default is 1.0 (100%), meaning compaction triggers when context is full.
|
|
18
|
-
*/
|
|
19
|
-
thresholdPercent: z.ZodDefault<z.ZodNumber>;
|
|
20
|
-
preserveLastNTurns: z.ZodDefault<z.ZodNumber>;
|
|
21
|
-
maxSummaryTokens: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
summaryPrompt: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, "strict", z.ZodTypeAny, {
|
|
24
|
-
type: "reactive-overflow";
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
thresholdPercent: number;
|
|
27
|
-
preserveLastNTurns: number;
|
|
28
|
-
maxSummaryTokens: number;
|
|
29
|
-
maxContextTokens?: number | undefined;
|
|
30
|
-
summaryPrompt?: string | undefined;
|
|
31
|
-
}, {
|
|
32
|
-
type: "reactive-overflow";
|
|
33
|
-
enabled?: boolean | undefined;
|
|
34
|
-
maxContextTokens?: number | undefined;
|
|
35
|
-
thresholdPercent?: number | undefined;
|
|
36
|
-
preserveLastNTurns?: number | undefined;
|
|
37
|
-
maxSummaryTokens?: number | undefined;
|
|
38
|
-
summaryPrompt?: string | undefined;
|
|
39
|
-
}>;
|
|
40
|
-
export type ReactiveOverflowConfig = z.output<typeof ReactiveOverflowConfigSchema>;
|
|
41
|
-
/**
|
|
42
|
-
* Provider for reactive overflow compaction strategy.
|
|
43
|
-
*
|
|
44
|
-
* This strategy triggers compaction when context window overflow is detected:
|
|
45
|
-
* - Generates LLM-powered summaries of older messages
|
|
46
|
-
* - Preserves recent turns for context continuity
|
|
47
|
-
* - Falls back to simple text summary if LLM call fails
|
|
48
|
-
* - Adds summary message to history (read-time filtering excludes old messages)
|
|
49
|
-
*/
|
|
50
|
-
export declare const reactiveOverflowProvider: CompactionProvider<'reactive-overflow', ReactiveOverflowConfig>;
|
|
51
|
-
//# sourceMappingURL=reactive-overflow-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;IAIjC;;;;OAIG;;IAQH;;;OAGG;;;;;;;;;;;;;;;;;;;;;EA0BE,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"}
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
/**
|
|
8
|
-
* Maximum context tokens before compaction triggers.
|
|
9
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
10
|
-
* Useful for capping context size below the model's maximum limit.
|
|
11
|
-
*/
|
|
12
|
-
maxContextTokens: z.number().positive().optional().describe(
|
|
13
|
-
"Maximum context tokens before compaction triggers. Overrides model context window when set."
|
|
14
|
-
),
|
|
15
|
-
/**
|
|
16
|
-
* Percentage of context window that triggers compaction (0.1 to 1.0).
|
|
17
|
-
* Default is 1.0 (100%), meaning compaction triggers when context is full.
|
|
18
|
-
*/
|
|
19
|
-
thresholdPercent: z.number().min(0.1).max(1).default(1).describe(
|
|
20
|
-
"Percentage of context window that triggers compaction (0.1 to 1.0, default 1.0)"
|
|
21
|
-
),
|
|
22
|
-
preserveLastNTurns: z.number().int().positive().default(2).describe("Number of recent turns (user+assistant pairs) to preserve"),
|
|
23
|
-
maxSummaryTokens: z.number().int().positive().default(2e3).describe("Maximum tokens for the summary output"),
|
|
24
|
-
summaryPrompt: z.string().optional().describe("Custom summary prompt template. Use {conversation} as placeholder")
|
|
25
|
-
}).strict();
|
|
26
|
-
const reactiveOverflowProvider = {
|
|
27
|
-
type: "reactive-overflow",
|
|
28
|
-
configSchema: ReactiveOverflowConfigSchema,
|
|
29
|
-
metadata: {
|
|
30
|
-
displayName: "Reactive Overflow Compaction",
|
|
31
|
-
description: "Generates summaries when context window overflows, preserving recent turns",
|
|
32
|
-
requiresLLM: true,
|
|
33
|
-
isProactive: false
|
|
34
|
-
},
|
|
35
|
-
create(config, context) {
|
|
36
|
-
if (!context.model) {
|
|
37
|
-
throw new Error("ReactiveOverflowStrategy requires LanguageModel");
|
|
38
|
-
}
|
|
39
|
-
const options = {
|
|
40
|
-
preserveLastNTurns: config.preserveLastNTurns,
|
|
41
|
-
maxSummaryTokens: config.maxSummaryTokens
|
|
42
|
-
};
|
|
43
|
-
if (config.summaryPrompt !== void 0) {
|
|
44
|
-
options.summaryPrompt = config.summaryPrompt;
|
|
45
|
-
}
|
|
46
|
-
return new ReactiveOverflowStrategy(context.model, options, context.logger);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
ReactiveOverflowConfigSchema,
|
|
51
|
-
reactiveOverflowProvider
|
|
52
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var 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
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var 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
|
-
/**
|
|
30
|
-
* Maximum context tokens before compaction triggers.
|
|
31
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
32
|
-
* Useful for capping context size below the model's maximum limit.
|
|
33
|
-
* Example: Set to 50000 to trigger compaction at 50K tokens even if
|
|
34
|
-
* the model supports 200K tokens.
|
|
35
|
-
*/
|
|
36
|
-
maxContextTokens: import_zod.z.number().positive().optional().describe(
|
|
37
|
-
"Maximum context tokens before compaction triggers. Overrides model context window when set."
|
|
38
|
-
),
|
|
39
|
-
/**
|
|
40
|
-
* Percentage of context window that triggers compaction (0.0 to 1.0).
|
|
41
|
-
* Default is 0.9 (90%), leaving a 10% buffer to avoid context degradation.
|
|
42
|
-
* Set lower values to trigger compaction earlier.
|
|
43
|
-
* Example: 0.8 triggers compaction when 80% of context is used.
|
|
44
|
-
*/
|
|
45
|
-
thresholdPercent: import_zod.z.number().min(0.1).max(1).default(0.9).describe(
|
|
46
|
-
"Percentage of context window that triggers compaction (0.1 to 1.0, default 0.9)"
|
|
47
|
-
)
|
|
48
|
-
}).passthrough().describe("Context compaction configuration");
|
|
49
|
-
const DEFAULT_COMPACTION_CONFIG = {
|
|
50
|
-
type: "reactive-overflow",
|
|
51
|
-
enabled: true,
|
|
52
|
-
thresholdPercent: 0.9
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
CompactionConfigSchema,
|
|
57
|
-
DEFAULT_COMPACTION_CONFIG
|
|
58
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
/**
|
|
13
|
-
* Maximum context tokens before compaction triggers.
|
|
14
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
15
|
-
* Useful for capping context size below the model's maximum limit.
|
|
16
|
-
* Example: Set to 50000 to trigger compaction at 50K tokens even if
|
|
17
|
-
* the model supports 200K tokens.
|
|
18
|
-
*/
|
|
19
|
-
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
/**
|
|
21
|
-
* Percentage of context window that triggers compaction (0.0 to 1.0).
|
|
22
|
-
* Default is 0.9 (90%), leaving a 10% buffer to avoid context degradation.
|
|
23
|
-
* Set lower values to trigger compaction earlier.
|
|
24
|
-
* Example: 0.8 triggers compaction when 80% of context is used.
|
|
25
|
-
*/
|
|
26
|
-
thresholdPercent: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
28
|
-
type: z.ZodString;
|
|
29
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum context tokens before compaction triggers.
|
|
32
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
33
|
-
* Useful for capping context size below the model's maximum limit.
|
|
34
|
-
* Example: Set to 50000 to trigger compaction at 50K tokens even if
|
|
35
|
-
* the model supports 200K tokens.
|
|
36
|
-
*/
|
|
37
|
-
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
/**
|
|
39
|
-
* Percentage of context window that triggers compaction (0.0 to 1.0).
|
|
40
|
-
* Default is 0.9 (90%), leaving a 10% buffer to avoid context degradation.
|
|
41
|
-
* Set lower values to trigger compaction earlier.
|
|
42
|
-
* Example: 0.8 triggers compaction when 80% of context is used.
|
|
43
|
-
*/
|
|
44
|
-
thresholdPercent: z.ZodDefault<z.ZodNumber>;
|
|
45
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
46
|
-
type: z.ZodString;
|
|
47
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
-
/**
|
|
49
|
-
* Maximum context tokens before compaction triggers.
|
|
50
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
51
|
-
* Useful for capping context size below the model's maximum limit.
|
|
52
|
-
* Example: Set to 50000 to trigger compaction at 50K tokens even if
|
|
53
|
-
* the model supports 200K tokens.
|
|
54
|
-
*/
|
|
55
|
-
maxContextTokens: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
/**
|
|
57
|
-
* Percentage of context window that triggers compaction (0.0 to 1.0).
|
|
58
|
-
* Default is 0.9 (90%), leaving a 10% buffer to avoid context degradation.
|
|
59
|
-
* Set lower values to trigger compaction earlier.
|
|
60
|
-
* Example: 0.8 triggers compaction when 80% of context is used.
|
|
61
|
-
*/
|
|
62
|
-
thresholdPercent: z.ZodDefault<z.ZodNumber>;
|
|
63
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
64
|
-
export type CompactionConfigInput = z.output<typeof CompactionConfigSchema>;
|
|
65
|
-
/**
|
|
66
|
-
* Default compaction configuration - uses reactive-overflow strategy
|
|
67
|
-
*/
|
|
68
|
-
export declare const DEFAULT_COMPACTION_CONFIG: CompactionConfigInput;
|
|
69
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;;IAI3B;;;;;;OAMG;;IAQH;;;;;OAKG;;;;;IAnBH;;;;;;OAMG;;IAQH;;;;;OAKG;;;;;IAnBH;;;;;;OAMG;;IAQH;;;;;OAKG;;gCAWsC,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,qBAIvC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* Maximum context tokens before compaction triggers.
|
|
8
|
-
* When set, overrides the model's context window for compaction threshold.
|
|
9
|
-
* Useful for capping context size below the model's maximum limit.
|
|
10
|
-
* Example: Set to 50000 to trigger compaction at 50K tokens even if
|
|
11
|
-
* the model supports 200K tokens.
|
|
12
|
-
*/
|
|
13
|
-
maxContextTokens: z.number().positive().optional().describe(
|
|
14
|
-
"Maximum context tokens before compaction triggers. Overrides model context window when set."
|
|
15
|
-
),
|
|
16
|
-
/**
|
|
17
|
-
* Percentage of context window that triggers compaction (0.0 to 1.0).
|
|
18
|
-
* Default is 0.9 (90%), leaving a 10% buffer to avoid context degradation.
|
|
19
|
-
* Set lower values to trigger compaction earlier.
|
|
20
|
-
* Example: 0.8 triggers compaction when 80% of context is used.
|
|
21
|
-
*/
|
|
22
|
-
thresholdPercent: z.number().min(0.1).max(1).default(0.9).describe(
|
|
23
|
-
"Percentage of context window that triggers compaction (0.1 to 1.0, default 0.9)"
|
|
24
|
-
)
|
|
25
|
-
}).passthrough().describe("Context compaction configuration");
|
|
26
|
-
const DEFAULT_COMPACTION_CONFIG = {
|
|
27
|
-
type: "reactive-overflow",
|
|
28
|
-
enabled: true,
|
|
29
|
-
thresholdPercent: 0.9
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
CompactionConfigSchema,
|
|
33
|
-
DEFAULT_COMPACTION_CONFIG
|
|
34
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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;AAsCD;;;;;;;;;;;;;;;;;;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;IAiF9E;;;;;;;;;OASG;YACW,aAAa;IAkD3B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAuB9B;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAwDpB;;;;;OAKG;YACW,eAAe;IAmC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2ChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA0DhC"}
|