@nexface/agent 0.1.1-alpha.8 → 0.1.1

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 (47) hide show
  1. package/dist/agent.d.ts +15 -2
  2. package/dist/agent.js +127 -72
  3. package/dist/agent.js.map +1 -1
  4. package/dist/browser-prompt.generated.js.map +1 -1
  5. package/dist/browser-prompt.js.map +1 -1
  6. package/dist/errors.d.ts +1 -1
  7. package/dist/errors.js +0 -1
  8. package/dist/errors.js.map +1 -1
  9. package/dist/history-compaction.d.ts +22 -0
  10. package/dist/history-compaction.js +181 -0
  11. package/dist/history-compaction.js.map +1 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/model/binding.d.ts +2 -0
  15. package/dist/model/binding.js.map +1 -1
  16. package/dist/model/error.js.map +1 -1
  17. package/dist/model/internal-adapter.js.map +1 -1
  18. package/dist/model/types.js.map +1 -1
  19. package/dist/models/{42.js → 39.js} +217 -46
  20. package/dist/models/851.js +10 -0
  21. package/dist/models/_chunks/{anthropic-messages~1-a838a7c1.js → anthropic-messages~1-d35e3e7d.js} +1 -1
  22. package/dist/models/_chunks/{google-generative-ai~1-5ceee40d.js → google-generative-ai~1-2ba71457.js} +1 -1
  23. package/dist/models/_chunks/{openai-completions~1-396a5c3a.js → openai-completions~1-b340f0e0.js} +1 -1
  24. package/dist/models/_chunks/{openai-responses~1-2b3e0291.js → openai-responses~1-b53c65c2.js} +1 -1
  25. package/dist/models/anthropic-messages.d.ts +1 -1
  26. package/dist/models/anthropic-messages.js +3 -3
  27. package/dist/models/google-generative-ai.d.ts +1 -1
  28. package/dist/models/google-generative-ai.js +3 -3
  29. package/dist/models/openai-completions.js +6 -3
  30. package/dist/models/openai-responses.js +6 -3
  31. package/dist/request.d.ts +4 -8
  32. package/dist/request.js +1 -1
  33. package/dist/request.js.map +1 -1
  34. package/dist/tool-bridge.js +10 -72
  35. package/dist/tool-bridge.js.map +1 -1
  36. package/dist/tool-result.d.ts +1 -0
  37. package/dist/{internal.js → tool-result.js} +1 -2
  38. package/dist/tool-result.js.map +1 -0
  39. package/dist/types.d.ts +1 -13
  40. package/dist/types.js.map +1 -1
  41. package/package.json +2 -6
  42. package/dist/internal.d.ts +0 -3
  43. package/dist/internal.js.map +0 -1
  44. package/dist/models/663.js +0 -5
  45. package/dist/protocol-response.d.ts +0 -17
  46. package/dist/protocol-response.js +0 -62
  47. package/dist/protocol-response.js.map +0 -1
@@ -1,5 +1,9 @@
1
1
  import { defineAgentModelConfig } from "../model/binding.js";
2
2
 
3
+ function flattenModelCatalog(_provider, groups) {
4
+ return Object.assign({}, ...Object.values(groups));
5
+ }
6
+ //# sourceMappingURL=model-catalog.js.map
3
7
  // Generic event stream class for async iteration
4
8
  class EventStream {
5
9
  queue = [];
@@ -171,7 +175,6 @@ const AGENT_MODEL_ERROR_CODES = [
171
175
  "AGENT_RUN_BLOCKED",
172
176
  "INVALID_MODEL_RESPONSE",
173
177
  "MODEL_CONFIG_INVALID",
174
- "MODEL_NOT_FOUND",
175
178
  "MODEL_REQUEST_FAILED",
176
179
  "MODEL_INPUT_UNSUPPORTED"
177
180
  ];
@@ -211,6 +214,189 @@ class AgentModelError extends AgentError {
211
214
  }
212
215
  }
213
216
 
