@dexto/core 1.6.1 → 1.6.2

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.
Files changed (132) hide show
  1. package/dist/agent/DextoAgent.cjs +54 -0
  2. package/dist/agent/DextoAgent.d.ts +12 -1
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +54 -0
  5. package/dist/agent/agent-options.d.ts +6 -1
  6. package/dist/agent/agent-options.d.ts.map +1 -1
  7. package/dist/events/index.d.ts +9 -1
  8. package/dist/events/index.d.ts.map +1 -1
  9. package/dist/llm/executor/provider-options.cjs +223 -28
  10. package/dist/llm/executor/provider-options.d.ts +3 -37
  11. package/dist/llm/executor/provider-options.d.ts.map +1 -1
  12. package/dist/llm/executor/provider-options.js +227 -27
  13. package/dist/llm/executor/stream-processor.cjs +54 -31
  14. package/dist/llm/executor/stream-processor.d.ts +9 -2
  15. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  16. package/dist/llm/executor/stream-processor.js +52 -29
  17. package/dist/llm/executor/turn-executor.cjs +63 -41
  18. package/dist/llm/executor/turn-executor.d.ts +2 -2
  19. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  20. package/dist/llm/executor/turn-executor.js +53 -31
  21. package/dist/llm/formatters/vercel.cjs +15 -3
  22. package/dist/llm/formatters/vercel.d.ts +1 -0
  23. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  24. package/dist/llm/formatters/vercel.js +15 -3
  25. package/dist/llm/index.cjs +8 -0
  26. package/dist/llm/index.d.ts +2 -1
  27. package/dist/llm/index.d.ts.map +1 -1
  28. package/dist/llm/index.js +7 -0
  29. package/dist/llm/providers/local/schemas.d.ts +2 -2
  30. package/dist/llm/providers/openrouter-model-registry.cjs +66 -11
  31. package/dist/llm/providers/openrouter-model-registry.d.ts +26 -0
  32. package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -1
  33. package/dist/llm/providers/openrouter-model-registry.js +65 -11
  34. package/dist/llm/reasoning/anthropic-betas.cjs +31 -0
  35. package/dist/llm/reasoning/anthropic-betas.d.ts +3 -0
  36. package/dist/llm/reasoning/anthropic-betas.d.ts.map +1 -0
  37. package/dist/llm/reasoning/anthropic-betas.js +7 -0
  38. package/dist/llm/reasoning/anthropic-thinking.cjs +79 -0
  39. package/dist/llm/reasoning/anthropic-thinking.d.ts +15 -0
  40. package/dist/llm/reasoning/anthropic-thinking.d.ts.map +1 -0
  41. package/dist/llm/reasoning/anthropic-thinking.js +52 -0
  42. package/dist/llm/reasoning/openai-reasoning-effort.cjs +86 -0
  43. package/dist/llm/reasoning/openai-reasoning-effort.d.ts +5 -0
  44. package/dist/llm/reasoning/openai-reasoning-effort.d.ts.map +1 -0
  45. package/dist/llm/reasoning/openai-reasoning-effort.js +61 -0
  46. package/dist/llm/reasoning/profile.cjs +113 -0
  47. package/dist/llm/reasoning/profile.d.ts +13 -0
  48. package/dist/llm/reasoning/profile.d.ts.map +1 -0
  49. package/dist/llm/reasoning/profile.js +92 -0
  50. package/dist/llm/reasoning/profiles/anthropic.cjs +61 -0
  51. package/dist/llm/reasoning/profiles/anthropic.d.ts +8 -0
  52. package/dist/llm/reasoning/profiles/anthropic.d.ts.map +1 -0
  53. package/dist/llm/reasoning/profiles/anthropic.js +45 -0
  54. package/dist/llm/reasoning/profiles/bedrock.cjs +54 -0
  55. package/dist/llm/reasoning/profiles/bedrock.d.ts +3 -0
  56. package/dist/llm/reasoning/profiles/bedrock.d.ts.map +1 -0
  57. package/dist/llm/reasoning/profiles/bedrock.js +36 -0
  58. package/dist/llm/reasoning/profiles/google.cjs +45 -0
  59. package/dist/llm/reasoning/profiles/google.d.ts +9 -0
  60. package/dist/llm/reasoning/profiles/google.d.ts.map +1 -0
  61. package/dist/llm/reasoning/profiles/google.js +21 -0
  62. package/dist/llm/reasoning/profiles/openai-compatible.cjs +39 -0
  63. package/dist/llm/reasoning/profiles/openai-compatible.d.ts +3 -0
  64. package/dist/llm/reasoning/profiles/openai-compatible.d.ts.map +1 -0
  65. package/dist/llm/reasoning/profiles/openai-compatible.js +16 -0
  66. package/dist/llm/reasoning/profiles/openai.cjs +41 -0
  67. package/dist/llm/reasoning/profiles/openai.d.ts +3 -0
  68. package/dist/llm/reasoning/profiles/openai.d.ts.map +1 -0
  69. package/dist/llm/reasoning/profiles/openai.js +18 -0
  70. package/dist/llm/reasoning/profiles/openrouter.cjs +83 -0
  71. package/dist/llm/reasoning/profiles/openrouter.d.ts +10 -0
  72. package/dist/llm/reasoning/profiles/openrouter.d.ts.map +1 -0
  73. package/dist/llm/reasoning/profiles/openrouter.js +59 -0
  74. package/dist/llm/reasoning/profiles/shared.cjs +80 -0
  75. package/dist/llm/reasoning/profiles/shared.d.ts +25 -0
  76. package/dist/llm/reasoning/profiles/shared.d.ts.map +1 -0
  77. package/dist/llm/reasoning/profiles/shared.js +53 -0
  78. package/dist/llm/reasoning/profiles/vertex.cjs +46 -0
  79. package/dist/llm/reasoning/profiles/vertex.d.ts +3 -0
  80. package/dist/llm/reasoning/profiles/vertex.d.ts.map +1 -0
  81. package/dist/llm/reasoning/profiles/vertex.js +23 -0
  82. package/dist/llm/registry/auto-update.cjs +18 -0
  83. package/dist/llm/registry/auto-update.d.ts.map +1 -1
  84. package/dist/llm/registry/auto-update.js +18 -0
  85. package/dist/llm/registry/index.cjs +126 -26
  86. package/dist/llm/registry/index.d.ts +48 -4
  87. package/dist/llm/registry/index.d.ts.map +1 -1
  88. package/dist/llm/registry/index.js +136 -28
  89. package/dist/llm/registry/models.generated.cjs +5198 -59
  90. package/dist/llm/registry/models.generated.d.ts +1893 -76
  91. package/dist/llm/registry/models.generated.d.ts.map +1 -1
  92. package/dist/llm/registry/models.generated.js +5196 -58
  93. package/dist/llm/registry/sync.cjs +72 -1
  94. package/dist/llm/registry/sync.d.ts +21 -1
  95. package/dist/llm/registry/sync.d.ts.map +1 -1
  96. package/dist/llm/registry/sync.js +72 -1
  97. package/dist/llm/resolver.cjs +13 -1
  98. package/dist/llm/resolver.d.ts.map +1 -1
  99. package/dist/llm/resolver.js +13 -1
  100. package/dist/llm/schemas.cjs +75 -14
  101. package/dist/llm/schemas.d.ts +80 -23
  102. package/dist/llm/schemas.d.ts.map +1 -1
  103. package/dist/llm/schemas.js +75 -14
  104. package/dist/llm/services/factory.cjs +55 -8
  105. package/dist/llm/services/factory.d.ts +1 -1
  106. package/dist/llm/services/factory.d.ts.map +1 -1
  107. package/dist/llm/services/factory.js +58 -8
  108. package/dist/llm/services/vercel.cjs +1 -1
  109. package/dist/llm/services/vercel.js +1 -1
  110. package/dist/llm/types.d.ts +9 -0
  111. package/dist/llm/types.d.ts.map +1 -1
  112. package/dist/prompts/index.cjs +9 -0
  113. package/dist/prompts/index.d.ts +1 -0
  114. package/dist/prompts/index.d.ts.map +1 -1
  115. package/dist/prompts/index.js +10 -0
  116. package/dist/prompts/prompt-manager.cjs +2 -0
  117. package/dist/prompts/prompt-manager.d.ts.map +1 -1
  118. package/dist/prompts/prompt-manager.js +2 -0
  119. package/dist/prompts/providers/config-prompt-provider.cjs +11 -1
  120. package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
  121. package/dist/prompts/providers/config-prompt-provider.js +11 -1
  122. package/dist/prompts/schemas.cjs +2 -2
  123. package/dist/prompts/schemas.js +2 -2
  124. package/dist/prompts/types.d.ts +6 -2
  125. package/dist/prompts/types.d.ts.map +1 -1
  126. package/dist/tools/tool-manager.cjs +88 -2
  127. package/dist/tools/tool-manager.d.ts +15 -1
  128. package/dist/tools/tool-manager.d.ts.map +1 -1
  129. package/dist/tools/tool-manager.js +88 -2
  130. package/dist/utils/service-initializer.d.ts +1 -0
  131. package/dist/utils/service-initializer.d.ts.map +1 -1
  132. package/package.json +6 -4
