@dexto/core 1.7.2 → 1.8.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/dist/agent/DextoAgent.cjs +163 -77
- package/dist/agent/DextoAgent.d.ts +73 -19
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +165 -67
- package/dist/agent/agent-options.d.ts +6 -10
- package/dist/agent/agent-options.d.ts.map +1 -1
- package/dist/agent/agentCard.js +1 -1
- package/dist/agent/error-codes.js +1 -1
- package/dist/agent/errors.js +1 -1
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/schemas.d.ts +2 -2
- package/dist/agent/schemas.js +1 -1
- package/dist/agent/state-manager.js +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.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 +2 -2
- package/dist/approval/errors.cjs +2 -5
- package/dist/approval/errors.d.ts.map +1 -1
- package/dist/approval/errors.js +3 -6
- package/dist/approval/factory.cjs +19 -4
- package/dist/approval/factory.d.ts +4 -1
- package/dist/approval/factory.d.ts.map +1 -1
- package/dist/approval/factory.js +19 -5
- package/dist/approval/index.d.ts +1 -1
- package/dist/approval/index.d.ts.map +1 -1
- package/dist/approval/index.js +1 -1
- package/dist/approval/manager.cjs +168 -26
- package/dist/approval/manager.d.ts +46 -12
- package/dist/approval/manager.d.ts.map +1 -1
- package/dist/approval/manager.js +177 -29
- package/dist/approval/schemas.cjs +26 -26
- package/dist/approval/schemas.d.ts +29 -29
- package/dist/approval/schemas.d.ts.map +1 -1
- package/dist/approval/schemas.js +23 -23
- package/dist/approval/types.cjs +5 -5
- package/dist/approval/types.d.ts +18 -18
- package/dist/approval/types.d.ts.map +1 -1
- package/dist/approval/types.js +6 -6
- package/dist/{chunk-PTJYTZNU.js → chunk-C6A6W6XS.js} +1 -44
- package/dist/config/index.cjs +75 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +50 -0
- package/dist/context/compaction/overflow.d.ts +1 -1
- package/dist/context/compaction/overflow.d.ts.map +1 -1
- package/dist/context/compaction/overflow.js +1 -1
- package/dist/context/compaction/strategies/noop.js +1 -1
- package/dist/context/compaction/strategies/reactive-overflow-compaction.js +1 -1
- package/dist/context/content-clone.cjs +131 -0
- package/dist/context/content-clone.d.ts +7 -0
- package/dist/context/content-clone.d.ts.map +1 -0
- package/dist/context/content-clone.js +104 -0
- package/dist/context/error-codes.js +1 -1
- package/dist/context/errors.js +1 -1
- package/dist/context/index.cjs +2 -0
- 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 +52 -41
- package/dist/context/manager.d.ts +8 -8
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +46 -35
- package/dist/context/media-helpers.js +1 -1
- package/dist/context/schemas.cjs +77 -0
- package/dist/context/schemas.d.ts +5 -0
- package/dist/context/schemas.d.ts.map +1 -0
- package/dist/context/schemas.js +53 -0
- package/dist/context/types.d.ts +1 -1
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +1 -1
- package/dist/context/utils.cjs +73 -72
- package/dist/context/utils.d.ts +4 -4
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +72 -71
- 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.js +1 -1
- package/dist/errors/types.js +1 -1
- package/dist/events/index.cjs +9 -1
- package/dist/events/index.d.ts +22 -10
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +10 -2
- package/dist/hooks/builtins/content-policy.js +1 -1
- package/dist/hooks/builtins/response-sanitizer.js +1 -1
- package/dist/hooks/error-codes.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/manager.cjs +1 -1
- package/dist/hooks/manager.d.ts +2 -2
- package/dist/hooks/manager.d.ts.map +1 -1
- package/dist/hooks/manager.js +2 -2
- package/dist/hooks/types.d.ts +2 -2
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.browser.cjs +9 -9
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/llm/curation-config.cjs +3 -3
- package/dist/llm/curation-config.d.ts +1 -1
- package/dist/llm/curation-config.js +4 -4
- package/dist/llm/curation.cjs +2 -2
- package/dist/llm/curation.d.ts +2 -2
- package/dist/llm/curation.d.ts.map +1 -1
- package/dist/llm/curation.js +2 -2
- package/dist/llm/error-codes.js +1 -1
- package/dist/llm/errors.cjs +3 -3
- package/dist/llm/errors.d.ts +1 -1
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +2 -2
- package/dist/llm/{reasoning/anthropic-betas.cjs → executor/index.cjs} +10 -9
- package/dist/llm/executor/index.d.ts +2 -0
- package/dist/llm/executor/index.d.ts.map +1 -0
- package/dist/llm/executor/index.js +11 -0
- package/dist/llm/executor/provider-options.cjs +22 -25
- package/dist/llm/executor/provider-options.d.ts +1 -1
- package/dist/llm/executor/provider-options.d.ts.map +1 -1
- package/dist/llm/executor/provider-options.js +18 -17
- package/dist/llm/executor/stream-processor.cjs +28 -139
- package/dist/llm/executor/stream-processor.d.ts +3 -14
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/stream-processor.js +29 -140
- package/dist/llm/{reasoning/profiles/openai.cjs → executor/tool-definitions.cjs} +22 -18
- package/dist/llm/executor/tool-definitions.d.ts +4 -0
- package/dist/llm/executor/tool-definitions.d.ts.map +1 -0
- package/dist/llm/executor/tool-definitions.js +22 -0
- package/dist/llm/executor/tool-output-truncator.js +1 -1
- package/dist/llm/executor/turn-executor.cjs +1093 -458
- package/dist/llm/executor/turn-executor.d.ts +269 -43
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.js +1079 -405
- package/dist/llm/executor/types.d.ts +7 -1
- package/dist/llm/executor/types.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.cjs +2 -2
- package/dist/llm/formatters/vercel.d.ts +1 -1
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.js +1 -1
- package/dist/llm/index.cjs +2 -4
- package/dist/llm/index.d.ts +1 -2
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +2 -3
- package/dist/llm/providers/codex-app-server.cjs +22 -2
- package/dist/llm/providers/codex-app-server.d.ts.map +1 -1
- package/dist/llm/providers/codex-app-server.js +23 -3
- package/dist/llm/providers/codex-base-url.js +1 -1
- package/dist/llm/providers/local/ai-sdk-adapter.js +1 -1
- package/dist/llm/providers/local/downloader.js +1 -1
- package/dist/llm/providers/local/error-codes.js +1 -1
- package/dist/llm/providers/local/errors.js +1 -1
- package/dist/llm/providers/local/gpu-detector.js +1 -1
- package/dist/llm/providers/local/index.js +1 -1
- package/dist/llm/providers/local/node-llama-provider.js +1 -1
- package/dist/llm/providers/local/ollama-provider.js +1 -1
- package/dist/llm/providers/local/registry.js +1 -1
- package/dist/llm/providers/local/schemas.js +1 -1
- package/dist/llm/providers/openrouter-model-registry.js +1 -1
- package/dist/llm/registry/auto-update.cjs +5 -5
- package/dist/llm/registry/auto-update.d.ts.map +1 -1
- package/dist/llm/registry/auto-update.js +3 -3
- package/dist/llm/registry/index.cjs +96 -789
- package/dist/llm/registry/index.d.ts +4 -323
- package/dist/llm/registry/index.d.ts.map +1 -1
- package/dist/llm/registry/index.js +100 -763
- package/dist/llm/registry/sync.d.ts +2 -2
- package/dist/llm/registry/sync.d.ts.map +1 -1
- package/dist/llm/registry/sync.js +1 -1
- package/dist/llm/resolver.cjs +7 -6
- package/dist/llm/resolver.d.ts +1 -1
- package/dist/llm/resolver.js +5 -5
- package/dist/llm/schemas.cjs +14 -14
- package/dist/llm/schemas.d.ts +1 -1
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +6 -5
- package/dist/llm/services/factory.cjs +13 -15
- package/dist/llm/services/factory.d.ts +3 -3
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +16 -16
- package/dist/llm/services/types.d.ts +11 -2
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/services/vercel.cjs +23 -8
- package/dist/llm/services/vercel.d.ts +11 -7
- package/dist/llm/services/vercel.d.ts.map +1 -1
- package/dist/llm/services/vercel.js +24 -9
- package/dist/llm/usage-metadata.cjs +23 -6
- package/dist/llm/usage-metadata.d.ts +3 -2
- package/dist/llm/usage-metadata.d.ts.map +1 -1
- package/dist/llm/usage-metadata.js +20 -7
- package/dist/llm/usage-scope.js +1 -1
- package/dist/llm/usage-summary.d.ts +1 -1
- package/dist/llm/usage-summary.js +1 -1
- package/dist/llm/validation.cjs +4 -4
- package/dist/llm/validation.d.ts +1 -1
- package/dist/llm/validation.js +2 -2
- package/dist/logger/browser.js +1 -1
- package/dist/logger/default-logger-factory.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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/logger/v2/transports/silent-transport.js +1 -1
- package/dist/logger/v2/types.js +1 -1
- package/dist/mcp/bundled-config.js +1 -1
- package/dist/mcp/error-codes.js +1 -1
- package/dist/mcp/errors.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/manager.js +1 -1
- package/dist/mcp/mcp-client.js +1 -1
- package/dist/mcp/resolver.js +1 -1
- package/dist/mcp/schemas.js +1 -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.cjs +7 -27
- package/dist/memory/manager.d.ts +4 -12
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +8 -28
- package/dist/memory/schemas.js +1 -1
- package/dist/prompts/error-codes.js +1 -1
- package/dist/prompts/errors.js +1 -1
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/name-validation.js +1 -1
- package/dist/prompts/prompt-manager.cjs +9 -38
- package/dist/prompts/prompt-manager.d.ts +2 -10
- package/dist/prompts/prompt-manager.d.ts.map +1 -1
- package/dist/prompts/prompt-manager.js +10 -39
- package/dist/prompts/providers/config-prompt-provider.cjs +8 -87
- package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/config-prompt-provider.js +9 -88
- package/dist/prompts/providers/custom-prompt-provider.cjs +21 -22
- package/dist/prompts/providers/custom-prompt-provider.d.ts +19 -4
- package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
- package/dist/prompts/providers/custom-prompt-provider.js +22 -23
- package/dist/prompts/providers/mcp-prompt-provider.js +1 -1
- package/dist/prompts/schemas.cjs +2 -24
- package/dist/prompts/schemas.d.ts +0 -52
- package/dist/prompts/schemas.d.ts.map +1 -1
- package/dist/prompts/schemas.js +3 -25
- package/dist/prompts/types.d.ts +5 -32
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/utils.js +1 -1
- package/dist/resources/agent-resources-provider.js +1 -1
- package/dist/resources/error-codes.js +1 -1
- package/dist/resources/errors.js +1 -1
- package/dist/resources/handlers/blob-handler.cjs +14 -11
- package/dist/resources/handlers/blob-handler.d.ts +4 -4
- package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
- package/dist/resources/handlers/blob-handler.js +15 -12
- package/dist/resources/handlers/factory.cjs +3 -3
- package/dist/resources/handlers/factory.js +4 -4
- package/dist/resources/handlers/filesystem-handler.js +1 -1
- package/dist/resources/handlers/types.d.ts +2 -2
- package/dist/resources/handlers/types.d.ts.map +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/resources/manager.cjs +10 -7
- package/dist/resources/manager.d.ts +4 -4
- package/dist/resources/manager.d.ts.map +1 -1
- package/dist/resources/manager.js +11 -8
- package/dist/resources/reference-parser.js +1 -1
- package/dist/resources/schemas.cjs +1 -1
- package/dist/resources/schemas.d.ts +2 -2
- package/dist/resources/schemas.js +2 -2
- package/dist/runtime/host-runtime.js +1 -1
- package/dist/runtime/index.cjs +3 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/run-context.js +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/search-service.cjs +6 -13
- package/dist/search/search-service.d.ts +5 -3
- package/dist/search/search-service.d.ts.map +1 -1
- package/dist/search/search-service.js +7 -14
- package/dist/session/chat-session.cjs +264 -108
- package/dist/session/chat-session.d.ts +75 -21
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +268 -108
- package/dist/session/error-codes.js +1 -1
- package/dist/session/errors.js +1 -1
- package/dist/session/index.cjs +19 -2
- package/dist/session/index.d.ts +4 -3
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +19 -3
- package/dist/session/message-queue.cjs +82 -51
- package/dist/session/message-queue.d.ts +13 -8
- package/dist/session/message-queue.d.ts.map +1 -1
- package/dist/session/message-queue.js +83 -52
- package/dist/session/queue-clone.cjs +50 -0
- package/dist/session/queue-clone.d.ts +5 -0
- package/dist/session/queue-clone.d.ts.map +1 -0
- package/dist/session/queue-clone.js +25 -0
- package/dist/session/schemas.cjs +74 -2
- package/dist/session/schemas.d.ts +94 -0
- package/dist/session/schemas.d.ts.map +1 -1
- package/dist/session/schemas.js +69 -2
- package/dist/session/session-manager.cjs +107 -123
- package/dist/session/session-manager.d.ts +8 -7
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +108 -124
- package/dist/session/title-generator.cjs +14 -26
- package/dist/session/title-generator.d.ts +4 -6
- package/dist/session/title-generator.d.ts.map +1 -1
- package/dist/session/title-generator.js +16 -28
- package/dist/session/types.cjs +28 -0
- package/dist/session/types.d.ts +5 -1
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +19 -0
- package/dist/{session/history/factory.cjs → skills/index.cjs} +9 -9
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +7 -0
- package/dist/skills/skill-manager.cjs +76 -0
- package/dist/skills/skill-manager.d.ts +13 -0
- package/dist/skills/skill-manager.d.ts.map +1 -0
- package/dist/skills/skill-manager.js +53 -0
- package/dist/skills/types.d.ts +24 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/workspace-skill-source.cjs +120 -0
- package/dist/skills/workspace-skill-source.d.ts +16 -0
- package/dist/skills/workspace-skill-source.d.ts.map +1 -0
- package/dist/skills/workspace-skill-source.js +97 -0
- package/dist/{llm → storage/approvals}/types.cjs +13 -30
- package/dist/storage/approvals/types.d.ts +54 -0
- package/dist/storage/approvals/types.d.ts.map +1 -0
- package/dist/storage/approvals/types.js +14 -0
- package/dist/storage/artifacts/types.d.ts +73 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -0
- package/dist/storage/conversation/database.cjs +233 -0
- package/dist/storage/conversation/database.d.ts +38 -0
- package/dist/storage/conversation/database.d.ts.map +1 -0
- package/dist/storage/conversation/database.js +210 -0
- package/dist/storage/conversation/types.cjs +16 -0
- package/dist/storage/conversation/types.d.ts +21 -0
- package/dist/storage/conversation/types.d.ts.map +1 -0
- package/dist/storage/conversation/types.js +0 -0
- package/dist/storage/database/types.d.ts +4 -0
- package/dist/storage/database/types.d.ts.map +1 -1
- package/dist/storage/error-codes.js +1 -1
- package/dist/storage/errors.cjs +6 -6
- package/dist/storage/errors.d.ts +2 -2
- package/dist/storage/errors.js +7 -7
- package/dist/storage/index.cjs +42 -5
- package/dist/storage/index.d.ts +19 -8
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +39 -4
- package/dist/storage/memories/types.cjs +16 -0
- package/dist/storage/memories/types.d.ts +17 -0
- package/dist/storage/memories/types.d.ts.map +1 -0
- package/dist/storage/memories/types.js +0 -0
- package/dist/storage/message-queue/types.cjs +16 -0
- package/dist/storage/message-queue/types.d.ts +15 -0
- package/dist/storage/message-queue/types.d.ts.map +1 -0
- package/dist/storage/message-queue/types.js +0 -0
- package/dist/storage/prompts/types.cjs +16 -0
- package/dist/storage/prompts/types.d.ts +14 -0
- package/dist/storage/prompts/types.d.ts.map +1 -0
- package/dist/storage/prompts/types.js +0 -0
- package/dist/storage/runtime-events/types.cjs +16 -0
- package/dist/storage/runtime-events/types.d.ts +19 -0
- package/dist/storage/runtime-events/types.d.ts.map +1 -0
- package/dist/storage/runtime-events/types.js +0 -0
- package/dist/storage/sessions/types.cjs +16 -0
- package/dist/storage/sessions/types.d.ts +19 -0
- package/dist/storage/sessions/types.d.ts.map +1 -0
- package/dist/storage/sessions/types.js +0 -0
- package/dist/storage/stores/backend.cjs +702 -0
- package/dist/storage/stores/backend.d.ts +303 -0
- package/dist/storage/stores/backend.d.ts.map +1 -0
- package/dist/storage/stores/backend.js +677 -0
- package/dist/storage/stores/in-memory.cjs +510 -0
- package/dist/storage/stores/in-memory.d.ts +11 -0
- package/dist/storage/stores/in-memory.d.ts.map +1 -0
- package/dist/storage/stores/in-memory.js +487 -0
- package/dist/storage/stores/types.cjs +16 -0
- package/dist/storage/stores/types.d.ts +36 -0
- package/dist/storage/stores/types.d.ts.map +1 -0
- package/dist/storage/stores/types.js +0 -0
- package/dist/storage/tool-executions/types.cjs +127 -0
- package/dist/storage/tool-executions/types.d.ts +193 -0
- package/dist/storage/tool-executions/types.d.ts.map +1 -0
- package/dist/storage/tool-executions/types.js +96 -0
- package/dist/storage/tool-preferences/types.cjs +16 -0
- package/dist/storage/tool-preferences/types.d.ts +29 -0
- package/dist/storage/tool-preferences/types.d.ts.map +1 -0
- package/dist/storage/tool-preferences/types.js +0 -0
- package/dist/storage/tool-state/types.cjs +16 -0
- package/dist/storage/tool-state/types.d.ts +20 -0
- package/dist/storage/tool-state/types.d.ts.map +1 -0
- package/dist/storage/tool-state/types.js +0 -0
- package/dist/storage/workspaces/types.cjs +16 -0
- package/dist/storage/workspaces/types.d.ts +19 -0
- package/dist/storage/workspaces/types.d.ts.map +1 -0
- package/dist/storage/workspaces/types.js +0 -0
- package/dist/systemPrompt/contributors.cjs +10 -14
- package/dist/systemPrompt/contributors.d.ts +3 -3
- package/dist/systemPrompt/contributors.d.ts.map +1 -1
- package/dist/systemPrompt/contributors.js +11 -15
- package/dist/systemPrompt/error-codes.js +1 -1
- package/dist/systemPrompt/errors.js +1 -1
- package/dist/systemPrompt/in-built-prompts.js +1 -1
- package/dist/systemPrompt/index.js +1 -1
- package/dist/systemPrompt/manager.js +1 -1
- package/dist/systemPrompt/registry.js +1 -1
- package/dist/systemPrompt/schemas.js +1 -1
- 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/test-utils/in-memory-storage.cjs +9 -17
- package/dist/test-utils/in-memory-storage.js +9 -16
- package/dist/test-utils/session-state-stores.cjs +21 -24
- package/dist/test-utils/session-state-stores.js +22 -24
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.cjs +1 -1
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.d.ts +2 -2
- package/dist/tools/approval/allowed-tools-provider/factory.d.ts.map +1 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/factory.js +2 -2
- package/dist/tools/approval/allowed-tools-provider/in-memory.d.ts.map +1 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.js +1 -1
- package/dist/tools/approval/allowed-tools-provider/storage.cjs +66 -0
- package/dist/tools/{confirmation → approval}/allowed-tools-provider/storage.d.ts +4 -10
- package/dist/tools/approval/allowed-tools-provider/storage.d.ts.map +1 -0
- package/dist/tools/approval/allowed-tools-provider/storage.js +43 -0
- package/dist/tools/approval/allowed-tools-provider/types.cjs +16 -0
- package/dist/tools/approval/allowed-tools-provider/types.d.ts.map +1 -0
- package/dist/tools/approval/allowed-tools-provider/types.js +0 -0
- package/dist/tools/approval/session-tool-policy.cjs +269 -0
- package/dist/tools/approval/session-tool-policy.d.ts +43 -0
- package/dist/tools/approval/session-tool-policy.d.ts.map +1 -0
- package/dist/tools/approval/session-tool-policy.js +245 -0
- package/dist/tools/define-tool.js +1 -1
- package/dist/tools/display-types.js +1 -1
- package/dist/tools/error-codes.cjs +3 -3
- package/dist/tools/error-codes.d.ts +4 -4
- package/dist/tools/error-codes.d.ts.map +1 -1
- package/dist/tools/error-codes.js +4 -4
- package/dist/tools/errors.cjs +12 -12
- package/dist/tools/errors.d.ts +6 -6
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +13 -13
- package/dist/tools/index.cjs +3 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/pattern-utils.js +1 -1
- package/dist/tools/presentation/tool-presentation.cjs +182 -0
- package/dist/tools/presentation/tool-presentation.d.ts +51 -0
- package/dist/tools/presentation/tool-presentation.d.ts.map +1 -0
- package/dist/tools/presentation/tool-presentation.js +159 -0
- package/dist/tools/presentation.js +1 -1
- package/dist/tools/schemas.cjs +5 -10
- package/dist/tools/schemas.d.ts +1 -4
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +6 -11
- package/dist/tools/session-tool-preferences-store.cjs +12 -28
- package/dist/tools/session-tool-preferences-store.d.ts +4 -7
- package/dist/tools/session-tool-preferences-store.d.ts.map +1 -1
- package/dist/tools/session-tool-preferences-store.js +12 -29
- package/dist/tools/tool-call-metadata.js +1 -1
- package/dist/tools/tool-manager.cjs +871 -834
- package/dist/tools/tool-manager.d.ts +94 -96
- package/dist/tools/tool-manager.d.ts.map +1 -1
- package/dist/tools/tool-manager.js +876 -833
- package/dist/tools/types.d.ts +10 -14
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.d.ts +1 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/api-key-resolver.js +1 -1
- package/dist/utils/async-context.js +1 -1
- package/dist/utils/debug.js +1 -1
- package/dist/utils/defer.js +1 -1
- package/dist/utils/env.js +1 -1
- 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/path.js +1 -1
- package/dist/utils/redactor.js +1 -1
- package/dist/utils/result.js +1 -1
- package/dist/utils/safe-stringify.js +1 -1
- package/dist/utils/schema.js +1 -1
- package/dist/utils/service-initializer.cjs +37 -33
- package/dist/utils/service-initializer.d.ts +9 -5
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +38 -34
- package/dist/utils/zod-schema-converter.js +1 -1
- package/dist/workspace/error-codes.cjs +5 -1
- package/dist/workspace/error-codes.d.ts +4 -0
- package/dist/workspace/error-codes.d.ts.map +1 -1
- package/dist/workspace/error-codes.js +6 -2
- package/dist/workspace/errors.cjs +43 -0
- package/dist/workspace/errors.d.ts +9 -0
- package/dist/workspace/errors.d.ts.map +1 -1
- package/dist/workspace/errors.js +44 -1
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/manager.cjs +21 -29
- package/dist/workspace/manager.d.ts +6 -6
- package/dist/workspace/manager.d.ts.map +1 -1
- package/dist/workspace/manager.js +22 -30
- package/dist/workspace/types.d.ts +47 -0
- package/dist/workspace/types.d.ts.map +1 -1
- package/package.json +116 -3
- package/dist/approval/session-approval-store.cjs +0 -91
- package/dist/approval/session-approval-store.d.ts +0 -37
- package/dist/approval/session-approval-store.d.ts.map +0 -1
- package/dist/approval/session-approval-store.js +0 -68
- package/dist/llm/reasoning/anthropic-betas.d.ts +0 -3
- package/dist/llm/reasoning/anthropic-betas.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-betas.js +0 -7
- package/dist/llm/reasoning/anthropic-thinking.cjs +0 -79
- package/dist/llm/reasoning/anthropic-thinking.d.ts +0 -15
- package/dist/llm/reasoning/anthropic-thinking.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-thinking.js +0 -52
- package/dist/llm/reasoning/openai-reasoning-effort.cjs +0 -86
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts +0 -5
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts.map +0 -1
- package/dist/llm/reasoning/openai-reasoning-effort.js +0 -61
- package/dist/llm/reasoning/profile.cjs +0 -113
- package/dist/llm/reasoning/profile.d.ts +0 -13
- package/dist/llm/reasoning/profile.d.ts.map +0 -1
- package/dist/llm/reasoning/profile.js +0 -92
- package/dist/llm/reasoning/profiles/anthropic.cjs +0 -61
- package/dist/llm/reasoning/profiles/anthropic.d.ts +0 -8
- package/dist/llm/reasoning/profiles/anthropic.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/anthropic.js +0 -45
- package/dist/llm/reasoning/profiles/bedrock.cjs +0 -54
- package/dist/llm/reasoning/profiles/bedrock.d.ts +0 -3
- package/dist/llm/reasoning/profiles/bedrock.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/bedrock.js +0 -36
- package/dist/llm/reasoning/profiles/google.cjs +0 -45
- package/dist/llm/reasoning/profiles/google.d.ts +0 -9
- package/dist/llm/reasoning/profiles/google.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/google.js +0 -21
- package/dist/llm/reasoning/profiles/openai-compatible.cjs +0 -39
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai-compatible.js +0 -16
- package/dist/llm/reasoning/profiles/openai.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai.js +0 -18
- package/dist/llm/reasoning/profiles/openrouter.cjs +0 -83
- package/dist/llm/reasoning/profiles/openrouter.d.ts +0 -10
- package/dist/llm/reasoning/profiles/openrouter.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openrouter.js +0 -59
- package/dist/llm/reasoning/profiles/shared.cjs +0 -80
- package/dist/llm/reasoning/profiles/shared.d.ts +0 -25
- package/dist/llm/reasoning/profiles/shared.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/shared.js +0 -53
- package/dist/llm/reasoning/profiles/vertex.cjs +0 -46
- package/dist/llm/reasoning/profiles/vertex.d.ts +0 -3
- package/dist/llm/reasoning/profiles/vertex.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/vertex.js +0 -23
- package/dist/llm/registry/models.generated.cjs +0 -10741
- package/dist/llm/registry/models.generated.d.ts +0 -2945
- package/dist/llm/registry/models.generated.d.ts.map +0 -1
- package/dist/llm/registry/models.generated.js +0 -10717
- package/dist/llm/registry/models.manual.cjs +0 -44
- package/dist/llm/registry/models.manual.d.ts +0 -22
- package/dist/llm/registry/models.manual.d.ts.map +0 -1
- package/dist/llm/registry/models.manual.js +0 -21
- package/dist/llm/types.d.ts +0 -39
- package/dist/llm/types.d.ts.map +0 -1
- package/dist/llm/types.js +0 -30
- package/dist/session/history/database.cjs +0 -232
- package/dist/session/history/database.d.ts +0 -41
- package/dist/session/history/database.d.ts.map +0 -1
- package/dist/session/history/database.js +0 -209
- package/dist/session/history/factory.d.ts +0 -11
- package/dist/session/history/factory.d.ts.map +0 -1
- package/dist/session/history/factory.js +0 -8
- package/dist/session/history/memory.cjs +0 -57
- package/dist/session/history/memory.d.ts +0 -22
- package/dist/session/history/memory.d.ts.map +0 -1
- package/dist/session/history/memory.js +0 -34
- package/dist/session/history/types.d.ts +0 -26
- package/dist/session/history/types.d.ts.map +0 -1
- package/dist/session/message-queue-store.cjs +0 -75
- package/dist/session/message-queue-store.d.ts +0 -16
- package/dist/session/message-queue-store.d.ts.map +0 -1
- package/dist/session/message-queue-store.js +0 -52
- package/dist/storage/storage-manager.cjs +0 -209
- package/dist/storage/storage-manager.d.ts +0 -77
- package/dist/storage/storage-manager.d.ts.map +0 -1
- package/dist/storage/storage-manager.js +0 -186
- package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/in-memory.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.cjs +0 -69
- package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +0 -1
- package/dist/tools/confirmation/allowed-tools-provider/storage.js +0 -46
- package/dist/tools/confirmation/allowed-tools-provider/types.d.ts.map +0 -1
- /package/dist/{session/history → skills}/types.cjs +0 -0
- /package/dist/{session/history → skills}/types.js +0 -0
- /package/dist/{tools/confirmation/allowed-tools-provider → storage/artifacts}/types.cjs +0 -0
- /package/dist/{tools/confirmation/allowed-tools-provider → storage/artifacts}/types.js +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.cjs +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/in-memory.d.ts +0 -0
- /package/dist/tools/{confirmation → approval}/allowed-tools-provider/types.d.ts +0 -0
|
@@ -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 session_approval_store_exports = {};
|
|
20
|
-
__export(session_approval_store_exports, {
|
|
21
|
-
SessionApprovalStore: () => SessionApprovalStore
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(session_approval_store_exports);
|
|
24
|
-
var import_zod = require("zod");
|
|
25
|
-
const ApprovedDirectoryTypeSchema = import_zod.z.enum(["session", "once"]);
|
|
26
|
-
const PersistedApprovedDirectorySchema = import_zod.z.object({
|
|
27
|
-
path: import_zod.z.string(),
|
|
28
|
-
type: ApprovedDirectoryTypeSchema
|
|
29
|
-
}).strict();
|
|
30
|
-
const SessionApprovalStateSchema = import_zod.z.object({
|
|
31
|
-
toolPatterns: import_zod.z.record(import_zod.z.string(), import_zod.z.array(import_zod.z.string())).default({}),
|
|
32
|
-
approvedDirectories: import_zod.z.array(PersistedApprovedDirectorySchema).default([])
|
|
33
|
-
}).strict();
|
|
34
|
-
const DEFAULT_APPROVAL_STATE = {
|
|
35
|
-
toolPatterns: {},
|
|
36
|
-
approvedDirectories: []
|
|
37
|
-
};
|
|
38
|
-
class SessionApprovalStore {
|
|
39
|
-
constructor(storageManager, logger, options = {}) {
|
|
40
|
-
this.storageManager = storageManager;
|
|
41
|
-
this.logger = logger;
|
|
42
|
-
const cacheTtlMs = options.cacheTtlMs ?? 36e5;
|
|
43
|
-
this.cacheTtlSeconds = Math.max(1, Math.floor(cacheTtlMs / 1e3));
|
|
44
|
-
}
|
|
45
|
-
cacheTtlSeconds;
|
|
46
|
-
buildKey(sessionId) {
|
|
47
|
-
return sessionId ? `session-approvals:${sessionId}` : "session-approvals:global";
|
|
48
|
-
}
|
|
49
|
-
async load(sessionId) {
|
|
50
|
-
const key = this.buildKey(sessionId);
|
|
51
|
-
const cached = await this.storageManager.getCache().get(key);
|
|
52
|
-
if (cached !== void 0) {
|
|
53
|
-
return this.parseState(cached, key);
|
|
54
|
-
}
|
|
55
|
-
const stored = await this.storageManager.getDatabase().get(key);
|
|
56
|
-
if (stored === void 0) {
|
|
57
|
-
return structuredClone(DEFAULT_APPROVAL_STATE);
|
|
58
|
-
}
|
|
59
|
-
const parsed = this.parseState(stored, key);
|
|
60
|
-
await this.storageManager.getCache().set(key, parsed, this.cacheTtlSeconds);
|
|
61
|
-
return parsed;
|
|
62
|
-
}
|
|
63
|
-
async save(sessionId, state) {
|
|
64
|
-
const key = this.buildKey(sessionId);
|
|
65
|
-
const normalized = SessionApprovalStateSchema.parse(state);
|
|
66
|
-
await this.storageManager.getDatabase().set(key, normalized);
|
|
67
|
-
await this.storageManager.getCache().set(key, normalized, this.cacheTtlSeconds);
|
|
68
|
-
}
|
|
69
|
-
async delete(sessionId) {
|
|
70
|
-
const key = this.buildKey(sessionId);
|
|
71
|
-
await Promise.all([
|
|
72
|
-
this.storageManager.getDatabase().delete(key),
|
|
73
|
-
this.storageManager.getCache().delete(key)
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
|
-
parseState(value, key) {
|
|
77
|
-
const result = SessionApprovalStateSchema.safeParse(value);
|
|
78
|
-
if (result.success) {
|
|
79
|
-
return result.data;
|
|
80
|
-
}
|
|
81
|
-
this.logger.warn("Invalid persisted approval state encountered; using defaults", {
|
|
82
|
-
key,
|
|
83
|
-
error: result.error.message
|
|
84
|
-
});
|
|
85
|
-
return structuredClone(DEFAULT_APPROVAL_STATE);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
SessionApprovalStore
|
|
91
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { StorageManager } from '../storage/index.js';
|
|
3
|
-
import type { Logger } from '../logger/v2/types.js';
|
|
4
|
-
declare const PersistedApprovedDirectorySchema: z.ZodObject<{
|
|
5
|
-
path: z.ZodString;
|
|
6
|
-
type: z.ZodEnum<{
|
|
7
|
-
session: "session";
|
|
8
|
-
once: "once";
|
|
9
|
-
}>;
|
|
10
|
-
}, z.core.$strict>;
|
|
11
|
-
declare const SessionApprovalStateSchema: z.ZodObject<{
|
|
12
|
-
toolPatterns: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
13
|
-
approvedDirectories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
14
|
-
path: z.ZodString;
|
|
15
|
-
type: z.ZodEnum<{
|
|
16
|
-
session: "session";
|
|
17
|
-
once: "once";
|
|
18
|
-
}>;
|
|
19
|
-
}, z.core.$strict>>>;
|
|
20
|
-
}, z.core.$strict>;
|
|
21
|
-
export type PersistedApprovedDirectory = z.output<typeof PersistedApprovedDirectorySchema>;
|
|
22
|
-
export type SessionApprovalState = z.output<typeof SessionApprovalStateSchema>;
|
|
23
|
-
export declare class SessionApprovalStore {
|
|
24
|
-
private readonly storageManager;
|
|
25
|
-
private readonly logger;
|
|
26
|
-
private readonly cacheTtlSeconds;
|
|
27
|
-
constructor(storageManager: StorageManager, logger: Logger, options?: {
|
|
28
|
-
cacheTtlMs?: number;
|
|
29
|
-
});
|
|
30
|
-
private buildKey;
|
|
31
|
-
load(sessionId?: string): Promise<SessionApprovalState>;
|
|
32
|
-
save(sessionId: string | undefined, state: SessionApprovalState): Promise<void>;
|
|
33
|
-
delete(sessionId?: string): Promise<void>;
|
|
34
|
-
private parseState;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=session-approval-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-approval-store.d.ts","sourceRoot":"","sources":["../../src/approval/session-approval-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,QAAA,MAAM,gCAAgC;;;;;;kBAKzB,CAAC;AAEd,QAAA,MAAM,0BAA0B;;;;;;;;;kBAKnB,CAAC;AAEd,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC3F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAO/E,qBAAa,oBAAoB;IAIzB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJ3B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAGpB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EAC/B,OAAO,GAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO;IAMzC,OAAO,CAAC,QAAQ;IAIV,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAiBvD,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/E,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,OAAO,CAAC,UAAU;CAYrB"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "../chunk-PTJYTZNU.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
const ApprovedDirectoryTypeSchema = z.enum(["session", "once"]);
|
|
4
|
-
const PersistedApprovedDirectorySchema = z.object({
|
|
5
|
-
path: z.string(),
|
|
6
|
-
type: ApprovedDirectoryTypeSchema
|
|
7
|
-
}).strict();
|
|
8
|
-
const SessionApprovalStateSchema = z.object({
|
|
9
|
-
toolPatterns: z.record(z.string(), z.array(z.string())).default({}),
|
|
10
|
-
approvedDirectories: z.array(PersistedApprovedDirectorySchema).default([])
|
|
11
|
-
}).strict();
|
|
12
|
-
const DEFAULT_APPROVAL_STATE = {
|
|
13
|
-
toolPatterns: {},
|
|
14
|
-
approvedDirectories: []
|
|
15
|
-
};
|
|
16
|
-
class SessionApprovalStore {
|
|
17
|
-
constructor(storageManager, logger, options = {}) {
|
|
18
|
-
this.storageManager = storageManager;
|
|
19
|
-
this.logger = logger;
|
|
20
|
-
const cacheTtlMs = options.cacheTtlMs ?? 36e5;
|
|
21
|
-
this.cacheTtlSeconds = Math.max(1, Math.floor(cacheTtlMs / 1e3));
|
|
22
|
-
}
|
|
23
|
-
cacheTtlSeconds;
|
|
24
|
-
buildKey(sessionId) {
|
|
25
|
-
return sessionId ? `session-approvals:${sessionId}` : "session-approvals:global";
|
|
26
|
-
}
|
|
27
|
-
async load(sessionId) {
|
|
28
|
-
const key = this.buildKey(sessionId);
|
|
29
|
-
const cached = await this.storageManager.getCache().get(key);
|
|
30
|
-
if (cached !== void 0) {
|
|
31
|
-
return this.parseState(cached, key);
|
|
32
|
-
}
|
|
33
|
-
const stored = await this.storageManager.getDatabase().get(key);
|
|
34
|
-
if (stored === void 0) {
|
|
35
|
-
return structuredClone(DEFAULT_APPROVAL_STATE);
|
|
36
|
-
}
|
|
37
|
-
const parsed = this.parseState(stored, key);
|
|
38
|
-
await this.storageManager.getCache().set(key, parsed, this.cacheTtlSeconds);
|
|
39
|
-
return parsed;
|
|
40
|
-
}
|
|
41
|
-
async save(sessionId, state) {
|
|
42
|
-
const key = this.buildKey(sessionId);
|
|
43
|
-
const normalized = SessionApprovalStateSchema.parse(state);
|
|
44
|
-
await this.storageManager.getDatabase().set(key, normalized);
|
|
45
|
-
await this.storageManager.getCache().set(key, normalized, this.cacheTtlSeconds);
|
|
46
|
-
}
|
|
47
|
-
async delete(sessionId) {
|
|
48
|
-
const key = this.buildKey(sessionId);
|
|
49
|
-
await Promise.all([
|
|
50
|
-
this.storageManager.getDatabase().delete(key),
|
|
51
|
-
this.storageManager.getCache().delete(key)
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
parseState(value, key) {
|
|
55
|
-
const result = SessionApprovalStateSchema.safeParse(value);
|
|
56
|
-
if (result.success) {
|
|
57
|
-
return result.data;
|
|
58
|
-
}
|
|
59
|
-
this.logger.warn("Invalid persisted approval state encountered; using defaults", {
|
|
60
|
-
key,
|
|
61
|
-
error: result.error.message
|
|
62
|
-
});
|
|
63
|
-
return structuredClone(DEFAULT_APPROVAL_STATE);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
SessionApprovalStore
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-betas.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/anthropic-betas.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAMtD,eAAO,MAAM,mCAAmC,oCAAoC,CAAC"}
|
|
@@ -1,79 +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 anthropic_thinking_exports = {};
|
|
20
|
-
__export(anthropic_thinking_exports, {
|
|
21
|
-
isAnthropicAdaptiveThinkingModel: () => isAnthropicAdaptiveThinkingModel,
|
|
22
|
-
isAnthropicOpusAdaptiveThinkingModel: () => isAnthropicOpusAdaptiveThinkingModel,
|
|
23
|
-
isClaudeVersionAtLeast: () => isClaudeVersionAtLeast,
|
|
24
|
-
parseClaudeVersion: () => parseClaudeVersion,
|
|
25
|
-
supportsAnthropicInterleavedThinking: () => supportsAnthropicInterleavedThinking
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(anthropic_thinking_exports);
|
|
28
|
-
function parseClaudeVersion(model) {
|
|
29
|
-
const modelLower = model.toLowerCase();
|
|
30
|
-
const variantFirst = /claude-(opus|sonnet|haiku)-(\d+)(?:[.-](\d{1,2})(?!\d))?/i.exec(
|
|
31
|
-
modelLower
|
|
32
|
-
);
|
|
33
|
-
if (variantFirst) {
|
|
34
|
-
const [, variant, majorRaw, minorRaw] = variantFirst;
|
|
35
|
-
if (!variant || !majorRaw) return null;
|
|
36
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
37
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
38
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
39
|
-
return { major, minor, variant };
|
|
40
|
-
}
|
|
41
|
-
const versionFirst = /claude-(\d+)(?:[.-](\d{1,2})(?!\d))?-(opus|sonnet|haiku)/i.exec(
|
|
42
|
-
modelLower
|
|
43
|
-
);
|
|
44
|
-
if (versionFirst) {
|
|
45
|
-
const [, majorRaw, minorRaw, variant] = versionFirst;
|
|
46
|
-
if (!majorRaw || !variant) return null;
|
|
47
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
48
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
49
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
50
|
-
return { major, minor, variant };
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
function isClaudeVersionAtLeast(version, min) {
|
|
55
|
-
return version.major > min.major || version.major === min.major && version.minor >= min.minor;
|
|
56
|
-
}
|
|
57
|
-
function isAnthropicAdaptiveThinkingModel(model) {
|
|
58
|
-
const version = parseClaudeVersion(model);
|
|
59
|
-
if (!version) return false;
|
|
60
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
61
|
-
}
|
|
62
|
-
function isAnthropicOpusAdaptiveThinkingModel(model) {
|
|
63
|
-
const version = parseClaudeVersion(model);
|
|
64
|
-
if (!version || version.variant !== "opus") return false;
|
|
65
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
66
|
-
}
|
|
67
|
-
function supportsAnthropicInterleavedThinking(model) {
|
|
68
|
-
const version = parseClaudeVersion(model);
|
|
69
|
-
if (!version) return false;
|
|
70
|
-
return version.major >= 4;
|
|
71
|
-
}
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
isAnthropicAdaptiveThinkingModel,
|
|
75
|
-
isAnthropicOpusAdaptiveThinkingModel,
|
|
76
|
-
isClaudeVersionAtLeast,
|
|
77
|
-
parseClaudeVersion,
|
|
78
|
-
supportsAnthropicInterleavedThinking
|
|
79
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type ClaudeVariant = 'opus' | 'sonnet' | 'haiku';
|
|
2
|
-
export type ParsedClaudeVersion = {
|
|
3
|
-
major: number;
|
|
4
|
-
minor: number;
|
|
5
|
-
variant?: ClaudeVariant;
|
|
6
|
-
};
|
|
7
|
-
export declare function parseClaudeVersion(model: string): ParsedClaudeVersion | null;
|
|
8
|
-
export declare function isClaudeVersionAtLeast(version: Pick<ParsedClaudeVersion, 'major' | 'minor'>, min: {
|
|
9
|
-
major: number;
|
|
10
|
-
minor: number;
|
|
11
|
-
}): boolean;
|
|
12
|
-
export declare function isAnthropicAdaptiveThinkingModel(model: string): boolean;
|
|
13
|
-
export declare function isAnthropicOpusAdaptiveThinkingModel(model: string): boolean;
|
|
14
|
-
export declare function supportsAnthropicInterleavedThinking(model: string): boolean;
|
|
15
|
-
//# sourceMappingURL=anthropic-thinking.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-thinking.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/anthropic-thinking.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAmC5E;AAED,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,CAAC,EACrD,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtC,OAAO,CAET;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMvE;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI3E;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAM3E"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import "../../chunk-PTJYTZNU.js";
|
|
2
|
-
function parseClaudeVersion(model) {
|
|
3
|
-
const modelLower = model.toLowerCase();
|
|
4
|
-
const variantFirst = /claude-(opus|sonnet|haiku)-(\d+)(?:[.-](\d{1,2})(?!\d))?/i.exec(
|
|
5
|
-
modelLower
|
|
6
|
-
);
|
|
7
|
-
if (variantFirst) {
|
|
8
|
-
const [, variant, majorRaw, minorRaw] = variantFirst;
|
|
9
|
-
if (!variant || !majorRaw) return null;
|
|
10
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
11
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
12
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
13
|
-
return { major, minor, variant };
|
|
14
|
-
}
|
|
15
|
-
const versionFirst = /claude-(\d+)(?:[.-](\d{1,2})(?!\d))?-(opus|sonnet|haiku)/i.exec(
|
|
16
|
-
modelLower
|
|
17
|
-
);
|
|
18
|
-
if (versionFirst) {
|
|
19
|
-
const [, majorRaw, minorRaw, variant] = versionFirst;
|
|
20
|
-
if (!majorRaw || !variant) return null;
|
|
21
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
22
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
23
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
24
|
-
return { major, minor, variant };
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
function isClaudeVersionAtLeast(version, min) {
|
|
29
|
-
return version.major > min.major || version.major === min.major && version.minor >= min.minor;
|
|
30
|
-
}
|
|
31
|
-
function isAnthropicAdaptiveThinkingModel(model) {
|
|
32
|
-
const version = parseClaudeVersion(model);
|
|
33
|
-
if (!version) return false;
|
|
34
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
35
|
-
}
|
|
36
|
-
function isAnthropicOpusAdaptiveThinkingModel(model) {
|
|
37
|
-
const version = parseClaudeVersion(model);
|
|
38
|
-
if (!version || version.variant !== "opus") return false;
|
|
39
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
40
|
-
}
|
|
41
|
-
function supportsAnthropicInterleavedThinking(model) {
|
|
42
|
-
const version = parseClaudeVersion(model);
|
|
43
|
-
if (!version) return false;
|
|
44
|
-
return version.major >= 4;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
isAnthropicAdaptiveThinkingModel,
|
|
48
|
-
isAnthropicOpusAdaptiveThinkingModel,
|
|
49
|
-
isClaudeVersionAtLeast,
|
|
50
|
-
parseClaudeVersion,
|
|
51
|
-
supportsAnthropicInterleavedThinking
|
|
52
|
-
};
|
|
@@ -1,86 +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 openai_reasoning_effort_exports = {};
|
|
20
|
-
__export(openai_reasoning_effort_exports, {
|
|
21
|
-
coerceOpenAIReasoningEffort: () => coerceOpenAIReasoningEffort,
|
|
22
|
-
getSupportedOpenAIReasoningEfforts: () => getSupportedOpenAIReasoningEfforts,
|
|
23
|
-
supportsOpenAIReasoningEffort: () => supportsOpenAIReasoningEffort
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(openai_reasoning_effort_exports);
|
|
26
|
-
function normalizeOpenAIModelId(model) {
|
|
27
|
-
const id = model.split("/").pop() ?? model;
|
|
28
|
-
return id.toLowerCase();
|
|
29
|
-
}
|
|
30
|
-
function getSupportedOpenAIReasoningEfforts(model) {
|
|
31
|
-
const id = normalizeOpenAIModelId(model);
|
|
32
|
-
if (id.includes("gpt-5-pro")) {
|
|
33
|
-
return ["high"];
|
|
34
|
-
}
|
|
35
|
-
if (id.startsWith("gpt-5.3")) {
|
|
36
|
-
return ["low", "medium", "high", "xhigh"];
|
|
37
|
-
}
|
|
38
|
-
if (id.startsWith("gpt-5.2")) {
|
|
39
|
-
return ["low", "medium", "high", "xhigh"];
|
|
40
|
-
}
|
|
41
|
-
if (id.includes("gpt-5.1-codex-max")) {
|
|
42
|
-
return ["none", "low", "medium", "high", "xhigh"];
|
|
43
|
-
}
|
|
44
|
-
if (id.startsWith("gpt-5.1")) {
|
|
45
|
-
return ["none", "low", "medium", "high"];
|
|
46
|
-
}
|
|
47
|
-
if (id.startsWith("gpt-5")) {
|
|
48
|
-
return ["minimal", "low", "medium", "high"];
|
|
49
|
-
}
|
|
50
|
-
if (id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")) {
|
|
51
|
-
return ["low", "medium", "high"];
|
|
52
|
-
}
|
|
53
|
-
return ["low", "medium", "high"];
|
|
54
|
-
}
|
|
55
|
-
function getFallbackOrder(requested) {
|
|
56
|
-
switch (requested) {
|
|
57
|
-
case "none":
|
|
58
|
-
return ["none", "minimal", "low", "medium", "high", "xhigh"];
|
|
59
|
-
case "minimal":
|
|
60
|
-
return ["minimal", "low", "medium", "high", "xhigh"];
|
|
61
|
-
case "low":
|
|
62
|
-
return ["low", "medium", "high", "xhigh"];
|
|
63
|
-
case "medium":
|
|
64
|
-
return ["medium", "high", "xhigh"];
|
|
65
|
-
case "high":
|
|
66
|
-
return ["high", "xhigh"];
|
|
67
|
-
case "xhigh":
|
|
68
|
-
return ["xhigh", "high", "medium", "low", "minimal", "none"];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function coerceOpenAIReasoningEffort(model, requested) {
|
|
72
|
-
const supported = getSupportedOpenAIReasoningEfforts(model);
|
|
73
|
-
for (const candidate of getFallbackOrder(requested)) {
|
|
74
|
-
if (supported.includes(candidate)) return candidate;
|
|
75
|
-
}
|
|
76
|
-
return void 0;
|
|
77
|
-
}
|
|
78
|
-
function supportsOpenAIReasoningEffort(model, effort) {
|
|
79
|
-
return getSupportedOpenAIReasoningEfforts(model).includes(effort);
|
|
80
|
-
}
|
|
81
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
-
0 && (module.exports = {
|
|
83
|
-
coerceOpenAIReasoningEffort,
|
|
84
|
-
getSupportedOpenAIReasoningEfforts,
|
|
85
|
-
supportsOpenAIReasoningEffort
|
|
86
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type OpenAIReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
2
|
-
export declare function getSupportedOpenAIReasoningEfforts(model: string): OpenAIReasoningEffort[];
|
|
3
|
-
export declare function coerceOpenAIReasoningEffort(model: string, requested: OpenAIReasoningEffort): OpenAIReasoningEffort | undefined;
|
|
4
|
-
export declare function supportsOpenAIReasoningEffort(model: string, effort: OpenAIReasoningEffort): boolean;
|
|
5
|
-
//# sourceMappingURL=openai-reasoning-effort.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai-reasoning-effort.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/openai-reasoning-effort.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAO7F,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAoCzF;AAmBD,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,qBAAqB,GACjC,qBAAqB,GAAG,SAAS,CAMnC;AAED,wBAAgB,6BAA6B,CACzC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,qBAAqB,GAC9B,OAAO,CAET"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import "../../chunk-PTJYTZNU.js";
|
|
2
|
-
function normalizeOpenAIModelId(model) {
|
|
3
|
-
const id = model.split("/").pop() ?? model;
|
|
4
|
-
return id.toLowerCase();
|
|
5
|
-
}
|
|
6
|
-
function getSupportedOpenAIReasoningEfforts(model) {
|
|
7
|
-
const id = normalizeOpenAIModelId(model);
|
|
8
|
-
if (id.includes("gpt-5-pro")) {
|
|
9
|
-
return ["high"];
|
|
10
|
-
}
|
|
11
|
-
if (id.startsWith("gpt-5.3")) {
|
|
12
|
-
return ["low", "medium", "high", "xhigh"];
|
|
13
|
-
}
|
|
14
|
-
if (id.startsWith("gpt-5.2")) {
|
|
15
|
-
return ["low", "medium", "high", "xhigh"];
|
|
16
|
-
}
|
|
17
|
-
if (id.includes("gpt-5.1-codex-max")) {
|
|
18
|
-
return ["none", "low", "medium", "high", "xhigh"];
|
|
19
|
-
}
|
|
20
|
-
if (id.startsWith("gpt-5.1")) {
|
|
21
|
-
return ["none", "low", "medium", "high"];
|
|
22
|
-
}
|
|
23
|
-
if (id.startsWith("gpt-5")) {
|
|
24
|
-
return ["minimal", "low", "medium", "high"];
|
|
25
|
-
}
|
|
26
|
-
if (id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")) {
|
|
27
|
-
return ["low", "medium", "high"];
|
|
28
|
-
}
|
|
29
|
-
return ["low", "medium", "high"];
|
|
30
|
-
}
|
|
31
|
-
function getFallbackOrder(requested) {
|
|
32
|
-
switch (requested) {
|
|
33
|
-
case "none":
|
|
34
|
-
return ["none", "minimal", "low", "medium", "high", "xhigh"];
|
|
35
|
-
case "minimal":
|
|
36
|
-
return ["minimal", "low", "medium", "high", "xhigh"];
|
|
37
|
-
case "low":
|
|
38
|
-
return ["low", "medium", "high", "xhigh"];
|
|
39
|
-
case "medium":
|
|
40
|
-
return ["medium", "high", "xhigh"];
|
|
41
|
-
case "high":
|
|
42
|
-
return ["high", "xhigh"];
|
|
43
|
-
case "xhigh":
|
|
44
|
-
return ["xhigh", "high", "medium", "low", "minimal", "none"];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function coerceOpenAIReasoningEffort(model, requested) {
|
|
48
|
-
const supported = getSupportedOpenAIReasoningEfforts(model);
|
|
49
|
-
for (const candidate of getFallbackOrder(requested)) {
|
|
50
|
-
if (supported.includes(candidate)) return candidate;
|
|
51
|
-
}
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
function supportsOpenAIReasoningEffort(model, effort) {
|
|
55
|
-
return getSupportedOpenAIReasoningEfforts(model).includes(effort);
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
coerceOpenAIReasoningEffort,
|
|
59
|
-
getSupportedOpenAIReasoningEfforts,
|
|
60
|
-
supportsOpenAIReasoningEffort
|
|
61
|
-
};
|
|
@@ -1,113 +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 profile_exports = {};
|
|
20
|
-
__export(profile_exports, {
|
|
21
|
-
getReasoningProfile: () => getReasoningProfile,
|
|
22
|
-
supportsReasoningVariant: () => supportsReasoningVariant
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(profile_exports);
|
|
25
|
-
var import_registry = require("../registry/index.js");
|
|
26
|
-
var import_anthropic_thinking = require("./anthropic-thinking.js");
|
|
27
|
-
var import_anthropic = require("./profiles/anthropic.js");
|
|
28
|
-
var import_bedrock = require("./profiles/bedrock.js");
|
|
29
|
-
var import_google = require("./profiles/google.js");
|
|
30
|
-
var import_openai_compatible = require("./profiles/openai-compatible.js");
|
|
31
|
-
var import_openai = require("./profiles/openai.js");
|
|
32
|
-
var import_openrouter = require("./profiles/openrouter.js");
|
|
33
|
-
var import_vertex = require("./profiles/vertex.js");
|
|
34
|
-
var import_shared = require("./profiles/shared.js");
|
|
35
|
-
const ANTHROPIC_PROFILE_CONFIG = {
|
|
36
|
-
includeDisabled: true,
|
|
37
|
-
supportsBudgetTokensForBudgetParadigm: true,
|
|
38
|
-
supportsBudgetTokensForAdaptiveParadigm: false
|
|
39
|
-
};
|
|
40
|
-
const GOOGLE_PROFILE_CONFIG = {
|
|
41
|
-
includeDisabled: true,
|
|
42
|
-
supportsBudgetTokensForBudgetParadigm: true,
|
|
43
|
-
supportsBudgetTokensForThinkingLevelParadigm: false
|
|
44
|
-
};
|
|
45
|
-
function isAnthropicStyleReasoningCapable(provider, model) {
|
|
46
|
-
return (0, import_registry.isReasoningCapableModel)(model, provider) || (0, import_anthropic_thinking.parseClaudeVersion)(model) !== null || (0, import_anthropic_thinking.isAnthropicAdaptiveThinkingModel)(model);
|
|
47
|
-
}
|
|
48
|
-
function getNativeReasoningProfile(provider, model) {
|
|
49
|
-
switch (provider) {
|
|
50
|
-
case "openai":
|
|
51
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "openai")) {
|
|
52
|
-
return (0, import_shared.nonCapableProfile)();
|
|
53
|
-
}
|
|
54
|
-
return (0, import_openai.buildOpenAIReasoningProfile)(model);
|
|
55
|
-
case "anthropic":
|
|
56
|
-
if (!isAnthropicStyleReasoningCapable("anthropic", model)) {
|
|
57
|
-
return (0, import_shared.nonCapableProfile)();
|
|
58
|
-
}
|
|
59
|
-
return (0, import_anthropic.buildAnthropicReasoningProfile)({ model, ...ANTHROPIC_PROFILE_CONFIG });
|
|
60
|
-
case "bedrock":
|
|
61
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "bedrock")) {
|
|
62
|
-
return (0, import_shared.nonCapableProfile)();
|
|
63
|
-
}
|
|
64
|
-
return (0, import_bedrock.buildBedrockReasoningProfile)(model);
|
|
65
|
-
case "google":
|
|
66
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "google")) {
|
|
67
|
-
return (0, import_shared.nonCapableProfile)();
|
|
68
|
-
}
|
|
69
|
-
return (0, import_google.buildGoogleReasoningProfile)({ model, ...GOOGLE_PROFILE_CONFIG });
|
|
70
|
-
case "vertex":
|
|
71
|
-
if (!isAnthropicStyleReasoningCapable("vertex", model)) {
|
|
72
|
-
return (0, import_shared.nonCapableProfile)();
|
|
73
|
-
}
|
|
74
|
-
return (0, import_vertex.buildVertexReasoningProfile)(model);
|
|
75
|
-
case "openai-compatible":
|
|
76
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "openai-compatible")) {
|
|
77
|
-
return (0, import_shared.nonCapableProfile)();
|
|
78
|
-
}
|
|
79
|
-
return (0, import_openai_compatible.buildOpenAICompatibleReasoningProfile)();
|
|
80
|
-
default:
|
|
81
|
-
return (0, import_shared.nonCapableProfile)();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function toGatewayReasoningProfile(nativeProfile) {
|
|
85
|
-
if (!nativeProfile.capable) {
|
|
86
|
-
return (0, import_shared.nonCapableProfile)();
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
...nativeProfile,
|
|
90
|
-
variants: nativeProfile.variants.map((variant) => ({ ...variant })),
|
|
91
|
-
supportedVariants: [...nativeProfile.supportedVariants],
|
|
92
|
-
supportsBudgetTokens: true
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function getReasoningProfile(provider, model) {
|
|
96
|
-
if ((0, import_openrouter.isOpenRouterGatewayProvider)(provider)) {
|
|
97
|
-
const target = (0, import_openrouter.getOpenRouterReasoningTarget)(model);
|
|
98
|
-
if (!target) {
|
|
99
|
-
return (0, import_shared.nonCapableProfile)();
|
|
100
|
-
}
|
|
101
|
-
const nativeProfile = getNativeReasoningProfile(target.upstreamProvider, target.modelId);
|
|
102
|
-
return toGatewayReasoningProfile(nativeProfile);
|
|
103
|
-
}
|
|
104
|
-
return getNativeReasoningProfile(provider, model);
|
|
105
|
-
}
|
|
106
|
-
function supportsReasoningVariant(profile, variant) {
|
|
107
|
-
return profile.variants.some((entry) => entry.id === variant);
|
|
108
|
-
}
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
getReasoningProfile,
|
|
112
|
-
supportsReasoningVariant
|
|
113
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { LLMProvider } from '../types.js';
|
|
2
|
-
import { type ReasoningProfile } from './profiles/shared.js';
|
|
3
|
-
export type { ReasoningParadigm, ReasoningProfile, ReasoningVariantOption, } from './profiles/shared.js';
|
|
4
|
-
/**
|
|
5
|
-
* Returns exact, model/provider-native reasoning controls available for this model.
|
|
6
|
-
*
|
|
7
|
-
* This is intentionally strict:
|
|
8
|
-
* - No generic preset abstraction at this layer
|
|
9
|
-
* - No guessed variants for unknown paradigms
|
|
10
|
-
*/
|
|
11
|
-
export declare function getReasoningProfile(provider: LLMProvider, model: string): ReasoningProfile;
|
|
12
|
-
export declare function supportsReasoningVariant(profile: ReasoningProfile, variant: string): boolean;
|
|
13
|
-
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa/C,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,YAAY,EACR,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;AAiF9B;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAY1F;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5F"}
|