@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
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var auth_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(auth_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/auth/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,eAAe,EACf,uBAAuB,EACvB,0BAA0B,GAC7B,MAAM,YAAY,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LLMProvider } from '@dexto/llm';
|
|
2
|
+
export type LlmRuntimeAuthOverrides = {
|
|
3
|
+
apiKey?: string | undefined;
|
|
4
|
+
baseURL?: string | undefined;
|
|
5
|
+
headers?: Record<string, string> | undefined;
|
|
6
|
+
fetch?: typeof fetch | undefined;
|
|
7
|
+
auth?: LlmRuntimeAuthInfo | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type LlmRuntimeAuthInfo = {
|
|
10
|
+
source: 'profile';
|
|
11
|
+
profileId: string;
|
|
12
|
+
providerId: string;
|
|
13
|
+
methodId: string;
|
|
14
|
+
credentialType: string;
|
|
15
|
+
};
|
|
16
|
+
export type ResolveLlmRuntimeAuthInput = {
|
|
17
|
+
provider: LLMProvider;
|
|
18
|
+
model: string;
|
|
19
|
+
apiKey?: string | undefined;
|
|
20
|
+
baseURL?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
export interface LlmAuthResolver {
|
|
23
|
+
resolveRuntimeAuth(input: ResolveLlmRuntimeAuthInput): LlmRuntimeAuthOverrides | null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/llm/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,uBAAuB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,eAAe;IAC5B,kBAAkB,CAAC,KAAK,EAAE,0BAA0B,GAAG,uBAAuB,GAAG,IAAI,CAAC;CACzF"}
|
|
File without changes
|
|
@@ -54,7 +54,7 @@ const CURATED_MODEL_IDS_BY_PROVIDER = {
|
|
|
54
54
|
"gemini-2.5-pro",
|
|
55
55
|
"gemini-2.5-flash"
|
|
56
56
|
],
|
|
57
|
-
xai: ["grok-4", "grok-
|
|
57
|
+
xai: ["grok-4.3", "grok-4.20-0309-reasoning", "grok-4.20-0309-non-reasoning"],
|
|
58
58
|
groq: ["llama-3.3-70b-versatile", "llama-3.1-8b-instant", "qwen-qwq-32b"],
|
|
59
59
|
cohere: ["command-a-03-2025", "command-r-plus-08-2024", "command-r-08-2024"],
|
|
60
60
|
minimax: ["MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
|
|
@@ -70,10 +70,10 @@ const CURATED_MODEL_IDS_BY_PROVIDER = {
|
|
|
70
70
|
"anthropic/claude-opus-4.5",
|
|
71
71
|
"openai/gpt-5.2",
|
|
72
72
|
"openai/gpt-5.2-codex",
|
|
73
|
-
"google/gemini-3-pro-preview",
|
|
73
|
+
"google/gemini-3.1-pro-preview",
|
|
74
74
|
"google/gemini-3-flash-preview",
|
|
75
75
|
"qwen/qwen3-coder:free",
|
|
76
|
-
"deepseek/deepseek-r1-0528
|
|
76
|
+
"deepseek/deepseek-r1-0528",
|
|
77
77
|
"z-ai/glm-4.7",
|
|
78
78
|
"minimax/minimax-m2.5",
|
|
79
79
|
"moonshotai/kimi-k2.5"
|
|
@@ -32,7 +32,7 @@ const CURATED_MODEL_IDS_BY_PROVIDER = {
|
|
|
32
32
|
"gemini-2.5-pro",
|
|
33
33
|
"gemini-2.5-flash"
|
|
34
34
|
],
|
|
35
|
-
xai: ["grok-4", "grok-
|
|
35
|
+
xai: ["grok-4.3", "grok-4.20-0309-reasoning", "grok-4.20-0309-non-reasoning"],
|
|
36
36
|
groq: ["llama-3.3-70b-versatile", "llama-3.1-8b-instant", "qwen-qwq-32b"],
|
|
37
37
|
cohere: ["command-a-03-2025", "command-r-plus-08-2024", "command-r-08-2024"],
|
|
38
38
|
minimax: ["MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
|
|
@@ -48,10 +48,10 @@ const CURATED_MODEL_IDS_BY_PROVIDER = {
|
|
|
48
48
|
"anthropic/claude-opus-4.5",
|
|
49
49
|
"openai/gpt-5.2",
|
|
50
50
|
"openai/gpt-5.2-codex",
|
|
51
|
-
"google/gemini-3-pro-preview",
|
|
51
|
+
"google/gemini-3.1-pro-preview",
|
|
52
52
|
"google/gemini-3-flash-preview",
|
|
53
53
|
"qwen/qwen3-coder:free",
|
|
54
|
-
"deepseek/deepseek-r1-0528
|
|
54
|
+
"deepseek/deepseek-r1-0528",
|
|
55
55
|
"z-ai/glm-4.7",
|
|
56
56
|
"minimax/minimax-m2.5",
|
|
57
57
|
"moonshotai/kimi-k2.5"
|
package/dist/llm/curation.cjs
CHANGED
|
@@ -22,11 +22,11 @@ __export(curation_exports, {
|
|
|
22
22
|
getCuratedModelsForProvider: () => getCuratedModelsForProvider
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(curation_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_llm = require("@dexto/llm");
|
|
26
26
|
var import_curation_config = require("./curation-config.js");
|
|
27
27
|
const DEFAULT_MAX = 8;
|
|
28
28
|
function getCuratedModelsForProvider(provider, options) {
|
|
29
|
-
const providerInfo =
|
|
29
|
+
const providerInfo = import_llm.LLM_REGISTRY[provider];
|
|
30
30
|
const models = providerInfo.models ?? [];
|
|
31
31
|
if (models.length === 0) return [];
|
|
32
32
|
const max = options?.max ?? DEFAULT_MAX;
|
package/dist/llm/curation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LLMProvider } from '
|
|
2
|
-
import type
|
|
1
|
+
import type { LLMProvider } from '@dexto/llm';
|
|
2
|
+
import { type ModelInfo } from '@dexto/llm';
|
|
3
3
|
type CuratedModelsOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* Maximum number of models to return.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curation.d.ts","sourceRoot":"","sources":["../../src/llm/curation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"curation.d.ts","sourceRoot":"","sources":["../../src/llm/curation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG1D,KAAK,oBAAoB,GAAG;IACxB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,SAAS,WAAW,EAAE,CAAC;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC/B,SAAS,EAAE,CAgCb;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC3C,OAAO,EAAE,uBAAuB,GACjC,eAAe,EAAE,CAkDnB"}
|
package/dist/llm/curation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-C6A6W6XS.js";
|
|
2
|
-
import { LLM_REGISTRY } from "
|
|
2
|
+
import { LLM_REGISTRY } from "@dexto/llm";
|
|
3
3
|
import { CURATED_MODEL_IDS_BY_PROVIDER } from "./curation-config.js";
|
|
4
4
|
const DEFAULT_MAX = 8;
|
|
5
5
|
function getCuratedModelsForProvider(provider, options) {
|
package/dist/llm/errors.cjs
CHANGED
|
@@ -25,7 +25,7 @@ var import_DextoRuntimeError = require("../errors/DextoRuntimeError.js");
|
|
|
25
25
|
var import_types = require("../errors/types.js");
|
|
26
26
|
var import_types2 = require("../errors/types.js");
|
|
27
27
|
var import_error_codes = require("./error-codes.js");
|
|
28
|
-
var
|
|
28
|
+
var import_llm = require("@dexto/llm");
|
|
29
29
|
class LLMError {
|
|
30
30
|
// Runtime model/provider lookup errors
|
|
31
31
|
static unknownModel(provider, model) {
|
|
@@ -56,7 +56,7 @@ class LLMError {
|
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
static unsupportedProvider(provider) {
|
|
59
|
-
const availableProviders = (0,
|
|
59
|
+
const availableProviders = (0, import_llm.getSupportedProviders)();
|
|
60
60
|
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
61
61
|
import_error_codes.LLMErrorCode.PROVIDER_UNSUPPORTED,
|
|
62
62
|
import_types.ErrorScope.LLM,
|
|
@@ -81,7 +81,7 @@ class LLMError {
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
static modelProviderUnknown(model) {
|
|
84
|
-
const availableProviders = (0,
|
|
84
|
+
const availableProviders = (0, import_llm.getSupportedProviders)();
|
|
85
85
|
return new import_DextoRuntimeError.DextoRuntimeError(
|
|
86
86
|
import_error_codes.LLMErrorCode.MODEL_UNKNOWN,
|
|
87
87
|
import_types.ErrorScope.LLM,
|
package/dist/llm/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DextoRuntimeError } from '../errors/DextoRuntimeError.js';
|
|
2
|
-
import type { LLMProvider } from '
|
|
2
|
+
import type { LLMProvider } from '@dexto/llm';
|
|
3
3
|
/**
|
|
4
4
|
* LLM runtime error factory methods
|
|
5
5
|
* Creates properly typed errors for LLM runtime operations
|
package/dist/llm/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/llm/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/llm/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAKnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,qBAAa,QAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;IAUxD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW;;;IAU3C,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM;;;;IAU9D,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM;;;;IAW3C;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM;;;;IAW1D,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,MAAM;;;;IAczC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,MAAM;;;;;;;IAenE;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM;;;IAa3C,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;;;;IAW3E,MAAM,CAAC,kBAAkB;CAU5B"}
|
package/dist/llm/errors.js
CHANGED
|
@@ -3,7 +3,7 @@ import { DextoRuntimeError } from "../errors/DextoRuntimeError.js";
|
|
|
3
3
|
import { ErrorScope } from "../errors/types.js";
|
|
4
4
|
import { ErrorType } from "../errors/types.js";
|
|
5
5
|
import { LLMErrorCode } from "./error-codes.js";
|
|
6
|
-
import { getSupportedProviders } from "
|
|
6
|
+
import { getSupportedProviders } from "@dexto/llm";
|
|
7
7
|
class LLMError {
|
|
8
8
|
// Runtime model/provider lookup errors
|
|
9
9
|
static unknownModel(provider, model) {
|
|
@@ -22,12 +22,7 @@ __export(provider_options_exports, {
|
|
|
22
22
|
getEffectiveReasoningBudgetTokens: () => getEffectiveReasoningBudgetTokens
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(provider_options_exports);
|
|
25
|
-
var
|
|
26
|
-
var import_anthropic_thinking = require("../reasoning/anthropic-thinking.js");
|
|
27
|
-
var import_anthropic_betas = require("../reasoning/anthropic-betas.js");
|
|
28
|
-
var import_profile = require("../reasoning/profile.js");
|
|
29
|
-
var import_openrouter = require("../reasoning/profiles/openrouter.js");
|
|
30
|
-
var import_openai_reasoning_effort = require("../reasoning/openai-reasoning-effort.js");
|
|
25
|
+
var import_llm = require("@dexto/llm");
|
|
31
26
|
const ANTHROPIC_MIN_THINKING_BUDGET_TOKENS = 1024;
|
|
32
27
|
const ANTHROPIC_DEFAULT_BUDGET_TOKENS = 2048;
|
|
33
28
|
const GOOGLE_DEFAULT_BUDGET_TOKENS = 2048;
|
|
@@ -45,7 +40,7 @@ function toOpenAICompatibleReasoningEffort(reasoningVariant) {
|
|
|
45
40
|
return reasoningVariant === "none" || reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high" ? reasoningVariant : void 0;
|
|
46
41
|
}
|
|
47
42
|
function getSelectedReasoningVariant(config) {
|
|
48
|
-
const profile = (0,
|
|
43
|
+
const profile = (0, import_llm.getReasoningProfile)(config.provider, config.model);
|
|
49
44
|
const requested = config.reasoning?.variant;
|
|
50
45
|
if (requested !== void 0) {
|
|
51
46
|
const supported = profile.variants.some((entry) => entry.id === requested);
|
|
@@ -61,7 +56,7 @@ function getSelectedReasoningVariant(config) {
|
|
|
61
56
|
}
|
|
62
57
|
function buildAnthropicProviderOptions(config) {
|
|
63
58
|
const { model, reasoningVariant, budgetTokens, capable } = config;
|
|
64
|
-
const adaptiveThinking = (0,
|
|
59
|
+
const adaptiveThinking = (0, import_llm.isAnthropicAdaptiveThinkingModel)(model);
|
|
65
60
|
if (adaptiveThinking) {
|
|
66
61
|
if (reasoningVariant === "disabled") {
|
|
67
62
|
return {
|
|
@@ -72,7 +67,7 @@ function buildAnthropicProviderOptions(config) {
|
|
|
72
67
|
}
|
|
73
68
|
};
|
|
74
69
|
}
|
|
75
|
-
const effort = reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high" || reasoningVariant === "max" ? reasoningVariant : void 0;
|
|
70
|
+
const effort = reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high" || reasoningVariant === "xhigh" || reasoningVariant === "max" ? reasoningVariant : void 0;
|
|
76
71
|
return {
|
|
77
72
|
anthropic: {
|
|
78
73
|
cacheControl: ANTHROPIC_CACHE_CONTROL,
|
|
@@ -114,16 +109,16 @@ function buildAnthropicProviderOptions(config) {
|
|
|
114
109
|
}
|
|
115
110
|
function buildOpenRouterProviderOptions(config) {
|
|
116
111
|
const { provider, model, reasoningVariant, budgetTokens } = config;
|
|
117
|
-
const profile = (0,
|
|
112
|
+
const profile = (0, import_llm.getReasoningProfile)(provider, model);
|
|
118
113
|
if (!profile.capable) {
|
|
119
114
|
return void 0;
|
|
120
115
|
}
|
|
121
116
|
if (reasoningVariant === "disabled") {
|
|
122
|
-
return {
|
|
117
|
+
return { [provider]: { include_reasoning: false } };
|
|
123
118
|
}
|
|
124
119
|
if (budgetTokens !== void 0) {
|
|
125
120
|
return {
|
|
126
|
-
|
|
121
|
+
[provider]: {
|
|
127
122
|
include_reasoning: true,
|
|
128
123
|
reasoning: { enabled: true, max_tokens: budgetTokens }
|
|
129
124
|
}
|
|
@@ -132,7 +127,7 @@ function buildOpenRouterProviderOptions(config) {
|
|
|
132
127
|
if (profile.paradigm === "budget") {
|
|
133
128
|
if (reasoningVariant === void 0 || reasoningVariant === "enabled") {
|
|
134
129
|
return {
|
|
135
|
-
|
|
130
|
+
[provider]: {
|
|
136
131
|
include_reasoning: true
|
|
137
132
|
}
|
|
138
133
|
};
|
|
@@ -142,7 +137,7 @@ function buildOpenRouterProviderOptions(config) {
|
|
|
142
137
|
const explicitEffort = toOpenAIReasoningEffort(reasoningVariant);
|
|
143
138
|
const effort = explicitEffort ?? (profile.paradigm === "adaptive-effort" && reasoningVariant === "max" ? "xhigh" : void 0);
|
|
144
139
|
return {
|
|
145
|
-
|
|
140
|
+
[provider]: {
|
|
146
141
|
include_reasoning: true,
|
|
147
142
|
...effort !== void 0 ? { reasoning: { enabled: true, effort } } : {}
|
|
148
143
|
}
|
|
@@ -170,7 +165,8 @@ function getEffectiveReasoningBudgetTokens(providerOptions) {
|
|
|
170
165
|
return reasoningConfig["budgetTokens"];
|
|
171
166
|
}
|
|
172
167
|
const openrouter = asRecord(providerOptions["openrouter"]);
|
|
173
|
-
const
|
|
168
|
+
const dextoNova = asRecord(providerOptions["dexto-nova"]);
|
|
169
|
+
const reasoning = asRecord(openrouter?.["reasoning"] ?? dextoNova?.["reasoning"]);
|
|
174
170
|
if (typeof reasoning?.["max_tokens"] === "number") {
|
|
175
171
|
return reasoning["max_tokens"];
|
|
176
172
|
}
|
|
@@ -185,11 +181,11 @@ function buildProviderOptions(config) {
|
|
|
185
181
|
return void 0;
|
|
186
182
|
}
|
|
187
183
|
if (provider === "anthropic") {
|
|
188
|
-
const capable = (0,
|
|
184
|
+
const capable = (0, import_llm.isReasoningCapableModel)(model, "anthropic");
|
|
189
185
|
return buildAnthropicProviderOptions({ model, reasoningVariant, budgetTokens, capable });
|
|
190
186
|
}
|
|
191
187
|
if (provider === "bedrock") {
|
|
192
|
-
const capable = (0,
|
|
188
|
+
const capable = (0, import_llm.getReasoningProfile)("bedrock", model).capable;
|
|
193
189
|
if (!capable) {
|
|
194
190
|
return { bedrock: {} };
|
|
195
191
|
}
|
|
@@ -212,8 +208,8 @@ function buildProviderOptions(config) {
|
|
|
212
208
|
return { bedrock: {} };
|
|
213
209
|
}
|
|
214
210
|
bedrock["reasoningConfig"] = { type: "enabled", budgetTokens: effectiveBudgetTokens };
|
|
215
|
-
if ((0,
|
|
216
|
-
bedrock["anthropicBeta"] = [
|
|
211
|
+
if ((0, import_llm.supportsAnthropicInterleavedThinking)(model)) {
|
|
212
|
+
bedrock["anthropicBeta"] = [import_llm.ANTHROPIC_INTERLEAVED_THINKING_BETA];
|
|
217
213
|
}
|
|
218
214
|
return { bedrock };
|
|
219
215
|
}
|
|
@@ -224,16 +220,17 @@ function buildProviderOptions(config) {
|
|
|
224
220
|
return { bedrock };
|
|
225
221
|
}
|
|
226
222
|
if (provider === "vertex" && modelLower.includes("claude")) {
|
|
227
|
-
const capable = (0,
|
|
223
|
+
const capable = (0, import_llm.isReasoningCapableModel)(model, "vertex");
|
|
228
224
|
return buildAnthropicProviderOptions({ model, reasoningVariant, budgetTokens, capable });
|
|
229
225
|
}
|
|
230
226
|
if (provider === "google" || provider === "vertex" && !modelLower.includes("claude")) {
|
|
231
|
-
const profile = (0,
|
|
227
|
+
const profile = (0, import_llm.getReasoningProfile)(provider, model);
|
|
232
228
|
const includeThoughts = profile.capable && reasoningVariant !== "disabled";
|
|
233
229
|
const isThinkingLevel = profile.paradigm === "thinking-level";
|
|
234
230
|
const thinkingLevel = includeThoughts && isThinkingLevel && (reasoningVariant === "minimal" || reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high") ? reasoningVariant : void 0;
|
|
231
|
+
const modelDefaultBudgetTokens = (0, import_llm.getGoogleReasoningBudgetTokens)(model, reasoningVariant);
|
|
235
232
|
const thinkingBudgetTokens = coerceBudgetTokens(
|
|
236
|
-
budgetTokens ?? GOOGLE_DEFAULT_BUDGET_TOKENS,
|
|
233
|
+
budgetTokens ?? modelDefaultBudgetTokens ?? GOOGLE_DEFAULT_BUDGET_TOKENS,
|
|
237
234
|
1
|
|
238
235
|
);
|
|
239
236
|
return {
|
|
@@ -252,7 +249,7 @@ function buildProviderOptions(config) {
|
|
|
252
249
|
}
|
|
253
250
|
if (provider === "openai") {
|
|
254
251
|
const effortCandidate = toOpenAIReasoningEffort(reasoningVariant);
|
|
255
|
-
if (effortCandidate && (0,
|
|
252
|
+
if (effortCandidate && (0, import_llm.supportsOpenAIReasoningEffort)(model, effortCandidate)) {
|
|
256
253
|
return {
|
|
257
254
|
openai: {
|
|
258
255
|
reasoningEffort: effortCandidate,
|
|
@@ -261,11 +258,11 @@ function buildProviderOptions(config) {
|
|
|
261
258
|
};
|
|
262
259
|
}
|
|
263
260
|
}
|
|
264
|
-
if ((0,
|
|
261
|
+
if ((0, import_llm.isOpenRouterGatewayProvider)(provider)) {
|
|
265
262
|
return buildOpenRouterProviderOptions({ provider, model, reasoningVariant, budgetTokens });
|
|
266
263
|
}
|
|
267
264
|
if (provider === "openai-compatible") {
|
|
268
|
-
const profile = (0,
|
|
265
|
+
const profile = (0, import_llm.getReasoningProfile)(provider, model);
|
|
269
266
|
if (!profile.capable) return void 0;
|
|
270
267
|
const reasoningEffort = toOpenAICompatibleReasoningEffort(reasoningVariant);
|
|
271
268
|
if (reasoningEffort === void 0) return void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Provider-specific options builder for Vercel AI SDK's streamText/generateText.
|
|
3
3
|
*/
|
|
4
|
-
import type { LLMProvider, LLMReasoningConfig } from '
|
|
4
|
+
import type { LLMProvider, LLMReasoningConfig } from '@dexto/llm';
|
|
5
5
|
export interface ProviderOptionsConfig {
|
|
6
6
|
provider: LLMProvider;
|
|
7
7
|
model: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-options.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/provider-options.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"provider-options.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/provider-options.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAalE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAC9C;AA6LD,wBAAgB,iCAAiC,CAC7C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,GACrE,MAAM,GAAG,SAAS,CA6BpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,qBAAqB,GAC9B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CA4IrD"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import "../../chunk-C6A6W6XS.js";
|
|
2
|
-
import { isReasoningCapableModel } from "../registry/index.js";
|
|
3
2
|
import {
|
|
3
|
+
ANTHROPIC_INTERLEAVED_THINKING_BETA,
|
|
4
|
+
getGoogleReasoningBudgetTokens,
|
|
5
|
+
getReasoningProfile,
|
|
4
6
|
isAnthropicAdaptiveThinkingModel,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { getReasoningProfile } from "../reasoning/profile.js";
|
|
9
|
-
import { isOpenRouterGatewayProvider } from "../reasoning/profiles/openrouter.js";
|
|
10
|
-
import {
|
|
7
|
+
isOpenRouterGatewayProvider,
|
|
8
|
+
isReasoningCapableModel,
|
|
9
|
+
supportsAnthropicInterleavedThinking,
|
|
11
10
|
supportsOpenAIReasoningEffort
|
|
12
|
-
} from "
|
|
11
|
+
} from "@dexto/llm";
|
|
13
12
|
const ANTHROPIC_MIN_THINKING_BUDGET_TOKENS = 1024;
|
|
14
13
|
const ANTHROPIC_DEFAULT_BUDGET_TOKENS = 2048;
|
|
15
14
|
const GOOGLE_DEFAULT_BUDGET_TOKENS = 2048;
|
|
@@ -54,7 +53,7 @@ function buildAnthropicProviderOptions(config) {
|
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
|
-
const effort = reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high" || reasoningVariant === "max" ? reasoningVariant : void 0;
|
|
56
|
+
const effort = reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high" || reasoningVariant === "xhigh" || reasoningVariant === "max" ? reasoningVariant : void 0;
|
|
58
57
|
return {
|
|
59
58
|
anthropic: {
|
|
60
59
|
cacheControl: ANTHROPIC_CACHE_CONTROL,
|
|
@@ -101,11 +100,11 @@ function buildOpenRouterProviderOptions(config) {
|
|
|
101
100
|
return void 0;
|
|
102
101
|
}
|
|
103
102
|
if (reasoningVariant === "disabled") {
|
|
104
|
-
return {
|
|
103
|
+
return { [provider]: { include_reasoning: false } };
|
|
105
104
|
}
|
|
106
105
|
if (budgetTokens !== void 0) {
|
|
107
106
|
return {
|
|
108
|
-
|
|
107
|
+
[provider]: {
|
|
109
108
|
include_reasoning: true,
|
|
110
109
|
reasoning: { enabled: true, max_tokens: budgetTokens }
|
|
111
110
|
}
|
|
@@ -114,7 +113,7 @@ function buildOpenRouterProviderOptions(config) {
|
|
|
114
113
|
if (profile.paradigm === "budget") {
|
|
115
114
|
if (reasoningVariant === void 0 || reasoningVariant === "enabled") {
|
|
116
115
|
return {
|
|
117
|
-
|
|
116
|
+
[provider]: {
|
|
118
117
|
include_reasoning: true
|
|
119
118
|
}
|
|
120
119
|
};
|
|
@@ -124,7 +123,7 @@ function buildOpenRouterProviderOptions(config) {
|
|
|
124
123
|
const explicitEffort = toOpenAIReasoningEffort(reasoningVariant);
|
|
125
124
|
const effort = explicitEffort ?? (profile.paradigm === "adaptive-effort" && reasoningVariant === "max" ? "xhigh" : void 0);
|
|
126
125
|
return {
|
|
127
|
-
|
|
126
|
+
[provider]: {
|
|
128
127
|
include_reasoning: true,
|
|
129
128
|
...effort !== void 0 ? { reasoning: { enabled: true, effort } } : {}
|
|
130
129
|
}
|
|
@@ -152,7 +151,8 @@ function getEffectiveReasoningBudgetTokens(providerOptions) {
|
|
|
152
151
|
return reasoningConfig["budgetTokens"];
|
|
153
152
|
}
|
|
154
153
|
const openrouter = asRecord(providerOptions["openrouter"]);
|
|
155
|
-
const
|
|
154
|
+
const dextoNova = asRecord(providerOptions["dexto-nova"]);
|
|
155
|
+
const reasoning = asRecord(openrouter?.["reasoning"] ?? dextoNova?.["reasoning"]);
|
|
156
156
|
if (typeof reasoning?.["max_tokens"] === "number") {
|
|
157
157
|
return reasoning["max_tokens"];
|
|
158
158
|
}
|
|
@@ -171,7 +171,7 @@ function buildProviderOptions(config) {
|
|
|
171
171
|
return buildAnthropicProviderOptions({ model, reasoningVariant, budgetTokens, capable });
|
|
172
172
|
}
|
|
173
173
|
if (provider === "bedrock") {
|
|
174
|
-
const capable =
|
|
174
|
+
const capable = getReasoningProfile("bedrock", model).capable;
|
|
175
175
|
if (!capable) {
|
|
176
176
|
return { bedrock: {} };
|
|
177
177
|
}
|
|
@@ -214,8 +214,9 @@ function buildProviderOptions(config) {
|
|
|
214
214
|
const includeThoughts = profile.capable && reasoningVariant !== "disabled";
|
|
215
215
|
const isThinkingLevel = profile.paradigm === "thinking-level";
|
|
216
216
|
const thinkingLevel = includeThoughts && isThinkingLevel && (reasoningVariant === "minimal" || reasoningVariant === "low" || reasoningVariant === "medium" || reasoningVariant === "high") ? reasoningVariant : void 0;
|
|
217
|
+
const modelDefaultBudgetTokens = getGoogleReasoningBudgetTokens(model, reasoningVariant);
|
|
217
218
|
const thinkingBudgetTokens = coerceBudgetTokens(
|
|
218
|
-
budgetTokens ?? GOOGLE_DEFAULT_BUDGET_TOKENS,
|
|
219
|
+
budgetTokens ?? modelDefaultBudgetTokens ?? GOOGLE_DEFAULT_BUDGET_TOKENS,
|
|
219
220
|
1
|
|
220
221
|
);
|
|
221
222
|
return {
|
|
@@ -3,7 +3,7 @@ import { ContextManager } from '../../context/manager.js';
|
|
|
3
3
|
import { SessionEventBus } from '../../events/index.js';
|
|
4
4
|
import { StreamProcessorResult } from './types.js';
|
|
5
5
|
import type { Logger } from '../../logger/v2/types.js';
|
|
6
|
-
import type { LLMProvider, ReasoningVariant } from '
|
|
6
|
+
import type { LLMProvider, ReasoningVariant } from '@dexto/llm';
|
|
7
7
|
export interface StreamProcessorConfig {
|
|
8
8
|
provider: LLMProvider;
|
|
9
9
|
model: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-processor.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,IAAI,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKvD,OAAO,KAAK,EAAE,WAAW,EAAoB,gBAAgB,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"stream-processor.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/stream-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,IAAI,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKvD,OAAO,KAAK,EAAE,WAAW,EAAoB,gBAAgB,EAAc,MAAM,YAAY,CAAC;AAgD9F,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,gFAAgF;IAChF,qBAAqB,CAAC,EAA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manager.js';
|
|
6
6
|
import type { ToolSet } from '../../tools/types.js';
|
|
7
7
|
import type { ExecutorResult, StreamProcessorResult } from './types.js';
|
|
8
|
-
import type { TokenUsage, LLMReasoningConfig, LLMContext } from '
|
|
8
|
+
import type { TokenUsage, LLMReasoningConfig, LLMContext } from '@dexto/llm';
|
|
9
9
|
import type { Logger } from '../../logger/v2/types.js';
|
|
10
10
|
import type { SessionEventBus, LLMFinishReason } from '../../events/index.js';
|
|
11
11
|
import type { ResourceManager } from '../../resources/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-executor.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/turn-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAMb,KAAK,YAAY,EAEpB,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAa,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAS1D,OAAO,EACH,WAAW,EAId,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAMpD,OAAO,KAAK,EAAE,cAAc,EAAiB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEvF,OAAO,KAAK,EACR,UAAU,EACV,kBAAkB,EAClB,UAAU,EAGb,MAAM,
|
|
1
|
+
{"version":3,"file":"turn-executor.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/turn-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EAMb,KAAK,YAAY,EAEpB,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAa,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAS1D,OA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5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAoB9B,OAAO,CAAC,qBAAqB;IAK7B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAyF3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/llm/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC3B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,oCAAoC;IACpC,YAAY,EAAE,eAAe,CAAC;CACjC;AAED,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,eAAe,CAAC;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC9B"}
|
|
@@ -22,7 +22,7 @@ __export(vercel_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(vercel_exports);
|
|
24
24
|
var import_utils = require("../../context/utils.js");
|
|
25
|
-
var
|
|
25
|
+
var import_types = require("../../logger/v2/types.js");
|
|
26
26
|
function toUrlIfString(value) {
|
|
27
27
|
if (typeof value === "string" && /^https?:\/\//i.test(value)) {
|
|
28
28
|
try {
|
|
@@ -44,7 +44,7 @@ function normalizeToolMediaData(data) {
|
|
|
44
44
|
class VercelMessageFormatter {
|
|
45
45
|
logger;
|
|
46
46
|
constructor(logger) {
|
|
47
|
-
this.logger = logger.createChild(
|
|
47
|
+
this.logger = logger.createChild(import_types.DextoLogComponent.LLM);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Formats internal messages into Vercel AI SDK format
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.d.ts","sourceRoot":"","sources":["../../../src/llm/formatters/vercel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAiD,MAAM,IAAI,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vercel.d.ts","sourceRoot":"","sources":["../../../src/llm/formatters/vercel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAiD,MAAM,IAAI,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAiC,MAAM,wBAAwB,CAAC;AAO7F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AA8BvD;;;;;;;;;;GAUG;AACH,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAG1B;;;;;;OAMG;IACH,MAAM,CACF,OAAO,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC,EACpC,OAAO,EAAE,UAAU,EACnB,YAAY,EAAE,MAAM,GAAG,IAAI,GAC5B,YAAY,EAAE;IAkKjB;;;;;;OAMG;IACH,kBAAkB,IAAI,IAAI;IAI1B,OAAO,CAAC,wBAAwB;IAUhC,OAAO,CAAC,sBAAsB;IAmG9B,OAAO,CAAC,iBAAiB;CA6E5B"}
|
package/dist/llm/index.cjs
CHANGED
|
@@ -44,11 +44,9 @@ __reExport(llm_exports, require("./error-codes.js"), module.exports);
|
|
|
44
44
|
__reExport(llm_exports, require("./registry/index.js"), module.exports);
|
|
45
45
|
__reExport(llm_exports, require("./curation.js"), module.exports);
|
|
46
46
|
__reExport(llm_exports, require("./validation.js"), module.exports);
|
|
47
|
-
__reExport(llm_exports, require("./types.js"), module.exports);
|
|
48
47
|
__reExport(llm_exports, require("./usage-metadata.js"), module.exports);
|
|
49
48
|
__reExport(llm_exports, require("./usage-scope.js"), module.exports);
|
|
50
49
|
__reExport(llm_exports, require("./usage-summary.js"), module.exports);
|
|
51
|
-
__reExport(llm_exports, require("./reasoning/profile.js"), module.exports);
|
|
52
50
|
__reExport(llm_exports, require("./services/index.js"), module.exports);
|
|
53
51
|
__reExport(llm_exports, require("./executor/index.js"), module.exports);
|
|
54
52
|
__reExport(llm_exports, require("./schemas.js"), module.exports);
|
|
@@ -82,11 +80,9 @@ __reExport(llm_exports, require("./providers/local/index.js"), module.exports);
|
|
|
82
80
|
...require("./registry/index.js"),
|
|
83
81
|
...require("./curation.js"),
|
|
84
82
|
...require("./validation.js"),
|
|
85
|
-
...require("./types.js"),
|
|
86
83
|
...require("./usage-metadata.js"),
|
|
87
84
|
...require("./usage-scope.js"),
|
|
88
85
|
...require("./usage-summary.js"),
|
|
89
|
-
...require("./reasoning/profile.js"),
|
|
90
86
|
...require("./services/index.js"),
|
|
91
87
|
...require("./executor/index.js"),
|
|
92
88
|
...require("./schemas.js"),
|