@warmdrift/kgauto-compiler 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +198 -0
- package/dist/chunk-5TI6PNSK.mjs +95 -0
- package/dist/chunk-MBEI5UOM.mjs +409 -0
- package/dist/dialect.d.mts +99 -0
- package/dist/dialect.d.ts +99 -0
- package/dist/dialect.js +127 -0
- package/dist/dialect.mjs +22 -0
- package/dist/index.d.mts +238 -0
- package/dist/index.d.ts +238 -0
- package/dist/index.js +1804 -0
- package/dist/index.mjs +1286 -0
- package/dist/profiles-BiyrF36f.d.mts +489 -0
- package/dist/profiles-C5lVqF8_.d.ts +489 -0
- package/dist/profiles.d.mts +2 -0
- package/dist/profiles.d.ts +2 -0
- package/dist/profiles.js +437 -0
- package/dist/profiles.mjs +14 -0
- package/package.json +59 -0
package/dist/profiles.js
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
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
|
+
|
|
20
|
+
// src/profiles.ts
|
|
21
|
+
var profiles_exports = {};
|
|
22
|
+
__export(profiles_exports, {
|
|
23
|
+
ALIASES: () => ALIASES,
|
|
24
|
+
allProfiles: () => allProfiles,
|
|
25
|
+
getProfile: () => getProfile,
|
|
26
|
+
profilesByProvider: () => profilesByProvider,
|
|
27
|
+
tryGetProfile: () => tryGetProfile
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(profiles_exports);
|
|
30
|
+
var ANTHROPIC_LOWERING_BASE = {
|
|
31
|
+
system: { mode: "inline" },
|
|
32
|
+
cache: {
|
|
33
|
+
strategy: "cache_control",
|
|
34
|
+
minTokens: 1024,
|
|
35
|
+
discount: 0.1,
|
|
36
|
+
ttlSeconds: 300
|
|
37
|
+
},
|
|
38
|
+
tools: { format: "anthropic" }
|
|
39
|
+
};
|
|
40
|
+
var GOOGLE_LOWERING_BASE = {
|
|
41
|
+
system: { mode: "separate", field: "systemInstruction" },
|
|
42
|
+
cache: {
|
|
43
|
+
strategy: "cachedContent",
|
|
44
|
+
minTokens: 4096,
|
|
45
|
+
discount: 0.25,
|
|
46
|
+
ttlSeconds: 3600
|
|
47
|
+
},
|
|
48
|
+
tools: { format: "google" }
|
|
49
|
+
};
|
|
50
|
+
var PROFILES_RAW = [
|
|
51
|
+
// ── Anthropic ──
|
|
52
|
+
{
|
|
53
|
+
id: "claude-opus-4-7",
|
|
54
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
55
|
+
provider: "anthropic",
|
|
56
|
+
status: "current",
|
|
57
|
+
maxContextTokens: 1e6,
|
|
58
|
+
maxOutputTokens: 128e3,
|
|
59
|
+
maxTools: 64,
|
|
60
|
+
parallelToolCalls: true,
|
|
61
|
+
structuredOutput: "grammar",
|
|
62
|
+
systemPromptMode: "inline",
|
|
63
|
+
streaming: true,
|
|
64
|
+
cliffs: [],
|
|
65
|
+
costInputPer1m: 5,
|
|
66
|
+
costOutputPer1m: 25,
|
|
67
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
68
|
+
recovery: [
|
|
69
|
+
{
|
|
70
|
+
signal: "rate_limit",
|
|
71
|
+
action: "escalate",
|
|
72
|
+
reason: "429 from Anthropic \u2014 escalate to fallback chain"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
signal: "model_not_found",
|
|
76
|
+
action: "escalate",
|
|
77
|
+
reason: "Model deprecated/renamed \u2014 escalate (L-061)"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
strengths: ["reasoning", "agentic_coding", "long_context", "reliable_tool_use", "structured_output"],
|
|
81
|
+
weaknesses: ["cost", "latency"],
|
|
82
|
+
notes: "Frontier (2026-05). Step-change improvement over 4.6 in agentic coding. Adaptive thinking only \u2014 no extended-thinking toggle. 1M context, 128k max output."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "claude-opus-4-6",
|
|
86
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
87
|
+
provider: "anthropic",
|
|
88
|
+
status: "legacy",
|
|
89
|
+
maxContextTokens: 1e6,
|
|
90
|
+
maxOutputTokens: 128e3,
|
|
91
|
+
maxTools: 64,
|
|
92
|
+
parallelToolCalls: true,
|
|
93
|
+
structuredOutput: "grammar",
|
|
94
|
+
systemPromptMode: "inline",
|
|
95
|
+
streaming: true,
|
|
96
|
+
cliffs: [],
|
|
97
|
+
costInputPer1m: 5,
|
|
98
|
+
costOutputPer1m: 25,
|
|
99
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
100
|
+
recovery: [
|
|
101
|
+
{
|
|
102
|
+
signal: "rate_limit",
|
|
103
|
+
action: "escalate",
|
|
104
|
+
reason: "429 from Anthropic \u2014 escalate to fallback chain"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
signal: "model_not_found",
|
|
108
|
+
action: "escalate",
|
|
109
|
+
reason: "Model deprecated/renamed \u2014 escalate (L-061)"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
strengths: ["reasoning", "long_context", "reliable_tool_use", "structured_output", "extended_thinking"],
|
|
113
|
+
weaknesses: ["cost", "latency"],
|
|
114
|
+
notes: "Predecessor to 4.7. Still current in Anthropic legacy table. Same pricing as 4.7 \u2014 choose 4.7 unless you need extended-thinking budget control (4.7 is adaptive-only)."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "claude-sonnet-4-6",
|
|
118
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
119
|
+
provider: "anthropic",
|
|
120
|
+
status: "current",
|
|
121
|
+
maxContextTokens: 1e6,
|
|
122
|
+
maxOutputTokens: 64e3,
|
|
123
|
+
maxTools: 64,
|
|
124
|
+
parallelToolCalls: true,
|
|
125
|
+
structuredOutput: "grammar",
|
|
126
|
+
systemPromptMode: "inline",
|
|
127
|
+
streaming: true,
|
|
128
|
+
cliffs: [],
|
|
129
|
+
costInputPer1m: 3,
|
|
130
|
+
costOutputPer1m: 15,
|
|
131
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
132
|
+
recovery: [
|
|
133
|
+
{ signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" },
|
|
134
|
+
{ signal: "model_not_found", action: "escalate", reason: "Deprecated \u2014 escalate (L-061)" }
|
|
135
|
+
],
|
|
136
|
+
strengths: ["quality", "tool_use", "long_context", "cache_friendly", "extended_thinking"],
|
|
137
|
+
weaknesses: [],
|
|
138
|
+
notes: "Workhorse. Best price/quality for most multi-turn agentic work. 1M context, 64k max output."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "claude-haiku-4-5",
|
|
142
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
143
|
+
provider: "anthropic",
|
|
144
|
+
status: "current",
|
|
145
|
+
maxContextTokens: 2e5,
|
|
146
|
+
maxOutputTokens: 64e3,
|
|
147
|
+
maxTools: 32,
|
|
148
|
+
parallelToolCalls: true,
|
|
149
|
+
structuredOutput: "grammar",
|
|
150
|
+
systemPromptMode: "inline",
|
|
151
|
+
streaming: true,
|
|
152
|
+
cliffs: [
|
|
153
|
+
{
|
|
154
|
+
metric: "tool_count",
|
|
155
|
+
threshold: 16,
|
|
156
|
+
action: "drop_to_top_relevant",
|
|
157
|
+
reason: "Haiku reliability degrades above ~16 tools"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
costInputPer1m: 1,
|
|
161
|
+
costOutputPer1m: 5,
|
|
162
|
+
lowering: ANTHROPIC_LOWERING_BASE,
|
|
163
|
+
recovery: [
|
|
164
|
+
{ signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to Sonnet" }
|
|
165
|
+
],
|
|
166
|
+
strengths: ["speed", "cost", "classification", "cache_friendly", "extended_thinking"],
|
|
167
|
+
weaknesses: ["complex_reasoning", "large_tool_sets"],
|
|
168
|
+
notes: "Cheapest Anthropic. Great for classify, summarize, ask shapes. 200k context, 64k max output. API alias `claude-haiku-4-5` resolves to dated snapshot `claude-haiku-4-5-20251001`."
|
|
169
|
+
},
|
|
170
|
+
// ── Google ──
|
|
171
|
+
{
|
|
172
|
+
id: "gemini-2.5-flash",
|
|
173
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
174
|
+
provider: "google",
|
|
175
|
+
status: "current",
|
|
176
|
+
maxContextTokens: 1048576,
|
|
177
|
+
maxOutputTokens: 65535,
|
|
178
|
+
maxTools: 128,
|
|
179
|
+
parallelToolCalls: true,
|
|
180
|
+
structuredOutput: "native",
|
|
181
|
+
systemPromptMode: "separate",
|
|
182
|
+
streaming: true,
|
|
183
|
+
cliffs: [
|
|
184
|
+
{
|
|
185
|
+
metric: "input_tokens",
|
|
186
|
+
threshold: 8e3,
|
|
187
|
+
action: "downgrade_quality_warning",
|
|
188
|
+
reason: "Quality degrades significantly above ~8K context tokens"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
metric: "tool_count",
|
|
192
|
+
threshold: 20,
|
|
193
|
+
action: "drop_to_top_relevant",
|
|
194
|
+
reason: "Tool reliability drops above ~20 tools (despite 128 hard limit)"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
metric: "thinking_with_short_output",
|
|
198
|
+
threshold: 1,
|
|
199
|
+
action: "force_thinking_budget_zero",
|
|
200
|
+
reason: "Thinking tokens consume maxOutputTokens \u2014 empty response if drained"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
// s11 trust artifact (2026-05-02): brain showed 5/5 empty rate on
|
|
204
|
+
// tt-intelligence/summarize/gemini-2.5-flash with tools offered.
|
|
205
|
+
// v1's disable_thinking_for_short_output already fired and didn't
|
|
206
|
+
// help — disabling thinking is necessary but not sufficient. Tools
|
|
207
|
+
// present + summarize intent confuses Flash into a no-output state
|
|
208
|
+
// (likely tool-decision purgatory). Strip tools entirely for this
|
|
209
|
+
// archetype on this model.
|
|
210
|
+
metric: "tool_count",
|
|
211
|
+
threshold: 1,
|
|
212
|
+
whenIntent: "summarize",
|
|
213
|
+
action: "strip_tools",
|
|
214
|
+
reason: "Gemini Flash returns empty when summarize intent has tools offered (5/5 empty rate observed in v1 prod 2026-04-19, replayed into v2 brain 2026-04-29)"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
costInputPer1m: 0.3,
|
|
218
|
+
costOutputPer1m: 2.5,
|
|
219
|
+
lowering: {
|
|
220
|
+
...GOOGLE_LOWERING_BASE,
|
|
221
|
+
thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
|
|
222
|
+
},
|
|
223
|
+
recovery: [
|
|
224
|
+
{
|
|
225
|
+
signal: "empty_response_after_tool",
|
|
226
|
+
action: "retry_with_params",
|
|
227
|
+
retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
|
|
228
|
+
maxRetries: 1,
|
|
229
|
+
reason: "Known: empty after tool result \u2014 retry with thinking off"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
signal: "empty_response",
|
|
233
|
+
action: "retry_with_params",
|
|
234
|
+
retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
|
|
235
|
+
maxRetries: 1,
|
|
236
|
+
reason: "Empty response \u2014 try with thinking off"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
signal: "malformed_function_call",
|
|
240
|
+
action: "escalate",
|
|
241
|
+
reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
strengths: ["speed", "volume", "classification", "1m_context", "cost"],
|
|
245
|
+
weaknesses: ["complex_schemas", "large_tool_sets", "high_context_quality"],
|
|
246
|
+
notes: "Fast and cheap with 1M context. Quality cliffs at 8K context and 20 tools \u2014 guard with cliffs."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "gemini-2.5-pro",
|
|
250
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
251
|
+
provider: "google",
|
|
252
|
+
status: "current",
|
|
253
|
+
maxContextTokens: 1048576,
|
|
254
|
+
maxOutputTokens: 65535,
|
|
255
|
+
maxTools: 128,
|
|
256
|
+
parallelToolCalls: true,
|
|
257
|
+
structuredOutput: "native",
|
|
258
|
+
systemPromptMode: "separate",
|
|
259
|
+
streaming: true,
|
|
260
|
+
cliffs: [
|
|
261
|
+
{
|
|
262
|
+
metric: "input_tokens",
|
|
263
|
+
threshold: 2e5,
|
|
264
|
+
action: "downgrade_quality_warning",
|
|
265
|
+
reason: "Pricing doubles above 200K: input $1.25\u2192$2.50/M, output $10\u2192$15/M"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
costInputPer1m: 1.25,
|
|
269
|
+
costOutputPer1m: 10,
|
|
270
|
+
lowering: {
|
|
271
|
+
...GOOGLE_LOWERING_BASE,
|
|
272
|
+
thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
|
|
273
|
+
},
|
|
274
|
+
recovery: [
|
|
275
|
+
{
|
|
276
|
+
signal: "malformed_function_call",
|
|
277
|
+
action: "escalate",
|
|
278
|
+
reason: "MALFORMED_FUNCTION_CALL \u2014 escalate"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
strengths: ["reasoning", "1m_context", "structured_output", "tool_use"],
|
|
282
|
+
weaknesses: ["pricing_above_200k"]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: "gemini-3.1-pro-preview",
|
|
286
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
287
|
+
provider: "google",
|
|
288
|
+
status: "preview",
|
|
289
|
+
maxContextTokens: 1048576,
|
|
290
|
+
maxOutputTokens: 65535,
|
|
291
|
+
maxTools: 128,
|
|
292
|
+
parallelToolCalls: true,
|
|
293
|
+
structuredOutput: "native",
|
|
294
|
+
systemPromptMode: "separate",
|
|
295
|
+
streaming: true,
|
|
296
|
+
cliffs: [
|
|
297
|
+
{
|
|
298
|
+
metric: "input_tokens",
|
|
299
|
+
threshold: 2e5,
|
|
300
|
+
action: "downgrade_quality_warning",
|
|
301
|
+
reason: "Pricing doubles above 200K: input $2\u2192$4/M, output $12\u2192$18/M"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
costInputPer1m: 2,
|
|
305
|
+
costOutputPer1m: 12,
|
|
306
|
+
lowering: {
|
|
307
|
+
...GOOGLE_LOWERING_BASE,
|
|
308
|
+
cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
|
|
309
|
+
thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
|
|
310
|
+
},
|
|
311
|
+
recovery: [
|
|
312
|
+
{
|
|
313
|
+
signal: "malformed_function_call",
|
|
314
|
+
action: "escalate",
|
|
315
|
+
reason: "MALFORMED_FUNCTION_CALL \u2014 escalate"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
strengths: ["reasoning", "1m_context", "agentic_coding", "structured_output", "tool_use"],
|
|
319
|
+
weaknesses: ["cost", "preview_status", "pricing_above_200k"],
|
|
320
|
+
notes: "Frontier Gemini (preview, 2026-Q2). Step-change agentic coding per Google. Cache discount 10\xD7 (vs 4\xD7 for 2.5 Pro). Use status=preview to flag rollback path until GA."
|
|
321
|
+
},
|
|
322
|
+
// ── DeepSeek ──
|
|
323
|
+
// 2026-05-08 audit (L-073): DeepSeek's `deepseek-chat` was silently aliased
|
|
324
|
+
// to `deepseek-v4-flash` non-thinking mode. Old kgauto profile claimed 64k
|
|
325
|
+
// context + $0.27/$1.10 — actual is 1M context + $0.14/$0.28. Now modeled
|
|
326
|
+
// as: V4-Flash + V4-Pro as canonical profiles; deepseek-chat and
|
|
327
|
+
// deepseek-reasoner registered as aliases (see ALIASES below).
|
|
328
|
+
{
|
|
329
|
+
id: "deepseek-v4-flash",
|
|
330
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
331
|
+
provider: "deepseek",
|
|
332
|
+
status: "current",
|
|
333
|
+
maxContextTokens: 1e6,
|
|
334
|
+
maxOutputTokens: 384e3,
|
|
335
|
+
maxTools: 16,
|
|
336
|
+
parallelToolCalls: false,
|
|
337
|
+
structuredOutput: "native",
|
|
338
|
+
systemPromptMode: "inline",
|
|
339
|
+
streaming: true,
|
|
340
|
+
cliffs: [
|
|
341
|
+
{
|
|
342
|
+
metric: "tool_count",
|
|
343
|
+
threshold: 1,
|
|
344
|
+
action: "drop_to_top_relevant",
|
|
345
|
+
reason: "Sequential tool calls only \u2014 L-040"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
costInputPer1m: 0.14,
|
|
349
|
+
costOutputPer1m: 0.28,
|
|
350
|
+
lowering: {
|
|
351
|
+
system: { mode: "inline" },
|
|
352
|
+
cache: { strategy: "unsupported" },
|
|
353
|
+
tools: { format: "deepseek" }
|
|
354
|
+
},
|
|
355
|
+
recovery: [
|
|
356
|
+
{ signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" }
|
|
357
|
+
],
|
|
358
|
+
strengths: ["cost", "1m_context", "json_output", "code", "reasoning"],
|
|
359
|
+
weaknesses: ["parallel_tools", "large_tool_sets"],
|
|
360
|
+
notes: "Cheap workhorse. 1M context, 384k max output. Cache-hit input $0.0028/M (1/50\xD7 of miss). Aliased as `deepseek-chat` (non-thinking) and `deepseek-reasoner` (thinking) \u2014 see ALIASES."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "deepseek-v4-pro",
|
|
364
|
+
verifiedAgainstDocs: "2026-05-08",
|
|
365
|
+
provider: "deepseek",
|
|
366
|
+
status: "current",
|
|
367
|
+
maxContextTokens: 1e6,
|
|
368
|
+
maxOutputTokens: 384e3,
|
|
369
|
+
maxTools: 16,
|
|
370
|
+
parallelToolCalls: false,
|
|
371
|
+
structuredOutput: "native",
|
|
372
|
+
systemPromptMode: "inline",
|
|
373
|
+
streaming: true,
|
|
374
|
+
cliffs: [
|
|
375
|
+
{
|
|
376
|
+
metric: "tool_count",
|
|
377
|
+
threshold: 1,
|
|
378
|
+
action: "drop_to_top_relevant",
|
|
379
|
+
reason: "Sequential tool calls only \u2014 L-040"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
// Profile carries REGULAR pricing, not the 75%-off promo (ends 2026-05-31).
|
|
383
|
+
// Under-estimating cost is worse than over-estimating for budget caps.
|
|
384
|
+
costInputPer1m: 1.74,
|
|
385
|
+
costOutputPer1m: 3.48,
|
|
386
|
+
lowering: {
|
|
387
|
+
system: { mode: "inline" },
|
|
388
|
+
cache: { strategy: "unsupported" },
|
|
389
|
+
tools: { format: "deepseek" }
|
|
390
|
+
},
|
|
391
|
+
recovery: [
|
|
392
|
+
{ signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate" }
|
|
393
|
+
],
|
|
394
|
+
strengths: ["quality", "reasoning", "1m_context", "json_output", "code", "extended_thinking"],
|
|
395
|
+
weaknesses: ["parallel_tools", "large_tool_sets"],
|
|
396
|
+
notes: "Pro tier. 1M context, 384k max output. Regular pricing $1.74/$3.48; 75% promo through 2026-05-31 ($0.435/$0.87). Default mode = thinking."
|
|
397
|
+
}
|
|
398
|
+
];
|
|
399
|
+
var ALIASES = {
|
|
400
|
+
// DeepSeek's own model routing — both names served by V4-Flash.
|
|
401
|
+
"deepseek-chat": "deepseek-v4-flash",
|
|
402
|
+
"deepseek-reasoner": "deepseek-v4-flash",
|
|
403
|
+
// Legacy kgauto typo — actual API alias is dash-form (alpha.1 had dot).
|
|
404
|
+
"claude-haiku-4.5": "claude-haiku-4-5"
|
|
405
|
+
};
|
|
406
|
+
function canonicalId(id) {
|
|
407
|
+
return ALIASES[id] ?? id;
|
|
408
|
+
}
|
|
409
|
+
var PROFILE_INDEX = new Map(
|
|
410
|
+
PROFILES_RAW.map((p) => [p.id, p])
|
|
411
|
+
);
|
|
412
|
+
function getProfile(id) {
|
|
413
|
+
const canonical = canonicalId(id);
|
|
414
|
+
const p = PROFILE_INDEX.get(canonical);
|
|
415
|
+
if (!p) {
|
|
416
|
+
const known = [...PROFILE_INDEX.keys(), ...Object.keys(ALIASES)].join(", ");
|
|
417
|
+
throw new Error(`Unknown model id: "${id}". Known: ${known}`);
|
|
418
|
+
}
|
|
419
|
+
return p;
|
|
420
|
+
}
|
|
421
|
+
function tryGetProfile(id) {
|
|
422
|
+
return PROFILE_INDEX.get(canonicalId(id));
|
|
423
|
+
}
|
|
424
|
+
function allProfiles() {
|
|
425
|
+
return PROFILES_RAW;
|
|
426
|
+
}
|
|
427
|
+
function profilesByProvider(provider) {
|
|
428
|
+
return PROFILES_RAW.filter((p) => p.provider === provider);
|
|
429
|
+
}
|
|
430
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
431
|
+
0 && (module.exports = {
|
|
432
|
+
ALIASES,
|
|
433
|
+
allProfiles,
|
|
434
|
+
getProfile,
|
|
435
|
+
profilesByProvider,
|
|
436
|
+
tryGetProfile
|
|
437
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@warmdrift/kgauto-compiler",
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
|
+
"description": "Prompt compiler + central learning brain for multi-model AI apps. Swap models without rewriting prompts.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./dialect": {
|
|
15
|
+
"types": "./dist/dialect.d.ts",
|
|
16
|
+
"import": "./dist/dialect.mjs",
|
|
17
|
+
"require": "./dist/dialect.js"
|
|
18
|
+
},
|
|
19
|
+
"./profiles": {
|
|
20
|
+
"types": "./dist/profiles.d.ts",
|
|
21
|
+
"import": "./dist/profiles.mjs",
|
|
22
|
+
"require": "./dist/profiles.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "README.md"],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup src/index.ts src/dialect.ts src/profiles.ts --format cjs,esm --dts --clean",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"prepublishOnly": "npm run typecheck && npm run test && npm run build"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"ai",
|
|
35
|
+
"llm",
|
|
36
|
+
"prompt-compiler",
|
|
37
|
+
"model-router",
|
|
38
|
+
"anthropic",
|
|
39
|
+
"openai",
|
|
40
|
+
"gemini",
|
|
41
|
+
"deepseek",
|
|
42
|
+
"prompt-cache",
|
|
43
|
+
"self-improving"
|
|
44
|
+
],
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"dependencies": {},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"js-tiktoken": ">=1.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"js-tiktoken": { "optional": true }
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^22.10.0",
|
|
55
|
+
"tsup": "^8.4.0",
|
|
56
|
+
"typescript": "^5.7.0",
|
|
57
|
+
"vitest": "^3.1.0"
|
|
58
|
+
}
|
|
59
|
+
}
|