@dexto/core 1.6.1 → 1.6.3

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 (140) 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/{utils/user-info.cjs → llm/reasoning/anthropic-betas.cjs} +9 -8
  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/confirmation/allowed-tools-provider/types.d.ts +1 -1
  127. package/dist/tools/tool-manager.cjs +88 -2
  128. package/dist/tools/tool-manager.d.ts +15 -1
  129. package/dist/tools/tool-manager.d.ts.map +1 -1
  130. package/dist/tools/tool-manager.js +88 -2
  131. package/dist/utils/service-initializer.d.ts +1 -0
  132. package/dist/utils/service-initializer.d.ts.map +1 -1
  133. package/package.json +7 -5
  134. package/dist/utils/schema-metadata.cjs +0 -235
  135. package/dist/utils/schema-metadata.d.ts +0 -82
  136. package/dist/utils/schema-metadata.d.ts.map +0 -1
  137. package/dist/utils/schema-metadata.js +0 -208
  138. package/dist/utils/user-info.d.ts +0 -2
  139. package/dist/utils/user-info.d.ts.map +0 -1
  140. package/dist/utils/user-info.js +0 -7
@@ -0,0 +1,86 @@
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
+ });
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,61 @@
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
+ };
@@ -0,0 +1,113 @@
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
+ });
@@ -0,0 +1,13 @@
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
@@ -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"}