@dexto/core 1.6.0 → 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 (188) hide show
  1. package/dist/agent/DextoAgent.cjs +79 -5
  2. package/dist/agent/DextoAgent.d.ts +24 -2
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +79 -5
  5. package/dist/agent/agent-options.d.ts +6 -1
  6. package/dist/agent/agent-options.d.ts.map +1 -1
  7. package/dist/agent/schemas.d.ts +18 -18
  8. package/dist/approval/manager.cjs +87 -27
  9. package/dist/approval/manager.d.ts +10 -1
  10. package/dist/approval/manager.d.ts.map +1 -1
  11. package/dist/approval/manager.js +87 -27
  12. package/dist/approval/schemas.cjs +22 -8
  13. package/dist/approval/schemas.d.ts +276 -102
  14. package/dist/approval/schemas.d.ts.map +1 -1
  15. package/dist/approval/schemas.js +22 -8
  16. package/dist/context/manager.cjs +2 -2
  17. package/dist/context/manager.d.ts +2 -1
  18. package/dist/context/manager.d.ts.map +1 -1
  19. package/dist/context/manager.js +2 -2
  20. package/dist/context/types.d.ts +3 -2
  21. package/dist/context/types.d.ts.map +1 -1
  22. package/dist/events/index.d.ts +26 -13
  23. package/dist/events/index.d.ts.map +1 -1
  24. package/dist/hooks/index.d.ts +1 -1
  25. package/dist/hooks/index.d.ts.map +1 -1
  26. package/dist/hooks/types.d.ts +1 -22
  27. package/dist/hooks/types.d.ts.map +1 -1
  28. package/dist/llm/executor/provider-options.cjs +223 -28
  29. package/dist/llm/executor/provider-options.d.ts +3 -37
  30. package/dist/llm/executor/provider-options.d.ts.map +1 -1
  31. package/dist/llm/executor/provider-options.js +227 -27
  32. package/dist/llm/executor/stream-processor.cjs +57 -34
  33. package/dist/llm/executor/stream-processor.d.ts +12 -4
  34. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  35. package/dist/llm/executor/stream-processor.js +55 -32
  36. package/dist/llm/executor/turn-executor.cjs +66 -44
  37. package/dist/llm/executor/turn-executor.d.ts +3 -3
  38. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  39. package/dist/llm/executor/turn-executor.js +56 -34
  40. package/dist/llm/formatters/vercel.cjs +15 -3
  41. package/dist/llm/formatters/vercel.d.ts +1 -0
  42. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  43. package/dist/llm/formatters/vercel.js +15 -3
  44. package/dist/llm/index.cjs +8 -0
  45. package/dist/llm/index.d.ts +2 -1
  46. package/dist/llm/index.d.ts.map +1 -1
  47. package/dist/llm/index.js +7 -0
  48. package/dist/llm/providers/local/schemas.d.ts +2 -2
  49. package/dist/llm/providers/openrouter-model-registry.cjs +66 -11
  50. package/dist/llm/providers/openrouter-model-registry.d.ts +26 -0
  51. package/dist/llm/providers/openrouter-model-registry.d.ts.map +1 -1
  52. package/dist/llm/providers/openrouter-model-registry.js +65 -11
  53. package/dist/llm/reasoning/anthropic-betas.cjs +31 -0
  54. package/dist/llm/reasoning/anthropic-betas.d.ts +3 -0
  55. package/dist/llm/reasoning/anthropic-betas.d.ts.map +1 -0
  56. package/dist/llm/reasoning/anthropic-betas.js +7 -0
  57. package/dist/llm/reasoning/anthropic-thinking.cjs +79 -0
  58. package/dist/llm/reasoning/anthropic-thinking.d.ts +15 -0
  59. package/dist/llm/reasoning/anthropic-thinking.d.ts.map +1 -0
  60. package/dist/llm/reasoning/anthropic-thinking.js +52 -0
  61. package/dist/llm/reasoning/openai-reasoning-effort.cjs +86 -0
  62. package/dist/llm/reasoning/openai-reasoning-effort.d.ts +5 -0
  63. package/dist/llm/reasoning/openai-reasoning-effort.d.ts.map +1 -0
  64. package/dist/llm/reasoning/openai-reasoning-effort.js +61 -0
  65. package/dist/llm/reasoning/profile.cjs +113 -0
  66. package/dist/llm/reasoning/profile.d.ts +13 -0
  67. package/dist/llm/reasoning/profile.d.ts.map +1 -0
  68. package/dist/llm/reasoning/profile.js +92 -0
  69. package/dist/llm/reasoning/profiles/anthropic.cjs +61 -0
  70. package/dist/llm/reasoning/profiles/anthropic.d.ts +8 -0
  71. package/dist/llm/reasoning/profiles/anthropic.d.ts.map +1 -0
  72. package/dist/llm/reasoning/profiles/anthropic.js +45 -0
  73. package/dist/llm/reasoning/profiles/bedrock.cjs +54 -0
  74. package/dist/llm/reasoning/profiles/bedrock.d.ts +3 -0
  75. package/dist/llm/reasoning/profiles/bedrock.d.ts.map +1 -0
  76. package/dist/llm/reasoning/profiles/bedrock.js +36 -0
  77. package/dist/llm/reasoning/profiles/google.cjs +45 -0
  78. package/dist/llm/reasoning/profiles/google.d.ts +9 -0
  79. package/dist/llm/reasoning/profiles/google.d.ts.map +1 -0
  80. package/dist/llm/reasoning/profiles/google.js +21 -0
  81. package/dist/llm/reasoning/profiles/openai-compatible.cjs +39 -0
  82. package/dist/llm/reasoning/profiles/openai-compatible.d.ts +3 -0
  83. package/dist/llm/reasoning/profiles/openai-compatible.d.ts.map +1 -0
  84. package/dist/llm/reasoning/profiles/openai-compatible.js +16 -0
  85. package/dist/llm/reasoning/profiles/openai.cjs +41 -0
  86. package/dist/llm/reasoning/profiles/openai.d.ts +3 -0
  87. package/dist/llm/reasoning/profiles/openai.d.ts.map +1 -0
  88. package/dist/llm/reasoning/profiles/openai.js +18 -0
  89. package/dist/llm/reasoning/profiles/openrouter.cjs +83 -0
  90. package/dist/llm/reasoning/profiles/openrouter.d.ts +10 -0
  91. package/dist/llm/reasoning/profiles/openrouter.d.ts.map +1 -0
  92. package/dist/llm/reasoning/profiles/openrouter.js +59 -0
  93. package/dist/llm/reasoning/profiles/shared.cjs +80 -0
  94. package/dist/llm/reasoning/profiles/shared.d.ts +25 -0
  95. package/dist/llm/reasoning/profiles/shared.d.ts.map +1 -0
  96. package/dist/llm/reasoning/profiles/shared.js +53 -0
  97. package/dist/llm/reasoning/profiles/vertex.cjs +46 -0
  98. package/dist/llm/reasoning/profiles/vertex.d.ts +3 -0
  99. package/dist/llm/reasoning/profiles/vertex.d.ts.map +1 -0
  100. package/dist/llm/reasoning/profiles/vertex.js +23 -0
  101. package/dist/llm/registry/auto-update.cjs +18 -0
  102. package/dist/llm/registry/auto-update.d.ts.map +1 -1
  103. package/dist/llm/registry/auto-update.js +18 -0
  104. package/dist/llm/registry/index.cjs +126 -26
  105. package/dist/llm/registry/index.d.ts +48 -4
  106. package/dist/llm/registry/index.d.ts.map +1 -1
  107. package/dist/llm/registry/index.js +136 -28
  108. package/dist/llm/registry/models.generated.cjs +5198 -59
  109. package/dist/llm/registry/models.generated.d.ts +1893 -76
  110. package/dist/llm/registry/models.generated.d.ts.map +1 -1
  111. package/dist/llm/registry/models.generated.js +5196 -58
  112. package/dist/llm/registry/sync.cjs +72 -1
  113. package/dist/llm/registry/sync.d.ts +21 -1
  114. package/dist/llm/registry/sync.d.ts.map +1 -1
  115. package/dist/llm/registry/sync.js +72 -1
  116. package/dist/llm/resolver.cjs +13 -1
  117. package/dist/llm/resolver.d.ts.map +1 -1
  118. package/dist/llm/resolver.js +13 -1
  119. package/dist/llm/schemas.cjs +75 -14
  120. package/dist/llm/schemas.d.ts +84 -27
  121. package/dist/llm/schemas.d.ts.map +1 -1
  122. package/dist/llm/schemas.js +75 -14
  123. package/dist/llm/services/factory.cjs +55 -8
  124. package/dist/llm/services/factory.d.ts +1 -1
  125. package/dist/llm/services/factory.d.ts.map +1 -1
  126. package/dist/llm/services/factory.js +58 -8
  127. package/dist/llm/services/vercel.cjs +2 -2
  128. package/dist/llm/services/vercel.js +2 -2
  129. package/dist/llm/types.d.ts +9 -0
  130. package/dist/llm/types.d.ts.map +1 -1
  131. package/dist/logger/default-logger-factory.d.ts +12 -12
  132. package/dist/logger/v2/dexto-logger.cjs +35 -0
  133. package/dist/logger/v2/dexto-logger.d.ts +19 -0
  134. package/dist/logger/v2/dexto-logger.d.ts.map +1 -1
  135. package/dist/logger/v2/dexto-logger.js +35 -0
  136. package/dist/logger/v2/schemas.d.ts +6 -6
  137. package/dist/logger/v2/test-utils.cjs +2 -0
  138. package/dist/logger/v2/test-utils.d.ts.map +1 -1
  139. package/dist/logger/v2/test-utils.js +2 -0
  140. package/dist/logger/v2/types.d.ts +14 -1
  141. package/dist/logger/v2/types.d.ts.map +1 -1
  142. package/dist/mcp/schemas.d.ts +15 -15
  143. package/dist/memory/schemas.d.ts +4 -4
  144. package/dist/prompts/index.cjs +9 -0
  145. package/dist/prompts/index.d.ts +1 -0
  146. package/dist/prompts/index.d.ts.map +1 -1
  147. package/dist/prompts/index.js +10 -0
  148. package/dist/prompts/prompt-manager.cjs +2 -0
  149. package/dist/prompts/prompt-manager.d.ts.map +1 -1
  150. package/dist/prompts/prompt-manager.js +2 -0
  151. package/dist/prompts/providers/config-prompt-provider.cjs +11 -1
  152. package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -1
  153. package/dist/prompts/providers/config-prompt-provider.js +11 -1
  154. package/dist/prompts/schemas.cjs +2 -2
  155. package/dist/prompts/schemas.d.ts +7 -7
  156. package/dist/prompts/schemas.js +2 -2
  157. package/dist/prompts/types.d.ts +6 -2
  158. package/dist/prompts/types.d.ts.map +1 -1
  159. package/dist/systemPrompt/in-built-prompts.cjs +5 -5
  160. package/dist/systemPrompt/in-built-prompts.d.ts +1 -1
  161. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  162. package/dist/systemPrompt/in-built-prompts.js +5 -5
  163. package/dist/systemPrompt/schemas.d.ts +5 -5
  164. package/dist/systemPrompt/types.d.ts +11 -0
  165. package/dist/systemPrompt/types.d.ts.map +1 -1
  166. package/dist/tools/display-types.d.ts +10 -0
  167. package/dist/tools/display-types.d.ts.map +1 -1
  168. package/dist/tools/index.cjs +3 -1
  169. package/dist/tools/index.d.ts +1 -0
  170. package/dist/tools/index.d.ts.map +1 -1
  171. package/dist/tools/index.js +1 -0
  172. package/dist/tools/presentation.cjs +49 -0
  173. package/dist/tools/presentation.d.ts +11 -0
  174. package/dist/tools/presentation.d.ts.map +1 -0
  175. package/dist/tools/presentation.js +24 -0
  176. package/dist/tools/tool-manager.cjs +389 -136
  177. package/dist/tools/tool-manager.d.ts +36 -24
  178. package/dist/tools/tool-manager.d.ts.map +1 -1
  179. package/dist/tools/tool-manager.js +389 -136
  180. package/dist/tools/types.d.ts +134 -55
  181. package/dist/tools/types.d.ts.map +1 -1
  182. package/dist/utils/path.cjs +10 -1
  183. package/dist/utils/path.d.ts +5 -2
  184. package/dist/utils/path.d.ts.map +1 -1
  185. package/dist/utils/path.js +10 -1
  186. package/dist/utils/service-initializer.d.ts +1 -0
  187. package/dist/utils/service-initializer.d.ts.map +1 -1
  188. package/package.json +7 -5
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,92 @@
1
+ import "../../chunk-PTJYTZNU.js";
2
+ import { isReasoningCapableModel } from "../registry/index.js";
3
+ import { isAnthropicAdaptiveThinkingModel, parseClaudeVersion } from "./anthropic-thinking.js";
4
+ import { buildAnthropicReasoningProfile } from "./profiles/anthropic.js";
5
+ import { buildBedrockReasoningProfile } from "./profiles/bedrock.js";
6
+ import { buildGoogleReasoningProfile } from "./profiles/google.js";
7
+ import { buildOpenAICompatibleReasoningProfile } from "./profiles/openai-compatible.js";
8
+ import { buildOpenAIReasoningProfile } from "./profiles/openai.js";
9
+ import {
10
+ getOpenRouterReasoningTarget,
11
+ isOpenRouterGatewayProvider
12
+ } from "./profiles/openrouter.js";
13
+ import { buildVertexReasoningProfile } from "./profiles/vertex.js";
14
+ import { nonCapableProfile } from "./profiles/shared.js";
15
+ const ANTHROPIC_PROFILE_CONFIG = {
16
+ includeDisabled: true,
17
+ supportsBudgetTokensForBudgetParadigm: true,
18
+ supportsBudgetTokensForAdaptiveParadigm: false
19
+ };
20
+ const GOOGLE_PROFILE_CONFIG = {
21
+ includeDisabled: true,
22
+ supportsBudgetTokensForBudgetParadigm: true,
23
+ supportsBudgetTokensForThinkingLevelParadigm: false
24
+ };
25
+ function isAnthropicStyleReasoningCapable(provider, model) {
26
+ return isReasoningCapableModel(model, provider) || parseClaudeVersion(model) !== null || isAnthropicAdaptiveThinkingModel(model);
27
+ }
28
+ function getNativeReasoningProfile(provider, model) {
29
+ switch (provider) {
30
+ case "openai":
31
+ if (!isReasoningCapableModel(model, "openai")) {
32
+ return nonCapableProfile();
33
+ }
34
+ return buildOpenAIReasoningProfile(model);
35
+ case "anthropic":
36
+ if (!isAnthropicStyleReasoningCapable("anthropic", model)) {
37
+ return nonCapableProfile();
38
+ }
39
+ return buildAnthropicReasoningProfile({ model, ...ANTHROPIC_PROFILE_CONFIG });
40
+ case "bedrock":
41
+ if (!isReasoningCapableModel(model, "bedrock")) {
42
+ return nonCapableProfile();
43
+ }
44
+ return buildBedrockReasoningProfile(model);
45
+ case "google":
46
+ if (!isReasoningCapableModel(model, "google")) {
47
+ return nonCapableProfile();
48
+ }
49
+ return buildGoogleReasoningProfile({ model, ...GOOGLE_PROFILE_CONFIG });
50
+ case "vertex":
51
+ if (!isAnthropicStyleReasoningCapable("vertex", model)) {
52
+ return nonCapableProfile();
53
+ }
54
+ return buildVertexReasoningProfile(model);
55
+ case "openai-compatible":
56
+ if (!isReasoningCapableModel(model, "openai-compatible")) {
57
+ return nonCapableProfile();
58
+ }
59
+ return buildOpenAICompatibleReasoningProfile();
60
+ default:
61
+ return nonCapableProfile();
62
+ }
63
+ }
64
+ function toGatewayReasoningProfile(nativeProfile) {
65
+ if (!nativeProfile.capable) {
66
+ return nonCapableProfile();
67
+ }
68
+ return {
69
+ ...nativeProfile,
70
+ variants: nativeProfile.variants.map((variant) => ({ ...variant })),
71
+ supportedVariants: [...nativeProfile.supportedVariants],
72
+ supportsBudgetTokens: true
73
+ };
74
+ }
75
+ function getReasoningProfile(provider, model) {
76
+ if (isOpenRouterGatewayProvider(provider)) {
77
+ const target = getOpenRouterReasoningTarget(model);
78
+ if (!target) {
79
+ return nonCapableProfile();
80
+ }
81
+ const nativeProfile = getNativeReasoningProfile(target.upstreamProvider, target.modelId);
82
+ return toGatewayReasoningProfile(nativeProfile);
83
+ }
84
+ return getNativeReasoningProfile(provider, model);
85
+ }
86
+ function supportsReasoningVariant(profile, variant) {
87
+ return profile.variants.some((entry) => entry.id === variant);
88
+ }
89
+ export {
90
+ getReasoningProfile,
91
+ supportsReasoningVariant
92
+ };
@@ -0,0 +1,61 @@
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_exports = {};
20
+ __export(anthropic_exports, {
21
+ buildAnthropicReasoningProfile: () => buildAnthropicReasoningProfile
22
+ });
23
+ module.exports = __toCommonJS(anthropic_exports);
24
+ var import_anthropic_thinking = require("../anthropic-thinking.js");
25
+ var import_shared = require("./shared.js");
26
+ function buildAnthropicAdaptiveProfile(config) {
27
+ const variants = [];
28
+ if (config.includeDisabled) {
29
+ variants.push((0, import_shared.option)("disabled"));
30
+ }
31
+ variants.push((0, import_shared.option)("low"), (0, import_shared.option)("medium"), (0, import_shared.option)("high"));
32
+ if ((0, import_anthropic_thinking.isAnthropicOpusAdaptiveThinkingModel)(config.model)) {
33
+ variants.push((0, import_shared.option)("max"));
34
+ }
35
+ return (0, import_shared.withDefault)(
36
+ {
37
+ capable: true,
38
+ paradigm: "adaptive-effort",
39
+ variants,
40
+ supportsBudgetTokens: config.supportsBudgetTokens
41
+ },
42
+ "medium"
43
+ );
44
+ }
45
+ function buildAnthropicReasoningProfile(config) {
46
+ if ((0, import_anthropic_thinking.isAnthropicAdaptiveThinkingModel)(config.model)) {
47
+ return buildAnthropicAdaptiveProfile({
48
+ model: config.model,
49
+ includeDisabled: config.includeDisabled,
50
+ supportsBudgetTokens: config.supportsBudgetTokensForAdaptiveParadigm
51
+ });
52
+ }
53
+ return (0, import_shared.buildBudgetProfile)({
54
+ includeDisabled: config.includeDisabled,
55
+ supportsBudgetTokens: config.supportsBudgetTokensForBudgetParadigm
56
+ });
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ buildAnthropicReasoningProfile
61
+ });
@@ -0,0 +1,8 @@
1
+ import { type ReasoningProfile } from './shared.js';
2
+ export declare function buildAnthropicReasoningProfile(config: {
3
+ model: string;
4
+ includeDisabled: boolean;
5
+ supportsBudgetTokensForBudgetParadigm: boolean;
6
+ supportsBudgetTokensForAdaptiveParadigm: boolean;
7
+ }): ReasoningProfile;
8
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/anthropic.ts"],"names":[],"mappings":"AAIA,OAAO,EAGH,KAAK,gBAAgB,EAGxB,MAAM,aAAa,CAAC;AA4BrB,wBAAgB,8BAA8B,CAAC,MAAM,EAAE;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,qCAAqC,EAAE,OAAO,CAAC;IAC/C,uCAAuC,EAAE,OAAO,CAAC;CACpD,GAAG,gBAAgB,CAanB"}
@@ -0,0 +1,45 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import {
3
+ isAnthropicAdaptiveThinkingModel,
4
+ isAnthropicOpusAdaptiveThinkingModel
5
+ } from "../anthropic-thinking.js";
6
+ import {
7
+ buildBudgetProfile,
8
+ option,
9
+ withDefault
10
+ } from "./shared.js";
11
+ function buildAnthropicAdaptiveProfile(config) {
12
+ const variants = [];
13
+ if (config.includeDisabled) {
14
+ variants.push(option("disabled"));
15
+ }
16
+ variants.push(option("low"), option("medium"), option("high"));
17
+ if (isAnthropicOpusAdaptiveThinkingModel(config.model)) {
18
+ variants.push(option("max"));
19
+ }
20
+ return withDefault(
21
+ {
22
+ capable: true,
23
+ paradigm: "adaptive-effort",
24
+ variants,
25
+ supportsBudgetTokens: config.supportsBudgetTokens
26
+ },
27
+ "medium"
28
+ );
29
+ }
30
+ function buildAnthropicReasoningProfile(config) {
31
+ if (isAnthropicAdaptiveThinkingModel(config.model)) {
32
+ return buildAnthropicAdaptiveProfile({
33
+ model: config.model,
34
+ includeDisabled: config.includeDisabled,
35
+ supportsBudgetTokens: config.supportsBudgetTokensForAdaptiveParadigm
36
+ });
37
+ }
38
+ return buildBudgetProfile({
39
+ includeDisabled: config.includeDisabled,
40
+ supportsBudgetTokens: config.supportsBudgetTokensForBudgetParadigm
41
+ });
42
+ }
43
+ export {
44
+ buildAnthropicReasoningProfile
45
+ };
@@ -0,0 +1,54 @@
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 bedrock_exports = {};
20
+ __export(bedrock_exports, {
21
+ buildBedrockReasoningProfile: () => buildBedrockReasoningProfile
22
+ });
23
+ module.exports = __toCommonJS(bedrock_exports);
24
+ var import_shared = require("./shared.js");
25
+ function isBedrockAnthropicModel(model) {
26
+ return model.toLowerCase().includes("anthropic");
27
+ }
28
+ function isBedrockNovaModel(model) {
29
+ return model.toLowerCase().includes("nova");
30
+ }
31
+ function buildBedrockReasoningProfile(model) {
32
+ if (isBedrockAnthropicModel(model)) {
33
+ return (0, import_shared.buildBudgetProfile)({
34
+ includeDisabled: true,
35
+ supportsBudgetTokens: true
36
+ });
37
+ }
38
+ if (isBedrockNovaModel(model)) {
39
+ return (0, import_shared.withDefault)(
40
+ {
41
+ capable: true,
42
+ paradigm: "effort",
43
+ variants: [(0, import_shared.option)("disabled"), (0, import_shared.option)("low"), (0, import_shared.option)("medium"), (0, import_shared.option)("high")],
44
+ supportsBudgetTokens: false
45
+ },
46
+ "medium"
47
+ );
48
+ }
49
+ return (0, import_shared.nonCapableProfile)();
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ buildBedrockReasoningProfile
54
+ });
@@ -0,0 +1,3 @@
1
+ import { type ReasoningProfile } from './shared.js';
2
+ export declare function buildBedrockReasoningProfile(model: string): ReasoningProfile;
3
+ //# sourceMappingURL=bedrock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/bedrock.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,gBAAgB,EAExB,MAAM,aAAa,CAAC;AAUrB,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAqB5E"}
@@ -0,0 +1,36 @@
1
+ import "../../../chunk-PTJYTZNU.js";
2
+ import {
3
+ buildBudgetProfile,
4
+ nonCapableProfile,
5
+ option,
6
+ withDefault
7
+ } from "./shared.js";
8
+ function isBedrockAnthropicModel(model) {
9
+ return model.toLowerCase().includes("anthropic");
10
+ }
11
+ function isBedrockNovaModel(model) {
12
+ return model.toLowerCase().includes("nova");
13
+ }
14
+ function buildBedrockReasoningProfile(model) {
15
+ if (isBedrockAnthropicModel(model)) {
16
+ return buildBudgetProfile({
17
+ includeDisabled: true,
18
+ supportsBudgetTokens: true
19
+ });
20
+ }
21
+ if (isBedrockNovaModel(model)) {
22
+ return withDefault(
23
+ {
24
+ capable: true,
25
+ paradigm: "effort",
26
+ variants: [option("disabled"), option("low"), option("medium"), option("high")],
27
+ supportsBudgetTokens: false
28
+ },
29
+ "medium"
30
+ );
31
+ }
32
+ return nonCapableProfile();
33
+ }
34
+ export {
35
+ buildBedrockReasoningProfile
36
+ };
@@ -0,0 +1,45 @@
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 google_exports = {};
20
+ __export(google_exports, {
21
+ buildGoogleReasoningProfile: () => buildGoogleReasoningProfile,
22
+ isGemini3Model: () => isGemini3Model
23
+ });
24
+ module.exports = __toCommonJS(google_exports);
25
+ var import_shared = require("./shared.js");
26
+ function isGemini3Model(model) {
27
+ return model.toLowerCase().includes("gemini-3");
28
+ }
29
+ function buildGoogleReasoningProfile(config) {
30
+ if (isGemini3Model(config.model)) {
31
+ return (0, import_shared.buildThinkingLevelProfile)({
32
+ includeDisabled: config.includeDisabled,
33
+ supportsBudgetTokens: config.supportsBudgetTokensForThinkingLevelParadigm
34
+ });
35
+ }
36
+ return (0, import_shared.buildBudgetProfile)({
37
+ includeDisabled: config.includeDisabled,
38
+ supportsBudgetTokens: config.supportsBudgetTokensForBudgetParadigm
39
+ });
40
+ }
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ buildGoogleReasoningProfile,
44
+ isGemini3Model
45
+ });
@@ -0,0 +1,9 @@
1
+ import { type ReasoningProfile } from './shared.js';
2
+ export declare function isGemini3Model(model: string): boolean;
3
+ export declare function buildGoogleReasoningProfile(config: {
4
+ model: string;
5
+ includeDisabled: boolean;
6
+ supportsBudgetTokensForBudgetParadigm: boolean;
7
+ supportsBudgetTokensForThinkingLevelParadigm: boolean;
8
+ }): ReasoningProfile;
9
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../../src/llm/reasoning/profiles/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEnG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,qCAAqC,EAAE,OAAO,CAAC;IAC/C,4CAA4C,EAAE,OAAO,CAAC;CACzD,GAAG,gBAAgB,CAYnB"}
@@ -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"}