@dexto/core 1.8.0 → 1.8.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.
- package/dist/agent/DextoAgent.cjs +10 -16
- package/dist/agent/DextoAgent.d.ts +2 -2
- package/dist/agent/DextoAgent.d.ts.map +1 -1
- package/dist/agent/DextoAgent.js +8 -5
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/context/compaction/overflow.d.ts +1 -1
- package/dist/context/compaction/overflow.d.ts.map +1 -1
- package/dist/context/manager.cjs +8 -8
- package/dist/context/manager.d.ts +1 -1
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/manager.js +1 -1
- package/dist/context/types.d.ts +1 -1
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/utils.cjs +3 -3
- package/dist/context/utils.d.ts +1 -1
- package/dist/context/utils.d.ts.map +1 -1
- package/dist/context/utils.js +1 -1
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/index.browser.cjs +9 -9
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/llm/auth/index.cjs +16 -0
- package/dist/llm/auth/index.d.ts +2 -0
- package/dist/llm/auth/index.d.ts.map +1 -0
- package/dist/llm/auth/index.js +0 -0
- package/dist/llm/auth/types.cjs +16 -0
- package/dist/llm/auth/types.d.ts +25 -0
- package/dist/llm/auth/types.d.ts.map +1 -0
- package/dist/llm/auth/types.js +0 -0
- package/dist/llm/curation-config.cjs +3 -3
- package/dist/llm/curation-config.d.ts +1 -1
- package/dist/llm/curation-config.js +3 -3
- package/dist/llm/curation.cjs +2 -2
- package/dist/llm/curation.d.ts +2 -2
- package/dist/llm/curation.d.ts.map +1 -1
- package/dist/llm/curation.js +1 -1
- package/dist/llm/errors.cjs +3 -3
- package/dist/llm/errors.d.ts +1 -1
- package/dist/llm/errors.d.ts.map +1 -1
- package/dist/llm/errors.js +1 -1
- package/dist/llm/executor/provider-options.cjs +22 -25
- package/dist/llm/executor/provider-options.d.ts +1 -1
- package/dist/llm/executor/provider-options.d.ts.map +1 -1
- package/dist/llm/executor/provider-options.js +17 -16
- package/dist/llm/executor/stream-processor.d.ts +1 -1
- package/dist/llm/executor/stream-processor.d.ts.map +1 -1
- package/dist/llm/executor/turn-executor.d.ts +1 -1
- package/dist/llm/executor/turn-executor.d.ts.map +1 -1
- package/dist/llm/executor/types.d.ts +1 -1
- package/dist/llm/executor/types.d.ts.map +1 -1
- package/dist/llm/formatters/vercel.cjs +2 -2
- package/dist/llm/formatters/vercel.d.ts +1 -1
- package/dist/llm/formatters/vercel.d.ts.map +1 -1
- package/dist/llm/index.cjs +0 -4
- package/dist/llm/index.d.ts +1 -2
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +0 -2
- package/dist/llm/registry/auto-update.cjs +5 -5
- package/dist/llm/registry/auto-update.d.ts.map +1 -1
- package/dist/llm/registry/auto-update.js +2 -2
- package/dist/llm/registry/index.cjs +96 -789
- package/dist/llm/registry/index.d.ts +4 -323
- package/dist/llm/registry/index.d.ts.map +1 -1
- package/dist/llm/registry/index.js +99 -762
- package/dist/llm/registry/sync.d.ts +2 -2
- package/dist/llm/registry/sync.d.ts.map +1 -1
- package/dist/llm/resolver.cjs +7 -6
- package/dist/llm/resolver.d.ts +1 -1
- package/dist/llm/resolver.js +4 -4
- package/dist/llm/schemas.cjs +14 -14
- package/dist/llm/schemas.d.ts +1 -1
- package/dist/llm/schemas.d.ts.map +1 -1
- package/dist/llm/schemas.js +5 -4
- package/dist/llm/services/factory.cjs +124 -33
- package/dist/llm/services/factory.d.ts.map +1 -1
- package/dist/llm/services/factory.js +128 -35
- package/dist/llm/services/types.d.ts +8 -1
- package/dist/llm/services/types.d.ts.map +1 -1
- package/dist/llm/usage-metadata.cjs +3 -3
- package/dist/llm/usage-metadata.d.ts +2 -2
- package/dist/llm/usage-metadata.d.ts.map +1 -1
- package/dist/llm/usage-metadata.js +1 -4
- package/dist/llm/usage-summary.d.ts +1 -1
- package/dist/llm/validation.cjs +4 -4
- package/dist/llm/validation.d.ts +1 -1
- package/dist/llm/validation.js +1 -1
- package/dist/session/chat-session.cjs +2 -12
- package/dist/session/chat-session.d.ts +2 -0
- package/dist/session/chat-session.d.ts.map +1 -1
- package/dist/session/chat-session.js +2 -13
- package/dist/session/session-manager.cjs +4 -1
- package/dist/session/session-manager.d.ts +5 -1
- package/dist/session/session-manager.d.ts.map +1 -1
- package/dist/session/session-manager.js +4 -1
- package/dist/utils/api-key-resolver.d.ts +1 -1
- package/dist/utils/api-key-resolver.d.ts.map +1 -1
- package/dist/utils/result.cjs +1 -1
- package/dist/utils/result.js +1 -1
- package/dist/utils/service-initializer.cjs +3 -0
- package/dist/utils/service-initializer.d.ts +2 -0
- package/dist/utils/service-initializer.d.ts.map +1 -1
- package/dist/utils/service-initializer.js +3 -0
- package/package.json +3 -2
- package/dist/llm/reasoning/anthropic-betas.cjs +0 -31
- package/dist/llm/reasoning/anthropic-betas.d.ts +0 -3
- package/dist/llm/reasoning/anthropic-betas.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-betas.js +0 -7
- package/dist/llm/reasoning/anthropic-thinking.cjs +0 -79
- package/dist/llm/reasoning/anthropic-thinking.d.ts +0 -15
- package/dist/llm/reasoning/anthropic-thinking.d.ts.map +0 -1
- package/dist/llm/reasoning/anthropic-thinking.js +0 -52
- package/dist/llm/reasoning/openai-reasoning-effort.cjs +0 -86
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts +0 -5
- package/dist/llm/reasoning/openai-reasoning-effort.d.ts.map +0 -1
- package/dist/llm/reasoning/openai-reasoning-effort.js +0 -61
- package/dist/llm/reasoning/profile.cjs +0 -113
- package/dist/llm/reasoning/profile.d.ts +0 -13
- package/dist/llm/reasoning/profile.d.ts.map +0 -1
- package/dist/llm/reasoning/profile.js +0 -92
- package/dist/llm/reasoning/profiles/anthropic.cjs +0 -61
- package/dist/llm/reasoning/profiles/anthropic.d.ts +0 -8
- package/dist/llm/reasoning/profiles/anthropic.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/anthropic.js +0 -45
- package/dist/llm/reasoning/profiles/bedrock.cjs +0 -54
- package/dist/llm/reasoning/profiles/bedrock.d.ts +0 -3
- package/dist/llm/reasoning/profiles/bedrock.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/bedrock.js +0 -36
- package/dist/llm/reasoning/profiles/google.cjs +0 -45
- package/dist/llm/reasoning/profiles/google.d.ts +0 -9
- package/dist/llm/reasoning/profiles/google.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/google.js +0 -21
- package/dist/llm/reasoning/profiles/openai-compatible.cjs +0 -39
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai-compatible.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai-compatible.js +0 -16
- package/dist/llm/reasoning/profiles/openai.cjs +0 -41
- package/dist/llm/reasoning/profiles/openai.d.ts +0 -3
- package/dist/llm/reasoning/profiles/openai.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openai.js +0 -18
- package/dist/llm/reasoning/profiles/openrouter.cjs +0 -83
- package/dist/llm/reasoning/profiles/openrouter.d.ts +0 -10
- package/dist/llm/reasoning/profiles/openrouter.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/openrouter.js +0 -59
- package/dist/llm/reasoning/profiles/shared.cjs +0 -80
- package/dist/llm/reasoning/profiles/shared.d.ts +0 -25
- package/dist/llm/reasoning/profiles/shared.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/shared.js +0 -53
- package/dist/llm/reasoning/profiles/vertex.cjs +0 -46
- package/dist/llm/reasoning/profiles/vertex.d.ts +0 -3
- package/dist/llm/reasoning/profiles/vertex.d.ts.map +0 -1
- package/dist/llm/reasoning/profiles/vertex.js +0 -23
- package/dist/llm/registry/models.generated.cjs +0 -10741
- package/dist/llm/registry/models.generated.d.ts +0 -2945
- package/dist/llm/registry/models.generated.d.ts.map +0 -1
- package/dist/llm/registry/models.generated.js +0 -10717
- package/dist/llm/registry/models.manual.cjs +0 -44
- package/dist/llm/registry/models.manual.d.ts +0 -22
- package/dist/llm/registry/models.manual.d.ts.map +0 -1
- package/dist/llm/registry/models.manual.js +0 -21
- package/dist/llm/types.cjs +0 -55
- package/dist/llm/types.d.ts +0 -39
- package/dist/llm/types.d.ts.map +0 -1
- package/dist/llm/types.js +0 -30
package/dist/utils/result.cjs
CHANGED
|
@@ -33,7 +33,7 @@ module.exports = __toCommonJS(result_exports);
|
|
|
33
33
|
var import_zod = require("zod");
|
|
34
34
|
var import_types = require("../errors/types.js");
|
|
35
35
|
const NonEmptyTrimmed = import_zod.z.string().transform((s) => s.trim()).refine((s) => s.length > 0, { message: "Required" });
|
|
36
|
-
const ALLOWED_URL_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"
|
|
36
|
+
const ALLOWED_URL_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
37
37
|
function isValidUrl(s) {
|
|
38
38
|
try {
|
|
39
39
|
const u = new URL(s);
|
package/dist/utils/result.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../chunk-C6A6W6XS.js";
|
|
|
2
2
|
import { z, ZodError } from "zod";
|
|
3
3
|
import { ErrorScope, ErrorType } from "../errors/types.js";
|
|
4
4
|
const NonEmptyTrimmed = z.string().transform((s) => s.trim()).refine((s) => s.length > 0, { message: "Required" });
|
|
5
|
-
const ALLOWED_URL_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"
|
|
5
|
+
const ALLOWED_URL_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
6
6
|
function isValidUrl(s) {
|
|
7
7
|
try {
|
|
8
8
|
const u = new URL(s);
|
|
@@ -218,6 +218,9 @@ async function createAgentServices(config, logger, agentEventBus, overrides, com
|
|
|
218
218
|
},
|
|
219
219
|
...overrides?.languageModelFactory !== void 0 && {
|
|
220
220
|
languageModelFactory: overrides.languageModelFactory
|
|
221
|
+
},
|
|
222
|
+
...overrides?.authResolver !== void 0 && {
|
|
223
|
+
authResolver: overrides.authResolver
|
|
221
224
|
}
|
|
222
225
|
},
|
|
223
226
|
logger
|
|
@@ -11,6 +11,7 @@ import type { DextoStores } from '../storage/index.js';
|
|
|
11
11
|
import type { ToolExecutionStore } from '../storage/tool-executions/types.js';
|
|
12
12
|
import { WorkspaceManager } from '../workspace/index.js';
|
|
13
13
|
import type { Logger } from '../logger/v2/types.js';
|
|
14
|
+
import type { LlmAuthResolver } from '../llm/auth/index.js';
|
|
14
15
|
import type { AgentRuntimeSettings } from '../agent/runtime-config.js';
|
|
15
16
|
import { AgentEventBus } from '../events/index.js';
|
|
16
17
|
import { ResourceManager } from '../resources/manager.js';
|
|
@@ -61,6 +62,7 @@ export type TelemetryBootstrap = (context: TelemetryBootstrapContext) => Promise
|
|
|
61
62
|
export type InitializeServicesOptions = {
|
|
62
63
|
sessionLoggerFactory?: import('../session/session-manager.js').SessionLoggerFactory;
|
|
63
64
|
languageModelFactory?: LanguageModelFactory;
|
|
65
|
+
authResolver?: LlmAuthResolver | null;
|
|
64
66
|
mcpAuthProviderFactory?: import('../mcp/types.js').McpAuthProviderFactory | null;
|
|
65
67
|
toolManager?: ToolManager;
|
|
66
68
|
toolManagerFactory?: ToolManagerFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-initializer.d.ts","sourceRoot":"","sources":["../../src/utils/service-initializer.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,oBA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AC;IAC1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;IAC3B,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC9D,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACvD,CAAC;AAEF,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,MAAM,EACd,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,SAAS,GACpD,OAAO,CAAC,IAAI,CAAC,CAef;AAGD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,yBAAyB,EACrC,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAC3D,OAAO,CAAC,aAAa,CAAC,CAwOxB"}
|
|
@@ -185,6 +185,9 @@ async function createAgentServices(config, logger, agentEventBus, overrides, com
|
|
|
185
185
|
},
|
|
186
186
|
...overrides?.languageModelFactory !== void 0 && {
|
|
187
187
|
languageModelFactory: overrides.languageModelFactory
|
|
188
|
+
},
|
|
189
|
+
...overrides?.authResolver !== void 0 && {
|
|
190
|
+
authResolver: overrides.authResolver
|
|
188
191
|
}
|
|
189
192
|
},
|
|
190
193
|
logger
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/core",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -156,7 +156,8 @@
|
|
|
156
156
|
"glob": "^12.0.0",
|
|
157
157
|
"nanoid": "^5.1.6",
|
|
158
158
|
"winston": "^3.17.0",
|
|
159
|
-
"yaml": "^2.8.3"
|
|
159
|
+
"yaml": "^2.8.3",
|
|
160
|
+
"@dexto/llm": "1.8.2"
|
|
160
161
|
},
|
|
161
162
|
"devDependencies": {
|
|
162
163
|
"@opentelemetry/instrumentation-http": "^0.210.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var anthropic_betas_exports = {};
|
|
20
|
-
__export(anthropic_betas_exports, {
|
|
21
|
-
ANTHROPIC_BETA_HEADER: () => ANTHROPIC_BETA_HEADER,
|
|
22
|
-
ANTHROPIC_INTERLEAVED_THINKING_BETA: () => ANTHROPIC_INTERLEAVED_THINKING_BETA
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(anthropic_betas_exports);
|
|
25
|
-
const ANTHROPIC_BETA_HEADER = "anthropic-beta";
|
|
26
|
-
const ANTHROPIC_INTERLEAVED_THINKING_BETA = "interleaved-thinking-2025-05-14";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
ANTHROPIC_BETA_HEADER,
|
|
30
|
-
ANTHROPIC_INTERLEAVED_THINKING_BETA
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-betas.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/anthropic-betas.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAMtD,eAAO,MAAM,mCAAmC,oCAAoC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var anthropic_thinking_exports = {};
|
|
20
|
-
__export(anthropic_thinking_exports, {
|
|
21
|
-
isAnthropicAdaptiveThinkingModel: () => isAnthropicAdaptiveThinkingModel,
|
|
22
|
-
isAnthropicOpusAdaptiveThinkingModel: () => isAnthropicOpusAdaptiveThinkingModel,
|
|
23
|
-
isClaudeVersionAtLeast: () => isClaudeVersionAtLeast,
|
|
24
|
-
parseClaudeVersion: () => parseClaudeVersion,
|
|
25
|
-
supportsAnthropicInterleavedThinking: () => supportsAnthropicInterleavedThinking
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(anthropic_thinking_exports);
|
|
28
|
-
function parseClaudeVersion(model) {
|
|
29
|
-
const modelLower = model.toLowerCase();
|
|
30
|
-
const variantFirst = /claude-(opus|sonnet|haiku)-(\d+)(?:[.-](\d{1,2})(?!\d))?/i.exec(
|
|
31
|
-
modelLower
|
|
32
|
-
);
|
|
33
|
-
if (variantFirst) {
|
|
34
|
-
const [, variant, majorRaw, minorRaw] = variantFirst;
|
|
35
|
-
if (!variant || !majorRaw) return null;
|
|
36
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
37
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
38
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
39
|
-
return { major, minor, variant };
|
|
40
|
-
}
|
|
41
|
-
const versionFirst = /claude-(\d+)(?:[.-](\d{1,2})(?!\d))?-(opus|sonnet|haiku)/i.exec(
|
|
42
|
-
modelLower
|
|
43
|
-
);
|
|
44
|
-
if (versionFirst) {
|
|
45
|
-
const [, majorRaw, minorRaw, variant] = versionFirst;
|
|
46
|
-
if (!majorRaw || !variant) return null;
|
|
47
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
48
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
49
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
50
|
-
return { major, minor, variant };
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
function isClaudeVersionAtLeast(version, min) {
|
|
55
|
-
return version.major > min.major || version.major === min.major && version.minor >= min.minor;
|
|
56
|
-
}
|
|
57
|
-
function isAnthropicAdaptiveThinkingModel(model) {
|
|
58
|
-
const version = parseClaudeVersion(model);
|
|
59
|
-
if (!version) return false;
|
|
60
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
61
|
-
}
|
|
62
|
-
function isAnthropicOpusAdaptiveThinkingModel(model) {
|
|
63
|
-
const version = parseClaudeVersion(model);
|
|
64
|
-
if (!version || version.variant !== "opus") return false;
|
|
65
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
66
|
-
}
|
|
67
|
-
function supportsAnthropicInterleavedThinking(model) {
|
|
68
|
-
const version = parseClaudeVersion(model);
|
|
69
|
-
if (!version) return false;
|
|
70
|
-
return version.major >= 4;
|
|
71
|
-
}
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
isAnthropicAdaptiveThinkingModel,
|
|
75
|
-
isAnthropicOpusAdaptiveThinkingModel,
|
|
76
|
-
isClaudeVersionAtLeast,
|
|
77
|
-
parseClaudeVersion,
|
|
78
|
-
supportsAnthropicInterleavedThinking
|
|
79
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type ClaudeVariant = 'opus' | 'sonnet' | 'haiku';
|
|
2
|
-
export type ParsedClaudeVersion = {
|
|
3
|
-
major: number;
|
|
4
|
-
minor: number;
|
|
5
|
-
variant?: ClaudeVariant;
|
|
6
|
-
};
|
|
7
|
-
export declare function parseClaudeVersion(model: string): ParsedClaudeVersion | null;
|
|
8
|
-
export declare function isClaudeVersionAtLeast(version: Pick<ParsedClaudeVersion, 'major' | 'minor'>, min: {
|
|
9
|
-
major: number;
|
|
10
|
-
minor: number;
|
|
11
|
-
}): boolean;
|
|
12
|
-
export declare function isAnthropicAdaptiveThinkingModel(model: string): boolean;
|
|
13
|
-
export declare function isAnthropicOpusAdaptiveThinkingModel(model: string): boolean;
|
|
14
|
-
export declare function supportsAnthropicInterleavedThinking(model: string): boolean;
|
|
15
|
-
//# sourceMappingURL=anthropic-thinking.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-thinking.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/anthropic-thinking.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAmC5E;AAED,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,CAAC,EACrD,GAAG,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtC,OAAO,CAET;AAED,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMvE;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI3E;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAM3E"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import "../../chunk-C6A6W6XS.js";
|
|
2
|
-
function parseClaudeVersion(model) {
|
|
3
|
-
const modelLower = model.toLowerCase();
|
|
4
|
-
const variantFirst = /claude-(opus|sonnet|haiku)-(\d+)(?:[.-](\d{1,2})(?!\d))?/i.exec(
|
|
5
|
-
modelLower
|
|
6
|
-
);
|
|
7
|
-
if (variantFirst) {
|
|
8
|
-
const [, variant, majorRaw, minorRaw] = variantFirst;
|
|
9
|
-
if (!variant || !majorRaw) return null;
|
|
10
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
11
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
12
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
13
|
-
return { major, minor, variant };
|
|
14
|
-
}
|
|
15
|
-
const versionFirst = /claude-(\d+)(?:[.-](\d{1,2})(?!\d))?-(opus|sonnet|haiku)/i.exec(
|
|
16
|
-
modelLower
|
|
17
|
-
);
|
|
18
|
-
if (versionFirst) {
|
|
19
|
-
const [, majorRaw, minorRaw, variant] = versionFirst;
|
|
20
|
-
if (!majorRaw || !variant) return null;
|
|
21
|
-
const major = Number.parseInt(majorRaw, 10);
|
|
22
|
-
const minor = minorRaw ? Number.parseInt(minorRaw, 10) : 0;
|
|
23
|
-
if (!Number.isFinite(major) || !Number.isFinite(minor)) return null;
|
|
24
|
-
return { major, minor, variant };
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
function isClaudeVersionAtLeast(version, min) {
|
|
29
|
-
return version.major > min.major || version.major === min.major && version.minor >= min.minor;
|
|
30
|
-
}
|
|
31
|
-
function isAnthropicAdaptiveThinkingModel(model) {
|
|
32
|
-
const version = parseClaudeVersion(model);
|
|
33
|
-
if (!version) return false;
|
|
34
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
35
|
-
}
|
|
36
|
-
function isAnthropicOpusAdaptiveThinkingModel(model) {
|
|
37
|
-
const version = parseClaudeVersion(model);
|
|
38
|
-
if (!version || version.variant !== "opus") return false;
|
|
39
|
-
return isClaudeVersionAtLeast(version, { major: 4, minor: 6 });
|
|
40
|
-
}
|
|
41
|
-
function supportsAnthropicInterleavedThinking(model) {
|
|
42
|
-
const version = parseClaudeVersion(model);
|
|
43
|
-
if (!version) return false;
|
|
44
|
-
return version.major >= 4;
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
isAnthropicAdaptiveThinkingModel,
|
|
48
|
-
isAnthropicOpusAdaptiveThinkingModel,
|
|
49
|
-
isClaudeVersionAtLeast,
|
|
50
|
-
parseClaudeVersion,
|
|
51
|
-
supportsAnthropicInterleavedThinking
|
|
52
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var openai_reasoning_effort_exports = {};
|
|
20
|
-
__export(openai_reasoning_effort_exports, {
|
|
21
|
-
coerceOpenAIReasoningEffort: () => coerceOpenAIReasoningEffort,
|
|
22
|
-
getSupportedOpenAIReasoningEfforts: () => getSupportedOpenAIReasoningEfforts,
|
|
23
|
-
supportsOpenAIReasoningEffort: () => supportsOpenAIReasoningEffort
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(openai_reasoning_effort_exports);
|
|
26
|
-
function normalizeOpenAIModelId(model) {
|
|
27
|
-
const id = model.split("/").pop() ?? model;
|
|
28
|
-
return id.toLowerCase();
|
|
29
|
-
}
|
|
30
|
-
function getSupportedOpenAIReasoningEfforts(model) {
|
|
31
|
-
const id = normalizeOpenAIModelId(model);
|
|
32
|
-
if (id.includes("gpt-5-pro")) {
|
|
33
|
-
return ["high"];
|
|
34
|
-
}
|
|
35
|
-
if (id.startsWith("gpt-5.3")) {
|
|
36
|
-
return ["low", "medium", "high", "xhigh"];
|
|
37
|
-
}
|
|
38
|
-
if (id.startsWith("gpt-5.2")) {
|
|
39
|
-
return ["low", "medium", "high", "xhigh"];
|
|
40
|
-
}
|
|
41
|
-
if (id.includes("gpt-5.1-codex-max")) {
|
|
42
|
-
return ["none", "low", "medium", "high", "xhigh"];
|
|
43
|
-
}
|
|
44
|
-
if (id.startsWith("gpt-5.1")) {
|
|
45
|
-
return ["none", "low", "medium", "high"];
|
|
46
|
-
}
|
|
47
|
-
if (id.startsWith("gpt-5")) {
|
|
48
|
-
return ["minimal", "low", "medium", "high"];
|
|
49
|
-
}
|
|
50
|
-
if (id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")) {
|
|
51
|
-
return ["low", "medium", "high"];
|
|
52
|
-
}
|
|
53
|
-
return ["low", "medium", "high"];
|
|
54
|
-
}
|
|
55
|
-
function getFallbackOrder(requested) {
|
|
56
|
-
switch (requested) {
|
|
57
|
-
case "none":
|
|
58
|
-
return ["none", "minimal", "low", "medium", "high", "xhigh"];
|
|
59
|
-
case "minimal":
|
|
60
|
-
return ["minimal", "low", "medium", "high", "xhigh"];
|
|
61
|
-
case "low":
|
|
62
|
-
return ["low", "medium", "high", "xhigh"];
|
|
63
|
-
case "medium":
|
|
64
|
-
return ["medium", "high", "xhigh"];
|
|
65
|
-
case "high":
|
|
66
|
-
return ["high", "xhigh"];
|
|
67
|
-
case "xhigh":
|
|
68
|
-
return ["xhigh", "high", "medium", "low", "minimal", "none"];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function coerceOpenAIReasoningEffort(model, requested) {
|
|
72
|
-
const supported = getSupportedOpenAIReasoningEfforts(model);
|
|
73
|
-
for (const candidate of getFallbackOrder(requested)) {
|
|
74
|
-
if (supported.includes(candidate)) return candidate;
|
|
75
|
-
}
|
|
76
|
-
return void 0;
|
|
77
|
-
}
|
|
78
|
-
function supportsOpenAIReasoningEffort(model, effort) {
|
|
79
|
-
return getSupportedOpenAIReasoningEfforts(model).includes(effort);
|
|
80
|
-
}
|
|
81
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
-
0 && (module.exports = {
|
|
83
|
-
coerceOpenAIReasoningEffort,
|
|
84
|
-
getSupportedOpenAIReasoningEfforts,
|
|
85
|
-
supportsOpenAIReasoningEffort
|
|
86
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type OpenAIReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
2
|
-
export declare function getSupportedOpenAIReasoningEfforts(model: string): OpenAIReasoningEffort[];
|
|
3
|
-
export declare function coerceOpenAIReasoningEffort(model: string, requested: OpenAIReasoningEffort): OpenAIReasoningEffort | undefined;
|
|
4
|
-
export declare function supportsOpenAIReasoningEffort(model: string, effort: OpenAIReasoningEffort): boolean;
|
|
5
|
-
//# sourceMappingURL=openai-reasoning-effort.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai-reasoning-effort.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/openai-reasoning-effort.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAO7F,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAoCzF;AAmBD,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,qBAAqB,GACjC,qBAAqB,GAAG,SAAS,CAMnC;AAED,wBAAgB,6BAA6B,CACzC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,qBAAqB,GAC9B,OAAO,CAET"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import "../../chunk-C6A6W6XS.js";
|
|
2
|
-
function normalizeOpenAIModelId(model) {
|
|
3
|
-
const id = model.split("/").pop() ?? model;
|
|
4
|
-
return id.toLowerCase();
|
|
5
|
-
}
|
|
6
|
-
function getSupportedOpenAIReasoningEfforts(model) {
|
|
7
|
-
const id = normalizeOpenAIModelId(model);
|
|
8
|
-
if (id.includes("gpt-5-pro")) {
|
|
9
|
-
return ["high"];
|
|
10
|
-
}
|
|
11
|
-
if (id.startsWith("gpt-5.3")) {
|
|
12
|
-
return ["low", "medium", "high", "xhigh"];
|
|
13
|
-
}
|
|
14
|
-
if (id.startsWith("gpt-5.2")) {
|
|
15
|
-
return ["low", "medium", "high", "xhigh"];
|
|
16
|
-
}
|
|
17
|
-
if (id.includes("gpt-5.1-codex-max")) {
|
|
18
|
-
return ["none", "low", "medium", "high", "xhigh"];
|
|
19
|
-
}
|
|
20
|
-
if (id.startsWith("gpt-5.1")) {
|
|
21
|
-
return ["none", "low", "medium", "high"];
|
|
22
|
-
}
|
|
23
|
-
if (id.startsWith("gpt-5")) {
|
|
24
|
-
return ["minimal", "low", "medium", "high"];
|
|
25
|
-
}
|
|
26
|
-
if (id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")) {
|
|
27
|
-
return ["low", "medium", "high"];
|
|
28
|
-
}
|
|
29
|
-
return ["low", "medium", "high"];
|
|
30
|
-
}
|
|
31
|
-
function getFallbackOrder(requested) {
|
|
32
|
-
switch (requested) {
|
|
33
|
-
case "none":
|
|
34
|
-
return ["none", "minimal", "low", "medium", "high", "xhigh"];
|
|
35
|
-
case "minimal":
|
|
36
|
-
return ["minimal", "low", "medium", "high", "xhigh"];
|
|
37
|
-
case "low":
|
|
38
|
-
return ["low", "medium", "high", "xhigh"];
|
|
39
|
-
case "medium":
|
|
40
|
-
return ["medium", "high", "xhigh"];
|
|
41
|
-
case "high":
|
|
42
|
-
return ["high", "xhigh"];
|
|
43
|
-
case "xhigh":
|
|
44
|
-
return ["xhigh", "high", "medium", "low", "minimal", "none"];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function coerceOpenAIReasoningEffort(model, requested) {
|
|
48
|
-
const supported = getSupportedOpenAIReasoningEfforts(model);
|
|
49
|
-
for (const candidate of getFallbackOrder(requested)) {
|
|
50
|
-
if (supported.includes(candidate)) return candidate;
|
|
51
|
-
}
|
|
52
|
-
return void 0;
|
|
53
|
-
}
|
|
54
|
-
function supportsOpenAIReasoningEffort(model, effort) {
|
|
55
|
-
return getSupportedOpenAIReasoningEfforts(model).includes(effort);
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
coerceOpenAIReasoningEffort,
|
|
59
|
-
getSupportedOpenAIReasoningEfforts,
|
|
60
|
-
supportsOpenAIReasoningEffort
|
|
61
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var profile_exports = {};
|
|
20
|
-
__export(profile_exports, {
|
|
21
|
-
getReasoningProfile: () => getReasoningProfile,
|
|
22
|
-
supportsReasoningVariant: () => supportsReasoningVariant
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(profile_exports);
|
|
25
|
-
var import_registry = require("../registry/index.js");
|
|
26
|
-
var import_anthropic_thinking = require("./anthropic-thinking.js");
|
|
27
|
-
var import_anthropic = require("./profiles/anthropic.js");
|
|
28
|
-
var import_bedrock = require("./profiles/bedrock.js");
|
|
29
|
-
var import_google = require("./profiles/google.js");
|
|
30
|
-
var import_openai_compatible = require("./profiles/openai-compatible.js");
|
|
31
|
-
var import_openai = require("./profiles/openai.js");
|
|
32
|
-
var import_openrouter = require("./profiles/openrouter.js");
|
|
33
|
-
var import_vertex = require("./profiles/vertex.js");
|
|
34
|
-
var import_shared = require("./profiles/shared.js");
|
|
35
|
-
const ANTHROPIC_PROFILE_CONFIG = {
|
|
36
|
-
includeDisabled: true,
|
|
37
|
-
supportsBudgetTokensForBudgetParadigm: true,
|
|
38
|
-
supportsBudgetTokensForAdaptiveParadigm: false
|
|
39
|
-
};
|
|
40
|
-
const GOOGLE_PROFILE_CONFIG = {
|
|
41
|
-
includeDisabled: true,
|
|
42
|
-
supportsBudgetTokensForBudgetParadigm: true,
|
|
43
|
-
supportsBudgetTokensForThinkingLevelParadigm: false
|
|
44
|
-
};
|
|
45
|
-
function isAnthropicStyleReasoningCapable(provider, model) {
|
|
46
|
-
return (0, import_registry.isReasoningCapableModel)(model, provider) || (0, import_anthropic_thinking.parseClaudeVersion)(model) !== null || (0, import_anthropic_thinking.isAnthropicAdaptiveThinkingModel)(model);
|
|
47
|
-
}
|
|
48
|
-
function getNativeReasoningProfile(provider, model) {
|
|
49
|
-
switch (provider) {
|
|
50
|
-
case "openai":
|
|
51
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "openai")) {
|
|
52
|
-
return (0, import_shared.nonCapableProfile)();
|
|
53
|
-
}
|
|
54
|
-
return (0, import_openai.buildOpenAIReasoningProfile)(model);
|
|
55
|
-
case "anthropic":
|
|
56
|
-
if (!isAnthropicStyleReasoningCapable("anthropic", model)) {
|
|
57
|
-
return (0, import_shared.nonCapableProfile)();
|
|
58
|
-
}
|
|
59
|
-
return (0, import_anthropic.buildAnthropicReasoningProfile)({ model, ...ANTHROPIC_PROFILE_CONFIG });
|
|
60
|
-
case "bedrock":
|
|
61
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "bedrock")) {
|
|
62
|
-
return (0, import_shared.nonCapableProfile)();
|
|
63
|
-
}
|
|
64
|
-
return (0, import_bedrock.buildBedrockReasoningProfile)(model);
|
|
65
|
-
case "google":
|
|
66
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "google")) {
|
|
67
|
-
return (0, import_shared.nonCapableProfile)();
|
|
68
|
-
}
|
|
69
|
-
return (0, import_google.buildGoogleReasoningProfile)({ model, ...GOOGLE_PROFILE_CONFIG });
|
|
70
|
-
case "vertex":
|
|
71
|
-
if (!isAnthropicStyleReasoningCapable("vertex", model)) {
|
|
72
|
-
return (0, import_shared.nonCapableProfile)();
|
|
73
|
-
}
|
|
74
|
-
return (0, import_vertex.buildVertexReasoningProfile)(model);
|
|
75
|
-
case "openai-compatible":
|
|
76
|
-
if (!(0, import_registry.isReasoningCapableModel)(model, "openai-compatible")) {
|
|
77
|
-
return (0, import_shared.nonCapableProfile)();
|
|
78
|
-
}
|
|
79
|
-
return (0, import_openai_compatible.buildOpenAICompatibleReasoningProfile)();
|
|
80
|
-
default:
|
|
81
|
-
return (0, import_shared.nonCapableProfile)();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function toGatewayReasoningProfile(nativeProfile) {
|
|
85
|
-
if (!nativeProfile.capable) {
|
|
86
|
-
return (0, import_shared.nonCapableProfile)();
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
...nativeProfile,
|
|
90
|
-
variants: nativeProfile.variants.map((variant) => ({ ...variant })),
|
|
91
|
-
supportedVariants: [...nativeProfile.supportedVariants],
|
|
92
|
-
supportsBudgetTokens: true
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function getReasoningProfile(provider, model) {
|
|
96
|
-
if ((0, import_openrouter.isOpenRouterGatewayProvider)(provider)) {
|
|
97
|
-
const target = (0, import_openrouter.getOpenRouterReasoningTarget)(model);
|
|
98
|
-
if (!target) {
|
|
99
|
-
return (0, import_shared.nonCapableProfile)();
|
|
100
|
-
}
|
|
101
|
-
const nativeProfile = getNativeReasoningProfile(target.upstreamProvider, target.modelId);
|
|
102
|
-
return toGatewayReasoningProfile(nativeProfile);
|
|
103
|
-
}
|
|
104
|
-
return getNativeReasoningProfile(provider, model);
|
|
105
|
-
}
|
|
106
|
-
function supportsReasoningVariant(profile, variant) {
|
|
107
|
-
return profile.variants.some((entry) => entry.id === variant);
|
|
108
|
-
}
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
getReasoningProfile,
|
|
112
|
-
supportsReasoningVariant
|
|
113
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { LLMProvider } from '../types.js';
|
|
2
|
-
import { type ReasoningProfile } from './profiles/shared.js';
|
|
3
|
-
export type { ReasoningParadigm, ReasoningProfile, ReasoningVariantOption, } from './profiles/shared.js';
|
|
4
|
-
/**
|
|
5
|
-
* Returns exact, model/provider-native reasoning controls available for this model.
|
|
6
|
-
*
|
|
7
|
-
* This is intentionally strict:
|
|
8
|
-
* - No generic preset abstraction at this layer
|
|
9
|
-
* - No guessed variants for unknown paradigms
|
|
10
|
-
*/
|
|
11
|
-
export declare function getReasoningProfile(provider: LLMProvider, model: string): ReasoningProfile;
|
|
12
|
-
export declare function supportsReasoningVariant(profile: ReasoningProfile, variant: string): boolean;
|
|
13
|
-
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/llm/reasoning/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa/C,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,YAAY,EACR,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;AAiF9B;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAY1F;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5F"}
|