@@ -0,0 +1,21 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import { buildBudgetProfile, buildThinkingLevelProfile } from "./shared.js";
3
+ function isGemini3Model(model) {
4
+ return model.toLowerCase().includes("gemini-3");
5
+ }
6
+ function buildGoogleReasoningProfile(config) {
7
+ if (isGemini3Model(config.model)) {
8
+ return buildThinkingLevelProfile({
9
+ includeDisabled: config.includeDisabled,
10
+ supportsBudgetTokens: config.supportsBudgetTokensForThinkingLevelParadigm
11
+ });
12
+ }
13
+ return buildBudgetProfile({
14
+ includeDisabled: config.includeDisabled,
15
+ supportsBudgetTokens: config.supportsBudgetTokensForBudgetParadigm
16
+ });
17
+ }
18
+ export {
19
+ buildGoogleReasoningProfile,
20
+ isGemini3Model
21
+ };
@@ -0,0 +1,39 @@
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_compatible_exports = {};
20
+ __export(openai_compatible_exports, {
21
+ buildOpenAICompatibleReasoningProfile: () => buildOpenAICompatibleReasoningProfile
22
+ });
23
+ module.exports = __toCommonJS(openai_compatible_exports);
24
+ var import_shared = require("./shared.js");
25
+ function buildOpenAICompatibleReasoningProfile() {
26
+ return (0, import_shared.withDefault)(
27
+ {
28
+ capable: true,
29
+ paradigm: "effort",
30
+ variants: [(0, import_shared.option)("none"), (0, import_shared.option)("low"), (0, import_shared.option)("medium"), (0, import_shared.option)("high")],
31
+ supportsBudgetTokens: false
32
+ },
33
+ "medium"
34
+ );
35
+ }
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ buildOpenAICompatibleReasoningProfile
39
+ });
@@ -0,0 +1,3 @@
1
+ import { type ReasoningProfile } from './shared.js';
2
+ export declare function buildOpenAICompatibleReasoningProfile(): ReasoningProfile;
3
+ //# sourceMappingURL=openai-compatible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-compatible.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/openai-compatible.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,gBAAgB,EAAe,MAAM,aAAa,CAAC;AAEzE,wBAAgB,qCAAqC,IAAI,gBAAgB,CAUxE"}
@@ -0,0 +1,16 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import { option, withDefault } from "./shared.js";
3
+ function buildOpenAICompatibleReasoningProfile() {
4
+ return withDefault(
5
+ {
6
+ capable: true,
7
+ paradigm: "effort",
8
+ variants: [option("none"), option("low"), option("medium"), option("high")],
9
+ supportsBudgetTokens: false
10
+ },
11
+ "medium"
12
+ );
13
+ }
14
+ export {
15
+ buildOpenAICompatibleReasoningProfile
16
+ };
@@ -0,0 +1,41 @@
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_exports = {};
20
+ __export(openai_exports, {
21
+ buildOpenAIReasoningProfile: () => buildOpenAIReasoningProfile
22
+ });
23
+ module.exports = __toCommonJS(openai_exports);
24
+ var import_openai_reasoning_effort = require("../openai-reasoning-effort.js");
25
+ var import_shared = require("./shared.js");
26
+ function buildOpenAIReasoningProfile(model) {
27
+ const efforts = (0, import_openai_reasoning_effort.getSupportedOpenAIReasoningEfforts)(model);
28
+ return (0, import_shared.withDefault)(
29
+ {
30
+ capable: true,
31
+ paradigm: "effort",
32
+ variants: efforts.map((effort) => (0, import_shared.option)(effort)),
33
+ supportsBudgetTokens: false
34
+ },
35
+ "medium"
36
+ );
37
+ }
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ buildOpenAIReasoningProfile
41
+ });
@@ -0,0 +1,3 @@
1
+ import { type ReasoningProfile } from './shared.js';
2
+ export declare function buildOpenAIReasoningProfile(model: string): ReasoningProfile;
3
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/openai.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,gBAAgB,EAAe,MAAM,aAAa,CAAC;AAEzE,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAW3E"}
@@ -0,0 +1,18 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import { getSupportedOpenAIReasoningEfforts } from "../openai-reasoning-effort.js";
3
+ import { option, withDefault } from "./shared.js";
4
+ function buildOpenAIReasoningProfile(model) {
5
+ const efforts = getSupportedOpenAIReasoningEfforts(model);
6
+ return withDefault(
7
+ {
8
+ capable: true,
9
+ paradigm: "effort",
10
+ variants: efforts.map((effort) => option(effort)),
11
+ supportsBudgetTokens: false
12
+ },
13
+ "medium"
14
+ );
15
+ }
16
+ export {
17
+ buildOpenAIReasoningProfile
18
+ };
@@ -0,0 +1,83 @@
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 openrouter_exports = {};
20
+ __export(openrouter_exports, {
21
+ getOpenRouterReasoningTarget: () => getOpenRouterReasoningTarget,
22
+ isOpenRouterGatewayProvider: () => isOpenRouterGatewayProvider
23
+ });
24
+ module.exports = __toCommonJS(openrouter_exports);
25
+ const OPENROUTER_REASONING_EXCLUDED_FAMILIES = [
26
+ "deepseek",
27
+ "minimax",
28
+ "glm",
29
+ "mistral",
30
+ "kimi",
31
+ // Temporary workaround for OpenRouter models that intermittently error with reasoning params.
32
+ // Keep this explicit so it's easy to remove once upstream stabilizes.
33
+ "k2p5"
34
+ ];
35
+ const OPENROUTER_REASONING_TARGET_RULES = {
36
+ openai: {
37
+ upstreamProvider: "openai",
38
+ acceptsModelId: () => true
39
+ },
40
+ anthropic: {
41
+ upstreamProvider: "anthropic",
42
+ acceptsModelId: () => true
43
+ },
44
+ google: {
45
+ upstreamProvider: "google",
46
+ acceptsModelId: (modelId) => modelId.includes("gemini-3")
47
+ }
48
+ };
49
+ function isOpenRouterGatewayProvider(provider) {
50
+ return provider === "openrouter" || provider === "dexto-nova";
51
+ }
52
+ function isOpenRouterReasoningAllowlistedFamily(modelLower) {
53
+ return modelLower.includes("gpt") || modelLower.includes("claude") || modelLower.includes("gemini-3");
54
+ }
55
+ function splitGatewayModelId(modelLower) {
56
+ const slashIndex = modelLower.indexOf("/");
57
+ if (slashIndex <= 0 || slashIndex >= modelLower.length - 1) return null;
58
+ const providerPrefix = modelLower.slice(0, slashIndex);
59
+ const modelId = modelLower.slice(slashIndex + 1);
60
+ return { providerPrefix, modelId };
61
+ }
62
+ function getOpenRouterReasoningTarget(model) {
63
+ const modelLower = model.toLowerCase();
64
+ for (const family of OPENROUTER_REASONING_EXCLUDED_FAMILIES) {
65
+ if (modelLower.includes(family)) return null;
66
+ }
67
+ if (!isOpenRouterReasoningAllowlistedFamily(modelLower)) {
68
+ return null;
69
+ }
70
+ const split = splitGatewayModelId(modelLower);
71
+ if (!split) return null;
72
+ const { providerPrefix, modelId } = split;
73
+ const rule = OPENROUTER_REASONING_TARGET_RULES[providerPrefix];
74
+ if (!rule || !rule.acceptsModelId(modelId, modelLower)) {
75
+ return null;
76
+ }
77
+ return { upstreamProvider: rule.upstreamProvider, modelId };
78
+ }
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ getOpenRouterReasoningTarget,
82
+ isOpenRouterGatewayProvider
83
+ });
@@ -0,0 +1,10 @@
1
+ import type { LLMProvider } from '../../types.js';
2
+ type OpenRouterGatewayProvider = 'openrouter' | 'dexto-nova';
3
+ export type OpenRouterReasoningTarget = {
4
+ upstreamProvider: LLMProvider;
5
+ modelId: string;
6
+ };
7
+ export declare function isOpenRouterGatewayProvider(provider: LLMProvider): provider is OpenRouterGatewayProvider;
8
+ export declare function getOpenRouterReasoningTarget(model: string): OpenRouterReasoningTarget | null;
9
+ export {};
10
+ //# sourceMappingURL=openrouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openrouter.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/openrouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAalD,KAAK,yBAAyB,GAAG,YAAY,GAAG,YAAY,CAAC;AAM7D,MAAM,MAAM,yBAAyB,GAAG;IACpC,gBAAgB,EAAE,WAAW,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,WAAW,GACtB,QAAQ,IAAI,yBAAyB,CAEvC;AAoBD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI,CAqB5F"}
@@ -0,0 +1,59 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ const OPENROUTER_REASONING_EXCLUDED_FAMILIES = [
3
+ "deepseek",
4
+ "minimax",
5
+ "glm",
6
+ "mistral",
7
+ "kimi",
8
+ // Temporary workaround for OpenRouter models that intermittently error with reasoning params.
9
+ // Keep this explicit so it's easy to remove once upstream stabilizes.
10
+ "k2p5"
11
+ ];
12
+ const OPENROUTER_REASONING_TARGET_RULES = {
13
+ openai: {
14
+ upstreamProvider: "openai",
15
+ acceptsModelId: () => true
16
+ },
17
+ anthropic: {
18
+ upstreamProvider: "anthropic",
19
+ acceptsModelId: () => true
20
+ },
21
+ google: {
22
+ upstreamProvider: "google",
23
+ acceptsModelId: (modelId) => modelId.includes("gemini-3")
24
+ }
25
+ };
26
+ function isOpenRouterGatewayProvider(provider) {
27
+ return provider === "openrouter" || provider === "dexto-nova";
28
+ }
29
+ function isOpenRouterReasoningAllowlistedFamily(modelLower) {
30
+ return modelLower.includes("gpt") || modelLower.includes("claude") || modelLower.includes("gemini-3");
31
+ }
32
+ function splitGatewayModelId(modelLower) {
33
+ const slashIndex = modelLower.indexOf("/");
34
+ if (slashIndex <= 0 || slashIndex >= modelLower.length - 1) return null;
35
+ const providerPrefix = modelLower.slice(0, slashIndex);
36
+ const modelId = modelLower.slice(slashIndex + 1);
37
+ return { providerPrefix, modelId };
38
+ }
39
+ function getOpenRouterReasoningTarget(model) {
40
+ const modelLower = model.toLowerCase();
41
+ for (const family of OPENROUTER_REASONING_EXCLUDED_FAMILIES) {
42
+ if (modelLower.includes(family)) return null;
43
+ }
44
+ if (!isOpenRouterReasoningAllowlistedFamily(modelLower)) {
45
+ return null;
46
+ }
47
+ const split = splitGatewayModelId(modelLower);
48
+ if (!split) return null;
49
+ const { providerPrefix, modelId } = split;
50
+ const rule = OPENROUTER_REASONING_TARGET_RULES[providerPrefix];
51
+ if (!rule || !rule.acceptsModelId(modelId, modelLower)) {
52
+ return null;
53
+ }
54
+ return { upstreamProvider: rule.upstreamProvider, modelId };
55
+ }
56
+ export {
57
+ getOpenRouterReasoningTarget,
58
+ isOpenRouterGatewayProvider
59
+ };
@@ -0,0 +1,80 @@
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 shared_exports = {};
20
+ __export(shared_exports, {
21
+ buildBudgetProfile: () => buildBudgetProfile,
22
+ buildThinkingLevelProfile: () => buildThinkingLevelProfile,
23
+ nonCapableProfile: () => nonCapableProfile,
24
+ option: () => option,
25
+ withDefault: () => withDefault
26
+ });
27
+ module.exports = __toCommonJS(shared_exports);
28
+ function option(id, label) {
29
+ return { id, label: label ?? id };
30
+ }
31
+ function withDefault(profile, preferredDefault) {
32
+ const hasPreferred = profile.variants.some((variant) => variant.id === preferredDefault);
33
+ const defaultVariant = hasPreferred ? preferredDefault : profile.variants[0]?.id;
34
+ return {
35
+ ...profile,
36
+ supportedVariants: profile.variants.map((variant) => variant.id),
37
+ ...defaultVariant !== void 0 && { defaultVariant }
38
+ };
39
+ }
40
+ function nonCapableProfile() {
41
+ return {
42
+ capable: false,
43
+ paradigm: "none",
44
+ variants: [],
45
+ supportedVariants: [],
46
+ supportsBudgetTokens: false
47
+ };
48
+ }
49
+ function buildBudgetProfile(config) {
50
+ const variants = config.includeDisabled ? [option("disabled"), option("enabled")] : [option("enabled")];
51
+ return withDefault(
52
+ {
53
+ capable: true,
54
+ paradigm: "budget",
55
+ variants,
56
+ supportsBudgetTokens: config.supportsBudgetTokens
57
+ },
58
+ "enabled"
59
+ );
60
+ }
61
+ function buildThinkingLevelProfile(config) {
62
+ const variants = config.includeDisabled ? [option("disabled"), option("minimal"), option("low"), option("medium"), option("high")] : [option("minimal"), option("low"), option("medium"), option("high")];
63
+ return withDefault(
64
+ {
65
+ capable: true,
66
+ paradigm: "thinking-level",
67
+ variants,
68
+ supportsBudgetTokens: config.supportsBudgetTokens
69
+ },
70
+ "medium"
71
+ );
72
+ }
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ buildBudgetProfile,
76
+ buildThinkingLevelProfile,
77
+ nonCapableProfile,
78
+ option,
79
+ withDefault
80
+ });
@@ -0,0 +1,25 @@
1
+ export type ReasoningParadigm = 'effort' | 'adaptive-effort' | 'thinking-level' | 'budget' | 'none';
2
+ export type ReasoningVariantOption = {
3
+ id: string;
4
+ label: string;
5
+ };
6
+ export type ReasoningProfile = {
7
+ capable: boolean;
8
+ paradigm: ReasoningParadigm;
9
+ variants: ReasoningVariantOption[];
10
+ supportedVariants: string[];
11
+ defaultVariant?: string;
12
+ supportsBudgetTokens: boolean;
13
+ };
14
+ export declare function option(id: string, label?: string): ReasoningVariantOption;
15
+ export declare function withDefault(profile: Omit<ReasoningProfile, 'defaultVariant' | 'supportedVariants'>, preferredDefault: string): ReasoningProfile;
16
+ export declare function nonCapableProfile(): ReasoningProfile;
17
+ export declare function buildBudgetProfile(config: {
18
+ includeDisabled: boolean;
19
+ supportsBudgetTokens: boolean;
20
+ }): ReasoningProfile;
21
+ export declare function buildThinkingLevelProfile(config: {
22
+ includeDisabled: boolean;
23
+ supportsBudgetTokens: boolean;
24
+ }): ReasoningProfile;
25
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/shared.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpG,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAEzE;AAED,wBAAgB,WAAW,CACvB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,EACvE,gBAAgB,EAAE,MAAM,GACzB,gBAAgB,CAQlB;AAED,wBAAgB,iBAAiB,IAAI,gBAAgB,CAQpD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;CACjC,GAAG,gBAAgB,CAcnB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAC9C,eAAe,EAAE,OAAO,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;CACjC,GAAG,gBAAgB,CAcnB"}
@@ -0,0 +1,53 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ function option(id, label) {
3
+ return { id, label: label ?? id };
4
+ }
5
+ function withDefault(profile, preferredDefault) {
6
+ const hasPreferred = profile.variants.some((variant) => variant.id === preferredDefault);
7
+ const defaultVariant = hasPreferred ? preferredDefault : profile.variants[0]?.id;
8
+ return {
9
+ ...profile,
10
+ supportedVariants: profile.variants.map((variant) => variant.id),
11
+ ...defaultVariant !== void 0 && { defaultVariant }
12
+ };
13
+ }
14
+ function nonCapableProfile() {
15
+ return {
16
+ capable: false,
17
+ paradigm: "none",
18
+ variants: [],
19
+ supportedVariants: [],
20
+ supportsBudgetTokens: false
21
+ };
22
+ }
23
+ function buildBudgetProfile(config) {
24
+ const variants = config.includeDisabled ? [option("disabled"), option("enabled")] : [option("enabled")];
25
+ return withDefault(
26
+ {
27
+ capable: true,
28
+ paradigm: "budget",
29
+ variants,
30
+ supportsBudgetTokens: config.supportsBudgetTokens
31
+ },
32
+ "enabled"
33
+ );
34
+ }
35
+ function buildThinkingLevelProfile(config) {
36
+ const variants = config.includeDisabled ? [option("disabled"), option("minimal"), option("low"), option("medium"), option("high")] : [option("minimal"), option("low"), option("medium"), option("high")];
37
+ return withDefault(
38
+ {
39
+ capable: true,
40
+ paradigm: "thinking-level",
41
+ variants,
42
+ supportsBudgetTokens: config.supportsBudgetTokens
43
+ },
44
+ "medium"
45
+ );
46
+ }
47
+ export {
48
+ buildBudgetProfile,
49
+ buildThinkingLevelProfile,
50
+ nonCapableProfile,
51
+ option,
52
+ withDefault
53
+ };
@@ -0,0 +1,46 @@
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 vertex_exports = {};
20
+ __export(vertex_exports, {
21
+ buildVertexReasoningProfile: () => buildVertexReasoningProfile
22
+ });
23
+ module.exports = __toCommonJS(vertex_exports);
24
+ var import_anthropic = require("./anthropic.js");
25
+ var import_google = require("./google.js");
26
+ function buildVertexReasoningProfile(model) {
27
+ const modelLower = model.toLowerCase();
28
+ if (modelLower.includes("claude")) {
29
+ return (0, import_anthropic.buildAnthropicReasoningProfile)({
30
+ model,
31
+ includeDisabled: true,
32
+ supportsBudgetTokensForBudgetParadigm: true,
33
+ supportsBudgetTokensForAdaptiveParadigm: false
34
+ });
35
+ }
36
+ return (0, import_google.buildGoogleReasoningProfile)({
37
+ model,
38
+ includeDisabled: true,
39
+ supportsBudgetTokensForBudgetParadigm: true,
40
+ supportsBudgetTokensForThinkingLevelParadigm: false
41
+ });
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ buildVertexReasoningProfile
46
+ });
@@ -0,0 +1,3 @@
1
+ import type { ReasoningProfile } from './shared.js';
2
+ export declare function buildVertexReasoningProfile(model: string): ReasoningProfile;
3
+ //# sourceMappingURL=vertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vertex.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/vertex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAiB3E"}
@@ -0,0 +1,23 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import { buildAnthropicReasoningProfile } from "./anthropic.js";
3
+ import { buildGoogleReasoningProfile } from "./google.js";
4
+ function buildVertexReasoningProfile(model) {
5
+ const modelLower = model.toLowerCase();
6
+ if (modelLower.includes("claude")) {
7
+ return buildAnthropicReasoningProfile({
8
+ model,
9
+ includeDisabled: true,
10
+ supportsBudgetTokensForBudgetParadigm: true,
11
+ supportsBudgetTokensForAdaptiveParadigm: false
12
+ });
13
+ }
14
+ return buildGoogleReasoningProfile({
15
+ model,
16
+ includeDisabled: true,
17
+ supportsBudgetTokensForBudgetParadigm: true,
18
+ supportsBudgetTokensForThinkingLevelParadigm: false
19
+ });
20
+ }
21
+ export {
22
+ buildVertexReasoningProfile
23
+ };
@@ -100,12 +100,30 @@ function applyModelsByProvider(modelsByProvider) {
100
100
  const maxInputTokens = typeof updated.maxInputTokens === "number" && updated.maxInputTokens > 0 ? updated.maxInputTokens : m.maxInputTokens;
101
101
  const supportedFileTypes = Array.isArray(updated.supportedFileTypes) ? updated.supportedFileTypes : m.supportedFileTypes;
102
102
  const displayName = updated.displayName ?? m.displayName;
103
+ const reasoning = typeof updated.reasoning === "boolean" ? updated.reasoning : m.reasoning;
104
+ const supportsTemperature = typeof updated.supportsTemperature === "boolean" ? updated.supportsTemperature : m.supportsTemperature;
105
+ const supportsInterleaved = typeof updated.supportsInterleaved === "boolean" ? updated.supportsInterleaved : m.supportsInterleaved;
106
+ const supportsToolCall = typeof updated.supportsToolCall === "boolean" ? updated.supportsToolCall : m.supportsToolCall;
107
+ const releaseDate = updated.releaseDate ?? m.releaseDate;
108
+ const status = updated.status ?? m.status;
109
+ const modalities = updated.modalities ?? m.modalities;
110
+ const providerMetadata = updated.providerMetadata ?? m.providerMetadata;
111
+ const interleaved = updated.interleaved ?? m.interleaved;
103
112
  const pricing = updated.pricing ?? m.pricing;
104
113
  merged.push({
105
114
  name,
106
115
  maxInputTokens,
107
116
  supportedFileTypes,
108
117
  ...displayName ? { displayName } : {},
118
+ ...typeof reasoning === "boolean" ? { reasoning } : {},
119
+ ...typeof supportsTemperature === "boolean" ? { supportsTemperature } : {},
120
+ ...typeof supportsInterleaved === "boolean" ? { supportsInterleaved } : {},
121
+ ...typeof supportsToolCall === "boolean" ? { supportsToolCall } : {},
122
+ ...releaseDate ? { releaseDate } : {},
123
+ ...status ? { status } : {},
124
+ ...modalities ? { modalities } : {},
125
+ ...providerMetadata ? { providerMetadata } : {},
126
+ ...interleaved ? { interleaved } : {},
109
127
  ...pricing ? { pricing } : {}
110
128
  });
111
129
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auto-update.d.ts","sourceRoot":"","sources":["../../../src/llm/registry/auto-update.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOvD,KAAK,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAuKjE,MAAM,MAAM,2BAA2B,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC3C,CAAC;AAMF,wBAAgB,8BAA8B,IAAI,2BAA2B,CAU5E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAO5E;AAiBD,wBAAsB,uBAAuB,CAAC,OAAO,CAAC,EAAE;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDhB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CA6BP"}
1
+ {"version":3,"file":"auto-update.d.ts","sourceRoot":"","sources":["../../../src/llm/registry/auto-update.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOvD,KAAK,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAmMjE,MAAM,MAAM,2BAA2B,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC3C,CAAC;AAMF,wBAAgB,8BAA8B,IAAI,2BAA2B,CAU5E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAO5E;AAiBD,wBAAsB,uBAAuB,CAAC,OAAO,CAAC,EAAE;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDhB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CA6BP"}
@@ -65,12 +65,30 @@ function applyModelsByProvider(modelsByProvider) {
65
65
  const maxInputTokens = typeof updated.maxInputTokens === "number" && updated.maxInputTokens > 0 ? updated.maxInputTokens : m.maxInputTokens;
66
66
  const supportedFileTypes = Array.isArray(updated.supportedFileTypes) ? updated.supportedFileTypes : m.supportedFileTypes;
67
67
  const displayName = updated.displayName ?? m.displayName;
68
+ const reasoning = typeof updated.reasoning === "boolean" ? updated.reasoning : m.reasoning;
69
+ const supportsTemperature = typeof updated.supportsTemperature === "boolean" ? updated.supportsTemperature : m.supportsTemperature;
70
+ const supportsInterleaved = typeof updated.supportsInterleaved === "boolean" ? updated.supportsInterleaved : m.supportsInterleaved;
71
+ const supportsToolCall = typeof updated.supportsToolCall === "boolean" ? updated.supportsToolCall : m.supportsToolCall;
72
+ const releaseDate = updated.releaseDate ?? m.releaseDate;
73
+ const status = updated.status ?? m.status;
74
+ const modalities = updated.modalities ?? m.modalities;
75
+ const providerMetadata = updated.providerMetadata ?? m.providerMetadata;
76
+ const interleaved = updated.interleaved ?? m.interleaved;
68
77
  const pricing = updated.pricing ?? m.pricing;
69
78
  merged.push({
70
79
  name,
71
80
  maxInputTokens,
72
81
  supportedFileTypes,
73
82
  ...displayName ? { displayName } : {},
83
+ ...typeof reasoning === "boolean" ? { reasoning } : {},
84
+ ...typeof supportsTemperature === "boolean" ? { supportsTemperature } : {},
85
+ ...typeof supportsInterleaved === "boolean" ? { supportsInterleaved } : {},
86
+ ...typeof supportsToolCall === "boolean" ? { supportsToolCall } : {},
87
+ ...releaseDate ? { releaseDate } : {},
88
+ ...status ? { status } : {},
89
+ ...modalities ? { modalities } : {},
90
+ ...providerMetadata ? { providerMetadata } : {},
91
+ ...interleaved ? { interleaved } : {},
74
92
  ...pricing ? { pricing } : {}
75
93
  });
76
94
  }