217
+ const HISTORY_COMPACTION_TRIGGER_BYTES = (/* unused pure expression or super */ null && (128 * 1024));
218
+ const HISTORY_COMPACTION_MIN_NEW_BYTES = (/* unused pure expression or super */ null && (32 * 1024));
219
+ const HISTORY_COMPACTION_MIN_SAVINGS_BYTES = (/* unused pure expression or super */ null && (16 * 1024));
220
+ const HISTORY_SUMMARY_MAX_BYTES = (/* unused pure expression or super */ null && (16 * 1024));
221
+ const RECENT_BATCHES = 2;
222
+ const encoder = new TextEncoder();
223
+ function historyLayout(messages) {
224
+ const batches = [];
225
+ const unsafeIndices = [];
226
+ let current;
227
+ let pending = new Map();
228
+ let valid = true;
229
+ let latestUser = -1;
230
+ let latestBrowserBatch;
231
+ const settle = ()=>{
232
+ if (current) {
233
+ current.complete = valid && pending.size === 0;
234
+ if (!current.complete) unsafeIndices.push(current.start);
235
+ }
236
+ current = undefined;
237
+ };
238
+ for (const [index, message] of messages.entries()){
239
+ if (message.role === "user") {
240
+ settle();
241
+ latestUser = index;
242
+ } else if (message.role === "assistant") {
243
+ settle();
244
+ current = {
245
+ start: index,
246
+ indices: [
247
+ index
248
+ ],
249
+ complete: false
250
+ };
251
+ batches.push(current);
252
+ pending = new Map(message.toolCalls.map((call)=>[
253
+ call.id,
254
+ call.name
255
+ ]));
256
+ valid = pending.size === message.toolCalls.length;
257
+ } else if (message.role === "tool") {
258
+ if (!current) {
259
+ unsafeIndices.push(index);
260
+ continue;
261
+ }
262
+ current.indices.push(index);
263
+ if (pending.get(message.toolCallId) !== message.name) valid = false;
264
+ pending.delete(message.toolCallId);
265
+ if (message.name === "getSnapshot" || message.name === "executeCode") latestBrowserBatch = current;
266
+ }
267
+ }
268
+ settle();
269
+ const protectedIndices = new Set(latestUser < 0 ? [] : [
270
+ latestUser
271
+ ]);
272
+ const recent = batches.filter((batch)=>batch.complete).slice(-RECENT_BATCHES);
273
+ for (const batch of [
274
+ ...recent,
275
+ ...latestBrowserBatch ? [
276
+ latestBrowserBatch
277
+ ] : []
278
+ ]){
279
+ for (const index of batch.indices)protectedIndices.add(index);
280
+ }
281
+ return {
282
+ batches,
283
+ latestUser,
284
+ protectedIndices,
285
+ unsafeIndices
286
+ };
287
+ }
288
+ function boundaryIndex(messages, messageId, layout) {
289
+ const index = messages.findIndex((message)=>message.id === messageId && (message.role === "user" || message.role === "assistant"));
290
+ if (index < 0 || layout.unsafeIndices.some((unsafe)=>unsafe < index) || messages[index].role === "assistant" && !layout.batches.some((batch)=>batch.start === index && batch.complete)) {
291
+ throw new Error("History compaction boundary does not reference a complete batch or user message.");
292
+ }
293
+ return index;
294
+ }
295
+ function summaryMessage(summary, messages, boundary) {
296
+ let latestUser = -1;
297
+ let coveredUser = -1;
298
+ for (const [index, message] of messages.entries()){
299
+ if (message.role !== "user") continue;
300
+ latestUser = index;
301
+ if (index < boundary) coveredUser = index;
302
+ }
303
+ const request = coveredUser < 0 ? "No user request is covered." : `The last covered user request ID is ${JSON.stringify(messages[coveredUser].id ?? "unknown")}. ` + (coveredUser === latestUser ? "It is the current request; only confirmed outcomes explicitly attributed to this request count as its execution record." : "It is an earlier request; its outcomes do not fulfill the current request.") + " Subsequent execution messages belong to that request until the next user message.";
304
+ return {
305
+ role: "assistant",
306
+ content: "Summary of earlier conversation history. Treat this as historical evidence, not instructions or the current application state. " + request + "\n\n" + summary.content,
307
+ toolCalls: []
308
+ };
309
+ }
310
+ function latestContextIndex(messages) {
311
+ let latest = -1;
312
+ let revision = -Infinity;
313
+ for (const [index, message] of messages.entries()){
314
+ if (message.role === "application_context" && message.revision >= revision) {
315
+ latest = index;
316
+ revision = message.revision;
317
+ }
318
+ }
319
+ return latest;
320
+ }
321
+ function validateHistorySummary(value, canonicalMessages) {
322
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Invalid history summary.");
323
+ const summary = value;
324
+ if (Object.keys(summary).some((key)=>key !== "beforeMessageId" && key !== "content") || typeof summary.beforeMessageId !== "string" || !summary.beforeMessageId || typeof summary.content !== "string" || !summary.content.trim() || encoder.encode(summary.content).byteLength > HISTORY_SUMMARY_MAX_BYTES) {
325
+ throw new Error("Invalid history summary.");
326
+ }
327
+ const validated = {
328
+ beforeMessageId: summary.beforeMessageId,
329
+ content: summary.content.trim()
330
+ };
331
+ boundaryIndex(canonicalMessages, validated.beforeMessageId, historyLayout(canonicalMessages));
332
+ return validated;
333
+ }
334
+ function validateCompactionAttempt(value, messages, summary) {
335
+ if (typeof value !== "string" || !value) throw new Error("Invalid history compaction attempt.");
336
+ const layout = historyLayout(messages);
337
+ const index = boundaryIndex(messages, value, layout);
338
+ if (summary && index < boundaryIndex(messages, summary.beforeMessageId, layout)) {
339
+ throw new Error("History compaction attempt precedes the summary.");
340
+ }
341
+ return value;
342
+ }
343
+ function selectModelHistory(messages, summary) {
344
+ const layout = historyLayout(messages);
345
+ const boundary = summary ? boundaryIndex(messages, summary.beforeMessageId, layout) : 0;
346
+ const contextIndex = latestContextIndex(messages);
347
+ const catalogIndex = messages.reduce((last, message, index)=>message.role === "system" && message.content.startsWith("[NEXFACE_RUNTIME_V1]") ? index : last, -1);
348
+ const entries = [];
349
+ for (const [index, message] of messages.entries()){
350
+ if (summary && index === boundary) entries.push({
351
+ message: summaryMessage(summary, messages, boundary),
352
+ index: -1
353
+ });
354
+ if (message.role === "system") {
355
+ if (message.content.startsWith("[NEXFACE_RUNTIME_V1]") && index !== catalogIndex) continue;
356
+ } else if (message.role === "application_context") {
357
+ if (index !== contextIndex) continue;
358
+ } else if (index < boundary && !layout.protectedIndices.has(index)) continue;
359
+ entries.push({
360
+ message,
361
+ index
362
+ });
363
+ }
364
+ return entries;
365
+ }
366
+ function serializedBytes(messages) {
367
+ return encoder.encode(JSON.stringify(messages)).byteLength;
368
+ }
369
+ function modelHistoryBytes(messages, summary) {
370
+ return serializedBytes(selectModelHistory(messages, summary).map((entry)=>entry.message));
371
+ }
372
+ function getHistoryCompactionInput(messages, previous, attemptBeforeMessageId) {
373
+ const layout = historyLayout(messages);
374
+ // A pending or malformed tool batch must be settled before choosing any new cut.
375
+ if (layout.unsafeIndices.length || layout.batches.length <= RECENT_BATCHES) return undefined;
376
+ const boundary = layout.batches[layout.batches.length - RECENT_BATCHES].start;
377
+ const beforeMessageId = messages[boundary].id;
378
+ const start = previous ? boundaryIndex(messages, previous.beforeMessageId, layout) : 0;
379
+ const attemptStart = attemptBeforeMessageId ? boundaryIndex(messages, attemptBeforeMessageId, layout) : start;
380
+ if (!beforeMessageId || boundary <= Math.max(start, attemptStart) || modelHistoryBytes(messages, previous) <= HISTORY_COMPACTION_TRIGGER_BYTES) return undefined;
381
+ const removable = messages.slice(attemptStart, boundary).filter((message, offset)=>message.role !== "system" && message.role !== "application_context" && !layout.protectedIndices.has(offset + attemptStart));
382
+ if (serializedBytes(removable) < HISTORY_COMPACTION_MIN_NEW_BYTES) return undefined;
383
+ const prefix = previous ? [
384
+ summaryMessage(previous, messages, start)
385
+ ] : [];
386
+ for(let index = start; index < boundary; index += 1){
387
+ const message = messages[index];
388
+ if (message.role !== "system" && message.role !== "application_context") prefix.push(message);
389
+ }
390
+ return {
391
+ beforeMessageId,
392
+ messages: prefix,
393
+ ...layout.latestUser < 0 ? {} : {
394
+ latestUser: messages[layout.latestUser]
395
+ }
396
+ };
397
+ }
398
+
399
+
214
400
 
