@dexto/core 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -9
- package/dist/agent/DextoAgent.cjs +570 -210
- package/dist/agent/DextoAgent.d.ts +175 -35
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +568 -208
- package/dist/agent/agentCard.js +1 -1
- package/dist/agent/error-codes.cjs +1 -0
- package/dist/agent/error-codes.d.ts +2 -1
- package/dist/agent/error-codes.d.ts.map +1 -1
- package/dist/agent/error-codes.js +2 -1
- package/dist/agent/errors.cjs +13 -0
- package/dist/agent/errors.d.ts +4 -0
- package/dist/agent/errors.d.ts.map +1 -1
- package/dist/agent/errors.js +14 -1
- package/dist/agent/index.cjs +4 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +6 -2
- package/dist/agent/schemas.cjs +90 -68
- package/dist/agent/schemas.d.ts +5998 -146
- package/dist/agent/schemas.d.ts.map +1 -1
- package/dist/agent/schemas.js +90 -65
- package/dist/agent/state-manager.cjs +5 -5
- package/dist/agent/state-manager.d.ts +4 -4
- package/dist/agent/state-manager.js +6 -6
- package/dist/agent/types.d.ts +24 -10
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/approval/error-codes.js +1 -1
- package/dist/approval/errors.js +1 -1
- package/dist/approval/factory.js +1 -1
- package/dist/approval/index.js +1 -1
- package/dist/approval/manager.cjs +234 -4
- package/dist/approval/manager.d.ts +131 -4
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +225 -5
- package/dist/approval/schemas.cjs +57 -7
- package/dist/approval/schemas.d.ts +344 -33
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +54 -8
- package/dist/approval/types.cjs +1 -0
- package/dist/approval/types.d.ts +32 -1
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +2 -1
- package/dist/{chunk-C6A6W6XS.js → chunk-PTJYTZNU.js} +44 -1
- package/dist/context/compaction/factory.cjs +57 -0
- package/dist/context/compaction/factory.d.ts +17 -0
- package/dist/context/compaction/factory.d.ts.map +1 -0
- package/dist/context/compaction/factory.js +34 -0
- package/dist/context/compaction/index.cjs +49 -0
- package/dist/context/compaction/index.d.ts +11 -0
- package/dist/context/compaction/index.d.ts.map +1 -0
- package/dist/context/compaction/index.js +19 -0
- package/dist/context/compaction/overflow.cjs +43 -0
- package/dist/context/compaction/overflow.d.ts +33 -0
- package/dist/context/compaction/overflow.d.ts.map +1 -0
- package/dist/context/compaction/overflow.js +19 -0
- package/dist/context/compaction/provider.cjs +16 -0
- package/dist/context/compaction/provider.d.ts +48 -0
- package/dist/context/compaction/provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.cjs +48 -0
- package/dist/context/compaction/providers/noop-provider.d.ts +24 -0
- package/dist/context/compaction/providers/noop-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/noop-provider.js +24 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.cjs +61 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +36 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -0
- package/dist/context/compaction/providers/reactive-overflow-provider.js +37 -0
- package/dist/{llm/tokenizer/factory.cjs → context/compaction/registry.cjs} +15 -20
- package/dist/context/compaction/registry.d.ts +19 -0
- package/dist/context/compaction/registry.d.ts.map +1 -0
- package/dist/context/compaction/registry.js +16 -0
- package/dist/context/compaction/schemas.cjs +38 -0
- package/dist/context/compaction/schemas.d.ts +24 -0
- package/dist/context/compaction/schemas.d.ts.map +1 -0
- package/dist/context/compaction/schemas.js +14 -0
- package/dist/{llm/tokenizer/types.cjs → context/compaction/strategies/noop.cjs} +12 -9
- package/dist/context/compaction/strategies/noop.d.ts +18 -0
- package/dist/context/compaction/strategies/noop.d.ts.map +1 -0
- package/dist/context/compaction/strategies/noop.js +13 -0
- package/dist/context/compaction/strategies/reactive-overflow.cjs +201 -0
- package/dist/context/compaction/strategies/reactive-overflow.d.ts +81 -0
- package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -0
- package/dist/context/compaction/strategies/reactive-overflow.js +178 -0
- package/dist/context/compaction/types.d.ts +20 -0
- package/dist/context/compaction/types.d.ts.map +1 -0
- package/dist/context/error-codes.cjs +7 -0
- package/dist/context/error-codes.d.ts +8 -1
- package/dist/context/error-codes.d.ts.map +1 -1
- package/dist/context/error-codes.js +8 -1
- package/dist/context/errors.cjs +68 -0
- package/dist/context/errors.d.ts +21 -0
- package/dist/context/errors.d.ts.map +1 -1
- package/dist/context/errors.js +69 -1
- package/dist/context/index.cjs +3 -1
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -1
- package/dist/context/manager.cjs +280 -323
- package/dist/context/manager.d.ts +65 -111
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +280 -328
- package/dist/context/media-helpers.js +1 -1
- package/dist/context/types.cjs +49 -0
- package/dist/context/types.d.ts +187 -72
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +35 -0
- package/dist/context/utils.cjs +293 -290
- package/dist/context/utils.d.ts +32 -18
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +293 -290
- package/dist/errors/DextoBaseError.js +1 -1
- package/dist/errors/DextoRuntimeError.js +1 -1
- package/dist/errors/DextoValidationError.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/result-bridge.cjs +2 -3
- package/dist/errors/result-bridge.d.ts.map +1 -1
- package/dist/errors/result-bridge.js +3 -4
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +18 -1
- package/dist/events/index.d.ts +149 -12
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +19 -2
- package/dist/filesystem/error-codes.js +1 -1
- package/dist/filesystem/errors.js +1 -1
- package/dist/filesystem/filesystem-service.cjs +39 -0
- package/dist/filesystem/filesystem-service.d.ts +32 -0
- package/dist/filesystem/filesystem-service.d.ts.map +1 -1
- package/dist/filesystem/filesystem-service.js +40 -1
- package/dist/filesystem/index.d.ts +1 -1
- package/dist/filesystem/index.d.ts.map +1 -1
- package/dist/filesystem/index.js +1 -1
- package/dist/filesystem/path-validator.cjs +69 -1
- package/dist/filesystem/path-validator.d.ts +43 -2
- package/dist/filesystem/path-validator.d.ts.map +1 -1
- package/dist/filesystem/path-validator.js +70 -2
- package/dist/image/define-image.cjs +146 -0
- package/dist/image/define-image.d.ts +71 -0
- package/dist/image/define-image.d.ts.map +1 -0
- package/dist/image/define-image.js +121 -0
- package/dist/{llm/tokenizer/default.cjs → image/index.cjs} +10 -19
- package/dist/image/index.d.ts +53 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +7 -0
- package/dist/image/types.d.ts +231 -0
- package/dist/image/types.d.ts.map +1 -0
- package/dist/image/types.js +0 -0
- package/dist/index.browser.cjs +23 -8
- package/dist/index.browser.d.ts +4 -3
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +20 -3
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/llm/error-codes.cjs +1 -1
- package/dist/llm/error-codes.d.ts +1 -1
- package/dist/llm/error-codes.d.ts.map +1 -1
- package/dist/llm/error-codes.js +2 -2
- package/dist/llm/errors.cjs +34 -10
- package/dist/llm/errors.d.ts +23 -11
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +36 -12
- package/dist/llm/executor/stream-processor.cjs +375 -0
- package/dist/llm/executor/stream-processor.d.ts +55 -0
- package/dist/llm/executor/stream-processor.d.ts.map +1 -0
- package/dist/llm/executor/stream-processor.js +352 -0
- package/dist/llm/executor/tool-output-truncator.cjs +75 -0
- package/dist/llm/executor/tool-output-truncator.d.ts +27 -0
- package/dist/llm/executor/tool-output-truncator.d.ts.map +1 -0
- package/dist/llm/executor/tool-output-truncator.js +48 -0
- package/dist/llm/executor/turn-executor.cjs +780 -0
- package/dist/llm/executor/turn-executor.d.ts +167 -0
- package/dist/llm/executor/turn-executor.d.ts.map +1 -0
- package/dist/llm/executor/turn-executor.js +711 -0
- package/dist/llm/executor/types.cjs +16 -0
- package/dist/llm/executor/types.d.ts +27 -0
- package/dist/llm/executor/types.d.ts.map +1 -0
- package/dist/llm/executor/types.js +0 -0
- package/dist/llm/formatters/vercel.cjs +26 -188
- package/dist/llm/formatters/vercel.d.ts +2 -14
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +25 -187
- package/dist/llm/index.cjs +18 -1
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +14 -0
- package/dist/llm/providers/local/ai-sdk-adapter.cjs +308 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts +29 -0
- package/dist/llm/providers/local/ai-sdk-adapter.d.ts.map +1 -0
- package/dist/llm/providers/local/ai-sdk-adapter.js +278 -0
- package/dist/llm/providers/local/downloader.cjs +291 -0
- package/dist/llm/providers/local/downloader.d.ts +82 -0
- package/dist/llm/providers/local/downloader.d.ts.map +1 -0
- package/dist/llm/providers/local/downloader.js +251 -0
- package/dist/llm/providers/local/error-codes.cjs +57 -0
- package/dist/llm/providers/local/error-codes.d.ts +66 -0
- package/dist/llm/providers/local/error-codes.d.ts.map +1 -0
- package/dist/llm/providers/local/error-codes.js +34 -0
- package/dist/llm/providers/local/errors.cjs +240 -0
- package/dist/llm/providers/local/errors.d.ts +31 -0
- package/dist/llm/providers/local/errors.d.ts.map +1 -0
- package/dist/llm/providers/local/errors.js +217 -0
- package/dist/llm/providers/local/gpu-detector.cjs +214 -0
- package/dist/llm/providers/local/gpu-detector.d.ts +28 -0
- package/dist/llm/providers/local/gpu-detector.d.ts.map +1 -0
- package/dist/llm/providers/local/gpu-detector.js +178 -0
- package/dist/llm/providers/local/index.cjs +147 -0
- package/dist/llm/providers/local/index.d.ts +21 -0
- package/dist/llm/providers/local/index.d.ts.map +1 -0
- package/dist/llm/providers/local/index.js +126 -0
- package/dist/llm/providers/local/node-llama-provider.cjs +216 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts +90 -0
- package/dist/llm/providers/local/node-llama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/node-llama-provider.js +176 -0
- package/dist/llm/providers/local/ollama-provider.cjs +230 -0
- package/dist/llm/providers/local/ollama-provider.d.ts +70 -0
- package/dist/llm/providers/local/ollama-provider.d.ts.map +1 -0
- package/dist/llm/providers/local/ollama-provider.js +198 -0
- package/dist/llm/providers/local/registry.cjs +343 -0
- package/dist/llm/providers/local/registry.d.ts +51 -0
- package/dist/llm/providers/local/registry.d.ts.map +1 -0
- package/dist/llm/providers/local/registry.js +312 -0
- package/dist/llm/providers/local/schemas.cjs +169 -0
- package/dist/llm/providers/local/schemas.d.ts +395 -0
- package/dist/llm/providers/local/schemas.d.ts.map +1 -0
- package/dist/llm/providers/local/schemas.js +133 -0
- package/dist/llm/providers/local/types.cjs +16 -0
- package/dist/llm/providers/local/types.d.ts +219 -0
- package/dist/llm/providers/local/types.d.ts.map +1 -0
- package/dist/llm/providers/local/types.js +0 -0
- package/dist/llm/providers/openrouter-model-registry.cjs +350 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts +120 -0
- package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -0
- package/dist/llm/providers/openrouter-model-registry.js +309 -0
- package/dist/llm/registry.cjs +569 -52
- package/dist/llm/registry.d.ts +79 -39
- package/dist/llm/registry.d.ts.map +1 -1
- package/dist/llm/registry.js +564 -49
- package/dist/llm/resolver.cjs +62 -34
- package/dist/llm/resolver.d.ts +3 -3
- package/dist/llm/resolver.d.ts.map +1 -1
- package/dist/llm/resolver.js +69 -38
- package/dist/llm/schemas.cjs +92 -97
- package/dist/llm/schemas.d.ts +162 -39
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +93 -100
- package/dist/llm/services/factory.cjs +88 -103
- package/dist/llm/services/factory.d.ts +17 -4
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +87 -93
- package/dist/llm/services/test-utils.integration.cjs +28 -10
- package/dist/llm/services/test-utils.integration.d.ts +7 -1
- package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
- package/dist/llm/services/test-utils.integration.js +33 -12
- package/dist/llm/services/types.d.ts +1 -28
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +58 -469
- package/dist/llm/services/vercel.d.ts +39 -21
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +60 -476
- package/dist/llm/types.cjs +11 -4
- package/dist/llm/types.d.ts +9 -9
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/llm/types.js +12 -4
- package/dist/llm/validation.js +1 -1
- package/dist/logger/browser.js +1 -1
- package/dist/logger/factory.js +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/logger.js +1 -1
- package/dist/logger/v2/dexto-logger.cjs +34 -6
- package/dist/logger/v2/dexto-logger.d.ts +20 -2
- package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
- package/dist/logger/v2/dexto-logger.js +35 -7
- package/dist/logger/v2/error-codes.js +1 -1
- package/dist/logger/v2/errors.js +1 -1
- package/dist/logger/v2/schemas.js +1 -1
- package/dist/logger/v2/test-utils.cjs +70 -0
- package/dist/logger/v2/test-utils.d.ts +17 -0
- package/dist/logger/v2/test-utils.d.ts.map +1 -0
- package/dist/logger/v2/test-utils.js +46 -0
- package/dist/logger/v2/transport-factory.js +1 -1
- package/dist/logger/v2/transports/console-transport.js +1 -1
- package/dist/logger/v2/transports/file-transport.cjs +6 -0
- package/dist/logger/v2/transports/file-transport.d.ts +4 -0
- package/dist/logger/v2/transports/file-transport.d.ts.map +1 -1
- package/dist/logger/v2/transports/file-transport.js +7 -1
- package/dist/logger/v2/types.cjs +1 -0
- package/dist/logger/v2/types.d.ts +18 -2
- package/dist/logger/v2/types.d.ts.map +1 -1
- package/dist/logger/v2/types.js +2 -1
- package/dist/mcp/error-codes.cjs +1 -0
- package/dist/mcp/error-codes.d.ts +1 -0
- package/dist/mcp/error-codes.d.ts.map +1 -1
- package/dist/mcp/error-codes.js +2 -1
- package/dist/mcp/errors.cjs +13 -0
- package/dist/mcp/errors.d.ts +7 -0
- package/dist/mcp/errors.d.ts.map +1 -1
- package/dist/mcp/errors.js +14 -1
- package/dist/mcp/manager.cjs +12 -0
- package/dist/mcp/manager.d.ts +17 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +13 -1
- package/dist/mcp/mcp-client.cjs +0 -3
- package/dist/mcp/mcp-client.d.ts.map +1 -1
- package/dist/mcp/mcp-client.js +1 -4
- package/dist/mcp/resolver.js +1 -1
- package/dist/mcp/schemas.cjs +6 -0
- package/dist/mcp/schemas.d.ts +52 -0
- package/dist/mcp/schemas.d.ts.map +1 -1
- package/dist/mcp/schemas.js +6 -1
- package/dist/memory/error-codes.js +1 -1
- package/dist/memory/errors.js +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/manager.js +1 -1
- package/dist/memory/schemas.d.ts +3 -3
- package/dist/memory/schemas.js +1 -1
- package/dist/plugins/builtins/content-policy.js +1 -1
- package/dist/plugins/builtins/response-sanitizer.js +1 -1
- package/dist/plugins/error-codes.cjs +3 -0
- package/dist/plugins/error-codes.d.ts +7 -1
- package/dist/plugins/error-codes.d.ts.map +1 -1
- package/dist/plugins/error-codes.js +4 -1
- package/dist/plugins/index.cjs +7 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +7 -2
- package/dist/plugins/loader.js +1 -1
- package/dist/plugins/manager.cjs +92 -7
- package/dist/plugins/manager.d.ts +10 -3
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/plugins/manager.js +93 -8
- package/dist/plugins/registrations/builtins.js +1 -1
- package/dist/plugins/registry.cjs +63 -0
- package/dist/plugins/registry.d.ts +101 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/registry.js +39 -0
- package/dist/plugins/schemas.cjs +17 -5
- package/dist/plugins/schemas.d.ts +65 -8
- package/dist/plugins/schemas.d.ts.map +1 -1
- package/dist/plugins/schemas.js +16 -5
- package/dist/plugins/types.d.ts +0 -1
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/process/command-validator.js +1 -1
- package/dist/process/error-codes.js +1 -1
- package/dist/process/errors.js +1 -1
- package/dist/process/index.js +1 -1
- package/dist/process/process-service.cjs +78 -26
- package/dist/process/process-service.d.ts +6 -1
- package/dist/process/process-service.d.ts.map +1 -1
- package/dist/process/process-service.js +79 -27
- package/dist/process/types.d.ts +2 -2
- package/dist/process/types.d.ts.map +1 -1
- package/dist/prompts/error-codes.cjs +1 -0
- package/dist/prompts/error-codes.d.ts +2 -1
- package/dist/prompts/error-codes.d.ts.map +1 -1
- package/dist/prompts/error-codes.js +2 -1
- package/dist/prompts/errors.cjs +15 -0
- package/dist/prompts/errors.d.ts +4 -0
- package/dist/prompts/errors.d.ts.map +1 -1
- package/dist/prompts/errors.js +16 -1
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/name-validation.js +1 -1
- package/dist/prompts/prompt-manager.cjs +13 -2
- package/dist/prompts/prompt-manager.d.ts +7 -0
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.js +14 -3
- package/dist/prompts/providers/config-prompt-provider.cjs +12 -3
- package/dist/prompts/providers/config-prompt-provider.d.ts +2 -1
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +13 -4
- package/dist/prompts/providers/custom-prompt-provider.js +1 -1
- package/dist/prompts/providers/mcp-prompt-provider.js +1 -1
- package/dist/prompts/schemas.d.ts +12 -0
- package/dist/prompts/schemas.d.ts.map +1 -1
- package/dist/prompts/schemas.js +1 -1
- package/dist/prompts/types.d.ts +2 -0
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/utils.js +1 -1
- package/dist/providers/base-registry.cjs +147 -0
- package/dist/providers/base-registry.d.ts +147 -0
- package/dist/providers/base-registry.d.ts.map +1 -0
- package/dist/providers/base-registry.js +123 -0
- package/dist/providers/discovery.cjs +95 -0
- package/dist/providers/discovery.d.ts +94 -0
- package/dist/providers/discovery.d.ts.map +1 -0
- package/dist/providers/discovery.js +70 -0
- package/dist/providers/index.cjs +24 -0
- package/dist/providers/index.d.ts +32 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/resources/error-codes.js +1 -1
- package/dist/resources/errors.js +1 -1
- package/dist/resources/handlers/blob-handler.js +1 -1
- package/dist/resources/handlers/factory.js +1 -1
- package/dist/resources/handlers/filesystem-handler.js +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/resources/internal-provider.js +1 -1
- package/dist/resources/manager.js +1 -1
- package/dist/resources/reference-parser.cjs +3 -3
- package/dist/resources/reference-parser.d.ts.map +1 -1
- package/dist/resources/reference-parser.js +4 -4
- package/dist/resources/schemas.js +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/search-service.js +1 -1
- package/dist/session/chat-session.cjs +169 -54
- package/dist/session/chat-session.d.ts +69 -29
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +171 -56
- package/dist/session/error-codes.js +1 -1
- package/dist/session/errors.js +1 -1
- package/dist/session/history/database.cjs +134 -21
- package/dist/session/history/database.d.ts +37 -8
- package/dist/session/history/database.d.ts.map +1 -1
- package/dist/session/history/database.js +135 -22
- package/dist/session/history/factory.js +1 -1
- package/dist/session/history/memory.cjs +18 -0
- package/dist/session/history/memory.d.ts +8 -0
- package/dist/session/history/memory.d.ts.map +1 -1
- package/dist/session/history/memory.js +19 -1
- package/dist/session/history/types.d.ts +13 -1
- package/dist/session/history/types.d.ts.map +1 -1
- package/dist/session/index.cjs +3 -0
- package/dist/session/index.d.ts +3 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +3 -1
- package/dist/session/message-queue.cjs +201 -0
- package/dist/session/message-queue.d.ts +114 -0
- package/dist/session/message-queue.d.ts.map +1 -0
- package/dist/session/message-queue.js +178 -0
- package/dist/session/schemas.js +1 -1
- package/dist/session/session-manager.cjs +57 -7
- package/dist/session/session-manager.d.ts +18 -0
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +58 -8
- package/dist/session/title-generator.cjs +4 -8
- package/dist/session/title-generator.d.ts +1 -2
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/session/title-generator.js +5 -9
- package/dist/session/types.cjs +16 -0
- package/dist/session/types.d.ts +14 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +0 -0
- package/dist/storage/blob/factory.cjs +8 -11
- package/dist/storage/blob/factory.d.ts +32 -6
- package/dist/storage/blob/factory.d.ts.map +1 -1
- package/dist/storage/blob/factory.js +9 -12
- package/dist/storage/blob/index.cjs +56 -0
- package/dist/storage/blob/index.d.ts +45 -0
- package/dist/storage/blob/index.d.ts.map +1 -0
- package/dist/storage/blob/index.js +30 -0
- package/dist/storage/blob/local-blob-store.js +1 -1
- package/dist/storage/blob/memory-blob-store.js +1 -1
- package/dist/storage/blob/provider.cjs +16 -0
- package/dist/storage/blob/provider.d.ts +50 -0
- package/dist/storage/blob/provider.d.ts.map +1 -0
- package/dist/storage/blob/provider.js +0 -0
- package/dist/storage/blob/providers/index.cjs +31 -0
- package/dist/storage/blob/providers/index.d.ts +8 -0
- package/dist/storage/blob/providers/index.d.ts.map +1 -0
- package/dist/storage/blob/providers/index.js +7 -0
- package/dist/storage/blob/providers/local.cjs +39 -0
- package/dist/storage/blob/providers/local.d.ts +17 -0
- package/dist/storage/blob/providers/local.d.ts.map +1 -0
- package/dist/storage/blob/providers/local.js +16 -0
- package/dist/storage/blob/providers/memory.cjs +39 -0
- package/dist/storage/blob/providers/memory.d.ts +17 -0
- package/dist/storage/blob/providers/memory.d.ts.map +1 -0
- package/dist/storage/blob/providers/memory.js +16 -0
- package/dist/storage/blob/registry.cjs +50 -0
- package/dist/storage/blob/registry.d.ts +42 -0
- package/dist/storage/blob/registry.d.ts.map +1 -0
- package/dist/storage/blob/registry.js +26 -0
- package/dist/storage/blob/schemas.cjs +9 -12
- package/dist/storage/blob/schemas.d.ts +39 -34
- package/dist/storage/blob/schemas.d.ts.map +1 -1
- package/dist/storage/blob/schemas.js +7 -12
- package/dist/storage/cache/factory.cjs +8 -36
- package/dist/storage/cache/factory.d.ts +32 -7
- package/dist/storage/cache/factory.d.ts.map +1 -1
- package/dist/storage/cache/factory.js +9 -27
- package/dist/storage/cache/index.cjs +53 -0
- package/dist/storage/cache/index.d.ts +44 -0
- package/dist/storage/cache/index.d.ts.map +1 -0
- package/dist/storage/cache/index.js +28 -0
- package/dist/storage/cache/memory-cache-store.js +1 -1
- package/dist/storage/cache/provider.cjs +16 -0
- package/dist/storage/cache/provider.d.ts +56 -0
- package/dist/storage/cache/provider.d.ts.map +1 -0
- package/dist/storage/cache/provider.js +0 -0
- package/dist/storage/cache/providers/index.cjs +31 -0
- package/dist/storage/cache/providers/index.d.ts +8 -0
- package/dist/storage/cache/providers/index.d.ts.map +1 -0
- package/dist/storage/cache/providers/index.js +7 -0
- package/dist/storage/cache/providers/memory.cjs +40 -0
- package/dist/storage/cache/providers/memory.d.ts +17 -0
- package/dist/storage/cache/providers/memory.d.ts.map +1 -0
- package/dist/storage/cache/providers/memory.js +17 -0
- package/dist/storage/cache/providers/redis.cjs +66 -0
- package/dist/storage/cache/providers/redis.d.ts +20 -0
- package/dist/storage/cache/providers/redis.d.ts.map +1 -0
- package/dist/storage/cache/providers/redis.js +33 -0
- package/dist/storage/cache/redis-store.js +1 -1
- package/dist/{llm/tokenizer/google.cjs → storage/cache/registry.cjs} +23 -25
- package/dist/storage/cache/registry.d.ts +42 -0
- package/dist/storage/cache/registry.d.ts.map +1 -0
- package/dist/storage/cache/registry.js +26 -0
- package/dist/storage/cache/schemas.cjs +6 -2
- package/dist/storage/cache/schemas.d.ts +2 -3
- package/dist/storage/cache/schemas.d.ts.map +1 -1
- package/dist/storage/cache/schemas.js +4 -2
- package/dist/storage/database/factory.cjs +8 -47
- package/dist/storage/database/factory.d.ts +34 -8
- package/dist/storage/database/factory.d.ts.map +1 -1
- package/dist/storage/database/factory.js +9 -38
- package/dist/storage/database/index.cjs +58 -0
- package/dist/storage/database/index.d.ts +45 -0
- package/dist/storage/database/index.d.ts.map +1 -0
- package/dist/storage/database/index.js +37 -0
- package/dist/storage/database/memory-database-store.js +1 -1
- package/dist/storage/database/postgres-store.cjs +12 -0
- package/dist/storage/database/postgres-store.d.ts.map +1 -1
- package/dist/storage/database/postgres-store.js +13 -1
- package/dist/storage/database/provider.cjs +16 -0
- package/dist/storage/database/provider.d.ts +56 -0
- package/dist/storage/database/provider.d.ts.map +1 -0
- package/dist/storage/database/provider.js +0 -0
- package/dist/storage/database/providers/index.cjs +34 -0
- package/dist/storage/database/providers/index.d.ts +9 -0
- package/dist/storage/database/providers/index.d.ts.map +1 -0
- package/dist/storage/database/providers/index.js +9 -0
- package/dist/storage/database/providers/memory.cjs +40 -0
- package/dist/storage/database/providers/memory.d.ts +16 -0
- package/dist/storage/database/providers/memory.d.ts.map +1 -0
- package/dist/storage/database/providers/memory.js +17 -0
- package/dist/storage/database/providers/postgres.cjs +62 -0
- package/dist/storage/database/providers/postgres.d.ts +19 -0
- package/dist/storage/database/providers/postgres.d.ts.map +1 -0
- package/dist/storage/database/providers/postgres.js +29 -0
- package/dist/storage/database/providers/sqlite.cjs +66 -0
- package/dist/storage/database/providers/sqlite.d.ts +20 -0
- package/dist/storage/database/providers/sqlite.d.ts.map +1 -0
- package/dist/storage/database/providers/sqlite.js +33 -0
- package/dist/storage/database/registry.cjs +50 -0
- package/dist/storage/database/registry.d.ts +42 -0
- package/dist/storage/database/registry.d.ts.map +1 -0
- package/dist/storage/database/registry.js +26 -0
- package/dist/storage/database/schemas.cjs +8 -2
- package/dist/storage/database/schemas.d.ts +3 -4
- package/dist/storage/database/schemas.d.ts.map +1 -1
- package/dist/storage/database/schemas.js +5 -2
- package/dist/storage/database/sqlite-store.js +1 -1
- package/dist/storage/error-codes.cjs +6 -0
- package/dist/storage/error-codes.d.ts +7 -1
- package/dist/storage/error-codes.d.ts.map +1 -1
- package/dist/storage/error-codes.js +7 -1
- package/dist/storage/errors.cjs +80 -0
- package/dist/storage/errors.d.ts +24 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +81 -1
- package/dist/storage/index.cjs +47 -4
- package/dist/storage/index.d.ts +34 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +33 -4
- package/dist/storage/schemas.cjs +4 -0
- package/dist/storage/schemas.d.ts +17 -50
- package/dist/storage/schemas.d.ts.map +1 -1
- package/dist/storage/schemas.js +6 -2
- package/dist/storage/storage-manager.cjs +6 -6
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +4 -4
- package/dist/systemPrompt/contributors.js +1 -1
- package/dist/systemPrompt/error-codes.js +1 -1
- package/dist/systemPrompt/errors.js +1 -1
- package/dist/systemPrompt/in-built-prompts.cjs +7 -6
- package/dist/systemPrompt/in-built-prompts.d.ts +2 -2
- package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
- package/dist/systemPrompt/in-built-prompts.js +7 -6
- package/dist/systemPrompt/index.js +1 -1
- package/dist/systemPrompt/manager.js +1 -1
- package/dist/systemPrompt/registry.cjs +2 -2
- package/dist/systemPrompt/registry.d.ts +1 -1
- package/dist/systemPrompt/registry.d.ts.map +1 -1
- package/dist/systemPrompt/registry.js +3 -3
- package/dist/systemPrompt/schemas.cjs +2 -2
- package/dist/systemPrompt/schemas.d.ts +18 -18
- package/dist/systemPrompt/schemas.js +3 -3
- package/dist/telemetry/decorators.js +1 -1
- package/dist/telemetry/error-codes.js +1 -1
- package/dist/telemetry/errors.js +1 -1
- package/dist/telemetry/exporters.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/schemas.js +1 -1
- package/dist/telemetry/telemetry.js +1 -1
- package/dist/telemetry/utils.js +1 -1
- package/dist/tools/bash-pattern-utils.cjs +91 -0
- package/dist/tools/bash-pattern-utils.d.ts +58 -0
- package/dist/tools/bash-pattern-utils.d.ts.map +1 -0
- package/dist/tools/bash-pattern-utils.js +64 -0
- package/dist/tools/confirmation/allowed-tools-provider/factory.js +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.js +1 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.js +1 -1
- package/dist/tools/custom-tool-registry.cjs +64 -0
- package/dist/tools/custom-tool-registry.d.ts +120 -0
- package/dist/tools/custom-tool-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-registry.js +40 -0
- package/dist/tools/custom-tool-schema-registry.cjs +164 -0
- package/dist/tools/custom-tool-schema-registry.d.ts +86 -0
- package/dist/tools/custom-tool-schema-registry.d.ts.map +1 -0
- package/dist/tools/custom-tool-schema-registry.js +140 -0
- package/dist/tools/display-types.cjs +60 -0
- package/dist/tools/display-types.d.ts +133 -0
- package/dist/tools/display-types.d.ts.map +1 -0
- package/dist/tools/display-types.js +32 -0
- package/dist/tools/error-codes.cjs +5 -0
- package/dist/tools/error-codes.d.ts +6 -1
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +6 -1
- package/dist/tools/errors.cjs +71 -0
- package/dist/tools/errors.d.ts +33 -0
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +72 -1
- package/dist/tools/index.cjs +15 -1
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +13 -2
- package/dist/tools/internal-tools/constants.cjs +3 -9
- package/dist/tools/internal-tools/constants.d.ts +1 -1
- package/dist/tools/internal-tools/constants.d.ts.map +1 -1
- package/dist/tools/internal-tools/constants.js +4 -10
- package/dist/tools/internal-tools/implementations/ask-user-tool.cjs +1 -1
- package/dist/tools/internal-tools/implementations/ask-user-tool.js +2 -2
- package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +1 -1
- package/dist/tools/internal-tools/implementations/get-resource-tool.cjs +113 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts +30 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/get-resource-tool.js +90 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.cjs +91 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts +24 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.d.ts.map +1 -0
- package/dist/tools/internal-tools/implementations/list-resources-tool.js +68 -0
- package/dist/tools/internal-tools/implementations/search-history-tool.js +1 -1
- package/dist/tools/internal-tools/provider.cjs +175 -31
- package/dist/tools/internal-tools/provider.d.ts +62 -14
- package/dist/tools/internal-tools/provider.d.ts.map +1 -1
- package/dist/tools/internal-tools/provider.js +176 -32
- package/dist/tools/internal-tools/registry.cjs +19 -43
- package/dist/tools/internal-tools/registry.d.ts +32 -11
- package/dist/tools/internal-tools/registry.d.ts.map +1 -1
- package/dist/tools/internal-tools/registry.js +20 -44
- package/dist/tools/schemas.cjs +36 -6
- package/dist/tools/schemas.d.ts +74 -5
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +30 -6
- package/dist/tools/tool-manager.cjs +279 -30
- package/dist/tools/tool-manager.d.ts +45 -4
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +284 -31
- package/dist/tools/types.d.ts +63 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.cjs +19 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +20 -2
- package/dist/utils/async-context.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/{llm/tokenizer/anthropic.cjs → utils/defer.cjs} +19 -20
- package/dist/utils/defer.d.ts +63 -0
- package/dist/utils/defer.d.ts.map +1 -0
- package/dist/utils/defer.js +19 -0
- package/dist/utils/error-conversion.js +1 -1
- package/dist/utils/execution-context.js +1 -1
- package/dist/utils/fs-walk.js +1 -1
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/redactor.cjs +18 -3
- package/dist/utils/redactor.d.ts +0 -7
- package/dist/utils/redactor.d.ts.map +1 -1
- package/dist/utils/redactor.js +19 -4
- package/dist/utils/result.js +1 -1
- package/dist/utils/safe-stringify.js +1 -1
- package/dist/utils/schema-metadata.js +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/service-initializer.cjs +15 -37
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +16 -38
- package/dist/utils/user-info.js +1 -1
- package/dist/utils/zod-schema-converter.js +1 -1
- package/package.json +10 -8
- package/dist/context/compression/middle-removal.cjs +0 -95
- package/dist/context/compression/middle-removal.d.ts +0 -47
- package/dist/context/compression/middle-removal.d.ts.map +0 -1
- package/dist/context/compression/middle-removal.js +0 -72
- package/dist/context/compression/oldest-removal.cjs +0 -83
- package/dist/context/compression/oldest-removal.d.ts +0 -42
- package/dist/context/compression/oldest-removal.d.ts.map +0 -1
- package/dist/context/compression/oldest-removal.js +0 -60
- package/dist/context/compression/types.d.ts +0 -18
- package/dist/context/compression/types.d.ts.map +0 -1
- package/dist/llm/formatters/anthropic.cjs +0 -257
- package/dist/llm/formatters/anthropic.d.ts +0 -46
- package/dist/llm/formatters/anthropic.d.ts.map +0 -1
- package/dist/llm/formatters/anthropic.js +0 -239
- package/dist/llm/formatters/factory.cjs +0 -50
- package/dist/llm/formatters/factory.d.ts +0 -10
- package/dist/llm/formatters/factory.d.ts.map +0 -1
- package/dist/llm/formatters/factory.js +0 -27
- package/dist/llm/formatters/openai.cjs +0 -203
- package/dist/llm/formatters/openai.d.ts +0 -39
- package/dist/llm/formatters/openai.d.ts.map +0 -1
- package/dist/llm/formatters/openai.js +0 -184
- package/dist/llm/formatters/types.d.ts +0 -41
- package/dist/llm/formatters/types.d.ts.map +0 -1
- package/dist/llm/services/anthropic.cjs +0 -511
- package/dist/llm/services/anthropic.d.ts +0 -48
- package/dist/llm/services/anthropic.d.ts.map +0 -1
- package/dist/llm/services/anthropic.js +0 -447
- package/dist/llm/services/openai.cjs +0 -611
- package/dist/llm/services/openai.d.ts +0 -48
- package/dist/llm/services/openai.d.ts.map +0 -1
- package/dist/llm/services/openai.js +0 -547
- package/dist/llm/tokenizer/anthropic.d.ts +0 -19
- package/dist/llm/tokenizer/anthropic.d.ts.map +0 -1
- package/dist/llm/tokenizer/anthropic.js +0 -20
- package/dist/llm/tokenizer/default.d.ts +0 -14
- package/dist/llm/tokenizer/default.d.ts.map +0 -1
- package/dist/llm/tokenizer/default.js +0 -18
- package/dist/llm/tokenizer/factory.d.ts +0 -12
- package/dist/llm/tokenizer/factory.d.ts.map +0 -1
- package/dist/llm/tokenizer/factory.js +0 -21
- package/dist/llm/tokenizer/google.d.ts +0 -29
- package/dist/llm/tokenizer/google.d.ts.map +0 -1
- package/dist/llm/tokenizer/google.js +0 -29
- package/dist/llm/tokenizer/openai.cjs +0 -115
- package/dist/llm/tokenizer/openai.d.ts +0 -41
- package/dist/llm/tokenizer/openai.d.ts.map +0 -1
- package/dist/llm/tokenizer/openai.js +0 -91
- package/dist/llm/tokenizer/types.d.ts +0 -18
- package/dist/llm/tokenizer/types.d.ts.map +0 -1
- package/dist/llm/tokenizer/types.js +0 -10
- package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +0 -106
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts +0 -13
- package/dist/tools/internal-tools/implementations/bash-exec-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-exec-tool.js +0 -73
- package/dist/tools/internal-tools/implementations/bash-output-tool.cjs +0 -49
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/bash-output-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/bash-output-tool.js +0 -26
- package/dist/tools/internal-tools/implementations/edit-file-tool.cjs +0 -62
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/edit-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/edit-file-tool.js +0 -39
- package/dist/tools/internal-tools/implementations/glob-files-tool.cjs +0 -57
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/glob-files-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/glob-files-tool.js +0 -34
- package/dist/tools/internal-tools/implementations/grep-content-tool.cjs +0 -71
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/grep-content-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/grep-content-tool.js +0 -48
- package/dist/tools/internal-tools/implementations/kill-process-tool.cjs +0 -47
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/kill-process-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/kill-process-tool.js +0 -24
- package/dist/tools/internal-tools/implementations/read-file-tool.cjs +0 -55
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/read-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/read-file-tool.js +0 -32
- package/dist/tools/internal-tools/implementations/write-file-tool.cjs +0 -56
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts +0 -12
- package/dist/tools/internal-tools/implementations/write-file-tool.d.ts.map +0 -1
- package/dist/tools/internal-tools/implementations/write-file-tool.js +0 -33
- package/dist/utils/env-file.cjs +0 -118
- package/dist/utils/env-file.d.ts +0 -5
- package/dist/utils/env-file.d.ts.map +0 -1
- package/dist/utils/env-file.js +0 -85
- /package/dist/context/{compression/types.js → compaction/provider.js} +0 -0
- /package/dist/context/{compression → compaction}/types.cjs +0 -0
- /package/dist/{llm/formatters → context/compaction}/types.js +0 -0
- /package/dist/{llm/formatters → image}/types.cjs +0 -0
|
@@ -1,62 +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 edit_file_tool_exports = {};
|
|
20
|
-
__export(edit_file_tool_exports, {
|
|
21
|
-
createEditFileTool: () => createEditFileTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(edit_file_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const EditFileInputSchema = import_zod.z.object({
|
|
26
|
-
file_path: import_zod.z.string().describe("Absolute path to the file to edit"),
|
|
27
|
-
old_string: import_zod.z.string().describe("Text to replace (must be unique unless replace_all is true)"),
|
|
28
|
-
new_string: import_zod.z.string().describe("Replacement text"),
|
|
29
|
-
replace_all: import_zod.z.boolean().optional().default(false).describe("Replace all occurrences (default: false, requires unique match)")
|
|
30
|
-
}).strict();
|
|
31
|
-
function createEditFileTool(fileSystemService) {
|
|
32
|
-
return {
|
|
33
|
-
id: "edit_file",
|
|
34
|
-
description: "Edit a file by replacing text. By default, old_string must be unique in the file (will error if found multiple times). Set replace_all=true to replace all occurrences. Automatically creates backup before editing. Requires approval. Returns success status, path, number of changes made, and backup path.",
|
|
35
|
-
inputSchema: EditFileInputSchema,
|
|
36
|
-
execute: async (input, _context) => {
|
|
37
|
-
const { file_path, old_string, new_string, replace_all } = input;
|
|
38
|
-
const result = await fileSystemService.editFile(
|
|
39
|
-
file_path,
|
|
40
|
-
{
|
|
41
|
-
oldString: old_string,
|
|
42
|
-
newString: new_string,
|
|
43
|
-
replaceAll: replace_all
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
backup: true
|
|
47
|
-
// Always create backup for internal tools
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
return {
|
|
51
|
-
success: result.success,
|
|
52
|
-
path: result.path,
|
|
53
|
-
changes_count: result.changesCount,
|
|
54
|
-
...result.backupPath && { backup_path: result.backupPath }
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
-
0 && (module.exports = {
|
|
61
|
-
createEditFileTool
|
|
62
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edit File Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for editing files by replacing text (requires approval)
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { FileSystemService } from '../../../filesystem/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the edit_file internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createEditFileTool(fileSystemService: FileSystemService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=edit-file-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-file-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/edit-file-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAmBjE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,YAAY,CA+BrF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const EditFileInputSchema = z.object({
|
|
4
|
-
file_path: z.string().describe("Absolute path to the file to edit"),
|
|
5
|
-
old_string: z.string().describe("Text to replace (must be unique unless replace_all is true)"),
|
|
6
|
-
new_string: z.string().describe("Replacement text"),
|
|
7
|
-
replace_all: z.boolean().optional().default(false).describe("Replace all occurrences (default: false, requires unique match)")
|
|
8
|
-
}).strict();
|
|
9
|
-
function createEditFileTool(fileSystemService) {
|
|
10
|
-
return {
|
|
11
|
-
id: "edit_file",
|
|
12
|
-
description: "Edit a file by replacing text. By default, old_string must be unique in the file (will error if found multiple times). Set replace_all=true to replace all occurrences. Automatically creates backup before editing. Requires approval. Returns success status, path, number of changes made, and backup path.",
|
|
13
|
-
inputSchema: EditFileInputSchema,
|
|
14
|
-
execute: async (input, _context) => {
|
|
15
|
-
const { file_path, old_string, new_string, replace_all } = input;
|
|
16
|
-
const result = await fileSystemService.editFile(
|
|
17
|
-
file_path,
|
|
18
|
-
{
|
|
19
|
-
oldString: old_string,
|
|
20
|
-
newString: new_string,
|
|
21
|
-
replaceAll: replace_all
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
backup: true
|
|
25
|
-
// Always create backup for internal tools
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
return {
|
|
29
|
-
success: result.success,
|
|
30
|
-
path: result.path,
|
|
31
|
-
changes_count: result.changesCount,
|
|
32
|
-
...result.backupPath && { backup_path: result.backupPath }
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
createEditFileTool
|
|
39
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var glob_files_tool_exports = {};
|
|
20
|
-
__export(glob_files_tool_exports, {
|
|
21
|
-
createGlobFilesTool: () => createGlobFilesTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(glob_files_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const GlobFilesInputSchema = import_zod.z.object({
|
|
26
|
-
pattern: import_zod.z.string().describe('Glob pattern to match files (e.g., "**/*.ts", "src/**/*.js")'),
|
|
27
|
-
path: import_zod.z.string().optional().describe("Base directory to search from (defaults to working directory)"),
|
|
28
|
-
max_results: import_zod.z.number().int().positive().optional().default(1e3).describe("Maximum number of results to return (default: 1000)")
|
|
29
|
-
}).strict();
|
|
30
|
-
function createGlobFilesTool(fileSystemService) {
|
|
31
|
-
return {
|
|
32
|
-
id: "glob_files",
|
|
33
|
-
description: "Find files matching a glob pattern. Supports standard glob syntax like **/*.js for recursive matches, *.ts for files in current directory, and src/**/*.tsx for nested paths. Returns array of file paths with metadata (size, modified date). Results are limited to allowed paths only.",
|
|
34
|
-
inputSchema: GlobFilesInputSchema,
|
|
35
|
-
execute: async (input, _context) => {
|
|
36
|
-
const { pattern, path, max_results } = input;
|
|
37
|
-
const result = await fileSystemService.globFiles(pattern, {
|
|
38
|
-
cwd: path,
|
|
39
|
-
maxResults: max_results,
|
|
40
|
-
includeMetadata: true
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
files: result.files.map((file) => ({
|
|
44
|
-
path: file.path,
|
|
45
|
-
size: file.size,
|
|
46
|
-
modified: file.modified.toISOString()
|
|
47
|
-
})),
|
|
48
|
-
total_found: result.totalFound,
|
|
49
|
-
truncated: result.truncated
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
createGlobFilesTool
|
|
57
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Glob Files Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for finding files using glob patterns
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { FileSystemService } from '../../../filesystem/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the glob_files internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createGlobFilesTool(fileSystemService: FileSystemService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=glob-files-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob-files-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/glob-files-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAuBjE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,YAAY,CA4BtF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const GlobFilesInputSchema = z.object({
|
|
4
|
-
pattern: z.string().describe('Glob pattern to match files (e.g., "**/*.ts", "src/**/*.js")'),
|
|
5
|
-
path: z.string().optional().describe("Base directory to search from (defaults to working directory)"),
|
|
6
|
-
max_results: z.number().int().positive().optional().default(1e3).describe("Maximum number of results to return (default: 1000)")
|
|
7
|
-
}).strict();
|
|
8
|
-
function createGlobFilesTool(fileSystemService) {
|
|
9
|
-
return {
|
|
10
|
-
id: "glob_files",
|
|
11
|
-
description: "Find files matching a glob pattern. Supports standard glob syntax like **/*.js for recursive matches, *.ts for files in current directory, and src/**/*.tsx for nested paths. Returns array of file paths with metadata (size, modified date). Results are limited to allowed paths only.",
|
|
12
|
-
inputSchema: GlobFilesInputSchema,
|
|
13
|
-
execute: async (input, _context) => {
|
|
14
|
-
const { pattern, path, max_results } = input;
|
|
15
|
-
const result = await fileSystemService.globFiles(pattern, {
|
|
16
|
-
cwd: path,
|
|
17
|
-
maxResults: max_results,
|
|
18
|
-
includeMetadata: true
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
files: result.files.map((file) => ({
|
|
22
|
-
path: file.path,
|
|
23
|
-
size: file.size,
|
|
24
|
-
modified: file.modified.toISOString()
|
|
25
|
-
})),
|
|
26
|
-
total_found: result.totalFound,
|
|
27
|
-
truncated: result.truncated
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
createGlobFilesTool
|
|
34
|
-
};
|
|
@@ -1,71 +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 grep_content_tool_exports = {};
|
|
20
|
-
__export(grep_content_tool_exports, {
|
|
21
|
-
createGrepContentTool: () => createGrepContentTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(grep_content_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const GrepContentInputSchema = import_zod.z.object({
|
|
26
|
-
pattern: import_zod.z.string().describe("Regular expression pattern to search for"),
|
|
27
|
-
path: import_zod.z.string().optional().describe("Directory to search in (defaults to working directory)"),
|
|
28
|
-
glob: import_zod.z.string().optional().describe('Glob pattern to filter files (e.g., "*.ts", "**/*.js")'),
|
|
29
|
-
context_lines: import_zod.z.number().int().min(0).optional().default(0).describe(
|
|
30
|
-
"Number of context lines to include before and after each match (default: 0)"
|
|
31
|
-
),
|
|
32
|
-
case_insensitive: import_zod.z.boolean().optional().default(false).describe("Perform case-insensitive search (default: false)"),
|
|
33
|
-
max_results: import_zod.z.number().int().positive().optional().default(100).describe("Maximum number of results to return (default: 100)")
|
|
34
|
-
}).strict();
|
|
35
|
-
function createGrepContentTool(fileSystemService) {
|
|
36
|
-
return {
|
|
37
|
-
id: "grep_content",
|
|
38
|
-
description: 'Search for text patterns in files using regular expressions. Returns matching lines with file path, line number, and optional context lines. Use glob parameter to filter specific file types (e.g., "*.ts"). Supports case-insensitive search. Great for finding code patterns, function definitions, or specific text across multiple files.',
|
|
39
|
-
inputSchema: GrepContentInputSchema,
|
|
40
|
-
execute: async (input, _context) => {
|
|
41
|
-
const { pattern, path, glob, context_lines, case_insensitive, max_results } = input;
|
|
42
|
-
const result = await fileSystemService.searchContent(pattern, {
|
|
43
|
-
path,
|
|
44
|
-
glob,
|
|
45
|
-
contextLines: context_lines,
|
|
46
|
-
caseInsensitive: case_insensitive,
|
|
47
|
-
maxResults: max_results
|
|
48
|
-
});
|
|
49
|
-
return {
|
|
50
|
-
matches: result.matches.map((match) => ({
|
|
51
|
-
file: match.file,
|
|
52
|
-
line_number: match.lineNumber,
|
|
53
|
-
line: match.line,
|
|
54
|
-
...match.context && {
|
|
55
|
-
context: {
|
|
56
|
-
before: match.context.before,
|
|
57
|
-
after: match.context.after
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
})),
|
|
61
|
-
total_matches: result.totalMatches,
|
|
62
|
-
files_searched: result.filesSearched,
|
|
63
|
-
truncated: result.truncated
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
-
0 && (module.exports = {
|
|
70
|
-
createGrepContentTool
|
|
71
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grep Content Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for searching file contents using regex patterns
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { FileSystemService } from '../../../filesystem/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the grep_content internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createGrepContentTool(fileSystemService: FileSystemService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=grep-content-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grep-content-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/grep-content-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAuCjE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,YAAY,CAsCxF"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const GrepContentInputSchema = z.object({
|
|
4
|
-
pattern: z.string().describe("Regular expression pattern to search for"),
|
|
5
|
-
path: z.string().optional().describe("Directory to search in (defaults to working directory)"),
|
|
6
|
-
glob: z.string().optional().describe('Glob pattern to filter files (e.g., "*.ts", "**/*.js")'),
|
|
7
|
-
context_lines: z.number().int().min(0).optional().default(0).describe(
|
|
8
|
-
"Number of context lines to include before and after each match (default: 0)"
|
|
9
|
-
),
|
|
10
|
-
case_insensitive: z.boolean().optional().default(false).describe("Perform case-insensitive search (default: false)"),
|
|
11
|
-
max_results: z.number().int().positive().optional().default(100).describe("Maximum number of results to return (default: 100)")
|
|
12
|
-
}).strict();
|
|
13
|
-
function createGrepContentTool(fileSystemService) {
|
|
14
|
-
return {
|
|
15
|
-
id: "grep_content",
|
|
16
|
-
description: 'Search for text patterns in files using regular expressions. Returns matching lines with file path, line number, and optional context lines. Use glob parameter to filter specific file types (e.g., "*.ts"). Supports case-insensitive search. Great for finding code patterns, function definitions, or specific text across multiple files.',
|
|
17
|
-
inputSchema: GrepContentInputSchema,
|
|
18
|
-
execute: async (input, _context) => {
|
|
19
|
-
const { pattern, path, glob, context_lines, case_insensitive, max_results } = input;
|
|
20
|
-
const result = await fileSystemService.searchContent(pattern, {
|
|
21
|
-
path,
|
|
22
|
-
glob,
|
|
23
|
-
contextLines: context_lines,
|
|
24
|
-
caseInsensitive: case_insensitive,
|
|
25
|
-
maxResults: max_results
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
matches: result.matches.map((match) => ({
|
|
29
|
-
file: match.file,
|
|
30
|
-
line_number: match.lineNumber,
|
|
31
|
-
line: match.line,
|
|
32
|
-
...match.context && {
|
|
33
|
-
context: {
|
|
34
|
-
before: match.context.before,
|
|
35
|
-
after: match.context.after
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
})),
|
|
39
|
-
total_matches: result.totalMatches,
|
|
40
|
-
files_searched: result.filesSearched,
|
|
41
|
-
truncated: result.truncated
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
createGrepContentTool
|
|
48
|
-
};
|
|
@@ -1,47 +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 kill_process_tool_exports = {};
|
|
20
|
-
__export(kill_process_tool_exports, {
|
|
21
|
-
createKillProcessTool: () => createKillProcessTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(kill_process_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const KillProcessInputSchema = import_zod.z.object({
|
|
26
|
-
process_id: import_zod.z.string().describe("Process ID of the background process to terminate")
|
|
27
|
-
}).strict();
|
|
28
|
-
function createKillProcessTool(processService) {
|
|
29
|
-
return {
|
|
30
|
-
id: "kill_process",
|
|
31
|
-
description: "Terminate a background process started with bash_exec. Sends SIGTERM signal first, then SIGKILL if process doesn't terminate within 5 seconds. Only works on processes started by this agent. Returns success status and whether the process was running. Does not require additional approval (process was already approved when started).",
|
|
32
|
-
inputSchema: KillProcessInputSchema,
|
|
33
|
-
execute: async (input, _context) => {
|
|
34
|
-
const { process_id } = input;
|
|
35
|
-
await processService.killProcess(process_id);
|
|
36
|
-
return {
|
|
37
|
-
success: true,
|
|
38
|
-
process_id,
|
|
39
|
-
message: `Termination signal sent to process ${process_id}`
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
createKillProcessTool
|
|
47
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kill Process Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for terminating background processes
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { ProcessService } from '../../../process/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the kill_process internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createKillProcessTool(processService: ProcessService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=kill-process-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kill-process-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/kill-process-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,cAAc,GAAG,YAAY,CAqBlF"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const KillProcessInputSchema = z.object({
|
|
4
|
-
process_id: z.string().describe("Process ID of the background process to terminate")
|
|
5
|
-
}).strict();
|
|
6
|
-
function createKillProcessTool(processService) {
|
|
7
|
-
return {
|
|
8
|
-
id: "kill_process",
|
|
9
|
-
description: "Terminate a background process started with bash_exec. Sends SIGTERM signal first, then SIGKILL if process doesn't terminate within 5 seconds. Only works on processes started by this agent. Returns success status and whether the process was running. Does not require additional approval (process was already approved when started).",
|
|
10
|
-
inputSchema: KillProcessInputSchema,
|
|
11
|
-
execute: async (input, _context) => {
|
|
12
|
-
const { process_id } = input;
|
|
13
|
-
await processService.killProcess(process_id);
|
|
14
|
-
return {
|
|
15
|
-
success: true,
|
|
16
|
-
process_id,
|
|
17
|
-
message: `Termination signal sent to process ${process_id}`
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
createKillProcessTool
|
|
24
|
-
};
|
|
@@ -1,55 +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 read_file_tool_exports = {};
|
|
20
|
-
__export(read_file_tool_exports, {
|
|
21
|
-
createReadFileTool: () => createReadFileTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(read_file_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const ReadFileInputSchema = import_zod.z.object({
|
|
26
|
-
file_path: import_zod.z.string().describe("Absolute path to the file to read"),
|
|
27
|
-
limit: import_zod.z.number().int().positive().optional().describe("Maximum number of lines to read (optional)"),
|
|
28
|
-
offset: import_zod.z.number().int().min(1).optional().describe("Starting line number (1-based, optional)")
|
|
29
|
-
}).strict();
|
|
30
|
-
function createReadFileTool(fileSystemService) {
|
|
31
|
-
return {
|
|
32
|
-
id: "read_file",
|
|
33
|
-
description: "Read the contents of a file with optional pagination. Returns file content, line count, encoding, and whether the output was truncated. Use limit and offset parameters for large files to read specific sections. This tool is for reading files within allowed paths only.",
|
|
34
|
-
inputSchema: ReadFileInputSchema,
|
|
35
|
-
execute: async (input, _context) => {
|
|
36
|
-
const { file_path, limit, offset } = input;
|
|
37
|
-
const result = await fileSystemService.readFile(file_path, {
|
|
38
|
-
limit,
|
|
39
|
-
offset
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
content: result.content,
|
|
43
|
-
lines: result.lines,
|
|
44
|
-
encoding: result.encoding,
|
|
45
|
-
truncated: result.truncated,
|
|
46
|
-
size: result.size,
|
|
47
|
-
...result.mimeType && { mimeType: result.mimeType }
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
createReadFileTool
|
|
55
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read File Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for reading file contents with size limits and pagination
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { FileSystemService } from '../../../filesystem/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the read_file internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createReadFileTool(fileSystemService: FileSystemService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=read-file-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-file-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/read-file-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAsBjE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,YAAY,CA0BrF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import "../../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const ReadFileInputSchema = z.object({
|
|
4
|
-
file_path: z.string().describe("Absolute path to the file to read"),
|
|
5
|
-
limit: z.number().int().positive().optional().describe("Maximum number of lines to read (optional)"),
|
|
6
|
-
offset: z.number().int().min(1).optional().describe("Starting line number (1-based, optional)")
|
|
7
|
-
}).strict();
|
|
8
|
-
function createReadFileTool(fileSystemService) {
|
|
9
|
-
return {
|
|
10
|
-
id: "read_file",
|
|
11
|
-
description: "Read the contents of a file with optional pagination. Returns file content, line count, encoding, and whether the output was truncated. Use limit and offset parameters for large files to read specific sections. This tool is for reading files within allowed paths only.",
|
|
12
|
-
inputSchema: ReadFileInputSchema,
|
|
13
|
-
execute: async (input, _context) => {
|
|
14
|
-
const { file_path, limit, offset } = input;
|
|
15
|
-
const result = await fileSystemService.readFile(file_path, {
|
|
16
|
-
limit,
|
|
17
|
-
offset
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
content: result.content,
|
|
21
|
-
lines: result.lines,
|
|
22
|
-
encoding: result.encoding,
|
|
23
|
-
truncated: result.truncated,
|
|
24
|
-
size: result.size,
|
|
25
|
-
...result.mimeType && { mimeType: result.mimeType }
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
createReadFileTool
|
|
32
|
-
};
|
|
@@ -1,56 +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 write_file_tool_exports = {};
|
|
20
|
-
__export(write_file_tool_exports, {
|
|
21
|
-
createWriteFileTool: () => createWriteFileTool
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(write_file_tool_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const WriteFileInputSchema = import_zod.z.object({
|
|
26
|
-
file_path: import_zod.z.string().describe("Absolute path where the file should be written"),
|
|
27
|
-
content: import_zod.z.string().describe("Content to write to the file"),
|
|
28
|
-
create_dirs: import_zod.z.boolean().optional().default(false).describe("Create parent directories if they don't exist (default: false)"),
|
|
29
|
-
encoding: import_zod.z.enum(["utf-8", "ascii", "latin1", "utf16le"]).optional().default("utf-8").describe("File encoding (default: utf-8)")
|
|
30
|
-
}).strict();
|
|
31
|
-
function createWriteFileTool(fileSystemService) {
|
|
32
|
-
return {
|
|
33
|
-
id: "write_file",
|
|
34
|
-
description: "Write content to a file. Creates a new file or overwrites existing file. Automatically creates backup of existing files before overwriting. Use create_dirs to create parent directories. Requires approval for all write operations. Returns success status, path, bytes written, and backup path if applicable.",
|
|
35
|
-
inputSchema: WriteFileInputSchema,
|
|
36
|
-
execute: async (input, _context) => {
|
|
37
|
-
const { file_path, content, create_dirs, encoding } = input;
|
|
38
|
-
const result = await fileSystemService.writeFile(file_path, content, {
|
|
39
|
-
createDirs: create_dirs,
|
|
40
|
-
encoding,
|
|
41
|
-
backup: true
|
|
42
|
-
// Always create backup for internal tools
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
success: result.success,
|
|
46
|
-
path: result.path,
|
|
47
|
-
bytes_written: result.bytesWritten,
|
|
48
|
-
...result.backupPath && { backup_path: result.backupPath }
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
createWriteFileTool
|
|
56
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Write File Tool
|
|
3
|
-
*
|
|
4
|
-
* Internal tool for writing content to files (requires approval)
|
|
5
|
-
*/
|
|
6
|
-
import { InternalTool } from '../../types.js';
|
|
7
|
-
import { FileSystemService } from '../../../filesystem/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* Create the write_file internal tool
|
|
10
|
-
*/
|
|
11
|
-
export declare function createWriteFileTool(fileSystemService: FileSystemService): InternalTool;
|
|
12
|
-
//# sourceMappingURL=write-file-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-file-tool.d.ts","sourceRoot":"","sources":["../../../../src/tools/internal-tools/implementations/write-file-tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAkB,MAAM,8BAA8B,CAAC;AAqBjF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,YAAY,CAyBtF"}
|