@cuylabs/agent-core 0.8.0 → 0.9.0

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 (68) hide show
  1. package/dist/{builder-UpOWQMW3.d.ts → builder-BgZ_j4Vs.d.ts} +2 -1
  2. package/dist/{chunk-RZITT45F.js → chunk-4QFNWPIF.js} +4 -4
  3. package/dist/{chunk-BFM2YHNM.js → chunk-5ARZJWD2.js} +74 -37
  4. package/dist/{chunk-KUVSERLJ.js → chunk-DXFBQMXP.js} +5 -2
  5. package/dist/{chunk-CAA7FHIH.js → chunk-EKR6PKXU.js} +0 -100
  6. package/dist/{chunk-IVUJDISU.js → chunk-GFTW23FV.js} +5 -14
  7. package/dist/{chunk-7VKQ4WPB.js → chunk-H3FUYU52.js} +11 -3
  8. package/dist/chunk-I6PKJ7XQ.js +292 -0
  9. package/dist/chunk-IYWQOJMQ.js +102 -0
  10. package/dist/{chunk-4BDA7DQY.js → chunk-J4QDGZIA.js} +19 -3
  11. package/dist/{chunk-7MUFEN4K.js → chunk-JLXG2SH7.js} +349 -3
  12. package/dist/{chunk-YSLSEQ6B.js → chunk-MAZ5DY5B.js} +18 -30
  13. package/dist/{chunk-P6YF7USR.js → chunk-MHKK374K.js} +12 -11
  14. package/dist/{chunk-VBWWUHWI.js → chunk-OFDKHNCX.js} +4 -1
  15. package/dist/{chunk-YUUJK53A.js → chunk-RKEW5WXI.js} +1 -1
  16. package/dist/{chunk-LRHOS4ZN.js → chunk-SPILYYDF.js} +3 -2
  17. package/dist/{chunk-RFEKJKTO.js → chunk-UDCZ673N.js} +321 -275
  18. package/dist/{chunk-BDBZ3SLK.js → chunk-UHCJEM2E.js} +39 -2
  19. package/dist/chunk-WGZAPU6N.js +929 -0
  20. package/dist/{chunk-N6HWIEEA.js → chunk-WKHDSSXG.js} +140 -23
  21. package/dist/index-BCqEGzBj.d.ts +251 -0
  22. package/dist/{index-CWSchSql.d.ts → index-DQuTZ8xL.d.ts} +290 -13
  23. package/dist/index.d.ts +23 -29
  24. package/dist/index.js +776 -490
  25. package/dist/{errors → inference/errors}/index.d.ts +2 -2
  26. package/dist/{errors → inference/errors}/index.js +1 -1
  27. package/dist/inference/index.d.ts +10 -9
  28. package/dist/inference/index.js +34 -8
  29. package/dist/middleware/index.d.ts +5 -4
  30. package/dist/middleware/index.js +3 -3
  31. package/dist/models/index.d.ts +18 -16
  32. package/dist/models/index.js +47 -11
  33. package/dist/models/reasoning/index.d.ts +4 -0
  34. package/dist/{reasoning → models/reasoning}/index.js +2 -3
  35. package/dist/plugin/index.d.ts +414 -0
  36. package/dist/plugin/index.js +32 -0
  37. package/dist/presets/index.d.ts +3 -3
  38. package/dist/presets/index.js +7 -5
  39. package/dist/prompt/index.d.ts +6 -5
  40. package/dist/prompt/index.js +3 -2
  41. package/dist/runner-CI-XeR16.d.ts +91 -0
  42. package/dist/runtime/index.d.ts +7 -6
  43. package/dist/runtime/index.js +6 -7
  44. package/dist/safety/index.d.ts +1 -1
  45. package/dist/safety/index.js +1 -1
  46. package/dist/{session-manager-B_CWGTsl.d.ts → session-manager-KbYt2WUh.d.ts} +8 -0
  47. package/dist/signal/index.js +1 -1
  48. package/dist/skill/index.d.ts +2 -2
  49. package/dist/skill/index.js +3 -3
  50. package/dist/storage/index.d.ts +2 -2
  51. package/dist/storage/index.js +1 -1
  52. package/dist/sub-agent/index.d.ts +10 -9
  53. package/dist/sub-agent/index.js +21 -4
  54. package/dist/tool/index.d.ts +19 -5
  55. package/dist/tool/index.js +2 -2
  56. package/dist/{tool-BHbyUAy3.d.ts → tool-CZWN3KbO.d.ts} +1 -10
  57. package/dist/{tool-DLXAR9Ce.d.ts → tool-DkhSCV2Y.d.ts} +1 -1
  58. package/dist/tracking/index.d.ts +1 -1
  59. package/dist/tracking/index.js +1 -1
  60. package/dist/{types-KKDrdU9Y.d.ts → types-BlOKk-Bb.d.ts} +9 -4
  61. package/dist/{types-BnpEOYV-.d.ts → types-BlZwmnuW.d.ts} +1 -1
  62. package/dist/{runner-e2YRcUoX.d.ts → types-DTSkxakL.d.ts} +3 -138
  63. package/dist/{types-QKHHQLLq.d.ts → types-DmDwi2zI.d.ts} +7 -4
  64. package/package.json +15 -9
  65. package/dist/chunk-DWYX7ASF.js +0 -26
  66. package/dist/chunk-SQU2AJHO.js +0 -305
  67. package/dist/reasoning/index.d.ts +0 -116
  68. package/dist/types-QA4WhEfz.d.ts +0 -138
