@dexto/core 1.5.8 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -8
- package/dist/agent/DextoAgent.cjs +318 -159
- package/dist/agent/DextoAgent.d.ts +94 -56
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +315 -156
- 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 +8 -9197
- 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 +163 -83
- package/dist/approval/manager.d.ts +50 -43
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +161 -81
- package/dist/approval/schemas.cjs +47 -32
- package/dist/approval/schemas.d.ts +291 -97
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +43 -28
- 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 +5 -3
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +4 -2
- package/dist/context/types.d.ts +3 -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 +48 -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 +26 -45
- 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 +8 -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 +12 -12
- 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 +10 -149
- 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 +8 -15
- 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 +8 -15
- 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.cjs +35 -0
- package/dist/logger/v2/dexto-logger.d.ts +22 -3
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/dexto-logger.js +35 -0
- package/dist/logger/v2/schemas.d.ts +6 -6
- package/dist/logger/v2/test-utils.cjs +2 -0
- 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/test-utils.js +2 -0
- 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 +22 -9
- 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 +19 -19
- 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 +7 -7
- 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/in-built-prompts.cjs +5 -5
- package/dist/systemPrompt/in-built-prompts.d.ts +1 -1
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +5 -5
- 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/systemPrompt/schemas.d.ts +5 -5
- package/dist/systemPrompt/types.d.ts +11 -0
- package/dist/systemPrompt/types.d.ts.map +1 -1
- 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/display-types.d.ts +10 -0
- package/dist/tools/display-types.d.ts.map +1 -1
- 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 +6 -9
- package/dist/tools/index.d.ts +3 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -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/{storage/cache/factory.cjs → tools/presentation.cjs} +26 -15
- package/dist/tools/presentation.d.ts +11 -0
- package/dist/tools/presentation.d.ts.map +1 -0
- package/dist/tools/presentation.js +24 -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 +608 -392
- package/dist/tools/tool-manager.d.ts +79 -98
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +608 -396
- package/dist/tools/types.d.ts +223 -45
- 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.cjs +10 -1
- package/dist/utils/path.d.ts +7 -4
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +10 -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.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,140 +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 invoke_skill_tool_exports = {};
|
|
20
|
-
__export(invoke_skill_tool_exports, {
|
|
21
|
-
createInvokeSkillTool: () => createInvokeSkillTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(invoke_skill_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
var import_utils = require("../../../prompts/utils.js");
|
|
26
|
-
const InvokeSkillInputSchema = import_zod.z.object({
|
|
27
|
-
skill: import_zod.z.string().min(1, "Skill name is required").describe(
|
|
28
|
-
'The name of the skill to invoke (e.g., "plugin-name:skill-name" or "skill-name")'
|
|
29
|
-
),
|
|
30
|
-
args: import_zod.z.record(import_zod.z.string()).optional().describe("Optional arguments to pass to the skill"),
|
|
31
|
-
taskContext: import_zod.z.string().optional().describe(
|
|
32
|
-
"Context about what task this skill should accomplish. Recommended for forked skills to provide context since they run in isolation without conversation history."
|
|
33
|
-
)
|
|
34
|
-
}).strict();
|
|
35
|
-
function createInvokeSkillTool(services) {
|
|
36
|
-
return {
|
|
37
|
-
id: "invoke_skill",
|
|
38
|
-
description: buildToolDescription(),
|
|
39
|
-
inputSchema: InvokeSkillInputSchema,
|
|
40
|
-
execute: async (input, context) => {
|
|
41
|
-
const { skill, args, taskContext } = input;
|
|
42
|
-
const promptManager = services.promptManager;
|
|
43
|
-
if (!promptManager) {
|
|
44
|
-
return {
|
|
45
|
-
error: "PromptManager not available. This is a configuration error."
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const autoInvocable = await promptManager.listAutoInvocablePrompts();
|
|
49
|
-
let skillKey;
|
|
50
|
-
for (const key of Object.keys(autoInvocable)) {
|
|
51
|
-
const info = autoInvocable[key];
|
|
52
|
-
if (!info) continue;
|
|
53
|
-
if (key === skill || info.displayName === skill || info.commandName === skill || info.name === skill) {
|
|
54
|
-
skillKey = key;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (!skillKey) {
|
|
59
|
-
return {
|
|
60
|
-
error: `Skill '${skill}' not found or not available for model invocation. Use a skill from the available list.`,
|
|
61
|
-
availableSkills: Object.keys(autoInvocable)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const promptDef = await promptManager.getPromptDefinition(skillKey);
|
|
65
|
-
const promptResult = await promptManager.getPrompt(skillKey, args);
|
|
66
|
-
const flattened = (0, import_utils.flattenPromptResult)(promptResult);
|
|
67
|
-
const content = flattened.text;
|
|
68
|
-
if (promptDef?.context === "fork") {
|
|
69
|
-
const taskForker = services.taskForker;
|
|
70
|
-
if (!taskForker) {
|
|
71
|
-
return {
|
|
72
|
-
error: `Skill '${skill}' requires fork execution (context: fork), but agent spawning is not available. Configure agent-spawner custom tool to enable forked skills.`,
|
|
73
|
-
skill: skillKey
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
let instructions;
|
|
77
|
-
if (taskContext) {
|
|
78
|
-
instructions = `## Task Context
|
|
79
|
-
${taskContext}
|
|
80
|
-
|
|
81
|
-
## Skill Instructions
|
|
82
|
-
${content}`;
|
|
83
|
-
} else {
|
|
84
|
-
instructions = content;
|
|
85
|
-
}
|
|
86
|
-
const forkOptions = {
|
|
87
|
-
task: `Skill: ${skill}`,
|
|
88
|
-
instructions,
|
|
89
|
-
// Fork skills auto-approve by default since they run in isolation
|
|
90
|
-
autoApprove: true
|
|
91
|
-
};
|
|
92
|
-
if (promptDef.agent) {
|
|
93
|
-
forkOptions.agentId = promptDef.agent;
|
|
94
|
-
}
|
|
95
|
-
if (context?.toolCallId) {
|
|
96
|
-
forkOptions.toolCallId = context.toolCallId;
|
|
97
|
-
}
|
|
98
|
-
if (context?.sessionId) {
|
|
99
|
-
forkOptions.sessionId = context.sessionId;
|
|
100
|
-
}
|
|
101
|
-
const result = await taskForker.fork(forkOptions);
|
|
102
|
-
if (result.success) {
|
|
103
|
-
return result.response ?? "Task completed successfully.";
|
|
104
|
-
} else {
|
|
105
|
-
return `Error: ${result.error ?? "Unknown error during forked execution"}`;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
skill: skillKey,
|
|
110
|
-
content,
|
|
111
|
-
instructions: "Follow the instructions in the skill content above to complete the task."
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function buildToolDescription() {
|
|
117
|
-
return `Invoke a skill to load and execute specialized instructions for a task. Skills are predefined prompts that guide how to handle specific scenarios.
|
|
118
|
-
|
|
119
|
-
When to use:
|
|
120
|
-
- When you recognize a task that matches an available skill
|
|
121
|
-
- When you need specialized guidance for a complex operation
|
|
122
|
-
- When the user references a skill by name
|
|
123
|
-
|
|
124
|
-
Parameters:
|
|
125
|
-
- skill: The name of the skill to invoke
|
|
126
|
-
- args: Optional arguments to pass to the skill (e.g., for $ARGUMENTS substitution)
|
|
127
|
-
- taskContext: Context about what you're trying to accomplish (important for forked skills that run in isolation)
|
|
128
|
-
|
|
129
|
-
Execution modes:
|
|
130
|
-
- **Inline skills**: Return instructions for you to follow in the current conversation
|
|
131
|
-
- **Fork skills**: Automatically execute in an isolated subagent and return the result (no additional tool calls needed)
|
|
132
|
-
|
|
133
|
-
Fork skills run in complete isolation without access to conversation history. They're useful for tasks that should run independently.
|
|
134
|
-
|
|
135
|
-
Available skills are listed in your system prompt. Use the skill name exactly as shown.`;
|
|
136
|
-
}
|
|
137
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
-
0 && (module.exports = {
|
|
139
|
-
createInvokeSkillTool
|
|
140
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { InternalTool } from '../../types.js';
|
|
2
|
-
import type { InternalToolsServices } from '../registry.js';
|
|
3
|
-
/**
|
|
4
|
-
* Internal tool for invoking skills/prompts during agent execution.
|
|
5
|
-
*
|
|
6
|
-
* This tool allows the LLM to load and execute skills that are registered
|
|
7
|
-
* with the PromptManager. Skills are prompts that can be auto-invoked by
|
|
8
|
-
* the model (not disabled via `disableModelInvocation`).
|
|
9
|
-
*
|
|
10
|
-
* Execution modes:
|
|
11
|
-
* - **inline** (default): Skill content is returned for the LLM to follow in the current session
|
|
12
|
-
* - **fork**: Skill is executed in an isolated subagent with no conversation history access
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
* - The LLM sees available skills in its system prompt
|
|
16
|
-
* - When a skill is relevant, the LLM calls this tool with the skill name
|
|
17
|
-
* - For inline skills: content is returned for the LLM to follow
|
|
18
|
-
* - For forked skills: execution happens in isolation and result is returned
|
|
19
|
-
*
|
|
20
|
-
* Note: Takes services object (not individual deps) to support late-binding of taskForker.
|
|
21
|
-
* The taskForker may be set after tool creation when agent-spawner custom tool is registered.
|
|
22
|
-
*/
|
|
23
|
-
export declare function createInvokeSkillTool(services: InternalToolsServices): InternalTool;
|
|
24
|
-
//# sourceMappingURL=invoke-skill-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoke-skill-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/invoke-skill-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAuB5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,YAAY,CAqHnF"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { flattenPromptResult } from "../../../prompts/utils.js";
|
|
4
|
-
const InvokeSkillInputSchema = z.object({
|
|
5
|
-
skill: z.string().min(1, "Skill name is required").describe(
|
|
6
|
-
'The name of the skill to invoke (e.g., "plugin-name:skill-name" or "skill-name")'
|
|
7
|
-
),
|
|
8
|
-
args: z.record(z.string()).optional().describe("Optional arguments to pass to the skill"),
|
|
9
|
-
taskContext: z.string().optional().describe(
|
|
10
|
-
"Context about what task this skill should accomplish. Recommended for forked skills to provide context since they run in isolation without conversation history."
|
|
11
|
-
)
|
|
12
|
-
}).strict();
|
|
13
|
-
function createInvokeSkillTool(services) {
|
|
14
|
-
return {
|
|
15
|
-
id: "invoke_skill",
|
|
16
|
-
description: buildToolDescription(),
|
|
17
|
-
inputSchema: InvokeSkillInputSchema,
|
|
18
|
-
execute: async (input, context) => {
|
|
19
|
-
const { skill, args, taskContext } = input;
|
|
20
|
-
const promptManager = services.promptManager;
|
|
21
|
-
if (!promptManager) {
|
|
22
|
-
return {
|
|
23
|
-
error: "PromptManager not available. This is a configuration error."
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const autoInvocable = await promptManager.listAutoInvocablePrompts();
|
|
27
|
-
let skillKey;
|
|
28
|
-
for (const key of Object.keys(autoInvocable)) {
|
|
29
|
-
const info = autoInvocable[key];
|
|
30
|
-
if (!info) continue;
|
|
31
|
-
if (key === skill || info.displayName === skill || info.commandName === skill || info.name === skill) {
|
|
32
|
-
skillKey = key;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (!skillKey) {
|
|
37
|
-
return {
|
|
38
|
-
error: `Skill '${skill}' not found or not available for model invocation. Use a skill from the available list.`,
|
|
39
|
-
availableSkills: Object.keys(autoInvocable)
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const promptDef = await promptManager.getPromptDefinition(skillKey);
|
|
43
|
-
const promptResult = await promptManager.getPrompt(skillKey, args);
|
|
44
|
-
const flattened = flattenPromptResult(promptResult);
|
|
45
|
-
const content = flattened.text;
|
|
46
|
-
if (promptDef?.context === "fork") {
|
|
47
|
-
const taskForker = services.taskForker;
|
|
48
|
-
if (!taskForker) {
|
|
49
|
-
return {
|
|
50
|
-
error: `Skill '${skill}' requires fork execution (context: fork), but agent spawning is not available. Configure agent-spawner custom tool to enable forked skills.`,
|
|
51
|
-
skill: skillKey
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
let instructions;
|
|
55
|
-
if (taskContext) {
|
|
56
|
-
instructions = `## Task Context
|
|
57
|
-
${taskContext}
|
|
58
|
-
|
|
59
|
-
## Skill Instructions
|
|
60
|
-
${content}`;
|
|
61
|
-
} else {
|
|
62
|
-
instructions = content;
|
|
63
|
-
}
|
|
64
|
-
const forkOptions = {
|
|
65
|
-
task: `Skill: ${skill}`,
|
|
66
|
-
instructions,
|
|
67
|
-
// Fork skills auto-approve by default since they run in isolation
|
|
68
|
-
autoApprove: true
|
|
69
|
-
};
|
|
70
|
-
if (promptDef.agent) {
|
|
71
|
-
forkOptions.agentId = promptDef.agent;
|
|
72
|
-
}
|
|
73
|
-
if (context?.toolCallId) {
|
|
74
|
-
forkOptions.toolCallId = context.toolCallId;
|
|
75
|
-
}
|
|
76
|
-
if (context?.sessionId) {
|
|
77
|
-
forkOptions.sessionId = context.sessionId;
|
|
78
|
-
}
|
|
79
|
-
const result = await taskForker.fork(forkOptions);
|
|
80
|
-
if (result.success) {
|
|
81
|
-
return result.response ?? "Task completed successfully.";
|
|
82
|
-
} else {
|
|
83
|
-
return `Error: ${result.error ?? "Unknown error during forked execution"}`;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
skill: skillKey,
|
|
88
|
-
content,
|
|
89
|
-
instructions: "Follow the instructions in the skill content above to complete the task."
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function buildToolDescription() {
|
|
95
|
-
return `Invoke a skill to load and execute specialized instructions for a task. Skills are predefined prompts that guide how to handle specific scenarios.
|
|
96
|
-
|
|
97
|
-
When to use:
|
|
98
|
-
- When you recognize a task that matches an available skill
|
|
99
|
-
- When you need specialized guidance for a complex operation
|
|
100
|
-
- When the user references a skill by name
|
|
101
|
-
|
|
102
|
-
Parameters:
|
|
103
|
-
- skill: The name of the skill to invoke
|
|
104
|
-
- args: Optional arguments to pass to the skill (e.g., for $ARGUMENTS substitution)
|
|
105
|
-
- taskContext: Context about what you're trying to accomplish (important for forked skills that run in isolation)
|
|
106
|
-
|
|
107
|
-
Execution modes:
|
|
108
|
-
- **Inline skills**: Return instructions for you to follow in the current conversation
|
|
109
|
-
- **Fork skills**: Automatically execute in an isolated subagent and return the result (no additional tool calls needed)
|
|
110
|
-
|
|
111
|
-
Fork skills run in complete isolation without access to conversation history. They're useful for tasks that should run independently.
|
|
112
|
-
|
|
113
|
-
Available skills are listed in your system prompt. Use the skill name exactly as shown.`;
|
|
114
|
-
}
|
|
115
|
-
export {
|
|
116
|
-
createInvokeSkillTool
|
|
117
|
-
};
|
|
@@ -1,91 +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 list_resources_tool_exports = {};
|
|
20
|
-
__export(list_resources_tool_exports, {
|
|
21
|
-
createListResourcesTool: () => createListResourcesTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(list_resources_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const ListResourcesInputSchema = import_zod.z.object({
|
|
26
|
-
source: import_zod.z.enum(["all", "tool", "user"]).optional().default("all").describe(
|
|
27
|
-
'Filter by source: "tool" for tool-generated resources, "user" for user-uploaded, "all" for both'
|
|
28
|
-
),
|
|
29
|
-
kind: import_zod.z.enum(["all", "image", "audio", "video", "binary"]).optional().default("all").describe('Filter by type: "image", "audio", "video", "binary", or "all"'),
|
|
30
|
-
limit: import_zod.z.number().optional().default(50).describe("Maximum number of resources to return (default: 50)")
|
|
31
|
-
}).strict();
|
|
32
|
-
function createListResourcesTool(resourceManager) {
|
|
33
|
-
return {
|
|
34
|
-
id: "list_resources",
|
|
35
|
-
description: "List available resources (images, files, etc.). Returns resource references that can be used with get_resource to obtain shareable URLs or metadata. Filter by source (tool/user) or kind (image/audio/video/binary).",
|
|
36
|
-
inputSchema: ListResourcesInputSchema,
|
|
37
|
-
execute: async (input, _context) => {
|
|
38
|
-
const { source, kind, limit } = input;
|
|
39
|
-
try {
|
|
40
|
-
const blobStore = resourceManager.getBlobStore();
|
|
41
|
-
const allBlobs = await blobStore.listBlobs();
|
|
42
|
-
const resources = [];
|
|
43
|
-
for (const blob of allBlobs) {
|
|
44
|
-
if (blob.metadata.source === "system") {
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
if (source !== "all" && blob.metadata.source !== source) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
const mimeType = blob.metadata.mimeType;
|
|
51
|
-
let resourceKind = "binary";
|
|
52
|
-
if (mimeType.startsWith("image/")) resourceKind = "image";
|
|
53
|
-
else if (mimeType.startsWith("audio/")) resourceKind = "audio";
|
|
54
|
-
else if (mimeType.startsWith("video/")) resourceKind = "video";
|
|
55
|
-
if (kind !== "all" && resourceKind !== kind) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
resources.push({
|
|
59
|
-
reference: blob.uri,
|
|
60
|
-
kind: resourceKind,
|
|
61
|
-
mimeType: blob.metadata.mimeType,
|
|
62
|
-
...blob.metadata.originalName && { filename: blob.metadata.originalName },
|
|
63
|
-
source: blob.metadata.source || "tool",
|
|
64
|
-
size: blob.metadata.size,
|
|
65
|
-
createdAt: blob.metadata.createdAt.toISOString()
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
resources.sort(
|
|
69
|
-
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
70
|
-
);
|
|
71
|
-
const limitedResources = resources.slice(0, limit);
|
|
72
|
-
return {
|
|
73
|
-
success: true,
|
|
74
|
-
count: limitedResources.length,
|
|
75
|
-
resources: limitedResources,
|
|
76
|
-
_hint: limitedResources.length > 0 ? "Use get_resource with a reference to get a shareable URL or metadata" : "No resources found matching the criteria"
|
|
77
|
-
};
|
|
78
|
-
} catch (error) {
|
|
79
|
-
return {
|
|
80
|
-
success: false,
|
|
81
|
-
error: `Failed to list resources: ${error instanceof Error ? error.message : String(error)}`,
|
|
82
|
-
resources: []
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
createListResourcesTool
|
|
91
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InternalTool } from '../../types.js';
|
|
2
|
-
import type { ResourceManager } from '../../../resources/manager.js';
|
|
3
|
-
/**
|
|
4
|
-
* Internal tool for listing available resources.
|
|
5
|
-
*
|
|
6
|
-
* This tool allows agents to discover what resources (images, files, etc.) are
|
|
7
|
-
* available. Use this to find resources that can be accessed with get_resource.
|
|
8
|
-
*
|
|
9
|
-
* Resources are stored blobs from:
|
|
10
|
-
* - Tool results (images generated by tools, screenshots, etc.)
|
|
11
|
-
* - User uploads (files attached to messages)
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* // List all tool-generated images
|
|
16
|
-
* list_resources({ source: 'tool', kind: 'image' })
|
|
17
|
-
* → { resources: [{ reference: 'blob:abc123', kind: 'image', ... }] }
|
|
18
|
-
*
|
|
19
|
-
* // Get a URL for sharing
|
|
20
|
-
* get_resource({ reference: 'blob:abc123', format: 'url' })
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function createListResourcesTool(resourceManager: ResourceManager): InternalTool;
|
|
24
|
-
//# sourceMappingURL=list-resources-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-resources-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/list-resources-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAqDrE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,eAAe,GAAG,YAAY,CA8EtF"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const ListResourcesInputSchema = z.object({
|
|
4
|
-
source: z.enum(["all", "tool", "user"]).optional().default("all").describe(
|
|
5
|
-
'Filter by source: "tool" for tool-generated resources, "user" for user-uploaded, "all" for both'
|
|
6
|
-
),
|
|
7
|
-
kind: z.enum(["all", "image", "audio", "video", "binary"]).optional().default("all").describe('Filter by type: "image", "audio", "video", "binary", or "all"'),
|
|
8
|
-
limit: z.number().optional().default(50).describe("Maximum number of resources to return (default: 50)")
|
|
9
|
-
}).strict();
|
|
10
|
-
function createListResourcesTool(resourceManager) {
|
|
11
|
-
return {
|
|
12
|
-
id: "list_resources",
|
|
13
|
-
description: "List available resources (images, files, etc.). Returns resource references that can be used with get_resource to obtain shareable URLs or metadata. Filter by source (tool/user) or kind (image/audio/video/binary).",
|
|
14
|
-
inputSchema: ListResourcesInputSchema,
|
|
15
|
-
execute: async (input, _context) => {
|
|
16
|
-
const { source, kind, limit } = input;
|
|
17
|
-
try {
|
|
18
|
-
const blobStore = resourceManager.getBlobStore();
|
|
19
|
-
const allBlobs = await blobStore.listBlobs();
|
|
20
|
-
const resources = [];
|
|
21
|
-
for (const blob of allBlobs) {
|
|
22
|
-
if (blob.metadata.source === "system") {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
if (source !== "all" && blob.metadata.source !== source) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
const mimeType = blob.metadata.mimeType;
|
|
29
|
-
let resourceKind = "binary";
|
|
30
|
-
if (mimeType.startsWith("image/")) resourceKind = "image";
|
|
31
|
-
else if (mimeType.startsWith("audio/")) resourceKind = "audio";
|
|
32
|
-
else if (mimeType.startsWith("video/")) resourceKind = "video";
|
|
33
|
-
if (kind !== "all" && resourceKind !== kind) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
resources.push({
|
|
37
|
-
reference: blob.uri,
|
|
38
|
-
kind: resourceKind,
|
|
39
|
-
mimeType: blob.metadata.mimeType,
|
|
40
|
-
...blob.metadata.originalName && { filename: blob.metadata.originalName },
|
|
41
|
-
source: blob.metadata.source || "tool",
|
|
42
|
-
size: blob.metadata.size,
|
|
43
|
-
createdAt: blob.metadata.createdAt.toISOString()
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
resources.sort(
|
|
47
|
-
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
48
|
-
);
|
|
49
|
-
const limitedResources = resources.slice(0, limit);
|
|
50
|
-
return {
|
|
51
|
-
success: true,
|
|
52
|
-
count: limitedResources.length,
|
|
53
|
-
resources: limitedResources,
|
|
54
|
-
_hint: limitedResources.length > 0 ? "Use get_resource with a reference to get a shareable URL or metadata" : "No resources found matching the criteria"
|
|
55
|
-
};
|
|
56
|
-
} catch (error) {
|
|
57
|
-
return {
|
|
58
|
-
success: false,
|
|
59
|
-
error: `Failed to list resources: ${error instanceof Error ? error.message : String(error)}`,
|
|
60
|
-
resources: []
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
createListResourcesTool
|
|
68
|
-
};
|
|
@@ -1,61 +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 search_history_tool_exports = {};
|
|
20
|
-
__export(search_history_tool_exports, {
|
|
21
|
-
createSearchHistoryTool: () => createSearchHistoryTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(search_history_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const SearchHistoryInputSchema = import_zod.z.object({
|
|
26
|
-
query: import_zod.z.string().describe("The search query to find in conversation history"),
|
|
27
|
-
mode: import_zod.z.enum(["messages", "sessions"]).describe(
|
|
28
|
-
'Search mode: "messages" searches for individual messages, "sessions" finds sessions containing the query'
|
|
29
|
-
),
|
|
30
|
-
sessionId: import_zod.z.string().optional().describe('Optional: limit search to a specific session (only for mode="messages")'),
|
|
31
|
-
role: import_zod.z.enum(["user", "assistant", "system", "tool"]).optional().describe('Optional: filter by message role (only for mode="messages")'),
|
|
32
|
-
limit: import_zod.z.number().optional().default(20).describe(
|
|
33
|
-
'Optional: maximum number of results to return (default: 20, only for mode="messages")'
|
|
34
|
-
),
|
|
35
|
-
offset: import_zod.z.number().optional().default(0).describe('Optional: offset for pagination (default: 0, only for mode="messages")')
|
|
36
|
-
});
|
|
37
|
-
function createSearchHistoryTool(searchService) {
|
|
38
|
-
return {
|
|
39
|
-
id: "search_history",
|
|
40
|
-
description: 'Search through conversation history across sessions. Use mode="messages" to search for specific messages, or mode="sessions" to find sessions containing the query. For message search, you can filter by sessionId (specific session), role (user/assistant/system/tool), limit results, and set pagination offset.',
|
|
41
|
-
inputSchema: SearchHistoryInputSchema,
|
|
42
|
-
// TODO: Enhance to get SearchService via ToolExecutionContext for better separation of concerns
|
|
43
|
-
execute: async (input, _context) => {
|
|
44
|
-
const { query, mode, sessionId, role, limit, offset } = input;
|
|
45
|
-
if (mode === "messages") {
|
|
46
|
-
const searchOptions = {};
|
|
47
|
-
if (sessionId !== void 0) searchOptions.sessionId = sessionId;
|
|
48
|
-
if (role !== void 0) searchOptions.role = role;
|
|
49
|
-
if (limit !== void 0) searchOptions.limit = limit;
|
|
50
|
-
if (offset !== void 0) searchOptions.offset = offset;
|
|
51
|
-
return await searchService.searchMessages(query, searchOptions);
|
|
52
|
-
} else {
|
|
53
|
-
return await searchService.searchSessions(query);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
-
0 && (module.exports = {
|
|
60
|
-
createSearchHistoryTool
|
|
61
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { InternalTool } from '../../types.js';
|
|
2
|
-
import { SearchService } from '../../../search/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Internal tool for searching conversation history
|
|
5
|
-
*/
|
|
6
|
-
export declare function createSearchHistoryTool(searchService: SearchService): InternalTool;
|
|
7
|
-
//# sourceMappingURL=search-history-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-history-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/search-history-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAkCzD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,aAAa,GAAG,YAAY,CAyBlF"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const SearchHistoryInputSchema = z.object({
|
|
4
|
-
query: z.string().describe("The search query to find in conversation history"),
|
|
5
|
-
mode: z.enum(["messages", "sessions"]).describe(
|
|
6
|
-
'Search mode: "messages" searches for individual messages, "sessions" finds sessions containing the query'
|
|
7
|
-
),
|
|
8
|
-
sessionId: z.string().optional().describe('Optional: limit search to a specific session (only for mode="messages")'),
|
|
9
|
-
role: z.enum(["user", "assistant", "system", "tool"]).optional().describe('Optional: filter by message role (only for mode="messages")'),
|
|
10
|
-
limit: z.number().optional().default(20).describe(
|
|
11
|
-
'Optional: maximum number of results to return (default: 20, only for mode="messages")'
|
|
12
|
-
),
|
|
13
|
-
offset: z.number().optional().default(0).describe('Optional: offset for pagination (default: 0, only for mode="messages")')
|
|
14
|
-
});
|
|
15
|
-
function createSearchHistoryTool(searchService) {
|
|
16
|
-
return {
|
|
17
|
-
id: "search_history",
|
|
18
|
-
description: 'Search through conversation history across sessions. Use mode="messages" to search for specific messages, or mode="sessions" to find sessions containing the query. For message search, you can filter by sessionId (specific session), role (user/assistant/system/tool), limit results, and set pagination offset.',
|
|
19
|
-
inputSchema: SearchHistoryInputSchema,
|
|
20
|
-
// TODO: Enhance to get SearchService via ToolExecutionContext for better separation of concerns
|
|
21
|
-
execute: async (input, _context) => {
|
|
22
|
-
const { query, mode, sessionId, role, limit, offset } = input;
|
|
23
|
-
if (mode === "messages") {
|
|
24
|
-
const searchOptions = {};
|
|
25
|
-
if (sessionId !== void 0) searchOptions.sessionId = sessionId;
|
|
26
|
-
if (role !== void 0) searchOptions.role = role;
|
|
27
|
-
if (limit !== void 0) searchOptions.limit = limit;
|
|
28
|
-
if (offset !== void 0) searchOptions.offset = offset;
|
|
29
|
-
return await searchService.searchMessages(query, searchOptions);
|
|
30
|
-
} else {
|
|
31
|
-
return await searchService.searchSessions(query);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
createSearchHistoryTool
|
|
38
|
-
};
|
|
@@ -1,26 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var internal_tools_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(internal_tools_exports);
|
|
18
|
-
__reExport(internal_tools_exports, require("./provider.js"), module.exports);
|
|
19
|
-
__reExport(internal_tools_exports, require("./registry.js"), module.exports);
|
|
20
|
-
__reExport(internal_tools_exports, require("./constants.js"), module.exports);
|
|
21
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
-
0 && (module.exports = {
|
|
23
|
-
...require("./provider.js"),
|
|
24
|
-
...require("./registry.js"),
|
|
25
|
-
...require("./constants.js")
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/internal-tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|