@qredence/fleet 0.5.1 → 0.5.5

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 (78) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bin/fleet-prime.mjs +6 -0
  3. package/dist/web/client/assets/action-swap-roll-DX5o_33Q.js +1 -0
  4. package/dist/web/client/assets/artifacts-panel-C3yewUBP.js +1 -0
  5. package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
  6. package/dist/web/client/assets/chat-command-palette-D0xDK1j4.js +1 -0
  7. package/dist/web/client/assets/command-CQzrtjyj.js +2 -0
  8. package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-B0Y7ou0U.js} +16 -16
  9. package/dist/web/client/assets/generative-text-renderer-SS9c1kNX.js +6 -0
  10. package/dist/web/client/assets/globals-D_Hy9bT1.css +2 -0
  11. package/dist/web/client/assets/{index-DweoFRMs.js → index-C9FloFgj.js} +2 -2
  12. package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
  13. package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-CCfQqUfE.js} +5 -5
  14. package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
  15. package/dist/web/client/assets/range-65lubOFp.js +2 -0
  16. package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
  17. package/dist/web/client/assets/routes-DSTyx_J0.js +16 -0
  18. package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
  19. package/dist/web/client/assets/subagent-chat-panel-D-qw4uWb.js +1 -0
  20. package/dist/web/client/assets/subagent-transcript-C7oRwEEP.js +1 -0
  21. package/dist/web/client/assets/subagents-panel-aSMWZP9p.js +1 -0
  22. package/dist/web/client/assets/{tool-result-CBzwwUE9.js → tool-result-C2NvnN32.js} +3 -3
  23. package/dist/web/server/{_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js → _tanstack-start-manifest_v-DZc7dwm7-6ZQLGXB7.js} +13 -13
  24. package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-Bt7YUzm4-NCBMXJ25.js} +15 -15
  25. package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Co1L3rUY-RQLNME4T.js} +33 -12
  26. package/dist/web/server/{chunk-KPNGZR2R.js → chunk-2V6B62OF.js} +204 -204
  27. package/dist/web/server/{chunk-44IVTHDV.js → chunk-3HUI75QM.js} +60 -60
  28. package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
  29. package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-56HSKUBD.js} +699 -691
  30. package/dist/web/server/{chunk-RPROZ2JC.js → chunk-5RQ6QAZX.js} +133 -133
  31. package/dist/web/server/{chunk-PWK2HJIV.js → chunk-6D524OCJ.js} +175 -175
  32. package/dist/web/server/{chunk-FBOO3G67.js → chunk-AECEK3K7.js} +6 -6
  33. package/dist/web/server/{chunk-VHCAD46L.js → chunk-AWFOBHH4.js} +4 -4
  34. package/dist/web/server/{chunk-FVWDJNXR.js → chunk-BEMDNODD.js} +1 -1
  35. package/dist/web/server/{chunk-X2TUFLTP.js → chunk-BLVCDQ7E.js} +438 -438
  36. package/dist/web/server/{chunk-EIVNRYP3.js → chunk-FZRBAPUM.js} +2 -2
  37. package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
  38. package/dist/web/server/{chunk-XYYNYFFD.js → chunk-LSIHVSUT.js} +2 -2
  39. package/dist/web/server/{chunk-H64JLONZ.js → chunk-PDRD2X5G.js} +2 -2
  40. package/dist/web/server/{chunk-FE4KN6T2.js → chunk-RX62LUDV.js} +4 -4
  41. package/dist/web/server/chunk-SR65ARVS.js +192 -0
  42. package/dist/web/server/{chunk-WK7CQS2N.js → chunk-SZ65K4CO.js} +48 -48
  43. package/dist/web/server/{chunk-DO3TVNGA.js → chunk-TO3YPLNZ.js} +6 -6
  44. package/dist/web/server/{chunk-3IKSPTYI.js → chunk-UKINNXJY.js} +2 -2
  45. package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
  46. package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-VRLTWOVJ.js} +11 -6
  47. package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
  48. package/dist/web/server/{chunk-2U7PWSJX.js → chunk-WZNZQNI4.js} +231 -3633
  49. package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
  50. package/dist/web/server/{chunk-3GSFXWL5.js → chunk-XLCTCC4W.js} +3 -3
  51. package/dist/web/server/{chunk-AZZHUVJR.js → chunk-Y4MHIA7B.js} +18 -26
  52. package/dist/web/server/{fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js → fleet-pi-tool-renderer-CE45vM6T-2UQN6RJM.js} +11 -9
  53. package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DCzuGelH-TN2Q5OXI.js} +5 -5
  54. package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-c36_GYes-HX46N4M5.js} +11 -11
  55. package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
  56. package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-_ZpegqiQ-QIE44PIB.js} +1737 -1370
  57. package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-Ct81-8Tq-LHRMOS7R.js} +2882 -2330
  58. package/dist/web/server/server.js +3 -3
  59. package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
  60. package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-B4uUS6f--AZ4I4ZOT.js} +142 -142
  61. package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
  62. package/dist/web/server/subagent-chat-panel-C97S3WID-DLOAD5TG.js +63 -0
  63. package/dist/web/server/subagents-panel-iHpvMIZy-LI6XK66M.js +181 -0
  64. package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-CHPoiXEo-YB4WS3MK.js} +2 -2
  65. package/package.json +5 -5
  66. package/dist/web/client/assets/artifacts-panel-CX62LQ13.js +0 -1
  67. package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
  68. package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
  69. package/dist/web/client/assets/command-CB6emP8m.js +0 -2
  70. package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
  71. package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
  72. package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
  73. package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
  74. package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
  75. package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
  76. package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
  77. package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
  78. package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
@@ -11,7 +11,7 @@ import {
11
11
  QueryClientProvider,
12
12
  domAnimation,
13
13
  isServer
14
- } from "./chunk-H64JLONZ.js";
14
+ } from "./chunk-PDRD2X5G.js";
15
15
  import {
16
16
  redactSessionLabelSecrets
17
17
  } from "./chunk-QK4CHLVV.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-54II5QXQ.js";
23
23
  import {
24
24
  Toaster
25
- } from "./chunk-WK7CQS2N.js";
25
+ } from "./chunk-SZ65K4CO.js";
26
26
  import {
27
27
  drag,
28
28
  layout
@@ -34,8 +34,9 @@ import {
34
34
  CardDescription,
35
35
  CardHeader,
36
36
  CardTitle,
37
+ generatePrompt,
37
38
  validateAndNormalizeOpenUIHtmlArtifact
38
- } from "./chunk-ZEVZFLIY.js";
39
+ } from "./chunk-KOIPYBJF.js";
39
40
  import {
40
41
  ChatNewRequestSchema,
41
42
  ChatOpenUIArtifactUpsertRequestSchema,
@@ -54,7 +55,7 @@ import {
54
55
  SessionIdSchema,
55
56
  UploadedAttachmentSchema,
56
57
  external_exports
57
- } from "./chunk-B2F6MLVZ.js";
58
+ } from "./chunk-XFVL5ITL.js";
58
59
  import {
59
60
  KNOWN_PROVIDERS,
60
61
  OPENAI_CHAT_COMPLETIONS_PROVIDER_ID,
@@ -69,8 +70,8 @@ import {
69
70
  toInstanceSlug,
70
71
  toOccInstanceId
71
72
  } from "./chunk-RJOANOT4.js";
72
- import "./chunk-RPROZ2JC.js";
73
- import "./chunk-X2TUFLTP.js";
73
+ import "./chunk-5RQ6QAZX.js";
74
+ import "./chunk-BLVCDQ7E.js";
74
75
  import "./chunk-E26EAQIM.js";
75
76
  import "./chunk-DJMHPJBP.js";
76
77
  import {
@@ -86,7 +87,7 @@ import "./chunk-JDCCC7A7.js";
86
87
  import "./chunk-L547YHC4.js";
87
88
  import "./chunk-MLKGABMK.js";
88
89
 
89
- // web/app/dist/server/assets/router-CEahIUpn.js
90
+ // web/app/dist/server/assets/router-_ZpegqiQ.js
90
91
  import { useEffect, useLayoutEffect } from "react";
91
92
  import { jsx, jsxs } from "react/jsx-runtime";
92
93
  import { basename, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -120,7 +121,7 @@ function NotFoundPage({ title = "404", description = "The requested page could n
120
121
  })
121
122
  });
122
123
  }