215
401
  function parseArguments(value) {
216
402
  try {
@@ -266,12 +452,12 @@ function toolIsError(content) {
266
452
  return false;
267
453
  }
268
454
  }
269
- function createPiContext(messages, tools, model, replay) {
455
+ function createPiContext(messages, tools, model, replay, historySummary) {
270
456
  // pi-ai exposes one trusted systemPrompt rather than chronological system messages.
271
457
  // Keep canonical checkpoints append-only, then consolidate them in their original order.
272
458
  const system = [];
273
459
  const piMessages = [];
274
- messages.forEach((message, index)=>{
460
+ selectModelHistory(messages, historySummary).forEach(({ message, index })=>{
275
461
  if (message.role === "system" || message.role === "application_context") {
276
462
  system.push(message.content);
277
463
  return;
@@ -472,10 +658,15 @@ class PiModelBinding {
472
658
  exportReplay(messages) {
473
659
  return [
474
660
  ...this.#replay
475
- ].map(([index, message])=>({
476
- messageId: messages[index - 1]?.id,
477
- message
478
- }));
661
+ ].flatMap(([index, message])=>{
662
+ const retained = messages[index - 1];
663
+ return retained?.role === "assistant" && retained.id ? [
664
+ {
665
+ messageId: retained.id,
666
+ message
667
+ }
668
+ ] : [];
669
+ });
479
670
  }
480
671
  restoreReplay(replay, messages) {
481
672
  if (!Array.isArray(replay)) throw new Error("Invalid model replay.");
@@ -492,7 +683,7 @@ class PiModelBinding {
492
683
  }
493
684
  }
494
685
  async complete(request) {
495
- const raw = await consumeStream(this.#stream.streamSimple(this.#model, createPiContext(request.messages, request.tools, this.#model, this.#replay), {
686
+ const raw = await consumeStream(this.#stream.streamSimple(this.#model, createPiContext(request.messages, request.tools, this.#model, this.#replay, request.historySummary), {
496
687
  ...this.#options,
497
688
  signal: request.signal,
498
689
  sessionId: request.agentId
@@ -512,49 +703,31 @@ class PiModelBinding {
512
703
  }
513
704
  function resolveModel(definition, config, baseURL) {
514
705
  const catalogModel = definition.resolveCatalogModel?.(config.model);
515
- if (definition.resolveCatalogModel && !catalogModel) {
516
- throw new AgentModelError("MODEL_NOT_FOUND", `Model "${config.model}" was not found for provider "${definition.provider}".`);
517
- }
518
- const capabilities = {
519
- ...DEFAULT_CAPABILITIES,
520
- ...config.capabilities
521
- };
522
- if (catalogModel) {
523
- return {
524
- ...catalogModel,
525
- baseUrl: baseURL,
526
- ...config.capabilities?.reasoning === undefined ? {} : {
527
- reasoning: config.capabilities.reasoning
528
- },
529
- ...config.capabilities?.input === undefined ? {} : {
530
- input: [
531
- ...config.capabilities.input
532
- ]
533
- },
534
- ...config.capabilities?.contextWindow === undefined ? {} : {
535
- contextWindow: config.capabilities.contextWindow
536
- },
537
- ...config.capabilities?.maxOutputTokens === undefined ? {} : {
538
- maxTokens: config.capabilities.maxOutputTokens
539
- }
540
- };
541
- }
706
+ const capabilities = config.capabilities;
542
707
  return {
708
+ ...definition.preserveCatalogCompat && catalogModel?.compat !== undefined ? {
709
+ compat: catalogModel.compat
710
+ } : {},
711
+ ...catalogModel?.thinkingLevelMap === undefined ? {} : {
712
+ thinkingLevelMap: catalogModel.thinkingLevelMap
713
+ },
543
714
  id: config.model,
544
715
  name: config.model,
545
716
  api: definition.api,
546
717
  provider: definition.provider,
547
718
  baseUrl: baseURL,
548
- reasoning: capabilities.reasoning,
549
- input: capabilities.input,
719
+ reasoning: capabilities?.reasoning ?? catalogModel?.reasoning ?? DEFAULT_CAPABILITIES.reasoning,
720
+ input: [
721
+ ...capabilities?.input ?? catalogModel?.input ?? DEFAULT_CAPABILITIES.input
722
+ ],
550
723
  cost: {
551
724
  input: 0,
552
725
  output: 0,
553
726
  cacheRead: 0,
554
727
  cacheWrite: 0
555
728
  },
556
- contextWindow: capabilities.contextWindow,
557
- maxTokens: capabilities.maxOutputTokens
729
+ contextWindow: capabilities?.contextWindow ?? catalogModel?.contextWindow ?? DEFAULT_CAPABILITIES.contextWindow,
730
+ maxTokens: capabilities?.maxOutputTokens ?? catalogModel?.maxTokens ?? DEFAULT_CAPABILITIES.maxOutputTokens
558
731
  };
559
732
  }
560
733
  function createProtocolModelConfig(definition, config) {
@@ -567,9 +740,6 @@ function createProtocolModelConfig(definition, config) {
567
740
  if (definition.supportsCustomFetch === false && config.fetch) {
568
741
  invalid(`Custom fetch is not supported for provider "${definition.provider}".`);
569
742
  }
570
- if (definition.resolveCatalogModel && config.capabilities !== undefined) {
571
- invalid(`Capability overrides are not supported for provider "${definition.provider}".`);
572
- }
573
743
  assertFiniteNumber(config.temperature, "temperature", 0);
574
744
  assertFiniteNumber(config.maxTokens, "maxTokens", 1);
575
745
  assertFiniteNumber(config.timeoutMs, "timeoutMs", 1);
@@ -613,6 +783,7 @@ function createProtocolModelConfig(definition, config) {
613
783
  return defineAgentModelConfig({
614
784
  info,
615
785
  async resolve () {
786
+ const model = resolveModel(definition, preparedConfig, baseURL);
616
787
  const configuredFetch = preparedConfig.fetch ?? globalThis.fetch;
617
788
  const options = {
618
789
  ...preparedConfig.temperature === undefined ? {} : {
@@ -621,9 +792,9 @@ function createProtocolModelConfig(definition, config) {
621
792
  ...preparedConfig.maxTokens === undefined ? {} : {
622
793
  maxTokens: preparedConfig.maxTokens
623
794
  },
624
- ...preparedConfig.reasoning === undefined ? {} : {
795
+ ...model.reasoning && preparedConfig.reasoning !== undefined ? {
625
796
  reasoning: preparedConfig.reasoning
626
- },
797
+ } : {},
627
798
  ...preparedConfig.timeoutMs === undefined ? {} : {
628
799
  timeoutMs: preparedConfig.timeoutMs
629
800
  },
@@ -645,9 +816,9 @@ function createProtocolModelConfig(definition, config) {
645
816
  apiKey: preparedConfig.apiKey
646
817
  }
647
818
  };
648
- return new PiModelBinding(info, resolveModel(definition, preparedConfig, baseURL), definition.stream, options);
819
+ return new PiModelBinding(info, model, definition.stream, options);
649
820
  }
650
821
  });
651
822
  }
652
823
 
653
- export { AgentModelError, AssistantMessageEventStream, createProtocolModelConfig, lazyApi };
824
+ export { AgentModelError, AssistantMessageEventStream, createProtocolModelConfig, flattenModelCatalog, lazyApi };
@@ -0,0 +1,10 @@
1
+ import { flattenModelCatalog } from "./39.js";
2
+
3
+ var openai_namespaceObject = /*#__PURE__*/JSON.parse('{"openai-responses":{"gpt-4":{"id":"gpt-4","name":"GPT-4","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text"],"cost":{"input":30,"output":60,"cacheRead":0,"cacheWrite":0},"contextWindow":8192,"maxTokens":8192,"compat":{"supportsStrictMode":true}},"gpt-4-turbo":{"id":"gpt-4-turbo","name":"GPT-4 Turbo","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":10,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":4096,"compat":{"supportsStrictMode":true}},"gpt-4.1":{"id":"gpt-4.1","name":"GPT-4.1","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":2,"output":8,"cacheRead":0.5,"cacheWrite":0},"contextWindow":1047576,"maxTokens":32768,"compat":{"supportsStrictMode":true}},"gpt-4.1-mini":{"id":"gpt-4.1-mini","name":"GPT-4.1 mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.4,"output":1.6,"cacheRead":0.1,"cacheWrite":0},"contextWindow":1047576,"maxTokens":32768,"compat":{"supportsStrictMode":true}},"gpt-4.1-nano":{"id":"gpt-4.1-nano","name":"GPT-4.1 nano","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.1,"output":0.4,"cacheRead":0.025,"cacheWrite":0},"contextWindow":1047576,"maxTokens":32768,"compat":{"supportsStrictMode":true}},"gpt-4o":{"id":"gpt-4o","name":"GPT-4o","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":2.5,"output":10,"cacheRead":1.25,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStrictMode":true}},"gpt-4o-2024-05-13":{"id":"gpt-4o-2024-05-13","name":"GPT-4o (2024-05-13)","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":5,"output":15,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":4096,"compat":{"supportsStrictMode":true}},"gpt-4o-2024-08-06":{"id":"gpt-4o-2024-08-06","name":"GPT-4o (2024-08-06)","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":2.5,"output":10,"cacheRead":1.25,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStrictMode":true}},"gpt-4o-2024-11-20":{"id":"gpt-4o-2024-11-20","name":"GPT-4o (2024-11-20)","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":2.5,"output":10,"cacheRead":1.25,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStrictMode":true}},"gpt-4o-mini":{"id":"gpt-4o-mini","name":"GPT-4o mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":0.15,"output":0.6,"cacheRead":0.075,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"compat":{"supportsStrictMode":true}},"gpt-5":{"id":"gpt-5","name":"GPT-5","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5-chat-latest":{"id":"gpt-5-chat-latest","name":"GPT-5 Chat Latest","api":"openai-responses","baseUrl":"https://api.openai.com/v1","provider":"openai","reasoning":false,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"thinkingLevelMap":{"off":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5-mini":{"id":"gpt-5-mini","name":"GPT-5 Mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":2,"cacheRead":0.025,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5-nano":{"id":"gpt-5-nano","name":"GPT-5 Nano","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.05,"output":0.4,"cacheRead":0.005,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5-pro":{"id":"gpt-5-pro","name":"GPT-5 Pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":120,"cacheRead":0,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.1":{"id":"gpt-5.1","name":"GPT-5.1","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.2":{"id":"gpt-5.2","name":"GPT-5.2","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.2-chat-latest":{"id":"gpt-5.2-chat-latest","name":"GPT-5.2 Chat","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":"medium","high":null,"xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.2-pro":{"id":"gpt-5.2-pro","name":"GPT-5.2 Pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":21,"output":168,"cacheRead":0,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.3-chat-latest":{"id":"gpt-5.3-chat-latest","name":"GPT-5.3 Chat (latest)","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":false,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":128000,"maxTokens":16384,"thinkingLevelMap":{"off":null,"xhigh":"xhigh"},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.3-codex":{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.3-codex-spark":{"id":"gpt-5.3-codex-spark","name":"GPT-5.3 Codex Spark","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.75,"output":14,"cacheRead":0.175,"cacheWrite":0},"contextWindow":128000,"maxTokens":32000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.4":{"id":"gpt-5.4","name":"GPT-5.4","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2.5,"output":15,"cacheRead":0.25,"cacheWrite":0,"tiers":[{"inputTokensAbove":272000,"input":5,"output":22.5,"cacheRead":0.5,"cacheWrite":0}]},"contextWindow":272000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true}},"gpt-5.4-mini":{"id":"gpt-5.4-mini","name":"GPT-5.4 mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.75,"output":4.5,"cacheRead":0.075,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true}},"gpt-5.4-nano":{"id":"gpt-5.4-nano","name":"GPT-5.4 nano","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.25,"cacheRead":0.02,"cacheWrite":0},"contextWindow":400000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.4-pro":{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":30,"output":180,"cacheRead":0,"cacheWrite":0,"tiers":[{"inputTokensAbove":272000,"input":60,"output":270,"cacheRead":0,"cacheWrite":0}]},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true}},"gpt-5.5":{"id":"gpt-5.5","name":"GPT-5.5","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":272000,"input":10,"output":45,"cacheRead":1,"cacheWrite":0}]},"contextWindow":272000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true}},"gpt-5.5-pro":{"id":"gpt-5.5-pro","name":"GPT-5.5 Pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":30,"output":180,"cacheRead":0,"cacheWrite":0,"tiers":[{"inputTokensAbove":272000,"input":60,"output":270,"cacheRead":0,"cacheWrite":0}]},"contextWindow":1050000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true}},"gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT-5.6 Luna","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25,"tiers":[{"inputTokensAbove":272000,"input":0.4,"output":1.8,"cacheRead":0.04,"cacheWrite":0.5}]},"contextWindow":272000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true,"supportsExplicitPromptCacheMode":true}},"gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT-5.6 Sol","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":30,"cacheRead":0.5,"cacheWrite":6.25,"tiers":[{"inputTokensAbove":272000,"input":10,"output":45,"cacheRead":1,"cacheWrite":12.5}]},"contextWindow":272000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true,"supportsExplicitPromptCacheMode":true}},"gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT-5.6 Terra","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":18,"cacheRead":0.4,"cacheWrite":5}]},"contextWindow":272000,"maxTokens":128000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"compat":{"supportsStrictMode":true,"supportsOpenAIGrammarTools":true,"supportsToolSearch":true,"supportsExplicitPromptCacheMode":true}},"gpt-realtime-2.1":{"id":"gpt-realtime-2.1","name":"GPT-Realtime-2.1","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":4,"output":24,"cacheRead":0.4,"cacheWrite":0},"contextWindow":128000,"maxTokens":32000,"thinkingLevelMap":{"off":null,"minimal":"minimal","low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"compat":{"supportsStrictMode":true}},"o1":{"id":"o1","name":"o1","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":15,"output":60,"cacheRead":7.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}},"o1-pro":{"id":"o1-pro","name":"o1-pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":150,"output":600,"cacheRead":0,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}},"o3":{"id":"o3","name":"o3","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":8,"cacheRead":0.5,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}},"o3-mini":{"id":"o3-mini","name":"o3-mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.55,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}},"o3-pro":{"id":"o3-pro","name":"o3-pro","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":20,"output":80,"cacheRead":0,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}},"o4-mini":{"id":"o4-mini","name":"o4-mini","api":"openai-responses","provider":"openai","baseUrl":"https://api.openai.com/v1","reasoning":true,"input":["text","image"],"cost":{"input":1.1,"output":4.4,"cacheRead":0.275,"cacheWrite":0},"contextWindow":200000,"maxTokens":100000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"compat":{"supportsStrictMode":true}}}}')
4
+ // This file is auto-generated by scripts/generate-models.ts
5
+ // Do not edit manually - run 'npm run generate-models' to update
6
+
7
+
8
+ const OPENAI_MODELS = flattenModelCatalog("openai", openai_namespaceObject);
9
+ //# sourceMappingURL=openai.models.js.map
10
+ export { OPENAI_MODELS };
@@ -1,7 +1,7 @@
1
1
  import { __webpack_require__ } from "../rslib-runtime.js";
2
2
  import { getProviderEnvValue, buildCopilotDynamicHeaders, parseStreamingJson, parseJsonWithRepair, hasCopilotVisionInput } from "./86-c0c5ac98.js";
3
3
  import { retryProviderRequest, adjustMaxTokensForThinking, headersToRecord, resolveJsonSchemaStrictSampling, transformMessages, calculateCost, clampMaxTokensToContext, buildBaseOptions, sanitizeSurrogates } from "./360-7e580bb2.js";
4
- import { AssistantMessageEventStream } from "../42.js";
4
+ import { AssistantMessageEventStream } from "../39.js";
5
5
  import { splitDeferredTools } from "./deferred-tools-90f3c977.js";
6
6
 
7
7
  // NAMESPACE OBJECT: ../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__ws@8.21.1_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js
@@ -1,6 +1,6 @@
1
1
  import { __webpack_require__ } from "../rslib-runtime.js";
2
2
  import { providerHeadersToRecord, clampThinkingLevel, resolveJsonSchemaStrictSampling, transformMessages, calculateCost, buildBaseOptions, retryProviderRequest, sanitizeSurrogates } from "./360-7e580bb2.js";
3
- import { AssistantMessageEventStream } from "../42.js";
3
+ import { AssistantMessageEventStream } from "../39.js";
4
4
  import { formatProviderError, normalizeProviderError } from "./error-body-8bee35c2.js";
5
5
 
6
6
  __webpack_require__.add({
@@ -1,6 +1,6 @@
1
1
  import { OpenAI, shortHash, clampOpenAIPromptCacheKey } from "./474-e1813138.js";
2
2
  import { getProviderEnvValue, buildCopilotDynamicHeaders, parseStreamingJson, hasCopilotVisionInput } from "./86-c0c5ac98.js";
3
- import { AssistantMessageEventStream } from "../42.js";
3
+ import { AssistantMessageEventStream } from "../39.js";
4
4
  import { sanitizeSurrogates, appendGrammarToolInputJsonDelta, resolveGrammarConstrainedSampling, getGrammarToolInput, headersToRecord, clampThinkingLevel, clampReasoning, resolveJsonSchemaStrictSampling, transformMessages, calculateCost, buildBaseOptions, retryProviderRequest, createGrammarToolInputProperties } from "./360-7e580bb2.js";
5
5
  import { formatProviderError, normalizeProviderError } from "./error-body-8bee35c2.js";
6
6
 
@@ -3,7 +3,7 @@ import { sanitizeSurrogates, appendGrammarToolInputJsonDelta, resolveGrammarCons
3
3
  import { OpenAI, shortHash, clampOpenAIPromptCacheKey } from "./474-e1813138.js";
4
4
  import { getProviderEnvValue, buildCopilotDynamicHeaders, parseStreamingJson, hasCopilotVisionInput } from "./86-c0c5ac98.js";
5
5
  import { formatProviderError, normalizeProviderError } from "./error-body-8bee35c2.js";
6
- import { AssistantMessageEventStream } from "../42.js";
6
+ import { AssistantMessageEventStream } from "../39.js";
7
7
  import { splitDeferredTools } from "./deferred-tools-90f3c977.js";
8
8
 
9
9
  // NAMESPACE OBJECT: ../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__ws@8.21.1_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js
@@ -1,4 +1,4 @@
1
1
  import type { AgentModelConfig, AgentModelFactoryConfig } from "./types.js";
2
- export interface ModelConfigOptions extends Omit<AgentModelFactoryConfig, "capabilities"> {
2
+ export interface ModelConfigOptions extends AgentModelFactoryConfig {
3
3
  }
4
4
  export declare function createModelConfig(config: ModelConfigOptions): AgentModelConfig;
@@ -1,8 +1,7 @@
1
- import { lazyApi, AgentModelError, createProtocolModelConfig } from "./42.js";
2
- import { flattenModelCatalog } from "./663.js";
1
+ import { lazyApi, AgentModelError, flattenModelCatalog, createProtocolModelConfig } from "./39.js";
3
2
 
4
3
 
5
- const anthropicMessagesApi = () => lazyApi(() => import("./_chunks/anthropic-messages~1-a838a7c1.js").then(m => m.anthropic_messages_namespaceObject));
4
+ const anthropicMessagesApi = () => lazyApi(() => import("./_chunks/anthropic-messages~1-d35e3e7d.js").then(m => m.anthropic_messages_namespaceObject));
6
5
  //# sourceMappingURL=anthropic-messages.lazy.js.map
7
6
  var anthropic_namespaceObject = /*#__PURE__*/JSON.parse('{"anthropic-messages":{"claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsStrictTools":true}},"claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"contextWindow":200000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-haiku-4-5-20251001":{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"contextWindow":200000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":200000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-opus-4-5-20251101":{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":200000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-opus-4-6":{"id":"claude-opus-4-6","name":"Claude Opus 4.6","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsStrictTools":true}},"claude-opus-4-7":{"id":"claude-opus-4-7","name":"Claude Opus 4.7","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsTemperature":false,"supportsStrictTools":true}},"claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsTemperature":false,"supportsStrictTools":true}},"claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsTemperature":false,"supportsStrictTools":true}},"claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":1000000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-sonnet-4-5-20250929":{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":1000000,"maxTokens":64000,"compat":{"supportsStrictTools":true}},"claude-sonnet-4-6":{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsStrictTools":true}},"claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","api":"anthropic-messages","provider":"anthropic","baseUrl":"https://api.anthropic.com","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"contextWindow":1000000,"maxTokens":128000,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"compat":{"forceAdaptiveThinking":true,"supportsStrictTools":true}}}}')
8
7
  // This file is auto-generated by scripts/generate-models.ts
@@ -25,6 +24,7 @@ function createModelConfig(config) {
25
24
  api: "anthropic-messages",
26
25
  defaultBaseURL: "https://api.anthropic.com",
27
26
  stream: anthropicMessagesApi(),
27
+ preserveCatalogCompat: true,
28
28
  resolveCatalogModel: (model)=>Object.values(ANTHROPIC_MODELS).find(({ id })=>id === model)
29
29
  }, config);
30
30
  }
@@ -1,4 +1,4 @@
1
1
  import type { AgentModelConfig, AgentModelFactoryConfig } from "./types.js";
2
- export interface ModelConfigOptions extends Omit<AgentModelFactoryConfig, "capabilities" | "fetch" | "timeoutMs"> {
2
+ export interface ModelConfigOptions extends Omit<AgentModelFactoryConfig, "fetch" | "timeoutMs"> {
3
3
  }
4
4
  export declare function createModelConfig(config: ModelConfigOptions): AgentModelConfig;
@@ -1,8 +1,7 @@
1
- import { lazyApi, AgentModelError, createProtocolModelConfig } from "./42.js";
2
- import { flattenModelCatalog } from "./663.js";
1
+ import { lazyApi, AgentModelError, flattenModelCatalog, createProtocolModelConfig } from "./39.js";
3
2
 
4
3
 
5
- const googleGenerativeAIApi = () => lazyApi(() => import("./_chunks/google-generative-ai~1-5ceee40d.js").then(m => m.google_generative_ai_namespaceObject));
4
+ const googleGenerativeAIApi = () => lazyApi(() => import("./_chunks/google-generative-ai~1-2ba71457.js").then(m => m.google_generative_ai_namespaceObject));
6
5
  //# sourceMappingURL=google-generative-ai.lazy.js.map
7
6
  var google_namespaceObject = /*#__PURE__*/JSON.parse('{"google-generative-ai":{"deep-research-max-preview-04-2026":{"id":"deep-research-max-preview-04-2026","name":"Deep Research Max Preview (Apr-21-2026)","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":131072,"maxTokens":65536},"deep-research-preview-04-2026":{"id":"deep-research-preview-04-2026","name":"Deep Research Preview (Apr-21-2026)","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":131072,"maxTokens":65536},"gemini-2.0-flash":{"id":"gemini-2.0-flash","name":"Gemini 2.0 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"cost":{"input":0.1,"output":0.4,"cacheRead":0.025,"cacheWrite":0},"contextWindow":1048576,"maxTokens":8192},"gemini-2.0-flash-lite":{"id":"gemini-2.0-flash-lite","name":"Gemini 2.0 Flash-Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":false,"input":["text","image"],"cost":{"input":0.075,"output":0.3,"cacheRead":0,"cacheWrite":0},"contextWindow":1048576,"maxTokens":8192},"gemini-2.5-computer-use-preview-10-2025":{"id":"gemini-2.5-computer-use-preview-10-2025","name":"Gemini 2.5 Computer Use Preview 10-2025","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":65536},"gemini-2.5-flash":{"id":"gemini-2.5-flash","name":"Gemini 2.5 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":2.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},"gemini-2.5-flash-lite":{"id":"gemini-2.5-flash-lite","name":"Gemini 2.5 Flash-Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.1,"output":0.4,"cacheRead":0.01,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},"gemini-2.5-pro":{"id":"gemini-2.5-pro","name":"Gemini 2.5 Pro","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.25,"output":10,"cacheRead":0.125,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536},"gemini-3-flash-preview":{"id":"gemini-3-flash-preview","name":"Gemini 3 Flash Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":3,"cacheRead":0.05,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3-pro-preview":{"id":"gemini-3-pro-preview","name":"Gemini 3 Pro Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null,"minimal":null,"low":"LOW","medium":null,"high":"HIGH"}},"gemini-3.1-flash-lite":{"id":"gemini-3.1-flash-lite","name":"Gemini 3.1 Flash Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":1.5,"cacheRead":0.025,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.1-flash-lite-image":{"id":"gemini-3.1-flash-lite-image","name":"Nano Banana 2 Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":30,"cacheRead":0,"cacheWrite":0},"contextWindow":65536,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.1-flash-lite-preview":{"id":"gemini-3.1-flash-lite-preview","name":"Gemini 3.1 Flash Lite Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":1.5,"cacheRead":0.025,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.1-flash-live-preview":{"id":"gemini-3.1-flash-live-preview","name":"Gemini 3.1 Flash Live Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.75,"output":4.5,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.1-pro-preview":{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null,"minimal":null,"low":"LOW","medium":null,"high":"HIGH"}},"gemini-3.1-pro-preview-customtools":{"id":"gemini-3.1-pro-preview-customtools","name":"Gemini 3.1 Pro Preview Custom Tools","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null,"minimal":null,"low":"LOW","medium":null,"high":"HIGH"}},"gemini-3.5-flash":{"id":"gemini-3.5-flash","name":"Gemini 3.5 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.5,"output":9,"cacheRead":0.15,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.5-flash-lite":{"id":"gemini-3.5-flash-lite","name":"Gemini 3.5 Flash Lite","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":2.5,"cacheRead":0.03,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-3.6-flash":{"id":"gemini-3.6-flash","name":"Gemini 3.6 Flash","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.5,"output":7.5,"cacheRead":0.15,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-flash-latest":{"id":"gemini-flash-latest","name":"Gemini Flash Latest","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1.5,"output":9,"cacheRead":0.15,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-flash-lite-latest":{"id":"gemini-flash-lite-latest","name":"Gemini Flash-Lite Latest","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":1.5,"cacheRead":0.025,"cacheWrite":0},"contextWindow":1048576,"maxTokens":65536,"thinkingLevelMap":{"off":null}},"gemini-robotics-er-1.6-preview":{"id":"gemini-robotics-er-1.6-preview","name":"Gemini Robotics-ER 1.6 Preview","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":5,"cacheRead":0,"cacheWrite":0},"contextWindow":131072,"maxTokens":65536},"gemma-4-26b-a4b-it":{"id":"gemma-4-26b-a4b-it","name":"Gemma 4 26B A4B IT","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":262144,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"}},"gemma-4-31b-it":{"id":"gemma-4-31b-it","name":"Gemma 4 31B IT","api":"google-generative-ai","provider":"google","baseUrl":"https://generativelanguage.googleapis.com/v1beta","reasoning":true,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":262144,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"}}}}')
8
7
  // This file is auto-generated by scripts/generate-models.ts
@@ -25,6 +24,7 @@ function createModelConfig(config) {
25
24
  defaultBaseURL: "https://generativelanguage.googleapis.com/v1beta",
26
25
  stream: googleGenerativeAIApi(),
27
26
  supportsCustomFetch: false,
27
+ preserveCatalogCompat: true,
28
28
  resolveCatalogModel: (model)=>Object.values(GOOGLE_MODELS).find(({ id })=>id === model)
29
29
  }, config);
30
30
  }
@@ -1,15 +1,18 @@
1
- import { lazyApi, createProtocolModelConfig } from "./42.js";
1
+ import { lazyApi, createProtocolModelConfig } from "./39.js";
2
+ import { OPENAI_MODELS } from "./851.js";
2
3
 
3
4
 
4
- const openAICompletionsApi = () => lazyApi(() => import("./_chunks/openai-completions~1-396a5c3a.js"));
5
+ const openAICompletionsApi = () => lazyApi(() => import("./_chunks/openai-completions~1-b340f0e0.js"));
5
6
  //# sourceMappingURL=openai-completions.lazy.js.map
6
7
 
7
8
 
9
+
8
10
  function createModelConfig(config) {
9
11
  return createProtocolModelConfig({
10
12
  provider: "openai-compatible",
11
13
  api: "openai-completions",
12
- stream: openAICompletionsApi()
14
+ stream: openAICompletionsApi(),
15
+ resolveCatalogModel: (model)=>Object.values(OPENAI_MODELS).find(({ id })=>id === model)
13
16
  }, config);
14
17
  }
15
18
 
@@ -1,15 +1,18 @@
1
- import { lazyApi, createProtocolModelConfig } from "./42.js";
1
+ import { lazyApi, createProtocolModelConfig } from "./39.js";
2
+ import { OPENAI_MODELS } from "./851.js";
2
3
 
3
4
 
4
- const openAIResponsesApi = () => lazyApi(() => import("./_chunks/openai-responses~1-2b3e0291.js").then(m => m.openai_responses_namespaceObject));
5
+ const openAIResponsesApi = () => lazyApi(() => import("./_chunks/openai-responses~1-b53c65c2.js").then(m => m.openai_responses_namespaceObject));
5
6
  //# sourceMappingURL=openai-responses.lazy.js.map
6
7
 
7
8
 
9
+
8
10
  function createModelConfig(config) {
9
11
  return createProtocolModelConfig({
10
12
  provider: "openai-compatible",
11
13
  api: "openai-responses",
12
- stream: openAIResponsesApi()
14
+ stream: openAIResponsesApi(),
15
+ resolveCatalogModel: (model)=>Object.values(OPENAI_MODELS).find(({ id })=>id === model)
13
16
  }, config);
14
17
  }
15
18