@@ -1,305 +0,0 @@
1
- import {
2
- extractModelId,
3
- extractProvider,
4
- getDefaultResolver,
5
- likelySupportsReasoning
6
- } from "./chunk-RFEKJKTO.js";
7
-
8
- // src/reasoning/types.ts
9
- var STANDARD_LEVELS = ["off", "low", "medium", "high"];
10
- var EXTENDED_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
11
- var FIXED_LEVELS = ["medium"];
12
- function shouldIncludeReasoningSummary() {
13
- if (typeof process !== "undefined" && process.env) {
14
- return process.env.CODE_AGENT_DISABLE_REASONING_SUMMARY !== "true";
15
- }
16
- return true;
17
- }
18
-
19
- // src/reasoning/providers.ts
20
- function buildOpenAIOptions(level, compat) {
21
- if (level === "off") return void 0;
22
- const options = {};
23
- if (compat?.supportsReasoningEffort !== false) {
24
- options.reasoningEffort = level;
25
- }
26
- if (shouldIncludeReasoningSummary()) {
27
- options.reasoningSummary = "auto";
28
- }
29
- return options;
30
- }
31
- var ANTHROPIC_BUDGETS = {
32
- off: 0,
33
- minimal: 2e3,
34
- low: 4e3,
35
- medium: 8e3,
36
- high: 16e3,
37
- xhigh: 31999
38
- };
39
- function buildAnthropicOptions(level) {
40
- if (level === "off") return void 0;
41
- return {
42
- thinking: {
43
- type: "enabled",
44
- budgetTokens: ANTHROPIC_BUDGETS[level]
45
- }
46
- };
47
- }
48
- var GOOGLE_BUDGETS = {
49
- off: 0,
50
- minimal: 2e3,
51
- low: 4e3,
52
- medium: 8e3,
53
- high: 16e3,
54
- xhigh: 24576
55
- };
56
- function buildGoogleOptions(level, modelId) {
57
- if (level === "off") return void 0;
58
- if (modelId?.includes("gemini-3") || modelId?.includes("gemini-4")) {
59
- return {
60
- thinkingConfig: {
61
- includeThoughts: true,
62
- thinkingLevel: level === "high" || level === "xhigh" ? "high" : "low"
63
- }
64
- };
65
- }
66
- return {
67
- thinkingConfig: {
68
- includeThoughts: true,
69
- thinkingBudget: GOOGLE_BUDGETS[level]
70
- }
71
- };
72
- }
73
- function buildXAIOptions(level) {
74
- if (level === "off") return void 0;
75
- return { reasoningEffort: level };
76
- }
77
- function buildGroqOptions(level) {
78
- if (level === "off") return void 0;
79
- return {
80
- includeThoughts: true,
81
- thinkingLevel: level === "high" || level === "xhigh" ? "high" : "low"
82
- };
83
- }
84
- var BEDROCK_ANTHROPIC_BUDGETS = {
85
- off: 0,
86
- minimal: 2e3,
87
- low: 4e3,
88
- medium: 8e3,
89
- high: 16e3,
90
- xhigh: 31999
91
- };
92
- function buildBedrockOptions(level, modelId) {
93
- if (level === "off") return void 0;
94
- if (modelId?.includes("anthropic") || modelId?.includes("claude")) {
95
- return {
96
- reasoningConfig: {
97
- type: "enabled",
98
- budgetTokens: BEDROCK_ANTHROPIC_BUDGETS[level]
99
- }
100
- };
101
- }
102
- return {
103
- reasoningConfig: {
104
- type: "enabled",
105
- maxReasoningEffort: level
106
- }
107
- };
108
- }
109
- function buildOpenRouterOptions(level) {
110
- if (level === "off") return void 0;
111
- return {
112
- reasoning: { effort: level }
113
- };
114
- }
115
- var PROVIDER_KEY_MAP = {
116
- "openai.chat": "openai",
117
- "openai.responses": "openai",
118
- "anthropic.messages": "anthropic",
119
- "google.generative-ai": "google",
120
- "bedrock": "bedrock",
121
- "azure": "azure",
122
- "xai": "xai",
123
- "deepinfra": "deepinfra",
124
- "togetherai": "togetherai",
125
- "groq": "groq",
126
- "mistral": "mistral"
127
- };
128
- function getProviderOptionsKey(provider) {
129
- return PROVIDER_KEY_MAP[provider] || provider.split(".")[0] || "unknown";
130
- }
131
-
132
- // src/reasoning/config.ts
133
- async function getReasoningConfig(model) {
134
- const resolver = getDefaultResolver();
135
- const result = await resolver.resolve(model);
136
- const { capabilities, compatibility } = result.entry;
137
- const provider = extractProvider(model);
138
- const modelId = extractModelId(model).toLowerCase();
139
- if (!capabilities.reasoning) {
140
- return {
141
- supportsReasoning: false,
142
- availableLevels: ["off"],
143
- getProviderOptions: () => void 0
144
- };
145
- }
146
- if (provider?.includes("openai") || modelId.includes("gpt") || modelId.match(/^o[134]/)) {
147
- if (modelId === "o1-mini") {
148
- return {
149
- supportsReasoning: true,
150
- availableLevels: FIXED_LEVELS,
151
- getProviderOptions: () => void 0
152
- };
153
- }
154
- const isAdvanced = modelId.includes("gpt-5") || modelId.includes("o3") || modelId.includes("o4");
155
- return {
156
- supportsReasoning: true,
157
- availableLevels: isAdvanced ? EXTENDED_LEVELS : STANDARD_LEVELS,
158
- getProviderOptions: (level) => buildOpenAIOptions(level, compatibility)
159
- };
160
- }
161
- if (provider?.includes("anthropic") || modelId.includes("claude")) {
162
- return {
163
- supportsReasoning: true,
164
- availableLevels: ["off", "low", "medium", "high"],
165
- getProviderOptions: buildAnthropicOptions
166
- };
167
- }
168
- if (provider?.includes("google") || modelId.includes("gemini")) {
169
- return {
170
- supportsReasoning: true,
171
- availableLevels: STANDARD_LEVELS,
172
- getProviderOptions: (level) => buildGoogleOptions(level, modelId)
173
- };
174
- }
175
- if (provider?.includes("xai") || modelId.includes("grok")) {
176
- return {
177
- supportsReasoning: true,
178
- availableLevels: STANDARD_LEVELS,
179
- getProviderOptions: buildXAIOptions
180
- };
181
- }
182
- if (provider?.includes("bedrock")) {
183
- return {
184
- supportsReasoning: true,
185
- availableLevels: STANDARD_LEVELS,
186
- getProviderOptions: (level) => buildBedrockOptions(level, modelId)
187
- };
188
- }
189
- if (provider?.includes("groq")) {
190
- return {
191
- supportsReasoning: true,
192
- availableLevels: ["off", "low", "high"],
193
- getProviderOptions: buildGroqOptions
194
- };
195
- }
196
- if (provider?.includes("openrouter")) {
197
- return {
198
- supportsReasoning: true,
199
- availableLevels: STANDARD_LEVELS,
200
- getProviderOptions: buildOpenRouterOptions
201
- };
202
- }
203
- if (modelId.includes("r1") || modelId.includes("deepseek")) {
204
- return {
205
- supportsReasoning: true,
206
- availableLevels: FIXED_LEVELS,
207
- getProviderOptions: () => void 0
208
- };
209
- }
210
- return {
211
- supportsReasoning: true,
212
- availableLevels: STANDARD_LEVELS,
213
- getProviderOptions: (level) => buildOpenAIOptions(level, compatibility)
214
- };
215
- }
216
- function getReasoningConfigSync(model) {
217
- const modelId = extractModelId(model).toLowerCase();
218
- const provider = extractProvider(model) || "";
219
- const supportsReasoning2 = modelId.match(/^o[134]/) !== null || modelId.includes("gpt-5") || modelId.includes("r1") || modelId.includes("thinking") || modelId.includes("reasoning") || modelId.includes("grok") && modelId.includes("mini");
220
- if (!supportsReasoning2) {
221
- return {
222
- supportsReasoning: false,
223
- availableLevels: ["off"],
224
- getProviderOptions: () => void 0
225
- };
226
- }
227
- const isOpenAI = provider.includes("openai") || !!modelId.match(/^o[134]/) || modelId.includes("gpt");
228
- const isAnthropic = provider.includes("anthropic") || modelId.includes("claude");
229
- const isGoogle = provider.includes("google") || modelId.includes("gemini");
230
- const isXAI = provider.includes("xai") || modelId.includes("grok");
231
- const isBedrock = provider.includes("bedrock");
232
- const isGroq = provider.includes("groq");
233
- const isOpenRouter = provider.includes("openrouter");
234
- return {
235
- supportsReasoning: true,
236
- availableLevels: STANDARD_LEVELS,
237
- getProviderOptions: (level) => {
238
- if (level === "off") return void 0;
239
- if (isOpenAI) {
240
- const opts = { reasoningEffort: level };
241
- if (shouldIncludeReasoningSummary()) opts.reasoningSummary = "auto";
242
- return opts;
243
- }
244
- if (isAnthropic) return buildAnthropicOptions(level);
245
- if (isGoogle) return buildGoogleOptions(level, modelId);
246
- if (isXAI) return buildXAIOptions(level);
247
- if (isBedrock) return buildBedrockOptions(level, modelId);
248
- if (isGroq) return buildGroqOptions(level);
249
- if (isOpenRouter) return buildOpenRouterOptions(level);
250
- const defaultOpts = { reasoningEffort: level };
251
- if (shouldIncludeReasoningSummary()) defaultOpts.reasoningSummary = "auto";
252
- return defaultOpts;
253
- }
254
- };
255
- }
256
- async function buildReasoningOptions(model, level) {
257
- if (level === "off") return void 0;
258
- const config = await getReasoningConfig(model);
259
- if (!config.supportsReasoning) return void 0;
260
- const effectiveLevel = config.availableLevels.includes(level) ? level : config.availableLevels[config.availableLevels.length - 1];
261
- const options = config.getProviderOptions(effectiveLevel);
262
- if (!options) return void 0;
263
- const provider = extractProvider(model) || "";
264
- const providerKey = getProviderOptionsKey(provider);
265
- return { [providerKey]: options };
266
- }
267
- function buildReasoningOptionsSync(model, level) {
268
- if (level === "off") return void 0;
269
- const config = getReasoningConfigSync(model);
270
- if (!config.supportsReasoning) return void 0;
271
- const effectiveLevel = config.availableLevels.includes(level) ? level : config.availableLevels[config.availableLevels.length - 1];
272
- const options = config.getProviderOptions(effectiveLevel);
273
- if (!options) return void 0;
274
- const provider = extractProvider(model) || "";
275
- const providerKey = getProviderOptionsKey(provider);
276
- return { [providerKey]: options };
277
- }
278
- async function supportsReasoning(model) {
279
- const resolver = getDefaultResolver();
280
- return resolver.supportsReasoning(model);
281
- }
282
- function supportsReasoningSync(model) {
283
- return likelySupportsReasoning(extractModelId(model));
284
- }
285
-
286
- export {
287
- STANDARD_LEVELS,
288
- EXTENDED_LEVELS,
289
- FIXED_LEVELS,
290
- shouldIncludeReasoningSummary,
291
- buildOpenAIOptions,
292
- buildAnthropicOptions,
293
- buildGoogleOptions,
294
- buildXAIOptions,
295
- buildGroqOptions,
296
- buildBedrockOptions,
297
- buildOpenRouterOptions,
298
- getProviderOptionsKey,
299
- getReasoningConfig,
300
- getReasoningConfigSync,
301
- buildReasoningOptions,
302
- buildReasoningOptionsSync,
303
- supportsReasoning,
304
- supportsReasoningSync
305
- };
@@ -1,116 +0,0 @@
1
- import { R as ReasoningLevel, a as ReasoningConfig } from '../types-CQaXbRsS.js';
2
- export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
3
- import { P as ProviderCompatibility } from '../types-QA4WhEfz.js';
4
- import { LanguageModel } from 'ai';
5
- import { ProviderOptions } from '@ai-sdk/provider-utils';
6
-
7
- /**
8
- * Provider-Specific Reasoning Option Builders
9
- *
10
- * Each function takes a {@link ReasoningLevel} and returns the
11
- * provider-options object expected by the Vercel AI SDK's
12
- * `providerOptions` parameter.
13
- *
14
- * Provider key mapping (`getProviderOptionsKey`) is also defined
15
- * here so that callers can wrap the raw options correctly.
16
- */
17
-
18
- /**
19
- * Build OpenAI reasoning options.
20
- *
21
- * OpenAI reasoning models use:
22
- * - `reasoningEffort` — controls depth
23
- * - `reasoningSummary` — controls whether reasoning is streamed
24
- * (`"auto"` = condensed summary, `"detailed"` = full)
25
- *
26
- * `reasoningSummary` requires a verified OpenAI organisation.
27
- * Set `CODE_AGENT_DISABLE_REASONING_SUMMARY=true` to skip it.
28
- */
29
- declare function buildOpenAIOptions(level: ReasoningLevel, compat?: ProviderCompatibility): Record<string, unknown> | undefined;
30
- /**
31
- * Build Anthropic thinking options.
32
- *
33
- * Uses `thinking.type: "enabled"` with `budgetTokens`.
34
- */
35
- declare function buildAnthropicOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
36
- /**
37
- * Build Google / Gemini reasoning options.
38
- *
39
- * - **Gemini 3+** uses `thinkingLevel` (`"low"` / `"high"`)
40
- * - **Gemini 2.5 and earlier** uses `thinkingBudget` (token count)
41
- */
42
- declare function buildGoogleOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
43
- /**
44
- * Build xAI / Grok reasoning options.
45
- */
46
- declare function buildXAIOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
47
- /**
48
- * Build Groq reasoning options.
49
- */
50
- declare function buildGroqOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
51
- /**
52
- * Build Amazon Bedrock reasoning options.
53
- *
54
- * - Anthropic / Claude models use `budgetTokens`
55
- * - Amazon Nova models use `maxReasoningEffort`
56
- */
57
- declare function buildBedrockOptions(level: ReasoningLevel, modelId?: string): Record<string, unknown> | undefined;
58
- /**
59
- * Build OpenRouter reasoning options.
60
- */
61
- declare function buildOpenRouterOptions(level: ReasoningLevel): Record<string, unknown> | undefined;
62
- /**
63
- * Resolve the `providerOptions` key for a given SDK provider string.
64
- *
65
- * Falls back to the first dot-segment (e.g. `"foo.bar"` → `"foo"`).
66
- */
67
- declare function getProviderOptionsKey(provider: string): string;
68
-
69
- /**
70
- * Reasoning Configuration & Option Builders
71
- *
72
- * Orchestrates capability detection and provider-specific option
73
- * building to produce ready-to-use `providerOptions` for the
74
- * Vercel AI SDK.
75
- *
76
- * Two flavours of every function are provided:
77
- * - **Async** (`getReasoningConfig`, `buildReasoningOptions`) —
78
- * uses the full capability resolver (network + cache).
79
- * - **Sync** (`getReasoningConfigSync`, `buildReasoningOptionsSync`) —
80
- * uses fast pattern-matching only (no network).
81
- */
82
-
83
- /**
84
- * Get the reasoning configuration for a model.
85
- *
86
- * Uses the full capability resolver (including network lookups)
87
- * for the most accurate result.
88
- */
89
- declare function getReasoningConfig(model: LanguageModel): Promise<ReasoningConfig>;
90
- /**
91
- * Synchronous reasoning config using pattern-matching only.
92
- *
93
- * Faster but less accurate than {@link getReasoningConfig}.
94
- * Good for hot paths where async is impractical.
95
- */
96
- declare function getReasoningConfigSync(model: LanguageModel): ReasoningConfig;
97
- /**
98
- * Build `providerOptions` for a reasoning level (async).
99
- *
100
- * Returns `undefined` when reasoning is off or unsupported.
101
- */
102
- declare function buildReasoningOptions(model: LanguageModel, level: ReasoningLevel): Promise<ProviderOptions | undefined>;
103
- /**
104
- * Build `providerOptions` for a reasoning level (sync / pattern-only).
105
- */
106
- declare function buildReasoningOptionsSync(model: LanguageModel, level: ReasoningLevel): ProviderOptions | undefined;
107
- /**
108
- * Check whether a model supports reasoning (async, full resolver).
109
- */
110
- declare function supportsReasoning(model: LanguageModel): Promise<boolean>;
111
- /**
112
- * Synchronous check using pattern-matching only.
113
- */
114
- declare function supportsReasoningSync(model: LanguageModel): boolean;
115
-
116
- export { ReasoningConfig, ReasoningLevel, buildAnthropicOptions, buildBedrockOptions, buildGoogleOptions, buildGroqOptions, buildOpenAIOptions, buildOpenRouterOptions, buildReasoningOptions, buildReasoningOptionsSync, buildXAIOptions, getProviderOptionsKey, getReasoningConfig, getReasoningConfigSync, supportsReasoning, supportsReasoningSync };
@@ -1,138 +0,0 @@
1
- /**
2
- * Model Capability Types for @cuylabs/agent-core
3
- *
4
- * Defines the structure for model capabilities that can be sourced from
5
- * static patterns, local cache, or remote APIs.
6
- */
7
- /**
8
- * Input modalities a model can accept
9
- */
10
- type InputModality = "text" | "image" | "audio" | "video" | "pdf";
11
- /**
12
- * Output modalities a model can produce
13
- */
14
- type OutputModality = "text" | "image" | "audio" | "video";
15
- /**
16
- * Comprehensive model capabilities
17
- */
18
- interface ModelCapabilities {
19
- /** Model supports extended reasoning/thinking */
20
- reasoning: boolean;
21
- /** Model supports function/tool calling */
22
- toolCalling: boolean;
23
- /** Model supports temperature adjustment */
24
- temperature: boolean;
25
- /** Model supports file attachments */
26
- attachments: boolean;
27
- /** Model supports streaming responses */
28
- streaming: boolean;
29
- /** Supported input modalities */
30
- inputModalities: InputModality[];
31
- /** Supported output modalities */
32
- outputModalities: OutputModality[];
33
- /** Maximum context window in tokens */
34
- contextWindow?: number;
35
- /** Maximum output tokens */
36
- maxOutput?: number;
37
- }
38
- /**
39
- * Provider-specific compatibility flags
40
- * These handle quirks in different provider implementations
41
- */
42
- interface ProviderCompatibility {
43
- /** Supports OpenAI-style reasoning_effort parameter */
44
- supportsReasoningEffort?: boolean;
45
- /** Supports developer/system role distinction */
46
- supportsDeveloperRole?: boolean;
47
- /** Field name for max tokens (varies by provider) */
48
- maxTokensField?: "max_tokens" | "max_completion_tokens";
49
- /** Requires thinking as text tags vs structured */
50
- requiresThinkingTags?: boolean;
51
- /** Provider-specific thinking format */
52
- thinkingFormat?: "openai" | "anthropic" | "google" | "zai";
53
- }
54
- /**
55
- * Complete model entry with metadata
56
- */
57
- interface ModelEntry {
58
- /** Model identifier (e.g., "gpt-4o", "claude-sonnet-4") */
59
- id: string;
60
- /** Human-readable model name */
61
- name: string;
62
- /** Provider identifier (e.g., "openai", "anthropic") */
63
- provider: string;
64
- /** Model capabilities */
65
- capabilities: ModelCapabilities;
66
- /** Provider-specific compatibility settings */
67
- compatibility?: ProviderCompatibility;
68
- /** Cost per million tokens (input) */
69
- costInput?: number;
70
- /** Cost per million tokens (output) */
71
- costOutput?: number;
72
- /** When this entry was last updated */
73
- updatedAt?: string;
74
- }
75
- /**
76
- * Priority levels for capability sources
77
- */
78
- declare enum SourcePriority {
79
- /** User configuration overrides everything */
80
- UserConfig = 0,
81
- /** Local cache from previous fetch */
82
- LocalCache = 1,
83
- /** Bundled static data (build-time) */
84
- BundledData = 2,
85
- /** Pattern-based inference (fallback) */
86
- PatternMatch = 3,
87
- /** Remote API (if network available) */
88
- RemoteAPI = 4
89
- }
90
- /**
91
- * Result from a capability source lookup
92
- */
93
- interface SourceResult {
94
- /** The model entry if found */
95
- entry?: ModelEntry;
96
- /** Which source provided this result */
97
- source: SourcePriority;
98
- /** Whether this is a confident match */
99
- confident: boolean;
100
- /** Error message if lookup failed */
101
- error?: string;
102
- }
103
- /**
104
- * Capability source interface
105
- */
106
- interface CapabilitySource {
107
- /** Source priority (lower = higher priority) */
108
- priority: SourcePriority;
109
- /** Human-readable source name */
110
- name: string;
111
- /** Look up capabilities for a model */
112
- lookup(modelId: string, provider?: string): Promise<SourceResult>;
113
- /** Check if this source is available */
114
- isAvailable(): Promise<boolean>;
115
- }
116
- /**
117
- * Options for the capability resolver
118
- */
119
- interface ResolverOptions {
120
- /** Enable remote API fetching (default: false) */
121
- enableRemoteFetch?: boolean;
122
- /** Remote API URL (default: https://models.dev) */
123
- remoteApiUrl?: string;
124
- /** Cache directory path */
125
- cachePath?: string;
126
- /** Cache TTL in milliseconds (default: 1 hour) */
127
- cacheTtlMs?: number;
128
- /** Network timeout in milliseconds (default: 10 seconds) */
129
- networkTimeoutMs?: number;
130
- /** Custom user overrides for specific models */
131
- modelOverrides?: Record<string, Partial<ModelCapabilities>>;
132
- }
133
- /**
134
- * Default resolver options
135
- */
136
- declare const DEFAULT_RESOLVER_OPTIONS: Required<ResolverOptions>;
137
-
138
- export { type CapabilitySource as C, DEFAULT_RESOLVER_OPTIONS as D, type InputModality as I, type ModelCapabilities as M, type OutputModality as O, type ProviderCompatibility as P, type ResolverOptions as R, SourcePriority as S, type ModelEntry as a, type SourceResult as b };