123
- var globals_default = "/assets/globals-CqqQdk2S.css";
124
+ var globals_default = "/assets/globals-D_Hy9bT1.css";
124
125
  function makeQueryClient() {
125
126
  return new QueryClient({ defaultOptions: { queries: {
126
127
  staleTime: 6e4,
@@ -173,9 +174,9 @@ function RootComponent() {
173
174
  }, []);
174
175
  useEffect(() => {
175
176
  }, []);
176
- return /* @__PURE__ */ jsx(MotionRuntime, { children: /* @__PURE__ */ jsx(QueryClientProvider, {
177
+ return /* @__PURE__ */ jsx(MotionRuntime, { children: /* @__PURE__ */ jsxs(QueryClientProvider, {
177
178
  client: getQueryClient(),
178
- children: /* @__PURE__ */ jsx(Outlet, {})
179
+ children: [/* @__PURE__ */ jsx(Outlet, {}), null]
179
180
  }) });
180
181
  }
181
182
  function RootDocument({ children }) {
@@ -189,7 +190,7 @@ function RootDocument({ children }) {
189
190
  ] })]
190
191
  });
191
192
  }
192
- var $$splitComponentImporter = () => import("./routes-BznemByz-F4DJAYIM.js");
193
+ var $$splitComponentImporter = () => import("./routes-Ct81-8Tq-LHRMOS7R.js");
193
194
  var Route$26 = createFileRoute("/")({ component: lazyRouteComponent($$splitComponentImporter, "component") });
194
195
  var ManagedAttachmentValidationError = class extends Error {
195
196
  status;
@@ -336,639 +337,6 @@ function sessionCommandResultText(command, presentation, initialRefinementCount)
336
337
  if (command.name === "goal") return presentation.goal?.objective ? `Goal ${presentation.goal.status}: ${presentation.goal.objective}` : "No active goal.";
337
338
  return `/${command.name} completed.`;
338
339
  }
339
- function resolveField(obj, path) {
340
- if (!path || obj == null) return void 0;
341
- if (!path.includes(".")) return obj[path];
342
- let cur = obj;
343
- for (const p of path.split(".")) {
344
- if (cur == null) return void 0;
345
- cur = cur[p];
346
- }
347
- return cur;
348
- }
349
- function toNumber(val) {
350
- if (typeof val === "number") return val;
351
- if (typeof val === "string") {
352
- const n = Number(val);
353
- return isNaN(n) ? 0 : n;
354
- }
355
- if (typeof val === "boolean") return val ? 1 : 0;
356
- return 0;
357
- }
358
- var BUILTINS = {
359
- Count: {
360
- name: "Count",
361
- signature: "Count(array) \u2192 number",
362
- description: "Returns array length",
363
- fn: (arr) => Array.isArray(arr) ? arr.length : 0
364
- },
365
- First: {
366
- name: "First",
367
- signature: "First(array) \u2192 element",
368
- description: "Returns first element of array",
369
- fn: (arr) => Array.isArray(arr) ? arr[0] ?? null : null
370
- },
371
- Last: {
372
- name: "Last",
373
- signature: "Last(array) \u2192 element",
374
- description: "Returns last element of array",
375
- fn: (arr) => Array.isArray(arr) ? arr[arr.length - 1] ?? null : null
376
- },
377
- Sum: {
378
- name: "Sum",
379
- signature: "Sum(numbers[]) \u2192 number",
380
- description: "Sum of numeric array",
381
- fn: (arr) => Array.isArray(arr) ? arr.reduce((a, b) => a + toNumber(b), 0) : 0
382
- },
383
- Avg: {
384
- name: "Avg",
385
- signature: "Avg(numbers[]) \u2192 number",
386
- description: "Average of numeric array",
387
- fn: (arr) => Array.isArray(arr) && arr.length ? arr.reduce((a, b) => a + toNumber(b), 0) / arr.length : 0
388
- },
389
- Min: {
390
- name: "Min",
391
- signature: "Min(numbers[]) \u2192 number",
392
- description: "Minimum value in array",
393
- fn: (arr) => Array.isArray(arr) && arr.length ? arr.reduce((acc, b) => Math.min(acc, toNumber(b)), toNumber(arr[0])) : 0
394
- },
395
- Max: {
396
- name: "Max",
397
- signature: "Max(numbers[]) \u2192 number",
398
- description: "Maximum value in array",
399
- fn: (arr) => Array.isArray(arr) && arr.length ? arr.reduce((acc, b) => Math.max(acc, toNumber(b)), toNumber(arr[0])) : 0
400
- },
401
- Sort: {
402
- name: "Sort",
403
- signature: "Sort(array, field, direction?) \u2192 sorted array",
404
- description: 'Sort array by field. Direction: "asc" (default) or "desc"',
405
- fn: (arr, field, dir) => {
406
- if (!Array.isArray(arr)) return arr;
407
- const f = String(field ?? "");
408
- const desc = String(dir ?? "asc") === "desc";
409
- return [...arr].sort((a, b) => {
410
- const av = f ? resolveField(a, f) : a;
411
- const bv = f ? resolveField(b, f) : b;
412
- const aIsNumeric = typeof av === "number" || typeof av === "string" && !isNaN(Number(av)) && av !== "";
413
- const bIsNumeric = typeof bv === "number" || typeof bv === "string" && !isNaN(Number(bv)) && bv !== "";
414
- if (aIsNumeric && bIsNumeric) {
415
- const diff = toNumber(av) - toNumber(bv);
416
- return desc ? -diff : diff;
417
- }
418
- const cmp = String(av ?? "").localeCompare(String(bv ?? ""));
419
- return desc ? -cmp : cmp;
420
- });
421
- }
422
- },
423
- Filter: {
424
- name: "Filter",
425
- signature: 'Filter(array, field, operator: "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains", value) \u2192 filtered array',
426
- description: "Filter array by field value",
427
- fn: (arr, field, op, value) => {
428
- if (!Array.isArray(arr)) return [];
429
- const f = String(field ?? "");
430
- const o = String(op ?? "==");
431
- return arr.filter((item) => {
432
- const v = f ? resolveField(item, f) : item;
433
- switch (o) {
434
- case "==":
435
- return v == value;
436
- case "!=":
437
- return v != value;
438
- case ">":
439
- return toNumber(v) > toNumber(value);
440
- case "<":
441
- return toNumber(v) < toNumber(value);
442
- case ">=":
443
- return toNumber(v) >= toNumber(value);
444
- case "<=":
445
- return toNumber(v) <= toNumber(value);
446
- case "contains":
447
- return String(v ?? "").includes(String(value ?? ""));
448
- default:
449
- return false;
450
- }
451
- });
452
- }
453
- },
454
- Round: {
455
- name: "Round",
456
- signature: "Round(number, decimals?) \u2192 number",
457
- description: "Round to N decimal places (default 0)",
458
- fn: (n, decimals) => {
459
- const num = toNumber(n);
460
- const d = decimals != null ? toNumber(decimals) : 0;
461
- const factor = Math.pow(10, d);
462
- return Math.round(num * factor) / factor;
463
- }
464
- },
465
- Abs: {
466
- name: "Abs",
467
- signature: "Abs(number) \u2192 number",
468
- description: "Absolute value",
469
- fn: (n) => Math.abs(toNumber(n))
470
- },
471
- Floor: {
472
- name: "Floor",
473
- signature: "Floor(number) \u2192 number",
474
- description: "Round down to nearest integer",
475
- fn: (n) => Math.floor(toNumber(n))
476
- },
477
- Ceil: {
478
- name: "Ceil",
479
- signature: "Ceil(number) \u2192 number",
480
- description: "Round up to nearest integer",
481
- fn: (n) => Math.ceil(toNumber(n))
482
- }
483
- };
484
- var LAZY_BUILTINS = /* @__PURE__ */ new Set(["Each"]);
485
- var LAZY_BUILTIN_DEFS = { Each: {
486
- signature: "Each(array, varName, template)",
487
- description: "Evaluate template for each element. varName is the loop variable \u2014 use it ONLY inside the template expression (inline). Do NOT create a separate statement for the template."
488
- } };
489
- var ACTION_NAMES = /* @__PURE__ */ new Set(["Action", ...Object.keys({
490
- Run: "run",
491
- ToAssistant: "continue_conversation",
492
- OpenUrl: "open_url",
493
- Set: "set",
494
- Reset: "reset"
495
- })]);
496
- [
497
- ...Object.keys(BUILTINS),
498
- ...LAZY_BUILTINS,
499
- ...ACTION_NAMES
500
- ];
501
- function jsonSchemaTypeStr(schema) {
502
- const type = schema.type;
503
- if (type === "string") {
504
- const enumVals = schema.enum;
505
- if (enumVals) return enumVals.map((v) => `"${v}"`).join(" | ");
506
- return "string";
507
- }
508
- if (type === "number" || type === "integer") return "number";
509
- if (type === "boolean") return "boolean";
510
- if (type === "array") {
511
- const items = schema.items;
512
- if (items) return `${jsonSchemaTypeStr(items)}[]`;
513
- return "any[]";
514
- }
515
- if (type === "object") {
516
- const props = schema.properties;
517
- if (props && Object.keys(props).length > 0) {
518
- const required = schema.required ?? [];
519
- return `{${Object.entries(props).map(([k, v]) => {
520
- return `${k}${required.includes(k) ? "" : "?"}: ${jsonSchemaTypeStr(v)}`;
521
- }).join(", ")}}`;
522
- }
523
- return "object";
524
- }
525
- return "any";
526
- }
527
- function defaultForSchema(schema) {
528
- const type = schema.type;
529
- if (type === "string") return "";
530
- if (type === "number" || type === "integer") return 0;
531
- if (type === "boolean") return false;
532
- if (type === "array") return [];
533
- if (type === "object") {
534
- const props = schema.properties;
535
- if (props && Object.keys(props).length > 0) {
536
- const result = {};
537
- for (const [k, v] of Object.entries(props)) result[k] = defaultForSchema(v);
538
- return result;
539
- }
540
- return {};
541
- }
542
- return null;
543
- }
544
- var PREAMBLE = `You are an AI assistant that responds using openui-lang, a declarative UI language. Your ENTIRE response must be valid openui-lang code \u2014 no markdown, no explanations, just openui-lang.`;
545
- function syntaxRules(rootName, flags) {
546
- const lines = [
547
- "## Syntax Rules",
548
- "",
549
- "1. Each statement is on its own line: `identifier = Expression`",
550
- `2. \`root\` is the entry point \u2014 every program must define \`root = ${rootName}(...)\``,
551
- '3. Expressions are: strings ("..."), numbers, booleans (true/false), null, arrays ([...]), objects ({...}), or component calls TypeName(arg1, arg2, ...)',
552
- "4. Use references for readability: define `name = ...` on one line, then use `name` later",
553
- "5. EVERY variable (except root) MUST be referenced by at least one other variable. Unreferenced variables are silently dropped and will NOT render. Always include defined variables in their parent's children/items array.",
554
- '6. Arguments are POSITIONAL (order matters, not names). Write `Stack([children], "row", "l")` NOT `Stack([children], direction: "row", gap: "l")` \u2014 colon syntax is NOT supported and silently breaks',
555
- "7. Optional arguments can be omitted from the end"
556
- ];
557
- let ruleNum = 8;
558
- if (flags.bindings) lines.push(`${ruleNum++}. Declare mutable state with \`$varName = defaultValue\`. Components marked with \`$binding\` can read/write these. Undeclared $variables are auto-created with null default.`);
559
- if (flags.supportsExpressions) lines.push(`${ruleNum++}. String concatenation: \`"text" + $var + "more"\``, `${ruleNum++}. Dot member access: \`query.field\` reads a field; on arrays it extracts that field from every element`, `${ruleNum++}. Index access: \`arr[0]\`, \`data[index]\``, `${ruleNum++}. Arithmetic operators: +, -, *, /, % (work on numbers; + is string concat when either side is a string)`, `${ruleNum++}. Comparison: ==, !=, >, <, >=, <=`, `${ruleNum++}. Logical: &&, ||, ! (prefix)`, `${ruleNum++}. Ternary: \`condition ? valueIfTrue : valueIfFalse\``, `${ruleNum++}. Parentheses for grouping: \`(a + b) * c\``);
560
- lines.push("- Strings use double quotes with backslash escaping");
561
- return lines.join("\n");
562
- }
563
- function builtinFunctionsSection() {
564
- const builtinLines = Object.values(BUILTINS).map((b) => `@${b.signature} \u2014 ${b.description}`);
565
- const lazyLines = Object.values(LAZY_BUILTIN_DEFS).map((b) => `@${b.signature} \u2014 ${b.description}`);
566
- return `## Built-in Functions
567
-
568
- Data functions prefixed with \`@\` to distinguish from components. These are the ONLY functions available \u2014 do NOT invent new ones.
569
- Use @-prefixed built-in functions (@Count, @Sum, @Avg, @Min, @Max, @Round) on Query results \u2014 do NOT hardcode computed values.
570
-
571
- ${[...builtinLines, ...lazyLines].join("\n")}
572
-
573
- Builtins compose \u2014 output of one is input to the next:
574
- \`@Count(@Filter(data.rows, "field", "==", "val"))\` for KPIs/chart values, \`@Round(@Avg(data.rows.score), 1)\`, \`@Each(data.rows, "item", Comp(item.field))\` for per-item rendering.
575
- Array pluck: \`data.rows.field\` extracts a field from every row \u2192 use with @Sum, @Avg, charts, tables.
576
-
577
- IMPORTANT @Each rule: The loop variable (e.g. "item") is ONLY available inside the @Each template expression. Always inline the template \u2014 do NOT extract it to a separate statement.
578
- CORRECT: \`Col("Actions", @Each(rows, "t", Button("Edit", Action([@Set($id, t.id)]))))\`
579
- WRONG: \`myBtn = Button("Edit", Action([@Set($id, t.id)]))\` then \`Col("Actions", @Each(rows, "t", myBtn))\` \u2014 t is undefined in myBtn.`;
580
- }
581
- function querySection() {
582
- return `## Query \u2014 Live Data Fetching
583
-
584
- Fetch data from available tools. Returns defaults instantly, swaps in real data when it arrives.
585
-
586
- \`\`\`
587
- metrics = Query("tool_name", {arg1: value, arg2: $binding}, {defaultField: 0, defaultData: []}, refreshInterval?)
588
- \`\`\`
589
-
590
- - First arg: tool name (string)
591
- - Second arg: arguments object (may reference $bindings \u2014 re-fetches automatically on change)
592
- - Third arg: default data (rendered immediately before fetch resolves)
593
- - Fourth arg (optional): refresh interval in seconds (e.g. 30 for auto-refresh every 30s)
594
- - Use dot access on results: metrics.totalEvents, metrics.data.day (array pluck)
595
- - Query results must use regular identifiers: \`metrics = Query(...)\`, NOT \`$metrics = Query(...)\`
596
- - Manual refresh: \`Button("Refresh", Action([@Run(query1), @Run(query2)]), "secondary")\` \u2014 re-fetches the listed queries
597
- - Refresh all queries: create Action with @Run for each query`;
598
- }
599
- function mutationSection() {
600
- return `## Mutation \u2014 Write Operations
601
-
602
- Execute state-changing tool calls (create, update, delete). Unlike Query (auto-fetches on render), Mutation fires only on button click via Action.
603
-
604
- \`\`\`
605
- result = Mutation("tool_name", {arg1: $binding, arg2: "value"})
606
- \`\`\`
607
-
608
- - First arg: tool name (string)
609
- - Second arg: arguments object (evaluated with current $binding values at click time)
610
- - result.status: "idle" | "loading" | "success" | "error"
611
- - result.data: tool response on success
612
- - result.error: error message on failure
613
- - Mutation results use regular identifiers: \`result = Mutation(...)\`, NOT \`$result\`
614
- - Show loading state: \`result.status == "loading" ? TextContent("Saving...") : null\``;
615
- }
616
- function actionSection(flags) {
617
- const steps = ['- @ToAssistant("message") \u2014 Send a message to the assistant (for conversational buttons like "Tell me more", "Explain this")', '- @OpenUrl("https://...") \u2014 Navigate to a URL'];
618
- if (flags.bindings) steps.push("- @Set($variable, value) \u2014 Set a $variable to a specific value", '- @Reset($var1, $var2, ...) \u2014 Reset $variables to their declared defaults (e.g. @Reset($title, $priority) restores $title="" and $priority="medium")');
619
- if (flags.toolCalls) steps.unshift("- @Run(queryOrMutationRef) \u2014 Execute a Mutation or re-fetch a Query (ref must be a declared Query/Mutation)");
620
- const examples = [];
621
- if (flags.toolCalls) examples.push(`Example \u2014 mutation + refresh + reset (PREFERRED pattern):
622
- \`\`\`
623
- $binding = "default"
624
- result = Mutation("tool_name", {field: $binding})
625
- data = Query("tool_name", {}, {rows: []})
626
- onSubmit = Action([@Run(result), @Run(data), @Reset($binding)])
627
- \`\`\``);
628
- examples.push(`Example \u2014 simple nav:
629
- \`\`\`
630
- viewBtn = Button("View", Action([@OpenUrl("https://example.com")]))
631
- \`\`\``);
632
- const rules = ['- Action can be assigned to a variable or inlined: Button("Go", onSubmit) and Button("Go", Action([...])) both work'];
633
- if (flags.toolCalls) rules.push("- If a @Run(mutation) step fails, remaining steps are skipped (halt on failure)", "- @Run(queryRef) re-fetches the query (fire-and-forget, cannot fail)");
634
- return `## Action \u2014 Button Behavior
635
-
636
- Action([@steps...]) wires button clicks to operations. Steps are @-prefixed built-in actions. Steps execute in order.
637
- Buttons without an explicit Action prop automatically send their label to the assistant (equivalent to Action([@ToAssistant(label)])).
638
-
639
- Available steps:
640
- ${steps.join("\n")}
641
-
642
- ${examples.join("\n\n")}
643
-
644
- ${rules.join("\n")}`;
645
- }
646
- function interactiveFiltersSection() {
647
- return `## Interactive Filters
648
-
649
- To let the user filter data with a dropdown:
650
- 1. Declare a $variable with a default: \`$dateRange = "14"\`
651
- 2. Create a Select with name, items, and binding: \`Select("dateRange", [SelectItem("7", "Last 7 days"), ...], null, null, $dateRange)\`
652
- 3. Wrap in FormControl for a label: \`FormControl("Date Range", Select(...))\`
653
- 4. Pass $dateRange in Query args: \`Query("tool", {dateRange: $dateRange}, {defaults})\`
654
- 5. When the user changes the Select, $dateRange updates and the Query automatically re-fetches
655
-
656
- FILTER WIRING RULE: If a $binding filter is visible in the UI, EVERY relevant Query MUST reference that $binding in its args. Never show a filter dropdown while hardcoding the query args.
657
-
658
- Rules for $variables:
659
- - $variables hold simple values (strings or numbers), NOT arrays or objects
660
- - $variables must be bound to a Select/Input component via the value argument (last positional arg) to be interactive
661
- - Queries must use regular identifiers (NOT $variables): \`metrics = Query(...)\` not \`$metrics = Query(...)\`
662
- - **Auto-declare**: You do NOT need to explicitly declare $variables. If you use \`$foo\` without declaring it, the parser auto-creates \`$foo = null\`. You can still declare explicitly to set a default: \`$days = "14"\`
663
-
664
- ## Forms
665
-
666
- Simple form \u2014 no $bindings needed. Field values are managed internally by the Form via the name prop:
667
- \`\`\`
668
- contactForm = Form("contact", submitBtn, [nameField, emailField])
669
- nameField = FormControl("Name", Input("name", "Your name", "text", {required: true}))
670
- emailField = FormControl("Email", Input("email", "your@email.com", "email", {required: true, email: true}))
671
- submitBtn = Button("Submit")
672
- \`\`\`
673
-
674
- Use $bindings when you need to read field values elsewhere (in Action context, Query args, or conditionals). They are auto-declared:
675
- \`\`\`
676
- $role = "engineer"
677
- contactForm = Form("contact", submitBtn, [nameField, emailField, roleField])
678
- nameField = FormControl("Name", Input("name", "Enter your name", "text", {required: true}, $name))
679
- emailField = FormControl("Email", Input("email", "Enter your email", "email", {required: true, email: true}, $email))
680
- roleField = FormControl("Role", Select("role", [SelectItem("engineer", "Engineer"), SelectItem("designer", "Designer"), SelectItem("pm", "PM")], null, {required: true}, $role))
681
- submitBtn = Button("Submit")
682
- \`\`\`
683
-
684
- For form + mutation patterns (create, refresh, reset), see the Action section example above.
685
-
686
- IMPORTANT: Always add validation rules to form fields used with Mutations. Use OBJECT syntax: {required: true, email: true, minLength: 8}. The renderer shows error messages automatically and blocks submit when validation fails.`;
687
- }
688
- function editModeSection() {
689
- return `## Edit Mode
690
-
691
- The runtime merges by statement name: same name = replace, new name = append.
692
- Output ONLY statements that changed or are new. Everything else is kept automatically.
693
-
694
- ### Delete
695
- To remove a component, update the parent to exclude it from its children array. Orphaned statements are automatically garbage-collected.
696
- Example \u2014 remove chart: \`root = Stack([header, kpiRow, table])\` \u2014 chart is no longer in the children list, so it and any statements only it referenced are auto-deleted.
697
-
698
- ### Patch size guide
699
- - Changing a title or label: 1 statement
700
- - Adding a component: 2-3 statements (the new component + parent update)
701
- - Removing a component: 1 statement (re-declare parent without the removed child)
702
- - Adding a filter + wiring to query: 3-5 statements
703
- - Restructuring into tabs: 5-10 statements
704
-
705
- ### Rules
706
- - Reuse existing statement names exactly \u2014 do not rename
707
- - Do NOT re-emit unchanged statements \u2014 the runtime keeps them
708
- - A typical edit patch is 1-10 statements, not 20+
709
- - If the existing code already satisfies the request, output only the root statement
710
- - NEVER output the entire program as a patch. Only output what actually changes
711
- - If you are about to output more than 10 statements, reconsider \u2014 most edits need fewer`;
712
- }
713
- function streamingRules(rootName, flags) {
714
- const steps = [`1. \`root = ${rootName}(...)\` \u2014 UI shell appears immediately`];
715
- if (flags.supportsExpressions) {
716
- steps.push("2. $variable declarations \u2014 state ready for bindings");
717
- steps.push("3. Query statements \u2014 defaults resolve immediately so components render with data");
718
- steps.push("4. Component definitions \u2014 fill in with data already available");
719
- steps.push("5. Data values \u2014 leaf content last");
720
- } else {
721
- steps.push("2. Component definitions \u2014 fill in as they stream");
722
- steps.push("3. Data values \u2014 leaf content last");
723
- }
724
- return `## Hoisting & Streaming (CRITICAL)
725
-
726
- openui-lang supports hoisting: a reference can be used BEFORE it is defined. The parser resolves all references after the full input is parsed.
727
-
728
- During streaming, the output is re-parsed on every chunk. Undefined references are temporarily unresolved and appear once their definitions stream in. This creates a progressive top-down reveal \u2014 structure first, then data fills in.
729
-
730
- **Recommended statement order for optimal streaming:**
731
- ${steps.join("\n")}
732
-
733
- Always write the root = ${rootName}(...) statement first so the UI shell appears immediately, even before child data has streamed in.`;
734
- }
735
- function inlineModeSection() {
736
- return `## Inline Mode
737
-
738
- You are in inline mode. You can respond in two ways:
739
-
740
- ### 1. Code response (when the user wants to CREATE or CHANGE the UI)
741
- Wrap openui-lang code in triple-backtick fences. You can include explanatory text before/after:
742
-
743
- Here's your dashboard:
744
-
745
- \`\`\`openui-lang
746
- root = RootComp([header, content])
747
- header = SomeHeader("Title")
748
- content = SomeContent("Hello world")
749
- \`\`\`
750
-
751
- I created a simple layout with a header.
752
-
753
- ### 2. Text-only response (when the user asks a QUESTION)
754
- If the user asks "what is this?", "explain the chart", "how does this work", etc. \u2014 respond with plain text. Do NOT output any openui-lang code. The existing dashboard stays unchanged.
755
-
756
- ### Rules
757
- - When the user asks for changes, output ONLY the changed/new statements in a fenced block
758
- - When the user asks a question, respond with text only \u2014 NO code. The dashboard stays unchanged.
759
- - The parser extracts code from fences automatically. Text outside fences is shown as chat.`;
760
- }
761
- function toolWorkflowSection() {
762
- return `## Data Workflow
763
-
764
- When tools are available, follow this workflow:
765
- 1. FIRST: Call the most relevant tool to inspect the real data shape before generating code
766
- 2. Use Query() for READ operations (data that should stay live) \u2014 NEVER hardcode tool results as literal arrays or objects
767
- 3. Use Mutation() for WRITE operations (create, update, delete) \u2014 triggered by button clicks via Action([@Run(mutationRef)])
768
- 4. Use the real data from step 1 as condensed Query defaults (3-5 rows) so the UI renders immediately
769
- 5. Use @-prefixed builtins (@Count, @Filter, @Sort, @Sum) on Query results for KPIs and aggregations \u2014 the runtime evaluates these live on every refresh
770
- 6. Hardcoded arrays are ONLY for static display data (labels, options) where no tool exists
771
-
772
- WRONG \u2014 you called a tool and got data back, but you inlined the results:
773
- \`\`\`
774
- openCount = 2
775
- item1 = SomeComp("first item title")
776
- item2 = SomeComp("second item title")
777
- list = Stack([item1, item2])
778
- chart = SomeChart(["A", "B"], [12, 8])
779
- \`\`\`
780
- This is static \u2014 it shows stale data and won't update. Creating item1, item2, item3... manually is ALWAYS wrong when a tool exists.
781
-
782
- RIGHT \u2014 use Query() for live data, Mutation() for writes, @builtins to derive values:
783
- \`\`\`
784
- data = Query("tool_name", {}, {rows: []})
785
- openCount = @Count(@Filter(data.rows, "field", "==", "value"))
786
- list = @Each(data.rows, "item", SomeComp(item.title, item.field))
787
- createResult = Mutation("create_tool", {title: $title})
788
- submitBtn = Button("Create", Action([@Run(createResult), @Run(data), @Reset($title)]))
789
- \`\`\`
790
- Everything derives from the Query \u2014 when data refreshes, the entire dashboard updates automatically.`;
791
- }
792
- function importantRules(rootName, flags) {
793
- const verifyLines = [`1. root = ${rootName}(...) is the FIRST line (for optimal streaming).`, "2. Every referenced name is defined. Every defined name (other than root) is reachable from root."];
794
- if (flags.toolCalls) verifyLines.push("3. Every Query result is referenced by at least one component.");
795
- if (flags.bindings) verifyLines.push(`${flags.toolCalls ? "4" : "3"}. Every $binding appears in at least one component or expression.`);
796
- if (flags.toolCalls && flags.bindings) verifyLines.push("5. Every visible filter $binding appears in at least one Query args object.");
797
- return `## Important Rules
798
- - When asked about data, generate realistic/plausible data
799
- - Choose components that best represent the content (tables for comparisons, charts for trends, forms for input, etc.)
800
-
801
- ## Final Verification
802
- Before finishing, walk your output and verify:
803
- ${verifyLines.join("\n")}`;
804
- }
805
- function renderToolSignature(tool) {
806
- let args = "";
807
- if (tool.inputSchema) {
808
- const props = tool.inputSchema.properties;
809
- const required = tool.inputSchema.required ?? [];
810
- if (props && Object.keys(props).length > 0) args = Object.entries(props).map(([k, v]) => {
811
- return `${k}${required.includes(k) ? "" : "?"}: ${jsonSchemaTypeStr(v)}`;
812
- }).join(", ");
813
- }
814
- let returnType = "";
815
- if (tool.outputSchema) returnType = ` \u2192 ${jsonSchemaTypeStr(tool.outputSchema)}`;
816
- let line = `- ${tool.name}(${args})${returnType}`;
817
- if (tool.description) line += `
818
- ${tool.description}`;
819
- return line;
820
- }
821
- function renderToolsSection(tools) {
822
- const lines = [];
823
- const stringTools = [];
824
- const specTools = [];
825
- for (const tool of tools) if (typeof tool === "string") stringTools.push(tool);
826
- else specTools.push(tool);
827
- lines.push("## Available Tools");
828
- lines.push("");
829
- lines.push("Use these with Query() for read operations or Mutation() for write operations. The LLM decides which is appropriate based on the tool's purpose.");
830
- lines.push("");
831
- for (const t of stringTools) lines.push(`- ${t}`);
832
- for (const t of specTools) lines.push(renderToolSignature(t));
833
- const toolsWithOutput = specTools.filter((t) => t.outputSchema);
834
- if (toolsWithOutput.length > 0) {
835
- lines.push("");
836
- lines.push("### Default values for Query results");
837
- lines.push("");
838
- lines.push("Use these shapes as minimal Query defaults:");
839
- for (const t of toolsWithOutput) {
840
- const defaults = defaultForSchema(t.outputSchema);
841
- lines.push(`- ${t.name}: \`${JSON.stringify(defaults)}\``);
842
- }
843
- }
844
- lines.push("");
845
- lines.push("CRITICAL: Use ONLY the tools listed above in Query() and Mutation() calls. Do NOT invent or guess tool names. If the user asks for functionality that doesn't match any available tool, use realistic mock data instead of fabricating a tool call.");
846
- return lines.join("\n");
847
- }
848
- function generateComponentSignatures(spec, flags) {
849
- const lines = [
850
- "## Component Signatures",
851
- "",
852
- "Arguments marked with ? are optional. Sub-components can be inline or referenced; prefer references for better streaming."
853
- ];
854
- if (flags.usesActionExpression) {
855
- const allSteps = [
856
- flags.toolCalls ? "@Run" : "",
857
- "@ToAssistant",
858
- "@OpenUrl",
859
- flags.bindings ? "@Set" : "",
860
- flags.bindings ? "@Reset" : ""
861
- ].filter(Boolean);
862
- lines.push(`Props typed \`ActionExpression\` accept an Action([@steps...]) expression. See the Action section for available steps (${allSteps.join(", ")}).`);
863
- }
864
- if (flags.bindings || Object.values(spec.components).some((c) => c.signature?.includes("$binding"))) lines.push("Props marked `$binding<type>` accept a `$variable` reference for two-way binding.");
865
- const formatSig = (comp) => comp.description ? `${comp.signature} \u2014 ${comp.description}` : comp.signature;
866
- if (spec.componentGroups?.length) {
867
- const grouped = /* @__PURE__ */ new Set();
868
- for (const group of spec.componentGroups) {
869
- lines.push("", `### ${group.name}`);
870
- for (const name of group.components) {
871
- if (grouped.has(name)) continue;
872
- const comp = spec.components[name];
873
- if (!comp) continue;
874
- grouped.add(name);
875
- lines.push(formatSig(comp));
876
- }
877
- if (group.notes?.length) for (const note of group.notes) lines.push(note);
878
- }
879
- const ungrouped = Object.keys(spec.components).filter((n) => !grouped.has(n));
880
- if (ungrouped.length) {
881
- lines.push("", "### Other");
882
- for (const name of ungrouped) {
883
- const comp = spec.components[name];
884
- lines.push(formatSig(comp));
885
- }
886
- }
887
- } else {
888
- lines.push("");
889
- for (const [, comp] of Object.entries(spec.components)) lines.push(formatSig(comp));
890
- }
891
- return lines.join("\n");
892
- }
893
- function generatePrompt(spec) {
894
- const rootName = spec.root ?? "Root";
895
- const hasTools = !!spec.tools?.length;
896
- const toolCalls = spec.toolCalls ?? hasTools;
897
- const bindings = spec.bindings ?? toolCalls;
898
- const supportsExpressions = toolCalls || bindings;
899
- const usesActionExpression = Object.values(spec.components).some((c) => c.signature?.includes("ActionExpression"));
900
- const parts = [];
901
- parts.push(spec.preamble ?? PREAMBLE);
902
- parts.push("");
903
- parts.push(syntaxRules(rootName, {
904
- supportsExpressions,
905
- bindings
906
- }));
907
- parts.push("");
908
- parts.push(generateComponentSignatures(spec, {
909
- toolCalls,
910
- bindings,
911
- usesActionExpression
912
- }));
913
- if (supportsExpressions) {
914
- parts.push("");
915
- parts.push(builtinFunctionsSection());
916
- }
917
- if (toolCalls) {
918
- parts.push("");
919
- parts.push(querySection());
920
- parts.push("");
921
- parts.push(mutationSection());
922
- }
923
- if (usesActionExpression) {
924
- parts.push("");
925
- parts.push(actionSection({
926
- toolCalls,
927
- bindings
928
- }));
929
- }
930
- if (toolCalls && bindings) {
931
- parts.push("");
932
- parts.push(interactiveFiltersSection());
933
- }
934
- if (toolCalls) {
935
- parts.push("");
936
- parts.push(toolWorkflowSection());
937
- }
938
- if (spec.tools?.length) {
939
- parts.push("");
940
- parts.push(renderToolsSection(spec.tools));
941
- }
942
- parts.push("");
943
- parts.push(streamingRules(rootName, { supportsExpressions }));
944
- const allExamples = [...spec.examples ?? [], ...spec.toolExamples ?? []];
945
- if (allExamples.length) {
946
- parts.push("");
947
- parts.push("## Examples");
948
- parts.push("");
949
- for (const ex of allExamples) {
950
- parts.push(ex);
951
- parts.push("");
952
- }
953
- }
954
- if (spec.editMode) {
955
- parts.push("");
956
- parts.push(editModeSection());
957
- }
958
- if (spec.inlineMode) {
959
- parts.push("");
960
- parts.push(inlineModeSection());
961
- }
962
- parts.push(importantRules(rootName, {
963
- toolCalls,
964
- bindings
965
- }));
966
- if (spec.additionalRules?.length) {
967
- parts.push("");
968
- for (const rule of spec.additionalRules) parts.push(`- ${rule}`);
969
- }
970
- return parts.join("\n");
971
- }
972
340
  var openUIPromptSpec = {
973
341
  components: {
974
342
  Root: {
@@ -3069,6 +2437,15 @@ function extractToolErrorText(result) {
3069
2437
  }
3070
2438
  return "Tool execution failed";
3071
2439
  }
2440
+ function extractToolBackgroundOutput(result) {
2441
+ if (!result || typeof result !== "object") return void 0;
2442
+ const record2 = result;
2443
+ if (typeof record2.backgroundOutput === "string") return record2.backgroundOutput;
2444
+ if (record2.details && typeof record2.details === "object") {
2445
+ const details = record2.details;
2446
+ if (typeof details.backgroundOutput === "string") return details.backgroundOutput;
2447
+ }
2448
+ }
3072
2449
  function toChatMessagesFromAgentMessages(messages, sessionId) {
3073
2450
  const output = [];
3074
2451
  for (const [index, message] of messages.entries()) {
@@ -3095,6 +2472,7 @@ function toChatMessagesFromAgentMessages(messages, sessionId) {
3095
2472
  const errorText = isError ? extractToolErrorText(result) : void 0;
3096
2473
  const errorEnvelope = errorText ? createFleetErrorEnvelope(errorText) : void 0;
3097
2474
  const durationMs = typeof result.durationMs === "number" ? result.durationMs : typeof result.details?.durationMs === "number" ? result.details.durationMs : void 0;
2475
+ const backgroundOutput = extractToolBackgroundOutput(result);
3098
2476
  let attached = false;
3099
2477
  if (toolCallId) for (let messageIndex = output.length - 1; messageIndex >= 0 && !attached; messageIndex -= 1) {
3100
2478
  const candidate = output[messageIndex];
@@ -3108,6 +2486,7 @@ function toChatMessagesFromAgentMessages(messages, sessionId) {
3108
2486
  output: toolResultOutput(result),
3109
2487
  result: toolResultOutput(result),
3110
2488
  ...durationMs !== void 0 ? { durationMs } : {},
2489
+ ...backgroundOutput !== void 0 ? { backgroundOutput } : {},
3111
2490
  ...errorEnvelope ? { error: errorEnvelope } : {}
3112
2491
  };
3113
2492
  output[messageIndex] = {
@@ -3127,6 +2506,7 @@ function toChatMessagesFromAgentMessages(messages, sessionId) {
3127
2506
  output: toolResultOutput(result),
3128
2507
  result: toolResultOutput(result),
3129
2508
  ...durationMs !== void 0 ? { durationMs } : {},
2509
+ ...backgroundOutput !== void 0 ? { backgroundOutput } : {},
3130
2510
  ...errorEnvelope ? { error: errorEnvelope } : {}
3131
2511
  }]
3132
2512
  });
@@ -3158,7 +2538,9 @@ function createEventMapperState(init) {
3158
2538
  inRun: false,
3159
2539
  presentation: init?.presentation ?? createEmptyPrimeAgentSessionPresentation(),
3160
2540
  activeUserBashId: void 0,
3161
- userBashSequence: 0
2541
+ userBashSequence: 0,
2542
+ rlmChildOverrides: new Map(init?.rlmChildOverrides),
2543
+ rlmChildRuntimeOverrides: /* @__PURE__ */ new Map()
3162
2544
  };
3163
2545
  }
3164
2546
  function resetRun(state) {
@@ -3264,7 +2646,9 @@ function computeRlmExecutionTree(rootSessionId, children, activeNodeId) {
3264
2646
  ...activeNodeId ? { activeNodeId } : {}
3265
2647
  };
3266
2648
  }
3267
- function safeRlmChild(child) {
2649
+ function safeRlmChild(child, override) {
2650
+ const childLastHeardFrom = child.lastHeardFrom;
2651
+ const lastHeardFrom = override?.lastHeardFrom ?? (typeof childLastHeardFrom === "number" ? childLastHeardFrom : void 0);
3268
2652
  return {
3269
2653
  id: child.id,
3270
2654
  ...child.parentId ? { parentId: child.parentId } : {},
@@ -3272,7 +2656,7 @@ function safeRlmChild(child) {
3272
2656
  ...child.sessionName ? { sessionName: child.sessionName } : {},
3273
2657
  ...child.model ? { model: child.model } : {},
3274
2658
  label: child.label,
3275
- status: child.status,
2659
+ status: override?.status ?? child.status,
3276
2660
  ...child.durationMs !== void 0 ? { durationMs: child.durationMs } : {},
3277
2661
  ...child.answerPreview ? { answerPreview: child.answerPreview } : {},
3278
2662
  ...child.toolUseCount !== void 0 ? { toolUseCount: child.toolUseCount } : {},
@@ -3281,9 +2665,63 @@ function safeRlmChild(child) {
3281
2665
  ...child.activity ? { activity: child.activity } : {},
3282
2666
  ...child.repliedSinceTask !== void 0 ? { repliedSinceTask: child.repliedSinceTask } : {},
3283
2667
  ...child.error ? { error: child.error } : {},
2668
+ ...lastHeardFrom !== void 0 ? { lastHeardFrom } : {},
3284
2669
  timestamp: Date.now()
3285
2670
  };
3286
2671
  }
2672
+ function rlmArtifactStatus(status) {
2673
+ if (status === "cancelled") return "cancelled";
2674
+ if (status === "error" || status === "failed") return "error";
2675
+ if (status === "done") return "success";
2676
+ return "running";
2677
+ }
2678
+ function applyRlmChildStatusOverrides(state, overrides) {
2679
+ for (const [childId, override] of overrides) state.rlmChildOverrides.set(childId, override);
2680
+ let changed = false;
2681
+ const rawRlmChildren = state.presentation.rlmChildren.map((child) => {
2682
+ const override = state.rlmChildOverrides.get(child.id);
2683
+ const runtimeOverride = state.rlmChildRuntimeOverrides.get(child.id);
2684
+ const status = override?.status ?? runtimeOverride?.status ?? child.status;
2685
+ const lastHeardFrom = override ? override.lastHeardFrom : runtimeOverride?.lastHeardFrom ?? child.lastHeardFrom;
2686
+ if (status === child.status && lastHeardFrom === child.lastHeardFrom) return child;
2687
+ changed = true;
2688
+ return {
2689
+ ...child,
2690
+ status,
2691
+ ...lastHeardFrom !== void 0 ? { lastHeardFrom } : {}
2692
+ };
2693
+ });
2694
+ if (!changed) return [];
2695
+ const rlmTree = computeRlmExecutionTree(state.sessionId, rawRlmChildren, state.presentation.rlmTree?.activeNodeId);
2696
+ const rlmChildren = rawRlmChildren.map((child) => {
2697
+ const treeNode = rlmTree.nodes[child.id];
2698
+ return treeNode ? {
2699
+ ...child,
2700
+ depth: treeNode.depth,
2701
+ childrenIds: treeNode.childrenIds
2702
+ } : child;
2703
+ });
2704
+ const updatedArtifacts = state.presentation.artifactRuns.map((run) => ({
2705
+ ...run,
2706
+ artifacts: run.artifacts.map((artifact) => {
2707
+ if (artifact.kind !== "rlm" || !artifact.sourceToolCallId) return artifact;
2708
+ const child = rlmChildren.find((entry) => entry.id === artifact.sourceToolCallId);
2709
+ if (!child) return artifact;
2710
+ return {
2711
+ ...artifact,
2712
+ status: rlmArtifactStatus(child.status),
2713
+ output: child,
2714
+ timestamp: child.timestamp
2715
+ };
2716
+ })
2717
+ }));
2718
+ return [emitPresentation(state, {
2719
+ ...state.presentation,
2720
+ rlmChildren,
2721
+ rlmTree,
2722
+ artifactRuns: updatedArtifacts
2723
+ })];
2724
+ }
3287
2725
  function safeGoal(goal) {
3288
2726
  return {
3289
2727
  active: goal.active,
@@ -3573,6 +3011,7 @@ function mapCoreAgentEvent(state, event) {
3573
3011
  }
3574
3012
  case "tool_execution_update": {
3575
3013
  const { category, toolName, serverName } = categorizeTool(event.toolName);
3014
+ const backgroundOutput = extractToolBackgroundOutput(event.partialResult);
3576
3015
  return [{
3577
3016
  type: "tool",
3578
3017
  part: upsertCurrentToolPart(state, {
@@ -3583,7 +3022,8 @@ function mapCoreAgentEvent(state, event) {
3583
3022
  toolCallId: event.toolCallId,
3584
3023
  state: "input-streaming",
3585
3024
  input: event.args,
3586
- result: event.partialResult
3025
+ result: event.partialResult,
3026
+ ...backgroundOutput !== void 0 ? { backgroundOutput } : {}
3587
3027
  }),
3588
3028
  messageId: state.currentMessageId
3589
3029
  }];
@@ -3593,6 +3033,7 @@ function mapCoreAgentEvent(state, event) {
3593
3033
  const errorText = event.isError ? extractToolErrorText(event.result) : void 0;
3594
3034
  const errorEnvelope = errorText ? createFleetErrorEnvelope(errorText) : void 0;
3595
3035
  const durationMs = typeof event.result?.durationMs === "number" ? event.result.durationMs : typeof event.result?.details?.durationMs === "number" ? event.result.details.durationMs : void 0;
3036
+ const backgroundOutput = extractToolBackgroundOutput(event.result);
3596
3037
  return [{
3597
3038
  type: "tool",
3598
3039
  part: upsertCurrentToolPart(state, {
@@ -3605,6 +3046,7 @@ function mapCoreAgentEvent(state, event) {
3605
3046
  output: event.result,
3606
3047
  result: event.result,
3607
3048
  ...durationMs !== void 0 ? { durationMs } : {},
3049
+ ...backgroundOutput !== void 0 ? { backgroundOutput } : {},
3608
3050
  ...errorEnvelope ? { error: errorEnvelope } : {}
3609
3051
  }),
3610
3052
  messageId: state.currentMessageId
@@ -3778,7 +3220,12 @@ function mapSessionSpecificEvent(state, event) {
3778
3220
  serviceTier: event.serviceTier
3779
3221
  })];
3780
3222
  case "rlm_child_update": {
3781
- const child = safeRlmChild(event.child);
3223
+ const runtimeChild = safeRlmChild(event.child);
3224
+ state.rlmChildRuntimeOverrides.set(event.child.id, {
3225
+ status: runtimeChild.status,
3226
+ ...runtimeChild.lastHeardFrom !== void 0 ? { lastHeardFrom: runtimeChild.lastHeardFrom } : {}
3227
+ });
3228
+ const child = safeRlmChild(event.child, state.rlmChildOverrides.get(event.child.id));
3782
3229
  const rawRlmChildren = state.presentation.rlmChildren.filter((entry) => entry.id !== child.id);
3783
3230
  rawRlmChildren.push(child);
3784
3231
  const rlmTree = computeRlmExecutionTree(state.sessionId, rawRlmChildren, child.id);
@@ -3801,7 +3248,7 @@ function mapSessionSpecificEvent(state, event) {
3801
3248
  sourceToolCallId: child.id,
3802
3249
  kind: "rlm",
3803
3250
  title: child.label,
3804
- status: child.status === "cancelled" ? "cancelled" : child.status === "error" ? "error" : child.status === "done" ? "success" : "running",
3251
+ status: rlmArtifactStatus(child.status),
3805
3252
  output: child,
3806
3253
  timestamp: child.timestamp
3807
3254
  };
@@ -3964,7 +3411,14 @@ function mapAgentConnectionEvent(state, event) {
3964
3411
  resetRun(state);
3965
3412
  const events = [];
3966
3413
  if (event.snapshot.parent || event.snapshot.children) {
3967
- const rawRlmChildren = (event.snapshot.children ?? []).map(safeRlmChild);
3414
+ const rawRlmChildren = (event.snapshot.children ?? []).map((child) => {
3415
+ const runtimeChild = safeRlmChild(child);
3416
+ state.rlmChildRuntimeOverrides.set(child.id, {
3417
+ status: runtimeChild.status,
3418
+ ...runtimeChild.lastHeardFrom !== void 0 ? { lastHeardFrom: runtimeChild.lastHeardFrom } : {}
3419
+ });
3420
+ return safeRlmChild(child, state.rlmChildOverrides.get(child.id));
3421
+ });
3968
3422
  const rlmTree = computeRlmExecutionTree(state.sessionId, rawRlmChildren);
3969
3423
  const rlmChildren = rawRlmChildren.map((c) => {
3970
3424
  const treeNode = rlmTree.nodes[c.id];
@@ -4295,6 +3749,9 @@ var RingBuffer = class {
4295
3749
  size() {
4296
3750
  return this.entries.length;
4297
3751
  }
3752
+ latestSequence() {
3753
+ return this.entries.at(-1)?.seq ?? 0;
3754
+ }
4298
3755
  clear() {
4299
3756
  this.entries.length = 0;
4300
3757
  this.nextSeq = 1;
@@ -4533,7 +3990,13 @@ function sessionSummaryIdentifiers(summary) {
4533
3990
  function sessionSummaryParentIdentifiers(summary) {
4534
3991
  return [summary.parentSessionId, summary.parentActiveSessionId].flatMap((value) => typeof value === "string" && value.length > 0 ? [value] : []);
4535
3992
  }
4536
- function hasSessionLineage(candidate, rootIdentifiers, sessionsByIdentifier) {
3993
+ function sessionSummaryPath(summary) {
3994
+ return typeof summary.sessionFile === "string" && summary.sessionFile.length > 0 ? resolve(summary.sessionFile) : void 0;
3995
+ }
3996
+ function sessionSummaryParentPaths(summary) {
3997
+ return [summary.parentSessionPath].flatMap((value) => typeof value === "string" && value.length > 0 ? [resolve(value)] : []);
3998
+ }
3999
+ function hasSessionLineage(candidate, rootIdentifiers, rootPaths, sessionsByIdentifier, sessionsByPath) {
4537
4000
  const pending = [candidate];
4538
4001
  const visited = /* @__PURE__ */ new Set();
4539
4002
  while (pending.length > 0) {
@@ -4545,13 +4008,48 @@ function hasSessionLineage(candidate, rootIdentifiers, sessionsByIdentifier) {
4545
4008
  const parent = sessionsByIdentifier.get(parentId);
4546
4009
  if (parent && !visited.has(parent)) pending.push(parent);
4547
4010
  }
4011
+ for (const parentPath of sessionSummaryParentPaths(current)) {
4012
+ if (rootPaths.has(parentPath)) return true;
4013
+ const parent = sessionsByPath.get(parentPath);
4014
+ if (parent && !visited.has(parent)) pending.push(parent);
4015
+ }
4548
4016
  }
4549
4017
  return false;
4550
4018
  }
4019
+ async function sessionLineagePaths(sessionPath) {
4020
+ const paths = /* @__PURE__ */ new Set();
4021
+ let currentPath = resolve(sessionPath);
4022
+ while (!paths.has(currentPath)) {
4023
+ paths.add(currentPath);
4024
+ try {
4025
+ const parentSession = (await SessionManager.openAsync(currentPath)).getHeader()?.parentSession;
4026
+ if (!parentSession) break;
4027
+ currentPath = resolve(dirname(currentPath), parentSession);
4028
+ } catch {
4029
+ break;
4030
+ }
4031
+ }
4032
+ return paths;
4033
+ }
4034
+ function rlmChildStatusOverride(summary) {
4035
+ const status = summary.statusLabel === "failed" || summary.workerState === "failed" ? "failed" : summary.statusLabel === "recovering" || summary.workerState === "recovering" ? "recovering" : void 0;
4036
+ const lastHeardFrom = summary.lastHeardFromAt ? Date.parse(summary.lastHeardFromAt) : NaN;
4037
+ return {
4038
+ ...status ? { status } : {},
4039
+ ...Number.isFinite(lastHeardFrom) ? { lastHeardFrom } : {}
4040
+ };
4041
+ }
4042
+ function effectiveRlmChildStatus(child, summary) {
4043
+ return rlmChildStatusOverride(summary).status ?? child.status;
4044
+ }
4551
4045
  var PrimeBridge = class {
4552
4046
  #sessions = /* @__PURE__ */ new Map();
4553
4047
  #listeners = /* @__PURE__ */ new Set();
4554
4048
  #ringBuffers = /* @__PURE__ */ new Map();
4049
+ #rlmChildStreams = /* @__PURE__ */ new Map();
4050
+ #rlmChildStreamInitializations = /* @__PURE__ */ new Map();
4051
+ #rlmChildMetadataRefreshes = /* @__PURE__ */ new Map();
4052
+ #rlmChildMetadataRefreshPending = /* @__PURE__ */ new Set();
4555
4053
  #dialogs;
4556
4054
  #kernelTimeoutMs;
4557
4055
  #ringBufferCapacity;
@@ -4638,6 +4136,15 @@ var PrimeBridge = class {
4638
4136
  }
4639
4137
  /** Test-only: reset state. */
4640
4138
  resetForTests() {
4139
+ for (const stream of this.#rlmChildStreams.values()) {
4140
+ stream.closed = true;
4141
+ stream.removeWatcherListener();
4142
+ stream.watcher.close().catch(() => void 0);
4143
+ }
4144
+ this.#rlmChildStreams.clear();
4145
+ this.#rlmChildStreamInitializations.clear();
4146
+ this.#rlmChildMetadataRefreshes.clear();
4147
+ this.#rlmChildMetadataRefreshPending.clear();
4641
4148
  for (const session of this.#sessions.values()) {
4642
4149
  session.unsubscribe();
4643
4150
  session.connection.dispose().catch(() => void 0);
@@ -4788,6 +4295,7 @@ var PrimeBridge = class {
4788
4295
  if (frame.type === "presentation") this.#persistPresentation(sessionId, sessionPath, frame.presentation);
4789
4296
  this.#dispatch(sessionId, frame);
4790
4297
  }
4298
+ if (event.type === "session_resynced" || event.type === "session_event" && event.event.type === "rlm_child_update") this.#queueRlmChildMetadataRefresh(sessionId);
4791
4299
  });
4792
4300
  const bridgeSession = {
4793
4301
  sessionId,
@@ -4880,33 +4388,192 @@ var PrimeBridge = class {
4880
4388
  async listSessions(cwd) {
4881
4389
  return this.#sessionLister(cwd);
4882
4390
  }
4883
- /**
4884
- * Load a completed RLM child without resuming it as a live session.
4885
- *
4886
- * Child transcripts can be stored outside the parent's configured session
4887
- * directory. Authorization is therefore based on both the live parent's
4888
- * presentation and the daemon's lineage metadata, never on a browser-
4889
- * supplied filesystem path.
4890
- */
4891
- async loadRlmChildTranscript(parentSessionId, childId) {
4391
+ async #resolveRlmLineage(sessions2, rootSessionId, rootSessionPath) {
4392
+ const sessionsByIdentifier = /* @__PURE__ */ new Map();
4393
+ const sessionsByPath = /* @__PURE__ */ new Map();
4394
+ for (const session of sessions2) {
4395
+ for (const identifier of sessionSummaryIdentifiers(session)) if (!sessionsByIdentifier.has(identifier)) sessionsByIdentifier.set(identifier, session);
4396
+ const path = sessionSummaryPath(session);
4397
+ if (path && !sessionsByPath.has(path)) sessionsByPath.set(path, session);
4398
+ }
4399
+ const rootIdentifiers = /* @__PURE__ */ new Set([rootSessionId]);
4400
+ const rootPaths = new Set(await sessionLineagePaths(rootSessionPath));
4401
+ const rootSummary = sessionsByIdentifier.get(rootSessionId);
4402
+ if (rootSummary) {
4403
+ for (const identifier of sessionSummaryIdentifiers(rootSummary)) rootIdentifiers.add(identifier);
4404
+ for (const path of sessionSummaryParentPaths(rootSummary)) rootPaths.add(path);
4405
+ }
4406
+ for (const rootPath of rootPaths) {
4407
+ const rootAncestor = sessionsByPath.get(rootPath);
4408
+ if (!rootAncestor) continue;
4409
+ for (const identifier of sessionSummaryIdentifiers(rootAncestor)) rootIdentifiers.add(identifier);
4410
+ }
4411
+ return {
4412
+ sessionsByIdentifier,
4413
+ sessionsByPath,
4414
+ rootIdentifiers,
4415
+ rootPaths
4416
+ };
4417
+ }
4418
+ async #findAuthorizedRlmChild(parentSessionId, childId) {
4892
4419
  const parent = this.#sessions.get(parentSessionId);
4893
- if (!parent || !parent.mapperState.presentation.rlmChildren.some((child2) => child2.id === childId)) return;
4420
+ const child = parent?.mapperState.presentation.rlmChildren.find((entry) => entry.id === childId);
4421
+ if (!parent || !child) return void 0;
4894
4422
  const sessions2 = await this.#sessionLister();
4895
- const sessionsByIdentifier = /* @__PURE__ */ new Map();
4896
- for (const session of sessions2) for (const identifier of sessionSummaryIdentifiers(session)) if (!sessionsByIdentifier.has(identifier)) sessionsByIdentifier.set(identifier, session);
4897
- const rootIdentifiers = /* @__PURE__ */ new Set([parentSessionId]);
4898
- const rootSummary = sessionsByIdentifier.get(parentSessionId);
4899
- if (rootSummary) for (const identifier of sessionSummaryIdentifiers(rootSummary)) rootIdentifiers.add(identifier);
4900
- const child = sessions2.find((candidate) => {
4901
- return candidate.rlmChildId === childId && typeof candidate.sessionFile === "string" && hasSessionLineage(candidate, rootIdentifiers, sessionsByIdentifier);
4902
- });
4903
- if (!child?.sessionFile) return void 0;
4904
- const sessionManager = await SessionManager.openAsync(child.sessionFile);
4423
+ const { sessionsByIdentifier, sessionsByPath, rootIdentifiers, rootPaths } = await this.#resolveRlmLineage(sessions2, parentSessionId, parent.sessionPath);
4424
+ const summary = sessions2.find((candidate) => candidate.rlmChildId === childId && hasSessionLineage(candidate, rootIdentifiers, rootPaths, sessionsByIdentifier, sessionsByPath));
4425
+ return summary ? {
4426
+ parent,
4427
+ child,
4428
+ summary
4429
+ } : void 0;
4430
+ }
4431
+ #queueRlmChildMetadataRefresh(rootSessionId) {
4432
+ this.#rlmChildMetadataRefreshPending.add(rootSessionId);
4433
+ if (this.#rlmChildMetadataRefreshes.has(rootSessionId)) return;
4434
+ const refresh = (async () => {
4435
+ while (this.#rlmChildMetadataRefreshPending.delete(rootSessionId)) await this.#refreshRlmChildMetadata(rootSessionId);
4436
+ })();
4437
+ this.#rlmChildMetadataRefreshes.set(rootSessionId, refresh);
4438
+ refresh.finally(() => {
4439
+ if (this.#rlmChildMetadataRefreshes.get(rootSessionId) === refresh) this.#rlmChildMetadataRefreshes.delete(rootSessionId);
4440
+ }).catch(() => void 0);
4441
+ }
4442
+ async #refreshRlmChildMetadata(rootSessionId) {
4443
+ const parent = this.#sessions.get(rootSessionId);
4444
+ if (!parent) return;
4445
+ let sessions2;
4446
+ try {
4447
+ sessions2 = await this.#sessionLister();
4448
+ } catch {
4449
+ for (const child of parent.mapperState.presentation.rlmChildren) parent.mapperState.rlmChildOverrides.delete(child.id);
4450
+ for (const frame of applyRlmChildStatusOverrides(parent.mapperState, /* @__PURE__ */ new Map())) this.#dispatch(rootSessionId, frame);
4451
+ return;
4452
+ }
4453
+ const { sessionsByIdentifier, sessionsByPath, rootIdentifiers, rootPaths } = await this.#resolveRlmLineage(sessions2, rootSessionId, parent.sessionPath);
4454
+ const overrides = /* @__PURE__ */ new Map();
4455
+ for (const child of parent.mapperState.presentation.rlmChildren) {
4456
+ const summary = sessions2.find((candidate) => candidate.rlmChildId === child.id && hasSessionLineage(candidate, rootIdentifiers, rootPaths, sessionsByIdentifier, sessionsByPath));
4457
+ if (summary) overrides.set(child.id, rlmChildStatusOverride(summary));
4458
+ else parent.mapperState.rlmChildOverrides.delete(child.id);
4459
+ }
4460
+ const frames = applyRlmChildStatusOverrides(parent.mapperState, overrides);
4461
+ for (const frame of frames) {
4462
+ if (frame.type === "presentation") this.#persistPresentation(rootSessionId, parent.sessionPath, frame.presentation);
4463
+ this.#dispatch(rootSessionId, frame);
4464
+ }
4465
+ }
4466
+ #childStreamStatus(child, summary) {
4467
+ const status = summary ? effectiveRlmChildStatus(child, summary) : child.status;
4468
+ if (status === "error" || status === "failed") return "error";
4469
+ if (status === "running" || status === "recovering") return "streaming";
4470
+ return "ready";
4471
+ }
4472
+ async #closeRlmChildStream(stream) {
4473
+ if (stream.closed) return;
4474
+ stream.closed = true;
4475
+ if (this.#rlmChildStreams.get(stream.key) === stream) this.#rlmChildStreams.delete(stream.key);
4476
+ stream.buffering = false;
4477
+ stream.bufferedEvents.length = 0;
4478
+ stream.removeWatcherListener();
4479
+ await stream.watcher.close().catch(() => void 0);
4480
+ this.#ringBuffers.delete(stream.channelId);
4481
+ }
4482
+ async #publicRlmChildStream(stream, resume) {
4483
+ const requestedCursor = resume?.lastEventId && resume.lastEventId > 0 ? resume.lastEventId : 0;
4484
+ const generationMatches = resume?.streamGeneration === stream.streamGeneration;
4485
+ const buffer = this.#ringBufferFor(stream.channelId);
4486
+ const latest = buffer.latestSequence();
4487
+ const cursorOverflowed = generationMatches && requestedCursor > 0 ? buffer.replaySince(requestedCursor).overflowed : false;
4488
+ const canResume = generationMatches && requestedCursor > 0 && (requestedCursor === 0 || requestedCursor <= latest) && !cursorOverflowed;
4489
+ if (!canResume && !stream.snapshot.terminal && (resume?.streamGeneration !== void 0 || requestedCursor > 0)) await this.#refreshRlmChildSnapshot(stream);
4490
+ const refreshedLatest = buffer.latestSequence();
4491
+ const includeSnapshot = !canResume || stream.snapshot.terminal === true;
4492
+ const cursorReset = (resume?.streamGeneration !== void 0 || requestedCursor > 0) && !canResume;
4493
+ const replayFrom = canResume ? requestedCursor : stream.snapshot.terminal ? refreshedLatest : stream.replayFrom;
4494
+ let released = false;
4495
+ return {
4496
+ sessionId: stream.streamSessionId,
4497
+ projectId: stream.projectId,
4498
+ snapshot: stream.snapshot,
4499
+ channelId: stream.channelId,
4500
+ streamGeneration: stream.streamGeneration,
4501
+ mode: "live",
4502
+ resumeAccepted: canResume,
4503
+ cursorReset,
4504
+ replayFrom,
4505
+ includeSnapshot,
4506
+ release: async () => {
4507
+ if (released) return;
4508
+ released = true;
4509
+ stream.refs = Math.max(0, stream.refs - 1);
4510
+ if (stream.refs === 0) await this.#closeRlmChildStream(stream);
4511
+ }
4512
+ };
4513
+ }
4514
+ async #refreshRlmChildSnapshot(stream) {
4515
+ if (stream.closed) return;
4516
+ stream.buffering = true;
4517
+ const tracked = stream.refreshTail.catch(() => void 0).then(async () => {
4518
+ if (stream.closed) return;
4519
+ const messages = toChatMessagesFromAgentMessages(await stream.watcher.getMessages(), stream.canonicalSessionId);
4520
+ if (stream.closed) return;
4521
+ stream.snapshot = {
4522
+ ...stream.snapshot,
4523
+ messages,
4524
+ presentation: stream.mapperState.presentation
4525
+ };
4526
+ this.#dispatch(stream.channelId, stream.snapshot);
4527
+ stream.replayFrom = this.#ringBufferFor(stream.channelId).latestSequence();
4528
+ }).catch(() => void 0);
4529
+ stream.refreshTail = tracked;
4530
+ await tracked;
4531
+ if (stream.refreshTail === tracked) {
4532
+ stream.buffering = false;
4533
+ for (const event of stream.bufferedEvents.splice(0)) this.#handleRlmChildEvent(stream, event);
4534
+ }
4535
+ }
4536
+ #queueRlmChildSnapshot(stream) {
4537
+ this.#refreshRlmChildSnapshot(stream);
4538
+ }
4539
+ #handleRlmChildEvent(stream, event) {
4540
+ if (stream.closed) return;
4541
+ if (event.type === "session_event") {
4542
+ if (event.event.type === "agent_start" || event.event.type === "turn_start") stream.snapshot = {
4543
+ ...stream.snapshot,
4544
+ status: "streaming",
4545
+ terminal: false
4546
+ };
4547
+ if (event.event.type === "agent_end" || event.event.type === "turn_end") stream.snapshot = {
4548
+ ...stream.snapshot,
4549
+ status: "ready"
4550
+ };
4551
+ }
4552
+ if (event.type === "closed") stream.snapshot = {
4553
+ ...stream.snapshot,
4554
+ status: event.error ? "error" : "ready",
4555
+ terminal: true
4556
+ };
4557
+ const frames = mapAgentConnectionEvent(stream.mapperState, event);
4558
+ for (const frame of frames) {
4559
+ if (frame.type === "error") stream.snapshot = {
4560
+ ...stream.snapshot,
4561
+ status: "error"
4562
+ };
4563
+ this.#dispatch(stream.channelId, frame);
4564
+ }
4565
+ if (event.type === "session_event" && event.event.type === "rlm_child_update") this.#queueRlmChildMetadataRefresh(stream.parentSessionId);
4566
+ if (event.type === "session_replaced" || event.type === "session_resynced" || event.type === "closed" || event.type === "session_event" && (event.event.type === "agent_end" || event.event.type === "turn_end")) this.#queueRlmChildSnapshot(stream);
4567
+ }
4568
+ async #loadAuthorizedRlmChildTranscript(authorized) {
4569
+ const { summary: childSummary } = authorized;
4570
+ if (!childSummary.sessionFile) return void 0;
4571
+ const sessionManager = await SessionManager.openAsync(childSummary.sessionFile);
4905
4572
  const sessionId = sessionManager.getSessionId();
4906
- if (sessionId !== child.sessionId && sessionId !== child.id) return void 0;
4573
+ if (sessionId !== childSummary.sessionId && sessionId !== childSummary.id) return void 0;
4907
4574
  const agentMessages = sessionManager.buildSessionContext().messages;
4908
4575
  const messages = toChatMessagesFromAgentMessages(agentMessages, sessionId);
4909
- const presentation = initialPresentationForSession(agentMessages, void 0, void 0, void 0, void 0, sessionId, await loadManagedPrimePresentation({ sessionPath: child.sessionFile }));
4576
+ const presentation = initialPresentationForSession(agentMessages, void 0, void 0, void 0, void 0, sessionId, await loadManagedPrimePresentation({ sessionPath: childSummary.sessionFile }));
4910
4577
  return {
4911
4578
  sessionId,
4912
4579
  projectId: await getPrimeConfig().projectRegistry.projectIdForSession(sessionId, sessionManager.getCwd()),
@@ -4914,6 +4581,170 @@ var PrimeBridge = class {
4914
4581
  presentation
4915
4582
  };
4916
4583
  }
4584
+ async #snapshotOnlyRlmChildStream(authorized, resume) {
4585
+ const transcript = await this.#loadAuthorizedRlmChildTranscript(authorized).catch(() => void 0);
4586
+ if (!transcript) return void 0;
4587
+ const streamGeneration = crypto.randomUUID();
4588
+ const snapshot2 = {
4589
+ type: "session_snapshot",
4590
+ session: {
4591
+ sessionId: transcript.sessionId,
4592
+ projectId: transcript.projectId
4593
+ },
4594
+ messages: transcript.messages,
4595
+ presentation: transcript.presentation,
4596
+ status: this.#childStreamStatus(authorized.child, authorized.summary),
4597
+ terminal: true
4598
+ };
4599
+ return {
4600
+ sessionId: transcript.sessionId,
4601
+ projectId: transcript.projectId,
4602
+ snapshot: snapshot2,
4603
+ channelId: `snapshot:${authorized.parent.sessionId}:${authorized.child.id}:${streamGeneration}`,
4604
+ streamGeneration,
4605
+ mode: "snapshot-only",
4606
+ resumeAccepted: false,
4607
+ cursorReset: resume?.streamGeneration !== void 0 || (resume?.lastEventId ?? 0) > 0,
4608
+ replayFrom: 0,
4609
+ includeSnapshot: true,
4610
+ release: async () => void 0
4611
+ };
4612
+ }
4613
+ async #initializeRlmChildStream(authorized) {
4614
+ const { child, summary, parent } = authorized;
4615
+ const runtimeIds = [
4616
+ summary.activeSessionId,
4617
+ child.activeSessionId,
4618
+ summary.sessionId,
4619
+ summary.id,
4620
+ child.id
4621
+ ].filter((value) => typeof value === "string" && value.length > 0);
4622
+ let watcher;
4623
+ let streamSessionId;
4624
+ for (const runtimeId of [...new Set(runtimeIds)]) {
4625
+ try {
4626
+ watcher = await parent.connection.watchSession(runtimeId);
4627
+ } catch {
4628
+ watcher = void 0;
4629
+ }
4630
+ if (watcher) {
4631
+ streamSessionId = runtimeId;
4632
+ break;
4633
+ }
4634
+ }
4635
+ if (!watcher || !streamSessionId) return void 0;
4636
+ const pendingEvents = [];
4637
+ let buffering = true;
4638
+ let removeWatcherListener = () => void 0;
4639
+ try {
4640
+ removeWatcherListener = watcher.subscribe((event) => {
4641
+ if (buffering) pendingEvents.push(event);
4642
+ else {
4643
+ const stream2 = this.#rlmChildStreams.get(`${parent.sessionId}:${child.id}`);
4644
+ if (!stream2) return;
4645
+ if (stream2.buffering) stream2.bufferedEvents.push(event);
4646
+ else this.#handleRlmChildEvent(stream2, event);
4647
+ }
4648
+ });
4649
+ const agentMessages = await watcher.getMessages();
4650
+ const persistedPresentation = summary.sessionFile ? await loadManagedPrimePresentation({ sessionPath: summary.sessionFile }) : void 0;
4651
+ const canonicalSessionId = summary.sessionId || streamSessionId;
4652
+ const override = rlmChildStatusOverride(summary);
4653
+ const presentation = initialPresentationForSession(agentMessages, summary.sessionName ?? child.sessionName ?? child.label, summary.thinkingLevel, void 0, child.recap ?? summary.summary, canonicalSessionId, persistedPresentation);
4654
+ const mapperState = createEventMapperState({
4655
+ sessionId: canonicalSessionId,
4656
+ presentation,
4657
+ rlmChildOverrides: /* @__PURE__ */ new Map([[child.id, override]])
4658
+ });
4659
+ const projectId = await getPrimeConfig().projectRegistry.projectIdForSession(canonicalSessionId, summary.cwd);
4660
+ const streamGeneration = crypto.randomUUID();
4661
+ const stream = {
4662
+ key: `${parent.sessionId}:${child.id}`,
4663
+ parentSessionId: parent.sessionId,
4664
+ childId: child.id,
4665
+ streamSessionId,
4666
+ canonicalSessionId,
4667
+ channelId: `child:${parent.sessionId}:${child.id}:${streamGeneration}`,
4668
+ streamGeneration,
4669
+ projectId,
4670
+ child,
4671
+ summary,
4672
+ watcher,
4673
+ mapperState,
4674
+ snapshot: {
4675
+ type: "session_snapshot",
4676
+ session: {
4677
+ sessionId: canonicalSessionId,
4678
+ projectId
4679
+ },
4680
+ messages: toChatMessagesFromAgentMessages(agentMessages, canonicalSessionId),
4681
+ presentation,
4682
+ status: this.#childStreamStatus(child, summary)
4683
+ },
4684
+ replayFrom: 0,
4685
+ refs: 1,
4686
+ closed: false,
4687
+ buffering: false,
4688
+ bufferedEvents: [],
4689
+ removeWatcherListener,
4690
+ refreshTail: Promise.resolve()
4691
+ };
4692
+ this.#rlmChildStreams.set(stream.key, stream);
4693
+ this.#ringBufferFor(stream.channelId);
4694
+ buffering = false;
4695
+ for (const event of pendingEvents.splice(0)) this.#handleRlmChildEvent(stream, event);
4696
+ return stream;
4697
+ } catch {
4698
+ buffering = false;
4699
+ removeWatcherListener();
4700
+ await watcher.close().catch(() => void 0);
4701
+ return;
4702
+ }
4703
+ }
4704
+ /**
4705
+ * Open a read-only stream for an authorized RLM child. Completed and cold
4706
+ * children use a one-shot snapshot and never resume a runtime session.
4707
+ */
4708
+ async openRlmChildStream(parentSessionId, childId, resume) {
4709
+ const authorized = await this.#findAuthorizedRlmChild(parentSessionId, childId);
4710
+ if (!authorized) return void 0;
4711
+ const key = `${parentSessionId}:${childId}`;
4712
+ const existing = this.#rlmChildStreams.get(key);
4713
+ if (existing) {
4714
+ existing.refs += 1;
4715
+ return this.#publicRlmChildStream(existing, resume);
4716
+ }
4717
+ const status = effectiveRlmChildStatus(authorized.child, authorized.summary);
4718
+ if (status !== "running" && status !== "recovering") return this.#snapshotOnlyRlmChildStream(authorized, resume);
4719
+ const pending = this.#rlmChildStreamInitializations.get(key);
4720
+ if (pending) {
4721
+ const stream = await pending;
4722
+ if (!stream) return void 0;
4723
+ stream.refs += 1;
4724
+ return this.#publicRlmChildStream(stream, resume);
4725
+ }
4726
+ const initialization = this.#initializeRlmChildStream(authorized);
4727
+ this.#rlmChildStreamInitializations.set(key, initialization);
4728
+ try {
4729
+ const stream = await initialization;
4730
+ if (!stream) return void 0;
4731
+ return this.#publicRlmChildStream(stream, resume);
4732
+ } finally {
4733
+ if (this.#rlmChildStreamInitializations.get(key) === initialization) this.#rlmChildStreamInitializations.delete(key);
4734
+ }
4735
+ }
4736
+ /**
4737
+ * Load a completed RLM child without resuming it as a live session.
4738
+ *
4739
+ * Child transcripts can be stored outside the parent's configured session
4740
+ * directory. Authorization is therefore based on both the live parent's
4741
+ * presentation and the daemon's lineage metadata, never on a browser-
4742
+ * supplied filesystem path.
4743
+ */
4744
+ async loadRlmChildTranscript(parentSessionId, childId) {
4745
+ const authorized = await this.#findAuthorizedRlmChild(parentSessionId, childId);
4746
+ return authorized ? this.#loadAuthorizedRlmChildTranscript(authorized) : void 0;
4747
+ }
4917
4748
  async deleteSession(sessionId) {
4918
4749
  let existing = this.#sessions.get(sessionId);
4919
4750
  if (!existing) {
@@ -4939,6 +4770,11 @@ var PrimeBridge = class {
4939
4770
  await pendingPresentationWrite?.catch(() => void 0);
4940
4771
  if (this.#presentationWrites.get(existing.sessionId) === pendingPresentationWrite) this.#presentationWrites.delete(existing.sessionId);
4941
4772
  this.#dialogs.cancelAll(existing.sessionId, "server-shutdown");
4773
+ for (const childStream of [...this.#rlmChildStreams.values()]) {
4774
+ if (childStream.parentSessionId !== existing.sessionId) continue;
4775
+ childStream.refs = 0;
4776
+ await this.#closeRlmChildStream(childStream);
4777
+ }
4942
4778
  existing.unsubscribe();
4943
4779
  await existing.connection.abort().catch(() => void 0);
4944
4780
  await this.#openUIPromptTransitions.get(existing.sessionId)?.catch(() => void 0);
@@ -5862,103 +5698,162 @@ function normalizeSseReplayEvent(event) {
5862
5698
  if (!event || typeof event !== "object" || !("frame" in event)) return event;
5863
5699
  return event.frame ?? event;
5864
5700
  }
5865
- function handleChatEventsGet(request) {
5866
- return wrapApiHandler(async () => {
5867
- const url = new URL(request.url);
5868
- const sessionId = url.searchParams.get("sessionId");
5869
- if (!sessionId) return Response.json({ message: "SSE requires ?sessionId=" }, { status: 400 });
5870
- const lastEventIdRaw = request.headers.get("last-event-id") ?? url.searchParams.get("lastEventId");
5871
- const parsedLastEventId = lastEventIdRaw ? Number.parseInt(lastEventIdRaw, 10) : 0;
5872
- const lastEventId = Number.isFinite(parsedLastEventId) && parsedLastEventId > 0 ? parsedLastEventId : 0;
5873
- const bridge = getBridge();
5874
- const encoder = new TextEncoder();
5875
- let heartbeat;
5876
- let removeListener;
5877
- const stream = new ReadableStream({
5878
- async start(controller) {
5879
- let closed = false;
5880
- const enqueue = (data) => {
5881
- if (closed) return;
5882
- try {
5883
- controller.enqueue(encoder.encode(data));
5884
- } catch {
5885
- closed = true;
5886
- }
5887
- };
5888
- const write = (chunk) => {
5889
- const lines = [
5890
- chunk.id !== void 0 ? `id: ${chunk.id}
5701
+ function lastEventIdFor(request, url) {
5702
+ const raw = request.headers.get("last-event-id") ?? url.searchParams.get("lastEventId");
5703
+ const parsed = raw ? Number.parseInt(raw, 10) : 0;
5704
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
5705
+ }
5706
+ function createSseResponse(request, bridge, source, lastEventId) {
5707
+ const encoder = new TextEncoder();
5708
+ let heartbeat;
5709
+ let removeListener;
5710
+ let cleaned = false;
5711
+ let released = false;
5712
+ const releaseSource = () => {
5713
+ if (released) return;
5714
+ released = true;
5715
+ const release = source.release;
5716
+ if (release) release().catch(() => void 0);
5717
+ };
5718
+ const stream = new ReadableStream({
5719
+ async start(controller) {
5720
+ let closed = false;
5721
+ const enqueue = (data) => {
5722
+ if (closed) return;
5723
+ try {
5724
+ controller.enqueue(encoder.encode(data));
5725
+ } catch {
5726
+ closed = true;
5727
+ }
5728
+ };
5729
+ const write = (chunk) => {
5730
+ const lines = [
5731
+ chunk.id !== void 0 ? `id: ${chunk.id}
5891
5732
  ` : "",
5892
- `event: message
5893
- `,
5894
- `data: ${JSON.stringify(chunk.data)}
5733
+ "event: message\n",
5734
+ `data: ${JSON.stringify(chunk.data)}
5895
5735
 
5896
5736
  `
5897
- ];
5898
- enqueue(lines.join(""));
5899
- };
5900
- write({ data: {
5901
- type: "connected",
5902
- sessionId,
5903
- adapterCapabilities: FLEET_ADAPTER_CAPABILITIES
5904
- } });
5905
- let liveCursor = lastEventId;
5906
- let pendingQuestionIds = lastEventId === 0 ? new Set(bridge.pendingDialogsFor(sessionId).map((dialog) => dialog.toolCallId)) : null;
5907
- const flush = () => {
5908
- const { replayed } = bridge.replaySince(sessionId, liveCursor);
5909
- for (const entry of replayed) {
5910
- liveCursor = entry.seq;
5911
- const event = normalizeSseReplayEvent(entry.event);
5912
- if (!shouldReplaySseEvent(event, pendingQuestionIds)) continue;
5913
- write({
5914
- id: entry.seq,
5915
- data: event
5916
- });
5917
- }
5918
- pendingQuestionIds = null;
5919
- };
5920
- removeListener = bridge.addEventListener((sid) => {
5921
- if (sid !== sessionId) return;
5922
- flush();
5923
- });
5924
- if (lastEventId > 0) {
5925
- const { overflowed } = bridge.replaySince(sessionId, lastEventId);
5926
- if (overflowed) write({ data: {
5737
+ ];
5738
+ enqueue(lines.join(""));
5739
+ };
5740
+ const cleanup = () => {
5741
+ if (cleaned) return;
5742
+ cleaned = true;
5743
+ closed = true;
5744
+ if (heartbeat) clearInterval(heartbeat);
5745
+ removeListener?.();
5746
+ releaseSource();
5747
+ try {
5748
+ controller.close();
5749
+ } catch {
5750
+ }
5751
+ };
5752
+ const channelId = source.channelId ?? source.sessionId;
5753
+ let readyToFlush = false;
5754
+ let resyncSent = false;
5755
+ let liveCursor = source.replayFrom ?? lastEventId;
5756
+ let pendingQuestionIds = liveCursor === 0 ? new Set(bridge.pendingDialogsFor(source.sessionId).map((dialog) => dialog.toolCallId)) : null;
5757
+ const flush = () => {
5758
+ if (!readyToFlush || resyncSent || closed) return;
5759
+ const { replayed, overflowed } = bridge.replaySince(channelId, liveCursor);
5760
+ if (overflowed) {
5761
+ resyncSent = true;
5762
+ write({ data: {
5927
5763
  type: "state",
5928
5764
  state: {
5929
5765
  name: "agent_settled",
5930
5766
  message: "resync-required"
5931
5767
  }
5932
5768
  } });
5769
+ pendingQuestionIds = null;
5770
+ return;
5933
5771
  }
5934
- flush();
5935
- heartbeat = setInterval(() => {
5936
- enqueue(`: heartbeat
5937
-
5938
- `);
5939
- }, 15e3);
5940
- request.signal.addEventListener("abort", () => {
5941
- if (closed) return;
5942
- closed = true;
5943
- if (heartbeat) clearInterval(heartbeat);
5944
- removeListener?.();
5945
- try {
5946
- controller.close();
5947
- } catch {
5772
+ for (const entry of replayed) {
5773
+ liveCursor = entry.seq;
5774
+ const event = normalizeSseReplayEvent(entry.event);
5775
+ if (!shouldReplaySseEvent(event, pendingQuestionIds)) continue;
5776
+ write({
5777
+ id: entry.seq,
5778
+ data: event
5779
+ });
5780
+ if (event && typeof event === "object" && event.type === "session_snapshot" && event.terminal === true) {
5781
+ cleanup();
5782
+ return;
5948
5783
  }
5949
- });
5950
- },
5951
- cancel() {
5952
- if (heartbeat) clearInterval(heartbeat);
5953
- removeListener?.();
5784
+ }
5785
+ pendingQuestionIds = null;
5786
+ };
5787
+ removeListener = bridge.addEventListener((sessionId) => {
5788
+ if (sessionId === channelId) flush();
5789
+ });
5790
+ write({ data: {
5791
+ type: "connected",
5792
+ sessionId: source.sessionId,
5793
+ adapterCapabilities: FLEET_ADAPTER_CAPABILITIES,
5794
+ ...source.streamGeneration ? { streamGeneration: source.streamGeneration } : {},
5795
+ ...source.cursorReset ? { cursorReset: true } : {},
5796
+ ...source.resumeAccepted ? { resumeAccepted: true } : {}
5797
+ } });
5798
+ if (source.includeSnapshot !== false && source.initialSnapshot) write({ data: source.initialSnapshot });
5799
+ readyToFlush = true;
5800
+ if (source.initialSnapshot?.terminal === true) {
5801
+ cleanup();
5802
+ return;
5954
5803
  }
5955
- });
5956
- return new Response(stream, { headers: {
5957
- "Content-Type": "text/event-stream; charset=utf-8",
5958
- "Cache-Control": "no-cache, no-store",
5959
- Connection: "keep-alive",
5960
- "X-Accel-Buffering": "no"
5961
- } });
5804
+ flush();
5805
+ if (closed || cleaned) return;
5806
+ heartbeat = setInterval(() => enqueue(": heartbeat\n\n"), 15e3);
5807
+ request.signal.addEventListener("abort", cleanup, { once: true });
5808
+ },
5809
+ cancel() {
5810
+ if (heartbeat) clearInterval(heartbeat);
5811
+ removeListener?.();
5812
+ releaseSource();
5813
+ cleaned = true;
5814
+ }
5815
+ });
5816
+ return new Response(stream, { headers: {
5817
+ "Content-Type": "text/event-stream; charset=utf-8",
5818
+ "Cache-Control": "no-cache, no-store",
5819
+ Connection: "keep-alive",
5820
+ "X-Accel-Buffering": "no"
5821
+ } });
5822
+ }
5823
+ function handleChatEventsGet(request) {
5824
+ return wrapApiHandler(async () => {
5825
+ const url = new URL(request.url);
5826
+ const sessionIdParam = url.searchParams.get("sessionId");
5827
+ const parentSessionIdParam = url.searchParams.get("parentSessionId");
5828
+ const childIdParam = url.searchParams.get("childId");
5829
+ const streamGenerationParam = url.searchParams.get("streamGeneration");
5830
+ if (parentSessionIdParam !== null || childIdParam !== null || streamGenerationParam !== null) {
5831
+ if (sessionIdParam || !parentSessionIdParam || !childIdParam) return Response.json({ message: "GET /api/chat/events requires both ?parentSessionId= and ?childId= for child streams" }, { status: 400 });
5832
+ const parentSessionId = SessionIdSchema.safeParse(parentSessionIdParam);
5833
+ const childId = SessionIdSchema.safeParse(childIdParam);
5834
+ if (!parentSessionId.success || !childId.success) return Response.json({ message: "Invalid subagent stream identifiers" }, { status: 400 });
5835
+ if (streamGenerationParam !== null && !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(streamGenerationParam)) return Response.json({ message: "Invalid child stream generation" }, { status: 400 });
5836
+ const childStream = await getBridge().openRlmChildStream(parentSessionId.data, childId.data, {
5837
+ ...streamGenerationParam ? { streamGeneration: streamGenerationParam } : {},
5838
+ lastEventId: lastEventIdFor(request, url)
5839
+ });
5840
+ if (!childStream) return Response.json({ message: "Unknown live subagent stream" }, { status: 404 });
5841
+ return createSseResponse(request, getBridge(), {
5842
+ sessionId: childStream.sessionId,
5843
+ channelId: childStream.channelId,
5844
+ streamGeneration: childStream.streamGeneration,
5845
+ resumeAccepted: childStream.resumeAccepted,
5846
+ cursorReset: childStream.cursorReset,
5847
+ replayFrom: childStream.replayFrom,
5848
+ includeSnapshot: childStream.includeSnapshot,
5849
+ initialSnapshot: childStream.snapshot,
5850
+ release: childStream.release
5851
+ }, lastEventIdFor(request, url));
5852
+ }
5853
+ if (!sessionIdParam) return Response.json({ message: "SSE requires ?sessionId=" }, { status: 400 });
5854
+ const sessionId = SessionIdSchema.safeParse(sessionIdParam);
5855
+ if (!sessionId.success) return Response.json({ message: "Invalid session identifier" }, { status: 400 });
5856
+ return createSseResponse(request, getBridge(), { sessionId: sessionId.data }, lastEventIdFor(request, url));
5962
5857
  });
5963
5858
  }
5964
5859
  var BodySchema$1 = external_exports.object({
@@ -6816,6 +6711,28 @@ var MODELS = {
6816
6711
  contextWindow: 1e6,
6817
6712
  maxTokens: 128e3
6818
6713
  },
6714
+ "anthropic.claude-fable-5-1": {
6715
+ id: "anthropic.claude-fable-5-1",
6716
+ name: "Claude Fable 5.1",
6717
+ api: "bedrock-converse-stream",
6718
+ provider: "amazon-bedrock",
6719
+ baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
6720
+ reasoning: true,
6721
+ thinkingLevelMap: {
6722
+ "off": null,
6723
+ "xhigh": "xhigh",
6724
+ "max": "max"
6725
+ },
6726
+ input: ["text", "image"],
6727
+ cost: {
6728
+ input: 10,
6729
+ output: 50,
6730
+ cacheRead: 0.25,
6731
+ cacheWrite: 12.5
6732
+ },
6733
+ contextWindow: 1e6,
6734
+ maxTokens: 128e3
6735
+ },
6819
6736
  "anthropic.claude-haiku-4-5-20251001-v1:0": {
6820
6737
  id: "anthropic.claude-haiku-4-5-20251001-v1:0",
6821
6738
  name: "Claude Haiku 4.5",
@@ -7403,6 +7320,28 @@ var MODELS = {
7403
7320
  contextWindow: 1e6,
7404
7321
  maxTokens: 128e3
7405
7322
  },
7323
+ "global.anthropic.claude-fable-5-1": {
7324
+ id: "global.anthropic.claude-fable-5-1",
7325
+ name: "Claude Fable 5.1 (Global)",
7326
+ api: "bedrock-converse-stream",
7327
+ provider: "amazon-bedrock",
7328
+ baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
7329
+ reasoning: true,
7330
+ thinkingLevelMap: {
7331
+ "off": null,
7332
+ "xhigh": "xhigh",
7333
+ "max": "max"
7334
+ },
7335
+ input: ["text", "image"],
7336
+ cost: {
7337
+ input: 10,
7338
+ output: 50,
7339
+ cacheRead: 0.25,
7340
+ cacheWrite: 12.5
7341
+ },
7342
+ contextWindow: 1e6,
7343
+ maxTokens: 128e3
7344
+ },
7406
7345
  "global.anthropic.claude-haiku-4-5-20251001-v1:0": {
7407
7346
  id: "global.anthropic.claude-haiku-4-5-20251001-v1:0",
7408
7347
  name: "Claude Haiku 4.5 (Global)",
@@ -7588,10 +7527,10 @@ var MODELS = {
7588
7527
  },
7589
7528
  input: ["text", "image"],
7590
7529
  cost: {
7591
- input: 0.22,
7592
- output: 1.32,
7593
- cacheRead: 0.022,
7594
- cacheWrite: 0.275
7530
+ input: 0.2,
7531
+ output: 1.2,
7532
+ cacheRead: 0.02,
7533
+ cacheWrite: 0.25
7595
7534
  },
7596
7535
  contextWindow: 105e4,
7597
7536
  maxTokens: 128e3
@@ -7610,10 +7549,10 @@ var MODELS = {
7610
7549
  },
7611
7550
  input: ["text", "image"],
7612
7551
  cost: {
7613
- input: 5.5,
7614
- output: 33,
7615
- cacheRead: 0.55,
7616
- cacheWrite: 6.875
7552
+ input: 4,
7553
+ output: 20,
7554
+ cacheRead: 0.4,
7555
+ cacheWrite: 5
7617
7556
  },
7618
7557
  contextWindow: 105e4,
7619
7558
  maxTokens: 128e3
@@ -7632,10 +7571,10 @@ var MODELS = {
7632
7571
  },
7633
7572
  input: ["text", "image"],
7634
7573
  cost: {
7635
- input: 2.2,
7636
- output: 13.2,
7637
- cacheRead: 0.22,
7638
- cacheWrite: 2.75
7574
+ input: 2,
7575
+ output: 12,
7576
+ cacheRead: 0.2,
7577
+ cacheWrite: 2.5
7639
7578
  },
7640
7579
  contextWindow: 105e4,
7641
7580
  maxTokens: 128e3
@@ -8273,10 +8212,10 @@ var MODELS = {
8273
8212
  },
8274
8213
  input: ["text", "image"],
8275
8214
  cost: {
8276
- input: 5.5,
8277
- output: 33,
8278
- cacheRead: 0.55,
8279
- cacheWrite: 6.875
8215
+ input: 4.4,
8216
+ output: 22,
8217
+ cacheRead: 0.44,
8218
+ cacheWrite: 5.5
8280
8219
  },
8281
8220
  contextWindow: 105e4,
8282
8221
  maxTokens: 128e3
@@ -8546,6 +8485,28 @@ var MODELS = {
8546
8485
  contextWindow: 1e6,
8547
8486
  maxTokens: 128e3
8548
8487
  },
8488
+ "us.anthropic.claude-fable-5-1": {
8489
+ id: "us.anthropic.claude-fable-5-1",
8490
+ name: "Claude Fable 5.1 (US)",
8491
+ api: "bedrock-converse-stream",
8492
+ provider: "amazon-bedrock",
8493
+ baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
8494
+ reasoning: true,
8495
+ thinkingLevelMap: {
8496
+ "off": null,
8497
+ "xhigh": "xhigh",
8498
+ "max": "max"
8499
+ },
8500
+ input: ["text", "image"],
8501
+ cost: {
8502
+ input: 11,
8503
+ output: 55,
8504
+ cacheRead: 0.275,
8505
+ cacheWrite: 13.75
8506
+ },
8507
+ contextWindow: 1e6,
8508
+ maxTokens: 128e3
8509
+ },
8549
8510
  "us.anthropic.claude-haiku-4-5-20251001-v1:0": {
8550
8511
  id: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
8551
8512
  name: "Claude Haiku 4.5 (US)",
@@ -8928,6 +8889,28 @@ var MODELS = {
8928
8889
  contextWindow: 1e6,
8929
8890
  maxTokens: 128e3
8930
8891
  },
8892
+ "claude-fable-5-1": {
8893
+ id: "claude-fable-5-1",
8894
+ name: "Claude Fable 5.1",
8895
+ api: "anthropic-messages",
8896
+ provider: "anthropic",
8897
+ baseUrl: "https://api.anthropic.com",
8898
+ reasoning: true,
8899
+ thinkingLevelMap: {
8900
+ "off": null,
8901
+ "xhigh": "xhigh",
8902
+ "max": "max"
8903
+ },
8904
+ input: ["text", "image"],
8905
+ cost: {
8906
+ input: 10,
8907
+ output: 50,
8908
+ cacheRead: 0.25,
8909
+ cacheWrite: 12.5
8910
+ },
8911
+ contextWindow: 1e6,
8912
+ maxTokens: 128e3
8913
+ },
8931
8914
  "claude-haiku-4-5": {
8932
8915
  id: "claude-haiku-4-5",
8933
8916
  name: "Claude Haiku 4.5 (latest)",
@@ -10876,6 +10859,42 @@ var MODELS = {
10876
10859
  },
10877
10860
  contextWindow: 262144,
10878
10861
  maxTokens: 256e3
10862
+ },
10863
+ "@cf/zai-org/glm-5.3": {
10864
+ id: "@cf/zai-org/glm-5.3",
10865
+ name: "Glm 5.3",
10866
+ api: "openai-completions",
10867
+ provider: "cloudflare-workers-ai",
10868
+ baseUrl: "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",
10869
+ compat: { "sendSessionAffinityHeaders": true },
10870
+ reasoning: true,
10871
+ input: ["text"],
10872
+ cost: {
10873
+ input: 1.4,
10874
+ output: 4.4,
10875
+ cacheRead: 0.26,
10876
+ cacheWrite: 0
10877
+ },
10878
+ contextWindow: 1310720,
10879
+ maxTokens: 1310720
10880
+ },
10881
+ "@cf/zai-org/glm-5.3-flash": {
10882
+ id: "@cf/zai-org/glm-5.3-flash",
10883
+ name: "Glm 5.3 Flash",
10884
+ api: "openai-completions",
10885
+ provider: "cloudflare-workers-ai",
10886
+ baseUrl: "https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",
10887
+ compat: { "sendSessionAffinityHeaders": true },
10888
+ reasoning: true,
10889
+ input: ["text", "image"],
10890
+ cost: {
10891
+ input: 0.15,
10892
+ output: 0.5,
10893
+ cacheRead: 0.03,
10894
+ cacheWrite: 0
10895
+ },
10896
+ contextWindow: 1310720,
10897
+ maxTokens: 1048576
10879
10898
  }
10880
10899
  },
10881
10900
  "deepseek": {
@@ -10939,23 +10958,6 @@ var MODELS = {
10939
10958
  }
10940
10959
  },
10941
10960
  "fireworks": {
10942
- "accounts/fireworks/models/deepseek-v4-flash": {
10943
- id: "accounts/fireworks/models/deepseek-v4-flash",
10944
- name: "DeepSeek V4 Flash",
10945
- api: "anthropic-messages",
10946
- provider: "fireworks",
10947
- baseUrl: "https://api.fireworks.ai/inference",
10948
- reasoning: true,
10949
- input: ["text"],
10950
- cost: {
10951
- input: 0.14,
10952
- output: 0.28,
10953
- cacheRead: 0.028,
10954
- cacheWrite: 0
10955
- },
10956
- contextWindow: 1e6,
10957
- maxTokens: 384e3
10958
- },
10959
10961
  "accounts/fireworks/models/deepseek-v4-flash-0731": {
10960
10962
  id: "accounts/fireworks/models/deepseek-v4-flash-0731",
10961
10963
  name: "DeepSeek V4 Flash 0731",
@@ -10973,23 +10975,6 @@ var MODELS = {
10973
10975
  contextWindow: 1e6,
10974
10976
  maxTokens: 384e3
10975
10977
  },
10976
- "accounts/fireworks/models/deepseek-v4-pro": {
10977
- id: "accounts/fireworks/models/deepseek-v4-pro",
10978
- name: "DeepSeek V4 Pro",
10979
- api: "anthropic-messages",
10980
- provider: "fireworks",
10981
- baseUrl: "https://api.fireworks.ai/inference",
10982
- reasoning: true,
10983
- input: ["text"],
10984
- cost: {
10985
- input: 1.74,
10986
- output: 3.48,
10987
- cacheRead: 0.145,
10988
- cacheWrite: 0
10989
- },
10990
- contextWindow: 1e6,
10991
- maxTokens: 384e3
10992
- },
10993
10978
  "accounts/fireworks/models/deepseek-v4-pro-0813": {
10994
10979
  id: "accounts/fireworks/models/deepseek-v4-pro-0813",
10995
10980
  name: "DeepSeek V4 Pro 0813",
@@ -11024,35 +11009,52 @@ var MODELS = {
11024
11009
  contextWindow: 1048575,
11025
11010
  maxTokens: 131072
11026
11011
  },
11027
- "accounts/fireworks/models/gpt-oss-120b": {
11028
- id: "accounts/fireworks/models/gpt-oss-120b",
11029
- name: "GPT OSS 120B",
11012
+ "accounts/fireworks/models/glm-5p3": {
11013
+ id: "accounts/fireworks/models/glm-5p3",
11014
+ name: "GLM 5.3",
11030
11015
  api: "anthropic-messages",
11031
11016
  provider: "fireworks",
11032
11017
  baseUrl: "https://api.fireworks.ai/inference",
11033
11018
  reasoning: true,
11034
11019
  input: ["text"],
11020
+ cost: {
11021
+ input: 1.4,
11022
+ output: 4.4,
11023
+ cacheRead: 0.26,
11024
+ cacheWrite: 0
11025
+ },
11026
+ contextWindow: 1e6,
11027
+ maxTokens: 131072
11028
+ },
11029
+ "accounts/fireworks/models/glm-5p3-flash": {
11030
+ id: "accounts/fireworks/models/glm-5p3-flash",
11031
+ name: "GLM 5.3 Flash",
11032
+ api: "anthropic-messages",
11033
+ provider: "fireworks",
11034
+ baseUrl: "https://api.fireworks.ai/inference",
11035
+ reasoning: true,
11036
+ input: ["text", "image"],
11035
11037
  cost: {
11036
11038
  input: 0.15,
11037
- output: 0.6,
11038
- cacheRead: 0.015,
11039
+ output: 0.5,
11040
+ cacheRead: 0.029,
11039
11041
  cacheWrite: 0
11040
11042
  },
11041
- contextWindow: 131072,
11042
- maxTokens: 32768
11043
+ contextWindow: 1e6,
11044
+ maxTokens: 131072
11043
11045
  },
11044
- "accounts/fireworks/models/gpt-oss-20b": {
11045
- id: "accounts/fireworks/models/gpt-oss-20b",
11046
- name: "GPT OSS 20B",
11046
+ "accounts/fireworks/models/gpt-oss-120b": {
11047
+ id: "accounts/fireworks/models/gpt-oss-120b",
11048
+ name: "GPT OSS 120B",
11047
11049
  api: "anthropic-messages",
11048
11050
  provider: "fireworks",
11049
11051
  baseUrl: "https://api.fireworks.ai/inference",
11050
11052
  reasoning: true,
11051
11053
  input: ["text"],
11052
11054
  cost: {
11053
- input: 0.07,
11054
- output: 0.3,
11055
- cacheRead: 0.035,
11055
+ input: 0.15,
11056
+ output: 0.6,
11057
+ cacheRead: 0.015,
11056
11058
  cacheWrite: 0
11057
11059
  },
11058
11060
  contextWindow: 131072,
@@ -11135,23 +11137,6 @@ var MODELS = {
11135
11137
  contextWindow: 1048576,
11136
11138
  maxTokens: 131072
11137
11139
  },
11138
- "accounts/fireworks/models/minimax-m2p7": {
11139
- id: "accounts/fireworks/models/minimax-m2p7",
11140
- name: "MiniMax-M2.7",
11141
- api: "anthropic-messages",
11142
- provider: "fireworks",
11143
- baseUrl: "https://api.fireworks.ai/inference",
11144
- reasoning: true,
11145
- input: ["text"],
11146
- cost: {
11147
- input: 0.3,
11148
- output: 1.2,
11149
- cacheRead: 0.06,
11150
- cacheWrite: 0
11151
- },
11152
- contextWindow: 196608,
11153
- maxTokens: 196608
11154
- },
11155
11140
  "accounts/fireworks/models/minimax-m3": {
11156
11141
  id: "accounts/fireworks/models/minimax-m3",
11157
11142
  name: "MiniMax-M3",
@@ -11271,57 +11256,6 @@ var MODELS = {
11271
11256
  contextWindow: 1048575,
11272
11257
  maxTokens: 131072
11273
11258
  },
11274
- "accounts/fireworks/routers/kimi-k2p6-fast": {
11275
- id: "accounts/fireworks/routers/kimi-k2p6-fast",
11276
- name: "Kimi K2.6 Fast",
11277
- api: "anthropic-messages",
11278
- provider: "fireworks",
11279
- baseUrl: "https://api.fireworks.ai/inference",
11280
- reasoning: true,
11281
- input: ["text", "image"],
11282
- cost: {
11283
- input: 2,
11284
- output: 8,
11285
- cacheRead: 0.3,
11286
- cacheWrite: 0
11287
- },
11288
- contextWindow: 262e3,
11289
- maxTokens: 262e3
11290
- },
11291
- "accounts/fireworks/routers/kimi-k2p6-turbo": {
11292
- id: "accounts/fireworks/routers/kimi-k2p6-turbo",
11293
- name: "Kimi K2.6 Turbo",
11294
- api: "anthropic-messages",
11295
- provider: "fireworks",
11296
- baseUrl: "https://api.fireworks.ai/inference",
11297
- reasoning: true,
11298
- input: ["text", "image"],
11299
- cost: {
11300
- input: 2,
11301
- output: 8,
11302
- cacheRead: 0.3,
11303
- cacheWrite: 0
11304
- },
11305
- contextWindow: 262e3,
11306
- maxTokens: 262e3
11307
- },
11308
- "accounts/fireworks/routers/kimi-k2p7-code-fast": {
11309
- id: "accounts/fireworks/routers/kimi-k2p7-code-fast",
11310
- name: "Kimi K2.7 Code Fast",
11311
- api: "anthropic-messages",
11312
- provider: "fireworks",
11313
- baseUrl: "https://api.fireworks.ai/inference",
11314
- reasoning: true,
11315
- input: ["text", "image"],
11316
- cost: {
11317
- input: 1.9,
11318
- output: 8,
11319
- cacheRead: 0.38,
11320
- cacheWrite: 0
11321
- },
11322
- contextWindow: 262e3,
11323
- maxTokens: 262e3
11324
- },
11325
11259
  "accounts/fireworks/routers/kimi-k3-fast": {
11326
11260
  id: "accounts/fireworks/routers/kimi-k3-fast",
11327
11261
  name: "Kimi K3 Fast",
@@ -11705,9 +11639,9 @@ var MODELS = {
11705
11639
  reasoning: true,
11706
11640
  input: ["text", "image"],
11707
11641
  cost: {
11708
- input: 1.5,
11709
- output: 7.5,
11710
- cacheRead: 0.15,
11642
+ input: 0.75,
11643
+ output: 3.75,
11644
+ cacheRead: 0.075,
11711
11645
  cacheWrite: 0
11712
11646
  },
11713
11647
  contextWindow: 1e6,
@@ -12006,7 +11940,7 @@ var MODELS = {
12006
11940
  input: 0.2,
12007
11941
  output: 1.2,
12008
11942
  cacheRead: 0.02,
12009
- cacheWrite: 0
11943
+ cacheWrite: 0.25
12010
11944
  },
12011
11945
  contextWindow: 105e4,
12012
11946
  maxTokens: 128e3
@@ -12032,10 +11966,10 @@ var MODELS = {
12032
11966
  },
12033
11967
  input: ["text", "image"],
12034
11968
  cost: {
12035
- input: 2.5,
12036
- output: 15,
12037
- cacheRead: 0.25,
12038
- cacheWrite: 3.125
11969
+ input: 2,
11970
+ output: 10,
11971
+ cacheRead: 0.2,
11972
+ cacheWrite: 2.5
12039
11973
  },
12040
11974
  contextWindow: 105e4,
12041
11975
  maxTokens: 128e3
@@ -12064,7 +11998,7 @@ var MODELS = {
12064
11998
  input: 2,
12065
11999
  output: 12,
12066
12000
  cacheRead: 0.2,
12067
- cacheWrite: 0
12001
+ cacheWrite: 2.5
12068
12002
  },
12069
12003
  contextWindow: 105e4,
12070
12004
  maxTokens: 128e3
@@ -12507,23 +12441,6 @@ var MODELS = {
12507
12441
  contextWindow: 1048576,
12508
12442
  maxTokens: 65536
12509
12443
  },
12510
- "gemini-robotics-er-1.6-preview": {
12511
- id: "gemini-robotics-er-1.6-preview",
12512
- name: "Gemini Robotics-ER 1.6 Preview",
12513
- api: "google-generative-ai",
12514
- provider: "google",
12515
- baseUrl: "https://generativelanguage.googleapis.com/v1beta",
12516
- reasoning: true,
12517
- input: ["text", "image"],
12518
- cost: {
12519
- input: 1,
12520
- output: 5,
12521
- cacheRead: 0,
12522
- cacheWrite: 0
12523
- },
12524
- contextWindow: 131072,
12525
- maxTokens: 65536
12526
- },
12527
12444
  "gemma-4-26b-a4b-it": {
12528
12445
  id: "gemma-4-26b-a4b-it",
12529
12446
  name: "Gemma 4 26B A4B IT",
@@ -12920,6 +12837,23 @@ var MODELS = {
12920
12837
  },
12921
12838
  contextWindow: 131072,
12922
12839
  maxTokens: 16384
12840
+ },
12841
+ "qwen/qwen3.8-27b": {
12842
+ id: "qwen/qwen3.8-27b",
12843
+ name: "Qwen3.8 27B",
12844
+ api: "openai-completions",
12845
+ provider: "groq",
12846
+ baseUrl: "https://api.groq.com/openai/v1",
12847
+ reasoning: true,
12848
+ input: ["text", "image"],
12849
+ cost: {
12850
+ input: 0.8,
12851
+ output: 4,
12852
+ cacheRead: 0,
12853
+ cacheWrite: 0
12854
+ },
12855
+ contextWindow: 131042,
12856
+ maxTokens: 16384
12923
12857
  }
12924
12858
  },
12925
12859
  "huggingface": {
@@ -12939,7 +12873,7 @@ var MODELS = {
12939
12873
  cacheWrite: 0
12940
12874
  },
12941
12875
  contextWindow: 204800,
12942
- maxTokens: 128e3
12876
+ maxTokens: 131072
12943
12877
  },
12944
12878
  "MiniMaxAI/MiniMax-M2.1": {
12945
12879
  id: "MiniMaxAI/MiniMax-M2.1",
@@ -13011,7 +12945,7 @@ var MODELS = {
13011
12945
  cacheWrite: 0
13012
12946
  },
13013
12947
  contextWindow: 524288,
13014
- maxTokens: 128e3
12948
+ maxTokens: 512e3
13015
12949
  },
13016
12950
  "Qwen/Qwen2.5-Coder-32B-Instruct": {
13017
12951
  id: "Qwen/Qwen2.5-Coder-32B-Instruct",
@@ -14155,6 +14089,42 @@ var MODELS = {
14155
14089
  },
14156
14090
  contextWindow: 262144,
14157
14091
  maxTokens: 131072
14092
+ },
14093
+ "zai-org/GLM-5.3": {
14094
+ id: "zai-org/GLM-5.3",
14095
+ name: "GLM-5.3",
14096
+ api: "openai-completions",
14097
+ provider: "huggingface",
14098
+ baseUrl: "https://router.huggingface.co/v1",
14099
+ compat: { "supportsDeveloperRole": false },
14100
+ reasoning: true,
14101
+ input: ["text"],
14102
+ cost: {
14103
+ input: 1.4,
14104
+ output: 4.4,
14105
+ cacheRead: 0,
14106
+ cacheWrite: 0
14107
+ },
14108
+ contextWindow: 1048576,
14109
+ maxTokens: 131072
14110
+ },
14111
+ "zai-org/GLM-5.3-Flash": {
14112
+ id: "zai-org/GLM-5.3-Flash",
14113
+ name: "GLM-5.3-Flash",
14114
+ api: "openai-completions",
14115
+ provider: "huggingface",
14116
+ baseUrl: "https://router.huggingface.co/v1",
14117
+ compat: { "supportsDeveloperRole": false },
14118
+ reasoning: true,
14119
+ input: ["text", "image"],
14120
+ cost: {
14121
+ input: 0.15,
14122
+ output: 0.5,
14123
+ cacheRead: 0,
14124
+ cacheWrite: 0
14125
+ },
14126
+ contextWindow: 1048576,
14127
+ maxTokens: 131072
14158
14128
  }
14159
14129
  },
14160
14130
  "kimi-coding": {
@@ -14848,6 +14818,23 @@ var MODELS = {
14848
14818
  },
14849
14819
  contextWindow: 32e3,
14850
14820
  maxTokens: 32e3
14821
+ },
14822
+ "zai-glm-5-2": {
14823
+ id: "zai-glm-5-2",
14824
+ name: "GLM-5.2",
14825
+ api: "mistral-conversations",
14826
+ provider: "mistral",
14827
+ baseUrl: "https://api.mistral.ai",
14828
+ reasoning: true,
14829
+ input: ["text"],
14830
+ cost: {
14831
+ input: 1.4,
14832
+ output: 4.4,
14833
+ cacheRead: 0.14,
14834
+ cacheWrite: 0
14835
+ },
14836
+ contextWindow: 1e6,
14837
+ maxTokens: 131072
14851
14838
  }
14852
14839
  },
14853
14840
  "moonshotai": {
@@ -16443,6 +16430,28 @@ var MODELS = {
16443
16430
  contextWindow: 1e6,
16444
16431
  maxTokens: 128e3
16445
16432
  },
16433
+ "claude-fable-5-1": {
16434
+ id: "claude-fable-5-1",
16435
+ name: "Claude Fable 5.1",
16436
+ api: "anthropic-messages",
16437
+ provider: "opencode",
16438
+ baseUrl: "https://opencode.ai/zen",
16439
+ reasoning: true,
16440
+ thinkingLevelMap: {
16441
+ "off": null,
16442
+ "xhigh": "xhigh",
16443
+ "max": "max"
16444
+ },
16445
+ input: ["text", "image"],
16446
+ cost: {
16447
+ input: 10,
16448
+ output: 50,
16449
+ cacheRead: 0.25,
16450
+ cacheWrite: 12.5
16451
+ },
16452
+ contextWindow: 1e6,
16453
+ maxTokens: 128e3
16454
+ },
16446
16455
  "claude-haiku-4-5": {
16447
16456
  id: "claude-haiku-4-5",
16448
16457
  name: "Claude Haiku 4.5",
@@ -17289,23 +17298,6 @@ var MODELS = {
17289
17298
  contextWindow: 256e3,
17290
17299
  maxTokens: 256e3
17291
17300
  },
17292
- "hy3-free": {
17293
- id: "hy3-free",
17294
- name: "Hy3 Free",
17295
- api: "openai-completions",
17296
- provider: "opencode",
17297
- baseUrl: "https://opencode.ai/zen/v1",
17298
- reasoning: true,
17299
- input: ["text"],
17300
- cost: {
17301
- input: 0,
17302
- output: 0,
17303
- cacheRead: 0,
17304
- cacheWrite: 0
17305
- },
17306
- contextWindow: 19e4,
17307
- maxTokens: 64e3
17308
- },
17309
17301
  "kimi-k2.5": {
17310
17302
  id: "kimi-k2.5",
17311
17303
  name: "Kimi K2.5",
@@ -17383,6 +17375,23 @@ var MODELS = {
17383
17375
  contextWindow: 1048576,
17384
17376
  maxTokens: 131072
17385
17377
  },
17378
+ "ling-3.0-flash-fin-free": {
17379
+ id: "ling-3.0-flash-fin-free",
17380
+ name: "Ling 3.0 Flash Fin Free",
17381
+ api: "openai-completions",
17382
+ provider: "opencode",
17383
+ baseUrl: "https://opencode.ai/zen/v1",
17384
+ reasoning: true,
17385
+ input: ["text"],
17386
+ cost: {
17387
+ input: 0,
17388
+ output: 0,
17389
+ cacheRead: 0,
17390
+ cacheWrite: 0
17391
+ },
17392
+ contextWindow: 262144,
17393
+ maxTokens: 32768
17394
+ },
17386
17395
  "mimo-v2.5-free": {
17387
17396
  id: "mimo-v2.5-free",
17388
17397
  name: "MiMo V2.5 Free",
@@ -17552,23 +17561,6 @@ var MODELS = {
17552
17561
  },
17553
17562
  contextWindow: 262144,
17554
17563
  maxTokens: 65536
17555
- },
17556
- "x-preview-f-free": {
17557
- id: "x-preview-f-free",
17558
- name: "Ox Alpha Free (Unlimited)",
17559
- api: "openai-completions",
17560
- provider: "opencode",
17561
- baseUrl: "https://opencode.ai/zen/v1",
17562
- reasoning: true,
17563
- input: ["text", "image"],
17564
- cost: {
17565
- input: 0,
17566
- output: 0,
17567
- cacheRead: 0,
17568
- cacheWrite: 0
17569
- },
17570
- contextWindow: 1e6,
17571
- maxTokens: 131072
17572
17564
  }
17573
17565
  },
17574
17566
  "opencode-go": {
@@ -17710,6 +17702,23 @@ var MODELS = {
17710
17702
  contextWindow: 1e6,
17711
17703
  maxTokens: 131072
17712
17704
  },
17705
+ "glm-5.3-flash": {
17706
+ id: "glm-5.3-flash",
17707
+ name: "GLM-5.3-Flash (2x usage)",
17708
+ api: "openai-completions",
17709
+ provider: "opencode-go",
17710
+ baseUrl: "https://opencode.ai/zen/go/v1",
17711
+ reasoning: true,
17712
+ input: ["text", "image"],
17713
+ cost: {
17714
+ input: 0.075,
17715
+ output: 0.25,
17716
+ cacheRead: 0.015,
17717
+ cacheWrite: 0
17718
+ },
17719
+ contextWindow: 1e6,
17720
+ maxTokens: 131072
17721
+ },
17713
17722
  "gpt-5.6-luna": {
17714
17723
  id: "gpt-5.6-luna",
17715
17724
  name: "GPT-5.6 Luna",
@@ -17752,21 +17761,38 @@ var MODELS = {
17752
17761
  },
17753
17762
  "hy3": {
17754
17763
  id: "hy3",
17755
- name: "Hy3 (8x usage)",
17764
+ name: "Hy3",
17756
17765
  api: "openai-completions",
17757
17766
  provider: "opencode-go",
17758
17767
  baseUrl: "https://opencode.ai/zen/go/v1",
17759
17768
  reasoning: true,
17760
17769
  input: ["text"],
17761
17770
  cost: {
17762
- input: 0.0175,
17763
- output: 0.0725,
17764
- cacheRead: 4375e-6,
17771
+ input: 0.14,
17772
+ output: 0.58,
17773
+ cacheRead: 0.035,
17765
17774
  cacheWrite: 0
17766
17775
  },
17767
17776
  contextWindow: 256e3,
17768
17777
  maxTokens: 64e3
17769
17778
  },
17779
+ "hy4-preview": {
17780
+ id: "hy4-preview",
17781
+ name: "Hy4 preview",
17782
+ api: "openai-completions",
17783
+ provider: "opencode-go",
17784
+ baseUrl: "https://opencode.ai/zen/go/v1",
17785
+ reasoning: true,
17786
+ input: ["text"],
17787
+ cost: {
17788
+ input: 0.834,
17789
+ output: 2.501,
17790
+ cacheRead: 0.042,
17791
+ cacheWrite: 0
17792
+ },
17793
+ contextWindow: 1024e3,
17794
+ maxTokens: 64e3
17795
+ },
17770
17796
  "kimi-k2.6": {
17771
17797
  id: "kimi-k2.6",
17772
17798
  name: "Kimi K2.6",
@@ -17929,23 +17955,6 @@ var MODELS = {
17929
17955
  contextWindow: 1048576,
17930
17956
  maxTokens: 131072
17931
17957
  },
17932
- "ox-alpha-free": {
17933
- id: "ox-alpha-free",
17934
- name: "Ox Alpha Free (Unlimited)",
17935
- api: "openai-completions",
17936
- provider: "opencode-go",
17937
- baseUrl: "https://opencode.ai/zen/go/v1",
17938
- reasoning: true,
17939
- input: ["text", "image"],
17940
- cost: {
17941
- input: 0,
17942
- output: 0,
17943
- cacheRead: 0,
17944
- cacheWrite: 0
17945
- },
17946
- contextWindow: 1e6,
17947
- maxTokens: 131072
17948
- },
17949
17958
  "qwen3.6-plus": {
17950
17959
  id: "qwen3.6-plus",
17951
17960
  name: "Qwen3.6 Plus",
@@ -17998,6 +18007,23 @@ var MODELS = {
17998
18007
  contextWindow: 1e6,
17999
18008
  maxTokens: 65536
18000
18009
  },
18010
+ "qwen3.8-flash": {
18011
+ id: "qwen3.8-flash",
18012
+ name: "Qwen3.8 Flash",
18013
+ api: "openai-completions",
18014
+ provider: "opencode-go",
18015
+ baseUrl: "https://opencode.ai/zen/go/v1",
18016
+ reasoning: true,
18017
+ input: ["text", "image"],
18018
+ cost: {
18019
+ input: 0.15,
18020
+ output: 0.47,
18021
+ cacheRead: 0.016,
18022
+ cacheWrite: 0.2
18023
+ },
18024
+ contextWindow: 1e6,
18025
+ maxTokens: 131072
18026
+ },
18001
18027
  "qwen3.8-max": {
18002
18028
  id: "qwen3.8-max",
18003
18029
  name: "Qwen3.8 Max",
@@ -18235,6 +18261,32 @@ var MODELS = {
18235
18261
  contextWindow: 1e6,
18236
18262
  maxTokens: 128e3
18237
18263
  },
18264
+ "anthropic/claude-fable-5.1": {
18265
+ id: "anthropic/claude-fable-5.1",
18266
+ name: "Anthropic: Claude Fable 5.1",
18267
+ api: "openai-completions",
18268
+ provider: "openrouter",
18269
+ baseUrl: "https://openrouter.ai/api/v1",
18270
+ reasoning: true,
18271
+ thinkingLevelMap: {
18272
+ "off": null,
18273
+ "minimal": null,
18274
+ "low": "low",
18275
+ "medium": "medium",
18276
+ "high": "high",
18277
+ "xhigh": "xhigh",
18278
+ "max": "max"
18279
+ },
18280
+ input: ["text", "image"],
18281
+ cost: {
18282
+ input: 0,
18283
+ output: 0,
18284
+ cacheRead: 0,
18285
+ cacheWrite: 0
18286
+ },
18287
+ contextWindow: 1e6,
18288
+ maxTokens: 128e3
18289
+ },
18238
18290
  "anthropic/claude-haiku-4.5": {
18239
18291
  id: "anthropic/claude-haiku-4.5",
18240
18292
  name: "Anthropic: Claude Haiku 4.5",
@@ -18389,31 +18441,6 @@ var MODELS = {
18389
18441
  contextWindow: 1e6,
18390
18442
  maxTokens: 128e3
18391
18443
  },
18392
- "anthropic/claude-opus-4.7-fast": {
18393
- id: "anthropic/claude-opus-4.7-fast",
18394
- name: "Anthropic: Claude Opus 4.7 (Fast)",
18395
- api: "openai-completions",
18396
- provider: "openrouter",
18397
- baseUrl: "https://openrouter.ai/api/v1",
18398
- reasoning: true,
18399
- thinkingLevelMap: {
18400
- "minimal": null,
18401
- "low": "low",
18402
- "medium": "medium",
18403
- "high": "high",
18404
- "xhigh": "xhigh",
18405
- "max": "max"
18406
- },
18407
- input: ["text", "image"],
18408
- cost: {
18409
- input: 30,
18410
- output: 150,
18411
- cacheRead: 3,
18412
- cacheWrite: 37.5
18413
- },
18414
- contextWindow: 1e6,
18415
- maxTokens: 128e3
18416
- },
18417
18444
  "anthropic/claude-opus-4.8": {
18418
18445
  id: "anthropic/claude-opus-4.8",
18419
18446
  name: "Anthropic: Claude Opus 4.8",
@@ -18439,31 +18466,6 @@ var MODELS = {
18439
18466
  contextWindow: 1e6,
18440
18467
  maxTokens: 128e3
18441
18468
  },
18442
- "anthropic/claude-opus-4.8-fast": {
18443
- id: "anthropic/claude-opus-4.8-fast",
18444
- name: "Anthropic: Claude Opus 4.8 (Fast)",
18445
- api: "openai-completions",
18446
- provider: "openrouter",
18447
- baseUrl: "https://openrouter.ai/api/v1",
18448
- reasoning: true,
18449
- thinkingLevelMap: {
18450
- "minimal": null,
18451
- "low": "low",
18452
- "medium": "medium",
18453
- "high": "high",
18454
- "xhigh": "xhigh",
18455
- "max": "max"
18456
- },
18457
- input: ["text", "image"],
18458
- cost: {
18459
- input: 10,
18460
- output: 50,
18461
- cacheRead: 1,
18462
- cacheWrite: 12.5
18463
- },
18464
- contextWindow: 1e6,
18465
- maxTokens: 128e3
18466
- },
18467
18469
  "anthropic/claude-opus-5": {
18468
18470
  id: "anthropic/claude-opus-5",
18469
18471
  name: "Claude Opus 5",
@@ -18489,31 +18491,6 @@ var MODELS = {
18489
18491
  contextWindow: 1e6,
18490
18492
  maxTokens: 128e3
18491
18493
  },
18492
- "anthropic/claude-opus-5-fast": {
18493
- id: "anthropic/claude-opus-5-fast",
18494
- name: "Claude Opus 5 (Fast)",
18495
- api: "openai-completions",
18496
- provider: "openrouter",
18497
- baseUrl: "https://openrouter.ai/api/v1",
18498
- reasoning: true,
18499
- thinkingLevelMap: {
18500
- "minimal": null,
18501
- "low": "low",
18502
- "medium": "medium",
18503
- "high": "high",
18504
- "xhigh": "xhigh",
18505
- "max": "max"
18506
- },
18507
- input: ["text", "image"],
18508
- cost: {
18509
- input: 10,
18510
- output: 50,
18511
- cacheRead: 1,
18512
- cacheWrite: 12.5
18513
- },
18514
- contextWindow: 1e6,
18515
- maxTokens: 128e3
18516
- },
18517
18494
  "anthropic/claude-sonnet-4": {
18518
18495
  id: "anthropic/claude-sonnet-4",
18519
18496
  name: "Anthropic: Claude Sonnet 4",
@@ -18635,30 +18612,13 @@ var MODELS = {
18635
18612
  },
18636
18613
  input: ["text"],
18637
18614
  cost: {
18638
- input: 0.22,
18639
- output: 0.85,
18615
+ input: 0.25,
18616
+ output: 0.7999999999999999,
18640
18617
  cacheRead: 0.06,
18641
18618
  cacheWrite: 0
18642
18619
  },
18643
18620
  contextWindow: 262144,
18644
- maxTokens: 235929
18645
- },
18646
- "arcee-ai/virtuoso-large": {
18647
- id: "arcee-ai/virtuoso-large",
18648
- name: "Arcee AI: Virtuoso Large",
18649
- api: "openai-completions",
18650
- provider: "openrouter",
18651
- baseUrl: "https://openrouter.ai/api/v1",
18652
- reasoning: false,
18653
- input: ["text"],
18654
- cost: {
18655
- input: 0.75,
18656
- output: 1.2,
18657
- cacheRead: 0,
18658
- cacheWrite: 0
18659
- },
18660
- contextWindow: 131072,
18661
- maxTokens: 64e3
18621
+ maxTokens: 8e4
18662
18622
  },
18663
18623
  "auto": {
18664
18624
  id: "auto",
@@ -19048,13 +19008,13 @@ var MODELS = {
19048
19008
  },
19049
19009
  input: ["text"],
19050
19010
  cost: {
19051
- input: 0.26,
19052
- output: 0.38,
19053
- cacheRead: 0.13,
19011
+ input: 0.26899999999999996,
19012
+ output: 0.39999999999999997,
19013
+ cacheRead: 0.13449999999999998,
19054
19014
  cacheWrite: 0
19055
19015
  },
19056
19016
  contextWindow: 163840,
19057
- maxTokens: 147456
19017
+ maxTokens: 65536
19058
19018
  },
19059
19019
  "deepseek/deepseek-v3.2-exp": {
19060
19020
  id: "deepseek/deepseek-v3.2-exp",
@@ -19103,9 +19063,9 @@ var MODELS = {
19103
19063
  },
19104
19064
  input: ["text"],
19105
19065
  cost: {
19106
- input: 0.088606,
19107
- output: 0.177212,
19108
- cacheRead: 0.017721200000000003,
19066
+ input: 0.07476000000000001,
19067
+ output: 0.14952000000000001,
19068
+ cacheRead: 0.014952,
19109
19069
  cacheWrite: 0
19110
19070
  },
19111
19071
  contextWindow: 1048576,
@@ -19132,9 +19092,9 @@ var MODELS = {
19132
19092
  },
19133
19093
  input: ["text"],
19134
19094
  cost: {
19135
- input: 0.06,
19136
- output: 0.12,
19137
- cacheRead: 0.012,
19095
+ input: 0.065,
19096
+ output: 0.18,
19097
+ cacheRead: 0.016,
19138
19098
  cacheWrite: 0
19139
19099
  },
19140
19100
  contextWindow: 1310720,
@@ -19190,13 +19150,13 @@ var MODELS = {
19190
19150
  },
19191
19151
  input: ["text"],
19192
19152
  cost: {
19193
- input: 0.87,
19194
- output: 1.74,
19195
- cacheRead: 0.0725,
19153
+ input: 1.5999999999999999,
19154
+ output: 3.1999999999999997,
19155
+ cacheRead: 0.135,
19196
19156
  cacheWrite: 0
19197
19157
  },
19198
19158
  contextWindow: 1048576,
19199
- maxTokens: 384e3
19159
+ maxTokens: 393216
19200
19160
  },
19201
19161
  "deepseek/deepseek-v4-pro-0813": {
19202
19162
  id: "deepseek/deepseek-v4-pro-0813",
@@ -19219,13 +19179,13 @@ var MODELS = {
19219
19179
  },
19220
19180
  input: ["text"],
19221
19181
  cost: {
19222
- input: 1.122,
19223
- output: 3.366,
19224
- cacheRead: 0.037399999999999996,
19182
+ input: 0.66,
19183
+ output: 1.9800000000000002,
19184
+ cacheRead: 0.022,
19225
19185
  cacheWrite: 0
19226
19186
  },
19227
19187
  contextWindow: 1048576,
19228
- maxTokens: 943717
19188
+ maxTokens: 384e3
19229
19189
  },
19230
19190
  "dots-studio/dots-3-note-preview:free": {
19231
19191
  id: "dots-studio/dots-3-note-preview:free",
@@ -19636,10 +19596,10 @@ var MODELS = {
19636
19596
  },
19637
19597
  input: ["text", "image"],
19638
19598
  cost: {
19639
- input: 0.375,
19640
- output: 1.875,
19641
- cacheRead: 0.0375,
19642
- cacheWrite: 0.0208333333333333
19599
+ input: 0.75,
19600
+ output: 3.75,
19601
+ cacheRead: 0.075,
19602
+ cacheWrite: 0.0416666666666667
19643
19603
  },
19644
19604
  contextWindow: 1048576,
19645
19605
  maxTokens: 65536
@@ -19675,7 +19635,7 @@ var MODELS = {
19675
19635
  cacheRead: 0.04,
19676
19636
  cacheWrite: 0
19677
19637
  },
19678
- contextWindow: 262144,
19638
+ contextWindow: 131072,
19679
19639
  maxTokens: 117964
19680
19640
  },
19681
19641
  "google/gemma-4-26b-a4b-it": {
@@ -19799,6 +19759,31 @@ var MODELS = {
19799
19759
  contextWindow: 131072,
19800
19760
  maxTokens: 117964
19801
19761
  },
19762
+ "ibm-granite/granite-4.2-8b": {
19763
+ id: "ibm-granite/granite-4.2-8b",
19764
+ name: "IBM: Granite 4.2 8B",
19765
+ api: "openai-completions",
19766
+ provider: "openrouter",
19767
+ baseUrl: "https://openrouter.ai/api/v1",
19768
+ reasoning: true,
19769
+ thinkingLevelMap: {
19770
+ "minimal": null,
19771
+ "low": "low",
19772
+ "medium": null,
19773
+ "high": "high",
19774
+ "xhigh": null,
19775
+ "max": null
19776
+ },
19777
+ input: ["text"],
19778
+ cost: {
19779
+ input: 0.09999999999999999,
19780
+ output: 0.15,
19781
+ cacheRead: 0.049999999999999996,
19782
+ cacheWrite: 0
19783
+ },
19784
+ contextWindow: 131072,
19785
+ maxTokens: 117964
19786
+ },
19802
19787
  "inception/mercury-2": {
19803
19788
  id: "inception/mercury-2",
19804
19789
  name: "Inception: Mercury 2",
@@ -19824,6 +19809,31 @@ var MODELS = {
19824
19809
  contextWindow: 128e3,
19825
19810
  maxTokens: 5e4
19826
19811
  },
19812
+ "inception/mercury-2.5-preview": {
19813
+ id: "inception/mercury-2.5-preview",
19814
+ name: "Inception: Mercury 2.5 Preview",
19815
+ api: "openai-completions",
19816
+ provider: "openrouter",
19817
+ baseUrl: "https://openrouter.ai/api/v1",
19818
+ reasoning: true,
19819
+ thinkingLevelMap: {
19820
+ "minimal": null,
19821
+ "low": "low",
19822
+ "medium": "medium",
19823
+ "high": "high",
19824
+ "xhigh": null,
19825
+ "max": null
19826
+ },
19827
+ input: ["text"],
19828
+ cost: {
19829
+ input: 0.04,
19830
+ output: 0.15,
19831
+ cacheRead: 4e-3,
19832
+ cacheWrite: 0
19833
+ },
19834
+ contextWindow: 26e4,
19835
+ maxTokens: 65536
19836
+ },
19827
19837
  "inclusionai/ling-3.0-flash": {
19828
19838
  id: "inclusionai/ling-3.0-flash",
19829
19839
  name: "Ling-3.0-flash",
@@ -19850,22 +19860,31 @@ var MODELS = {
19850
19860
  contextWindow: 262144,
19851
19861
  maxTokens: 32768
19852
19862
  },
19853
- "kwaipilot/kat-coder-air-v2.5": {
19854
- id: "kwaipilot/kat-coder-air-v2.5",
19855
- name: "Kwaipilot: KAT-Coder-Air V2.5",
19863
+ "inclusionai/ling-3.0-flash-fin:free": {
19864
+ id: "inclusionai/ling-3.0-flash-fin:free",
19865
+ name: "Ling 3.0 Flash Fin (free)",
19856
19866
  api: "openai-completions",
19857
19867
  provider: "openrouter",
19858
19868
  baseUrl: "https://openrouter.ai/api/v1",
19859
- reasoning: false,
19869
+ compat: { "supportsReasoningEffort": false },
19870
+ reasoning: true,
19871
+ thinkingLevelMap: {
19872
+ "minimal": null,
19873
+ "low": null,
19874
+ "medium": null,
19875
+ "high": "high",
19876
+ "xhigh": null,
19877
+ "max": null
19878
+ },
19860
19879
  input: ["text"],
19861
19880
  cost: {
19862
- input: 0.15,
19863
- output: 0.6,
19864
- cacheRead: 0.03,
19881
+ input: 0,
19882
+ output: 0,
19883
+ cacheRead: 0,
19865
19884
  cacheWrite: 0
19866
19885
  },
19867
- contextWindow: 256e3,
19868
- maxTokens: 8e4
19886
+ contextWindow: 262144,
19887
+ maxTokens: 32768
19869
19888
  },
19870
19889
  "kwaipilot/kat-coder-pro-v2": {
19871
19890
  id: "kwaipilot/kat-coder-pro-v2",
@@ -19882,7 +19901,7 @@ var MODELS = {
19882
19901
  cacheWrite: 0
19883
19902
  },
19884
19903
  contextWindow: 262144,
19885
- maxTokens: 8e4
19904
+ maxTokens: 144e3
19886
19905
  },
19887
19906
  "kwaipilot/kat-coder-pro-v2.5": {
19888
19907
  id: "kwaipilot/kat-coder-pro-v2.5",
@@ -19898,8 +19917,8 @@ var MODELS = {
19898
19917
  cacheRead: 0.15,
19899
19918
  cacheWrite: 0
19900
19919
  },
19901
- contextWindow: 256e3,
19902
- maxTokens: 8e4
19920
+ contextWindow: 262144,
19921
+ maxTokens: 235929
19903
19922
  },
19904
19923
  "liquid/lfm-2.5-2.6b:free": {
19905
19924
  id: "liquid/lfm-2.5-2.6b:free",
@@ -20015,12 +20034,12 @@ var MODELS = {
20015
20034
  input: ["text", "image"],
20016
20035
  cost: {
20017
20036
  input: 0.19999999999999998,
20018
- output: 0.7999999999999999,
20037
+ output: 0.696,
20019
20038
  cacheRead: 0,
20020
20039
  cacheWrite: 0
20021
20040
  },
20022
20041
  contextWindow: 1048576,
20023
- maxTokens: 16384
20042
+ maxTokens: 115200
20024
20043
  },
20025
20044
  "meta-llama/llama-4-scout": {
20026
20045
  id: "meta-llama/llama-4-scout",
@@ -20031,13 +20050,13 @@ var MODELS = {
20031
20050
  reasoning: false,
20032
20051
  input: ["text", "image"],
20033
20052
  cost: {
20034
- input: 0.11,
20035
- output: 0.33999999999999997,
20036
- cacheRead: 0.055,
20053
+ input: 0.09999999999999999,
20054
+ output: 0.3,
20055
+ cacheRead: 0,
20037
20056
  cacheWrite: 0
20038
20057
  },
20039
20058
  contextWindow: 1310720,
20040
- maxTokens: 8192
20059
+ maxTokens: 16384
20041
20060
  },
20042
20061
  "meta/muse-glimmer-30b": {
20043
20062
  id: "meta/muse-glimmer-30b",
@@ -20057,13 +20076,13 @@ var MODELS = {
20057
20076
  },
20058
20077
  input: ["text", "image"],
20059
20078
  cost: {
20060
- input: 0.35,
20061
- output: 1.5,
20079
+ input: 0.3,
20080
+ output: 1.2,
20062
20081
  cacheRead: 0.04,
20063
20082
  cacheWrite: 0
20064
20083
  },
20065
20084
  contextWindow: 131072,
20066
- maxTokens: 117964
20085
+ maxTokens: 16384
20067
20086
  },
20068
20087
  "meta/muse-spark-1.1": {
20069
20088
  id: "meta/muse-spark-1.1",
@@ -20382,9 +20401,9 @@ var MODELS = {
20382
20401
  reasoning: false,
20383
20402
  input: ["text"],
20384
20403
  cost: {
20385
- input: 0.44,
20386
- output: 2.2,
20387
- cacheRead: 0.044,
20404
+ input: 0.39999999999999997,
20405
+ output: 2,
20406
+ cacheRead: 0.04,
20388
20407
  cacheWrite: 0
20389
20408
  },
20390
20409
  contextWindow: 262144,
@@ -20658,8 +20677,8 @@ var MODELS = {
20658
20677
  cacheRead: 0.01,
20659
20678
  cacheWrite: 0
20660
20679
  },
20661
- contextWindow: 32e3,
20662
- maxTokens: 25600
20680
+ contextWindow: 32768,
20681
+ maxTokens: 26214
20663
20682
  },
20664
20683
  "moonshotai/kimi-k2": {
20665
20684
  id: "moonshotai/kimi-k2",
@@ -20793,9 +20812,9 @@ var MODELS = {
20793
20812
  },
20794
20813
  input: ["text", "image"],
20795
20814
  cost: {
20796
- input: 0.67,
20815
+ input: 0.66,
20797
20816
  output: 3.4,
20798
- cacheRead: 0.19,
20817
+ cacheRead: 0.18,
20799
20818
  cacheWrite: 0
20800
20819
  },
20801
20820
  contextWindow: 262144,
@@ -20898,11 +20917,11 @@ var MODELS = {
20898
20917
  cost: {
20899
20918
  input: 0.049999999999999996,
20900
20919
  output: 0.19999999999999998,
20901
- cacheRead: 0.03,
20920
+ cacheRead: 0.024999999999999998,
20902
20921
  cacheWrite: 0
20903
20922
  },
20904
20923
  contextWindow: 262144,
20905
- maxTokens: 235929
20924
+ maxTokens: 228e3
20906
20925
  },
20907
20926
  "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free": {
20908
20927
  id: "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",
@@ -20997,13 +21016,13 @@ var MODELS = {
20997
21016
  },
20998
21017
  input: ["text"],
20999
21018
  cost: {
21000
- input: 0.6,
21001
- output: 3.5999999999999996,
21002
- cacheRead: 0.19999999999999998,
21019
+ input: 0.5,
21020
+ output: 2.2,
21021
+ cacheRead: 0.09999999999999999,
21003
21022
  cacheWrite: 0
21004
21023
  },
21005
- contextWindow: 512288,
21006
- maxTokens: 461059
21024
+ contextWindow: 262144,
21025
+ maxTokens: 16384
21007
21026
  },
21008
21027
  "nvidia/nemotron-3-ultra-550b-a55b:free": {
21009
21028
  id: "nvidia/nemotron-3-ultra-550b-a55b:free",
@@ -22561,13 +22580,13 @@ var MODELS = {
22561
22580
  reasoning: false,
22562
22581
  input: ["text"],
22563
22582
  cost: {
22564
- input: 0.09,
22565
- output: 0.55,
22566
- cacheRead: 0,
22583
+ input: 0.0875,
22584
+ output: 0.35,
22585
+ cacheRead: 0.0175,
22567
22586
  cacheWrite: 0
22568
22587
  },
22569
22588
  contextWindow: 262144,
22570
- maxTokens: 16384
22589
+ maxTokens: 235929
22571
22590
  },
22572
22591
  "qwen/qwen3-235b-a22b-thinking-2507": {
22573
22592
  id: "qwen/qwen3-235b-a22b-thinking-2507",
@@ -22943,13 +22962,13 @@ var MODELS = {
22943
22962
  reasoning: false,
22944
22963
  input: ["text", "image"],
22945
22964
  cost: {
22946
- input: 0.13,
22947
- output: 0.52,
22965
+ input: 0.15,
22966
+ output: 0.6,
22948
22967
  cacheRead: 0,
22949
22968
  cacheWrite: 0
22950
22969
  },
22951
22970
  contextWindow: 262144,
22952
- maxTokens: 32768
22971
+ maxTokens: 16384
22953
22972
  },
22954
22973
  "qwen/qwen3-vl-30b-a3b-thinking": {
22955
22974
  id: "qwen/qwen3-vl-30b-a3b-thinking",
@@ -23057,13 +23076,13 @@ var MODELS = {
23057
23076
  },
23058
23077
  input: ["text", "image"],
23059
23078
  cost: {
23060
- input: 0.26,
23061
- output: 2.08,
23079
+ input: 0.29,
23080
+ output: 2.4,
23062
23081
  cacheRead: 0,
23063
23082
  cacheWrite: 0
23064
23083
  },
23065
23084
  contextWindow: 262144,
23066
- maxTokens: 235929
23085
+ maxTokens: 81920
23067
23086
  },
23068
23087
  "qwen/qwen3.5-27b": {
23069
23088
  id: "qwen/qwen3.5-27b",
@@ -23291,8 +23310,8 @@ var MODELS = {
23291
23310
  },
23292
23311
  input: ["text", "image"],
23293
23312
  cost: {
23294
- input: 0.14,
23295
- output: 1,
23313
+ input: 0.09999999999999999,
23314
+ output: 0.8999999999999999,
23296
23315
  cacheRead: 0.049999999999999996,
23297
23316
  cacheWrite: 0
23298
23317
  },
@@ -23479,7 +23498,7 @@ var MODELS = {
23479
23498
  cacheWrite: 0
23480
23499
  },
23481
23500
  contextWindow: 1048576,
23482
- maxTokens: 131072
23501
+ maxTokens: 262144
23483
23502
  },
23484
23503
  "qwen/qwen3.8-27b": {
23485
23504
  id: "qwen/qwen3.8-27b",
@@ -23506,6 +23525,32 @@ var MODELS = {
23506
23525
  contextWindow: 1e6,
23507
23526
  maxTokens: 131072
23508
23527
  },
23528
+ "qwen/qwen3.8-flash": {
23529
+ id: "qwen/qwen3.8-flash",
23530
+ name: "Qwen: Qwen3.8 Flash",
23531
+ api: "openai-completions",
23532
+ provider: "openrouter",
23533
+ baseUrl: "https://openrouter.ai/api/v1",
23534
+ compat: { "supportsReasoningEffort": false },
23535
+ reasoning: true,
23536
+ thinkingLevelMap: {
23537
+ "minimal": null,
23538
+ "low": null,
23539
+ "medium": null,
23540
+ "high": "high",
23541
+ "xhigh": null,
23542
+ "max": null
23543
+ },
23544
+ input: ["text", "image"],
23545
+ cost: {
23546
+ input: 0.15,
23547
+ output: 0.47,
23548
+ cacheRead: 0.016,
23549
+ cacheWrite: 0.19999999999999998
23550
+ },
23551
+ contextWindow: 1e6,
23552
+ maxTokens: 131072
23553
+ },
23509
23554
  "qwen/qwen3.8-max": {
23510
23555
  id: "qwen/qwen3.8-max",
23511
23556
  name: "Qwen: Qwen3.8 Max",
@@ -23634,32 +23679,6 @@ var MODELS = {
23634
23679
  contextWindow: 131072,
23635
23680
  maxTokens: 16384
23636
23681
  },
23637
- "stealth/ox-alpha": {
23638
- id: "stealth/ox-alpha",
23639
- name: "Ox Alpha",
23640
- api: "openai-completions",
23641
- provider: "openrouter",
23642
- baseUrl: "https://openrouter.ai/api/v1",
23643
- reasoning: true,
23644
- thinkingLevelMap: {
23645
- "off": null,
23646
- "minimal": null,
23647
- "low": "low",
23648
- "medium": null,
23649
- "high": "high",
23650
- "xhigh": null,
23651
- "max": "max"
23652
- },
23653
- input: ["text", "image"],
23654
- cost: {
23655
- input: 0,
23656
- output: 0,
23657
- cacheRead: 0,
23658
- cacheWrite: 0
23659
- },
23660
- contextWindow: 1048576,
23661
- maxTokens: 131072
23662
- },
23663
23682
  "stepfun/step-3.5-flash": {
23664
23683
  id: "stepfun/step-3.5-flash",
23665
23684
  name: "StepFun: Step 3.5 Flash",
@@ -23730,9 +23749,9 @@ var MODELS = {
23730
23749
  },
23731
23750
  input: ["text"],
23732
23751
  cost: {
23733
- input: 0.13199999999999998,
23734
- output: 0.5279999999999999,
23735
- cacheRead: 0.032999999999999995,
23752
+ input: 0.0825,
23753
+ output: 0.33,
23754
+ cacheRead: 0.020625,
23736
23755
  cacheWrite: 0
23737
23756
  },
23738
23757
  contextWindow: 262144,
@@ -23763,6 +23782,31 @@ var MODELS = {
23763
23782
  contextWindow: 262144,
23764
23783
  maxTokens: 235929
23765
23784
  },
23785
+ "tencent/hy4-preview": {
23786
+ id: "tencent/hy4-preview",
23787
+ name: "Tencent: Hy4 preview",
23788
+ api: "openai-completions",
23789
+ provider: "openrouter",
23790
+ baseUrl: "https://openrouter.ai/api/v1",
23791
+ reasoning: true,
23792
+ thinkingLevelMap: {
23793
+ "minimal": null,
23794
+ "low": "low",
23795
+ "medium": null,
23796
+ "high": "high",
23797
+ "xhigh": null,
23798
+ "max": null
23799
+ },
23800
+ input: ["text"],
23801
+ cost: {
23802
+ input: 0.834,
23803
+ output: 2.501,
23804
+ cacheRead: 0.041999999999999996,
23805
+ cacheWrite: 0
23806
+ },
23807
+ contextWindow: 1048576,
23808
+ maxTokens: 64e3
23809
+ },
23766
23810
  "thedrummer/unslopnemo-12b": {
23767
23811
  id: "thedrummer/unslopnemo-12b",
23768
23812
  name: "TheDrummer: UnslopNemo 12B",
@@ -23797,13 +23841,13 @@ var MODELS = {
23797
23841
  },
23798
23842
  input: ["text", "image"],
23799
23843
  cost: {
23800
- input: 0.95,
23844
+ input: 1,
23801
23845
  output: 4.05,
23802
- cacheRead: 0.16,
23846
+ cacheRead: 0.16999999999999998,
23803
23847
  cacheWrite: 0
23804
23848
  },
23805
23849
  contextWindow: 1048576,
23806
- maxTokens: 262144
23850
+ maxTokens: 471859
23807
23851
  },
23808
23852
  "thinkingmachines/inkling-small": {
23809
23853
  id: "thinkingmachines/inkling-small",
@@ -24210,13 +24254,13 @@ var MODELS = {
24210
24254
  },
24211
24255
  input: ["text"],
24212
24256
  cost: {
24213
- input: 0.5,
24214
- output: 2,
24215
- cacheRead: 0.09999999999999999,
24257
+ input: 0.43,
24258
+ output: 1.75,
24259
+ cacheRead: 0.08,
24216
24260
  cacheWrite: 0
24217
24261
  },
24218
24262
  contextWindow: 204800,
24219
- maxTokens: 131072
24263
+ maxTokens: 16384
24220
24264
  },
24221
24265
  "z-ai/glm-4.6v": {
24222
24266
  id: "z-ai/glm-4.6v",
@@ -24366,13 +24410,13 @@ var MODELS = {
24366
24410
  },
24367
24411
  input: ["text"],
24368
24412
  cost: {
24369
- input: 1.26,
24370
- output: 3.9600000000000004,
24371
- cacheRead: 0.234,
24413
+ input: 0.966,
24414
+ output: 3.036,
24415
+ cacheRead: 0.1794,
24372
24416
  cacheWrite: 0
24373
24417
  },
24374
24418
  contextWindow: 204800,
24375
- maxTokens: 182476
24419
+ maxTokens: 128e3
24376
24420
  },
24377
24421
  "z-ai/glm-5.2": {
24378
24422
  id: "z-ai/glm-5.2",
@@ -24447,7 +24491,33 @@ var MODELS = {
24447
24491
  cacheRead: 0.26,
24448
24492
  cacheWrite: 0
24449
24493
  },
24450
- contextWindow: 1048576,
24494
+ contextWindow: 1310720,
24495
+ maxTokens: 131072
24496
+ },
24497
+ "z-ai/glm-5.3-flash": {
24498
+ id: "z-ai/glm-5.3-flash",
24499
+ name: "Z.ai: GLM 5.3 Flash",
24500
+ api: "openai-completions",
24501
+ provider: "openrouter",
24502
+ baseUrl: "https://openrouter.ai/api/v1",
24503
+ reasoning: true,
24504
+ thinkingLevelMap: {
24505
+ "off": null,
24506
+ "minimal": null,
24507
+ "low": "low",
24508
+ "medium": null,
24509
+ "high": "high",
24510
+ "xhigh": null,
24511
+ "max": "max"
24512
+ },
24513
+ input: ["text", "image"],
24514
+ cost: {
24515
+ input: 0.075,
24516
+ output: 0.25,
24517
+ cacheRead: 0.015,
24518
+ cacheWrite: 0
24519
+ },
24520
+ contextWindow: 1310720,
24451
24521
  maxTokens: 131072
24452
24522
  },
24453
24523
  "z-ai/glm-5v-turbo": {
@@ -24599,9 +24669,9 @@ var MODELS = {
24599
24669
  },
24600
24670
  input: ["text"],
24601
24671
  cost: {
24602
- input: 0.03,
24603
- output: 0.075,
24604
- cacheRead: 7e-3,
24672
+ input: 0.049980000000000004,
24673
+ output: 0.09996000000000001,
24674
+ cacheRead: 0.009996000000000001,
24605
24675
  cacheWrite: 0
24606
24676
  },
24607
24677
  contextWindow: 1310720,
@@ -24625,10 +24695,10 @@ var MODELS = {
24625
24695
  },
24626
24696
  input: ["text", "image"],
24627
24697
  cost: {
24628
- input: 0.375,
24629
- output: 1.875,
24630
- cacheRead: 0.0375,
24631
- cacheWrite: 0.0208333333333333
24698
+ input: 0.75,
24699
+ output: 3.75,
24700
+ cacheRead: 0.075,
24701
+ cacheWrite: 0.0416666666666667
24632
24702
  },
24633
24703
  contextWindow: 1048576,
24634
24704
  maxTokens: 65536
@@ -24778,13 +24848,13 @@ var MODELS = {
24778
24848
  },
24779
24849
  input: ["text"],
24780
24850
  cost: {
24781
- input: 1.4,
24782
- output: 4.4,
24783
- cacheRead: 0.26,
24851
+ input: 1.17,
24852
+ output: 3.9600000000000004,
24853
+ cacheRead: 0.234,
24784
24854
  cacheWrite: 0
24785
24855
  },
24786
- contextWindow: 1048576,
24787
- maxTokens: 131072
24856
+ contextWindow: 1310720,
24857
+ maxTokens: 943718
24788
24858
  }
24789
24859
  },
24790
24860
  "prime-inference": {
@@ -25202,8 +25272,8 @@ var MODELS = {
25202
25272
  reasoning: false,
25203
25273
  input: ["text"],
25204
25274
  cost: {
25205
- input: 0.5,
25206
- output: 1.5,
25275
+ input: 0.4,
25276
+ output: 1.3,
25207
25277
  cacheRead: 0,
25208
25278
  cacheWrite: 0
25209
25279
  },
@@ -25226,8 +25296,8 @@ var MODELS = {
25226
25296
  reasoning: false,
25227
25297
  input: ["text"],
25228
25298
  cost: {
25229
- input: 1.25,
25230
- output: 1.5,
25299
+ input: 0.27,
25300
+ output: 1.12,
25231
25301
  cacheRead: 0,
25232
25302
  cacheWrite: 0
25233
25303
  },
@@ -25259,8 +25329,8 @@ var MODELS = {
25259
25329
  },
25260
25330
  input: ["text"],
25261
25331
  cost: {
25262
- input: 0.56,
25263
- output: 1.68,
25332
+ input: 0.6,
25333
+ output: 1.7,
25264
25334
  cacheRead: 0,
25265
25335
  cacheWrite: 0
25266
25336
  },
@@ -25292,8 +25362,8 @@ var MODELS = {
25292
25362
  },
25293
25363
  input: ["text"],
25294
25364
  cost: {
25295
- input: 0.45,
25296
- output: 1.5,
25365
+ input: 0.27,
25366
+ output: 1,
25297
25367
  cacheRead: 0,
25298
25368
  cacheWrite: 0
25299
25369
  },
@@ -25325,13 +25395,13 @@ var MODELS = {
25325
25395
  },
25326
25396
  input: ["text"],
25327
25397
  cost: {
25328
- input: 0.28,
25329
- output: 0.42,
25398
+ input: 0.3705,
25399
+ output: 1.1115,
25330
25400
  cacheRead: 0,
25331
25401
  cacheWrite: 0
25332
25402
  },
25333
25403
  contextWindow: 163840,
25334
- maxTokens: 147456,
25404
+ maxTokens: 65536,
25335
25405
  featured: true
25336
25406
  },
25337
25407
  "deepseek/deepseek-v3.2-exp": {
@@ -25359,8 +25429,8 @@ var MODELS = {
25359
25429
  },
25360
25430
  input: ["text"],
25361
25431
  cost: {
25362
- input: 0.28,
25363
- output: 0.42,
25432
+ input: 0.27,
25433
+ output: 0.41,
25364
25434
  cacheRead: 0,
25365
25435
  cacheWrite: 0
25366
25436
  },
@@ -25393,8 +25463,8 @@ var MODELS = {
25393
25463
  },
25394
25464
  input: ["text"],
25395
25465
  cost: {
25396
- input: 0.14,
25397
- output: 0.28,
25466
+ input: 0.44,
25467
+ output: 1.32,
25398
25468
  cacheRead: 0,
25399
25469
  cacheWrite: 0
25400
25470
  },
@@ -25428,8 +25498,8 @@ var MODELS = {
25428
25498
  },
25429
25499
  input: ["text"],
25430
25500
  cost: {
25431
- input: 0.14,
25432
- output: 0.28,
25501
+ input: 0.44,
25502
+ output: 1.32,
25433
25503
  cacheRead: 0,
25434
25504
  cacheWrite: 0
25435
25505
  },
@@ -25462,13 +25532,13 @@ var MODELS = {
25462
25532
  },
25463
25533
  input: ["text"],
25464
25534
  cost: {
25465
- input: 2.1,
25466
- output: 4.4,
25535
+ input: 1.91,
25536
+ output: 3.83,
25467
25537
  cacheRead: 0,
25468
25538
  cacheWrite: 0
25469
25539
  },
25470
25540
  contextWindow: 1048576,
25471
- maxTokens: 384e3,
25541
+ maxTokens: 393216,
25472
25542
  featured: true
25473
25543
  },
25474
25544
  "google/gemini-2.5-flash": {
@@ -25702,6 +25772,39 @@ var MODELS = {
25702
25772
  contextWindow: 1048576,
25703
25773
  maxTokens: 65536
25704
25774
  },
25775
+ "google/gemini-3.7-flash": {
25776
+ id: "google/gemini-3.7-flash",
25777
+ name: "Gemini 3.7 Flash",
25778
+ api: "openai-completions",
25779
+ provider: "prime-inference",
25780
+ baseUrl: "https://api.pinference.ai/api/v1",
25781
+ compat: {
25782
+ "supportsStore": false,
25783
+ "supportsDeveloperRole": false,
25784
+ "supportsReasoningEffort": true,
25785
+ "maxTokensField": "max_tokens",
25786
+ "supportsStrictMode": false
25787
+ },
25788
+ reasoning: true,
25789
+ thinkingLevelMap: {
25790
+ "off": null,
25791
+ "minimal": null,
25792
+ "low": "low",
25793
+ "medium": "medium",
25794
+ "high": "high",
25795
+ "xhigh": null,
25796
+ "max": null
25797
+ },
25798
+ input: ["text", "image"],
25799
+ cost: {
25800
+ input: 1.35,
25801
+ output: 6.75,
25802
+ cacheRead: 0,
25803
+ cacheWrite: 0
25804
+ },
25805
+ contextWindow: 1048576,
25806
+ maxTokens: 65536
25807
+ },
25705
25808
  "google/gemma-3-27b-it": {
25706
25809
  id: "google/gemma-3-27b-it",
25707
25810
  name: "Gemma 3 27B IT",
@@ -25723,7 +25826,7 @@ var MODELS = {
25723
25826
  cacheRead: 0,
25724
25827
  cacheWrite: 0
25725
25828
  },
25726
- contextWindow: 262144,
25829
+ contextWindow: 131072,
25727
25830
  maxTokens: 117964
25728
25831
  },
25729
25832
  "meta-llama/Llama-3.2-1B-Instruct": {
@@ -25742,8 +25845,8 @@ var MODELS = {
25742
25845
  reasoning: false,
25743
25846
  input: ["text"],
25744
25847
  cost: {
25745
- input: 0.03,
25746
- output: 0.21,
25848
+ input: 0.027,
25849
+ output: 0.201,
25747
25850
  cacheRead: 0,
25748
25851
  cacheWrite: 0
25749
25852
  },
@@ -25766,8 +25869,8 @@ var MODELS = {
25766
25869
  reasoning: false,
25767
25870
  input: ["text"],
25768
25871
  cost: {
25769
- input: 0.1,
25770
- output: 0.34,
25872
+ input: 0.0509,
25873
+ output: 0.335,
25771
25874
  cacheRead: 0,
25772
25875
  cacheWrite: 0
25773
25876
  },
@@ -25790,8 +25893,8 @@ var MODELS = {
25790
25893
  reasoning: false,
25791
25894
  input: ["text"],
25792
25895
  cost: {
25793
- input: 0.9,
25794
- output: 0.9,
25896
+ input: 1.04,
25897
+ output: 2.253,
25795
25898
  cacheRead: 0,
25796
25899
  cacheWrite: 0
25797
25900
  },
@@ -25814,13 +25917,46 @@ var MODELS = {
25814
25917
  reasoning: false,
25815
25918
  input: ["text", "image"],
25816
25919
  cost: {
25817
- input: 0.27,
25818
- output: 0.88,
25920
+ input: 0.35,
25921
+ output: 1.15,
25819
25922
  cacheRead: 0,
25820
25923
  cacheWrite: 0
25821
25924
  },
25822
25925
  contextWindow: 1048576,
25823
- maxTokens: 16384
25926
+ maxTokens: 115200
25927
+ },
25928
+ "meta/muse-spark-1.2": {
25929
+ id: "meta/muse-spark-1.2",
25930
+ name: "Muse Spark 1.2",
25931
+ api: "openai-completions",
25932
+ provider: "prime-inference",
25933
+ baseUrl: "https://api.pinference.ai/api/v1",
25934
+ compat: {
25935
+ "supportsStore": false,
25936
+ "supportsDeveloperRole": false,
25937
+ "supportsReasoningEffort": true,
25938
+ "maxTokensField": "max_tokens",
25939
+ "supportsStrictMode": false
25940
+ },
25941
+ reasoning: true,
25942
+ thinkingLevelMap: {
25943
+ "off": null,
25944
+ "minimal": "minimal",
25945
+ "low": "low",
25946
+ "medium": "medium",
25947
+ "high": "high",
25948
+ "xhigh": "xhigh",
25949
+ "max": null
25950
+ },
25951
+ input: ["text", "image"],
25952
+ cost: {
25953
+ input: 1.25,
25954
+ output: 4.25,
25955
+ cacheRead: 0,
25956
+ cacheWrite: 0
25957
+ },
25958
+ contextWindow: 1048576,
25959
+ maxTokens: 943718
25824
25960
  },
25825
25961
  "minimax/minimax-m2.5": {
25826
25962
  id: "minimax/minimax-m2.5",
@@ -25848,8 +25984,8 @@ var MODELS = {
25848
25984
  },
25849
25985
  input: ["text"],
25850
25986
  cost: {
25851
- input: 0.3,
25852
- output: 1.2,
25987
+ input: 0.6,
25988
+ output: 2.4,
25853
25989
  cacheRead: 0,
25854
25990
  cacheWrite: 0
25855
25991
  },
@@ -25964,8 +26100,8 @@ var MODELS = {
25964
26100
  reasoning: false,
25965
26101
  input: ["text"],
25966
26102
  cost: {
25967
- input: 0.1,
25968
- output: 0.25,
26103
+ input: 0.165,
26104
+ output: 0.17,
25969
26105
  cacheRead: 0,
25970
26106
  cacheWrite: 0
25971
26107
  },
@@ -25996,8 +26132,8 @@ var MODELS = {
25996
26132
  },
25997
26133
  input: ["text", "image"],
25998
26134
  cost: {
25999
- input: 0.1875,
26000
- output: 0.75,
26135
+ input: 0.165,
26136
+ output: 0.66,
26001
26137
  cacheRead: 0,
26002
26138
  cacheWrite: 0
26003
26139
  },
@@ -26020,8 +26156,8 @@ var MODELS = {
26020
26156
  reasoning: false,
26021
26157
  input: ["text"],
26022
26158
  cost: {
26023
- input: 2,
26024
- output: 6,
26159
+ input: 2.2,
26160
+ output: 6.6,
26025
26161
  cacheRead: 0,
26026
26162
  cacheWrite: 0
26027
26163
  },
@@ -26044,8 +26180,8 @@ var MODELS = {
26044
26180
  reasoning: false,
26045
26181
  input: ["text"],
26046
26182
  cost: {
26047
- input: 1.2,
26048
- output: 5,
26183
+ input: 0.6,
26184
+ output: 2.5,
26049
26185
  cacheRead: 0,
26050
26186
  cacheWrite: 0
26051
26187
  },
@@ -26078,7 +26214,7 @@ var MODELS = {
26078
26214
  input: ["text", "image"],
26079
26215
  cost: {
26080
26216
  input: 0.6,
26081
- output: 3.2,
26217
+ output: 3,
26082
26218
  cacheRead: 0,
26083
26219
  cacheWrite: 0
26084
26220
  },
@@ -26144,8 +26280,8 @@ var MODELS = {
26144
26280
  },
26145
26281
  input: ["text", "image"],
26146
26282
  cost: {
26147
- input: 1.0925,
26148
- output: 4.6,
26283
+ input: 1.9,
26284
+ output: 8,
26149
26285
  cacheRead: 0,
26150
26286
  cacheWrite: 0
26151
26287
  },
@@ -26177,8 +26313,8 @@ var MODELS = {
26177
26313
  },
26178
26314
  input: ["text", "image"],
26179
26315
  cost: {
26180
- input: 3,
26181
- output: 15,
26316
+ input: 3.45,
26317
+ output: 17.25,
26182
26318
  cacheRead: 0,
26183
26319
  cacheWrite: 0
26184
26320
  },
@@ -26211,13 +26347,13 @@ var MODELS = {
26211
26347
  },
26212
26348
  input: ["text"],
26213
26349
  cost: {
26214
- input: 0.05,
26215
- output: 0.2,
26350
+ input: 0.06,
26351
+ output: 0.24,
26216
26352
  cacheRead: 0,
26217
26353
  cacheWrite: 0
26218
26354
  },
26219
26355
  contextWindow: 262144,
26220
- maxTokens: 235929,
26356
+ maxTokens: 228e3,
26221
26357
  featured: true
26222
26358
  },
26223
26359
  "nvidia/nemotron-3-super-120b-a12b": {
@@ -26245,7 +26381,7 @@ var MODELS = {
26245
26381
  input: ["text"],
26246
26382
  cost: {
26247
26383
  input: 0.3,
26248
- output: 0.9,
26384
+ output: 0.65,
26249
26385
  cacheRead: 0,
26250
26386
  cacheWrite: 0
26251
26387
  },
@@ -26536,31 +26672,6 @@ var MODELS = {
26536
26672
  contextWindow: 4e5,
26537
26673
  maxTokens: 128e3
26538
26674
  },
26539
- "openai/gpt-5.2-chat": {
26540
- id: "openai/gpt-5.2-chat",
26541
- name: "GPT 5.2 Chat",
26542
- api: "openai-completions",
26543
- provider: "prime-inference",
26544
- baseUrl: "https://api.pinference.ai/api/v1",
26545
- compat: {
26546
- "supportsStore": false,
26547
- "supportsDeveloperRole": false,
26548
- "supportsReasoningEffort": true,
26549
- "maxTokensField": "max_tokens",
26550
- "supportsStrictMode": false
26551
- },
26552
- reasoning: false,
26553
- thinkingLevelMap: { "xhigh": "xhigh" },
26554
- input: ["text", "image"],
26555
- cost: {
26556
- input: 1.75,
26557
- output: 14,
26558
- cacheRead: 0,
26559
- cacheWrite: 0
26560
- },
26561
- contextWindow: 128e3,
26562
- maxTokens: 32e3
26563
- },
26564
26675
  "openai/gpt-5.2-pro": {
26565
26676
  id: "openai/gpt-5.2-pro",
26566
26677
  name: "GPT 5.2 PRO",
@@ -26845,8 +26956,8 @@ var MODELS = {
26845
26956
  },
26846
26957
  input: ["text", "image"],
26847
26958
  cost: {
26848
- input: 1,
26849
- output: 6,
26959
+ input: 0.2,
26960
+ output: 1.2,
26850
26961
  cacheRead: 0,
26851
26962
  cacheWrite: 0
26852
26963
  },
@@ -27038,8 +27149,8 @@ var MODELS = {
27038
27149
  },
27039
27150
  input: ["text"],
27040
27151
  cost: {
27041
- input: 0.15,
27042
- output: 0.6,
27152
+ input: 0.35,
27153
+ output: 0.75,
27043
27154
  cacheRead: 0,
27044
27155
  cacheWrite: 0
27045
27156
  },
@@ -27104,8 +27215,8 @@ var MODELS = {
27104
27215
  },
27105
27216
  input: ["text"],
27106
27217
  cost: {
27107
- input: 0.1,
27108
- output: 0.19,
27218
+ input: 0.09,
27219
+ output: 0.18,
27109
27220
  cacheRead: 0,
27110
27221
  cacheWrite: 0
27111
27222
  },
@@ -27137,8 +27248,8 @@ var MODELS = {
27137
27248
  },
27138
27249
  input: ["text"],
27139
27250
  cost: {
27140
- input: 0.065,
27141
- output: 0.13,
27251
+ input: 0.06,
27252
+ output: 0.12,
27142
27253
  cacheRead: 0,
27143
27254
  cacheWrite: 0
27144
27255
  },
@@ -27161,13 +27272,13 @@ var MODELS = {
27161
27272
  reasoning: false,
27162
27273
  input: ["text"],
27163
27274
  cost: {
27164
- input: 0.22,
27165
- output: 0.88,
27275
+ input: 0.25,
27276
+ output: 1,
27166
27277
  cacheRead: 0,
27167
27278
  cacheWrite: 0
27168
27279
  },
27169
27280
  contextWindow: 262144,
27170
- maxTokens: 16384
27281
+ maxTokens: 235929
27171
27282
  },
27172
27283
  "qwen/qwen3-30b-a3b-instruct-2507": {
27173
27284
  id: "qwen/qwen3-30b-a3b-instruct-2507",
@@ -27185,8 +27296,8 @@ var MODELS = {
27185
27296
  reasoning: false,
27186
27297
  input: ["text"],
27187
27298
  cost: {
27188
- input: 0.2,
27189
- output: 0.8,
27299
+ input: 0.13,
27300
+ output: 0.52,
27190
27301
  cacheRead: 0,
27191
27302
  cacheWrite: 0
27192
27303
  },
@@ -27243,7 +27354,7 @@ var MODELS = {
27243
27354
  reasoning: false,
27244
27355
  input: ["text"],
27245
27356
  cost: {
27246
- input: 2,
27357
+ input: 0.975,
27247
27358
  output: 4.875,
27248
27359
  cacheRead: 0,
27249
27360
  cacheWrite: 0
@@ -27267,7 +27378,7 @@ var MODELS = {
27267
27378
  reasoning: false,
27268
27379
  input: ["text"],
27269
27380
  cost: {
27270
- input: 0.5,
27381
+ input: 0.3,
27271
27382
  output: 1.5,
27272
27383
  cacheRead: 0,
27273
27384
  cacheWrite: 0
@@ -27317,8 +27428,8 @@ var MODELS = {
27317
27428
  reasoning: false,
27318
27429
  input: ["text", "image"],
27319
27430
  cost: {
27320
- input: 0.4,
27321
- output: 1.9,
27431
+ input: 0.3,
27432
+ output: 1.5,
27322
27433
  cacheRead: 0,
27323
27434
  cacheWrite: 0
27324
27435
  },
@@ -27351,7 +27462,7 @@ var MODELS = {
27351
27462
  },
27352
27463
  input: ["text", "image"],
27353
27464
  cost: {
27354
- input: 1,
27465
+ input: 0.98,
27355
27466
  output: 4,
27356
27467
  cacheRead: 0,
27357
27468
  cacheWrite: 0
@@ -27376,13 +27487,13 @@ var MODELS = {
27376
27487
  reasoning: false,
27377
27488
  input: ["text", "image"],
27378
27489
  cost: {
27379
- input: 0.25,
27380
- output: 1,
27490
+ input: 0.2,
27491
+ output: 0.7,
27381
27492
  cacheRead: 0,
27382
27493
  cacheWrite: 0
27383
27494
  },
27384
27495
  contextWindow: 262144,
27385
- maxTokens: 32768
27496
+ maxTokens: 16384
27386
27497
  },
27387
27498
  "qwen/qwen3-vl-8b-instruct": {
27388
27499
  id: "qwen/qwen3-vl-8b-instruct",
@@ -27400,8 +27511,8 @@ var MODELS = {
27400
27511
  reasoning: false,
27401
27512
  input: ["text", "image"],
27402
27513
  cost: {
27403
- input: 0.18,
27404
- output: 0.7,
27514
+ input: 0.117,
27515
+ output: 0.455,
27405
27516
  cacheRead: 0,
27406
27517
  cacheWrite: 0
27407
27518
  },
@@ -27433,8 +27544,8 @@ var MODELS = {
27433
27544
  },
27434
27545
  input: ["text", "image"],
27435
27546
  cost: {
27436
- input: 0.3125,
27437
- output: 1.8,
27547
+ input: 0.25,
27548
+ output: 1.3,
27438
27549
  cacheRead: 0,
27439
27550
  cacheWrite: 0
27440
27551
  },
@@ -27532,8 +27643,8 @@ var MODELS = {
27532
27643
  },
27533
27644
  input: ["text", "image"],
27534
27645
  cost: {
27535
- input: 0.3,
27536
- output: 1.8,
27646
+ input: 0.25,
27647
+ output: 1.25,
27537
27648
  cacheRead: 0,
27538
27649
  cacheWrite: 0
27539
27650
  },
@@ -27675,6 +27786,39 @@ var MODELS = {
27675
27786
  maxTokens: 3e4,
27676
27787
  featured: true
27677
27788
  },
27789
+ "x-ai/grok-4.6": {
27790
+ id: "x-ai/grok-4.6",
27791
+ name: "Grok 4.6",
27792
+ api: "openai-completions",
27793
+ provider: "prime-inference",
27794
+ baseUrl: "https://api.pinference.ai/api/v1",
27795
+ compat: {
27796
+ "supportsStore": false,
27797
+ "supportsDeveloperRole": false,
27798
+ "supportsReasoningEffort": true,
27799
+ "maxTokensField": "max_tokens",
27800
+ "supportsStrictMode": false
27801
+ },
27802
+ reasoning: true,
27803
+ thinkingLevelMap: {
27804
+ "off": null,
27805
+ "minimal": null,
27806
+ "low": "low",
27807
+ "medium": "medium",
27808
+ "high": "high",
27809
+ "xhigh": "xhigh",
27810
+ "max": null
27811
+ },
27812
+ input: ["text", "image"],
27813
+ cost: {
27814
+ input: 2,
27815
+ output: 6,
27816
+ cacheRead: 0,
27817
+ cacheWrite: 0
27818
+ },
27819
+ contextWindow: 5e5,
27820
+ maxTokens: 45e4
27821
+ },
27678
27822
  "xiaomi/mimo-v2.5": {
27679
27823
  id: "xiaomi/mimo-v2.5",
27680
27824
  name: "Mimo V2.5",
@@ -27700,8 +27844,8 @@ var MODELS = {
27700
27844
  },
27701
27845
  input: ["text", "image"],
27702
27846
  cost: {
27703
- input: 0.4,
27704
- output: 2,
27847
+ input: 0.168,
27848
+ output: 0.336,
27705
27849
  cacheRead: 0,
27706
27850
  cacheWrite: 0
27707
27851
  },
@@ -27733,8 +27877,8 @@ var MODELS = {
27733
27877
  },
27734
27878
  input: ["text"],
27735
27879
  cost: {
27736
- input: 1,
27737
- output: 3,
27880
+ input: 0.48024,
27881
+ output: 1.5,
27738
27882
  cacheRead: 0,
27739
27883
  cacheWrite: 0
27740
27884
  },
@@ -27838,41 +27982,41 @@ var MODELS = {
27838
27982
  cacheWrite: 0
27839
27983
  },
27840
27984
  contextWindow: 204800,
27985
+ maxTokens: 16384
27986
+ },
27987
+ "z-ai/glm-4.7": {
27988
+ id: "z-ai/glm-4.7",
27989
+ name: "GLM 4.7",
27990
+ api: "openai-completions",
27991
+ provider: "prime-inference",
27992
+ baseUrl: "https://api.pinference.ai/api/v1",
27993
+ compat: {
27994
+ "supportsStore": false,
27995
+ "supportsDeveloperRole": false,
27996
+ "supportsReasoningEffort": false,
27997
+ "maxTokensField": "max_tokens",
27998
+ "supportsStrictMode": false,
27999
+ "thinkingFormat": "zai"
28000
+ },
28001
+ reasoning: true,
28002
+ thinkingLevelMap: {
28003
+ "minimal": null,
28004
+ "low": null,
28005
+ "medium": null,
28006
+ "high": "high",
28007
+ "xhigh": null,
28008
+ "max": null
28009
+ },
28010
+ input: ["text"],
28011
+ cost: {
28012
+ input: 0.6,
28013
+ output: 2.2,
28014
+ cacheRead: 0,
28015
+ cacheWrite: 0
28016
+ },
28017
+ contextWindow: 204800,
27841
28018
  maxTokens: 131072
27842
28019
  },
27843
- "z-ai/glm-4.7": {
27844
- id: "z-ai/glm-4.7",
27845
- name: "GLM 4.7",
27846
- api: "openai-completions",
27847
- provider: "prime-inference",
27848
- baseUrl: "https://api.pinference.ai/api/v1",
27849
- compat: {
27850
- "supportsStore": false,
27851
- "supportsDeveloperRole": false,
27852
- "supportsReasoningEffort": false,
27853
- "maxTokensField": "max_tokens",
27854
- "supportsStrictMode": false,
27855
- "thinkingFormat": "zai"
27856
- },
27857
- reasoning: true,
27858
- thinkingLevelMap: {
27859
- "minimal": null,
27860
- "low": null,
27861
- "medium": null,
27862
- "high": "high",
27863
- "xhigh": null,
27864
- "max": null
27865
- },
27866
- input: ["text"],
27867
- cost: {
27868
- input: 0.6,
27869
- output: 2.65,
27870
- cacheRead: 0,
27871
- cacheWrite: 0
27872
- },
27873
- contextWindow: 204800,
27874
- maxTokens: 131072
27875
- },
27876
28020
  "z-ai/glm-4.7-flash": {
27877
28021
  id: "z-ai/glm-4.7-flash",
27878
28022
  name: "GLM 4.7 Flash",
@@ -27898,8 +28042,8 @@ var MODELS = {
27898
28042
  },
27899
28043
  input: ["text"],
27900
28044
  cost: {
27901
- input: 0.1,
27902
- output: 0.43,
28045
+ input: 0.07,
28046
+ output: 0.4,
27903
28047
  cacheRead: 0,
27904
28048
  cacheWrite: 0
27905
28049
  },
@@ -27931,8 +28075,8 @@ var MODELS = {
27931
28075
  },
27932
28076
  input: ["text"],
27933
28077
  cost: {
27934
- input: 1.2,
27935
- output: 3.5,
28078
+ input: 1,
28079
+ output: 3.2,
27936
28080
  cacheRead: 0,
27937
28081
  cacheWrite: 0
27938
28082
  },
@@ -27965,13 +28109,13 @@ var MODELS = {
27965
28109
  },
27966
28110
  input: ["text"],
27967
28111
  cost: {
27968
- input: 1.75,
27969
- output: 5.5,
28112
+ input: 1.4,
28113
+ output: 4.4,
27970
28114
  cacheRead: 0,
27971
28115
  cacheWrite: 0
27972
28116
  },
27973
28117
  contextWindow: 204800,
27974
- maxTokens: 182476,
28118
+ maxTokens: 128e3,
27975
28119
  featured: true
27976
28120
  },
27977
28121
  "z-ai/glm-5.2": {
@@ -27999,8 +28143,8 @@ var MODELS = {
27999
28143
  },
28000
28144
  input: ["text"],
28001
28145
  cost: {
28002
- input: 1.68,
28003
- output: 5.28,
28146
+ input: 1.54,
28147
+ output: 4.84,
28004
28148
  cacheRead: 0,
28005
28149
  cacheWrite: 0
28006
28150
  },
@@ -28039,7 +28183,41 @@ var MODELS = {
28039
28183
  cacheRead: 0,
28040
28184
  cacheWrite: 0
28041
28185
  },
28042
- contextWindow: 1048576,
28186
+ contextWindow: 1310720,
28187
+ maxTokens: 131072
28188
+ },
28189
+ "z-ai/glm-5.3-flash": {
28190
+ id: "z-ai/glm-5.3-flash",
28191
+ name: "GLM 5.3 Flash",
28192
+ api: "openai-completions",
28193
+ provider: "prime-inference",
28194
+ baseUrl: "https://api.pinference.ai/api/v1",
28195
+ compat: {
28196
+ "supportsStore": false,
28197
+ "supportsDeveloperRole": false,
28198
+ "supportsReasoningEffort": false,
28199
+ "maxTokensField": "max_tokens",
28200
+ "supportsStrictMode": false,
28201
+ "thinkingFormat": "zai"
28202
+ },
28203
+ reasoning: true,
28204
+ thinkingLevelMap: {
28205
+ "off": null,
28206
+ "minimal": null,
28207
+ "low": "low",
28208
+ "medium": null,
28209
+ "high": "high",
28210
+ "xhigh": null,
28211
+ "max": "max"
28212
+ },
28213
+ input: ["text", "image"],
28214
+ cost: {
28215
+ input: 0.15,
28216
+ output: 0.5,
28217
+ cacheRead: 0,
28218
+ cacheWrite: 0
28219
+ },
28220
+ contextWindow: 1310720,
28043
28221
  maxTokens: 131072
28044
28222
  }
28045
28223
  },
@@ -28480,11 +28658,11 @@ var MODELS = {
28480
28658
  cost: {
28481
28659
  input: 2,
28482
28660
  output: 6,
28483
- cacheRead: 0.19999999999999998,
28661
+ cacheRead: 0.25,
28484
28662
  cacheWrite: 0
28485
28663
  },
28486
28664
  contextWindow: 262144,
28487
- maxTokens: 131072
28665
+ maxTokens: 128e3
28488
28666
  },
28489
28667
  "alibaba/qwen3.8-27b": {
28490
28668
  id: "alibaba/qwen3.8-27b",
@@ -28495,14 +28673,48 @@ var MODELS = {
28495
28673
  reasoning: true,
28496
28674
  input: ["text", "image"],
28497
28675
  cost: {
28498
- input: 0.55,
28499
- output: 3.3000000000000003,
28500
- cacheRead: 0.11,
28501
- cacheWrite: 0
28676
+ input: 0.5,
28677
+ output: 3,
28678
+ cacheRead: 0.09999999999999999,
28679
+ cacheWrite: 0.625
28502
28680
  },
28503
28681
  contextWindow: 1e6,
28504
28682
  maxTokens: 131072
28505
28683
  },
28684
+ "alibaba/qwen3.8-flash": {
28685
+ id: "alibaba/qwen3.8-flash",
28686
+ name: "Qwen 3.8 Flash",
28687
+ api: "anthropic-messages",
28688
+ provider: "vercel-ai-gateway",
28689
+ baseUrl: "https://ai-gateway.vercel.sh",
28690
+ reasoning: true,
28691
+ input: ["text", "image"],
28692
+ cost: {
28693
+ input: 0.16,
28694
+ output: 0.47,
28695
+ cacheRead: 0.016,
28696
+ cacheWrite: 0.19999999999999998
28697
+ },
28698
+ contextWindow: 991e3,
28699
+ maxTokens: 128e3
28700
+ },
28701
+ "alibaba/qwen3.8-flash-next": {
28702
+ id: "alibaba/qwen3.8-flash-next",
28703
+ name: "Qwen 3.8 Flash Next",
28704
+ api: "anthropic-messages",
28705
+ provider: "vercel-ai-gateway",
28706
+ baseUrl: "https://ai-gateway.vercel.sh",
28707
+ reasoning: true,
28708
+ input: ["text", "image"],
28709
+ cost: {
28710
+ input: 0.12,
28711
+ output: 0.39999999999999997,
28712
+ cacheRead: 0.01,
28713
+ cacheWrite: 0
28714
+ },
28715
+ contextWindow: 1048576,
28716
+ maxTokens: 1048576
28717
+ },
28506
28718
  "alibaba/qwen3.8-max": {
28507
28719
  id: "alibaba/qwen3.8-max",
28508
28720
  name: "Qwen 3.8 Max",
@@ -28627,6 +28839,28 @@ var MODELS = {
28627
28839
  contextWindow: 1e6,
28628
28840
  maxTokens: 128e3
28629
28841
  },
28842
+ "anthropic/claude-fable-5.1": {
28843
+ id: "anthropic/claude-fable-5.1",
28844
+ name: "Claude Fable 5.1",
28845
+ api: "anthropic-messages",
28846
+ provider: "vercel-ai-gateway",
28847
+ baseUrl: "https://ai-gateway.vercel.sh",
28848
+ reasoning: true,
28849
+ thinkingLevelMap: {
28850
+ "off": null,
28851
+ "xhigh": "xhigh",
28852
+ "max": "max"
28853
+ },
28854
+ input: ["text", "image"],
28855
+ cost: {
28856
+ input: 10,
28857
+ output: 50,
28858
+ cacheRead: 0.25,
28859
+ cacheWrite: 12.5
28860
+ },
28861
+ contextWindow: 1e6,
28862
+ maxTokens: 128e3
28863
+ },
28630
28864
  "anthropic/claude-haiku-4.5": {
28631
28865
  id: "anthropic/claude-haiku-4.5",
28632
28866
  name: "Claude Haiku 4.5",
@@ -29092,8 +29326,8 @@ var MODELS = {
29092
29326
  cacheRead: 7e-3,
29093
29327
  cacheWrite: 0
29094
29328
  },
29095
- contextWindow: 1e6,
29096
- maxTokens: 384e3
29329
+ contextWindow: 1048576,
29330
+ maxTokens: 1048576
29097
29331
  },
29098
29332
  "deepseek/deepseek-v4-pro": {
29099
29333
  id: "deepseek/deepseek-v4-pro",
@@ -29104,13 +29338,13 @@ var MODELS = {
29104
29338
  reasoning: true,
29105
29339
  input: ["text"],
29106
29340
  cost: {
29107
- input: 1.74,
29108
- output: 3.48,
29109
- cacheRead: 0.14,
29341
+ input: 0.66,
29342
+ output: 1.9800000000000002,
29343
+ cacheRead: 0.022,
29110
29344
  cacheWrite: 0
29111
29345
  },
29112
- contextWindow: 1048600,
29113
- maxTokens: 1048600
29346
+ contextWindow: 1e6,
29347
+ maxTokens: 384e3
29114
29348
  },
29115
29349
  "deepseek/deepseek-v4-pro-0813": {
29116
29350
  id: "deepseek/deepseek-v4-pro-0813",
@@ -29384,6 +29618,40 @@ var MODELS = {
29384
29618
  contextWindow: 256e3,
29385
29619
  maxTokens: 32e3
29386
29620
  },
29621
+ "inclusionai/ling-3.0-flash-fin": {
29622
+ id: "inclusionai/ling-3.0-flash-fin",
29623
+ name: "Ling 3.0 Flash Fin",
29624
+ api: "anthropic-messages",
29625
+ provider: "vercel-ai-gateway",
29626
+ baseUrl: "https://ai-gateway.vercel.sh",
29627
+ reasoning: true,
29628
+ input: ["text"],
29629
+ cost: {
29630
+ input: 0,
29631
+ output: 0,
29632
+ cacheRead: 0,
29633
+ cacheWrite: 0
29634
+ },
29635
+ contextWindow: 256e3,
29636
+ maxTokens: 32e3
29637
+ },
29638
+ "inclusionai/ling-3.0-flash-fin-free": {
29639
+ id: "inclusionai/ling-3.0-flash-fin-free",
29640
+ name: "Ling 3.0 Flash Fin (Free)",
29641
+ api: "anthropic-messages",
29642
+ provider: "vercel-ai-gateway",
29643
+ baseUrl: "https://ai-gateway.vercel.sh",
29644
+ reasoning: true,
29645
+ input: ["text"],
29646
+ cost: {
29647
+ input: 0,
29648
+ output: 0,
29649
+ cacheRead: 0,
29650
+ cacheWrite: 0
29651
+ },
29652
+ contextWindow: 256e3,
29653
+ maxTokens: 32e3
29654
+ },
29387
29655
  "interfaze/interfaze-beta": {
29388
29656
  id: "interfaze/interfaze-beta",
29389
29657
  name: "Interfaze Beta",
@@ -29709,7 +29977,7 @@ var MODELS = {
29709
29977
  },
29710
29978
  "minimax/minimax-m2.7": {
29711
29979
  id: "minimax/minimax-m2.7",
29712
- name: "Minimax M2.7",
29980
+ name: "MiniMax M2.7",
29713
29981
  api: "anthropic-messages",
29714
29982
  provider: "vercel-ai-gateway",
29715
29983
  baseUrl: "https://ai-gateway.vercel.sh",
@@ -29726,7 +29994,7 @@ var MODELS = {
29726
29994
  },
29727
29995
  "minimax/minimax-m2.7-free": {
29728
29996
  id: "minimax/minimax-m2.7-free",
29729
- name: "Minimax M2.7 (Free)",
29997
+ name: "MiniMax M2.7 (Free)",
29730
29998
  api: "anthropic-messages",
29731
29999
  provider: "vercel-ai-gateway",
29732
30000
  baseUrl: "https://ai-gateway.vercel.sh",
@@ -29772,8 +30040,8 @@ var MODELS = {
29772
30040
  cacheRead: 0.06,
29773
30041
  cacheWrite: 0
29774
30042
  },
29775
- contextWindow: 1e6,
29776
- maxTokens: 1e6
30043
+ contextWindow: 512e3,
30044
+ maxTokens: 512e3
29777
30045
  },
29778
30046
  "minimax/minimax-m3-free": {
29779
30047
  id: "minimax/minimax-m3-free",
@@ -30075,7 +30343,7 @@ var MODELS = {
30075
30343
  cost: {
30076
30344
  input: 0.95,
30077
30345
  output: 4,
30078
- cacheRead: 0.19,
30346
+ cacheRead: 0.16,
30079
30347
  cacheWrite: 0
30080
30348
  },
30081
30349
  contextWindow: 256e3,
@@ -30211,8 +30479,8 @@ var MODELS = {
30211
30479
  input: ["text"],
30212
30480
  cost: {
30213
30481
  input: 0.049999999999999996,
30214
- output: 0.15,
30215
- cacheRead: 0.049999999999999996,
30482
+ output: 0.19999999999999998,
30483
+ cacheRead: 0.01,
30216
30484
  cacheWrite: 0
30217
30485
  },
30218
30486
  contextWindow: 262144,
@@ -31564,13 +31832,30 @@ var MODELS = {
31564
31832
  reasoning: true,
31565
31833
  input: ["text"],
31566
31834
  cost: {
31567
- input: 0.13199999999999998,
31568
- output: 0.5279999999999999,
31569
- cacheRead: 0.032999999999999995,
31835
+ input: 0.14,
31836
+ output: 0.58,
31837
+ cacheRead: 0.035,
31570
31838
  cacheWrite: 0
31571
31839
  },
31572
- contextWindow: 256e3,
31573
- maxTokens: 128e3
31840
+ contextWindow: 262144,
31841
+ maxTokens: 262144
31842
+ },
31843
+ "tencent/hy4-preview": {
31844
+ id: "tencent/hy4-preview",
31845
+ name: "Tencent Hy4 Preview",
31846
+ api: "anthropic-messages",
31847
+ provider: "vercel-ai-gateway",
31848
+ baseUrl: "https://ai-gateway.vercel.sh",
31849
+ reasoning: true,
31850
+ input: ["text"],
31851
+ cost: {
31852
+ input: 0.834,
31853
+ output: 2.501,
31854
+ cacheRead: 0.041999999999999996,
31855
+ cacheWrite: 0
31856
+ },
31857
+ contextWindow: 1024e3,
31858
+ maxTokens: 64e3
31574
31859
  },
31575
31860
  "thinkingmachines/inkling": {
31576
31861
  id: "thinkingmachines/inkling",
@@ -31640,6 +31925,23 @@ var MODELS = {
31640
31925
  contextWindow: 105e4,
31641
31926
  maxTokens: 131e3
31642
31927
  },
31928
+ "xiaomi/mimo-v2.5-pro-ultraspeed": {
31929
+ id: "xiaomi/mimo-v2.5-pro-ultraspeed",
31930
+ name: "MiMo V2.5 Pro UltraSpeed",
31931
+ api: "anthropic-messages",
31932
+ provider: "vercel-ai-gateway",
31933
+ baseUrl: "https://ai-gateway.vercel.sh",
31934
+ reasoning: true,
31935
+ input: ["text"],
31936
+ cost: {
31937
+ input: 1.305,
31938
+ output: 2.61,
31939
+ cacheRead: 0.0108,
31940
+ cacheWrite: 0
31941
+ },
31942
+ contextWindow: 1048576,
31943
+ maxTokens: 131072
31944
+ },
31643
31945
  "zai/glm-4.5": {
31644
31946
  id: "zai/glm-4.5",
31645
31947
  name: "GLM 4.5",
@@ -31855,11 +32157,28 @@ var MODELS = {
31855
32157
  cost: {
31856
32158
  input: 1.4,
31857
32159
  output: 4.4,
31858
- cacheRead: 0.26,
32160
+ cacheRead: 0.14,
32161
+ cacheWrite: 0
32162
+ },
32163
+ contextWindow: 1e6,
32164
+ maxTokens: 1e6
32165
+ },
32166
+ "zai/glm-5.3-flash": {
32167
+ id: "zai/glm-5.3-flash",
32168
+ name: "GLM 5.3 Flash",
32169
+ api: "anthropic-messages",
32170
+ provider: "vercel-ai-gateway",
32171
+ baseUrl: "https://ai-gateway.vercel.sh",
32172
+ reasoning: true,
32173
+ input: ["text", "image"],
32174
+ cost: {
32175
+ input: 0.15,
32176
+ output: 0.5,
32177
+ cacheRead: 0.03,
31859
32178
  cacheWrite: 0
31860
32179
  },
31861
32180
  contextWindow: 1e6,
31862
- maxTokens: 12800
32181
+ maxTokens: 131e3
31863
32182
  },
31864
32183
  "zai/glm-5v-turbo": {
31865
32184
  id: "zai/glm-5v-turbo",
@@ -32526,6 +32845,50 @@ var MODELS = {
32526
32845
  },
32527
32846
  contextWindow: 1e6,
32528
32847
  maxTokens: 131072
32848
+ },
32849
+ "glm-5.3-flash": {
32850
+ id: "glm-5.3-flash",
32851
+ name: "GLM-5.3-Flash",
32852
+ api: "openai-completions",
32853
+ provider: "zai",
32854
+ baseUrl: "https://api.z.ai/api/coding/paas/v4",
32855
+ compat: {
32856
+ "supportsDeveloperRole": false,
32857
+ "thinkingFormat": "zai",
32858
+ "zaiToolStream": true
32859
+ },
32860
+ reasoning: true,
32861
+ input: ["text", "image"],
32862
+ cost: {
32863
+ input: 0,
32864
+ output: 0,
32865
+ cacheRead: 0,
32866
+ cacheWrite: 0
32867
+ },
32868
+ contextWindow: 1e6,
32869
+ maxTokens: 131072
32870
+ },
32871
+ "glm-5.3-highspeed": {
32872
+ id: "glm-5.3-highspeed",
32873
+ name: "GLM-5.3 Highspeed",
32874
+ api: "openai-completions",
32875
+ provider: "zai",
32876
+ baseUrl: "https://api.z.ai/api/coding/paas/v4",
32877
+ compat: {
32878
+ "supportsDeveloperRole": false,
32879
+ "thinkingFormat": "zai",
32880
+ "zaiToolStream": true
32881
+ },
32882
+ reasoning: true,
32883
+ input: ["text"],
32884
+ cost: {
32885
+ input: 0,
32886
+ output: 0,
32887
+ cacheRead: 0,
32888
+ cacheWrite: 0
32889
+ },
32890
+ contextWindow: 1e6,
32891
+ maxTokens: 131072
32529
32892
  }
32530
32893
  }
32531
32894
  };
@@ -33634,6 +33997,7 @@ function normalizeSessionListRow(source) {
33634
33997
  if (!sessionId || !cwd) throw new Error("The Prime Agent session listing returned an invalid session entry");
33635
33998
  const createdAt = timestampValue(raw.created) ?? timestampValue(raw.modified) ?? (/* @__PURE__ */ new Date()).toISOString();
33636
33999
  const updatedAt = timestampValue(raw.modified) ?? timestampValue(raw.created) ?? createdAt;
34000
+ const isSubagent = typeof raw.runtimeKind === "string" ? raw.runtimeKind === "subagent" : Boolean(raw.rlmChildId ?? raw.rlmParentNodeId ?? raw.parentActiveSessionId ?? raw.parentSessionId ?? raw.parentSessionPath);
33637
34001
  return {
33638
34002
  source,
33639
34003
  sessionId,
@@ -33642,7 +34006,8 @@ function normalizeSessionListRow(source) {
33642
34006
  createdAt,
33643
34007
  updatedAt,
33644
34008
  messageCount: messageCountValue(raw.messageCount),
33645
- firstMessage: typeof raw.firstMessage === "string" ? raw.firstMessage : ""
34009
+ firstMessage: typeof raw.firstMessage === "string" ? raw.firstMessage : "",
34010
+ isSubagent
33646
34011
  };
33647
34012
  }
33648
34013
  function sessionStatus(info, live) {
@@ -33682,7 +34047,8 @@ function handleProjectsGet(_request) {
33682
34047
  updatedAt: session.updatedAt,
33683
34048
  status: sessionStatus(session.source, getBridge().getSession(session.sessionId)),
33684
34049
  messageCount: session.messageCount,
33685
- firstMessage: session.firstMessage ? redactSessionLabelSecrets(session.firstMessage) : ""
34050
+ firstMessage: session.firstMessage ? redactSessionLabelSecrets(session.firstMessage) : "",
34051
+ ...session.isSubagent ? { isSubagent: true } : {}
33686
34052
  };
33687
34053
  })
33688
34054
  });
@@ -33746,7 +34112,8 @@ function handleChatSessionsGet(_request) {
33746
34112
  updatedAt: session.updatedAt,
33747
34113
  status: sessionStatus(session.source, liveSession),
33748
34114
  messageCount: session.messageCount,
33749
- firstMessage: session.firstMessage
34115
+ firstMessage: session.firstMessage,
34116
+ ...session.isSubagent ? { isSubagent: true } : {}
33750
34117
  };
33751
34118
  }));
33752
34119
  return Response.json({ sessions: projectId ? formatted.filter((session) => session.projectId === projectId) : formatted });