@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,9 +1,8 @@
|
|
|
1
|
-
import { type LanguageModel } from 'ai';
|
|
2
|
-
import type { ICompactionStrategy } from '../types.js';
|
|
3
1
|
import type { InternalMessage } from '../../types.js';
|
|
4
|
-
import type
|
|
2
|
+
import { type ModelLimits } from '../overflow.js';
|
|
3
|
+
import type { CompactionRuntimeContext, CompactionSettings, CompactionStrategy } from '../types.js';
|
|
5
4
|
/**
|
|
6
|
-
* Configuration options for
|
|
5
|
+
* Configuration options for ReactiveOverflowCompactionStrategy.
|
|
7
6
|
*/
|
|
8
7
|
export interface ReactiveOverflowOptions {
|
|
9
8
|
/**
|
|
@@ -23,8 +22,14 @@ export interface ReactiveOverflowOptions {
|
|
|
23
22
|
*/
|
|
24
23
|
summaryPrompt?: string;
|
|
25
24
|
}
|
|
25
|
+
export interface ReactiveOverflowCompactionStrategyOptions {
|
|
26
|
+
enabled?: boolean | undefined;
|
|
27
|
+
maxContextTokens?: number | undefined;
|
|
28
|
+
thresholdPercent?: number | undefined;
|
|
29
|
+
strategy?: ReactiveOverflowOptions | undefined;
|
|
30
|
+
}
|
|
26
31
|
/**
|
|
27
|
-
*
|
|
32
|
+
* ReactiveOverflowCompactionStrategy implements reactive compaction.
|
|
28
33
|
*
|
|
29
34
|
* Key behaviors:
|
|
30
35
|
* - Triggers on overflow (after actual tokens exceed context limit)
|
|
@@ -42,53 +47,31 @@ export interface ReactiveOverflowOptions {
|
|
|
42
47
|
* and filterCompacted() handles excluding old messages at read-time.
|
|
43
48
|
* This preserves full history for audit/recovery purposes.
|
|
44
49
|
*/
|
|
45
|
-
export declare class
|
|
50
|
+
export declare class ReactiveOverflowCompactionStrategy implements CompactionStrategy {
|
|
46
51
|
readonly name = "reactive-overflow";
|
|
47
|
-
private readonly
|
|
48
|
-
private readonly
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* IMPORTANT: This does NOT replace history. It returns a summary message
|
|
55
|
-
* that the caller should ADD to history via contextManager.addMessage().
|
|
56
|
-
* Read-time filtering (filterCompacted) will then exclude pre-summary
|
|
57
|
-
* messages when formatting for LLM.
|
|
58
|
-
*
|
|
59
|
-
* @param history The full conversation history
|
|
60
|
-
* @returns Array with single summary message to add, or empty if nothing to summarize
|
|
61
|
-
*/
|
|
62
|
-
compact(history: readonly InternalMessage[]): Promise<InternalMessage[]>;
|
|
52
|
+
private readonly settings;
|
|
53
|
+
private readonly strategyOptions;
|
|
54
|
+
constructor(options?: ReactiveOverflowCompactionStrategyOptions);
|
|
55
|
+
getSettings(): CompactionSettings;
|
|
56
|
+
getModelLimits(modelContextWindow: number): ModelLimits;
|
|
57
|
+
shouldCompact(inputTokens: number, modelLimits: ModelLimits): boolean;
|
|
58
|
+
compact(history: readonly InternalMessage[], context: CompactionRuntimeContext): Promise<InternalMessage[]>;
|
|
63
59
|
/**
|
|
64
60
|
* Handle re-compaction when there's already a summary in history.
|
|
65
61
|
* Only summarizes messages AFTER the existing summary, preventing
|
|
66
62
|
* cascading summaries of summaries.
|
|
67
|
-
*
|
|
68
|
-
* @param messagesAfterSummary Messages after the existing summary
|
|
69
|
-
* @param fullHistory The complete history (for current task detection)
|
|
70
|
-
* @param existingSummaryIndex Index of the existing summary in fullHistory
|
|
71
|
-
* @returns Array with single summary message, or empty if nothing to summarize
|
|
72
63
|
*/
|
|
73
64
|
private compactSubset;
|
|
74
65
|
/**
|
|
75
66
|
* Find the most recent user message that represents the current task.
|
|
76
|
-
* This helps preserve context about what the user is currently asking for.
|
|
77
67
|
*/
|
|
78
68
|
private findCurrentTaskMessage;
|
|
79
69
|
/**
|
|
80
70
|
* Split history into messages to summarize and messages to keep.
|
|
81
|
-
* Keeps the last N turns (user + assistant pairs) intact.
|
|
82
|
-
*
|
|
83
|
-
* For long agentic conversations with many tool calls, this also ensures
|
|
84
|
-
* we don't try to keep too many messages even within preserved turns.
|
|
85
71
|
*/
|
|
86
72
|
private splitHistory;
|
|
87
73
|
/**
|
|
88
74
|
* Generate an LLM summary of the messages.
|
|
89
|
-
*
|
|
90
|
-
* @param messages Messages to summarize
|
|
91
|
-
* @param currentTask The most recent user message (current task context)
|
|
92
75
|
*/
|
|
93
76
|
private generateSummary;
|
|
94
77
|
/**
|
|
@@ -100,4 +83,4 @@ export declare class ReactiveOverflowStrategy implements ICompactionStrategy {
|
|
|
100
83
|
*/
|
|
101
84
|
private createFallbackSummary;
|
|
102
85
|
}
|
|
103
|
-
//# sourceMappingURL=reactive-overflow.d.ts.map
|
|
86
|
+
//# sourceMappingURL=reactive-overflow-compaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive-overflow-compaction.d.ts","sourceRoot":"","sources":["../../../../src/context/compaction/strategies/reactive-overflow-compaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAY,MAAM,gBAAgB,CAAC;AAGhE,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpG;;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;AAED,MAAM,WAAW,yCAAyC;IACtD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAClD;AAsCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kCAAmC,YAAW,kBAAkB;IACzE,QAAQ,CAAC,IAAI,uBAAuB;IAEpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;gBAExD,OAAO,GAAE,yCAA8C;IAYnE,WAAW,IAAI,kBAAkB;IAIjC,cAAc,CAAC,kBAAkB,EAAE,MAAM,GAAG,WAAW;IASvD,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO;IAO/D,OAAO,CACT,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC;IA+F7B;;;;OAIG;YACW,aAAa;IA8C3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAsB9B;;OAEG;IACH,OAAO,CAAC,YAAY;IA8CpB;;OAEG;YACW,eAAe;IAkC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAyDhC"}
|
package/dist/context/compaction/strategies/{reactive-overflow.js → reactive-overflow-compaction.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../../../chunk-PTJYTZNU.js";
|
|
2
2
|
import { generateText } from "ai";
|
|
3
3
|
import { isAssistantMessage, isToolMessage } from "../../types.js";
|
|
4
|
+
import { isOverflow } from "../overflow.js";
|
|
4
5
|
const DEFAULT_OPTIONS = {
|
|
5
6
|
preserveLastNTurns: 2,
|
|
6
7
|
maxSummaryTokens: 2e3,
|
|
@@ -36,30 +37,43 @@ IMPORTANT: The assistant will continue working based on this summary. Ensure the
|
|
|
36
37
|
Conversation to summarize:
|
|
37
38
|
{conversation}`
|
|
38
39
|
};
|
|
39
|
-
class
|
|
40
|
+
class ReactiveOverflowCompactionStrategy {
|
|
40
41
|
name = "reactive-overflow";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
settings;
|
|
43
|
+
strategyOptions;
|
|
44
|
+
constructor(options = {}) {
|
|
45
|
+
this.settings = {
|
|
46
|
+
enabled: options.enabled ?? true,
|
|
47
|
+
maxContextTokens: options.maxContextTokens,
|
|
48
|
+
thresholdPercent: options.thresholdPercent ?? 0.9
|
|
49
|
+
};
|
|
50
|
+
this.strategyOptions = {
|
|
51
|
+
...DEFAULT_OPTIONS,
|
|
52
|
+
...options.strategy ?? {}
|
|
53
|
+
};
|
|
48
54
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
getSettings() {
|
|
56
|
+
return this.settings;
|
|
57
|
+
}
|
|
58
|
+
getModelLimits(modelContextWindow) {
|
|
59
|
+
const capped = this.settings.enabled && this.settings.maxContextTokens !== void 0 ? Math.min(modelContextWindow, this.settings.maxContextTokens) : modelContextWindow;
|
|
60
|
+
return { contextWindow: capped };
|
|
61
|
+
}
|
|
62
|
+
shouldCompact(inputTokens, modelLimits) {
|
|
63
|
+
if (!this.settings.enabled) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return isOverflow({ inputTokens }, modelLimits, this.settings.thresholdPercent);
|
|
67
|
+
}
|
|
68
|
+
async compact(history, context) {
|
|
69
|
+
if (!this.settings.enabled) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
const { model, logger } = context;
|
|
61
73
|
if (history.length <= 2) {
|
|
62
|
-
|
|
74
|
+
logger.debug(
|
|
75
|
+
"ReactiveOverflowCompactionStrategy: History too short, skipping compaction"
|
|
76
|
+
);
|
|
63
77
|
return [];
|
|
64
78
|
}
|
|
65
79
|
let existingSummaryIndex = -1;
|
|
@@ -73,26 +87,32 @@ class ReactiveOverflowStrategy {
|
|
|
73
87
|
if (existingSummaryIndex !== -1) {
|
|
74
88
|
const messagesAfterSummary = history.slice(existingSummaryIndex + 1);
|
|
75
89
|
if (messagesAfterSummary.length <= 4) {
|
|
76
|
-
|
|
77
|
-
`
|
|
90
|
+
logger.debug(
|
|
91
|
+
`ReactiveOverflowCompactionStrategy: Only ${messagesAfterSummary.length} messages after existing summary, skipping re-compaction`
|
|
78
92
|
);
|
|
79
93
|
return [];
|
|
80
94
|
}
|
|
81
|
-
|
|
82
|
-
`
|
|
95
|
+
logger.info(
|
|
96
|
+
`ReactiveOverflowCompactionStrategy: Found existing summary at index ${existingSummaryIndex}, working with ${messagesAfterSummary.length} messages after it`
|
|
97
|
+
);
|
|
98
|
+
return this.compactSubset(
|
|
99
|
+
messagesAfterSummary,
|
|
100
|
+
history,
|
|
101
|
+
existingSummaryIndex,
|
|
102
|
+
model,
|
|
103
|
+
logger
|
|
83
104
|
);
|
|
84
|
-
return this.compactSubset(messagesAfterSummary, history, existingSummaryIndex);
|
|
85
105
|
}
|
|
86
106
|
const { toSummarize, toKeep } = this.splitHistory(history);
|
|
87
107
|
if (toSummarize.length === 0) {
|
|
88
|
-
|
|
108
|
+
logger.debug("ReactiveOverflowCompactionStrategy: No messages to summarize");
|
|
89
109
|
return [];
|
|
90
110
|
}
|
|
91
111
|
const currentTaskMessage = this.findCurrentTaskMessage(history);
|
|
92
|
-
|
|
93
|
-
`
|
|
112
|
+
logger.info(
|
|
113
|
+
`ReactiveOverflowCompactionStrategy: Summarizing ${toSummarize.length} messages, keeping ${toKeep.length}`
|
|
94
114
|
);
|
|
95
|
-
const summary = await this.generateSummary(toSummarize, currentTaskMessage);
|
|
115
|
+
const summary = await this.generateSummary(toSummarize, currentTaskMessage, model, logger);
|
|
96
116
|
const summaryMessage = {
|
|
97
117
|
role: "assistant",
|
|
98
118
|
content: [{ type: "text", text: summary }],
|
|
@@ -111,23 +131,18 @@ class ReactiveOverflowStrategy {
|
|
|
111
131
|
* Handle re-compaction when there's already a summary in history.
|
|
112
132
|
* Only summarizes messages AFTER the existing summary, preventing
|
|
113
133
|
* cascading summaries of summaries.
|
|
114
|
-
*
|
|
115
|
-
* @param messagesAfterSummary Messages after the existing summary
|
|
116
|
-
* @param fullHistory The complete history (for current task detection)
|
|
117
|
-
* @param existingSummaryIndex Index of the existing summary in fullHistory
|
|
118
|
-
* @returns Array with single summary message, or empty if nothing to summarize
|
|
119
134
|
*/
|
|
120
|
-
async compactSubset(messagesAfterSummary, fullHistory, existingSummaryIndex) {
|
|
135
|
+
async compactSubset(messagesAfterSummary, fullHistory, existingSummaryIndex, model, logger) {
|
|
121
136
|
const { toSummarize, toKeep } = this.splitHistory(messagesAfterSummary);
|
|
122
137
|
if (toSummarize.length === 0) {
|
|
123
|
-
|
|
138
|
+
logger.debug("ReactiveOverflowCompactionStrategy: No messages to summarize in subset");
|
|
124
139
|
return [];
|
|
125
140
|
}
|
|
126
141
|
const currentTaskMessage = this.findCurrentTaskMessage(fullHistory);
|
|
127
|
-
|
|
128
|
-
`
|
|
142
|
+
logger.info(
|
|
143
|
+
`ReactiveOverflowCompactionStrategy (re-compact): Summarizing ${toSummarize.length} messages after existing summary, keeping ${toKeep.length}`
|
|
129
144
|
);
|
|
130
|
-
const summary = await this.generateSummary(toSummarize, currentTaskMessage);
|
|
145
|
+
const summary = await this.generateSummary(toSummarize, currentTaskMessage, model, logger);
|
|
131
146
|
const absoluteOriginalMessageCount = existingSummaryIndex + 1 + toSummarize.length;
|
|
132
147
|
const summaryMessage = {
|
|
133
148
|
role: "assistant",
|
|
@@ -138,7 +153,6 @@ class ReactiveOverflowStrategy {
|
|
|
138
153
|
summarizedAt: Date.now(),
|
|
139
154
|
originalMessageCount: absoluteOriginalMessageCount,
|
|
140
155
|
isRecompaction: true,
|
|
141
|
-
// Mark that this is a re-compaction
|
|
142
156
|
originalFirstTimestamp: toSummarize[0]?.timestamp,
|
|
143
157
|
originalLastTimestamp: toSummarize[toSummarize.length - 1]?.timestamp
|
|
144
158
|
}
|
|
@@ -147,7 +161,6 @@ class ReactiveOverflowStrategy {
|
|
|
147
161
|
}
|
|
148
162
|
/**
|
|
149
163
|
* Find the most recent user message that represents the current task.
|
|
150
|
-
* This helps preserve context about what the user is currently asking for.
|
|
151
164
|
*/
|
|
152
165
|
findCurrentTaskMessage(history) {
|
|
153
166
|
for (let i = history.length - 1; i >= 0; i--) {
|
|
@@ -169,13 +182,9 @@ class ReactiveOverflowStrategy {
|
|
|
169
182
|
}
|
|
170
183
|
/**
|
|
171
184
|
* Split history into messages to summarize and messages to keep.
|
|
172
|
-
* Keeps the last N turns (user + assistant pairs) intact.
|
|
173
|
-
*
|
|
174
|
-
* For long agentic conversations with many tool calls, this also ensures
|
|
175
|
-
* we don't try to keep too many messages even within preserved turns.
|
|
176
185
|
*/
|
|
177
186
|
splitHistory(history) {
|
|
178
|
-
const turnsToKeep = this.
|
|
187
|
+
const turnsToKeep = this.strategyOptions.preserveLastNTurns;
|
|
179
188
|
const userMessageIndices = [];
|
|
180
189
|
for (let i = history.length - 1; i >= 0; i--) {
|
|
181
190
|
if (history[i]?.role === "user") {
|
|
@@ -203,9 +212,6 @@ class ReactiveOverflowStrategy {
|
|
|
203
212
|
toKeep: history
|
|
204
213
|
};
|
|
205
214
|
}
|
|
206
|
-
this.logger.debug(
|
|
207
|
-
`splitHistory: Using fallback - keeping last ${keepCount} of ${history.length} messages`
|
|
208
|
-
);
|
|
209
215
|
return {
|
|
210
216
|
toSummarize: history.slice(0, -keepCount),
|
|
211
217
|
toKeep: history.slice(-keepCount)
|
|
@@ -213,11 +219,8 @@ class ReactiveOverflowStrategy {
|
|
|
213
219
|
}
|
|
214
220
|
/**
|
|
215
221
|
* Generate an LLM summary of the messages.
|
|
216
|
-
*
|
|
217
|
-
* @param messages Messages to summarize
|
|
218
|
-
* @param currentTask The most recent user message (current task context)
|
|
219
222
|
*/
|
|
220
|
-
async generateSummary(messages, currentTask) {
|
|
223
|
+
async generateSummary(messages, currentTask, model, logger) {
|
|
221
224
|
const formattedConversation = this.formatMessagesForSummary(messages);
|
|
222
225
|
let conversationWithContext = formattedConversation;
|
|
223
226
|
if (currentTask) {
|
|
@@ -226,21 +229,21 @@ class ReactiveOverflowStrategy {
|
|
|
226
229
|
--- CURRENT TASK (most recent user request) ---
|
|
227
230
|
${currentTask}`;
|
|
228
231
|
}
|
|
229
|
-
const prompt = this.
|
|
232
|
+
const prompt = this.strategyOptions.summaryPrompt.replace(
|
|
230
233
|
"{conversation}",
|
|
231
234
|
conversationWithContext
|
|
232
235
|
);
|
|
233
236
|
try {
|
|
234
237
|
const result = await generateText({
|
|
235
|
-
model
|
|
238
|
+
model,
|
|
236
239
|
prompt,
|
|
237
|
-
maxOutputTokens: this.
|
|
240
|
+
maxOutputTokens: this.strategyOptions.maxSummaryTokens
|
|
238
241
|
});
|
|
239
242
|
return `[Session Compaction Summary]
|
|
240
243
|
${result.text}`;
|
|
241
244
|
} catch (error) {
|
|
242
|
-
|
|
243
|
-
`
|
|
245
|
+
logger.error(
|
|
246
|
+
`ReactiveOverflowCompactionStrategy: Failed to generate summary - ${error instanceof Error ? error.message : String(error)}`
|
|
244
247
|
);
|
|
245
248
|
return this.createFallbackSummary(messages, currentTask);
|
|
246
249
|
}
|
|
@@ -316,5 +319,5 @@ ${result.text}`;
|
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
321
|
export {
|
|
319
|
-
|
|
322
|
+
ReactiveOverflowCompactionStrategy
|
|
320
323
|
};
|
|
@@ -1,14 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { LanguageModel } from 'ai';
|
|
2
|
+
import type { Logger } from '../../logger/v2/types.js';
|
|
3
|
+
import type { InternalMessage } from '../types.js';
|
|
4
|
+
import type { ModelLimits } from './overflow.js';
|
|
5
|
+
export interface CompactionSettings {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Optional cap on the model context window used for compaction decisions.
|
|
9
|
+
* When set, compaction will behave as if the model's context window is:
|
|
10
|
+
* `min(modelContextWindow, maxContextTokens)`.
|
|
11
|
+
*/
|
|
12
|
+
maxContextTokens?: number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Percentage (0.1–1.0) of the effective context window at which compaction triggers.
|
|
15
|
+
* Example: 0.9 triggers at 90% of context usage.
|
|
16
|
+
*/
|
|
17
|
+
thresholdPercent: number;
|
|
18
|
+
}
|
|
19
|
+
export interface CompactionRuntimeContext {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
model: LanguageModel;
|
|
22
|
+
logger: Logger;
|
|
23
|
+
}
|
|
2
24
|
/**
|
|
3
|
-
* Compaction strategy
|
|
25
|
+
* Compaction strategy.
|
|
4
26
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
27
|
+
* This is the DI surface used by core runtime (TurnExecutor/VercelLLMService) to:
|
|
28
|
+
* - decide when to compact (budget + overflow logic)
|
|
29
|
+
* - execute compaction given per-session runtime context (model, logger, sessionId)
|
|
30
|
+
*
|
|
31
|
+
* Strategies are created by host layers (CLI/server/apps) via image factories.
|
|
32
|
+
* Core does not parse YAML, validate Zod schemas, or switch on `type` strings.
|
|
8
33
|
*/
|
|
9
|
-
export
|
|
34
|
+
export type CompactionStrategy = {
|
|
10
35
|
/** Human-readable name for logging/UI */
|
|
11
36
|
readonly name: string;
|
|
37
|
+
/** Effective budgeting settings for this strategy */
|
|
38
|
+
getSettings(): CompactionSettings;
|
|
39
|
+
/** Effective model limits after applying any strategy caps */
|
|
40
|
+
getModelLimits(modelContextWindow: number): ModelLimits;
|
|
41
|
+
/** Whether compaction should run given current input token usage */
|
|
42
|
+
shouldCompact(inputTokens: number, modelLimits: ModelLimits): boolean;
|
|
12
43
|
/**
|
|
13
44
|
* Compacts the provided message history.
|
|
14
45
|
*
|
|
@@ -25,8 +56,9 @@ export interface ICompactionStrategy {
|
|
|
25
56
|
* - `isSessionSummary: true` - Alternative to isSummary for session-level summaries
|
|
26
57
|
*
|
|
27
58
|
* @param history The current conversation history.
|
|
59
|
+
* @param context Per-session runtime context (model/logger/sessionId)
|
|
28
60
|
* @returns Summary messages to add to history. Empty array if nothing to compact.
|
|
29
61
|
*/
|
|
30
|
-
compact(history: readonly InternalMessage[]): Promise<InternalMessage[]
|
|
31
|
-
}
|
|
62
|
+
compact(history: readonly InternalMessage[], context: CompactionRuntimeContext): Promise<InternalMessage[]>;
|
|
63
|
+
};
|
|
32
64
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/context/compaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,qDAAqD;IACrD,WAAW,IAAI,kBAAkB,CAAC;IAElC,8DAA8D;IAC9D,cAAc,CAAC,kBAAkB,EAAE,MAAM,GAAG,WAAW,CAAC;IAExD,oEAAoE;IACpE,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC;IAEtE;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CACH,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACjC,CAAC"}
|
package/dist/context/manager.cjs
CHANGED
|
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(manager_exports);
|
|
|
34
34
|
var import_crypto = require("crypto");
|
|
35
35
|
var import_types2 = require("./types.js");
|
|
36
36
|
var import_types3 = require("../logger/v2/types.js");
|
|
37
|
-
var import_events = require("../events/index.js");
|
|
38
37
|
var import_utils = require("./utils.js");
|
|
39
38
|
var import_errors = require("./errors.js");
|
|
40
39
|
class ContextManager {
|
|
@@ -150,7 +149,7 @@ class ContextManager {
|
|
|
150
149
|
this.logger.info(
|
|
151
150
|
`Stored user input as blob: ${blobRef.uri} (${estimatedSize} bytes, ${metadata.mimeType})`
|
|
152
151
|
);
|
|
153
|
-
|
|
152
|
+
this.resourceManager.emitCacheInvalidated({
|
|
154
153
|
resourceUri: blobRef.uri,
|
|
155
154
|
serverName: "internal",
|
|
156
155
|
action: "blob_stored"
|
|
@@ -615,6 +614,9 @@ ${prompt}`);
|
|
|
615
614
|
content: sanitizedResult.content,
|
|
616
615
|
toolCallId,
|
|
617
616
|
name,
|
|
617
|
+
...metadata?.toolDisplayName !== void 0 && {
|
|
618
|
+
toolDisplayName: metadata.toolDisplayName
|
|
619
|
+
},
|
|
618
620
|
// Success status comes from sanitizedResult.meta (single source of truth)
|
|
619
621
|
success: sanitizedResult.meta.success,
|
|
620
622
|
// Persist display data for rich rendering on session resume
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { VercelMessageFormatter } from '../llm/formatters/vercel.js';
|
|
2
2
|
import { LLMContext } from '../llm/types.js';
|
|
3
3
|
import type { InternalMessage, AssistantMessage, ToolCall } from './types.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Logger } from '../logger/v2/types.js';
|
|
5
5
|
import type { SanitizedToolResult } from './types.js';
|
|
6
6
|
import { DynamicContributorContext } from '../systemPrompt/types.js';
|
|
7
7
|
import { SystemPromptManager } from '../systemPrompt/manager.js';
|
|
8
|
-
import {
|
|
8
|
+
import type { ConversationHistoryProvider } from '../session/history/types.js';
|
|
9
9
|
import { ValidatedLLMConfig } from '../llm/schemas.js';
|
|
10
10
|
/**
|
|
11
11
|
* Manages conversation history and provides message formatting capabilities for the LLM context.
|
|
@@ -75,7 +75,7 @@ export declare class ContextManager<TMessage = unknown> {
|
|
|
75
75
|
* @param resourceManager ResourceManager for resolving blob references in messages
|
|
76
76
|
* @param logger Logger instance for logging
|
|
77
77
|
*/
|
|
78
|
-
constructor(llmConfig: ValidatedLLMConfig, formatter: VercelMessageFormatter, systemPromptManager: SystemPromptManager, maxInputTokens: number, historyProvider:
|
|
78
|
+
constructor(llmConfig: ValidatedLLMConfig, formatter: VercelMessageFormatter, systemPromptManager: SystemPromptManager, maxInputTokens: number, historyProvider: ConversationHistoryProvider, sessionId: string, resourceManager: import('../resources/index.js').ResourceManager, logger: Logger);
|
|
79
79
|
/**
|
|
80
80
|
* Get the ResourceManager instance
|
|
81
81
|
*/
|
|
@@ -254,6 +254,7 @@ export declare class ContextManager<TMessage = unknown> {
|
|
|
254
254
|
addToolResult(toolCallId: string, name: string, sanitizedResult: SanitizedToolResult, metadata?: {
|
|
255
255
|
requireApproval?: boolean;
|
|
256
256
|
approvalStatus?: 'approved' | 'rejected';
|
|
257
|
+
toolDisplayName?: string;
|
|
257
258
|
}): Promise<void>;
|
|
258
259
|
/**
|
|
259
260
|
* Gets the conversation history formatted for the target LLM provider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/context/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/context/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc,CAAC,QAAQ,GAAG,OAAO;IAC1C;;OAEG;IACH,OAAO,CAAC,SAAS,CAAqB;IAEtC;;OAEG;IACH,OAAO,CAAC,mBAAmB,CAAsB;IAEjD;;OAEG;IACH,OAAO,CAAC,SAAS,CAAyB;IAE1C;;OAEG;IACH,OAAO,CAAC,cAAc,CAAS;IAE/B;;;OAGG;IACH,OAAO,CAAC,qBAAqB,CAAuB;IAEpD;;;;OAIG;IACH,OAAO,CAAC,sBAAsB,CAAuB;IAErD;;;;OAIG;IACH,OAAO,CAAC,oBAAoB,CAAuB;IAEnD,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,QA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,MAAM,CAAA;iBAAE,CAAC,CAAC;aACpD,CAAC;YACF,QAAQ,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,wBAAwB;QACxB,KAAK,EAAE;YACH,oBAAoB,EAAE,MAAM,CAAC;YAC7B,oBAAoB,EAAE,MAAM,CAAC;YAC7B,eAAe,EAAE,MAAM,CAAC;SAC3B,CAAC;QACF,8CAA8C;QAC9C,gBAAgB,CAAC,EAAE;YACf,kEAAkE;YAClE,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;YAC/B,iEAAiE;YACjE,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,kEAAkE;YAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAC1B,iFAAiF;YACjF,mBAAmB,CAAC,EAAE,MAAM,CAAC;SAChC,CAAC;KACL,CAAC;IA+FF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACG,2BAA2B,CAC7B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,SAAS,eAAe,EAAE,EAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,GACrF,OAAO,CAAC,MAAM,CAAC;IAwBlB;;;;;;OAMG;IACG,wBAAwB,CAC1B,QAAQ,EAAE,yBAAyB,GACpC,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAKrC;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ3C"}
|
package/dist/context/manager.js
CHANGED
|
@@ -2,7 +2,6 @@ import "../chunk-PTJYTZNU.js";
|
|
|
2
2
|
import { randomUUID } from "crypto";
|
|
3
3
|
import { isSystemMessage, isUserMessage, isAssistantMessage, isToolMessage } from "./types.js";
|
|
4
4
|
import { DextoLogComponent } from "../logger/v2/types.js";
|
|
5
|
-
import { eventBus } from "../events/index.js";
|
|
6
5
|
import {
|
|
7
6
|
expandBlobReferences,
|
|
8
7
|
isLikelyBase64String,
|
|
@@ -124,7 +123,7 @@ class ContextManager {
|
|
|
124
123
|
this.logger.info(
|
|
125
124
|
`Stored user input as blob: ${blobRef.uri} (${estimatedSize} bytes, ${metadata.mimeType})`
|
|
126
125
|
);
|
|
127
|
-
|
|
126
|
+
this.resourceManager.emitCacheInvalidated({
|
|
128
127
|
resourceUri: blobRef.uri,
|
|
129
128
|
serverName: "internal",
|
|
130
129
|
action: "blob_stored"
|
|
@@ -589,6 +588,9 @@ ${prompt}`);
|
|
|
589
588
|
content: sanitizedResult.content,
|
|
590
589
|
toolCallId,
|
|
591
590
|
name,
|
|
591
|
+
...metadata?.toolDisplayName !== void 0 && {
|
|
592
|
+
toolDisplayName: metadata.toolDisplayName
|
|
593
|
+
},
|
|
592
594
|
// Success status comes from sanitizedResult.meta (single source of truth)
|
|
593
595
|
success: sanitizedResult.meta.success,
|
|
594
596
|
// Persist display data for rich rendering on session resume
|
package/dist/context/types.d.ts
CHANGED
|
@@ -216,6 +216,8 @@ export interface ToolMessage extends MessageBase {
|
|
|
216
216
|
toolCallId: string;
|
|
217
217
|
/** Name of the tool that produced this result (REQUIRED) */
|
|
218
218
|
name: string;
|
|
219
|
+
/** Optional user-facing name for the tool (UI convenience) */
|
|
220
|
+
toolDisplayName?: string;
|
|
219
221
|
/** Whether the tool execution was successful */
|
|
220
222
|
success?: boolean;
|
|
221
223
|
/** Whether this tool call required user approval before execution */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAMjE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB,KAAK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GAAG,aAAa,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAM3F;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,aAAa,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,WAAW,CAEtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,gBAAgB,CAEhF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,WAAW,CAEtE"}
|
package/dist/context/utils.cjs
CHANGED
|
@@ -50,8 +50,8 @@ __export(utils_exports, {
|
|
|
50
50
|
module.exports = __toCommonJS(utils_exports);
|
|
51
51
|
var import_types = require("./types.js");
|
|
52
52
|
var import_display_types = require("../tools/display-types.js");
|
|
53
|
-
var import_registry = require("../llm/registry/index.
|
|
54
|
-
var import_safe_stringify = require("../utils/safe-stringify.
|
|
53
|
+
var import_registry = require("../llm/registry/index.js");
|
|
54
|
+
var import_safe_stringify = require("../utils/safe-stringify.js");
|
|
55
55
|
var import_media_helpers = require("./media-helpers.js");
|
|
56
56
|
const MIN_BASE64_HEURISTIC_LENGTH = 512;
|
|
57
57
|
const MAX_TOOL_TEXT_CHARS = 8e3;
|