mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-21 05:23:19 +00:00
* fix(claude): attribute each call to the project of its own cwd * fix(claude): keep subfolder cwds in their project, count and show a split session once * fix(claude): a deleted subfolder stays its own project
18082 lines
No EOL
1.2 MiB
18082 lines
No EOL
1.2 MiB
var __defProp = Object.defineProperty;
|
||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
var __esm = (fn, res) => function __init() {
|
||
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
||
};
|
||
var __export = (target, all) => {
|
||
for (var name in all)
|
||
__defProp(target, name, { get: all[name], enumerable: true });
|
||
};
|
||
|
||
// src/cache-dir.ts
|
||
import { readFile } from "fs/promises";
|
||
import { homedir } from "os";
|
||
import { join } from "path";
|
||
function getCodeburnCacheDir() {
|
||
const override = process.env["CODEBURN_CACHE_DIR"];
|
||
return override?.trim() ? override : join(homedir(), ".cache", "codeburn");
|
||
}
|
||
async function readExistingTextFile(path) {
|
||
try {
|
||
return { status: "ok", text: await readFile(path, "utf-8") };
|
||
} catch (err) {
|
||
const code = err && typeof err === "object" && "code" in err ? err.code : void 0;
|
||
return { status: code === "ENOENT" ? "absent" : "unreadable" };
|
||
}
|
||
}
|
||
var init_cache_dir = __esm({
|
||
"src/cache-dir.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/data/litellm-snapshot.json
|
||
var litellm_snapshot_default;
|
||
var init_litellm_snapshot = __esm({
|
||
"src/data/litellm-snapshot.json"() {
|
||
litellm_snapshot_default = { "ai21.j2-mid-v1": [125e-7, 125e-7, null, null, null, null], "ai21.j2-ultra-v1": [188e-7, 188e-7, null, null, null, null], "ai21.jamba-1-5-large-v1:0": [2e-6, 8e-6, null, null, null, null], "ai21.jamba-1-5-mini-v1:0": [2e-7, 4e-7, null, null, null, null], "ai21.jamba-instruct-v1:0": [5e-7, 7e-7, null, null, null, null], "us.writer.palmyra-x4-v1:0": [25e-7, 1e-5, null, null, null, null], "us.writer.palmyra-x5-v1:0": [6e-7, 6e-6, null, null, null, null], "writer.palmyra-x4-v1:0": [25e-7, 1e-5, null, null, null, null], "writer.palmyra-x5-v1:0": [6e-7, 6e-6, null, null, null, null], "writer.palmyra-vision-7b": [15e-8, 6e-7, null, null, null, null], "amazon.nova-lite-v1:0": [6e-8, 24e-8, null, 15e-9, null, null], "amazon.nova-2-lite-v1:0": [3e-7, 25e-7, null, 75e-9, null, null], "amazon.nova-2-pro-preview-20251202-v1:0": [21875e-10, 175e-7, null, 546875e-12, null, null], "apac.amazon.nova-2-lite-v1:0": [33e-8, 275e-8, null, 825e-10, null, null], "apac.amazon.nova-2-pro-preview-20251202-v1:0": [21875e-10, 175e-7, null, 546875e-12, null, null], "eu.amazon.nova-2-lite-v1:0": [33e-8, 275e-8, null, 825e-10, null, null], "eu.amazon.nova-2-pro-preview-20251202-v1:0": [21875e-10, 175e-7, null, 546875e-12, null, null], "us.amazon.nova-2-lite-v1:0": [33e-8, 275e-8, null, 825e-10, null, null], "us.amazon.nova-2-pro-preview-20251202-v1:0": [21875e-10, 175e-7, null, 546875e-12, null, null], "amazon.nova-2-multimodal-embeddings-v1:0": [135e-9, 0, null, null, null, null], "amazon.nova-micro-v1:0": [35e-9, 14e-8, null, 875e-11, null, null], "amazon.nova-pro-v1:0": [8e-7, 32e-7, null, 2e-7, null, null], "amazon.nova-2-sonic-v1:0": [33e-8, 275e-8, null, null, null, null], "amazon.rerank-v1:0": [0, 0, null, null, null, null], "amazon.titan-embed-image-v1": [8e-7, 0, null, null, null, null], "amazon.titan-embed-text-v1": [1e-7, 0, null, null, null, null], "amazon.titan-embed-g1-text-02": [1e-7, 0, null, null, null, null], "amazon.titan-embed-text-v2:0": [2e-8, 0, null, null, null, null], "amazon.titan-text-express-v1": [13e-7, 17e-7, null, null, null, null], "amazon.titan-text-lite-v1": [3e-7, 4e-7, null, null, null, null], "amazon.titan-text-premier-v1:0": [5e-7, 15e-7, null, null, null, null], "anthropic.claude-3-5-haiku-20241022-v1:0": [8e-7, 4e-6, 1e-6, 8e-8, null, null], "anthropic.claude-haiku-4-5-20251001-v1:0": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "anthropic.claude-haiku-4-5@20251001": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 3e-5, cacheWrite: 75e-7, cacheRead: 6e-7 }], "anthropic.claude-3-5-sonnet-20241022-v2:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 3e-5, cacheWrite: 75e-7, cacheRead: 6e-7 }], "anthropic.claude-3-7-sonnet-20240620-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "anthropic.claude-3-7-sonnet-20250219-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "anthropic.claude-3-opus-20240229-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "anthropic.claude-instant-v1": [8e-7, 24e-7, null, null, null, null], "anthropic.claude-opus-4-1-20250805-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "anthropic.claude-opus-4-20250514-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "anthropic.claude-opus-4-5-20251101-v1:0": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic.claude-opus-4-6-v1": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "global.anthropic.claude-opus-4-6-v1": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "us.anthropic.claude-opus-4-6-v1": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "eu.anthropic.claude-opus-4-6-v1": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "au.anthropic.claude-opus-4-6-v1": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "anthropic.claude-opus-4-7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic.claude-mythos-preview": [275e-7, 1375e-7, 34375e-9, 275e-8, null, null], "global.anthropic.claude-opus-4-7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "us.anthropic.claude-opus-4-7": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "eu.anthropic.claude-opus-4-7": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "au.anthropic.claude-opus-4-7": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "anthropic.claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "anthropic.claude-fable-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "global.anthropic.claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "global.anthropic.claude-fable-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "us.anthropic.claude-fable-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "us.anthropic.claude-fable-5-1": [11e-6, 55e-6, 1375e-8, 275e-9, null, null], "eu.anthropic.claude-fable-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "eu.anthropic.claude-fable-5-1": [11e-6, 55e-6, 1375e-8, 275e-9, null, null], "anthropic.claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic.claude-opus-5-5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "global.anthropic.claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "global.anthropic.claude-opus-5-5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "us.anthropic.claude-opus-5": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "us.anthropic.claude-opus-5-5": [44e-7, 22e-6, 55e-7, 22e-8, null, null], "eu.anthropic.claude-opus-5": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "eu.anthropic.claude-opus-5-5": [44e-7, 22e-6, 55e-7, 22e-8, null, null], "au.anthropic.claude-opus-5": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "au.anthropic.claude-opus-5-5": [44e-7, 22e-6, 55e-7, 22e-8, null, null], "jp.anthropic.claude-opus-5": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "jp.anthropic.claude-opus-5-5": [44e-7, 22e-6, 55e-7, 22e-8, null, null], "anthropic.claude-opus-4-8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "global.anthropic.claude-opus-4-8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "us.anthropic.claude-opus-4-8": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "eu.anthropic.claude-opus-4-8": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "au.anthropic.claude-opus-4-8": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "jp.anthropic.claude-opus-4-8": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "jp.anthropic.claude-opus-4-7": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "anthropic.claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "global.anthropic.claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "us.anthropic.claude-sonnet-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "eu.anthropic.claude-sonnet-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "au.anthropic.claude-sonnet-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "jp.anthropic.claude-sonnet-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "anthropic.claude-sonnet-4-6": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "global.anthropic.claude-sonnet-4-6": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us.anthropic.claude-sonnet-4-6": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "eu.anthropic.claude-sonnet-4-6": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "au.anthropic.claude-sonnet-4-6": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "jp.anthropic.claude-sonnet-4-6": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "anthropic.claude-sonnet-4-20250514-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "anthropic.claude-sonnet-4-5-20250929-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "apac.amazon.nova-lite-v1:0": [63e-9, 252e-9, null, 1575e-11, null, null], "apac.amazon.nova-micro-v1:0": [37e-9, 148e-9, null, 925e-11, null, null], "apac.amazon.nova-pro-v1:0": [84e-8, 336e-8, null, 21e-8, null, null], "apac.anthropic.claude-haiku-4-5-20251001-v1:0": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "apac.anthropic.claude-sonnet-4-20250514-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "au.anthropic.claude-sonnet-4-5-20250929-v1:0": [33e-7, 165e-7, 4125e-9, 33e-8, null, { threshold: 2e5, input: 66e-7, output: 2475e-8, cacheWrite: 825e-8, cacheRead: 66e-8 }], "babbage-002": [4e-7, 4e-7, null, null, null, null], chatdolphin: [5e-7, 5e-7, null, null, null, null], "gpt-4o-transcribe-diarize": [25e-7, 1e-5, null, null, null, null], "claude-haiku-4-5-20251001": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "claude-haiku-4-5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "claude-sonnet-4-5": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "claude-sonnet-4-5-20250929": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "claude-sonnet-5-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "claude-sonnet-4-6": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "claude-sonnet-4-5-20250929-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "claude-opus-4-5-20251101": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-6-20260205": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-7-20260416": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "claude-fable-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "claude-opus-5-5": [4e-6, 2e-5, 5e-6, 2e-7, 2, null], "claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, 2, null], "claude-opus-4-8": [5e-6, 25e-6, 625e-8, 5e-7, 2, null], "cohere.command-light-text-v14": [3e-7, 6e-7, null, null, null, null], "cohere.command-text-v14": [1e-6, 2e-6, null, null, null, null], "cohere.embed-english-v3": [1e-7, 0, null, null, null, null], "cohere.embed-multilingual-v3": [1e-7, 0, null, null, null, null], "cohere.embed-v4:0": [12e-8, 0, null, null, null, null], "us.cohere.embed-v4:0": [12e-8, 0, null, null, null, null], "global.cohere.embed-v4:0": [12e-8, 0, null, null, null, null], "cohere.rerank-v3-5:0": [0, 0, null, null, null, null], "command-a-03-2025": [25e-7, 1e-5, null, null, null, null], "c4ai-aya-expanse-32b": [5e-7, 15e-7, null, null, null, null], "command-a-plus-05-2026": [0, 0, null, null, null, null], "command-nightly": [1e-6, 2e-6, null, null, null, null], "command-r-08-2024": [15e-8, 6e-7, null, null, null, null], "command-r-plus-08-2024": [25e-7, 1e-5, null, null, null, null], "command-r7b-12-2024": [375e-10, 15e-8, null, null, null, null], "computer-use-preview": [3e-6, 12e-6, null, null, null, null], "deepseek-chat": [28e-8, 42e-8, 0, 28e-9, null, null], "deepseek-reasoner": [28e-8, 42e-8, null, 28e-9, null, null], "davinci-002": [2e-6, 2e-6, null, null, null, null], "deepseek.v3-v1:0": [58e-8, 168e-8, null, null, null, null], "deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], dolphin: [5e-7, 5e-7, null, null, null, null], "deepseek-v3-2-251201": [0, 0, null, null, null, null], "glm-4-7-251222": [0, 0, null, null, null, null], "kimi-k2-thinking-251104": [0, 0, null, null, null, null], "doubao-embedding": [0, 0, null, null, null, null], "doubao-embedding-large": [0, 0, null, null, null, null], "doubao-embedding-large-text-240915": [0, 0, null, null, null, null], "doubao-embedding-large-text-250515": [0, 0, null, null, null, null], "doubao-embedding-text-240715": [0, 0, null, null, null, null], "embed-english-light-v3.0": [1e-7, 0, null, null, null, null], "embed-english-v3.0": [1e-7, 0, null, null, null, null], "embed-multilingual-v3.0": [1e-7, 0, null, null, null, null], "embed-multilingual-light-v3.0": [1e-4, 0, null, null, null, null], "eu.amazon.nova-lite-v1:0": [78e-9, 312e-9, null, 195e-10, null, null], "eu.amazon.nova-micro-v1:0": [46e-9, 184e-9, null, 115e-10, null, null], "eu.amazon.nova-pro-v1:0": [105e-8, 42e-7, null, 2625e-10, null, null], "eu.anthropic.claude-3-5-haiku-20241022-v1:0": [8e-7, 4e-6, 1e-6, 8e-8, null, null], "eu.anthropic.claude-haiku-4-5-20251001-v1:0": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "eu.anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "eu.anthropic.claude-3-5-sonnet-20241022-v2:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "eu.anthropic.claude-3-7-sonnet-20250219-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "eu.anthropic.claude-3-opus-20240229-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "eu.anthropic.claude-opus-4-1-20250805-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "eu.anthropic.claude-opus-4-20250514-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "eu.anthropic.claude-sonnet-4-20250514-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "eu.anthropic.claude-sonnet-4-5-20250929-v1:0": [33e-7, 165e-7, 4125e-9, 33e-8, null, { threshold: 2e5, input: 66e-7, output: 2475e-8, cacheWrite: 825e-8, cacheRead: 66e-8 }], "eu.meta.llama3-2-1b-instruct-v1:0": [13e-8, 13e-8, null, null, null, null], "eu.meta.llama3-2-3b-instruct-v1:0": [19e-8, 19e-8, null, null, null, null], "eu.mistral.pixtral-large-2502-v1:0": [2e-6, 6e-6, null, null, null, null], "fireworks-ai-4.1b-to-16b": [2e-7, 2e-7, null, null, null, null], "fireworks-ai-56b-to-176b": [12e-7, 12e-7, null, null, null, null], "fireworks-ai-above-16b": [9e-7, 9e-7, null, null, null, null], "fireworks-ai-default": [0, 0, null, null, null, null], "fireworks-ai-embedding-150m-to-350m": [16e-9, 0, null, null, null, null], "fireworks-ai-embedding-up-to-150m": [8e-9, 0, null, null, null, null], "fireworks-ai-moe-up-to-56b": [5e-7, 5e-7, null, null, null, null], "fireworks-ai-up-to-4b": [2e-7, 2e-7, null, null, null, null], "ft:babbage-002": [16e-7, 16e-7, null, null, null, null], "ft:davinci-002": [12e-6, 12e-6, null, null, null, null], "ft:gpt-3.5-turbo": [3e-6, 6e-6, null, null, null, null], "ft:gpt-3.5-turbo-0125": [3e-6, 6e-6, null, null, null, null], "ft:gpt-3.5-turbo-0613": [3e-6, 6e-6, null, null, null, null], "ft:gpt-3.5-turbo-1106": [3e-6, 6e-6, null, null, null, null], "ft:gpt-4-0613": [3e-5, 6e-5, null, null, null, null], "ft:gpt-4o-2024-08-06": [375e-8, 15e-6, null, 1875e-9, null, null], "ft:gpt-4o-2024-11-20": [375e-8, 15e-6, 1875e-9, null, null, null], "ft:gpt-4o-mini-2024-07-18": [3e-7, 12e-7, null, 15e-8, null, null], "ft:gpt-4.1-2025-04-14": [3e-6, 12e-6, null, 75e-8, null, null], "ft:gpt-4.1-mini-2025-04-14": [8e-7, 32e-7, null, 2e-7, null, null], "ft:gpt-4.1-nano-2025-04-14": [2e-7, 8e-7, null, 5e-8, null, null], "ft:o4-mini-2025-04-16": [4e-6, 16e-6, null, 1e-6, null, null], "gemini-2.5-flash": [3e-7, 25e-7, null, 3e-8, 1.8, null, [15e-8, 125e-8, null, 3e-8, null, null]], "gemini-2.5-flash-image": [3e-7, 25e-7, null, 3e-8, null, null], "gemini-3-pro-image": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 1e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "gemini-3-pro-image-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "gemini-3.1-flash-image": [5e-7, 3e-6, null, 5e-8, null, null, [25e-8, 15e-7, null, 25e-9, null, null]], "gemini-3.1-flash-image-preview": [5e-7, 3e-6, null, 5e-8, null, null], "gemini-3.1-flash-lite-image": [25e-8, 15e-7, null, 25e-9, null, null, [125e-9, 75e-8, null, 125e-10, null, null]], "gemini-3.1-flash-lite-preview": [25e-8, 15e-7, null, 25e-9, null, null], "gemini-3.1-flash-lite": [25e-8, 15e-7, null, 25e-9, 1.8, null, [125e-9, 75e-8, null, 125e-10, null, null]], "gemini-3.5-flash-lite": [3e-7, 25e-7, null, 3e-8, 1.8, null, [15e-8, 125e-8, null, 15e-9, null, null]], "deep-research-pro-preview-12-2025": [2e-6, 12e-6, null, 2e-7, null, null], "gemini-2.5-flash-lite": [1e-7, 4e-7, null, 1e-8, 1.8, null, [5e-8, 2e-7, null, 1e-8, null, null]], "gemini-2.5-flash-lite-preview-09-2025": [1e-7, 4e-7, null, 1e-8, null, null], "gemini-2.5-flash-preview-09-2025": [3e-7, 25e-7, null, 3e-8, null, null], "gemini-live-2.5-flash-native-audio": [5e-7, 2e-6, null, null, null, null], "gemini-live-2.5-flash-preview-native-audio-09-2025": [5e-7, 2e-6, null, null, null, null], "gemini-2.5-pro": [125e-8, 1e-5, null, 125e-9, 1.8, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: 25e-8, cacheRead: 25e-8 }, [625e-9, 5e-6, null, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: 25e-8, cacheRead: 25e-8 }]], "gemini-3.1-pro-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }]], "gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "gemini-2.5-pro-preview-tts": [1e-6, 2e-5, null, 125e-9, null, null], "gemini-robotics-er-1.5-preview": [3e-7, 25e-7, null, 0, null, null], "gemini-2.5-computer-use-preview-10-2025": [125e-8, 1e-5, null, null, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: null }], "gemini-embedding-001": [15e-8, 0, null, null, null, null], "gemini-embedding-2-preview": [2e-7, 0, null, null, null, null], "gemini-embedding-2": [2e-7, 0, null, null, null, null], "gemini-flash-experimental": [0, 0, null, null, null, null], "gemini-3-flash-preview": [5e-7, 3e-6, null, 5e-8, 1.8, null, [25e-8, 15e-7, null, 5e-8, null, null]], "gemini-omni-flash-preview": [15e-7, 9e-6, null, null, null, null], "gemini-3.5-flash": [15e-7, 9e-6, null, 15e-8, 1.8, null, [75e-8, 45e-7, null, 75e-9, null, null]], "gemini-3.6-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini-3.7-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini-3.8-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini-3.8-flash-cyber": [15e-7, 75e-7, null, 15e-8, 1.8, null, [75e-8, 375e-8, null, 75e-9, null, null]], "google.gemma-3-12b-it": [9e-8, 29e-8, null, null, null, null], "google.gemma-3-27b-it": [23e-8, 38e-8, null, null, null, null], "google.gemma-3-4b-it": [4e-8, 8e-8, null, null, null, null], "global.anthropic.claude-sonnet-4-5-20250929-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "global.anthropic.claude-sonnet-4-20250514-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "global.anthropic.claude-haiku-4-5-20251001-v1:0": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "global.amazon.nova-2-lite-v1:0": [3e-7, 25e-7, null, 75e-9, null, null], "gpt-3.5-turbo": [5e-7, 15e-7, null, null, null, null], "gpt-3.5-turbo-0125": [5e-7, 15e-7, null, null, null, null], "gpt-3.5-turbo-1106": [1e-6, 2e-6, null, null, null, null], "gpt-3.5-turbo-16k": [3e-6, 4e-6, null, null, null, null], "gpt-3.5-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "gpt-3.5-turbo-instruct-0914": [15e-7, 2e-6, null, null, null, null], "gpt-4": [3e-5, 6e-5, null, null, null, null], "gpt-4-0613": [3e-5, 6e-5, null, null, null, null], "gpt-4-1106-preview": [1e-5, 3e-5, null, null, null, null], "gpt-4-turbo": [1e-5, 3e-5, null, null, null, null], "gpt-4-turbo-2024-04-09": [1e-5, 3e-5, null, null, null, null], "gpt-4.1": [2e-6, 8e-6, null, 5e-7, 1.75, null], "gpt-4.1-2025-04-14": [2e-6, 8e-6, null, 5e-7, 1.75, null], "gpt-4.1-mini": [4e-7, 16e-7, null, 1e-7, 1.75, null], "gpt-4.1-mini-2025-04-14": [4e-7, 16e-7, null, 1e-7, 1.75, null], "gpt-4.1-nano": [1e-7, 4e-7, null, 25e-9, 2, null], "gpt-4.1-nano-2025-04-14": [1e-7, 4e-7, null, 25e-9, 2, null], "gpt-4o": [25e-7, 1e-5, null, 125e-8, 1.7, null], "gpt-4o-2024-05-13": [5e-6, 15e-6, null, null, 1.75, null], "gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, 1.7, null], "gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, 1.7, null], "gpt-4o-audio-preview-2024-12-17": [25e-7, 1e-5, null, null, null, null], "gpt-4o-audio-preview-2025-06-03": [25e-7, 1e-5, null, null, null, null], "gpt-audio": [25e-7, 1e-5, null, null, null, null], "gpt-audio-1.5": [25e-7, 1e-5, null, null, null, null], "gpt-audio-2025-08-28": [25e-7, 1e-5, null, null, null, null], "gpt-audio-mini": [6e-7, 24e-7, null, null, null, null], "gpt-audio-mini-2025-12-15": [6e-7, 24e-7, null, null, null, null], "gpt-4o-mini": [15e-8, 6e-7, null, 75e-9, 1.6667, null], "gpt-4o-mini-2024-07-18": [15e-8, 6e-7, null, 75e-9, 1.6667, null], "gpt-4o-mini-audio-preview-2024-12-17": [15e-8, 6e-7, null, null, null, null], "gpt-4o-mini-realtime-preview-2024-12-17": [6e-7, 24e-7, null, 3e-7, null, null], "gpt-4o-mini-search-preview": [15e-8, 6e-7, null, 75e-9, null, null], "gpt-4o-mini-transcribe": [125e-8, 5e-6, null, null, null, null], "gpt-4o-mini-tts": [6e-7, 1e-5, null, null, null, null], "gpt-4o-search-preview": [25e-7, 1e-5, null, 125e-8, null, null], "gpt-4o-transcribe": [25e-7, 1e-5, null, null, null, null], "gpt-image-1.5": [5e-6, 1e-5, null, 125e-8, null, null], "gpt-image-1.5-2025-12-16": [5e-6, 1e-5, null, 125e-8, null, null], "gpt-5": [125e-8, 1e-5, null, 125e-9, 2, null, [625e-9, 5e-6, null, 625e-10, null, null]], "gpt-5-codex": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1": [125e-8, 1e-5, null, 125e-9, 2, null, [625e-9, 5e-6, null, 625e-10, null, null]], "gpt-5.1-codex-mini": [25e-8, 2e-6, null, 25e-9, null, null], "gpt-5.1-codex-max": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1-codex": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1-chat-latest": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1-2025-11-13": [125e-8, 1e-5, null, 125e-9, 2, null, [625e-9, 5e-6, null, 625e-10, null, null]], "gpt-5.2": [175e-8, 14e-6, null, 175e-9, 2, null, [875e-9, 7e-6, null, 875e-10, null, null]], "gpt-5.2-codex": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5.2-chat-latest": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5.2-2025-12-11": [175e-8, 14e-6, null, 175e-9, 2, null, [875e-9, 7e-6, null, 875e-10, null, null]], "gpt-5.2-pro": [21e-6, 168e-6, null, null, null, null], "gpt-5.2-pro-2025-12-11": [21e-6, 168e-6, null, null, null, null], "gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, 2, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }, [5e-6, 25e-6, 625e-8, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 375e-7, cacheWrite: 125e-7, cacheRead: 1e-6 }]], "gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, 2, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }, [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }]], "gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, 2, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }, [5e-8, 25e-8, 625e-10, 5e-9, null, { threshold: 272e3, input: 1e-7, output: 375e-9, cacheWrite: 125e-9, cacheRead: 1e-8 }]], "gpt-5.6": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "gpt-5.6-sol": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, 2, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }, [1e-6, 6e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: 25e-7, cacheRead: 2e-7 }]], "gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, 2, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }, [1e-7, 6e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: 25e-8, cacheRead: 2e-8 }]], "gpt-5.6-cyber": [125e-7, 75e-6, 15625e-9, 125e-8, null, { threshold: 272e3, input: 25e-6, output: 1125e-7, cacheWrite: 3125e-8, cacheRead: 25e-7 }], "daybreak-red-latest": [125e-7, 75e-6, 15625e-9, 125e-8, null, { threshold: 272e3, input: 25e-6, output: 1125e-7, cacheWrite: 3125e-8, cacheRead: 25e-7 }], "gpt-daybreak-red-latest": [125e-7, 75e-6, 15625e-9, 125e-8, null, { threshold: 272e3, input: 25e-6, output: 1125e-7, cacheWrite: 3125e-8, cacheRead: 25e-7 }], "daybreak-blue-latest": [4e-6, 2e-5, 5e-6, 4e-7, null, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }], "gpt-daybreak-blue-latest": [4e-6, 2e-5, 5e-6, 4e-7, null, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }], "chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "gpt-5.5": [5e-6, 3e-5, null, 5e-7, 2.5, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6, fast: 1 }, [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }]], "gpt-5.5-2026-04-23": [5e-6, 3e-5, null, 5e-7, 2.5, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6, fast: 1 }, [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }]], "gpt-5.5-pro": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "gpt-5.5-pro-2026-04-23": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "gpt-5.4": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7, fast: 1 }, [125e-8, 75e-7, null, 13e-8, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }]], "gpt-5.4-2026-03-05": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7, fast: 1 }, [125e-8, 75e-7, null, 13e-8, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }]], "gpt-5.4-pro": [3e-5, 18e-5, null, 3e-6, 2, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "gpt-5.4-pro-2026-03-05": [3e-5, 18e-5, null, 3e-6, 2, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, 2, null, [375e-9, 225e-8, null, 375e-10, null, null]], "gpt-5.4-mini-2026-03-17": [75e-8, 45e-7, null, 75e-9, 2, null, [375e-9, 225e-8, null, 375e-10, null, null]], "gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null, [1e-7, 625e-9, null, 1e-8, null, null]], "gpt-5.4-nano-2026-03-17": [2e-7, 125e-8, null, 2e-8, null, null, [1e-7, 625e-9, null, 1e-8, null, null]], "gpt-5-pro": [15e-6, 12e-5, null, null, null, null], "gpt-5-pro-2025-10-06": [15e-6, 12e-5, null, null, null, null], "gpt-5-2025-08-07": [125e-8, 1e-5, null, 125e-9, 2, null, [625e-9, 5e-6, null, 625e-10, null, null]], "gpt-5-chat": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5-chat-latest": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.3-codex": [175e-8, 14e-6, null, 175e-9, 2, null], "gpt-5.3-chat-latest": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5-mini": [25e-8, 2e-6, null, 25e-9, 1.8, null, [125e-9, 1e-6, null, 125e-10, null, null]], "gpt-5-mini-2025-08-07": [25e-8, 2e-6, null, 25e-9, 1.8, null, [125e-9, 1e-6, null, 125e-10, null, null]], "gpt-5-nano": [5e-8, 4e-7, null, 5e-9, null, null, [25e-9, 2e-7, null, 25e-10, null, null]], "gpt-5-nano-2025-08-07": [5e-8, 4e-7, null, 5e-9, null, null, [25e-9, 2e-7, null, 25e-10, null, null]], "gpt-realtime": [4e-6, 16e-6, null, 4e-7, null, null], "gpt-realtime-1.5": [4e-6, 16e-6, null, 4e-7, null, null], "gpt-realtime-2": [4e-6, 24e-6, null, 4e-7, null, null], "gpt-realtime-2.1": [4e-6, 24e-6, null, 4e-7, null, null], "gpt-realtime-2.1-mini": [6e-7, 24e-7, null, 6e-8, null, null], "gpt-realtime-mini": [6e-7, 24e-7, null, 6e-8, null, null], "gpt-realtime-2025-08-28": [4e-6, 16e-6, null, 4e-7, null, null], "j2-light": [3e-6, 3e-6, null, null, null, null], "j2-mid": [1e-5, 1e-5, null, null, null, null], "j2-ultra": [15e-6, 15e-6, null, null, null, null], "jamba-1.5": [2e-7, 4e-7, null, null, null, null], "jamba-1.5-large": [2e-6, 8e-6, null, null, null, null], "jamba-1.5-large@001": [2e-6, 8e-6, null, null, null, null], "jamba-1.5-mini": [2e-7, 4e-7, null, null, null, null], "jamba-1.5-mini@001": [2e-7, 4e-7, null, null, null, null], "jamba-large-1.6": [2e-6, 8e-6, null, null, null, null], "jamba-large-1.7": [2e-6, 8e-6, null, null, null, null], "jamba-mini-1.6": [2e-7, 4e-7, null, null, null, null], "jamba-mini-1.7": [2e-7, 4e-7, null, null, null, null], "jina-reranker-v2-base-multilingual": [5e-8, 0, null, null, null, null], "jp.anthropic.claude-sonnet-4-5-20250929-v1:0": [33e-7, 165e-7, 4125e-9, 33e-8, null, { threshold: 2e5, input: 66e-7, output: 2475e-8, cacheWrite: 825e-8, cacheRead: 66e-8 }], "jp.anthropic.claude-haiku-4-5-20251001-v1:0": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "meta.llama2-13b-chat-v1": [75e-8, 1e-6, null, null, null, null], "meta.llama2-70b-chat-v1": [195e-8, 256e-8, null, null, null, null], "meta.llama3-1-405b-instruct-v1:0": [532e-8, 16e-6, null, null, null, null], "meta.llama3-1-70b-instruct-v1:0": [99e-8, 99e-8, null, null, null, null], "meta.llama3-1-8b-instruct-v1:0": [22e-8, 22e-8, null, null, null, null], "meta.llama3-2-11b-instruct-v1:0": [35e-8, 35e-8, null, null, null, null], "meta.llama3-2-1b-instruct-v1:0": [1e-7, 1e-7, null, null, null, null], "meta.llama3-2-3b-instruct-v1:0": [15e-8, 15e-8, null, null, null, null], "meta.llama3-2-90b-instruct-v1:0": [2e-6, 2e-6, null, null, null, null], "meta.llama3-3-70b-instruct-v1:0": [72e-8, 72e-8, null, null, null, null], "meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "meta.llama4-maverick-17b-instruct-v1:0": [24e-8, 97e-8, null, null, null, null], "meta.llama4-scout-17b-instruct-v1:0": [17e-8, 66e-8, null, null, null, null], "minimax.minimax-m2": [3e-7, 12e-7, null, null, null, null], "minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "mistral.devstral-2-123b": [4e-7, 2e-6, null, null, null, null], "mistral.magistral-small-2509": [5e-7, 15e-7, null, null, null, null], "mistral.ministral-3-14b-instruct": [2e-7, 2e-7, null, null, null, null], "mistral.ministral-3-3b-instruct": [1e-7, 1e-7, null, null, null, null], "mistral.ministral-3-8b-instruct": [15e-8, 15e-8, null, null, null, null], "mistral.mistral-7b-instruct-v0:2": [15e-8, 2e-7, null, null, null, null], "mistral.mistral-large-2402-v1:0": [4e-6, 12e-6, null, null, null, null], "mistral.mistral-large-2407-v1:0": [3e-6, 9e-6, null, null, null, null], "mistral.mistral-large-3-675b-instruct": [5e-7, 15e-7, null, null, null, null], "mistral.mistral-small-2402-v1:0": [1e-6, 3e-6, null, null, null, null], "mistral.mixtral-8x7b-instruct-v0:1": [45e-8, 7e-7, null, null, null, null], "mistral.voxtral-mini-3b-2507": [4e-8, 4e-8, null, null, null, null], "mistral.voxtral-small-24b-2507": [1e-7, 3e-7, null, null, null, null], "moonshot.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], multimodalembedding: [8e-7, 0, null, null, null, null], "multimodalembedding@001": [8e-7, 0, null, null, null, null], "nvidia.nemotron-nano-12b-v2": [2e-7, 6e-7, null, null, null, null], "nvidia.nemotron-nano-9b-v2": [6e-8, 23e-8, null, null, null, null], "nvidia.nemotron-nano-3-30b": [6e-8, 24e-8, null, null, null, null], "nvidia.nemotron-super-3-120b": [15e-8, 65e-8, null, null, null, null], o1: [15e-6, 6e-5, null, 75e-7, null, null], "o1-2024-12-17": [15e-6, 6e-5, null, 75e-7, null, null], "o1-pro": [15e-5, 6e-4, null, null, null, null], "o1-pro-2025-03-19": [15e-5, 6e-4, null, null, null, null], o3: [2e-6, 8e-6, null, 5e-7, 1.75, null, [1e-6, 4e-6, null, 25e-8, null, null]], "o3-deep-research": [1e-5, 4e-5, null, 25e-7, null, null], "o3-2025-04-16": [2e-6, 8e-6, null, 5e-7, 1.75, null, [1e-6, 4e-6, null, 25e-8, null, null]], "o3-mini": [11e-7, 44e-7, null, 55e-8, null, null], "o3-mini-2025-01-31": [11e-7, 44e-7, null, 55e-8, null, null], "o3-pro": [2e-5, 8e-5, null, null, null, null], "o3-pro-2025-06-10": [2e-5, 8e-5, null, null, null, null], "o4-mini": [11e-7, 44e-7, null, 275e-9, 1.8182, null, [55e-8, 22e-7, null, 138e-9, null, null]], "o4-mini-deep-research": [2e-6, 8e-6, null, 5e-7, null, null], "o4-mini-2025-04-16": [11e-7, 44e-7, null, 275e-9, 1.8182, null, [55e-8, 22e-7, null, 138e-9, null, null]], "omni-moderation-2024-09-26": [0, 0, null, null, null, null], "omni-moderation-latest": [0, 0, null, null, null, null], "openai.gpt-oss-120b-1:0": [15e-8, 6e-7, null, null, null, null], "openai.gpt-oss-20b-1:0": [7e-8, 3e-7, null, null, null, null], "openai.gpt-oss-safeguard-120b": [15e-8, 6e-7, null, null, null, null], "openai.gpt-oss-safeguard-20b": [7e-8, 2e-7, null, null, null, null], "qwen.qwen3-coder-480b-a35b-v1:0": [45e-8, 18e-7, null, null, null, null], "qwen.qwen3-235b-a22b-2507-v1:0": [22e-8, 88e-8, null, null, null, null], "qwen.qwen3-coder-30b-a3b-v1:0": [15e-8, 6e-7, null, null, null, null], "qwen.qwen3-32b-v1:0": [15e-8, 6e-7, null, null, null, null], "qwen.qwen3-next-80b-a3b": [15e-8, 12e-7, null, null, null, null], "qwen.qwen3-vl-235b-a22b": [53e-8, 266e-8, null, null, null, null], "qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "rerank-english-v3.0": [0, 0, null, null, null, null], "rerank-multilingual-v3.0": [0, 0, null, null, null, null], "rerank-v3.5": [0, 0, null, null, null, null], "rerank-v4.0-fast": [0, 0, null, null, null, null], "rerank-v4.0-pro": [0, 0, null, null, null, null], "text-embedding-004": [1e-7, 0, null, null, null, null], "text-embedding-005": [1e-7, 0, null, null, null, null], "text-embedding-3-large": [13e-8, 0, null, null, null, null], "text-embedding-3-small": [2e-8, 0, null, null, null, null], "text-embedding-ada-002": [1e-7, 0, null, null, null, null], "text-embedding-ada-002-v2": [1e-7, 0, null, null, null, null], "text-embedding-large-exp-03-07": [1e-7, 0, null, null, null, null], "text-embedding-preview-0409": [625e-11, 0, null, null, null, null], "text-multilingual-embedding-002": [1e-7, 0, null, null, null, null], "text-unicorn": [1e-5, 28e-6, null, null, null, null], "text-unicorn@001": [1e-5, 28e-6, null, null, null, null], "together-ai-21.1b-41b": [8e-7, 8e-7, null, null, null, null], "together-ai-4.1b-8b": [2e-7, 2e-7, null, null, null, null], "together-ai-41.1b-80b": [9e-7, 9e-7, null, null, null, null], "together-ai-8.1b-21b": [3e-7, 3e-7, null, null, null, null], "together-ai-81.1b-110b": [18e-7, 18e-7, null, null, null, null], "together-ai-embedding-151m-to-350m": [16e-9, 0, null, null, null, null], "together-ai-embedding-up-to-150m": [8e-9, 0, null, null, null, null], "together-ai-up-to-4b": [1e-7, 1e-7, null, null, null, null], "us.amazon.nova-lite-v1:0": [6e-8, 24e-8, null, 15e-9, null, null], "us.amazon.nova-micro-v1:0": [35e-9, 14e-8, null, 875e-11, null, null], "us.amazon.nova-pro-v1:0": [8e-7, 32e-7, null, 2e-7, null, null], "us.anthropic.claude-3-5-haiku-20241022-v1:0": [8e-7, 4e-6, 1e-6, 8e-8, null, null], "us.anthropic.claude-haiku-4-5-20251001-v1:0": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "us.anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us.anthropic.claude-3-5-sonnet-20241022-v2:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us.anthropic.claude-3-7-sonnet-20250219-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us.anthropic.claude-3-opus-20240229-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "us.anthropic.claude-opus-4-1-20250805-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "us.anthropic.claude-sonnet-4-5-20250929-v1:0": [33e-7, 165e-7, 4125e-9, 33e-8, null, { threshold: 2e5, input: 66e-7, output: 2475e-8, cacheWrite: 825e-8, cacheRead: 66e-8 }], "us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, { threshold: 2e5, input: 72e-7, output: 27e-6, cacheWrite: 9e-6, cacheRead: 72e-8 }], "us-gov.anthropic.claude-sonnet-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us-gov.anthropic.claude-opus-4-8": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov.anthropic.claude-opus-5": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov.anthropic.claude-opus-5-5": [48e-7, 24e-6, 6e-6, 24e-8, null, null], "us-gov.anthropic.claude-fable-5-1": [12e-6, 6e-5, 15e-6, 3e-7, null, null], "us-gov.nvidia.nemotron-nano-3-30b": [72e-9, 288e-9, null, null, null, null], "us-gov.nvidia.nemotron-nano-12b-v2": [24e-8, 72e-8, null, null, null, null], "us-gov.nvidia.nemotron-nano-9b-v2": [72e-9, 276e-9, null, null, null, null], "us-gov.nvidia.nemotron-super-3-120b": [18e-8, 78e-8, null, null, null, null], "us-gov.openai.gpt-oss-20b-1:0": [84e-9, 36e-8, null, null, null, null], "us-gov.openai.gpt-oss-120b-1:0": [18e-8, 72e-8, null, null, null, null], "us-gov.xai.grok-4.6": [264e-8, 792e-8, null, 66e-8, null, null], "au.anthropic.claude-haiku-4-5-20251001-v1:0": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "us.anthropic.claude-opus-4-20250514-v1:0": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "us.anthropic.claude-opus-4-5-20251101-v1:0": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "global.anthropic.claude-opus-4-5-20251101-v1:0": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "eu.anthropic.claude-opus-4-5-20251101-v1:0": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "us.anthropic.claude-sonnet-4-20250514-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "us.deepseek.r1-v1:0": [135e-8, 54e-7, null, null, null, null], "us.deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "eu.deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "us.meta.llama3-1-405b-instruct-v1:0": [532e-8, 16e-6, null, null, null, null], "us.meta.llama3-1-70b-instruct-v1:0": [99e-8, 99e-8, null, null, null, null], "us.meta.llama3-1-8b-instruct-v1:0": [22e-8, 22e-8, null, null, null, null], "us.meta.llama3-2-11b-instruct-v1:0": [35e-8, 35e-8, null, null, null, null], "us.meta.llama3-2-1b-instruct-v1:0": [1e-7, 1e-7, null, null, null, null], "us.meta.llama3-2-3b-instruct-v1:0": [15e-8, 15e-8, null, null, null, null], "us.meta.llama3-2-90b-instruct-v1:0": [2e-6, 2e-6, null, null, null, null], "us.meta.llama3-3-70b-instruct-v1:0": [72e-8, 72e-8, null, null, null, null], "us.meta.llama4-maverick-17b-instruct-v1:0": [24e-8, 97e-8, null, null, null, null], "us.meta.llama4-scout-17b-instruct-v1:0": [17e-8, 66e-8, null, null, null, null], "us.mistral.pixtral-large-2502-v1:0": [2e-6, 6e-6, null, null, null, null], "zai.glm-4.7": [6e-7, 22e-7, null, null, null, null], "zai.glm-5": [1e-6, 32e-7, null, null, null, null], "zai.glm-4.7-flash": [7e-8, 4e-7, null, null, null, null], "gpt-4o-mini-tts-2025-12-15": [6e-7, 1e-5, null, null, null, null], "gpt-4o-mini-transcribe-2025-03-20": [125e-8, 5e-6, null, null, null, null], "gpt-4o-mini-transcribe-2025-12-15": [125e-8, 5e-6, null, null, null, null], "gpt-5-search-api": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5-search-api-2025-10-14": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-realtime-mini-2025-12-15": [6e-7, 24e-7, null, 6e-8, null, null], "chatgpt-image-latest": [5e-6, 1e-5, null, 125e-8, null, null], "gemini-2.0-flash-exp-image-generation": [0, 0, null, null, null, null], "gemini-2.5-flash-native-audio-latest": [5e-7, 2e-6, null, null, null, null], "gemini-2.5-flash-native-audio-preview-09-2025": [5e-7, 2e-6, null, null, null, null], "gemini-2.5-flash-native-audio-preview-12-2025": [5e-7, 2e-6, null, null, null, null], "gemini-3.1-flash-live-preview": [75e-8, 45e-7, null, null, null, null], "gemini-3.8-live": [75e-8, 45e-7, null, null, null, null], "gemini-3.8-live-extended-thinking": [75e-8, 45e-7, null, null, null, null], "gemini-2.5-flash-preview-tts": [5e-7, 1e-5, null, null, null, null], "gemini-flash-latest": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini-flash-lite-latest": [3e-7, 25e-7, null, 3e-8, null, null, [15e-8, 125e-8, null, 2e-8, null, null]], "gemini-pro-latest": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "gemini-exp-1206": [3e-7, 25e-7, null, 3e-8, null, null], "us.openai.gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, null, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "global.openai.gpt-5.6-sol": [4e-6, 2e-5, 5e-6, 4e-7, null, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }], "us.openai.gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "global.openai.gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "us.openai.gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, null, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "us.openai.gpt-5.4": [275e-8, 165e-7, null, 275e-9, null, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8 }], "global.openai.gpt-5.4": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "us.openai.gpt-5.5": [55e-7, 33e-6, null, 55e-8, null, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7 }], "global.openai.gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "global.openai.gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }], "us.openai.gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "us.openai.gpt-6-sol": [22e-7, 11e-6, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 165e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "us.openai.gpt-6-luna": [11e-8, 55e-8, 1375e-10, 11e-9, null, { threshold: 272e3, input: 22e-8, output: 825e-9, cacheWrite: 275e-9, cacheRead: 22e-9 }], "global.openai.gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openai.gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "global.openai.gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai.gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "global.openai.gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "us.xai.grok-4.6": [22e-7, 66e-7, null, 55e-8, null, null], "global.xai.grok-4.6": [2e-6, 6e-6, null, 5e-7, null, null], "deepseek-flash": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek-v4-flash": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek-v4-flash-vision-exp": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek-v4-pro": [132e-8, 396e-8, 0, 44e-9, null, null], "claude-mythos-5": [1e-5, 5e-5, 125e-7, 1e-6], "claude-mythos-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "claude-mythos-preview": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "gpt-5.5-cyber": [125e-7, 75e-6, null, 125e-8, null, null], "gpt-rosalind-research": [5e-6, 25e-6, null, 5e-7, null, null], "moonshotai.kimi-k3": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "global.moonshotai.kimi-k3": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us.moonshotai.kimi-k3": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "anthropic.claude-mythos-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "global.anthropic.claude-mythos-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "us.anthropic.claude-mythos-5-1": [11e-6, 55e-6, 1375e-8, 275e-9, null, null], "us.anthropic.claude-mythos-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "apac.anthropic.claude-fable-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "au.anthropic.claude-fable-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "apac.anthropic.claude-opus-4-7": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "apac.anthropic.claude-opus-4-8": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "apac.anthropic.claude-opus-5": [55e-7, 275e-7, 6875e-9, 55e-8, null, null], "apac.anthropic.claude-opus-5-5": [44e-7, 22e-6, 55e-7, 22e-8, null, null], "apac.anthropic.claude-sonnet-4-6": [33e-7, 165e-7, 4125e-9, 33e-8, null, null], "apac.anthropic.claude-sonnet-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "us.anthropic.claude-mythos-preview": [275e-7, 1375e-7, 34375e-9, 275e-8, null, null], "apac.anthropic.claude-mythos-preview": [275e-7, 1375e-7, 34375e-9, 275e-8, null, null], "au.anthropic.claude-mythos-preview": [275e-7, 1375e-7, 34375e-9, 275e-8, null, null], "deepseek.r1-v1:0": [135e-8, 54e-7, null, null, null, null], "mistral.pixtral-large-2502-v1:0": [2e-6, 6e-6, null, null, null, null], "anthropic.claude-sonnet-5-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "apac.anthropic.claude-sonnet-5-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "au.anthropic.claude-sonnet-5-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "eu.anthropic.claude-sonnet-5-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "global.anthropic.claude-sonnet-5-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "jp.anthropic.claude-sonnet-5-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "us-gov.anthropic.claude-sonnet-5-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us.anthropic.claude-sonnet-5-5": [22e-7, 11e-6, 275e-8, 22e-8, null, null], "anyscale/HuggingFaceH4/zephyr-7b-beta": [15e-8, 15e-8, null, null, null, null], "HuggingFaceH4/zephyr-7b-beta": [15e-8, 15e-8, null, null, null, null], "anyscale/codellama/CodeLlama-34b-Instruct-hf": [1e-6, 1e-6, null, null, null, null], "codellama/CodeLlama-34b-Instruct-hf": [1e-6, 1e-6, null, null, null, null], "anyscale/codellama/CodeLlama-70b-Instruct-hf": [1e-6, 1e-6, null, null, null, null], "codellama/CodeLlama-70b-Instruct-hf": [1e-6, 1e-6, null, null, null, null], "anyscale/google/gemma-7b-it": [15e-8, 15e-8, null, null, null, null], "google/gemma-7b-it": [15e-8, 15e-8, null, null, null, null], "anyscale/meta-llama/Llama-2-13b-chat-hf": [25e-8, 25e-8, null, null, null, null], "meta-llama/Llama-2-13b-chat-hf": [25e-8, 25e-8, null, null, null, null], "anyscale/meta-llama/Llama-2-70b-chat-hf": [1e-6, 1e-6, null, null, null, null], "meta-llama/Llama-2-70b-chat-hf": [1e-6, 1e-6, null, null, null, null], "anyscale/meta-llama/Llama-2-7b-chat-hf": [15e-8, 15e-8, null, null, null, null], "meta-llama/Llama-2-7b-chat-hf": [15e-8, 15e-8, null, null, null, null], "anyscale/meta-llama/Meta-Llama-3-70B-Instruct": [1e-6, 1e-6, null, null, null, null], "meta-llama/Meta-Llama-3-70B-Instruct": [1e-6, 1e-6, null, null, null, null], "anyscale/meta-llama/Meta-Llama-3-8B-Instruct": [15e-8, 15e-8, null, null, null, null], "meta-llama/Meta-Llama-3-8B-Instruct": [15e-8, 15e-8, null, null, null, null], "anyscale/mistralai/Mistral-7B-Instruct-v0.1": [15e-8, 15e-8, null, null, null, null], "mistralai/Mistral-7B-Instruct-v0.1": [15e-8, 15e-8, null, null, null, null], "anyscale/mistralai/Mixtral-8x22B-Instruct-v0.1": [9e-7, 9e-7, null, null, null, null], "mistralai/Mixtral-8x22B-Instruct-v0.1": [9e-7, 9e-7, null, null, null, null], "anyscale/mistralai/Mixtral-8x7B-Instruct-v0.1": [15e-8, 15e-8, null, null, null, null], "mistralai/Mixtral-8x7B-Instruct-v0.1": [15e-8, 15e-8, null, null, null, null], "azure/ada": [1e-7, 0, null, null, null, null], ada: [1e-7, 0, null, null, null, null], "azure/codex-mini": [15e-7, 6e-6, null, 375e-9, null, null], "codex-mini": [15e-7, 6e-6, null, 375e-9, null, null], "azure/command-r-plus": [3e-6, 15e-6, null, null, null, null], "command-r-plus": [3e-6, 15e-6, null, null, null, null], "azure_ai/claude-haiku-4-5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "azure_ai/claude-opus-4-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "azure_ai/claude-opus-4-6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "azure_ai/claude-opus-4-7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "azure_ai/claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "azure_ai/claude-fable-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "azure_ai/claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "azure_ai/claude-opus-5-5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "azure_ai/claude-opus-4-8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "azure_ai/claude-sonnet-4-5": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "azure_ai/claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "azure_ai/claude-sonnet-4-6": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "azure/computer-use-preview": [3e-6, 12e-6, null, null, null, null], "azure_ai/gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "gpt-oss-120b": [15e-8, 6e-7, null, 15e-9, 1.2, null], "azure_ai/gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "azure_ai/gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "azure_ai/gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "azure_ai/gpt-5.5": [5e-6, 3e-5, null, 5e-7, 2, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure_ai/gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "azure_ai/codex-mini": [15e-7, 6e-6, null, 375e-9, null, null], "azure_ai/gpt-5.5-2026-04-23": [5e-6, 3e-5, null, 5e-7, 2, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure_ai/gpt-5.5-2026-04-24": [5e-6, 3e-5, null, 5e-7, 2, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "gpt-5.5-2026-04-24": [5e-6, 3e-5, null, 5e-7, 2, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure_ai/gpt-5.4": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "azure_ai/gpt-5.4-2026-03-05": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "azure_ai/gpt-5.4-pro": [3e-5, 18e-5, null, 3e-6, 2, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "azure_ai/gpt-5.4-pro-2026-03-05": [3e-5, 18e-5, null, 3e-6, 2, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "azure_ai/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, 2, null], "azure_ai/gpt-5.4-mini-2026-03-17": [75e-8, 45e-7, null, 75e-9, 2, null], "azure_ai/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, 2, null], "azure_ai/gpt-5.4-nano-2026-03-17": [2e-7, 125e-8, null, 2e-8, 2, null], "azure_ai/model_router": [14e-8, 0, null, null, null, null], model_router: [14e-8, 0, null, null, null, null], "azure_ai/model-router": [14e-8, 0, null, null, null, null], "model-router": [14e-8, 0, null, null, null, null], "azure/eu/gpt-4o-2024-08-06": [275e-8, 11e-6, null, 1375e-9, null, null], "eu/gpt-4o-2024-08-06": [275e-8, 11e-6, null, 1375e-9, null, null], "azure/eu/gpt-4o-2024-11-20": [275e-8, 11e-6, 138e-8, 1375e-9, null, null], "eu/gpt-4o-2024-11-20": [275e-8, 11e-6, 138e-8, 1375e-9, null, null], "azure/eu/gpt-4o-mini-2024-07-18": [165e-9, 66e-8, null, 83e-9, null, null], "eu/gpt-4o-mini-2024-07-18": [165e-9, 66e-8, null, 83e-9, null, null], "azure/eu/gpt-4o-mini-realtime-preview-2024-12-17": [66e-8, 264e-8, null, 33e-8, null, null], "eu/gpt-4o-mini-realtime-preview-2024-12-17": [66e-8, 264e-8, null, 33e-8, null, null], "azure/eu/gpt-4o-realtime-preview-2024-10-01": [55e-7, 22e-6, null, 275e-8, null, null], "eu/gpt-4o-realtime-preview-2024-10-01": [55e-7, 22e-6, null, 275e-8, null, null], "azure/eu/gpt-4o-realtime-preview-2024-12-17": [55e-7, 22e-6, null, 275e-8, null, null], "eu/gpt-4o-realtime-preview-2024-12-17": [55e-7, 22e-6, null, 275e-8, null, null], "azure/eu/gpt-5-2025-08-07": [1375e-9, 11e-6, null, 1375e-10, 2, null], "eu/gpt-5-2025-08-07": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/eu/gpt-5-mini-2025-08-07": [275e-9, 22e-7, null, 275e-10, 1.8, null], "eu/gpt-5-mini-2025-08-07": [275e-9, 22e-7, null, 275e-10, 1.8, null], "azure/eu/gpt-5.1": [1375e-9, 11e-6, null, 1375e-10, 2, null], "eu/gpt-5.1": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/eu/gpt-5.1-codex": [1375e-9, 11e-6, null, 1375e-10, null, null], "eu/gpt-5.1-codex": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/eu/gpt-5.1-codex-mini": [275e-9, 22e-7, null, 275e-10, null, null], "eu/gpt-5.1-codex-mini": [275e-9, 22e-7, null, 275e-10, null, null], "azure/eu/gpt-5-nano-2025-08-07": [55e-9, 44e-8, null, 55e-10, null, null], "eu/gpt-5-nano-2025-08-07": [55e-9, 44e-8, null, 55e-10, null, null], "azure/eu/o1-2024-12-17": [165e-7, 66e-6, null, 825e-8, null, null], "eu/o1-2024-12-17": [165e-7, 66e-6, null, 825e-8, null, null], "azure/eu/o1-mini-2024-09-12": [121e-8, 484e-8, null, 605e-9, null, null], "eu/o1-mini-2024-09-12": [121e-8, 484e-8, null, 605e-9, null, null], "azure/eu/o3-mini-2025-01-31": [121e-8, 484e-8, null, 605e-9, null, null], "eu/o3-mini-2025-01-31": [121e-8, 484e-8, null, 605e-9, null, null], "azure/global-standard/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "global-standard/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "azure/global-standard/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "global-standard/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "azure/global-standard/gpt-4o-mini": [15e-8, 6e-7, null, null, null, null], "global-standard/gpt-4o-mini": [15e-8, 6e-7, null, null, null, null], "azure/global/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "global/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "azure/global/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "global/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "azure/global/gpt-5.1": [125e-8, 1e-5, null, 125e-9, 2, null], "global/gpt-5.1": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/global/gpt-5.1-codex": [125e-8, 1e-5, null, 125e-9, null, null], "global/gpt-5.1-codex": [125e-8, 1e-5, null, 125e-9, null, null], "azure/global/gpt-5.1-codex-mini": [25e-8, 2e-6, null, 25e-9, null, null], "global/gpt-5.1-codex-mini": [25e-8, 2e-6, null, 25e-9, null, null], "azure/gpt-3.5-turbo": [5e-7, 15e-7, null, null, null, null], "azure/gpt-3.5-turbo-instruct-0914": [15e-7, 2e-6, null, null, null, null], "azure/gpt-35-turbo": [5e-7, 15e-7, null, null, null, null], "gpt-35-turbo": [5e-7, 15e-7, null, null, null, null], "azure/gpt-35-turbo-16k": [3e-6, 4e-6, null, null, null, null], "gpt-35-turbo-16k": [3e-6, 4e-6, null, null, null, null], "azure/gpt-35-turbo-16k-0613": [3e-6, 4e-6, null, null, null, null], "gpt-35-turbo-16k-0613": [3e-6, 4e-6, null, null, null, null], "azure/gpt-35-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "gpt-35-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "azure/gpt-35-turbo-instruct-0914": [15e-7, 2e-6, null, null, null, null], "gpt-35-turbo-instruct-0914": [15e-7, 2e-6, null, null, null, null], "azure/gpt-4": [3e-5, 6e-5, null, null, null, null], "azure/gpt-4-0125-preview": [1e-5, 3e-5, null, null, null, null], "gpt-4-0125-preview": [1e-5, 3e-5, null, null, null, null], "azure/gpt-4-0613": [3e-5, 6e-5, null, null, null, null], "azure/gpt-4-1106-preview": [1e-5, 3e-5, null, null, null, null], "azure/gpt-4-32k": [6e-5, 12e-5, null, null, null, null], "gpt-4-32k": [6e-5, 12e-5, null, null, null, null], "azure/gpt-4-32k-0613": [6e-5, 12e-5, null, null, null, null], "gpt-4-32k-0613": [6e-5, 12e-5, null, null, null, null], "azure/gpt-4-turbo": [1e-5, 3e-5, null, null, null, null], "azure/gpt-4-turbo-2024-04-09": [1e-5, 3e-5, null, null, null, null], "azure/gpt-4-turbo-vision-preview": [1e-5, 3e-5, null, null, null, null], "gpt-4-turbo-vision-preview": [1e-5, 3e-5, null, null, null, null], "azure/gpt-4.1": [2e-6, 8e-6, null, 5e-7, 1.75, null], "azure/gpt-4.1-2025-04-14": [2e-6, 8e-6, null, 5e-7, 1.75, null], "azure/gpt-4.1-mini": [4e-7, 16e-7, null, 1e-7, 1.75, null], "azure/gpt-4.1-mini-2025-04-14": [4e-7, 16e-7, null, 1e-7, 1.75, null], "azure/gpt-4.1-nano": [1e-7, 4e-7, null, 25e-9, null, null], "azure/gpt-4.1-nano-2025-04-14": [1e-7, 4e-7, null, 25e-9, null, null], "azure/gpt-4.5-preview": [75e-6, 15e-5, null, 375e-7, null, null], "gpt-4.5-preview": [75e-6, 15e-5, null, 375e-7, null, null], "azure/gpt-4o": [25e-7, 1e-5, null, 125e-8, null, null], "azure/gpt-4o-2024-05-13": [5e-6, 15e-6, null, null, null, null], "azure/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "azure/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "azure/gpt-audio": [25e-7, 1e-5, null, null, null, null], "azure/gpt-audio-2025-08-28": [25e-7, 1e-5, null, null, null, null], "azure/gpt-audio-1.5": [25e-7, 1e-5, null, null, null, null], "azure/gpt-audio-1.5-2026-02-23": [25e-7, 1e-5, null, null, null, null], "gpt-audio-1.5-2026-02-23": [25e-7, 1e-5, null, null, null, null], "azure/gpt-audio-mini": [6e-7, 24e-7, null, null, null, null], "azure/gpt-audio-mini-2025-10-06": [6e-7, 24e-7, null, null, null, null], "gpt-audio-mini-2025-10-06": [6e-7, 24e-7, null, null, null, null], "azure/gpt-4o-audio-preview-2024-12-17": [25e-7, 1e-5, null, null, null, null], "azure/gpt-4o-mini": [15e-8, 6e-7, null, 75e-9, null, null], "azure/gpt-4o-mini-2024-07-18": [15e-8, 6e-7, null, 75e-9, null, null], "azure/gpt-4o-mini-audio-preview-2024-12-17": [25e-7, 1e-5, null, null, null, null], "azure/gpt-4o-mini-realtime-preview-2024-12-17": [6e-7, 24e-7, null, 3e-7, null, null], "azure/gpt-realtime": [4e-6, 16e-6, null, 4e-7, null, null], "azure/gpt-realtime-2025-08-28": [4e-6, 16e-6, null, 4e-7, null, null], "azure/gpt-realtime-1.5": [4e-6, 16e-6, null, 4e-7, null, null], "azure/gpt-realtime-1.5-2026-02-23": [4e-6, 16e-6, null, 4e-7, null, null], "gpt-realtime-1.5-2026-02-23": [4e-6, 16e-6, null, 4e-7, null, null], "azure/gpt-realtime-2.1": [4e-6, 24e-6, null, 4e-7, null, null], "azure/gpt-realtime-2.1-mini": [6e-7, 24e-7, null, 6e-8, null, null], "azure/gpt-realtime-mini": [6e-7, 24e-7, null, 6e-8, null, null], "azure/gpt-realtime-mini-2025-10-06": [6e-7, 24e-7, null, 6e-8, null, null], "gpt-realtime-mini-2025-10-06": [6e-7, 24e-7, null, 6e-8, null, null], "azure/gpt-4o-mini-transcribe": [125e-8, 5e-6, null, null, null, null], "azure/gpt-4o-mini-tts": [6e-7, 1e-5, null, null, null, null], "azure/gpt-4o-realtime-preview-2024-10-01": [5e-6, 2e-5, null, 25e-7, null, null], "gpt-4o-realtime-preview-2024-10-01": [5e-6, 2e-5, null, 25e-7, null, null], "azure/gpt-4o-realtime-preview-2024-12-17": [5e-6, 2e-5, null, 25e-7, null, null], "gpt-4o-realtime-preview-2024-12-17": [5e-6, 2e-5, null, 25e-7, null, null], "azure/gpt-4o-transcribe": [25e-7, 1e-5, null, null, null, null], "azure/gpt-4o-transcribe-diarize": [25e-7, 1e-5, null, null, null, null], "azure/gpt-5.1-2025-11-13": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/gpt-5.1-codex-2025-11-13": [125e-8, 1e-5, null, 125e-9, 2, null], "gpt-5.1-codex-2025-11-13": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/gpt-5.1-codex-mini-2025-11-13": [25e-8, 2e-6, null, 25e-9, 1.8, null], "gpt-5.1-codex-mini-2025-11-13": [25e-8, 2e-6, null, 25e-9, 1.8, null], "azure/gpt-5": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/gpt-5-2025-08-07": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/gpt-5-codex": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5-mini": [25e-8, 2e-6, null, 25e-9, 1.8, null], "azure/gpt-5-mini-2025-08-07": [25e-8, 2e-6, null, 25e-9, 1.8, null], "azure/gpt-5-nano": [5e-8, 4e-7, null, 5e-9, null, null], "azure/gpt-5-nano-2025-08-07": [5e-8, 4e-7, null, 5e-9, null, null], "azure/gpt-5-pro": [15e-6, 12e-5, null, null, null, null], "azure/gpt-5.1": [125e-8, 1e-5, null, 125e-9, 2, null], "azure/gpt-5-chat": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5.1-chat": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1-chat": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5.2-chat": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5.2-chat": [175e-8, 14e-6, null, 175e-9, null, null], "azure/gpt-5.3-chat": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5.3-chat": [175e-8, 14e-6, null, 175e-9, null, null], "azure/us/gpt-5.1-chat": [1375e-9, 11e-6, null, 1375e-10, null, null], "us/gpt-5.1-chat": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/us/gpt-5.2-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "us/gpt-5.2-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/us/gpt-5.3-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "us/gpt-5.3-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/eu/gpt-5.1-chat": [1375e-9, 11e-6, null, 1375e-10, null, null], "eu/gpt-5.1-chat": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/eu/gpt-5.2-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "eu/gpt-5.2-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/eu/gpt-5.3-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "eu/gpt-5.3-chat": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/us/o1-preview": [165e-7, 66e-6, null, 825e-8, null, null], "us/o1-preview": [165e-7, 66e-6, null, 825e-8, null, null], "azure/eu/o1-preview": [165e-7, 66e-6, null, 825e-8, null, null], "eu/o1-preview": [165e-7, 66e-6, null, 825e-8, null, null], "azure/gpt-5.1-codex": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5.1-codex-max": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5.1-codex-mini": [25e-8, 2e-6, null, 25e-9, null, null], "azure/gpt-5.2": [175e-8, 14e-6, null, 175e-9, 2, null], "azure/gpt-5.2-2025-12-11": [175e-8, 14e-6, null, 175e-9, 2, null], "azure/gpt-5.2-codex": [175e-8, 14e-6, null, 175e-9, null, null], "azure/gpt-5.3-codex": [175e-8, 14e-6, null, 175e-9, 2, null], "azure/gpt-5.2-pro": [21e-6, 168e-6, null, null, null, null], "azure/gpt-5.2-pro-2025-12-11": [21e-6, 168e-6, null, null, null, null], "azure/gpt-5.4": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }, [125e-8, 75e-7, null, 25e-8, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }]], "azure/us/gpt-5.4": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "us/gpt-5.4": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "azure/eu/gpt-5.4": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "eu/gpt-5.4": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "azure/gpt-5.4-2026-03-05": [25e-7, 15e-6, null, 25e-8, 2, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }, [125e-8, 75e-7, null, 25e-8, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }]], "azure/us/gpt-5.4-2026-03-05": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "us/gpt-5.4-2026-03-05": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "azure/eu/gpt-5.4-2026-03-05": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "eu/gpt-5.4-2026-03-05": [275e-8, 165e-7, null, 275e-9, 2, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8, fast: 1 }], "azure/gpt-5.4-pro": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }, [15e-6, 9e-5, null, 3e-6, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: 6e-6 }]], "azure/gpt-5.4-pro-2026-03-05": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }, [15e-6, 9e-5, null, 3e-6, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: 6e-6 }]], "azure/gpt-5.6": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }], "azure/gpt-5.6-sol": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "azure/gpt-5.6-sol-2026-07-09": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "gpt-5.6-sol-2026-07-09": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "azure/gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, 2, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }, [1e-6, 6e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: 25e-7, cacheRead: 2e-7 }]], "azure/gpt-5.6-terra-2026-07-09": [2e-6, 12e-6, 25e-7, 2e-7, 2, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }, [1e-6, 6e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: 25e-7, cacheRead: 2e-7 }]], "gpt-5.6-terra-2026-07-09": [2e-6, 12e-6, 25e-7, 2e-7, 2, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }, [1e-6, 6e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: 25e-7, cacheRead: 2e-7 }]], "azure/gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, 2, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }, [1e-7, 6e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: 25e-8, cacheRead: 2e-8 }]], "azure/gpt-5.6-luna-2026-07-09": [2e-7, 12e-7, 25e-8, 2e-8, 2, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }, [1e-7, 6e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: 25e-8, cacheRead: 2e-8 }]], "gpt-5.6-luna-2026-07-09": [2e-7, 12e-7, 25e-8, 2e-8, 2, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }, [1e-7, 6e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: 25e-8, cacheRead: 2e-8 }]], "azure/gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "azure/gpt-6-astra-2026-09-03": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "gpt-6-astra-2026-09-03": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "azure/gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "azure/gpt-6-luna-2026-09-22": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "gpt-6-luna-2026-09-22": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "azure/gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "azure/gpt-6-sol-2026-09-22": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "gpt-6-sol-2026-09-22": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "azure/gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "azure/chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "azure/us/gpt-5.6": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "us/gpt-5.6": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "azure/us/gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "us/gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "azure/us/gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, 2, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "us/gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, 2, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "azure/us/gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, 2, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "us/gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, 2, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "azure/us/gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "us/gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "azure/us/gpt-6-luna": [11e-8, 55e-8, 1375e-10, 11e-9, null, { threshold: 272e3, input: 22e-8, output: 825e-9, cacheWrite: 275e-9, cacheRead: 22e-9 }], "us/gpt-6-luna": [11e-8, 55e-8, 1375e-10, 11e-9, null, { threshold: 272e3, input: 22e-8, output: 825e-9, cacheWrite: 275e-9, cacheRead: 22e-9 }], "azure/us/gpt-6-sol": [22e-7, 11e-6, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 165e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "us/gpt-6-sol": [22e-7, 11e-6, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 165e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "azure/us/gpt-chat-latest": [55e-7, 33e-6, null, 55e-8, null, null], "us/gpt-chat-latest": [55e-7, 33e-6, null, 55e-8, null, null], "azure/eu/gpt-5.6": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "eu/gpt-5.6": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "azure/eu/gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "eu/gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, 2, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "azure/eu/gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, 2, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "eu/gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, 2, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "azure/eu/gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, 2, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "eu/gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, 2, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "azure/gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure/us/gpt-5.5": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "us/gpt-5.5": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/eu/gpt-5.5": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "eu/gpt-5.5": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/gpt-5.5-2026-04-23": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure/gpt-5.5-2026-04-24": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure/us/gpt-5.5-2026-04-23": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "us/gpt-5.5-2026-04-23": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/us/gpt-5.5-2026-04-24": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "us/gpt-5.5-2026-04-24": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/eu/gpt-5.5-2026-04-23": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "eu/gpt-5.5-2026-04-23": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/eu/gpt-5.5-2026-04-24": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "eu/gpt-5.5-2026-04-24": [55e-7, 33e-6, null, 55e-8, 2.5, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7, fast: 1 }], "azure/gpt-5.5-pro": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "azure/gpt-5.5-pro-2026-04-23": [3e-5, 18e-5, null, 3e-6, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: 6e-6 }], "azure/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, 2, null, [375e-9, 225e-8, null, 375e-10, null, null]], "azure/gpt-5.4-mini-2026-03-17": [75e-8, 45e-7, null, 75e-9, 2, null, [375e-9, 225e-8, null, 375e-10, null, null]], "azure/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null, [1e-7, 625e-9, null, 1e-8, null, null]], "azure/gpt-5.4-nano-2026-03-17": [2e-7, 125e-8, null, 2e-8, null, null, [1e-7, 625e-9, null, 1e-8, null, null]], "azure/mistral-large-2402": [8e-6, 24e-6, null, null, null, null], "mistral-large-2402": [8e-6, 24e-6, null, null, null, null], "azure/mistral-large-latest": [8e-6, 24e-6, null, null, null, null], "mistral-large-latest": [5e-7, 15e-7, null, 5e-8, null, null], "azure/o1": [15e-6, 6e-5, null, 75e-7, null, null], "azure/o1-2024-12-17": [15e-6, 6e-5, null, 75e-7, null, null], "azure/o1-mini": [11e-7, 44e-7, null, 55e-8, null, null], "o1-mini": [11e-7, 44e-7, null, 55e-8, null, null], "azure/o1-mini-2024-09-12": [11e-7, 44e-7, null, 55e-8, null, null], "o1-mini-2024-09-12": [11e-7, 44e-7, null, 55e-8, null, null], "azure/o3": [2e-6, 8e-6, null, 5e-7, null, null], "azure/o3-2025-04-16": [2e-6, 8e-6, null, 5e-7, null, null], "azure/o3-deep-research": [1e-5, 4e-5, null, 25e-7, null, null], "azure/o3-mini": [11e-7, 44e-7, null, 55e-8, null, null], "azure/o3-mini-2025-01-31": [11e-7, 44e-7, null, 55e-8, null, null], "azure/o3-pro": [2e-5, 8e-5, null, null, null, null], "azure/o3-pro-2025-06-10": [2e-5, 8e-5, null, null, null, null], "azure/o4-mini": [11e-7, 44e-7, null, 275e-9, null, null], "azure/o4-mini-2025-04-16": [11e-7, 44e-7, null, 275e-9, null, null], "azure/text-embedding-3-large": [13e-8, 0, null, null, null, null], "azure/text-embedding-3-small": [2e-8, 0, null, null, null, null], "azure/text-embedding-ada-002": [1e-7, 0, null, null, null, null], "azure/us/gpt-4.1-2025-04-14": [22e-7, 88e-7, null, 55e-8, null, null], "us/gpt-4.1-2025-04-14": [22e-7, 88e-7, null, 55e-8, null, null], "azure/us/gpt-4.1-mini-2025-04-14": [44e-8, 176e-8, null, 11e-8, null, null], "us/gpt-4.1-mini-2025-04-14": [44e-8, 176e-8, null, 11e-8, null, null], "azure/us/gpt-4.1-nano-2025-04-14": [11e-8, 44e-8, null, 28e-9, null, null], "us/gpt-4.1-nano-2025-04-14": [11e-8, 44e-8, null, 28e-9, null, null], "azure/us/gpt-4o-2024-08-06": [275e-8, 11e-6, null, 1375e-9, null, null], "us/gpt-4o-2024-08-06": [275e-8, 11e-6, null, 1375e-9, null, null], "azure/us/gpt-4o-2024-11-20": [275e-8, 11e-6, 138e-8, 1375e-9, null, null], "us/gpt-4o-2024-11-20": [275e-8, 11e-6, 138e-8, 1375e-9, null, null], "azure/us/gpt-4o-mini-2024-07-18": [165e-9, 66e-8, null, 83e-9, null, null], "us/gpt-4o-mini-2024-07-18": [165e-9, 66e-8, null, 83e-9, null, null], "azure/us/gpt-4o-mini-realtime-preview-2024-12-17": [66e-8, 264e-8, null, 33e-8, null, null], "us/gpt-4o-mini-realtime-preview-2024-12-17": [66e-8, 264e-8, null, 33e-8, null, null], "azure/us/gpt-4o-realtime-preview-2024-10-01": [55e-7, 22e-6, null, 275e-8, null, null], "us/gpt-4o-realtime-preview-2024-10-01": [55e-7, 22e-6, null, 275e-8, null, null], "azure/us/gpt-4o-realtime-preview-2024-12-17": [55e-7, 22e-6, null, 275e-8, null, null], "us/gpt-4o-realtime-preview-2024-12-17": [55e-7, 22e-6, null, 275e-8, null, null], "azure/us/gpt-5-2025-08-07": [1375e-9, 11e-6, null, 1375e-10, 2, null], "us/gpt-5-2025-08-07": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/us/gpt-5-mini-2025-08-07": [275e-9, 22e-7, null, 275e-10, 1.8, null], "us/gpt-5-mini-2025-08-07": [275e-9, 22e-7, null, 275e-10, 1.8, null], "azure/us/gpt-5-nano-2025-08-07": [55e-9, 44e-8, null, 55e-10, null, null], "us/gpt-5-nano-2025-08-07": [55e-9, 44e-8, null, 55e-10, null, null], "azure/us/gpt-5.1": [1375e-9, 11e-6, null, 1375e-10, 2, null], "us/gpt-5.1": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/us/gpt-5.1-codex": [1375e-9, 11e-6, null, 1375e-10, null, null], "us/gpt-5.1-codex": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/us/gpt-5.1-codex-mini": [275e-9, 22e-7, null, 275e-10, null, null], "us/gpt-5.1-codex-mini": [275e-9, 22e-7, null, 275e-10, null, null], "azure/us/o1-2024-12-17": [165e-7, 66e-6, null, 825e-8, null, null], "us/o1-2024-12-17": [165e-7, 66e-6, null, 825e-8, null, null], "azure/us/o1-mini-2024-09-12": [121e-8, 484e-8, null, 605e-9, null, null], "us/o1-mini-2024-09-12": [121e-8, 484e-8, null, 605e-9, null, null], "azure/us/o3-2025-04-16": [22e-7, 88e-7, null, 55e-8, null, null], "us/o3-2025-04-16": [22e-7, 88e-7, null, 55e-8, null, null], "azure/us/o3-mini-2025-01-31": [121e-8, 484e-8, null, 605e-9, null, null], "us/o3-mini-2025-01-31": [121e-8, 484e-8, null, 605e-9, null, null], "azure/us/o4-mini-2025-04-16": [121e-8, 484e-8, null, 303e-9, null, null], "us/o4-mini-2025-04-16": [121e-8, 484e-8, null, 303e-9, null, null], "azure_ai/Cohere-embed-v3-english": [1e-7, 0, null, null, null, null], "Cohere-embed-v3-english": [1e-7, 0, null, null, null, null], "azure_ai/Cohere-embed-v3-multilingual": [1e-7, 0, null, null, null, null], "Cohere-embed-v3-multilingual": [1e-7, 0, null, null, null, null], "azure_ai/Codestral-2501": [3e-7, 9e-7, null, null, null, null], "Codestral-2501": [3e-7, 9e-7, null, null, null, null], "azure_ai/FW-DeepSeek-V3.2": [62e-8, 185e-8, null, 31e-8, null, null], "FW-DeepSeek-V3.2": [62e-8, 185e-8, null, 31e-8, null, null], "azure_ai/FW-DeepSeek-V4-Pro": [1925e-9, 3828e-9, null, 165e-9, null, null], "FW-DeepSeek-V4-Pro": [1925e-9, 3828e-9, null, 165e-9, null, null], "azure_ai/FW-GLM-5": [11e-7, 352e-8, null, 22e-8, null, null], "FW-GLM-5": [11e-7, 352e-8, null, 22e-8, null, null], "azure_ai/FW-GLM-5.1": [154e-8, 484e-8, null, 286e-9, null, null], "FW-GLM-5.1": [154e-8, 484e-8, null, 286e-9, null, null], "azure_ai/FW-GLM-5.2": [154e-8, 484e-8, null, 15e-8, null, null], "FW-GLM-5.2": [154e-8, 484e-8, null, 15e-8, null, null], "azure_ai/FW-GLM-5.2-Fast": [231e-8, 726e-8, null, 231e-9, null, null], "FW-GLM-5.2-Fast": [231e-8, 726e-8, null, 231e-9, null, null], "azure_ai/FW-Inkling": [11e-7, 446e-8, null, 19e-8, null, null], "FW-Inkling": [11e-7, 446e-8, null, 19e-8, null, null], "azure_ai/FW-Kimi-K2.5": [66e-8, 33e-7, null, 11e-8, null, null], "FW-Kimi-K2.5": [66e-8, 33e-7, null, 11e-8, null, null], "azure_ai/FW-Kimi-K2.6": [1045e-9, 44e-7, null, 176e-9, null, null], "FW-Kimi-K2.6": [1045e-9, 44e-7, null, 176e-9, null, null], "azure_ai/FW-Kimi-K2.7-Code": [105e-8, 44e-7, null, 21e-8, null, null], "FW-Kimi-K2.7-Code": [105e-8, 44e-7, null, 21e-8, null, null], "azure_ai/FW-Kimi-K3": [3e-6, 15e-6, null, 3e-7, null, null], "FW-Kimi-K3": [3e-6, 15e-6, null, 3e-7, null, null], "azure_ai/FW-MiniMax-M2.5": [33e-8, 132e-8, null, 33e-9, null, null], "FW-MiniMax-M2.5": [33e-8, 132e-8, null, 33e-9, null, null], "azure_ai/FW-MiniMax-M3": [33e-8, 132e-8, null, 66e-9, null, null], "FW-MiniMax-M3": [33e-8, 132e-8, null, 66e-9, null, null], "azure_ai/FW-Nemotron-Lightning-3.5-30B-A3B": [6e-8, 22e-8, null, 1e-8, null, null], "FW-Nemotron-Lightning-3.5-30B-A3B": [6e-8, 22e-8, null, 1e-8, null, null], "azure_ai/FW-Nemotron-3-Ultra-NVFP4": [66e-8, 264e-8, null, 13e-8, null, null], "FW-Nemotron-3-Ultra-NVFP4": [66e-8, 264e-8, null, 13e-8, null, null], "azure_ai/MAI-Thinking-1": [2e-6, 8e-6, null, 2e-7, null, null], "MAI-Thinking-1": [2e-6, 8e-6, null, 2e-7, null, null], "azure_ai/Llama-3.3-70B-Instruct": [71e-8, 71e-8, null, null, null, null], "Llama-3.3-70B-Instruct": [71e-8, 71e-8, null, null, null, null], "azure_ai/Llama-4-Maverick-17B-128E-Instruct-FP8": [25e-8, 1e-6, null, null, null, null], "Llama-4-Maverick-17B-128E-Instruct-FP8": [25e-8, 1e-6, null, null, null, null], "azure_ai/Llama-4-Scout-17B-16E-Instruct": [2e-7, 78e-8, null, null, null, null], "Llama-4-Scout-17B-16E-Instruct": [2e-7, 78e-8, null, null, null, null], "azure_ai/Meta-Llama-3-70B-Instruct": [11e-7, 37e-8, null, null, null, null], "Meta-Llama-3-70B-Instruct": [11e-7, 37e-8, null, null, null, null], "azure_ai/Meta-Llama-3.1-70B-Instruct": [268e-8, 354e-8, null, null, null, null], "Meta-Llama-3.1-70B-Instruct": [268e-8, 354e-8, null, null, null, null], "azure_ai/Phi-3-medium-128k-instruct": [17e-8, 68e-8, null, null, null, null], "Phi-3-medium-128k-instruct": [17e-8, 68e-8, null, null, null, null], "azure_ai/Phi-3-medium-4k-instruct": [17e-8, 68e-8, null, null, null, null], "Phi-3-medium-4k-instruct": [17e-8, 68e-8, null, null, null, null], "azure_ai/Phi-3-mini-128k-instruct": [13e-8, 52e-8, null, null, null, null], "Phi-3-mini-128k-instruct": [13e-8, 52e-8, null, null, null, null], "azure_ai/Phi-3-mini-4k-instruct": [13e-8, 52e-8, null, null, null, null], "Phi-3-mini-4k-instruct": [13e-8, 52e-8, null, null, null, null], "azure_ai/Phi-3-small-128k-instruct": [15e-8, 6e-7, null, null, null, null], "Phi-3-small-128k-instruct": [15e-8, 6e-7, null, null, null, null], "azure_ai/Phi-3-small-8k-instruct": [15e-8, 6e-7, null, null, null, null], "Phi-3-small-8k-instruct": [15e-8, 6e-7, null, null, null, null], "azure_ai/Phi-3.5-MoE-instruct": [16e-8, 64e-8, null, null, null, null], "Phi-3.5-MoE-instruct": [16e-8, 64e-8, null, null, null, null], "azure_ai/Phi-3.5-mini-instruct": [13e-8, 52e-8, null, null, null, null], "Phi-3.5-mini-instruct": [13e-8, 52e-8, null, null, null, null], "azure_ai/Phi-3.5-vision-instruct": [13e-8, 52e-8, null, null, null, null], "Phi-3.5-vision-instruct": [13e-8, 52e-8, null, null, null, null], "azure_ai/Phi-4": [125e-9, 5e-7, null, null, null, null], "Phi-4": [125e-9, 5e-7, null, null, null, null], "azure_ai/Phi-4-mini-instruct": [75e-9, 3e-7, null, null, null, null], "Phi-4-mini-instruct": [75e-9, 3e-7, null, null, null, null], "azure_ai/Phi-4-multimodal-instruct": [8e-8, 32e-8, null, null, null, null], "Phi-4-multimodal-instruct": [8e-8, 32e-8, null, null, null, null], "azure_ai/Phi-4-mini-reasoning": [75e-9, 3e-7, null, null, null, null], "Phi-4-mini-reasoning": [75e-9, 3e-7, null, null, null, null], "azure_ai/Phi-4-reasoning": [125e-9, 5e-7, null, null, null, null], "Phi-4-reasoning": [125e-9, 5e-7, null, null, null, null], "azure_ai/cohere-command-a": [25e-7, 1e-5, null, null, null, null], "cohere-command-a": [25e-7, 1e-5, null, null, null, null], "azure_ai/MAI-DS-R1": [135e-8, 54e-7, null, null, null, null], "MAI-DS-R1": [135e-8, 54e-7, null, null, null, null], "azure_ai/cohere-rerank-v3-english": [0, 0, null, null, null, null], "cohere-rerank-v3-english": [0, 0, null, null, null, null], "azure_ai/cohere-rerank-v3-multilingual": [0, 0, null, null, null, null], "cohere-rerank-v3-multilingual": [0, 0, null, null, null, null], "azure_ai/cohere-rerank-v4.0-pro": [0, 0, null, null, null, null], "cohere-rerank-v4.0-pro": [0, 0, null, null, null, null], "azure_ai/cohere-rerank-v4.0-fast": [0, 0, null, null, null, null], "cohere-rerank-v4.0-fast": [0, 0, null, null, null, null], "azure_ai/deepseek-v3.2": [58e-8, 168e-8, null, null, null, null], "deepseek-v3.2": [28e-8, 4e-7, null, 28e-9, null, null], "azure_ai/deepseek-v3.2-speciale": [58e-8, 168e-8, null, null, null, null], "deepseek-v3.2-speciale": [58e-8, 168e-8, null, null, null, null], "azure_ai/deepseek-v3": [114e-8, 456e-8, null, null, null, null], "deepseek-v3": [27e-8, 11e-7, 0, 7e-8, null, null], "azure_ai/deepseek-v4-pro": [174e-8, 348e-8, null, 145e-9, null, null], "azure_ai/deepseek-v4-flash": [19e-8, 51e-8, null, 28e-9, null, null], "azure_ai/DeepSeek-V4-Flash-0731": [44e-8, 132e-8, null, 14e-9, null, null], "DeepSeek-V4-Flash-0731": [44e-8, 132e-8, null, 14e-9, null, null], "azure_ai/embed-v-4-0": [12e-8, 0, null, null, null, null], "embed-v-4-0": [12e-8, 0, null, null, null, null], "azure_ai/grok-4": [3e-6, 15e-6, null, null, null, null], "grok-4": [3e-6, 15e-6, null, null, null, null], "azure_ai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "azure_ai/grok-4.6": [125e-8, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "azure_ai/grok-4-20-reasoning": [125e-8, 25e-7, null, 125e-8, null, null], "grok-4-20-reasoning": [125e-8, 25e-7, null, 125e-8, null, null], "azure_ai/grok-4-20-non-reasoning": [125e-8, 25e-7, null, 125e-8, null, null], "grok-4-20-non-reasoning": [125e-8, 25e-7, null, 125e-8, null, null], "azure_ai/grok-4-1-fast-non-reasoning": [2e-7, 5e-7, null, null, null, null], "grok-4-1-fast-non-reasoning": [2e-7, 5e-7, null, null, null, null], "azure_ai/grok-4-1-fast-reasoning": [2e-7, 5e-7, null, null, null, null], "grok-4-1-fast-reasoning": [2e-7, 5e-7, null, null, null, null], "azure_ai/grok-code-fast-1": [2e-7, 15e-7, null, null, null, null], "grok-code-fast-1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "azure_ai/jais-30b-chat": [32e-4, 971e-5, null, null, null, null], "jais-30b-chat": [32e-4, 971e-5, null, null, null, null], "azure_ai/jamba-instruct": [5e-7, 7e-7, null, null, null, null], "jamba-instruct": [5e-7, 7e-7, null, null, null, null], "azure_ai/kimi-k2.5": [6e-7, 3e-6, null, 1e-7, null, null], "kimi-k2.5": [6e-7, 3e-6, null, 1e-7, null, null], "azure_ai/kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "azure_ai/ministral-3b": [4e-8, 4e-8, null, null, null, null], "ministral-3b": [4e-8, 4e-8, null, null, null, null], "azure_ai/mistral-large": [4e-6, 12e-6, null, null, null, null], "mistral-large": [4e-6, 12e-6, null, null, null, null], "azure_ai/mistral-large-2407": [2e-6, 6e-6, null, null, null, null], "mistral-large-2407": [2e-6, 6e-6, null, null, null, null], "azure_ai/mistral-large-latest": [2e-6, 6e-6, null, null, null, null], "azure_ai/mistral-large-3": [5e-7, 15e-7, null, null, null, null], "mistral-large-3": [5e-7, 15e-7, null, 5e-8, null, null], "azure_ai/mistral-medium-2505": [4e-7, 2e-6, null, null, null, null], "mistral-medium-2505": [4e-7, 2e-6, null, null, null, null], "azure_ai/mistral-nemo": [15e-8, 15e-8, null, null, null, null], "mistral-nemo": [15e-8, 15e-8, null, null, null, null], "azure_ai/mistral-small": [1e-6, 3e-6, null, null, null, null], "mistral-small": [1e-7, 3e-7, null, 1e-8, null, null], "azure_ai/mistral-small-2503": [1e-7, 3e-7, null, null, null, null], "mistral-small-2503": [1e-7, 3e-7, null, null, null, null], "bedrock/ap-northeast-1/anthropic.claude-instant-v1": [223e-8, 755e-8, null, null, null, null], "ap-northeast-1/anthropic.claude-instant-v1": [223e-8, 755e-8, null, null, null, null], "bedrock/ap-northeast-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "ap-northeast-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "bedrock/ap-northeast-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "ap-northeast-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "bedrock/ap-northeast-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "ap-northeast-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "bedrock/ap-northeast-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "ap-northeast-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-northeast-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "ap-northeast-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-northeast-1/moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "ap-northeast-1/moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "bedrock/ap-northeast-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "ap-northeast-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "bedrock/ap-northeast-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "ap-northeast-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "bedrock/moonshotai.kimi-k2.5": [6e-7, 303e-8, null, null, null, null], "bedrock/ap-south-1/meta.llama3-70b-instruct-v1:0": [318e-8, 42e-7, null, null, null, null], "ap-south-1/meta.llama3-70b-instruct-v1:0": [318e-8, 42e-7, null, null, null, null], "bedrock/ap-south-1/meta.llama3-8b-instruct-v1:0": [36e-8, 72e-8, null, null, null, null], "ap-south-1/meta.llama3-8b-instruct-v1:0": [36e-8, 72e-8, null, null, null, null], "bedrock/ap-south-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "ap-south-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "bedrock/ap-south-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "ap-south-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-south-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "ap-south-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-south-1/moonshotai.kimi-k2-thinking": [71e-8, 294e-8, null, null, null, null], "ap-south-1/moonshotai.kimi-k2-thinking": [71e-8, 294e-8, null, null, null, null], "bedrock/ap-south-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "ap-south-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "bedrock/ap-south-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "ap-south-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/ap-southeast-2/minimax.minimax-m2.5": [309e-9, 1236e-9, null, null, null, null], "ap-southeast-2/minimax.minimax-m2.5": [309e-9, 1236e-9, null, null, null, null], "bedrock/ap-southeast-3/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "ap-southeast-3/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "bedrock/ap-southeast-3/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "ap-southeast-3/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-southeast-3/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "ap-southeast-3/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/ap-southeast-3/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "ap-southeast-3/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "bedrock/ap-southeast-3/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "ap-southeast-3/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/ca-central-1/meta.llama3-70b-instruct-v1:0": [305e-8, 403e-8, null, null, null, null], "ca-central-1/meta.llama3-70b-instruct-v1:0": [305e-8, 403e-8, null, null, null, null], "bedrock/ca-central-1/meta.llama3-8b-instruct-v1:0": [35e-8, 69e-8, null, null, null, null], "ca-central-1/meta.llama3-8b-instruct-v1:0": [35e-8, 69e-8, null, null, null, null], "bedrock/eu-north-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "eu-north-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "bedrock/eu-north-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "eu-north-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-north-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "eu-north-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-north-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "eu-north-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "bedrock/eu-central-1/anthropic.claude-instant-v1": [248e-8, 838e-8, null, null, null, null], "eu-central-1/anthropic.claude-instant-v1": [248e-8, 838e-8, null, null, null, null], "bedrock/eu-central-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "eu-central-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "bedrock/eu-central-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "eu-central-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "bedrock/eu-central-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "eu-central-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-central-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "eu-central-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-central-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "eu-central-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/eu-west-1/meta.llama3-70b-instruct-v1:0": [286e-8, 378e-8, null, null, null, null], "eu-west-1/meta.llama3-70b-instruct-v1:0": [286e-8, 378e-8, null, null, null, null], "bedrock/eu-west-1/meta.llama3-8b-instruct-v1:0": [32e-8, 65e-8, null, null, null, null], "eu-west-1/meta.llama3-8b-instruct-v1:0": [32e-8, 65e-8, null, null, null, null], "bedrock/eu-west-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "eu-west-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-west-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "eu-west-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-west-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "eu-west-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/eu-west-2/meta.llama3-70b-instruct-v1:0": [345e-8, 455e-8, null, null, null, null], "eu-west-2/meta.llama3-70b-instruct-v1:0": [345e-8, 455e-8, null, null, null, null], "bedrock/eu-west-2/meta.llama3-8b-instruct-v1:0": [39e-8, 78e-8, null, null, null, null], "eu-west-2/meta.llama3-8b-instruct-v1:0": [39e-8, 78e-8, null, null, null, null], "bedrock/eu-west-2/minimax.minimax-m2.1": [47e-8, 186e-8, null, null, null, null], "eu-west-2/minimax.minimax-m2.1": [47e-8, 186e-8, null, null, null, null], "bedrock/eu-west-2/minimax.minimax-m2.5": [47e-8, 186e-8, null, null, null, null], "eu-west-2/minimax.minimax-m2.5": [47e-8, 186e-8, null, null, null, null], "bedrock/eu-west-2/nvidia.nemotron-super-3-120b": [23e-8, 101e-8, null, null, null, null], "eu-west-2/nvidia.nemotron-super-3-120b": [23e-8, 101e-8, null, null, null, null], "bedrock/eu-west-2/qwen.qwen3-coder-next": [78e-8, 186e-8, null, null, null, null], "eu-west-2/qwen.qwen3-coder-next": [78e-8, 186e-8, null, null, null, null], "bedrock/eu-west-3/mistral.mistral-7b-instruct-v0:2": [2e-7, 26e-8, null, null, null, null], "eu-west-3/mistral.mistral-7b-instruct-v0:2": [2e-7, 26e-8, null, null, null, null], "bedrock/eu-west-3/mistral.mistral-large-2402-v1:0": [52e-7, 156e-7, null, null, null, null], "eu-west-3/mistral.mistral-large-2402-v1:0": [52e-7, 156e-7, null, null, null, null], "bedrock/eu-west-3/mistral.mixtral-8x7b-instruct-v0:1": [59e-8, 91e-8, null, null, null, null], "eu-west-3/mistral.mixtral-8x7b-instruct-v0:1": [59e-8, 91e-8, null, null, null, null], "bedrock/eu-south-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "eu-south-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-south-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "eu-south-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/eu-south-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "eu-south-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/invoke/anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "invoke/anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "bedrock/sa-east-1/meta.llama3-70b-instruct-v1:0": [445e-8, 588e-8, null, null, null, null], "sa-east-1/meta.llama3-70b-instruct-v1:0": [445e-8, 588e-8, null, null, null, null], "bedrock/sa-east-1/meta.llama3-8b-instruct-v1:0": [5e-7, 101e-8, null, null, null, null], "sa-east-1/meta.llama3-8b-instruct-v1:0": [5e-7, 101e-8, null, null, null, null], "bedrock/sa-east-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "sa-east-1/deepseek.v3.2": [74e-8, 222e-8, null, null, null, null], "bedrock/sa-east-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "sa-east-1/minimax.minimax-m2.1": [36e-8, 144e-8, null, null, null, null], "bedrock/sa-east-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "sa-east-1/minimax.minimax-m2.5": [36e-8, 144e-8, null, null, null, null], "bedrock/sa-east-1/moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "sa-east-1/moonshotai.kimi-k2-thinking": [73e-8, 303e-8, null, null, null, null], "bedrock/sa-east-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "sa-east-1/moonshotai.kimi-k2.5": [72e-8, 36e-7, null, null, null, null], "bedrock/sa-east-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "sa-east-1/qwen.qwen3-coder-next": [6e-7, 144e-8, null, null, null, null], "bedrock/us-east-1/anthropic.claude-instant-v1": [8e-7, 24e-7, null, null, null, null], "us-east-1/anthropic.claude-instant-v1": [8e-7, 24e-7, null, null, null, null], "bedrock/us-east-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "us-east-1/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "bedrock/us-east-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "us-east-1/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "bedrock/us-east-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "us-east-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "bedrock/us-east-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "us-east-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "bedrock/us-east-1/mistral.mistral-7b-instruct-v0:2": [15e-8, 2e-7, null, null, null, null], "us-east-1/mistral.mistral-7b-instruct-v0:2": [15e-8, 2e-7, null, null, null, null], "bedrock/us-east-1/mistral.mistral-large-2402-v1:0": [4e-6, 12e-6, null, null, null, null], "us-east-1/mistral.mistral-large-2402-v1:0": [4e-6, 12e-6, null, null, null, null], "bedrock/us-east-1/mistral.mixtral-8x7b-instruct-v0:1": [45e-8, 7e-7, null, null, null, null], "us-east-1/mistral.mixtral-8x7b-instruct-v0:1": [45e-8, 7e-7, null, null, null, null], "bedrock/us-east-1/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "us-east-1/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "bedrock/us-east-1/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "us-east-1/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "bedrock/us-east-1/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "us-east-1/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "bedrock/us-east-1/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "us-east-1/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "bedrock/us-east-1/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "us-east-1/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "bedrock/us-east-1/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "us-east-1/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "bedrock/us-east-2/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "us-east-2/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "bedrock/us-east-2/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "us-east-2/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "bedrock/us-east-2/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "us-east-2/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "bedrock/us-east-2/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "us-east-2/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "bedrock/us-east-2/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "us-east-2/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "bedrock/us-east-2/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "us-east-2/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "bedrock/us-gov-east-1/amazon.nova-pro-v1:0": [96e-8, 384e-8, null, 24e-8, null, null], "us-gov-east-1/amazon.nova-pro-v1:0": [96e-8, 384e-8, null, 24e-8, null, null], "bedrock/us-gov-east-1/amazon.titan-embed-text-v1": [1e-7, 0, null, null, null, null], "us-gov-east-1/amazon.titan-embed-text-v1": [1e-7, 0, null, null, null, null], "bedrock/us-gov-east-1/amazon.titan-embed-text-v2:0": [2e-7, 0, null, null, null, null], "us-gov-east-1/amazon.titan-embed-text-v2:0": [2e-7, 0, null, null, null, null], "bedrock/us-gov-east-1/amazon.titan-text-express-v1": [13e-7, 17e-7, null, null, null, null], "us-gov-east-1/amazon.titan-text-express-v1": [13e-7, 17e-7, null, null, null, null], "bedrock/us-gov-east-1/amazon.titan-text-lite-v1": [3e-7, 4e-7, null, null, null, null], "us-gov-east-1/amazon.titan-text-lite-v1": [3e-7, 4e-7, null, null, null, null], "bedrock/us-gov-east-1/amazon.titan-text-premier-v1:0": [5e-7, 15e-7, null, null, null, null], "us-gov-east-1/amazon.titan-text-premier-v1:0": [5e-7, 15e-7, null, null, null, null], "bedrock/us-gov-east-1/anthropic.claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-east-1/anthropic.claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-east-1/claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-east-1/claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-east-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "us-gov-east-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "bedrock/us-gov-east-1/meta.llama3-8b-instruct-v1:0": [3e-7, 265e-8, null, null, null, null], "us-gov-east-1/meta.llama3-8b-instruct-v1:0": [3e-7, 265e-8, null, null, null, null], "bedrock/us-gov-west-1/amazon.nova-2-multimodal-embeddings-v1:0": [162e-9, 0, null, null, null, null], "us-gov-west-1/amazon.nova-2-multimodal-embeddings-v1:0": [162e-9, 0, null, null, null, null], "bedrock/us-gov-west-1/amazon.nova-lite-v1:0": [72e-9, 288e-9, null, 18e-9, null, null], "us-gov-west-1/amazon.nova-lite-v1:0": [72e-9, 288e-9, null, 18e-9, null, null], "bedrock/us-gov-west-1/amazon.nova-micro-v1:0": [42e-9, 168e-9, null, 105e-10, null, null], "us-gov-west-1/amazon.nova-micro-v1:0": [42e-9, 168e-9, null, 105e-10, null, null], "bedrock/us-gov-west-1/amazon.nova-pro-v1:0": [96e-8, 384e-8, null, 24e-8, null, null], "us-gov-west-1/amazon.nova-pro-v1:0": [96e-8, 384e-8, null, 24e-8, null, null], "bedrock/us-gov-west-1/amazon.titan-embed-text-v1": [1e-7, 0, null, null, null, null], "us-gov-west-1/amazon.titan-embed-text-v1": [1e-7, 0, null, null, null, null], "bedrock/us-gov-west-1/amazon.titan-embed-text-v2:0": [2e-7, 0, null, null, null, null], "us-gov-west-1/amazon.titan-embed-text-v2:0": [2e-7, 0, null, null, null, null], "bedrock/us-gov-west-1/amazon.titan-text-express-v1": [13e-7, 17e-7, null, null, null, null], "us-gov-west-1/amazon.titan-text-express-v1": [13e-7, 17e-7, null, null, null, null], "bedrock/us-gov-west-1/amazon.titan-text-lite-v1": [3e-7, 4e-7, null, null, null, null], "us-gov-west-1/amazon.titan-text-lite-v1": [3e-7, 4e-7, null, null, null, null], "bedrock/us-gov-west-1/amazon.titan-text-premier-v1:0": [5e-7, 15e-7, null, null, null, null], "us-gov-west-1/amazon.titan-text-premier-v1:0": [5e-7, 15e-7, null, null, null, null], "bedrock/us-gov-west-1/anthropic.claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-west-1/anthropic.claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-west-1/claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-west-1/claude-sonnet-4-5-20250929-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-west-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "us-gov-west-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "bedrock/us-gov-west-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "us-gov-west-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "bedrock/us-west-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "us-west-1/meta.llama3-70b-instruct-v1:0": [265e-8, 35e-7, null, null, null, null], "bedrock/us-west-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "us-west-1/meta.llama3-8b-instruct-v1:0": [3e-7, 6e-7, null, null, null, null], "bedrock/us-west-2/anthropic.claude-instant-v1": [8e-7, 24e-7, null, null, null, null], "us-west-2/anthropic.claude-instant-v1": [8e-7, 24e-7, null, null, null, null], "bedrock/us-west-2/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "us-west-2/anthropic.claude-v1": [8e-6, 24e-6, null, null, null, null], "bedrock/us-west-2/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "us-west-2/anthropic.claude-v2:1": [8e-6, 24e-6, null, null, null, null], "bedrock/us-west-2/mistral.mistral-7b-instruct-v0:2": [15e-8, 2e-7, null, null, null, null], "us-west-2/mistral.mistral-7b-instruct-v0:2": [15e-8, 2e-7, null, null, null, null], "bedrock/us-west-2/mistral.mistral-large-2402-v1:0": [4e-6, 12e-6, null, null, null, null], "us-west-2/mistral.mistral-large-2402-v1:0": [4e-6, 12e-6, null, null, null, null], "bedrock/us-west-2/mistral.mixtral-8x7b-instruct-v0:1": [45e-8, 7e-7, null, null, null, null], "us-west-2/mistral.mixtral-8x7b-instruct-v0:1": [45e-8, 7e-7, null, null, null, null], "bedrock/us-west-2/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "us-west-2/deepseek.v3.2": [62e-8, 185e-8, null, null, null, null], "bedrock/us-west-2/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "us-west-2/minimax.minimax-m2.1": [3e-7, 12e-7, null, null, null, null], "bedrock/us-west-2/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "us-west-2/minimax.minimax-m2.5": [3e-7, 12e-7, null, null, null, null], "bedrock/us-west-2/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "us-west-2/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "bedrock/us-west-2/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "us-west-2/moonshotai.kimi-k2.5": [6e-7, 3e-6, null, null, null, null], "bedrock/us-west-2/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "us-west-2/qwen.qwen3-coder-next": [5e-7, 12e-7, null, null, null, null], "bedrock/us.anthropic.claude-3-5-haiku-20241022-v1:0": [8e-7, 4e-6, 1e-6, 8e-8, null, null], "cerebras/llama-3.3-70b": [85e-8, 12e-7, null, null, null, null], "llama-3.3-70b": [85e-8, 12e-7, null, null, null, null], "cerebras/llama3.1-70b": [6e-7, 6e-7, null, null, null, null], "llama3.1-70b": [6e-7, 6e-7, null, null, null, null], "cerebras/llama3.1-8b": [1e-7, 1e-7, null, null, null, null], "llama3.1-8b": [1e-7, 1e-7, null, null, null, null], "cerebras/gpt-oss-120b": [35e-8, 75e-8, null, null, null, null], "cerebras/qwen-3-32b": [4e-7, 8e-7, null, null, null, null], "qwen-3-32b": [4e-7, 8e-7, null, null, null, null], "cerebras/qwen-3.8-27b": [99e-8, 149e-8, null, null, null, null], "qwen-3.8-27b": [99e-8, 149e-8, null, null, null, null], "cloudflare/@cf/meta/llama-2-7b-chat-fp16": [1923e-9, 1923e-9, null, null, null, null], "@cf/meta/llama-2-7b-chat-fp16": [1923e-9, 1923e-9, null, null, null, null], "cloudflare/@cf/meta/llama-2-7b-chat-int8": [1923e-9, 1923e-9, null, null, null, null], "@cf/meta/llama-2-7b-chat-int8": [1923e-9, 1923e-9, null, null, null, null], "cloudflare/@cf/mistral/mistral-7b-instruct-v0.1": [1923e-9, 1923e-9, null, null, null, null], "@cf/mistral/mistral-7b-instruct-v0.1": [1923e-9, 1923e-9, null, null, null, null], "cloudflare/@hf/thebloke/codellama-7b-instruct-awq": [1923e-9, 1923e-9, null, null, null, null], "@hf/thebloke/codellama-7b-instruct-awq": [1923e-9, 1923e-9, null, null, null, null], "cloudflare/@cf/openai/gpt-oss-120b": [35e-8, 75e-8, null, null, null, null], "@cf/openai/gpt-oss-120b": [35e-8, 75e-8, null, null, null, null], "cloudflare/@cf/google/gemma-2b-it-lora": [0, 0, null, null, null, null], "@cf/google/gemma-2b-it-lora": [0, 0, null, null, null, null], "cloudflare/@cf/meta/llama-3.2-3b-instruct": [509e-10, 335e-9, null, null, null, null], "@cf/meta/llama-3.2-3b-instruct": [509e-10, 335e-9, null, null, null, null], "cloudflare/@cf/meta/llama-guard-3-8b": [484e-9, 3e-8, null, null, null, null], "@cf/meta/llama-guard-3-8b": [484e-9, 3e-8, null, null, null, null], "cloudflare/@cf/mistral/mistral-7b-instruct-v0.2-lora": [0, 0, null, null, null, null], "@cf/mistral/mistral-7b-instruct-v0.2-lora": [0, 0, null, null, null, null], "cloudflare/@cf/moonshotai/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "@cf/moonshotai/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "cloudflare/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": [497e-9, 4881e-9, null, null, null, null], "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": [497e-9, 4881e-9, null, null, null, null], "cloudflare/@cf/meta/llama-3.1-8b-instruct-fp8": [152e-9, 287e-9, null, null, null, null], "@cf/meta/llama-3.1-8b-instruct-fp8": [152e-9, 287e-9, null, null, null, null], "cloudflare/@cf/meta/llama-3.2-1b-instruct": [27e-9, 201e-9, null, null, null, null], "@cf/meta/llama-3.2-1b-instruct": [27e-9, 201e-9, null, null, null, null], "cloudflare/@cf/moonshotai/kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "@cf/moonshotai/kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "cloudflare/@cf/zai-org/glm-4.7-flash": [605e-10, 4e-7, null, null, null, null], "@cf/zai-org/glm-4.7-flash": [605e-10, 4e-7, null, null, null, null], "cloudflare/@cf/meta-llama/llama-2-7b-chat-hf-lora": [0, 0, null, null, null, null], "@cf/meta-llama/llama-2-7b-chat-hf-lora": [0, 0, null, null, null, null], "cloudflare/@cf/meta/llama-3.3-70b-instruct-fp8-fast": [293e-9, 2253e-9, null, null, null, null], "@cf/meta/llama-3.3-70b-instruct-fp8-fast": [293e-9, 2253e-9, null, null, null, null], "cloudflare/@cf/ibm-granite/granite-4.0-h-micro": [17e-9, 112e-9, null, null, null, null], "@cf/ibm-granite/granite-4.0-h-micro": [17e-9, 112e-9, null, null, null, null], "cloudflare/@cf/qwen/qwen2.5-coder-32b-instruct": [66e-8, 1e-6, null, null, null, null], "@cf/qwen/qwen2.5-coder-32b-instruct": [66e-8, 1e-6, null, null, null, null], "cloudflare/@cf/zai-org/glm-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "@cf/zai-org/glm-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "cloudflare/@cf/nvidia/nemotron-3-120b-a12b": [5e-7, 15e-7, null, null, null, null], "@cf/nvidia/nemotron-3-120b-a12b": [5e-7, 15e-7, null, null, null, null], "cloudflare/@cf/aisingapore/gemma-sea-lion-v4-27b-it": [351e-9, 555e-9, null, null, null, null], "@cf/aisingapore/gemma-sea-lion-v4-27b-it": [351e-9, 555e-9, null, null, null, null], "cloudflare/@cf/qwen/qwen3-30b-a3b-fp8": [509e-10, 335e-9, null, null, null, null], "@cf/qwen/qwen3-30b-a3b-fp8": [509e-10, 335e-9, null, null, null, null], "cloudflare/@cf/google/gemma-7b-it-lora": [0, 0, null, null, null, null], "@cf/google/gemma-7b-it-lora": [0, 0, null, null, null, null], "cloudflare/@cf/google/gemma-4-26b-a4b-it": [1e-7, 3e-7, null, null, null, null], "@cf/google/gemma-4-26b-a4b-it": [1e-7, 3e-7, null, null, null, null], "cloudflare/@cf/mistralai/mistral-small-3.1-24b-instruct": [351e-9, 555e-9, null, null, null, null], "@cf/mistralai/mistral-small-3.1-24b-instruct": [351e-9, 555e-9, null, null, null, null], "cloudflare/@cf/meta/llama-3.2-11b-vision-instruct": [485e-10, 676e-9, null, null, null, null], "@cf/meta/llama-3.2-11b-vision-instruct": [485e-10, 676e-9, null, null, null, null], "cloudflare/@cf/openai/gpt-oss-20b": [2e-7, 3e-7, null, null, null, null], "@cf/openai/gpt-oss-20b": [2e-7, 3e-7, null, null, null, null], "cloudflare/@cf/meta/llama-4-scout-17b-16e-instruct": [27e-8, 85e-8, null, null, null, null], "@cf/meta/llama-4-scout-17b-16e-instruct": [27e-8, 85e-8, null, null, null, null], "cloudflare/@cf/qwen/qwq-32b": [66e-8, 1e-6, null, null, null, null], "@cf/qwen/qwq-32b": [66e-8, 1e-6, null, null, null, null], "codestral/codestral-2405": [0, 0, null, null, null, null], "codestral-2405": [0, 0, null, null, null, null], "codestral/codestral-latest": [0, 0, null, null, null, null], "codestral-latest": [3e-7, 9e-7, null, 3e-8, null, null], "cohere/embed-v4.0": [12e-8, 0, null, null, null, null], "embed-v4.0": [12e-8, 0, null, null, null, null], "dashscope/deepseek-v4-flash": [2e-7, 4e-7, null, 4e-8, null, null], "dashscope/deepseek-v4-flash-0731": [2e-7, 4e-7, null, 4e-8, null, null], "deepseek-v4-flash-0731": [2e-7, 4e-7, null, 4e-8, null, null], "dashscope/deepseek-v4-pro": [24e-7, 48e-7, null, 2e-7, null, null], "dashscope/glm-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "glm-5.1": [14e-7, 44e-7, 0, 26e-8, null, null], "dashscope/glm-5.2": [14e-7, 44e-7, null, 28e-8, null, null], "glm-5.2": [14e-7, 44e-7, null, 28e-8, null, null], "dashscope/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "dashscope/qwen-coder": [3e-7, 15e-7, null, null, null, null], "qwen-coder": [3e-7, 15e-7, null, null, null, null], "dashscope/qwen-max": [16e-7, 64e-7, null, null, null, null], "qwen-max": [16e-7, 64e-7, null, null, null, null], "dashscope/qwen-plus": [4e-7, 12e-7, null, null, null, null], "qwen-plus": [4e-7, 12e-7, null, null, null, null], "dashscope/qwen-plus-2025-01-25": [4e-7, 12e-7, null, null, null, null], "qwen-plus-2025-01-25": [4e-7, 12e-7, null, null, null, null], "dashscope/qwen-plus-2025-04-28": [4e-7, 12e-7, null, null, null, null], "qwen-plus-2025-04-28": [4e-7, 12e-7, null, null, null, null], "dashscope/qwen-plus-2025-07-14": [4e-7, 12e-7, null, null, null, null], "qwen-plus-2025-07-14": [4e-7, 12e-7, null, null, null, null], "dashscope/qwen-turbo": [5e-8, 2e-7, null, null, null, null], "qwen-turbo": [5e-8, 2e-7, null, null, null, null], "dashscope/qwen-turbo-2024-11-01": [5e-8, 2e-7, null, null, null, null], "qwen-turbo-2024-11-01": [5e-8, 2e-7, null, null, null, null], "dashscope/qwen-turbo-2025-04-28": [5e-8, 2e-7, null, null, null, null], "qwen-turbo-2025-04-28": [5e-8, 2e-7, null, null, null, null], "dashscope/qwen-turbo-latest": [5e-8, 2e-7, null, null, null, null], "qwen-turbo-latest": [5e-8, 2e-7, null, null, null, null], "dashscope/qwen3-next-80b-a3b-instruct": [15e-8, 12e-7, null, null, null, null], "qwen3-next-80b-a3b-instruct": [15e-8, 12e-7, null, null, null, null], "dashscope/qwen3-next-80b-a3b-thinking": [15e-8, 12e-7, null, null, null, null], "qwen3-next-80b-a3b-thinking": [15e-8, 12e-7, null, null, null, null], "dashscope/qwen3-vl-235b-a22b-instruct": [4e-7, 16e-7, null, null, null, null], "qwen3-vl-235b-a22b-instruct": [4e-7, 16e-7, null, null, null, null], "dashscope/qwen3-vl-235b-a22b-thinking": [4e-7, 4e-6, null, null, null, null], "qwen3-vl-235b-a22b-thinking": [4e-7, 4e-6, null, null, null, null], "dashscope/qwen3-vl-32b-instruct": [16e-8, 64e-8, null, null, null, null], "qwen3-vl-32b-instruct": [16e-8, 64e-8, null, null, null, null], "dashscope/qwen3-vl-32b-thinking": [16e-8, 287e-8, null, null, null, null], "qwen3-vl-32b-thinking": [16e-8, 287e-8, null, null, null, null], "dashscope/qwen3.7-max": [25e-7, 75e-7, null, 5e-7, null, null], "qwen3.7-max": [25e-7, 75e-7, null, 5e-7, null, null], "dashscope/qwen3.8-max": [2e-6, 6e-6, null, 25e-8, null, null], "qwen3.8-max": [2e-6, 6e-6, null, 25e-8, null, null], "dashscope/qwen3.8-flash": [15e-8, 47e-8, 2e-7, 16e-9, null, null], "qwen3.8-flash": [15e-8, 47e-8, 2e-7, 16e-9, null, null], "dashscope/qwen3.8-omni-flash": [15e-8, 47e-8, null, 16e-9, null, null], "qwen3.8-omni-flash": [15e-8, 47e-8, null, 16e-9, null, null], "dashscope/qwq-plus": [8e-7, 24e-7, null, null, null, null], "qwq-plus": [8e-7, 24e-7, null, null, null, null], "qwencloud/deepseek-v4-flash": [2e-7, 4e-7, null, 4e-8, null, null], "qwencloud/deepseek-v4-flash-0731": [2e-7, 4e-7, null, 4e-8, null, null], "qwencloud/deepseek-v4-pro": [24e-7, 48e-7, null, 2e-7, null, null], "qwencloud/glm-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "qwencloud/glm-5.2": [14e-7, 44e-7, null, 28e-8, null, null], "qwencloud/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "qwencloud/qwen-coder": [3e-7, 15e-7, null, null, null, null], "qwencloud/qwen-max": [16e-7, 64e-7, null, null, null, null], "qwencloud/qwen-plus": [4e-7, 12e-7, null, null, null, null], "qwencloud/qwen-plus-2025-01-25": [4e-7, 12e-7, null, null, null, null], "qwencloud/qwen-plus-2025-04-28": [4e-7, 12e-7, null, null, null, null], "qwencloud/qwen-plus-2025-07-14": [4e-7, 12e-7, null, null, null, null], "qwencloud/qwen-turbo": [5e-8, 2e-7, null, null, null, null], "qwencloud/qwen-turbo-2024-11-01": [5e-8, 2e-7, null, null, null, null], "qwencloud/qwen-turbo-2025-04-28": [5e-8, 2e-7, null, null, null, null], "qwencloud/qwen-turbo-latest": [5e-8, 2e-7, null, null, null, null], "qwencloud/qwen3-next-80b-a3b-instruct": [15e-8, 12e-7, null, null, null, null], "qwencloud/qwen3-next-80b-a3b-thinking": [15e-8, 12e-7, null, null, null, null], "qwencloud/qwen3-vl-235b-a22b-instruct": [4e-7, 16e-7, null, null, null, null], "qwencloud/qwen3-vl-235b-a22b-thinking": [4e-7, 4e-6, null, null, null, null], "qwencloud/qwen3-vl-32b-instruct": [16e-8, 64e-8, null, null, null, null], "qwencloud/qwen3-vl-32b-thinking": [16e-8, 287e-8, null, null, null, null], "qwencloud/qwen3.7-max": [25e-7, 75e-7, null, 5e-7, null, null], "qwencloud/qwen3.8-max": [2e-6, 6e-6, null, 25e-8, null, null], "qwencloud/qwq-plus": [8e-7, 24e-7, null, null, null, null], "qwen_ai_platform/deepseek-v4-flash": [2e-7, 4e-7, null, 4e-8, null, null], "qwen_ai_platform/deepseek-v4-flash-0731": [2e-7, 4e-7, null, 4e-8, null, null], "qwen_ai_platform/deepseek-v4-pro": [24e-7, 48e-7, null, 2e-7, null, null], "qwen_ai_platform/glm-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "qwen_ai_platform/glm-5.2": [14e-7, 44e-7, null, 28e-8, null, null], "qwen_ai_platform/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "qwen_ai_platform/qwen-coder": [3e-7, 15e-7, null, null, null, null], "qwen_ai_platform/qwen-max": [16e-7, 64e-7, null, null, null, null], "qwen_ai_platform/qwen-plus": [4e-7, 12e-7, null, null, null, null], "qwen_ai_platform/qwen-plus-2025-01-25": [4e-7, 12e-7, null, null, null, null], "qwen_ai_platform/qwen-plus-2025-04-28": [4e-7, 12e-7, null, null, null, null], "qwen_ai_platform/qwen-plus-2025-07-14": [4e-7, 12e-7, null, null, null, null], "qwen_ai_platform/qwen-turbo": [5e-8, 2e-7, null, null, null, null], "qwen_ai_platform/qwen-turbo-2024-11-01": [5e-8, 2e-7, null, null, null, null], "qwen_ai_platform/qwen-turbo-2025-04-28": [5e-8, 2e-7, null, null, null, null], "qwen_ai_platform/qwen-turbo-latest": [5e-8, 2e-7, null, null, null, null], "qwen_ai_platform/qwen3-next-80b-a3b-instruct": [15e-8, 12e-7, null, null, null, null], "qwen_ai_platform/qwen3-next-80b-a3b-thinking": [15e-8, 12e-7, null, null, null, null], "qwen_ai_platform/qwen3-vl-235b-a22b-instruct": [4e-7, 16e-7, null, null, null, null], "qwen_ai_platform/qwen3-vl-235b-a22b-thinking": [4e-7, 4e-6, null, null, null, null], "qwen_ai_platform/qwen3-vl-32b-instruct": [16e-8, 64e-8, null, null, null, null], "qwen_ai_platform/qwen3-vl-32b-thinking": [16e-8, 287e-8, null, null, null, null], "qwen_ai_platform/qwen3.7-max": [25e-7, 75e-7, null, 5e-7, null, null], "qwen_ai_platform/qwen3.8-max": [2e-6, 6e-6, null, 25e-8, null, null], "qwen_ai_platform/qwen3.8-flash": [15e-8, 47e-8, 2e-7, 16e-9, null, null], "qwen_ai_platform/qwen3.8-omni-flash": [15e-8, 47e-8, null, 16e-9, null, null], "qwen_ai_platform/qwq-plus": [8e-7, 24e-7, null, null, null, null], "databricks/databricks-bge-large-en": [10003e-11, 0, 10003e-11, 10003e-11, null, null], "databricks-bge-large-en": [10003e-11, 0, 10003e-11, 10003e-11, null, null], "databricks/databricks-claude-fable-5": [1000006e-11, 5000002e-11, 1250004e-11, 100002e-11, null, null], "databricks-claude-fable-5": [1000006e-11, 5000002e-11, 1250004e-11, 100002e-11, null, null], "databricks/databricks-claude-fable-5-1": [1000006e-11, 5000002e-11, 1250004e-11, 25004e-11, null, null], "databricks-claude-fable-5-1": [1000006e-11, 5000002e-11, 1250004e-11, 25004e-11, null, null], "databricks/databricks-claude-haiku-4-5": [100002e-11, 500003e-11, 124999e-11, 10003e-11, null, null], "databricks-claude-haiku-4-5": [100002e-11, 500003e-11, 124999e-11, 10003e-11, null, null], "databricks/databricks-claude-opus-4": [15000020000000002e-21, 7500003000000001e-20, 1874999e-11, 150003e-11, null, null], "databricks-claude-opus-4": [15000020000000002e-21, 7500003000000001e-20, 1874999e-11, 150003e-11, null, null], "databricks/databricks-claude-opus-4-1": [15000020000000002e-21, 7500003000000001e-20, 1874999e-11, 150003e-11, null, null], "databricks-claude-opus-4-1": [15000020000000002e-21, 7500003000000001e-20, 1874999e-11, 150003e-11, null, null], "databricks/databricks-claude-opus-4-5": [500003e-11, 25000010000000002e-21, 625002e-11, 50001e-11, null, null], "databricks-claude-opus-4-5": [500003e-11, 25000010000000002e-21, 625002e-11, 50001e-11, null, null], "databricks/databricks-claude-opus-4-6": [500003e-11, 25000010000000002e-21, 625002e-11, 50001e-11, null, null], "databricks-claude-opus-4-6": [500003e-11, 25000010000000002e-21, 625002e-11, 50001e-11, null, null], "databricks/databricks-claude-opus-4-7": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks-claude-opus-4-7": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks/databricks-claude-opus-4-8": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks-claude-opus-4-8": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks/databricks-claude-opus-5": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks-claude-opus-5": [500003e-11, 2500001e-11, 625002e-11, 50001e-11, null, null], "databricks/databricks-claude-opus-5-5": [400001e-11, 1999998e-11, 500003e-11, 19999e-11, null, null], "databricks-claude-opus-5-5": [400001e-11, 1999998e-11, 500003e-11, 19999e-11, null, null], "databricks/databricks-claude-sonnet-4": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks-claude-sonnet-4": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks/databricks-claude-sonnet-4-1": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks-claude-sonnet-4-1": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks/databricks-claude-sonnet-4-5": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks-claude-sonnet-4-5": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks/databricks-claude-sonnet-4-6": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks-claude-sonnet-4-6": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks/databricks-claude-sonnet-5": [299999e-11, 1500002e-11, 374997e-11, 30002e-11, null, null], "databricks-claude-sonnet-5": [299999e-11, 1500002e-11, 374997e-11, 30002e-11, null, null], "databricks/databricks-deepseek-v4-flash-0731": [14e-8, 28e-8, 14e-8, 28e-9, null, null], "databricks-deepseek-v4-flash-0731": [14e-8, 28e-8, 14e-8, 28e-9, null, null], "databricks/databricks-deepseek-v4-pro-0813": [131999e-11, 395997e-11, 131999e-11, 13202e-11, null, null], "databricks-deepseek-v4-pro-0813": [131999e-11, 395997e-11, 131999e-11, 13202e-11, null, null], "databricks/databricks-gemini-2-5-flash": [30001999999999996e-23, 249998e-11, 30002e-11, 30002e-12, null, null], "databricks-gemini-2-5-flash": [30001999999999996e-23, 249998e-11, 30002e-11, 30002e-12, null, null], "databricks/databricks-gemini-2-5-pro": [124999e-11, 9999990000000002e-21, 124999e-11, 124999e-12, null, null], "databricks-gemini-2-5-pro": [124999e-11, 9999990000000002e-21, 124999e-11, 124999e-12, null, null], "databricks/databricks-gemini-3-1-flash-lite": [31248e-11, 187502e-11, 31248e-11, 3122e-11, null, null], "databricks-gemini-3-1-flash-lite": [31248e-11, 187502e-11, 31248e-11, 3122e-11, null, null], "databricks/databricks-gemini-3-1-pro": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks-gemini-3-1-pro": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks/databricks-gemini-3-flash": [62503e-11, 374997e-11, 62503e-11, 6251e-11, null, null], "databricks-gemini-3-flash": [62503e-11, 374997e-11, 62503e-11, 6251e-11, null, null], "databricks/databricks-gemini-3-pro": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks-gemini-3-pro": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks/databricks-gemini-3-6-flash": [187502e-11, 937503e-11, 187502e-11, 18753e-11, null, null], "databricks-gemini-3-6-flash": [187502e-11, 937503e-11, 187502e-11, 18753e-11, null, null], "databricks/databricks-gemini-3-5-flash": [187502e-11, 1124998e-11, 187502e-11, 18753e-11, null, null], "databricks-gemini-3-5-flash": [187502e-11, 1124998e-11, 187502e-11, 18753e-11, null, null], "databricks/databricks-gemini-3-5-flash-lite": [37499e-11, 312501e-11, 37499e-11, 3752e-11, null, null], "databricks-gemini-3-5-flash-lite": [37499e-11, 312501e-11, 37499e-11, 3752e-11, null, null], "databricks/databricks-gemma-3-12b": [15000999999999998e-23, 50001e-11, 15001e-11, 15001e-11, null, null], "databricks-gemma-3-12b": [15000999999999998e-23, 50001e-11, 15001e-11, 15001e-11, null, null], "databricks/databricks-glm-5-2": [14e-7, 439999e-11, 14e-7, 25998e-11, null, null], "databricks-glm-5-2": [14e-7, 439999e-11, 14e-7, 25998e-11, null, null], "databricks/databricks-glm-5-3": [14e-7, 439999e-11, 14e-7, 25998e-11, null, null], "databricks-glm-5-3": [14e-7, 439999e-11, 14e-7, 25998e-11, null, null], "databricks/databricks-glm-5-3-flash": [15001e-11, 50001e-11, 15001e-11, 3003e-11, null, null], "databricks-glm-5-3-flash": [15001e-11, 50001e-11, 15001e-11, 3003e-11, null, null], "databricks/databricks-gpt-5": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks-gpt-5": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks/databricks-gpt-5-1": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks-gpt-5-1": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks/databricks-gpt-5-2": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks-gpt-5-2": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks/databricks-gpt-5-3-codex": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks-gpt-5-3-codex": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks/databricks-gpt-5-4": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks-gpt-5-4": [249998e-11, 15000020000000002e-21, 249998e-11, 24997e-11, null, null], "databricks/databricks-gpt-5-4-mini": [74998e-11, 450002e-11, 74998e-11, 7497e-11, null, null], "databricks-gpt-5-4-mini": [74998e-11, 450002e-11, 74998e-11, 7497e-11, null, null], "databricks/databricks-gpt-5-4-nano": [19999e-11, 124999e-11, 19999e-11, 2002e-11, null, null], "databricks-gpt-5-4-nano": [19999e-11, 124999e-11, 19999e-11, 2002e-11, null, null], "databricks/databricks-gpt-5-6-sol": [400001e-11, 1999998e-11, 500003e-11, 39998e-11, null, null], "databricks-gpt-5-6-sol": [400001e-11, 1999998e-11, 500003e-11, 39998e-11, null, null], "databricks/databricks-gpt-5-6-terra": [249998e-11, 1500002e-11, 312501e-11, 24997e-11, null, null], "databricks-gpt-5-6-terra": [249998e-11, 1500002e-11, 312501e-11, 24997e-11, null, null], "databricks/databricks-gpt-5-6-luna": [100002e-11, 599998e-11, 124999e-11, 10003e-11, null, null], "databricks-gpt-5-6-luna": [100002e-11, 599998e-11, 124999e-11, 10003e-11, null, null], "databricks/databricks-gpt-5-5": [500003e-11, 2999997e-11, 500003e-11, 50001e-11, null, null], "databricks-gpt-5-5": [500003e-11, 2999997e-11, 500003e-11, 50001e-11, null, null], "databricks/databricks-gpt-5-5-pro": [2999997e-11, 18000003e-11, 2999997e-11, 2999997e-11, null, null], "databricks-gpt-5-5-pro": [2999997e-11, 18000003e-11, 2999997e-11, 2999997e-11, null, null], "databricks/databricks-gpt-5-mini": [24997000000000006e-23, 19999700000000004e-22, 24997e-11, 2499e-11, null, null], "databricks-gpt-5-mini": [24997000000000006e-23, 19999700000000004e-22, 24997e-11, 2499e-11, null, null], "databricks/databricks-gpt-5-nano": [4998e-11, 39998000000000007e-23, 4998e-11, 497e-11, null, null], "databricks-gpt-5-nano": [4998e-11, 39998000000000007e-23, 4998e-11, 497e-11, null, null], "databricks/databricks-gpt-oss-120b": [15000999999999998e-23, 59997e-11, 15001e-11, 15001e-11, null, null], "databricks-gpt-oss-120b": [15000999999999998e-23, 59997e-11, 15001e-11, 15001e-11, null, null], "databricks/databricks-gpt-oss-20b": [7e-8, 30001999999999996e-23, 7e-8, 7e-8, null, null], "databricks-gpt-oss-20b": [7e-8, 30001999999999996e-23, 7e-8, 7e-8, null, null], "databricks/databricks-grok-4-6": [249998e-11, 750001e-11, 249998e-11, 62503e-11, null, null], "databricks-grok-4-6": [249998e-11, 750001e-11, 249998e-11, 62503e-11, null, null], "databricks/databricks-gte-large-en": [12999000000000001e-23, 0, 12999e-11, 12999e-11, null, null], "databricks-gte-large-en": [12999000000000001e-23, 0, 12999e-11, 12999e-11, null, null], "databricks/databricks-inkling": [100002e-11, 404999e-11, 100002e-11, 17003e-11, null, null], "databricks-inkling": [100002e-11, 404999e-11, 100002e-11, 17003e-11, null, null], "databricks/databricks-kimi-k3": [299999e-11, 1500002e-11, 299999e-11, 30002e-11, null, null], "databricks-kimi-k3": [299999e-11, 1500002e-11, 299999e-11, 30002e-11, null, null], "databricks/databricks-llama-4-maverick": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks-llama-4-maverick": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks/databricks-meta-llama-3-1-8b-instruct": [15000999999999998e-23, 45003000000000007e-23, 15001e-11, 15001e-11, null, null], "databricks-meta-llama-3-1-8b-instruct": [15000999999999998e-23, 45003000000000007e-23, 15001e-11, 15001e-11, null, null], "databricks/databricks-meta-llama-3-3-70b-instruct": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks-meta-llama-3-3-70b-instruct": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks/databricks-qwen35-122b-a10b": [22001e-11, 220003e-11, 22001e-11, 22001e-11, null, null], "databricks-qwen35-122b-a10b": [22001e-11, 220003e-11, 22001e-11, 22001e-11, null, null], "databricks/databricks-qwen3-next-80b-a3b-instruct": [15001e-11, 120001e-11, 15001e-11, 15001e-11, null, null], "databricks-qwen3-next-80b-a3b-instruct": [15001e-11, 120001e-11, 15001e-11, 15001e-11, null, null], "databricks/databricks-qwen3-embedding-0-6b": [2002e-11, 0, 2002e-11, 2002e-11, null, null], "databricks-qwen3-embedding-0-6b": [2002e-11, 0, 2002e-11, 2002e-11, null, null], "deepinfra/Gryphe/MythoMax-L2-13b": [4e-7, 4e-7, null, null, null, null], "Gryphe/MythoMax-L2-13b": [4e-7, 4e-7, null, null, null, null], "deepinfra/NousResearch/Hermes-3-Llama-3.1-405B": [1e-6, 1e-6, null, null, null, null], "NousResearch/Hermes-3-Llama-3.1-405B": [1e-6, 1e-6, null, null, null, null], "deepinfra/NousResearch/Hermes-3-Llama-3.1-70B": [7e-7, 7e-7, null, null, null, null], "NousResearch/Hermes-3-Llama-3.1-70B": [7e-7, 7e-7, null, null, null, null], "deepinfra/Qwen/QwQ-32B": [15e-8, 4e-7, null, null, null, null], "Qwen/QwQ-32B": [15e-8, 4e-7, null, null, null, null], "deepinfra/Qwen/Qwen2.5-72B-Instruct": [36e-8, 4e-7, null, null, null, null], "Qwen/Qwen2.5-72B-Instruct": [36e-8, 4e-7, null, null, null, null], "deepinfra/Qwen/Qwen2.5-7B-Instruct": [4e-8, 1e-7, null, null, null, null], "Qwen/Qwen2.5-7B-Instruct": [4e-8, 1e-7, null, null, null, null], "deepinfra/Qwen/Qwen2.5-VL-32B-Instruct": [2e-7, 6e-7, null, null, null, null], "Qwen/Qwen2.5-VL-32B-Instruct": [2e-7, 6e-7, null, null, null, null], "deepinfra/Qwen/Qwen3-14B": [12e-8, 24e-8, null, null, null, null], "Qwen/Qwen3-14B": [12e-8, 24e-8, null, null, null, null], "deepinfra/Qwen/Qwen3-235B-A22B": [18e-8, 54e-8, null, null, null, null], "Qwen/Qwen3-235B-A22B": [18e-8, 54e-8, null, null, null, null], "deepinfra/Qwen/Qwen3-235B-A22B-Instruct-2507": [9e-8, 55e-8, null, null, null, null], "Qwen/Qwen3-235B-A22B-Instruct-2507": [9e-8, 55e-8, null, null, null, null], "deepinfra/Qwen/Qwen3-235B-A22B-Thinking-2507": [3e-7, 29e-7, null, null, null, null], "Qwen/Qwen3-235B-A22B-Thinking-2507": [3e-7, 29e-7, null, null, null, null], "deepinfra/Qwen/Qwen3-30B-A3B": [12e-8, 5e-7, null, null, null, null], "Qwen/Qwen3-30B-A3B": [12e-8, 5e-7, null, null, null, null], "deepinfra/Qwen/Qwen3-32B": [8e-8, 28e-8, null, null, null, null], "Qwen/Qwen3-32B": [8e-8, 28e-8, null, null, null, null], "deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct": [4e-7, 16e-7, null, null, null, null], "Qwen/Qwen3-Coder-480B-A35B-Instruct": [4e-7, 16e-7, null, null, null, null], "deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo": [3e-7, 1e-6, null, 1e-7, null, null], "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo": [3e-7, 1e-6, null, 1e-7, null, null], "deepinfra/Qwen/Qwen3-Next-80B-A3B-Instruct": [9e-8, 11e-7, null, null, null, null], "Qwen/Qwen3-Next-80B-A3B-Instruct": [9e-8, 11e-7, null, null, null, null], "deepinfra/Qwen/Qwen3-Next-80B-A3B-Thinking": [14e-8, 14e-7, null, null, null, null], "Qwen/Qwen3-Next-80B-A3B-Thinking": [14e-8, 14e-7, null, null, null, null], "deepinfra/Sao10K/L3-8B-Lunaris-v1-Turbo": [4e-8, 5e-8, null, null, null, null], "Sao10K/L3-8B-Lunaris-v1-Turbo": [4e-8, 5e-8, null, null, null, null], "deepinfra/Sao10K/L3.1-70B-Euryale-v2.2": [85e-8, 85e-8, null, null, null, null], "Sao10K/L3.1-70B-Euryale-v2.2": [85e-8, 85e-8, null, null, null, null], "deepinfra/Sao10K/L3.3-70B-Euryale-v2.3": [65e-8, 75e-8, null, null, null, null], "Sao10K/L3.3-70B-Euryale-v2.3": [65e-8, 75e-8, null, null, null, null], "deepinfra/allenai/olmOCR-7B-0725-FP8": [27e-8, 15e-7, null, null, null, null], "allenai/olmOCR-7B-0725-FP8": [27e-8, 15e-7, null, null, null, null], "deepinfra/anthropic/claude-3-7-sonnet-latest": [33e-7, 165e-7, null, 33e-8, null, null], "anthropic/claude-3-7-sonnet-latest": [33e-7, 165e-7, null, 33e-8, null, null], "deepinfra/anthropic/claude-4-opus": [165e-7, 825e-7, null, null, null, null], "anthropic/claude-4-opus": [165e-7, 825e-7, null, null, null, null], "deepinfra/anthropic/claude-4-sonnet": [33e-7, 165e-7, null, null, null, null], "anthropic/claude-4-sonnet": [33e-7, 165e-7, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-R1": [7e-7, 24e-7, null, null, null, null], "deepseek-ai/DeepSeek-R1": [7e-7, 24e-7, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-R1-0528": [5e-7, 215e-8, null, 4e-7, null, null], "deepseek-ai/DeepSeek-R1-0528": [5e-7, 215e-8, null, 4e-7, null, null], "deepinfra/deepseek-ai/DeepSeek-R1-0528-Turbo": [1e-6, 3e-6, null, null, null, null], "deepseek-ai/DeepSeek-R1-0528-Turbo": [1e-6, 3e-6, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-R1-Distill-Llama-70B": [2e-7, 6e-7, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Llama-70B": [2e-7, 6e-7, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": [27e-8, 27e-8, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": [27e-8, 27e-8, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-R1-Turbo": [1e-6, 3e-6, null, null, null, null], "deepseek-ai/DeepSeek-R1-Turbo": [1e-6, 3e-6, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-V3": [32e-8, 89e-8, null, null, null, null], "deepseek-ai/DeepSeek-V3": [32e-8, 89e-8, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-V3-0324": [24e-8, 9e-7, null, 135e-9, null, null], "deepseek-ai/DeepSeek-V3-0324": [24e-8, 9e-7, null, 135e-9, null, null], "deepinfra/deepseek-ai/DeepSeek-V3.1": [25e-8, 95e-8, null, 216e-9, null, null], "deepseek-ai/DeepSeek-V3.1": [25e-8, 95e-8, null, 216e-9, null, null], "deepinfra/deepseek-ai/DeepSeek-V3.1-Terminus": [27e-8, 1e-6, null, 216e-9, null, null], "deepseek-ai/DeepSeek-V3.1-Terminus": [27e-8, 1e-6, null, 216e-9, null, null], "deepinfra/google/gemini-2.5-flash": [3e-7, 25e-7, null, null, null, null], "google/gemini-2.5-flash": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "deepinfra/google/gemini-2.5-pro": [125e-8, 1e-5, null, null, null, null], "google/gemini-2.5-pro": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "deepinfra/google/gemma-3-12b-it": [5e-8, 15e-8, null, null, null, null], "google/gemma-3-12b-it": [5e-8, 15e-8, null, null, null, null], "deepinfra/google/gemma-3-27b-it": [8e-8, 16e-8, null, null, null, null], "google/gemma-3-27b-it": [8e-8, 16e-8, null, null, null, null], "deepinfra/google/gemma-3-4b-it": [5e-8, 1e-7, null, null, null, null], "google/gemma-3-4b-it": [5e-8, 1e-7, null, null, null, null], "deepinfra/meta-llama/Llama-3.2-11B-Vision-Instruct": [49e-9, 49e-9, null, null, null, null], "meta-llama/Llama-3.2-11B-Vision-Instruct": [49e-9, 49e-9, null, null, null, null], "deepinfra/meta-llama/Llama-3.2-3B-Instruct": [2e-8, 2e-8, null, null, null, null], "meta-llama/Llama-3.2-3B-Instruct": [2e-8, 2e-8, null, null, null, null], "deepinfra/meta-llama/Llama-3.3-70B-Instruct": [23e-8, 4e-7, null, null, null, null], "meta-llama/Llama-3.3-70B-Instruct": [23e-8, 4e-7, null, null, null, null], "deepinfra/meta-llama/Llama-3.3-70B-Instruct-Turbo": [1e-7, 32e-8, null, null, null, null], "meta-llama/Llama-3.3-70B-Instruct-Turbo": [1e-7, 32e-8, null, null, null, null], "deepinfra/meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": [2e-7, 8e-7, null, null, null, null], "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": [2e-7, 8e-7, null, null, null, null], "deepinfra/meta-llama/Llama-4-Scout-17B-16E-Instruct": [1e-7, 3e-7, null, null, null, null], "meta-llama/Llama-4-Scout-17B-16E-Instruct": [1e-7, 3e-7, null, null, null, null], "deepinfra/meta-llama/Llama-Guard-3-8B": [55e-9, 55e-9, null, null, null, null], "meta-llama/Llama-Guard-3-8B": [55e-9, 55e-9, null, null, null, null], "deepinfra/meta-llama/Llama-Guard-4-12B": [18e-8, 18e-8, null, null, null, null], "meta-llama/Llama-Guard-4-12B": [18e-8, 18e-8, null, null, null, null], "deepinfra/meta-llama/Meta-Llama-3-8B-Instruct": [3e-8, 6e-8, null, null, null, null], "deepinfra/meta-llama/Meta-Llama-3.1-70B-Instruct": [4e-7, 4e-7, null, null, null, null], "meta-llama/Meta-Llama-3.1-70B-Instruct": [4e-7, 4e-7, null, null, null, null], "deepinfra/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": [4e-7, 4e-7, null, null, null, null], "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": [4e-7, 4e-7, null, null, null, null], "deepinfra/meta-llama/Meta-Llama-3.1-8B-Instruct": [3e-8, 5e-8, null, null, null, null], "meta-llama/Meta-Llama-3.1-8B-Instruct": [3e-8, 5e-8, null, null, null, null], "deepinfra/meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": [2e-8, 4e-8, null, null, null, null], "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": [2e-8, 4e-8, null, null, null, null], "deepinfra/microsoft/WizardLM-2-8x22B": [48e-8, 48e-8, null, null, null, null], "microsoft/WizardLM-2-8x22B": [48e-8, 48e-8, null, null, null, null], "deepinfra/microsoft/phi-4": [7e-8, 14e-8, null, null, null, null], "microsoft/phi-4": [7e-8, 14e-8, null, null, null, null], "deepinfra/mistralai/Mistral-Nemo-Instruct-2407": [19e-9, 3e-8, null, null, null, null], "mistralai/Mistral-Nemo-Instruct-2407": [19e-9, 3e-8, null, null, null, null], "deepinfra/mistralai/Mistral-Small-24B-Instruct-2501": [5e-8, 8e-8, null, null, null, null], "mistralai/Mistral-Small-24B-Instruct-2501": [5e-8, 8e-8, null, null, null, null], "deepinfra/mistralai/Mistral-Small-3.2-24B-Instruct-2506": [75e-9, 2e-7, null, null, null, null], "mistralai/Mistral-Small-3.2-24B-Instruct-2506": [75e-9, 2e-7, null, null, null, null], "deepinfra/mistralai/Mixtral-8x7B-Instruct-v0.1": [4e-7, 4e-7, null, null, null, null], "deepinfra/moonshotai/Kimi-K2-Instruct": [5e-7, 2e-6, null, null, null, null], "moonshotai/Kimi-K2-Instruct": [5e-7, 2e-6, null, null, null, null], "deepinfra/moonshotai/Kimi-K2-Instruct-0905": [5e-7, 2e-6, null, 4e-7, null, null], "moonshotai/Kimi-K2-Instruct-0905": [5e-7, 2e-6, null, 4e-7, null, null], "deepinfra/nvidia/Llama-3.1-Nemotron-70B-Instruct": [6e-7, 6e-7, null, null, null, null], "nvidia/Llama-3.1-Nemotron-70B-Instruct": [6e-7, 6e-7, null, null, null, null], "deepinfra/nvidia/Llama-3.3-Nemotron-Super-49B-v1.5": [1e-7, 4e-7, null, null, null, null], "nvidia/Llama-3.3-Nemotron-Super-49B-v1.5": [1e-7, 4e-7, null, null, null, null], "deepinfra/nvidia/NVIDIA-Nemotron-3.5-Lightning": [8e-8, 2e-7, null, 4e-8, null, null], "nvidia/NVIDIA-Nemotron-3.5-Lightning": [8e-8, 2e-7, null, 4e-8, null, null], "deepinfra/nvidia/NVIDIA-Nemotron-Nano-9B-v2": [4e-8, 16e-8, null, null, null, null], "nvidia/NVIDIA-Nemotron-Nano-9B-v2": [4e-8, 16e-8, null, null, null, null], "deepinfra/openai/gpt-oss-120b": [37e-9, 17e-8, null, null, null, null], "openai/gpt-oss-120b": [37e-9, 17e-8, null, null, null, null], "deepinfra/openai/gpt-oss-20b": [3e-8, 14e-8, null, null, null, null], "openai/gpt-oss-20b": [3e-8, 14e-8, null, null, null, null], "deepinfra/zai-org/GLM-4.5": [4e-7, 16e-7, null, null, null, null], "zai-org/GLM-4.5": [4e-7, 16e-7, null, null, null, null], "deepseek/deepseek-chat": [28e-8, 42e-8, 0, 28e-9, null, null], "deepseek/deepseek-coder": [14e-8, 28e-8, null, 14e-9, null, null], "deepseek-coder": [14e-8, 28e-8, null, 14e-9, null, null], "deepseek/deepseek-r1": [55e-8, 219e-8, null, 14e-8, null, null], "deepseek-r1": [55e-8, 219e-8, null, 14e-8, null, null], "deepseek/deepseek-reasoner": [28e-8, 42e-8, null, 28e-9, null, null], "deepseek/deepseek-v3": [27e-8, 11e-7, 0, 7e-8, null, null], "deepseek/deepseek-v3.2": [28e-8, 4e-7, null, 28e-9, null, null], "sail/moonshotai/Kimi-K3": [25e-7, 125e-7, null, 25e-8, null, null, [125e-8, 625e-8, null, 15e-8, null, null]], "moonshotai/Kimi-K3": [25e-7, 125e-7, null, 25e-8, null, null, [125e-8, 625e-8, null, 15e-8, null, null]], "sail/zai-org/GLM-5.3": [98e-8, 308e-8, null, 18e-8, null, null, [4e-7, 18e-7, null, 8e-8, null, null]], "zai-org/GLM-5.3": [98e-8, 308e-8, null, 18e-8, null, null, [4e-7, 18e-7, null, 8e-8, null, null]], "sail/zai-org/GLM-5.3-Flash": [11e-8, 35e-8, null, 2e-8, null, null, [5e-8, 18e-8, null, 1e-8, null, null]], "zai-org/GLM-5.3-Flash": [11e-8, 35e-8, null, 2e-8, null, null, [5e-8, 18e-8, null, 1e-8, null, null]], "sail/deepseek-ai/DeepSeek-V4-Pro-0813": [92e-8, 277e-8, null, 4e-8, null, null, [46e-8, 139e-8, null, 2e-8, null, null]], "deepseek-ai/DeepSeek-V4-Pro-0813": [92e-8, 277e-8, null, 4e-8, null, null, [46e-8, 139e-8, null, 2e-8, null, null]], "sail/deepseek-ai/DeepSeek-V4-Flash-0731": [9e-8, 18e-8, null, 2e-8, null, null, [5e-8, 9e-8, null, 1e-8, null, null]], "deepseek-ai/DeepSeek-V4-Flash-0731": [9e-8, 18e-8, null, 2e-8, null, null, [5e-8, 9e-8, null, 1e-8, null, null]], "sail/deepseek-ai/DeepSeek-V4.1-Flash": [15e-8, 6e-7, null, 6e-9, null, null, [8e-8, 3e-7, null, 4e-9, null, null]], "deepseek-ai/DeepSeek-V4.1-Flash": [15e-8, 6e-7, null, 6e-9, null, null, [8e-8, 3e-7, null, 4e-9, null, null]], "sail/moonshotai/Kimi-K2.6": [1e-6, 4e-6, null, 2e-7, null, null, [35e-8, 2e-6, null, 1e-7, null, null]], "moonshotai/Kimi-K2.6": [1e-6, 4e-6, null, 2e-7, null, null, [35e-8, 2e-6, null, 1e-7, null, null]], "sail/google/gemma-4-31B-it": [4e-7, 6e-7, null, 2e-7, null, null, [6e-8, 3e-7, null, 2e-8, null, null]], "google/gemma-4-31B-it": [4e-7, 6e-7, null, 2e-7, null, null, [6e-8, 3e-7, null, 2e-8, null, null]], "sail/nvidia/Gemma-4-31B-IT-NVFP4": [14e-8, 4e-7, null, 7e-8, null, null, [7e-8, 2e-7, null, 4e-8, null, null]], "nvidia/Gemma-4-31B-IT-NVFP4": [14e-8, 4e-7, null, 7e-8, null, null, [7e-8, 2e-7, null, 4e-8, null, null]], "sail/google/gemma-4-12B-it": [3e-7, 2e-6, null, 15e-8, null, null, [5e-8, 1e-6, null, 2e-8, null, null]], "google/gemma-4-12B-it": [3e-7, 2e-6, null, 15e-8, null, null, [5e-8, 1e-6, null, 2e-8, null, null]], "sail/openai/gpt-oss-120b": [6e-8, 4e-7, null, 3e-8, null, null], "sail/Qwen/Qwen3.6-35B-A3B": [5e-8, 4e-7, null, 2e-8, null, null, [5e-8, 4e-7, null, 2e-8, null, null]], "Qwen/Qwen3.6-35B-A3B": [5e-8, 4e-7, null, 2e-8, null, null, [5e-8, 4e-7, null, 2e-8, null, null]], "fal_ai/fal-ai/moondream3-preview/query": [4e-7, 35e-7, null, null, null, null], "fal-ai/moondream3-preview/query": [4e-7, 35e-7, null, null, null, null], "fireworks_ai/WhereIsAI/UAE-Large-V1": [16e-9, 0, null, null, null, null], "WhereIsAI/UAE-Large-V1": [16e-9, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-instruct": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-v2-instruct": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1": [3e-6, 8e-6, null, null, null, null], "accounts/fireworks/models/deepseek-r1": [3e-6, 8e-6, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-0528": [3e-6, 8e-6, null, null, null, null], "accounts/fireworks/models/deepseek-r1-0528": [3e-6, 8e-6, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-basic": [55e-8, 219e-8, null, null, null, null], "accounts/fireworks/models/deepseek-r1-basic": [55e-8, 219e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v3": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/deepseek-v3": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v3-0324": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/deepseek-v3-0324": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v3p1": [56e-8, 168e-8, null, null, null, null], "accounts/fireworks/models/deepseek-v3p1": [56e-8, 168e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v3p1-terminus": [56e-8, 168e-8, null, null, null, null], "accounts/fireworks/models/deepseek-v3p1-terminus": [56e-8, 168e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v3p2": [56e-8, 168e-8, null, null, null, null], "accounts/fireworks/models/deepseek-v3p2": [56e-8, 168e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash": [14e-8, 28e-8, null, 28e-9, null, null], "accounts/fireworks/models/deepseek-v4-flash": [14e-8, 28e-8, null, 28e-9, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813": [132e-8, 396e-8, null, 44e-9, 1.25, null], "accounts/fireworks/models/deepseek-v4-pro-0813": [132e-8, 396e-8, null, 44e-9, 1.25, null], "fireworks_ai/deepseek-v4-pro-0813": [132e-8, 396e-8, null, 44e-9, 1.25, null], "deepseek-v4-pro-0813": [132e-8, 396e-8, null, 44e-9, 1.25, null], "fireworks_ai/accounts/fireworks/models/firefunction-v2": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/firefunction-v2": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-4p5": [55e-8, 219e-8, null, null, null, null], "accounts/fireworks/models/glm-4p5": [55e-8, 219e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-4p5-air": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/glm-4p5-air": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-4p6": [55e-8, 219e-8, null, null, null, null], "accounts/fireworks/models/glm-4p6": [55e-8, 219e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-4p7": [6e-7, 22e-7, null, 3e-7, null, null], "accounts/fireworks/models/glm-4p7": [6e-7, 22e-7, null, 3e-7, null, null], "fireworks_ai/accounts/fireworks/models/glm-5p1": [14e-7, 44e-7, null, 26e-8, null, null], "accounts/fireworks/models/glm-5p1": [14e-7, 44e-7, null, 26e-8, null, null], "fireworks_ai/accounts/fireworks/models/glm-5p2": [14e-7, 44e-7, null, 14e-8, 1.25, null], "accounts/fireworks/models/glm-5p2": [14e-7, 44e-7, null, 14e-8, 1.25, null], "fireworks_ai/accounts/fireworks/models/gpt-oss-120b": [15e-8, 6e-7, null, 15e-9, 1.2, null], "accounts/fireworks/models/gpt-oss-120b": [15e-8, 6e-7, null, 15e-9, 1.2, null], "fireworks_ai/accounts/fireworks/models/gpt-oss-20b": [7e-8, 3e-7, null, 35e-9, null, null], "accounts/fireworks/models/gpt-oss-20b": [7e-8, 3e-7, null, 35e-9, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2-instruct": [6e-7, 25e-7, null, null, null, null], "accounts/fireworks/models/kimi-k2-instruct": [6e-7, 25e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2-instruct-0905": [6e-7, 25e-7, null, null, null, null], "accounts/fireworks/models/kimi-k2-instruct-0905": [6e-7, 25e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "accounts/fireworks/models/kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2p5": [6e-7, 3e-6, null, 1e-7, null, null], "accounts/fireworks/models/kimi-k2p5": [6e-7, 3e-6, null, 1e-7, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2p6": [95e-8, 4e-6, null, 16e-8, null, null], "accounts/fireworks/models/kimi-k2p6": [95e-8, 4e-6, null, 16e-8, null, null], "fireworks_ai/accounts/fireworks/models/kimi-k2p7-code": [95e-8, 4e-6, null, 19e-8, 1.5, null], "accounts/fireworks/models/kimi-k2p7-code": [95e-8, 4e-6, null, 19e-8, 1.5, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-405b-instruct": [3e-6, 3e-6, null, null, null, null], "accounts/fireworks/models/llama-v3p1-405b-instruct": [3e-6, 3e-6, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-8b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p1-8b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-11b-vision-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-11b-vision-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-1b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-1b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-3b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-3b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-90b-vision-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-90b-vision-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama4-maverick-instruct-basic": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/llama4-maverick-instruct-basic": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama4-scout-instruct-basic": [15e-8, 6e-7, null, null, null, null], "accounts/fireworks/models/llama4-scout-instruct-basic": [15e-8, 6e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/minimax-m2p1": [3e-7, 12e-7, null, 3e-8, null, null], "accounts/fireworks/models/minimax-m2p1": [3e-7, 12e-7, null, 3e-8, null, null], "fireworks_ai/accounts/fireworks/models/minimax-m3": [3e-7, 12e-7, null, 6e-8, 1.5, null], "accounts/fireworks/models/minimax-m3": [3e-7, 12e-7, null, 6e-8, 1.5, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x22b-instruct-hf": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x22b-instruct-hf": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2-72b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2-72b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-32b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/yi-large": [3e-6, 3e-6, null, null, null, null], "accounts/fireworks/models/yi-large": [3e-6, 3e-6, null, null, null, null], "fireworks_ai/deepseek-v4-flash": [14e-8, 28e-8, null, 28e-9, null, null], "fireworks_ai/glm-4p7": [6e-7, 22e-7, null, 3e-7, null, null], "glm-4p7": [6e-7, 22e-7, null, 3e-7, null, null], "fireworks_ai/glm-5p1": [14e-7, 44e-7, null, 26e-8, null, null], "glm-5p1": [14e-7, 44e-7, null, 26e-8, null, null], "fireworks_ai/glm-5p1-fast": [28e-7, 88e-7, null, 52e-8, null, null], "glm-5p1-fast": [28e-7, 88e-7, null, 52e-8, null, null], "fireworks_ai/glm-5p2": [14e-7, 44e-7, null, 14e-8, 1.25, null], "glm-5p2": [14e-7, 44e-7, null, 14e-8, 1.25, null], "fireworks_ai/gpt-oss-120b": [15e-8, 6e-7, null, 15e-9, 1.2, null], "fireworks_ai/gpt-oss-20b": [7e-8, 3e-7, null, 35e-9, null, null], "gpt-oss-20b": [7e-8, 3e-7, null, 35e-9, null, null], "fireworks_ai/kimi-k2p5": [6e-7, 3e-6, null, 1e-7, null, null], "kimi-k2p5": [6e-7, 3e-6, null, 1e-7, null, null], "fireworks_ai/kimi-k2p6": [95e-8, 4e-6, null, 16e-8, null, null], "kimi-k2p6": [95e-8, 4e-6, null, 16e-8, null, null], "fireworks_ai/kimi-k2p6-fast": [2e-6, 8e-6, null, 3e-7, null, null], "kimi-k2p6-fast": [2e-6, 8e-6, null, 3e-7, null, null], "fireworks_ai/kimi-k2p7-code": [95e-8, 4e-6, null, 19e-8, 1.5, null], "kimi-k2p7-code": [95e-8, 4e-6, null, 19e-8, 1.5, null], "fireworks_ai/kimi-k2p7-code-fast": [19e-7, 8e-6, null, 38e-8, null, null], "kimi-k2p7-code-fast": [19e-7, 8e-6, null, 38e-8, null, null], "fireworks_ai/minimax-m2p1": [3e-7, 12e-7, null, 3e-8, null, null], "minimax-m2p1": [3e-7, 12e-7, null, 3e-8, null, null], "fireworks_ai/minimax-m3": [3e-7, 12e-7, null, 6e-8, 1.5, null], "minimax-m3": [3e-7, 12e-7, 0, 6e-8, null, null], "fireworks_ai/qwen3p7-plus": [4e-7, 16e-7, null, 8e-8, null, null], "qwen3p7-plus": [4e-7, 16e-7, null, 8e-8, null, null], "fireworks_ai/nomic-ai/nomic-embed-text-v1": [8e-9, 0, null, null, null, null], "nomic-ai/nomic-embed-text-v1": [8e-9, 0, null, null, null, null], "fireworks_ai/nomic-ai/nomic-embed-text-v1.5": [8e-9, 0, null, null, null, null], "nomic-ai/nomic-embed-text-v1.5": [8e-9, 0, null, null, null, null], "fireworks_ai/thenlper/gte-base": [8e-9, 0, null, null, null, null], "thenlper/gte-base": [8e-9, 0, null, null, null, null], "fireworks_ai/thenlper/gte-large": [16e-9, 0, null, null, null, null], "thenlper/gte-large": [16e-9, 0, null, null, null, null], "friendliai/zai-org/GLM-5.3-Flash": [15e-8, 5e-7, null, 3e-8, null, null], "friendliai/zai-org/GLM-5.3": [126e-8, 396e-8, null, 234e-9, null, null], "friendliai/google/gemma-4-31B-it": [14e-8, 4e-7, null, null, null, null], "friendliai/zai-org/GLM-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "zai-org/GLM-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "friendliai/deepseek-ai/DeepSeek-V3.2": [5e-7, 15e-7, null, 25e-8, null, null], "deepseek-ai/DeepSeek-V3.2": [5e-7, 15e-7, null, 25e-8, null, null], "friendliai/MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, 6e-8, null, null], "MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, 6e-8, null, null], "friendliai/zai-org/GLM-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "zai-org/GLM-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "gemini/gemini-live-2.5-flash-preview-native-audio-09-2025": [5e-7, 2e-6, null, null, null, null], "vertex_ai/gemini-3-pro-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "gemini-3-pro-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "vertex_ai/gemini-3-flash-preview": [5e-7, 3e-6, null, 5e-8, 1.8, null, [25e-8, 15e-7, null, 5e-8, null, null]], "vertex_ai/gemini-3.5-flash": [15e-7, 9e-6, null, 15e-8, 1.8, null, [75e-8, 45e-7, null, 75e-9, null, null]], "vertex_ai/gemini-3.6-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "vertex_ai/gemini-3.7-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "vertex_ai/gemini-3.8-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "vertex_ai/gemini-3.8-flash-cyber": [15e-7, 75e-7, null, 15e-8, 1.8, null, [75e-8, 375e-8, null, 75e-9, null, null]], "vertex_ai/gemini-3.8-live": [75e-8, 45e-7, null, null, null, null], "vertex_ai/gemini-3.1-pro-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }]], "vertex_ai/gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "gemini/gemini-robotics-er-2-preview": [1e-6, 5e-6, null, 1e-7, null, null], "gemini-robotics-er-2-preview": [1e-6, 5e-6, null, 1e-7, null, null], "vertex_ai/gemini-embedding-2-preview": [2e-7, 0, null, null, null, null], "vertex_ai/gemini-embedding-2": [2e-7, 0, null, null, null, null], "gemini/gemini-embedding-001": [15e-8, 0, null, null, null, null], "gemini/gemini-embedding-2": [2e-7, 0, null, null, null, null], "gemini/gemini-3-pro-image-preview": [2e-6, 12e-6, null, null, 1.8, null, [1e-6, 6e-6, null, null, null, null]], "gemini/gemini-3.1-flash-image-preview": [5e-7, 3e-6, null, null, null, null], "gemini/gemini-3.1-flash-lite-preview": [25e-8, 15e-7, null, 25e-9, 1.8, null, [125e-9, 75e-8, null, 125e-10, null, null]], "gemini/gemini-embedding-2-preview": [2e-7, 0, null, null, null, null], "gemini/deep-research-preview-04-2026": [2e-6, 12e-6, null, null, null, null], "deep-research-preview-04-2026": [2e-6, 12e-6, null, null, null, null], "gemini/deep-research-max-preview-04-2026": [2e-6, 12e-6, null, null, null, null], "deep-research-max-preview-04-2026": [2e-6, 12e-6, null, null, null, null], "gemini/gemini-2.5-flash": [3e-7, 25e-7, null, 3e-8, 1.8, null, [15e-8, 125e-8, null, 3e-8, null, null]], "gemini/gemini-2.5-flash-image": [3e-7, 25e-7, null, 3e-8, null, null], "gemini/gemini-3-pro-image": [2e-6, 12e-6, null, null, 1.8, null, [1e-6, 6e-6, null, null, null, null]], "gemini/nano-banana-pro-preview": [2e-6, 12e-6, null, null, 1.8, null, [1e-6, 6e-6, null, null, null, null]], "nano-banana-pro-preview": [2e-6, 12e-6, null, null, 1.8, null, [1e-6, 6e-6, null, null, null, null]], "gemini/gemini-3.1-flash-image": [5e-7, 3e-6, null, null, null, null], "gemini/gemini-3.1-flash-lite-image": [25e-8, 15e-7, null, null, null, null], "gemini/deep-research-pro-preview-12-2025": [2e-6, 12e-6, null, null, null, null], "gemini/gemini-2.5-flash-lite": [1e-7, 4e-7, null, 1e-8, 1.8, null, [5e-8, 2e-7, null, 1e-8, null, null]], "gemini/gemini-flash-latest": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini/gemini-flash-lite-latest": [3e-7, 25e-7, null, 3e-8, null, null, [15e-8, 125e-8, null, 2e-8, null, null]], "gemini/gemini-2.5-flash-preview-tts": [5e-7, 1e-5, null, null, null, null], "gemini/gemini-2.5-pro": [125e-8, 1e-5, null, 125e-9, 1.8, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }, [625e-9, 5e-6, null, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }]], "gemini/gemini-2.5-computer-use-preview-10-2025": [125e-8, 1e-5, null, null, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: null }], "gemini/gemini-3.1-flash-lite": [25e-8, 15e-7, null, 25e-9, 1.8, null, [125e-9, 75e-8, null, 125e-10, null, null]], "gemini/gemini-3.5-flash-lite": [3e-7, 25e-7, null, 3e-8, null, null, [15e-8, 125e-8, null, 2e-8, null, null]], "gemini/gemini-3-flash-preview": [5e-7, 3e-6, null, 5e-8, 1.8, null, [25e-8, 15e-7, null, 5e-8, null, null]], "gemini/gemini-3.5-flash": [15e-7, 9e-6, null, 15e-8, 1.8, null, [75e-8, 45e-7, null, 8e-8, null, null]], "gemini/gemini-3.6-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini/gemini-3.7-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini/gemini-3.8-flash": [75e-8, 375e-8, null, 75e-9, 1.8, null, [375e-9, 1875e-9, null, 375e-10, null, null]], "gemini/gemini-omni-flash-preview": [15e-7, 9e-6, null, null, null, null], "gemini/gemini-3.1-pro-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "gemini/gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "gemini/gemini-2.5-pro-preview-tts": [1e-6, 2e-5, null, 125e-9, null, null], "gemini/gemini-exp-1114": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemini-exp-1114": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemini/gemini-exp-1206": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemini/gemini-gemma-2-27b-it": [35e-8, 105e-8, null, null, null, null], "gemini-gemma-2-27b-it": [35e-8, 105e-8, null, null, null, null], "gemini/gemini-gemma-2-9b-it": [35e-8, 105e-8, null, null, null, null], "gemini-gemma-2-9b-it": [35e-8, 105e-8, null, null, null, null], "gemini/gemma-3-27b-it": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemma-3-27b-it": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemini/gemma-4-26b-a4b-it": [0, 0, null, null, null, null], "gemma-4-26b-a4b-it": [0, 0, null, null, null, null], "gemini/gemma-4-31b-it": [0, 0, null, null, null, null], "gemma-4-31b-it": [0, 0, null, null, null, null], "gemini/learnlm-1.5-pro-experimental": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "learnlm-1.5-pro-experimental": [0, 0, null, null, null, { threshold: 128e3, input: 0, output: 0, cacheWrite: null, cacheRead: null }], "gemini/lyria-3-clip-preview": [0, 0, null, null, null, null], "lyria-3-clip-preview": [0, 0, null, null, null, null], "gemini/lyria-3-pro-preview": [0, 0, null, null, null, null], "lyria-3-pro-preview": [0, 0, null, null, null, null], "github_copilot/mai-code-1-flash": [75e-8, 45e-7, null, 75e-9, null, null], "mai-code-1-flash": [75e-8, 45e-7, null, 75e-9, null, null], "github_copilot/mai-code-1-flash-internal": [75e-8, 45e-7, null, 75e-9, null, null], "mai-code-1-flash-internal": [75e-8, 45e-7, null, 75e-9, null, null], "gigachat/GigaChat-2": [0, 0, null, null, null, null], "GigaChat-2": [0, 0, null, null, null, null], "gigachat/GigaChat-2-Max": [0, 0, null, null, null, null], "GigaChat-2-Max": [0, 0, null, null, null, null], "gigachat/GigaChat-2-Pro": [0, 0, null, null, null, null], "GigaChat-2-Pro": [0, 0, null, null, null, null], "gigachat/Embeddings": [0, 0, null, null, null, null], Embeddings: [0, 0, null, null, null, null], "gigachat/Embeddings-2": [0, 0, null, null, null, null], "Embeddings-2": [0, 0, null, null, null, null], "gigachat/EmbeddingsGigaR": [0, 0, null, null, null, null], EmbeddingsGigaR: [0, 0, null, null, null, null], "gigachat/GigaEmbeddings-3B-2025-09": [0, 0, null, null, null, null], "GigaEmbeddings-3B-2025-09": [0, 0, null, null, null, null], "gmi/anthropic/claude-opus-4.5": [5e-6, 25e-6, null, null, null, null], "anthropic/claude-opus-4.5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "gmi/anthropic/claude-sonnet-4.5": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-sonnet-4.5": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "gmi/anthropic/claude-sonnet-4": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-sonnet-4": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "gmi/anthropic/claude-opus-4": [15e-6, 75e-6, null, null, null, null], "anthropic/claude-opus-4": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "gmi/openai/gpt-5.2": [175e-8, 14e-6, null, null, null, null], "openai/gpt-5.2": [175e-8, 14e-6, null, 175e-9, null, null], "gmi/openai/gpt-5.1": [125e-8, 1e-5, null, null, null, null], "openai/gpt-5.1": [125e-8, 1e-5, null, 125e-9, null, null], "gmi/openai/gpt-5": [125e-8, 1e-5, null, null, null, null], "openai/gpt-5": [125e-8, 1e-5, null, 125e-9, null, null], "gmi/openai/gpt-4o": [25e-7, 1e-5, null, null, null, null], "openai/gpt-4o": [25e-7, 1e-5, 0, 125e-8, null, null], "gmi/openai/gpt-4o-mini": [15e-8, 6e-7, null, null, null, null], "openai/gpt-4o-mini": [15e-8, 6e-7, 0, 75e-9, null, null], "gmi/deepseek-ai/DeepSeek-V3.2": [28e-8, 4e-7, null, null, null, null], "gmi/deepseek-ai/DeepSeek-V3-0324": [28e-8, 88e-8, null, null, null, null], "gmi/google/gemini-3-flash-preview": [5e-7, 3e-6, null, null, null, null], "google/gemini-3-flash-preview": [5e-7, 3e-6, 833333333333333e-22, 5e-8, null, null], "gmi/moonshotai/Kimi-K2-Thinking": [8e-7, 12e-7, null, null, null, null], "moonshotai/Kimi-K2-Thinking": [8e-7, 12e-7, null, null, null, null], "gmi/MiniMaxAI/MiniMax-M2.1": [3e-7, 12e-7, null, null, null, null], "MiniMaxAI/MiniMax-M2.1": [3e-7, 12e-7, null, null, null, null], "baseten/MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, null, null, null], "baseten/nvidia/Nemotron-120B-A12B": [3e-7, 75e-8, null, null, null, null], "nvidia/Nemotron-120B-A12B": [3e-7, 75e-8, null, null, null, null], "baseten/zai-org/GLM-5": [95e-8, 315e-8, null, null, null, null], "zai-org/GLM-5": [95e-8, 315e-8, null, null, null, null], "baseten/zai-org/GLM-4.7": [6e-7, 22e-7, null, 12e-8, null, null], "zai-org/GLM-4.7": [6e-7, 22e-7, null, 12e-8, null, null], "baseten/zai-org/GLM-4.6": [6e-7, 22e-7, null, null, null, null], "zai-org/GLM-4.6": [6e-7, 22e-7, null, null, null, null], "baseten/moonshotai/Kimi-K2.5": [6e-7, 3e-6, null, null, null, null], "moonshotai/Kimi-K2.5": [6e-7, 3e-6, null, 1e-7, null, null], "baseten/moonshotai/Kimi-K2-Thinking": [6e-7, 25e-7, null, null, null, null], "baseten/moonshotai/Kimi-K2-Instruct-0905": [6e-7, 25e-7, null, null, null, null], "baseten/openai/gpt-oss-120b": [1e-7, 5e-7, null, 1e-7, null, null], "baseten/deepseek-ai/DeepSeek-V3.1": [5e-7, 15e-7, null, null, null, null], "baseten/deepseek-ai/DeepSeek-V3-0324": [77e-8, 77e-8, null, null, null, null], "gmi/Qwen/Qwen3-VL-235B-A22B-Instruct-FP8": [3e-7, 14e-7, null, null, null, null], "Qwen/Qwen3-VL-235B-A22B-Instruct-FP8": [3e-7, 14e-7, null, null, null, null], "gmi/zai-org/GLM-4.7-FP8": [4e-7, 2e-6, null, null, null, null], "zai-org/GLM-4.7-FP8": [4e-7, 2e-6, null, null, null, null], "gradient_ai/anthropic-claude-3-opus": [15e-6, 75e-6, null, null, null, null], "anthropic-claude-3-opus": [15e-6, 75e-6, null, null, null, null], "gradient_ai/anthropic-claude-3.5-haiku": [8e-7, 4e-6, null, null, null, null], "anthropic-claude-3.5-haiku": [8e-7, 4e-6, null, null, null, null], "gradient_ai/anthropic-claude-3.5-sonnet": [3e-6, 15e-6, null, null, null, null], "anthropic-claude-3.5-sonnet": [3e-6, 15e-6, null, null, null, null], "gradient_ai/anthropic-claude-3.7-sonnet": [3e-6, 15e-6, null, null, null, null], "anthropic-claude-3.7-sonnet": [3e-6, 15e-6, null, null, null, null], "gradient_ai/deepseek-r1-distill-llama-70b": [99e-8, 99e-8, null, null, null, null], "deepseek-r1-distill-llama-70b": [99e-8, 99e-8, null, null, null, null], "gradient_ai/llama3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "llama3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "gradient_ai/llama3.3-70b-instruct": [65e-8, 65e-8, null, null, null, null], "llama3.3-70b-instruct": [65e-8, 65e-8, null, null, null, null], "gradient_ai/mistral-nemo-instruct-2407": [3e-7, 3e-7, null, null, null, null], "mistral-nemo-instruct-2407": [3e-7, 3e-7, null, null, null, null], "gradient_ai/openai-o3": [2e-6, 8e-6, null, null, null, null], "openai-o3": [2e-6, 8e-6, null, null, null, null], "gradient_ai/openai-o3-mini": [11e-7, 44e-7, null, null, null, null], "openai-o3-mini": [11e-7, 44e-7, null, null, null, null], "lemonade/Qwen3-Coder-30B-A3B-Instruct-GGUF": [0, 0, null, null, null, null], "Qwen3-Coder-30B-A3B-Instruct-GGUF": [0, 0, null, null, null, null], "lemonade/gpt-oss-20b-mxfp4-GGUF": [0, 0, null, null, null, null], "gpt-oss-20b-mxfp4-GGUF": [0, 0, null, null, null, null], "lemonade/gpt-oss-120b-mxfp-GGUF": [0, 0, null, null, null, null], "gpt-oss-120b-mxfp-GGUF": [0, 0, null, null, null, null], "lemonade/Gemma-3-4b-it-GGUF": [0, 0, null, null, null, null], "Gemma-3-4b-it-GGUF": [0, 0, null, null, null, null], "lemonade/Qwen3-4B-Instruct-2507-GGUF": [0, 0, null, null, null, null], "Qwen3-4B-Instruct-2507-GGUF": [0, 0, null, null, null, null], "amazon-nova/nova-micro-v1": [35e-9, 14e-8, null, null, null, null], "nova-micro-v1": [35e-9, 14e-8, null, null, null, null], "amazon-nova/nova-lite-v1": [6e-8, 24e-8, null, null, null, null], "nova-lite-v1": [6e-8, 24e-8, null, null, null, null], "amazon-nova/nova-premier-v1": [25e-7, 125e-7, null, null, null, null], "nova-premier-v1": [25e-7, 125e-7, null, null, null, null], "amazon-nova/nova-pro-v1": [8e-7, 32e-7, null, null, null, null], "nova-pro-v1": [8e-7, 32e-7, null, null, null, null], "groq/llama-guard-3-8b": [2e-7, 2e-7, null, null, null, null], "llama-guard-3-8b": [2e-7, 2e-7, null, null, null, null], "groq/meta-llama/llama-prompt-guard-2-22m": [3e-8, 3e-8, null, null, null, null], "meta-llama/llama-prompt-guard-2-22m": [3e-8, 3e-8, null, null, null, null], "groq/meta-llama/llama-prompt-guard-2-86m": [4e-8, 4e-8, null, null, null, null], "meta-llama/llama-prompt-guard-2-86m": [4e-8, 4e-8, null, null, null, null], "groq/openai/gpt-oss-120b": [15e-8, 6e-7, null, 75e-9, null, null], "groq/openai/gpt-oss-20b": [75e-9, 3e-7, null, 375e-10, null, null], "groq/openai/gpt-oss-safeguard-20b": [75e-9, 3e-7, null, 37e-9, null, null], "openai/gpt-oss-safeguard-20b": [75e-9, 3e-7, null, 37e-9, null, null], "hyperbolic/NousResearch/Hermes-3-Llama-3.1-70B": [12e-8, 3e-7, null, null, null, null], "hyperbolic/Qwen/QwQ-32B": [2e-7, 2e-7, null, null, null, null], "hyperbolic/Qwen/Qwen2.5-72B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/Qwen/Qwen2.5-Coder-32B-Instruct": [12e-8, 3e-7, null, null, null, null], "Qwen/Qwen2.5-Coder-32B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/Qwen/Qwen3-235B-A22B": [2e-6, 2e-6, null, null, null, null], "hyperbolic/deepseek-ai/DeepSeek-R1": [4e-7, 4e-7, null, null, null, null], "hyperbolic/deepseek-ai/DeepSeek-R1-0528": [25e-8, 25e-8, null, null, null, null], "hyperbolic/deepseek-ai/DeepSeek-V3": [2e-7, 2e-7, null, null, null, null], "hyperbolic/deepseek-ai/DeepSeek-V3-0324": [4e-7, 4e-7, null, null, null, null], "hyperbolic/meta-llama/Llama-3.2-3B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/meta-llama/Llama-3.3-70B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/meta-llama/Meta-Llama-3-70B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/meta-llama/Meta-Llama-3.1-405B-Instruct": [12e-8, 3e-7, null, null, null, null], "meta-llama/Meta-Llama-3.1-405B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/meta-llama/Meta-Llama-3.1-70B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/meta-llama/Meta-Llama-3.1-8B-Instruct": [12e-8, 3e-7, null, null, null, null], "hyperbolic/moonshotai/Kimi-K2-Instruct": [2e-6, 2e-6, null, null, null, null], "crusoe/deepseek-ai/DeepSeek-R1-0528": [3e-6, 7e-6, null, null, null, null], "crusoe/deepseek-ai/DeepSeek-V3-0324": [15e-7, 15e-7, null, null, null, null], "crusoe/google/gemma-3-12b-it": [1e-7, 1e-7, null, null, null, null], "crusoe/meta-llama/Llama-3.3-70B-Instruct": [2e-7, 2e-7, null, null, null, null], "crusoe/moonshotai/Kimi-K2-Thinking": [25e-7, 25e-7, null, null, null, null], "crusoe/openai/gpt-oss-120b": [8e-7, 8e-7, null, null, null, null], "crusoe/Qwen/Qwen3-235B-A22B-Instruct-2507": [3e-6, 3e-6, null, null, null, null], "inception/mercury-2": [25e-8, 75e-8, null, 25e-9, null, null], "mercury-2": [25e-8, 75e-8, null, 25e-9, null, null], "inception/mercury-2.5": [2e-7, 75e-8, null, 2e-8, null, null], "mercury-2.5": [2e-7, 75e-8, null, 2e-8, null, null], "text-completion-inception/mercury-edit-2": [25e-8, 75e-8, null, 25e-9, null, null], "mercury-edit-2": [25e-8, 75e-8, null, 25e-9, null, null], "lambda_ai/deepseek-llama3.3-70b": [2e-7, 6e-7, null, null, null, null], "deepseek-llama3.3-70b": [2e-7, 6e-7, null, null, null, null], "lambda_ai/deepseek-r1-0528": [2e-7, 6e-7, null, null, null, null], "deepseek-r1-0528": [2e-7, 6e-7, null, null, null, null], "lambda_ai/deepseek-r1-671b": [8e-7, 8e-7, null, null, null, null], "deepseek-r1-671b": [8e-7, 8e-7, null, null, null, null], "lambda_ai/deepseek-v3-0324": [2e-7, 6e-7, null, null, null, null], "deepseek-v3-0324": [2e-7, 6e-7, null, null, null, null], "lambda_ai/hermes3-405b": [8e-7, 8e-7, null, null, null, null], "hermes3-405b": [8e-7, 8e-7, null, null, null, null], "lambda_ai/hermes3-70b": [12e-8, 3e-7, null, null, null, null], "hermes3-70b": [12e-8, 3e-7, null, null, null, null], "lambda_ai/hermes3-8b": [25e-9, 4e-8, null, null, null, null], "hermes3-8b": [25e-9, 4e-8, null, null, null, null], "lambda_ai/lfm-40b": [1e-7, 2e-7, null, null, null, null], "lfm-40b": [1e-7, 2e-7, null, null, null, null], "lambda_ai/lfm-7b": [25e-9, 4e-8, null, null, null, null], "lfm-7b": [25e-9, 4e-8, null, null, null, null], "lambda_ai/llama-4-maverick-17b-128e-instruct-fp8": [5e-8, 1e-7, null, null, null, null], "llama-4-maverick-17b-128e-instruct-fp8": [5e-8, 1e-7, null, null, null, null], "lambda_ai/llama-4-scout-17b-16e-instruct": [5e-8, 1e-7, null, null, null, null], "llama-4-scout-17b-16e-instruct": [5e-8, 1e-7, null, null, null, null], "lambda_ai/llama3.1-405b-instruct-fp8": [8e-7, 8e-7, null, null, null, null], "llama3.1-405b-instruct-fp8": [8e-7, 8e-7, null, null, null, null], "lambda_ai/llama3.1-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "llama3.1-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "lambda_ai/llama3.1-8b-instruct": [25e-9, 4e-8, null, null, null, null], "llama3.1-8b-instruct": [25e-9, 4e-8, null, null, null, null], "lambda_ai/llama3.1-nemotron-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "llama3.1-nemotron-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "lambda_ai/llama3.2-11b-vision-instruct": [15e-9, 25e-9, null, null, null, null], "llama3.2-11b-vision-instruct": [15e-9, 25e-9, null, null, null, null], "lambda_ai/llama3.2-3b-instruct": [15e-9, 25e-9, null, null, null, null], "llama3.2-3b-instruct": [15e-9, 25e-9, null, null, null, null], "lambda_ai/llama3.3-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "llama3.3-70b-instruct-fp8": [12e-8, 3e-7, null, null, null, null], "lambda_ai/qwen25-coder-32b-instruct": [5e-8, 1e-7, null, null, null, null], "qwen25-coder-32b-instruct": [5e-8, 1e-7, null, null, null, null], "lambda_ai/qwen3-32b-fp8": [5e-8, 1e-7, null, null, null, null], "qwen3-32b-fp8": [5e-8, 1e-7, null, null, null, null], "meta/muse-spark-1.1": [125e-8, 425e-8, null, 15e-8, null, null], "muse-spark-1.1": [125e-8, 425e-8, null, 15e-8, null, null], "meta/muse-spark-1.2": [125e-8, 425e-8, null, 15e-8, null, null], "muse-spark-1.2": [125e-8, 425e-8, null, 15e-8, null, null], "meta/muse-spark-1.2-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "muse-spark-1.2-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "meta/muse-spark-1.3": [125e-8, 425e-8, null, 15e-8, null, null], "muse-spark-1.3": [125e-8, 425e-8, null, 15e-8, null, null], "meta/muse-spark-1.3-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "muse-spark-1.3-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "minimax/MiniMax-M2.1": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "MiniMax-M2.1": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "minimax/MiniMax-M2.1-lightning": [3e-7, 24e-7, 375e-9, 3e-8, null, null], "MiniMax-M2.1-lightning": [3e-7, 24e-7, 375e-9, 3e-8, null, null], "minimax/MiniMax-M2.5": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "MiniMax-M2.5": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "minimax/MiniMax-M2.5-lightning": [3e-7, 24e-7, 375e-9, 3e-8, null, null], "MiniMax-M2.5-lightning": [3e-7, 24e-7, 375e-9, 3e-8, null, null], "minimax/MiniMax-M2": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "MiniMax-M2": [3e-7, 12e-7, 375e-9, 3e-8, null, null], "minimax/MiniMax-M3": [3e-7, 12e-7, null, 6e-8, null, { threshold: 512e3, input: 6e-7, output: 24e-7, cacheWrite: null, cacheRead: 12e-8 }], "MiniMax-M3": [3e-7, 12e-7, null, 6e-8, null, { threshold: 512e3, input: 6e-7, output: 24e-7, cacheWrite: null, cacheRead: 12e-8 }], "mistral/codestral-2508": [3e-7, 9e-7, null, 3e-8, null, null], "codestral-2508": [3e-7, 9e-7, null, 3e-8, null, null], "mistral/codestral-latest": [3e-7, 9e-7, null, 3e-8, null, null], "mistral/codestral-mamba-latest": [25e-8, 25e-8, null, 25e-9, null, null], "codestral-mamba-latest": [25e-8, 25e-8, null, 25e-9, null, null], "mistral/devstral-small-latest": [1e-7, 3e-7, null, 1e-8, null, null], "devstral-small-latest": [1e-7, 3e-7, null, 1e-8, null, null], "mistral/devstral-latest": [4e-7, 2e-6, null, 4e-8, null, null], "devstral-latest": [4e-7, 2e-6, null, 4e-8, null, null], "mistral/devstral-medium-latest": [4e-7, 2e-6, null, 4e-8, null, null], "devstral-medium-latest": [4e-7, 2e-6, null, 4e-8, null, null], "mistral/ministral-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "ministral-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "mistral/ministral-14b-latest": [2e-7, 2e-7, null, 2e-8, null, null], "ministral-14b-latest": [2e-7, 2e-7, null, 2e-8, null, null], "mistral/ministral-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "ministral-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "mistral/ministral-3b-latest": [1e-7, 1e-7, null, 1e-8, null, null], "ministral-3b-latest": [1e-7, 1e-7, null, 1e-8, null, null], "mistral/mistral-medium-3": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium-3": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/voxtral-small-2507": [1e-7, 4e-7, null, 1e-8, null, null], "voxtral-small-2507": [1e-7, 4e-7, null, 1e-8, null, null], "mistral/voxtral-small-latest": [1e-7, 4e-7, null, 1e-8, null, null], "voxtral-small-latest": [1e-7, 4e-7, null, 1e-8, null, null], "mistral/zai-glm-5-2": [14e-7, 44e-7, null, 14e-8, null, null], "zai-glm-5-2": [14e-7, 44e-7, null, 14e-8, null, null], "mistral/zai-glm-5-3": [14e-7, 44e-7, null, 14e-8, null, null], "zai-glm-5-3": [14e-7, 44e-7, null, 14e-8, null, null], "mistral/zai-glm-5": [14e-7, 44e-7, null, 14e-8, null, null], "zai-glm-5": [14e-7, 44e-7, null, 14e-8, null, null], "mistral/zai-glm-latest": [14e-7, 44e-7, null, 14e-8, null, null], "zai-glm-latest": [14e-7, 44e-7, null, 14e-8, null, null], "mistral/glm-5-2": [14e-7, 44e-7, null, 14e-8, null, null], "glm-5-2": [14e-7, 44e-7, null, 14e-8, null, null], "mistral/magistral-medium-latest": [15e-7, 75e-7, null, 15e-8, null, null], "magistral-medium-latest": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/magistral-small-latest": [15e-8, 6e-7, null, 15e-9, null, null], "magistral-small-latest": [15e-8, 6e-7, null, 15e-9, null, null], "mistral/mistral-large-latest": [5e-7, 15e-7, null, 5e-8, null, null], "mistral/mistral-large-3": [5e-7, 15e-7, null, 5e-8, null, null], "mistral/mistral-large-2512": [5e-7, 15e-7, null, 5e-8, null, null], "mistral-large-2512": [5e-7, 15e-7, null, 5e-8, null, null], "mistral/mistral-medium": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-medium-2604": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium-2604": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-medium-latest": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium-latest": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-medium-3-5": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium-3-5": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-small": [1e-7, 3e-7, null, 1e-8, null, null], "mistral/mistral-small-latest": [15e-8, 6e-7, null, 15e-9, null, null], "mistral-small-latest": [15e-8, 6e-7, null, 15e-9, null, null], "mistral/ministral-3-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "ministral-3-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "mistral/ministral-3-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "ministral-3-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "mistral/ministral-3-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "ministral-3-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "mistral/ministral-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "ministral-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "mistral/ministral-8b-latest": [15e-8, 15e-8, null, 15e-9, null, null], "ministral-8b-latest": [15e-8, 15e-8, null, 15e-9, null, null], "mistral/mistral-tiny": [25e-8, 25e-8, null, 25e-9, null, null], "mistral-tiny": [25e-8, 25e-8, null, 25e-9, null, null], "mistral/open-mistral-nemo": [3e-7, 3e-7, null, 3e-8, null, null], "open-mistral-nemo": [3e-7, 3e-7, null, 3e-8, null, null], "mistral/pixtral-large-latest": [2e-6, 6e-6, null, 2e-7, null, null], "pixtral-large-latest": [2e-6, 6e-6, null, 2e-7, null, null], "moonshot/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "moonshot/kimi-k2.5": [6e-7, 3e-6, null, 1e-7, null, null], "moonshot/kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "moonshot/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "moonshot/moonshot-v1-128k": [2e-6, 5e-6, null, null, null, null], "moonshot-v1-128k": [2e-6, 5e-6, null, null, null, null], "moonshot/moonshot-v1-128k-vision-preview": [2e-6, 5e-6, null, null, null, null], "moonshot-v1-128k-vision-preview": [2e-6, 5e-6, null, null, null, null], "moonshot/moonshot-v1-32k": [1e-6, 3e-6, null, null, null, null], "moonshot-v1-32k": [1e-6, 3e-6, null, null, null, null], "moonshot/moonshot-v1-32k-vision-preview": [1e-6, 3e-6, null, null, null, null], "moonshot-v1-32k-vision-preview": [1e-6, 3e-6, null, null, null, null], "moonshot/moonshot-v1-8k": [2e-7, 2e-6, null, null, null, null], "moonshot-v1-8k": [2e-7, 2e-6, null, null, null, null], "moonshot/moonshot-v1-8k-vision-preview": [2e-7, 2e-6, null, null, null, null], "moonshot-v1-8k-vision-preview": [2e-7, 2e-6, null, null, null, null], "moonshot/moonshot-v1-auto": [2e-6, 5e-6, null, null, null, null], "moonshot-v1-auto": [2e-6, 5e-6, null, null, null, null], "morph/morph-v3-fast": [8e-7, 12e-7, null, null, null, null], "morph-v3-fast": [8e-7, 12e-7, null, null, null, null], "morph/morph-v3-large": [9e-7, 19e-7, null, null, null, null], "morph-v3-large": [9e-7, 19e-7, null, null, null, null], "nscale/Qwen/QwQ-32B": [18e-8, 2e-7, null, null, null, null], "nscale/Qwen/Qwen2.5-Coder-32B-Instruct": [6e-8, 2e-7, null, null, null, null], "nscale/Qwen/Qwen2.5-Coder-3B-Instruct": [1e-8, 3e-8, null, null, null, null], "Qwen/Qwen2.5-Coder-3B-Instruct": [1e-8, 3e-8, null, null, null, null], "nscale/Qwen/Qwen2.5-Coder-7B-Instruct": [1e-8, 3e-8, null, null, null, null], "Qwen/Qwen2.5-Coder-7B-Instruct": [1e-8, 3e-8, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Llama-70B": [375e-9, 375e-9, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Llama-8B": [25e-9, 25e-9, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Llama-8B": [25e-9, 25e-9, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": [9e-8, 9e-8, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": [9e-8, 9e-8, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": [7e-8, 7e-8, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": [7e-8, 7e-8, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B": [15e-8, 15e-8, null, null, null, null], "nscale/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B": [2e-7, 2e-7, null, null, null, null], "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B": [2e-7, 2e-7, null, null, null, null], "nscale/meta-llama/Llama-3.1-8B-Instruct": [3e-8, 3e-8, null, null, null, null], "meta-llama/Llama-3.1-8B-Instruct": [3e-8, 3e-8, null, null, null, null], "nscale/meta-llama/Llama-3.3-70B-Instruct": [2e-7, 2e-7, null, null, null, null], "nscale/meta-llama/Llama-4-Scout-17B-16E-Instruct": [9e-8, 29e-8, null, null, null, null], "nscale/mistralai/mixtral-8x22b-instruct-v0.1": [6e-7, 6e-7, null, null, null, null], "mistralai/mixtral-8x22b-instruct-v0.1": [6e-7, 6e-7, null, null, null, null], "nebius/deepseek-ai/DeepSeek-R1": [8e-7, 24e-7, null, null, null, null], "nebius/deepseek-ai/DeepSeek-R1-0528": [8e-7, 24e-7, null, null, null, null], "nebius/deepseek-ai/DeepSeek-R1-Distill-Llama-70B": [25e-8, 75e-8, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V3": [5e-7, 15e-7, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V3-0324": [5e-7, 15e-7, null, null, null, null], "nebius/google/gemma-3-27b-it": [1e-7, 3e-7, null, null, null, null], "nebius/meta-llama/Llama-3.3-70B-Instruct": [13e-8, 4e-7, null, null, null, null], "nebius/meta-llama/Llama-Guard-3-8B": [2e-8, 6e-8, null, null, null, null], "nebius/meta-llama/Meta-Llama-3.1-8B-Instruct": [2e-8, 6e-8, null, null, null, null], "nebius/meta-llama/Meta-Llama-3.1-70B-Instruct": [13e-8, 4e-7, null, null, null, null], "nebius/meta-llama/Meta-Llama-3.1-405B-Instruct": [1e-6, 3e-6, null, null, null, null], "nebius/mistralai/Mistral-Nemo-Instruct-2407": [4e-8, 12e-8, null, null, null, null], "nebius/NousResearch/Hermes-3-Llama-3.1-405B": [1e-6, 3e-6, null, null, null, null], "nebius/nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": [6e-7, 18e-7, null, null, null, null], "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": [6e-7, 18e-7, null, null, null, null], "nebius/nvidia/Llama-3.3-Nemotron-Super-49B-v1": [1e-7, 4e-7, null, null, null, null], "nvidia/Llama-3.3-Nemotron-Super-49B-v1": [1e-7, 4e-7, null, null, null, null], "nebius/Qwen/Qwen3-235B-A22B": [2e-7, 6e-7, null, null, null, null], "nebius/Qwen/Qwen3-32B": [1e-7, 3e-7, null, null, null, null], "nebius/Qwen/Qwen3-30B-A3B": [1e-7, 3e-7, null, null, null, null], "nebius/Qwen/Qwen3-14B": [8e-8, 24e-8, null, null, null, null], "nebius/Qwen/Qwen3-4B": [8e-8, 24e-8, null, null, null, null], "Qwen/Qwen3-4B": [8e-8, 24e-8, null, null, null, null], "nebius/Qwen/QwQ-32B": [15e-8, 45e-8, null, null, null, null], "nebius/Qwen/Qwen2.5-72B-Instruct": [13e-8, 4e-7, null, null, null, null], "nebius/Qwen/Qwen2.5-32B-Instruct": [6e-8, 2e-7, null, null, null, null], "Qwen/Qwen2.5-32B-Instruct": [6e-8, 2e-7, null, null, null, null], "nebius/Qwen/Qwen2.5-Coder-7B": [1e-8, 3e-8, null, null, null, null], "Qwen/Qwen2.5-Coder-7B": [1e-8, 3e-8, null, null, null, null], "nebius/Qwen/Qwen2.5-VL-72B-Instruct": [25e-8, 75e-8, null, null, null, null], "Qwen/Qwen2.5-VL-72B-Instruct": [25e-8, 75e-8, null, null, null, null], "nebius/Qwen/Qwen2-VL-72B-Instruct": [13e-8, 4e-7, null, null, null, null], "Qwen/Qwen2-VL-72B-Instruct": [13e-8, 4e-7, null, null, null, null], "nebius/Qwen/Qwen2-VL-7B-Instruct": [2e-8, 6e-8, null, null, null, null], "Qwen/Qwen2-VL-7B-Instruct": [2e-8, 6e-8, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V4-Flash": [14e-8, 28e-8, null, null, null, null], "deepseek-ai/DeepSeek-V4-Flash": [14e-8, 28e-8, null, 0, null, null], "nebius/deepseek-ai/DeepSeek-V4-Flash-0731": [14e-8, 28e-8, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V4-Pro": [175e-8, 35e-7, null, null, null, null], "deepseek-ai/DeepSeek-V4-Pro": [175e-8, 35e-7, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V4-Pro-0813": [132e-8, 396e-8, null, null, null, null], "nebius/deepseek-ai/DeepSeek-V4.1-Flash": [3e-7, 12e-7, null, null, null, null], "nebius/MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, null, null, null], "nebius/MiniMaxAI/MiniMax-M3": [3e-7, 12e-7, null, null, null, null], "MiniMaxAI/MiniMax-M3": [3e-7, 12e-7, null, 6e-8, null, null], "nebius/moonshotai/Kimi-K2.6": [95e-8, 4e-6, null, null, null, null], "nebius/moonshotai/Kimi-K2.7-Code": [95e-8, 4e-6, null, null, null, null], "moonshotai/Kimi-K2.7-Code": [95e-8, 4e-6, null, 19e-8, null, null], "nebius/moonshotai/Kimi-K3": [3e-6, 15e-6, null, null, null, null], "nebius/NousResearch/Hermes-4-405B": [1e-6, 3e-6, null, null, null, null], "NousResearch/Hermes-4-405B": [1e-6, 3e-6, null, null, null, null], "nebius/NousResearch/Hermes-4-70B": [13e-8, 4e-7, null, null, null, null], "NousResearch/Hermes-4-70B": [13e-8, 4e-7, null, null, null, null], "nebius/nvidia/Cosmos3-Super-Reasoner": [1e-7, 3e-7, null, null, null, null], "nvidia/Cosmos3-Super-Reasoner": [1e-7, 3e-7, null, null, null, null], "nebius/nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": [6e-7, 18e-7, null, null, null, null], "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": [6e-7, 18e-7, null, null, null, null], "nebius/nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B": [6e-8, 24e-8, null, null, null, null], "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B": [6e-8, 24e-8, null, null, null, null], "nebius/nvidia/Nemotron-3-Nano-Omni": [6e-8, 24e-8, null, null, null, null], "nvidia/Nemotron-3-Nano-Omni": [6e-8, 24e-8, null, null, null, null], "nebius/nvidia/nemotron-3-super-120b-a12b": [3e-7, 9e-7, null, null, null, null], "nvidia/nemotron-3-super-120b-a12b": [3e-7, 9e-7, null, null, null, null], "nebius/nvidia/Nemotron-3-Ultra-550b-a55b": [1e-6, 3e-6, null, null, null, null], "nvidia/Nemotron-3-Ultra-550b-a55b": [1e-6, 3e-6, null, null, null, null], "nebius/nvidia/Nemotron-3_5-Lightning": [6e-8, 24e-8, null, null, null, null], "nvidia/Nemotron-3_5-Lightning": [6e-8, 24e-8, null, null, null, null], "nebius/openai/gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "nebius/openbmb/MiniCPM-V-4_5": [658e-9, 111e-8, null, null, null, null], "openbmb/MiniCPM-V-4_5": [658e-9, 111e-8, null, null, null, null], "nebius/Qwen/Qwen3-235B-A22B-Instruct-2507": [2e-7, 6e-7, null, null, null, null], "nebius/Qwen/Qwen3-30B-A3B-Instruct-2507": [1e-7, 3e-7, null, null, null, null], "Qwen/Qwen3-30B-A3B-Instruct-2507": [1e-7, 3e-7, null, null, null, null], "nebius/Qwen/Qwen3-Next-80B-A3B-Thinking": [15e-8, 12e-7, null, null, null, null], "nebius/Qwen/Qwen3.5-397B-A17B": [6e-7, 36e-7, null, null, null, null], "Qwen/Qwen3.5-397B-A17B": [6e-7, 36e-7, null, 35e-8, null, null], "nebius/zai-org/GLM-5.1": [14e-7, 44e-7, null, null, null, null], "nebius/zai-org/GLM-5.2": [14e-7, 44e-7, null, null, null, null], "nebius/zai-org/GLM-5.3": [14e-7, 44e-7, null, null, null, null], "nebius/zai-org/GLM-5.3-Flash": [15e-8, 5e-7, null, null, null, null], "nebius/BAAI/bge-en-icl": [1e-8, 0, null, null, null, null], "BAAI/bge-en-icl": [1e-8, 0, null, null, null, null], "nebius/BAAI/bge-multilingual-gemma2": [1e-8, 0, null, null, null, null], "BAAI/bge-multilingual-gemma2": [1e-8, 0, null, null, null, null], "nebius/intfloat/e5-mistral-7b-instruct": [1e-8, 0, null, null, null, null], "intfloat/e5-mistral-7b-instruct": [1e-8, 0, null, null, null, null], "nebius/Qwen/Qwen3-Embedding-8B": [1e-8, 0, null, null, null, null], "Qwen/Qwen3-Embedding-8B": [1e-8, 0, null, null, null, null], "oci/meta.llama-3.1-8b-instruct": [72e-8, 72e-8, null, null, null, null], "meta.llama-3.1-8b-instruct": [72e-8, 72e-8, null, null, null, null], "oci/meta.llama-3.1-70b-instruct": [72e-8, 72e-8, null, null, null, null], "meta.llama-3.1-70b-instruct": [72e-8, 72e-8, null, null, null, null], "oci/meta.llama-3.1-405b-instruct": [1068e-8, 1068e-8, null, null, null, null], "meta.llama-3.1-405b-instruct": [1068e-8, 1068e-8, null, null, null, null], "oci/meta.llama-3.2-90b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "meta.llama-3.2-90b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "oci/meta.llama-3.3-70b-instruct": [72e-8, 72e-8, null, null, null, null], "meta.llama-3.3-70b-instruct": [72e-8, 72e-8, null, null, null, null], "oci/meta.llama-4-maverick-17b-128e-instruct-fp8": [72e-8, 72e-8, null, null, null, null], "meta.llama-4-maverick-17b-128e-instruct-fp8": [72e-8, 72e-8, null, null, null, null], "oci/meta.llama-4-scout-17b-16e-instruct": [72e-8, 72e-8, null, null, null, null], "meta.llama-4-scout-17b-16e-instruct": [72e-8, 72e-8, null, null, null, null], "oci/xai.grok-3": [3e-6, 15e-6, null, null, null, null], "xai.grok-3": [3e-6, 15e-6, null, null, null, null], "oci/xai.grok-3-fast": [5e-6, 25e-6, null, null, null, null], "xai.grok-3-fast": [5e-6, 25e-6, null, null, null, null], "oci/xai.grok-3-mini": [3e-7, 5e-7, null, null, null, null], "xai.grok-3-mini": [3e-7, 5e-7, null, null, null, null], "oci/xai.grok-3-mini-fast": [6e-7, 4e-6, null, null, null, null], "xai.grok-3-mini-fast": [6e-7, 4e-6, null, null, null, null], "oci/xai.grok-4": [3e-6, 15e-6, null, null, null, null], "xai.grok-4": [3e-6, 15e-6, null, null, null, null], "oci/cohere.command-latest": [156e-8, 156e-8, null, null, null, null], "cohere.command-latest": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-a-03-2025": [156e-8, 156e-8, null, null, null, null], "cohere.command-a-03-2025": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-plus-latest": [156e-8, 156e-8, null, null, null, null], "cohere.command-plus-latest": [156e-8, 156e-8, null, null, null, null], "oci/google.gemini-2.5-flash": [15e-8, 6e-7, null, null, null, null], "google.gemini-2.5-flash": [15e-8, 6e-7, null, null, null, null], "oci/google.gemini-2.5-pro": [125e-8, 1e-5, null, null, null, null], "google.gemini-2.5-pro": [125e-8, 1e-5, null, null, null, null], "oci/google.gemini-2.5-flash-lite": [75e-9, 3e-7, null, null, null, null], "google.gemini-2.5-flash-lite": [75e-9, 3e-7, null, null, null, null], "oci/cohere.command-a-vision": [156e-8, 156e-8, null, null, null, null], "cohere.command-a-vision": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-a-reasoning": [156e-8, 156e-8, null, null, null, null], "cohere.command-a-reasoning": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-a-reasoning-08-2025": [156e-8, 156e-8, null, null, null, null], "cohere.command-a-reasoning-08-2025": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-a-vision-07-2025": [156e-8, 156e-8, null, null, null, null], "cohere.command-a-vision-07-2025": [156e-8, 156e-8, null, null, null, null], "oci/cohere.command-a-translate-08-2025": [9e-8, 9e-8, null, null, null, null], "cohere.command-a-translate-08-2025": [9e-8, 9e-8, null, null, null, null], "oci/cohere.command-r-08-2024": [15e-8, 15e-8, null, null, null, null], "cohere.command-r-08-2024": [15e-8, 15e-8, null, null, null, null], "oci/cohere.command-r-plus-08-2024": [156e-8, 156e-8, null, null, null, null], "cohere.command-r-plus-08-2024": [156e-8, 156e-8, null, null, null, null], "oci/meta.llama-3.2-11b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "meta.llama-3.2-11b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "oci/meta.llama-3.3-70b-instruct-fp8-dynamic": [72e-8, 72e-8, null, null, null, null], "meta.llama-3.3-70b-instruct-fp8-dynamic": [72e-8, 72e-8, null, null, null, null], "oci/xai.grok-4-fast": [5e-6, 25e-6, null, null, null, null], "xai.grok-4-fast": [5e-6, 25e-6, null, null, null, null], "oci/xai.grok-4.1-fast": [5e-6, 25e-6, null, null, null, null], "xai.grok-4.1-fast": [5e-6, 25e-6, null, null, null, null], "oci/xai.grok-4.20": [3e-6, 15e-6, null, null, null, null], "xai.grok-4.20": [3e-6, 15e-6, null, null, null, null], "oci/xai.grok-4.20-multi-agent": [3e-6, 15e-6, null, null, null, null], "xai.grok-4.20-multi-agent": [3e-6, 15e-6, null, null, null, null], "oci/xai.grok-code-fast-1": [5e-6, 25e-6, null, null, null, null], "xai.grok-code-fast-1": [5e-6, 25e-6, null, null, null, null], "oci/openai.gpt-5": [125e-8, 1e-5, null, null, null, null], "openai.gpt-5": [125e-8, 1e-5, null, null, null, null], "oci/openai.gpt-5-mini": [25e-8, 2e-6, null, null, null, null], "openai.gpt-5-mini": [25e-8, 2e-6, null, null, null, null], "oci/openai.gpt-5-nano": [5e-8, 4e-7, null, null, null, null], "openai.gpt-5-nano": [5e-8, 4e-7, null, null, null, null], "oci/cohere.embed-english-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-english-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-english-light-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-english-light-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-multilingual-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-multilingual-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-multilingual-light-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-multilingual-light-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-english-image-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-english-image-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-english-light-image-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-english-light-image-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-multilingual-light-image-v3.0": [1e-7, 0, null, null, null, null], "cohere.embed-multilingual-light-image-v3.0": [1e-7, 0, null, null, null, null], "oci/cohere.embed-v4.0": [12e-8, 0, null, null, null, null], "cohere.embed-v4.0": [12e-8, 0, null, null, null, null], "ollama/codegeex4": [0, 0, null, null, null, null], codegeex4: [0, 0, null, null, null, null], "ollama/codegemma": [0, 0, null, null, null, null], codegemma: [0, 0, null, null, null, null], "ollama/codellama": [0, 0, null, null, null, null], codellama: [0, 0, null, null, null, null], "ollama/deepseek-coder-v2-base": [0, 0, null, null, null, null], "deepseek-coder-v2-base": [0, 0, null, null, null, null], "ollama/deepseek-coder-v2-instruct": [0, 0, null, null, null, null], "deepseek-coder-v2-instruct": [0, 0, null, null, null, null], "ollama/deepseek-coder-v2-lite-base": [0, 0, null, null, null, null], "deepseek-coder-v2-lite-base": [0, 0, null, null, null, null], "ollama/deepseek-coder-v2-lite-instruct": [0, 0, null, null, null, null], "deepseek-coder-v2-lite-instruct": [0, 0, null, null, null, null], "ollama/deepseek-v3.1:671b-cloud": [0, 0, null, null, null, null], "deepseek-v3.1:671b-cloud": [0, 0, null, null, null, null], "ollama/gpt-oss:120b-cloud": [0, 0, null, null, null, null], "gpt-oss:120b-cloud": [0, 0, null, null, null, null], "ollama/gpt-oss:20b-cloud": [0, 0, null, null, null, null], "gpt-oss:20b-cloud": [0, 0, null, null, null, null], "ollama/internlm2_5-20b-chat": [0, 0, null, null, null, null], "internlm2_5-20b-chat": [0, 0, null, null, null, null], "ollama/llama2": [0, 0, null, null, null, null], llama2: [0, 0, null, null, null, null], "ollama/llama2-uncensored": [0, 0, null, null, null, null], "llama2-uncensored": [0, 0, null, null, null, null], "ollama/llama2:13b": [0, 0, null, null, null, null], "llama2:13b": [0, 0, null, null, null, null], "ollama/llama2:70b": [0, 0, null, null, null, null], "llama2:70b": [0, 0, null, null, null, null], "ollama/llama2:7b": [0, 0, null, null, null, null], "llama2:7b": [0, 0, null, null, null, null], "ollama/llama3": [0, 0, null, null, null, null], llama3: [0, 0, null, null, null, null], "ollama/llama3.1": [0, 0, null, null, null, null], "llama3.1": [0, 0, null, null, null, null], "ollama/llama3:70b": [0, 0, null, null, null, null], "llama3:70b": [0, 0, null, null, null, null], "ollama/llama3:8b": [0, 0, null, null, null, null], "llama3:8b": [0, 0, null, null, null, null], "ollama/mistral": [0, 0, null, null, null, null], mistral: [0, 0, null, null, null, null], "ollama/mistral-7B-Instruct-v0.1": [0, 0, null, null, null, null], "mistral-7B-Instruct-v0.1": [0, 0, null, null, null, null], "ollama/mistral-7B-Instruct-v0.2": [0, 0, null, null, null, null], "mistral-7B-Instruct-v0.2": [0, 0, null, null, null, null], "ollama/mistral-large-instruct-2407": [0, 0, null, null, null, null], "mistral-large-instruct-2407": [0, 0, null, null, null, null], "ollama/mixtral-8x22B-Instruct-v0.1": [0, 0, null, null, null, null], "mixtral-8x22B-Instruct-v0.1": [0, 0, null, null, null, null], "ollama/mixtral-8x7B-Instruct-v0.1": [0, 0, null, null, null, null], "mixtral-8x7B-Instruct-v0.1": [0, 0, null, null, null, null], "ollama/orca-mini": [0, 0, null, null, null, null], "orca-mini": [0, 0, null, null, null, null], "ollama/qwen3-coder:480b-cloud": [0, 0, null, null, null, null], "qwen3-coder:480b-cloud": [0, 0, null, null, null, null], "ollama/vicuna": [0, 0, null, null, null, null], vicuna: [0, 0, null, null, null, null], "openrouter/anthropic/claude-3-haiku": [25e-8, 125e-8, 3e-7, 3e-8, null, null], "anthropic/claude-3-haiku": [25e-8, 125e-8, 3e-7, 3e-8, null, null], "openrouter/anthropic/claude-3.5-sonnet": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-3.5-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "openrouter/anthropic/claude-3.7-sonnet": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-3.7-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "openrouter/anthropic/claude-opus-4.1": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "anthropic/claude-opus-4.1": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "openrouter/anthropic/claude-sonnet-4": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "openrouter/anthropic/claude-sonnet-4.6": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "anthropic/claude-sonnet-4.6": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "openrouter/anthropic/claude-opus-4.5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-opus-4.6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic/claude-opus-4.6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-sonnet-4.5": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "openrouter/anthropic/claude-haiku-4.5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "anthropic/claude-haiku-4.5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "openrouter/anthropic/claude-opus-4.7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic/claude-opus-4.7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic/claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-opus-5.5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "anthropic/claude-opus-5.5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "openrouter/bytedance/ui-tars-1.5-7b": [1e-7, 2e-7, null, 1e-7, null, null], "bytedance/ui-tars-1.5-7b": [1e-7, 2e-7, null, 1e-7, null, null], "openrouter/deepseek/deepseek-chat": [2574e-10, 10287e-10, null, null, null, null], "openrouter/deepseek/deepseek-chat-v3-0324": [29e-8, 114e-8, null, 11e-8, null, null], "deepseek/deepseek-chat-v3-0324": [29e-8, 114e-8, null, 11e-8, null, null], "openrouter/deepseek/deepseek-chat-v3.1": [25e-8, 95e-8, null, 13e-8, null, null], "deepseek/deepseek-chat-v3.1": [25e-8, 95e-8, null, 13e-8, null, null], "openrouter/deepseek/deepseek-v3.2": [28e-8, 42e-8, null, 28e-9, null, null], "openrouter/deepseek/deepseek-v3.2-exp": [27e-8, 41e-8, null, 2e-8, null, null], "deepseek/deepseek-v3.2-exp": [27e-8, 41e-8, null, 2e-8, null, null], "openrouter/deepseek/deepseek-r1": [7e-7, 25e-7, null, 14e-8, null, null], "openrouter/deepseek/deepseek-r1-0528": [5e-7, 215e-8, null, 35e-8, null, null], "deepseek/deepseek-r1-0528": [5e-7, 215e-8, null, 35e-8, null, null], "openrouter/deepseek/deepseek-v4-pro": [9483e-10, 18966e-10, null, 79025e-12, null, null], "openrouter/deepseek/deepseek-v4.1-flash": [3483e-11, 6e-7, null, 3135e-11, null, null], "deepseek/deepseek-v4.1-flash": [3483e-11, 6e-7, null, 3135e-11, null, null], "openrouter/deepseek/deepseek-v4-pro-0813": [24298e-11, 35e-7, null, 172e-9, null, null], "deepseek/deepseek-v4-pro-0813": [24298e-11, 35e-7, null, 172e-9, null, null], "openrouter/fireworks/ember-1": [3e-6, 15e-6, null, 3e-7, null, null], "fireworks/ember-1": [3e-6, 15e-6, null, 3e-7, null, null], "openrouter/google/gemini-2.5-flash": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "openrouter/google/gemini-2.5-pro": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "openrouter/google/gemini-3-pro-preview": [2e-6, 12e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "google/gemini-3-pro-preview": [2e-6, 12e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "openrouter/google/gemini-3-flash-preview": [5e-7, 3e-6, 833333333333333e-22, 5e-8, null, null], "openrouter/google/gemini-3.1-flash-lite-preview": [25e-8, 15e-7, 833333333333333e-22, 25e-9, null, null], "google/gemini-3.1-flash-lite-preview": [25e-8, 15e-7, 833333333333333e-22, 25e-9, null, null], "openrouter/google/gemini-3.1-flash-lite": [25e-8, 15e-7, 833333333333333e-22, 25e-9, null, null], "google/gemini-3.1-flash-lite": [25e-8, 15e-7, 833333333333333e-22, 25e-9, null, null], "openrouter/google/gemini-3.1-pro-preview": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "google/gemini-3.1-pro-preview": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: 25e-8, cacheRead: 4e-7 }], "openrouter/gryphe/mythomax-l2-13b": [8e-8, 11e-8, null, null, null, null], "gryphe/mythomax-l2-13b": [8e-8, 11e-8, null, null, null, null], "openrouter/mancer/weaver": [4e-7, 75e-8, null, null, null, null], "mancer/weaver": [4e-7, 75e-8, null, null, null, null], "openrouter/meta-llama/llama-3-70b-instruct": [59e-8, 79e-8, null, null, null, null], "meta-llama/llama-3-70b-instruct": [59e-8, 79e-8, null, null, null, null], "openrouter/minimax/minimax-m2": [255e-9, 102e-8, null, null, null, null], "minimax/minimax-m2": [255e-9, 102e-8, null, null, null, null], "openrouter/mistralai/devstral-2512": [4e-7, 2e-6, null, 4e-8, null, null], "mistralai/devstral-2512": [4e-7, 2e-6, null, 4e-8, null, null], "openrouter/mistralai/ministral-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "mistralai/ministral-3b-2512": [1e-7, 1e-7, null, 1e-8, null, null], "openrouter/mistralai/ministral-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "mistralai/ministral-8b-2512": [15e-8, 15e-8, null, 15e-9, null, null], "openrouter/mistralai/ministral-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "mistralai/ministral-14b-2512": [2e-7, 2e-7, null, 2e-8, null, null], "openrouter/mistralai/mistral-7b-instruct": [13e-8, 13e-8, null, null, null, null], "mistralai/mistral-7b-instruct": [13e-8, 13e-8, null, null, null, null], "openrouter/mistralai/mistral-large": [2e-6, 6e-6, null, 2e-7, null, null], "mistralai/mistral-large": [2e-6, 6e-6, null, 2e-7, null, null], "openrouter/mistralai/mistral-small-3.1-24b-instruct": [351e-9, 555e-9, null, null, null, null], "mistralai/mistral-small-3.1-24b-instruct": [351e-9, 555e-9, null, null, null, null], "openrouter/mistralai/mistral-small-3.2-24b-instruct": [9375e-11, 25e-8, null, null, null, null], "mistralai/mistral-small-3.2-24b-instruct": [9375e-11, 25e-8, null, null, null, null], "openrouter/mistralai/mixtral-8x22b-instruct": [2e-6, 6e-6, null, 2e-7, null, null], "mistralai/mixtral-8x22b-instruct": [2e-6, 6e-6, null, 2e-7, null, null], "openrouter/moonshotai/kimi-k2.5": [45e-8, 225e-8, null, 7e-8, null, null], "moonshotai/kimi-k2.5": [45e-8, 225e-8, null, 7e-8, null, null], "openrouter/nvidia/nemotron-3.5-lightning": [8e-8, 2e-7, null, 4e-8, null, null], "nvidia/nemotron-3.5-lightning": [8e-8, 2e-7, null, 4e-8, null, null], "openrouter/openai/gpt-3.5-turbo": [5e-7, 15e-7, null, null, null, null], "openai/gpt-3.5-turbo": [5e-7, 15e-7, null, null, null, null], "openrouter/openai/gpt-3.5-turbo-16k": [3e-6, 4e-6, null, null, null, null], "openai/gpt-3.5-turbo-16k": [3e-6, 4e-6, null, null, null, null], "openrouter/openai/gpt-4": [3e-5, 6e-5, null, null, null, null], "openai/gpt-4": [3e-5, 6e-5, null, null, null, null], "openrouter/openai/gpt-4.1": [2e-6, 8e-6, null, 5e-7, null, null], "openai/gpt-4.1": [2e-6, 8e-6, 0, 5e-7, null, null], "openrouter/openai/gpt-4.1-mini": [4e-7, 16e-7, null, 1e-7, null, null], "openai/gpt-4.1-mini": [4e-7, 16e-7, 0, 1e-7, null, null], "openrouter/openai/gpt-4.1-nano": [1e-7, 4e-7, null, 25e-9, null, null], "openai/gpt-4.1-nano": [1e-7, 4e-7, 0, 25e-9, null, null], "openrouter/openai/gpt-4o": [25e-7, 1e-5, null, 125e-8, null, null], "openrouter/openai/gpt-4o-2024-05-13": [5e-6, 15e-6, null, null, null, null], "openai/gpt-4o-2024-05-13": [5e-6, 15e-6, null, null, null, null], "openrouter/openai/gpt-5-chat": [125e-8, 1e-5, null, 125e-9, null, null], "openai/gpt-5-chat": [125e-8, 1e-5, null, 125e-9, null, null], "openrouter/openai/gpt-5-codex": [125e-8, 1e-5, null, 125e-9, null, null], "openai/gpt-5-codex": [125e-8, 1e-5, null, 125e-9, null, null], "openrouter/openai/gpt-5.2-codex": [175e-8, 14e-6, null, 175e-9, null, null], "openai/gpt-5.2-codex": [175e-8, 14e-6, null, 175e-9, null, null], "openrouter/openai/gpt-5": [125e-8, 1e-5, null, 125e-9, null, null], "openrouter/openai/gpt-5-mini": [25e-8, 2e-6, null, 25e-9, null, null], "openai/gpt-5-mini": [25e-8, 2e-6, null, 25e-9, null, null], "openrouter/openai/gpt-5-nano": [5e-8, 4e-7, null, 5e-9, null, null], "openai/gpt-5-nano": [5e-8, 4e-7, null, 5e-9, null, null], "openrouter/openai/gpt-5.1-codex-max": [125e-8, 1e-5, null, 125e-9, null, null], "openai/gpt-5.1-codex-max": [125e-8, 1e-5, null, 125e-9, null, null], "openrouter/openai/gpt-5.2": [175e-8, 14e-6, null, 175e-9, null, null], "openrouter/openai/gpt-5.2-chat": [175e-8, 14e-6, null, 175e-9, null, null], "openai/gpt-5.2-chat": [175e-8, 14e-6, null, 175e-9, null, null], "openrouter/openai/gpt-5.2-pro": [21e-6, 168e-6, null, null, null, null], "openai/gpt-5.2-pro": [21e-6, 168e-6, null, null, null, null], "openrouter/openai/gpt-5.6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai/gpt-5.6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/gpt-5.6-sol-pro": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai/gpt-5.6-sol-pro": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/gpt-oss-120b": [15e-8, 6e-7, null, 75e-9, null, null], "openrouter/openai/gpt-oss-120b:batch": [296e-10, 136e-9, null, null, null, null], "openai/gpt-oss-120b:batch": [296e-10, 136e-9, null, null, null, null], "openrouter/openai/gpt-oss-20b": [18e-9, 9e-8, null, null, null, null], "openrouter/openai/o1": [15e-6, 6e-5, null, 75e-7, null, null], "openai/o1": [15e-6, 6e-5, 0, 75e-7, null, null], "openrouter/openai/o3-mini": [11e-7, 44e-7, null, 55e-8, null, null], "openai/o3-mini": [11e-7, 44e-7, 0, 55e-8, null, null], "openrouter/openai/o3-mini-high": [11e-7, 44e-7, null, 55e-8, null, null], "openai/o3-mini-high": [11e-7, 44e-7, null, 55e-8, null, null], "openrouter/qwen/qwen-2.5-coder-32b-instruct": [66e-8, 1e-6, null, null, null, null], "qwen/qwen-2.5-coder-32b-instruct": [66e-8, 1e-6, null, null, null, null], "openrouter/qwen/qwen-vl-plus": [21e-8, 63e-8, null, null, null, null], "qwen/qwen-vl-plus": [21e-8, 63e-8, null, null, null, null], "openrouter/qwen/qwen3-coder": [3e-7, 1e-6, null, 1e-7, null, null], "qwen/qwen3-coder": [3e-7, 1e-6, null, 1e-7, null, null], "openrouter/qwen/qwen3-coder-plus": [65e-8, 325e-8, 8125e-10, 13e-8, null, { threshold: 128e3, input: 195e-8, output: 975e-8, cacheWrite: 24375e-10, cacheRead: 39e-8 }], "qwen/qwen3-coder-plus": [65e-8, 325e-8, 8125e-10, 13e-8, null, { threshold: 128e3, input: 195e-8, output: 975e-8, cacheWrite: 24375e-10, cacheRead: 39e-8 }], "openrouter/qwen/qwen3-235b-a22b-2507": [875e-10, 35e-8, null, 175e-10, null, null], "qwen/qwen3-235b-a22b-2507": [875e-10, 35e-8, null, 175e-10, null, null], "openrouter/qwen/qwen3-235b-a22b-thinking-2507": [23e-8, 23e-7, null, null, null, null], "qwen/qwen3-235b-a22b-thinking-2507": [23e-8, 23e-7, null, null, null, null], "openrouter/qwen/qwen3.6-plus": [325e-9, 195e-8, 40625e-11, null, null, { threshold: 256e3, input: 13e-7, output: 39e-7, cacheWrite: 1625e-9, cacheRead: null }], "qwen/qwen3.6-plus": [325e-9, 195e-8, 40625e-11, null, null, { threshold: 256e3, input: 13e-7, output: 39e-7, cacheWrite: 1625e-9, cacheRead: null }], "openrouter/qwen/qwen3.5-35b-a3b": [1625e-10, 13e-7, null, 15625e-11, null, null], "qwen/qwen3.5-35b-a3b": [1625e-10, 13e-7, null, 15625e-11, null, null], "openrouter/qwen/qwen3.5-27b": [195e-9, 156e-8, null, null, null, null], "qwen/qwen3.5-27b": [195e-9, 156e-8, null, null, null, null], "openrouter/qwen/qwen3.5-122b-a10b": [26e-8, 208e-8, null, null, null, null], "qwen/qwen3.5-122b-a10b": [26e-8, 208e-8, null, null, null, null], "openrouter/qwen/qwen3.5-flash-02-23": [65e-9, 26e-8, null, null, null, null], "qwen/qwen3.5-flash-02-23": [65e-9, 26e-8, null, null, null, null], "openrouter/qwen/qwen3.5-plus-02-15": [26e-8, 156e-8, null, null, null, { threshold: 256e3, input: 325e-9, output: 195e-8, cacheWrite: null, cacheRead: null }], "qwen/qwen3.5-plus-02-15": [26e-8, 156e-8, null, null, null, { threshold: 256e3, input: 325e-9, output: 195e-8, cacheWrite: null, cacheRead: null }], "openrouter/qwen/qwen3.5-397b-a17b": [55e-8, 35e-7, null, 225e-9, null, null], "qwen/qwen3.5-397b-a17b": [55e-8, 35e-7, null, 225e-9, null, null], "openrouter/switchpoint/router": [85e-8, 34e-7, null, null, null, null], "switchpoint/router": [85e-8, 34e-7, null, null, null, null], "openrouter/undi95/remm-slerp-l2-13b": [35e-8, 65e-8, null, null, null, null], "undi95/remm-slerp-l2-13b": [35e-8, 65e-8, null, null, null, null], "openrouter/x-ai/grok-4": [3e-6, 15e-6, null, null, null, null], "x-ai/grok-4": [3e-6, 15e-6, null, null, null, null], "openrouter/z-ai/glm-4.6": [43e-8, 175e-8, null, 8e-8, null, null], "z-ai/glm-4.6": [43e-8, 175e-8, null, 8e-8, null, null], "openrouter/z-ai/glm-4.6:exacto": [45e-8, 19e-7, null, null, null, null], "z-ai/glm-4.6:exacto": [45e-8, 19e-7, null, null, null, null], "openrouter/xiaomi/mimo-v2-flash": [1e-7, 3e-7, 0, 1e-8, null, null], "xiaomi/mimo-v2-flash": [1e-7, 3e-7, 0, 1e-8, null, null], "openrouter/xiaomi/mimo-v2.5-pro": [435e-9, 87e-8, 0, 36e-10, null, null], "xiaomi/mimo-v2.5-pro": [435e-9, 87e-8, 0, 36e-10, null, null], "openrouter/xiaomi/mimo-v2.5": [14e-8, 28e-8, 0, 28e-10, null, null], "xiaomi/mimo-v2.5": [14e-8, 28e-8, 0, 28e-10, null, null], "openrouter/z-ai/glm-4.7": [6e-7, 22e-7, 0, 11e-8, null, null], "z-ai/glm-4.7": [6e-7, 22e-7, 0, 11e-8, null, null], "openrouter/z-ai/glm-4.7-flash": [605e-10, 4e-7, 0, 1e-8, null, null], "z-ai/glm-4.7-flash": [605e-10, 4e-7, 0, 1e-8, null, null], "openrouter/z-ai/glm-5": [6e-7, 192e-8, null, 12e-8, null, null], "z-ai/glm-5": [6e-7, 192e-8, null, 12e-8, null, null], "openrouter/z-ai/glm-5.1": [14e-7, 44e-7, 0, 26e-8, null, null], "z-ai/glm-5.1": [14e-7, 44e-7, 0, 26e-8, null, null], "openrouter/minimax/minimax-m2.1": [3e-7, 12e-7, 0, 3e-8, null, null], "minimax/minimax-m2.1": [3e-7, 12e-7, 0, 3e-8, null, null], "openrouter/minimax/minimax-m2.5": [27e-8, 108e-8, null, 27e-9, null, null], "minimax/minimax-m2.5": [27e-8, 108e-8, null, 27e-9, null, null], "openrouter/openrouter/auto": [0, 0, null, null, null, null], "openrouter/auto": [0, 0, null, null, null, null], "openrouter/openrouter/free": [0, 0, null, null, null, null], "openrouter/free": [0, 0, null, null, null, null], "openrouter/openrouter/bodybuilder": [0, 0, null, null, null, null], "openrouter/bodybuilder": [0, 0, null, null, null, null], "ovhcloud/DeepSeek-R1-Distill-Llama-70B": [67e-8, 67e-8, null, null, null, null], "DeepSeek-R1-Distill-Llama-70B": [67e-8, 67e-8, null, null, null, null], "ovhcloud/Llama-3.1-8B-Instruct": [1e-7, 1e-7, null, null, null, null], "Llama-3.1-8B-Instruct": [1e-7, 1e-7, null, null, null, null], "ovhcloud/Meta-Llama-3_1-70B-Instruct": [67e-8, 67e-8, null, null, null, null], "Meta-Llama-3_1-70B-Instruct": [67e-8, 67e-8, null, null, null, null], "ovhcloud/Meta-Llama-3_3-70B-Instruct": [67e-8, 67e-8, null, null, null, null], "Meta-Llama-3_3-70B-Instruct": [67e-8, 67e-8, null, null, null, null], "ovhcloud/Mistral-7B-Instruct-v0.3": [1e-7, 1e-7, null, null, null, null], "Mistral-7B-Instruct-v0.3": [1e-7, 1e-7, null, null, null, null], "ovhcloud/Mistral-Nemo-Instruct-2407": [13e-8, 13e-8, null, null, null, null], "Mistral-Nemo-Instruct-2407": [13e-8, 13e-8, null, null, null, null], "ovhcloud/Mistral-Small-3.2-24B-Instruct-2506": [9e-8, 28e-8, null, null, null, null], "Mistral-Small-3.2-24B-Instruct-2506": [9e-8, 28e-8, null, null, null, null], "ovhcloud/Mixtral-8x7B-Instruct-v0.1": [63e-8, 63e-8, null, null, null, null], "Mixtral-8x7B-Instruct-v0.1": [63e-8, 63e-8, null, null, null, null], "ovhcloud/Qwen2.5-Coder-32B-Instruct": [87e-8, 87e-8, null, null, null, null], "Qwen2.5-Coder-32B-Instruct": [87e-8, 87e-8, null, null, null, null], "ovhcloud/Qwen2.5-VL-72B-Instruct": [91e-8, 91e-8, null, null, null, null], "Qwen2.5-VL-72B-Instruct": [91e-8, 91e-8, null, null, null, null], "ovhcloud/Qwen3-32B": [8e-8, 23e-8, null, null, null, null], "Qwen3-32B": [8e-8, 23e-8, null, null, null, null], "ovhcloud/gpt-oss-120b": [8e-8, 4e-7, null, null, null, null], "ovhcloud/gpt-oss-20b": [4e-8, 15e-8, null, null, null, null], "ovhcloud/llava-v1.6-mistral-7b-hf": [29e-8, 29e-8, null, null, null, null], "llava-v1.6-mistral-7b-hf": [29e-8, 29e-8, null, null, null, null], "ovhcloud/mamba-codestral-7B-v0.1": [19e-8, 19e-8, null, null, null, null], "mamba-codestral-7B-v0.1": [19e-8, 19e-8, null, null, null, null], "palm/chat-bison": [125e-9, 125e-9, null, null, null, null], "chat-bison": [125e-9, 125e-9, null, null, null, null], "palm/chat-bison-001": [125e-9, 125e-9, null, null, null, null], "chat-bison-001": [125e-9, 125e-9, null, null, null, null], "palm/text-bison": [125e-9, 125e-9, null, null, null, null], "text-bison": [125e-9, 125e-9, null, null, null, null], "palm/text-bison-001": [125e-9, 125e-9, null, null, null, null], "text-bison-001": [125e-9, 125e-9, null, null, null, null], "palm/text-bison-safety-off": [125e-9, 125e-9, null, null, null, null], "text-bison-safety-off": [125e-9, 125e-9, null, null, null, null], "palm/text-bison-safety-recitation-off": [125e-9, 125e-9, null, null, null, null], "text-bison-safety-recitation-off": [125e-9, 125e-9, null, null, null, null], "perplexity/codellama-34b-instruct": [35e-8, 14e-7, null, null, null, null], "codellama-34b-instruct": [35e-8, 14e-7, null, null, null, null], "perplexity/codellama-70b-instruct": [7e-7, 28e-7, null, null, null, null], "codellama-70b-instruct": [7e-7, 28e-7, null, null, null, null], "perplexity/llama-2-70b-chat": [7e-7, 28e-7, null, null, null, null], "llama-2-70b-chat": [7e-7, 28e-7, null, null, null, null], "perplexity/llama-3.1-70b-instruct": [1e-6, 1e-6, null, null, null, null], "llama-3.1-70b-instruct": [1e-6, 1e-6, null, null, null, null], "perplexity/llama-3.1-8b-instruct": [2e-7, 2e-7, null, null, null, null], "llama-3.1-8b-instruct": [2e-7, 2e-7, null, null, null, null], "perplexity/mistral-7b-instruct": [7e-8, 28e-8, null, null, null, null], "mistral-7b-instruct": [7e-8, 28e-8, null, null, null, null], "perplexity/mixtral-8x7b-instruct": [7e-8, 28e-8, null, null, null, null], "mixtral-8x7b-instruct": [7e-8, 28e-8, null, null, null, null], "perplexity/pplx-70b-chat": [7e-7, 28e-7, null, null, null, null], "pplx-70b-chat": [7e-7, 28e-7, null, null, null, null], "perplexity/pplx-70b-online": [0, 28e-7, null, null, null, null], "pplx-70b-online": [0, 28e-7, null, null, null, null], "perplexity/pplx-7b-chat": [7e-8, 28e-8, null, null, null, null], "pplx-7b-chat": [7e-8, 28e-8, null, null, null, null], "perplexity/pplx-7b-online": [0, 28e-8, null, null, null, null], "pplx-7b-online": [0, 28e-8, null, null, null, null], "perplexity/sonar": [1e-6, 1e-6, null, null, null, null], sonar: [1e-6, 1e-6, null, null, null, null], "perplexity/sonar-deep-research": [2e-6, 8e-6, null, null, null, null], "sonar-deep-research": [2e-6, 8e-6, null, null, null, null], "perplexity/sonar-medium-chat": [6e-7, 18e-7, null, null, null, null], "sonar-medium-chat": [6e-7, 18e-7, null, null, null, null], "perplexity/sonar-medium-online": [0, 18e-7, null, null, null, null], "sonar-medium-online": [0, 18e-7, null, null, null, null], "perplexity/sonar-pro": [3e-6, 15e-6, null, null, null, null], "sonar-pro": [3e-6, 15e-6, null, null, null, null], "perplexity/sonar-reasoning": [1e-6, 5e-6, null, null, null, null], "sonar-reasoning": [1e-6, 5e-6, null, null, null, null], "perplexity/sonar-reasoning-pro": [2e-6, 8e-6, null, null, null, null], "sonar-reasoning-pro": [2e-6, 8e-6, null, null, null, null], "perplexity/sonar-small-chat": [7e-8, 28e-8, null, null, null, null], "sonar-small-chat": [7e-8, 28e-8, null, null, null, null], "perplexity/sonar-small-online": [0, 28e-8, null, null, null, null], "sonar-small-online": [0, 28e-8, null, null, null, null], "publicai/swiss-ai/apertus-8b-instruct": [0, 0, null, null, null, null], "swiss-ai/apertus-8b-instruct": [0, 0, null, null, null, null], "publicai/swiss-ai/apertus-70b-instruct": [0, 0, null, null, null, null], "swiss-ai/apertus-70b-instruct": [0, 0, null, null, null, null], "publicai/aisingapore/Gemma-SEA-LION-v4-27B-IT": [0, 0, null, null, null, null], "aisingapore/Gemma-SEA-LION-v4-27B-IT": [0, 0, null, null, null, null], "publicai/BSC-LT/salamandra-7b-instruct-tools-16k": [0, 0, null, null, null, null], "BSC-LT/salamandra-7b-instruct-tools-16k": [0, 0, null, null, null, null], "publicai/BSC-LT/ALIA-40b-instruct_Q8_0": [0, 0, null, null, null, null], "BSC-LT/ALIA-40b-instruct_Q8_0": [0, 0, null, null, null, null], "publicai/allenai/Olmo-3-7B-Instruct": [0, 0, null, null, null, null], "allenai/Olmo-3-7B-Instruct": [0, 0, null, null, null, null], "perplexity/openai/gpt-5.2": [175e-8, 14e-6, null, 175e-9, null, null], "perplexity/openai/gpt-5.1": [125e-8, 1e-5, null, 125e-9, null, null], "perplexity/openai/gpt-5-mini": [25e-8, 2e-6, null, 25e-9, null, null], "perplexity/anthropic/claude-opus-4-6": [5e-6, 25e-6, null, 5e-7, null, null], "anthropic/claude-opus-4-6": [5e-6, 25e-6, null, 5e-7, null, null], "perplexity/anthropic/claude-opus-4-7": [5e-6, 25e-6, null, 5e-7, null, null], "anthropic/claude-opus-4-7": [5e-6, 25e-6, null, 5e-7, null, null], "perplexity/anthropic/claude-opus-4-5": [5e-6, 25e-6, null, 5e-7, null, null], "anthropic/claude-opus-4-5": [5e-6, 25e-6, null, 5e-7, null, null], "perplexity/anthropic/claude-sonnet-4-5": [3e-6, 15e-6, null, 3e-7, null, null], "anthropic/claude-sonnet-4-5": [3e-6, 15e-6, null, 3e-7, null, null], "perplexity/anthropic/claude-haiku-4-5": [1e-6, 5e-6, null, 1e-7, null, null], "anthropic/claude-haiku-4-5": [1e-6, 5e-6, null, 1e-7, null, null], "perplexity/google/gemini-3-flash-preview": [5e-7, 3e-6, null, 5e-8, null, null], "perplexity/perplexity/sonar": [25e-8, 25e-7, null, 625e-10, null, null], "perplexity/perplexity/deepseek-v4-flash-0731": [13e-8, 26e-8, null, 28e-9, null, null], "perplexity/deepseek-v4-flash-0731": [13e-8, 26e-8, null, 28e-9, null, null], "perplexity/perplexity/glm-5.2": [14e-7, 44e-7, null, 14e-8, null, null], "perplexity/glm-5.2": [14e-7, 44e-7, null, 14e-8, null, null], "perplexity/perplexity/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "perplexity/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "perplexity/perplexity/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "perplexity/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "perplexity/pplx-embed-v1-0.6b": [4e-9, 0, null, null, null, null], "pplx-embed-v1-0.6b": [4e-9, 0, null, null, null, null], "perplexity/pplx-embed-v1-4b": [3e-8, 0, null, null, null, null], "pplx-embed-v1-4b": [3e-8, 0, null, null, null, null], "publicai/aisingapore/Qwen-SEA-LION-v4-32B-IT": [0, 0, null, null, null, null], "aisingapore/Qwen-SEA-LION-v4-32B-IT": [0, 0, null, null, null, null], "publicai/allenai/Olmo-3-7B-Think": [0, 0, null, null, null, null], "allenai/Olmo-3-7B-Think": [0, 0, null, null, null, null], "publicai/allenai/Olmo-3-32B-Think": [0, 0, null, null, null, null], "allenai/Olmo-3-32B-Think": [0, 0, null, null, null, null], "bedrock/ap-northeast-1/qwen.qwen3-next-80b-a3b": [18e-8, 145e-8, null, null, null, null], "ap-northeast-1/qwen.qwen3-next-80b-a3b": [18e-8, 145e-8, null, null, null, null], "bedrock/ap-south-1/qwen.qwen3-next-80b-a3b": [18e-8, 141e-8, null, null, null, null], "ap-south-1/qwen.qwen3-next-80b-a3b": [18e-8, 141e-8, null, null, null, null], "bedrock/ap-southeast-2/qwen.qwen3-next-80b-a3b": [1545e-10, 1236e-9, null, null, null, null], "ap-southeast-2/qwen.qwen3-next-80b-a3b": [1545e-10, 1236e-9, null, null, null, null], "bedrock/eu-west-1/qwen.qwen3-next-80b-a3b": [18e-8, 141e-8, null, null, null, null], "eu-west-1/qwen.qwen3-next-80b-a3b": [18e-8, 141e-8, null, null, null, null], "bedrock/eu-west-2/qwen.qwen3-next-80b-a3b": [23e-8, 186e-8, null, null, null, null], "eu-west-2/qwen.qwen3-next-80b-a3b": [23e-8, 186e-8, null, null, null, null], "bedrock/sa-east-1/qwen.qwen3-next-80b-a3b": [18e-8, 145e-8, null, null, null, null], "sa-east-1/qwen.qwen3-next-80b-a3b": [18e-8, 145e-8, null, null, null, null], "replicate/meta/llama-2-13b": [1e-7, 5e-7, null, null, null, null], "meta/llama-2-13b": [1e-7, 5e-7, null, null, null, null], "replicate/meta/llama-2-13b-chat": [1e-7, 5e-7, null, null, null, null], "meta/llama-2-13b-chat": [1e-7, 5e-7, null, null, null, null], "replicate/meta/llama-2-70b": [65e-8, 275e-8, null, null, null, null], "meta/llama-2-70b": [65e-8, 275e-8, null, null, null, null], "replicate/meta/llama-2-70b-chat": [65e-8, 275e-8, null, null, null, null], "meta/llama-2-70b-chat": [65e-8, 275e-8, null, null, null, null], "replicate/meta/llama-2-7b": [5e-8, 25e-8, null, null, null, null], "meta/llama-2-7b": [5e-8, 25e-8, null, null, null, null], "replicate/meta/llama-2-7b-chat": [5e-8, 25e-8, null, null, null, null], "meta/llama-2-7b-chat": [5e-8, 25e-8, null, null, null, null], "replicate/meta/llama-3-70b": [65e-8, 275e-8, null, null, null, null], "meta/llama-3-70b": [65e-8, 275e-8, null, null, null, null], "replicate/meta/llama-3-70b-instruct": [65e-8, 275e-8, null, null, null, null], "meta/llama-3-70b-instruct": [65e-8, 275e-8, null, null, null, null], "replicate/meta/llama-3-8b": [5e-8, 25e-8, null, null, null, null], "meta/llama-3-8b": [5e-8, 25e-8, null, null, null, null], "replicate/meta/llama-3-8b-instruct": [5e-8, 25e-8, null, null, null, null], "meta/llama-3-8b-instruct": [5e-8, 25e-8, null, null, null, null], "replicate/mistralai/mistral-7b-instruct-v0.2": [5e-8, 25e-8, null, null, null, null], "mistralai/mistral-7b-instruct-v0.2": [5e-8, 25e-8, null, null, null, null], "replicate/mistralai/mistral-7b-v0.1": [5e-8, 25e-8, null, null, null, null], "mistralai/mistral-7b-v0.1": [5e-8, 25e-8, null, null, null, null], "replicate/mistralai/mixtral-8x7b-instruct-v0.1": [3e-7, 1e-6, null, null, null, null], "mistralai/mixtral-8x7b-instruct-v0.1": [3e-7, 1e-6, null, null, null, null], "replicate/openai/gpt-5": [125e-8, 1e-5, null, null, null, null], "replicate/openai/gpt-oss-20b": [9e-8, 36e-8, null, null, null, null], "replicate/anthropic/claude-4.5-haiku": [1e-6, 5e-6, null, null, null, null], "anthropic/claude-4.5-haiku": [1e-6, 5e-6, null, null, null, null], "replicate/ibm-granite/granite-3.3-8b-instruct": [3e-8, 25e-8, null, null, null, null], "ibm-granite/granite-3.3-8b-instruct": [3e-8, 25e-8, null, null, null, null], "replicate/openai/gpt-4o": [25e-7, 1e-5, null, null, null, null], "replicate/openai/o4-mini": [1e-6, 4e-6, null, null, null, null], "openai/o4-mini": [1e-6, 4e-6, null, null, null, null], "replicate/openai/o1-mini": [11e-7, 44e-7, null, null, null, null], "openai/o1-mini": [11e-7, 44e-7, null, null, null, null], "replicate/openai/o1": [15e-6, 6e-5, null, null, null, null], "replicate/openai/gpt-4o-mini": [15e-8, 6e-7, null, null, null, null], "replicate/qwen/qwen3-235b-a22b-instruct-2507": [264e-9, 106e-8, null, null, null, null], "qwen/qwen3-235b-a22b-instruct-2507": [264e-9, 106e-8, null, null, null, null], "replicate/anthropic/claude-4-sonnet": [3e-6, 15e-6, null, null, null, null], "replicate/deepseek-ai/deepseek-v3": [145e-8, 145e-8, null, null, null, null], "deepseek-ai/deepseek-v3": [145e-8, 145e-8, null, null, null, null], "replicate/anthropic/claude-3.7-sonnet": [3e-6, 15e-6, null, null, null, null], "replicate/anthropic/claude-3.5-haiku": [1e-6, 5e-6, null, null, null, null], "anthropic/claude-3.5-haiku": [1e-6, 5e-6, null, null, null, null], "replicate/anthropic/claude-3.5-sonnet": [375e-8, 1875e-8, null, null, null, null], "replicate/google/gemini-3-pro": [2e-6, 12e-6, null, null, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: null }], "google/gemini-3-pro": [2e-6, 12e-6, null, null, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: null }], "replicate/anthropic/claude-4.5-sonnet": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-4.5-sonnet": [3e-6, 15e-6, null, null, null, null], "replicate/openai/gpt-4.1": [2e-6, 8e-6, null, null, null, null], "replicate/openai/gpt-4.1-nano": [1e-7, 4e-7, null, null, null, null], "replicate/openai/gpt-4.1-mini": [4e-7, 16e-7, null, null, null, null], "replicate/openai/gpt-5-nano": [5e-8, 4e-7, null, null, null, null], "replicate/openai/gpt-5-mini": [25e-8, 2e-6, null, null, null, null], "replicate/google/gemini-2.5-flash": [3e-7, 25e-7, null, null, null, null], "replicate/openai/gpt-oss-120b": [18e-8, 72e-8, null, null, null, null], "replicate/deepseek-ai/deepseek-v3.1": [672e-9, 2016e-9, null, null, null, null], "deepseek-ai/deepseek-v3.1": [672e-9, 2016e-9, null, null, null, null], "replicate/xai/grok-4": [72e-7, 36e-6, null, null, null, null], "xai/grok-4": [72e-7, 36e-6, null, null, null, null], "replicate/deepseek-ai/deepseek-r1": [375e-8, 1e-5, null, null, null, null], "deepseek-ai/deepseek-r1": [375e-8, 1e-5, null, null, null, null], "nvidia_nim/nvidia/nv-rerankqa-mistral-4b-v3": [0, 0, null, null, null, null], "nvidia/nv-rerankqa-mistral-4b-v3": [0, 0, null, null, null, null], "nvidia_nim/nvidia/llama-3_2-nv-rerankqa-1b-v2": [0, 0, null, null, null, null], "nvidia/llama-3_2-nv-rerankqa-1b-v2": [0, 0, null, null, null, null], "nvidia_nim/ranking/nvidia/llama-3.2-nv-rerankqa-1b-v2": [0, 0, null, null, null, null], "ranking/nvidia/llama-3.2-nv-rerankqa-1b-v2": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-13b": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-13b": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-13b-f": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-13b-f": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-70b": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-70b": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-70b-b-f": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-70b-b-f": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-7b": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-7b": [0, 0, null, null, null, null], "sagemaker/meta-textgeneration-llama-2-7b-f": [0, 0, null, null, null, null], "meta-textgeneration-llama-2-7b-f": [0, 0, null, null, null, null], "sambanova/MiniMax-M2.7": [6e-7, 24e-7, null, null, null, null], "MiniMax-M2.7": [3e-7, 12e-7, 375e-9, 6e-8], "sambanova/DeepSeek-R1": [5e-6, 7e-6, null, null, null, null], "DeepSeek-R1": [5e-6, 7e-6, null, null, null, null], "sambanova/Llama-4-Maverick-17B-128E-Instruct": [63e-8, 18e-7, null, null, null, null], "Llama-4-Maverick-17B-128E-Instruct": [63e-8, 18e-7, null, null, null, null], "sambanova/Meta-Llama-3.3-70B-Instruct": [6e-7, 12e-7, null, null, null, null], "Meta-Llama-3.3-70B-Instruct": [6e-7, 12e-7, null, null, null, null], "sambanova/DeepSeek-V3.1": [3e-6, 45e-7, null, null, null, null], "DeepSeek-V3.1": [3e-6, 45e-7, null, null, null, null], "sambanova/gpt-oss-120b": [22e-8, 59e-8, null, null, null, null], "sambanova/DeepSeek-V3.2": [3e-6, 45e-7, null, null, null, null], "DeepSeek-V3.2": [3e-6, 45e-7, null, null, null, null], "sambanova/gemma-4-31B-it": [38e-8, 115e-8, null, null, null, null], "gemma-4-31B-it": [38e-8, 115e-8, null, null, null, null], "scx-ai/GLM-5.2": [61e-8, 198e-8, null, 22e-8, null, null], "GLM-5.2": [61e-8, 198e-8, null, 22e-8, null, null], "scx-ai/Qwen3.8-Max": [165e-8, 499e-8, null, 21e-8, null, null], "Qwen3.8-Max": [165e-8, 499e-8, null, 21e-8, null, null], "snowflake/claude-3-5-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "claude-3-5-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "snowflake/deepseek-r1": [135e-8, 54e-7, null, null, null, null], "snowflake/llama3.1-405b": [12e-7, 12e-7, null, null, null, null], "llama3.1-405b": [12e-7, 12e-7, null, null, null, null], "snowflake/llama3.1-70b": [72e-8, 72e-8, null, null, null, null], "snowflake/llama3.1-8b": [24e-8, 24e-8, null, null, null, null], "snowflake/llama3.3-70b": [72e-8, 72e-8, null, null, null, null], "llama3.3-70b": [72e-8, 72e-8, null, null, null, null], "snowflake/mistral-large2": [2e-6, 6e-6, null, null, null, null], "mistral-large2": [2e-6, 6e-6, null, null, null, null], "snowflake/snowflake-llama-3.3-70b": [72e-8, 72e-8, null, null, null, null], "snowflake-llama-3.3-70b": [72e-8, 72e-8, null, null, null, null], "text-completion-codestral/codestral-2405": [0, 0, null, null, null, null], "text-completion-codestral/codestral-latest": [0, 0, null, null, null, null], "together_ai/baai/bge-base-en-v1.5": [8e-9, 0, null, null, null, null], "baai/bge-base-en-v1.5": [8e-9, 0, null, null, null, null], "together_ai/BAAI/bge-base-en-v1.5": [8e-9, 0, null, null, null, null], "BAAI/bge-base-en-v1.5": [8e-9, 0, null, null, null, null], "together_ai/Qwen/Qwen2.5-7B-Instruct-Turbo": [3e-7, 3e-7, null, null, null, null], "Qwen/Qwen2.5-7B-Instruct-Turbo": [3e-7, 3e-7, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-V3": [125e-8, 125e-8, null, null, null, null], "together_ai/meta-llama/Llama-3.3-70B-Instruct-Turbo": [104e-8, 104e-8, null, null, null, null], "together_ai/moonshotai/Kimi-K2-Instruct": [1e-6, 3e-6, null, null, null, null], "together_ai/openai/gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "together_ai/zai-org/GLM-4.6": [6e-7, 22e-7, null, null, null, null], "together_ai/MiniMaxAI/MiniMax-M3": [3e-7, 12e-7, null, 6e-8, null, null], "together_ai/Prism-ML/Ternary-Bonsai-27B": [0, 0, null, null, null, null], "Prism-ML/Ternary-Bonsai-27B": [0, 0, null, null, null, null], "together_ai/Qwen/Qwen3.5-9B": [17e-8, 25e-8, null, null, null, null], "Qwen/Qwen3.5-9B": [17e-8, 25e-8, null, null, null, null], "together_ai/Qwen/Qwen3.6-Plus": [5e-7, 3e-6, null, null, null, null], "Qwen/Qwen3.6-Plus": [5e-7, 3e-6, null, null, null, null], "together_ai/Qwen/Qwen3.7-Max": [15e-7, 45e-7, null, 3e-7, null, null], "Qwen/Qwen3.7-Max": [15e-7, 45e-7, null, 3e-7, null, null], "together_ai/Qwen/Qwen3.7-Plus": [32e-8, 128e-8, null, null, null, null], "Qwen/Qwen3.7-Plus": [32e-8, 128e-8, null, null, null, null], "together_ai/Qwen/Qwen3.8-2.4T-A95B": [2e-6, 6e-6, null, 25e-8, null, null], "Qwen/Qwen3.8-2.4T-A95B": [2e-6, 6e-6, null, 25e-8, null, null], "together_ai/arize-ai/qwen-2-1.5b-instruct": [1e-7, 1e-7, null, null, null, null], "arize-ai/qwen-2-1.5b-instruct": [1e-7, 1e-7, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-V4-Flash-0731": [14e-8, 28e-8, null, 3e-8, null, null], "together_ai/deepseek-ai/DeepSeek-V4.1-Flash": [3e-7, 12e-7, null, 6e-9, null, null], "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813": [132e-8, 396e-8, null, 13e-8, null, null], "together_ai/meta-models/Muse-Glimmer-30B": [35e-8, 15e-7, null, 4e-8, null, null], "meta-models/Muse-Glimmer-30B": [35e-8, 15e-7, null, 4e-8, null, null], "together_ai/moonshotai/Kimi-K3": [3e-6, 15e-6, null, 3e-7, null, null], "together_ai/thinkingmachines/Inkling": [1e-6, 405e-8, null, 17e-8, null, null], "thinkingmachines/Inkling": [1e-6, 405e-8, null, 17e-8, null, null], "together_ai/zai-org/GLM-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "together_ai/zai-org/GLM-5.3": [14e-7, 44e-7, null, 26e-8, null, null], "together_ai/zai-org/GLM-5.3-Flash": [15e-8, 5e-7, null, 3e-8, null, null], "v0/v0-1.0-md": [3e-6, 15e-6, null, null, null, null], "v0-1.0-md": [3e-6, 15e-6, null, null, null, null], "v0/v0-1.5-lg": [15e-6, 75e-6, null, null, null, null], "v0-1.5-lg": [15e-6, 75e-6, null, null, null, null], "v0/v0-1.5-md": [3e-6, 15e-6, null, null, null, null], "v0-1.5-md": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/alibaba/qwen-3-14b": [8e-8, 24e-8, null, null, null, null], "alibaba/qwen-3-14b": [8e-8, 24e-8, null, null, null, null], "vercel_ai_gateway/alibaba/qwen-3-235b": [2e-7, 6e-7, null, null, null, null], "alibaba/qwen-3-235b": [2e-7, 6e-7, null, null, null, null], "vercel_ai_gateway/alibaba/qwen-3-30b": [1e-7, 3e-7, null, null, null, null], "alibaba/qwen-3-30b": [1e-7, 3e-7, null, null, null, null], "vercel_ai_gateway/alibaba/qwen-3-32b": [1e-7, 3e-7, null, null, null, null], "alibaba/qwen-3-32b": [1e-7, 3e-7, null, null, null, null], "vercel_ai_gateway/alibaba/qwen3-coder": [4e-7, 16e-7, null, null, null, null], "alibaba/qwen3-coder": [4e-7, 16e-7, null, null, null, null], "vercel_ai_gateway/amazon/nova-lite": [6e-8, 24e-8, null, null, null, null], "amazon/nova-lite": [6e-8, 24e-8, null, null, null, null], "vercel_ai_gateway/amazon/nova-micro": [35e-9, 14e-8, null, null, null, null], "amazon/nova-micro": [35e-9, 14e-8, null, null, null, null], "vercel_ai_gateway/amazon/nova-pro": [8e-7, 32e-7, null, null, null, null], "amazon/nova-pro": [8e-7, 32e-7, null, null, null, null], "vercel_ai_gateway/amazon/titan-embed-text-v2": [2e-8, 0, null, null, null, null], "amazon/titan-embed-text-v2": [2e-8, 0, null, null, null, null], "vercel_ai_gateway/anthropic/claude-3-haiku": [25e-8, 125e-8, 3e-7, 3e-8, null, null], "vercel_ai_gateway/anthropic/claude-3-opus": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "anthropic/claude-3-opus": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vercel_ai_gateway/anthropic/claude-3.5-haiku": [8e-7, 4e-6, 1e-6, 8e-8, null, null], "vercel_ai_gateway/anthropic/claude-3.5-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-3.7-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-4-opus": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vercel_ai_gateway/anthropic/claude-4-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-3-5-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "anthropic/claude-3-5-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-3-5-sonnet-20241022": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "anthropic/claude-3-5-sonnet-20241022": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-3-7-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "anthropic/claude-3-7-sonnet": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-haiku-4.5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "vercel_ai_gateway/anthropic/claude-opus-4": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vercel_ai_gateway/anthropic/claude-opus-4.1": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vercel_ai_gateway/anthropic/claude-opus-4.5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vercel_ai_gateway/anthropic/claude-opus-4.6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vercel_ai_gateway/anthropic/claude-sonnet-4": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/anthropic/claude-sonnet-4.5": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vercel_ai_gateway/cohere/command-a": [25e-7, 1e-5, null, null, null, null], "cohere/command-a": [25e-7, 1e-5, null, null, null, null], "vercel_ai_gateway/cohere/command-r": [15e-8, 6e-7, null, null, null, null], "cohere/command-r": [15e-8, 6e-7, null, null, null, null], "vercel_ai_gateway/cohere/command-r-plus": [25e-7, 1e-5, null, null, null, null], "cohere/command-r-plus": [25e-7, 1e-5, null, null, null, null], "vercel_ai_gateway/cohere/embed-v4.0": [12e-8, 0, null, null, null, null], "vercel_ai_gateway/deepseek/deepseek-r1": [55e-8, 219e-8, null, null, null, null], "vercel_ai_gateway/deepseek/deepseek-r1-distill-llama-70b": [75e-8, 99e-8, null, null, null, null], "deepseek/deepseek-r1-distill-llama-70b": [75e-8, 99e-8, null, null, null, null], "vercel_ai_gateway/deepseek/deepseek-v3": [9e-7, 9e-7, null, null, null, null], "vercel_ai_gateway/google/gemini-2.5-flash": [3e-7, 25e-7, null, 3e-8, null, null], "vercel_ai_gateway/google/gemini-2.5-pro": [125e-8, 1e-5, null, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "vercel_ai_gateway/google/gemini-embedding-001": [15e-8, 0, null, null, null, null], "google/gemini-embedding-001": [15e-8, 0, null, null, null, null], "vercel_ai_gateway/google/gemma-2-9b": [2e-7, 2e-7, null, null, null, null], "google/gemma-2-9b": [2e-7, 2e-7, null, null, null, null], "vercel_ai_gateway/google/text-embedding-005": [25e-9, 0, null, null, null, null], "google/text-embedding-005": [25e-9, 0, null, null, null, null], "vercel_ai_gateway/google/text-multilingual-embedding-002": [25e-9, 0, null, null, null, null], "google/text-multilingual-embedding-002": [25e-9, 0, null, null, null, null], "vercel_ai_gateway/inception/mercury-coder-small": [25e-8, 1e-6, null, null, null, null], "inception/mercury-coder-small": [25e-8, 1e-6, null, null, null, null], "vercel_ai_gateway/meta/llama-3-70b": [59e-8, 79e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3-8b": [5e-8, 8e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.1-70b": [72e-8, 72e-8, null, null, null, null], "meta/llama-3.1-70b": [72e-8, 72e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.1-8b": [5e-8, 8e-8, null, null, null, null], "meta/llama-3.1-8b": [5e-8, 8e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.2-11b": [16e-8, 16e-8, null, null, null, null], "meta/llama-3.2-11b": [16e-8, 16e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.2-1b": [1e-7, 1e-7, null, null, null, null], "meta/llama-3.2-1b": [1e-7, 1e-7, null, null, null, null], "vercel_ai_gateway/meta/llama-3.2-3b": [15e-8, 15e-8, null, null, null, null], "meta/llama-3.2-3b": [15e-8, 15e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.2-90b": [72e-8, 72e-8, null, null, null, null], "meta/llama-3.2-90b": [72e-8, 72e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-3.3-70b": [72e-8, 72e-8, null, null, null, null], "meta/llama-3.3-70b": [72e-8, 72e-8, null, null, null, null], "vercel_ai_gateway/meta/llama-4-maverick": [2e-7, 6e-7, null, null, null, null], "meta/llama-4-maverick": [2e-7, 6e-7, null, null, null, null], "vercel_ai_gateway/meta/llama-4-scout": [1e-7, 3e-7, null, null, null, null], "meta/llama-4-scout": [1e-7, 3e-7, null, null, null, null], "vercel_ai_gateway/mistral/codestral": [3e-7, 9e-7, null, null, null, null], "mistral/codestral": [3e-7, 9e-7, null, null, null, null], "vercel_ai_gateway/mistral/codestral-embed": [15e-8, 0, null, null, null, null], "vercel_ai_gateway/mistral/devstral-small": [7e-8, 28e-8, null, null, null, null], "mistral/devstral-small": [7e-8, 28e-8, null, null, null, null], "vercel_ai_gateway/mistral/magistral-medium": [2e-6, 5e-6, null, null, null, null], "mistral/magistral-medium": [2e-6, 5e-6, null, null, null, null], "vercel_ai_gateway/mistral/magistral-small": [5e-7, 15e-7, null, null, null, null], "mistral/magistral-small": [5e-7, 15e-7, null, null, null, null], "vercel_ai_gateway/mistral/ministral-3b": [4e-8, 4e-8, null, null, null, null], "mistral/ministral-3b": [4e-8, 4e-8, null, null, null, null], "vercel_ai_gateway/mistral/ministral-8b": [1e-7, 1e-7, null, null, null, null], "mistral/ministral-8b": [1e-7, 1e-7, null, null, null, null], "vercel_ai_gateway/mistral/mistral-embed": [1e-7, 0, null, null, null, null], "vercel_ai_gateway/mistral/mistral-large": [2e-6, 6e-6, null, null, null, null], "mistral/mistral-large": [2e-6, 6e-6, null, null, null, null], "vercel_ai_gateway/mistral/mistral-saba-24b": [79e-8, 79e-8, null, null, null, null], "mistral/mistral-saba-24b": [79e-8, 79e-8, null, null, null, null], "vercel_ai_gateway/mistral/mistral-small": [1e-7, 3e-7, null, null, null, null], "vercel_ai_gateway/mistral/mixtral-8x22b-instruct": [12e-7, 12e-7, null, null, null, null], "mistral/mixtral-8x22b-instruct": [12e-7, 12e-7, null, null, null, null], "vercel_ai_gateway/mistral/pixtral-12b": [15e-8, 15e-8, null, null, null, null], "mistral/pixtral-12b": [15e-8, 15e-8, null, null, null, null], "vercel_ai_gateway/mistral/pixtral-large": [2e-6, 6e-6, null, null, null, null], "mistral/pixtral-large": [2e-6, 6e-6, null, null, null, null], "vercel_ai_gateway/moonshotai/kimi-k2": [55e-8, 22e-7, null, null, null, null], "moonshotai/kimi-k2": [55e-8, 22e-7, null, null, null, null], "vercel_ai_gateway/morph/morph-v3-fast": [8e-7, 12e-7, null, null, null, null], "vercel_ai_gateway/morph/morph-v3-large": [9e-7, 19e-7, null, null, null, null], "vercel_ai_gateway/openai/gpt-3.5-turbo": [5e-7, 15e-7, null, null, null, null], "vercel_ai_gateway/openai/gpt-3.5-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "openai/gpt-3.5-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "vercel_ai_gateway/openai/gpt-4-turbo": [1e-5, 3e-5, null, null, null, null], "openai/gpt-4-turbo": [1e-5, 3e-5, null, null, null, null], "vercel_ai_gateway/openai/gpt-4.1": [2e-6, 8e-6, 0, 5e-7, null, null], "vercel_ai_gateway/openai/gpt-4.1-mini": [4e-7, 16e-7, 0, 1e-7, null, null], "vercel_ai_gateway/openai/gpt-4.1-nano": [1e-7, 4e-7, 0, 25e-9, null, null], "vercel_ai_gateway/openai/gpt-4o": [25e-7, 1e-5, 0, 125e-8, null, null], "vercel_ai_gateway/openai/gpt-4o-mini": [15e-8, 6e-7, 0, 75e-9, null, null], "vercel_ai_gateway/openai/o1": [15e-6, 6e-5, 0, 75e-7, null, null], "vercel_ai_gateway/openai/o3": [2e-6, 8e-6, 0, 5e-7, null, null], "openai/o3": [2e-6, 8e-6, 0, 5e-7, null, null], "vercel_ai_gateway/openai/o3-mini": [11e-7, 44e-7, 0, 55e-8, null, null], "vercel_ai_gateway/openai/o4-mini": [11e-7, 44e-7, 0, 275e-9, null, null], "vercel_ai_gateway/openai/text-embedding-3-large": [13e-8, 0, null, null, null, null], "openai/text-embedding-3-large": [13e-8, 0, null, null, null, null], "vercel_ai_gateway/openai/text-embedding-3-small": [2e-8, 0, null, null, null, null], "openai/text-embedding-3-small": [2e-8, 0, null, null, null, null], "vercel_ai_gateway/openai/text-embedding-ada-002": [1e-7, 0, null, null, null, null], "openai/text-embedding-ada-002": [1e-7, 0, null, null, null, null], "vercel_ai_gateway/perplexity/sonar": [1e-6, 1e-6, null, null, null, null], "vercel_ai_gateway/perplexity/sonar-pro": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/perplexity/sonar-reasoning": [1e-6, 5e-6, null, null, null, null], "vercel_ai_gateway/perplexity/sonar-reasoning-pro": [2e-6, 8e-6, null, null, null, null], "vercel_ai_gateway/vercel/v0-1.0-md": [3e-6, 15e-6, null, null, null, null], "vercel/v0-1.0-md": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/vercel/v0-1.5-md": [3e-6, 15e-6, null, null, null, null], "vercel/v0-1.5-md": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/xai/grok-2": [2e-6, 1e-5, null, null, null, null], "xai/grok-2": [2e-6, 1e-5, null, null, null, null], "vercel_ai_gateway/xai/grok-2-vision": [2e-6, 1e-5, null, null, null, null], "xai/grok-2-vision": [2e-6, 1e-5, null, null, null, null], "vercel_ai_gateway/xai/grok-3": [3e-6, 15e-6, null, null, null, null], "xai/grok-3": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/xai/grok-3-fast": [5e-6, 25e-6, null, null, null, null], "xai/grok-3-fast": [5e-6, 25e-6, null, null, null, null], "vercel_ai_gateway/xai/grok-3-mini": [3e-7, 5e-7, null, null, null, null], "xai/grok-3-mini": [3e-7, 5e-7, null, null, null, null], "vercel_ai_gateway/xai/grok-3-mini-fast": [6e-7, 4e-6, null, null, null, null], "xai/grok-3-mini-fast": [6e-7, 4e-6, null, null, null, null], "vercel_ai_gateway/xai/grok-4": [3e-6, 15e-6, null, null, null, null], "vercel_ai_gateway/zai/glm-4.5": [6e-7, 22e-7, null, null, null, null], "vercel_ai_gateway/zai/glm-4.5-air": [2e-7, 11e-7, null, null, null, null], "vercel_ai_gateway/zai/glm-4.6": [45e-8, 18e-7, null, 11e-8, null, null], "vertex_ai/claude-3-5-haiku": [1e-6, 5e-6, null, null, null, null], "claude-3-5-haiku": [1e-6, 5e-6, null, null, null, null], "vertex_ai/claude-3-5-haiku@20241022": [1e-6, 5e-6, null, null, null, null], "claude-3-5-haiku@20241022": [1e-6, 5e-6, null, null, null, null], "vertex_ai/claude-haiku-4-5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "vertex_ai/claude-haiku-4-5@20251001": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "claude-haiku-4-5@20251001": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "vertex_ai/claude-3-5-sonnet": [3e-6, 15e-6, null, null, null, null], "vertex_ai/claude-3-5-sonnet@20240620": [3e-6, 15e-6, null, null, null, null], "claude-3-5-sonnet@20240620": [3e-6, 15e-6, null, null, null, null], "vertex_ai/claude-3-haiku": [25e-8, 125e-8, null, null, null, null], "claude-3-haiku": [25e-8, 125e-8, null, null, null, null], "vertex_ai/claude-3-haiku@20240307": [25e-8, 125e-8, null, null, null, null], "claude-3-haiku@20240307": [25e-8, 125e-8, null, null, null, null], "vertex_ai/claude-3-opus": [15e-6, 75e-6, null, null, null, null], "claude-3-opus": [15e-6, 75e-6, null, null, null, null], "vertex_ai/claude-3-opus@20240229": [15e-6, 75e-6, null, null, null, null], "claude-3-opus@20240229": [15e-6, 75e-6, null, null, null, null], "vertex_ai/claude-3-sonnet": [3e-6, 15e-6, null, null, null, null], "claude-3-sonnet": [3e-6, 15e-6, null, null, null, null], "vertex_ai/claude-3-sonnet@20240229": [3e-6, 15e-6, null, null, null, null], "claude-3-sonnet@20240229": [3e-6, 15e-6, null, null, null, null], "vertex_ai/claude-opus-4-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-5@20251101": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-5@20251101": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-6": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-6@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-6@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-7": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-7@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-7@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "vertex_ai/claude-fable-5-1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "vertex_ai/claude-fable-5@default": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "claude-fable-5@default": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "vertex_ai/claude-fable-5-1@default": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "claude-fable-5-1@default": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "vertex_ai/claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-5@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-5@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-5-5": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "vertex_ai/claude-opus-5-5@default": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "claude-opus-5-5@default": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "vertex_ai/claude-opus-4-8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-opus-4-8@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-8@default": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "vertex_ai/claude-sonnet-4-5": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "vertex_ai/claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "vertex_ai/claude-sonnet-4-6": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "vertex_ai/claude-sonnet-4-5@20250929": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "claude-sonnet-4-5@20250929": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "vertex_ai/mistralai/codestral-2@001": [3e-7, 9e-7, null, null, null, null], "mistralai/codestral-2@001": [3e-7, 9e-7, null, null, null, null], "vertex_ai/codestral-2": [3e-7, 9e-7, null, null, null, null], "codestral-2": [3e-7, 9e-7, null, null, null, null], "vertex_ai/codestral-2@001": [3e-7, 9e-7, null, null, null, null], "codestral-2@001": [3e-7, 9e-7, null, null, null, null], "vertex_ai/mistralai/codestral-2": [3e-7, 9e-7, null, null, null, null], "mistralai/codestral-2": [3e-7, 9e-7, null, null, null, null], "vertex_ai/codestral-2501": [2e-7, 6e-7, null, null, null, null], "codestral-2501": [2e-7, 6e-7, null, null, null, null], "vertex_ai/codestral@2405": [2e-7, 6e-7, null, null, null, null], "codestral@2405": [2e-7, 6e-7, null, null, null, null], "vertex_ai/codestral@latest": [2e-7, 6e-7, null, null, null, null], "codestral@latest": [2e-7, 6e-7, null, null, null, null], "vertex_ai/deepseek-ai/deepseek-v3.1-maas": [6e-7, 17e-7, null, 6e-8, null, null], "deepseek-ai/deepseek-v3.1-maas": [6e-7, 17e-7, null, 6e-8, null, null], "vertex_ai/deepseek-ai/deepseek-v3.2-maas": [56e-8, 168e-8, null, 56e-9, null, null], "deepseek-ai/deepseek-v3.2-maas": [56e-8, 168e-8, null, 56e-9, null, null], "vertex_ai/deepseek-ai/deepseek-r1-0528-maas": [135e-8, 54e-7, null, null, null, null], "deepseek-ai/deepseek-r1-0528-maas": [135e-8, 54e-7, null, null, null, null], "vertex_ai/gemini-2.5-flash-image": [3e-7, 25e-7, null, null, null, null, [15e-8, 125e-8, null, null, null, null]], "vertex_ai/gemini-3-pro-image": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 1e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "vertex_ai/gemini-3-pro-image-preview": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "vertex_ai/gemini-3.1-flash-image": [5e-7, 3e-6, null, 5e-8, null, null, [25e-8, 15e-7, null, 25e-9, null, null]], "vertex_ai/gemini-3.1-flash-image-preview": [5e-7, 3e-6, null, 5e-8, null, null], "vertex_ai/gemini-3.1-flash-lite-image": [25e-8, 15e-7, null, 25e-9, null, null, [125e-9, 75e-8, null, 125e-10, null, null]], "vertex_ai/gemini-3.1-flash-lite-preview": [25e-8, 15e-7, null, 25e-9, null, null], "vertex_ai/gemini-3.1-flash-lite": [25e-8, 15e-7, null, 25e-9, 1.8, null, [125e-9, 75e-8, null, 125e-10, null, null]], "vertex_ai/gemini-3.5-flash-lite": [3e-7, 25e-7, null, 3e-8, 1.8, null, [15e-8, 125e-8, null, 15e-9, null, null]], "vertex_ai/deep-research-pro-preview-12-2025": [2e-6, 12e-6, null, 2e-7, null, null], "vertex_ai/jamba-1.5": [2e-7, 4e-7, null, null, null, null], "vertex_ai/jamba-1.5-large": [2e-6, 8e-6, null, null, null, null], "vertex_ai/jamba-1.5-large@001": [2e-6, 8e-6, null, null, null, null], "vertex_ai/jamba-1.5-mini": [2e-7, 4e-7, null, null, null, null], "vertex_ai/jamba-1.5-mini@001": [2e-7, 4e-7, null, null, null, null], "vertex_ai/lyria-3-clip-preview": [0, 0, null, null, null, null], "vertex_ai/lyria-3-pro-preview": [0, 0, null, null, null, null], "vertex_ai/meta/llama-3.1-405b-instruct-maas": [5e-6, 16e-6, null, null, null, null], "meta/llama-3.1-405b-instruct-maas": [5e-6, 16e-6, null, null, null, null], "vertex_ai/meta/llama-3.1-70b-instruct-maas": [0, 0, null, null, null, null], "meta/llama-3.1-70b-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/meta/llama-3.1-8b-instruct-maas": [0, 0, null, null, null, null], "meta/llama-3.1-8b-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/meta/llama-3.2-90b-vision-instruct-maas": [0, 0, null, null, null, null], "meta/llama-3.2-90b-vision-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/meta/llama-4-maverick-17b-128e-instruct-maas": [35e-8, 115e-8, null, null, null, null], "meta/llama-4-maverick-17b-128e-instruct-maas": [35e-8, 115e-8, null, null, null, null], "vertex_ai/meta/llama-4-maverick-17b-16e-instruct-maas": [35e-8, 115e-8, null, null, null, null], "meta/llama-4-maverick-17b-16e-instruct-maas": [35e-8, 115e-8, null, null, null, null], "vertex_ai/meta/llama-4-scout-17b-128e-instruct-maas": [25e-8, 7e-7, null, null, null, null], "meta/llama-4-scout-17b-128e-instruct-maas": [25e-8, 7e-7, null, null, null, null], "vertex_ai/meta/llama-4-scout-17b-16e-instruct-maas": [25e-8, 7e-7, null, null, null, null], "meta/llama-4-scout-17b-16e-instruct-maas": [25e-8, 7e-7, null, null, null, null], "vertex_ai/meta/llama3-405b-instruct-maas": [0, 0, null, null, null, null], "meta/llama3-405b-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/meta/llama3-70b-instruct-maas": [0, 0, null, null, null, null], "meta/llama3-70b-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/meta/llama3-8b-instruct-maas": [0, 0, null, null, null, null], "meta/llama3-8b-instruct-maas": [0, 0, null, null, null, null], "vertex_ai/minimaxai/minimax-m2-maas": [3e-7, 12e-7, null, 3e-8, null, null], "minimaxai/minimax-m2-maas": [3e-7, 12e-7, null, 3e-8, null, null], "vertex_ai/moonshotai/kimi-k2-thinking-maas": [6e-7, 25e-7, null, 6e-8, null, null], "moonshotai/kimi-k2-thinking-maas": [6e-7, 25e-7, null, 6e-8, null, null], "vertex_ai/zai-org/glm-4.7-maas": [6e-7, 22e-7, null, 6e-8, null, null], "zai-org/glm-4.7-maas": [6e-7, 22e-7, null, 6e-8, null, null], "vertex_ai/zai-org/glm-5-maas": [1e-6, 32e-7, null, 1e-7, null, null], "zai-org/glm-5-maas": [1e-6, 32e-7, null, 1e-7, null, null], "vertex_ai/mistral-medium-3": [4e-7, 2e-6, null, null, null, null], "vertex_ai/mistral-medium-3@001": [4e-7, 2e-6, null, null, null, null], "mistral-medium-3@001": [4e-7, 2e-6, null, null, null, null], "vertex_ai/mistralai/mistral-medium-3": [4e-7, 2e-6, null, null, null, null], "mistralai/mistral-medium-3": [4e-7, 2e-6, null, 4e-8, null, null], "vertex_ai/mistralai/mistral-medium-3@001": [4e-7, 2e-6, null, null, null, null], "mistralai/mistral-medium-3@001": [4e-7, 2e-6, null, null, null, null], "vertex_ai/mistral-large-2411": [2e-6, 6e-6, null, null, null, null], "mistral-large-2411": [2e-6, 6e-6, null, null, null, null], "vertex_ai/mistral-large@2407": [2e-6, 6e-6, null, null, null, null], "mistral-large@2407": [2e-6, 6e-6, null, null, null, null], "vertex_ai/mistral-large@2411-001": [2e-6, 6e-6, null, null, null, null], "mistral-large@2411-001": [2e-6, 6e-6, null, null, null, null], "vertex_ai/mistral-large@latest": [2e-6, 6e-6, null, null, null, null], "mistral-large@latest": [2e-6, 6e-6, null, null, null, null], "vertex_ai/mistral-nemo@2407": [3e-6, 3e-6, null, null, null, null], "mistral-nemo@2407": [3e-6, 3e-6, null, null, null, null], "vertex_ai/mistral-nemo@latest": [15e-8, 15e-8, null, null, null, null], "mistral-nemo@latest": [15e-8, 15e-8, null, null, null, null], "vertex_ai/mistral-small-2503": [1e-7, 3e-7, null, null, null, null], "vertex_ai/mistral-small-2503@001": [1e-7, 3e-7, null, null, null, null], "mistral-small-2503@001": [1e-7, 3e-7, null, null, null, null], "vertex_ai/deepseek-ai/deepseek-ocr-maas": [3e-7, 12e-7, null, null, null, null], "deepseek-ai/deepseek-ocr-maas": [3e-7, 12e-7, null, null, null, null], "vertex_ai/google/gemma-4-26b-a4b-it-maas": [15e-8, 6e-7, null, 15e-9, null, null], "google/gemma-4-26b-a4b-it-maas": [15e-8, 6e-7, null, 15e-9, null, null], "vertex_ai/openai/gpt-oss-120b-maas": [9e-8, 36e-8, null, null, null, null], "openai/gpt-oss-120b-maas": [9e-8, 36e-8, null, null, null, null], "vertex_ai/openai/gpt-oss-20b-maas": [7e-8, 25e-8, null, 7e-9, null, null], "openai/gpt-oss-20b-maas": [7e-8, 25e-8, null, 7e-9, null, null], "vertex_ai/xai/grok-4.1-fast-non-reasoning": [2e-7, 5e-7, null, 5e-8, null, null], "xai/grok-4.1-fast-non-reasoning": [2e-7, 5e-7, null, 5e-8, null, null], "vertex_ai/xai/grok-4.1-fast-reasoning": [2e-7, 5e-7, null, 5e-8, null, null], "xai/grok-4.1-fast-reasoning": [2e-7, 5e-7, null, 5e-8, null, null], "vertex_ai/xai/grok-4.20-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "vertex_ai/xai/grok-4.20-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "vertex_ai/xai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "vertex_ai/xai/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "vertex_ai/qwen/qwen3-235b-a22b-instruct-2507-maas": [22e-8, 88e-8, null, null, null, null], "qwen/qwen3-235b-a22b-instruct-2507-maas": [22e-8, 88e-8, null, null, null, null], "vertex_ai/qwen/qwen3-coder-480b-a35b-instruct-maas": [22e-8, 18e-7, null, 22e-9, null, null], "qwen/qwen3-coder-480b-a35b-instruct-maas": [22e-8, 18e-7, null, 22e-9, null, null], "vertex_ai/qwen/qwen3-next-80b-a3b-instruct-maas": [15e-8, 12e-7, null, null, null, null], "qwen/qwen3-next-80b-a3b-instruct-maas": [15e-8, 12e-7, null, null, null, null], "vertex_ai/qwen/qwen3-next-80b-a3b-thinking-maas": [15e-8, 12e-7, null, null, null, null], "qwen/qwen3-next-80b-a3b-thinking-maas": [15e-8, 12e-7, null, null, null, null], "voyage/rerank-2": [5e-8, 0, null, null, null, null], "rerank-2": [5e-8, 0, null, null, null, null], "voyage/rerank-2-lite": [2e-8, 0, null, null, null, null], "rerank-2-lite": [2e-8, 0, null, null, null, null], "voyage/rerank-2.5": [5e-8, 0, null, null, null, null], "rerank-2.5": [5e-8, 0, null, null, null, null], "voyage/rerank-2.5-lite": [2e-8, 0, null, null, null, null], "rerank-2.5-lite": [2e-8, 0, null, null, null, null], "voyage/rerank-3": [5e-8, 0, null, null, null, null], "rerank-3": [5e-8, 0, null, null, null, null], "voyage/rerank-3-lite": [2e-8, 0, null, null, null, null], "rerank-3-lite": [2e-8, 0, null, null, null, null], "voyage/voyage-2": [1e-7, 0, null, null, null, null], "voyage-2": [1e-7, 0, null, null, null, null], "voyage/voyage-3": [6e-8, 0, null, null, null, null], "voyage-3": [6e-8, 0, null, null, null, null], "voyage/voyage-multilingual-2": [12e-8, 0, null, null, null, null], "voyage-multilingual-2": [12e-8, 0, null, null, null, null], "voyage/voyage-3-large": [18e-8, 0, null, null, null, null], "voyage-3-large": [18e-8, 0, null, null, null, null], "voyage/voyage-3-lite": [2e-8, 0, null, null, null, null], "voyage-3-lite": [2e-8, 0, null, null, null, null], "voyage/voyage-3.5": [6e-8, 0, null, null, null, null], "voyage-3.5": [6e-8, 0, null, null, null, null], "voyage/voyage-3.5-lite": [2e-8, 0, null, null, null, null], "voyage-3.5-lite": [2e-8, 0, null, null, null, null], "voyage/voyage-code-2": [12e-8, 0, null, null, null, null], "voyage-code-2": [12e-8, 0, null, null, null, null], "voyage/voyage-code-3": [18e-8, 0, null, null, null, null], "voyage-code-3": [18e-8, 0, null, null, null, null], "voyage/voyage-context-3": [18e-8, 0, null, null, null, null], "voyage-context-3": [18e-8, 0, null, null, null, null], "voyage/voyage-finance-2": [12e-8, 0, null, null, null, null], "voyage-finance-2": [12e-8, 0, null, null, null, null], "voyage/voyage-large-2": [12e-8, 0, null, null, null, null], "voyage-large-2": [12e-8, 0, null, null, null, null], "voyage/voyage-law-2": [12e-8, 0, null, null, null, null], "voyage-law-2": [12e-8, 0, null, null, null, null], "voyage/voyage-lite-01": [1e-7, 0, null, null, null, null], "voyage-lite-01": [1e-7, 0, null, null, null, null], "voyage/voyage-lite-02-instruct": [1e-7, 0, null, null, null, null], "voyage-lite-02-instruct": [1e-7, 0, null, null, null, null], "voyage/voyage-multimodal-3": [12e-8, 0, null, null, null, null], "voyage-multimodal-3": [12e-8, 0, null, null, null, null], "wandb/openai/gpt-oss-120b": [3e-8, 17e-8, null, null, null, null], "wandb/openai/gpt-oss-20b": [3e-8, 13e-8, null, null, null, null], "wandb/moonshotai/Kimi-K2.5": [6e-7, 3e-6, null, 1e-7, null, null], "wandb/meta-llama/Llama-3.1-8B-Instruct": [22e-8, 22e-8, null, null, null, null], "wandb/deepseek-ai/DeepSeek-V3.1": [55e-8, 165e-8, null, null, null, null], "wandb/meta-llama/Llama-3.3-70B-Instruct": [71e-8, 71e-8, null, null, null, null], "watsonx/ibm/granite-3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "ibm/granite-3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "watsonx/mistralai/mistral-large": [3e-6, 1e-5, null, null, null, null], "watsonx/bigscience/mt0-xxl-13b": [1908e-9, 1908e-9, null, null, null, null], "bigscience/mt0-xxl-13b": [1908e-9, 1908e-9, null, null, null, null], "watsonx/bigscience/mt0-xxl": [1908e-9, 1908e-9, null, null, null, null], "bigscience/mt0-xxl": [1908e-9, 1908e-9, null, null, null, null], "watsonx/core42/jais-13b-chat": [5e-4, 2e-3, null, null, null, null], "core42/jais-13b-chat": [5e-4, 2e-3, null, null, null, null], "watsonx/google/flan-t5-xl-3b": [6e-7, 6e-7, null, null, null, null], "google/flan-t5-xl-3b": [6e-7, 6e-7, null, null, null, null], "watsonx/ibm/granite-13b-chat-v2": [6e-7, 6e-7, null, null, null, null], "ibm/granite-13b-chat-v2": [6e-7, 6e-7, null, null, null, null], "watsonx/ibm/granite-13b-instruct-v2": [6e-7, 6e-7, null, null, null, null], "ibm/granite-13b-instruct-v2": [6e-7, 6e-7, null, null, null, null], "watsonx/ibm/granite-3-3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "ibm/granite-3-3-8b-instruct": [2e-7, 2e-7, null, null, null, null], "watsonx/ibm/granite-4-h-small": [636e-10, 265e-9, null, null, null, null], "ibm/granite-4-h-small": [636e-10, 265e-9, null, null, null, null], "watsonx/ibm/granite-guardian-3-2-2b": [1e-7, 1e-7, null, null, null, null], "ibm/granite-guardian-3-2-2b": [1e-7, 1e-7, null, null, null, null], "watsonx/ibm/granite-guardian-3-3-8b": [2e-7, 2e-7, null, null, null, null], "ibm/granite-guardian-3-3-8b": [2e-7, 2e-7, null, null, null, null], "watsonx/ibm/granite-ttm-1024-96-r2": [38e-8, 38e-8, null, null, null, null], "ibm/granite-ttm-1024-96-r2": [38e-8, 38e-8, null, null, null, null], "watsonx/ibm/granite-ttm-1536-96-r2": [38e-8, 38e-8, null, null, null, null], "ibm/granite-ttm-1536-96-r2": [38e-8, 38e-8, null, null, null, null], "watsonx/ibm/granite-ttm-512-96-r2": [38e-8, 38e-8, null, null, null, null], "ibm/granite-ttm-512-96-r2": [38e-8, 38e-8, null, null, null, null], "watsonx/ibm/granite-vision-3-2-2b": [1e-7, 1e-7, null, null, null, null], "ibm/granite-vision-3-2-2b": [1e-7, 1e-7, null, null, null, null], "watsonx/meta-llama/llama-3-2-11b-vision-instruct": [35e-8, 35e-8, null, null, null, null], "meta-llama/llama-3-2-11b-vision-instruct": [35e-8, 35e-8, null, null, null, null], "watsonx/meta-llama/llama-3-2-1b-instruct": [1e-7, 1e-7, null, null, null, null], "meta-llama/llama-3-2-1b-instruct": [1e-7, 1e-7, null, null, null, null], "watsonx/meta-llama/llama-3-2-3b-instruct": [15e-8, 15e-8, null, null, null, null], "meta-llama/llama-3-2-3b-instruct": [15e-8, 15e-8, null, null, null, null], "watsonx/meta-llama/llama-3-2-90b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "meta-llama/llama-3-2-90b-vision-instruct": [2e-6, 2e-6, null, null, null, null], "watsonx/meta-llama/llama-3-3-70b-instruct": [7526e-10, 7526e-10, null, null, null, null], "meta-llama/llama-3-3-70b-instruct": [7526e-10, 7526e-10, null, null, null, null], "watsonx/meta-llama/llama-4-maverick-17b": [371e-9, 1484e-9, null, null, null, null], "meta-llama/llama-4-maverick-17b": [371e-9, 1484e-9, null, null, null, null], "watsonx/meta-llama/llama-4-maverick-17b-128e-instruct-fp8": [371e-9, 1484e-9, null, null, null, null], "meta-llama/llama-4-maverick-17b-128e-instruct-fp8": [371e-9, 1484e-9, null, null, null, null], "watsonx/meta-llama/llama-guard-3-11b-vision": [35e-8, 35e-8, null, null, null, null], "meta-llama/llama-guard-3-11b-vision": [35e-8, 35e-8, null, null, null, null], "watsonx/mistralai/mistral-medium-2505": [3e-6, 1e-5, null, null, null, null], "mistralai/mistral-medium-2505": [3e-6, 1e-5, null, null, null, null], "watsonx/mistralai/mistral-small-2503": [1e-7, 3e-7, null, null, null, null], "mistralai/mistral-small-2503": [1e-7, 3e-7, null, null, null, null], "watsonx/mistralai/mistral-small-3-1-24b-instruct-2503": [106e-9, 318e-9, null, null, null, null], "mistralai/mistral-small-3-1-24b-instruct-2503": [106e-9, 318e-9, null, null, null, null], "watsonx/mistralai/pixtral-12b-2409": [35e-8, 35e-8, null, null, null, null], "mistralai/pixtral-12b-2409": [35e-8, 35e-8, null, null, null, null], "watsonx/openai/gpt-oss-120b": [159e-9, 636e-9, null, null, null, null], "watsonx/sdaia/allam-1-13b-instruct": [18e-7, 18e-7, null, null, null, null], "sdaia/allam-1-13b-instruct": [18e-7, 18e-7, null, null, null, null], "xai/grok-4.20-multi-agent-beta-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-beta-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-0309-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-0309-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-0309-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-0309-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-0309-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-0309-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.3-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.3-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.5": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "grok-4.5": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "xai/grok-4.5-latest": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "grok-4.5-latest": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "xai/grok-build-latest": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "grok-build-latest": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "xai/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "xai/grok-4.7": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "grok-4.7": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "zai/glm-5": [1e-6, 32e-7, 0, 2e-7, null, null], "glm-5": [1e-6, 32e-7, 0, 2e-7, null, null], "zai/glm-5.3": [14e-7, 44e-7, 0, 26e-8, null, null], "glm-5.3": [14e-7, 44e-7, 0, 26e-8, null, null], "zai/glm-5.3-flash": [15e-8, 5e-7, 0, 3e-8, null, null], "glm-5.3-flash": [15e-8, 5e-7, 0, 3e-8, null, null], "zai/glm-5.1": [14e-7, 44e-7, 0, 26e-8, null, null], "zai/glm-5-code": [12e-7, 5e-6, 0, 3e-7, null, null], "glm-5-code": [12e-7, 5e-6, 0, 3e-7, null, null], "zai/glm-4.7": [6e-7, 22e-7, 0, 11e-8, null, null], "glm-4.7": [6e-7, 22e-7, 0, 11e-8, null, null], "zai/glm-4.7-flash": [0, 0, 0, 0, null, null], "glm-4.7-flash": [0, 0, 0, 0, null, null], "zai/glm-4.6": [6e-7, 22e-7, 0, 11e-8, null, null], "glm-4.6": [6e-7, 22e-7, 0, 11e-8, null, null], "zai/glm-4.5": [6e-7, 22e-7, null, null, null, null], "glm-4.5": [6e-7, 22e-7, null, null, null, null], "zai/glm-4.5v": [6e-7, 18e-7, null, null, null, null], "glm-4.5v": [6e-7, 18e-7, null, null, null, null], "zai/glm-4.5-x": [22e-7, 89e-7, null, null, null, null], "glm-4.5-x": [22e-7, 89e-7, null, null, null, null], "zai/glm-4.5-air": [2e-7, 11e-7, null, null, null, null], "glm-4.5-air": [2e-7, 11e-7, null, null, null, null], "zai/glm-4.5-airx": [11e-7, 45e-7, null, null, null, null], "glm-4.5-airx": [11e-7, 45e-7, null, null, null, null], "zai/glm-4-32b-0414-128k": [1e-7, 1e-7, null, null, null, null], "glm-4-32b-0414-128k": [1e-7, 1e-7, null, null, null, null], "zai/glm-4.5-flash": [0, 0, null, null, null, null], "glm-4.5-flash": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": [45e-8, 18e-7, null, null, null, null], "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct": [45e-8, 18e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-kontext-pro": [4e-8, 4e-8, null, null, null, null], "accounts/fireworks/models/flux-kontext-pro": [4e-8, 4e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/SSD-1B": [13e-11, 13e-11, null, null, null, null], "accounts/fireworks/models/SSD-1B": [13e-11, 13e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/chronos-hermes-13b-v2": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/chronos-hermes-13b-v2": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-13b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-13b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-13b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-13b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-13b-python": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-13b-python": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-34b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-34b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-34b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-34b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-34b-python": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-34b-python": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-70b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-70b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-70b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-70b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-70b-python": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/code-llama-70b-python": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-llama-7b-python": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-llama-7b-python": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/code-qwen-1p5-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/code-qwen-1p5-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/codegemma-2b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/codegemma-2b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/codegemma-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/codegemma-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-671b-v2-p1": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/cogito-671b-v2-p1": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-v1-preview-llama-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/cogito-v1-preview-llama-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-v1-preview-llama-70b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/cogito-v1-preview-llama-70b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-v1-preview-llama-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/cogito-v1-preview-llama-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-v1-preview-qwen-14b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/cogito-v1-preview-qwen-14b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/cogito-v1-preview-qwen-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/cogito-v1-preview-qwen-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-kontext-max": [8e-8, 8e-8, null, null, null, null], "accounts/fireworks/models/flux-kontext-max": [8e-8, 8e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/dbrx-instruct": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/dbrx-instruct": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-1b-base": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-1b-base": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-33b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-33b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-7b-base": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-7b-base": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-7b-base-v1p5": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-7b-base-v1p5": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-7b-instruct-v1p5": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-7b-instruct-v1p5": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-lite-base": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-v2-lite-base": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-lite-instruct": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/deepseek-coder-v2-lite-instruct": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-prover-v2": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/deepseek-prover-v2": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-0528-distill-qwen3-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-0528-distill-qwen3-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-llama-70b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-llama-70b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-llama-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-llama-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-qwen-14b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-qwen-14b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-qwen-1p5b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-qwen-1p5b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-qwen-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-qwen-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-r1-distill-qwen-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/deepseek-r1-distill-qwen-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v2-lite-chat": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/deepseek-v2-lite-chat": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v2p5": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/deepseek-v2p5": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/devstral-small-2505": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/devstral-small-2505": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/dobby-mini-unhinged-plus-llama-3-1-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/dobby-mini-unhinged-plus-llama-3-1-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/dobby-unhinged-llama-3-3-70b-new": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/dobby-unhinged-llama-3-3-70b-new": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/dolphin-2-9-2-qwen2-72b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/dolphin-2-9-2-qwen2-72b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/dolphin-2p6-mixtral-8x7b": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/dolphin-2p6-mixtral-8x7b": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/ernie-4p5-21b-a3b-pt": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/ernie-4p5-21b-a3b-pt": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/ernie-4p5-300b-a47b-pt": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/ernie-4p5-300b-a47b-pt": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/fare-20b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/fare-20b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/firefunction-v1": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/firefunction-v1": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/firellava-13b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/firellava-13b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/firesearch-ocr-v6": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/firesearch-ocr-v6": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/fireworks-asr-large": [0, 0, null, null, null, null], "accounts/fireworks/models/fireworks-asr-large": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/fireworks-asr-v2": [0, 0, null, null, null, null], "accounts/fireworks/models/fireworks-asr-v2": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-1-dev": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/flux-1-dev": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-1-dev-controlnet-union": [1e-9, 1e-9, null, null, null, null], "accounts/fireworks/models/flux-1-dev-controlnet-union": [1e-9, 1e-9, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-1-dev-fp8": [5e-10, 5e-10, null, null, null, null], "accounts/fireworks/models/flux-1-dev-fp8": [5e-10, 5e-10, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-1-schnell": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/flux-1-schnell": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/flux-1-schnell-fp8": [35e-11, 35e-11, null, null, null, null], "accounts/fireworks/models/flux-1-schnell-fp8": [35e-11, 35e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gemma-2b-it": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/gemma-2b-it": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gemma-3-27b-it": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/gemma-3-27b-it": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gemma-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/gemma-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gemma-7b-it": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/gemma-7b-it": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gemma2-9b-it": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/gemma2-9b-it": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-4p5v": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/glm-4p5v": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gpt-oss-safeguard-120b": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/gpt-oss-safeguard-120b": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/gpt-oss-safeguard-20b": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/gpt-oss-safeguard-20b": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/hermes-2-pro-mistral-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/hermes-2-pro-mistral-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/internvl3-38b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/internvl3-38b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/internvl3-78b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/internvl3-78b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/internvl3-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/internvl3-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/japanese-stable-diffusion-xl": [13e-11, 13e-11, null, null, null, null], "accounts/fireworks/models/japanese-stable-diffusion-xl": [13e-11, 13e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kat-coder": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/kat-coder": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kat-dev-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/kat-dev-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/kat-dev-72b-exp": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/kat-dev-72b-exp": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-guard-2-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-guard-2-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-guard-3-1b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-guard-3-1b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-guard-3-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-guard-3-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-13b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-13b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-13b-chat": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-13b-chat": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-70b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-70b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-70b-chat": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-70b-chat": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v2-7b-chat": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v2-7b-chat": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3-70b-instruct-hf": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3-70b-instruct-hf": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v3-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3-8b-instruct-hf": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llama-v3-8b-instruct-hf": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-405b-instruct-long": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p1-405b-instruct-long": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-70b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p1-70b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-70b-instruct-1b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p1-70b-instruct-1b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p1-nemotron-70b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p1-nemotron-70b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-1b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-1b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p2-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p2-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llama-v3p3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llama-v3p3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llamaguard-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/llamaguard-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/llava-yi-34b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/llava-yi-34b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/minimax-m1-80k": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/minimax-m1-80k": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/minimax-m2": [3e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/minimax-m2": [3e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/ministral-3-14b-instruct-2512": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/ministral-3-14b-instruct-2512": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/ministral-3-3b-instruct-2512": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/ministral-3-3b-instruct-2512": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/ministral-3-8b-instruct-2512": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/ministral-3-8b-instruct-2512": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-7b-instruct-4k": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-7b-instruct-4k": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-7b-instruct-v0p2": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-7b-instruct-v0p2": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-7b-instruct-v3": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-7b-instruct-v3": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-7b-v0p2": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-7b-v0p2": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-large-3-fp8": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/mistral-large-3-fp8": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-nemo-base-2407": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-nemo-base-2407": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-nemo-instruct-2407": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mistral-nemo-instruct-2407": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mistral-small-24b-instruct-2501": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/mistral-small-24b-instruct-2501": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x22b": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x22b": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x22b-instruct": [12e-7, 12e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x22b-instruct": [12e-7, 12e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x7b": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x7b": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x7b-instruct": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x7b-instruct": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mixtral-8x7b-instruct-hf": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/mixtral-8x7b-instruct-hf": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/mythomax-l2-13b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/mythomax-l2-13b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nemotron-nano-v2-12b-vl": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/nemotron-nano-v2-12b-vl": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-capybara-7b-v1p9": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/nous-capybara-7b-v1p9": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-hermes-2-mixtral-8x7b-dpo": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/nous-hermes-2-mixtral-8x7b-dpo": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-hermes-2-yi-34b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/nous-hermes-2-yi-34b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-hermes-llama2-13b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/nous-hermes-llama2-13b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-hermes-llama2-70b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/nous-hermes-llama2-70b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nous-hermes-llama2-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/nous-hermes-llama2-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nvidia-nemotron-nano-12b-v2": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/nvidia-nemotron-nano-12b-v2": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/nvidia-nemotron-nano-9b-v2": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/nvidia-nemotron-nano-9b-v2": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/openchat-3p5-0106-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/openchat-3p5-0106-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/openhermes-2-mistral-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/openhermes-2-mistral-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/openhermes-2p5-mistral-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/openhermes-2p5-mistral-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/openorca-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/openorca-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phi-2-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/phi-2-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phi-3-mini-128k-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/phi-3-mini-128k-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phi-3-vision-128k-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/phi-3-vision-128k-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phind-code-llama-34b-python-v1": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/phind-code-llama-34b-python-v1": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phind-code-llama-34b-v1": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/phind-code-llama-34b-v1": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/phind-code-llama-34b-v2": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/phind-code-llama-34b-v2": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/playground-v2-1024px-aesthetic": [13e-11, 13e-11, null, null, null, null], "accounts/fireworks/models/playground-v2-1024px-aesthetic": [13e-11, 13e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/playground-v2-5-1024px-aesthetic": [13e-11, 13e-11, null, null, null, null], "accounts/fireworks/models/playground-v2-5-1024px-aesthetic": [13e-11, 13e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/pythia-12b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/pythia-12b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen-qwq-32b-preview": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen-qwq-32b-preview": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen-v2p5-14b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen-v2p5-14b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen-v2p5-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen-v2p5-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen1p5-72b-chat": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen1p5-72b-chat": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2-vl-2b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2-vl-2b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2-vl-72b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2-vl-72b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2-vl-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2-vl-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-0p5b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-0p5b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-14b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-14b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-1p5b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-1p5b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-32b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-32b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-72b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-72b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-72b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-72b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-0p5b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-0p5b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-0p5b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-0p5b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-14b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-14b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-14b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-14b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-1p5b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-1p5b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-1p5b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-1p5b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct-128k": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-32b-instruct-128k": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct-32k-rope": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-32b-instruct-32k-rope": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct-64k": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-32b-instruct-64k": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-3b-instruct": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-3b-instruct": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-coder-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-coder-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-math-72b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-math-72b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-vl-32b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-vl-32b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-vl-3b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-vl-3b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-vl-72b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-vl-72b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen2p5-vl-7b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen2p5-vl-7b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-0p6b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen3-0p6b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-14b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen3-14b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-1p7b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen3-1p7b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-1p7b-fp8-draft": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen3-1p7b-fp8-draft": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-1p7b-fp8-draft-131072": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen3-1p7b-fp8-draft-131072": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-1p7b-fp8-draft-40960": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/qwen3-1p7b-fp8-draft-40960": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-235b-a22b": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/qwen3-235b-a22b": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-235b-a22b-thinking-2507": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/qwen3-235b-a22b-thinking-2507": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-30b-a3b": [15e-8, 6e-7, null, null, null, null], "accounts/fireworks/models/qwen3-30b-a3b": [15e-8, 6e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-30b-a3b-instruct-2507": [5e-7, 5e-7, null, null, null, null], "accounts/fireworks/models/qwen3-30b-a3b-instruct-2507": [5e-7, 5e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-30b-a3b-thinking-2507": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-30b-a3b-thinking-2507": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-4b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen3-4b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-4b-instruct-2507": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen3-4b-instruct-2507": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-8b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen3-8b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-coder-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "accounts/fireworks/models/qwen3-coder-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-coder-480b-instruct-bf16": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-coder-480b-instruct-bf16": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-embedding-0p6b": [0, 0, null, null, null, null], "accounts/fireworks/models/qwen3-embedding-0p6b": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-embedding-4b": [0, 0, null, null, null, null], "accounts/fireworks/models/qwen3-embedding-4b": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/": [1e-7, 0, null, null, null, null], "accounts/fireworks/models/": [1e-7, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-next-80b-a3b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-next-80b-a3b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-next-80b-a3b-thinking": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-next-80b-a3b-thinking": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-reranker-0p6b": [0, 0, null, null, null, null], "accounts/fireworks/models/qwen3-reranker-0p6b": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-reranker-4b": [0, 0, null, null, null, null], "accounts/fireworks/models/qwen3-reranker-4b": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-reranker-8b": [2e-7, 0, null, null, null, null], "accounts/fireworks/models/qwen3-reranker-8b": [2e-7, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-235b-a22b-instruct": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/qwen3-vl-235b-a22b-instruct": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-235b-a22b-thinking": [22e-8, 88e-8, null, null, null, null], "accounts/fireworks/models/qwen3-vl-235b-a22b-thinking": [22e-8, 88e-8, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "accounts/fireworks/models/qwen3-vl-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-30b-a3b-thinking": [15e-8, 6e-7, null, null, null, null], "accounts/fireworks/models/qwen3-vl-30b-a3b-thinking": [15e-8, 6e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-32b-instruct": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwen3-vl-32b-instruct": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3-vl-8b-instruct": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/qwen3-vl-8b-instruct": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/qwen3p7-plus": [4e-7, 16e-7, null, 8e-8, null, null], "accounts/fireworks/models/qwen3p7-plus": [4e-7, 16e-7, null, 8e-8, null, null], "fireworks_ai/accounts/fireworks/models/qwq-32b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/qwq-32b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/rolm-ocr": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/rolm-ocr": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/snorkel-mistral-7b-pairrm-dpo": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/snorkel-mistral-7b-pairrm-dpo": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/stable-diffusion-xl-1024-v1-0": [13e-11, 13e-11, null, null, null, null], "accounts/fireworks/models/stable-diffusion-xl-1024-v1-0": [13e-11, 13e-11, null, null, null, null], "fireworks_ai/accounts/fireworks/models/stablecode-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/stablecode-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/starcoder-16b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/starcoder-16b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/starcoder-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/starcoder-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/starcoder2-15b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/starcoder2-15b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/starcoder2-3b": [1e-7, 1e-7, null, null, null, null], "accounts/fireworks/models/starcoder2-3b": [1e-7, 1e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/starcoder2-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/starcoder2-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/toppy-m-7b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/toppy-m-7b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/yi-34b": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/yi-34b": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/yi-34b-200k-capybara": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/yi-34b-200k-capybara": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/yi-34b-chat": [9e-7, 9e-7, null, null, null, null], "accounts/fireworks/models/yi-34b-chat": [9e-7, 9e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/yi-6b": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/yi-6b": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/zephyr-7b-beta": [2e-7, 2e-7, null, null, null, null], "accounts/fireworks/models/zephyr-7b-beta": [2e-7, 2e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/routers/glm-5p1-fast": [28e-7, 88e-7, null, 52e-8, null, null], "accounts/fireworks/routers/glm-5p1-fast": [28e-7, 88e-7, null, 52e-8, null, null], "fireworks_ai/accounts/fireworks/routers/kimi-k2p6-fast": [2e-6, 8e-6, null, 3e-7, null, null], "accounts/fireworks/routers/kimi-k2p6-fast": [2e-6, 8e-6, null, 3e-7, null, null], "fireworks_ai/accounts/fireworks/routers/kimi-k2p7-code-fast": [19e-7, 8e-6, null, 38e-8, null, null], "accounts/fireworks/routers/kimi-k2p7-code-fast": [19e-7, 8e-6, null, 38e-8, null, null], "scaleway/qwen/qwen3.5-397b-a17b": [6e-7, 36e-7, null, null, null, null], "scaleway/qwen/qwen3.6-35b-a3b": [25e-8, 15e-7, null, null, null, null], "qwen/qwen3.6-35b-a3b": [25e-8, 15e-7, null, null, null, null], "scaleway/qwen/qwen3-235b-a22b-instruct-2507": [75e-8, 225e-8, null, null, null, null], "scaleway/qwen/qwen3-embedding-8b": [1e-7, 0, null, null, null, null], "qwen/qwen3-embedding-8b": [1e-7, 0, null, null, null, null], "scaleway/qwen/qwen3-coder-30b-a3b-instruct": [2e-7, 8e-7, null, null, null, null], "qwen/qwen3-coder-30b-a3b-instruct": [2e-7, 8e-7, null, null, null, null], "scaleway/openai/gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "scaleway/google/gemma-4-26b-a4b-it": [25e-8, 5e-7, null, null, null, null], "google/gemma-4-26b-a4b-it": [25e-8, 5e-7, null, null, null, null], "scaleway/mistralai/mistral-medium-3.5-128b": [15e-7, 75e-7, null, null, null, null], "mistralai/mistral-medium-3.5-128b": [15e-7, 75e-7, null, null, null, null], "scaleway/mistralai/mistral-small-3.2-24b-instruct-2506": [15e-8, 35e-8, null, null, null, null], "mistralai/mistral-small-3.2-24b-instruct-2506": [15e-8, 35e-8, null, null, null, null], "scaleway/mistralai/pixtral-12b-2409": [2e-7, 2e-7, null, null, null, null], "scaleway/BAAI/bge-multilingual-gemma2": [1e-7, 0, null, null, null, null], "scaleway/meta/llama-3.3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "meta/llama-3.3-70b-instruct": [9e-7, 9e-7, null, null, null, null], "novita/deepseek/deepseek-v3.2": [269e-9, 4e-7, null, 1345e-10, null, null], "novita/minimax/minimax-m2.1": [3e-7, 12e-7, null, 3e-8, null, null], "novita/zai-org/glm-4.7": [6e-7, 22e-7, null, 11e-8, null, null], "zai-org/glm-4.7": [6e-7, 22e-7, null, 11e-8, null, null], "novita/xiaomimimo/mimo-v2-flash": [11e-8, 33e-8, null, 24e-9, null, null], "xiaomimimo/mimo-v2-flash": [11e-8, 33e-8, null, 24e-9, null, null], "novita/zai-org/autoglm-phone-9b-multilingual": [35e-9, 138e-9, null, null, null, null], "zai-org/autoglm-phone-9b-multilingual": [35e-9, 138e-9, null, null, null, null], "novita/moonshotai/kimi-k2-thinking": [6e-7, 25e-7, null, 15e-8, null, null], "moonshotai/kimi-k2-thinking": [6e-7, 25e-7, null, 15e-8, null, null], "novita/minimax/minimax-m2": [3e-7, 12e-7, null, 3e-8, null, null], "novita/paddlepaddle/paddleocr-vl": [2e-8, 2e-8, null, null, null, null], "paddlepaddle/paddleocr-vl": [2e-8, 2e-8, null, null, null, null], "novita/deepseek/deepseek-v3.2-exp": [27e-8, 41e-8, null, null, null, null], "novita/qwen/qwen3-vl-235b-a22b-thinking": [98e-8, 395e-8, null, null, null, null], "qwen/qwen3-vl-235b-a22b-thinking": [98e-8, 395e-8, null, null, null, null], "novita/zai-org/glm-4.6v": [3e-7, 9e-7, null, 55e-9, null, null], "zai-org/glm-4.6v": [3e-7, 9e-7, null, 55e-9, null, null], "novita/zai-org/glm-4.6": [55e-8, 22e-7, null, 11e-8, null, null], "zai-org/glm-4.6": [55e-8, 22e-7, null, 11e-8, null, null], "novita/kwaipilot/kat-coder-pro": [3e-7, 12e-7, null, 6e-8, null, null], "kwaipilot/kat-coder-pro": [3e-7, 12e-7, null, 6e-8, null, null], "novita/qwen/qwen3-next-80b-a3b-instruct": [15e-8, 15e-7, null, null, null, null], "qwen/qwen3-next-80b-a3b-instruct": [15e-8, 15e-7, null, null, null, null], "novita/qwen/qwen3-next-80b-a3b-thinking": [15e-8, 15e-7, null, null, null, null], "qwen/qwen3-next-80b-a3b-thinking": [15e-8, 15e-7, null, null, null, null], "novita/deepseek/deepseek-ocr": [3e-8, 3e-8, null, null, null, null], "deepseek/deepseek-ocr": [3e-8, 3e-8, null, null, null, null], "novita/deepseek/deepseek-v3.1-terminus": [27e-8, 1e-6, null, 135e-9, null, null], "deepseek/deepseek-v3.1-terminus": [27e-8, 1e-6, null, 135e-9, null, null], "novita/qwen/qwen3-vl-235b-a22b-instruct": [3e-7, 15e-7, null, null, null, null], "qwen/qwen3-vl-235b-a22b-instruct": [3e-7, 15e-7, null, null, null, null], "novita/qwen/qwen3-max": [211e-8, 845e-8, null, null, null, null], "qwen/qwen3-max": [211e-8, 845e-8, null, null, null, null], "novita/skywork/r1v4-lite": [2e-7, 6e-7, null, null, null, null], "skywork/r1v4-lite": [2e-7, 6e-7, null, null, null, null], "novita/deepseek/deepseek-v3.1": [27e-8, 1e-6, null, 135e-9, null, null], "deepseek/deepseek-v3.1": [27e-8, 1e-6, null, 135e-9, null, null], "novita/moonshotai/kimi-k2-0905": [6e-7, 25e-7, null, null, null, null], "moonshotai/kimi-k2-0905": [6e-7, 25e-7, null, null, null, null], "novita/qwen/qwen3-coder-480b-a35b-instruct": [38e-8, 155e-8, null, null, null, null], "qwen/qwen3-coder-480b-a35b-instruct": [38e-8, 155e-8, null, null, null, null], "novita/qwen/qwen3-coder-30b-a3b-instruct": [7e-8, 27e-8, null, null, null, null], "novita/openai/gpt-oss-120b": [5e-8, 25e-8, null, null, null, null], "novita/moonshotai/kimi-k2-instruct": [57e-8, 23e-7, null, null, null, null], "moonshotai/kimi-k2-instruct": [57e-8, 23e-7, null, null, null, null], "novita/deepseek/deepseek-v3-0324": [27e-8, 112e-8, null, 135e-9, null, null], "deepseek/deepseek-v3-0324": [27e-8, 112e-8, null, 135e-9, null, null], "novita/zai-org/glm-4.5": [6e-7, 22e-7, null, 11e-8, null, null], "zai-org/glm-4.5": [6e-7, 22e-7, null, 11e-8, null, null], "novita/qwen/qwen3-235b-a22b-thinking-2507": [3e-7, 3e-6, null, null, null, null], "novita/meta-llama/llama-3.1-8b-instruct": [2e-8, 5e-8, null, null, null, null], "meta-llama/llama-3.1-8b-instruct": [2e-8, 5e-8, null, null, null, null], "novita/google/gemma-3-12b-it": [5e-8, 1e-7, null, null, null, null], "novita/zai-org/glm-4.5v": [6e-7, 18e-7, null, 11e-8, null, null], "zai-org/glm-4.5v": [6e-7, 18e-7, null, 11e-8, null, null], "novita/openai/gpt-oss-20b": [4e-8, 15e-8, null, null, null, null], "novita/qwen/qwen3-235b-a22b-instruct-2507": [9e-8, 58e-8, null, null, null, null], "novita/deepseek/deepseek-r1-distill-qwen-14b": [15e-8, 15e-8, null, null, null, null], "deepseek/deepseek-r1-distill-qwen-14b": [15e-8, 15e-8, null, null, null, null], "novita/meta-llama/llama-3.3-70b-instruct": [135e-9, 4e-7, null, null, null, null], "meta-llama/llama-3.3-70b-instruct": [135e-9, 4e-7, null, null, null, null], "novita/qwen/qwen-2.5-72b-instruct": [38e-8, 4e-7, null, null, null, null], "qwen/qwen-2.5-72b-instruct": [38e-8, 4e-7, null, null, null, null], "novita/mistralai/mistral-nemo": [4e-8, 17e-8, null, null, null, null], "mistralai/mistral-nemo": [4e-8, 17e-8, null, null, null, null], "novita/minimaxai/minimax-m1-80k": [55e-8, 22e-7, null, null, null, null], "minimaxai/minimax-m1-80k": [55e-8, 22e-7, null, null, null, null], "novita/deepseek/deepseek-r1-0528": [7e-7, 25e-7, null, 35e-8, null, null], "novita/deepseek/deepseek-r1-distill-qwen-32b": [3e-7, 3e-7, null, null, null, null], "deepseek/deepseek-r1-distill-qwen-32b": [3e-7, 3e-7, null, null, null, null], "novita/meta-llama/llama-3-8b-instruct": [4e-8, 4e-8, null, null, null, null], "meta-llama/llama-3-8b-instruct": [4e-8, 4e-8, null, null, null, null], "novita/microsoft/wizardlm-2-8x22b": [62e-8, 62e-8, null, null, null, null], "microsoft/wizardlm-2-8x22b": [62e-8, 62e-8, null, null, null, null], "novita/deepseek/deepseek-r1-0528-qwen3-8b": [6e-8, 9e-8, null, null, null, null], "deepseek/deepseek-r1-0528-qwen3-8b": [6e-8, 9e-8, null, null, null, null], "novita/deepseek/deepseek-r1-distill-llama-70b": [8e-7, 8e-7, null, null, null, null], "novita/meta-llama/llama-3-70b-instruct": [51e-8, 74e-8, null, null, null, null], "novita/qwen/qwen3-235b-a22b-fp8": [2e-7, 8e-7, null, null, null, null], "qwen/qwen3-235b-a22b-fp8": [2e-7, 8e-7, null, null, null, null], "novita/meta-llama/llama-4-maverick-17b-128e-instruct-fp8": [27e-8, 85e-8, null, null, null, null], "novita/meta-llama/llama-4-scout-17b-16e-instruct": [18e-8, 59e-8, null, null, null, null], "meta-llama/llama-4-scout-17b-16e-instruct": [18e-8, 59e-8, null, null, null, null], "novita/nousresearch/hermes-2-pro-llama-3-8b": [14e-8, 14e-8, null, null, null, null], "nousresearch/hermes-2-pro-llama-3-8b": [14e-8, 14e-8, null, null, null, null], "novita/qwen/qwen2.5-vl-72b-instruct": [8e-7, 8e-7, null, null, null, null], "qwen/qwen2.5-vl-72b-instruct": [8e-7, 8e-7, null, null, null, null], "novita/sao10k/l3-70b-euryale-v2.1": [148e-8, 148e-8, null, null, null, null], "sao10k/l3-70b-euryale-v2.1": [148e-8, 148e-8, null, null, null, null], "novita/baidu/ernie-4.5-21B-a3b-thinking": [7e-8, 28e-8, null, null, null, null], "baidu/ernie-4.5-21B-a3b-thinking": [7e-8, 28e-8, null, null, null, null], "novita/sao10k/l3-8b-lunaris": [5e-8, 5e-8, null, null, null, null], "sao10k/l3-8b-lunaris": [5e-8, 5e-8, null, null, null, null], "novita/baichuan/baichuan-m2-32b": [7e-8, 7e-8, null, null, null, null], "baichuan/baichuan-m2-32b": [7e-8, 7e-8, null, null, null, null], "novita/baidu/ernie-4.5-vl-424b-a47b": [42e-8, 125e-8, null, null, null, null], "baidu/ernie-4.5-vl-424b-a47b": [42e-8, 125e-8, null, null, null, null], "novita/baidu/ernie-4.5-300b-a47b-paddle": [28e-8, 11e-7, null, null, null, null], "baidu/ernie-4.5-300b-a47b-paddle": [28e-8, 11e-7, null, null, null, null], "novita/deepseek/deepseek-prover-v2-671b": [7e-7, 25e-7, null, null, null, null], "deepseek/deepseek-prover-v2-671b": [7e-7, 25e-7, null, null, null, null], "novita/qwen/qwen3-32b-fp8": [1e-7, 45e-8, null, null, null, null], "qwen/qwen3-32b-fp8": [1e-7, 45e-8, null, null, null, null], "novita/qwen/qwen3-30b-a3b-fp8": [9e-8, 45e-8, null, null, null, null], "qwen/qwen3-30b-a3b-fp8": [9e-8, 45e-8, null, null, null, null], "novita/google/gemma-3-27b-it": [119e-9, 2e-7, null, null, null, null], "novita/deepseek/deepseek-v3-turbo": [4e-7, 13e-7, null, null, null, null], "deepseek/deepseek-v3-turbo": [4e-7, 13e-7, null, null, null, null], "novita/deepseek/deepseek-r1-turbo": [7e-7, 25e-7, null, null, null, null], "deepseek/deepseek-r1-turbo": [7e-7, 25e-7, null, null, null, null], "novita/Sao10K/L3-8B-Stheno-v3.2": [5e-8, 5e-8, null, null, null, null], "Sao10K/L3-8B-Stheno-v3.2": [5e-8, 5e-8, null, null, null, null], "novita/gryphe/mythomax-l2-13b": [9e-8, 9e-8, null, null, null, null], "novita/baidu/ernie-4.5-vl-28b-a3b-thinking": [39e-8, 39e-8, null, null, null, null], "baidu/ernie-4.5-vl-28b-a3b-thinking": [39e-8, 39e-8, null, null, null, null], "novita/qwen/qwen3-vl-8b-instruct": [8e-8, 5e-7, null, null, null, null], "qwen/qwen3-vl-8b-instruct": [8e-8, 5e-7, null, null, null, null], "novita/zai-org/glm-4.5-air": [13e-8, 85e-8, null, 25e-9, null, null], "zai-org/glm-4.5-air": [13e-8, 85e-8, null, 25e-9, null, null], "novita/qwen/qwen3-vl-30b-a3b-instruct": [2e-7, 7e-7, null, null, null, null], "qwen/qwen3-vl-30b-a3b-instruct": [2e-7, 7e-7, null, null, null, null], "novita/qwen/qwen3-vl-30b-a3b-thinking": [2e-7, 1e-6, null, null, null, null], "qwen/qwen3-vl-30b-a3b-thinking": [2e-7, 1e-6, null, null, null, null], "novita/qwen/qwen3-omni-30b-a3b-thinking": [25e-8, 97e-8, null, null, null, null], "qwen/qwen3-omni-30b-a3b-thinking": [25e-8, 97e-8, null, null, null, null], "novita/qwen/qwen3-omni-30b-a3b-instruct": [25e-8, 97e-8, null, null, null, null], "qwen/qwen3-omni-30b-a3b-instruct": [25e-8, 97e-8, null, null, null, null], "novita/qwen/qwen-mt-plus": [25e-8, 75e-8, null, null, null, null], "qwen/qwen-mt-plus": [25e-8, 75e-8, null, null, null, null], "novita/baidu/ernie-4.5-vl-28b-a3b": [14e-8, 56e-8, null, null, null, null], "baidu/ernie-4.5-vl-28b-a3b": [14e-8, 56e-8, null, null, null, null], "novita/baidu/ernie-4.5-21B-a3b": [7e-8, 28e-8, null, null, null, null], "baidu/ernie-4.5-21B-a3b": [7e-8, 28e-8, null, null, null, null], "novita/qwen/qwen3-8b-fp8": [35e-9, 138e-9, null, null, null, null], "qwen/qwen3-8b-fp8": [35e-9, 138e-9, null, null, null, null], "novita/qwen/qwen3-4b-fp8": [3e-8, 3e-8, null, null, null, null], "qwen/qwen3-4b-fp8": [3e-8, 3e-8, null, null, null, null], "novita/qwen/qwen2.5-7b-instruct": [7e-8, 7e-8, null, null, null, null], "qwen/qwen2.5-7b-instruct": [7e-8, 7e-8, null, null, null, null], "novita/meta-llama/llama-3.2-3b-instruct": [3e-8, 5e-8, null, null, null, null], "meta-llama/llama-3.2-3b-instruct": [3e-8, 5e-8, null, null, null, null], "novita/sao10k/l31-70b-euryale-v2.2": [148e-8, 148e-8, null, null, null, null], "sao10k/l31-70b-euryale-v2.2": [148e-8, 148e-8, null, null, null, null], "novita/qwen/qwen3-embedding-0.6b": [7e-8, 0, null, null, null, null], "qwen/qwen3-embedding-0.6b": [7e-8, 0, null, null, null, null], "novita/qwen/qwen3-embedding-8b": [7e-8, 0, null, null, null, null], "novita/baai/bge-m3": [1e-8, 1e-8, null, null, null, null], "baai/bge-m3": [1e-8, 1e-8, null, null, null, null], "novita/qwen/qwen3-reranker-8b": [5e-8, 5e-8, null, null, null, null], "qwen/qwen3-reranker-8b": [5e-8, 5e-8, null, null, null, null], "novita/baai/bge-reranker-v2-m3": [1e-8, 1e-8, null, null, null, null], "baai/bge-reranker-v2-m3": [1e-8, 1e-8, null, null, null, null], "llamagate/llama-3.1-8b": [3e-8, 5e-8, null, null, null, null], "llama-3.1-8b": [3e-8, 5e-8, null, null, null, null], "llamagate/llama-3.2-3b": [4e-8, 8e-8, null, null, null, null], "llama-3.2-3b": [4e-8, 8e-8, null, null, null, null], "llamagate/mistral-7b-v0.3": [1e-7, 15e-8, null, null, null, null], "mistral-7b-v0.3": [1e-7, 15e-8, null, null, null, null], "llamagate/qwen3-8b": [4e-8, 14e-8, null, null, null, null], "qwen3-8b": [4e-8, 14e-8, null, null, null, null], "llamagate/dolphin3-8b": [8e-8, 15e-8, null, null, null, null], "dolphin3-8b": [8e-8, 15e-8, null, null, null, null], "llamagate/deepseek-r1-8b": [1e-7, 2e-7, null, null, null, null], "deepseek-r1-8b": [1e-7, 2e-7, null, null, null, null], "llamagate/deepseek-r1-7b-qwen": [8e-8, 15e-8, null, null, null, null], "deepseek-r1-7b-qwen": [8e-8, 15e-8, null, null, null, null], "llamagate/openthinker-7b": [8e-8, 15e-8, null, null, null, null], "openthinker-7b": [8e-8, 15e-8, null, null, null, null], "llamagate/qwen2.5-coder-7b": [6e-8, 12e-8, null, null, null, null], "qwen2.5-coder-7b": [6e-8, 12e-8, null, null, null, null], "llamagate/deepseek-coder-6.7b": [6e-8, 12e-8, null, null, null, null], "deepseek-coder-6.7b": [6e-8, 12e-8, null, null, null, null], "llamagate/codellama-7b": [6e-8, 12e-8, null, null, null, null], "codellama-7b": [6e-8, 12e-8, null, null, null, null], "llamagate/qwen3-vl-8b": [15e-8, 55e-8, null, null, null, null], "qwen3-vl-8b": [15e-8, 55e-8, null, null, null, null], "llamagate/llava-7b": [1e-7, 2e-7, null, null, null, null], "llava-7b": [1e-7, 2e-7, null, null, null, null], "llamagate/gemma3-4b": [3e-8, 8e-8, null, null, null, null], "gemma3-4b": [3e-8, 8e-8, null, null, null, null], "llamagate/nomic-embed-text": [2e-8, 0, null, null, null, null], "nomic-embed-text": [2e-8, 0, null, null, null, null], "llamagate/qwen3-embedding-8b": [2e-8, 0, null, null, null, null], "qwen3-embedding-8b": [2e-8, 0, null, null, null, null], "libertai/hermes-3-8b-tee": [15e-8, 6e-7, null, null, null, null], "hermes-3-8b-tee": [15e-8, 6e-7, null, null, null, null], "libertai/gemma-4-31b-it": [15e-8, 4e-7, null, null, null, null], "libertai/gemma-4-31b-it-thinking": [15e-8, 4e-7, null, null, null, null], "gemma-4-31b-it-thinking": [15e-8, 4e-7, null, null, null, null], "libertai/qwen3.6-27b": [15e-8, 5e-7, null, null, null, null], "qwen3.6-27b": [15e-8, 5e-7, null, null, null, null], "libertai/qwen3.6-27b-thinking": [15e-8, 5e-7, null, null, null, null], "qwen3.6-27b-thinking": [15e-8, 5e-7, null, null, null, null], "libertai/qwen3.6-35b-a3b": [15e-8, 5e-7, null, null, null, null], "qwen3.6-35b-a3b": [15e-8, 5e-7, null, null, null, null], "libertai/qwen3.6-35b-a3b-thinking": [15e-8, 5e-7, null, null, null, null], "qwen3.6-35b-a3b-thinking": [15e-8, 5e-7, null, null, null, null], "libertai/qwen3.5-122b-a10b": [25e-8, 175e-8, null, null, null, null], "qwen3.5-122b-a10b": [25e-8, 175e-8, null, null, null, null], "libertai/qwen3.5-122b-a10b-thinking": [25e-8, 175e-8, null, null, null, null], "qwen3.5-122b-a10b-thinking": [25e-8, 175e-8, null, null, null, null], "libertai/deepseek-v4-flash": [25e-8, 175e-8, null, null, null, null], "libertai/deepseek-v4-flash-thinking": [25e-8, 175e-8, null, null, null, null], "deepseek-v4-flash-thinking": [25e-8, 175e-8, null, null, null, null], "libertai/bge-m3": [1e-8, 0, null, null, null, null], "bge-m3": [1e-8, 0, null, null, null, null], "sarvam/sarvam-m": [0, 0, 0, 0, null, null], "sarvam-m": [0, 0, 0, 0, null, null], "gemini/gemini-2.0-flash-exp-image-generation": [0, 0, null, null, null, null], "gemini/gemini-2.5-flash-native-audio-latest": [5e-7, 2e-6, null, null, null, null], "gemini/gemini-2.5-flash-native-audio-preview-09-2025": [5e-7, 2e-6, null, null, null, null], "gemini/gemini-2.5-flash-native-audio-preview-12-2025": [5e-7, 2e-6, null, null, null, null], "gemini/gemini-3.1-flash-live-preview": [75e-8, 45e-7, null, null, null, null], "gemini/gemini-3.1-flash-tts-preview": [1e-6, 2e-5, null, null, null, null], "gemini-3.1-flash-tts-preview": [1e-6, 2e-5, null, null, null, null], "gemini/gemini-3.8-flash-tts": [5e-7, 9e-6, null, 125e-9, 1.8, null, [25e-8, 45e-7, null, 25e-9, null, null]], "gemini-3.8-flash-tts": [5e-7, 9e-6, null, 125e-9, 1.8, null, [25e-8, 45e-7, null, 25e-9, null, null]], "gemini/gemini-3.8-flash-lite-tts": [5e-7, 6e-6, null, 125e-9, 1.8, null, [25e-8, 3e-6, null, 25e-9, null, null]], "gemini-3.8-flash-lite-tts": [5e-7, 6e-6, null, 125e-9, 1.8, null, [25e-8, 3e-6, null, 25e-9, null, null]], "gemini/gemini-pro-latest": [2e-6, 12e-6, null, 2e-7, 1.8, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }, [1e-6, 6e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }]], "vertex_ai/claude-sonnet-5@default": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "claude-sonnet-5@default": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "vertex_ai/claude-sonnet-4-6@default": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "claude-sonnet-4-6@default": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "bedrock_mantle/openai.gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "openai.gpt-oss-120b": [15e-8, 6e-7, null, null, null, null], "bedrock_mantle/openai.gpt-oss-20b": [7e-8, 3e-7, null, null, null, null], "openai.gpt-oss-20b": [7e-8, 3e-7, null, null, null, null], "bedrock_mantle/openai.gpt-oss-safeguard-120b": [15e-8, 6e-7, null, null, null, null], "bedrock_mantle/openai.gpt-oss-safeguard-20b": [7e-8, 2e-7, null, null, null, null], "bedrock_mantle/openai.gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, null, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "openai.gpt-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, null, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "bedrock_mantle/openai.gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "openai.gpt-5.6-terra": [22e-7, 132e-7, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 198e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "bedrock_mantle/openai.gpt-5.6-cyber": [1375e-8, 825e-7, 171875e-10, 1375e-9, null, null], "openai.gpt-5.6-cyber": [1375e-8, 825e-7, 171875e-10, 1375e-9, null, null], "bedrock_mantle/openai.gpt-daybreak-blue-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, null, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "openai.gpt-daybreak-blue-5.6-sol": [44e-7, 22e-6, 55e-7, 44e-8, null, { threshold: 272e3, input: 88e-7, output: 33e-6, cacheWrite: 11e-6, cacheRead: 88e-8 }], "bedrock_mantle/openai.gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, null, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "openai.gpt-5.6-luna": [22e-8, 132e-8, 275e-9, 22e-9, null, { threshold: 272e3, input: 44e-8, output: 198e-8, cacheWrite: 55e-8, cacheRead: 44e-9 }], "bedrock_mantle/openai.gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "openai.gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "bedrock_mantle/openai.gpt-6-sol": [22e-7, 11e-6, 275e-8, 22e-8, null, { threshold: 272e3, input: 44e-7, output: 165e-7, cacheWrite: 55e-7, cacheRead: 44e-8 }], "bedrock_mantle/openai.gpt-6-luna": [11e-8, 55e-8, 1375e-10, 11e-9, null, { threshold: 272e3, input: 22e-8, output: 825e-9, cacheWrite: 275e-9, cacheRead: 22e-9 }], "bedrock_mantle/openai.gpt-5.5": [55e-7, 33e-6, null, 55e-8, null, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7 }], "openai.gpt-5.5": [55e-7, 33e-6, null, 55e-8, null, { threshold: 272e3, input: 11e-6, output: 495e-7, cacheWrite: null, cacheRead: 11e-7 }], "bedrock_mantle/openai.gpt-5.4": [275e-8, 165e-7, null, 275e-9, null, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8 }], "openai.gpt-5.4": [275e-8, 165e-7, null, 275e-9, null, { threshold: 272e3, input: 55e-7, output: 2475e-8, cacheWrite: null, cacheRead: 55e-8 }], "bedrock_mantle/google.gemma-4-31b": [14e-8, 4e-7, null, null, null, null], "google.gemma-4-31b": [14e-8, 4e-7, null, null, null, null], "bedrock_mantle/google.gemma-4-26b-a4b": [13e-8, 4e-7, null, null, null, null], "google.gemma-4-26b-a4b": [13e-8, 4e-7, null, null, null, null], "bedrock_mantle/google.gemma-4-e2b": [4e-8, 8e-8, null, null, null, null], "google.gemma-4-e2b": [4e-8, 8e-8, null, null, null, null], "bedrock_mantle/xai.grok-4.3": [125e-8, 25e-7, null, 2e-7, null, null], "xai.grok-4.3": [125e-8, 25e-7, null, 2e-7, null, null], "bedrock_mantle/xai.grok-4.6": [22e-7, 66e-7, null, 55e-8, null, null], "xai.grok-4.6": [22e-7, 66e-7, null, 55e-8, null, null], "bedrock_mantle/anthropic.claude-haiku-4-5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "anthropic.claude-haiku-4-5": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "volcengine/doubao-seed-2-1-pro-260628": [8625e-10, 43125e-10, null, 1725e-10, null, null], "doubao-seed-2-1-pro-260628": [8625e-10, 43125e-10, null, 1725e-10, null, null], "volcengine/doubao-seed-2-1-turbo-260628": [43125e-11, 215625e-11, null, 8625e-11, null, null], "doubao-seed-2-1-turbo-260628": [43125e-11, 215625e-11, null, 8625e-11, null, null], "bedrock/us-east-1/zai.glm-5": [1e-6, 32e-7, null, null, null, null], "us-east-1/zai.glm-5": [1e-6, 32e-7, null, null, null, null], "bedrock/us-west-2/zai.glm-5": [1e-6, 32e-7, null, null, null, null], "us-west-2/zai.glm-5": [1e-6, 32e-7, null, null, null, null], "bedrock/us-gov-east-1/anthropic.claude-haiku-4-5-20251001-v1:0": [12e-7, 6e-6, 15e-7, 12e-8, null, null], "us-gov-east-1/anthropic.claude-haiku-4-5-20251001-v1:0": [12e-7, 6e-6, 15e-7, 12e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-haiku-4-5-20251001-v1:0": [12e-7, 6e-6, 15e-7, 12e-8, null, null], "us-gov-west-1/anthropic.claude-haiku-4-5-20251001-v1:0": [12e-7, 6e-6, 15e-7, 12e-8, null, null], "snowflake/claude-sonnet-4-5": [3e-6, 15e-6, null, 3e-7, null, null], "snowflake/claude-sonnet-4-6": [3e-6, 15e-6, null, 3e-7, null, null], "snowflake/claude-4-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "claude-4-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "snowflake/claude-4-opus": [5e-6, 25e-6, null, 5e-7, null, null], "claude-4-opus": [5e-6, 25e-6, null, 5e-7, null, null], "snowflake/claude-haiku-4-5": [1e-6, 5e-6, null, 1e-7, null, null], "snowflake/claude-3-7-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "claude-3-7-sonnet": [3e-6, 15e-6, null, 3e-7, null, null], "snowflake/openai-gpt-4.1": [2e-6, 8e-6, null, 5e-7, null, null], "openai-gpt-4.1": [2e-6, 8e-6, null, 5e-7, null, null], "snowflake/openai-gpt-5": [125e-8, 1e-5, null, 125e-9, null, null], "openai-gpt-5": [125e-8, 1e-5, null, 125e-9, null, null], "snowflake/openai-gpt-5-mini": [3e-7, 12e-7, null, null, null, null], "openai-gpt-5-mini": [3e-7, 12e-7, null, null, null, null], "snowflake/openai-gpt-5-nano": [15e-8, 6e-7, null, null, null, null], "openai-gpt-5-nano": [15e-8, 6e-7, null, null, null, null], "snowflake/llama4-maverick": [24e-8, 97e-8, null, null, null, null], "llama4-maverick": [24e-8, 97e-8, null, null, null, null], "snowflake/snowflake-arctic-embed-l-v2.0": [7e-8, 0, null, null, null, null], "snowflake-arctic-embed-l-v2.0": [7e-8, 0, null, null, null, null], "snowflake/snowflake-arctic-embed-m-v2.0": [7e-8, 0, null, null, null, null], "snowflake-arctic-embed-m-v2.0": [7e-8, 0, null, null, null, null], "tensormesh/Qwen/Qwen3.5-397B-A17B-FP8": [6e-7, 36e-7, null, 0, null, null], "Qwen/Qwen3.5-397B-A17B-FP8": [6e-7, 36e-7, null, 0, null, null], "tensormesh/Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": [45e-8, 18e-7, null, 0, null, null], "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": [45e-8, 18e-7, null, 0, null, null], "tensormesh/Qwen/Qwen3.6-27B-FP8": [32e-8, 32e-7, null, 0, null, null], "Qwen/Qwen3.6-27B-FP8": [32e-8, 32e-7, null, 0, null, null], "tensormesh/lukealonso/GLM-5.1-NVFP4-MTP": [14e-7, 44e-7, null, 0, null, null], "lukealonso/GLM-5.1-NVFP4-MTP": [14e-7, 44e-7, null, 0, null, null], "tensormesh/deepseek-ai/DeepSeek-V4-Flash": [14e-8, 28e-8, null, 0, null, null], "tensormesh/moonshotai/Kimi-K2.6": [96e-8, 4e-6, null, 0, null, null], "tensormesh/MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, 0, null, null], "tensormesh/google/gemma-4-31B-it": [14e-8, 56e-8, null, 0, null, null], "tensormesh/openai/gpt-oss-120b": [15e-8, 6e-7, null, 0, null, null], "tensormesh/openai/gpt-oss-20b": [7e-8, 28e-8, null, 0, null, null], "deepseek/deepseek-flash": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek/deepseek-v4-flash": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek/deepseek-v4-flash-vision-exp": [3e-7, 12e-7, 0, 6e-9, null, null], "deepseek/deepseek-v4-pro": [132e-8, 396e-8, 0, 44e-9, null, null], "tencent/deepseek-v4-pro": [435e-9, 87e-8, 0, 3625e-12, null, null], "tencent/deepseek-v4-flash": [14e-8, 28e-8, 0, 28e-10, null, null], "tencent/minimax-m3": [3e-7, 12e-7, 0, 6e-8, null, null], "cognition/swe-1.6": [5e-7, 25e-7, null, 2e-7, null, null], "swe-1.6": [5e-7, 25e-7, null, 2e-7, null, null], "cognition/swe-1.7": [5e-7, 25e-7, null, 2e-7, null, null], "swe-1.7": [5e-7, 25e-7, null, 2e-7, null, null], "cognition/swe-1.7-lightning": [25e-7, 125e-7, null, 1e-6, null, null], "swe-1.7-lightning": [25e-7, 125e-7, null, 1e-6, null, null], "pinstripes/ps/glm-4.5-air": [125e-9, 45e-8, null, null, null, null], "ps/glm-4.5-air": [125e-9, 45e-8, null, null, null, null], "pinstripes/ps/qwen3.6-35b-a3b": [14e-8, 45e-8, null, null, null, null], "ps/qwen3.6-35b-a3b": [14e-8, 45e-8, null, null, null, null], "pinstripes/ps/qwen3-30b-a3b": [9e-8, 2e-7, null, null, null, null], "ps/qwen3-30b-a3b": [9e-8, 2e-7, null, null, null, null], "pinstripes/ps/qwen3-coder-30b-a3b": [3e-7, 6e-7, null, null, null, null], "ps/qwen3-coder-30b-a3b": [3e-7, 6e-7, null, null, null, null], "pinstripes/ps/deepseek-v4-flash": [1e-7, 2e-7, null, null, null, null], "ps/deepseek-v4-flash": [1e-7, 2e-7, null, null, null, null], "pinstripes/ps/minimax-m2.7": [255e-9, 55e-8, null, null, null, null], "ps/minimax-m2.7": [255e-9, 55e-8, null, null, null, null], "darkbloom/gemma-4-26b": [3e-8, 165e-9, null, null, null, null], "gemma-4-26b": [3e-8, 165e-9, null, null, null, null], "darkbloom/gpt-oss-20b": [145e-10, 7e-8, null, null, null, null], "xai/grok-4.20-0309-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-0309-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-build-0.1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-build-0.1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "gemini/gemini-robotics-er-2-streaming-preview": [1e-6, 5e-6, null, null, null, null], "gemini-robotics-er-2-streaming-preview": [1e-6, 5e-6, null, null, null, null], "mistral/mistral-small-2603": [15e-8, 6e-7, null, 15e-9, null, null], "mistral-small-2603": [15e-8, 6e-7, null, 15e-9, null, null], "mistral/labs-leanstral-1-5": [0, 0, null, null, null, null], "labs-leanstral-1-5": [0, 0, null, null, null, null], "mistral/mistral-moderation-2603": [0, 0, null, null, null, null], "mistral-moderation-2603": [0, 0, null, null, null, null], "gemini/gemini-3.5-live-translate-preview": [35e-7, 21e-6, null, null, null, null], "gemini-3.5-live-translate-preview": [35e-7, 21e-6, null, null, null, null], "gemini/gemini-3.5-transcribe": [2e-6, 12e-6, null, null, null, null], "gemini-3.5-transcribe": [2e-6, 12e-6, null, null, null, null], "gemini/gemini-3.5-transcribe-live": [35e-7, 21e-6, null, null, null, null], "gemini-3.5-transcribe-live": [35e-7, 21e-6, null, null, null, null], "vertex_ai/gemini-3.5-transcribe-preview": [2e-6, 12e-6, null, null, null, null], "gemini-3.5-transcribe-preview": [2e-6, 12e-6, null, null, null, null], "vertex_ai/gemini-3.5-transcribe-live-preview": [35e-7, 21e-6, null, null, null, null], "gemini-3.5-transcribe-live-preview": [35e-7, 21e-6, null, null, null, null], "vertex_ai/gemini-3.5-live-translate-preview": [35e-7, 21e-6, null, null, null, null], "perplexity/pplx-embed-context-v1-0.6b": [8e-9, 0, null, null, null, null], "pplx-embed-context-v1-0.6b": [8e-9, 0, null, null, null, null], "perplexity/pplx-embed-context-v1-4b": [5e-8, 0, null, null, null, null], "pplx-embed-context-v1-4b": [5e-8, 0, null, null, null, null], "voyage/voyage-4-large": [12e-8, 0, null, null, null, null], "voyage-4-large": [12e-8, 0, null, null, null, null], "voyage/voyage-4": [6e-8, 0, null, null, null, null], "voyage-4": [6e-8, 0, null, null, null, null], "voyage/voyage-4-lite": [2e-8, 0, null, null, null, null], "voyage-4-lite": [2e-8, 0, null, null, null, null], "voyage/voyage-code-4": [12e-8, 0, null, null, null, null], "voyage-code-4": [12e-8, 0, null, null, null, null], "voyage/voyage-context-4": [12e-8, 0, null, null, null, null], "voyage-context-4": [12e-8, 0, null, null, null, null], "voyage/voyage-multimodal-3.5": [12e-8, 0, null, null, null, null], "voyage-multimodal-3.5": [12e-8, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-0731": [22e-8, 66e-8, null, 7e-9, 1.25, null], "accounts/fireworks/models/deepseek-v4-flash-0731": [22e-8, 66e-8, null, 7e-9, 1.25, null], "fireworks_ai/accounts/fireworks/models/deepseek-v4p1-flash": [22e-8, 66e-8, null, 7e-9, null, null], "accounts/fireworks/models/deepseek-v4p1-flash": [22e-8, 66e-8, null, 7e-9, null, null], "fireworks_ai/accounts/fireworks/routers/deepseek-v4p1-flash-us": [45e-8, 18e-7, null, 9e-9, 1.25, null], "accounts/fireworks/routers/deepseek-v4p1-flash-us": [45e-8, 18e-7, null, 9e-9, 1.25, null], "fireworks_ai/accounts/fireworks/models/deepseek-v4-flash-vision-exp": [22e-8, 66e-8, null, 7e-9, 1.25, null], "accounts/fireworks/models/deepseek-v4-flash-vision-exp": [22e-8, 66e-8, null, 7e-9, 1.25, null], "fireworks_ai/accounts/fireworks/models/kimi-k3": [3e-6, 15e-6, null, 3e-7, 1.25, null], "accounts/fireworks/models/kimi-k3": [3e-6, 15e-6, null, 3e-7, 1.25, null], "fireworks_ai/deepseek-v4-flash-0731": [22e-8, 66e-8, null, 7e-9, 1.25, null], "fireworks_ai/deepseek-v4p1-flash": [22e-8, 66e-8, null, 7e-9, null, null], "deepseek-v4p1-flash": [22e-8, 66e-8, null, 7e-9, null, null], "fireworks_ai/deepseek-v4p1-flash-us": [45e-8, 18e-7, null, 9e-9, 1.25, null], "deepseek-v4p1-flash-us": [45e-8, 18e-7, null, 9e-9, 1.25, null], "fireworks_ai/deepseek-v4-flash-vision-exp": [22e-8, 66e-8, null, 7e-9, 1.25, null], "fireworks_ai/glm-5p2-fast": [21e-7, 66e-7, null, 21e-8, null, null], "glm-5p2-fast": [21e-7, 66e-7, null, 21e-8, null, null], "fireworks_ai/glm-5p2-fast-us": [21e-7, 66e-7, null, 21e-8, null, null], "glm-5p2-fast-us": [21e-7, 66e-7, null, 21e-8, null, null], "fireworks_ai/kimi-k3": [3e-6, 15e-6, null, 3e-7, 1.25, null], "fireworks_ai/kimi-k3-fast": [45e-7, 225e-7, null, 45e-8, null, null], "kimi-k3-fast": [45e-7, 225e-7, null, 45e-8, null, null], "fireworks_ai/kimi-k3-us": [45e-7, 225e-7, null, 45e-8, 1.25, null], "kimi-k3-us": [45e-7, 225e-7, null, 45e-8, 1.25, null], "fireworks_ai/qwen3p8-max": [2e-6, 6e-6, null, 25e-8, 1.5, null], "qwen3p8-max": [2e-6, 6e-6, null, 25e-8, 1.5, null], "fireworks_ai/muse-glimmer-30b": [35e-8, 15e-7, null, 4e-8, 1.5, null], "muse-glimmer-30b": [35e-8, 15e-7, null, 4e-8, 1.5, null], "fireworks_ai/nemotron-lightning-3p5-30b-a3b": [5e-8, 2e-7, null, 1e-8, 1.25, null], "nemotron-lightning-3p5-30b-a3b": [5e-8, 2e-7, null, 1e-8, 1.25, null], "fireworks_ai/nemotron-3-ultra-nvfp4": [6e-7, 24e-7, null, 12e-8, 1.25, null], "nemotron-3-ultra-nvfp4": [6e-7, 24e-7, null, 12e-8, 1.25, null], "fireworks_ai/accounts/fireworks/models/muse-glimmer-30b": [35e-8, 15e-7, null, 4e-8, 1.5, null], "accounts/fireworks/models/muse-glimmer-30b": [35e-8, 15e-7, null, 4e-8, 1.5, null], "fireworks_ai/accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b": [5e-8, 2e-7, null, 1e-8, 1.25, null], "accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b": [5e-8, 2e-7, null, 1e-8, 1.25, null], "fireworks_ai/accounts/fireworks/models/nemotron-3-ultra-nvfp4": [6e-7, 24e-7, null, 12e-8, 1.25, null], "accounts/fireworks/models/nemotron-3-ultra-nvfp4": [6e-7, 24e-7, null, 12e-8, 1.25, null], "fireworks_ai/accounts/fireworks/models/qwen3p8-max": [2e-6, 6e-6, null, 25e-8, 1.5, null], "accounts/fireworks/models/qwen3p8-max": [2e-6, 6e-6, null, 25e-8, 1.5, null], "fireworks_ai/accounts/fireworks/routers/glm-5p2-fast": [21e-7, 66e-7, null, 21e-8, null, null], "accounts/fireworks/routers/glm-5p2-fast": [21e-7, 66e-7, null, 21e-8, null, null], "fireworks_ai/accounts/fireworks/routers/glm-5p2-fast-us": [21e-7, 66e-7, null, 21e-8, null, null], "accounts/fireworks/routers/glm-5p2-fast-us": [21e-7, 66e-7, null, 21e-8, null, null], "fireworks_ai/accounts/fireworks/routers/kimi-k3-fast": [45e-7, 225e-7, null, 45e-8, null, null], "accounts/fireworks/routers/kimi-k3-fast": [45e-7, 225e-7, null, 45e-8, null, null], "fireworks_ai/accounts/fireworks/routers/kimi-k3-us": [45e-7, 225e-7, null, 45e-8, 1.25, null], "accounts/fireworks/routers/kimi-k3-us": [45e-7, 225e-7, null, 45e-8, 1.25, null], "novita/zai-org/glm-5.3": [14e-7, 44e-7, null, 26e-8, null, null], "zai-org/glm-5.3": [14e-7, 44e-7, null, 26e-8, null, null], "novita/deepseek/deepseek-v4-pro-0813": [132e-8, 396e-8, null, 13200000000000002e-23, null, null], "novita/moonshotai/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "moonshotai/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "novita/tencent/hy3": [14e-8, 58e-8, null, 35e-9, null, null], "tencent/hy3": [14e-8, 58e-8, null, 35e-9, null, null], "novita/zai-org/glm-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "zai-org/glm-5.2": [14e-7, 44e-7, null, 26e-8, null, null], "novita/moonshotai/kimi-k2.7-code": [9499999999999999e-22, 4e-6, null, 19e-8, null, null], "moonshotai/kimi-k2.7-code": [9499999999999999e-22, 4e-6, null, 19e-8, null, null], "novita/deepseek/deepseek-v4-flash-vision-exp": [44e-8, 132e-8, null, 28e-9, null, null], "novita/deepseek/deepseek-v4-flash-0731": [44e-8, 132e-8, null, 28e-9, null, null], "deepseek/deepseek-v4-flash-0731": [44e-8, 132e-8, null, 28e-9, null, null], "novita/mindai/macaron-v1-venti": [15e-7, 45e-7, null, 3e-7, null, null], "mindai/macaron-v1-venti": [15e-7, 45e-7, null, 3e-7, null, null], "novita/minimax/minimax-m3": [3e-7, 12e-7, null, 6e-8, null, null], "minimax/minimax-m3": [3e-7, 12e-7, null, 6e-8, null, null], "novita/deepseek/deepseek-v4-flash": [14e-8, 28e-8, null, 28e-9, null, null], "novita/deepseek/deepseek-v4-pro": [16000000000000001e-22, 32000000000000003e-22, null, 135e-9, null, null], "novita/inclusionai/ling-3.0-flash-fast": [6e-8, 18e-8, null, 12e-9, null, null], "inclusionai/ling-3.0-flash-fast": [6e-8, 18e-8, null, 12e-9, null, null], "novita/qwen/qwen3.8-max": [2e-6, 6e-6, null, 25e-8, null, null], "qwen/qwen3.8-max": [2e-6, 6e-6, 25e-7, 25e-8, null, null], "novita/inclusionai/ling-3.0-flash": [6e-8, 18e-8, null, 12e-9, null, null], "inclusionai/ling-3.0-flash": [6e-8, 18e-8, null, 12e-9, null, null], "novita/mindai/macaron-v1-tall": [45000000000000003e-23, 26e-7, null, 8e-8, null, null], "mindai/macaron-v1-tall": [45000000000000003e-23, 26e-7, null, 8e-8, null, null], "novita/stepfun/step-3.7-flash": [20000000000000002e-23, 115e-8, null, 4e-8, null, null], "stepfun/step-3.7-flash": [20000000000000002e-23, 115e-8, null, 4e-8, null, null], "novita/nvidia/nemotron-3-nano-30b-a3b": [50000000000000004e-24, 20000000000000002e-23, null, null, null, null], "nvidia/nemotron-3-nano-30b-a3b": [50000000000000004e-24, 20000000000000002e-23, null, null, null, null], "novita/baidu/cobuddy": [28e-8, 113e-8, null, 7e-8, null, null], "baidu/cobuddy": [28e-8, 113e-8, null, 7e-8, null, null], "novita/xiaomimimo/mimo-v2.5": [16800000000000002e-23, 33600000000000004e-23, null, 34e-10, null, null], "xiaomimimo/mimo-v2.5": [16800000000000002e-23, 33600000000000004e-23, null, 34e-10, null, null], "novita/qwen/qwen3.7-max": [125e-8, 375e-8, null, 25e-8, null, null], "qwen/qwen3.7-max": [125e-8, 375e-8, null, 25e-8, null, null], "novita/xiaomimimo/mimo-v2.5-pro": [522e-9, 1044e-9, null, 43e-10, null, null], "xiaomimimo/mimo-v2.5-pro": [522e-9, 1044e-9, null, 43e-10, null, null], "novita/qwen/qwen3.6-27b": [6e-7, 36000000000000003e-22, null, null, null, null], "qwen/qwen3.6-27b": [6e-7, 36000000000000003e-22, null, null, null, null], "novita/moonshotai/kimi-k2.6": [8000000000000001e-22, 34e-7, null, 16e-8, null, null], "moonshotai/kimi-k2.6": [8000000000000001e-22, 34e-7, null, 16e-8, null, null], "novita/zai-org/glm-5.1": [138e-8, 44e-7, null, 26e-8, null, null], "zai-org/glm-5.1": [138e-8, 44e-7, null, 26e-8, null, null], "novita/minimax/minimax-m2.7-highspeed": [6e-7, 24e-7, null, 6e-8, null, null], "minimax/minimax-m2.7-highspeed": [6e-7, 24e-7, null, 6e-8, null, null], "novita/zai-org/glm-5v-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "zai-org/glm-5v-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "novita/google/gemma-4-26b-a4b-it": [13e-8, 40000000000000003e-23, null, null, null, null], "novita/google/gemma-4-31b-it": [14e-8, 40000000000000003e-23, null, null, null, null], "google/gemma-4-31b-it": [14e-8, 40000000000000003e-23, null, null, null, null], "novita/zai-org/glm-5-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "zai-org/glm-5-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "novita/minimax/minimax-m2.7": [3e-7, 12e-7, null, 6e-8, null, null], "minimax/minimax-m2.7": [3e-7, 12e-7, null, 6e-8, null, null], "novita/minimax/minimax-m2.5-highspeed": [6e-7, 24e-7, null, 3e-8, null, null], "minimax/minimax-m2.5-highspeed": [6e-7, 24e-7, null, 3e-8, null, null], "novita/qwen/qwen3.5-27b": [3e-7, 24e-7, null, null, null, null], "novita/qwen/qwen3.5-122b-a10b": [40000000000000003e-23, 32000000000000003e-22, null, null, null, null], "novita/qwen/qwen3.5-35b-a3b": [25e-8, 2e-6, null, null, null, null], "novita/qwen/qwen3.5-397b-a17b": [6e-7, 36000000000000003e-22, null, null, null, null], "novita/minimax/minimax-m2.5": [3e-7, 12e-7, null, 3e-8, null, null], "novita/zai-org/glm-5": [1e-6, 32000000000000003e-22, null, 20000000000000002e-23, null, null], "zai-org/glm-5": [1e-6, 32000000000000003e-22, null, 20000000000000002e-23, null, null], "novita/qwen/qwen3-coder-next": [20000000000000002e-23, 15e-7, null, null, null, null], "qwen/qwen3-coder-next": [20000000000000002e-23, 15e-7, null, null, null, null], "novita/deepseek/deepseek-ocr-2": [3e-8, 3e-8, null, null, null, null], "deepseek/deepseek-ocr-2": [3e-8, 3e-8, null, null, null, null], "novita/moonshotai/kimi-k2.5": [6e-7, 3e-6, null, 10000000000000001e-23, null, null], "novita/zai-org/glm-4.7-h": [6e-7, 22e-7, null, 11e-8, null, null], "zai-org/glm-4.7-h": [6e-7, 22e-7, null, 11e-8, null, null], "novita/zai-org/glm-4.7-flash": [7e-8, 40000000000000003e-23, null, 1e-8, null, null], "zai-org/glm-4.7-flash": [7e-8, 40000000000000003e-23, null, 1e-8, null, null], "novita/qwen/qwen3.6-35b-a3b": [248e-9, 14850000000000002e-22, null, null, null, null], "novita/deepseek/deepseek_v3": [8900000000000001e-22, 8900000000000001e-22, null, null, null, null], "deepseek/deepseek_v3": [8900000000000001e-22, 8900000000000001e-22, null, null, null, null], "novita/deepseek/deepseek-r1": [4e-6, 4e-6, null, null, null, null], "novita/deepseek/deepseek-v3/community": [8900000000000001e-22, 8900000000000001e-22, null, null, null, null], "deepseek/deepseek-v3/community": [8900000000000001e-22, 8900000000000001e-22, null, null, null, null], "novita/deepseek/deepseek-r1/community": [4e-6, 4e-6, null, null, null, null], "deepseek/deepseek-r1/community": [4e-6, 4e-6, null, null, null, null], "novita/thudm/glm-4-32b-0414": [55e-8, 166e-8, null, null, null, null], "thudm/glm-4-32b-0414": [55e-8, 166e-8, null, null, null, null], "novita/meta-llama/llama-3.2-1b-instruct": [2e-8, 2e-8, null, null, null, null], "meta-llama/llama-3.2-1b-instruct": [2e-8, 2e-8, null, null, null, null], "wandb/deepseek-ai/DeepSeek-V4-Flash": [14e-8, 28e-8, null, 7e-8, null, null], "wandb/deepseek-ai/DeepSeek-V4-Flash-0731": [13e-8, 28e-8, null, 7e-8, null, null], "wandb/deepseek-ai/DeepSeek-V4-Pro": [115e-8, 255e-8, null, 2e-7, null, null], "wandb/google/gemma-4-31B-it": [1e-7, 34e-8, null, null, null, null], "wandb/ibm-granite/granite-4.1-8b": [5e-8, 1e-7, null, null, null, null], "ibm-granite/granite-4.1-8b": [5e-8, 1e-7, null, null, null, null], "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct": [5e-8, 1e-7, null, null, null, null], "JetBrains/Mellum2-12B-A2.5B-Instruct": [5e-8, 1e-7, null, null, null, null], "wandb/meta-llama/Llama-3.1-70B-Instruct": [8e-7, 8e-7, null, null, null, null], "meta-llama/Llama-3.1-70B-Instruct": [8e-7, 8e-7, null, null, null, null], "wandb/MiniMaxAI/MiniMax-M3": [23e-8, 96e-8, null, 5e-8, null, null], "wandb/moonshotai/Kimi-K2.7-Code": [71e-8, 35e-7, null, 15e-8, null, null], "wandb/moonshotai/Kimi-K2.6": [65e-8, 341e-8, null, 15e-8, null, null], "wandb/nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B": [7e-8, 2e-7, null, 4e-8, null, null], "nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B": [7e-8, 2e-7, null, 4e-8, null, null], "wandb/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": [5e-7, 215e-8, null, 1e-7, null, null], "nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": [5e-7, 215e-8, null, 1e-7, null, null], "wandb/OpenPipe/Qwen3-14B-Instruct": [5e-8, 22e-8, null, null, null, null], "OpenPipe/Qwen3-14B-Instruct": [5e-8, 22e-8, null, null, null, null], "wandb/Qwen/Qwen3.8-27B": [4e-7, 3e-6, null, 15e-8, null, null], "Qwen/Qwen3.8-27B": [4e-7, 3e-6, null, 15e-8, null, null], "wandb/Qwen/Qwen3.6-35B-A3B": [25e-8, 125e-8, null, null, null, null], "wandb/Qwen/Qwen3.6-27B": [6e-7, 36e-7, null, 12e-8, null, null], "Qwen/Qwen3.6-27B": [6e-7, 36e-7, null, 12e-8, null, null], "wandb/Qwen/Qwen3.5-35B-A3B": [25e-8, 125e-8, null, null, null, null], "Qwen/Qwen3.5-35B-A3B": [25e-8, 125e-8, null, null, null, null], "wandb/Qwen/Qwen3-30B-A3B-Instruct-2507": [1e-7, 3e-7, null, null, null, null], "wandb/deepseek-ai/DeepSeek-V4-Pro-0813": [131e-8, 396e-8, null, 44e-9, null, null], "wandb/ibm-granite/granite-4.2-8b": [1e-7, 15e-8, null, 5e-8, null, null], "ibm-granite/granite-4.2-8b": [1e-7, 15e-8, null, 5e-8, null, null], "wandb/zai-org/GLM-5.2": [76e-8, 242e-8, null, 14e-8, null, null], "deepinfra/openai/gpt-oss-120b-Turbo": [15e-8, 6e-7, null, null, null, null], "openai/gpt-oss-120b-Turbo": [15e-8, 6e-7, null, null, null, null], "deepinfra/MiniMaxAI/MiniMax-M2.7": [25e-8, 1e-6, null, 5e-8, null, null], "MiniMaxAI/MiniMax-M2.7": [25e-8, 1e-6, null, 5e-8, null, null], "deepinfra/Qwen/Qwen3.8-27B": [4e-7, 3e-6, null, 4e-8, null, null], "deepinfra/google/gemma-4-31B-it-Ultra": [27e-8, 76e-8, null, null, null, null], "google/gemma-4-31B-it-Ultra": [27e-8, 76e-8, null, null, null, null], "deepinfra/moonshotai/Kimi-K2.5": [45e-8, 225e-8, null, 7e-8, null, null], "deepinfra/zai-org/GLM-4.7-Flash": [6e-8, 4e-7, null, 1e-8, null, null], "zai-org/GLM-4.7-Flash": [6e-8, 4e-7, null, 1e-8, null, null], "deepinfra/zai-org/GLM-4.6": [5e-7, 2e-6, null, 1e-7, null, null], "deepinfra/anthropic/claude-opus-4-8": [5e-6, 25e-6, null, null, null, null], "anthropic/claude-opus-4-8": [5e-6, 25e-6, null, 5e-7, null, null], "deepinfra/anthropic/claude-sonnet-4-6": [3e-6, 15e-6, null, null, null, null], "anthropic/claude-sonnet-4-6": [3e-6, 15e-6, null, 3e-7, null, null], "deepinfra/google/gemini-3.5-flash": [15e-7, 9e-6, null, null, null, null], "google/gemini-3.5-flash": [15e-7, 9e-6, 833333333333333e-22, 15e-8, null, null], "deepinfra/XiaomiMiMo/MiMo-V2.5": [4e-7, 2e-6, null, 8e-8, null, null], "XiaomiMiMo/MiMo-V2.5": [4e-7, 2e-6, null, 8e-8, null, null], "deepinfra/Qwen/Qwen3-Max": [12e-7, 6e-6, null, 24e-8, null, null], "Qwen/Qwen3-Max": [12e-7, 6e-6, null, 24e-8, null, null], "deepinfra/google/gemma-4-31B-it-turbo": [9e-8, 34e-8, null, 5e-8, null, null], "google/gemma-4-31B-it-turbo": [9e-8, 34e-8, null, 5e-8, null, null], "deepinfra/thinkingmachines/Inkling-Small": [45e-8, 12e-7, null, 1e-7, null, null], "thinkingmachines/Inkling-Small": [45e-8, 12e-7, null, 1e-7, null, null], "deepinfra/meta-models/Muse-Glimmer-30B": [3e-7, 12e-7, null, 4e-8, null, null], "deepinfra/Qwen/Qwen3-Max-Thinking": [12e-7, 6e-6, null, 24e-8, null, null], "Qwen/Qwen3-Max-Thinking": [12e-7, 6e-6, null, 24e-8, null, null], "deepinfra/Qwen/Qwen3-VL-235B-A22B-Instruct": [2e-7, 88e-8, null, 11e-8, null, null], "Qwen/Qwen3-VL-235B-A22B-Instruct": [2e-7, 88e-8, null, 11e-8, null, null], "deepinfra/Qwen/Qwen3-VL-30B-A3B-Instruct": [15e-8, 6e-7, null, null, null, null], "Qwen/Qwen3-VL-30B-A3B-Instruct": [15e-8, 6e-7, null, null, null, null], "deepinfra/Qwen/Qwen3.5-27B": [26e-8, 26e-7, null, null, null, null], "Qwen/Qwen3.5-27B": [26e-8, 26e-7, null, null, null, null], "deepinfra/Qwen/Qwen3.6-35B-A3B": [1e-7, 95e-8, null, null, null, null], "deepinfra/nvidia/Nemotron-Content-Safety-3.5": [2e-7, 2e-7, null, null, null, null], "nvidia/Nemotron-Content-Safety-3.5": [2e-7, 2e-7, null, null, null, null], "deepinfra/anthropic/claude-opus-5": [5e-6, 25e-6, null, null, null, null], "deepinfra/thinkingmachines/Inkling": [95e-8, 405e-8, null, 16e-8, null, null], "deepinfra/moonshotai/Kimi-K2.6": [75e-8, 35e-7, null, 15e-8, null, null], "deepinfra/deepseek-ai/DeepSeek-V4-Pro-0813": [13e-7, 26e-7, null, 1e-7, null, null], "deepinfra/Qwen/Qwen3.7-Max": [25e-7, 75e-7, null, 5e-7, null, null], "deepinfra/ByteDance/Seed-2.0-mini": [1e-7, 4e-7, null, 2e-8, null, null], "ByteDance/Seed-2.0-mini": [1e-7, 4e-7, null, 2e-8, null, null], "deepinfra/Qwen/Qwen3.8-2.4T-A95B": [2e-6, 6e-6, null, 2e-7, null, null], "deepinfra/MiniMaxAI/MiniMax-M3": [28e-8, 11e-7, null, 56e-9, null, null], "deepinfra/google/gemini-3.1-flash-lite": [25e-8, 15e-7, null, null, null, null], "deepinfra/google/gemini-3.7-flash": [75e-8, 375e-8, null, null, null, null], "google/gemini-3.7-flash": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "deepinfra/inclusionAI/Ling-3.0-flash": [6e-8, 18e-8, null, 12e-9, null, null], "inclusionAI/Ling-3.0-flash": [6e-8, 18e-8, null, 12e-9, null, null], "deepinfra/stepfun-ai/Step-3.7-Flash": [2e-7, 115e-8, null, 4e-8, null, null], "stepfun-ai/Step-3.7-Flash": [2e-7, 115e-8, null, 4e-8, null, null], "deepinfra/Qwen/Qwen3.5-35B-A3B": [14e-8, 1e-6, null, 5e-8, null, null], "deepinfra/ByteDance/Seed-1.8": [25e-8, 2e-6, null, 5e-8, null, null], "ByteDance/Seed-1.8": [25e-8, 2e-6, null, 5e-8, null, null], "deepinfra/tencent/Hy3": [14e-8, 58e-8, null, 35e-9, null, null], "tencent/Hy3": [14e-8, 58e-8, null, 35e-9, null, null], "deepinfra/ByteDance/Seed-2.0-code": [5e-7, 3e-6, null, 1e-7, null, null], "ByteDance/Seed-2.0-code": [5e-7, 3e-6, null, 1e-7, null, null], "deepinfra/ByteDance/Seed-2.0-pro": [5e-7, 3e-6, null, 1e-7, null, null], "ByteDance/Seed-2.0-pro": [5e-7, 3e-6, null, 1e-7, null, null], "deepinfra/zai-org/GLM-5": [6e-7, 208e-8, null, 12e-8, null, null], "deepinfra/nvidia/Nemotron-3-Nano-30B-A3B": [5e-8, 2e-7, null, 25e-9, null, null], "nvidia/Nemotron-3-Nano-30B-A3B": [5e-8, 2e-7, null, 25e-9, null, null], "deepinfra/moonshotai/Kimi-K2.7-Code": [68e-8, 34e-7, null, 136e-9, null, null], "deepinfra/anthropic/claude-sonnet-5": [2e-6, 1e-5, null, null, null, null], "anthropic/claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "deepinfra/Qwen/Qwen3.5-397B-A17B": [45e-8, 3e-6, null, 22e-8, null, null], "deepinfra/deepseek-ai/DeepSeek-V4-Flash-0731": [8e-8, 18e-8, null, 16e-9, null, null], "deepinfra/google/gemma-4-E4B-it": [2e-8, 1e-7, null, null, null, null], "google/gemma-4-E4B-it": [2e-8, 1e-7, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-V3.2": [26e-8, 38e-8, null, 13e-8, null, null], "deepinfra/Qwen/Qwen3.8-Max": [165e-8, 4951e-9, null, 206e-9, null, null], "Qwen/Qwen3.8-Max": [165e-8, 4951e-9, null, 206e-9, null, null], "deepinfra/anthropic/claude-fable-5": [1e-5, 5e-5, null, null, null, null], "anthropic/claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "deepinfra/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": [5e-7, 22e-7, null, 1e-7, null, null], "deepinfra/Qwen/Qwen3.5-122B-A10B": [29e-8, 24e-7, null, null, null, null], "Qwen/Qwen3.5-122B-A10B": [29e-8, 24e-7, null, null, null, null], "deepinfra/zai-org/GLM-5.1": [105e-8, 35e-7, null, 205e-9, null, null], "deepinfra/deepseek-ai/DeepSeek-V4-Pro": [13e-7, 26e-7, null, 1e-7, null, null], "deepinfra/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B": [85e-9, 4e-7, null, null, null, null], "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B": [85e-9, 4e-7, null, null, null, null], "deepinfra/zai-org/GLM-5.2": [75e-8, 24e-7, null, 14e-8, null, null], "deepinfra/moonshotai/Kimi-K3": [285e-8, 1425e-8, null, 285e-9, null, null], "deepinfra/anthropic/claude-opus-4-7": [5e-6, 25e-6, null, null, null, null], "deepinfra/Qwen/Qwen3.6-27B": [32e-8, 32e-7, null, null, null, null], "deepinfra/google/gemma-4-26B-A4B-it": [7e-8, 34e-8, null, null, null, null], "google/gemma-4-26B-A4B-it": [7e-8, 34e-8, null, null, null, null], "deepinfra/google/gemini-3.1-pro": [2e-6, 12e-6, null, null, null, null], "google/gemini-3.1-pro": [2e-6, 12e-6, null, null, null, null], "deepinfra/XiaomiMiMo/MiMo-V2.5-Pro": [1e-6, 3e-6, null, 2e-7, null, null], "XiaomiMiMo/MiMo-V2.5-Pro": [1e-6, 3e-6, null, 2e-7, null, null], "deepinfra/anthropic/claude-haiku-4-5": [1e-6, 5e-6, null, null, null, null], "deepinfra/deepseek-ai/DeepSeek-V4-Flash": [9e-8, 18e-8, null, 18e-9, null, null], "deepinfra/openai/gpt-oss-120b-Ultra": [2e-7, 95e-8, null, null, null, null], "openai/gpt-oss-120b-Ultra": [2e-7, 95e-8, null, null, null, null], "deepinfra/Qwen/Qwen3.5-9B": [1e-7, 15e-8, null, null, null, null], "deepinfra/MiniMaxAI/MiniMax-M2.7-Turbo": [38e-8, 17e-7, null, 7e-8, null, null], "MiniMaxAI/MiniMax-M2.7-Turbo": [38e-8, 17e-7, null, 7e-8, null, null], "deepinfra/zai-org/GLM-4.7": [4e-7, 175e-8, null, 8e-8, null, null], "deepinfra/google/gemma-4-31B-it": [13e-8, 38e-8, null, null, null, null], "gemini/gemini-omni-1.1-flash": [15e-7, 9e-6, null, null, null, null], "gemini-omni-1.1-flash": [15e-7, 9e-6, null, null, null, null], "xai/grok-4.20": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "groq/qwen/qwen3.8-27b": [8e-7, 4e-6, null, null, null, null], "qwen/qwen3.8-27b": [8e-7, 4e-6, null, null, null, null], "mistral/mistral-medium-3.5": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-medium-3.5": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-vibe-cli-latest": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-vibe-cli-latest": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-vibe-cli-with-tools": [15e-7, 75e-7, null, 15e-8, null, null], "mistral-vibe-cli-with-tools": [15e-7, 75e-7, null, 15e-8, null, null], "mistral/mistral-vibe-cli-fast": [15e-8, 6e-7, null, 15e-9, null, null], "mistral-vibe-cli-fast": [15e-8, 6e-7, null, 15e-9, null, null], "mistral/mistral-code-latest": [3e-7, 9e-7, null, 3e-8, null, null], "mistral-code-latest": [3e-7, 9e-7, null, 3e-8, null, null], "mistral/mistral-code-fim-latest": [3e-7, 9e-7, null, 3e-8, null, null], "mistral-code-fim-latest": [3e-7, 9e-7, null, 3e-8, null, null], "mistral/mistral-code-agent-latest": [4e-7, 2e-6, null, 4e-8, null, null], "mistral-code-agent-latest": [4e-7, 2e-6, null, 4e-8, null, null], "mistral/labs-leanstral-1-5-1": [0, 0, null, null, null, null], "labs-leanstral-1-5-1": [0, 0, null, null, null, null], "fireworks_ai/accounts/fireworks/models/glm-5p3": [14e-7, 44e-7, null, 26e-8, 1.25, null], "accounts/fireworks/models/glm-5p3": [14e-7, 44e-7, null, 26e-8, 1.25, null], "fireworks_ai/accounts/fireworks/routers/glm-5p3-us": [21e-7, 66e-7, null, 39e-8, 1.25, null], "accounts/fireworks/routers/glm-5p3-us": [21e-7, 66e-7, null, 39e-8, 1.25, null], "fireworks_ai/glm-5p3": [14e-7, 44e-7, null, 26e-8, 1.25, null], "glm-5p3": [14e-7, 44e-7, null, 26e-8, 1.25, null], "fireworks_ai/glm-5p3-us": [21e-7, 66e-7, null, 39e-8, 1.25, null], "glm-5p3-us": [21e-7, 66e-7, null, 39e-8, 1.25, null], "fireworks_ai/accounts/fireworks/routers/glm-5p3-fast": [21e-7, 66e-7, null, 39e-8, null, null], "accounts/fireworks/routers/glm-5p3-fast": [21e-7, 66e-7, null, 39e-8, null, null], "fireworks_ai/glm-5p3-fast": [21e-7, 66e-7, null, 39e-8, null, null], "glm-5p3-fast": [21e-7, 66e-7, null, 39e-8, null, null], "fireworks_ai/accounts/fireworks/models/glm-5p3-flash": [15e-8, 5e-7, null, 3e-8, 1.25, null], "accounts/fireworks/models/glm-5p3-flash": [15e-8, 5e-7, null, 3e-8, 1.25, null], "fireworks_ai/accounts/fireworks/routers/glm-5p3-flash-us": [225e-9, 75e-8, null, 45e-9, 1.25, null], "accounts/fireworks/routers/glm-5p3-flash-us": [225e-9, 75e-8, null, 45e-9, 1.25, null], "fireworks_ai/glm-5p3-flash": [15e-8, 5e-7, null, 3e-8, 1.25, null], "glm-5p3-flash": [15e-8, 5e-7, null, 3e-8, 1.25, null], "fireworks_ai/glm-5p3-flash-us": [225e-9, 75e-8, null, 45e-9, 1.25, null], "glm-5p3-flash-us": [225e-9, 75e-8, null, 45e-9, 1.25, null], "fireworks_ai/accounts/fireworks/models/inkling": [1e-6, 405e-8, null, 17e-8, 1, null], "accounts/fireworks/models/inkling": [1e-6, 405e-8, null, 17e-8, 1, null], "fireworks_ai/accounts/fireworks/models/qwen3-embedding-8b": [1e-7, 0, null, null, null, null], "accounts/fireworks/models/qwen3-embedding-8b": [1e-7, 0, null, null, null, null], "zai/glm-5.2": [14e-7, 44e-7, 0, 26e-8, null, null], "together_ai/Qwen/Qwen3.8-Flash": [9e-8, 282e-9, null, null, null, null], "Qwen/Qwen3.8-Flash": [9e-8, 282e-9, null, null, null, null], "together_ai/moonshotai/Kimi-K2.5-fp4": [5e-7, 28e-7, null, null, null, null], "moonshotai/Kimi-K2.5-fp4": [5e-7, 28e-7, null, null, null, null], "together_ai/MiniMaxAI/MiniMax-M2.7": [3e-7, 12e-7, null, 6e-8, null, null], "together_ai/deepseek-ai/DeepSeek-R1-0528": [3e-6, 7e-6, null, null, null, null], "together_ai/mistralai/Ministral-3-14B-Instruct-2512": [2e-7, 2e-7, null, null, null, null], "mistralai/Ministral-3-14B-Instruct-2512": [2e-7, 2e-7, null, null, null, null], "together_ai/nvidia/NVIDIA-Nemotron-Nano-9B-v2": [6e-8, 25e-8, null, null, null, null], "together_ai/mistralai/Mistral-7B-Instruct-v0.3": [2e-7, 2e-7, null, null, null, null], "mistralai/Mistral-7B-Instruct-v0.3": [2e-7, 2e-7, null, null, null, null], "cerebras/gemma-4-31b": [99e-8, 149e-8, null, null, null, null], "gemma-4-31b": [99e-8, 149e-8, null, null, null, null], "scaleway/glm-5.2": [18e-7, 55e-7, null, null, null, null], "scaleway/deepseek-v4-flash-0731": [4e-7, 8e-7, null, 8e-8, null, null], "azure_ai/kimi-k2.7-code": [95e-8, 4e-6, null, 19e-8, null, null], "azure_ai/deepseek-v4.1-flash": [3e-7, 12e-7, null, 6e-9, null, null], "deepseek-v4.1-flash": [3e-7, 12e-7, null, 6e-9, null, null], "azure_ai/FW-DeepSeek-V4.1-Flash": [375e-9, 15e-7, null, 8e-9, null, null], "FW-DeepSeek-V4.1-Flash": [375e-9, 15e-7, null, 8e-9, null, null], "azure_ai/FW-DeepSeek-V4-Flash": [15e-8, 31e-8, null, 3e-8, null, null], "FW-DeepSeek-V4-Flash": [15e-8, 31e-8, null, 3e-8, null, null], "azure_ai/FW-GLM-5.3": [175e-8, 55e-7, null, 325e-9, null, null], "FW-GLM-5.3": [175e-8, 55e-7, null, 325e-9, null, null], "azure_ai/FW-GLM-5.3-Flash": [188e-9, 625e-9, null, 38e-9, null, null], "FW-GLM-5.3-Flash": [188e-9, 625e-9, null, 38e-9, null, null], "azure_ai/FW-GPT-OSS-120B": [165e-9, 66e-8, null, 82e-9, null, null], "FW-GPT-OSS-120B": [165e-9, 66e-8, null, 82e-9, null, null], "azure_ai/Cohere-command-a-plus-05-2026": [8e-7, 32e-7, null, null, null, null], "Cohere-command-a-plus-05-2026": [8e-7, 32e-7, null, null, null, null], "azure_ai/mistral-medium-3-5": [15e-7, 75e-7, null, null, null, null], "azure_ai/deepseek-r1": [135e-8, 54e-7, null, null, null, null], "azure_ai/deepseek-v3-0324": [114e-8, 456e-8, null, null, null, null], "azure_ai/deepseek-v3.1": [123e-8, 494e-8, null, null, null, null], "deepseek-v3.1": [123e-8, 494e-8, null, null, null, null], "azure_ai/grok-3": [3e-6, 15e-6, null, null, null, null], "grok-3": [3e-6, 15e-6, null, null, null, null], "azure_ai/grok-3-mini": [25e-8, 127e-8, null, null, null, null], "grok-3-mini": [25e-8, 127e-8, null, null, null, null], "azure_ai/grok-4-fast-non-reasoning": [2e-7, 5e-7, null, null, null, null], "grok-4-fast-non-reasoning": [2e-7, 5e-7, null, null, null, null], "azure_ai/grok-4-fast-reasoning": [2e-7, 5e-7, null, null, null, null], "grok-4-fast-reasoning": [2e-7, 5e-7, null, null, null, null], "bedrock/us-gov-west-1/nvidia.nemotron-nano-3-30b": [72e-9, 288e-9, null, null, null, null], "us-gov-west-1/nvidia.nemotron-nano-3-30b": [72e-9, 288e-9, null, null, null, null], "bedrock/us-gov-west-1/nvidia.nemotron-nano-12b-v2": [24e-8, 72e-8, null, null, null, null], "us-gov-west-1/nvidia.nemotron-nano-12b-v2": [24e-8, 72e-8, null, null, null, null], "bedrock/us-gov-west-1/nvidia.nemotron-nano-9b-v2": [72e-9, 276e-9, null, null, null, null], "us-gov-west-1/nvidia.nemotron-nano-9b-v2": [72e-9, 276e-9, null, null, null, null], "bedrock/us-gov-west-1/nvidia.nemotron-super-3-120b": [18e-8, 78e-8, null, null, null, null], "us-gov-west-1/nvidia.nemotron-super-3-120b": [18e-8, 78e-8, null, null, null, null], "bedrock/us-gov-west-1/openai.gpt-oss-20b-1:0": [84e-9, 36e-8, null, null, null, null], "us-gov-west-1/openai.gpt-oss-20b-1:0": [84e-9, 36e-8, null, null, null, null], "bedrock/us-gov-west-1/openai.gpt-oss-120b-1:0": [18e-8, 72e-8, null, null, null, null], "us-gov-west-1/openai.gpt-oss-120b-1:0": [18e-8, 72e-8, null, null, null, null], "bedrock/us-gov-west-1/anthropic.claude-sonnet-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us-gov-west-1/anthropic.claude-sonnet-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-opus-4-8": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov-west-1/anthropic.claude-opus-4-8": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "bedrock/us-gov-west-1/anthropic.claude-opus-5": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov-west-1/anthropic.claude-opus-5": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "bedrock/us-gov-west-1/anthropic.claude-opus-5-5": [48e-7, 24e-6, 6e-6, 24e-8, null, null], "us-gov-west-1/anthropic.claude-opus-5-5": [48e-7, 24e-6, 6e-6, 24e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-fable-5-1": [12e-6, 6e-5, 15e-6, 3e-7, null, null], "us-gov-west-1/anthropic.claude-fable-5-1": [12e-6, 6e-5, 15e-6, 3e-7, null, null], "bedrock/us-gov-east-1/nvidia.nemotron-nano-3-30b": [72e-9, 288e-9, null, null, null, null], "us-gov-east-1/nvidia.nemotron-nano-3-30b": [72e-9, 288e-9, null, null, null, null], "bedrock/us-gov-east-1/nvidia.nemotron-nano-12b-v2": [24e-8, 72e-8, null, null, null, null], "us-gov-east-1/nvidia.nemotron-nano-12b-v2": [24e-8, 72e-8, null, null, null, null], "bedrock/us-gov-east-1/nvidia.nemotron-nano-9b-v2": [72e-9, 276e-9, null, null, null, null], "us-gov-east-1/nvidia.nemotron-nano-9b-v2": [72e-9, 276e-9, null, null, null, null], "bedrock/us-gov-east-1/nvidia.nemotron-super-3-120b": [18e-8, 78e-8, null, null, null, null], "us-gov-east-1/nvidia.nemotron-super-3-120b": [18e-8, 78e-8, null, null, null, null], "bedrock/us-gov-east-1/openai.gpt-oss-20b-1:0": [84e-9, 36e-8, null, null, null, null], "us-gov-east-1/openai.gpt-oss-20b-1:0": [84e-9, 36e-8, null, null, null, null], "bedrock/us-gov-east-1/openai.gpt-oss-120b-1:0": [18e-8, 72e-8, null, null, null, null], "us-gov-east-1/openai.gpt-oss-120b-1:0": [18e-8, 72e-8, null, null, null, null], "bedrock/us-gov-east-1/anthropic.claude-sonnet-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us-gov-east-1/anthropic.claude-sonnet-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "bedrock/us-gov-east-1/anthropic.claude-opus-4-8": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov-east-1/anthropic.claude-opus-4-8": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "bedrock/us-gov-east-1/anthropic.claude-opus-5": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "us-gov-east-1/anthropic.claude-opus-5": [6e-6, 3e-5, 75e-7, 6e-7, null, null], "bedrock/us-gov-east-1/anthropic.claude-opus-5-5": [48e-7, 24e-6, 6e-6, 24e-8, null, null], "us-gov-east-1/anthropic.claude-opus-5-5": [48e-7, 24e-6, 6e-6, 24e-8, null, null], "bedrock/us-gov-east-1/anthropic.claude-fable-5-1": [12e-6, 6e-5, 15e-6, 3e-7, null, null], "us-gov-east-1/anthropic.claude-fable-5-1": [12e-6, 6e-5, 15e-6, 3e-7, null, null], "bedrock_mantle/us-gov-west-1/openai.gpt-5.6-terra": [264e-8, 1584e-8, 33e-7, 264e-9, null, { threshold: 272e3, input: 528e-8, output: 2376e-8, cacheWrite: 66e-7, cacheRead: 528e-9 }], "us-gov-west-1/openai.gpt-5.6-terra": [264e-8, 1584e-8, 33e-7, 264e-9, null, { threshold: 272e3, input: 528e-8, output: 2376e-8, cacheWrite: 66e-7, cacheRead: 528e-9 }], "bedrock_mantle/us-gov-west-1/openai.gpt-5.6-luna": [264e-9, 1584e-9, 33e-8, 264e-10, null, { threshold: 272e3, input: 528e-9, output: 2376e-9, cacheWrite: 66e-8, cacheRead: 528e-10 }], "us-gov-west-1/openai.gpt-5.6-luna": [264e-9, 1584e-9, 33e-8, 264e-10, null, { threshold: 272e3, input: 528e-9, output: 2376e-9, cacheWrite: 66e-8, cacheRead: 528e-10 }], "bedrock_mantle/us-gov-west-1/openai.gpt-5.4": [33e-7, 198e-7, null, 33e-8, null, null], "us-gov-west-1/openai.gpt-5.4": [33e-7, 198e-7, null, 33e-8, null, null], "bedrock_mantle/us-gov-west-1/xai.grok-4.3": [15e-7, 3e-6, null, 24e-8, null, null], "us-gov-west-1/xai.grok-4.3": [15e-7, 3e-6, null, 24e-8, null, null], "bedrock_mantle/us-gov-west-1/xai.grok-4.6": [264e-8, 792e-8, null, 66e-8, null, null], "us-gov-west-1/xai.grok-4.6": [264e-8, 792e-8, null, 66e-8, null, null], "bedrock_mantle/us-gov-west-1/google.gemma-4-e2b": [48e-9, 96e-9, null, null, null, null], "us-gov-west-1/google.gemma-4-e2b": [48e-9, 96e-9, null, null, null, null], "bedrock_mantle/us-gov-west-1/google.gemma-4-26b-a4b": [156e-9, 48e-8, null, null, null, null], "us-gov-west-1/google.gemma-4-26b-a4b": [156e-9, 48e-8, null, null, null, null], "bedrock_mantle/us-gov-west-1/google.gemma-4-31b": [168e-9, 48e-8, null, null, null, null], "us-gov-west-1/google.gemma-4-31b": [168e-9, 48e-8, null, null, null, null], "bedrock_mantle/us-gov-west-1/openai.gpt-oss-20b": [84e-9, 36e-8, null, null, null, null], "us-gov-west-1/openai.gpt-oss-20b": [84e-9, 36e-8, null, null, null, null], "bedrock_mantle/us-gov-west-1/openai.gpt-oss-120b": [18e-8, 72e-8, null, null, null, null], "us-gov-west-1/openai.gpt-oss-120b": [18e-8, 72e-8, null, null, null, null], "bedrock_mantle/us-gov-east-1/openai.gpt-5.4": [33e-7, 198e-7, null, 33e-8, null, null], "us-gov-east-1/openai.gpt-5.4": [33e-7, 198e-7, null, 33e-8, null, null], "bedrock_mantle/us-gov-east-1/xai.grok-4.6": [264e-8, 792e-8, null, 66e-8, null, null], "us-gov-east-1/xai.grok-4.6": [264e-8, 792e-8, null, 66e-8, null, null], "bedrock_mantle/us-gov-east-1/openai.gpt-oss-20b": [84e-9, 36e-8, null, null, null, null], "us-gov-east-1/openai.gpt-oss-20b": [84e-9, 36e-8, null, null, null, null], "bedrock_mantle/us-gov-east-1/openai.gpt-oss-120b": [18e-8, 72e-8, null, null, null, null], "us-gov-east-1/openai.gpt-oss-120b": [18e-8, 72e-8, null, null, null, null], "bedrock_mantle/deepseek.v3.1": [58e-8, 168e-8, null, null, null, null], "deepseek.v3.1": [58e-8, 168e-8, null, null, null, null], "bedrock_mantle/moonshotai.kimi-k2-thinking": [6e-7, 25e-7, null, null, null, null], "bedrock_mantle/qwen.qwen3-235b-a22b-2507": [22e-8, 88e-8, null, null, null, null], "qwen.qwen3-235b-a22b-2507": [22e-8, 88e-8, null, null, null, null], "bedrock_mantle/qwen.qwen3-32b": [15e-8, 6e-7, null, null, null, null], "qwen.qwen3-32b": [15e-8, 6e-7, null, null, null, null], "bedrock_mantle/qwen.qwen3-coder-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "qwen.qwen3-coder-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "bedrock_mantle/qwen.qwen3-coder-480b-a35b-instruct": [45e-8, 18e-7, null, null, null, null], "qwen.qwen3-coder-480b-a35b-instruct": [45e-8, 18e-7, null, null, null, null], "bedrock_mantle/qwen.qwen3-next-80b-a3b-instruct": [14e-8, 12e-7, null, null, null, null], "qwen.qwen3-next-80b-a3b-instruct": [14e-8, 12e-7, null, null, null, null], "bedrock_mantle/qwen.qwen3-vl-235b-a22b-instruct": [53e-8, 266e-8, null, null, null, null], "qwen.qwen3-vl-235b-a22b-instruct": [53e-8, 266e-8, null, null, null, null], "azure/us-gov/gpt-5.1": [171875e-11, 1375e-8, null, 171875e-12, null, null], "us-gov/gpt-5.1": [171875e-11, 1375e-8, null, 171875e-12, null, null], "azure/us-gov/o3-mini": [1513e-9, 605e-8, null, 757e-9, null, null], "us-gov/o3-mini": [1513e-9, 605e-8, null, 757e-9, null, null], "azure/us-gov/text-embedding-3-large": [163e-9, 0, null, null, null, null], "us-gov/text-embedding-3-large": [163e-9, 0, null, null, null, null], "azure/us-gov/text-embedding-3-small": [25e-9, 0, null, null, null, null], "us-gov/text-embedding-3-small": [25e-9, 0, null, null, null, null], "gemini/lyria-3.5-clip-preview": [0, 0, null, null, null, null], "lyria-3.5-clip-preview": [0, 0, null, null, null, null], "gemini/lyria-3.5-pro-preview": [0, 0, null, null, null, null], "lyria-3.5-pro-preview": [0, 0, null, null, null, null], "gemini/lyria-3.5": [0, 0, null, null, null, null], "lyria-3.5": [0, 0, null, null, null, null], "gemini/lyria-realtime-exp": [0, 0, null, null, null, null], "lyria-realtime-exp": [0, 0, null, null, null, null], "perplexity/anthropic/claude-fable-5": [1e-5, 5e-5, null, 1e-6, null, null], "perplexity/anthropic/claude-opus-5": [5e-6, 25e-6, null, 5e-7, null, null], "perplexity/anthropic/claude-opus-4-8": [5e-6, 25e-6, null, 5e-7, null, null], "perplexity/anthropic/claude-sonnet-5": [2e-6, 1e-5, null, 2e-7, null, null], "perplexity/anthropic/claude-sonnet-4-6": [3e-6, 15e-6, null, 3e-7, null, null], "perplexity/openai/gpt-5.6-sol": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "perplexity/openai/gpt-5.6-terra": [2e-6, 12e-6, null, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "openai/gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "perplexity/openai/gpt-5.6-luna": [2e-7, 12e-7, null, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: null, cacheRead: 4e-8 }], "openai/gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }], "perplexity/openai/gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: null }], "openai/gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: null }], "perplexity/openai/gpt-5.4": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: null }], "openai/gpt-5.4": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: null }], "perplexity/openai/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, null, null], "openai/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, null, null], "perplexity/openai/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null], "openai/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null], "perplexity/openai/gpt-5": [125e-8, 1e-5, null, 125e-9, null, null], "perplexity/google/gemini-3.1-pro-preview": [2e-6, 12e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "perplexity/google/gemini-3.1-flash-lite": [25e-8, 15e-7, null, 25e-9, null, null], "perplexity/google/gemini-3.5-flash": [15e-7, 9e-6, null, 15e-8, null, null], "perplexity/google/gemini-3.5-flash-lite": [3e-7, 25e-7, null, 3e-8, null, null], "google/gemini-3.5-flash-lite": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "perplexity/google/gemini-3.6-flash": [15e-7, 75e-7, null, 15e-8, null, null], "google/gemini-3.6-flash": [15e-7, 75e-7, null, 15e-8, null, null], "perplexity/google/gemini-3.7-flash": [75e-8, 375e-8, null, 75e-9, null, null], "perplexity/xai/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "perplexity/xai/grok-4.5": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "perplexity/xai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: null }], "perplexity/xai/grok-4.20-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: null }], "perplexity/xai/grok-4.20-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: null }], "perplexity/xai/grok-4.20-multi-agent": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: null }], "perplexity/perplexity/glm-5.3": [14e-7, 44e-7, null, 26e-8, null, null], "perplexity/glm-5.3": [14e-7, 44e-7, null, 26e-8, null, null], "perplexity/perplexity/glm-5.3-flash": [15e-8, 5e-7, null, 3e-8, null, null], "perplexity/glm-5.3-flash": [15e-8, 5e-7, null, 3e-8, null, null], "perplexity/perplexity/nemotron-3.5-lightning-30b-a3b": [115e-10, 17e-8, null, 115e-11, null, null], "perplexity/nemotron-3.5-lightning-30b-a3b": [115e-10, 17e-8, null, 115e-11, null, null], "perplexity/perplexity/nemotron-3-ultra-550b-a55b": [25e-8, 25e-7, null, 25e-8, null, null], "perplexity/nemotron-3-ultra-550b-a55b": [25e-8, 25e-7, null, 25e-8, null, null], "openrouter/anthropic/claude-fable-5": [1e-5, 5e-5, 125e-7, 1e-6, null, null], "openrouter/anthropic/claude-fable-5.1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "anthropic/claude-fable-5.1": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "openrouter/anthropic/claude-opus-4.8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic/claude-opus-4.8": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "openrouter/google/gemini-2.5-flash-lite": [1e-7, 4e-7, 833333333333333e-22, 1e-8, null, null], "google/gemini-2.5-flash-lite": [1e-7, 4e-7, 833333333333333e-22, 1e-8, null, null], "openrouter/google/gemini-3.5-flash": [15e-7, 9e-6, 833333333333333e-22, 15e-8, null, null], "openrouter/google/gemini-3.5-flash-lite": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "openrouter/google/gemini-3.6-flash": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "openrouter/google/gemini-3.7-flash": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "openrouter/google/gemini-3.8-flash": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "google/gemini-3.8-flash": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "openrouter/openai/gpt-4o-mini": [15e-8, 6e-7, null, 75e-9, null, null], "openrouter/openai/gpt-5.1": [125e-8, 1e-5, null, 125e-9, null, null], "openrouter/openai/gpt-5.3-codex": [175e-8, 14e-6, null, 175e-9, null, null], "openai/gpt-5.3-codex": [175e-8, 14e-6, null, 175e-9, null, null], "openrouter/openai/gpt-5.4": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "openrouter/openai/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, null, null], "openrouter/openai/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null], "openrouter/openai/gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "openrouter/openai/gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }], "openrouter/openai/gpt-5.6-luna-pro": [2e-7, 12e-7, 25e-8, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }], "openai/gpt-5.6-luna-pro": [2e-7, 12e-7, 25e-8, 2e-8, null, { threshold: 272e3, input: 4e-7, output: 18e-7, cacheWrite: 5e-7, cacheRead: 4e-8 }], "openrouter/openai/gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/gpt-5.6-terra-pro": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai/gpt-5.6-terra-pro": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/o3": [2e-6, 8e-6, null, 5e-7, null, null], "openrouter/openai/o4-mini": [11e-7, 44e-7, null, 275e-9, null, null], "openrouter/x-ai/grok-4.20": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "x-ai/grok-4.20": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/x-ai/grok-4.20-multi-agent": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "x-ai/grok-4.20-multi-agent": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/x-ai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "x-ai/grok-4.3": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/x-ai/grok-4.5": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "x-ai/grok-4.5": [2e-6, 6e-6, null, 3e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 6e-7 }], "openrouter/x-ai/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "x-ai/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, { threshold: 2e5, input: 4e-6, output: 12e-6, cacheWrite: null, cacheRead: 1e-6 }], "openrouter/x-ai/grok-build-0.1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "x-ai/grok-build-0.1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "baseten/zai-org/GLM-5.3": [14e-7, 44e-7, null, 14e-8, null, null], "baseten/zai-org/GLM-5.3-Fast": [21e-7, 66e-7, null, 21e-8, null, null], "zai-org/GLM-5.3-Fast": [21e-7, 66e-7, null, 21e-8, null, null], "openrouter/minimax/minimax-m3": [3e-7, 12e-7, null, 6e-8, null, null], "openrouter/qwen/qwen3.7-plus": [32e-8, 128e-8, 4e-7, 64e-9, null, { threshold: 256e3, input: 96e-8, output: 384e-8, cacheWrite: 12e-7, cacheRead: 192e-9 }], "qwen/qwen3.7-plus": [32e-8, 128e-8, 4e-7, 64e-9, null, { threshold: 256e3, input: 96e-8, output: 384e-8, cacheWrite: 12e-7, cacheRead: 192e-9 }], "openrouter/openai/gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openai/gpt-6-astra": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openrouter/openai/gpt-6-astra-pro": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openai/gpt-6-astra-pro": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openrouter/qwen/qwen3.8-flash": [15e-8, 47e-8, 2e-7, 16e-9, null, null], "qwen/qwen3.8-flash": [15e-8, 47e-8, 2e-7, 16e-9, null, null], "openrouter/z-ai/glm-5.3-flash": [15e-8, 5e-7, null, 3e-8, null, null], "z-ai/glm-5.3-flash": [15e-8, 5e-7, null, 3e-8, null, null], "openrouter/deepseek/deepseek-v4-flash-vision-exp": [44e-8, 132e-8, null, 14e-9, null, null], "openrouter/z-ai/glm-5.3": [3556e-10, 2574e-9, null, 6604e-11, null, null], "z-ai/glm-5.3": [3556e-10, 2574e-9, null, 6604e-11, null, null], "openrouter/qwen/qwen3.8-27b": [42e-8, 3e-6, null, 85e-9, null, null], "openrouter/qwen/qwen3.8-2.4t-a95b": [2e-6, 6e-6, null, 25e-8, null, null], "qwen/qwen3.8-2.4t-a95b": [2e-6, 6e-6, null, 25e-8, null, null], "openrouter/nvidia/nemotron-3.5-lightning:free": [0, 0, null, null, null, null], "nvidia/nemotron-3.5-lightning:free": [0, 0, null, null, null, null], "openrouter/qwen/qwen3.8-max": [2e-6, 6e-6, 25e-7, 25e-8, null, null], "openrouter/qwen/qwen3.8-max-0902": [2e-6, 6e-6, 25e-7, 25e-8, null, null], "qwen/qwen3.8-max-0902": [2e-6, 6e-6, 25e-7, 25e-8, null, null], "openrouter/qwen/qwen3.8-max-prime": [4e-6, 12e-6, null, 5e-7, null, null], "qwen/qwen3.8-max-prime": [4e-6, 12e-6, null, 5e-7, null, null], "openrouter/deepseek/deepseek-v4-flash-0731": [21e-9, 32e-8, null, 16e-9, null, null], "openrouter/qwen/qwen3.7-flash": [3e-8, 13e-8, 38e-9, 6e-9, null, { threshold: 256e3, input: 2e-7, output: 8e-7, cacheWrite: 25e-8, cacheRead: 4e-8 }], "qwen/qwen3.7-flash": [3e-8, 13e-8, 38e-9, 6e-9, null, { threshold: 256e3, input: 2e-7, output: 8e-7, cacheWrite: 25e-8, cacheRead: 4e-8 }], "openrouter/poolside/laguna-s-2.1": [9e-8, 18e-8, null, 9e-9, null, null], "poolside/laguna-s-2.1": [9e-8, 18e-8, null, 9e-9, null, null], "openrouter/poolside/laguna-s-2.1:free": [0, 0, null, null, null, null], "poolside/laguna-s-2.1:free": [0, 0, null, null, null, null], "openrouter/moonshotai/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "openrouter/poolside/laguna-xs-2.1": [6e-8, 12e-8, null, 3e-8, null, null], "poolside/laguna-xs-2.1": [6e-8, 12e-8, null, 3e-8, null, null], "openrouter/poolside/laguna-xs-2.1:free": [0, 0, null, null, null, null], "poolside/laguna-xs-2.1:free": [0, 0, null, null, null, null], "openrouter/google/gemini-3.1-flash-lite-image": [25e-8, 15e-7, null, null, null, null], "google/gemini-3.1-flash-lite-image": [25e-8, 15e-7, null, null, null, null], "openrouter/google/gemini-3.1-flash-image": [5e-7, 3e-6, null, null, null, null], "google/gemini-3.1-flash-image": [5e-7, 3e-6, null, null, null, null], "openrouter/google/gemini-3-pro-image": [2e-6, 12e-6, 375e-9, 2e-7, null, null], "google/gemini-3-pro-image": [2e-6, 12e-6, 375e-9, 2e-7, null, null], "openrouter/z-ai/glm-5.2": [6496e-10, 20416e-10, null, 12064e-11, null, null], "z-ai/glm-5.2": [6496e-10, 20416e-10, null, 12064e-11, null, null], "openrouter/z-ai/glm-5.2:free": [0, 0, null, null, null, null], "z-ai/glm-5.2:free": [0, 0, null, null, null, null], "openrouter/moonshotai/kimi-k2.7-code": [6562e-10, 33e-7, null, 18e-8, null, null], "openrouter/nvidia/nemotron-3.5-content-safety": [2e-7, 2e-7, null, null, null, null], "nvidia/nemotron-3.5-content-safety": [2e-7, 2e-7, null, null, null, null], "openrouter/nvidia/nemotron-3.5-content-safety:free": [0, 0, null, null, null, null], "nvidia/nemotron-3.5-content-safety:free": [0, 0, null, null, null, null], "openrouter/nvidia/nemotron-3-ultra-550b-a55b": [6e-7, 24e-7, null, 12e-8, null, null], "nvidia/nemotron-3-ultra-550b-a55b": [6e-7, 24e-7, null, 12e-8, null, null], "openrouter/nvidia/nemotron-3-ultra-550b-a55b:free": [0, 0, null, null, null, null], "nvidia/nemotron-3-ultra-550b-a55b:free": [0, 0, null, null, null, null], "openrouter/minimax/minimax-m3:free": [0, 0, null, null, null, null], "minimax/minimax-m3:free": [0, 0, null, null, null, null], "openrouter/qwen/qwen3.7-max": [1475e-9, 4425e-9, 184375e-11, 295e-9, null, null], "openrouter/mistralai/mistral-medium-3-5": [15e-7, 75e-7, null, null, null, null], "mistralai/mistral-medium-3-5": [15e-7, 75e-7, null, null, null, null], "openrouter/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free": [0, 0, null, null, null, null], "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free": [0, 0, null, null, null, null], "openrouter/qwen/qwen3.5-plus-20260420": [3e-7, 18e-7, 375e-9, null, null, { threshold: 256e3, input: 375e-9, output: 225e-8, cacheWrite: 46875e-11, cacheRead: null }], "qwen/qwen3.5-plus-20260420": [3e-7, 18e-7, 375e-9, null, null, { threshold: 256e3, input: 375e-9, output: 225e-8, cacheWrite: 46875e-11, cacheRead: null }], "openrouter/qwen/qwen3.6-flash": [1875e-10, 1125e-9, 234375e-12, null, null, { threshold: 256e3, input: 75e-8, output: 3e-6, cacheWrite: 9375e-10, cacheRead: null }], "qwen/qwen3.6-flash": [1875e-10, 1125e-9, 234375e-12, null, null, { threshold: 256e3, input: 75e-8, output: 3e-6, cacheWrite: 9375e-10, cacheRead: null }], "openrouter/qwen/qwen3.6-35b-a3b": [15e-8, 1e-6, null, 5e-8, null, null], "openrouter/qwen/qwen3.6-max-preview": [1027e-9, 6162e-9, 128375e-11, null, null, { threshold: 128e3, input: 158e-8, output: 948e-8, cacheWrite: 1975e-9, cacheRead: null }], "qwen/qwen3.6-max-preview": [1027e-9, 6162e-9, 128375e-11, null, null, { threshold: 128e3, input: 158e-8, output: 948e-8, cacheWrite: 1975e-9, cacheRead: null }], "openrouter/qwen/qwen3.6-27b": [32e-8, 32e-7, null, 15e-8, null, null], "openrouter/openai/gpt-5.5-pro": [3e-5, 18e-5, null, null, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: null }], "openai/gpt-5.5-pro": [3e-5, 18e-5, null, null, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: null }], "openrouter/openai/gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "openai/gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "openrouter/deepseek/deepseek-v4-flash": [14e-8, 28e-8, null, 28e-9, null, null], "openrouter/moonshotai/kimi-k2.6": [95e-8, 4e-6, null, 16e-8, null, null], "openrouter/google/gemma-4-26b-a4b-it": [675e-10, 225e-9, null, 375e-10, null, null], "openrouter/google/gemma-4-26b-a4b-it:free": [0, 0, null, null, null, null], "google/gemma-4-26b-a4b-it:free": [0, 0, null, null, null, null], "openrouter/google/gemma-4-31b-it": [9e-8, 34e-8, null, 5e-8, null, null], "openrouter/google/gemma-4-31b-it:free": [0, 0, null, null, null, null], "google/gemma-4-31b-it:free": [0, 0, null, null, null, null], "openrouter/z-ai/glm-5v-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "z-ai/glm-5v-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "openrouter/minimax/minimax-m2.7": [3e-7, 12e-7, null, 6e-8, null, null], "openrouter/minimax/minimax-m2.7:free": [0, 0, null, null, null, null], "minimax/minimax-m2.7:free": [0, 0, null, null, null, null], "openrouter/mistralai/mistral-small-2603": [15e-8, 6e-7, null, 15e-9, null, null], "mistralai/mistral-small-2603": [15e-8, 6e-7, null, 15e-9, null, null], "openrouter/z-ai/glm-5-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "z-ai/glm-5-turbo": [12e-7, 4e-6, null, 24e-8, null, null], "openrouter/nvidia/nemotron-3-super-120b-a12b": [8e-8, 45e-8, null, null, null, null], "openrouter/nvidia/nemotron-3-super-120b-a12b:free": [0, 0, null, null, null, null], "nvidia/nemotron-3-super-120b-a12b:free": [0, 0, null, null, null, null], "openrouter/qwen/qwen3.5-9b": [1e-7, 15e-8, null, null, null, null], "qwen/qwen3.5-9b": [1e-7, 15e-8, null, null, null, null], "openrouter/openai/gpt-5.4-pro": [3e-5, 18e-5, null, null, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: null }], "openai/gpt-5.4-pro": [3e-5, 18e-5, null, null, null, { threshold: 272e3, input: 6e-5, output: 27e-5, cacheWrite: null, cacheRead: null }], "openrouter/google/gemini-3.1-flash-image-preview": [5e-7, 3e-6, null, null, null, null], "google/gemini-3.1-flash-image-preview": [5e-7, 3e-6, null, null, null, null], "openrouter/google/gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "google/gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/qwen/qwen3-max-thinking": [78e-8, 39e-7, null, null, null, { threshold: 128e3, input: 195e-8, output: 975e-8, cacheWrite: null, cacheRead: null }], "qwen/qwen3-max-thinking": [78e-8, 39e-7, null, null, null, { threshold: 128e3, input: 195e-8, output: 975e-8, cacheWrite: null, cacheRead: null }], "openrouter/qwen/qwen3-coder-next": [12e-8, 8e-7, null, 7e-8, null, null], "openrouter/minimax/minimax-m2-her": [3e-7, 12e-7, null, 3e-8, null, null], "minimax/minimax-m2-her": [3e-7, 12e-7, null, 3e-8, null, null], "openrouter/openai/gpt-audio": [25e-7, 1e-5, null, null, null, null], "openai/gpt-audio": [25e-7, 1e-5, null, null, null, null], "openrouter/openai/gpt-audio-mini": [6e-7, 24e-7, null, null, null, null], "openai/gpt-audio-mini": [6e-7, 24e-7, null, null, null, null], "openrouter/nvidia/nemotron-3-nano-30b-a3b": [5e-8, 2e-7, null, 3e-8, null, null], "openrouter/z-ai/glm-4.6v": [3e-7, 9e-7, null, 55e-9, null, null], "z-ai/glm-4.6v": [3e-7, 9e-7, null, 55e-9, null, null], "openrouter/google/gemini-3-pro-image-preview": [2e-6, 12e-6, 375e-9, 2e-7, null, null], "google/gemini-3-pro-image-preview": [2e-6, 12e-6, 375e-9, 2e-7, null, null], "openrouter/openai/gpt-5.1-codex": [125e-8, 1e-5, null, 13e-8, null, null], "openai/gpt-5.1-codex": [125e-8, 1e-5, null, 13e-8, null, null], "openrouter/openai/gpt-5.1-codex-mini": [25e-8, 2e-6, null, 3e-8, null, null], "openai/gpt-5.1-codex-mini": [25e-8, 2e-6, null, 3e-8, null, null], "openrouter/moonshotai/kimi-k2-thinking": [6e-7, 25e-7, null, 15e-8, null, null], "openrouter/mistralai/voxtral-small-24b-2507": [1e-7, 3e-7, null, 1e-8, null, null], "mistralai/voxtral-small-24b-2507": [1e-7, 3e-7, null, 1e-8, null, null], "openrouter/openai/gpt-oss-safeguard-20b": [75e-9, 3e-7, null, 375e-10, null, null], "openrouter/qwen/qwen3-vl-32b-instruct": [104e-9, 416e-9, null, null, null, null], "qwen/qwen3-vl-32b-instruct": [104e-9, 416e-9, null, null, null, null], "openrouter/qwen/qwen3-vl-8b-thinking": [18e-8, 21e-7, null, null, null, null], "qwen/qwen3-vl-8b-thinking": [18e-8, 21e-7, null, null, null, null], "openrouter/qwen/qwen3-vl-8b-instruct": [117e-9, 455e-9, null, null, null, null], "openrouter/google/gemini-2.5-flash-image": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "google/gemini-2.5-flash-image": [3e-7, 25e-7, 833333333333333e-22, 3e-8, null, null], "openrouter/qwen/qwen3-vl-30b-a3b-thinking": [2e-7, 24e-7, null, null, null, null], "openrouter/qwen/qwen3-vl-30b-a3b-instruct": [15e-8, 6e-7, null, null, null, null], "openrouter/openai/gpt-5-pro": [15e-6, 12e-5, null, null, null, null], "openai/gpt-5-pro": [15e-6, 12e-5, null, null, null, null], "openrouter/qwen/qwen3-vl-235b-a22b-thinking": [4e-7, 4e-6, null, null, null, null], "openrouter/qwen/qwen3-vl-235b-a22b-instruct": [21e-8, 19e-7, null, 1e-7, null, null], "openrouter/qwen/qwen3-max": [78e-8, 39e-7, 975e-9, 156e-9, null, { threshold: 128e3, input: 195e-8, output: 975e-8, cacheWrite: 24375e-10, cacheRead: 39e-8 }], "openrouter/deepseek/deepseek-v3.1-terminus": [27e-8, 1e-6, null, 135e-9, null, null], "openrouter/qwen/qwen3-coder-flash": [195e-9, 975e-9, 24375e-11, 39e-9, null, { threshold: 128e3, input: 52e-8, output: 26e-7, cacheWrite: 65e-8, cacheRead: 104e-9 }], "qwen/qwen3-coder-flash": [195e-9, 975e-9, 24375e-11, 39e-9, null, { threshold: 128e3, input: 52e-8, output: 26e-7, cacheWrite: 65e-8, cacheRead: 104e-9 }], "openrouter/qwen/qwen3-next-80b-a3b-thinking": [15e-8, 12e-7, null, null, null, null], "openrouter/qwen/qwen3-next-80b-a3b-instruct": [1e-7, 11e-7, null, 7e-8, null, null], "openrouter/qwen/qwen-plus-2025-07-28": [26e-8, 78e-8, 325e-9, 52e-9, null, { threshold: 256e3, input: 78e-8, output: 234e-8, cacheWrite: null, cacheRead: null }], "qwen/qwen-plus-2025-07-28": [26e-8, 78e-8, 325e-9, 52e-9, null, { threshold: 256e3, input: 78e-8, output: 234e-8, cacheWrite: null, cacheRead: null }], "openrouter/moonshotai/kimi-k2-0905": [6e-7, 25e-7, null, null, null, null], "openrouter/qwen/qwen3-30b-a3b-thinking-2507": [2e-7, 24e-7, null, null, null, null], "qwen/qwen3-30b-a3b-thinking-2507": [2e-7, 24e-7, null, null, null, null], "openrouter/mistralai/mistral-medium-3.1": [4e-7, 2e-6, null, 4e-8, null, null], "mistralai/mistral-medium-3.1": [4e-7, 2e-6, null, 4e-8, null, null], "openrouter/z-ai/glm-4.5v": [6e-7, 18e-7, null, 11e-8, null, null], "z-ai/glm-4.5v": [6e-7, 18e-7, null, 11e-8, null, null], "openrouter/mistralai/codestral-2508": [3e-7, 9e-7, null, 3e-8, null, null], "mistralai/codestral-2508": [3e-7, 9e-7, null, 3e-8, null, null], "openrouter/qwen/qwen3-coder-30b-a3b-instruct": [7e-8, 28e-8, null, null, null, null], "openrouter/qwen/qwen3-30b-a3b-instruct-2507": [1e-7, 3e-7, null, null, null, null], "qwen/qwen3-30b-a3b-instruct-2507": [1e-7, 3e-7, null, null, null, null], "openrouter/z-ai/glm-4.5": [6e-7, 22e-7, null, 11e-8, null, null], "z-ai/glm-4.5": [6e-7, 22e-7, null, 11e-8, null, null], "openrouter/z-ai/glm-4.5-air": [13e-8, 85e-8, null, 25e-9, null, null], "z-ai/glm-4.5-air": [13e-8, 85e-8, null, 25e-9, null, null], "openrouter/moonshotai/kimi-k2": [57e-8, 23e-7, null, null, null, null], "openrouter/minimax/minimax-m1": [4e-7, 22e-7, null, null, null, null], "minimax/minimax-m1": [4e-7, 22e-7, null, null, null, null], "openrouter/openai/o3-pro": [2e-5, 8e-5, null, null, null, null], "openai/o3-pro": [2e-5, 8e-5, null, null, null, null], "openrouter/google/gemini-2.5-pro-preview": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "google/gemini-2.5-pro-preview": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "openrouter/mistralai/mistral-medium-3": [4e-7, 2e-6, null, 4e-8, null, null], "openrouter/google/gemini-2.5-pro-preview-05-06": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "google/gemini-2.5-pro-preview-05-06": [125e-8, 1e-5, 375e-9, 125e-9, null, { threshold: 2e5, input: 25e-7, output: 15e-6, cacheWrite: null, cacheRead: 25e-8 }], "openrouter/meta-llama/llama-guard-4-12b": [18e-8, 18e-8, null, null, null, null], "meta-llama/llama-guard-4-12b": [18e-8, 18e-8, null, null, null, null], "openrouter/qwen/qwen3-30b-a3b": [13e-8, 52e-8, null, null, null, null], "qwen/qwen3-30b-a3b": [13e-8, 52e-8, null, null, null, null], "openrouter/qwen/qwen3-8b": [117e-9, 455e-9, null, null, null, null], "qwen/qwen3-8b": [117e-9, 455e-9, null, null, null, null], "openrouter/qwen/qwen3-14b": [2275e-10, 91e-8, null, null, null, null], "qwen/qwen3-14b": [2275e-10, 91e-8, null, null, null, null], "openrouter/qwen/qwen3-32b": [8e-8, 28e-8, null, null, null, null], "qwen/qwen3-32b": [8e-8, 28e-8, null, null, null, null], "openrouter/qwen/qwen3-235b-a22b": [455e-9, 182e-8, null, null, null, null], "qwen/qwen3-235b-a22b": [455e-9, 182e-8, null, null, null, null], "openrouter/openai/o4-mini-high": [11e-7, 44e-7, null, 275e-9, null, null], "openai/o4-mini-high": [11e-7, 44e-7, null, 275e-9, null, null], "openrouter/meta-llama/llama-4-maverick": [1875e-10, 6525e-10, null, null, null, null], "meta-llama/llama-4-maverick": [1875e-10, 6525e-10, null, null, null, null], "openrouter/meta-llama/llama-4-scout": [1e-7, 3e-7, null, null, null, null], "meta-llama/llama-4-scout": [1e-7, 3e-7, null, null, null, null], "openrouter/openai/o1-pro": [15e-5, 6e-4, null, null, null, null], "openai/o1-pro": [15e-5, 6e-4, null, null, null, null], "openrouter/google/gemma-3-4b-it": [5e-8, 1e-7, null, null, null, null], "openrouter/google/gemma-3-12b-it": [5e-8, 15e-8, null, null, null, null], "openrouter/google/gemma-3-27b-it": [8e-8, 45e-8, null, 4e-8, null, null], "openrouter/mistralai/mistral-saba": [2e-7, 6e-7, null, 2e-8, null, null], "mistralai/mistral-saba": [2e-7, 6e-7, null, 2e-8, null, null], "openrouter/qwen/qwen2.5-vl-72b-instruct": [8e-7, 1e-6, null, 4e-7, null, null], "openrouter/qwen/qwen-plus": [26e-8, 78e-8, 325e-9, 52e-9, null, { threshold: 256e3, input: 78e-8, output: 234e-8, cacheWrite: 975e-9, cacheRead: 156e-9 }], "qwen/qwen-plus": [26e-8, 78e-8, 325e-9, 52e-9, null, { threshold: 256e3, input: 78e-8, output: 234e-8, cacheWrite: 975e-9, cacheRead: 156e-9 }], "openrouter/mistralai/mistral-small-24b-instruct-2501": [5e-8, 8e-8, null, null, null, null], "mistralai/mistral-small-24b-instruct-2501": [5e-8, 8e-8, null, null, null, null], "openrouter/deepseek/deepseek-r1-distill-llama-70b": [8e-7, 8e-7, null, null, null, null], "openrouter/minimax/minimax-01": [2e-7, 11e-7, null, null, null, null], "minimax/minimax-01": [2e-7, 11e-7, null, null, null, null], "openrouter/meta-llama/llama-3.3-70b-instruct": [1e-7, 32e-8, null, null, null, null], "openrouter/openai/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "openai/gpt-4o-2024-11-20": [25e-7, 1e-5, null, 125e-8, null, null], "openrouter/mistralai/mistral-large-2407": [2e-6, 6e-6, null, 2e-7, null, null], "mistralai/mistral-large-2407": [2e-6, 6e-6, null, 2e-7, null, null], "openrouter/qwen/qwen-2.5-7b-instruct": [1e-7, 2e-7, null, null, null, null], "qwen/qwen-2.5-7b-instruct": [1e-7, 2e-7, null, null, null, null], "openrouter/meta-llama/llama-3.2-1b-instruct": [27e-9, 201e-9, null, null, null, null], "openrouter/meta-llama/llama-3.2-3b-instruct": [5e-8, 33e-8, null, null, null, null], "openrouter/qwen/qwen-2.5-72b-instruct": [36e-8, 4e-7, null, null, null, null], "openrouter/openai/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "openai/gpt-4o-2024-08-06": [25e-7, 1e-5, null, 125e-8, null, null], "openrouter/meta-llama/llama-3.1-70b-instruct": [4e-7, 4e-7, null, null, null, null], "meta-llama/llama-3.1-70b-instruct": [4e-7, 4e-7, null, null, null, null], "openrouter/meta-llama/llama-3.1-8b-instruct": [5e-8, 8e-8, null, 25e-9, null, null], "openrouter/mistralai/mistral-nemo": [19e-9, 3e-8, null, null, null, null], "openrouter/openai/gpt-4o-mini-2024-07-18": [15e-8, 6e-7, null, 75e-9, null, null], "openai/gpt-4o-mini-2024-07-18": [15e-8, 6e-7, null, 75e-9, null, null], "openrouter/google/gemma-2-27b-it": [65e-8, 65e-8, null, null, null, null], "google/gemma-2-27b-it": [65e-8, 65e-8, null, null, null, null], "openrouter/openai/gpt-4-turbo": [1e-5, 3e-5, null, null, null, null], "openrouter/openai/gpt-4-turbo-preview": [1e-5, 3e-5, null, null, null, null], "openai/gpt-4-turbo-preview": [1e-5, 3e-5, null, null, null, null], "openrouter/openai/gpt-3.5-turbo-instruct": [15e-7, 2e-6, null, null, null, null], "together_ai/arcee-ai/trinity-mini": [45e-9, 15e-8, null, null, null, null], "arcee-ai/trinity-mini": [45e-9, 15e-8, null, null, null, null], "vertex_ai/gemini-2.5-flash-native-audio": [5e-7, 2e-6, null, null, null, null], "gemini-2.5-flash-native-audio": [5e-7, 2e-6, null, null, null, null], "vertex_ai/gemini-2.5-flash-preview-tts": [5e-7, 1e-5, null, null, null, null], "vertex_ai/gemini-3.1-flash-tts-preview": [1e-6, 2e-5, null, null, null, null], "vertex_ai/gemini-omni-1.1-flash": [15e-7, 9e-6, null, null, null, null], "vertex_ai/gemini-omni-1.1-flash-preview": [15e-7, 9e-6, null, null, null, null], "gemini-omni-1.1-flash-preview": [15e-7, 9e-6, null, null, null, null], "vertex_ai/gemma-4-26b-a4b-it": [15e-8, 6e-7, null, 15e-9, null, null], "together_ai/meta-llama/Llama-3.1-405B-Instruct": [35e-7, 35e-7, null, null, null, null], "meta-llama/Llama-3.1-405B-Instruct": [35e-7, 35e-7, null, null, null, null], "together_ai/meta-llama/Llama-3.2-1B-Instruct": [6e-8, 6e-8, null, null, null, null], "meta-llama/Llama-3.2-1B-Instruct": [6e-8, 6e-8, null, null, null, null], "together_ai/meta-llama/Llama-3.2-3B-Instruct": [6e-8, 6e-8, null, null, null, null], "together_ai/Qwen/Qwen2-1.5B-Instruct": [2e-8, 2e-8, null, null, null, null], "Qwen/Qwen2-1.5B-Instruct": [2e-8, 2e-8, null, null, null, null], "together_ai/Qwen/Qwen2.5-14B-Instruct": [8e-7, 8e-7, null, null, null, null], "Qwen/Qwen2.5-14B-Instruct": [8e-7, 8e-7, null, null, null, null], "together_ai/Qwen/Qwen2.5-72B-Instruct": [12e-7, 12e-7, null, null, null, null], "together_ai/Salesforce/Llama-Rank-V1": [1e-7, 0, null, null, null, null], "Salesforce/Llama-Rank-V1": [1e-7, 0, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3.1-8B": [2e-7, 2e-7, null, null, null, null], "meta-llama/Meta-Llama-3.1-8B": [2e-7, 2e-7, null, null, null, null], "together_ai/together/Tev1-4B-experimental": [42e-9, 0, null, 42e-9, null, null], "together/Tev1-4B-experimental": [42e-9, 0, null, 42e-9, null, null], "together_ai/NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO": [6e-7, 6e-7, null, null, null, null], "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO": [6e-7, 6e-7, null, null, null, null], "together_ai/Qwen/QwQ-32B": [12e-7, 12e-7, null, null, null, null], "together_ai/Qwen/Qwen2-72B-Instruct": [9e-7, 9e-7, null, null, null, null], "Qwen/Qwen2-72B-Instruct": [9e-7, 9e-7, null, null, null, null], "together_ai/Qwen/Qwen2-VL-72B-Instruct": [12e-7, 12e-7, null, null, null, null], "together_ai/Qwen/Qwen2.5-72B-Instruct-Turbo": [12e-7, 12e-7, null, null, null, null], "Qwen/Qwen2.5-72B-Instruct-Turbo": [12e-7, 12e-7, null, null, null, null], "together_ai/Qwen/Qwen2.5-Coder-32B-Instruct": [8e-7, 8e-7, null, null, null, null], "together_ai/Qwen/Qwen2.5-VL-72B-Instruct": [195e-8, 8e-6, null, null, null, null], "together_ai/Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8": [2e-6, 2e-6, null, null, null, null], "together_ai/Qwen/Qwen3-Coder-Next-FP8": [5e-7, 12e-7, null, null, null, null], "Qwen/Qwen3-Coder-Next-FP8": [5e-7, 12e-7, null, null, null, null], "together_ai/Qwen/Qwen3-Next-80B-A3B-Instruct": [15e-8, 15e-7, null, null, null, null], "together_ai/Qwen/Qwen3-Next-80B-A3B-Thinking": [15e-8, 15e-7, null, null, null, null], "together_ai/Qwen/Qwen3-VL-32B-Instruct": [5e-7, 15e-7, null, null, null, null], "Qwen/Qwen3-VL-32B-Instruct": [5e-7, 15e-7, null, null, null, null], "together_ai/Qwen/Qwen3-VL-8B-Instruct": [18e-8, 68e-8, null, null, null, null], "Qwen/Qwen3-VL-8B-Instruct": [18e-8, 68e-8, null, null, null, null], "together_ai/Qwen/Qwen3.5-397B-A17B": [6e-7, 36e-7, null, 35e-8, null, null], "together_ai/deepseek-ai/DeepSeek-R1-Distill-Llama-70B": [2e-6, 2e-6, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B": [18e-8, 18e-8, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B": [16e-7, 16e-7, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-V3.1": [6e-7, 17e-7, null, null, null, null], "together_ai/deepseek-ai/deepseek-coder-33b-instruct": [8e-7, 8e-7, null, null, null, null], "deepseek-ai/deepseek-coder-33b-instruct": [8e-7, 8e-7, null, null, null, null], "together_ai/google/gemma-2-27b-it": [8e-7, 8e-7, null, null, null, null], "together_ai/google/gemma-4-31B-it": [39e-8, 97e-8, null, null, null, null], "together_ai/meta-llama/Llama-3-8b-chat-hf": [2e-7, 2e-7, null, null, null, null], "meta-llama/Llama-3-8b-chat-hf": [2e-7, 2e-7, null, null, null, null], "together_ai/meta-llama/Llama-4-Scout-17B-16E-Instruct": [18e-8, 59e-8, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3-70B-Instruct-Turbo": [88e-8, 88e-8, null, null, null, null], "meta-llama/Meta-Llama-3-70B-Instruct-Turbo": [88e-8, 88e-8, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3-8B-Instruct": [2e-7, 2e-7, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo": [88e-8, 88e-8, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo": [18e-8, 18e-8, null, null, null, null], "together_ai/mistralai/Mistral-7B-Instruct-v0.1": [2e-7, 2e-7, null, null, null, null], "together_ai/mistralai/Mistral-Small-24B-Instruct-2501": [1e-7, 3e-7, null, null, null, null], "together_ai/mistralai/Mixtral-8x7B-Instruct-v0.1": [6e-7, 6e-7, null, null, null, null], "together_ai/moonshotai/Kimi-K2.6": [12e-7, 45e-7, null, 2e-7, null, null], "together_ai/moonshotai/Kimi-K2.7-Code": [95e-8, 4e-6, null, 19e-8, null, null], "together_ai/nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": [88e-8, 88e-8, null, null, null, null], "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF": [88e-8, 88e-8, null, null, null, null], "together_ai/nvidia/nemotron-3-ultra-550b-a55b": [6e-7, 36e-7, null, 2e-7, null, null], "together_ai/openai/gpt-oss-20b": [5e-8, 2e-7, null, null, null, null], "together_ai/zai-org/GLM-4.5-Air-FP8": [2e-7, 11e-7, null, null, null, null], "zai-org/GLM-4.5-Air-FP8": [2e-7, 11e-7, null, null, null, null], "together_ai/zai-org/GLM-4.7": [45e-8, 2e-6, null, null, null, null], "together_ai/zai-org/GLM-5": [1e-6, 32e-7, null, null, null, null], "together_ai/zai-org/GLM-5.1": [14e-7, 44e-7, null, 26e-8, null, null], "azure/eu/codex-mini": [165e-8, 66e-7, null, 413e-9, null, null], "eu/codex-mini": [165e-8, 66e-7, null, 413e-9, null, null], "azure/eu/computer-use-preview": [33e-7, 132e-7, null, null, null, null], "eu/computer-use-preview": [33e-7, 132e-7, null, null, null, null], "azure/eu/gpt-4.1": [22e-7, 88e-7, null, 55e-8, null, null], "eu/gpt-4.1": [22e-7, 88e-7, null, 55e-8, null, null], "azure/eu/gpt-4.1-mini": [44e-8, 176e-8, null, 11e-8, null, null], "eu/gpt-4.1-mini": [44e-8, 176e-8, null, 11e-8, null, null], "azure/eu/gpt-4.1-nano": [11e-8, 44e-8, null, 28e-9, null, null], "eu/gpt-4.1-nano": [11e-8, 44e-8, null, 28e-9, null, null], "azure/eu/gpt-4o-2024-05-13": [55e-7, 165e-7, null, null, null, null], "eu/gpt-4o-2024-05-13": [55e-7, 165e-7, null, null, null, null], "azure/eu/gpt-5": [1375e-9, 11e-6, null, 1375e-10, 2, null], "eu/gpt-5": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/eu/gpt-5-codex": [1375e-9, 11e-6, null, 138e-9, null, null], "eu/gpt-5-codex": [1375e-9, 11e-6, null, 138e-9, null, null], "azure/eu/gpt-5-mini": [275e-9, 22e-7, null, 275e-10, 1.8, null], "eu/gpt-5-mini": [275e-9, 22e-7, null, 275e-10, 1.8, null], "azure/eu/gpt-5-nano": [55e-9, 44e-8, null, 55e-10, null, null], "eu/gpt-5-nano": [55e-9, 44e-8, null, 55e-10, null, null], "azure/eu/gpt-5-pro": [165e-7, 132e-6, null, null, null, null], "eu/gpt-5-pro": [165e-7, 132e-6, null, null, null, null], "azure/eu/gpt-5.1-codex-max": [1375e-9, 11e-6, null, 1375e-10, null, null], "eu/gpt-5.1-codex-max": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/eu/gpt-5.2": [1925e-9, 154e-7, null, 1925e-10, 2, null], "eu/gpt-5.2": [1925e-9, 154e-7, null, 1925e-10, 2, null], "azure/eu/gpt-5.2-codex": [1925e-9, 154e-7, null, 1925e-10, null, null], "eu/gpt-5.2-codex": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/eu/gpt-5.2-pro": [231e-7, 1848e-7, null, null, null, null], "eu/gpt-5.2-pro": [231e-7, 1848e-7, null, null, null, null], "azure/eu/gpt-5.3-codex": [1925e-9, 154e-7, null, 1925e-10, 2, null], "eu/gpt-5.3-codex": [1925e-9, 154e-7, null, 1925e-10, 2, null], "azure/eu/gpt-5.4-mini": [825e-9, 495e-8, null, 825e-10, 2, null], "eu/gpt-5.4-mini": [825e-9, 495e-8, null, 825e-10, 2, null], "azure/eu/gpt-5.4-nano": [22e-8, 1375e-9, null, 22e-9, null, null], "eu/gpt-5.4-nano": [22e-8, 1375e-9, null, 22e-9, null, null], "azure/eu/gpt-5.4-pro": [33e-6, 198e-6, null, null, null, { threshold: 272e3, input: 66e-6, output: 297e-6, cacheWrite: null, cacheRead: null }], "eu/gpt-5.4-pro": [33e-6, 198e-6, null, null, null, { threshold: 272e3, input: 66e-6, output: 297e-6, cacheWrite: null, cacheRead: null }], "azure/eu/gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "eu/gpt-6-astra": [11e-6, 55e-6, 1375e-8, 11e-7, null, { threshold: 272e3, input: 22e-6, output: 825e-7, cacheWrite: 275e-7, cacheRead: 22e-7 }], "azure/eu/gpt-6-luna": [12e-8, 6e-7, 15e-8, 12e-9, null, { threshold: 272e3, input: 24e-8, output: 9e-7, cacheWrite: 3e-7, cacheRead: 24e-9 }], "eu/gpt-6-luna": [12e-8, 6e-7, 15e-8, 12e-9, null, { threshold: 272e3, input: 24e-8, output: 9e-7, cacheWrite: 3e-7, cacheRead: 24e-9 }], "azure/eu/gpt-6-sol": [24e-7, 12e-6, 3e-6, 24e-8, null, { threshold: 272e3, input: 48e-7, output: 18e-6, cacheWrite: 6e-6, cacheRead: 48e-8 }], "eu/gpt-6-sol": [24e-7, 12e-6, 3e-6, 24e-8, null, { threshold: 272e3, input: 48e-7, output: 18e-6, cacheWrite: 6e-6, cacheRead: 48e-8 }], "azure/eu/o1-mini": [121e-8, 484e-8, null, 605e-9, null, null], "eu/o1-mini": [121e-8, 484e-8, null, 605e-9, null, null], "azure/eu/o3-2025-04-16": [22e-7, 88e-7, null, 55e-8, null, null], "eu/o3-2025-04-16": [22e-7, 88e-7, null, 55e-8, null, null], "azure/eu/o3-deep-research": [11e-6, 44e-6, null, 275e-8, null, null], "eu/o3-deep-research": [11e-6, 44e-6, null, 275e-8, null, null], "azure/eu/o4-mini-2025-04-16": [121e-8, 484e-8, null, 303e-9, null, null], "eu/o4-mini-2025-04-16": [121e-8, 484e-8, null, 303e-9, null, null], "gemini/gemini-3.8-live": [75e-8, 45e-7, null, null, null, null], "gemini/gemini-3.8-live-extended-thinking": [75e-8, 45e-7, null, null, null, null], "azure/us/codex-mini": [165e-8, 66e-7, null, 413e-9, null, null], "us/codex-mini": [165e-8, 66e-7, null, 413e-9, null, null], "azure/us/computer-use-preview": [33e-7, 132e-7, null, null, null, null], "us/computer-use-preview": [33e-7, 132e-7, null, null, null, null], "azure/us/gpt-4.1": [22e-7, 88e-7, null, 55e-8, null, null], "us/gpt-4.1": [22e-7, 88e-7, null, 55e-8, null, null], "azure/us/gpt-4.1-mini": [44e-8, 176e-8, null, 11e-8, null, null], "us/gpt-4.1-mini": [44e-8, 176e-8, null, 11e-8, null, null], "azure/us/gpt-4.1-nano": [11e-8, 44e-8, null, 28e-9, null, null], "us/gpt-4.1-nano": [11e-8, 44e-8, null, 28e-9, null, null], "azure/us/gpt-4o-2024-05-13": [55e-7, 165e-7, null, null, null, null], "us/gpt-4o-2024-05-13": [55e-7, 165e-7, null, null, null, null], "azure/us/gpt-5": [1375e-9, 11e-6, null, 1375e-10, 2, null], "us/gpt-5": [1375e-9, 11e-6, null, 1375e-10, 2, null], "azure/us/gpt-5-codex": [1375e-9, 11e-6, null, 138e-9, null, null], "us/gpt-5-codex": [1375e-9, 11e-6, null, 138e-9, null, null], "azure/us/gpt-5-mini": [275e-9, 22e-7, null, 275e-10, 1.8, null], "us/gpt-5-mini": [275e-9, 22e-7, null, 275e-10, 1.8, null], "azure/us/gpt-5-nano": [55e-9, 44e-8, null, 55e-10, null, null], "us/gpt-5-nano": [55e-9, 44e-8, null, 55e-10, null, null], "azure/us/gpt-5-pro": [165e-7, 132e-6, null, null, null, null], "us/gpt-5-pro": [165e-7, 132e-6, null, null, null, null], "azure/us/gpt-5.1-codex-max": [1375e-9, 11e-6, null, 1375e-10, null, null], "us/gpt-5.1-codex-max": [1375e-9, 11e-6, null, 1375e-10, null, null], "azure/us/gpt-5.2": [1925e-9, 154e-7, null, 1925e-10, 2, null], "us/gpt-5.2": [1925e-9, 154e-7, null, 1925e-10, 2, null], "azure/us/gpt-5.2-codex": [1925e-9, 154e-7, null, 1925e-10, null, null], "us/gpt-5.2-codex": [1925e-9, 154e-7, null, 1925e-10, null, null], "azure/us/gpt-5.2-pro": [231e-7, 1848e-7, null, null, null, null], "us/gpt-5.2-pro": [231e-7, 1848e-7, null, null, null, null], "azure/us/gpt-5.3-codex": [1925e-9, 154e-7, null, 1925e-10, 2, null], "us/gpt-5.3-codex": [1925e-9, 154e-7, null, 1925e-10, 2, null], "azure/us/gpt-5.4-mini": [825e-9, 495e-8, null, 825e-10, 2, null], "us/gpt-5.4-mini": [825e-9, 495e-8, null, 825e-10, 2, null], "azure/us/gpt-5.4-nano": [22e-8, 1375e-9, null, 22e-9, null, null], "us/gpt-5.4-nano": [22e-8, 1375e-9, null, 22e-9, null, null], "azure/us/gpt-5.4-pro": [33e-6, 198e-6, null, null, null, { threshold: 272e3, input: 66e-6, output: 297e-6, cacheWrite: null, cacheRead: null }], "us/gpt-5.4-pro": [33e-6, 198e-6, null, null, null, { threshold: 272e3, input: 66e-6, output: 297e-6, cacheWrite: null, cacheRead: null }], "azure/us/o1-mini": [121e-8, 484e-8, null, 605e-9, null, null], "us/o1-mini": [121e-8, 484e-8, null, 605e-9, null, null], "azure/us/o3-deep-research": [11e-6, 44e-6, null, 275e-8, null, null], "us/o3-deep-research": [11e-6, 44e-6, null, 275e-8, null, null], "azure/gpt-realtime-2": [4e-6, 24e-6, null, 4e-7, null, null], "aihubmix/agnes-2.5-flash": [3e-8, 15e-8, null, null, null, null], "agnes-2.5-flash": [3e-8, 15e-8, null, null, null, null], "aihubmix/agnes-2.5-pro": [45e-8, 9e-7, null, 378e-11, null, null], "agnes-2.5-pro": [45e-8, 9e-7, null, 378e-11, null, null], "aihubmix/cc-glm-5.1": [6e-8, 22e-8, null, null, null, null], "cc-glm-5.1": [6e-8, 22e-8, null, null, null, null], "aihubmix/claude-fable-5": [11e-6, 55e-6, 1375e-8, 11e-7, null, null], "aihubmix/claude-haiku-4-5": [11e-7, 55e-7, 1375e-9, 11e-8, null, null], "aihubmix/claude-opus-4-8-think": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "claude-opus-4-8-think": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "aihubmix/claude-opus-5": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "aihubmix/claude-sonnet-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "aihubmix/coding-glm-5.3": [6e-8, 22e-8, null, 15e-9, null, null], "coding-glm-5.3": [6e-8, 22e-8, null, 15e-9, null, null], "aihubmix/coding-kimi-k3": [44e-8, 161333e-11, null, 66e-9, null, null], "coding-kimi-k3": [44e-8, 161333e-11, null, 66e-9, null, null], "aihubmix/coding-xiaomi-mimo-v2-omni": [8e-8, 4e-7, null, 16e-9, null, null], "coding-xiaomi-mimo-v2-omni": [8e-8, 4e-7, null, 16e-9, null, null], "aihubmix/coding-xiaomi-mimo-v2.5": [8e-8, 16e-8, null, 16e-10, null, null], "coding-xiaomi-mimo-v2.5": [8e-8, 16e-8, null, 16e-10, null, null], "aihubmix/coding-xiaomi-mimo-v2.5-pro": [2e-7, 4e-7, null, 16e-10, null, null], "coding-xiaomi-mimo-v2.5-pro": [2e-7, 4e-7, null, 16e-10, null, null], "aihubmix/command-a-plus-05-2026": [25e-7, 1e-5, null, null, null, null], "aihubmix/deepseek-v4-flash": [142e-9, 284e-9, null, 284e-10, null, null], "aihubmix/deepseek-v4-pro": [169e-8, 338e-8, null, 14027e-11, null, null], "aihubmix/doubao-seed-2-0-code-preview": [4822e-10, 2411e-9, null, 9644e-11, null, null], "doubao-seed-2-0-code-preview": [4822e-10, 2411e-9, null, 9644e-11, null, null], "aihubmix/doubao-seed-2-0-lite-260428": [9041e-11, 54246e-11, null, 18082e-12, null, null], "doubao-seed-2-0-lite-260428": [9041e-11, 54246e-11, null, 18082e-12, null, null], "aihubmix/doubao-seed-2-0-mini": [30136e-12, 30136e-11, null, 6027e-12, null, null], "doubao-seed-2-0-mini": [30136e-12, 30136e-11, null, 6027e-12, null, null], "aihubmix/doubao-seed-2-0-pro": [4822e-10, 2411e-9, null, 9644e-11, null, null], "doubao-seed-2-0-pro": [4822e-10, 2411e-9, null, 9644e-11, null, null], "aihubmix/doubao-seed-2-1-turbo": [46475e-11, 232375e-11, null, 9295e-11, null, null], "doubao-seed-2-1-turbo": [46475e-11, 232375e-11, null, 9295e-11, null, null], "aihubmix/ernie-5.1": [5634e-10, 25353e-10, null, 5634e-10, null, null], "ernie-5.1": [5634e-10, 25353e-10, null, 5634e-10, null, null], "aihubmix/gemini-3-flash-preview": [5e-7, 3e-6, null, 5e-8, null, null], "aihubmix/gemini-3-flash-preview-search": [5e-7, 3e-6, null, 5e-8, null, null], "gemini-3-flash-preview-search": [5e-7, 3e-6, null, 5e-8, null, null], "aihubmix/gemini-3.1-pro-preview": [2e-6, 12e-6, null, 2e-7, null, null], "aihubmix/gemini-3.1-pro-preview-customtools": [2e-6, 12e-6, null, 2e-7, null, null], "aihubmix/gemini-3.5-flash-lite": [3e-7, 2499999e-12, null, 3e-8, null, null], "aihubmix/gemini-3.7-flash": [75e-8, 375e-8, null, 75e-9, null, null], "aihubmix/gemma-4-26b-a4b-it": [14e-8, 39998e-11, null, null, null, null], "aihubmix/gemma-4-31b-it": [14e-8, 39998e-11, null, null, null, null], "aihubmix/glm-5.2-fast-preview": [2254e-9, 7889e-9, null, 5635e-10, null, null], "glm-5.2-fast-preview": [2254e-9, 7889e-9, null, 5635e-10, null, null], "aihubmix/glm-5.3": [11268e-10, 39438e-10, null, 2817e-10, null, null], "aihubmix/glm-5.3-flash": [11268e-11, 39438e-11, null, 2817e-11, null, null], "aihubmix/glm-5v-turbo": [7042e-10, 309848e-11, null, 169008e-12, null, null], "glm-5v-turbo": [7042e-10, 309848e-11, null, 169008e-12, null, null], "aihubmix/gpt-5.3-codex": [175e-8, 14e-6, null, 175e-9, null, null], "aihubmix/gpt-5.4-high": [25e-7, 15e-6, null, 25e-8, null, null], "gpt-5.4-high": [25e-7, 15e-6, null, 25e-8, null, null], "aihubmix/gpt-5.4-low": [25e-7, 15e-6, null, 25e-8, null, null], "gpt-5.4-low": [25e-7, 15e-6, null, 25e-8, null, null], "aihubmix/gpt-5.4-mini": [75e-8, 45e-7, null, 75e-9, null, null], "aihubmix/gpt-5.4-nano": [2e-7, 125e-8, null, 2e-8, null, null], "aihubmix/gpt-5.5": [5e-6, 3e-5, null, 5e-7, null, null], "aihubmix/gpt-5.5-pro": [3e-5, 18e-5, null, null, null, null], "aihubmix/gpt-5.6-luna": [2e-7, 12e-7, 25e-8, 2e-8, null, null], "aihubmix/gpt-5.6-sol-disc": [4e-6, 2e-5, 5e-6, 4e-7, null, null], "gpt-5.6-sol-disc": [4e-6, 2e-5, 5e-6, 4e-7, null, null], "aihubmix/gpt-5.6-terra": [2e-6, 12e-6, 25e-7, 2e-7, null, null], "aihubmix/gpt-chat-latest": [5e-6, 3e-5, null, 5e-7, null, null], "aihubmix/grok-4-20-non-reasoning": [2e-6, 6e-6, null, 2e-7, null, null], "aihubmix/grok-4-20-reasoning": [2e-6, 6e-6, null, 2e-7, null, null], "aihubmix/grok-4.6": [2e-6, 6e-6, null, 5e-7, null, null], "aihubmix/grok-build-0.1": [1e-6, 2e-6, null, 2e-7, null, null], "aihubmix/hy3": [1562e-10, 6248e-10, null, 3905e-11, null, null], hy3: [1562e-10, 6248e-10, null, 3905e-11, null, null], "aihubmix/hy4-preview": [845e-9, 2535e-9, null, 4225e-11, null, null], "hy4-preview": [845e-9, 2535e-9, null, 4225e-11, null, null], "aihubmix/kimi-k2.6": [95e-8, 39995e-10, null, 160835e-12, null, null], "aihubmix/kimi-k2.7-code-highspeed": [19e-7, 7999e-9, null, 32167e-11, null, null], "kimi-k2.7-code-highspeed": [19e-7, 7999e-9, null, 32167e-11, null, null], "aihubmix/kimi-k3": [3e-6, 15e-6, null, 3e-7, null, null], "aihubmix/longcat-2.0": [7746e-10, 30984e-10, null, 15492e-12, null, null], "longcat-2.0": [7746e-10, 30984e-10, null, 15492e-12, null, null], "aihubmix/mai-thinking-1": [2e-6, 8e-6, null, null, null, null], "mai-thinking-1": [2e-6, 8e-6, null, null, null, null], "aihubmix/mimo-v2-omni": [44e-8, 22e-7, null, 88e-9, null, null], "mimo-v2-omni": [44e-8, 22e-7, null, 88e-9, null, null], "aihubmix/mimo-v2-pro": [11e-7, 33e-7, null, 22e-8, null, null], "mimo-v2-pro": [11e-7, 33e-7, null, 22e-8, null, null], "aihubmix/minimax-m2.7": [2958e-10, 11832e-10, null, 5916e-11, null, null], "minimax-m2.7": [2958e-10, 11832e-10, null, 5916e-11, null, null], "aihubmix/minimax-m3": [288e-9, 1152e-9, null, null, null, null], "aihubmix/muse-spark-1.2": [1375e-9, 4675e-9, null, null, null, null], "aihubmix/qwen3-coder-next": [137e-9, 548e-9, null, null, null, null], "qwen3-coder-next": [137e-9, 548e-9, null, null, null, null], "aihubmix/qwen3.5-122b-a10b": [1126e-10, 9008e-10, null, null, null, null], "aihubmix/qwen3.5-397b-a17b": [1644e-10, 9864e-10, null, null, null, null], "qwen3.5-397b-a17b": [1644e-10, 9864e-10, null, null, null, null], "aihubmix/qwen3.6-27b": [422e-9, 2532e-9, null, null, null, null], "aihubmix/qwen3.6-35b-a3b": [254e-9, 1524e-9, null, null, null, null], "aihubmix/qwen3.6-max-preview": [1268e-9, 7608e-9, 1585e-9, 1268e-10, null, null], "qwen3.6-max-preview": [1268e-9, 7608e-9, 1585e-9, 1268e-10, null, null], "aihubmix/qwen3.7-plus": [282e-9, 1128e-9, 3525e-10, 564e-10, null, null], "qwen3.7-plus": [282e-9, 1128e-9, 3525e-10, 564e-10, null, null], "aihubmix/qwen3.8-2.4t-a95b": [2e-6, 6e-6, null, 5e-7, null, null], "qwen3.8-2.4t-a95b": [2e-6, 6e-6, null, 5e-7, null, null], "aihubmix/qwen3.8-flash": [1126e-10, 380025e-12, 175937e-12, 14075e-12, null, null], "aihubmix/qwen3.8-max": [169e-8, 507e-8, 21125e-10, 169e-9, null, null], "aihubmix/step-3.7-flash": [22e-8, 132e-8, null, 44e-9, null, null], "step-3.7-flash": [22e-8, 132e-8, null, 44e-9, null, null], "openrouter/typesafe/jev-1.13": [42e-9, 0, null, null, null, null], "typesafe/jev-1.13": [42e-9, 0, null, null, null, null], "openrouter/typesafe/jev-router": [0, 0, null, null, null, null], "typesafe/jev-router": [0, 0, null, null, null, null], "typesafe/jev-1.13.0": [42e-9, 0, null, null, null, null], "jev-1.13.0": [42e-9, 0, null, null, null, null], "typesafe/jev-latest": [42e-9, 0, null, null, null, null], "jev-latest": [42e-9, 0, null, null, null, null], "typesafe/jev-preview": [42e-9, 0, null, null, null, null], "jev-preview": [42e-9, 0, null, null, null, null], "wandb/deepseek-ai/DeepSeek-V4.1-Flash": [2e-7, 65e-8, null, 3e-8, null, null], "wandb/google/gemma-4-26B-A4B-it": [1e-7, 3e-7, null, 5e-8, null, null], "wandb/zai-org/GLM-5.3-Flash": [15e-8, 5e-7, null, 5e-8, null, null], "openrouter/~anthropic/claude-fable-latest": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "~anthropic/claude-fable-latest": [1e-5, 5e-5, 125e-7, 25e-8, null, null], "openrouter/~anthropic/claude-haiku-latest": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "~anthropic/claude-haiku-latest": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "openrouter/~anthropic/claude-opus-latest": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "~anthropic/claude-opus-latest": [4e-6, 2e-5, 5e-6, 2e-7, null, null], "openrouter/~anthropic/claude-sonnet-latest": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "~anthropic/claude-sonnet-latest": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "openrouter/~deepseek/deepseek-flash-latest": [3e-7, 12e-7, null, 6e-9, null, null], "~deepseek/deepseek-flash-latest": [3e-7, 12e-7, null, 6e-9, null, null], "openrouter/~deepseek/deepseek-pro-latest": [132e-8, 396e-8, null, 44e-9, null, null], "~deepseek/deepseek-pro-latest": [132e-8, 396e-8, null, 44e-9, null, null], "openrouter/~deepseek/deepseek-v4-flash-latest": [4e-8, 64e-8, null, 16e-9, null, null], "~deepseek/deepseek-v4-flash-latest": [4e-8, 64e-8, null, 16e-9, null, null], "openrouter/~google/gemini-flash-latest": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "~google/gemini-flash-latest": [75e-8, 375e-8, 416666666666667e-22, 75e-9, null, null], "openrouter/~google/gemini-pro-latest": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "~google/gemini-pro-latest": [2e-6, 12e-6, 375e-9, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/~moonshotai/kimi-latest": [3e-6, 15e-6, null, 3e-7, null, null], "~moonshotai/kimi-latest": [3e-6, 15e-6, null, 3e-7, null, null], "openrouter/~openai/gpt-astra-latest": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "~openai/gpt-astra-latest": [1e-5, 5e-5, 125e-7, 1e-6, null, { threshold: 272e3, input: 2e-5, output: 75e-6, cacheWrite: 25e-6, cacheRead: 2e-6 }], "openrouter/~openai/gpt-luna-latest": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "~openai/gpt-luna-latest": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "openrouter/~openai/gpt-mini-latest": [75e-8, 45e-7, null, 75e-9, null, null], "~openai/gpt-mini-latest": [75e-8, 45e-7, null, 75e-9, null, null], "openrouter/~openai/gpt-sol-latest": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "~openai/gpt-sol-latest": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/~openai/gpt-terra-latest": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "~openai/gpt-terra-latest": [2e-6, 12e-6, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 18e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/~x-ai/grok-latest": [16e-7, 48e-7, null, 4e-7, null, { threshold: 2e5, input: 32e-7, output: 96e-7, cacheWrite: null, cacheRead: 8e-7 }], "~x-ai/grok-latest": [16e-7, 48e-7, null, 4e-7, null, { threshold: 2e5, input: 32e-7, output: 96e-7, cacheWrite: null, cacheRead: 8e-7 }], "openrouter/~z-ai/glm-flash-latest": [15e-8, 5e-7, null, 5e-8, null, null], "~z-ai/glm-flash-latest": [15e-8, 5e-7, null, 5e-8, null, null], "openrouter/~z-ai/glm-latest": [6538e-10, 20548e-10, null, 12142e-11, null, null], "~z-ai/glm-latest": [6538e-10, 20548e-10, null, 12142e-11, null, null], "openrouter/aion-labs/aion-2.0": [8e-7, 16e-7, null, 2e-7, null, null], "aion-labs/aion-2.0": [8e-7, 16e-7, null, 2e-7, null, null], "openrouter/aion-labs/aion-3.0": [3e-6, 6e-6, null, 75e-8, null, null], "aion-labs/aion-3.0": [3e-6, 6e-6, null, 75e-8, null, null], "openrouter/aion-labs/aion-3.0-mini": [7e-7, 14e-7, null, 18e-8, null, null], "aion-labs/aion-3.0-mini": [7e-7, 14e-7, null, 18e-8, null, null], "openrouter/aion-labs/aion-3.5": [3e-6, 6e-6, null, 75e-8, null, null], "aion-labs/aion-3.5": [3e-6, 6e-6, null, 75e-8, null, null], "openrouter/aion-labs/aion-3.5-mini": [7e-7, 14e-7, null, 18e-8, null, null], "aion-labs/aion-3.5-mini": [7e-7, 14e-7, null, 18e-8, null, null], "openrouter/aion-labs/aion-rp-llama-3.1-8b": [8e-7, 16e-7, null, null, null, null], "aion-labs/aion-rp-llama-3.1-8b": [8e-7, 16e-7, null, null, null, null], "openrouter/amazon/nova-2-lite-v1": [3e-7, 25e-7, null, null, null, null], "amazon/nova-2-lite-v1": [3e-7, 25e-7, null, null, null, null], "openrouter/amazon/nova-lite-v1": [6e-8, 24e-8, null, null, null, null], "amazon/nova-lite-v1": [6e-8, 24e-8, null, null, null, null], "openrouter/amazon/nova-micro-v1": [35e-9, 14e-8, null, null, null, null], "amazon/nova-micro-v1": [35e-9, 14e-8, null, null, null, null], "openrouter/amazon/nova-premier-v1": [25e-7, 125e-7, null, 625e-9, null, null], "amazon/nova-premier-v1": [25e-7, 125e-7, null, 625e-9, null, null], "openrouter/amazon/nova-pro-v1": [8e-7, 32e-7, null, null, null, null], "amazon/nova-pro-v1": [8e-7, 32e-7, null, null, null, null], "openrouter/anthracite-org/magnum-v4-72b": [25e-7, 5e-6, null, null, null, null], "anthracite-org/magnum-v4-72b": [25e-7, 5e-6, null, null, null, null], "openrouter/anthropic/claude-fable-5:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "anthropic/claude-fable-5:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, null], "openrouter/anthropic/claude-fable-5.1:batch": [5e-6, 25e-6, 625e-8, 125e-9, null, null], "anthropic/claude-fable-5.1:batch": [5e-6, 25e-6, 625e-8, 125e-9, null, null], "openrouter/anthropic/claude-haiku-4.5:batch": [5e-7, 25e-7, 625e-9, 5e-8, null, null], "anthropic/claude-haiku-4.5:batch": [5e-7, 25e-7, 625e-9, 5e-8, null, null], "openrouter/anthropic/claude-opus-4.1:batch": [75e-7, 375e-7, 9375e-9, 75e-8, null, null], "anthropic/claude-opus-4.1:batch": [75e-7, 375e-7, 9375e-9, 75e-8, null, null], "openrouter/anthropic/claude-opus-4.5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "anthropic/claude-opus-4.5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "openrouter/anthropic/claude-opus-4.6:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "anthropic/claude-opus-4.6:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "openrouter/anthropic/claude-opus-4.7:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "anthropic/claude-opus-4.7:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "openrouter/anthropic/claude-opus-4.8:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "anthropic/claude-opus-4.8:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "openrouter/anthropic/claude-opus-5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "anthropic/claude-opus-5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null, null], "openrouter/anthropic/claude-sonnet-4.5:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null, { threshold: 2e5, input: 3e-6, output: 1125e-8, cacheWrite: 375e-8, cacheRead: 3e-7 }], "anthropic/claude-sonnet-4.5:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null, { threshold: 2e5, input: 3e-6, output: 1125e-8, cacheWrite: 375e-8, cacheRead: 3e-7 }], "openrouter/anthropic/claude-sonnet-4.6:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null, null], "anthropic/claude-sonnet-4.6:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null, null], "openrouter/anthropic/claude-sonnet-5:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "anthropic/claude-sonnet-5:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, null], "openrouter/arcee-ai/trinity-large-thinking": [25e-8, 8e-7, null, 6e-8, null, null], "arcee-ai/trinity-large-thinking": [25e-8, 8e-7, null, 6e-8, null, null], "openrouter/baidu/ernie-4.5-vl-424b-a47b": [42e-8, 125e-8, null, null, null, null], "openrouter/bytedance-seed/seed-1.6": [25e-8, 2e-6, null, null, null, { threshold: 128e3, input: 5e-7, output: 4e-6, cacheWrite: null, cacheRead: null }], "bytedance-seed/seed-1.6": [25e-8, 2e-6, null, null, null, { threshold: 128e3, input: 5e-7, output: 4e-6, cacheWrite: null, cacheRead: null }], "openrouter/bytedance-seed/seed-1.6-flash": [75e-9, 3e-7, null, null, null, { threshold: 128e3, input: 1e-7, output: 8e-7, cacheWrite: null, cacheRead: null }], "bytedance-seed/seed-1.6-flash": [75e-9, 3e-7, null, null, null, { threshold: 128e3, input: 1e-7, output: 8e-7, cacheWrite: null, cacheRead: null }], "openrouter/bytedance-seed/seed-2-1-turbo": [5e-7, 25e-7, null, null, null, null], "bytedance-seed/seed-2-1-turbo": [5e-7, 25e-7, null, null, null, null], "openrouter/bytedance-seed/seed-2.0-code": [5e-7, 3e-6, null, null, null, { threshold: 128e3, input: 1e-6, output: 6e-6, cacheWrite: null, cacheRead: null }], "bytedance-seed/seed-2.0-code": [5e-7, 3e-6, null, null, null, { threshold: 128e3, input: 1e-6, output: 6e-6, cacheWrite: null, cacheRead: null }], "openrouter/bytedance-seed/seed-2.0-lite": [25e-8, 2e-6, null, null, null, { threshold: 128e3, input: 5e-7, output: 4e-6, cacheWrite: null, cacheRead: null }], "bytedance-seed/seed-2.0-lite": [25e-8, 2e-6, null, null, null, { threshold: 128e3, input: 5e-7, output: 4e-6, cacheWrite: null, cacheRead: null }], "openrouter/bytedance-seed/seed-2.0-mini": [1e-7, 4e-7, null, null, null, { threshold: 128e3, input: 2e-7, output: 8e-7, cacheWrite: null, cacheRead: null }], "bytedance-seed/seed-2.0-mini": [1e-7, 4e-7, null, null, null, { threshold: 128e3, input: 2e-7, output: 8e-7, cacheWrite: null, cacheRead: null }], "openrouter/cognitivecomputations/dolphin-mistral-24b-venice-edition": [2e-7, 9e-7, null, null, null, null], "cognitivecomputations/dolphin-mistral-24b-venice-edition": [2e-7, 9e-7, null, null, null, null], "openrouter/cohere/command-a": [25e-7, 1e-5, null, null, null, null], "openrouter/cohere/command-r-08-2024": [15e-8, 6e-7, null, null, null, null], "cohere/command-r-08-2024": [15e-8, 6e-7, null, null, null, null], "openrouter/cohere/command-r-plus-08-2024": [25e-7, 1e-5, null, null, null, null], "cohere/command-r-plus-08-2024": [25e-7, 1e-5, null, null, null, null], "openrouter/cohere/command-r7b-12-2024": [375e-10, 15e-8, null, null, null, null], "cohere/command-r7b-12-2024": [375e-10, 15e-8, null, null, null, null], "openrouter/cohere/north-mini-code:free": [0, 0, null, null, null, null], "cohere/north-mini-code:free": [0, 0, null, null, null, null], "openrouter/dots-studio/dots-3-note-preview:free": [0, 0, null, null, null, null], "dots-studio/dots-3-note-preview:free": [0, 0, null, null, null, null], "openrouter/google/gemini-2.5-flash-lite:batch": [5e-8, 2e-7, null, 1e-8, null, null], "google/gemini-2.5-flash-lite:batch": [5e-8, 2e-7, null, 1e-8, null, null], "openrouter/google/gemini-2.5-flash:batch": [15e-8, 125e-8, null, 3e-8, null, null], "google/gemini-2.5-flash:batch": [15e-8, 125e-8, null, 3e-8, null, null], "openrouter/google/gemini-2.5-pro:batch": [625e-9, 5e-6, null, 125e-9, null, { threshold: 2e5, input: 125e-8, output: 75e-7, cacheWrite: null, cacheRead: 25e-8 }], "google/gemini-2.5-pro:batch": [625e-9, 5e-6, null, 125e-9, null, { threshold: 2e5, input: 125e-8, output: 75e-7, cacheWrite: null, cacheRead: 25e-8 }], "openrouter/google/gemini-3-flash-preview:batch": [25e-8, 15e-7, null, null, null, null], "google/gemini-3-flash-preview:batch": [25e-8, 15e-7, null, null, null, null], "openrouter/google/gemini-3.1-flash-lite:batch": [125e-9, 75e-8, null, 125e-10, null, null], "google/gemini-3.1-flash-lite:batch": [125e-9, 75e-8, null, 125e-10, null, null], "openrouter/google/gemini-3.1-pro-preview:batch": [1e-6, 6e-6, null, null, null, { threshold: 2e5, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: null }], "google/gemini-3.1-pro-preview:batch": [1e-6, 6e-6, null, null, null, { threshold: 2e5, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: null }], "openrouter/google/gemini-3.5-flash-lite:batch": [15e-8, 125e-8, null, 15e-9, null, null], "google/gemini-3.5-flash-lite:batch": [15e-8, 125e-8, null, 15e-9, null, null], "openrouter/google/gemini-3.5-flash:batch": [75e-8, 45e-7, null, 75e-9, null, null], "google/gemini-3.5-flash:batch": [75e-8, 45e-7, null, 75e-9, null, null], "openrouter/google/gemini-3.6-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "google/gemini-3.6-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "openrouter/google/gemini-3.7-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "google/gemini-3.7-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "openrouter/google/gemini-3.8-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "google/gemini-3.8-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null, null], "openrouter/ibm-granite/granite-4.0-h-micro": [17e-9, 112e-9, null, null, null, null], "ibm-granite/granite-4.0-h-micro": [17e-9, 112e-9, null, null, null, null], "openrouter/ibm-granite/granite-4.2-8b": [6e-8, 25e-8, null, 15e-9, null, null], "openrouter/inception/mercury-2": [25e-8, 75e-8, null, 25e-9, null, null], "openrouter/inception/mercury-2.5": [4e-8, 15e-8, null, 4e-9, null, null], "openrouter/inclusionai/ling-3.0-flash": [21e-9, 63e-9, null, 42e-10, null, null], "openrouter/inclusionai/ling-3.0-flash-fin": [6e-8, 18e-8, null, 12e-9, null, null], "inclusionai/ling-3.0-flash-fin": [6e-8, 18e-8, null, 12e-9, null, null], "openrouter/inclusionai/ling-3.0-flash-fin:free": [0, 0, null, null, null, null], "inclusionai/ling-3.0-flash-fin:free": [0, 0, null, null, null, null], "openrouter/inclusionai/ling-3.0-flash-sante:free": [0, 0, null, null, null, null], "inclusionai/ling-3.0-flash-sante:free": [0, 0, null, null, null, null], "openrouter/inclusionai/ling-3.0-flash-vl": [21e-9, 616e-10, null, 42e-10, null, null], "inclusionai/ling-3.0-flash-vl": [21e-9, 616e-10, null, 42e-10, null, null], "openrouter/inclusionai/ling-3.0-flash-vl:free": [0, 0, null, null, null, null], "inclusionai/ling-3.0-flash-vl:free": [0, 0, null, null, null, null], "openrouter/inference-net/schematron-v2-small": [5e-8, 23e-8, null, 5e-8, null, null], "inference-net/schematron-v2-small": [5e-8, 23e-8, null, 5e-8, null, null], "openrouter/inference-net/schematron-v2-turbo": [3e-8, 15e-8, null, 3e-8, null, null], "inference-net/schematron-v2-turbo": [3e-8, 15e-8, null, 3e-8, null, null], "openrouter/kwaipilot/kat-coder-pro-v2.5": [74e-8, 296e-8, null, 15e-8, null, null], "kwaipilot/kat-coder-pro-v2.5": [74e-8, 296e-8, null, 15e-8, null, null], "openrouter/liquid/lfm-2.5-2.6b:free": [0, 0, null, null, null, null], "liquid/lfm-2.5-2.6b:free": [0, 0, null, null, null, null], "openrouter/meituan/longcat-2.0": [3e-7, 12e-7, null, 6e-9, null, null], "meituan/longcat-2.0": [3e-7, 12e-7, null, 6e-9, null, null], "openrouter/meta/muse-glimmer-30b": [3e-7, 12e-7, null, 4e-8, null, null], "meta/muse-glimmer-30b": [3e-7, 12e-7, null, 4e-8, null, null], "openrouter/meta/muse-spark-1.1": [125e-8, 425e-8, null, 15e-8, null, null], "openrouter/meta/muse-spark-1.2": [125e-8, 425e-8, null, 15e-8, null, null], "openrouter/meta/muse-spark-1.2-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "openrouter/meta/muse-spark-1.3": [125e-8, 425e-8, null, 15e-8, null, null], "openrouter/meta/muse-spark-1.3-contributor": [1e-7, 2e-7, null, 2e-9, null, null], "openrouter/microsoft/phi-4": [7e-8, 14e-8, null, null, null, null], "openrouter/microsoft/wizardlm-2-8x22b": [62e-8, 62e-8, null, null, null, null], "openrouter/mistralai/codestral-2508:batch": [15e-8, 45e-8, null, 15e-9, null, null], "mistralai/codestral-2508:batch": [15e-8, 45e-8, null, 15e-9, null, null], "openrouter/mistralai/ministral-8b-2512:batch": [75e-9, 75e-9, null, 75e-10, null, null], "mistralai/ministral-8b-2512:batch": [75e-9, 75e-9, null, 75e-10, null, null], "openrouter/mistralai/mistral-large-2512": [5e-7, 15e-7, null, 5e-8, null, null], "mistralai/mistral-large-2512": [5e-7, 15e-7, null, 5e-8, null, null], "openrouter/mistralai/mistral-large-2512:batch": [25e-8, 75e-8, null, 25e-9, null, null], "mistralai/mistral-large-2512:batch": [25e-8, 75e-8, null, 25e-9, null, null], "openrouter/mistralai/mistral-medium-3-5:batch": [75e-8, 375e-8, null, null, null, null], "mistralai/mistral-medium-3-5:batch": [75e-8, 375e-8, null, null, null, null], "openrouter/mistralai/mistral-medium-3.1:batch": [2e-7, 1e-6, null, 2e-8, null, null], "mistralai/mistral-medium-3.1:batch": [2e-7, 1e-6, null, 2e-8, null, null], "openrouter/mistralai/mistral-small-2603:batch": [75e-9, 3e-7, null, 75e-10, null, null], "mistralai/mistral-small-2603:batch": [75e-9, 3e-7, null, 75e-10, null, null], "openrouter/moonshotai/kimi-k3:batch": [228e-8, 114e-7, null, 228e-9, null, null], "moonshotai/kimi-k3:batch": [228e-8, 114e-7, null, 228e-9, null, null], "openrouter/morph/morph-v3-fast": [8e-7, 12e-7, null, null, null, null], "openrouter/morph/morph-v3-large": [9e-7, 19e-7, null, null, null, null], "openrouter/nex-agi/nex-n2.5-mini:free": [0, 0, null, null, null, null], "nex-agi/nex-n2.5-mini:free": [0, 0, null, null, null, null], "openrouter/nex-agi/nex-n2.5-pro:free": [0, 0, null, null, null, null], "nex-agi/nex-n2.5-pro:free": [0, 0, null, null, null, null], "openrouter/nousresearch/hermes-3-llama-3.1-405b": [1e-6, 1e-6, null, null, null, null], "nousresearch/hermes-3-llama-3.1-405b": [1e-6, 1e-6, null, null, null, null], "openrouter/nousresearch/hermes-3-llama-3.1-70b": [7e-7, 7e-7, null, null, null, null], "nousresearch/hermes-3-llama-3.1-70b": [7e-7, 7e-7, null, null, null, null], "openrouter/nousresearch/hermes-4-405b": [1e-6, 3e-6, null, null, null, null], "nousresearch/hermes-4-405b": [1e-6, 3e-6, null, null, null, null], "openrouter/openai/gpt-3.5-turbo-0613": [1e-6, 2e-6, null, null, null, null], "openai/gpt-3.5-turbo-0613": [1e-6, 2e-6, null, null, null, null], "openrouter/openai/gpt-3.5-turbo:batch": [25e-8, 75e-8, null, null, null, null], "openai/gpt-3.5-turbo:batch": [25e-8, 75e-8, null, null, null, null], "openrouter/openai/gpt-4-turbo:batch": [5e-6, 15e-6, null, null, null, null], "openai/gpt-4-turbo:batch": [5e-6, 15e-6, null, null, null, null], "openrouter/openai/gpt-4.1-mini:batch": [2e-7, 8e-7, null, 5e-8, null, null], "openai/gpt-4.1-mini:batch": [2e-7, 8e-7, null, 5e-8, null, null], "openrouter/openai/gpt-4.1-nano:batch": [5e-8, 2e-7, null, 125e-10, null, null], "openai/gpt-4.1-nano:batch": [5e-8, 2e-7, null, 125e-10, null, null], "openrouter/openai/gpt-4.1:batch": [1e-6, 4e-6, null, 25e-8, null, null], "openai/gpt-4.1:batch": [1e-6, 4e-6, null, 25e-8, null, null], "openrouter/openai/gpt-4o-mini:batch": [75e-9, 3e-7, null, 375e-10, null, null], "openai/gpt-4o-mini:batch": [75e-9, 3e-7, null, 375e-10, null, null], "openrouter/openai/gpt-4o:batch": [125e-8, 5e-6, null, 625e-9, null, null], "openai/gpt-4o:batch": [125e-8, 5e-6, null, 625e-9, null, null], "openrouter/openai/gpt-5-image": [1e-5, 1e-5, null, 125e-8, null, null], "openai/gpt-5-image": [1e-5, 1e-5, null, 125e-8, null, null], "openrouter/openai/gpt-5-image-mini": [25e-7, 2e-6, null, 25e-8, null, null], "openai/gpt-5-image-mini": [25e-7, 2e-6, null, 25e-8, null, null], "openrouter/openai/gpt-5-mini:batch": [125e-9, 1e-6, null, 125e-10, null, null], "openai/gpt-5-mini:batch": [125e-9, 1e-6, null, 125e-10, null, null], "openrouter/openai/gpt-5-nano:batch": [25e-9, 2e-7, null, 25e-10, null, null], "openai/gpt-5-nano:batch": [25e-9, 2e-7, null, 25e-10, null, null], "openrouter/openai/gpt-5-pro:batch": [75e-7, 6e-5, null, null, null, null], "openai/gpt-5-pro:batch": [75e-7, 6e-5, null, null, null, null], "openrouter/openai/gpt-5:batch": [625e-9, 5e-6, null, 625e-10, null, null], "openai/gpt-5:batch": [625e-9, 5e-6, null, 625e-10, null, null], "openrouter/openai/gpt-5.1:batch": [625e-9, 5e-6, null, 625e-10, null, null], "openai/gpt-5.1:batch": [625e-9, 5e-6, null, 625e-10, null, null], "openrouter/openai/gpt-5.2-pro:batch": [105e-7, 84e-6, null, null, null, null], "openai/gpt-5.2-pro:batch": [105e-7, 84e-6, null, null, null, null], "openrouter/openai/gpt-5.2:batch": [875e-9, 7e-6, null, 875e-10, null, null], "openai/gpt-5.2:batch": [875e-9, 7e-6, null, 875e-10, null, null], "openrouter/openai/gpt-5.4-image-2": [8e-6, 15e-6, null, 2e-6, null, null], "openai/gpt-5.4-image-2": [8e-6, 15e-6, null, 2e-6, null, null], "openrouter/openai/gpt-5.4-mini:batch": [375e-9, 225e-8, null, 375e-10, null, null], "openai/gpt-5.4-mini:batch": [375e-9, 225e-8, null, 375e-10, null, null], "openrouter/openai/gpt-5.4-nano:batch": [1e-7, 625e-9, null, 1e-8, null, null], "openai/gpt-5.4-nano:batch": [1e-7, 625e-9, null, 1e-8, null, null], "openrouter/openai/gpt-5.4-pro:batch": [15e-6, 9e-5, null, null, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: null }], "openai/gpt-5.4-pro:batch": [15e-6, 9e-5, null, null, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: null }], "openrouter/openai/gpt-5.4:batch": [125e-8, 75e-7, null, 125e-9, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }], "openai/gpt-5.4:batch": [125e-8, 75e-7, null, 125e-9, null, { threshold: 272e3, input: 25e-7, output: 1125e-8, cacheWrite: null, cacheRead: 25e-8 }], "openrouter/openai/gpt-5.5-pro:batch": [15e-6, 9e-5, null, null, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: null }], "openai/gpt-5.5-pro:batch": [15e-6, 9e-5, null, null, null, { threshold: 272e3, input: 3e-5, output: 135e-6, cacheWrite: null, cacheRead: null }], "openrouter/openai/gpt-5.5:batch": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "openai/gpt-5.5:batch": [25e-7, 15e-6, null, 25e-8, null, { threshold: 272e3, input: 5e-6, output: 225e-7, cacheWrite: null, cacheRead: 5e-7 }], "openrouter/openai/gpt-5.6-luna-pro:batch": [1e-7, 6e-7, null, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: null, cacheRead: 2e-8 }], "openai/gpt-5.6-luna-pro:batch": [1e-7, 6e-7, null, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: null, cacheRead: 2e-8 }], "openrouter/openai/gpt-5.6-luna:batch": [1e-7, 6e-7, null, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: null, cacheRead: 2e-8 }], "openai/gpt-5.6-luna:batch": [1e-7, 6e-7, null, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 9e-7, cacheWrite: null, cacheRead: 2e-8 }], "openrouter/openai/gpt-5.6-sol-pro:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openai/gpt-5.6-sol-pro:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openrouter/openai/gpt-5.6-sol:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openai/gpt-5.6-sol:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openrouter/openai/gpt-5.6-terra-pro:batch": [1e-6, 6e-6, null, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: 2e-7 }], "openai/gpt-5.6-terra-pro:batch": [1e-6, 6e-6, null, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: 2e-7 }], "openrouter/openai/gpt-5.6-terra:batch": [1e-6, 6e-6, null, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: 2e-7 }], "openai/gpt-5.6-terra:batch": [1e-6, 6e-6, null, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 9e-6, cacheWrite: null, cacheRead: 2e-7 }], "openrouter/openai/gpt-6-astra-pro:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 375e-7, cacheWrite: 125e-7, cacheRead: 1e-6 }], "openai/gpt-6-astra-pro:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 375e-7, cacheWrite: 125e-7, cacheRead: 1e-6 }], "openrouter/openai/gpt-6-astra:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 375e-7, cacheWrite: 125e-7, cacheRead: 1e-6 }], "openai/gpt-6-astra:batch": [5e-6, 25e-6, 625e-8, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 375e-7, cacheWrite: 125e-7, cacheRead: 1e-6 }], "openrouter/openai/gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "openai/gpt-6-luna": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "openrouter/openai/gpt-6-luna-pro": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "openai/gpt-6-luna-pro": [1e-7, 5e-7, 125e-9, 1e-8, null, { threshold: 272e3, input: 2e-7, output: 75e-8, cacheWrite: 25e-8, cacheRead: 2e-8 }], "openrouter/openai/gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai/gpt-6-sol": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/gpt-6-sol-pro": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openai/gpt-6-sol-pro": [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }], "openrouter/openai/o3-mini:batch": [55e-8, 22e-7, null, 275e-9, null, null], "openai/o3-mini:batch": [55e-8, 22e-7, null, 275e-9, null, null], "openrouter/openai/o3:batch": [1e-6, 4e-6, null, 25e-8, null, null], "openai/o3:batch": [1e-6, 4e-6, null, 25e-8, null, null], "openrouter/openai/o4-mini:batch": [55e-8, 22e-7, null, 1375e-10, null, null], "openai/o4-mini:batch": [55e-8, 22e-7, null, 1375e-10, null, null], "openrouter/perceptron/perceptron-mk1": [15e-8, 15e-7, null, null, null, null], "perceptron/perceptron-mk1": [15e-8, 15e-7, null, null, null, null], "openrouter/perplexity/sonar": [1e-6, 1e-6, null, null, null, null], "openrouter/perplexity/sonar-deep-research": [2e-6, 8e-6, null, null, null, null], "openrouter/perplexity/sonar-pro": [3e-6, 15e-6, null, null, null, null], "openrouter/perplexity/sonar-pro-search": [3e-6, 15e-6, null, null, null, null], "perplexity/sonar-pro-search": [3e-6, 15e-6, null, null, null, null], "openrouter/perplexity/sonar-reasoning-pro": [2e-6, 8e-6, null, null, null, null], "openrouter/qwen/qwen3.8-27b:free": [0, 0, null, null, null, null], "qwen/qwen3.8-27b:free": [0, 0, null, null, null, null], "openrouter/rekaai/reka-edge": [1e-7, 1e-7, null, null, null, null], "rekaai/reka-edge": [1e-7, 1e-7, null, null, null, null], "openrouter/rekaai/reka-flash-3": [1e-7, 2e-7, null, null, null, null], "rekaai/reka-flash-3": [1e-7, 2e-7, null, null, null, null], "openrouter/relace/relace-apply-3": [85e-8, 125e-8, null, null, null, null], "relace/relace-apply-3": [85e-8, 125e-8, null, null, null, null], "openrouter/relace/relace-search": [1e-6, 3e-6, null, null, null, null], "relace/relace-search": [1e-6, 3e-6, null, null, null, null], "openrouter/sakana/fugu-max": [2e-6, 6e-6, null, 25e-8, null, null], "sakana/fugu-max": [2e-6, 6e-6, null, 25e-8, null, null], "openrouter/sakana/fugu-ultra": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "sakana/fugu-ultra": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "openrouter/sakana/fugu-ultra-v2": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "sakana/fugu-ultra-v2": [5e-6, 3e-5, null, 5e-7, null, { threshold: 272e3, input: 1e-5, output: 45e-6, cacheWrite: null, cacheRead: 1e-6 }], "openrouter/sakana/sakana-namazu": [95e-8, 4e-6, null, 15e-8, null, null], "sakana/sakana-namazu": [95e-8, 4e-6, null, 15e-8, null, null], "openrouter/sao10k/l3-lunaris-8b": [4e-8, 5e-8, null, null, null, null], "sao10k/l3-lunaris-8b": [4e-8, 5e-8, null, null, null, null], "openrouter/sao10k/l3.1-euryale-70b": [85e-8, 85e-8, null, null, null, null], "sao10k/l3.1-euryale-70b": [85e-8, 85e-8, null, null, null, null], "openrouter/sao10k/l3.3-euryale-70b": [65e-8, 75e-8, null, null, null, null], "sao10k/l3.3-euryale-70b": [65e-8, 75e-8, null, null, null, null], "openrouter/stealth/space-bunny-alpha": [0, 0, null, null, null, null], "stealth/space-bunny-alpha": [0, 0, null, null, null, null], "openrouter/stepfun/step-3.5-flash": [1e-7, 3e-7, null, null, null, null], "stepfun/step-3.5-flash": [1e-7, 3e-7, null, null, null, null], "openrouter/stepfun/step-3.7-flash": [2e-7, 115e-8, null, 4e-8, null, null], "openrouter/tencent/hunyuan-a13b-instruct": [14e-8, 57e-8, null, null, null, null], "tencent/hunyuan-a13b-instruct": [14e-8, 57e-8, null, null, null, null], "openrouter/tencent/hy-mt2-1.8b": [44e-9, 177e-9, null, null, null, null], "tencent/hy-mt2-1.8b": [44e-9, 177e-9, null, null, null, null], "openrouter/tencent/hy-mt2-30b-a3b": [74e-9, 295e-9, null, null, null, null], "tencent/hy-mt2-30b-a3b": [74e-9, 295e-9, null, null, null, null], "openrouter/tencent/hy-mt2-7b": [74e-9, 295e-9, null, null, null, null], "tencent/hy-mt2-7b": [74e-9, 295e-9, null, null, null, null], "openrouter/tencent/hy3": [132e-9, 528e-9, null, 33e-9, null, null], "openrouter/tencent/hy3-preview": [18e-8, 6e-7, null, 6e-8, null, null], "tencent/hy3-preview": [18e-8, 6e-7, null, 6e-8, null, null], "openrouter/tencent/hy4-preview": [834e-9, 2501e-9, null, 42e-9, null, null], "tencent/hy4-preview": [834e-9, 2501e-9, null, 42e-9, null, null], "openrouter/thedrummer/cydonia-24b-v4.1": [3e-7, 5e-7, null, 15e-8, null, null], "thedrummer/cydonia-24b-v4.1": [3e-7, 5e-7, null, 15e-8, null, null], "openrouter/thedrummer/skyfall-36b-v2": [55e-8, 8e-7, null, 25e-8, null, null], "thedrummer/skyfall-36b-v2": [55e-8, 8e-7, null, 25e-8, null, null], "openrouter/thedrummer/unslopnemo-12b": [4e-7, 4e-7, null, null, null, null], "thedrummer/unslopnemo-12b": [4e-7, 4e-7, null, null, null, null], "openrouter/thinkingmachines/inkling": [1e-6, 405e-8, null, 17e-8, null, null], "thinkingmachines/inkling": [1e-6, 405e-8, null, 17e-8, null, null], "openrouter/thinkingmachines/inkling-small": [45e-8, 12e-7, null, 1e-7, null, null], "thinkingmachines/inkling-small": [45e-8, 12e-7, null, 1e-7, null, null], "openrouter/thinkingmachines/inkling-small:free": [0, 0, null, null, null, null], "thinkingmachines/inkling-small:free": [0, 0, null, null, null, null], "openrouter/thinkingmachines/inkling:free": [0, 0, null, null, null, null], "thinkingmachines/inkling:free": [0, 0, null, null, null, null], "openrouter/unbiased/pareto": [25e-7, 75e-7, null, 25e-8, null, null], "unbiased/pareto": [25e-7, 75e-7, null, 25e-8, null, null], "openrouter/upstage/solar-pro-3": [15e-8, 6e-7, null, 15e-9, null, null], "upstage/solar-pro-3": [15e-8, 6e-7, null, 15e-9, null, null], "openrouter/upstage/solar-pro4": [9e-8, 36e-8, null, 18e-9, null, null], "upstage/solar-pro4": [9e-8, 36e-8, null, 18e-9, null, null], "openrouter/upstage/solar-mini4": [5e-8, 2e-7, null, 5e-9, null, null], "upstage/solar-mini4": [5e-8, 2e-7, null, 5e-9, null, null], "openrouter/writer/palmyra-x5": [6e-7, 6e-6, null, null, null, null], "writer/palmyra-x5": [6e-7, 6e-6, null, null, null, null], "openrouter/x-ai/grok-4.3:batch": [1e-6, 2e-6, null, 16e-8, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 32e-8 }], "x-ai/grok-4.3:batch": [1e-6, 2e-6, null, 16e-8, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 32e-8 }], "openrouter/z-ai/glm-5.3-flash:batch": [6e-8, 2e-7, null, 12e-9, null, null], "z-ai/glm-5.3-flash:batch": [6e-8, 2e-7, null, 12e-9, null, null], "openrouter/z-ai/glm-5.3:batch": [45e-8, 2e-6, null, 1e-7, null, null], "z-ai/glm-5.3:batch": [45e-8, 2e-6, null, 1e-7, null, null], "openrouter/prism-ml/ternary-bonsai-2-27b": [75e-9, 5e-7, null, null, null, null], "prism-ml/ternary-bonsai-2-27b": [75e-9, 5e-7, null, null, null, null], "openrouter/z-ai/glm-5.3-prime": [28e-7, 88e-7, null, 56e-8, null, null], "z-ai/glm-5.3-prime": [28e-7, 88e-7, null, 56e-8, null, null], "openrouter/z-ai/glm-5.3-flashx": [37e-8, 125e-8, null, 9e-8, null, null], "z-ai/glm-5.3-flashx": [37e-8, 125e-8, null, 9e-8, null, null], "openrouter/x-ai/grok-4.7": [16e-7, 48e-7, null, 4e-7, null, { threshold: 2e5, input: 32e-7, output: 96e-7, cacheWrite: null, cacheRead: 8e-7 }], "x-ai/grok-4.7": [16e-7, 48e-7, null, 4e-7, null, { threshold: 2e5, input: 32e-7, output: 96e-7, cacheWrite: null, cacheRead: 8e-7 }], "openrouter/xiaomi/mimo-v2.6-flash": [14e-8, 28e-8, null, 28e-10, null, null], "xiaomi/mimo-v2.6-flash": [14e-8, 28e-8, null, 28e-10, null, null], "openrouter/xiaomi/mimo-v2.6-pro": [435e-9, 87e-8, null, 36e-10, null, null], "xiaomi/mimo-v2.6-pro": [435e-9, 87e-8, null, 36e-10, null, null], "openrouter/xiaomi/mimo-v2.6-pro-ultraspeed": [435e-8, 87e-7, null, 36e-9, null, null], "xiaomi/mimo-v2.6-pro-ultraspeed": [435e-8, 87e-7, null, 36e-9, null, null], "xiaomi_mimo/mimo-v2.6-pro": [435e-9, 87e-8, null, 36e-10, null, null], "mimo-v2.6-pro": [435e-9, 87e-8, null, 36e-10, null, null], "xiaomi_mimo/mimo-v2.6-flash": [14e-8, 28e-8, null, 28e-10, null, null], "mimo-v2.6-flash": [14e-8, 28e-8, null, 28e-10, null, null], "xai/grok-4.20-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-0309": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-latest-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-latest-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-latest-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-latest-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-beta-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-beta-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-0304": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-0304": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-0304-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-0304-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-0304-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-0304-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-experimental-beta-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-experimental-beta-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent-experimental-beta-0304": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-experimental-beta-0304": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-multi-agent-experimental-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-multi-agent-experimental-beta-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-non-reasoning-gv2": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-non-reasoning-gv2": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4.20-reasoning-gv2": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4.20-reasoning-gv2": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "openrouter/nex-agi/nex-n2.5-mini": [25e-9, 1e-7, null, 25e-10, null, null], "nex-agi/nex-n2.5-mini": [25e-9, 1e-7, null, 25e-10, null, null], "openrouter/nex-agi/nex-n2.5-pro": [75e-9, 25e-8, null, 15e-9, null, null], "nex-agi/nex-n2.5-pro": [75e-9, 25e-8, null, 15e-9, null, null], "baseten/deepseek-ai/DeepSeek-V4.1-Flash": [3e-7, 12e-7, null, 7e-9, null, null], "baseten/moonshotai/Kimi-K2.6": [95e-8, 4e-6, null, 16e-8, null, null], "baseten/moonshotai/Kimi-K2.7-Code": [95e-8, 4e-6, null, 16e-8, null, null], "baseten/moonshotai/Kimi-K3": [3e-6, 15e-6, null, 3e-7, null, null], "baseten/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": [6e-7, 24e-7, null, 12e-8, null, null], "baseten/thinkingmachines/inkling": [1e-6, 405e-8, null, 17e-8, null, null], "baseten/thinkingmachines/inkling-small": [5e-7, 12e-7, null, 1e-7, null, null], "baseten/zai-org/GLM-5.2": [14e-7, 44e-7, null, 14e-8, null, null], "baseten/zai-org/GLM-5.3-Flash": [15e-8, 5e-7, null, 3e-8, null, null], "baseten/deepseek-ai/DeepSeek-V4-Flash-0731": [13e-8, 26e-8, null, 28e-9, null, null], "baseten/deepseek-ai/DeepSeek-V4-Pro": [174e-8, 348e-8, null, 145e-9, null, null], "baseten/deepseek-ai/DeepSeek-V4-Pro-0813": [132e-8, 396e-8, null, 132e-9, null, null], "baseten/zai-org/GLM-5.2-Fast": [21e-7, 66e-7, null, 21e-8, null, null], "zai-org/GLM-5.2-Fast": [21e-7, 66e-7, null, 21e-8, null, null], "xai/grok-code-fast": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-code-fast": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-code-fast-1": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-code-fast-1-0825": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-code-fast-1-0825": [1e-6, 2e-6, null, 2e-7, null, { threshold: 2e5, input: 2e-6, output: 4e-6, cacheWrite: null, cacheRead: 4e-7 }], "fireworks_ai/accounts/fireworks/models/deepseek-v4-pro": [12e-7, 12e-7, null, 6e-7, 1, null], "accounts/fireworks/models/deepseek-v4-pro": [12e-7, 12e-7, null, 6e-7, 1, null], "fireworks_ai/accounts/fireworks/models/ember-1": [3e-6, 15e-6, null, 3e-7, 1.25, null], "accounts/fireworks/models/ember-1": [3e-6, 15e-6, null, 3e-7, 1.25, null], "openrouter/anthropic/claude-opus-5.5:batch": [2e-6, 1e-5, 25e-7, 1e-7, null, null], "anthropic/claude-opus-5.5:batch": [2e-6, 1e-5, 25e-7, 1e-7, null, null], "openrouter/cohere/command-a-plus": [3e-7, 15e-7, null, 15e-8, null, null], "cohere/command-a-plus": [3e-7, 15e-7, null, 15e-8, null, null], "openrouter/deepseek/deepseek-v4.1-flash:batch": [112e-9, 336e-9, null, 336e-11, null, null], "deepseek/deepseek-v4.1-flash:batch": [112e-9, 336e-9, null, 336e-11, null, null], "openrouter/openai/gpt-6-luna-pro:batch": [5e-8, 25e-8, 625e-10, 5e-9, null, { threshold: 272e3, input: 1e-7, output: 375e-9, cacheWrite: 125e-9, cacheRead: 1e-8 }], "openai/gpt-6-luna-pro:batch": [5e-8, 25e-8, 625e-10, 5e-9, null, { threshold: 272e3, input: 1e-7, output: 375e-9, cacheWrite: 125e-9, cacheRead: 1e-8 }], "openrouter/openai/gpt-6-luna:batch": [5e-8, 25e-8, 625e-10, 5e-9, null, { threshold: 272e3, input: 1e-7, output: 375e-9, cacheWrite: 125e-9, cacheRead: 1e-8 }], "openai/gpt-6-luna:batch": [5e-8, 25e-8, 625e-10, 5e-9, null, { threshold: 272e3, input: 1e-7, output: 375e-9, cacheWrite: 125e-9, cacheRead: 1e-8 }], "openrouter/openai/gpt-6-sol-pro:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openai/gpt-6-sol-pro:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openrouter/openai/gpt-6-sol:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openai/gpt-6-sol:batch": [1e-6, 5e-6, 125e-8, 1e-7, null, { threshold: 272e3, input: 2e-6, output: 75e-7, cacheWrite: 25e-7, cacheRead: 2e-7 }], "openrouter/openai/gpt-oss-20b:batch": [24e-9, 112e-9, null, null, null, null], "openai/gpt-oss-20b:batch": [24e-9, 112e-9, null, null, null, null], "openrouter/qwen/qwen3.8-omni-flash": [15e-8, 47e-8, null, 16e-9, null, null], "qwen/qwen3.8-omni-flash": [15e-8, 47e-8, null, 16e-9, null, null], "openrouter/perceptron/perceptron-mk1.5": [15e-8, 15e-7, null, null, null, null], "perceptron/perceptron-mk1.5": [15e-8, 15e-7, null, null, null, null], "vertex_ai/gemini-2.0-flash": [15e-8, 6e-7, null, null, null, null], "gemini-2.0-flash": [15e-8, 6e-7, null, null, null, null], "vertex_ai/gemini-2.0-flash-lite": [75e-9, 3e-7, null, null, null, null], "gemini-2.0-flash-lite": [75e-9, 3e-7, null, null, null, null], "vertex_ai/zai-org/glm-5.2-maas": [14e-7, 44e-7, null, 14e-8, null, null], "zai-org/glm-5.2-maas": [14e-7, 44e-7, null, 14e-8, null, null], "vertex_ai/meta/llama-3.3-70b-instruct-maas": [72e-8, 72e-8, null, null, null, null], "meta/llama-3.3-70b-instruct-maas": [72e-8, 72e-8, null, null, null, null], "vertex_ai/gemini-2.5-flash-tts": [5e-7, 1e-5, null, null, null, null], "gemini-2.5-flash-tts": [5e-7, 1e-5, null, null, null, null], "vertex_ai/gemini-2.5-pro-tts": [1e-6, 2e-5, null, null, null, null], "gemini-2.5-pro-tts": [1e-6, 2e-5, null, null, null, null], "azure_ai/MAI-Cyber-1-Flash": [6e-7, 35e-7, null, 6e-8, null, null], "MAI-Cyber-1-Flash": [6e-7, 35e-7, null, 6e-8, null, null], "azure_ai/claude-sonnet-5-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "bedrock/us-gov-east-1/anthropic.claude-sonnet-5-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us-gov-east-1/anthropic.claude-sonnet-5-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-sonnet-5-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "us-gov-west-1/anthropic.claude-sonnet-5-5": [24e-7, 12e-6, 3e-6, 24e-8, null, null], "openrouter/anthropic/claude-sonnet-5.5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "anthropic/claude-sonnet-5.5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "perplexity/anthropic/claude-sonnet-5-5": [2e-6, 1e-5, null, 2e-7, null, null], "anthropic/claude-sonnet-5-5": [2e-6, 1e-5, null, 2e-7, null, null], "vertex_ai/claude-sonnet-5-5": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "vertex_ai/claude-sonnet-5-5@default": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "claude-sonnet-5-5@default": [2e-6, 1e-5, 25e-7, 2e-7, null, null], "MiniMax-M2.7-highspeed": [6e-7, 24e-7, 375e-9, 6e-8], "gpt-5.6-codex": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "gpt-5.6-codex-max": [4e-6, 2e-5, 5e-6, 4e-7, 2, { threshold: 272e3, input: 8e-6, output: 3e-5, cacheWrite: 1e-5, cacheRead: 8e-7 }, [2e-6, 1e-5, 25e-7, 2e-7, null, { threshold: 272e3, input: 4e-6, output: 15e-6, cacheWrite: 5e-6, cacheRead: 4e-7 }]], "claude-opus-4": [15e-6, 75e-6, 1875e-8, 15e-7], "mistral-large-4-0": [68e-8, 209e-8, null, 7e-8, null, null], "mistral-large-2610": [68e-8, 209e-8, null, 7e-8, null, null], "mistral-large-4": [68e-8, 209e-8, null, 7e-8, null, null] };
|
||
}
|
||
});
|
||
|
||
// src/data/pricing-fallback.json
|
||
var pricing_fallback_default;
|
||
var init_pricing_fallback = __esm({
|
||
"src/data/pricing-fallback.json"() {
|
||
pricing_fallback_default = { "qvq-max": [12e-7, 48e-7, null, null, null], "qwen-flash": [50000000000000004e-24, 40000000000000003e-23, null, null, null], "qwen-mt-turbo": [16e-8, 49e-8, null, null, null], "qwen-omni-turbo": [7e-8, 27e-8, null, null, null], "qwen-omni-turbo-realtime": [27e-8, 10700000000000001e-22, null, null, null], "qwen-plus-character-ja": [5e-7, 14e-7, null, null, null], "qwen-vl-max": [8000000000000001e-22, 32000000000000003e-22, null, null, null], "qwen-vl-ocr": [72e-8, 72e-8, null, null, null], "qwen2-5-14b-instruct": [35e-8, 14e-7, null, null, null], "qwen2-5-32b-instruct": [7e-7, 28e-7, null, null, null], "qwen2-5-72b-instruct": [14e-7, 56e-7, null, null, null], "qwen2-5-7b-instruct": [175e-9, 7e-7, null, null, null], "qwen2-5-omni-7b": [10000000000000001e-23, 40000000000000003e-23, null, null, null], "qwen2-5-vl-72b-instruct": [28e-7, 8400000000000001e-21, null, null, null], "qwen2-5-vl-7b-instruct": [35e-8, 10500000000000001e-22, null, null, null], "qwen3-asr-flash": [35e-9, 35e-9, null, null, null], "qwen3-livetranslate-flash-realtime": [1e-5, 1e-5, null, null, null], "qwen3-omni-flash": [43e-8, 166e-8, null, null, null], "qwen3-omni-flash-realtime": [52e-8, 199e-8, null, null, null], "qwen3-vl-235b-a22b": [7e-7, 28e-7, null, null, null], "qwen3-vl-30b-a3b": [20000000000000002e-23, 8000000000000001e-22, null, null, null], "qwen3-vl-plus": [20000000000000002e-23, 16000000000000001e-22, null, null, null], "qwen3.5-flash": [10000000000000001e-23, 40000000000000003e-23, 125e-9, 1e-8, null], "deepseek-v3-1": [5739999999999999e-22, 17210000000000001e-22, null, null, null], "deepseek-v3-2-exp": [28699999999999996e-23, 431e-9, null, null, null], "moonshot-kimi-k2-instruct": [5739999999999999e-22, 2294e-9, null, null, null], "qwen-deep-research": [7742e-9, 23367000000000002e-21, null, null, null], "qwen-doc-turbo": [87e-9, 144e-9, null, null, null], "qwen-long": [72e-9, 28699999999999996e-23, null, null, null], "qwen-math-plus": [5739999999999999e-22, 17210000000000001e-22, null, null, null], "qwen-math-turbo": [28699999999999996e-23, 861e-9, null, null, null], "qwen-plus-character": [11500000000000001e-23, 28699999999999996e-23, null, null, null], "qwen2-5-coder-32b-instruct": [28699999999999996e-23, 861e-9, null, null, null], "qwen2-5-coder-7b-instruct": [144e-9, 28699999999999996e-23, null, null, null], "qwen2-5-math-72b-instruct": [5739999999999999e-22, 17210000000000001e-22, null, null, null], "qwen2-5-math-7b-instruct": [144e-9, 28699999999999996e-23, null, null, null], "tongyi-intent-detect-v3": [58e-9, 144e-9, null, null, null], "command-a-reasoning-08-2025": [25e-7, 1e-5, null, null, null], "command-a-translate-08-2025": [25e-7, 1e-5, null, null, null], "command-a-vision-07-2025": [25e-7, 1e-5, null, null, null], "command-r7b-arabic-02-2025": [375e-10, 15e-8, null, null, null], "claude-opus-4-1": [15e-6, 75e-6, 1875e-8, 15e-7, null], "devstral-medium-2507": [40000000000000003e-23, 2e-6, null, null, null], "devstral-small-2507": [10000000000000001e-23, 3e-7, null, null, null], "mistral-medium-2508": [40000000000000003e-23, 2e-6, null, null, null], "mistral-small-2506": [10000000000000001e-23, 3e-7, null, null, null], "open-mistral-7b": [25e-8, 25e-8, null, null, null], "open-mixtral-8x22b": [2e-6, 6e-6, null, null, null], "open-mixtral-8x7b": [7e-7, 7e-7, null, null, null], "gpt-5.3-codex-spark": [175e-8, 14e-6, null, 175e-9, null], "gpt-image-2": [5e-6, 3e-5, null, 125e-8, null], "glm-4.7-flashx": [7e-8, 40000000000000003e-23, 0, 1e-8, null], "claude-sonnet-5.5:batch": [1e-6, 5e-6, 125e-8, 1e-7, null], "mistral/codestral-embed": [15e-8, 0, null, null, null, null], "mistral/mistral-embed": [1e-7, 0, null, null, null, null], "azure_ai/muse-spark-1.3": [125e-8, 425e-8, null, 15e-8, null, null], "amazon.nova-sonic-v1:0": [6e-8, 24e-8, null, null, null, null], "anthropic.claude-3-haiku-20240307-v1:0": [25e-8, 125e-8, 3125e-10, 25e-9, null, null], "anthropic.claude-3-sonnet-20240229-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "apac.anthropic.claude-3-5-sonnet-20240620-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "apac.anthropic.claude-3-5-sonnet-20241022-v2:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "apac.anthropic.claude-3-haiku-20240307-v1:0": [25e-8, 125e-8, 3125e-10, 25e-9, null, null], "apac.anthropic.claude-3-sonnet-20240229-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "chatgpt-4o-latest": [5e-6, 15e-6, null, null, null, null], "codex-mini-latest": [15e-7, 6e-6, null, 375e-9, null, null], "cohere.command-r-plus-v1:0": [3e-6, 15e-6, null, null, null, null], "cohere.command-r-v1:0": [5e-7, 15e-7, null, null, null, null], command: [1e-6, 2e-6, null, null, null, null], "command-light": [3e-7, 6e-7, null, null, null, null], "command-r": [15e-8, 6e-7, null, null, null, null], "embed-english-light-v2.0": [1e-7, 0, null, null, null, null], "embed-english-v2.0": [1e-7, 0, null, null, null, null], "embed-multilingual-v2.0": [1e-7, 0, null, null, null, null], "eu.anthropic.claude-3-haiku-20240307-v1:0": [25e-8, 125e-8, 3125e-10, 25e-9, null, null], "eu.anthropic.claude-3-sonnet-20240229-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "gemini-2.0-flash-001": [15e-8, 6e-7, null, 375e-10, null, null], "gemini-2.0-flash-lite-001": [75e-9, 3e-7, null, 1875e-11, null, null], "gemini-2.5-flash-lite-preview-06-17": [1e-7, 4e-7, null, 1e-8, null, null], "gpt-4-0314": [3e-5, 6e-5, null, null, null, null], "gpt-4-turbo-preview": [1e-5, 3e-5, null, null, null, null], "gpt-4o-audio-preview": [25e-7, 1e-5, null, null, null, null], "gpt-4o-mini-audio-preview": [15e-8, 6e-7, null, null, null, null], "gpt-4o-mini-realtime-preview": [6e-7, 24e-7, null, 3e-7, null, null], "gpt-4o-mini-search-preview-2025-03-11": [15e-8, 6e-7, null, 75e-9, null, null], "gpt-4o-realtime-preview": [5e-6, 2e-5, null, 25e-7, null, null], "gpt-4o-realtime-preview-2025-06-03": [5e-6, 2e-5, null, 25e-7, null, null], "gpt-4o-search-preview-2025-03-11": [25e-7, 1e-5, null, 125e-8, null, null], "o3-deep-research-2025-06-26": [1e-5, 4e-5, null, 25e-7, null, null], "o4-mini-deep-research-2025-06-26": [2e-6, 8e-6, null, 5e-7, null, null], "us.amazon.nova-premier-v1:0": [25e-7, 125e-7, null, 625e-9, null, null], "us.anthropic.claude-3-haiku-20240307-v1:0": [25e-8, 125e-8, 3125e-10, 25e-9, null, null], "us.anthropic.claude-3-sonnet-20240229-v1:0": [3e-6, 15e-6, 375e-8, 3e-7, null, null], "us-gov.anthropic.claude-3-haiku-20240307-v1:0": [3e-7, 15e-7, 375e-9, 3e-8, null, null], "gpt-4o-mini-tts-2025-03-20": [6e-7, 1e-5, null, null, null, null], "azure_ai/claude-opus-4-1": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "azure/eu/o1-preview-2024-09-12": [165e-7, 66e-6, null, 825e-8, null, null], "eu/o1-preview-2024-09-12": [165e-7, 66e-6, null, 825e-8, null, null], "azure/global/gpt-5.1-chat": [125e-8, 1e-5, null, 125e-9, null, null], "global/gpt-5.1-chat": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-3.5-turbo-0125": [5e-7, 15e-7, null, null, null, null], "azure/gpt-35-turbo-0125": [5e-7, 15e-7, null, null, null, null], "gpt-35-turbo-0125": [5e-7, 15e-7, null, null, null, null], "azure/gpt-35-turbo-1106": [1e-6, 2e-6, null, null, null, null], "gpt-35-turbo-1106": [1e-6, 2e-6, null, null, null, null], "azure/gpt-5.1-chat-2025-11-13": [125e-8, 1e-5, null, 125e-9, null, null], "gpt-5.1-chat-2025-11-13": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5-chat-latest": [125e-8, 1e-5, null, 125e-9, null, null], "azure/gpt-5.2-chat-2025-12-11": [175e-8, 14e-6, null, 175e-9, null, null], "gpt-5.2-chat-2025-12-11": [175e-8, 14e-6, null, 175e-9, null, null], "azure/o1-preview": [15e-6, 6e-5, null, 75e-7, null, null], "o1-preview": [15e-6, 6e-5, null, 75e-7, null, null], "azure/o1-preview-2024-09-12": [15e-6, 6e-5, null, 75e-7, null, null], "o1-preview-2024-09-12": [15e-6, 6e-5, null, 75e-7, null, null], "azure/us/o1-preview-2024-09-12": [165e-7, 66e-6, null, 825e-8, null, null], "us/o1-preview-2024-09-12": [165e-7, 66e-6, null, 825e-8, null, null], "azure_ai/Llama-3.2-11B-Vision-Instruct": [37e-8, 37e-8, null, null, null, null], "Llama-3.2-11B-Vision-Instruct": [37e-8, 37e-8, null, null, null, null], "azure_ai/Llama-3.2-90B-Vision-Instruct": [204e-8, 204e-8, null, null, null, null], "Llama-3.2-90B-Vision-Instruct": [204e-8, 204e-8, null, null, null, null], "azure_ai/Meta-Llama-3.1-405B-Instruct": [533e-8, 16e-6, null, null, null, null], "Meta-Llama-3.1-405B-Instruct": [533e-8, 16e-6, null, null, null, null], "azure_ai/Meta-Llama-3.1-8B-Instruct": [3e-7, 61e-8, null, null, null, null], "Meta-Llama-3.1-8B-Instruct": [3e-7, 61e-8, null, null, null, null], "azure_ai/global/grok-3": [3e-6, 15e-6, null, null, null, null], "global/grok-3": [3e-6, 15e-6, null, null, null, null], "azure_ai/global/grok-3-mini": [25e-8, 127e-8, null, null, null, null], "global/grok-3-mini": [25e-8, 127e-8, null, null, null, null], "bedrock/us-gov-east-1/anthropic.claude-3-5-sonnet-20240620-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-east-1/anthropic.claude-3-5-sonnet-20240620-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-east-1/anthropic.claude-3-haiku-20240307-v1:0": [3e-7, 15e-7, 375e-9, 3e-8, null, null], "us-gov-east-1/anthropic.claude-3-haiku-20240307-v1:0": [3e-7, 15e-7, 375e-9, 3e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-3-7-sonnet-20250219-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-west-1/anthropic.claude-3-7-sonnet-20250219-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-3-5-sonnet-20240620-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "us-gov-west-1/anthropic.claude-3-5-sonnet-20240620-v1:0": [36e-7, 18e-6, 45e-7, 36e-8, null, null], "bedrock/us-gov-west-1/anthropic.claude-3-haiku-20240307-v1:0": [3e-7, 15e-7, 375e-9, 3e-8, null, null], "us-gov-west-1/anthropic.claude-3-haiku-20240307-v1:0": [3e-7, 15e-7, 375e-9, 3e-8, null, null], "cerebras/zai-glm-4.6": [225e-8, 275e-8, null, null, null, null], "zai-glm-4.6": [225e-8, 275e-8, null, null, null, null], "cerebras/zai-glm-4.7": [225e-8, 275e-8, null, null, null, null], "zai-glm-4.7": [225e-8, 275e-8, null, null, null, null], "databricks/databricks-claude-3-7-sonnet": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks-claude-3-7-sonnet": [29999900000000002e-22, 15000020000000002e-21, 374997e-11, 30002e-11, null, null], "databricks/databricks-gpt-5-1-codex-max": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks-gpt-5-1-codex-max": [124999e-11, 9999990000000002e-21, 124999e-11, 12502e-11, null, null], "databricks/databricks-gpt-5-1-codex-mini": [24997e-11, 199997e-11, 24997e-11, 2499e-11, null, null], "databricks-gpt-5-1-codex-mini": [24997e-11, 199997e-11, 24997e-11, 2499e-11, null, null], "databricks/databricks-gpt-5-2-codex": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks-gpt-5-2-codex": [175e-8, 14e-6, 175e-8, 175e-9, null, null], "databricks/databricks-llama-2-70b-chat": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks-llama-2-70b-chat": [50001e-11, 15000300000000002e-22, 50001e-11, 50001e-11, null, null], "databricks/databricks-meta-llama-3-1-405b-instruct": [500003e-11, 15000020000000002e-21, 500003e-11, 500003e-11, null, null], "databricks-meta-llama-3-1-405b-instruct": [500003e-11, 15000020000000002e-21, 500003e-11, 500003e-11, null, null], "databricks/databricks-meta-llama-3-70b-instruct": [100002e-11, 29999900000000002e-22, 100002e-11, 100002e-11, null, null], "databricks-meta-llama-3-70b-instruct": [100002e-11, 29999900000000002e-22, 100002e-11, 100002e-11, null, null], "databricks/databricks-mixtral-8x7b-instruct": [50001e-11, 100002e-11, 50001e-11, 50001e-11, null, null], "databricks-mixtral-8x7b-instruct": [50001e-11, 100002e-11, 50001e-11, 50001e-11, null, null], "databricks/databricks-mpt-30b-instruct": [100002e-11, 100002e-11, 100002e-11, 100002e-11, null, null], "databricks-mpt-30b-instruct": [100002e-11, 100002e-11, 100002e-11, 100002e-11, null, null], "databricks/databricks-mpt-7b-instruct": [50001e-11, 0, 50001e-11, 50001e-11, null, null], "databricks-mpt-7b-instruct": [50001e-11, 0, 50001e-11, 50001e-11, null, null], "deepinfra/google/gemini-2.0-flash-001": [1e-7, 4e-7, null, null, null, null], "google/gemini-2.0-flash-001": [1e-7, 4e-7, null, null, null, null], "fireworks_ai/accounts/fireworks/models/minimax-m2p7": [3e-7, 12e-7, null, 6e-8, null, null], "accounts/fireworks/models/minimax-m2p7": [3e-7, 12e-7, null, 6e-8, null, null], "fireworks_ai/deepseek-v4-pro": [12e-7, 12e-7, null, 6e-7, null, null], "fireworks_ai/minimax-m2p7": [3e-7, 12e-7, null, 6e-8, null, null], "minimax-m2p7": [3e-7, 12e-7, null, 6e-8, null, null], "friendliai/LGAI-EXAONE/K-EXAONE-2.0-750B-A37B": [6e-7, 24e-7, null, 12e-8, null, null], "LGAI-EXAONE/K-EXAONE-2.0-750B-A37B": [6e-7, 24e-7, null, 12e-8, null, null], "gemini/gemini-robotics-er-1.5-preview": [3e-7, 25e-7, null, 0, null, null], "gemini/gemini-robotics-er-1.6-preview": [1e-6, 5e-6, null, null, null, null], "gemini-robotics-er-1.6-preview": [1e-6, 5e-6, null, null, null, null], "gemini/gemini-1.5-flash": [75e-9, 0, null, null, null, null], "gemini-1.5-flash": [75e-9, 0, null, null, null, null], "gemini/gemini-2.0-flash": [1e-7, 4e-7, null, 25e-9, null, null], "gemini/gemini-2.0-flash-001": [1e-7, 4e-7, null, 25e-9, null, null], "gemini/gemini-2.0-flash-lite": [75e-9, 3e-7, null, 1875e-11, null, null], "gemini/gemini-2.5-flash-lite-preview-09-2025": [1e-7, 4e-7, null, 1e-8, null, null], "gemini/gemini-2.5-flash-preview-09-2025": [3e-7, 25e-7, null, 3e-8, null, null], "gemini/gemini-2.5-flash-lite-preview-06-17": [1e-7, 4e-7, null, 1e-8, null, null], "gemini/gemini-3-pro-preview": [2e-6, 12e-6, null, 2e-7, null, { threshold: 2e5, input: 4e-6, output: 18e-6, cacheWrite: null, cacheRead: 4e-7 }], "groq/llama-3.1-8b-instant": [5e-8, 8e-8, null, null, null, null], "llama-3.1-8b-instant": [5e-8, 8e-8, null, null, null, null], "groq/llama-3.3-70b-versatile": [59e-8, 79e-8, null, null, null, null], "llama-3.3-70b-versatile": [59e-8, 79e-8, null, null, null, null], "groq/gemma-7b-it": [5e-8, 8e-8, null, null, null, null], "gemma-7b-it": [5e-8, 8e-8, null, null, null, null], "groq/meta-llama/llama-guard-4-12b": [2e-7, 2e-7, null, null, null, null], "groq/meta-llama/llama-4-maverick-17b-128e-instruct": [2e-7, 6e-7, null, null, null, null], "meta-llama/llama-4-maverick-17b-128e-instruct": [2e-7, 6e-7, null, null, null, null], "groq/meta-llama/llama-4-scout-17b-16e-instruct": [11e-8, 34e-8, null, null, null, null], "groq/moonshotai/kimi-k2-instruct-0905": [1e-6, 3e-6, null, 5e-7, null, null], "moonshotai/kimi-k2-instruct-0905": [1e-6, 3e-6, null, 5e-7, null, null], "groq/qwen/qwen3.6-27b": [6e-7, 3e-6, null, null, null, null], "groq/qwen/qwen3-32b": [29e-8, 59e-8, null, null, null, null], "mistral/codestral-2405": [1e-6, 3e-6, null, null, null, null], "mistral/devstral-medium-2507": [4e-7, 2e-6, null, null, null, null], "mistral/devstral-small-2505": [1e-7, 3e-7, null, null, null, null], "devstral-small-2505": [1e-7, 3e-7, null, null, null, null], "mistral/devstral-small-2507": [1e-7, 3e-7, null, null, null, null], "mistral/labs-devstral-small-2512": [1e-7, 3e-7, null, null, null, null], "labs-devstral-small-2512": [1e-7, 3e-7, null, null, null, null], "mistral/devstral-2512": [4e-7, 2e-6, null, null, null, null], "devstral-2512": [4e-7, 2e-6, null, null, null, null], "mistral/magistral-medium-2506": [2e-6, 5e-6, null, null, null, null], "magistral-medium-2506": [2e-6, 5e-6, null, null, null, null], "mistral/magistral-medium-2509": [2e-6, 5e-6, null, null, null, null], "magistral-medium-2509": [2e-6, 5e-6, null, null, null, null], "mistral/magistral-medium-1-2-2509": [2e-6, 5e-6, null, null, null, null], "magistral-medium-1-2-2509": [2e-6, 5e-6, null, null, null, null], "mistral/magistral-small-2506": [5e-7, 15e-7, null, null, null, null], "magistral-small-2506": [5e-7, 15e-7, null, null, null, null], "mistral/magistral-small-1-2-2509": [5e-7, 15e-7, null, null, null, null], "magistral-small-1-2-2509": [5e-7, 15e-7, null, null, null, null], "mistral/mistral-large-2402": [4e-6, 12e-6, null, null, null, null], "mistral/mistral-large-2407": [3e-6, 9e-6, null, null, null, null], "mistral/mistral-large-2411": [2e-6, 6e-6, null, null, null, null], "mistral/mistral-medium-2312": [27e-7, 81e-7, null, null, null, null], "mistral-medium-2312": [27e-7, 81e-7, null, null, null, null], "mistral/mistral-medium-2505": [4e-7, 2e-6, null, null, null, null], "mistral/mistral-medium-2508": [4e-7, 2e-6, null, null, null, null], "mistral/mistral-medium-3-1-2508": [4e-7, 2e-6, null, null, null, null], "mistral-medium-3-1-2508": [4e-7, 2e-6, null, null, null, null], "mistral/mistral-small-3-2-2506": [6e-8, 18e-8, null, null, null, null], "mistral-small-3-2-2506": [6e-8, 18e-8, null, null, null, null], "mistral/open-codestral-mamba": [25e-8, 25e-8, null, null, null, null], "open-codestral-mamba": [25e-8, 25e-8, null, null, null, null], "mistral/open-mistral-7b": [25e-8, 25e-8, null, null, null, null], "mistral/open-mistral-nemo-2407": [3e-7, 3e-7, null, null, null, null], "open-mistral-nemo-2407": [3e-7, 3e-7, null, null, null, null], "mistral/open-mixtral-8x22b": [2e-6, 6e-6, null, null, null, null], "mistral/open-mixtral-8x7b": [7e-7, 7e-7, null, null, null, null], "mistral/pixtral-12b-2409": [15e-8, 15e-8, null, null, null, null], "pixtral-12b-2409": [15e-8, 15e-8, null, null, null, null], "mistral/pixtral-large-2411": [2e-6, 6e-6, null, null, null, null], "pixtral-large-2411": [2e-6, 6e-6, null, null, null, null], "moonshot/kimi-k2-0711-preview": [6e-7, 25e-7, null, 15e-8, null, null], "kimi-k2-0711-preview": [6e-7, 25e-7, null, 15e-8, null, null], "moonshot/kimi-k2-0905-preview": [6e-7, 25e-7, null, 15e-8, null, null], "kimi-k2-0905-preview": [6e-7, 25e-7, null, 15e-8, null, null], "moonshot/kimi-k2-turbo-preview": [115e-8, 8e-6, null, 15e-8, null, null], "kimi-k2-turbo-preview": [115e-8, 8e-6, null, 15e-8, null, null], "moonshot/kimi-latest": [2e-6, 5e-6, null, 15e-8, null, null], "kimi-latest": [2e-6, 5e-6, null, 15e-8, null, null], "moonshot/kimi-latest-128k": [2e-6, 5e-6, null, 15e-8, null, null], "kimi-latest-128k": [2e-6, 5e-6, null, 15e-8, null, null], "moonshot/kimi-latest-32k": [1e-6, 3e-6, null, 15e-8, null, null], "kimi-latest-32k": [1e-6, 3e-6, null, 15e-8, null, null], "moonshot/kimi-latest-8k": [2e-7, 2e-6, null, 15e-8, null, null], "kimi-latest-8k": [2e-7, 2e-6, null, 15e-8, null, null], "moonshot/kimi-thinking-preview": [6e-7, 25e-7, null, 15e-8, null, null], "kimi-thinking-preview": [6e-7, 25e-7, null, 15e-8, null, null], "moonshot/kimi-k2-thinking": [6e-7, 25e-7, null, 15e-8, null, null], "kimi-k2-thinking": [6e-7, 25e-7, null, 15e-8, null, null], "moonshot/kimi-k2-thinking-turbo": [115e-8, 8e-6, null, 15e-8, null, null], "kimi-k2-thinking-turbo": [115e-8, 8e-6, null, 15e-8, null, null], "moonshot/moonshot-v1-128k-0430": [2e-6, 5e-6, null, null, null, null], "moonshot-v1-128k-0430": [2e-6, 5e-6, null, null, null, null], "moonshot/moonshot-v1-32k-0430": [1e-6, 3e-6, null, null, null, null], "moonshot-v1-32k-0430": [1e-6, 3e-6, null, null, null, null], "moonshot/moonshot-v1-8k-0430": [2e-7, 2e-6, null, null, null, null], "moonshot-v1-8k-0430": [2e-7, 2e-6, null, null, null, null], "openrouter/anthropic/claude-opus-4": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "openrouter/google/gemini-2.0-flash-001": [1e-7, 4e-7, null, null, null, null], "sambanova/DeepSeek-R1-Distill-Llama-70B": [7e-7, 14e-7, null, null, null, null], "sambanova/DeepSeek-V3-0324": [3e-6, 45e-7, null, null, null, null], "DeepSeek-V3-0324": [3e-6, 45e-7, null, null, null, null], "sambanova/Llama-4-Scout-17B-16E-Instruct": [4e-7, 7e-7, null, null, null, null], "sambanova/Meta-Llama-3.1-405B-Instruct": [5e-6, 1e-5, null, null, null, null], "sambanova/Meta-Llama-3.1-8B-Instruct": [1e-7, 2e-7, null, null, null, null], "sambanova/Meta-Llama-3.2-1B-Instruct": [4e-8, 8e-8, null, null, null, null], "Meta-Llama-3.2-1B-Instruct": [4e-8, 8e-8, null, null, null, null], "sambanova/Meta-Llama-3.2-3B-Instruct": [8e-8, 16e-8, null, null, null, null], "Meta-Llama-3.2-3B-Instruct": [8e-8, 16e-8, null, null, null, null], "sambanova/Meta-Llama-Guard-3-8B": [3e-7, 3e-7, null, null, null, null], "Meta-Llama-Guard-3-8B": [3e-7, 3e-7, null, null, null, null], "sambanova/QwQ-32B": [5e-7, 1e-6, null, null, null, null], "QwQ-32B": [5e-7, 1e-6, null, null, null, null], "sambanova/Qwen2-Audio-7B-Instruct": [5e-7, 1e-4, null, null, null, null], "Qwen2-Audio-7B-Instruct": [5e-7, 1e-4, null, null, null, null], "sambanova/Qwen3-32B": [4e-7, 8e-7, null, null, null, null], "together_ai/Qwen/Qwen3-235B-A22B-Instruct-2507-tput": [2e-7, 6e-6, null, null, null, null], "Qwen/Qwen3-235B-A22B-Instruct-2507-tput": [2e-7, 6e-6, null, null, null, null], "together_ai/Qwen/Qwen3-235B-A22B-Thinking-2507": [65e-8, 3e-6, null, null, null, null], "together_ai/Qwen/Qwen3-235B-A22B-fp8-tput": [2e-7, 6e-7, null, null, null, null], "Qwen/Qwen3-235B-A22B-fp8-tput": [2e-7, 6e-7, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-R1": [3e-6, 7e-6, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-R1-0528-tput": [55e-8, 219e-8, null, null, null, null], "deepseek-ai/DeepSeek-R1-0528-tput": [55e-8, 219e-8, null, null, null, null], "together_ai/meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": [27e-8, 85e-8, null, null, null, null], "together_ai/meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": [35e-7, 35e-7, null, null, null, null], "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo": [35e-7, 35e-7, null, null, null, null], "together_ai/moonshotai/Kimi-K2.5": [5e-7, 28e-7, null, null, null, null], "together_ai/moonshotai/Kimi-K2-Instruct-0905": [1e-6, 3e-6, null, null, null, null], "together_ai/deepseek-ai/DeepSeek-V4-Pro": [174e-8, 348e-8, null, 2e-7, null, null], "together_ai/google/gemma-3n-E4B-it": [6e-8, 12e-8, null, null, null, null], "google/gemma-3n-E4B-it": [6e-8, 12e-8, null, null, null, null], "together_ai/intfloat/multilingual-e5-large-instruct": [2e-8, 2e-8, null, null, null, null], "intfloat/multilingual-e5-large-instruct": [2e-8, 2e-8, null, null, null, null], "together_ai/meta-llama/Llama-Guard-4-12B": [2e-7, 2e-7, null, null, null, null], "together_ai/pearl-ai/gemma-4-31b-it": [28e-8, 86e-8, null, null, null, null], "pearl-ai/gemma-4-31b-it": [28e-8, 86e-8, null, null, null, null], "together_ai/thinkingmachines/Inkling-Small": [5e-7, 12e-7, null, 1e-7, null, null], "vercel_ai_gateway/google/gemini-2.0-flash": [15e-8, 6e-7, null, null, null, null], "google/gemini-2.0-flash": [15e-8, 6e-7, null, null, null, null], "vercel_ai_gateway/google/gemini-2.0-flash-lite": [75e-9, 3e-7, null, null, null, null], "google/gemini-2.0-flash-lite": [75e-9, 3e-7, null, null, null, null], "vertex_ai/claude-opus-4": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vertex_ai/claude-opus-4-1": [15e-6, 75e-6, 1875e-8, 15e-7, null, null], "vertex_ai/claude-sonnet-4": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "claude-sonnet-4": [3e-6, 15e-6, 375e-8, 3e-7, null, { threshold: 2e5, input: 6e-6, output: 225e-7, cacheWrite: 75e-7, cacheRead: 6e-7 }], "wandb/zai-org/GLM-4.5": [0.055, 0.2, null, null, null, null], "wandb/Qwen/Qwen3-235B-A22B-Instruct-2507": [1e-7, 1e-7, null, null, null, null], "wandb/Qwen/Qwen3-Coder-480B-A35B-Instruct": [1e-6, 15e-7, null, null, null, null], "wandb/Qwen/Qwen3-235B-A22B-Thinking-2507": [1e-7, 1e-7, null, null, null, null], "wandb/moonshotai/Kimi-K2-Instruct": [6e-7, 25e-7, null, null, null, null], "wandb/MiniMaxAI/MiniMax-M2.5": [3e-7, 12e-7, null, null, null, null], "wandb/deepseek-ai/DeepSeek-R1-0528": [135e-8, 54e-7, null, null, null, null], "wandb/deepseek-ai/DeepSeek-V3-0324": [114e-8, 275e-8, null, null, null, null], "wandb/meta-llama/Llama-4-Scout-17B-16E-Instruct": [17e-8, 66e-8, null, null, null, null], "wandb/microsoft/Phi-4-mini-instruct": [8e-3, 0.035, null, null, null, null], "microsoft/Phi-4-mini-instruct": [8e-3, 0.035, null, null, null, null], "xai/grok-3-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-fast-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-fast-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-fast-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-fast-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-mini-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-mini-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-mini-fast": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-mini-fast-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-mini-fast-beta": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-mini-fast-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-mini-fast-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-3-mini-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-3-mini-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-fast-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-fast-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-0709": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4-0709": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-1-fast": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4-1-fast": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-1-fast-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-1-fast-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4-1-fast-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-1-fast-non-reasoning": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "xai/grok-4-1-fast-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "grok-4-1-fast-non-reasoning-latest": [125e-8, 25e-7, null, 2e-7, null, { threshold: 2e5, input: 25e-7, output: 5e-6, cacheWrite: null, cacheRead: 4e-7 }], "scaleway/google/gemma-3-27b-it": [25e-8, 5e-7, null, null, null, null], "scaleway/hcompany/holo2-30b-a3b": [3e-7, 7e-7, null, null, null, null], "hcompany/holo2-30b-a3b": [3e-7, 7e-7, null, null, null, null], "scaleway/mistralai/devstral-2-123b-instruct-2512": [4e-7, 2e-6, null, null, null, null], "mistralai/devstral-2-123b-instruct-2512": [4e-7, 2e-6, null, null, null, null], "scaleway/mistralai/voxtral-small-24b-2507": [15e-8, 35e-8, null, null, null, null], "gemini/gemini-2.0-flash-lite-001": [75e-9, 3e-7, null, 1875e-11, null, null], "vertex_ai/gemini-3.1-flash-live-preview": [75e-8, 45e-7, null, null, null, null], "vertex_ai/gemini-robotics-er-2": [1e-6, 5e-6, null, 1e-7, null, null], "gemini-robotics-er-2": [1e-6, 5e-6, null, 1e-7, null, null], "openrouter/deepseek/deepseek-v4-flash-0731:batch": [11e-8, 33e-8, null, 35e-10, null, null], "deepseek/deepseek-v4-flash-0731:batch": [11e-8, 33e-8, null, 35e-10, null, null], "openrouter/deepseek/deepseek-v4-flash-vision-exp:batch": [11e-8, 33e-8, null, 35e-10, null, null], "deepseek/deepseek-v4-flash-vision-exp:batch": [11e-8, 33e-8, null, 35e-10, null, null], "openrouter/deepseek/deepseek-v4-pro-0813:batch": [66e-8, 198e-8, null, 22e-9, null, null], "deepseek/deepseek-v4-pro-0813:batch": [66e-8, 198e-8, null, 22e-9, null, null], "openrouter/kwaipilot/kat-coder-pro-v2": [3e-7, 12e-7, null, 6e-8, null, null], "kwaipilot/kat-coder-pro-v2": [3e-7, 12e-7, null, 6e-8, null, null], "openrouter/meta/muse-glimmer-30b:batch": [175e-9, 75e-8, null, 2e-8, null, null], "meta/muse-glimmer-30b:batch": [175e-9, 75e-8, null, 2e-8, null, null], "openrouter/minimax/minimax-m3:batch": [3e-7, 12e-7, null, 6e-8, null, null], "minimax/minimax-m3:batch": [3e-7, 12e-7, null, 6e-8, null, null], "openrouter/qwen/qwen3.5-9b:batch": [17e-8, 25e-8, null, null, null, null], "qwen/qwen3.5-9b:batch": [17e-8, 25e-8, null, null, null, null], "openrouter/qwen/qwen3.8-2.4t-a95b:batch": [2e-6, 6e-6, null, 25e-8, null, null], "qwen/qwen3.8-2.4t-a95b:batch": [2e-6, 6e-6, null, 25e-8, null, null], "openrouter/thinkingmachines/inkling:batch": [1e-6, 405e-8, null, 17e-8, null, null], "thinkingmachines/inkling:batch": [1e-6, 405e-8, null, 17e-8, null, null], "openrouter/z-ai/glm-5.2:batch": [7e-7, 22e-7, null, 7e-8, null, null], "z-ai/glm-5.2:batch": [7e-7, 22e-7, null, 7e-8, null, null], "llama-3.3-70b-instruct-maas": [72e-8, 72e-8, null, null, null], "glm-5.2-maas": [14e-7, 44e-7, null, 14e-8, null], "glm-5.3-flashx": [37e-8, 125e-8, 0, 75e-9, null], "ternary-bonsai-2-27b": [75e-9, 5e-7, null, null, null], "twelvelabs.marengo-embed-2-7-v1:0": [7e-5, 0, null, null, null], "us.twelvelabs.marengo-embed-2-7-v1:0": [7e-5, 0, null, null, null], "eu.twelvelabs.marengo-embed-2-7-v1:0": [7e-5, 0, null, null, null], "gpt-image-2-2026-04-21": [5e-6, 1e-5, null, 125e-8, null], "azure/gpt-image-2": [5e-6, 1e-5, null, 125e-8, null], "azure/gpt-image-2-2026-04-21": [5e-6, 1e-5, null, 125e-8, null], "friendliai/meta-llama-3.1-70b-instruct": [6e-7, 6e-7, null, null, null], "meta-llama-3.1-70b-instruct": [6e-7, 6e-7, null, null, null], "friendliai/meta-llama-3.1-8b-instruct": [1e-7, 1e-7, null, null, null], "meta-llama-3.1-8b-instruct": [1e-7, 1e-7, null, null, null], "gmi/google/gemini-3-pro-preview": [2e-6, 12e-6, null, null, null], "qwen3-coder-flash": [3e-7, 15e-7, null, null, null], "qwen3.5-plus": [40000000000000003e-23, 24e-7, null, null, null], "qwen3.6-flash": [1875e-10, 1125e-9, 234375e-12, null, null], "qwen3.7-flash": [2962e-11, 1185e-10, 3703e-11, 2962e-12, null], "gemini-3.8-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null], "claude-fable-5.1": [1e-5, 5e-5, 125e-7, 25e-8, null], "claude-fable-5.1:batch": [5e-6, 25e-6, 625e-8, 125e-9, null], "mercury-2.5-preview": [4e-8, 15e-8, null, 4e-9, null], "granite-4.2-8b": [1e-7, 15e-8, null, 5e-8, null], "ling-3.0-flash-fin": [6e-8, 18e-8, null, 12e-9, null], "glm-flash-latest": [7125e-11, 2375e-10, null, 1425e-11, null], "glm-5.3-flash:batch": [15e-8, 5e-7, null, 3e-8, null], "hy-mt2-1.8b": [44e-9, 177e-9, null, null, null], "hy-mt2-30b-a3b": [74e-9, 295e-9, null, null, null], "glm-latest": [1148e-9, 3608e-9, null, 1886e-10, null], "hy-mt2-7b": [74e-9, 295e-9, null, null, null], "gemini-3.7-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null], "seed-2-1-turbo": [5e-7, 25e-7, null, null, null], "qwen3.8-2.4t-a95b:batch": [2e-6, 6e-6, null, 25e-8, null], "deepseek-v4-pro-0813:batch": [132e-8, 396e-8, null, 13e-8, null], "sakana-namazu": [95e-8, 4e-6, null, 15e-8, null], "solar-pro4": [3e-8, 12e-8, null, 6e-9, null], "muse-glimmer-30b:batch": [35e-8, 15e-7, null, 4e-8, null], "deepseek-v4-flash-latest": [5e-8, 16e-8, null, 13e-9, null], "deepseek-v4-flash-0731:batch": [14e-8, 28e-8, null, 3e-8, null], "inkling-small:batch": [5e-7, 12e-7, null, 1e-7, null], "claude-opus-5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null], "laguna-s-2.1": [9e-8, 18e-8, null, 9e-9, null], "gemini-3.6-flash:batch": [375e-9, 1875e-9, 416666666666667e-22, 375e-10, null], "gemini-3.5-flash-lite:batch": [15e-8, 125e-8, null, 15e-9, null], "inkling:batch": [1e-6, 405e-8, null, 17e-8, null], "kimi-k3:batch": [3e-6, 15e-6, null, 3e-7, null], "kat-coder-pro-v2.5": [74e-8, 296e-8, null, 15e-8, null], "gpt-5.6-luna-pro": [2e-7, 12e-7, 25e-8, 2e-8, null], "gpt-5.6-luna-pro:batch": [1e-7, 6e-7, null, 1e-8, null], "gpt-5.6-luna:batch": [1e-7, 6e-7, null, 1e-8, null], "gpt-5.6-terra-pro": [2e-6, 12e-6, 25e-7, 2e-7, null], "gpt-5.6-terra-pro:batch": [1e-6, 6e-6, null, 1e-7, null], "gpt-5.6-terra:batch": [1e-6, 6e-6, null, 1e-7, null], "gpt-5.6-sol-pro": [2e-6, 1e-5, 25e-7, 2e-7, null], "gpt-5.6-sol-pro:batch": [1e-6, 5e-6, 125e-8, 1e-7, null], "gpt-5.6-sol:batch": [1e-6, 5e-6, 125e-8, 1e-7, null], "grok-latest": [2e-6, 6e-6, null, 5e-7, null], "aion-3.0-mini": [7e-7, 14e-7, null, 18e-8, null], "aion-3.0": [3e-6, 6e-6, null, 75e-8, null], "laguna-xs-2.1": [6e-8, 12e-8, null, 3e-8, null], "claude-sonnet-5:batch": [1e-6, 5e-6, 125e-8, 1e-7, null], "nex-n2-mini": [25e-9, 1e-7, null, 25e-10, null], "fugu-ultra": [5e-6, 3e-5, null, 5e-7, null], "claude-fable-latest": [1e-5, 5e-5, 125e-7, 25e-8, null], "claude-fable-5:batch": [5e-6, 25e-6, 625e-8, 5e-7, null], "nex-n2-pro": [25e-8, 1e-6, null, 25e-9, null], "minimax-m3:batch": [3e-7, 12e-7, null, 6e-8, null], "claude-opus-4.8": [5e-6, 25e-6, 625e-8, 5e-7, null], "claude-opus-4.8:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null], "gemini-3.5-flash:batch": [75e-8, 45e-7, null, 75e-9, null], "perceptron-mk1": [15e-8, 15e-7, null, null, null], "gemini-3.1-flash-lite:batch": [125e-9, 75e-8, null, 125e-10, null], "mistral-medium-3-5:batch": [75e-8, 375e-8, null, null, null], "claude-haiku-latest": [1e-6, 5e-6, 125e-8, 1e-7, null], "gpt-mini-latest": [75e-8, 45e-7, null, 75e-9, null], "claude-sonnet-latest": [2e-6, 1e-5, 25e-7, 2e-7, null], "gpt-latest": [2e-6, 1e-5, 25e-7, 2e-7, null], "gpt-5.5-pro:batch": [15e-6, 9e-5, null, null, null], "gpt-5.5:batch": [25e-7, 15e-6, null, 25e-8, null], "hy3-preview": [18e-8, 6e-7, null, 6e-8, null], "gpt-5.4-image-2": [8e-6, 15e-6, null, 2e-6, null], "claude-opus-latest": [5e-6, 25e-6, 625e-8, 5e-7, null], "claude-opus-4.7:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null], "gemma-4-31b-it:batch": [39e-8, 97e-8, null, null, null], "trinity-large-thinking": [25e-8, 8e-7, null, 6e-8, null], "kat-coder-pro-v2": [3e-7, 12e-7, null, 6e-8, null], "reka-edge": [1e-7, 1e-7, null, null, null], "gpt-5.4-nano:batch": [1e-7, 625e-9, null, 1e-8, null], "gpt-5.4-mini:batch": [375e-9, 225e-8, null, 375e-10, null], "nemotron-3-super-120b-a12b": [85e-9, 4e-7, null, null, null], "seed-2.0-lite": [25e-8, 2e-6, null, null, null], "qwen3.5-9b:batch": [17e-8, 25e-8, null, null, null], "gpt-5.4-pro:batch": [15e-6, 9e-5, null, null, null], "gpt-5.4:batch": [125e-8, 75e-7, null, 125e-9, null], "aion-2.0": [8e-7, 16e-7, null, 2e-7, null], "gemini-3.1-pro-preview:batch": [1e-6, 6e-6, null, null, null], "claude-sonnet-4.6:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null], "claude-opus-4.6:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null], "step-3.5-flash": [1e-7, 3e-7, null, null, null], "solar-pro-3": [15e-8, 6e-7, null, 15e-9, null], "minimax-m2-her": [3e-7, 12e-7, null, 3e-8, null], "palmyra-x5": [6e-7, 6e-6, null, null, null], "seed-1.6-flash": [75e-9, 3e-7, null, null, null], "seed-1.6": [25e-8, 2e-6, null, null, null], "gemini-3-flash-preview:batch": [25e-8, 15e-7, null, null, null], "gpt-5.2-pro:batch": [105e-7, 84e-6, null, null, null], "gpt-5.2:batch": [875e-9, 7e-6, null, 875e-10, null], "relace-search": [1e-6, 3e-6, null, null, null], "nova-2-lite-v1": [3e-7, 25e-7, null, null, null], "claude-opus-4.5:batch": [25e-7, 125e-7, 3125e-9, 25e-8, null], "gpt-5.1:batch": [625e-9, 5e-6, null, 625e-10, null], "sonar-pro-search": [3e-6, 15e-6, null, null, null], "gpt-5-image-mini": [25e-7, 2e-6, null, 25e-8, null], "claude-haiku-4.5:batch": [5e-7, 25e-7, 625e-9, 5e-8, null], "qwen3-vl-8b-thinking": [18e-8, 21e-7, null, null, null], "gpt-5-image": [1e-5, 1e-5, null, 125e-8, null], "gpt-5-pro:batch": [75e-7, 6e-5, null, null, null], "claude-sonnet-4.5:batch": [15e-7, 75e-7, 1875e-9, 15e-8, null], "cydonia-24b-v4.1": [3e-7, 5e-7, null, 15e-8, null], "relace-apply-3": [85e-8, 125e-8, null, null, null], "qwen-plus-2025-07-28": [26e-8, 78e-8, null, null, null], "hermes-4-70b": [13e-8, 4e-7, null, null, null], "hermes-4-405b": [1e-6, 3e-6, null, null, null], "mistral-medium-3.1": [4e-7, 2e-6, null, 4e-8, null], "gpt-5:batch": [625e-9, 5e-6, null, 625e-10, null], "gpt-5-mini:batch": [125e-9, 1e-6, null, 125e-10, null], "gpt-5-nano:batch": [25e-9, 2e-7, null, 25e-10, null], "gpt-oss-120b:batch": [15e-8, 6e-7, null, null, null], "gpt-oss-20b:batch": [5e-8, 2e-7, null, null, null], "claude-opus-4.1:batch": [75e-7, 375e-7, 9375e-9, 75e-8, null], "gemini-2.5-flash-lite:batch": [5e-8, 2e-7, null, 1e-8, null], "dolphin-mistral-24b-venice-edition": [2e-7, 9e-7, null, null, null], "hunyuan-a13b-instruct": [14e-8, 57e-8, null, null, null], "minimax-m1": [55e-8, 22e-7, null, null, null], "gemini-2.5-flash:batch": [15e-8, 125e-8, null, 3e-8, null], "gemini-2.5-pro:batch": [625e-9, 5e-6, null, 125e-9, null], "gemini-2.5-pro-preview": [125e-8, 1e-5, 375e-9, 125e-9, null], "gemini-2.5-pro-preview-05-06": [125e-8, 1e-5, 375e-9, 125e-9, null], "o4-mini-high": [11e-7, 44e-7, null, 275e-9, null], "o3:batch": [1e-6, 4e-6, null, 25e-8, null], "o4-mini:batch": [55e-8, 22e-7, null, 1375e-10, null], "gpt-4.1:batch": [1e-6, 4e-6, null, 25e-8, null], "gpt-4.1-mini:batch": [2e-7, 8e-7, null, 5e-8, null], "gpt-4.1-nano:batch": [5e-8, 2e-7, null, 125e-10, null], "reka-flash-3": [1e-7, 2e-7, null, null, null], "skyfall-36b-v2": [55e-8, 8e-7, null, 25e-8, null], "mistral-saba": [2e-7, 6e-7, null, 2e-8, null], "aion-rp-llama-3.1-8b": [8e-7, 16e-7, null, null, null], "o3-mini:batch": [55e-8, 22e-7, null, 275e-9, null], "minimax-01": [2e-7, 11e-7, null, null, null], "l3.3-euryale-70b": [65e-8, 75e-8, null, null, null], "unslopnemo-12b": [4e-7, 4e-7, null, null, null], "magnum-v4-72b": [25e-7, 5e-6, null, null, null], "qwen-2.5-7b-instruct": [1e-7, 2e-7, null, null, null], "l3.1-euryale-70b": [85e-8, 85e-8, null, null, null], "l3-lunaris-8b": [4e-8, 5e-8, null, null, null], "gpt-4o-mini:batch": [75e-9, 3e-7, null, 375e-10, null], "gemma-2-27b-it": [65e-8, 65e-8, null, null, null], "gpt-4o:batch": [125e-8, 5e-6, null, 625e-9, null], "gpt-4-turbo:batch": [5e-6, 15e-6, null, null, null], "gpt-3.5-turbo-0613": [1e-6, 2e-6, null, null, null], "gpt-3.5-turbo:batch": [25e-8, 75e-8, null, null, null] };
|
||
}
|
||
});
|
||
|
||
// src/fetch-utils.ts
|
||
var init_fetch_utils = __esm({
|
||
"src/fetch-utils.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/models.ts
|
||
function billableOutputTokens(provider, outputTokens, reasoningTokens) {
|
||
return REASONING_INCLUDED_IN_OUTPUT.has(provider) ? outputTokens : outputTokens + reasoningTokens;
|
||
}
|
||
function buildCosts(input, output, cacheWrite, cacheRead, fast, tier, flex) {
|
||
return {
|
||
inputCostPerToken: input,
|
||
outputCostPerToken: output,
|
||
cacheWriteCostPerToken: cacheWrite ?? input * 1.25,
|
||
cacheReadCostPerToken: cacheRead ?? input * 0.1,
|
||
webSearchCostPerRequest: WEB_SEARCH_COST,
|
||
fastMultiplier: fast ?? 1,
|
||
cacheWriteCostIsExplicit: cacheWrite !== null && cacheWrite !== void 0,
|
||
...tier ? { longContextTier: {
|
||
thresholdTokens: tier.threshold,
|
||
inputCostPerToken: tier.input,
|
||
outputCostPerToken: tier.output,
|
||
...tier.cacheWrite !== null ? { cacheWriteCostPerToken: tier.cacheWrite } : {},
|
||
...tier.cacheRead !== null ? { cacheReadCostPerToken: tier.cacheRead } : {},
|
||
...tier.fast !== void 0 ? { fastMultiplier: tier.fast } : {}
|
||
} } : {},
|
||
...flex ? { flex: tupleToCosts(flex) } : {}
|
||
};
|
||
}
|
||
function tieredCostsFor(model, baseCosts, promptTokens, provider) {
|
||
if (exactPriceOverrideFor(model)) return baseCosts;
|
||
if (resolveCanonicalModelId(model) === "grok-4.6" && promptTokens >= GROK_4_6_PROMPT_TOKEN_THRESHOLD) {
|
||
return GROK_4_6_HIGH_PROMPT_COSTS;
|
||
}
|
||
const tier = provider !== void 0 && TIERED_PRICING_PROVIDERS.has(provider) ? baseCosts.longContextTier : void 0;
|
||
if (tier && promptTokens >= tier.thresholdTokens) {
|
||
return {
|
||
...baseCosts,
|
||
inputCostPerToken: tier.inputCostPerToken,
|
||
outputCostPerToken: tier.outputCostPerToken,
|
||
...tier.cacheWriteCostPerToken !== void 0 ? { cacheWriteCostPerToken: tier.cacheWriteCostPerToken } : {},
|
||
...tier.cacheReadCostPerToken !== void 0 ? { cacheReadCostPerToken: tier.cacheReadCostPerToken } : {},
|
||
...tier.fastMultiplier !== void 0 ? { fastMultiplier: tier.fastMultiplier } : {}
|
||
};
|
||
}
|
||
return baseCosts;
|
||
}
|
||
function tupleToCosts(raw) {
|
||
const [input, output, cacheWrite, cacheRead, fast, tier, flex] = raw;
|
||
return buildCosts(input, output, cacheWrite, cacheRead, fast, tier, flex);
|
||
}
|
||
function applyBuiltinPriceOverrides(pricing) {
|
||
for (const [name, raw] of Object.entries(BUILTIN_PRICE_OVERRIDES)) {
|
||
pricing.set(name, tupleToCosts(raw));
|
||
}
|
||
return pricing;
|
||
}
|
||
function loadSnapshot() {
|
||
const map = /* @__PURE__ */ new Map();
|
||
for (const [name, raw] of Object.entries(litellm_snapshot_default)) {
|
||
map.set(name, tupleToCosts(raw));
|
||
}
|
||
return map;
|
||
}
|
||
function getSortedPricingKeys() {
|
||
if (sortedPricingKeys === null) {
|
||
sortedPricingKeys = Array.from(pricingCache.keys()).sort((a, b) => b.length - a.length);
|
||
}
|
||
return sortedPricingKeys;
|
||
}
|
||
function getLowercasePricingIndex() {
|
||
if (lowercasePricingIndex === null) {
|
||
lowercasePricingIndex = /* @__PURE__ */ new Map();
|
||
const priced = (c) => c.inputCostPerToken > 0 || c.outputCostPerToken > 0;
|
||
for (const [key, costs] of pricingCache) {
|
||
const lk = key.toLowerCase();
|
||
if (priced(costs) && !lowercasePricingIndex.has(lk)) lowercasePricingIndex.set(lk, costs);
|
||
}
|
||
for (const [lk, costs] of fallbackCosts) {
|
||
if (priced(costs) && !lowercasePricingIndex.has(lk)) lowercasePricingIndex.set(lk, costs);
|
||
}
|
||
}
|
||
return lowercasePricingIndex;
|
||
}
|
||
function safePerTokenRate(n) {
|
||
if (n === void 0 || !Number.isFinite(n) || n < 0) return null;
|
||
if (n > 1) return 1;
|
||
return n;
|
||
}
|
||
function setModelAliases(aliases) {
|
||
userAliases = aliases;
|
||
}
|
||
function priceOverrideRatePerToken(usdPerMillion) {
|
||
if (typeof usdPerMillion !== "number") return null;
|
||
return safePerTokenRate(usdPerMillion / 1e6);
|
||
}
|
||
function setPriceOverrides(overrides) {
|
||
const next = /* @__PURE__ */ new Map();
|
||
const nextConfig = {};
|
||
for (const [model, rates] of Object.entries(overrides)) {
|
||
if (!model || !rates || typeof rates !== "object") continue;
|
||
nextConfig[model] = { ...rates };
|
||
const input = priceOverrideRatePerToken(rates.input);
|
||
const output = priceOverrideRatePerToken(rates.output);
|
||
if (input === null || output === null) continue;
|
||
next.set(model, buildCosts(
|
||
input,
|
||
output,
|
||
priceOverrideRatePerToken(rates.cacheCreation),
|
||
priceOverrideRatePerToken(rates.cacheRead),
|
||
void 0
|
||
));
|
||
}
|
||
userPriceOverrides = next;
|
||
userPriceOverridesConfig = nextConfig;
|
||
sortedPriceOverrideKeys = null;
|
||
lowercasePriceOverrideIndex = null;
|
||
}
|
||
function getSortedPriceOverrideKeys() {
|
||
if (sortedPriceOverrideKeys === null) {
|
||
sortedPriceOverrideKeys = Array.from(userPriceOverrides.keys()).sort((a, b) => b.length - a.length);
|
||
}
|
||
return sortedPriceOverrideKeys;
|
||
}
|
||
function getLowercasePriceOverrideIndex() {
|
||
if (lowercasePriceOverrideIndex === null) {
|
||
lowercasePriceOverrideIndex = /* @__PURE__ */ new Map();
|
||
for (const [key, costs] of userPriceOverrides) {
|
||
const lk = key.toLowerCase();
|
||
if (!lowercasePriceOverrideIndex.has(lk)) lowercasePriceOverrideIndex.set(lk, costs);
|
||
}
|
||
}
|
||
return lowercasePriceOverrideIndex;
|
||
}
|
||
function getPriceOverrideExact(...keys) {
|
||
for (const key of keys) {
|
||
const costs = userPriceOverrides.get(key);
|
||
if (costs) return costs;
|
||
}
|
||
return null;
|
||
}
|
||
function getPriceOverridePrefix(canonical) {
|
||
for (const key of getSortedPriceOverrideKeys()) {
|
||
if (canonical.startsWith(key + "-") || canonical === key) {
|
||
return userPriceOverrides.get(key);
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
function getPriceOverrideCaseInsensitive(canonical, withPrefix) {
|
||
const lowerIndex = getLowercasePriceOverrideIndex();
|
||
return lowerIndex.get(canonical.toLowerCase()) ?? lowerIndex.get(withPrefix.toLowerCase()) ?? null;
|
||
}
|
||
function setLocalModelSavings(mappings) {
|
||
userLocalModelSavings = { ...mappings };
|
||
}
|
||
function getLocalSavingsBaseline(rawModel) {
|
||
if (!rawModel || typeof rawModel !== "string") return void 0;
|
||
if (!Object.hasOwn(userLocalModelSavings, rawModel)) return void 0;
|
||
return userLocalModelSavings[rawModel];
|
||
}
|
||
function calculateLocalModelSavings(rawModel, inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens, webSearchRequests, speed = "standard", oneHourCacheCreationTokens = 0) {
|
||
const baseline = getLocalSavingsBaseline(rawModel);
|
||
if (!baseline) return null;
|
||
if (!getModelCosts(baseline)) return null;
|
||
const savingsUSD = calculateCost(
|
||
baseline,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationTokens,
|
||
cacheReadTokens,
|
||
webSearchRequests,
|
||
speed,
|
||
oneHourCacheCreationTokens
|
||
);
|
||
return { savingsUSD, baselineModel: baseline };
|
||
}
|
||
function flatRateLeaf(model) {
|
||
const trimmed = model.trim().replace(/@.*$/, "").replace(/-\d{8}$/, "");
|
||
const leaf = trimmed.includes("/") ? trimmed.slice(trimmed.lastIndexOf("/") + 1) : trimmed;
|
||
return leaf.toLowerCase();
|
||
}
|
||
function fillFlatRateSet(models) {
|
||
const ids = /* @__PURE__ */ new Set();
|
||
const leaves = /* @__PURE__ */ new Set();
|
||
for (const model of models) {
|
||
if (!model || typeof model !== "string") continue;
|
||
ids.add(model);
|
||
const leaf = flatRateLeaf(model);
|
||
if (leaf) leaves.add(leaf);
|
||
}
|
||
return { ids, leaves };
|
||
}
|
||
function setFlatRateModels(models) {
|
||
const filled = fillFlatRateSet(models);
|
||
userFlatRateModels = filled.ids;
|
||
userFlatRateLeaves = filled.leaves;
|
||
}
|
||
function setFlatRateRemoved(models) {
|
||
const filled = fillFlatRateSet(models);
|
||
userFlatRateRemoved = filled.ids;
|
||
userFlatRateRemovedLeaves = filled.leaves;
|
||
}
|
||
function isUserFlatRateModel(model) {
|
||
if (userFlatRateModels.has(model)) return true;
|
||
const leaf = flatRateLeaf(model);
|
||
return leaf.length > 0 && userFlatRateLeaves.has(leaf);
|
||
}
|
||
function isFlatRateRemoved(model) {
|
||
if (userFlatRateRemoved.has(model)) return true;
|
||
const leaf = flatRateLeaf(model);
|
||
return leaf.length > 0 && userFlatRateRemovedLeaves.has(leaf);
|
||
}
|
||
function isBuiltInFlatRateModel(model) {
|
||
const leaf = flatRateLeaf(model);
|
||
if (leaf === "auto" || leaf === "auto-genius") return true;
|
||
if (leaf.startsWith("grok-composer-")) return true;
|
||
if (leaf.startsWith("warp-auto-")) return true;
|
||
const display = model.trim();
|
||
if (/^grok composer\b/i.test(display)) return true;
|
||
if (/^warp auto\b/i.test(display)) return true;
|
||
return false;
|
||
}
|
||
function isFlatRateModel(model) {
|
||
if (!model) return false;
|
||
if (isFlatRateRemoved(model)) return false;
|
||
return isUserFlatRateModel(model) || isBuiltInFlatRateModel(model);
|
||
}
|
||
function unpricedModelHint(model = "<model>") {
|
||
const safe = model.replace(/[\x00-\x1F\x7F-\x9F]/g, "?").slice(0, 200);
|
||
return `If a model is billed per token, map it with: codeburn model-alias "${safe}" <known-model>. If $0 is correct (subscription / flat-rate): codeburn model-flat-rate "${safe}".`;
|
||
}
|
||
function resolveAlias(model) {
|
||
if (Object.hasOwn(userAliases, model)) return userAliases[model];
|
||
if (Object.hasOwn(BUILTIN_ALIASES, model)) return BUILTIN_ALIASES[model];
|
||
const lowercase = model.toLowerCase();
|
||
if (lowercase !== model && Object.hasOwn(BUILTIN_ALIASES, lowercase)) return BUILTIN_ALIASES[lowercase];
|
||
return model;
|
||
}
|
||
function getCanonicalName(model) {
|
||
const cleaned = model.replace(/@.*$/, "").replace(/-\d{8}$/, "").replace(/\[[^\]]*\]$/, "");
|
||
if (Object.hasOwn(userAliases, cleaned) || Object.hasOwn(BUILTIN_ALIASES, cleaned)) {
|
||
return cleaned;
|
||
}
|
||
const lowercase = cleaned.toLowerCase();
|
||
if (lowercase !== cleaned && Object.hasOwn(BUILTIN_ALIASES, lowercase)) {
|
||
return cleaned;
|
||
}
|
||
return stripKnownFirstNamespace(cleaned);
|
||
}
|
||
function resolveCanonicalModelId(model) {
|
||
const viaUser = Object.hasOwn(userAliases, model) ? userAliases[model] : model;
|
||
const aliased = resolveAlias(getCanonicalName(viaUser));
|
||
if (!aliased.includes("/")) return aliased;
|
||
const leaf = aliased.slice(aliased.lastIndexOf("/") + 1);
|
||
if (!leaf) return aliased;
|
||
return resolveAlias(getCanonicalName(leaf));
|
||
}
|
||
function getKnownNamespaces() {
|
||
if (knownNamespaces) return knownNamespaces;
|
||
const set = new Set(EXTRA_NAMESPACES);
|
||
for (const keys of [pricingCache.keys(), fallbackCosts.keys()]) {
|
||
for (const key of keys) {
|
||
const idx = key.indexOf("/");
|
||
if (idx > 0) set.add(key.slice(0, idx).toLowerCase());
|
||
}
|
||
}
|
||
for (const local of LOCAL_NAMESPACES) set.delete(local);
|
||
knownNamespaces = set;
|
||
return set;
|
||
}
|
||
function stripKnownFirstNamespace(model) {
|
||
const idx = model.indexOf("/");
|
||
if (idx <= 0) return model;
|
||
const head = model.slice(0, idx).toLowerCase();
|
||
if (getKnownNamespaces().has(head)) return model.slice(idx + 1);
|
||
return model;
|
||
}
|
||
function routedModelCandidates(model) {
|
||
const ids = [];
|
||
const seen = /* @__PURE__ */ new Set();
|
||
const push = (value) => {
|
||
if (!value || seen.has(value)) return;
|
||
seen.add(value);
|
||
ids.push(value);
|
||
};
|
||
push(model);
|
||
let current = model;
|
||
let peeled = true;
|
||
while (peeled) {
|
||
peeled = false;
|
||
for (const prefix of ROUTER_PREFIXES) {
|
||
const next = current.replace(prefix, "");
|
||
if (next && next !== current) {
|
||
current = next;
|
||
push(current);
|
||
peeled = true;
|
||
}
|
||
}
|
||
}
|
||
push(getCanonicalName(current));
|
||
return ids;
|
||
}
|
||
function stripKnownPricingVariantSuffix(model) {
|
||
const withoutColonSuffix = model.replace(/:(thinking|cloud)$/i, "");
|
||
if (withoutColonSuffix !== model) return withoutColonSuffix;
|
||
const withoutTeeSuffix = model.replace(/-TEE$/i, "");
|
||
if (withoutTeeSuffix !== model) return withoutTeeSuffix;
|
||
return null;
|
||
}
|
||
function pricingModelAt(model, timestamp2) {
|
||
const id = model.toLowerCase();
|
||
if (id !== "codex-auto-review" && id !== "kimi-for-coding" && id !== "kimi-code") return model;
|
||
if (Object.hasOwn(userAliases, model) || userPriceOverrides.has(model)) return model;
|
||
const at = Date.parse(timestamp2 ?? "");
|
||
if (id === "codex-auto-review") return at < AUTO_REVIEW_LUNA_FROM ? "gpt-5.4" : model;
|
||
if (at < KIMI_CODING_K2_5_FROM) return "kimi-k2-thinking";
|
||
if (at < KIMI_CODING_K2_6_FROM) return "kimi-k2.5";
|
||
return at < KIMI_CODING_K2_7_FROM ? "kimi-k2.6" : model;
|
||
}
|
||
function getModelCosts(model) {
|
||
const withPrefix = model.replace(/@.*$/, "").replace(/-\d{8}$/, "");
|
||
const canonicalName = getCanonicalName(model);
|
||
const canonical = resolveAlias(canonicalName);
|
||
const override = getPriceOverrideExact(model, withPrefix, canonicalName, canonical);
|
||
if (override) return override;
|
||
if (canonical !== canonicalName && withPrefix === canonicalName && pricingCache.has(canonical)) {
|
||
return pricingCache.get(canonical);
|
||
}
|
||
if (pricingCache.has(withPrefix)) return pricingCache.get(withPrefix);
|
||
if (pricingCache.has(canonical)) return pricingCache.get(canonical);
|
||
for (const candidate of routedModelCandidates(model)) {
|
||
const aliased = resolveAlias(candidate);
|
||
const candidateOverride = getPriceOverrideExact(candidate, aliased);
|
||
if (candidateOverride) return candidateOverride;
|
||
if (pricingCache.has(aliased)) return pricingCache.get(aliased);
|
||
if (pricingCache.has(candidate)) return pricingCache.get(candidate);
|
||
}
|
||
const prefixOverride = getPriceOverridePrefix(canonical);
|
||
if (prefixOverride) return prefixOverride;
|
||
for (const key of getSortedPricingKeys()) {
|
||
if (canonical.startsWith(key + "-") || canonical === key) {
|
||
return pricingCache.get(key);
|
||
}
|
||
}
|
||
const caseInsensitiveOverride = getPriceOverrideCaseInsensitive(canonical, withPrefix);
|
||
if (caseInsensitiveOverride) return caseInsensitiveOverride;
|
||
const lowerIndex = getLowercasePricingIndex();
|
||
const byCanonical = lowerIndex.get(canonical.toLowerCase());
|
||
if (byCanonical) return byCanonical;
|
||
const byPrefix = lowerIndex.get(withPrefix.toLowerCase());
|
||
if (byPrefix) return byPrefix;
|
||
const withPrefixVariant = stripKnownPricingVariantSuffix(withPrefix);
|
||
if (withPrefixVariant && withPrefixVariant !== withPrefix) {
|
||
const variantCosts = getModelCosts(withPrefixVariant);
|
||
if (variantCosts) return variantCosts;
|
||
}
|
||
const canonicalVariant = stripKnownPricingVariantSuffix(canonical);
|
||
if (canonicalVariant && canonicalVariant !== canonical && canonicalVariant !== withPrefixVariant) {
|
||
const variantCosts = getModelCosts(canonicalVariant);
|
||
if (variantCosts) return variantCosts;
|
||
}
|
||
return null;
|
||
}
|
||
function looksLikeLocalModel(name) {
|
||
if (/-v?\d+:\d+$/.test(name)) return false;
|
||
if (/^arn:aws:bedrock:/i.test(name)) return false;
|
||
if (name.includes(":") && !name.startsWith("http")) return true;
|
||
if (/[-_](q[2-8](_[a-z0-9]+)?|bf16|fp16|gguf|f16|f32)$/i.test(name)) return true;
|
||
return false;
|
||
}
|
||
function hasBillableRate(costs) {
|
||
return costs.inputCostPerToken > 0 || costs.outputCostPerToken > 0 || costs.cacheWriteCostPerToken > 0 || costs.cacheReadCostPerToken > 0;
|
||
}
|
||
function exactPriceOverrideFor(model) {
|
||
const withPrefix = model.replace(/@.*$/, "").replace(/-\d{8}$/, "");
|
||
const canonicalName = getCanonicalName(model);
|
||
const canonical = resolveAlias(canonicalName);
|
||
return getPriceOverrideExact(model, withPrefix, canonicalName, canonical);
|
||
}
|
||
function isExpectedFreeModel(model) {
|
||
if (looksLikeLocalModel(model)) return true;
|
||
if (getLocalSavingsBaseline(model)) return true;
|
||
const costs = getModelCosts(model);
|
||
if (isFlatRateModel(model) && (!costs || !hasBillableRate(costs))) return true;
|
||
if (costs && !hasBillableRate(costs) && exactPriceOverrideFor(model)) return true;
|
||
return false;
|
||
}
|
||
function recordedCostFallback(model, costUSD, recorded) {
|
||
return costUSD === 0 && typeof recorded === "number" && recorded > 0 && !isExpectedFreeModel(model) ? recorded : void 0;
|
||
}
|
||
function shouldWarnAboutUnknownModel(name) {
|
||
if (!name || name === "<synthetic>") return false;
|
||
if (warnedUnknownModels.has(name)) return false;
|
||
if (looksLikeLocalModel(name)) return false;
|
||
if (isFlatRateModel(name)) return false;
|
||
if (process.env["CODEBURN_VERBOSE"] !== "1") return false;
|
||
return true;
|
||
}
|
||
function sanitizeModelForDisplay(model) {
|
||
return model.replace(/[\x00-\x1F\x7F-\x9F]/g, "?").slice(0, 200);
|
||
}
|
||
function cacheWriteCostPerToken(model, costs) {
|
||
if (costs.cacheWriteCostIsExplicit || /claude|anthropic/i.test(model)) return costs.cacheWriteCostPerToken;
|
||
return costs.inputCostPerToken;
|
||
}
|
||
function calculateCost(model, inputTokens, outputTokens, cacheCreationTokens, cacheReadTokens, webSearchRequests, speed = "standard", oneHourCacheCreationTokens = 0, provider) {
|
||
const costs = getModelCosts(model);
|
||
if (!costs) {
|
||
if (shouldWarnAboutUnknownModel(model)) {
|
||
warnedUnknownModels.add(model);
|
||
const safeName = sanitizeModelForDisplay(model);
|
||
process.stderr.write(
|
||
`codeburn: no pricing data for model "${safeName}" \u2014 costs for this model will show $0. ${unpricedModelHint(safeName)} Or track local-model savings with: codeburn model-savings "${safeName}" <baseline-model>, or update with: npx codeburn@latest.
|
||
`
|
||
);
|
||
}
|
||
return 0;
|
||
}
|
||
const safe = (n) => Number.isFinite(n) && n > 0 ? n : 0;
|
||
const safeOneHourCacheCreation = safe(oneHourCacheCreationTokens);
|
||
const safeCacheCreation = Math.max(safe(cacheCreationTokens), safeOneHourCacheCreation);
|
||
const safeFiveMinuteCacheCreation = Math.max(0, safeCacheCreation - safeOneHourCacheCreation);
|
||
const promptTokens = safe(inputTokens) + safe(cacheReadTokens);
|
||
const tieredCosts = tieredCostsFor(model, speed === "flex" ? costs.flex ?? costs : costs, promptTokens, provider);
|
||
const multiplier = speed === "fast" ? tieredCosts.fastMultiplier : 1;
|
||
const cacheWriteRate = cacheWriteCostPerToken(model, tieredCosts);
|
||
return multiplier * (safe(inputTokens) * tieredCosts.inputCostPerToken + safe(outputTokens) * tieredCosts.outputCostPerToken + safeFiveMinuteCacheCreation * cacheWriteRate + safeOneHourCacheCreation * cacheWriteRate * ONE_HOUR_CACHE_WRITE_MULTIPLIER_FROM_FIVE_MINUTE_RATE + safe(cacheReadTokens) * tieredCosts.cacheReadCostPerToken + safe(webSearchRequests) * tieredCosts.webSearchCostPerRequest);
|
||
}
|
||
function deriveClaudeShortName(canonical) {
|
||
const m = canonical.match(/^claude-(opus|sonnet|haiku|fable|mythos)-(\d+)(?:[-.](\d+))?/);
|
||
if (!m) return void 0;
|
||
const [, family, major, minor] = m;
|
||
return `${CLAUDE_FAMILY[family]} ${major}${minor ? `.${minor}` : ""}`;
|
||
}
|
||
function deriveGptShortName(id) {
|
||
const m = id.match(GPT_DERIVED_ID);
|
||
if (!m) return void 0;
|
||
const [, version, variant] = m;
|
||
const segments = (variant ?? "").split("-").filter((seg) => seg !== "" && !/^\d+$/.test(seg)).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1));
|
||
return ["GPT-" + version, ...segments].join(" ");
|
||
}
|
||
function lookupShortName(id) {
|
||
const claude2 = deriveClaudeShortName(id);
|
||
if (claude2) return claude2;
|
||
for (const [key, name] of SORTED_SHORT_NAMES) {
|
||
if (id === key || id.startsWith(key + "-")) return name;
|
||
}
|
||
return deriveGptShortName(id);
|
||
}
|
||
function modelKeyMatches(model, key) {
|
||
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||
return new RegExp(`(?<![\\w.-])${escaped}(?=$|-)`).test(model);
|
||
}
|
||
function getShortModelName(model) {
|
||
return shortModelName(model, /* @__PURE__ */ new Set());
|
||
}
|
||
function routeFromProviderField(value) {
|
||
if (!value) return void 0;
|
||
const normalized = value.trim().toLowerCase();
|
||
if (normalized !== "bedrock" && value !== normalized) return void 0;
|
||
return ROUTES_BY_FIELD.get(normalized);
|
||
}
|
||
function shortModelName(model, seen) {
|
||
if (autoModelNames[model]) return autoModelNames[model];
|
||
if (seen.has(model)) {
|
||
const leaf = model.includes("/") ? model.slice(model.lastIndexOf("/") + 1) : model;
|
||
return lookupShortName(leaf) ?? leaf;
|
||
}
|
||
seen.add(model);
|
||
if (Object.hasOwn(userAliases, model)) {
|
||
return shortModelName(userAliases[model], seen);
|
||
}
|
||
const stripped = getCanonicalName(model);
|
||
if (autoModelNames[stripped]) return autoModelNames[stripped];
|
||
if (stripped !== model) {
|
||
if (Object.hasOwn(userAliases, stripped)) {
|
||
return shortModelName(userAliases[stripped], seen);
|
||
}
|
||
const knownStripped = lookupShortName(stripped);
|
||
if (knownStripped && !Object.hasOwn(BUILTIN_ALIASES, stripped) && !Object.hasOwn(BUILTIN_ALIASES, stripped.toLowerCase())) {
|
||
return knownStripped;
|
||
}
|
||
}
|
||
const canonical = resolveAlias(stripped);
|
||
const known = lookupShortName(canonical);
|
||
if (known) return known;
|
||
if (canonical.includes("/")) {
|
||
const segment = canonical.slice(canonical.lastIndexOf("/") + 1);
|
||
if (!segment || seen.has(segment) || segment === stripped) {
|
||
return lookupShortName(segment) ?? segment;
|
||
}
|
||
return shortModelName(segment, seen);
|
||
}
|
||
return lookupShortName(canonical) ?? canonical;
|
||
}
|
||
function restorePricingState(snapshot) {
|
||
pricingCache = snapshot.pricing;
|
||
sortedPricingKeys = null;
|
||
lowercasePricingIndex = null;
|
||
knownNamespaces = null;
|
||
setModelAliases(snapshot.aliases);
|
||
setPriceOverrides(snapshot.priceOverrides);
|
||
setLocalModelSavings(snapshot.localModelSavings);
|
||
setFlatRateModels(snapshot.flatRateModels ?? []);
|
||
setFlatRateRemoved(snapshot.flatRateModelsRemoved ?? []);
|
||
}
|
||
var REASONING_INCLUDED_IN_OUTPUT, CACHE_TTL_MS, WEB_SEARCH_COST, ONE_HOUR_CACHE_WRITE_MULTIPLIER_FROM_FIVE_MINUTE_RATE, BUILTIN_PRICE_OVERRIDES, GROK_4_6_PROMPT_TOKEN_THRESHOLD, GROK_4_6_HIGH_PROMPT_COSTS, TIERED_PRICING_PROVIDERS, fallbackCosts, pricingCache, sortedPricingKeys, lowercasePricingIndex, BUILTIN_ALIASES, userAliases, userPriceOverrides, userPriceOverridesConfig, sortedPriceOverrideKeys, lowercasePriceOverrideIndex, userLocalModelSavings, userFlatRateModels, userFlatRateLeaves, userFlatRateRemoved, userFlatRateRemovedLeaves, EXTRA_NAMESPACES, LOCAL_NAMESPACES, knownNamespaces, ROUTER_PREFIXES, AUTO_REVIEW_LUNA_FROM, KIMI_CODING_K2_5_FROM, KIMI_CODING_K2_6_FROM, KIMI_CODING_K2_7_FROM, KIMI_CODING_K2_8_FROM, warnedUnknownModels, autoModelNames, SHORT_NAMES, SORTED_SHORT_NAMES, CLAUDE_FAMILY, GPT_DERIVED_ID, ROUTES, ROUTES_BY_ID, ROUTES_BY_FIELD;
|
||
var init_models = __esm({
|
||
"src/models.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_litellm_snapshot();
|
||
init_pricing_fallback();
|
||
init_fetch_utils();
|
||
REASONING_INCLUDED_IN_OUTPUT = /* @__PURE__ */ new Set(["claude", "codex", "copilot", "dsh"]);
|
||
CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
||
WEB_SEARCH_COST = 0.01;
|
||
ONE_HOUR_CACHE_WRITE_MULTIPLIER_FROM_FIVE_MINUTE_RATE = 1.6;
|
||
BUILTIN_PRICE_OVERRIDES = {
|
||
"deepseek-v3.2": [28e-8, 42e-8, null, 28e-9],
|
||
"swe-2": [3e-6, 15e-6, null, 3e-7],
|
||
"composer-2.5": [5e-7, 25e-7, 5e-7, 2e-7],
|
||
"composer-2": [5e-7, 25e-7, 5e-7, 2e-7],
|
||
"composer-1.5": [35e-7, 175e-7, 35e-7, 35e-8],
|
||
"composer-1": [125e-8, 1e-5, 125e-8, 125e-9],
|
||
// Moonshot's published rate (platform.kimi.ai/docs/pricing/chat): $1.90 miss,
|
||
// $0.38 hit, $8.00 output. LiteLLM only carries a reseller row for it.
|
||
"kimi-k2.7-code-highspeed": [19e-7, 8e-6, null, 38e-8]
|
||
};
|
||
GROK_4_6_PROMPT_TOKEN_THRESHOLD = 2e5;
|
||
GROK_4_6_HIGH_PROMPT_COSTS = buildCosts(4e-6, 12e-6, null, 1e-6, null);
|
||
TIERED_PRICING_PROVIDERS = /* @__PURE__ */ new Set(["codex", "antigravity"]);
|
||
fallbackCosts = (() => {
|
||
const map = /* @__PURE__ */ new Map();
|
||
for (const [name, raw] of Object.entries(pricing_fallback_default)) {
|
||
const lk = name.toLowerCase();
|
||
if (!map.has(lk)) map.set(lk, tupleToCosts(raw));
|
||
}
|
||
return map;
|
||
})();
|
||
pricingCache = applyBuiltinPriceOverrides(loadSnapshot());
|
||
sortedPricingKeys = null;
|
||
lowercasePricingIndex = null;
|
||
BUILTIN_ALIASES = {
|
||
"anthropic--claude-4.6-opus": "claude-opus-4-6",
|
||
"anthropic--claude-4.6-sonnet": "claude-sonnet-4-6",
|
||
"anthropic--claude-4.5-opus": "claude-opus-4-5",
|
||
"anthropic--claude-4.5-sonnet": "claude-sonnet-4-5",
|
||
"anthropic--claude-4.5-haiku": "claude-haiku-4-5",
|
||
// #1093: copilot session-store.db writes 'claude-haiku-4.5' (tier-first, dot)
|
||
"claude-haiku-4.5": "claude-haiku-4-5",
|
||
// Copilot's own spellings of the pre-2026 Claude SKUs (VS Code chat sessions, session-store.db)
|
||
"claude-3.5-sonnet": "claude-3-5-sonnet",
|
||
"claude-3.7-sonnet": "claude-3-7-sonnet",
|
||
"claude-3.7-sonnet-thought": "claude-3-7-sonnet",
|
||
"claude-opus-4.1": "claude-opus-4-1",
|
||
"claude-sonnet-4.6": "claude-sonnet-4-6",
|
||
"claude-sonnet-4.5": "claude-sonnet-4-5",
|
||
"claude-opus-4.7": "claude-opus-4-7",
|
||
"claude-opus-4.6": "claude-opus-4-6",
|
||
"claude-opus-4.5": "claude-opus-4-5",
|
||
"cursor-auto": "claude-sonnet-4-5",
|
||
"cursor-agent-auto": "claude-sonnet-4-5",
|
||
"copilot-auto": "claude-sonnet-4-5",
|
||
"copilot-openai-auto": "gpt-5.3-codex",
|
||
"copilot-anthropic-auto": "claude-sonnet-4-5",
|
||
"openai-codex:gpt-5.5": "gpt-5.5",
|
||
"ibm-bob-auto": "claude-sonnet-4-5",
|
||
"kiro-auto": "claude-sonnet-4-5",
|
||
"quickdesk-auto": "claude-sonnet-4-5",
|
||
"cline-auto": "claude-sonnet-4-5",
|
||
"openclaw-auto": "claude-sonnet-4-5",
|
||
"warp-auto-efficient": "gpt-5.3-codex",
|
||
"warp-auto-powerful": "claude-opus-4-6",
|
||
// `codex-auto-review` is a server-routed alias: rollouts record it in
|
||
// turn_context.model and nothing on disk names the real model. OpenAI moved
|
||
// auto review from GPT-5.4 to GPT-5.6 Luna on 30 Jul 2026 (announcement:
|
||
// "major price drop for 5.6 Terra and Luna"). This row is the forward
|
||
// default; pricingModelAt prices calls before 2026-07-30T00:00Z as gpt-5.4.
|
||
// A rollout that records the real model (API-key auth writes gpt-5.6-luna)
|
||
// is priced as recorded. Display stays on autoModelNames.
|
||
"codex-auto-review": "gpt-5.6-luna",
|
||
// Luna Reserve: the quota Codex falls back to once ordinary usage runs out
|
||
// (openai/codex#42372, LUNA_RESERVE_MODEL in codex-rs/tui/src/model_catalog.rs).
|
||
// The backend picks the real model and rollouts don't record it. GPT-5.6 Luna
|
||
// was the client fallback until 22 Sep 2026 (then GPT-6 Luna, half the
|
||
// price), so this is an upper-bound estimate and the codex parser marks it so.
|
||
"gpt-reserve": "gpt-5.6-luna",
|
||
// Short spelling of the only 5.3 Spark model (openai/codex uses it as a
|
||
// config model id in codex-rs/app-server/tests/suite/v2/config_rpc.rs).
|
||
"gpt-5.3-spark": "gpt-5.3-codex-spark",
|
||
"grok-build": "grok-build-0.1",
|
||
// Grok Bot's desktop app serves opaque `sand-*` aliases and records no model
|
||
// id at all, so there is nothing truthful to price it by. It is xAI's own
|
||
// product, so it prices at xAI's published grok-4.6 rate ($2.00/M in,
|
||
// $6.00/M out, $0.50/M cached). Every grokbot call is costIsEstimated.
|
||
"grokbot-auto": "grok-4.6",
|
||
// The same Grok Bot work as Cursor's usage export names it, per bot kind.
|
||
"grok-bot-automation": "grok-4.6",
|
||
"grok-bot-cua": "grok-4.6",
|
||
"grok-bot-default": "grok-4.6",
|
||
// Cursor-hosted Grok 4.6 as Cursor's usage export names it: the same model,
|
||
// so it takes grok-4.6's 200k-prompt tier like the local Cursor rows do.
|
||
"grok-4.6-high": "grok-4.6",
|
||
"grok-4.6-high-fast": "grok-4.6",
|
||
"cursor-grok-4.6-high": "grok-4.6",
|
||
"cursor-grok-4.6-high-fast": "grok-4.6",
|
||
"GPT-5.3 Codex (low reasoning)": "gpt-5.3-codex",
|
||
"GPT-5.3 Codex (medium reasoning)": "gpt-5.3-codex",
|
||
"GPT-5.3 Codex (high reasoning)": "gpt-5.3-codex",
|
||
"GPT-5.3 Codex (extra high reasoning)": "gpt-5.3-codex",
|
||
"Claude Sonnet 4.6": "claude-sonnet-4-6",
|
||
"Claude Sonnet 4.5": "claude-sonnet-4-5",
|
||
"Claude Haiku 4.5": "claude-haiku-4-5",
|
||
"Claude Opus 4.6": "claude-opus-4-6",
|
||
"claude-4-6-sonnet-high": "claude-sonnet-4-6",
|
||
"claude-4-6-sonnet-low": "claude-sonnet-4-6",
|
||
"claude-4-6-sonnet-medium": "claude-sonnet-4-6",
|
||
"claude-4-6-sonnet-high-fast": "claude-sonnet-4-6",
|
||
"claude-4-7-opus-xhigh": "claude-opus-4-7",
|
||
"claude-4-7-opus-xhigh-fast": "claude-opus-4-7",
|
||
"qwen-auto": "claude-sonnet-4-5",
|
||
// OrcaRouter fusion routes. Provenance: live OrcaRouter completion `model`
|
||
// field, 2026-08 (community #1058 / house #1118). Re-verify if the gateway
|
||
// rotates targets. `orcarouter/auto` is intentionally unaliased: the smart
|
||
// route currently lands on a Qwen/Llama flash model, so a Sonnet alias
|
||
// would overprice ~3–30×. Fail closed until a live probe pins that target.
|
||
"orcarouter/fusion": "openai/gpt-oss-120b",
|
||
"orcarouter/fusion-flash": "openai/gpt-oss-120b",
|
||
"orcarouter/fusion-mini": "openai/gpt-oss-120b",
|
||
"kimi-auto": "kimi-k2-thinking",
|
||
// `kimi-for-coding` is Kimi Code's moving alias; `kimi-code` is kimi-cli's
|
||
// spelling of the same SKU. pricingModelAt prices older calls by the model
|
||
// the alias served then. K2.8 Preview (11 Sep 2026 on) has no Open Platform
|
||
// price, so it stays on K2.7 Code's.
|
||
"kimi-code": "kimi-k2.7-code",
|
||
"kimi-for-coding": "kimi-k2.7-code",
|
||
// HighSpeed has been K2.7 Code HighSpeed since it launched on 9 Jul 2026.
|
||
"kimi-for-coding-highspeed": "kimi-k2.7-code-highspeed",
|
||
// Kimi Code wires report the bare `k3` id in llm.request.model; without an
|
||
// alias those calls priced at $0 and the provider looked absent in the UI.
|
||
"k3": "kimi-k3",
|
||
// Kimi desktop/IDE embedded runtime serves `k3-agent` / `k2d6-agent`.
|
||
"k3-agent": "kimi-k3",
|
||
"k2d6-agent": "kimi-k2p6",
|
||
"mimo-v2-flash": "xiaomi/mimo-v2-flash",
|
||
// Hermes / Xiaomi token-plan sessions store the bare id. LiteLLM's row is
|
||
// namespaced. Same class as mimo-v2-flash above — do not invent a rate.
|
||
"mimo-v2.5-pro": "xiaomi/mimo-v2.5-pro",
|
||
"mimo-v2.5": "xiaomi/mimo-v2.5",
|
||
"kat-coder-pro-v1": "kwaipilot/kat-coder-pro",
|
||
// Cursor emits dot-version tier-last names plus tier/reasoning suffixes
|
||
// that LiteLLM does not index (`-high`, `-low`, `-medium`, `-thinking`,
|
||
// `-high-thinking`, `-fast-mode`). Missing aliases here surface as $0 in
|
||
// the dashboard for users on non-Auto models (issue #159). Sources: the
|
||
// display map at `src/providers/cursor.ts:modelDisplayNames`, Cursor's
|
||
// public model docs at https://cursor.com/docs/models, and forum bug
|
||
// reports that quote literal slugs (e.g. forum.cursor.com/t/154933).
|
||
"claude-4-sonnet": "claude-sonnet-4",
|
||
"claude-4-sonnet-1m": "claude-sonnet-4",
|
||
"claude-4-sonnet-thinking": "claude-sonnet-4",
|
||
"claude-4.5-sonnet": "claude-sonnet-4-5",
|
||
"claude-4.5-sonnet-thinking": "claude-sonnet-4-5",
|
||
"claude-4.6-sonnet": "claude-sonnet-4-6",
|
||
"claude-4.6-sonnet-high": "claude-sonnet-4-6",
|
||
"claude-4.6-sonnet-low": "claude-sonnet-4-6",
|
||
"claude-4.6-sonnet-thinking": "claude-sonnet-4-6",
|
||
"claude-4.6-sonnet-high-thinking": "claude-sonnet-4-6",
|
||
"claude-4-opus": "claude-opus-4",
|
||
"claude-4.5-opus": "claude-opus-4-5",
|
||
"claude-4.5-opus-high": "claude-opus-4-5",
|
||
"claude-4.5-opus-low": "claude-opus-4-5",
|
||
"claude-4.5-opus-medium": "claude-opus-4-5",
|
||
"claude-4.5-opus-high-thinking": "claude-opus-4-5",
|
||
"claude-4.6-opus": "claude-opus-4-6",
|
||
"claude-4.6-opus-fast-mode": "claude-opus-4-6",
|
||
"claude-4.6-opus-high": "claude-opus-4-6",
|
||
"claude-4.6-opus-low": "claude-opus-4-6",
|
||
"claude-4.6-opus-medium": "claude-opus-4-6",
|
||
"claude-4.6-opus-high-thinking": "claude-opus-4-6",
|
||
"claude-4.7-opus": "claude-opus-4-7",
|
||
// Dash form (NOT dot) seen in forum.cursor.com/t/158597.
|
||
"claude-opus-4-7-thinking-high": "claude-opus-4-7",
|
||
"claude-4.5-haiku": "claude-haiku-4-5",
|
||
"claude-4.6-haiku": "claude-haiku-4-5",
|
||
// Cursor house composer models use Cursor-published rates in
|
||
// BUILTIN_PRICE_OVERRIDES; keep them out of this alias map so they do not
|
||
// inherit Claude Sonnet proxy pricing.
|
||
// Cursor's "fast" routing variant of GPT-5 is the same model behind a
|
||
// lower-latency endpoint; price as base GPT-5 until LiteLLM tracks it.
|
||
"gpt-5-fast": "gpt-5",
|
||
"gpt-4.1": "gpt-4.1",
|
||
"gpt-5.2-low": "gpt-5",
|
||
"gpt-5.1-codex-high": "gpt-5.3-codex",
|
||
// Antigravity Gemini model IDs resolve to preview-priced entries.
|
||
"gemini-3.1-pro": "gemini-3.1-pro-preview",
|
||
"gemini-3-flash": "gemini-3-flash-preview",
|
||
"gemini-3.1-pro-high": "gemini-3.1-pro-preview",
|
||
"gemini-3.1-pro-low": "gemini-3.1-pro-preview",
|
||
"gemini-3-flash-agent": "gemini-3-flash-preview",
|
||
"gemini-3.5-flash-high": "gemini-3.5-flash",
|
||
"gemini-3.5-flash-medium": "gemini-3.5-flash",
|
||
"gemini-3.5-flash-low": "gemini-3.5-flash",
|
||
"Gemini 3.5 Flash (High)": "gemini-3.5-flash",
|
||
"Gemini 3.5 Flash (Medium)": "gemini-3.5-flash",
|
||
"Gemini 3.5 Flash (Low)": "gemini-3.5-flash",
|
||
"gemini-3-pro": "gemini-3-pro-preview",
|
||
"gemini-3.1-flash-image": "gemini-3.1-flash-image-preview",
|
||
"gemini-3.1-flash-lite": "gemini-3.1-flash-lite-preview",
|
||
// ZCode reports GLM-5.2/5.3 capitalized; Hermes/Cline use lowercase. The
|
||
// snapshot's bare `glm-5.2`/`glm-5.3` rows carry the LIST rate ($1.4/$4.4);
|
||
// z.ai's own `z-ai/glm-5.2`/`z-ai/glm-5.3` rows are the discounted rate we
|
||
// actually pay. Point every spelling at the z-ai rows.
|
||
"glm-5.2": "z-ai/glm-5.2",
|
||
"GLM-5.2": "z-ai/glm-5.2",
|
||
"glm-5.3": "z-ai/glm-5.3",
|
||
"GLM-5.3": "z-ai/glm-5.3"
|
||
};
|
||
userAliases = {};
|
||
userPriceOverrides = /* @__PURE__ */ new Map();
|
||
userPriceOverridesConfig = {};
|
||
sortedPriceOverrideKeys = null;
|
||
lowercasePriceOverrideIndex = null;
|
||
userLocalModelSavings = {};
|
||
userFlatRateModels = /* @__PURE__ */ new Set();
|
||
userFlatRateLeaves = /* @__PURE__ */ new Set();
|
||
userFlatRateRemoved = /* @__PURE__ */ new Set();
|
||
userFlatRateRemovedLeaves = /* @__PURE__ */ new Set();
|
||
EXTRA_NAMESPACES = [
|
||
// Routing wrappers (see ROUTER_PREFIXES); no catalog lists them. `cliproxy/`
|
||
// is codex-cliproxy-gateway's default route prefix over CLIProxyAPI.
|
||
"cp",
|
||
"cline-pass",
|
||
"cline-free",
|
||
"cmd",
|
||
"antigravity",
|
||
"orcarouter",
|
||
"cliproxy",
|
||
// LiteLLM route prefixes that never appear as a key prefix.
|
||
"litellm_proxy",
|
||
"openai_like",
|
||
// Vendor spellings the catalog indexes under another name: `zhipu` is `z-ai`,
|
||
// `mimo` is `xiaomi` (BUILTIN_ALIASES maps the bare MiMo ids to `xiaomi/`),
|
||
// and `kimi/` is a client-side prefix (Codex records `kimi/k3[1m]`).
|
||
// `zcode/` is CLIProxyAPI's provider spelling for the Z.ai coding plans; the
|
||
// bare `glm-*` leaf already prices via its own catalog row, which carries an explicit zero cache-write cost.
|
||
"zhipu",
|
||
"mimo",
|
||
"kimi",
|
||
"zcode"
|
||
];
|
||
LOCAL_NAMESPACES = ["ollama"];
|
||
knownNamespaces = null;
|
||
ROUTER_PREFIXES = [
|
||
/^omniroute:/i,
|
||
/^cp\//i,
|
||
/^cline-pass\//i,
|
||
/^cline-free\//i,
|
||
/^cmd\//i,
|
||
/^antigravity\//i,
|
||
/^orcarouter\//i,
|
||
// codex-cliproxy-gateway keeps Codex's own OAuth routing native and forwards
|
||
// only `cliproxy/*` ids to CLIProxyAPI, so a routed session records
|
||
// `cliproxy/<id>` — and `<id>` can itself be a provider path
|
||
// (`cliproxy/zcode/glm-5.3-flash`). Peeling the wrapper lets the one
|
||
// known-namespace strip in getCanonicalName reach the priced leaf.
|
||
/^cliproxy\//i
|
||
// `xiaomi/` is NOT peeled: it is the vendor namespace LiteLLM prices under,
|
||
// and BUILTIN_ALIASES maps the bare MiMo ids INTO it. Peeling would pull the
|
||
// opposite way. It stays a known namespace via the catalog-derived set.
|
||
];
|
||
AUTO_REVIEW_LUNA_FROM = Date.parse("2026-07-30T00:00:00Z");
|
||
KIMI_CODING_K2_5_FROM = Date.parse("2026-01-27T00:00:00Z");
|
||
KIMI_CODING_K2_6_FROM = Date.parse("2026-04-13T00:00:00Z");
|
||
KIMI_CODING_K2_7_FROM = Date.parse("2026-06-12T00:00:00Z");
|
||
KIMI_CODING_K2_8_FROM = Date.parse("2026-09-11T00:00:00Z");
|
||
warnedUnknownModels = /* @__PURE__ */ new Set();
|
||
autoModelNames = {
|
||
"glm-5.2": "GLM-5.2",
|
||
"GLM-5.2": "GLM-5.2",
|
||
"glm-5.3": "GLM-5.3",
|
||
"GLM-5.3": "GLM-5.3",
|
||
"cursor-auto": "Cursor (auto)",
|
||
"cursor-agent-auto": "Cursor (auto)",
|
||
"copilot-auto": "Copilot (auto)",
|
||
"copilot-openai-auto": "Copilot (OpenAI)",
|
||
"copilot-anthropic-auto": "Copilot (Anthropic)",
|
||
"ibm-bob-auto": "IBM Bob (auto)",
|
||
"kiro-auto": "Kiro (auto)",
|
||
"quickdesk-auto": "Quick Desktop (auto)",
|
||
"grokbot-auto": "Grok Bot (auto)",
|
||
"grok-bot-automation": "Grok Bot (automation)",
|
||
"grok-bot-cua": "Grok Bot (computer use)",
|
||
"grok-bot-default": "Grok Bot (default)",
|
||
"grok-4.6-high": "Grok 4.6 (high)",
|
||
"grok-4.6-high-fast": "Grok 4.6 (high, fast)",
|
||
"cline-auto": "Cline (auto)",
|
||
"openclaw-auto": "OpenClaw (auto)",
|
||
"qwen-auto": "Qwen (auto)",
|
||
"kimi-auto": "Kimi (auto)",
|
||
"kimi-for-coding": "Kimi for Coding",
|
||
"kimi-for-coding-highspeed": "Kimi for Coding HighSpeed",
|
||
"codex-auto-review": "Codex Auto Review",
|
||
"gpt-reserve": "Luna Reserve"
|
||
};
|
||
SHORT_NAMES = {
|
||
// Modern claude-<family>-<major>-<minor> ids are derived in deriveClaudeShortName.
|
||
// Only the legacy 3.x ids (family-last) need explicit mapping.
|
||
"claude-3-7-sonnet": "Sonnet 3.7",
|
||
"claude-3-5-sonnet": "Sonnet 3.5",
|
||
"claude-3-5-haiku": "Haiku 3.5",
|
||
"gpt-4o-mini": "GPT-4o Mini",
|
||
"gpt-4o": "GPT-4o",
|
||
"gpt-4.1-nano": "GPT-4.1 Nano",
|
||
"gpt-4.1-mini": "GPT-4.1 Mini",
|
||
"gpt-4.1": "GPT-4.1",
|
||
"codex-auto-review": "Codex Auto Review",
|
||
"gpt-5.5-pro": "GPT-5.5 Pro",
|
||
"gpt-5.5": "GPT-5.5",
|
||
"gpt-5.4-pro": "GPT-5.4 Pro",
|
||
"gpt-5.4-nano": "GPT-5.4 Nano",
|
||
"gpt-5.4-mini": "GPT-5.4 Mini",
|
||
"gpt-5.4": "GPT-5.4",
|
||
"gpt-5.3-codex-spark": "GPT-5.3 Codex Spark",
|
||
"gpt-5.3-codex": "GPT-5.3 Codex",
|
||
"gpt-5.3": "GPT-5.3",
|
||
"gpt-5.2-pro": "GPT-5.2 Pro",
|
||
"gpt-5.2-low": "GPT-5.2 Low",
|
||
"gpt-5.2": "GPT-5.2",
|
||
"gpt-5.1-codex-mini": "GPT-5.1 Codex Mini",
|
||
"gpt-5.1-codex": "GPT-5.1 Codex",
|
||
"gpt-5.1": "GPT-5.1",
|
||
"gpt-5-pro": "GPT-5 Pro",
|
||
"gpt-5-nano": "GPT-5 Nano",
|
||
"gpt-5-mini": "GPT-5 Mini",
|
||
"gpt-5": "GPT-5",
|
||
"gemini-3.5-flash": "Gemini 3.5 Flash",
|
||
"gemini-3.1-pro-preview": "Gemini 3.1 Pro",
|
||
"gemini-3-flash-preview": "Gemini 3 Flash",
|
||
"gemini-2.5-pro": "Gemini 2.5 Pro",
|
||
"gemini-2.5-flash": "Gemini 2.5 Flash",
|
||
"kimi-k2-thinking-turbo": "Kimi K2 Thinking Turbo",
|
||
"kimi-k2-thinking": "Kimi K2 Thinking",
|
||
"kimi-k3": "Kimi K3",
|
||
"kimi-k2p6": "Kimi K2.6",
|
||
"kimi-thinking-preview": "Kimi Thinking",
|
||
"kimi-k2.6": "Kimi K2.6",
|
||
"kimi-k2.5": "Kimi K2.5",
|
||
"kimi-k2p5": "Kimi K2.5",
|
||
"kimi-k2-instruct": "Kimi K2 Instruct",
|
||
"kimi-k2-0905": "Kimi K2",
|
||
"kimi-k2": "Kimi K2",
|
||
"kimi-latest": "Kimi Latest",
|
||
"moonshot-v1": "Moonshot v1",
|
||
"deepseek-v4-pro": "DeepSeek v4 Pro",
|
||
"deepseek-v4-flash": "DeepSeek v4 Flash",
|
||
"deepseek-coder-max": "DeepSeek Coder Max",
|
||
"deepseek-coder": "DeepSeek Coder",
|
||
"deepseek-r1": "DeepSeek R1",
|
||
"o4-mini": "o4-mini",
|
||
"o3": "o3",
|
||
"MiniMax-M2.7-highspeed": "MiniMax M2.7 Highspeed",
|
||
"MiniMax-M2.7": "MiniMax M2.7",
|
||
// Grok (xAI) and GLM ids that otherwise surface raw or as a pricing key in
|
||
// reports. grok-build and GLM-5.2 price via sibling aliases, so
|
||
// getShortModelName resolves to the pricing key before this lookup; map each
|
||
// back to the real model name. grok-composer has no alias, it just lacked an
|
||
// entry.
|
||
"glm-5p1": "GLM-5.2",
|
||
// ZCode/Hermes run GLM-5.2 (priced as the GLM-5.1 sibling)
|
||
"grok-build-0.1": "Grok Build",
|
||
// Grok Build prices through the 0.1 sibling
|
||
"grok-composer-2.5-fast": "Grok Composer 2.5 Fast",
|
||
// Fireworks-hosted fleet models arrive as `accounts/fireworks/models/<slug>`;
|
||
// getShortModelName's path fallback strips to the bare slug and re-resolves it
|
||
// through this table. Display-only — getModelCosts prices off the full path,
|
||
// so these entries do not move any dollar amounts. (deepseek-v4-pro/-flash
|
||
// already have entries above and resolve the same way.)
|
||
"glm-5p2": "GLM-5.2",
|
||
"qwen3p7-plus": "Qwen 3.7 Plus",
|
||
"kimi-k2p7-code": "Kimi K2.7 Code",
|
||
// Ids that price correctly but had no display entry, so reports showed the
|
||
// raw slug. All display-only. The GPT-5.6 variants are listed individually
|
||
// rather than as a bare `gpt-5.6`: a base entry would swallow every future
|
||
// `gpt-5.6-*` via the prefix match and hide the variant, which is exactly
|
||
// what getShortModelName's version-boundary rule is there to prevent.
|
||
"gpt-5.6-sol": "GPT-5.6 Sol",
|
||
"gpt-5.6-terra": "GPT-5.6 Terra",
|
||
"gpt-5.6-luna": "GPT-5.6 Luna",
|
||
// The Grok Build harness reports the model it runs (`grok-4.5`), so this is
|
||
// the model's own name; `grok-build*` ids still resolve to "Grok Build".
|
||
"grok-4.5": "Grok 4.5",
|
||
// The harness also reports a `-build` variant of that model. It is a distinct
|
||
// id and reports bucket by id, so without its own entry the prefix match gave
|
||
// it the same name as `grok-4.5` and the report showed two identical rows.
|
||
"grok-4.5-build": "Grok 4.5 (build)",
|
||
// ClinePass routes models as `cline-pass/<slug>`; getShortModelName's path
|
||
// fallback strips the prefix and re-resolves the bare slug through this
|
||
// table, the same way it handles `accounts/fireworks/models/<slug>`.
|
||
"qwen3.7-max": "Qwen 3.7 Max",
|
||
"mimo-v2.5-pro": "MiMo v2.5 Pro",
|
||
"mimo-v2.5": "MiMo v2.5",
|
||
"mimo-v2-flash": "MiMo v2 Flash",
|
||
// Both spellings occur in the wild: OpenRouter gap-filled keys are lowercase
|
||
// slugs while sessions report the capitalized name (see the case-insensitive
|
||
// pricing index above). SHORT_NAMES matching is case-sensitive, so map both.
|
||
"minimax-m3": "MiniMax M3",
|
||
"MiniMax-M3": "MiniMax M3"
|
||
};
|
||
SORTED_SHORT_NAMES = Object.entries(SHORT_NAMES).sort((a, b) => b[0].length - a[0].length);
|
||
CLAUDE_FAMILY = {
|
||
opus: "Opus",
|
||
sonnet: "Sonnet",
|
||
haiku: "Haiku",
|
||
fable: "Fable",
|
||
mythos: "Mythos"
|
||
};
|
||
GPT_DERIVED_ID = /^gpt-(\d+\.\d+(?:\.\d+)*)(?:-([a-z0-9][a-z0-9-]*))?$/;
|
||
ROUTES = [
|
||
{ id: "bedrock", label: "Bedrock", billing: "metered", providerFields: ["bedrock", "amazon-bedrock"] },
|
||
{ id: "openrouter", label: "OpenRouter", billing: "metered", providerFields: ["openrouter"] },
|
||
{ id: "vertex", label: "Vertex", billing: "metered", providerFields: ["google-vertex", "google-vertex-anthropic"] }
|
||
];
|
||
ROUTES_BY_ID = new Map(ROUTES.map((route) => [route.id, route]));
|
||
ROUTES_BY_FIELD = new Map(ROUTES.flatMap((route) => route.providerFields.map((field) => [field, route])));
|
||
}
|
||
});
|
||
|
||
// src/fs-utils.ts
|
||
import { readFile as readFile2, stat } from "fs/promises";
|
||
import { readFileSync, statSync, createReadStream } from "fs";
|
||
function verbose() {
|
||
return process.env.CODEBURN_VERBOSE === "1";
|
||
}
|
||
function warn(msg) {
|
||
if (verbose()) process.stderr.write(`codeburn: ${msg}
|
||
`);
|
||
}
|
||
function notice(msg) {
|
||
process.stderr.write(`codeburn: ${msg}
|
||
`);
|
||
}
|
||
async function readSessionFile(filePath, encoding = "utf-8") {
|
||
let size;
|
||
try {
|
||
size = (await stat(filePath)).size;
|
||
} catch (err) {
|
||
warn(`stat failed for ${filePath}: ${err.code ?? "unknown"}`);
|
||
return null;
|
||
}
|
||
if (size > MAX_SESSION_FILE_BYTES) {
|
||
warn(`skipped oversize file ${filePath} (${size} bytes > cap ${MAX_SESSION_FILE_BYTES})`);
|
||
return null;
|
||
}
|
||
try {
|
||
return await readFile2(filePath, encoding);
|
||
} catch (err) {
|
||
warn(`read failed for ${filePath}: ${err.code ?? "unknown"}`);
|
||
return null;
|
||
}
|
||
}
|
||
async function* readSessionLines(filePath, shouldSkipHead, options = {}) {
|
||
let size;
|
||
try {
|
||
size = (await stat(filePath)).size;
|
||
} catch (err) {
|
||
warn(`stat failed for ${filePath}: ${err.code ?? "unknown"}`);
|
||
return;
|
||
}
|
||
const maxBytes = options.maxBytes ?? MAX_STREAM_SESSION_FILE_BYTES;
|
||
if (size > maxBytes) {
|
||
notice(
|
||
`skipped oversize session ${filePath} (${size} bytes > cap ${maxBytes}); its usage is NOT counted`
|
||
);
|
||
return;
|
||
}
|
||
const stream = createReadStream(
|
||
filePath,
|
||
options.startByteOffset !== void 0 ? { start: options.startByteOffset } : void 0
|
||
);
|
||
const SKIP_HEAD = 2048;
|
||
const largeLineThreshold = options.largeLineThresholdBytes ?? LARGE_STREAM_LINE_BYTES;
|
||
const formatLine = (buf, lineLen, head) => {
|
||
if (options.largeLineAsBuffer && lineLen > largeLineThreshold) return buf;
|
||
return head !== void 0 && lineLen <= SKIP_HEAD ? head : buf.toString("utf-8");
|
||
};
|
||
let parts = [];
|
||
let len = 0;
|
||
let skipping = false;
|
||
let headChecked = false;
|
||
let chunkBase = options.startByteOffset ?? 0;
|
||
const tracker = options.byteOffsetTracker;
|
||
try {
|
||
for await (const raw of stream) {
|
||
const chunk = raw;
|
||
let pos = 0;
|
||
while (pos < chunk.length) {
|
||
const nl = chunk.indexOf(10, pos);
|
||
if (skipping) {
|
||
if (nl === -1) {
|
||
pos = chunk.length;
|
||
} else {
|
||
if (tracker) tracker.lastCompleteLineOffset = chunkBase + nl + 1;
|
||
skipping = false;
|
||
pos = nl + 1;
|
||
}
|
||
continue;
|
||
}
|
||
if (nl !== -1) {
|
||
if (pos < nl) {
|
||
parts.push(chunk.subarray(pos, nl));
|
||
len += nl - pos;
|
||
}
|
||
pos = nl + 1;
|
||
if (tracker) tracker.lastCompleteLineOffset = chunkBase + pos;
|
||
if (len === 0) {
|
||
parts = [];
|
||
headChecked = false;
|
||
continue;
|
||
}
|
||
const buf = parts.length === 1 ? parts[0] : Buffer.concat(parts, len);
|
||
const lineLen = len;
|
||
parts = [];
|
||
len = 0;
|
||
headChecked = false;
|
||
if (shouldSkipHead) {
|
||
const head = lineLen > SKIP_HEAD ? buf.subarray(0, SKIP_HEAD).toString("utf-8") : buf.toString("utf-8");
|
||
if (shouldSkipHead(head)) continue;
|
||
yield formatLine(buf, lineLen, head);
|
||
} else {
|
||
yield formatLine(buf, lineLen);
|
||
}
|
||
} else {
|
||
const slice = chunk.subarray(pos);
|
||
parts.push(slice);
|
||
len += slice.length;
|
||
pos = chunk.length;
|
||
if (shouldSkipHead && !headChecked && len >= SKIP_HEAD) {
|
||
headChecked = true;
|
||
const headBuf = parts.length === 1 ? parts[0].subarray(0, SKIP_HEAD) : Buffer.concat(parts, len).subarray(0, SKIP_HEAD);
|
||
if (shouldSkipHead(headBuf.toString("utf-8"))) {
|
||
skipping = true;
|
||
parts = [];
|
||
len = 0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
chunkBase += chunk.length;
|
||
}
|
||
if (!skipping && len > 0) {
|
||
const buf = parts.length === 1 ? parts[0] : Buffer.concat(parts, len);
|
||
const lineLen = len;
|
||
if (shouldSkipHead) {
|
||
const head = lineLen > SKIP_HEAD ? buf.subarray(0, SKIP_HEAD).toString("utf-8") : buf.toString("utf-8");
|
||
if (!shouldSkipHead(head)) {
|
||
yield formatLine(buf, lineLen, head);
|
||
}
|
||
} else {
|
||
yield formatLine(buf, lineLen);
|
||
}
|
||
}
|
||
} catch (err) {
|
||
warn(`stream read failed for ${filePath}: ${err.code ?? "unknown"}`);
|
||
} finally {
|
||
stream.destroy();
|
||
}
|
||
}
|
||
async function mapWithConcurrency(items, limit, worker) {
|
||
const out = new Array(items.length);
|
||
let idx = 0;
|
||
const run = async () => {
|
||
while (idx < items.length) {
|
||
const current = idx++;
|
||
out[current] = await worker(items[current], current);
|
||
}
|
||
};
|
||
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, run));
|
||
return out;
|
||
}
|
||
var MAX_SESSION_FILE_BYTES, LARGE_STREAM_LINE_BYTES, MAX_STREAM_SESSION_FILE_BYTES, FS_SCAN_CONCURRENCY;
|
||
var init_fs_utils = __esm({
|
||
"src/fs-utils.ts"() {
|
||
"use strict";
|
||
MAX_SESSION_FILE_BYTES = 128 * 1024 * 1024;
|
||
LARGE_STREAM_LINE_BYTES = 32 * 1024;
|
||
MAX_STREAM_SESSION_FILE_BYTES = 4 * 1024 * 1024 * 1024;
|
||
FS_SCAN_CONCURRENCY = 32;
|
||
}
|
||
});
|
||
|
||
// src/behavioral-weight.ts
|
||
var init_behavioral_weight = __esm({
|
||
"src/behavioral-weight.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/copilot-aiu.ts
|
||
var AI_CREDIT_USD;
|
||
var init_copilot_aiu = __esm({
|
||
"src/copilot-aiu.ts"() {
|
||
"use strict";
|
||
AI_CREDIT_USD = 0.01;
|
||
}
|
||
});
|
||
|
||
// src/plans.ts
|
||
var COPILOT_PRO_CREDITS, COPILOT_PRO_PLUS_CREDITS, COPILOT_MAX_CREDITS, PRESET_PLANS;
|
||
var init_plans = __esm({
|
||
"src/plans.ts"() {
|
||
"use strict";
|
||
init_copilot_aiu();
|
||
COPILOT_PRO_CREDITS = 1500;
|
||
COPILOT_PRO_PLUS_CREDITS = 7e3;
|
||
COPILOT_MAX_CREDITS = 2e4;
|
||
PRESET_PLANS = {
|
||
"claude-pro": {
|
||
id: "claude-pro",
|
||
monthlyUsd: 20,
|
||
provider: "claude",
|
||
resetDay: 1
|
||
},
|
||
"claude-max": {
|
||
id: "claude-max",
|
||
monthlyUsd: 200,
|
||
provider: "claude",
|
||
resetDay: 1
|
||
},
|
||
"claude-max-5x": {
|
||
id: "claude-max-5x",
|
||
monthlyUsd: 100,
|
||
provider: "claude",
|
||
resetDay: 1
|
||
},
|
||
"cursor-pro": {
|
||
id: "cursor-pro",
|
||
monthlyUsd: 20,
|
||
provider: "cursor",
|
||
resetDay: 1
|
||
},
|
||
"supergrok": {
|
||
id: "supergrok",
|
||
monthlyUsd: 30,
|
||
provider: "grok",
|
||
resetDay: 1
|
||
},
|
||
"supergrok-heavy": {
|
||
id: "supergrok-heavy",
|
||
monthlyUsd: 300,
|
||
provider: "grok",
|
||
resetDay: 1
|
||
},
|
||
"copilot-pro": {
|
||
id: "copilot-pro",
|
||
monthlyCredits: COPILOT_PRO_CREDITS,
|
||
monthlyUsd: COPILOT_PRO_CREDITS * AI_CREDIT_USD,
|
||
provider: "copilot",
|
||
resetDay: 1
|
||
},
|
||
"copilot-pro-plus": {
|
||
id: "copilot-pro-plus",
|
||
monthlyCredits: COPILOT_PRO_PLUS_CREDITS,
|
||
monthlyUsd: COPILOT_PRO_PLUS_CREDITS * AI_CREDIT_USD,
|
||
provider: "copilot",
|
||
resetDay: 1
|
||
},
|
||
"copilot-max": {
|
||
id: "copilot-max",
|
||
monthlyCredits: COPILOT_MAX_CREDITS,
|
||
monthlyUsd: COPILOT_MAX_CREDITS * AI_CREDIT_USD,
|
||
provider: "copilot",
|
||
resetDay: 1
|
||
},
|
||
// US monthly prices from https://gemini.google/us/subscriptions/, fetched
|
||
// 2026-10-07. Antigravity is the only local tool these plans cover since
|
||
// Google retired Gemini CLI OAuth for individual tiers.
|
||
"google-ai-pro": {
|
||
id: "google-ai-pro",
|
||
monthlyUsd: 19.99,
|
||
provider: "antigravity",
|
||
resetDay: 1
|
||
},
|
||
"google-ai-ultra-5x": {
|
||
id: "google-ai-ultra-5x",
|
||
monthlyUsd: 99.99,
|
||
provider: "antigravity",
|
||
resetDay: 1
|
||
},
|
||
"google-ai-ultra-20x": {
|
||
id: "google-ai-ultra-20x",
|
||
monthlyUsd: 199.99,
|
||
provider: "antigravity",
|
||
resetDay: 1
|
||
}
|
||
};
|
||
}
|
||
});
|
||
|
||
// src/config.ts
|
||
var init_config = __esm({
|
||
"src/config.ts"() {
|
||
"use strict";
|
||
init_plans();
|
||
}
|
||
});
|
||
|
||
// src/currency.ts
|
||
var CACHE_TTL_MS2;
|
||
var init_currency = __esm({
|
||
"src/currency.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_config();
|
||
init_fetch_utils();
|
||
CACHE_TTL_MS2 = 24 * 60 * 60 * 1e3;
|
||
}
|
||
});
|
||
|
||
// src/format.ts
|
||
import chalk from "chalk";
|
||
var init_format = __esm({
|
||
"src/format.ts"() {
|
||
"use strict";
|
||
init_behavioral_weight();
|
||
init_currency();
|
||
}
|
||
});
|
||
|
||
// src/math-utils.ts
|
||
var init_math_utils = __esm({
|
||
"src/math-utils.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/session-output.ts
|
||
var init_session_output = __esm({
|
||
"src/session-output.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
}
|
||
});
|
||
|
||
// src/types.ts
|
||
var init_types = __esm({
|
||
"src/types.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/path-privacy.ts
|
||
import { homedir as homedir2 } from "os";
|
||
import { posix, win32 } from "path";
|
||
function normalizedPath(value) {
|
||
return value.trim().replace(/\\/g, "/").replace(/\/+$/, "");
|
||
}
|
||
function isUserHomeRoot(value) {
|
||
if (!value) return false;
|
||
const normalized = normalizedPath(value);
|
||
if (normalized.toLowerCase() === normalizedPath(homedir2()).toLowerCase()) return true;
|
||
return /(?:^|\/)(?:users|home|profiles)\/[^/]+$/i.test(normalized) || normalized === "/root";
|
||
}
|
||
var init_path_privacy = __esm({
|
||
"src/path-privacy.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/sync/otlp.ts
|
||
var init_otlp = __esm({
|
||
"src/sync/otlp.ts"() {
|
||
"use strict";
|
||
init_path_privacy();
|
||
init_models();
|
||
}
|
||
});
|
||
|
||
// src/work-units.ts
|
||
var KEY_SEP;
|
||
var init_work_units = __esm({
|
||
"src/work-units.ts"() {
|
||
"use strict";
|
||
init_otlp();
|
||
KEY_SEP = String.fromCharCode(0);
|
||
}
|
||
});
|
||
|
||
// src/sessions-report.ts
|
||
var KEY_SEP2, AMBIGUOUS_SPAWN_GRACE_MS;
|
||
var init_sessions_report = __esm({
|
||
"src/sessions-report.ts"() {
|
||
"use strict";
|
||
init_behavioral_weight();
|
||
init_format();
|
||
init_models();
|
||
init_math_utils();
|
||
init_session_output();
|
||
init_types();
|
||
init_work_units();
|
||
KEY_SEP2 = String.fromCharCode(0);
|
||
AMBIGUOUS_SPAWN_GRACE_MS = 30 * 60 * 1e3;
|
||
}
|
||
});
|
||
|
||
// src/content-utils.ts
|
||
function normalizeContentBlocks(content2) {
|
||
if (Array.isArray(content2)) {
|
||
const isBlock = (b) => b != null && typeof b === "object";
|
||
return content2.every(isBlock) ? content2 : content2.filter(isBlock);
|
||
}
|
||
if (typeof content2 === "string") return [{ type: "text", text: content2 }];
|
||
return [];
|
||
}
|
||
function flatSlice(s, max) {
|
||
return Buffer.from(s.slice(0, max), "utf16le").toString("utf16le");
|
||
}
|
||
function flatString(s) {
|
||
return Buffer.from(s, "utf16le").toString("utf16le");
|
||
}
|
||
var init_content_utils = __esm({
|
||
"src/content-utils.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/providers/amp.ts
|
||
import { readdir } from "fs/promises";
|
||
import { join as join2 } from "path";
|
||
import { homedir as homedir3 } from "os";
|
||
function ampDataDirs() {
|
||
const override = process.env["AMP_DATA_DIR"];
|
||
if (override) {
|
||
const dirs = override.split(",").map((part) => part.trim()).filter(Boolean);
|
||
if (dirs.length > 0) return [...new Set(dirs)];
|
||
}
|
||
return [join2(homedir3(), ".local/share/amp")];
|
||
}
|
||
function threadsDirFor(ampDataDir) {
|
||
return join2(ampDataDir, "threads");
|
||
}
|
||
function isRecord(value) {
|
||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||
}
|
||
function finiteNonNegative(value) {
|
||
if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
|
||
return Math.min(value, Number.MAX_SAFE_INTEGER);
|
||
}
|
||
return void 0;
|
||
}
|
||
function readNumber(record, field) {
|
||
return finiteNonNegative(record[field]) ?? 0;
|
||
}
|
||
function nonEmptyString(value) {
|
||
return typeof value === "string" && value.length > 0 ? value : void 0;
|
||
}
|
||
function messageText(message) {
|
||
const content2 = message["content"];
|
||
if (typeof content2 === "string") return content2;
|
||
if (Array.isArray(content2)) {
|
||
return content2.filter(isRecord).map((block) => nonEmptyString(block["text"]) ?? "").filter(Boolean).join(" ");
|
||
}
|
||
return nonEmptyString(message["text"]) ?? "";
|
||
}
|
||
function parseThreadFile(content2) {
|
||
let thread;
|
||
try {
|
||
thread = JSON.parse(content2);
|
||
} catch {
|
||
return null;
|
||
}
|
||
if (!isRecord(thread)) return null;
|
||
const threadId = nonEmptyString(thread["id"]);
|
||
if (!threadId) return null;
|
||
const messages = Array.isArray(thread["messages"]) ? thread["messages"].filter(isRecord) : [];
|
||
const userMessages = messages.map((message, index) => ({ index, text: messageText(message) })).filter((entry) => entry.text.length > 0);
|
||
const cacheTokensByMessageId = /* @__PURE__ */ new Map();
|
||
messages.forEach((message, index) => {
|
||
if (message["role"] !== "assistant") return;
|
||
const usage = message["usage"];
|
||
if (!isRecord(usage)) return;
|
||
const messageId = message["messageId"];
|
||
if (typeof messageId !== "number" || !Number.isInteger(messageId)) return;
|
||
cacheTokensByMessageId.set(messageId, {
|
||
index,
|
||
creation: readNumber(usage, "cacheCreationInputTokens"),
|
||
read: readNumber(usage, "cacheReadInputTokens")
|
||
});
|
||
});
|
||
const calls = [];
|
||
const ledger = thread["usageLedger"];
|
||
const events = isRecord(ledger) && Array.isArray(ledger["events"]) ? ledger["events"] : [];
|
||
for (const raw of events) {
|
||
if (!isRecord(raw)) continue;
|
||
const timestamp2 = nonEmptyString(raw["timestamp"]);
|
||
const model = nonEmptyString(raw["model"]);
|
||
const tokens2 = raw["tokens"];
|
||
if (!timestamp2 || !model || !isRecord(tokens2)) continue;
|
||
const inputTokens = readNumber(tokens2, "input");
|
||
const outputTokens = readNumber(tokens2, "output");
|
||
const total = finiteNonNegative(tokens2["total"]);
|
||
const toMessageId = raw["toMessageId"];
|
||
const billed = typeof toMessageId === "number" && Number.isInteger(toMessageId) ? cacheTokensByMessageId.get(toMessageId) : void 0;
|
||
const accountedTokens = inputTokens + outputTokens + (billed?.creation ?? 0) + (billed?.read ?? 0);
|
||
const billedOutput = outputTokens + Math.max(0, (total ?? 0) - accountedTokens);
|
||
calls.push({
|
||
model,
|
||
timestamp: timestamp2,
|
||
inputTokens,
|
||
outputTokens: billedOutput,
|
||
cacheCreationInputTokens: billed?.creation ?? 0,
|
||
cacheReadInputTokens: billed?.read ?? 0,
|
||
eventId: nonEmptyString(raw["id"]) ?? (typeof raw["id"] === "number" ? String(raw["id"]) : void 0),
|
||
messageIndex: billed?.index
|
||
});
|
||
}
|
||
if (calls.length > 0) return { threadId, calls, userMessages };
|
||
messages.forEach((message, index) => {
|
||
if (message["role"] !== "assistant") return;
|
||
const usage = message["usage"];
|
||
if (!isRecord(usage)) return;
|
||
const timestamp2 = nonEmptyString(usage["timestamp"]) ?? nonEmptyString(message["timestamp"]);
|
||
const model = nonEmptyString(usage["model"]) ?? nonEmptyString(message["model"]);
|
||
if (!timestamp2 || !model) return;
|
||
const inputTokens = readNumber(usage, "inputTokens");
|
||
const outputTokens = readNumber(usage, "outputTokens");
|
||
const cacheCreationInputTokens = readNumber(usage, "cacheCreationInputTokens");
|
||
const cacheReadInputTokens = readNumber(usage, "cacheReadInputTokens");
|
||
const total = finiteNonNegative(usage["totalTokens"]);
|
||
const hasParts = inputTokens > 0 || outputTokens > 0 || cacheCreationInputTokens > 0 || cacheReadInputTokens > 0;
|
||
const billedOutput = hasParts ? outputTokens : total ?? 0;
|
||
calls.push({
|
||
model,
|
||
timestamp: timestamp2,
|
||
inputTokens,
|
||
outputTokens: billedOutput,
|
||
cacheCreationInputTokens,
|
||
cacheReadInputTokens,
|
||
eventId: void 0,
|
||
messageIndex: index
|
||
});
|
||
});
|
||
return { threadId, calls, userMessages };
|
||
}
|
||
function userMessageFor(parsed, record) {
|
||
const anchor = record.messageIndex ?? Number.MAX_SAFE_INTEGER;
|
||
for (let i = parsed.userMessages.length - 1; i >= 0; i--) {
|
||
if (parsed.userMessages[i].index < anchor) return parsed.userMessages[i].text;
|
||
}
|
||
return parsed.userMessages[0]?.text ?? "";
|
||
}
|
||
function hasPositiveTokens(record) {
|
||
return record.inputTokens > 0 || record.outputTokens > 0 || record.cacheCreationInputTokens > 0 || record.cacheReadInputTokens > 0;
|
||
}
|
||
function createParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const content2 = await readSessionFile(source.path);
|
||
if (content2 === null) return;
|
||
const parsed = parseThreadFile(content2);
|
||
if (!parsed) return;
|
||
const threadId = parsed.threadId;
|
||
for (const record of parsed.calls) {
|
||
if (!hasPositiveTokens(record)) continue;
|
||
const deduplicationKey = record.eventId ? `${source.provider}:${threadId}:${record.eventId}` : `${source.provider}:${threadId}:${record.timestamp}:${record.model}:${record.inputTokens}x${record.outputTokens}`;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
yield {
|
||
provider: source.provider,
|
||
model: record.model,
|
||
inputTokens: record.inputTokens,
|
||
outputTokens: record.outputTokens,
|
||
cacheCreationInputTokens: record.cacheCreationInputTokens,
|
||
cacheReadInputTokens: record.cacheReadInputTokens,
|
||
cachedInputTokens: record.cacheReadInputTokens,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(
|
||
record.model,
|
||
record.inputTokens,
|
||
record.outputTokens,
|
||
record.cacheCreationInputTokens,
|
||
record.cacheReadInputTokens,
|
||
0
|
||
),
|
||
// Priced from tokens; Amp's own credits field is not converted.
|
||
costIsEstimated: true,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: record.timestamp,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
userMessage: userMessageFor(parsed, record),
|
||
sessionId: threadId,
|
||
project: source.project
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function discoverThreads(roots) {
|
||
const sources = [];
|
||
for (const root of roots) {
|
||
const threadsDir = threadsDirFor(root);
|
||
let entries;
|
||
try {
|
||
entries = await readdir(threadsDir, { recursive: true });
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const name of entries) {
|
||
if (!name.endsWith(".json")) continue;
|
||
sources.push({ path: join2(threadsDir, name), project: "Amp", provider: "amp" });
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createAmpProvider(overrideDirs) {
|
||
const roots = overrideDirs ?? ampDataDirs();
|
||
return {
|
||
name: "amp",
|
||
displayName: "Amp",
|
||
async probeRoots() {
|
||
return roots.map((root) => ({ path: threadsDirFor(root), label: "threads" }));
|
||
},
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
return discoverThreads(roots);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var amp;
|
||
var init_amp = __esm({
|
||
"src/providers/amp.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
amp = createAmpProvider();
|
||
}
|
||
});
|
||
|
||
// src/wsl.ts
|
||
import { execFileSync } from "child_process";
|
||
import { existsSync, readdirSync } from "fs";
|
||
function wslMode(env = process.env) {
|
||
const value = (env["CODEBURN_WSL"] ?? "").trim().toLowerCase();
|
||
return value === "off" || value === "all" ? value : "running";
|
||
}
|
||
function wslExePath(env) {
|
||
const root = env["SystemRoot"];
|
||
const base = root && /^[a-zA-Z]:[\\/]/.test(root) ? root.replace(/[\\/]+$/, "") : "C:\\Windows";
|
||
return `${base}\\System32\\wsl.exe`;
|
||
}
|
||
function parseWslDistros(raw) {
|
||
const text2 = raw.includes(0) ? raw.toString("utf16le") : raw.toString("utf8");
|
||
return text2.split(/\r?\n/).map((line) => line.replace(/[\0\uFEFF]/g, "").trim()).filter((name) => DISTRO_NAME.test(name) && !name.endsWith(".") && !UTILITY_DISTROS.test(name));
|
||
}
|
||
function isWslUncPath(path) {
|
||
return /^\\\\wsl(\$|\.localhost)\\/i.test(path);
|
||
}
|
||
function homesUnder(base) {
|
||
const homes = [];
|
||
try {
|
||
for (const entry of readdirSync(`${base}\\home`, { withFileTypes: true })) {
|
||
if (entry.isDirectory()) homes.push(`${base}\\home\\${entry.name}`);
|
||
}
|
||
} catch {
|
||
}
|
||
try {
|
||
if (existsSync(`${base}\\root`)) homes.push(`${base}\\root`);
|
||
} catch {
|
||
}
|
||
return homes;
|
||
}
|
||
function discoverWslHomes() {
|
||
if (process.platform !== "win32") return [];
|
||
const mode = wslMode();
|
||
if (mode === "off") return [];
|
||
const args = mode === "all" ? ["--list", "--quiet"] : ["--list", "--quiet", "--running"];
|
||
let raw;
|
||
try {
|
||
raw = execFileSync(wslExePath(process.env), args, {
|
||
timeout: 3e3,
|
||
windowsHide: true,
|
||
maxBuffer: 1024 * 1024,
|
||
stdio: ["ignore", "pipe", "ignore"]
|
||
});
|
||
} catch {
|
||
return [];
|
||
}
|
||
const homes = [];
|
||
for (const distro of parseWslDistros(raw)) {
|
||
for (const prefix of UNC_PREFIXES) {
|
||
const found = homesUnder(prefix + distro);
|
||
if (found.length > 0) {
|
||
homes.push(...found);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
return homes;
|
||
}
|
||
function wslHomes(now = Date.now()) {
|
||
const mode = wslMode();
|
||
if (mode === "off") {
|
||
if (!cached?.pinned) cached = void 0;
|
||
return [];
|
||
}
|
||
if (cached?.pinned) return cached.homes;
|
||
if (cached !== void 0 && cached.mode === mode && now < cached.expiresAt) return cached.homes;
|
||
const homes = discoverWslHomes();
|
||
cached = { homes, expiresAt: now + WSL_HOMES_TTL_MS, mode };
|
||
return homes;
|
||
}
|
||
var UTILITY_DISTROS, DISTRO_NAME, UNC_PREFIXES, WSL_HOMES_TTL_MS, cached;
|
||
var init_wsl = __esm({
|
||
"src/wsl.ts"() {
|
||
"use strict";
|
||
UTILITY_DISTROS = /^(docker-desktop|podman-machine|rancher-desktop)/;
|
||
DISTRO_NAME = /^[^\s\\/:*?"<>|]+$/;
|
||
UNC_PREFIXES = ["\\\\wsl$\\", "\\\\wsl.localhost\\"];
|
||
WSL_HOMES_TTL_MS = 6e4;
|
||
}
|
||
});
|
||
|
||
// src/providers/claude.ts
|
||
var init_claude = __esm({
|
||
"src/providers/claude.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_config();
|
||
init_fs_utils();
|
||
init_wsl();
|
||
}
|
||
});
|
||
|
||
// src/providers/vscode-cline-parser.ts
|
||
import { readdir as readdir2, readFile as readFile3, stat as stat2 } from "fs/promises";
|
||
import { basename, join as join3, posix as posix2, win32 as win322 } from "path";
|
||
import { homedir as homedir4 } from "os";
|
||
function getVSCodeGlobalStoragePaths(extensionId, homeDir = homedir4(), platform4 = process.platform) {
|
||
const pathJoin = platform4 === "win32" ? win322.join : posix2.join;
|
||
if (platform4 === "darwin") {
|
||
return [
|
||
pathJoin(homeDir, "Library", "Application Support", "Code", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, "Library", "Application Support", "Code - Insiders", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, "Library", "Application Support", "VSCodium", "User", "globalStorage", extensionId)
|
||
];
|
||
}
|
||
if (platform4 === "win32") {
|
||
return [
|
||
pathJoin(homeDir, "AppData", "Roaming", "Code", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, "AppData", "Roaming", "Code - Insiders", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, "AppData", "Roaming", "VSCodium", "User", "globalStorage", extensionId)
|
||
];
|
||
}
|
||
return [
|
||
pathJoin(homeDir, ".config", "Code", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, ".config", "Code - Insiders", "User", "globalStorage", extensionId),
|
||
pathJoin(homeDir, ".config", "VSCodium", "User", "globalStorage", extensionId)
|
||
];
|
||
}
|
||
function clineTaskRoots(extensionId, overrideDir) {
|
||
return overrideDir ? Array.isArray(overrideDir) ? overrideDir : [overrideDir] : getVSCodeGlobalStoragePaths(extensionId);
|
||
}
|
||
async function discoverClineTasks(extensionId, providerName, displayName, overrideDir) {
|
||
return discoverClineTasksInBaseDirs(clineTaskRoots(extensionId, overrideDir), providerName, displayName);
|
||
}
|
||
async function discoverClineTasksInBaseDirs(baseDirs, providerName, displayName) {
|
||
const sources = [];
|
||
const seen = /* @__PURE__ */ new Set();
|
||
for (const baseDir of baseDirs) {
|
||
for (const source of await discoverClineTasksInBaseDir(baseDir, providerName, displayName)) {
|
||
if (seen.has(source.path)) continue;
|
||
seen.add(source.path);
|
||
sources.push(source);
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverClineTasksInBaseDir(baseDir, providerName, displayName) {
|
||
const tasksDir = join3(baseDir, "tasks");
|
||
const sources = [];
|
||
let taskDirs;
|
||
try {
|
||
taskDirs = await readdir2(tasksDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const taskId of taskDirs) {
|
||
const taskDir = join3(tasksDir, taskId);
|
||
const dirStat = await stat2(taskDir).catch(() => null);
|
||
if (!dirStat?.isDirectory()) continue;
|
||
const uiPath = join3(taskDir, "ui_messages.json");
|
||
const uiStat = await stat2(uiPath).catch(() => null);
|
||
if (!uiStat?.isFile()) continue;
|
||
sources.push({ path: taskDir, project: displayName, provider: providerName });
|
||
}
|
||
return sources;
|
||
}
|
||
function extractHistoryMeta(taskDir, fallbackModel) {
|
||
return readFile3(join3(taskDir, "api_conversation_history.json"), "utf-8").then((raw) => {
|
||
const msgs = JSON.parse(raw);
|
||
if (!Array.isArray(msgs)) return { model: fallbackModel, workspace: null };
|
||
let model = null;
|
||
let workspace = null;
|
||
for (const msg of msgs) {
|
||
if (msg.role !== "user" || !Array.isArray(msg.content)) continue;
|
||
for (const block of msg.content) {
|
||
if (typeof block.text !== "string") continue;
|
||
if (!model) {
|
||
const mm = MODEL_TAG_RE.exec(block.text);
|
||
if (mm) model = mm[1].includes("/") ? mm[1].split("/").pop() : mm[1];
|
||
}
|
||
if (!workspace) {
|
||
const wm = WORKSPACE_DIR_RE.exec(block.text);
|
||
if (wm) workspace = wm[1];
|
||
}
|
||
if (model && workspace) break;
|
||
}
|
||
if (model && workspace) break;
|
||
}
|
||
return { model: model ?? fallbackModel, workspace };
|
||
}).catch(() => ({ model: fallbackModel, workspace: null }));
|
||
}
|
||
function workspaceToProject(workspace) {
|
||
return basename(workspace) || workspace;
|
||
}
|
||
function createClineParser(source, seenKeys, providerName, fallbackModel = "cline-auto") {
|
||
return {
|
||
async *parse() {
|
||
const taskDir = source.path;
|
||
const taskId = basename(taskDir);
|
||
let uiRaw;
|
||
try {
|
||
uiRaw = await readFile3(join3(taskDir, "ui_messages.json"), "utf-8");
|
||
} catch {
|
||
return;
|
||
}
|
||
let uiMessages;
|
||
try {
|
||
uiMessages = JSON.parse(uiRaw);
|
||
} catch {
|
||
return;
|
||
}
|
||
if (!Array.isArray(uiMessages)) return;
|
||
const meta = await extractHistoryMeta(taskDir, fallbackModel);
|
||
const model = meta.model;
|
||
const project = meta.workspace ? workspaceToProject(meta.workspace) : void 0;
|
||
const projectPath = meta.workspace ?? void 0;
|
||
let userMessage = "";
|
||
for (const msg of uiMessages) {
|
||
if (msg.type === "say" && (msg.say === "user_feedback" || msg.say === "text")) {
|
||
userMessage = (msg.text ?? "").slice(0, 500);
|
||
break;
|
||
}
|
||
}
|
||
const apiReqEntries = uiMessages.filter((m) => m.type === "say" && m.say === "api_req_started");
|
||
for (const [index, entry] of apiReqEntries.entries()) {
|
||
const dedupKey = `${providerName}:${taskId}:${index}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
let tokensIn = 0;
|
||
let tokensOut = 0;
|
||
let cacheReads = 0;
|
||
let cacheWrites = 0;
|
||
let cost;
|
||
if (entry.text) {
|
||
try {
|
||
const parsed = JSON.parse(entry.text);
|
||
tokensIn = parsed.tokensIn ?? 0;
|
||
tokensOut = parsed.tokensOut ?? 0;
|
||
cacheReads = parsed.cacheReads ?? 0;
|
||
cacheWrites = parsed.cacheWrites ?? 0;
|
||
cost = parsed.cost;
|
||
} catch {
|
||
}
|
||
}
|
||
if (tokensIn === 0 && tokensOut === 0) continue;
|
||
const tsDate = entry.ts ? new Date(entry.ts) : null;
|
||
const timestamp2 = tsDate && !Number.isNaN(tsDate.getTime()) ? tsDate.toISOString() : "";
|
||
const costUSD = cost ?? calculateCost(model, tokensIn, tokensOut, cacheWrites, cacheReads, 0);
|
||
yield {
|
||
provider: providerName,
|
||
model,
|
||
inputTokens: tokensIn,
|
||
outputTokens: tokensOut,
|
||
cacheCreationInputTokens: cacheWrites,
|
||
cacheReadInputTokens: cacheReads,
|
||
cachedInputTokens: cacheReads,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: index === 0 ? userMessage : "",
|
||
sessionId: taskId,
|
||
project,
|
||
projectPath
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
var MODEL_TAG_RE, WORKSPACE_DIR_RE;
|
||
var init_vscode_cline_parser = __esm({
|
||
"src/providers/vscode-cline-parser.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
MODEL_TAG_RE = /<model>([^<]+)<\/model>/;
|
||
WORKSPACE_DIR_RE = /Current Workspace Directory \(([^)]+)\)/;
|
||
}
|
||
});
|
||
|
||
// src/providers/cline.ts
|
||
import { stat as stat3 } from "fs/promises";
|
||
import { homedir as homedir5 } from "os";
|
||
import { basename as basename2, join as join4 } from "path";
|
||
function getClineDataPath() {
|
||
return join4(homedir5(), ".cline", "data");
|
||
}
|
||
function normalizeOverrideDirs(overrideDirs) {
|
||
if (overrideDirs === void 0) return void 0;
|
||
return Array.isArray(overrideDirs) ? overrideDirs : [overrideDirs];
|
||
}
|
||
async function dedupeTaskSources(sources) {
|
||
const candidates = await Promise.all(sources.map(async (source) => ({
|
||
source,
|
||
mtimeMs: (await stat3(join4(source.path, "ui_messages.json")).catch(() => null))?.mtimeMs ?? 0
|
||
})));
|
||
const seenTaskIds = /* @__PURE__ */ new Set();
|
||
const deduped = [];
|
||
for (const { source } of candidates.sort((a, b) => b.mtimeMs - a.mtimeMs)) {
|
||
const taskId = basename2(source.path);
|
||
if (seenTaskIds.has(taskId)) continue;
|
||
seenTaskIds.add(taskId);
|
||
deduped.push(source);
|
||
}
|
||
return deduped;
|
||
}
|
||
function createClineProvider(overrideDirs) {
|
||
const configuredDirs = normalizeOverrideDirs(overrideDirs);
|
||
const taskRoots = () => configuredDirs ?? [
|
||
...clineTaskRoots(EXTENSION_ID),
|
||
getClineDataPath()
|
||
];
|
||
return {
|
||
name: "cline",
|
||
displayName: "Cline",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return taskRoots().map((path) => ({ path, label: "tasks" }));
|
||
},
|
||
async discoverSessions() {
|
||
const baseDirs = taskRoots();
|
||
return dedupeTaskSources(await discoverClineTasks(EXTENSION_ID, "cline", "Cline", baseDirs));
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createClineParser(source, seenKeys, "cline");
|
||
}
|
||
};
|
||
}
|
||
var EXTENSION_ID, cline;
|
||
var init_cline = __esm({
|
||
"src/providers/cline.ts"() {
|
||
"use strict";
|
||
init_vscode_cline_parser();
|
||
EXTENSION_ID = "saoudrizwan.claude-dev";
|
||
cline = createClineProvider();
|
||
}
|
||
});
|
||
|
||
// src/bash-utils.ts
|
||
import { basename as basename3 } from "path";
|
||
import stripAnsi from "strip-ansi";
|
||
function stripQuotedStrings(command) {
|
||
return command.replace(/"[^"]*"|'[^']*'/g, (match) => " ".repeat(match.length));
|
||
}
|
||
function extractBashCommands(rawCommand) {
|
||
if (!rawCommand || !rawCommand.trim()) return [];
|
||
const command = stripAnsi(rawCommand);
|
||
const stripped = stripQuotedStrings(command);
|
||
const separatorRegex = /(?:&&|;|\|)/g;
|
||
const separators = [];
|
||
let match;
|
||
while ((match = separatorRegex.exec(stripped)) !== null) {
|
||
let start = match.index;
|
||
while (start > 0 && WHITESPACE.test(stripped[start - 1])) start--;
|
||
let end = match.index + match[0].length;
|
||
while (end < stripped.length && WHITESPACE.test(stripped[end])) end++;
|
||
const prevEnd = separators[separators.length - 1]?.end ?? 0;
|
||
separators.push({ start: Math.max(start, prevEnd), end });
|
||
separatorRegex.lastIndex = end;
|
||
}
|
||
const ranges = [];
|
||
let cursor = 0;
|
||
for (const sep3 of separators) {
|
||
ranges.push([cursor, sep3.start]);
|
||
cursor = sep3.end;
|
||
}
|
||
ranges.push([cursor, command.length]);
|
||
const commands = [];
|
||
for (const [start, end] of ranges) {
|
||
const segment = command.slice(start, end).trim();
|
||
if (!segment) continue;
|
||
const tokens2 = segment.split(/\s+/);
|
||
let i = 0;
|
||
while (i < tokens2.length) {
|
||
if (/^\w+=/.test(tokens2[i])) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const next = tokens2[i + 1];
|
||
if (next !== void 0 && COMMAND_PREFIXES.has(basename3(tokens2[i])) && !next.startsWith("-") && !/["']/.test(next)) {
|
||
i++;
|
||
continue;
|
||
}
|
||
break;
|
||
}
|
||
const base = i < tokens2.length ? basename3(tokens2[i]) : "";
|
||
if (base && base !== "cd" && base !== "true" && base !== "false") {
|
||
commands.push(base);
|
||
}
|
||
}
|
||
return commands;
|
||
}
|
||
var WHITESPACE, COMMAND_PREFIXES;
|
||
var init_bash_utils = __esm({
|
||
"src/bash-utils.ts"() {
|
||
"use strict";
|
||
WHITESPACE = /\s/;
|
||
COMMAND_PREFIXES = /* @__PURE__ */ new Set([
|
||
"sudo",
|
||
"doas",
|
||
"npx",
|
||
"bunx",
|
||
"time",
|
||
"nice",
|
||
"nohup",
|
||
"stdbuf",
|
||
"rtk"
|
||
]);
|
||
}
|
||
});
|
||
|
||
// src/providers/cline-cli.ts
|
||
import { readdir as readdir3 } from "fs/promises";
|
||
import { homedir as homedir6 } from "os";
|
||
import { basename as basename4, join as join5 } from "path";
|
||
function clineRootDir() {
|
||
return process.env["CLINE_DIR"]?.trim() || join5(homedir6(), ".cline");
|
||
}
|
||
function clineDataDir() {
|
||
return process.env["CLINE_DATA_DIR"]?.trim() || join5(clineRootDir(), "data");
|
||
}
|
||
function getClineCliSessionsDir() {
|
||
return process.env["CLINE_SESSION_DATA_DIR"]?.trim() || join5(clineDataDir(), "sessions");
|
||
}
|
||
function mapToolName(rawTool) {
|
||
return toolNameMap[rawTool] ?? rawTool;
|
||
}
|
||
function isRecord2(value) {
|
||
return value !== null && typeof value === "object" && !Array.isArray(value);
|
||
}
|
||
function nonEmptyString2(value) {
|
||
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
||
}
|
||
function safeNonNegativeNumber(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
||
}
|
||
function safeTokenCount(value) {
|
||
return Math.floor(Math.min(safeNonNegativeNumber(value), Number.MAX_SAFE_INTEGER));
|
||
}
|
||
function isReportedCost(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
||
}
|
||
function parseMetrics(value) {
|
||
if (!isRecord2(value)) return null;
|
||
const cacheReadTokens = safeTokenCount(value["cacheReadTokens"]);
|
||
const cacheWriteTokens = safeTokenCount(value["cacheWriteTokens"]);
|
||
const metrics = {
|
||
// Cline's inputTokens is the full prompt, cache read and write included
|
||
// (its own pricing bills max(0, input - cacheRead - cacheWrite) at the input rate).
|
||
inputTokens: Math.max(0, safeTokenCount(value["inputTokens"]) - cacheReadTokens - cacheWriteTokens),
|
||
outputTokens: safeTokenCount(value["outputTokens"]),
|
||
cacheReadTokens,
|
||
cacheWriteTokens,
|
||
cost: safeNonNegativeNumber(value["cost"]),
|
||
// A negative cost is not a credit we can represent — treat it as absent and
|
||
// fall back to token pricing, rather than reporting a clamped $0 as metered.
|
||
costReported: isReportedCost(value["cost"])
|
||
};
|
||
const hasTokens = metrics.inputTokens > 0 || metrics.outputTokens > 0 || metrics.cacheReadTokens > 0 || metrics.cacheWriteTokens > 0;
|
||
return hasTokens || metrics.cost > 0 ? metrics : null;
|
||
}
|
||
function projectName(workspace) {
|
||
if (!workspace) return DISPLAY_NAME;
|
||
const parts = workspace.replace(/[\\/]+$/, "").split(/[\\/]/).filter(Boolean);
|
||
return parts.at(-1) ?? DISPLAY_NAME;
|
||
}
|
||
function isoTimestamp(value, fallback) {
|
||
if (typeof value === "number" && Number.isFinite(value) && value > 0) {
|
||
const ms = value < MIN_REASONABLE_TIMESTAMP_MS ? value * 1e3 : value;
|
||
const date = new Date(ms);
|
||
if (!Number.isNaN(date.getTime()) && date.getTime() >= MIN_REASONABLE_TIMESTAMP_MS) {
|
||
return date.toISOString();
|
||
}
|
||
}
|
||
const parsed = nonEmptyString2(value);
|
||
if (parsed) {
|
||
const date = new Date(parsed);
|
||
if (!Number.isNaN(date.getTime())) return date.toISOString();
|
||
}
|
||
return fallback;
|
||
}
|
||
function commandsFrom(input) {
|
||
if (!isRecord2(input)) return [];
|
||
const raw = input["commands"] ?? input["command"];
|
||
if (Array.isArray(raw)) return raw.filter((c) => typeof c === "string");
|
||
const text2 = nonEmptyString2(raw);
|
||
if (!text2) return [];
|
||
if (text2.startsWith("[")) {
|
||
try {
|
||
const parsed = JSON.parse(text2);
|
||
if (Array.isArray(parsed)) return parsed.filter((c) => typeof c === "string");
|
||
} catch {
|
||
}
|
||
}
|
||
return [text2];
|
||
}
|
||
function firstString(input, keys) {
|
||
if (!isRecord2(input)) return void 0;
|
||
for (const key of keys) {
|
||
const value = nonEmptyString2(input[key]);
|
||
if (value) return value;
|
||
}
|
||
return void 0;
|
||
}
|
||
function collectTools(content2) {
|
||
const collected = {
|
||
tools: [],
|
||
bashCommands: [],
|
||
toolSequence: [],
|
||
skills: [],
|
||
subagentTypes: [],
|
||
webSearchRequests: 0
|
||
};
|
||
if (!Array.isArray(content2)) return collected;
|
||
const turnTools = [];
|
||
for (const block of content2) {
|
||
if (!isRecord2(block) || block["type"] !== "tool_use") continue;
|
||
const rawName = nonEmptyString2(block["name"]);
|
||
if (!rawName) continue;
|
||
const mapped = mapToolName(rawName);
|
||
const input = block["input"];
|
||
const toolCall = { tool: mapped };
|
||
const file = firstString(input, ["path", "file_path", "paths", "file"]);
|
||
if (file) toolCall.file = file;
|
||
if (mapped === "Bash") {
|
||
const commands = commandsFrom(input);
|
||
const [first] = commands;
|
||
if (first) toolCall.command = first;
|
||
for (const command of commands) collected.bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
if (mapped === "Skill") {
|
||
const skill = firstString(input, ["name", "skill", "skill_name"]);
|
||
if (skill) collected.skills.push(skill);
|
||
}
|
||
if (mapped === "Agent") {
|
||
const subagentType = firstString(input, ["agent", "agent_type", "type", "name"]);
|
||
if (subagentType) collected.subagentTypes.push(subagentType);
|
||
}
|
||
if (mapped === "WebFetch") collected.webSearchRequests++;
|
||
collected.tools.push(mapped);
|
||
turnTools.push(toolCall);
|
||
}
|
||
if (turnTools.length > 0) collected.toolSequence.push(turnTools);
|
||
return collected;
|
||
}
|
||
function textFromContent(content2) {
|
||
if (typeof content2 === "string") return content2;
|
||
if (!Array.isArray(content2)) return "";
|
||
for (const block of content2) {
|
||
if (!isRecord2(block) || block["type"] !== "text") continue;
|
||
const text2 = nonEmptyString2(block["text"]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function firstUserMessage(messages) {
|
||
for (const message of messages) {
|
||
if (!isRecord2(message) || message["role"] !== "user") continue;
|
||
const text2 = textFromContent(message["content"]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
async function readJson(path) {
|
||
const raw = await readSessionFile(path);
|
||
if (raw === null) return null;
|
||
try {
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function createParser2(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const metaPath = source.path.replace(/\.messages\.json$/, ".json");
|
||
const meta = await readJson(metaPath);
|
||
if (!isRecord2(meta)) return;
|
||
const sessionId = nonEmptyString2(meta["session_id"]) ?? basename4(metaPath).replace(/\.json$/, "");
|
||
const metadata = isRecord2(meta["metadata"]) ? meta["metadata"] : {};
|
||
const workspace = nonEmptyString2(meta["workspace_root"]) ?? nonEmptyString2(meta["cwd"]);
|
||
const sessionModel = nonEmptyString2(meta["model"]) ?? "unknown";
|
||
const startedAt = isoTimestamp(meta["started_at"], (/* @__PURE__ */ new Date(0)).toISOString());
|
||
const project = source.project;
|
||
let doc = await readJson(source.path);
|
||
if (!isRecord2(doc)) {
|
||
const recorded = nonEmptyString2(meta["messages_path"]);
|
||
if (recorded) doc = await readJson(recorded);
|
||
}
|
||
const messages = isRecord2(doc) && Array.isArray(doc["messages"]) ? doc["messages"] : [];
|
||
const userMessage = firstUserMessage(messages);
|
||
let hadMetrics = false;
|
||
for (const [index, message] of messages.entries()) {
|
||
if (!isRecord2(message) || message["role"] !== "assistant") continue;
|
||
const metrics = parseMetrics(message["metrics"]);
|
||
if (!metrics) continue;
|
||
hadMetrics = true;
|
||
const modelInfo = isRecord2(message["modelInfo"]) ? message["modelInfo"] : {};
|
||
const model = nonEmptyString2(modelInfo["id"]) ?? sessionModel;
|
||
const messageId = nonEmptyString2(message["id"]) ?? String(index);
|
||
const deduplicationKey2 = `${PROVIDER_NAME}:${sessionId}:${messageId}`;
|
||
if (seenKeys.has(deduplicationKey2)) continue;
|
||
seenKeys.add(deduplicationKey2);
|
||
const { tools, bashCommands, toolSequence, skills, subagentTypes, webSearchRequests } = collectTools(message["content"]);
|
||
yield {
|
||
provider: PROVIDER_NAME,
|
||
model,
|
||
inputTokens: metrics.inputTokens,
|
||
outputTokens: metrics.outputTokens,
|
||
cacheCreationInputTokens: metrics.cacheWriteTokens,
|
||
cacheReadInputTokens: metrics.cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests,
|
||
costUSD: metrics.costReported ? metrics.cost : calculateCost(model, metrics.inputTokens, metrics.outputTokens, metrics.cacheWriteTokens, metrics.cacheReadTokens, 0),
|
||
costIsEstimated: !metrics.costReported,
|
||
tools,
|
||
bashCommands,
|
||
skills: skills.length > 0 ? skills : void 0,
|
||
subagentTypes: subagentTypes.length > 0 ? subagentTypes : void 0,
|
||
timestamp: isoTimestamp(message["ts"], startedAt),
|
||
speed: "standard",
|
||
deduplicationKey: deduplicationKey2,
|
||
turnId: `${sessionId}:${messageId}`,
|
||
toolSequence: toolSequence.length > 0 ? toolSequence : void 0,
|
||
userMessage,
|
||
sessionId,
|
||
project,
|
||
projectPath: workspace,
|
||
workingDirectory: nonEmptyString2(meta["cwd"])
|
||
};
|
||
}
|
||
if (hadMetrics) return;
|
||
const rollup = parseMetrics(isRecord2(metadata["usage"]) ? metadata["usage"] : null);
|
||
if (!rollup) return;
|
||
const deduplicationKey = `${PROVIDER_NAME}:${sessionId}:rollup`;
|
||
if (seenKeys.has(deduplicationKey)) return;
|
||
seenKeys.add(deduplicationKey);
|
||
const rawRollupCost = (isRecord2(metadata["usage"]) ? metadata["usage"]["totalCost"] : void 0) ?? metadata["totalCost"];
|
||
const rollupCostReported = isReportedCost(rawRollupCost);
|
||
const rollupCost = safeNonNegativeNumber(rawRollupCost);
|
||
yield {
|
||
provider: PROVIDER_NAME,
|
||
model: sessionModel,
|
||
inputTokens: rollup.inputTokens,
|
||
outputTokens: rollup.outputTokens,
|
||
cacheCreationInputTokens: rollup.cacheWriteTokens,
|
||
cacheReadInputTokens: rollup.cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: rollupCostReported ? rollupCost : calculateCost(sessionModel, rollup.inputTokens, rollup.outputTokens, rollup.cacheWriteTokens, rollup.cacheReadTokens, 0),
|
||
costIsEstimated: !rollupCostReported,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: isoTimestamp(meta["ended_at"], startedAt),
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: `${sessionId}:rollup`,
|
||
userMessage,
|
||
sessionId,
|
||
project,
|
||
projectPath: workspace,
|
||
workingDirectory: nonEmptyString2(meta["cwd"])
|
||
};
|
||
}
|
||
};
|
||
}
|
||
function createClineCliProvider(overrideDir) {
|
||
const sessionsDir = () => overrideDir ?? getClineCliSessionsDir();
|
||
return {
|
||
name: PROVIDER_NAME,
|
||
displayName: DISPLAY_NAME,
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return mapToolName(rawTool);
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: sessionsDir(), label: "Cline CLI sessions" }];
|
||
},
|
||
async discoverSessions() {
|
||
const dir = sessionsDir();
|
||
const entries = await readdir3(dir, { withFileTypes: true }).catch(() => []);
|
||
const sources = [];
|
||
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
||
if (!entry.isDirectory()) continue;
|
||
const sessionId = entry.name;
|
||
const metaPath = join5(dir, sessionId, `${sessionId}.json`);
|
||
const meta = await readJson(metaPath);
|
||
if (!isRecord2(meta)) continue;
|
||
const workspace = nonEmptyString2(meta["workspace_root"]) ?? nonEmptyString2(meta["cwd"]);
|
||
sources.push({
|
||
path: join5(dir, sessionId, `${sessionId}.messages.json`),
|
||
project: projectName(workspace),
|
||
provider: PROVIDER_NAME
|
||
});
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser2(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var PROVIDER_NAME, DISPLAY_NAME, MIN_REASONABLE_TIMESTAMP_MS, toolNameMap, clineCli;
|
||
var init_cline_cli = __esm({
|
||
"src/providers/cline-cli.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_fs_utils();
|
||
init_models();
|
||
PROVIDER_NAME = "cline-cli";
|
||
DISPLAY_NAME = "Cline CLI";
|
||
MIN_REASONABLE_TIMESTAMP_MS = 1e12;
|
||
toolNameMap = {
|
||
run_commands: "Bash",
|
||
read_files: "Read",
|
||
editor: "Edit",
|
||
apply_patch: "Edit",
|
||
search_codebase: "Grep",
|
||
fetch_web_content: "WebFetch",
|
||
skills: "Skill",
|
||
spawn_agent: "Agent",
|
||
team_spawn_teammate: "Agent",
|
||
team_run_task: "Agent",
|
||
ask_question: "AskUser"
|
||
};
|
||
clineCli = createClineCliProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/codewhale.ts
|
||
import { open, readdir as readdir4, stat as stat4 } from "fs/promises";
|
||
import { homedir as homedir7 } from "os";
|
||
import { join as join6 } from "path";
|
||
function isRecord3(value) {
|
||
return value !== null && typeof value === "object" && !Array.isArray(value);
|
||
}
|
||
function nonEmptyString3(value) {
|
||
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
||
}
|
||
function safeNonNegativeNumber2(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
||
}
|
||
function safeTokenCount2(value) {
|
||
return Math.floor(Math.min(safeNonNegativeNumber2(value), Number.MAX_SAFE_INTEGER));
|
||
}
|
||
function parseMetadata(value) {
|
||
if (!isRecord3(value)) return null;
|
||
const id = nonEmptyString3(value["id"]);
|
||
if (!id) return null;
|
||
return {
|
||
id,
|
||
created_at: nonEmptyString3(value["created_at"]),
|
||
updated_at: nonEmptyString3(value["updated_at"]),
|
||
total_tokens: safeTokenCount2(value["total_tokens"]),
|
||
model: nonEmptyString3(value["model"]),
|
||
model_provider: nonEmptyString3(value["model_provider"]),
|
||
workspace: nonEmptyString3(value["workspace"]),
|
||
cost: isRecord3(value["cost"]) ? value["cost"] : void 0
|
||
};
|
||
}
|
||
function findStringEnd(source, start) {
|
||
for (let i = start + 1; i < source.length; i++) {
|
||
if (source.charCodeAt(i) === 92) {
|
||
i++;
|
||
} else if (source.charCodeAt(i) === 34) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
function findObjectEnd(source, start) {
|
||
let depth = 0;
|
||
let inString = false;
|
||
for (let i = start; i < source.length; i++) {
|
||
const ch = source.charCodeAt(i);
|
||
if (inString) {
|
||
if (ch === 92) i++;
|
||
else if (ch === 34) inString = false;
|
||
continue;
|
||
}
|
||
if (ch === 34) inString = true;
|
||
else if (ch === 123) depth++;
|
||
else if (ch === 125 && --depth === 0) return i;
|
||
}
|
||
return -1;
|
||
}
|
||
function extractTopLevelMetadata(source) {
|
||
let depth = 0;
|
||
for (let i = 0; i < source.length; i++) {
|
||
const ch = source.charCodeAt(i);
|
||
if (ch === 123) {
|
||
depth++;
|
||
continue;
|
||
}
|
||
if (ch === 125) {
|
||
depth--;
|
||
continue;
|
||
}
|
||
if (ch !== 34) continue;
|
||
const end = findStringEnd(source, i);
|
||
if (end === -1) return null;
|
||
if (depth !== 1) {
|
||
i = end;
|
||
continue;
|
||
}
|
||
let key;
|
||
try {
|
||
key = JSON.parse(source.slice(i, end + 1));
|
||
} catch {
|
||
return null;
|
||
}
|
||
i = end;
|
||
if (key !== "metadata") continue;
|
||
let cursor = end + 1;
|
||
while (cursor < source.length && /\s/.test(source[cursor])) cursor++;
|
||
if (source[cursor] !== ":") continue;
|
||
cursor++;
|
||
while (cursor < source.length && /\s/.test(source[cursor])) cursor++;
|
||
if (source[cursor] !== "{") return null;
|
||
const objectEnd = findObjectEnd(source, cursor);
|
||
if (objectEnd === -1) return null;
|
||
try {
|
||
return parseMetadata(JSON.parse(source.slice(cursor, objectEnd + 1)));
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
async function readSessionMetadata(filePath) {
|
||
const handle = await open(filePath, "r").catch(() => null);
|
||
if (!handle) return null;
|
||
try {
|
||
try {
|
||
const prefix = Buffer.alloc(METADATA_PREFIX_BYTES);
|
||
const { bytesRead } = await handle.read(prefix, 0, prefix.length, 0);
|
||
const metadata = extractTopLevelMetadata(prefix.subarray(0, bytesRead).toString("utf-8"));
|
||
if (metadata) return metadata;
|
||
} catch {
|
||
return null;
|
||
}
|
||
} finally {
|
||
await handle.close().catch(() => {
|
||
});
|
||
}
|
||
const raw = await readSessionFile(filePath);
|
||
if (raw === null) return null;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
return parseMetadata(parsed.metadata);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function defaultSessionDirs() {
|
||
const configuredHome = process.env["CODEWHALE_HOME"]?.trim();
|
||
if (configuredHome) return [join6(configuredHome, "sessions")];
|
||
return [
|
||
join6(homedir7(), ".codewhale", "sessions"),
|
||
join6(homedir7(), ".deepseek", "sessions")
|
||
];
|
||
}
|
||
function projectName2(workspace) {
|
||
if (!workspace) return "CodeWhale";
|
||
const parts = workspace.replace(/[\\/]+$/, "").split(/[\\/]/).filter(Boolean);
|
||
return parts.at(-1) ?? "CodeWhale";
|
||
}
|
||
async function discoverInDir(dir) {
|
||
const entries = await readdir4(dir, { withFileTypes: true }).catch(() => []);
|
||
const results = [];
|
||
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
||
if (!entry.isFile() || !entry.name.endsWith(".json")) continue;
|
||
const path = join6(dir, entry.name);
|
||
const metadata = await readSessionMetadata(path);
|
||
if (!metadata) continue;
|
||
results.push({
|
||
id: metadata.id,
|
||
source: {
|
||
path,
|
||
project: projectName2(metadata.workspace),
|
||
provider: "codewhale"
|
||
}
|
||
});
|
||
}
|
||
return results;
|
||
}
|
||
function normalizeTimestamp(value) {
|
||
if (!value) return "";
|
||
const timestamp2 = Date.parse(value);
|
||
return Number.isFinite(timestamp2) ? new Date(timestamp2).toISOString() : "";
|
||
}
|
||
function firstUserMessage2(messages) {
|
||
for (const message of messages) {
|
||
if (message.role !== "user") continue;
|
||
const text2 = typeof message.content === "string" ? message.content : Array.isArray(message.content) ? message.content.filter((block) => block?.type === "text" && typeof block.text === "string").map((block) => block.text).join(" ") : "";
|
||
if (text2.trim()) return Array.from(text2.trim()).slice(0, 500).join("");
|
||
}
|
||
return "";
|
||
}
|
||
function mapToolName2(rawName) {
|
||
if (rawName.startsWith("mcp__")) return rawName;
|
||
if (rawName.startsWith("agents/")) return "Agent";
|
||
return Object.prototype.hasOwnProperty.call(toolNameMap2, rawName) ? toolNameMap2[rawName] : rawName;
|
||
}
|
||
function toolInput(value) {
|
||
return isRecord3(value) ? value : {};
|
||
}
|
||
function firstString2(input, keys) {
|
||
for (const key of keys) {
|
||
const value = nonEmptyString3(input[key]);
|
||
if (value) return value;
|
||
}
|
||
return void 0;
|
||
}
|
||
function collectTools2(messages) {
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
const toolSequence = [];
|
||
const skills = [];
|
||
const subagentTypes = [];
|
||
let webSearchRequests = 0;
|
||
for (const message of messages) {
|
||
if (message.role !== "assistant" || !Array.isArray(message.content)) continue;
|
||
const turnTools = [];
|
||
for (const block of message.content) {
|
||
if (block?.type !== "tool_use" && block?.type !== "server_tool_use") continue;
|
||
const rawName = nonEmptyString3(block.name);
|
||
if (!rawName) continue;
|
||
const mapped = mapToolName2(rawName);
|
||
const input = toolInput(block.input);
|
||
const toolCall = { tool: mapped };
|
||
const file = firstString2(input, ["file_path", "path", "target_file", "file"]);
|
||
if (file) toolCall.file = file;
|
||
const command = firstString2(input, ["command", "cmd"]);
|
||
if (command) toolCall.command = command;
|
||
if (mapped === "Bash" && command) {
|
||
bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
if (mapped === "Skill") {
|
||
const skill = firstString2(input, ["name", "skill", "skill_name"]);
|
||
if (skill) skills.push(skill);
|
||
}
|
||
if (mapped === "Agent") {
|
||
const subagentType = firstString2(input, ["type", "agent_type", "profile"]);
|
||
if (subagentType) subagentTypes.push(subagentType);
|
||
}
|
||
if (mapped === "WebSearch") webSearchRequests++;
|
||
tools.push(mapped);
|
||
turnTools.push(toolCall);
|
||
}
|
||
if (turnTools.length > 0) toolSequence.push(turnTools);
|
||
}
|
||
return { tools, bashCommands, toolSequence, skills, subagentTypes, webSearchRequests };
|
||
}
|
||
function reportedCost(cost) {
|
||
if (!cost || typeof cost !== "object") return { value: 0, exact: false };
|
||
const hasSessionCost = Object.prototype.hasOwnProperty.call(cost, "session_cost_usd");
|
||
const hasSubagentCost = Object.prototype.hasOwnProperty.call(cost, "subagent_cost_usd");
|
||
if (!hasSessionCost && !hasSubagentCost) return { value: 0, exact: false };
|
||
return {
|
||
value: safeNonNegativeNumber2(cost.session_cost_usd) + safeNonNegativeNumber2(cost.subagent_cost_usd),
|
||
exact: true
|
||
};
|
||
}
|
||
function createParser3(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
let metadata = null;
|
||
let messages = [];
|
||
if (raw !== null) {
|
||
try {
|
||
const saved = JSON.parse(raw);
|
||
metadata = parseMetadata(saved.metadata);
|
||
messages = Array.isArray(saved.messages) ? saved.messages.filter(isRecord3) : [];
|
||
} catch {
|
||
}
|
||
}
|
||
metadata ??= await readSessionMetadata(source.path);
|
||
if (!metadata) return;
|
||
const totalTokens = safeTokenCount2(metadata.total_tokens);
|
||
const model = metadata.model ?? metadata.model_provider ?? "unknown";
|
||
const localCost = reportedCost(metadata.cost);
|
||
const costUSD = localCost.exact ? localCost.value : calculateCost(model, totalTokens, 0, 0, 0, 0);
|
||
if (totalTokens === 0 && costUSD === 0) return;
|
||
const deduplicationKey = `codewhale:${metadata.id}`;
|
||
if (seenKeys.has(deduplicationKey)) return;
|
||
seenKeys.add(deduplicationKey);
|
||
let timestamp2 = normalizeTimestamp(metadata.updated_at) || normalizeTimestamp(metadata.created_at);
|
||
if (!timestamp2) {
|
||
const fileStat = await stat4(source.path).catch(() => null);
|
||
timestamp2 = fileStat?.mtime.toISOString() ?? "";
|
||
}
|
||
const { tools, bashCommands, toolSequence, skills, subagentTypes, webSearchRequests } = collectTools2(messages);
|
||
const workspace = metadata.workspace;
|
||
yield {
|
||
provider: "codewhale",
|
||
model,
|
||
// CodeWhale persists only one aggregate token counter. Preserve it
|
||
// losslessly in the input column instead of inventing a split.
|
||
inputTokens: totalTokens,
|
||
outputTokens: 0,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests,
|
||
costUSD,
|
||
costIsEstimated: !localCost.exact,
|
||
tools,
|
||
bashCommands,
|
||
skills,
|
||
subagentTypes,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: `${metadata.id}:session`,
|
||
toolSequence: toolSequence.length > 0 ? toolSequence : void 0,
|
||
userMessage: firstUserMessage2(messages),
|
||
sessionId: metadata.id,
|
||
project: projectName2(workspace),
|
||
projectPath: workspace
|
||
};
|
||
}
|
||
};
|
||
}
|
||
function createCodeWhaleProvider(overrideDirs) {
|
||
const configuredDirs = overrideDirs === void 0 ? void 0 : Array.isArray(overrideDirs) ? overrideDirs : [overrideDirs];
|
||
return {
|
||
name: "codewhale",
|
||
displayName: "CodeWhale",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return mapToolName2(rawTool);
|
||
},
|
||
async probeRoots() {
|
||
return (configuredDirs ?? defaultSessionDirs()).map((path) => ({ path, label: "sessions" }));
|
||
},
|
||
async discoverSessions() {
|
||
const seenSessionIds = /* @__PURE__ */ new Set();
|
||
const sources = [];
|
||
for (const dir of configuredDirs ?? defaultSessionDirs()) {
|
||
for (const candidate of await discoverInDir(dir)) {
|
||
if (seenSessionIds.has(candidate.id)) continue;
|
||
seenSessionIds.add(candidate.id);
|
||
sources.push(candidate.source);
|
||
}
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser3(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var METADATA_PREFIX_BYTES, toolNameMap2, codewhale;
|
||
var init_codewhale = __esm({
|
||
"src/providers/codewhale.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_fs_utils();
|
||
init_models();
|
||
METADATA_PREFIX_BYTES = 64 * 1024;
|
||
toolNameMap2 = {
|
||
exec_shell: "Bash",
|
||
exec_shell_wait: "Bash",
|
||
exec_shell_interact: "Bash",
|
||
exec_shell_cancel: "Bash",
|
||
task_shell_start: "Bash",
|
||
task_shell_wait: "Bash",
|
||
terminal_run: "Bash",
|
||
terminal_send: "Bash",
|
||
terminal_wait: "Bash",
|
||
terminal_cancel: "Bash",
|
||
read_file: "Read",
|
||
write_file: "Write",
|
||
edit_file: "Edit",
|
||
fim_edit: "Edit",
|
||
apply_patch: "Edit",
|
||
list_dir: "Glob",
|
||
grep_files: "Grep",
|
||
web_search: "WebSearch",
|
||
fetch_url: "WebFetch",
|
||
"web.run": "WebSearch",
|
||
agent: "Agent",
|
||
"agents/list": "Agent",
|
||
"agents/message": "Agent",
|
||
"agents/followup": "Agent",
|
||
"agents/interrupt": "Agent",
|
||
"agents/wait": "Agent",
|
||
todo_write: "TodoWrite",
|
||
todo_add: "TodoWrite",
|
||
todo_update: "TodoWrite",
|
||
todo_list: "TodoWrite",
|
||
checklist_write: "TodoWrite",
|
||
checklist_add: "TodoWrite",
|
||
checklist_update: "TodoWrite",
|
||
checklist_list: "TodoWrite",
|
||
update_plan: "TodoWrite",
|
||
load_skill: "Skill",
|
||
request_user_input: "AskUser"
|
||
};
|
||
codewhale = createCodeWhaleProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/command-code.ts
|
||
import { readdir as readdir5 } from "fs/promises";
|
||
import { homedir as homedir8 } from "os";
|
||
import { basename as basename5, join as join7 } from "path";
|
||
function getCommandCodeProjectsDir() {
|
||
return join7(process.env["CODEBURN_COMMANDCODE_DIR"] || join7(homedir8(), ".commandcode"), "projects");
|
||
}
|
||
function tokens(n) {
|
||
return typeof n === "number" && Number.isFinite(n) && n > 0 ? n : 0;
|
||
}
|
||
function str(v) {
|
||
return typeof v === "string" && v ? v : void 0;
|
||
}
|
||
function userText(content2) {
|
||
if (typeof content2 === "string") return content2;
|
||
if (!Array.isArray(content2)) return "";
|
||
return content2.find((b) => b.type === "text" && typeof b.text === "string")?.text ?? "";
|
||
}
|
||
function createParser4(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
if (raw === null) return;
|
||
let sessionId = basename5(source.path, ".jsonl");
|
||
let cwd;
|
||
let userMessage = "";
|
||
for (const text2 of raw.split("\n")) {
|
||
if (!text2.trim()) continue;
|
||
let line;
|
||
try {
|
||
line = JSON.parse(text2);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (line.type === "session") {
|
||
sessionId = str(line.id) ?? sessionId;
|
||
cwd = str(line.cwd) ?? cwd;
|
||
continue;
|
||
}
|
||
if (line.type !== "message" || !line.message) continue;
|
||
if (line.message.role === "user") {
|
||
const prompt = userText(line.message.content);
|
||
if (prompt) userMessage = prompt;
|
||
continue;
|
||
}
|
||
if (line.message.role !== "assistant" || !line.usage) continue;
|
||
const id = str(line.id);
|
||
const timestamp2 = str(line.timestamp);
|
||
if (!id || !timestamp2) continue;
|
||
const deduplicationKey = `command-code:${str(line.message.meta?.messageId) ?? id}`;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
const u = line.usage;
|
||
const cacheRead = tokens(u.cacheReadTokens);
|
||
const cacheWrite = tokens(u.cacheWriteTokens);
|
||
const input = Math.max(0, tokens(u.inputTokens) - cacheRead);
|
||
const output = tokens(u.outputTokens);
|
||
const model = str(line.model) ?? "unknown";
|
||
const reported = typeof u.costUsd === "number" && Number.isFinite(u.costUsd) && u.costUsd >= 0;
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
const skills = [];
|
||
const subagentTypes = [];
|
||
const turn = [];
|
||
let webSearchRequests = 0;
|
||
for (const block of Array.isArray(line.message.content) ? line.message.content : []) {
|
||
if (block.type !== "tool_use" || !str(block.name)) continue;
|
||
const tool = toolNameMap3[block.name] ?? block.name;
|
||
const args = block.input ?? {};
|
||
const call = { tool };
|
||
const file = str(args["file_path"]) ?? str(args["path"]);
|
||
if (file) call.file = file;
|
||
const command = str(args["command"]);
|
||
if (command) {
|
||
call.command = command;
|
||
if (tool === "Bash") bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
if (block.name === "activate_skill") {
|
||
const skill = str(args["name"]) ?? str(args["skill"]);
|
||
if (skill) skills.push(skill);
|
||
}
|
||
const subagentType = block.name === "agent" ? str(args["subagent_type"]) : void 0;
|
||
if (subagentType) subagentTypes.push(subagentType);
|
||
if (tool === "WebSearch") webSearchRequests++;
|
||
tools.push(tool);
|
||
turn.push(call);
|
||
}
|
||
yield {
|
||
provider: "command-code",
|
||
model,
|
||
inputTokens: input,
|
||
outputTokens: output,
|
||
cacheCreationInputTokens: cacheWrite,
|
||
cacheReadInputTokens: cacheRead,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests,
|
||
costUSD: reported ? u.costUsd : calculateCost(model, input, output, cacheWrite, cacheRead, 0),
|
||
...reported ? { costFromBilling: true } : { costIsEstimated: true },
|
||
tools,
|
||
bashCommands,
|
||
skills,
|
||
subagentTypes,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: `${sessionId}:${id}`,
|
||
...turn.length > 0 ? { toolSequence: [turn] } : {},
|
||
userMessage,
|
||
sessionId,
|
||
project: cwd ? cwd.split(/[\\/]/).filter(Boolean).at(-1) ?? source.project : source.project,
|
||
...cwd ? { projectPath: cwd, workingDirectory: cwd } : {}
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createCommandCodeProvider(projectsDir) {
|
||
const dir = projectsDir ?? getCommandCodeProjectsDir();
|
||
return {
|
||
name: "command-code",
|
||
displayName: "Command Code",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap3[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: dir, label: "projects" }];
|
||
},
|
||
async discoverSessions() {
|
||
const sources = [];
|
||
const projects = await readdir5(dir, { withFileTypes: true }).catch(() => []);
|
||
for (const project of projects) {
|
||
if (!project.isDirectory()) continue;
|
||
const files = await readdir5(join7(dir, project.name), { withFileTypes: true }).catch(() => []);
|
||
for (const file of files) {
|
||
if (!file.isFile() || !/^[^.]+\.jsonl$/.test(file.name)) continue;
|
||
sources.push({ path: join7(dir, project.name, file.name), project: project.name, provider: "command-code" });
|
||
}
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser4(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap3, commandCode;
|
||
var init_command_code = __esm({
|
||
"src/providers/command-code.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_fs_utils();
|
||
init_models();
|
||
toolNameMap3 = {
|
||
shell_command: "Bash",
|
||
run_command: "Bash",
|
||
monitor_command: "Bash",
|
||
kill_shell: "Bash",
|
||
shell_output: "Bash",
|
||
shell_tasks: "Bash",
|
||
read_file: "Read",
|
||
write_file: "Write",
|
||
edit_file: "Edit",
|
||
read_directory: "Glob",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
web_search: "WebSearch",
|
||
web_fetch: "WebFetch",
|
||
todo_write: "TodoWrite",
|
||
activate_skill: "Skill",
|
||
agent: "Agent",
|
||
agent_output: "Agent",
|
||
ask_user_question: "AskUserQuestion"
|
||
};
|
||
commandCode = createCommandCodeProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/codebuff.ts
|
||
import { readdir as readdir6, readFile as readFile4, stat as stat5 } from "fs/promises";
|
||
import { basename as basename6, dirname, join as join8 } from "path";
|
||
import { homedir as homedir9 } from "os";
|
||
function getCodebuffRootSet(override) {
|
||
if (override && override.trim()) return [override];
|
||
const envPath = process.env["CODEBUFF_DATA_DIR"];
|
||
if (envPath && envPath.trim()) return [envPath];
|
||
const configDir = join8(homedir9(), ".config");
|
||
return CHANNELS.map((channel) => join8(configDir, channel));
|
||
}
|
||
function pickNumber(...vals) {
|
||
for (const v of vals) {
|
||
if (typeof v === "number" && Number.isFinite(v)) return v;
|
||
}
|
||
return void 0;
|
||
}
|
||
function normalizeUsage(u) {
|
||
if (!u) return { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
||
return {
|
||
input: pickNumber(u.inputTokens, u.input_tokens, u.promptTokens, u.prompt_tokens) ?? 0,
|
||
output: pickNumber(u.outputTokens, u.output_tokens, u.completionTokens, u.completion_tokens) ?? 0,
|
||
cacheRead: pickNumber(
|
||
u.cacheReadInputTokens,
|
||
u.cache_read_input_tokens,
|
||
u.promptTokensDetails?.cachedTokens,
|
||
u.prompt_tokens_details?.cached_tokens
|
||
) ?? 0,
|
||
cacheWrite: pickNumber(u.cacheCreationInputTokens, u.cache_creation_input_tokens) ?? 0
|
||
};
|
||
}
|
||
function coerceTimestamp(value) {
|
||
if (value == null) return "";
|
||
if (typeof value === "number") {
|
||
return Number.isFinite(value) ? new Date(value).toISOString() : "";
|
||
}
|
||
const parsed = Date.parse(value);
|
||
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : value;
|
||
}
|
||
function parseChatIdToIso(chatId) {
|
||
const iso = chatId.replace(/(\d{4}-\d{2}-\d{2}T\d{2})-(\d{2})-(\d{2})/, "$1:$2:$3");
|
||
const parsed = Date.parse(iso);
|
||
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : "";
|
||
}
|
||
function extractCwd(meta) {
|
||
const rs = meta?.runState;
|
||
if (!rs) return null;
|
||
return rs.sessionState?.projectContext?.cwd ?? rs.sessionState?.fileContext?.cwd ?? rs.sessionState?.cwd ?? rs.cwd ?? null;
|
||
}
|
||
function extractAgentType(meta) {
|
||
return meta?.runState?.sessionState?.mainAgentState?.agentType ?? null;
|
||
}
|
||
function collectBlockTools(blocks, acc) {
|
||
if (!Array.isArray(blocks)) return;
|
||
for (const block of blocks) {
|
||
if (!block || typeof block !== "object") continue;
|
||
if (block.type === "tool" && typeof block.toolName === "string") {
|
||
const raw = block.toolName;
|
||
if (!IGNORED_TOOLS.has(raw)) {
|
||
acc.tools.push(toolNameMap4[raw] ?? raw);
|
||
}
|
||
if ((raw === "run_terminal_command" || raw === "terminal") && block.input) {
|
||
const cmd = block.input["command"];
|
||
if (typeof cmd === "string") {
|
||
acc.bash.push(...extractBashCommands(cmd));
|
||
}
|
||
}
|
||
}
|
||
if (block.type === "agent" && Array.isArray(block.blocks)) {
|
||
collectBlockTools(block.blocks, acc);
|
||
}
|
||
}
|
||
}
|
||
function resolveModel(meta, stashedModel) {
|
||
const direct = meta?.model ?? meta?.modelId ?? meta?.codebuff?.model;
|
||
if (direct) return direct;
|
||
if (stashedModel) return stashedModel;
|
||
const agentType = extractAgentType(meta);
|
||
if (agentType) return `codebuff-${agentType}`;
|
||
return "codebuff";
|
||
}
|
||
function usageFromHistory(meta) {
|
||
const hist = meta?.runState?.sessionState?.mainAgentState?.messageHistory;
|
||
if (!Array.isArray(hist)) return { model: null, input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
||
for (let i = hist.length - 1; i >= 0; i--) {
|
||
const entry = hist[i];
|
||
if (!entry || entry.role !== "assistant" || !entry.providerOptions) continue;
|
||
const u = normalizeUsage(entry.providerOptions.usage ?? entry.providerOptions.codebuff?.usage);
|
||
if (u.input > 0 || u.output > 0 || u.cacheRead > 0 || u.cacheWrite > 0) {
|
||
return { model: entry.providerOptions.codebuff?.model ?? null, ...u };
|
||
}
|
||
}
|
||
return { model: null, input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
|
||
}
|
||
async function readJson2(filePath) {
|
||
try {
|
||
const raw = await readFile4(filePath, "utf-8");
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function discoverChannel(root) {
|
||
const sources = [];
|
||
const projectsDir = join8(root, "projects");
|
||
let projectNames;
|
||
try {
|
||
projectNames = await readdir6(projectsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const projectName3 of projectNames) {
|
||
const chatsDir = join8(projectsDir, projectName3, "chats");
|
||
let chatIds;
|
||
try {
|
||
chatIds = await readdir6(chatsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const chatId of chatIds) {
|
||
const chatDir = join8(chatsDir, chatId);
|
||
const dirStat = await stat5(chatDir).catch(() => null);
|
||
if (!dirStat?.isDirectory()) continue;
|
||
const messagesPath = join8(chatDir, "chat-messages.json");
|
||
const messagesStat = await stat5(messagesPath).catch(() => null);
|
||
if (!messagesStat?.isFile()) continue;
|
||
const runState = await readJson2(
|
||
join8(chatDir, "run-state.json")
|
||
);
|
||
const cwd = extractCwd({ runState: runState ?? void 0 });
|
||
const project = cwd ? basename6(cwd) : projectName3;
|
||
sources.push({ path: chatDir, project, provider: "codebuff" });
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverSessionsInRoots(roots) {
|
||
const results = [];
|
||
for (const root of roots) {
|
||
results.push(...await discoverChannel(root));
|
||
}
|
||
return results;
|
||
}
|
||
function extractChannelFromChatDir(chatDir) {
|
||
const chatsDir = dirname(chatDir);
|
||
if (basename6(chatsDir) !== "chats") return null;
|
||
const projectDir = dirname(chatsDir);
|
||
const projectsDir = dirname(projectDir);
|
||
if (basename6(projectsDir) !== "projects") return null;
|
||
const channel = basename6(dirname(projectsDir));
|
||
return channel ? channel : null;
|
||
}
|
||
function createParser5(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const chatDir = source.path;
|
||
const chatId = basename6(chatDir);
|
||
const channel = extractChannelFromChatDir(chatDir);
|
||
const sessionId = channel ? `${channel}/${chatId}` : chatId;
|
||
const fallbackTs = parseChatIdToIso(chatId);
|
||
const messages = await readJson2(
|
||
join8(chatDir, "chat-messages.json")
|
||
);
|
||
if (!Array.isArray(messages)) return;
|
||
let pendingUserMessage = "";
|
||
for (const [idx, msg] of messages.entries()) {
|
||
if (!msg || typeof msg !== "object") continue;
|
||
const variant = msg.variant ?? msg.role;
|
||
if (variant === "user") {
|
||
if (typeof msg.content === "string" && msg.content.length > 0) {
|
||
pendingUserMessage = msg.content;
|
||
}
|
||
continue;
|
||
}
|
||
if (variant !== "ai" && variant !== "agent" && variant !== "assistant") continue;
|
||
const credits = typeof msg.credits === "number" && Number.isFinite(msg.credits) ? msg.credits : 0;
|
||
const directUsage = normalizeUsage(msg.metadata?.usage ?? msg.metadata?.codebuff?.usage);
|
||
const stashedUsage = usageFromHistory(msg.metadata);
|
||
const hasDirect = directUsage.input > 0 || directUsage.output > 0 || directUsage.cacheRead > 0 || directUsage.cacheWrite > 0;
|
||
const usage = hasDirect ? directUsage : stashedUsage;
|
||
const stashedModel = stashedUsage.model;
|
||
if (credits === 0 && usage.input === 0 && usage.output === 0 && usage.cacheRead === 0 && usage.cacheWrite === 0) {
|
||
continue;
|
||
}
|
||
const model = resolveModel(msg.metadata, stashedModel);
|
||
const timestamp2 = coerceTimestamp(msg.timestamp ?? msg.metadata?.timestamp) || fallbackTs;
|
||
const dedupId = msg.id ?? String(idx);
|
||
const dedupKey = `codebuff:${chatDir}:${dedupId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const acc = { tools: [], bash: [] };
|
||
collectBlockTools(msg.blocks, acc);
|
||
let costUSD = calculateCost(model, usage.input, usage.output, usage.cacheWrite, usage.cacheRead, 0);
|
||
if (costUSD === 0 && credits > 0) {
|
||
costUSD = credits * USD_PER_CREDIT;
|
||
}
|
||
yield {
|
||
provider: "codebuff",
|
||
model,
|
||
inputTokens: usage.input,
|
||
outputTokens: usage.output,
|
||
cacheCreationInputTokens: usage.cacheWrite,
|
||
cacheReadInputTokens: usage.cacheRead,
|
||
cachedInputTokens: usage.cacheRead,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: acc.tools,
|
||
bashCommands: acc.bash,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId
|
||
};
|
||
pendingUserMessage = "";
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createCodebuffProvider(baseDir) {
|
||
const roots = getCodebuffRootSet(baseDir);
|
||
return {
|
||
name: "codebuff",
|
||
displayName: "Codebuff",
|
||
modelDisplayName(model) {
|
||
return modelDisplayNames[model] ?? model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap4[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return roots.map((path) => ({ path, label: "chats" }));
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessionsInRoots(roots);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser5(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var USD_PER_CREDIT, CHANNELS, modelDisplayNames, toolNameMap4, IGNORED_TOOLS, codebuff;
|
||
var init_codebuff = __esm({
|
||
"src/providers/codebuff.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_bash_utils();
|
||
USD_PER_CREDIT = 0.01;
|
||
CHANNELS = ["manicode", "manicode-dev", "manicode-staging"];
|
||
modelDisplayNames = {
|
||
codebuff: "Codebuff",
|
||
"codebuff-base": "Codebuff Base",
|
||
"codebuff-base2": "Codebuff Base 2",
|
||
"codebuff-lite": "Codebuff Lite",
|
||
"codebuff-max": "Codebuff Max"
|
||
};
|
||
toolNameMap4 = {
|
||
read_files: "Read",
|
||
read_file: "Read",
|
||
code_search: "Grep",
|
||
glob: "Glob",
|
||
find_files: "Glob",
|
||
str_replace: "Edit",
|
||
edit_file: "Edit",
|
||
write_file: "Write",
|
||
run_terminal_command: "Bash",
|
||
terminal: "Bash",
|
||
spawn_agents: "Agent",
|
||
spawn_agent: "Agent",
|
||
write_todos: "TodoWrite",
|
||
create_plan: "TodoWrite",
|
||
browser_logs: "WebFetch",
|
||
web_search: "WebSearch",
|
||
fetch_url: "WebFetch"
|
||
};
|
||
IGNORED_TOOLS = /* @__PURE__ */ new Set(["suggest_followups", "end_turn"]);
|
||
codebuff = createCodebuffProvider();
|
||
}
|
||
});
|
||
|
||
// src/codex-cache.ts
|
||
import { readFile as readFile5, mkdir, stat as stat6, open as open2, rename, unlink } from "fs/promises";
|
||
import { randomBytes } from "crypto";
|
||
import { join as join9, resolve } from "path";
|
||
import { AsyncLocalStorage } from "async_hooks";
|
||
function codexCacheFileName(version = CODEX_CACHE_VERSION) {
|
||
return `codex-results.v${version}.json`;
|
||
}
|
||
function codexProjectsFileName(version = CODEX_CACHE_VERSION) {
|
||
return `codex-projects.v${version}.json`;
|
||
}
|
||
function currentCacheDir() {
|
||
return cacheDirContext.getStore() ?? resolve(getCodeburnCacheDir());
|
||
}
|
||
function getCachePath(cacheDir) {
|
||
return join9(cacheDir, codexCacheFileName());
|
||
}
|
||
function getLegacyCachePath(cacheDir) {
|
||
return join9(cacheDir, CODEX_LEGACY_CACHE_FILE);
|
||
}
|
||
function isCurrentCache(cache) {
|
||
return cache.version === CODEX_CACHE_VERSION && !!cache.files && typeof cache.files === "object";
|
||
}
|
||
function loadProjectIndex(cacheDir) {
|
||
let index = projectIndexes.get(cacheDir);
|
||
if (!index) {
|
||
index = readProjectIndex(cacheDir);
|
||
projectIndexes.set(cacheDir, index);
|
||
}
|
||
return index;
|
||
}
|
||
async function readProjectIndex(cacheDir) {
|
||
try {
|
||
const parsed = JSON.parse(await readFile5(join9(cacheDir, codexProjectsFileName()), "utf-8"));
|
||
if (parsed.version === CODEX_CACHE_VERSION && parsed.files && typeof parsed.files === "object") return parsed.files;
|
||
} catch {
|
||
}
|
||
const cache = await loadCache(cacheDir);
|
||
if (Object.keys(cache.files).length > 0) await writeProjectIndex(cacheDir, cache);
|
||
return cache.files;
|
||
}
|
||
async function writeProjectIndex(cacheDir, cache) {
|
||
const files = {};
|
||
for (const [path, e] of Object.entries(cache.files)) {
|
||
files[path] = { dev: e.dev, ino: e.ino, mtimeMs: e.mtimeMs, sizeBytes: e.sizeBytes, project: e.project };
|
||
}
|
||
try {
|
||
await writeFileAtomic(join9(cacheDir, codexProjectsFileName()), JSON.stringify({ version: CODEX_CACHE_VERSION, files }));
|
||
} catch {
|
||
}
|
||
}
|
||
async function writeFileAtomic(finalPath, payload) {
|
||
const tempPath = `${finalPath}.${randomBytes(8).toString("hex")}.tmp`;
|
||
const handle = await open2(tempPath, "w", 384);
|
||
try {
|
||
await handle.writeFile(payload, { encoding: "utf-8" });
|
||
await handle.sync();
|
||
} finally {
|
||
await handle.close();
|
||
}
|
||
try {
|
||
await rename(tempPath, finalPath);
|
||
} catch (err) {
|
||
try {
|
||
await unlink(tempPath);
|
||
} catch {
|
||
}
|
||
throw err;
|
||
}
|
||
}
|
||
function loadCache(cacheDir) {
|
||
const inMemory = memCaches.get(cacheDir);
|
||
if (inMemory) return Promise.resolve(inMemory);
|
||
const pending = inFlightLoads.get(cacheDir);
|
||
if (pending) return pending;
|
||
const load = loadCacheFromDisk(cacheDir).finally(() => inFlightLoads.delete(cacheDir));
|
||
inFlightLoads.set(cacheDir, load);
|
||
return load;
|
||
}
|
||
async function loadCacheFromDisk(cacheDir) {
|
||
const empty = { version: CODEX_CACHE_VERSION, files: {} };
|
||
const versioned = await readExistingTextFile(getCachePath(cacheDir));
|
||
if (versioned.status === "ok") {
|
||
try {
|
||
const cache = JSON.parse(versioned.text);
|
||
if (isCurrentCache(cache)) {
|
||
memCaches.set(cacheDir, cache);
|
||
return cache;
|
||
}
|
||
} catch {
|
||
}
|
||
memCaches.set(cacheDir, empty);
|
||
return empty;
|
||
}
|
||
if (versioned.status === "unreadable") {
|
||
memCaches.set(cacheDir, empty);
|
||
return empty;
|
||
}
|
||
try {
|
||
const raw = await readFile5(getLegacyCachePath(cacheDir), "utf-8");
|
||
const cache = JSON.parse(raw);
|
||
if (isCurrentCache(cache)) {
|
||
memCaches.set(cacheDir, cache);
|
||
return cache;
|
||
}
|
||
} catch {
|
||
}
|
||
memCaches.set(cacheDir, empty);
|
||
return empty;
|
||
}
|
||
function getEntry(files, filePath, fp) {
|
||
if (!Object.hasOwn(files, filePath)) return null;
|
||
const entry = files[filePath];
|
||
if (entry && entry.dev === fp.dev && entry.ino === fp.ino && entry.mtimeMs === fp.mtimeMs && entry.sizeBytes === fp.sizeBytes) {
|
||
return entry;
|
||
}
|
||
return null;
|
||
}
|
||
async function endsLineAt(filePath, offset) {
|
||
if (offset === 0) return true;
|
||
try {
|
||
const handle = await open2(filePath, "r");
|
||
try {
|
||
const buf = Buffer.alloc(1);
|
||
const { bytesRead } = await handle.read(buf, 0, 1, offset - 1);
|
||
return bytesRead === 1 && buf[0] === 10;
|
||
} finally {
|
||
await handle.close();
|
||
}
|
||
} catch {
|
||
return false;
|
||
}
|
||
}
|
||
function fingerprintFromStat(filePath, s) {
|
||
if (isWslUncPath(filePath)) return { dev: 0, ino: 0, mtimeMs: s.mtimeMs, sizeBytes: s.size };
|
||
return { dev: s.dev, ino: s.ino, mtimeMs: s.mtimeMs, sizeBytes: s.size };
|
||
}
|
||
async function readCachedCodexResults(filePath) {
|
||
try {
|
||
const s = await stat6(filePath);
|
||
const cache = await loadCache(currentCacheDir());
|
||
const fp = fingerprintFromStat(filePath, s);
|
||
const entry = getEntry(cache.files, filePath, fp);
|
||
if (entry) return { kind: "exact", calls: entry.calls };
|
||
const stale = cache.files[filePath];
|
||
if (stale && stale.dev === fp.dev && stale.ino === fp.ino && stale.resumeOffset !== void 0 && stale.resumeState !== void 0 && stale.resumeCallCount !== void 0 && fp.sizeBytes > stale.sizeBytes && stale.resumeOffset <= fp.sizeBytes && await endsLineAt(filePath, stale.resumeOffset)) {
|
||
return { kind: "resume", calls: stale.calls, offset: stale.resumeOffset, state: stale.resumeState, callCount: stale.resumeCallCount };
|
||
}
|
||
} catch {
|
||
}
|
||
return null;
|
||
}
|
||
async function getCachedCodexProject(filePath) {
|
||
try {
|
||
const s = await stat6(filePath);
|
||
const cacheDir = currentCacheDir();
|
||
const files = memCaches.get(cacheDir)?.files ?? await loadProjectIndex(cacheDir);
|
||
const entry = getEntry(files, filePath, fingerprintFromStat(filePath, s));
|
||
return entry?.project ?? null;
|
||
} catch {
|
||
}
|
||
return null;
|
||
}
|
||
async function fingerprintFile(filePath) {
|
||
try {
|
||
return fingerprintFromStat(filePath, await stat6(filePath));
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function writeCachedCodexResults(filePath, project, calls, fingerprint, resume) {
|
||
try {
|
||
const cache = await loadCache(currentCacheDir());
|
||
cache.files[filePath] = {
|
||
dev: fingerprint.dev,
|
||
ino: fingerprint.ino,
|
||
mtimeMs: fingerprint.mtimeMs,
|
||
sizeBytes: fingerprint.sizeBytes,
|
||
project,
|
||
calls,
|
||
...resume ? { resumeOffset: resume.offset, resumeState: resume.state, resumeCallCount: resume.callCount } : {}
|
||
};
|
||
} catch {
|
||
}
|
||
}
|
||
var CODEX_CACHE_VERSION, CODEX_LEGACY_CACHE_FILE, cacheDirContext, memCaches, projectIndexes, inFlightLoads;
|
||
var init_codex_cache = __esm({
|
||
"src/codex-cache.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_wsl();
|
||
CODEX_CACHE_VERSION = 22;
|
||
CODEX_LEGACY_CACHE_FILE = "codex-results.json";
|
||
cacheDirContext = new AsyncLocalStorage();
|
||
memCaches = /* @__PURE__ */ new Map();
|
||
projectIndexes = /* @__PURE__ */ new Map();
|
||
inFlightLoads = /* @__PURE__ */ new Map();
|
||
}
|
||
});
|
||
|
||
// src/launcher-homes.ts
|
||
import { closeSync, existsSync as existsSync2, openSync, readdirSync as readdirSync2, readSync, realpathSync } from "fs";
|
||
import { homedir as homedir10 } from "os";
|
||
import { join as join10, resolve as resolve2, sep } from "path";
|
||
function resolveHome(dir) {
|
||
try {
|
||
return realpathSync(dir);
|
||
} catch {
|
||
return resolve2(dir);
|
||
}
|
||
}
|
||
function sameCodexHome(a, b) {
|
||
return resolveHome(a) === resolveHome(b);
|
||
}
|
||
function isNestedLauncherCodexHome(dir, opts) {
|
||
const resolved = resolveHome(dir);
|
||
const primary = resolveHome(opts.primaryDir);
|
||
if (resolved === primary) return false;
|
||
const underLauncher = opts.launcherRoots.some((root) => {
|
||
const r = resolveHome(root);
|
||
return resolved === r || resolved.startsWith(r + sep);
|
||
});
|
||
if (!underLauncher) return false;
|
||
return existsSync2(primary);
|
||
}
|
||
function rolloutFileSessionId(filePath) {
|
||
try {
|
||
const fd = openSync(filePath, "r");
|
||
try {
|
||
const buf = Buffer.alloc(FIRST_LINE_READ_CAP);
|
||
const n = readSync(fd, buf, 0, buf.length, 0);
|
||
if (n === 0) return void 0;
|
||
const slice = buf.subarray(0, n);
|
||
const nl = slice.indexOf(10);
|
||
if (nl === -1 && n === FIRST_LINE_READ_CAP) return void 0;
|
||
const line = (nl === -1 ? slice : slice.subarray(0, nl)).toString("utf8");
|
||
if (!line) return void 0;
|
||
const parsed = JSON.parse(line);
|
||
if (!parsed || typeof parsed !== "object") return void 0;
|
||
const payload = parsed.payload;
|
||
const id = payload?.session_id;
|
||
return typeof id === "string" && id.length > 0 ? id : void 0;
|
||
} finally {
|
||
closeSync(fd);
|
||
}
|
||
} catch {
|
||
return void 0;
|
||
}
|
||
}
|
||
function walkRolloutFiles(codexDir, visit) {
|
||
const take = (dir, file) => {
|
||
if (file.startsWith("rollout-") && file.endsWith(".jsonl")) visit(join10(dir, file));
|
||
};
|
||
const sessionsDir = join10(codexDir, "sessions");
|
||
try {
|
||
for (const year of readdirSync2(sessionsDir)) {
|
||
if (!/^\d{4}$/.test(year)) continue;
|
||
const yearDir = join10(sessionsDir, year);
|
||
for (const month of readdirSync2(yearDir)) {
|
||
if (!/^\d{2}$/.test(month)) continue;
|
||
const monthDir = join10(yearDir, month);
|
||
for (const day of readdirSync2(monthDir)) {
|
||
if (!/^\d{2}$/.test(day)) continue;
|
||
const dayDir = join10(monthDir, day);
|
||
for (const file of readdirSync2(dayDir)) take(dayDir, file);
|
||
}
|
||
}
|
||
}
|
||
} catch {
|
||
}
|
||
const archivedDir = join10(codexDir, "archived_sessions");
|
||
try {
|
||
for (const file of readdirSync2(archivedDir)) take(archivedDir, file);
|
||
} catch {
|
||
}
|
||
}
|
||
function listRolloutSessionIds(codexDir) {
|
||
const ids = /* @__PURE__ */ new Set();
|
||
walkRolloutFiles(codexDir, (filePath) => {
|
||
const id = rolloutFileSessionId(filePath);
|
||
if (id) ids.add(id);
|
||
});
|
||
return ids;
|
||
}
|
||
function defaultBilledCodexHome() {
|
||
return join10(homedir10(), ".codex");
|
||
}
|
||
function defaultLauncherRoots() {
|
||
return [join10(homedir10(), ".buzz")];
|
||
}
|
||
var FIRST_LINE_READ_CAP;
|
||
var init_launcher_homes = __esm({
|
||
"src/launcher-homes.ts"() {
|
||
"use strict";
|
||
FIRST_LINE_READ_CAP = 1024 * 1024;
|
||
}
|
||
});
|
||
|
||
// src/codex-fork-replay.ts
|
||
import { stat as stat7 } from "fs/promises";
|
||
import { basename as basename7, dirname as dirname2 } from "path";
|
||
function startCodexForkReplay(timestamp2) {
|
||
if (!timestamp2) return void 0;
|
||
const startedAtMs = Date.parse(timestamp2);
|
||
if (!Number.isFinite(startedAtMs)) return void 0;
|
||
return { startedAtMs, lastReplayAtMs: startedAtMs, active: true };
|
||
}
|
||
function isCodexForkReplay(state, timestamp2) {
|
||
if (!state?.active || !timestamp2) return false;
|
||
const timestampMs = Date.parse(timestamp2);
|
||
if (!Number.isFinite(timestampMs)) return false;
|
||
if (timestampMs < state.startedAtMs) return true;
|
||
if (timestampMs - state.startedAtMs > 5e3) {
|
||
state.active = false;
|
||
return false;
|
||
}
|
||
if (timestampMs < state.lastReplayAtMs) return true;
|
||
if (timestampMs - state.lastReplayAtMs > CODEX_FORK_REPLAY_MAX_GAP_MS) {
|
||
state.active = false;
|
||
return false;
|
||
}
|
||
state.lastReplayAtMs = timestampMs;
|
||
return true;
|
||
}
|
||
function isCodexForkReplayState(value) {
|
||
if (!value || typeof value !== "object") return false;
|
||
const state = value;
|
||
return typeof state["startedAtMs"] === "number" && Number.isFinite(state["startedAtMs"]) && typeof state["lastReplayAtMs"] === "number" && Number.isFinite(state["lastReplayAtMs"]) && typeof state["active"] === "boolean";
|
||
}
|
||
function codexReplayUsageIdentity(info) {
|
||
return JSON.stringify([usageCounters(info.total_token_usage), usageCounters(info.last_token_usage)]);
|
||
}
|
||
function findRollout(home, id) {
|
||
let index = rolloutIndexes.get(home);
|
||
if (!index?.has(id)) {
|
||
index = /* @__PURE__ */ new Map();
|
||
walkRolloutFiles(home, (path) => index.set(basename7(path).slice(ROLLOUT_ID_OFFSET, -".jsonl".length), path));
|
||
if (!index.has(id)) index.set(id, null);
|
||
rolloutIndexes.set(home, index);
|
||
}
|
||
return index.get(id) ?? void 0;
|
||
}
|
||
function codexHomeOf(path) {
|
||
for (let dir = dirname2(path); dir !== dirname2(dir); dir = dirname2(dir)) {
|
||
const name = basename7(dir);
|
||
if (name === "sessions" || name === "archived_sessions") return dirname2(dir);
|
||
}
|
||
return void 0;
|
||
}
|
||
async function readParentUsage(path) {
|
||
const records = [];
|
||
const skip = (head) => !head.includes('"token_count"') && !head.includes('"token_usage_record"');
|
||
for await (const line of readSessionLines(path, skip)) {
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
const at = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
if (entry.type === "token_usage_record" && typeof entry.payload?.response_id === "string") {
|
||
records.push([at, codexReplayResponseIdentity(entry.payload.response_id)]);
|
||
} else if (entry.type === "event_msg" && entry.payload?.type === "token_count" && entry.payload.info) {
|
||
records.push([at, codexReplayUsageIdentity(entry.payload.info)]);
|
||
}
|
||
}
|
||
return records;
|
||
}
|
||
async function loadCodexParentReplay(forkPath, parentId, forkedAtMs) {
|
||
const home = codexHomeOf(forkPath);
|
||
const path = home ? findRollout(home, parentId) : void 0;
|
||
if (!path || path === forkPath) return null;
|
||
let sig;
|
||
try {
|
||
const st = await stat7(path);
|
||
sig = `${st.size}:${st.mtimeMs}`;
|
||
} catch {
|
||
return null;
|
||
}
|
||
let cached2 = parentUsage.get(path);
|
||
if (cached2?.sig !== sig) {
|
||
cached2 = { sig, records: readParentUsage(path) };
|
||
parentUsage.set(path, cached2);
|
||
}
|
||
const ids = new Set((await cached2.records).filter(([at]) => !(at > forkedAtMs)).map(([, id]) => id));
|
||
return ids.size > 0 ? ids : null;
|
||
}
|
||
var CODEX_FORK_REPLAY_MAX_GAP_MS, usageCounters, codexReplayResponseIdentity, ROLLOUT_ID_OFFSET, rolloutIndexes, parentUsage;
|
||
var init_codex_fork_replay = __esm({
|
||
"src/codex-fork-replay.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_launcher_homes();
|
||
CODEX_FORK_REPLAY_MAX_GAP_MS = 1e3;
|
||
usageCounters = (u) => u ? [u.input_tokens ?? 0, u.cached_input_tokens ?? 0, u.cache_write_input_tokens ?? 0, u.output_tokens ?? 0, u.reasoning_output_tokens ?? 0, u.total_tokens ?? 0] : null;
|
||
codexReplayResponseIdentity = (responseId) => `response:${responseId}`;
|
||
ROLLOUT_ID_OFFSET = "rollout-YYYY-MM-DDTHH-MM-SS-".length;
|
||
rolloutIndexes = /* @__PURE__ */ new Map();
|
||
parentUsage = /* @__PURE__ */ new Map();
|
||
}
|
||
});
|
||
|
||
// src/codex-throughput.ts
|
||
import { open as open3, stat as stat8 } from "fs/promises";
|
||
import { StringDecoder } from "string_decoder";
|
||
function mergeToolIntervals(intervals, durationMs, taskStartedAt, taskCompletedAt) {
|
||
const windowStart = taskStartedAt ?? (taskCompletedAt !== void 0 ? taskCompletedAt - durationMs : void 0);
|
||
const windowEnd = windowStart !== void 0 ? windowStart + durationMs : void 0;
|
||
const clipped = intervals.map(([start, end]) => [
|
||
windowStart !== void 0 ? Math.max(start, windowStart) : start,
|
||
windowEnd !== void 0 ? Math.min(end, windowEnd) : end
|
||
]).filter(([start, end]) => end > start);
|
||
const merged = clipped.sort((a, b) => a[0] - b[0]).reduce((result, interval) => {
|
||
const previous = result.at(-1);
|
||
if (previous && interval[0] <= previous[1]) previous[1] = Math.max(previous[1], interval[1]);
|
||
else result.push([...interval]);
|
||
return result;
|
||
}, []);
|
||
return Math.min(durationMs, merged.reduce((total, [start, end]) => total + end - start, 0));
|
||
}
|
||
var CHUNK_BYTES, MAX_PENDING_LINE_CHARS;
|
||
var init_codex_throughput = __esm({
|
||
"src/codex-throughput.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_codex_fork_replay();
|
||
CHUNK_BYTES = 64 * 1024;
|
||
MAX_PENDING_LINE_CHARS = 4 * 1024 * 1024;
|
||
}
|
||
});
|
||
|
||
// src/token-estimate.ts
|
||
function estimateTokensFromChars(chars) {
|
||
return Math.ceil(chars / CHARS_PER_TOKEN);
|
||
}
|
||
var CHARS_PER_TOKEN;
|
||
var init_token_estimate = __esm({
|
||
"src/token-estimate.ts"() {
|
||
"use strict";
|
||
CHARS_PER_TOKEN = 4;
|
||
}
|
||
});
|
||
|
||
// src/providers/codex.ts
|
||
import { readdir as readdir7, stat as stat9 } from "fs/promises";
|
||
import { createReadStream as createReadStream2 } from "fs";
|
||
import { createInterface } from "readline";
|
||
import { basename as basename8, join as join11, resolve as resolve3 } from "path";
|
||
import { homedir as homedir11 } from "os";
|
||
function mcpToolFromShellCommand(text2) {
|
||
const m = MCP_CLI_CALL.exec(text2);
|
||
if (!m) return null;
|
||
const server = m[1].replace(/['"]/g, "");
|
||
const tool = m[2].replace(/['"]/g, "");
|
||
if (!server || !tool) return null;
|
||
return `mcp__${server}__${tool}`;
|
||
}
|
||
function skillFromShellCommand(text2) {
|
||
const m = SKILL_MD_READ.exec(text2);
|
||
const name = m?.[2]?.trim();
|
||
return name ? name : null;
|
||
}
|
||
function shellCommandText(command) {
|
||
if (typeof command === "string") return command;
|
||
if (Array.isArray(command)) return command.filter((x) => typeof x === "string").join(" ");
|
||
return "";
|
||
}
|
||
function countUnifiedDiffLoc(diff) {
|
||
let added = 0;
|
||
let removed = 0;
|
||
if (typeof diff !== "string") return { added, removed };
|
||
for (const line of diff.split("\n")) {
|
||
if (line.startsWith("+") && !line.startsWith("+++")) added++;
|
||
else if (line.startsWith("-") && !line.startsWith("---")) removed++;
|
||
}
|
||
return { added, removed };
|
||
}
|
||
function getCodexDir(override) {
|
||
return override ?? process.env["CODEX_HOME"] ?? join11(homedir11(), ".codex");
|
||
}
|
||
function sanitizeProject(cwd) {
|
||
return cwd.replace(/^\//, "").replace(/\//g, "-");
|
||
}
|
||
async function readFirstLine(filePath) {
|
||
const stream = createReadStream2(filePath, {
|
||
encoding: "utf-8",
|
||
start: 0,
|
||
end: FIRST_LINE_READ_CAP - 1
|
||
});
|
||
stream.on("error", () => {
|
||
});
|
||
const rl = createInterface({ input: stream, crlfDelay: Infinity });
|
||
let firstLine;
|
||
try {
|
||
for await (const line of rl) {
|
||
firstLine = line;
|
||
break;
|
||
}
|
||
} catch {
|
||
return null;
|
||
} finally {
|
||
rl.close();
|
||
stream.destroy();
|
||
}
|
||
if (!firstLine || !firstLine.trim()) return null;
|
||
try {
|
||
return JSON.parse(firstLine);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function isValidCodexSession(filePath) {
|
||
const entry = await readFirstLine(filePath);
|
||
if (!entry) return { valid: false };
|
||
const payload = entry.payload;
|
||
const valid = entry.type === "session_meta" && typeof payload === "object" && payload !== null && !Array.isArray(payload);
|
||
return { valid, meta: valid ? entry : void 0 };
|
||
}
|
||
function getRawJsonStringField(head, field) {
|
||
const re = new RegExp(`"${field}"\\s*:\\s*"((?:\\\\.|[^"\\\\])*)"`);
|
||
const match = re.exec(head);
|
||
if (!match) return void 0;
|
||
try {
|
||
return JSON.parse(`"${match[1]}"`);
|
||
} catch {
|
||
return match[1];
|
||
}
|
||
}
|
||
function getRawJsonNumberField(head, field) {
|
||
const match = new RegExp(`"${field}"\\s*:\\s*(-?\\d+(?:\\.\\d+)?)`).exec(head);
|
||
if (!match) return void 0;
|
||
const value = Number(match[1]);
|
||
return Number.isFinite(value) ? value : void 0;
|
||
}
|
||
function getRawPayloadFieldWindow(source, field, windowBytes = 4096) {
|
||
const payloadKey = Buffer.from('"payload"');
|
||
const payloadIndex = source.indexOf(payloadKey);
|
||
if (payloadIndex < 0) return void 0;
|
||
let payloadStart = source.indexOf(123, payloadIndex + payloadKey.length);
|
||
if (payloadStart < 0) return void 0;
|
||
let depth = 0;
|
||
let inString = false;
|
||
let escaped = false;
|
||
for (let i = payloadStart; i < source.length; i++) {
|
||
const byte = source[i];
|
||
if (inString) {
|
||
if (escaped) escaped = false;
|
||
else if (byte === 92) escaped = true;
|
||
else if (byte === 34) inString = false;
|
||
continue;
|
||
}
|
||
if (byte === 34) {
|
||
const keyStart = i + 1;
|
||
let keyEnd = keyStart;
|
||
let keyEscaped = false;
|
||
for (; keyEnd < source.length; keyEnd++) {
|
||
const keyByte = source[keyEnd];
|
||
if (keyEscaped) {
|
||
keyEscaped = false;
|
||
continue;
|
||
}
|
||
if (keyByte === 92) {
|
||
keyEscaped = true;
|
||
continue;
|
||
}
|
||
if (keyByte === 34) break;
|
||
}
|
||
if (depth === 1 && keyEnd < source.length) {
|
||
const key = source.subarray(keyStart, keyEnd).toString("utf-8");
|
||
let valueStart = keyEnd + 1;
|
||
while (valueStart < source.length && (source[valueStart] === 32 || source[valueStart] === 9 || source[valueStart] === 10 || source[valueStart] === 13)) valueStart++;
|
||
if (source[valueStart] === 58 && key === field) {
|
||
return source.subarray(i, Math.min(source.length, i + windowBytes)).toString("utf-8");
|
||
}
|
||
}
|
||
i = keyEnd;
|
||
inString = false;
|
||
continue;
|
||
}
|
||
if (byte === 34) inString = true;
|
||
else if (byte === 123 || byte === 91) depth++;
|
||
else if (byte === 125 || byte === 93) depth--;
|
||
if (depth < 0) break;
|
||
}
|
||
return void 0;
|
||
}
|
||
function getRawDurationMs(head) {
|
||
const objectMatch = /"duration"\s*:\s*\{\s*"secs"\s*:\s*(-?\d+(?:\.\d+)?)\s*,\s*"nanos"\s*:\s*(-?\d+(?:\.\d+)?)\s*\}/.exec(head);
|
||
if (objectMatch) {
|
||
const seconds = Number(objectMatch[1]);
|
||
const nanos = Number(objectMatch[2]);
|
||
if (Number.isFinite(seconds) && Number.isFinite(nanos)) return seconds * 1e3 + nanos / 1e6;
|
||
}
|
||
const text2 = getRawJsonStringField(head, "duration");
|
||
if (text2) {
|
||
const match = /^(\d+(?:\.\d+)?)(ms|s)?$/.exec(text2.trim());
|
||
if (match) {
|
||
const value = Number(match[1]);
|
||
if (Number.isFinite(value)) return value * (match[2] === "s" ? 1e3 : 1);
|
||
}
|
||
}
|
||
return void 0;
|
||
}
|
||
function durationValueMs(value) {
|
||
if (typeof value === "number" && Number.isFinite(value)) return value;
|
||
if (typeof value === "object" && value) {
|
||
const record = value;
|
||
const seconds = record["secs"];
|
||
const nanos = record["nanos"];
|
||
if (typeof seconds === "number" && typeof nanos === "number" && Number.isFinite(seconds) && Number.isFinite(nanos)) {
|
||
return seconds * 1e3 + nanos / 1e6;
|
||
}
|
||
}
|
||
if (typeof value === "string") {
|
||
const match = /^(\d+(?:\.\d+)?)(ms|s)?$/.exec(value.trim());
|
||
if (match) {
|
||
const parsed = Number(match[1]);
|
||
if (Number.isFinite(parsed)) return parsed * (match[2] === "s" ? 1e3 : 1);
|
||
}
|
||
}
|
||
return void 0;
|
||
}
|
||
function getRawTokenUsage(head, field) {
|
||
const match = new RegExp(`"${field}"\\s*:\\s*\\{([^}]*)\\}`).exec(head);
|
||
if (!match) return void 0;
|
||
const body = match[1];
|
||
return {
|
||
input_tokens: getRawJsonNumberField(body, "input_tokens"),
|
||
cached_input_tokens: getRawJsonNumberField(body, "cached_input_tokens"),
|
||
cache_write_input_tokens: getRawJsonNumberField(body, "cache_write_input_tokens"),
|
||
output_tokens: getRawJsonNumberField(body, "output_tokens"),
|
||
reasoning_output_tokens: getRawJsonNumberField(body, "reasoning_output_tokens"),
|
||
total_tokens: getRawJsonNumberField(body, "total_tokens")
|
||
};
|
||
}
|
||
function payloadHead(head) {
|
||
const idx = head.indexOf('"payload"');
|
||
return idx === -1 ? head : head.slice(idx);
|
||
}
|
||
function getRawInvocation(head) {
|
||
const idx = head.indexOf('"invocation"');
|
||
if (idx === -1) return void 0;
|
||
const invocationHead = head.slice(idx, idx + 8192);
|
||
const server = getRawJsonStringField(invocationHead, "server");
|
||
const tool = getRawJsonStringField(invocationHead, "tool");
|
||
return server || tool ? { server, tool } : void 0;
|
||
}
|
||
function countJsonStringBytes(source, valueStart) {
|
||
let count2 = 0;
|
||
for (let i = valueStart; i < source.length; i++) {
|
||
const ch = source[i];
|
||
if (ch === 92) {
|
||
i++;
|
||
count2++;
|
||
continue;
|
||
}
|
||
if (ch === 34) return count2;
|
||
count2++;
|
||
}
|
||
return count2;
|
||
}
|
||
function extractFirstJsonText(source, cap = LARGE_TEXT_CAP) {
|
||
const key = Buffer.from('"text"');
|
||
const idx = source.indexOf(key);
|
||
if (idx === -1) return "";
|
||
const colon = source.indexOf(58, idx + key.length);
|
||
if (colon === -1) return "";
|
||
const qStart = source.indexOf(34, colon + 1);
|
||
if (qStart === -1) return "";
|
||
const chunks = [];
|
||
for (let i = qStart + 1; i < source.length && chunks.length < cap; i++) {
|
||
const ch = source[i];
|
||
if (ch === 92) {
|
||
const next = source[++i];
|
||
if (next === 110) chunks.push(10);
|
||
else if (next === 114) chunks.push(13);
|
||
else if (next === 116) chunks.push(9);
|
||
else if (next !== void 0) chunks.push(next);
|
||
continue;
|
||
}
|
||
if (ch === 34) break;
|
||
chunks.push(ch);
|
||
}
|
||
return Buffer.from(chunks).toString("utf-8");
|
||
}
|
||
function countFirstJsonText(source) {
|
||
const key = Buffer.from('"text"');
|
||
const idx = source.indexOf(key);
|
||
if (idx === -1) return 0;
|
||
const colon = source.indexOf(58, idx + key.length);
|
||
if (colon === -1) return 0;
|
||
const qStart = source.indexOf(34, colon + 1);
|
||
if (qStart === -1) return 0;
|
||
return countJsonStringBytes(source, qStart + 1);
|
||
}
|
||
function serviceTierFromThreadSettings(payload) {
|
||
const tier = payload?.thread_settings?.service_tier;
|
||
return typeof tier === "string" && tier ? tier : void 0;
|
||
}
|
||
function speedForServiceTier(tier) {
|
||
if (tier === "flex") return "flex";
|
||
return tier === "priority" || tier === "fast" ? "fast" : "standard";
|
||
}
|
||
function parseCodexLine(line) {
|
||
if (typeof line === "string") {
|
||
const trimmed = line.trim();
|
||
if (!trimmed) return null;
|
||
try {
|
||
const entry2 = JSON.parse(trimmed);
|
||
const tier = serviceTierFromThreadSettings(entry2.payload);
|
||
if (tier !== void 0 && entry2.payload) entry2.payload.serviceTier = tier;
|
||
return entry2;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
if (line.length === 0) return null;
|
||
const head = line.subarray(0, RAW_HEAD_BYTES).toString("utf-8");
|
||
const type = getRawJsonStringField(head, "type");
|
||
if (!type) return null;
|
||
const pHead = payloadHead(head);
|
||
const payloadType = getRawJsonStringField(pHead, "type");
|
||
const role = getRawJsonStringField(pHead, "role");
|
||
const needsTimingTail = type === "event_msg" && (payloadType === "task_complete" || payloadType === "mcp_tool_call_end");
|
||
const timingTail = needsTimingTail && line.length > RAW_HEAD_BYTES ? line.subarray(Math.max(0, line.length - 16 * 1024)).toString("utf-8") : pHead;
|
||
const timingNumber = (field) => getRawJsonNumberField(pHead, field) ?? getRawJsonNumberField(timingTail, field);
|
||
const payloadDuration = payloadType === "mcp_tool_call_end" ? getRawDurationMs(getRawPayloadFieldWindow(line, "duration") ?? "") : void 0;
|
||
const timingDuration = payloadDuration ?? getRawDurationMs(pHead) ?? getRawDurationMs(timingTail);
|
||
const payloadString = (field) => type === "session_meta" ? getRawJsonStringField(getRawPayloadFieldWindow(line, field) ?? "", field) : getRawJsonStringField(pHead, field);
|
||
const compactModel = payloadString("model");
|
||
const compactModelName = getRawJsonStringField(pHead, "model_name");
|
||
const compactLastUsage = getRawTokenUsage(pHead, "last_token_usage");
|
||
const compactTotalUsage = getRawTokenUsage(pHead, "total_token_usage");
|
||
const compactInfo = compactModel || compactModelName || compactLastUsage || compactTotalUsage ? { model: compactModel, model_name: compactModelName, last_token_usage: compactLastUsage, total_token_usage: compactTotalUsage } : void 0;
|
||
const invocation = getRawInvocation(pHead) ?? getRawInvocation(timingTail);
|
||
const entry = {
|
||
type,
|
||
timestamp: getRawJsonStringField(head, "timestamp"),
|
||
payload: {
|
||
type: payloadType,
|
||
role,
|
||
cwd: payloadString("cwd"),
|
||
model_provider: payloadString("model_provider"),
|
||
originator: payloadString("originator"),
|
||
session_id: payloadString("session_id"),
|
||
forked_from_id: payloadString("forked_from_id"),
|
||
parent_thread_id: type === "session_meta" ? getRawJsonStringField(getRawPayloadFieldWindow(line, "source") ?? "", "parent_thread_id") : void 0,
|
||
model: compactModel,
|
||
name: payloadString("name"),
|
||
invocation,
|
||
call_id: getRawJsonStringField(pHead, "call_id"),
|
||
turn_id: getRawJsonStringField(pHead, "turn_id"),
|
||
// #1616: oversized thread_settings_applied records (a fat permission
|
||
// profile or plugin list can push them past the buffer threshold) still
|
||
// carry `service_tier` within the first few hundred bytes of the
|
||
// thread_settings object, so the windowed scan reaches it. Scanning
|
||
// inside the payload-depth-1 `thread_settings` window - the session_meta
|
||
// treatment above - keeps this decoder agreeing with the full-JSON path
|
||
// (which reads the nested field) even if a same-name key ever appears in
|
||
// an earlier payload field, and the payload-type guard keeps a
|
||
// coincidental same-name key inside another event's bulk from reading as
|
||
// a tier.
|
||
serviceTier: type === "event_msg" && payloadType === "thread_settings_applied" ? getRawJsonStringField(getRawPayloadFieldWindow(line, "thread_settings") ?? "", "service_tier") : void 0,
|
||
// On mcp_tool_call_end a coincidental `duration_ms` inside the large
|
||
// invocation.arguments object can shadow the payload-level duration, so the
|
||
// depth-aware value wins. The naive scan stays as the fallback for
|
||
// task_complete, which records duration_ms at the payload level directly.
|
||
duration_ms: timingDuration ?? timingNumber("duration_ms"),
|
||
started_at: timingNumber("started_at"),
|
||
info: compactInfo
|
||
}
|
||
};
|
||
if (type === "response_item" && payloadType === "message" && role === "user") {
|
||
entry.payload.content = [{ type: "input_text", text: extractFirstJsonText(line) }];
|
||
} else if (type === "response_item" && payloadType === "message" && role === "assistant") {
|
||
entry.payload.content = [{ type: "output_text", text: "x".repeat(Math.min(countFirstJsonText(line), LARGE_TEXT_CAP)) }];
|
||
}
|
||
return entry;
|
||
}
|
||
async function discoverSessionFile(filePath) {
|
||
const s = await stat9(filePath).catch(() => null);
|
||
if (!s?.isFile()) return null;
|
||
const cachedProject = await getCachedCodexProject(filePath);
|
||
if (cachedProject) {
|
||
return { path: filePath, project: cachedProject, provider: "codex" };
|
||
}
|
||
const { valid, meta } = await isValidCodexSession(filePath);
|
||
if (!valid || !meta) return null;
|
||
const rawCwd = meta.payload?.cwd;
|
||
const cwd = typeof rawCwd === "string" && rawCwd ? rawCwd : "unknown";
|
||
return { path: filePath, project: sanitizeProject(cwd), provider: "codex" };
|
||
}
|
||
async function discoverSessionsInDir(codexDir) {
|
||
const sources = [];
|
||
const seenBasenames = /* @__PURE__ */ new Set();
|
||
const sessionsDir = join11(codexDir, "sessions");
|
||
const years = (await readdir7(sessionsDir).catch(() => [])).filter((y) => /^\d{4}$/.test(y));
|
||
const monthDirs = (await mapWithConcurrency(years, FS_SCAN_CONCURRENCY, async (year) => {
|
||
const yearDir = join11(sessionsDir, year);
|
||
return (await readdir7(yearDir).catch(() => [])).filter((m) => /^\d{2}$/.test(m)).map((m) => join11(yearDir, m));
|
||
})).flat();
|
||
const dayDirs = (await mapWithConcurrency(
|
||
monthDirs,
|
||
FS_SCAN_CONCURRENCY,
|
||
async (monthDir) => (await readdir7(monthDir).catch(() => [])).filter((d) => /^\d{2}$/.test(d)).map((d) => join11(monthDir, d))
|
||
)).flat();
|
||
const dated = (await mapWithConcurrency(
|
||
dayDirs,
|
||
FS_SCAN_CONCURRENCY,
|
||
async (dayDir) => (await readdir7(dayDir).catch(() => [])).filter((f) => f.startsWith("rollout-") && f.endsWith(".jsonl")).map((f) => ({ file: f, path: join11(dayDir, f) }))
|
||
)).flat();
|
||
const archivedDir = join11(codexDir, "archived_sessions");
|
||
const archived = (await readdir7(archivedDir).catch(() => [])).filter((f) => f.startsWith("rollout-") && f.endsWith(".jsonl")).map((f) => ({ file: f, path: join11(archivedDir, f) }));
|
||
const candidates = [];
|
||
for (const entry of [...dated, ...archived]) {
|
||
if (seenBasenames.has(entry.file)) continue;
|
||
seenBasenames.add(entry.file);
|
||
candidates.push(entry);
|
||
}
|
||
const discovered = await mapWithConcurrency(candidates, FS_SCAN_CONCURRENCY, (c) => discoverSessionFile(c.path));
|
||
for (const source of discovered) if (source) sources.push(source);
|
||
return sources;
|
||
}
|
||
function firstModelString(...values) {
|
||
for (const value of values) {
|
||
if (typeof value === "string" && value) return value;
|
||
}
|
||
return void 0;
|
||
}
|
||
function resolveModel2(info, sessionModel) {
|
||
return firstModelString(info?.model, info?.model_name, info?.info?.model, info?.info?.model_name, sessionModel) ?? "gpt-5";
|
||
}
|
||
function isValidCodexTokenUsage(value) {
|
||
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
||
const usage = value;
|
||
const fields = [
|
||
usage["input_tokens"],
|
||
usage["cached_input_tokens"],
|
||
usage["cache_write_input_tokens"],
|
||
usage["output_tokens"],
|
||
usage["reasoning_output_tokens"]
|
||
];
|
||
const hasCounter = fields.some((field) => typeof field === "number" && Number.isFinite(field) && field >= 0);
|
||
return hasCounter && fields.every(
|
||
(field) => field === void 0 || typeof field === "number" && Number.isFinite(field) && field >= 0
|
||
);
|
||
}
|
||
function isResumeState(value) {
|
||
if (!value || typeof value !== "object") return false;
|
||
const v = value;
|
||
return typeof v["sessionId"] === "string" && typeof v["forkedFromId"] === "string" && (v["forkReplayState"] === void 0 || isCodexForkReplayState(v["forkReplayState"])) && (v["prevCumulativeTotal"] === null || typeof v["prevCumulativeTotal"] === "number") && (v["prevInfoIdentity"] === void 0 || v["prevInfoIdentity"] === null || typeof v["prevInfoIdentity"] === "string") && (v["hasTokenUsageRecord"] === void 0 || typeof v["hasTokenUsageRecord"] === "boolean") && (v["serviceTier"] === void 0 || typeof v["serviceTier"] === "string") && typeof v["prevInput"] === "number" && typeof v["prevCached"] === "number" && typeof v["prevCacheWrite"] === "number" && typeof v["prevOutput"] === "number" && typeof v["prevReasoning"] === "number" && Array.isArray(v["pendingTools"]) && Array.isArray(v["pendingToolSequence"]) && typeof v["pendingUserMessage"] === "string" && typeof v["pendingOutputChars"] === "number" && typeof v["pendingLocAdded"] === "number" && typeof v["pendingLocRemoved"] === "number" && typeof v["pendingEditFailed"] === "number" && typeof v["estCounter"] === "number" && typeof v["turnCounter"] === "number" && typeof v["currentTurnId"] === "string";
|
||
}
|
||
function createParser6(source, seenKeys, capture) {
|
||
return {
|
||
async *parse() {
|
||
const hit = capture ? null : await readCachedCodexResults(source.path);
|
||
if (hit?.kind === "exact") {
|
||
for (const call of hit.calls) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
return;
|
||
}
|
||
const resume = hit && isResumeState(hit.state) ? { offset: hit.offset, state: hit.state, calls: hit.calls.slice(0, hit.callCount) } : null;
|
||
const fp = await fingerprintFile(source.path);
|
||
if (!fp) return;
|
||
let sessionModel = resume?.state.sessionModel;
|
||
let sessionId = resume?.state.sessionId ?? "";
|
||
let sessionCwd = resume?.state.sessionCwd;
|
||
let forkedFromId = resume?.state.forkedFromId ?? "";
|
||
let forkReplayState = resume?.state.forkReplayState ? { ...resume.state.forkReplayState } : void 0;
|
||
let parentReplay;
|
||
let parentReplayAnchored = false;
|
||
const isParentReplay = async (identity) => {
|
||
if (parentReplay === void 0) {
|
||
parentReplay = forkedFromId && forkReplayState ? await loadCodexParentReplay(source.path, forkedFromId, forkReplayState.startedAtMs) : null;
|
||
}
|
||
if (!parentReplay || identity === void 0) return true;
|
||
if (parentReplay.has(identity)) {
|
||
parentReplayAnchored = true;
|
||
return true;
|
||
}
|
||
if (!parentReplayAnchored) {
|
||
parentReplay = null;
|
||
return true;
|
||
}
|
||
return false;
|
||
};
|
||
let prevCumulativeTotal = resume?.state.prevCumulativeTotal ?? null;
|
||
let prevInfoIdentity = resume?.state.prevInfoIdentity ?? null;
|
||
let hasTokenUsageRecord = resume?.state.hasTokenUsageRecord ?? false;
|
||
let serviceTier = resume?.state.serviceTier ?? "default";
|
||
let prevInput = resume?.state.prevInput ?? 0;
|
||
let prevCached = resume?.state.prevCached ?? 0;
|
||
let prevCacheWrite = resume?.state.prevCacheWrite ?? 0;
|
||
let prevOutput = resume?.state.prevOutput ?? 0;
|
||
let prevReasoning = resume?.state.prevReasoning ?? 0;
|
||
let pendingTools = resume ? [...resume.state.pendingTools] : [];
|
||
let pendingToolSequence = resume ? [...resume.state.pendingToolSequence] : [];
|
||
let pendingSkills = resume?.state.pendingSkills ? [...resume.state.pendingSkills] : [];
|
||
const itemDedup = /* @__PURE__ */ new Map();
|
||
const attributeShellCommand = (text2, viaItem) => {
|
||
if (!text2) return;
|
||
const claim = (name) => {
|
||
const pending = itemDedup.get(name) ?? 0;
|
||
if (!viaItem) {
|
||
itemDedup.set(name, pending + 1);
|
||
return true;
|
||
}
|
||
if (pending === 0) return true;
|
||
itemDedup.set(name, pending - 1);
|
||
return false;
|
||
};
|
||
const mcpTool = mcpToolFromShellCommand(text2);
|
||
if (mcpTool && claim(mcpTool)) {
|
||
pendingTools.push(mcpTool);
|
||
pendingToolSequence.push([{ tool: mcpTool }]);
|
||
}
|
||
const skill = skillFromShellCommand(text2);
|
||
if (skill && claim(`skill:${skill}`)) {
|
||
pendingSkills.push(skill);
|
||
pendingTools.push("Skill");
|
||
pendingToolSequence.push([{ tool: "Skill", file: skill }]);
|
||
}
|
||
};
|
||
let pendingUserMessage = resume?.state.pendingUserMessage ?? "";
|
||
let pendingOutputChars = resume?.state.pendingOutputChars ?? 0;
|
||
let pendingLocAdded = resume?.state.pendingLocAdded ?? 0;
|
||
let pendingLocRemoved = resume?.state.pendingLocRemoved ?? 0;
|
||
let pendingEditFailed = resume?.state.pendingEditFailed ?? 0;
|
||
let estCounter = resume?.state.estCounter ?? 0;
|
||
let turnCounter = resume?.state.turnCounter ?? 0;
|
||
let currentTurnId = resume?.state.currentTurnId ?? `${sessionId}:t0`;
|
||
let sawAnyLine = false;
|
||
const results = [];
|
||
if (resume) {
|
||
for (const call of resume.calls) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
results.push(call);
|
||
}
|
||
}
|
||
let pendingTaskCalls = [];
|
||
let taskGeneratedTokens = 0;
|
||
let taskToolIntervals = [];
|
||
let taskStartedAt = resume?.state.taskStartedAt;
|
||
let taskActiveStartedAt = resume?.state.taskActiveStartedAt;
|
||
const openToolStarts = /* @__PURE__ */ new Map();
|
||
const accountUsage = (entry, usage, dedupKey) => {
|
||
const inputTokens = usage.input_tokens ?? 0;
|
||
const cachedInputTokens = usage.cached_input_tokens ?? 0;
|
||
const cacheWriteTokens = usage.cache_write_input_tokens ?? 0;
|
||
const outputTokens = usage.output_tokens ?? 0;
|
||
const reasoningTokens = usage.reasoning_output_tokens ?? 0;
|
||
const totalTokens = inputTokens + cachedInputTokens + outputTokens + reasoningTokens;
|
||
if (totalTokens === 0 || seenKeys.has(dedupKey)) return;
|
||
const uncachedInputTokens = Math.max(0, inputTokens - cachedInputTokens);
|
||
const cacheWriteInputTokens = Math.max(0, Math.min(cacheWriteTokens, uncachedInputTokens));
|
||
const model = resolveModel2(entry.payload, sessionModel);
|
||
const timestamp2 = entry.timestamp ?? "";
|
||
const pricingModel = pricingModelAt(model, timestamp2);
|
||
const billedCacheWriteTokens = cacheWriteInputTokens > 0 && getModelCosts(pricingModel)?.cacheWriteCostIsExplicit ? cacheWriteInputTokens : 0;
|
||
const billedInputTokens = uncachedInputTokens - billedCacheWriteTokens;
|
||
seenKeys.add(dedupKey);
|
||
const speed = speedForServiceTier(serviceTier);
|
||
const costUSD = calculateCost(
|
||
pricingModel,
|
||
billedInputTokens,
|
||
billableOutputTokens("codex", outputTokens, reasoningTokens),
|
||
billedCacheWriteTokens,
|
||
cachedInputTokens,
|
||
0,
|
||
speed,
|
||
0,
|
||
"codex"
|
||
);
|
||
pendingTaskCalls.push({
|
||
provider: "codex",
|
||
model,
|
||
inputTokens: billedInputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: billedCacheWriteTokens,
|
||
cacheReadInputTokens: cachedInputTokens,
|
||
cachedInputTokens,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: pendingTools,
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed,
|
||
deduplicationKey: dedupKey,
|
||
turnId: currentTurnId,
|
||
toolSequence: pendingToolSequence.length > 0 ? pendingToolSequence : void 0,
|
||
...pendingSkills.length > 0 ? { skills: pendingSkills } : {},
|
||
userMessage: pendingUserMessage,
|
||
sessionId,
|
||
...sessionCwd ? { projectPath: sessionCwd, workingDirectory: sessionCwd } : {},
|
||
...pendingLocAdded ? { locAdded: pendingLocAdded } : {},
|
||
...pendingLocRemoved ? { locRemoved: pendingLocRemoved } : {},
|
||
...pendingEditFailed ? { editFailed: pendingEditFailed } : {},
|
||
...model.toLowerCase() === "gpt-reserve" ? { costIsEstimated: true } : {}
|
||
});
|
||
taskGeneratedTokens += billableOutputTokens("codex", outputTokens, reasoningTokens);
|
||
pendingTools = [];
|
||
pendingToolSequence = [];
|
||
pendingSkills = [];
|
||
pendingUserMessage = "";
|
||
pendingOutputChars = 0;
|
||
pendingLocAdded = 0;
|
||
pendingLocRemoved = 0;
|
||
pendingEditFailed = 0;
|
||
};
|
||
const tracker = { lastCompleteLineOffset: resume?.offset ?? 0 };
|
||
let resumeOffset = resume?.offset ?? 0;
|
||
let resumeState = resume?.state ?? null;
|
||
let resumeCallCount = results.length;
|
||
for await (const rawLine of readSessionLines(source.path, void 0, {
|
||
largeLineAsBuffer: true,
|
||
byteOffsetTracker: tracker,
|
||
...resume ? { startByteOffset: resume.offset } : {}
|
||
})) {
|
||
sawAnyLine = true;
|
||
const entry = parseCodexLine(rawLine);
|
||
if (!entry) continue;
|
||
if (entry.type === "session_meta") {
|
||
sessionId = entry.payload?.session_id ?? basename8(source.path, ".jsonl");
|
||
const rawSessionCwd = entry.payload?.cwd;
|
||
if (typeof rawSessionCwd === "string" && rawSessionCwd) sessionCwd = rawSessionCwd;
|
||
forkedFromId = entry.payload?.forked_from_id || entry.payload?.parent_thread_id || entry.payload?.source?.subagent?.thread_spawn?.parent_thread_id || "";
|
||
parentReplay = void 0;
|
||
parentReplayAnchored = false;
|
||
if (forkedFromId) {
|
||
forkReplayState = startCodexForkReplay(entry.timestamp);
|
||
prevInfoIdentity = null;
|
||
}
|
||
if (typeof entry.payload?.model === "string") sessionModel = entry.payload.model;
|
||
continue;
|
||
}
|
||
if (taskActiveStartedAt === void 0 && (entry.type === "turn_context" || entry.type === "world_state" || entry.type === "event_msg" && entry.payload?.type === "user_message" || entry.type === "response_item" && entry.payload?.type === "message")) {
|
||
const ctxAt = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
if (Number.isFinite(ctxAt)) taskActiveStartedAt = ctxAt;
|
||
}
|
||
const isForkReplay = isCodexForkReplay(forkReplayState, entry.timestamp);
|
||
if (entry.type === "turn_context" && typeof entry.payload?.model === "string") {
|
||
sessionModel = entry.payload.model;
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "thread_settings_applied") {
|
||
serviceTier = entry.payload.serviceTier ?? "default";
|
||
continue;
|
||
}
|
||
if (isForkReplay && (entry.payload?.type === "task_started" || entry.payload?.type === "task_complete" || entry.payload?.type === "function_call" || entry.payload?.type === "function_call_output" || entry.payload?.type === "custom_tool_call" || entry.payload?.type === "custom_tool_call_output" || entry.payload?.type === "mcp_tool_call_end" || entry.payload?.type === "item_completed" || entry.payload?.type === "patch_apply_end")) continue;
|
||
if (isForkReplay && entry.type === "response_item" && entry.payload?.type === "message") continue;
|
||
if (isForkReplay && entry.type === "event_msg" && entry.payload?.type === "token_count" && await isParentReplay(entry.payload.info ? codexReplayUsageIdentity(entry.payload.info) : void 0)) {
|
||
const info = entry.payload.info;
|
||
if (info) {
|
||
const total = info.total_token_usage;
|
||
const reportsCumulative = typeof total?.total_tokens === "number" && Number.isFinite(total.total_tokens) && total.total_tokens >= 0;
|
||
if (reportsCumulative) prevInfoIdentity = JSON.stringify(info);
|
||
if (total) {
|
||
const cumulativeTotal = total.total_tokens ?? 0;
|
||
prevCumulativeTotal = reportsCumulative ? cumulativeTotal : null;
|
||
prevInput = total.input_tokens ?? 0;
|
||
prevCached = total.cached_input_tokens ?? 0;
|
||
prevCacheWrite = total.cache_write_input_tokens ?? 0;
|
||
prevOutput = total.output_tokens ?? 0;
|
||
prevReasoning = total.reasoning_output_tokens ?? 0;
|
||
} else {
|
||
prevCumulativeTotal = null;
|
||
}
|
||
}
|
||
pendingUserMessage = "";
|
||
pendingOutputChars = 0;
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "task_started") {
|
||
results.push(...pendingTaskCalls);
|
||
pendingTaskCalls = [];
|
||
taskGeneratedTokens = 0;
|
||
taskToolIntervals = [];
|
||
const startedAt = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
taskStartedAt = Number.isFinite(startedAt) ? startedAt : void 0;
|
||
taskActiveStartedAt = void 0;
|
||
openToolStarts.clear();
|
||
resumeOffset = tracker.lastCompleteLineOffset;
|
||
resumeCallCount = results.length;
|
||
resumeState = {
|
||
...sessionModel !== void 0 ? { sessionModel } : {},
|
||
sessionId,
|
||
...sessionCwd !== void 0 ? { sessionCwd } : {},
|
||
forkedFromId,
|
||
...forkReplayState ? { forkReplayState: { ...forkReplayState } } : {},
|
||
prevCumulativeTotal,
|
||
prevInfoIdentity,
|
||
hasTokenUsageRecord,
|
||
serviceTier,
|
||
prevInput,
|
||
prevCached,
|
||
prevCacheWrite,
|
||
prevOutput,
|
||
prevReasoning,
|
||
pendingTools: [...pendingTools],
|
||
pendingToolSequence: [...pendingToolSequence],
|
||
pendingSkills: [...pendingSkills],
|
||
pendingUserMessage,
|
||
pendingOutputChars,
|
||
pendingLocAdded,
|
||
pendingLocRemoved,
|
||
pendingEditFailed,
|
||
estCounter,
|
||
turnCounter,
|
||
currentTurnId,
|
||
...taskStartedAt !== void 0 ? { taskStartedAt } : {},
|
||
...taskActiveStartedAt !== void 0 ? { taskActiveStartedAt } : {}
|
||
};
|
||
continue;
|
||
}
|
||
if (entry.type === "response_item" && (entry.payload?.type === "function_call" || entry.payload?.type === "custom_tool_call")) {
|
||
const rawName = entry.payload.name ?? "";
|
||
const mapped = toolNameMap5[rawName] ?? rawName;
|
||
pendingTools.push(mapped);
|
||
const call = { tool: mapped };
|
||
const rawArgs = entry.payload["arguments"];
|
||
const args = typeof rawArgs === "string" ? (() => {
|
||
try {
|
||
return JSON.parse(rawArgs);
|
||
} catch {
|
||
return null;
|
||
}
|
||
})() : typeof rawArgs === "object" && rawArgs ? rawArgs : null;
|
||
if (args) {
|
||
const fp2 = args["file_path"] ?? args["path"];
|
||
if (typeof fp2 === "string") call.file = fp2;
|
||
const cmd = args["command"] ?? args["cmd"];
|
||
if (typeof cmd === "string") call.command = cmd;
|
||
attributeShellCommand(shellCommandText(cmd), false);
|
||
}
|
||
if (mapped === "Bash") {
|
||
const input = entry.payload["input"];
|
||
if (typeof input === "string") attributeShellCommand(input, false);
|
||
}
|
||
const callId = entry.payload.call_id;
|
||
const started = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
if (callId && Number.isFinite(started)) openToolStarts.set(callId, started);
|
||
pendingToolSequence.push([call]);
|
||
continue;
|
||
}
|
||
if (entry.type === "response_item" && (entry.payload?.type === "function_call_output" || entry.payload?.type === "custom_tool_call_output")) {
|
||
const callId = entry.payload.call_id;
|
||
const ended = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
const started = callId ? openToolStarts.get(callId) : void 0;
|
||
if (started !== void 0 && Number.isFinite(ended) && ended > started) taskToolIntervals.push([started, ended]);
|
||
if (callId) openToolStarts.delete(callId);
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "task_complete") {
|
||
const durationMs = durationValueMs(entry.payload.duration_ms) ?? durationValueMs(entry.payload.duration);
|
||
if (typeof durationMs === "number" && durationMs > 0 && taskGeneratedTokens > 0 && pendingTaskCalls.length > 0) {
|
||
const completedAt = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
const activeWindowStart = taskActiveStartedAt ?? taskStartedAt;
|
||
const startupGapMs = activeWindowStart !== void 0 && taskStartedAt !== void 0 ? activeWindowStart - taskStartedAt : 0;
|
||
const effectiveDurationMs = Math.max(0, durationMs - startupGapMs);
|
||
const toolWaitMs = mergeToolIntervals(taskToolIntervals, effectiveDurationMs, activeWindowStart, Number.isFinite(completedAt) ? completedAt : void 0);
|
||
const activeMs = effectiveDurationMs - toolWaitMs;
|
||
if (activeMs <= 0) continue;
|
||
for (const call of pendingTaskCalls) {
|
||
const generated = billableOutputTokens("codex", call.outputTokens, call.reasoningTokens);
|
||
if (generated <= 0) continue;
|
||
call.activeGeneratedTokens = generated;
|
||
call.activeDurationMs = activeMs * (generated / taskGeneratedTokens);
|
||
call.toolWaitMs = toolWaitMs * (generated / taskGeneratedTokens);
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "patch_apply_end") {
|
||
pendingTools.push("Edit");
|
||
const p = entry.payload;
|
||
const changes = p["changes"];
|
||
const changesObj = typeof changes === "object" && changes ? changes : {};
|
||
const filePaths = Object.keys(changesObj);
|
||
if (filePaths.length > 0) {
|
||
for (const fp2 of filePaths) {
|
||
pendingToolSequence.push([{ tool: "Edit", file: fp2 }]);
|
||
const diff = changesObj[fp2]?.["unified_diff"];
|
||
const loc = countUnifiedDiffLoc(diff);
|
||
pendingLocAdded += loc.added;
|
||
pendingLocRemoved += loc.removed;
|
||
}
|
||
} else {
|
||
pendingToolSequence.push([{ tool: "Edit" }]);
|
||
}
|
||
if (p["success"] === false) pendingEditFailed++;
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "mcp_tool_call_end") {
|
||
const endedAt = entry.timestamp ? Date.parse(entry.timestamp) : NaN;
|
||
const durationMs = entry.payload.duration_ms ?? durationValueMs(entry.payload.duration);
|
||
if (typeof durationMs === "number" && durationMs > 0 && Number.isFinite(endedAt)) {
|
||
taskToolIntervals.push([endedAt - durationMs, endedAt]);
|
||
}
|
||
const inv = entry.payload["invocation"];
|
||
const server = typeof inv?.["server"] === "string" ? inv["server"] : "";
|
||
const tool = typeof inv?.["tool"] === "string" ? inv["tool"] : "";
|
||
if (server && tool) {
|
||
const name = `mcp__${server}__${tool}`;
|
||
pendingTools.push(name);
|
||
pendingToolSequence.push([{ tool: name }]);
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "item_completed") {
|
||
const item = entry.payload["item"];
|
||
if (item && item["type"] === "CommandExecution") {
|
||
attributeShellCommand(shellCommandText(item["command"]), true);
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type === "response_item" && entry.payload?.type === "message" && entry.payload?.role === "user") {
|
||
const texts = normalizeContentBlocks(entry.payload.content).filter((c) => c.type === "input_text").map((c) => c.text ?? "").filter(Boolean);
|
||
if (texts.length > 0) {
|
||
pendingUserMessage = texts.join(" ").slice(0, 500);
|
||
currentTurnId = `${sessionId}:t${++turnCounter}`;
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type === "response_item" && entry.payload?.type === "message" && entry.payload?.role === "assistant") {
|
||
const texts = normalizeContentBlocks(entry.payload.content).filter((c) => c.type === "output_text" || c.type === "text").map((c) => c.text ?? "");
|
||
pendingOutputChars += texts.join("").length;
|
||
continue;
|
||
}
|
||
if (entry.type === "token_usage_record") {
|
||
const usage = entry.payload?.usage;
|
||
if (!isValidCodexTokenUsage(usage)) continue;
|
||
const responseId = entry.payload?.response_id;
|
||
if (isForkReplay && await isParentReplay(typeof responseId === "string" && responseId ? codexReplayResponseIdentity(responseId) : void 0)) continue;
|
||
hasTokenUsageRecord = true;
|
||
const dedupKey = typeof responseId === "string" && responseId ? `codex:${forkedFromId || sessionId}:response:${responseId}` : `codex:usage-record:${JSON.stringify([source.path, tracker.lastCompleteLineOffset])}`;
|
||
accountUsage(entry, usage, dedupKey);
|
||
continue;
|
||
}
|
||
if (entry.type === "event_msg" && entry.payload?.type === "token_count") {
|
||
if (hasTokenUsageRecord) continue;
|
||
const info = entry.payload.info;
|
||
if (!info) {
|
||
if (pendingOutputChars === 0 && pendingUserMessage.length === 0) continue;
|
||
const estInput = estimateTokensFromChars(pendingUserMessage.length);
|
||
const estOutput = estimateTokensFromChars(pendingOutputChars);
|
||
if (estInput === 0 && estOutput === 0) continue;
|
||
const model = sessionModel ?? "gpt-5";
|
||
const timestamp2 = entry.timestamp ?? "";
|
||
const dedupKey2 = `codex:${sessionId}:${timestamp2}:est${estCounter++}`;
|
||
if (seenKeys.has(dedupKey2)) {
|
||
pendingTools = [];
|
||
pendingToolSequence = [];
|
||
pendingSkills = [];
|
||
pendingUserMessage = "";
|
||
pendingOutputChars = 0;
|
||
pendingLocAdded = 0;
|
||
pendingLocRemoved = 0;
|
||
pendingEditFailed = 0;
|
||
continue;
|
||
}
|
||
seenKeys.add(dedupKey2);
|
||
const speed = speedForServiceTier(serviceTier);
|
||
const costUSD = calculateCost(pricingModelAt(model, timestamp2), estInput, estOutput, 0, 0, 0, speed, 0, "codex");
|
||
pendingTaskCalls.push({
|
||
provider: "codex",
|
||
model,
|
||
inputTokens: estInput,
|
||
outputTokens: estOutput,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: true,
|
||
tools: pendingTools,
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed,
|
||
deduplicationKey: dedupKey2,
|
||
turnId: currentTurnId,
|
||
toolSequence: pendingToolSequence.length > 0 ? pendingToolSequence : void 0,
|
||
...pendingSkills.length > 0 ? { skills: pendingSkills } : {},
|
||
userMessage: pendingUserMessage,
|
||
sessionId,
|
||
...sessionCwd ? { projectPath: sessionCwd, workingDirectory: sessionCwd } : {},
|
||
...pendingLocAdded ? { locAdded: pendingLocAdded } : {},
|
||
...pendingLocRemoved ? { locRemoved: pendingLocRemoved } : {},
|
||
...pendingEditFailed ? { editFailed: pendingEditFailed } : {}
|
||
});
|
||
taskGeneratedTokens += estOutput;
|
||
pendingTools = [];
|
||
pendingToolSequence = [];
|
||
pendingSkills = [];
|
||
pendingUserMessage = "";
|
||
pendingOutputChars = 0;
|
||
pendingLocAdded = 0;
|
||
pendingLocRemoved = 0;
|
||
pendingEditFailed = 0;
|
||
continue;
|
||
}
|
||
const cumulativeTotal = info.total_token_usage?.total_tokens ?? 0;
|
||
const reportsCumulative = typeof info.total_token_usage?.total_tokens === "number" && Number.isFinite(info.total_token_usage.total_tokens) && info.total_token_usage.total_tokens >= 0;
|
||
const infoIdentity = JSON.stringify(info);
|
||
if (infoIdentity === prevInfoIdentity) continue;
|
||
prevInfoIdentity = infoIdentity;
|
||
if (reportsCumulative && prevCumulativeTotal !== null && cumulativeTotal === prevCumulativeTotal) continue;
|
||
prevCumulativeTotal = reportsCumulative ? cumulativeTotal : null;
|
||
const last = info.last_token_usage;
|
||
let inputTokens = 0;
|
||
let cachedInputTokens = 0;
|
||
let cacheWriteTokens = 0;
|
||
let outputTokens = 0;
|
||
let reasoningTokens = 0;
|
||
if (last) {
|
||
inputTokens = last.input_tokens ?? 0;
|
||
cachedInputTokens = last.cached_input_tokens ?? 0;
|
||
cacheWriteTokens = last.cache_write_input_tokens ?? 0;
|
||
outputTokens = last.output_tokens ?? 0;
|
||
reasoningTokens = last.reasoning_output_tokens ?? 0;
|
||
} else if (cumulativeTotal > 0) {
|
||
const total2 = info.total_token_usage;
|
||
if (!total2) continue;
|
||
inputTokens = (total2.input_tokens ?? 0) - prevInput;
|
||
cachedInputTokens = (total2.cached_input_tokens ?? 0) - prevCached;
|
||
cacheWriteTokens = (total2.cache_write_input_tokens ?? 0) - prevCacheWrite;
|
||
outputTokens = (total2.output_tokens ?? 0) - prevOutput;
|
||
reasoningTokens = (total2.reasoning_output_tokens ?? 0) - prevReasoning;
|
||
}
|
||
const total = info.total_token_usage;
|
||
if (total) {
|
||
prevInput = total.input_tokens ?? 0;
|
||
prevCached = total.cached_input_tokens ?? 0;
|
||
prevCacheWrite = total.cache_write_input_tokens ?? 0;
|
||
prevOutput = total.output_tokens ?? 0;
|
||
prevReasoning = total.reasoning_output_tokens ?? 0;
|
||
}
|
||
const dedupKey = reportsCumulative ? `codex:${forkedFromId || sessionId}:${cumulativeTotal}:${total?.input_tokens ?? 0}:${total?.cached_input_tokens ?? 0}:${total?.output_tokens ?? 0}:${total?.reasoning_output_tokens ?? 0}` : `codex:record:${JSON.stringify([source.path, tracker.lastCompleteLineOffset])}`;
|
||
accountUsage(entry, {
|
||
input_tokens: inputTokens,
|
||
cached_input_tokens: cachedInputTokens,
|
||
cache_write_input_tokens: cacheWriteTokens,
|
||
output_tokens: outputTokens,
|
||
reasoning_output_tokens: reasoningTokens
|
||
}, dedupKey);
|
||
}
|
||
}
|
||
if (!sawAnyLine) {
|
||
if (resume) for (const call of results) yield call;
|
||
return;
|
||
}
|
||
results.push(...pendingTaskCalls);
|
||
const resumeWrite = resumeState ? { offset: resumeOffset, state: resumeState, callCount: resumeCallCount } : void 0;
|
||
if (capture) {
|
||
capture.write = { project: source.project, fingerprint: fp, ...resumeWrite ? { resume: resumeWrite } : {} };
|
||
} else {
|
||
await writeCachedCodexResults(source.path, source.project, results, fp, resumeWrite);
|
||
}
|
||
for (const call of results) {
|
||
yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function parseCodexFileFull(source, seenKeys) {
|
||
const capture = {};
|
||
const calls = [];
|
||
for await (const call of createParser6(source, seenKeys, capture).parse()) calls.push(call);
|
||
return { calls, ...capture.write ? { write: capture.write } : {} };
|
||
}
|
||
function rootsFor(home) {
|
||
return [
|
||
{ path: join11(home, "sessions"), label: "sessions" },
|
||
{ path: join11(home, "archived_sessions"), label: "archived" }
|
||
];
|
||
}
|
||
function dropOverlappingNestSources(sources, billedHome) {
|
||
const billedIds = listRolloutSessionIds(billedHome);
|
||
return sources.filter((source) => {
|
||
const id = rolloutFileSessionId(source.path);
|
||
return !(id && billedIds.has(id));
|
||
});
|
||
}
|
||
function createCodexProvider(codexDir, opts) {
|
||
const dir = getCodexDir(codexDir);
|
||
const primaryDir = opts?.primaryDir ?? defaultBilledCodexHome();
|
||
const launcherRoots = opts?.launcherRoots ?? defaultLauncherRoots();
|
||
const duplicateHome = codexDir !== void 0 && sameCodexHome(dir, primaryDir) && resolve3(dir) !== resolve3(primaryDir);
|
||
const nestHome = isNestedLauncherCodexHome(dir, { primaryDir, launcherRoots });
|
||
const scanBoth = nestHome && codexDir === void 0;
|
||
const wslCodexDirs = () => codexDir ? [] : wslHomes().map((home) => join11(home, ".codex"));
|
||
return {
|
||
name: "codex",
|
||
displayName: "Codex",
|
||
modelDisplayName(model) {
|
||
for (const [key, name] of modelDisplayEntries) {
|
||
if (model === key || model.startsWith(key + "-")) return name;
|
||
}
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap5[rawTool] ?? rawTool;
|
||
},
|
||
// Trees discoverSessions actually walks. Honors CODEX_HOME; when the
|
||
// production singleton scans nest + billed home, both appear here, plus
|
||
// each WSL home's ~/.codex.
|
||
async probeRoots() {
|
||
if (duplicateHome) return [];
|
||
const local = scanBoth ? [...rootsFor(primaryDir), ...rootsFor(dir)] : rootsFor(dir);
|
||
return [...local, ...wslCodexDirs().flatMap(rootsFor)];
|
||
},
|
||
async discoverSessions() {
|
||
if (duplicateHome) return [];
|
||
const sources = await discoverSessionsInDir(dir);
|
||
const wslSources = (await Promise.all(wslCodexDirs().map((d) => discoverSessionsInDir(d)))).flat();
|
||
let local;
|
||
if (scanBoth) {
|
||
const billed = await discoverSessionsInDir(primaryDir);
|
||
local = [...billed, ...dropOverlappingNestSources(sources, primaryDir)];
|
||
} else if (!nestHome) {
|
||
local = sources;
|
||
} else {
|
||
local = dropOverlappingNestSources(sources, primaryDir);
|
||
}
|
||
return [...local, ...wslSources];
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser6(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var modelDisplayNames2, modelDisplayEntries, toolNameMap5, MCP_CLI_CALL, SKILL_MD_READ, RAW_HEAD_BYTES, LARGE_TEXT_CAP, codex;
|
||
var init_codex = __esm({
|
||
"src/providers/codex.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_codex_cache();
|
||
init_codex_throughput();
|
||
init_codex_fork_replay();
|
||
init_content_utils();
|
||
init_token_estimate();
|
||
init_wsl();
|
||
init_launcher_homes();
|
||
modelDisplayNames2 = {
|
||
"codex-auto-review": "Codex Auto Review",
|
||
"gpt-5.5": "GPT-5.5",
|
||
"gpt-5.4-mini": "GPT-5.4 Mini",
|
||
"gpt-5.4": "GPT-5.4",
|
||
"gpt-5.3-codex-spark": "GPT-5.3 Codex Spark",
|
||
"gpt-5.3-codex": "GPT-5.3 Codex",
|
||
"gpt-5.2-low": "GPT-5.2 Low",
|
||
"gpt-5.2": "GPT-5.2",
|
||
"gpt-5": "GPT-5",
|
||
"gpt-4o-mini": "GPT-4o Mini",
|
||
"gpt-4o": "GPT-4o"
|
||
};
|
||
modelDisplayEntries = Object.entries(modelDisplayNames2).sort((a, b) => b[0].length - a[0].length);
|
||
toolNameMap5 = {
|
||
exec_command: "Bash",
|
||
// Codex Desktop's custom-tool transport uses the shorter `exec` name for
|
||
// the same shell tool that CLI rollouts record as `exec_command`.
|
||
exec: "Bash",
|
||
read_file: "Read",
|
||
write_file: "Edit",
|
||
apply_diff: "Edit",
|
||
apply_patch: "Edit",
|
||
spawn_agent: "Agent",
|
||
close_agent: "Agent",
|
||
wait_agent: "Agent",
|
||
read_dir: "Glob"
|
||
};
|
||
MCP_CLI_CALL = /(?<![\w.-])mcp-cli(?:\s+(?!call\b)[^\s;|&]+)*\s+call\s+(\S+)\s+(\S+)/;
|
||
SKILL_MD_READ = /(?<![\w.-])(?:cat|bat|sed|head|tail|less|more)\b[^;|&]*?[\s'"]([^\s;|&'"]*[\\/]([^\\/;|&'"]+)[\\/]SKILL\.md)\b/;
|
||
RAW_HEAD_BYTES = 64 * 1024;
|
||
LARGE_TEXT_CAP = 2e3;
|
||
codex = createCodexProvider();
|
||
}
|
||
});
|
||
|
||
// src/editor-data-dir.ts
|
||
import { posix as posix3, win32 as win323 } from "path";
|
||
function getEditorDataDir(editor, home, os) {
|
||
if (os === "darwin") return posix3.join(home, "Library", "Application Support", editor);
|
||
if (os === "win32") {
|
||
return win323.join(process.env["APPDATA"] || win323.join(home, "AppData", "Roaming"), editor);
|
||
}
|
||
return posix3.join(process.env["XDG_CONFIG_HOME"] || posix3.join(home, ".config"), editor);
|
||
}
|
||
var init_editor_data_dir = __esm({
|
||
"src/editor-data-dir.ts"() {
|
||
"use strict";
|
||
}
|
||
});
|
||
|
||
// src/context-tree.ts
|
||
import chalk2 from "chalk";
|
||
function estimateTokens(text2) {
|
||
return estimateTokensFromChars(text2.length);
|
||
}
|
||
var MAX_LINE_BYTES;
|
||
var init_context_tree = __esm({
|
||
"src/context-tree.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_format();
|
||
init_token_estimate();
|
||
MAX_LINE_BYTES = 256 * 1024 * 1024;
|
||
}
|
||
});
|
||
|
||
// src/sqlite.ts
|
||
var sqlite_exports = {};
|
||
__export(sqlite_exports, {
|
||
assertDatabaseReadable: () => assertDatabaseReadable,
|
||
blobToText: () => blobToText,
|
||
getSqliteLoadError: () => getSqliteLoadError,
|
||
isBlockedDatabaseError: () => isBlockedDatabaseError,
|
||
isPathBlocked: () => isPathBlocked,
|
||
isSqliteAvailable: () => isSqliteAvailable,
|
||
isSqliteBusyError: () => isSqliteBusyError,
|
||
isSqliteReadonlyError: () => isSqliteReadonlyError,
|
||
openDatabase: () => openDatabase,
|
||
probeDatabaseBlocked: () => probeDatabaseBlocked,
|
||
sqliteSupportsUriFilenames: () => sqliteSupportsUriFilenames,
|
||
warnSqliteReadonlyOnce: () => warnSqliteReadonlyOnce
|
||
});
|
||
import { createRequire } from "module";
|
||
import { spawn, spawnSync } from "child_process";
|
||
import { copyFileSync, existsSync as existsSync3, mkdirSync, readdirSync as readdirSync3, renameSync, statSync as statSync2, unlinkSync, utimesSync } from "fs";
|
||
import { createHash, randomBytes as randomBytes2 } from "crypto";
|
||
import { homedir as homedir12 } from "os";
|
||
import { join as join12, sep as sep2 } from "path";
|
||
import { pathToFileURL } from "url";
|
||
function blobToText(value) {
|
||
if (value == null) return "";
|
||
if (typeof value === "string") return value;
|
||
return textDecoder.decode(value);
|
||
}
|
||
function loadDriver() {
|
||
if (loadAttempted) return DatabaseSync !== null;
|
||
loadAttempted = true;
|
||
const origEmit = process.emit.bind(process);
|
||
let restored = false;
|
||
const restore = () => {
|
||
if (restored) return;
|
||
restored = true;
|
||
process.emit = origEmit;
|
||
};
|
||
process.emit = function patchedEmit(event, ...args) {
|
||
if (event === "warning") {
|
||
const warning = args[0];
|
||
if (warning?.name === "ExperimentalWarning" && typeof warning.message === "string" && /SQLite/i.test(warning.message)) {
|
||
return false;
|
||
}
|
||
}
|
||
return origEmit.call(this, event, ...args);
|
||
};
|
||
try {
|
||
const mod = requireForSqlite("node:sqlite");
|
||
DatabaseSync = mod.DatabaseSync;
|
||
return true;
|
||
} catch (err) {
|
||
const message = err instanceof Error ? err.message : String(err);
|
||
loadError = `SQLite-based providers (Cursor, OpenCode) need Node 22+ with the node:sqlite module.
|
||
Current Node: ${process.version}.
|
||
Upgrade Node (https://nodejs.org) and run codeburn again.
|
||
(underlying error: ${message})`;
|
||
return false;
|
||
} finally {
|
||
process.nextTick(restore);
|
||
}
|
||
}
|
||
function isSqliteAvailable() {
|
||
return loadDriver();
|
||
}
|
||
function getSqliteLoadError() {
|
||
return loadError ?? "SQLite driver not available";
|
||
}
|
||
function isSqliteBusyError(err) {
|
||
const e = err;
|
||
const code = typeof e?.code === "string" ? e.code : "";
|
||
const errcode = typeof e?.errcode === "number" ? e.errcode : null;
|
||
const message = [
|
||
typeof e?.message === "string" ? e.message : "",
|
||
typeof e?.errstr === "string" ? e.errstr : ""
|
||
].join(" ");
|
||
return errcode === 5 || errcode === 6 || code === "SQLITE_BUSY" || code === "SQLITE_LOCKED" || /\bSQLITE_(BUSY|LOCKED)\b|database (?:is |table is )?locked/i.test(message);
|
||
}
|
||
function isSqliteReadonlyError(err) {
|
||
const e = err;
|
||
const code = typeof e?.code === "string" ? e.code : "";
|
||
const errcode = typeof e?.errcode === "number" ? e.errcode : null;
|
||
const message = [
|
||
typeof e?.message === "string" ? e.message : "",
|
||
typeof e?.errstr === "string" ? e.errstr : ""
|
||
].join(" ");
|
||
return errcode !== null && (errcode & 255) === 8 || /SQLITE_READONLY|attempt to write a readonly database|readonly database|read-only database/i.test(`${code} ${message}`);
|
||
}
|
||
function isSqliteSidecarError(err) {
|
||
if (isSqliteReadonlyError(err)) return true;
|
||
const errcode = err?.errcode;
|
||
return typeof errcode === "number" && (errcode & 255) === 14;
|
||
}
|
||
function sqliteSupportsUriFilenames() {
|
||
if (uriFilenamesSupported !== null) return uriFilenamesSupported;
|
||
uriFilenamesSupported = false;
|
||
const Driver = loadDriver() ? DatabaseSync : null;
|
||
if (Driver !== null) {
|
||
try {
|
||
new Driver("file:codeburn-uri-probe?mode=memory", { readOnly: true }).close();
|
||
uriFilenamesSupported = true;
|
||
} catch {
|
||
}
|
||
}
|
||
return uriFilenamesSupported;
|
||
}
|
||
function warnSqliteOnce(path, message) {
|
||
if (warnedDatabases.has(path)) return;
|
||
warnedDatabases.add(path);
|
||
process.stderr.write(message);
|
||
}
|
||
function warnSqliteReadonlyOnce(path) {
|
||
warnSqliteOnce(
|
||
path,
|
||
`codeburn: SQLite database ${path} is in a read-only directory and needs sidecar files; using a cache copy when necessary. The original database is not modified.
|
||
`
|
||
);
|
||
}
|
||
function errorCode(err) {
|
||
if (typeof err !== "object" || err === null || !("code" in err)) return void 0;
|
||
const code = err.code;
|
||
return typeof code === "string" ? code : void 0;
|
||
}
|
||
function describeError(err) {
|
||
return err instanceof Error ? err.message : String(err);
|
||
}
|
||
function fingerprintDatabase(path) {
|
||
const main = statSync2(path);
|
||
let wal = null;
|
||
try {
|
||
wal = statSync2(path + "-wal");
|
||
} catch (err) {
|
||
if (errorCode(err) !== "ENOENT") throw err;
|
||
}
|
||
return {
|
||
dev: main.dev,
|
||
ino: main.ino,
|
||
mtimeMs: wal ? Math.max(main.mtimeMs, wal.mtimeMs) : main.mtimeMs,
|
||
sizeBytes: main.size + (wal?.size ?? 0),
|
||
walBytes: wal?.size ?? 0
|
||
};
|
||
}
|
||
function sameFingerprint(a, b) {
|
||
return a.dev === b.dev && a.ino === b.ino && a.mtimeMs === b.mtimeMs && a.sizeBytes === b.sizeBytes && a.walBytes === b.walBytes;
|
||
}
|
||
function unlinkQuietly(path) {
|
||
try {
|
||
unlinkSync(path);
|
||
} catch {
|
||
}
|
||
}
|
||
function copyOptionalFile(sourcePath, destinationPath) {
|
||
try {
|
||
copyFileSync(sourcePath, destinationPath);
|
||
return true;
|
||
} catch (err) {
|
||
if (errorCode(err) === "ENOENT") return false;
|
||
throw err;
|
||
}
|
||
}
|
||
function sourceKeyOf(sourcePath) {
|
||
return createHash("sha256").update(sourcePath, "utf8").digest("hex").slice(0, 32);
|
||
}
|
||
function cacheEntryName(sourceKey, fingerprint) {
|
||
const parts = `${fingerprint.dev}:${fingerprint.ino}:${fingerprint.mtimeMs}:${fingerprint.sizeBytes}:${fingerprint.walBytes}`;
|
||
return `${sourceKey}.${createHash("sha256").update(parts).digest("hex").slice(0, 16)}.db`;
|
||
}
|
||
function dropCopy(cacheDir, name) {
|
||
unlinkQuietly(join12(cacheDir, name));
|
||
unlinkQuietly(join12(cacheDir, name + "-wal"));
|
||
unlinkQuietly(join12(cacheDir, name + "-shm"));
|
||
}
|
||
function evictSupersededCopies(cacheDir, sourceKey, keepName) {
|
||
let names;
|
||
try {
|
||
names = readdirSync3(cacheDir);
|
||
} catch {
|
||
return;
|
||
}
|
||
const now = Date.now();
|
||
const superseded = [];
|
||
for (const name of names) {
|
||
if (!name.endsWith(".db") || name === keepName) continue;
|
||
let mtimeMs;
|
||
try {
|
||
mtimeMs = statSync2(join12(cacheDir, name)).mtimeMs;
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (name.startsWith(`${sourceKey}.`)) superseded.push({ name, mtimeMs });
|
||
else if (now - mtimeMs > CACHE_ENTRY_MAX_AGE_MS) dropCopy(cacheDir, name);
|
||
}
|
||
superseded.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
||
for (const [index, entry] of superseded.entries()) {
|
||
if (index > 0 || now - entry.mtimeMs > CACHE_ENTRY_MAX_AGE_MS) dropCopy(cacheDir, entry.name);
|
||
}
|
||
}
|
||
function publish(tempPath, finalPath) {
|
||
try {
|
||
renameSync(tempPath, finalPath);
|
||
} catch (err) {
|
||
if (!existsSync3(finalPath)) throw err;
|
||
}
|
||
}
|
||
function readOnlyCachePath(sourcePath, fingerprint) {
|
||
const cacheDir = join12(getCodeburnCacheDir(), "sqlite-ro");
|
||
mkdirSync(cacheDir, { recursive: true, mode: 448 });
|
||
const sourceKey = sourceKeyOf(sourcePath);
|
||
const name = cacheEntryName(sourceKey, fingerprint);
|
||
const cachePath = join12(cacheDir, name);
|
||
if (existsSync3(cachePath)) {
|
||
const now = /* @__PURE__ */ new Date();
|
||
try {
|
||
utimesSync(cachePath, now, now);
|
||
} catch {
|
||
}
|
||
evictSupersededCopies(cacheDir, sourceKey, name);
|
||
return cachePath;
|
||
}
|
||
const tempBase = `${cachePath}.tmp-${process.pid}-${randomBytes2(8).toString("hex")}`;
|
||
const tempWal = tempBase + "-wal";
|
||
try {
|
||
copyFileSync(sourcePath, tempBase);
|
||
const copiedWal = copyOptionalFile(sourcePath + "-wal", tempWal);
|
||
if (!sameFingerprint(fingerprintDatabase(sourcePath), fingerprint)) {
|
||
throw new Error("SQLite database changed while preparing its read-only cache copy");
|
||
}
|
||
if (copiedWal) publish(tempWal, cachePath + "-wal");
|
||
publish(tempBase, cachePath);
|
||
evictSupersededCopies(cacheDir, sourceKey, name);
|
||
return cachePath;
|
||
} finally {
|
||
unlinkQuietly(tempBase);
|
||
unlinkQuietly(tempWal);
|
||
}
|
||
}
|
||
function openReadonlyCache(path, originalError) {
|
||
const Driver = DatabaseSync;
|
||
if (Driver === null) throw new Error(getSqliteLoadError());
|
||
let fingerprint;
|
||
try {
|
||
fingerprint = fingerprintDatabase(path);
|
||
} catch {
|
||
throw originalError;
|
||
}
|
||
if (fingerprint.walBytes === 0 && sqliteSupportsUriFilenames()) {
|
||
try {
|
||
return new Driver(`${pathToFileURL(path).href}?immutable=1`, { readOnly: true });
|
||
} catch {
|
||
}
|
||
}
|
||
let cachedPath;
|
||
try {
|
||
cachedPath = readOnlyCachePath(path, fingerprint);
|
||
} catch (err) {
|
||
warnSqliteOnce(
|
||
path,
|
||
`codeburn: SQLite database ${path} is in a read-only directory and its cache copy could not be written (${describeError(err)}); skipping this database.
|
||
`
|
||
);
|
||
throw originalError;
|
||
}
|
||
return new Driver(cachedPath, { readOnly: true });
|
||
}
|
||
function isBlockedDatabaseError(err) {
|
||
return typeof err === "object" && err !== null && "codeburnBlocked" in err;
|
||
}
|
||
function classifyProbe(result, isGroupContainer) {
|
||
if (result.signal === "SIGKILL") return true;
|
||
if (result.error) return isGroupContainer;
|
||
return result.status !== 0 && result.status !== 2;
|
||
}
|
||
function refreshProbeAsync(key, path, script, execPath, isGroupContainer) {
|
||
if (tccProbeRefreshing.has(key)) return;
|
||
tccProbeRefreshing.add(key);
|
||
const settle = (result) => {
|
||
tccProbeRefreshing.delete(key);
|
||
tccProbeCache.set(key, { blocked: classifyProbe(result, isGroupContainer), at: Date.now() });
|
||
};
|
||
let child;
|
||
try {
|
||
child = spawn(execPath, ["-e", script, path], {
|
||
stdio: "ignore",
|
||
// process.execPath is Electron's binary in the desktop app; without this
|
||
// it would launch a second app window instead of running the script.
|
||
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" }
|
||
});
|
||
} catch (error) {
|
||
settle({ signal: null, error, status: null });
|
||
return;
|
||
}
|
||
const timer = setTimeout(() => {
|
||
child.kill("SIGKILL");
|
||
settle({ signal: "SIGKILL", status: null });
|
||
}, TCC_PROBE_TIMEOUT_MS);
|
||
timer.unref?.();
|
||
child.once("error", (error) => {
|
||
clearTimeout(timer);
|
||
settle({ signal: null, error, status: null });
|
||
});
|
||
child.once("exit", (status, signal) => {
|
||
clearTimeout(timer);
|
||
settle({ signal, status });
|
||
});
|
||
}
|
||
function probeDatabaseBlocked(path, script = TCC_PROBE, execPath = process.execPath) {
|
||
const now = Date.now();
|
||
const key = `${script}\0${path}`;
|
||
const isGroupContainer = path.startsWith(GROUP_CONTAINERS_PREFIX);
|
||
const cached2 = tccProbeCache.get(key);
|
||
if (cached2) {
|
||
if (now - cached2.at >= TCC_PROBE_CACHE_MS) refreshProbeAsync(key, path, script, execPath, isGroupContainer);
|
||
return cached2.blocked;
|
||
}
|
||
const probe = spawnSync(execPath, ["-e", script, path], {
|
||
timeout: TCC_PROBE_TIMEOUT_MS,
|
||
killSignal: "SIGKILL",
|
||
stdio: "ignore",
|
||
// process.execPath is Electron's binary in the desktop app; without this it
|
||
// would launch a second app window instead of running the script.
|
||
env: { ...process.env, ELECTRON_RUN_AS_NODE: "1" }
|
||
});
|
||
const blocked = classifyProbe(probe, isGroupContainer);
|
||
tccProbeCache.set(key, { blocked, at: now });
|
||
return blocked;
|
||
}
|
||
function isPathBlocked(path, script = TCC_PROBE) {
|
||
return path.startsWith(GROUP_CONTAINERS_PREFIX) && probeDatabaseBlocked(path, script);
|
||
}
|
||
function assertDatabaseReadable(path, script = TCC_PROBE) {
|
||
if (!isPathBlocked(path, script)) return;
|
||
if (!warnedTccBlocked) {
|
||
warnedTccBlocked = true;
|
||
process.stderr.write(
|
||
"codeburn: skipped warp: macOS blocked access to Warp's database; grant Full Disk Access to the app running codeburn (System Settings > Privacy & Security) and retry\n"
|
||
);
|
||
}
|
||
throw Object.assign(new Error(`macOS blocked access to ${path}`), { codeburnBlocked: true });
|
||
}
|
||
function openDatabase(path) {
|
||
if (!loadDriver() || DatabaseSync === null) {
|
||
throw new Error(getSqliteLoadError());
|
||
}
|
||
assertDatabaseReadable(path);
|
||
let db;
|
||
let fallbackUsed = false;
|
||
try {
|
||
db = new DatabaseSync(path, { readOnly: true });
|
||
} catch (err) {
|
||
if (!isSqliteSidecarError(err)) throw err;
|
||
fallbackUsed = true;
|
||
db = openReadonlyCache(path, err);
|
||
warnSqliteReadonlyOnce(path);
|
||
}
|
||
try {
|
||
db.exec?.("PRAGMA busy_timeout = 1000");
|
||
} catch {
|
||
}
|
||
return {
|
||
query(sql, params = []) {
|
||
try {
|
||
return db.prepare(sql).all(...params);
|
||
} catch (err) {
|
||
if (!isSqliteSidecarError(err)) throw err;
|
||
if (fallbackUsed) throw err;
|
||
fallbackUsed = true;
|
||
try {
|
||
db.close();
|
||
} catch {
|
||
}
|
||
db = openReadonlyCache(path, err);
|
||
warnSqliteReadonlyOnce(path);
|
||
try {
|
||
db.exec?.("PRAGMA busy_timeout = 1000");
|
||
} catch {
|
||
}
|
||
return db.prepare(sql).all(...params);
|
||
}
|
||
},
|
||
close() {
|
||
db.close();
|
||
}
|
||
};
|
||
}
|
||
var requireForSqlite, DatabaseSync, loadAttempted, loadError, textDecoder, uriFilenamesSupported, CACHE_ENTRY_MAX_AGE_MS, warnedDatabases, GROUP_CONTAINERS_PREFIX, TCC_PROBE, TCC_PROBE_TIMEOUT_MS, TCC_PROBE_CACHE_MS, tccProbeCache, tccProbeRefreshing, warnedTccBlocked;
|
||
var init_sqlite = __esm({
|
||
"src/sqlite.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
requireForSqlite = createRequire(import.meta.url);
|
||
DatabaseSync = null;
|
||
loadAttempted = false;
|
||
loadError = null;
|
||
textDecoder = new TextDecoder("utf-8", { fatal: false });
|
||
uriFilenamesSupported = null;
|
||
CACHE_ENTRY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
||
warnedDatabases = /* @__PURE__ */ new Set();
|
||
GROUP_CONTAINERS_PREFIX = join12(homedir12(), "Library", "Group Containers") + sep2;
|
||
TCC_PROBE = "try{require('node:fs').closeSync(require('node:fs').openSync(process.argv[1],'r'))}catch(e){process.exit(e.code==='ENOENT'?2:1)}";
|
||
TCC_PROBE_TIMEOUT_MS = 3e3;
|
||
TCC_PROBE_CACHE_MS = 6e4;
|
||
tccProbeCache = /* @__PURE__ */ new Map();
|
||
tccProbeRefreshing = /* @__PURE__ */ new Set();
|
||
warnedTccBlocked = false;
|
||
}
|
||
});
|
||
|
||
// src/providers/copilot.ts
|
||
import { readdir as readdir8, stat as stat10 } from "fs/promises";
|
||
import { homedir as homedir13, platform } from "os";
|
||
import { join as join13, basename as basename9, dirname as dirname3, posix as posix4, win32 as win324 } from "path";
|
||
import { existsSync as existsSync4 } from "fs";
|
||
import { createHash as createHash2 } from "crypto";
|
||
function stripCopilotPrefix(raw) {
|
||
return raw.replace(/^(?:copilot|github\.copilot-chat)\//, "").trim();
|
||
}
|
||
function extractRenderNodeTexts(node) {
|
||
if (!node || typeof node !== "object") return "";
|
||
let out = "";
|
||
if (node.type === 2 && typeof node.text === "string") {
|
||
out += node.text;
|
||
}
|
||
if (Array.isArray(node.children)) {
|
||
for (const child of node.children) {
|
||
out += extractRenderNodeTexts(child);
|
||
}
|
||
}
|
||
return out;
|
||
}
|
||
function extractToolCallResultContent(results) {
|
||
if (!results) return "";
|
||
let out = "";
|
||
for (const result of Object.values(results)) {
|
||
for (const item of result.content ?? []) {
|
||
if (typeof item.value === "string") {
|
||
out += item.value + "\n";
|
||
} else if (item.value && typeof item.value === "object" && "node" in item.value) {
|
||
out += extractRenderNodeTexts(item.value.node) + "\n";
|
||
}
|
||
}
|
||
}
|
||
return out;
|
||
}
|
||
function inferModelFromLegacySession(session) {
|
||
for (const req of session.requests ?? []) {
|
||
if (req.modelId) {
|
||
const stripped = stripCopilotPrefix(req.modelId);
|
||
if (stripped && stripped !== "auto" && stripped !== "copilot-auto" && stripped !== "unknown") {
|
||
return stripped;
|
||
}
|
||
}
|
||
}
|
||
const selectedModel = session.inputState?.selectedModel;
|
||
if (selectedModel) {
|
||
const version = selectedModel.metadata?.version || selectedModel.metadata?.family || selectedModel.identifier;
|
||
if (version) {
|
||
const stripped = stripCopilotPrefix(version);
|
||
if (stripped && stripped !== "copilot/auto" && stripped !== "auto" && stripped !== "copilot-auto") {
|
||
return stripped;
|
||
}
|
||
}
|
||
}
|
||
for (const req of session.requests ?? []) {
|
||
const rawRounds = req.result?.metadata?.["toolCallRounds"] ?? (isRecord4(req.result) ? req.result["toolCallRounds"] : null);
|
||
const rounds = Array.isArray(rawRounds) ? rawRounds : [];
|
||
for (const round of rounds) {
|
||
for (const tc of round.toolCalls ?? []) {
|
||
const id = tc.id ?? "";
|
||
for (const hint of transcriptToolCallModelHints) {
|
||
if (id.startsWith(hint.prefix)) {
|
||
return hint.model;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
const response = req.response;
|
||
for (const item of response ?? []) {
|
||
if (item && typeof item === "object") {
|
||
const itemTyped = item;
|
||
const id = itemTyped.toolCallId ?? "";
|
||
for (const hint of transcriptToolCallModelHints) {
|
||
if (id.startsWith(hint.prefix)) {
|
||
return hint.model;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return "unknown";
|
||
}
|
||
function extractToolCallResultContentFromParts(response) {
|
||
if (!response) return "";
|
||
let out = "";
|
||
for (const item of response) {
|
||
if (!item || typeof item !== "object") continue;
|
||
if (item.kind === "toolInvocationSerialized") {
|
||
const itemTyped = item;
|
||
const spec = itemTyped.toolSpecificData;
|
||
if (spec) {
|
||
if (spec.terminalCommandOutput && typeof spec.terminalCommandOutput.text === "string") {
|
||
out += spec.terminalCommandOutput.text + "\n";
|
||
}
|
||
}
|
||
const resultDetails = itemTyped.resultDetails;
|
||
if (resultDetails && typeof resultDetails === "object") {
|
||
if (resultDetails.output && resultDetails.output.type === "data" && resultDetails.output.mimeType?.startsWith("text/")) {
|
||
const base64 = resultDetails.output.base64Data;
|
||
if (typeof base64 === "string") {
|
||
const decoded = Buffer.from(base64, "base64").toString("utf8");
|
||
out += decoded + "\n";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return out;
|
||
}
|
||
function extractLegacyOutputs(req) {
|
||
let outputText = "";
|
||
let reasoningText = "";
|
||
let recordedReasoningTokens = 0;
|
||
const rounds = req.result?.metadata?.toolCallRounds;
|
||
const response = req.response;
|
||
if (rounds && rounds.length > 0) {
|
||
for (const round of rounds) {
|
||
if (typeof round.response === "string" && round.response) {
|
||
outputText += round.response + "\n";
|
||
}
|
||
for (const tc of round.toolCalls ?? []) {
|
||
if (typeof tc.arguments === "string" && tc.arguments) {
|
||
outputText += tc.arguments + "\n";
|
||
}
|
||
}
|
||
if (numberOrZero(round.thinking?.tokens) > 0) {
|
||
recordedReasoningTokens += round.thinking.tokens;
|
||
} else if (round.thinking) {
|
||
const text2 = round.thinking.text;
|
||
if (typeof text2 === "string" && text2) {
|
||
reasoningText += text2 + "\n";
|
||
} else if (Array.isArray(text2)) {
|
||
reasoningText += text2.join("\n") + "\n";
|
||
}
|
||
}
|
||
}
|
||
} else if (response && response.length > 0) {
|
||
for (const itemRaw of response) {
|
||
if (!itemRaw || typeof itemRaw !== "object") continue;
|
||
const item = itemRaw;
|
||
if ("value" in item && typeof item.value === "string" && !("kind" in item)) {
|
||
outputText += item.value + "\n";
|
||
} else if ((item.kind === "markdownContent" || item.kind === "markdownVuln") && item.content) {
|
||
if (typeof item.content === "string") {
|
||
outputText += item.content + "\n";
|
||
} else if (typeof item.content === "object" && item.content !== null && "value" in item.content && typeof item.content.value === "string") {
|
||
outputText += item.content.value + "\n";
|
||
}
|
||
} else if (item.kind === "thinking" && item.value) {
|
||
if (typeof item.value === "string") {
|
||
reasoningText += item.value + "\n";
|
||
} else if (Array.isArray(item.value)) {
|
||
reasoningText += item.value.join("\n") + "\n";
|
||
}
|
||
} else if (item.kind === "textEditGroup") {
|
||
const edits = item.edits;
|
||
if (Array.isArray(edits)) {
|
||
for (const edit of edits) {
|
||
if (Array.isArray(edit)) {
|
||
for (const e of edit) {
|
||
if (e && typeof e === "object" && "text" in e && typeof e.text === "string") {
|
||
outputText += e.text + "\n";
|
||
}
|
||
}
|
||
} else if (edit && typeof edit === "object" && "text" in edit && typeof edit.text === "string") {
|
||
outputText += edit.text + "\n";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
for (const item of response ?? []) {
|
||
if (item && typeof item === "object") {
|
||
const inv = item.invocationMessage;
|
||
if (typeof inv === "string" && inv) {
|
||
outputText += inv + "\n";
|
||
} else if (inv && typeof inv === "object" && "value" in inv && typeof inv.value === "string") {
|
||
outputText += inv.value + "\n";
|
||
}
|
||
}
|
||
}
|
||
return { outputText, reasoningText, recordedReasoningTokens };
|
||
}
|
||
function extractModelFromRequest(req, session) {
|
||
const result = isRecord4(req.result) ? req.result : void 0;
|
||
const metadata = isRecord4(result?.["metadata"]) ? result?.["metadata"] : void 0;
|
||
const resolvedMeta = readString(metadata?.["resolvedModel"]) || readString(metadata?.["model"]);
|
||
if (resolvedMeta) {
|
||
const stripped = stripCopilotPrefix(resolvedMeta);
|
||
if (stripped && stripped !== "auto" && stripped !== "copilot-auto") {
|
||
return stripped;
|
||
}
|
||
}
|
||
const resultResolved = readString(result?.["resolvedModel"]) || readString(result?.["model"]);
|
||
if (resultResolved) {
|
||
const stripped = stripCopilotPrefix(resultResolved);
|
||
if (stripped && stripped !== "auto" && stripped !== "copilot-auto") {
|
||
return stripped;
|
||
}
|
||
}
|
||
for (const part of req.response ?? []) {
|
||
if (part && typeof part === "object") {
|
||
const p = part;
|
||
if (p["kind"] === "autoModeResolution") {
|
||
const resolved = readString(p["resolvedModel"]) || readString(p["model"]) || readString(p["modelId"]);
|
||
if (resolved) {
|
||
const stripped = stripCopilotPrefix(resolved);
|
||
if (stripped && stripped !== "auto" && stripped !== "copilot-auto") {
|
||
return stripped;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (req.modelId) {
|
||
const stripped = stripCopilotPrefix(req.modelId);
|
||
if (stripped && stripped !== "auto" && stripped !== "copilot-auto") {
|
||
return stripped;
|
||
}
|
||
}
|
||
const inferred = inferModelFromLegacySession(session);
|
||
if (inferred && inferred !== "auto" && inferred !== "copilot-auto" && inferred !== "unknown") {
|
||
return inferred;
|
||
}
|
||
return "unknown";
|
||
}
|
||
function parseLegacyChatSession(session, sessionId, project, seenKeys) {
|
||
if (!session || !Array.isArray(session.requests)) return [];
|
||
const results = [];
|
||
for (const [reqIndex, req] of session.requests.entries()) {
|
||
const resultObj = isRecord4(req.result) ? req.result : null;
|
||
const meta = isRecord4(resultObj?.["metadata"]) ? resultObj?.["metadata"] : null;
|
||
const usage = isRecord4(resultObj?.["usage"]) ? resultObj?.["usage"] : null;
|
||
const exactPromptTokens = numberOrZero(meta?.["promptTokens"]) || numberOrZero(resultObj?.["promptTokens"]) || numberOrZero(req.promptTokens) || numberOrZero(usage?.["promptTokens"]) || numberOrZero(usage?.["prompt_tokens"]) || void 0;
|
||
const exactOutputTokens = numberOrZero(meta?.["outputTokens"]) || numberOrZero(resultObj?.["outputTokens"]) || numberOrZero(req.completionTokens) || numberOrZero(req.outputTokens) || numberOrZero(usage?.["completionTokens"]) || numberOrZero(usage?.["completion_tokens"]) || void 0;
|
||
const exactCacheRead = numberOrZero(meta?.["cacheReadTokens"]) || numberOrZero(meta?.["cachedTokens"]) || numberOrZero(resultObj?.["cacheReadTokens"]) || numberOrZero(resultObj?.["cachedTokens"]) || numberOrZero(usage?.["cacheReadTokens"]) || numberOrZero(usage?.["cache_read_tokens"]) || numberOrZero(usage?.["cachedTokens"]) || numberOrZero(usage?.["cached_tokens"]) || 0;
|
||
const exactCacheCreation = numberOrZero(meta?.["cacheCreationTokens"]) || numberOrZero(meta?.["cacheWriteTokens"]) || numberOrZero(resultObj?.["cacheCreationTokens"]) || numberOrZero(resultObj?.["cacheWriteTokens"]) || numberOrZero(usage?.["cacheCreationTokens"]) || numberOrZero(usage?.["cache_creation_tokens"]) || numberOrZero(usage?.["cacheWriteTokens"]) || numberOrZero(usage?.["cache_write_tokens"]) || 0;
|
||
const hasExactTokens = exactPromptTokens !== void 0 || exactOutputTokens !== void 0;
|
||
const model = extractModelFromRequest(req, session);
|
||
const rawRounds = meta?.["toolCallRounds"] ?? resultObj?.["toolCallRounds"];
|
||
const extracted = extractChatSessionTools({ toolCallRounds: rawRounds });
|
||
const toolNamesSet = new Set(extracted.tools);
|
||
for (const item of req.response ?? []) {
|
||
const part = item;
|
||
if (part?.kind === "toolInvocationSerialized" && typeof part.toolId === "string" && part.toolId.trim()) {
|
||
toolNamesSet.add(normalizeTool(part.toolId.trim()));
|
||
}
|
||
}
|
||
const tools = [...toolNamesSet];
|
||
const msgText = typeof req.message === "string" ? req.message : req.message?.text ?? "";
|
||
const { outputText, reasoningText, recordedReasoningTokens } = extractLegacyOutputs(req);
|
||
let totalInputTokens;
|
||
let outputTokens;
|
||
let cacheReadInputTokens = exactCacheRead;
|
||
let cacheCreationInputTokens = exactCacheCreation;
|
||
let reasoningTokens = 0;
|
||
let isEstimated = false;
|
||
if (hasExactTokens) {
|
||
totalInputTokens = exactPromptTokens ?? 0;
|
||
outputTokens = exactOutputTokens ?? 0;
|
||
isEstimated = false;
|
||
} else {
|
||
isEstimated = true;
|
||
reasoningTokens = recordedReasoningTokens + Math.ceil(reasoningText.length / CHARS_PER_TOKEN_LEGACY);
|
||
const globalParts = (meta?.["renderedGlobalContext"] ?? []).filter(
|
||
(p) => isRecord4(p) && p.type === 1 /* Text */ && typeof p.text === "string"
|
||
);
|
||
const userParts = (meta?.["renderedUserMessage"] ?? []).filter(
|
||
(p) => isRecord4(p) && p.type === 1 /* Text */ && typeof p.text === "string"
|
||
);
|
||
const globalCacheMarkers = (meta?.["renderedGlobalContext"] ?? []).filter(
|
||
(p) => isRecord4(p) && p.type === 3 /* CacheBreakpoint */
|
||
);
|
||
const userCacheMarkers = (meta?.["renderedUserMessage"] ?? []).filter(
|
||
(p) => isRecord4(p) && p.type === 3 /* CacheBreakpoint */
|
||
);
|
||
let inputTokens = 0;
|
||
const hasRenderedMetadata = globalParts.length > 0 || userParts.length > 0;
|
||
if (hasRenderedMetadata) {
|
||
const globalText = globalParts.map((p) => p.text).join("\n");
|
||
const userText2 = userParts.map((p) => p.text).join("\n");
|
||
if (globalCacheMarkers.length > 0 || userCacheMarkers.length > 0) {
|
||
if (globalCacheMarkers.length > 0) {
|
||
cacheReadInputTokens = Math.ceil(globalText.length / CHARS_PER_TOKEN_LEGACY);
|
||
} else {
|
||
inputTokens = Math.ceil(globalText.length / CHARS_PER_TOKEN_LEGACY);
|
||
}
|
||
const attachmentText = userText2.replace(msgText, "");
|
||
if (userCacheMarkers.length > 0 && attachmentText.length > 0) {
|
||
cacheCreationInputTokens = Math.ceil(attachmentText.length / CHARS_PER_TOKEN_LEGACY);
|
||
} else if (userCacheMarkers.length === 0) {
|
||
inputTokens += Math.ceil(userText2.length / CHARS_PER_TOKEN_LEGACY);
|
||
inputTokens -= Math.ceil(msgText.length / CHARS_PER_TOKEN_LEGACY);
|
||
}
|
||
inputTokens += Math.ceil(msgText.length / CHARS_PER_TOKEN_LEGACY);
|
||
} else {
|
||
inputTokens = Math.ceil((globalText + "\n" + userText2).length / CHARS_PER_TOKEN_LEGACY);
|
||
}
|
||
} else {
|
||
inputTokens = Math.ceil(msgText.length / CHARS_PER_TOKEN_LEGACY);
|
||
}
|
||
let toolResultText = extractToolCallResultContent(meta?.["toolCallResults"]);
|
||
if (!toolResultText) {
|
||
toolResultText = extractToolCallResultContentFromParts(req.response);
|
||
}
|
||
const toolResultTokens = Math.ceil(toolResultText.length / CHARS_PER_TOKEN_LEGACY);
|
||
totalInputTokens = inputTokens + toolResultTokens;
|
||
outputTokens = Math.ceil(outputText.length / CHARS_PER_TOKEN_LEGACY);
|
||
if (outputTokens === 0 && totalInputTokens === 0 && cacheCreationInputTokens === 0 && reasoningTokens === 0) {
|
||
continue;
|
||
}
|
||
}
|
||
const reqId = readString(req.requestId) || `request-${reqIndex}`;
|
||
const dedupKey = `copilot-chatsession:${sessionId}:${reqId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const costUSD = calculateCost(
|
||
model,
|
||
totalInputTokens,
|
||
outputTokens + reasoningTokens,
|
||
cacheCreationInputTokens,
|
||
cacheReadInputTokens,
|
||
0
|
||
);
|
||
const ts = timestampToISO(req.timestamp) || timestampToISO(session.creationDate);
|
||
results.push({
|
||
provider: "copilot",
|
||
model,
|
||
inputTokens: totalInputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens,
|
||
cacheReadInputTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: isEstimated,
|
||
tools,
|
||
bashCommands: extracted.bashCommands,
|
||
skills: extracted.skills.length > 0 ? extracted.skills : void 0,
|
||
timestamp: ts,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: msgText,
|
||
sessionId,
|
||
project
|
||
});
|
||
}
|
||
return results;
|
||
}
|
||
function normalizeTool(rawTool) {
|
||
const mapped = toolNameMap6[rawTool];
|
||
if (mapped) return mapped;
|
||
const dashIdx = rawTool.lastIndexOf("-");
|
||
if (dashIdx > 0 && rawTool.includes("_")) {
|
||
const server = rawTool.slice(0, dashIdx).replace(/-/g, "_");
|
||
const tool = rawTool.slice(dashIdx + 1);
|
||
return `mcp__${server}__${tool}`;
|
||
}
|
||
return rawTool;
|
||
}
|
||
function getCopilotSessionStateDir(override) {
|
||
return override ?? process.env["CODEBURN_COPILOT_SESSION_STATE_DIR"] ?? join13(homedir13(), ".copilot", "session-state");
|
||
}
|
||
function getSessionStoreDbPath(override) {
|
||
return override ?? process.env["CODEBURN_COPILOT_SESSION_STORE_DB"] ?? join13(homedir13(), ".copilot", "session-store.db");
|
||
}
|
||
function getAgentTracesDbPath() {
|
||
const envOverride = process.env["CODEBURN_COPILOT_OTEL_DB"];
|
||
if (envOverride) {
|
||
return existsSync4(envOverride) ? envOverride : null;
|
||
}
|
||
const candidates = getVSCodeGlobalStorageDirs(homedir13(), platform()).map((dir) => join13(dir, "github.copilot-chat", "agent-traces.db"));
|
||
for (const candidate of candidates) {
|
||
if (existsSync4(candidate)) return candidate;
|
||
}
|
||
return null;
|
||
}
|
||
function getJetBrainsCopilotRoot(override) {
|
||
const envOverride = override ?? process.env["CODEBURN_COPILOT_JETBRAINS_DIR"];
|
||
if (envOverride) return envOverride;
|
||
const xdg = process.env["XDG_CONFIG_HOME"];
|
||
if (xdg && (posix4.isAbsolute(xdg) || win324.isAbsolute(xdg))) {
|
||
return join13(xdg, "github-copilot");
|
||
}
|
||
if (platform() === "win32") {
|
||
const local = process.env["LOCALAPPDATA"] ?? join13(homedir13(), "AppData", "Local");
|
||
return join13(local, "github-copilot");
|
||
}
|
||
return join13(homedir13(), ".config", "github-copilot");
|
||
}
|
||
function parseCwd(yaml) {
|
||
const match = yaml.match(/^cwd:\s*(.+)$/m);
|
||
if (!match?.[1]) return null;
|
||
let raw = match[1].trim();
|
||
raw = raw.replace(/\s*#.*$/, "");
|
||
raw = raw.replace(/^['"]|['"]$/g, "").trim();
|
||
return raw || null;
|
||
}
|
||
function loadSpanAttributesFromTable(db, spanId) {
|
||
try {
|
||
const rows = db.query(
|
||
`SELECT key, value FROM span_attributes WHERE span_id = ?`,
|
||
[spanId]
|
||
);
|
||
const attrs = {};
|
||
for (const row of rows) {
|
||
if (row.key && row.value) {
|
||
try {
|
||
const numValue = Number(row.value);
|
||
attrs[row.key] = Number.isNaN(numValue) ? row.value : numValue;
|
||
} catch {
|
||
attrs[row.key] = row.value;
|
||
}
|
||
}
|
||
}
|
||
return attrs;
|
||
} catch {
|
||
return {};
|
||
}
|
||
}
|
||
function epochToISO(epoch) {
|
||
if (!Number.isFinite(epoch) || epoch <= 0) return (/* @__PURE__ */ new Date(0)).toISOString();
|
||
const ms = epoch > 1e15 ? Math.floor(epoch / 1e6) : epoch > 1e12 ? epoch : epoch * 1e3;
|
||
return new Date(ms).toISOString();
|
||
}
|
||
function timestampToISO(raw) {
|
||
if (typeof raw === "number" && Number.isFinite(raw) && raw > 0) {
|
||
return epochToISO(raw);
|
||
}
|
||
if (typeof raw !== "string") return "";
|
||
const trimmed = raw.trim();
|
||
if (!trimmed) return "";
|
||
if (/^\d+(\.\d+)?$/.test(trimmed)) {
|
||
return epochToISO(Number(trimmed));
|
||
}
|
||
const parsed = Date.parse(trimmed);
|
||
return Number.isNaN(parsed) ? "" : new Date(parsed).toISOString();
|
||
}
|
||
function isRecord4(value) {
|
||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||
}
|
||
function isReplayContainer(value) {
|
||
return typeof value === "object" && value !== null;
|
||
}
|
||
function createReplayObject() {
|
||
return /* @__PURE__ */ Object.create(null);
|
||
}
|
||
function parseChatJournalPath(rawPath, fallback) {
|
||
const value = rawPath === void 0 ? fallback : rawPath;
|
||
if (!Array.isArray(value)) return null;
|
||
const path = [];
|
||
for (const segment of value) {
|
||
if (typeof segment === "number") {
|
||
if (!Number.isInteger(segment) || segment < 0) return null;
|
||
path.push(segment);
|
||
continue;
|
||
}
|
||
if (typeof segment === "string") {
|
||
if (FORBIDDEN_CHAT_JOURNAL_KEYS.has(segment)) return null;
|
||
path.push(segment);
|
||
continue;
|
||
}
|
||
return null;
|
||
}
|
||
return path;
|
||
}
|
||
function getReplayValue(container, segment) {
|
||
return container[String(segment)];
|
||
}
|
||
function setReplayValue(container, segment, value) {
|
||
;
|
||
container[String(segment)] = value;
|
||
}
|
||
function createContainerForNext(segment) {
|
||
return typeof segment === "number" ? [] : createReplayObject();
|
||
}
|
||
function ensureReplayParent(root, path) {
|
||
let current = root;
|
||
for (let i = 0; i < path.length - 1; i++) {
|
||
const segment = path[i];
|
||
const nextSegment = path[i + 1];
|
||
let child = getReplayValue(current, segment);
|
||
if (!isReplayContainer(child)) {
|
||
const created = createContainerForNext(nextSegment);
|
||
setReplayValue(current, segment, created);
|
||
current = created;
|
||
continue;
|
||
}
|
||
current = child;
|
||
}
|
||
return current;
|
||
}
|
||
function applyChatJournalSet(root, path, value) {
|
||
if (path.length === 0) return value;
|
||
const workingRoot = isReplayContainer(root) ? root : createReplayObject();
|
||
const parent = ensureReplayParent(workingRoot, path);
|
||
if (!parent) return workingRoot;
|
||
setReplayValue(parent, path[path.length - 1], value);
|
||
return workingRoot;
|
||
}
|
||
function applyChatJournalAppend(root, path, items) {
|
||
const workingRoot = isReplayContainer(root) ? root : createReplayObject();
|
||
if (path.length === 0) {
|
||
if (Array.isArray(workingRoot)) {
|
||
for (const item of items) workingRoot.push(item);
|
||
}
|
||
return workingRoot;
|
||
}
|
||
const parent = ensureReplayParent(workingRoot, path);
|
||
if (!parent) return workingRoot;
|
||
const last = path[path.length - 1];
|
||
let target = getReplayValue(parent, last);
|
||
const targetArray = Array.isArray(target) ? target : [];
|
||
if (target !== targetArray) {
|
||
setReplayValue(parent, last, targetArray);
|
||
}
|
||
for (const item of items) targetArray.push(item);
|
||
return workingRoot;
|
||
}
|
||
function replayChatSessionJournal(content2) {
|
||
let root = createReplayObject();
|
||
const lines = content2.split("\n").filter((l) => l.trim());
|
||
for (const line of lines) {
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (!isRecord4(entry)) continue;
|
||
const kind = entry["kind"];
|
||
if (kind === 0) {
|
||
root = entry["v"];
|
||
continue;
|
||
}
|
||
if (kind === 1) {
|
||
const path = parseChatJournalPath(entry["k"]);
|
||
if (!path) continue;
|
||
root = applyChatJournalSet(root, path, entry["v"]);
|
||
continue;
|
||
}
|
||
if (kind === 2) {
|
||
const hasPath = Object.prototype.hasOwnProperty.call(entry, "k");
|
||
const path = parseChatJournalPath(hasPath ? entry["k"] : void 0, ["requests"]);
|
||
const items = Array.isArray(entry["v"]) ? entry["v"] : [];
|
||
if (!path) continue;
|
||
root = applyChatJournalAppend(root, path, items);
|
||
}
|
||
}
|
||
return root;
|
||
}
|
||
function numberOrZero(raw) {
|
||
return typeof raw === "number" && Number.isFinite(raw) && raw > 0 ? raw : 0;
|
||
}
|
||
function readString(raw) {
|
||
return typeof raw === "string" ? raw : "";
|
||
}
|
||
function modelFromChatSessionRequest(req, metadata) {
|
||
const resolved = readString(metadata["resolvedModel"]);
|
||
if (resolved) return resolved;
|
||
const modelId = readString(req["modelId"]).replace(/^copilot\//, "");
|
||
return modelId || "unknown";
|
||
}
|
||
function parseStructuredArguments(raw) {
|
||
const payload = typeof raw === "string" ? (() => {
|
||
try {
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
})() : raw;
|
||
return isRecord4(payload) ? payload : null;
|
||
}
|
||
function extractStructuredSkill(raw) {
|
||
const payload = parseStructuredArguments(raw);
|
||
if (!payload) return null;
|
||
const skill = payload["skill"];
|
||
return typeof skill === "string" && skill.trim() ? skill.trim() : null;
|
||
}
|
||
function extractChatSessionTools(metadata) {
|
||
const rounds = metadata["toolCallRounds"];
|
||
if (!Array.isArray(rounds)) return { tools: [], skills: [], bashCommands: [] };
|
||
const names = /* @__PURE__ */ new Set();
|
||
const skills = /* @__PURE__ */ new Set();
|
||
const bashCommands = [];
|
||
const addName = (raw) => {
|
||
if (typeof raw === "string" && raw.trim()) names.add(normalizeTool(raw));
|
||
};
|
||
const addFromRecord = (record) => {
|
||
const rawNames = ["toolName", "name", "tool"].map((key) => record[key]);
|
||
for (const raw of rawNames) {
|
||
addName(raw);
|
||
if (typeof raw !== "string" || normalizeTool(raw) !== "Skill") continue;
|
||
const skill = extractStructuredSkill(record["arguments"]) ?? extractStructuredSkill(record["input"]);
|
||
if (skill) skills.add(skill);
|
||
}
|
||
if (rawNames.some((raw) => typeof raw === "string" && BASH_TOOL_NAMES.has(raw))) {
|
||
const args = parseStructuredArguments(record["arguments"]) ?? parseStructuredArguments(record["input"]);
|
||
const command = args?.["command"];
|
||
if (typeof command === "string") bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
};
|
||
for (const round of rounds) {
|
||
if (!isRecord4(round)) continue;
|
||
addFromRecord(round);
|
||
for (const key of ["tools", "toolCalls", "toolRequests"]) {
|
||
const entries = round[key];
|
||
if (!Array.isArray(entries)) continue;
|
||
for (const entry of entries) {
|
||
if (typeof entry === "string") {
|
||
addName(entry);
|
||
} else if (isRecord4(entry)) {
|
||
addFromRecord(entry);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return { tools: [...names], skills: [...skills], bashCommands };
|
||
}
|
||
function parseToolCommand(raw) {
|
||
if (typeof raw !== "string" || !raw.trim()) return null;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
const command = parsed["command"];
|
||
return typeof command === "string" ? command : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function extractOtelBashCommands(command) {
|
||
const normalized = command.replace(/\r?\n/g, "; ");
|
||
return extractBashCommands(normalized).filter((c) => !OTEL_SHELL_KEYWORDS.has(c));
|
||
}
|
||
function coerceToolRequests(raw) {
|
||
return Array.isArray(raw) ? raw : [];
|
||
}
|
||
function inferTranscriptModel(lines) {
|
||
let openaiCount = 0;
|
||
let anthropicCount = 0;
|
||
for (const line of lines) {
|
||
try {
|
||
const event = JSON.parse(line);
|
||
if (event.type !== "assistant.message") continue;
|
||
const data = event.data;
|
||
const reqs = coerceToolRequests(data.toolRequests);
|
||
for (const req of reqs) {
|
||
const id = req.toolCallId;
|
||
if (typeof id !== "string") continue;
|
||
if (id.startsWith("call_")) openaiCount++;
|
||
else if (/^tooluse_|^toolu_/.test(id)) anthropicCount++;
|
||
}
|
||
} catch {
|
||
continue;
|
||
}
|
||
}
|
||
if (openaiCount === 0 && anthropicCount === 0) return "";
|
||
return openaiCount >= anthropicCount ? "copilot-openai-auto" : "copilot-anthropic-auto";
|
||
}
|
||
function createJsonlParser(source, seenKeys, isTranscript) {
|
||
return {
|
||
async *parse() {
|
||
const content2 = await readSessionFile(source.path);
|
||
if (!content2) return;
|
||
const sessionId = isTranscript ? basename9(source.path, ".jsonl") : basename9(dirname3(source.path));
|
||
const lines = content2.split("\n").filter((l) => l.trim());
|
||
let currentModel = "";
|
||
let pendingUserMessage = "";
|
||
let selectedSubagentType;
|
||
const activeSubagents = [];
|
||
const currentSubagentType = () => activeSubagents[activeSubagents.length - 1]?.name ?? selectedSubagentType;
|
||
if (isTranscript) {
|
||
currentModel = inferTranscriptModel(lines);
|
||
}
|
||
let lastEventTimestamp = "";
|
||
let lastCompactionTs = "";
|
||
const prevShutdownUsage = /* @__PURE__ */ new Map();
|
||
const shutdownCountByModel = /* @__PURE__ */ new Map();
|
||
let legHasPerTurnOutput = false;
|
||
for (const line of lines) {
|
||
let event;
|
||
try {
|
||
event = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (typeof event.timestamp === "string" && event.timestamp) lastEventTimestamp = event.timestamp;
|
||
if (event.type === "session.start") {
|
||
if (!isTranscript) {
|
||
currentModel = event.data.selectedModel ?? currentModel;
|
||
}
|
||
continue;
|
||
}
|
||
if (event.type === "session.model_change") {
|
||
currentModel = event.data.newModel ?? currentModel;
|
||
continue;
|
||
}
|
||
if (event.type === "session.compaction_complete") {
|
||
const data = event.data;
|
||
const ts = typeof event.timestamp === "string" ? event.timestamp : "";
|
||
if (data?.success === true && ts && !Number.isNaN(new Date(ts).getTime())) {
|
||
lastCompactionTs = ts;
|
||
}
|
||
continue;
|
||
}
|
||
if (event.type === "session.compaction_start") continue;
|
||
if (event.type === "subagent.selected") {
|
||
selectedSubagentType = event.data.agentName;
|
||
continue;
|
||
}
|
||
if (event.type === "subagent.started") {
|
||
const data = event.data;
|
||
activeSubagents.push({ toolCallId: data.toolCallId ?? "", name: data.agentName });
|
||
continue;
|
||
}
|
||
if (event.type === "subagent.completed") {
|
||
const id = event.data.toolCallId ?? "";
|
||
if (!id) {
|
||
activeSubagents.pop();
|
||
continue;
|
||
}
|
||
for (let i = activeSubagents.length - 1; i >= 0; i--) {
|
||
if (activeSubagents[i].toolCallId === id) {
|
||
activeSubagents.splice(i, 1);
|
||
break;
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
if (event.type === "user.message") {
|
||
pendingUserMessage = event.data.content ?? "";
|
||
continue;
|
||
}
|
||
if (event.type === "session.shutdown") {
|
||
if (isTranscript) continue;
|
||
const shutdownData = event.data;
|
||
const modelMetrics = shutdownData.modelMetrics;
|
||
if (!isRecord4(modelMetrics)) continue;
|
||
const shutdownTimestamp = (event.timestamp ?? "") || lastEventTimestamp || timestampToISO(shutdownData.sessionStartTime);
|
||
for (const [model, metrics] of Object.entries(modelMetrics)) {
|
||
if (!model || !isRecord4(metrics)) continue;
|
||
const usage = metrics["usage"];
|
||
if (!isRecord4(usage)) continue;
|
||
const hasNanoAiu = typeof metrics["totalNanoAiu"] === "number";
|
||
const cumulative = {
|
||
inputTokens: numberOrZero(usage["inputTokens"]),
|
||
outputTokens: numberOrZero(usage["outputTokens"]),
|
||
cacheReadTokens: numberOrZero(usage["cacheReadTokens"]),
|
||
cacheWriteTokens: numberOrZero(usage["cacheWriteTokens"]),
|
||
reasoningTokens: numberOrZero(usage["reasoningTokens"]),
|
||
nanoAiu: numberOrZero(metrics["totalNanoAiu"])
|
||
};
|
||
const prevRaw = prevShutdownUsage.get(model);
|
||
prevShutdownUsage.set(model, cumulative);
|
||
const n = (shutdownCountByModel.get(model) ?? 0) + 1;
|
||
shutdownCountByModel.set(model, n);
|
||
const prev = prevRaw && cumulative.inputTokens < numberOrZero(prevRaw.inputTokens) ? void 0 : prevRaw;
|
||
const delta = (k) => Math.max(0, cumulative[k] - numberOrZero(prev?.[k]));
|
||
const outputTokens = legHasPerTurnOutput ? 0 : delta("outputTokens");
|
||
const nanoAiu = hasNanoAiu ? Math.max(0, cumulative.nanoAiu - (prevRaw && cumulative.nanoAiu >= prevRaw.nanoAiu ? prevRaw.nanoAiu : 0)) : void 0;
|
||
const cacheReadTokens = delta("cacheReadTokens");
|
||
const cacheWriteTokens = delta("cacheWriteTokens");
|
||
const reasoningTokens = delta("reasoningTokens");
|
||
const inputTokens = Math.max(
|
||
0,
|
||
delta("inputTokens") - cacheReadTokens - cacheWriteTokens
|
||
);
|
||
if (inputTokens === 0 && outputTokens === 0 && cacheReadTokens === 0 && cacheWriteTokens === 0 && reasoningTokens === 0 && !nanoAiu) continue;
|
||
const dedupKey = `copilot:${sessionId}:shutdown:${model}:${n}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const costUSD = calculateCost(model, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, 0);
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId,
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheWriteTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: false,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: shutdownTimestamp,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
...lastCompactionTs ? { compactedAt: lastCompactionTs } : {},
|
||
...nanoAiu !== void 0 ? { nanoAiu } : {}
|
||
};
|
||
}
|
||
legHasPerTurnOutput = false;
|
||
continue;
|
||
}
|
||
if (event.type === "assistant.message") {
|
||
const msgData = event.data;
|
||
const { messageId, model: msgModel, outputTokens = 0 } = msgData;
|
||
const hasOutputField = typeof msgData.outputTokens === "number";
|
||
if (hasOutputField) legHasPerTurnOutput = true;
|
||
const rawRequests = msgData.toolRequests;
|
||
const toolRequests = coerceToolRequests(rawRequests);
|
||
if (msgModel) currentModel = msgModel;
|
||
if (!isTranscript && hasOutputField && outputTokens === 0) continue;
|
||
if (!currentModel) continue;
|
||
const dedupKey = `copilot:${sessionId}:${messageId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const tools = toolRequests.map((t) => {
|
||
const raw = typeof t === "object" && t !== null ? t.name ?? t.toolName : null;
|
||
return typeof raw === "string" ? normalizeTool(raw) : null;
|
||
}).filter((t) => t !== null);
|
||
const skills = toolRequests.flatMap((t) => {
|
||
if (typeof t !== "object" || t === null) return [];
|
||
const name = t.name ?? t.toolName ?? "";
|
||
if (name !== "skill") return [];
|
||
const skill = t.arguments?.["skill"];
|
||
return typeof skill === "string" && skill.trim().length > 0 ? [skill.trim()] : [];
|
||
});
|
||
const bashCommands = toolRequests.flatMap((t) => {
|
||
if (typeof t !== "object" || t === null) return [];
|
||
const name = t.name ?? t.toolName ?? "";
|
||
if (!BASH_TOOL_NAMES.has(name)) return [];
|
||
const cmd = t.arguments?.["command"];
|
||
return typeof cmd === "string" ? extractBashCommands(cmd) : [];
|
||
});
|
||
const costUSD = calculateCost(currentModel, 0, outputTokens, 0, 0, 0);
|
||
const subagentType = currentSubagentType();
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId,
|
||
model: currentModel,
|
||
inputTokens: 0,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
// A transcript with no token count has unknown usage, not zero. A
|
||
// counted output is measured; the shutdown rollup or store rows
|
||
// carry the input (and, for tokenless CLI messages, the output).
|
||
...isTranscript && outputTokens === 0 ? { costIsEstimated: true } : {},
|
||
tools,
|
||
bashCommands,
|
||
skills: skills.length > 0 ? skills : void 0,
|
||
subagentTypes: subagentType ? [subagentType] : void 0,
|
||
timestamp: event.timestamp ?? "",
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage
|
||
};
|
||
pendingUserMessage = "";
|
||
}
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createChatSessionParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const content2 = await readSessionFile(source.path);
|
||
if (!content2) return;
|
||
if (source.path.endsWith(".json")) {
|
||
let session;
|
||
try {
|
||
session = JSON.parse(content2);
|
||
} catch {
|
||
return;
|
||
}
|
||
const sessionId2 = readString(session.sessionId) || basename9(source.path, ".json");
|
||
yield* parseLegacyChatSession(session, sessionId2, source.project, seenKeys);
|
||
return;
|
||
}
|
||
const root = replayChatSessionJournal(content2);
|
||
if (!isRecord4(root)) return;
|
||
const sessionId = readString(root["sessionId"]) || basename9(source.path, ".jsonl");
|
||
const sessionCreatedAt = timestampToISO(root["creationDate"]);
|
||
const requests = Array.isArray(root["requests"]) ? root["requests"] : [];
|
||
for (let index = 0; index < requests.length; index++) {
|
||
const rawReq = requests[index];
|
||
if (!isRecord4(rawReq)) continue;
|
||
const result = rawReq["result"];
|
||
const resultRecord = isRecord4(result) ? result : null;
|
||
const rawMetadata = resultRecord?.["metadata"];
|
||
const metadata = isRecord4(rawMetadata) ? rawMetadata : createReplayObject();
|
||
const inputTokens = numberOrZero(metadata["promptTokens"]) || numberOrZero(rawReq["promptTokens"]);
|
||
const metadataOutputTokens = numberOrZero(metadata["outputTokens"]);
|
||
const outputTokens = metadataOutputTokens || numberOrZero(rawReq["completionTokens"]);
|
||
if (inputTokens === 0 && outputTokens === 0) continue;
|
||
const requestId = readString(rawReq["requestId"]) || `request-${index}`;
|
||
const dedupKey = `copilot-chatsession:${sessionId}:${requestId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const model = modelFromChatSessionRequest(rawReq, metadata);
|
||
const costUSD = calculateCost(model, inputTokens, outputTokens, 0, 0, 0);
|
||
const timestamp2 = timestampToISO(rawReq["timestamp"]) || sessionCreatedAt;
|
||
const userMessage = isRecord4(rawReq["message"]) ? readString(rawReq["message"]["text"]) : "";
|
||
const extracted = extractChatSessionTools(metadata);
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId,
|
||
project: source.project,
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: extracted.tools,
|
||
bashCommands: extracted.bashCommands,
|
||
skills: extracted.skills.length > 0 ? extracted.skills : void 0,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function normalizeJetBrainsModelName(raw) {
|
||
const t = raw.trim();
|
||
if (!t) return "";
|
||
if (t.startsWith("claude-")) return t.replace(/\./g, "-");
|
||
return t;
|
||
}
|
||
function findJetBrainsModelToken(s) {
|
||
for (const token of JETBRAINS_MODEL_TOKENS) {
|
||
const escaped = token.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||
if (new RegExp(`(?<![A-Za-z0-9])${escaped}(?![A-Za-z0-9]|\\.\\d)`).test(s)) {
|
||
return normalizeJetBrainsModelName(token);
|
||
}
|
||
}
|
||
return "";
|
||
}
|
||
function inferJetBrainsModel(raw) {
|
||
return findJetBrainsModelToken(raw);
|
||
}
|
||
function inferJetBrainsProject(raw) {
|
||
const re = /file:\/\/(\/[^"\\]+?)(?:\\|")/g;
|
||
const seen = /* @__PURE__ */ new Set();
|
||
let m;
|
||
while (m = re.exec(raw)) {
|
||
let p = m[1];
|
||
try {
|
||
p = decodeURIComponent(p);
|
||
} catch {
|
||
}
|
||
const dir = p.slice(0, p.lastIndexOf("/"));
|
||
if (dir.startsWith("/")) seen.add(dir.replace(/^\/(?=[a-zA-Z]:\/)/, ""));
|
||
}
|
||
if (seen.size === 0) return void 0;
|
||
for (const dir of seen) {
|
||
const repo = findGitRepoRoot(dir);
|
||
if (repo) return repo;
|
||
}
|
||
return void 0;
|
||
}
|
||
function findGitRepoRoot(dir) {
|
||
let cur = dir;
|
||
for (let i = 0; i < 40 && cur && cur !== "/"; i++) {
|
||
if (existsSync4(join13(cur, ".git"))) {
|
||
const name = basename9(cur);
|
||
return name || void 0;
|
||
}
|
||
const parent = dirname3(cur);
|
||
if (parent === cur) break;
|
||
cur = parent;
|
||
}
|
||
return void 0;
|
||
}
|
||
function extractJetBrainsProjectName(raw) {
|
||
const re = /projectName\x74([\x00-\xff])([\x00-\xff])/g;
|
||
let m;
|
||
while (m = re.exec(raw)) {
|
||
const len = m[1].charCodeAt(0) << 8 | m[2].charCodeAt(0);
|
||
if (len < 1 || len > 128) continue;
|
||
const start = m.index + m[0].length;
|
||
const val = Buffer.from(raw.slice(start, start + len), "latin1").toString("utf8");
|
||
if (val.length > 0 && !/[\x00-\x1f]/.test(val)) return val;
|
||
}
|
||
return void 0;
|
||
}
|
||
function extractJetBrainsConversations(raw) {
|
||
const DEFAULT_TITLES = /* @__PURE__ */ new Set(["New Agent Session", "New Session", "New Chat"]);
|
||
const byId = /* @__PURE__ */ new Map();
|
||
const re = /\$([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})[\s\S]{0,8}name/g;
|
||
let m;
|
||
while (m = re.exec(raw)) {
|
||
const id = m[1];
|
||
const window = raw.slice(m.index, m.index + 400);
|
||
const tm = window.match(/value.{1,6}?([\x20-\x7e]{3,80}?)t\x00\x06source/);
|
||
if (!tm) continue;
|
||
const title = Buffer.from(tm[1].replace(/^[^A-Za-z0-9]*/, ""), "latin1").toString("utf8").trim();
|
||
if (!title) continue;
|
||
const existing = byId.get(id);
|
||
if (existing && !DEFAULT_TITLES.has(existing) && DEFAULT_TITLES.has(title)) continue;
|
||
byId.set(id, title);
|
||
}
|
||
return [...byId.entries()].map(([id, title]) => ({ id, title }));
|
||
}
|
||
function matchJsonObject(raw, start) {
|
||
let depth = 0;
|
||
let inStr = false;
|
||
let esc = false;
|
||
let i = start;
|
||
for (; i < raw.length; i++) {
|
||
const c = raw[i];
|
||
if (esc) {
|
||
esc = false;
|
||
continue;
|
||
}
|
||
if (c === "\\") {
|
||
esc = true;
|
||
continue;
|
||
}
|
||
if (c === '"') {
|
||
inStr = !inStr;
|
||
continue;
|
||
}
|
||
if (inStr) continue;
|
||
if (c === "{") depth++;
|
||
else if (c === "}") {
|
||
depth--;
|
||
if (depth === 0) {
|
||
i++;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
return { chunk: raw.slice(start, i), end: i };
|
||
}
|
||
function extractResponseText(blob) {
|
||
let s = blob;
|
||
for (let depth = 0; depth < 8; depth++) {
|
||
const isAgentMode = /"type":"AgentRound"/.test(s);
|
||
if (isAgentMode || /"type":"Markdown"/.test(s)) {
|
||
const decoded = isAgentMode ? extractAgentRoundReplies(s) : extractMarkdownTexts(s);
|
||
return Buffer.from(decoded.join("\n").trim(), "latin1").toString("utf8");
|
||
}
|
||
const next = s.replace(/\\([\\"])/g, "$1");
|
||
if (next === s) break;
|
||
s = next;
|
||
}
|
||
return "";
|
||
}
|
||
function extractMarkdownTexts(s) {
|
||
return extractRecordStrings(s, '"type":"Markdown"', '"data":"', "text");
|
||
}
|
||
function extractAgentRoundReplies(s) {
|
||
return extractRecordStrings(s, '"type":"AgentRound"', '"data":"', "reply");
|
||
}
|
||
function extractRecordStrings(s, marker, dataKey, field) {
|
||
const texts = [];
|
||
const seen = /* @__PURE__ */ new Set();
|
||
const re = new RegExp(marker.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g");
|
||
let m;
|
||
while (m = re.exec(s)) {
|
||
const dk = s.indexOf(dataKey, m.index);
|
||
if (dk === -1 || dk - m.index > 200) continue;
|
||
const start = dk + dataKey.length;
|
||
let i = start;
|
||
for (; i < s.length; i++) {
|
||
if (s[i] !== '"') continue;
|
||
let bs = 0;
|
||
for (let j = i - 1; j >= start && s[j] === "\\"; j--) bs++;
|
||
if (bs % 2 === 0) break;
|
||
}
|
||
const literal = s.slice(start, i);
|
||
try {
|
||
const doc = JSON.parse(JSON.parse('"' + literal + '"'));
|
||
const text2 = typeof doc[field] === "string" ? doc[field] : "";
|
||
if (text2 && !seen.has(text2)) {
|
||
seen.add(text2);
|
||
texts.push(text2);
|
||
}
|
||
} catch {
|
||
}
|
||
}
|
||
return texts;
|
||
}
|
||
function extractJetBrainsDbTurns(raw) {
|
||
const conversations = extractJetBrainsConversations(raw);
|
||
const convById = new Map(conversations.map((c) => [c.id, c]));
|
||
const turns = [];
|
||
const seenReplies = /* @__PURE__ */ new Set();
|
||
const re = /\{"__first__":\{"type":"Subgraph"/g;
|
||
let m;
|
||
while (m = re.exec(raw)) {
|
||
const { chunk, end } = matchJsonObject(raw, m.index);
|
||
re.lastIndex = end;
|
||
let conversationId = "";
|
||
let conversationTitle = "";
|
||
let bestPos = -1;
|
||
for (const c of convById.values()) {
|
||
const p = raw.lastIndexOf(c.id, m.index);
|
||
if (p > bestPos) {
|
||
bestPos = p;
|
||
conversationId = c.id;
|
||
conversationTitle = c.title;
|
||
}
|
||
}
|
||
const replyText = extractResponseText(chunk);
|
||
const conversationProject = inferJetBrainsProject(chunk) ?? "";
|
||
const model = findJetBrainsModelToken(chunk);
|
||
const hasErrorMarker = /error occurred|"isError":true|\\+"status\\+":\\+"(?:error|failed)\\+"/i.test(chunk);
|
||
if (hasErrorMarker && !replyText) {
|
||
turns.push({ replyText: "", model, errored: true, conversationId, conversationTitle, conversationProject });
|
||
continue;
|
||
}
|
||
if (!replyText) continue;
|
||
const dedupeKey = `${conversationId}::${replyText}`;
|
||
if (seenReplies.has(dedupeKey)) continue;
|
||
seenReplies.add(dedupeKey);
|
||
turns.push({ replyText, model, errored: false, conversationId, conversationTitle, conversationProject });
|
||
}
|
||
if (turns.length === 0 && raw.includes("AgentRound")) {
|
||
const outerDocRe = /[\x00-\x1f\x7f-\xff]\{"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}":\{"type":"Value"/g;
|
||
let dm;
|
||
while (dm = outerDocRe.exec(raw)) {
|
||
const docStart = dm.index + 1;
|
||
const { chunk, end } = matchJsonObject(raw, docStart);
|
||
outerDocRe.lastIndex = end;
|
||
if (!chunk.includes("AgentRound")) continue;
|
||
let conversationId = "";
|
||
let conversationTitle = "";
|
||
let bestPos = -1;
|
||
for (const c of convById.values()) {
|
||
const p = raw.lastIndexOf(c.id, docStart);
|
||
if (p > bestPos) {
|
||
bestPos = p;
|
||
conversationId = c.id;
|
||
conversationTitle = c.title;
|
||
}
|
||
}
|
||
const allReplies = extractResponseText(chunk);
|
||
if (!allReplies) continue;
|
||
const conversationProject = inferJetBrainsProject(chunk) ?? "";
|
||
const storeModel = findJetBrainsModelToken(chunk);
|
||
const dedupeKey = `${conversationId}::${allReplies}`;
|
||
if (seenReplies.has(dedupeKey)) continue;
|
||
seenReplies.add(dedupeKey);
|
||
turns.push({
|
||
replyText: allReplies,
|
||
model: storeModel,
|
||
errored: false,
|
||
conversationId,
|
||
conversationTitle,
|
||
conversationProject
|
||
});
|
||
}
|
||
}
|
||
const projByConv = /* @__PURE__ */ new Map();
|
||
for (const t of turns) {
|
||
if (t.conversationProject && !projByConv.has(t.conversationId)) {
|
||
projByConv.set(t.conversationId, t.conversationProject);
|
||
}
|
||
}
|
||
for (const t of turns) {
|
||
if (!t.conversationProject) t.conversationProject = projByConv.get(t.conversationId) ?? "";
|
||
}
|
||
return turns;
|
||
}
|
||
function createJetBrainsParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const sessionId = source.sessionId;
|
||
if (source.dbPath) {
|
||
let dbRaw = null;
|
||
try {
|
||
dbRaw = await readSessionFile(source.dbPath, "latin1");
|
||
} catch {
|
||
dbRaw = null;
|
||
}
|
||
if (dbRaw) {
|
||
const storeModel = inferJetBrainsModel(dbRaw);
|
||
const turns = extractJetBrainsDbTurns(dbRaw);
|
||
const perContentIndex = /* @__PURE__ */ new Map();
|
||
for (const turn of turns) {
|
||
const convId = turn.conversationId || sessionId;
|
||
const contentHash = createHash2("sha256").update(turn.replyText).digest("hex").slice(0, 12);
|
||
const nth = (perContentIndex.get(`${convId}:${contentHash}`) ?? 0) + 1;
|
||
perContentIndex.set(`${convId}:${contentHash}`, nth);
|
||
const dedupKey = `copilot:jb:${convId}:${contentHash}:${nth}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const model = turn.model || storeModel || "copilot-anthropic-auto";
|
||
const outputTokens = turn.errored ? 0 : estimateTokens(turn.replyText);
|
||
const costUSD = outputTokens > 0 ? calculateCost(model, 0, outputTokens, 0, 0, 0) : 0;
|
||
const project = source.projectName || turn.conversationProject || "copilot-jetbrains";
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId: convId,
|
||
project,
|
||
model,
|
||
inputTokens: 0,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: true,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: source.mtime,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
// Surface the chat-thread name here (it is the session's label, not
|
||
// a project) so it remains visible in session-level views.
|
||
userMessage: turn.conversationTitle
|
||
};
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createOtelParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const { openDatabase: openDatabase2 } = await Promise.resolve().then(() => (init_sqlite(), sqlite_exports));
|
||
const db = openDatabase2(source.path);
|
||
try {
|
||
const conversationRows = db.query(
|
||
`SELECT DISTINCT
|
||
sa_conv.value AS conversation_id,
|
||
sa_repo.value AS project,
|
||
MIN(s.start_time_ms) AS min_start
|
||
FROM spans s
|
||
LEFT JOIN span_attributes sa_conv
|
||
ON s.span_id = sa_conv.span_id AND sa_conv.key = 'gen_ai.conversation.id'
|
||
LEFT JOIN span_attributes sa_repo
|
||
ON s.span_id = sa_repo.span_id AND sa_repo.key = 'github.copilot.git.repository'
|
||
WHERE sa_conv.value IS NOT NULL
|
||
GROUP BY sa_conv.value
|
||
ORDER BY min_start DESC`
|
||
);
|
||
for (const convRow of conversationRows) {
|
||
const conversationId = convRow.conversation_id;
|
||
if (!conversationId) continue;
|
||
let project = convRow.project ?? "copilot-chat";
|
||
if (project.includes("/")) {
|
||
project = basename9(project.replace(/\.git$/, ""));
|
||
}
|
||
const spanIdRows = db.query(
|
||
`SELECT DISTINCT s.span_id, s.trace_id
|
||
FROM spans s
|
||
INNER JOIN span_attributes sa
|
||
ON s.span_id = sa.span_id AND sa.key = 'gen_ai.conversation.id' AND sa.value = ?
|
||
ORDER BY s.start_time_ms ASC`,
|
||
[conversationId]
|
||
);
|
||
const traceIds = /* @__PURE__ */ new Set();
|
||
for (const row of spanIdRows) {
|
||
traceIds.add(row.trace_id);
|
||
}
|
||
if (traceIds.size === 0) {
|
||
continue;
|
||
}
|
||
const traceIdArr = [...traceIds];
|
||
const tracePlaceholders = traceIdArr.map(() => "?").join(",");
|
||
if (!convRow.project && source.workspaceBySessionId?.size) {
|
||
const sessionIds = db.query(
|
||
`SELECT DISTINCT sa.value FROM spans s
|
||
JOIN span_attributes sa ON s.span_id = sa.span_id
|
||
WHERE s.trace_id IN (${tracePlaceholders})
|
||
AND sa.key IN ('copilot_chat.chat_session_id', 'copilot_chat.parent_chat_session_id')
|
||
ORDER BY sa.key, sa.value`,
|
||
traceIdArr
|
||
).map((r) => r.value);
|
||
for (const id of [conversationId, ...sessionIds]) {
|
||
const workspace = source.workspaceBySessionId.get(id);
|
||
if (workspace) {
|
||
project = workspace;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
const traceSpans = db.query(
|
||
`SELECT span_id, trace_id, operation_name, start_time_ms, response_model FROM spans WHERE trace_id IN (${tracePlaceholders})`,
|
||
traceIdArr
|
||
);
|
||
const toolsByTrace = /* @__PURE__ */ new Map();
|
||
const skillsByTrace = /* @__PURE__ */ new Map();
|
||
const bashByTrace = /* @__PURE__ */ new Map();
|
||
const subagentsByTrace = /* @__PURE__ */ new Map();
|
||
const chatSpanIds = [];
|
||
const spanMetaById = /* @__PURE__ */ new Map();
|
||
for (const span of traceSpans) {
|
||
const opName = span.operation_name || "";
|
||
spanMetaById.set(span.span_id, span);
|
||
if (opName === "chat") {
|
||
chatSpanIds.push(span.span_id);
|
||
continue;
|
||
}
|
||
if (opName === "execute_tool") {
|
||
const attrs = loadSpanAttributesFromTable(db, span.span_id);
|
||
const rawToolName = attrs["gen_ai.tool.name"];
|
||
if (rawToolName) {
|
||
const normalizedTool = normalizeTool(rawToolName);
|
||
const existing = toolsByTrace.get(span.trace_id) ?? [];
|
||
existing.push(normalizedTool);
|
||
toolsByTrace.set(span.trace_id, existing);
|
||
if (normalizedTool === "Skill") {
|
||
const skill = extractStructuredSkill(attrs["gen_ai.tool.call.arguments"]);
|
||
if (skill) {
|
||
const skills = skillsByTrace.get(span.trace_id) ?? [];
|
||
skills.push(skill);
|
||
skillsByTrace.set(span.trace_id, skills);
|
||
}
|
||
}
|
||
if (BASH_TOOL_NAMES.has(rawToolName)) {
|
||
const command = parseToolCommand(attrs["gen_ai.tool.call.arguments"]);
|
||
if (command) {
|
||
const bash = bashByTrace.get(span.trace_id) ?? [];
|
||
bash.push(...extractOtelBashCommands(command));
|
||
bashByTrace.set(span.trace_id, bash);
|
||
}
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
if (opName === "invoke_agent") {
|
||
const attrs = loadSpanAttributesFromTable(db, span.span_id);
|
||
const parentSession = attrs["copilot_chat.parent_chat_session_id"];
|
||
const agentName = attrs["gen_ai.agent.name"];
|
||
if (parentSession && agentName) {
|
||
const subs = subagentsByTrace.get(span.trace_id) ?? [];
|
||
subs.push(agentName);
|
||
subagentsByTrace.set(span.trace_id, subs);
|
||
}
|
||
}
|
||
}
|
||
chatSpanIds.sort((a, b) => (spanMetaById.get(a)?.start_time_ms ?? 0) - (spanMetaById.get(b)?.start_time_ms ?? 0));
|
||
const creditedTraces = /* @__PURE__ */ new Set();
|
||
for (const spanId of chatSpanIds) {
|
||
const attrs = loadSpanAttributesFromTable(db, spanId);
|
||
const spanMetadata = spanMetaById.get(spanId);
|
||
if (!spanMetadata) continue;
|
||
const model = attrs["gen_ai.response.model"] ?? attrs["gen_ai.request.model"] ?? spanMetadata.response_model ?? "unknown";
|
||
const inputTokens = Number(attrs["gen_ai.usage.input_tokens"] ?? 0);
|
||
const outputTokens = Number(attrs["gen_ai.usage.output_tokens"] ?? 0);
|
||
const cacheReadTokens = Number(attrs["gen_ai.usage.cache_read.input_tokens"] ?? 0);
|
||
const cacheCreationTokens = Number(attrs["gen_ai.usage.cache_creation.input_tokens"] ?? 0);
|
||
if (inputTokens === 0 && outputTokens === 0) {
|
||
continue;
|
||
}
|
||
const dedupKey = `copilot-otel:${spanId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const turnId = attrs["github.copilot.chat.turn.id"];
|
||
if (turnId) {
|
||
const jsonlDedupKey = `copilot:${conversationId}:${turnId}`;
|
||
seenKeys.add(jsonlDedupKey);
|
||
}
|
||
const ownsTraceMetadata = !creditedTraces.has(spanMetadata.trace_id);
|
||
if (ownsTraceMetadata) creditedTraces.add(spanMetadata.trace_id);
|
||
const tools = ownsTraceMetadata ? toolsByTrace.get(spanMetadata.trace_id) ?? [] : [];
|
||
const skills = ownsTraceMetadata ? skillsByTrace.get(spanMetadata.trace_id) ?? [] : [];
|
||
const bashCommands = ownsTraceMetadata ? bashByTrace.get(spanMetadata.trace_id) ?? [] : [];
|
||
const subagentTypes = subagentsByTrace.get(spanMetadata.trace_id);
|
||
const timestamp2 = epochToISO(spanMetadata.start_time_ms);
|
||
const costUSD = calculateCost(
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationTokens,
|
||
cacheReadTokens,
|
||
0
|
||
// webSearchRequests — not applicable to OTel spans
|
||
);
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId: conversationId,
|
||
project,
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheCreationTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools,
|
||
bashCommands,
|
||
skills: skills.length > 0 ? skills : void 0,
|
||
subagentTypes: subagentTypes && subagentTypes.length > 0 ? subagentTypes : void 0,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: ""
|
||
// Not available in OTel spans by default
|
||
};
|
||
}
|
||
}
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function fnv1a64(s) {
|
||
let h = 0xcbf29ce484222325n;
|
||
const prime = 0x100000001b3n;
|
||
const mask = 0xffffffffffffffffn;
|
||
for (let i = 0; i < s.length; i++) {
|
||
h ^= BigInt(s.charCodeAt(i));
|
||
h = h * prime & mask;
|
||
}
|
||
return h.toString(36);
|
||
}
|
||
function createSessionStoreParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const { openDatabase: openDatabase2, isSqliteBusyError: isSqliteBusyError2 } = await Promise.resolve().then(() => (init_sqlite(), sqlite_exports));
|
||
let db;
|
||
try {
|
||
db = openDatabase2(source.path);
|
||
} catch (err) {
|
||
if (isSqliteBusyError2(err)) throw err;
|
||
throw Object.assign(
|
||
new Error("copilot session-store.db unreadable at open; deferring"),
|
||
{ code: "SQLITE_BUSY" }
|
||
);
|
||
}
|
||
try {
|
||
let rows;
|
||
try {
|
||
for (const select of SESSION_STORE_USAGE_SELECTS) {
|
||
try {
|
||
rows = db.query(`${select} ORDER BY e.id ASC`);
|
||
break;
|
||
} catch (selectErr) {
|
||
const msg = selectErr instanceof Error ? selectErr.message : String(selectErr);
|
||
if (!/no such column/i.test(msg) || select === SESSION_STORE_USAGE_SELECT) throw selectErr;
|
||
}
|
||
}
|
||
if (!rows) throw new Error("copilot session-store.db: no usable select");
|
||
} catch (err) {
|
||
if (isSqliteBusyError2(err)) throw err;
|
||
throw Object.assign(
|
||
new Error("copilot session-store.db unreadable mid-parse; deferring"),
|
||
{ code: "SQLITE_BUSY" }
|
||
);
|
||
}
|
||
const normalizeTimestamp2 = (raw) => raw ? timestampToISO(
|
||
/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(\.\d+)?$/.test(raw) ? raw.replace(" ", "T") + "Z" : raw
|
||
) : "";
|
||
let prevTimestamp = "";
|
||
for (const row of rows) {
|
||
if (!row.session_id) continue;
|
||
const timestamp2 = normalizeTimestamp2(row.created_at) || prevTimestamp || normalizeTimestamp2(row.session_created_at);
|
||
if (!timestamp2) continue;
|
||
prevTimestamp = timestamp2;
|
||
const model = row.model || "unknown";
|
||
const cacheReadTokens = numberOrZero(row.cache_read_tokens);
|
||
const cacheWriteTokens = numberOrZero(row.cache_write_tokens);
|
||
const reasoningTokens = numberOrZero(row.reasoning_tokens);
|
||
const inputTokens = Math.max(
|
||
0,
|
||
numberOrZero(row.input_tokens) - cacheReadTokens - cacheWriteTokens
|
||
);
|
||
const outputTokens = numberOrZero(row.output_tokens);
|
||
if (inputTokens === 0 && cacheReadTokens === 0 && cacheWriteTokens === 0 && reasoningTokens === 0 && outputTokens === 0) continue;
|
||
const dedupKey = `copilot-store:${row.session_id}:${row.id}:${fnv1a64(
|
||
`${row.created_at ?? ""}|${row.input_tokens ?? ""}|${row.cache_read_tokens ?? ""}|${row.cache_write_tokens ?? ""}|${row.reasoning_tokens ?? ""}|${row.model}`
|
||
)}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const project = source.projectsBySessionId?.get(row.session_id) ?? (row.cwd ? basename9(row.cwd) : row.repository ? basename9(row.repository.replace(/\.git$/, "")) : row.session_id);
|
||
const costUSD = calculateCost(model, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, 0);
|
||
yield {
|
||
provider: "copilot",
|
||
sessionId: row.session_id,
|
||
project,
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheWriteTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: false,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
// Billing metadata rides as capture-only fields (deliberately
|
||
// OUTSIDE the dedup-key content hash: it identifies a charge, not
|
||
// the request). Omitted when the schema predates the columns.
|
||
...typeof row.total_nano_aiu === "number" ? { nanoAiu: row.total_nano_aiu } : {},
|
||
...typeof row.request_multiplier === "number" ? { requestMultiplier: row.request_multiplier } : {},
|
||
...row.initiator ? { initiator: row.initiator } : {}
|
||
};
|
||
}
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function isOtelSource(source) {
|
||
return source.sourceType === "otel";
|
||
}
|
||
function isChatSessionSource(source) {
|
||
return source.sourceType === "chatsession";
|
||
}
|
||
function isJetBrainsSource(source) {
|
||
return source.sourceType === "jetbrains";
|
||
}
|
||
function isTranscriptSource(source) {
|
||
return source.sourceType === "transcript";
|
||
}
|
||
function isSessionStoreSource(source) {
|
||
return source.sourceType === "session-store";
|
||
}
|
||
async function discoverJsonlSessions(sessionStateDir) {
|
||
const sources = [];
|
||
let sessionDirs;
|
||
try {
|
||
sessionDirs = await readdir8(sessionStateDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const sessionId of sessionDirs) {
|
||
const eventsPath = join13(sessionStateDir, sessionId, "events.jsonl");
|
||
const s = await stat10(eventsPath).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
let project = sessionId;
|
||
try {
|
||
const yaml = await readSessionFile(
|
||
join13(sessionStateDir, sessionId, "workspace.yaml")
|
||
);
|
||
const cwd = parseCwd(yaml ?? "");
|
||
if (cwd) project = basename9(cwd);
|
||
} catch {
|
||
}
|
||
sources.push({
|
||
path: eventsPath,
|
||
project,
|
||
provider: "copilot",
|
||
sourceType: "jsonl"
|
||
});
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverOtelSessions(dbPath) {
|
||
try {
|
||
await stat10(dbPath);
|
||
} catch {
|
||
return [];
|
||
}
|
||
return [{ path: dbPath, project: "copilot-chat", provider: "copilot", sourceType: "otel" }];
|
||
}
|
||
async function discoverSessionStoreSource(dbPath) {
|
||
const source = {
|
||
path: dbPath,
|
||
project: "copilot",
|
||
provider: "copilot",
|
||
sourceType: "session-store",
|
||
// The store IS the durable record: while it sits on disk, its cached rows
|
||
// must never age out (crash-only rows have no rollup to fall back to).
|
||
// Journal-style sources keep the ordinary durable age-out.
|
||
retainWhilePresent: true
|
||
};
|
||
try {
|
||
await stat10(dbPath);
|
||
} catch (err) {
|
||
const code = err.code;
|
||
return code === "ENOENT" || code === "ENOTDIR" ? null : source;
|
||
}
|
||
const { openDatabase: openDatabase2, isSqliteAvailable: isSqliteAvailable2 } = await Promise.resolve().then(() => (init_sqlite(), sqlite_exports));
|
||
if (!isSqliteAvailable2()) return null;
|
||
try {
|
||
const db = openDatabase2(dbPath);
|
||
try {
|
||
db.query(`${SESSION_STORE_USAGE_SELECT} LIMIT 1`);
|
||
} finally {
|
||
db.close();
|
||
}
|
||
return source;
|
||
} catch (err) {
|
||
const message = err instanceof Error ? err.message : String(err);
|
||
return /no such (table|column)/i.test(message) ? null : source;
|
||
}
|
||
}
|
||
async function findNitriteDbPath(storeDir, kind) {
|
||
const known = JETBRAINS_DB_NAMES[kind];
|
||
if (known) {
|
||
const p = join13(storeDir, known);
|
||
if ((await stat10(p).catch(() => null))?.isFile()) return p;
|
||
}
|
||
let files;
|
||
try {
|
||
files = await readdir8(storeDir);
|
||
} catch {
|
||
return null;
|
||
}
|
||
const db = files.find((f) => f.endsWith("-nitrite.db"));
|
||
return db ? join13(storeDir, db) : null;
|
||
}
|
||
async function discoverJetBrainsSessions(root) {
|
||
const sources = [];
|
||
let ideDirs;
|
||
try {
|
||
ideDirs = await readdir8(root);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const ide of ideDirs) {
|
||
for (const kind of JETBRAINS_SESSION_KINDS) {
|
||
const kindDir = join13(root, ide, kind);
|
||
let storeDirs;
|
||
try {
|
||
storeDirs = await readdir8(kindDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const storeId of storeDirs) {
|
||
const storeDir = join13(kindDir, storeId);
|
||
const dbPath = await findNitriteDbPath(storeDir, kind);
|
||
if (!dbPath) continue;
|
||
const dbStat = await stat10(dbPath).catch(() => null);
|
||
const mtime = (dbStat?.mtime ?? /* @__PURE__ */ new Date(0)).toISOString();
|
||
sources.push({
|
||
path: dbPath,
|
||
project: "copilot-jetbrains",
|
||
provider: "copilot",
|
||
sourceType: "jetbrains",
|
||
sessionId: storeId,
|
||
storeId,
|
||
dbPath,
|
||
mtime
|
||
});
|
||
}
|
||
}
|
||
}
|
||
await resolveJetBrainsProjectNames(sources);
|
||
return sources;
|
||
}
|
||
async function resolveJetBrainsProjectNames(sources) {
|
||
const byStore = /* @__PURE__ */ new Map();
|
||
for (const src of sources) {
|
||
if (!src.dbPath || byStore.has(src.storeId)) continue;
|
||
let raw = null;
|
||
try {
|
||
raw = await readSessionFile(src.dbPath, "latin1");
|
||
} catch {
|
||
raw = null;
|
||
}
|
||
if (!raw) continue;
|
||
const name = extractJetBrainsProjectName(raw);
|
||
if (name) byStore.set(src.storeId, name);
|
||
}
|
||
for (const src of sources) {
|
||
const name = byStore.get(src.storeId);
|
||
if (name) src.projectName = name;
|
||
}
|
||
}
|
||
function getVSCodeWorkspaceStorageDirs(home, os) {
|
||
const j = os === "win32" ? win324.join : posix4.join;
|
||
return ["Code", "Code - Insiders", "VSCodium"].map((editor) => j(getEditorDataDir(editor, home, os), "User", "workspaceStorage"));
|
||
}
|
||
function getVSCodeGlobalStorageDirs(home, os) {
|
||
const j = os === "win32" ? win324.join : posix4.join;
|
||
return ["Code", "Code - Insiders", "VSCodium"].map((editor) => j(getEditorDataDir(editor, home, os), "User", "globalStorage"));
|
||
}
|
||
async function readWorkspaceName(wsDir, hashDir) {
|
||
try {
|
||
const wsJson = await readSessionFile(join13(wsDir, hashDir, "workspace.json"));
|
||
if (!wsJson) return null;
|
||
const data = JSON.parse(wsJson);
|
||
const uri = typeof data.folder === "string" ? data.folder : typeof data.workspace === "string" ? data.workspace : null;
|
||
if (!uri) return null;
|
||
const name = decodeURIComponent(basename9(uri.replace(/^file:\/\//, "").replace(/\/+$/, "")));
|
||
if (!name || name === "workspace.json") return null;
|
||
return name.replace(/\.code-workspace$/, "") || null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function resolveWorkspaceProject(wsDir, hashDir) {
|
||
return await readWorkspaceName(wsDir, hashDir) ?? hashDir;
|
||
}
|
||
async function mapChatSessionWorkspaces(workspaceStorageDirs) {
|
||
const found = /* @__PURE__ */ new Map();
|
||
for (const wsDir of workspaceStorageDirs) {
|
||
let hashDirs;
|
||
try {
|
||
hashDirs = await readdir8(wsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const hashDir of hashDirs) {
|
||
let files;
|
||
try {
|
||
files = await readdir8(join13(wsDir, hashDir, "chatSessions"));
|
||
} catch {
|
||
continue;
|
||
}
|
||
const project = await readWorkspaceName(wsDir, hashDir);
|
||
if (!project) continue;
|
||
for (const file of files) {
|
||
const id = file.replace(/\.jsonl?$/, "");
|
||
if (id === file) continue;
|
||
const s = await stat10(join13(wsDir, hashDir, "chatSessions", file)).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
const prev = found.get(id);
|
||
if (!prev || s.mtimeMs > prev.mtimeMs) found.set(id, { project, mtimeMs: s.mtimeMs });
|
||
}
|
||
}
|
||
}
|
||
return new Map([...found].map(([id, v]) => [id, v.project]));
|
||
}
|
||
async function hasChatSessionFiles(chatSessionsDir) {
|
||
let files;
|
||
try {
|
||
files = await readdir8(chatSessionsDir);
|
||
} catch {
|
||
return false;
|
||
}
|
||
for (const file of files) {
|
||
if (!file.endsWith(".jsonl") && !file.endsWith(".json")) continue;
|
||
const s = await stat10(join13(chatSessionsDir, file)).catch(() => null);
|
||
if (s?.isFile()) return true;
|
||
}
|
||
return false;
|
||
}
|
||
async function discoverWorkspaceChatSessions(workspaceStorageDirs) {
|
||
const sources = [];
|
||
for (const wsDir of workspaceStorageDirs) {
|
||
let hashDirs;
|
||
try {
|
||
hashDirs = await readdir8(wsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const hashDir of hashDirs) {
|
||
const chatSessionsDir = join13(wsDir, hashDir, "chatSessions");
|
||
let files;
|
||
try {
|
||
files = await readdir8(chatSessionsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
const project = await resolveWorkspaceProject(wsDir, hashDir);
|
||
for (const file of files) {
|
||
if (!file.endsWith(".json") && !file.endsWith(".jsonl")) continue;
|
||
const path = join13(chatSessionsDir, file);
|
||
const s = await stat10(path).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({
|
||
path,
|
||
project,
|
||
provider: "copilot",
|
||
sourceType: "chatsession"
|
||
});
|
||
}
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverEmptyWindowChatSessions(globalStorageDirs) {
|
||
const sources = [];
|
||
for (const globalDir of globalStorageDirs) {
|
||
const chatSessionsDir = join13(globalDir, "emptyWindowChatSessions");
|
||
let files;
|
||
try {
|
||
files = await readdir8(chatSessionsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const file of files) {
|
||
if (!file.endsWith(".json") && !file.endsWith(".jsonl")) continue;
|
||
const path = join13(chatSessionsDir, file);
|
||
const s = await stat10(path).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({
|
||
path,
|
||
project: "copilot-chat",
|
||
provider: "copilot",
|
||
sourceType: "chatsession"
|
||
});
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverTranscriptSessions(workspaceStorageDirs) {
|
||
const sources = [];
|
||
for (const wsDir of workspaceStorageDirs) {
|
||
let hashDirs;
|
||
try {
|
||
hashDirs = await readdir8(wsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const hashDir of hashDirs) {
|
||
const chatSessionsDir = join13(wsDir, hashDir, "chatSessions");
|
||
if (await hasChatSessionFiles(chatSessionsDir)) continue;
|
||
const transcriptsDir = join13(wsDir, hashDir, "GitHub.copilot-chat", "transcripts");
|
||
const project = await resolveWorkspaceProject(wsDir, hashDir);
|
||
let transcriptFiles;
|
||
try {
|
||
transcriptFiles = await readdir8(transcriptsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const file of transcriptFiles) {
|
||
if (!file.endsWith(".jsonl")) continue;
|
||
const s = await stat10(join13(transcriptsDir, file)).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({
|
||
path: join13(transcriptsDir, file),
|
||
project,
|
||
provider: "copilot",
|
||
sourceType: "transcript"
|
||
});
|
||
}
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createCopilotProvider(sessionStateDir, workspaceStorageDir, globalStorageDir, jetbrainsDir, sessionStoreDb) {
|
||
function getWsDirs() {
|
||
if (workspaceStorageDir !== void 0) return [workspaceStorageDir];
|
||
const envDir = process.env["CODEBURN_COPILOT_WS_STORAGE_DIR"];
|
||
if (envDir) return [envDir];
|
||
return getVSCodeWorkspaceStorageDirs(homedir13(), platform());
|
||
}
|
||
function getGlobalDirs() {
|
||
if (globalStorageDir !== void 0) return [globalStorageDir];
|
||
const envDir = process.env["CODEBURN_COPILOT_GLOBAL_STORAGE_DIR"];
|
||
if (envDir) return [envDir];
|
||
return getVSCodeGlobalStorageDirs(homedir13(), platform());
|
||
}
|
||
return {
|
||
name: "copilot",
|
||
displayName: "Copilot",
|
||
durableSources: true,
|
||
// Every directory discovery scans, resolved the same way. Besides the
|
||
// doctor, a resident process's root watchers are built from these — a
|
||
// provider without them is silently invisible to the validated-reuse
|
||
// "clean" verdict, which would let a memoized complete parse outlive a
|
||
// store append + lock that a fresh parse would have deferred on. The
|
||
// store DB contributes its PARENT directory, not the file: SQLite appends
|
||
// land in -wal/-shm siblings a file watch would miss.
|
||
async probeRoots() {
|
||
const roots = /* @__PURE__ */ new Map();
|
||
const add = (path, label) => {
|
||
if (path && !roots.has(path)) roots.set(path, { path, label });
|
||
};
|
||
add(dirname3(getSessionStoreDbPath(sessionStoreDb)), "session store");
|
||
add(getCopilotSessionStateDir(sessionStateDir), "CLI session state");
|
||
for (const dir of getWsDirs()) add(dir, "VS Code workspaceStorage");
|
||
for (const dir of getGlobalDirs()) add(dir, "VS Code globalStorage");
|
||
add(getJetBrainsCopilotRoot(jetbrainsDir), "JetBrains");
|
||
const otelDb = getAgentTracesDbPath();
|
||
if (otelDb) add(dirname3(otelDb), "OTel agent traces");
|
||
return [...roots.values()];
|
||
},
|
||
// Segment-boundary match (#1530): `includes` let a bare `gpt-5` key
|
||
// capture `gpt-5.5` and `gpt-5.6-luna`. Unknown ids fall through to the
|
||
// raw id, and the report layer's fallbackRawModelDisplayName then resolves
|
||
// them with the same global getShortModelName every other provider uses.
|
||
modelDisplayName(model) {
|
||
for (const [key, display] of modelDisplayEntries2) {
|
||
if (modelKeyMatches(model, key)) return display;
|
||
}
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return normalizeTool(rawTool);
|
||
},
|
||
async discoverSessions() {
|
||
const sources = [];
|
||
let discoveredOtel = false;
|
||
const disableOtel = process.env["CODEBURN_COPILOT_DISABLE_OTEL"] === "1";
|
||
if (!disableOtel) {
|
||
const dbPath = getAgentTracesDbPath();
|
||
if (dbPath) {
|
||
try {
|
||
const otelSources = await discoverOtelSessions(dbPath);
|
||
discoveredOtel = otelSources.length > 0;
|
||
if (discoveredOtel) {
|
||
const workspaceBySessionId = await mapChatSessionWorkspaces(getWsDirs());
|
||
for (const otelSource of otelSources) otelSource.workspaceBySessionId = workspaceBySessionId;
|
||
}
|
||
sources.push(...otelSources);
|
||
} catch {
|
||
}
|
||
}
|
||
}
|
||
let storeSource = null;
|
||
try {
|
||
storeSource = await discoverSessionStoreSource(getSessionStoreDbPath(sessionStoreDb));
|
||
} catch {
|
||
storeSource = null;
|
||
}
|
||
if (storeSource) sources.push(storeSource);
|
||
try {
|
||
const jsonlDir = getCopilotSessionStateDir(sessionStateDir);
|
||
const jsonlSources = await discoverJsonlSessions(jsonlDir);
|
||
if (storeSource) {
|
||
storeSource.projectsBySessionId = new Map(
|
||
jsonlSources.map((src) => [basename9(dirname3(src.path)), src.project])
|
||
);
|
||
}
|
||
sources.push(...jsonlSources);
|
||
} catch {
|
||
}
|
||
if (!discoveredOtel) {
|
||
try {
|
||
const chatSessionSources = await discoverWorkspaceChatSessions(getWsDirs());
|
||
sources.push(...chatSessionSources);
|
||
} catch {
|
||
}
|
||
try {
|
||
const emptyWindowSources = await discoverEmptyWindowChatSessions(getGlobalDirs());
|
||
sources.push(...emptyWindowSources);
|
||
} catch {
|
||
}
|
||
}
|
||
try {
|
||
const transcriptSources = await discoverTranscriptSessions(getWsDirs());
|
||
sources.push(...transcriptSources);
|
||
} catch {
|
||
}
|
||
try {
|
||
const jetbrainsSources = await discoverJetBrainsSessions(
|
||
getJetBrainsCopilotRoot(jetbrainsDir)
|
||
);
|
||
sources.push(...jetbrainsSources);
|
||
} catch {
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
if (isOtelSource(source)) {
|
||
return createOtelParser(source, seenKeys);
|
||
}
|
||
if (isSessionStoreSource(source)) {
|
||
return createSessionStoreParser(source, seenKeys);
|
||
}
|
||
if (isChatSessionSource(source)) {
|
||
return createChatSessionParser(source, seenKeys);
|
||
}
|
||
if (isJetBrainsSource(source)) {
|
||
return createJetBrainsParser(source, seenKeys);
|
||
}
|
||
return createJsonlParser(source, seenKeys, isTranscriptSource(source));
|
||
}
|
||
};
|
||
}
|
||
var COPILOT_OPENAI_AUTO, COPILOT_ANTHROPIC_AUTO, transcriptToolCallModelHints, CHARS_PER_TOKEN_LEGACY, modelDisplayNames3, toolNameMap6, modelDisplayEntries2, BASH_TOOL_NAMES, FORBIDDEN_CHAT_JOURNAL_KEYS, OTEL_SHELL_KEYWORDS, JETBRAINS_MODEL_TOKENS, SESSION_STORE_USAGE_COLUMNS, SESSION_STORE_USAGE_FROM, SESSION_STORE_USAGE_SELECT, SESSION_STORE_USAGE_SELECTS, JETBRAINS_SESSION_KINDS, JETBRAINS_DB_NAMES, copilot;
|
||
var init_copilot = __esm({
|
||
"src/providers/copilot.ts"() {
|
||
"use strict";
|
||
init_editor_data_dir();
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_context_tree();
|
||
COPILOT_OPENAI_AUTO = "copilot-openai-auto";
|
||
COPILOT_ANTHROPIC_AUTO = "copilot-anthropic-auto";
|
||
transcriptToolCallModelHints = [
|
||
// Anthropic tool-call ID variants observed in Copilot transcript logs.
|
||
{ prefix: "toolu_bdrk_", model: COPILOT_ANTHROPIC_AUTO },
|
||
{ prefix: "toolu_vrtx_", model: COPILOT_ANTHROPIC_AUTO },
|
||
{ prefix: "tooluse_", model: COPILOT_ANTHROPIC_AUTO },
|
||
{ prefix: "toolu_", model: COPILOT_ANTHROPIC_AUTO },
|
||
// OpenAI tool-call IDs.
|
||
{ prefix: "call_", model: COPILOT_OPENAI_AUTO }
|
||
];
|
||
CHARS_PER_TOKEN_LEGACY = 4;
|
||
modelDisplayNames3 = {
|
||
"gpt-4.1-nano": "GPT-4.1 Nano",
|
||
"gpt-4.1-mini": "GPT-4.1 Mini",
|
||
"gpt-4.1": "GPT-4.1",
|
||
"gpt-4o-mini": "GPT-4o Mini",
|
||
"gpt-4o": "GPT-4o",
|
||
"gpt-5-mini": "GPT-5 Mini",
|
||
"gpt-5": "GPT-5",
|
||
"claude-sonnet-4-5": "Sonnet 4.5",
|
||
"claude-sonnet-4": "Sonnet 4",
|
||
"copilot-openai-auto": "Copilot (OpenAI auto)",
|
||
"copilot-anthropic-auto": "Copilot (Anthropic auto)"
|
||
};
|
||
toolNameMap6 = {
|
||
// JSONL session-state tool names
|
||
bash: "Bash",
|
||
skill: "Skill",
|
||
read_file: "Read",
|
||
write_file: "Edit",
|
||
edit_file: "Edit",
|
||
delete_file: "Delete",
|
||
github_repo: "GitHub",
|
||
web_search: "WebSearch",
|
||
run_in_terminal: "Shell",
|
||
// JetBrains Copilot agent tool names (snake_case)
|
||
insert_edit_into_file: "Edit",
|
||
create_file: "Edit",
|
||
get_errors: "Diagnostics",
|
||
file_search: "Search",
|
||
grep_search: "Search",
|
||
semantic_search: "Search",
|
||
list_dir: "Search",
|
||
fetch_webpage: "Web",
|
||
// OTel execute_tool span names from Copilot Chat:
|
||
readFile: "Read",
|
||
writeFile: "Edit",
|
||
editFile: "Edit",
|
||
runCommand: "Shell",
|
||
runInTerminal: "Shell",
|
||
findFiles: "Search",
|
||
grepSearch: "Search",
|
||
codebaseSearch: "Search",
|
||
getErrors: "Diagnostics",
|
||
listCodeUsages: "Search",
|
||
createFile: "Edit",
|
||
deleteFile: "Delete",
|
||
renameOrMoveFile: "Edit",
|
||
fetchWebpage: "Web"
|
||
};
|
||
modelDisplayEntries2 = Object.entries(modelDisplayNames3).sort(
|
||
(a, b) => b[0].length - a[0].length
|
||
);
|
||
BASH_TOOL_NAMES = /* @__PURE__ */ new Set(["bash", "run_in_terminal", "runInTerminal", "runCommand"]);
|
||
FORBIDDEN_CHAT_JOURNAL_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
||
OTEL_SHELL_KEYWORDS = /* @__PURE__ */ new Set([
|
||
"if",
|
||
"then",
|
||
"else",
|
||
"elif",
|
||
"fi",
|
||
"for",
|
||
"while",
|
||
"until",
|
||
"do",
|
||
"done",
|
||
"case",
|
||
"esac",
|
||
"select",
|
||
"function",
|
||
"in",
|
||
"time",
|
||
"coproc"
|
||
]);
|
||
JETBRAINS_MODEL_TOKENS = [
|
||
"claude-opus-4.8",
|
||
"claude-opus-4.6",
|
||
"claude-opus-4.5",
|
||
"claude-opus-4.1",
|
||
"claude-opus-4",
|
||
"claude-sonnet-4.6",
|
||
"claude-sonnet-4.5",
|
||
"claude-sonnet-4",
|
||
"claude-haiku-4.5",
|
||
"gpt-5.6-luna",
|
||
"gpt-5.6-terra",
|
||
"gpt-5.6",
|
||
"gpt-5.5",
|
||
"gpt-5.4-mini",
|
||
"gpt-5.4",
|
||
"gpt-5.3-codex",
|
||
"gpt-5.3",
|
||
"gpt-5.2",
|
||
"gpt-5.1",
|
||
"gpt-5-mini",
|
||
"gpt-5",
|
||
"gpt-4.1-mini",
|
||
"gpt-4.1-nano",
|
||
"gpt-4.1",
|
||
"gpt-4o-mini",
|
||
"gpt-4o",
|
||
"gemini-2.5-pro",
|
||
"gemini-2.0-flash",
|
||
"o3-mini",
|
||
"o4-mini",
|
||
"o3"
|
||
];
|
||
SESSION_STORE_USAGE_COLUMNS = `e.id, e.session_id, e.model,
|
||
e.input_tokens, e.cache_read_tokens, e.cache_write_tokens,
|
||
e.reasoning_tokens, e.created_at,
|
||
s.cwd, s.repository, s.created_at AS session_created_at`;
|
||
SESSION_STORE_USAGE_FROM = `
|
||
FROM assistant_usage_events e
|
||
LEFT JOIN sessions s ON s.id = e.session_id`;
|
||
SESSION_STORE_USAGE_SELECT = `SELECT ${SESSION_STORE_USAGE_COLUMNS}${SESSION_STORE_USAGE_FROM}`;
|
||
SESSION_STORE_USAGE_SELECTS = [
|
||
`SELECT ${SESSION_STORE_USAGE_COLUMNS},
|
||
e.total_nano_aiu, e.request_multiplier, e.initiator, e.output_tokens${SESSION_STORE_USAGE_FROM}`,
|
||
`SELECT ${SESSION_STORE_USAGE_COLUMNS},
|
||
e.total_nano_aiu, e.request_multiplier${SESSION_STORE_USAGE_FROM}`,
|
||
SESSION_STORE_USAGE_SELECT
|
||
];
|
||
JETBRAINS_SESSION_KINDS = ["chat-agent-sessions", "chat-sessions", "chat-edit-sessions"];
|
||
JETBRAINS_DB_NAMES = {
|
||
"chat-agent-sessions": "copilot-agent-sessions-nitrite.db",
|
||
"chat-sessions": "copilot-chat-nitrite.db",
|
||
"chat-edit-sessions": "copilot-edit-sessions-nitrite.db"
|
||
};
|
||
copilot = createCopilotProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/droid.ts
|
||
import { readdir as readdir9, stat as stat11, readFile as readFile6 } from "fs/promises";
|
||
import { join as join14 } from "path";
|
||
import { homedir as homedir14 } from "os";
|
||
function getFactoryDir() {
|
||
return process.env["FACTORY_DIR"] ?? join14(homedir14(), ".factory");
|
||
}
|
||
function stripModelPrefix(raw) {
|
||
return raw.replace(/^custom:/, "").replace(/\[.*?\]/g, "").replace(/-\d+$/, "").replace(/-+$/, "").replace(/^-/, "");
|
||
}
|
||
function parseModelForDisplay(raw) {
|
||
const stripped = stripModelPrefix(raw);
|
||
const lower = stripped.toLowerCase();
|
||
if (lower.includes("opus")) return getShortModelName(stripped);
|
||
if (lower.includes("sonnet")) return getShortModelName(stripped);
|
||
if (lower.includes("haiku")) return getShortModelName(stripped);
|
||
if (lower.startsWith("gpt-")) return getShortModelName(stripped);
|
||
if (lower.startsWith("o3") || lower.startsWith("o4")) return getShortModelName(stripped);
|
||
if (lower.startsWith("gemini")) return getShortModelName(stripped);
|
||
return stripped;
|
||
}
|
||
function extractDroidBashCommands(command) {
|
||
if (!command || !command.trim()) return [];
|
||
const firstLine = command.split("\n")[0].trim();
|
||
return extractBashCommands(firstLine);
|
||
}
|
||
function createParser7(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const content2 = await readSessionFile(source.path);
|
||
if (content2 === null) return;
|
||
const settingsPath = source.path.replace(/\.jsonl$/, ".settings.json");
|
||
let settings = {};
|
||
try {
|
||
const raw = await readFile6(settingsPath, "utf-8");
|
||
settings = JSON.parse(raw);
|
||
} catch {
|
||
}
|
||
const lines = content2.split("\n").filter((l) => l.trim());
|
||
let sessionId = "";
|
||
let sessionModelDisplay = settings.model ? stripModelPrefix(settings.model) : "unknown";
|
||
let currentUserMessage = "";
|
||
const assistantCalls = [];
|
||
let pendingTools = [];
|
||
let pendingBashCommands = [];
|
||
for (const line of lines) {
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (entry.type === "session_start") {
|
||
sessionId = entry.id ?? "";
|
||
continue;
|
||
}
|
||
if (entry.type !== "message" || !entry.message) continue;
|
||
const msg = entry.message;
|
||
if (msg.role === "user") {
|
||
const texts = normalizeContentBlocks(msg.content).filter((c) => c.type === "text" && c.text).map((c) => c.text).filter(Boolean);
|
||
const nonSystemTexts = texts.filter((t) => !t.startsWith("<system-reminder>"));
|
||
if (nonSystemTexts.length > 0) {
|
||
currentUserMessage = nonSystemTexts.join(" ").slice(0, 500);
|
||
}
|
||
continue;
|
||
}
|
||
if (msg.role === "assistant") {
|
||
const toolUses = normalizeContentBlocks(msg.content).filter((c) => c.type === "tool_use");
|
||
for (const tu of toolUses) {
|
||
const toolName = tu.name ?? "";
|
||
pendingTools.push(toolNameMap7[toolName] ?? toolName);
|
||
if (toolName === "Execute" && tu.input && typeof tu.input["command"] === "string") {
|
||
pendingBashCommands.push(...extractDroidBashCommands(tu.input["command"]));
|
||
}
|
||
}
|
||
const hasText = normalizeContentBlocks(msg.content).some((c) => c.type === "text" && c.text);
|
||
if (pendingTools.length > 0 || hasText) {
|
||
assistantCalls.push({
|
||
id: entry.id ?? `msg-${assistantCalls.length}`,
|
||
timestamp: entry.timestamp ?? "",
|
||
tools: [...pendingTools],
|
||
bashCommands: [...pendingBashCommands]
|
||
});
|
||
pendingTools = [];
|
||
pendingBashCommands = [];
|
||
}
|
||
continue;
|
||
}
|
||
}
|
||
if (assistantCalls.length === 0) return;
|
||
const totalTokens = settings.tokenUsage;
|
||
if (!totalTokens) return;
|
||
const totalInput = totalTokens.inputTokens ?? 0;
|
||
const totalOutput = totalTokens.outputTokens ?? 0;
|
||
const totalCacheCreation = totalTokens.cacheCreationTokens ?? 0;
|
||
const totalCacheRead = totalTokens.cacheReadTokens ?? 0;
|
||
const totalThinking = totalTokens.thinkingTokens ?? 0;
|
||
const numCalls = assistantCalls.length;
|
||
const inputPerCall = Math.floor(totalInput / numCalls);
|
||
const outputPerCall = Math.floor(totalOutput / numCalls);
|
||
const cacheCreationPerCall = Math.floor(totalCacheCreation / numCalls);
|
||
const cacheReadPerCall = Math.floor(totalCacheRead / numCalls);
|
||
const thinkingPerCall = Math.floor(totalThinking / numCalls);
|
||
for (let i = 0; i < assistantCalls.length; i++) {
|
||
const call = assistantCalls[i];
|
||
const isLast = i === assistantCalls.length - 1;
|
||
const inputTokens = isLast ? totalInput - inputPerCall * (numCalls - 1) : inputPerCall;
|
||
const outputTokens = isLast ? totalOutput - outputPerCall * (numCalls - 1) : outputPerCall;
|
||
const cacheCreationTokens = isLast ? totalCacheCreation - cacheCreationPerCall * (numCalls - 1) : cacheCreationPerCall;
|
||
const cacheReadTokens = isLast ? totalCacheRead - cacheReadPerCall * (numCalls - 1) : cacheReadPerCall;
|
||
const thinkingTokens = isLast ? totalThinking - thinkingPerCall * (numCalls - 1) : thinkingPerCall;
|
||
const dedupKey = `droid:${sessionId}:${call.id}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const costUSD = calculateCost(
|
||
sessionModelDisplay.toLowerCase(),
|
||
inputTokens,
|
||
outputTokens + thinkingTokens,
|
||
cacheCreationTokens,
|
||
cacheReadTokens,
|
||
0
|
||
);
|
||
const timestamp2 = call.timestamp || "";
|
||
yield {
|
||
provider: "droid",
|
||
model: sessionModelDisplay,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheCreationTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: cacheReadTokens,
|
||
reasoningTokens: thinkingTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: call.tools,
|
||
bashCommands: call.bashCommands,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: i === 0 ? currentUserMessage : "",
|
||
sessionId
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function isInternalSession(cwd, factoryDir) {
|
||
const normalized = cwd.replace(/\/+$/, "");
|
||
return normalized === factoryDir;
|
||
}
|
||
function deriveProjectName(cwd) {
|
||
const normalized = cwd.replace(/\/+$/, "");
|
||
const home = homedir14();
|
||
let relative = normalized.startsWith(home) ? normalized.slice(home.length).replace(/^\/+/, "") : normalized.replace(/^\/+/, "");
|
||
if (!relative) relative = "~";
|
||
const parts = relative.split("/");
|
||
const projectsIdx = parts.lastIndexOf("projects");
|
||
if (projectsIdx !== -1 && projectsIdx + 1 < parts.length) {
|
||
return parts.slice(projectsIdx + 1).join("/");
|
||
}
|
||
return parts.join("/");
|
||
}
|
||
async function readFirstJsonlLine(filePath) {
|
||
for await (const line of readSessionLines(filePath)) {
|
||
return line;
|
||
}
|
||
return null;
|
||
}
|
||
async function discoverSessionsInDir2(sessionsDir, factoryDir) {
|
||
const sources = [];
|
||
let entries;
|
||
try {
|
||
entries = await readdir9(sessionsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const entry of entries) {
|
||
const subDir = join14(sessionsDir, entry);
|
||
const s = await stat11(subDir).catch(() => null);
|
||
if (!s?.isDirectory()) continue;
|
||
const files = await readdir9(subDir).catch(() => []);
|
||
for (const file of files) {
|
||
if (!file.endsWith(".jsonl")) continue;
|
||
const filePath = join14(subDir, file);
|
||
const firstLine = await readFirstJsonlLine(filePath);
|
||
if (!firstLine?.trim()) continue;
|
||
let startEntry;
|
||
try {
|
||
startEntry = JSON.parse(firstLine);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (startEntry.type !== "session_start") continue;
|
||
const cwd = startEntry.cwd ?? entry;
|
||
if (isInternalSession(cwd, factoryDir)) continue;
|
||
sources.push({
|
||
path: filePath,
|
||
project: deriveProjectName(cwd),
|
||
provider: "droid"
|
||
});
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createDroidProvider(factoryDir) {
|
||
const base = factoryDir ?? getFactoryDir();
|
||
const sessionsDir = join14(base, "sessions");
|
||
return {
|
||
name: "droid",
|
||
displayName: "Droid",
|
||
modelDisplayName(model) {
|
||
return parseModelForDisplay(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap7[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: sessionsDir, label: "sessions" }];
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessionsInDir2(sessionsDir, base);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser7(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap7, droid;
|
||
var init_droid = __esm({
|
||
"src/providers/droid.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_content_utils();
|
||
toolNameMap7 = {
|
||
Read: "Read",
|
||
Create: "Create",
|
||
Edit: "Edit",
|
||
MultiEdit: "MultiEdit",
|
||
LS: "LS",
|
||
Glob: "Glob",
|
||
Grep: "Grep",
|
||
Execute: "Bash",
|
||
AskUser: "AskUser",
|
||
TodoWrite: "TodoWrite",
|
||
Skill: "Skill",
|
||
Task: "Agent",
|
||
WebSearch: "WebSearch",
|
||
FetchUrl: "FetchUrl",
|
||
GenerateDroid: "GenerateDroid",
|
||
ExitSpecMode: "ExitSpecMode"
|
||
};
|
||
droid = createDroidProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/devin.ts
|
||
import { existsSync as existsSync5 } from "fs";
|
||
import { readdir as readdir10, stat as stat12 } from "fs/promises";
|
||
import { basename as basename10, join as join15 } from "path";
|
||
import { homedir as homedir15 } from "os";
|
||
function isTextContentPart(contentPart) {
|
||
return contentPart.type === "text";
|
||
}
|
||
function parseTranscript(raw) {
|
||
try {
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function parseNumericTimestamp(value) {
|
||
const millis = value < 1e10 ? value * 1e3 : value;
|
||
return new Date(millis).toISOString();
|
||
}
|
||
function hasAnyTokenField(metrics) {
|
||
if (!metrics) return false;
|
||
return [
|
||
metrics.prompt_tokens,
|
||
metrics.completion_tokens,
|
||
metrics.cached_tokens,
|
||
metrics.extra?.cache_creation_input_tokens
|
||
].some((value) => value != null);
|
||
}
|
||
function getMetricsFromStep(step) {
|
||
if (hasAnyTokenField(step.metrics)) {
|
||
return step.metrics ?? null;
|
||
}
|
||
if (step.metadata) {
|
||
return getDevinMetricsFromMetadata(step.metadata);
|
||
}
|
||
return step.metrics ?? null;
|
||
}
|
||
function getDevinMetricsFromMetadata(metadata) {
|
||
const input = metadata.metrics?.input_tokens;
|
||
return {
|
||
// Devin's own metrics count input_tokens without the cache reads, unlike
|
||
// the OpenAI-style prompt_tokens getUsage carves them out of.
|
||
prompt_tokens: input == null ? input : input + safeNumber(metadata.metrics?.cache_read_tokens),
|
||
completion_tokens: metadata.metrics?.output_tokens,
|
||
cached_tokens: metadata.metrics?.cache_read_tokens,
|
||
extra: {
|
||
cache_creation_input_tokens: metadata.metrics?.cache_creation_tokens
|
||
}
|
||
};
|
||
}
|
||
function getUsage(step) {
|
||
const metrics = getMetricsFromStep(step);
|
||
const hasAnyUsage = [
|
||
metrics?.prompt_tokens,
|
||
metrics?.completion_tokens,
|
||
metrics?.extra?.cache_creation_input_tokens,
|
||
metrics?.cached_tokens
|
||
].some((x) => isPositiveNumber(x));
|
||
if (!hasAnyUsage) return null;
|
||
const cacheReadInputTokens = safeNumber(metrics?.cached_tokens);
|
||
return {
|
||
// Devin reports OpenAI-style prompt_tokens, with the cached tokens counted
|
||
// inside it; Anthropic semantics (what calculateCost expects) keep them
|
||
// apart, so the cached share is carved out instead of billed twice.
|
||
inputTokens: Math.max(0, safeNumber(metrics?.prompt_tokens) - cacheReadInputTokens),
|
||
outputTokens: safeNumber(metrics?.completion_tokens),
|
||
cacheCreationInputTokens: safeNumber(
|
||
metrics?.extra?.cache_creation_input_tokens
|
||
),
|
||
cacheReadInputTokens
|
||
};
|
||
}
|
||
function getSessionId(source, transcript) {
|
||
const fromTranscript = transcript.session_id?.trim();
|
||
return fromTranscript || basename10(source.path, ".json");
|
||
}
|
||
function projectNameFromPath(path) {
|
||
const normalized = path.trim().replace(/[/\\]+$/, "");
|
||
return normalized.split(/[/\\]/).filter(Boolean).pop() ?? path;
|
||
}
|
||
function getProjectName(source, session) {
|
||
if (session?.workingDirectory)
|
||
return projectNameFromPath(session.workingDirectory);
|
||
if (session?.title) return session.title;
|
||
return source.project;
|
||
}
|
||
function getProjectPath(session) {
|
||
return session?.workingDirectory;
|
||
}
|
||
function getTimestamp(step, session) {
|
||
return [
|
||
step.metadata?.created_at,
|
||
session?.lastActivityAt,
|
||
session?.createdAt
|
||
].filter(Boolean).shift();
|
||
}
|
||
function firstPresentString(...values) {
|
||
for (const value of values) {
|
||
const trimmed = value?.trim();
|
||
if (trimmed) return trimmed;
|
||
}
|
||
return void 0;
|
||
}
|
||
function getFriendlyGptName(model) {
|
||
const shortName = getShortModelName(model);
|
||
const match = model.match(/^gpt-(\d+(?:\.\d+)*)(?:-(.+))?$/);
|
||
if (!match) return shortName;
|
||
const suffixParts = match[2]?.split("-").filter(Boolean) ?? [];
|
||
if (suffixParts.some((part) => /^\d+$/.test(part))) return shortName;
|
||
const suffix = suffixParts.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
||
const reconstructed = `GPT-${match[1]}${suffix ? ` ${suffix}` : ""}`;
|
||
if (shortName !== model && (!suffix || shortName !== `GPT-${match[1]}`)) {
|
||
return shortName;
|
||
}
|
||
return reconstructed;
|
||
}
|
||
function normalizeDevinGptId(model) {
|
||
return model.replace(/^(gpt|swe)-(\d+)-(\d)(?=-|$)/, "$1-$2.$3");
|
||
}
|
||
function getDevinDisplayModelName(generationModel, modelName) {
|
||
if (!generationModel || /^MODEL_/.test(generationModel)) {
|
||
return getShortModelName(modelName);
|
||
}
|
||
if (generationModel.startsWith("gpt-")) {
|
||
const normalized = normalizeDevinGptId(generationModel);
|
||
const effortMatch = normalized.match(/-([^-]+)$/);
|
||
const effort = effortMatch && DEVIN_EFFORT_TIERS.has(effortMatch[1]) ? effortMatch[1] : void 0;
|
||
const base = effort ? normalized.slice(0, -(effort.length + 1)) : normalized;
|
||
const friendlyBase = getFriendlyGptName(base);
|
||
return effort ? `${friendlyBase} (${effort})` : friendlyBase;
|
||
}
|
||
return getShortModelName(generationModel);
|
||
}
|
||
function getModels(agentModel, step, session) {
|
||
const generationModel = firstPresentString(
|
||
step.metadata?.generation_model,
|
||
step.extra?.generation_model
|
||
);
|
||
const modelName = firstPresentString(
|
||
step.model_name,
|
||
agentModel,
|
||
session?.model
|
||
) ?? DEFAULT_MODEL_NAME;
|
||
const pricingModel = !generationModel || /^MODEL_/.test(generationModel) ? modelName : normalizeDevinGptId(generationModel);
|
||
return {
|
||
pricingModel,
|
||
displayModel: getDevinDisplayModelName(generationModel, modelName)
|
||
};
|
||
}
|
||
function getToolNames(step) {
|
||
return (step.tool_calls ?? []).map((call) => call.function_name);
|
||
}
|
||
function normalizeContentPartMessage(contentPart) {
|
||
if (isTextContentPart(contentPart)) {
|
||
return contentPart.text;
|
||
} else {
|
||
return contentPart.source.path;
|
||
}
|
||
}
|
||
function normalizeStepMessage(message) {
|
||
if (Array.isArray(message)) {
|
||
return message.map((x) => normalizeContentPartMessage(x).trim()).join(" ");
|
||
}
|
||
return message.trim();
|
||
}
|
||
function isUserStep(step) {
|
||
return step.metadata?.is_user_input === true || step.source === "user";
|
||
}
|
||
function getFirstUserMessageBeforeStep(steps, index) {
|
||
for (let i = index - 1; i >= 0; i--) {
|
||
const step = steps[i];
|
||
if (!step || !isUserStep(step)) continue;
|
||
const message = step.message ? normalizeStepMessage(step.message) : void 0;
|
||
if (message) return message;
|
||
}
|
||
return null;
|
||
}
|
||
function loadFirstPrompts(db) {
|
||
const prompts = /* @__PURE__ */ new Map();
|
||
try {
|
||
const rows = db.query(
|
||
`SELECT session_id, content FROM prompt_history ORDER BY id`
|
||
);
|
||
for (const row of rows) {
|
||
const content2 = row.content?.trim();
|
||
if (!row.session_id || !content2 || prompts.has(row.session_id)) continue;
|
||
prompts.set(row.session_id, content2);
|
||
}
|
||
} catch {
|
||
}
|
||
return prompts;
|
||
}
|
||
function toSessionMetadata(row, firstPrompt) {
|
||
return {
|
||
id: row.id,
|
||
workingDirectory: row.working_directory,
|
||
model: row.model,
|
||
title: row.title?.trim() || firstPrompt,
|
||
createdAt: parseNumericTimestamp(row.created_at),
|
||
lastActivityAt: parseNumericTimestamp(row.last_activity_at),
|
||
hidden: !!row.hidden
|
||
};
|
||
}
|
||
function loadSessionMetadata(dbPath) {
|
||
const sessions = /* @__PURE__ */ new Map();
|
||
let db = null;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
const rows = db.query(`SELECT ${SESSION_COLUMNS} FROM sessions`);
|
||
const firstPrompts = loadFirstPrompts(db);
|
||
for (const row of rows) {
|
||
if (!row.id) continue;
|
||
sessions.set(row.id, toSessionMetadata(row, firstPrompts.get(row.id)));
|
||
}
|
||
} catch {
|
||
return sessions;
|
||
} finally {
|
||
db?.close();
|
||
}
|
||
return sessions;
|
||
}
|
||
function toParsedCall(call) {
|
||
const { step, usage, session } = call;
|
||
const { pricingModel, displayModel } = getModels(call.agentModel, step, session);
|
||
return {
|
||
provider: DEVIN_PROVIDER_NAME,
|
||
model: displayModel,
|
||
inputTokens: usage.inputTokens,
|
||
outputTokens: usage.outputTokens,
|
||
cacheCreationInputTokens: usage.cacheCreationInputTokens,
|
||
cacheReadInputTokens: usage.cacheReadInputTokens,
|
||
cachedInputTokens: usage.cacheReadInputTokens,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(
|
||
pricingModel,
|
||
usage.inputTokens,
|
||
usage.outputTokens,
|
||
usage.cacheCreationInputTokens,
|
||
usage.cacheReadInputTokens,
|
||
0
|
||
),
|
||
tools: getToolNames(step),
|
||
bashCommands: [],
|
||
timestamp: call.timestamp,
|
||
speed: "standard",
|
||
deduplicationKey: call.deduplicationKey,
|
||
userMessage: call.userMessage,
|
||
sessionId: call.sessionId,
|
||
project: call.project,
|
||
projectPath: call.projectPath
|
||
};
|
||
}
|
||
function parseJson(raw) {
|
||
if (!raw) return null;
|
||
try {
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function discoverDbSessions(dbPath) {
|
||
if (!existsSync5(dbPath)) return null;
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return null;
|
||
}
|
||
try {
|
||
const rows = db.query(
|
||
`SELECT id, working_directory, title FROM sessions
|
||
WHERE hidden = 0 AND id IN (SELECT DISTINCT session_id FROM message_nodes)
|
||
ORDER BY id`
|
||
);
|
||
return rows.map((row) => ({
|
||
path: `${dbPath}:${row.id}`,
|
||
project: row.working_directory && projectNameFromPath(row.working_directory) || row.title?.trim() || DEVIN_PROVIDER_NAME,
|
||
provider: DEVIN_PROVIDER_NAME
|
||
}));
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return null;
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
function resolveDevinCliDir(override) {
|
||
return override && override.trim() ? override : DEFAULT_DEVIN_CLI_DIR;
|
||
}
|
||
function getDevinDiscoveryRoots(cliDir) {
|
||
return {
|
||
transcriptsDir: join15(cliDir, DEVIN_TRANSCRIPTS_SUBDIR),
|
||
sessionsDbPath: join15(cliDir, DEVIN_SESSIONS_DB)
|
||
};
|
||
}
|
||
function createDevinProvider(cliDir) {
|
||
const resolvedCliDir = resolveDevinCliDir(cliDir);
|
||
const { transcriptsDir, sessionsDbPath } = getDevinDiscoveryRoots(resolvedCliDir);
|
||
let sessionMetadata = null;
|
||
const getSessionMetadata = () => {
|
||
if (!sessionMetadata) sessionMetadata = loadSessionMetadata(sessionsDbPath);
|
||
return sessionMetadata;
|
||
};
|
||
return {
|
||
name: DEVIN_PROVIDER_NAME,
|
||
displayName: DEVIN_PROVIDER_DISPLAY_NAME,
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [
|
||
{ path: transcriptsDir, label: "transcripts" },
|
||
{ path: sessionsDbPath, label: "sessions.db" }
|
||
];
|
||
},
|
||
async discoverSessions() {
|
||
const dbSources = discoverDbSessions(sessionsDbPath);
|
||
if (dbSources) return dbSources;
|
||
const entries = await readdir10(transcriptsDir).catch(() => []);
|
||
const metadata = getSessionMetadata();
|
||
const sources = [];
|
||
for (const entry of entries) {
|
||
if (!entry.endsWith(".json")) continue;
|
||
const filePath = join15(transcriptsDir, entry);
|
||
const pathStats = await stat12(filePath).catch(() => null);
|
||
if (!pathStats?.isFile()) continue;
|
||
const session = metadata.get(basename10(filePath, ".json")) ?? null;
|
||
if (session?.hidden) continue;
|
||
const tmpSource = {
|
||
path: filePath,
|
||
project: DEVIN_PROVIDER_NAME,
|
||
provider: DEVIN_PROVIDER_NAME
|
||
};
|
||
const project = getProjectName(tmpSource, session);
|
||
sources.push({
|
||
path: filePath,
|
||
project,
|
||
provider: DEVIN_PROVIDER_NAME
|
||
});
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return source.path.endsWith(".json") ? new DevinSessionParser(source, seenKeys, getSessionMetadata()) : new DevinDbSessionParser(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var DEFAULT_DEVIN_CLI_DIR, DEFAULT_MODEL_NAME, DEVIN_PROVIDER_NAME, DEVIN_PROVIDER_DISPLAY_NAME, DEVIN_TRANSCRIPTS_SUBDIR, DEVIN_SESSIONS_DB, DEVIN_EFFORT_TIERS, SESSION_COLUMNS, DevinSessionParser, MESSAGE_BATCH_ROWS, DevinDbSessionParser, devin;
|
||
var init_devin = __esm({
|
||
"src/providers/devin.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_sqlite();
|
||
init_fs_utils();
|
||
init_parser();
|
||
DEFAULT_DEVIN_CLI_DIR = join15(
|
||
homedir15(),
|
||
".local",
|
||
"share",
|
||
"devin",
|
||
"cli"
|
||
);
|
||
DEFAULT_MODEL_NAME = "devin";
|
||
DEVIN_PROVIDER_NAME = "devin";
|
||
DEVIN_PROVIDER_DISPLAY_NAME = "Devin";
|
||
DEVIN_TRANSCRIPTS_SUBDIR = "transcripts";
|
||
DEVIN_SESSIONS_DB = "sessions.db";
|
||
DEVIN_EFFORT_TIERS = /* @__PURE__ */ new Set(["xhigh", "high", "medium", "low"]);
|
||
SESSION_COLUMNS = "id, working_directory, model, title, created_at, last_activity_at, hidden";
|
||
DevinSessionParser = class {
|
||
constructor(source, seenKeys, sessionMetadata) {
|
||
this.source = source;
|
||
this.seenKeys = seenKeys;
|
||
this.sessionMetadata = sessionMetadata;
|
||
}
|
||
source;
|
||
seenKeys;
|
||
sessionMetadata;
|
||
async *parse() {
|
||
const raw = await readSessionFile(this.source.path);
|
||
if (!raw) return;
|
||
const transcript = parseTranscript(raw);
|
||
if (!transcript?.steps) return;
|
||
const sessionId = getSessionId(this.source, transcript);
|
||
const session = this.sessionMetadata.get(sessionId) ?? null;
|
||
if (session?.hidden) return;
|
||
const project = getProjectName(this.source, session);
|
||
const projectPath = getProjectPath(session);
|
||
for (let index = 0; index < transcript.steps.length; index++) {
|
||
const step = transcript.steps[index];
|
||
if (isUserStep(step)) continue;
|
||
const usage = getUsage(step);
|
||
if (!usage) continue;
|
||
const timestamp2 = getTimestamp(step, session) ?? "";
|
||
const deduplicationKey = `devin:${sessionId}:${step.step_id}`;
|
||
if (this.seenKeys.has(deduplicationKey)) continue;
|
||
this.seenKeys.add(deduplicationKey);
|
||
yield toParsedCall({
|
||
step,
|
||
usage,
|
||
agentModel: transcript.agent?.model_name,
|
||
session,
|
||
timestamp: timestamp2,
|
||
deduplicationKey,
|
||
userMessage: getFirstUserMessageBeforeStep(transcript.steps, index) ?? session?.title ?? "",
|
||
sessionId,
|
||
project,
|
||
projectPath
|
||
});
|
||
}
|
||
}
|
||
};
|
||
MESSAGE_BATCH_ROWS = 2e3;
|
||
DevinDbSessionParser = class {
|
||
constructor(source, seenKeys) {
|
||
this.source = source;
|
||
this.seenKeys = seenKeys;
|
||
}
|
||
source;
|
||
seenKeys;
|
||
async *parse() {
|
||
const idx = this.source.path.lastIndexOf(":");
|
||
const dbPath = this.source.path.slice(0, idx);
|
||
const sessionId = this.source.path.slice(idx + 1);
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return;
|
||
}
|
||
const calls = [];
|
||
try {
|
||
const row = db.query(
|
||
`SELECT ${SESSION_COLUMNS} FROM sessions WHERE id = ?`,
|
||
[sessionId]
|
||
)[0];
|
||
if (!row || row.hidden) return;
|
||
const firstPrompt = db.query(
|
||
`SELECT content FROM prompt_history WHERE session_id = ? ORDER BY id LIMIT 1`,
|
||
[sessionId]
|
||
)[0]?.content?.trim();
|
||
const session = toSessionMetadata(row, firstPrompt);
|
||
const project = getProjectName(this.source, session);
|
||
const promptByNode = /* @__PURE__ */ new Map();
|
||
let lastNodeId = -1;
|
||
for (; ; ) {
|
||
const rows = db.query(
|
||
`SELECT node_id, parent_node_id,
|
||
json_extract(chat_message, '$.role') AS role,
|
||
json_extract(chat_message, '$.metadata') AS metadata,
|
||
(SELECT json_group_array(json_extract(value, '$.name'))
|
||
FROM json_each(chat_message, '$.tool_calls')) AS tool_names,
|
||
CASE WHEN json_extract(chat_message, '$.role') = 'user'
|
||
AND json_type(chat_message, '$.content') = 'text'
|
||
THEN json_extract(chat_message, '$.content') END AS content
|
||
FROM message_nodes
|
||
WHERE session_id = ? AND node_id > ?
|
||
ORDER BY node_id
|
||
LIMIT ?`,
|
||
[sessionId, lastNodeId, MESSAGE_BATCH_ROWS]
|
||
);
|
||
for (const node of rows) {
|
||
lastNodeId = Number(node.node_id);
|
||
const metadata = parseJson(node.metadata);
|
||
const inherited = node.parent_node_id == null ? void 0 : promptByNode.get(Number(node.parent_node_id));
|
||
const ownPrompt = node.role === "user" && metadata?.is_user_input === true && typeof node.content === "string" ? node.content.trim() || void 0 : void 0;
|
||
promptByNode.set(lastNodeId, ownPrompt ?? inherited);
|
||
if (node.role !== "assistant" || !metadata) continue;
|
||
const step = {
|
||
step_id: lastNodeId,
|
||
source: "agent",
|
||
message: "",
|
||
metadata,
|
||
tool_calls: (parseJson(node.tool_names) ?? []).filter((name) => !!name).map((name) => ({ tool_call_id: "", function_name: name, arguments: null }))
|
||
};
|
||
const usage = getUsage(step);
|
||
if (!usage) continue;
|
||
const deduplicationKey = `devin:${sessionId}:${metadata.request_id ?? `node-${lastNodeId}`}`;
|
||
if (this.seenKeys.has(deduplicationKey)) continue;
|
||
this.seenKeys.add(deduplicationKey);
|
||
calls.push(
|
||
toParsedCall({
|
||
step,
|
||
usage,
|
||
agentModel: void 0,
|
||
session,
|
||
timestamp: getTimestamp(step, session) ?? "",
|
||
deduplicationKey,
|
||
userMessage: ownPrompt ?? inherited ?? session.title ?? "",
|
||
sessionId,
|
||
project,
|
||
projectPath: getProjectPath(session)
|
||
})
|
||
);
|
||
}
|
||
if (rows.length < MESSAGE_BATCH_ROWS) break;
|
||
}
|
||
} finally {
|
||
db.close();
|
||
}
|
||
yield* calls;
|
||
}
|
||
};
|
||
devin = createDevinProvider(DEFAULT_DEVIN_CLI_DIR);
|
||
}
|
||
});
|
||
|
||
// src/providers/dsh.ts
|
||
import { open as open4, readdir as readdir11, readFile as readFile7, stat as stat13 } from "fs/promises";
|
||
import { basename as basename11, join as join16 } from "path";
|
||
import { homedir as homedir16 } from "os";
|
||
import zlib from "zlib";
|
||
function notice2(message) {
|
||
if (noticed.has(message)) return;
|
||
noticed.add(message);
|
||
process.stderr.write(message);
|
||
}
|
||
function noticePath(kind, detail) {
|
||
const seen = (noticedPaths.get(kind) ?? 0) + 1;
|
||
noticedPaths.set(kind, seen);
|
||
if (seen <= PATH_NOTICE_EXAMPLES) process.stderr.write(`codeburn: ${kind}: ${detail}
|
||
`);
|
||
else if (seen === PATH_NOTICE_EXAMPLES + 1) process.stderr.write(`codeburn: ${kind}: further paths suppressed
|
||
`);
|
||
}
|
||
function scanZstdFrames(buffer, maxFrames = Number.POSITIVE_INFINITY) {
|
||
const frames = [];
|
||
let offset = 0;
|
||
while (offset < buffer.length) {
|
||
const start = offset;
|
||
if (buffer.length - offset < 4) return { frames, tornStart: start };
|
||
if (buffer.readUInt32LE(offset) !== ZSTD_MAGIC) {
|
||
throw new Error(`invalid zstd frame magic at byte ${offset}`);
|
||
}
|
||
offset += 4;
|
||
if (offset === buffer.length) return { frames, tornStart: start };
|
||
const descriptor = buffer.readUInt8(offset);
|
||
offset += 1;
|
||
if ((descriptor & 24) !== 0) throw new Error(`reserved frame-header bit at byte ${offset - 1}`);
|
||
const contentSizeFlag = descriptor >>> 6;
|
||
const singleSegment = (descriptor & 32) !== 0;
|
||
const checksum = (descriptor & 4) !== 0;
|
||
const dictionaryFlag = descriptor & 3;
|
||
const dictionaryBytes = dictionaryFlag === 3 ? 4 : dictionaryFlag;
|
||
const contentSizeBytes = contentSizeFlag === 0 ? singleSegment ? 1 : 0 : 1 << contentSizeFlag;
|
||
const remainingHeaderBytes = (singleSegment ? 0 : 1) + dictionaryBytes + contentSizeBytes;
|
||
if (buffer.length - offset < remainingHeaderBytes) return { frames, tornStart: start };
|
||
offset += remainingHeaderBytes;
|
||
for (; ; ) {
|
||
if (buffer.length - offset < 3) return { frames, tornStart: start };
|
||
const blockHeader = buffer.readUIntLE(offset, 3);
|
||
offset += 3;
|
||
const lastBlock = (blockHeader & 1) !== 0;
|
||
const blockType = blockHeader >>> 1 & 3;
|
||
const blockSize = blockHeader >>> 3;
|
||
if (blockType === 3) throw new Error(`reserved block type at byte ${offset - 3}`);
|
||
const payloadBytes = blockType === 1 ? 1 : blockSize;
|
||
if (buffer.length - offset < payloadBytes) return { frames, tornStart: start };
|
||
offset += payloadBytes;
|
||
if (lastBlock) break;
|
||
}
|
||
if (checksum) {
|
||
if (buffer.length - offset < 4) return { frames, tornStart: start };
|
||
offset += 4;
|
||
}
|
||
frames.push({ start, end: offset });
|
||
if (frames.length === maxFrames) return { frames };
|
||
}
|
||
return { frames };
|
||
}
|
||
function mapToolName3(raw) {
|
||
return toolNameMap8[raw] ?? raw;
|
||
}
|
||
function numberOrZero2(raw) {
|
||
return typeof raw === "number" && Number.isSafeInteger(raw) && raw > 0 ? raw : 0;
|
||
}
|
||
function usageIsComplete(usage) {
|
||
const count2 = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
||
return count2(usage.inputTokens) && count2(usage.outputTokens) && [usage.cacheReadTokens, usage.cacheWriteTokens, usage.reasoningTokens].every((value) => value === void 0 || count2(value)) && (usage.reasoningTokens === void 0 || usage.reasoningTokens <= usage.outputTokens);
|
||
}
|
||
function isReadableVersion(header) {
|
||
if (typeof header.version === "number" && SUPPORTED_SESSION_FORMAT_VERSIONS.has(header.version)) return true;
|
||
notice2(`codeburn: skipping DSH sessions written in session format version ${String(header.version)}; upgrade codeburn.
|
||
`);
|
||
return false;
|
||
}
|
||
function generationFromPath(filePath) {
|
||
const match = SESSION_LOG_NAME.exec(basename11(filePath));
|
||
if (!match) return void 0;
|
||
return match[1] === void 0 ? 0 : Number(match[1]);
|
||
}
|
||
function headerMatchesPath(header, filePath) {
|
||
const generation = generationFromPath(filePath);
|
||
if (generation === void 0 || header.version !== generation) {
|
||
noticePath("skipping DSH session log whose filename and header versions disagree", filePath);
|
||
return false;
|
||
}
|
||
return isReadableVersion(header);
|
||
}
|
||
function isoTimestamp2(value, fallback) {
|
||
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallback;
|
||
const ms = value < MIN_REASONABLE_TIMESTAMP_MS2 ? value * 1e3 : value;
|
||
const date = new Date(ms);
|
||
if (Number.isNaN(date.getTime()) || date.getTime() < MIN_REASONABLE_TIMESTAMP_MS2) return fallback;
|
||
return date.toISOString();
|
||
}
|
||
function getDshHome(override) {
|
||
return override ?? (process.env["DSH_HOME"] || void 0) ?? join16(homedir16(), ".dsh");
|
||
}
|
||
function projectFromCwd(cwd, fallback) {
|
||
const segments = cwd.split(/[\\/]/).filter(Boolean);
|
||
return segments[segments.length - 1] ?? fallback;
|
||
}
|
||
function* readZstdLines(buffer, maxFrames = Number.POSITIVE_INFINITY, budget = MAX_SESSION_FILE_BYTES) {
|
||
const { frames } = scanZstdFrames(buffer, maxFrames);
|
||
let remaining = budget;
|
||
for (const frame of frames) {
|
||
if (remaining <= 0) throw new Error(`decodes past the ${budget}-byte cap`);
|
||
const decoded = zstdDecompress(buffer.subarray(frame.start, frame.end), {
|
||
maxOutputLength: Math.min(remaining, MAX_FRAME_DECODED_BYTES)
|
||
});
|
||
remaining -= decoded.length;
|
||
for (const line of decoded.toString("utf-8").split("\n")) {
|
||
if (line.trim()) yield line;
|
||
}
|
||
}
|
||
}
|
||
async function readEventLines(filePath) {
|
||
if (filePath.endsWith(".zstd")) {
|
||
if (!zstdDecompress) {
|
||
notice2("codeburn: DSH sessions need Node >= 22.15 (zstd support); skipping DSH usage.\n");
|
||
return null;
|
||
}
|
||
let buffer;
|
||
try {
|
||
const size = (await stat13(filePath)).size;
|
||
if (size > MAX_SESSION_FILE_BYTES) {
|
||
noticePath("skipped oversize DSH session log", `${filePath} (${size} bytes)`);
|
||
return null;
|
||
}
|
||
buffer = await readFile7(filePath);
|
||
} catch {
|
||
return null;
|
||
}
|
||
try {
|
||
return [...readZstdLines(buffer)];
|
||
} catch (err) {
|
||
noticePath("skipped corrupt DSH session log", `${filePath}: ${err instanceof Error ? err.message : err}`);
|
||
return null;
|
||
}
|
||
}
|
||
const content2 = await readSessionFile(filePath);
|
||
if (content2 === null) return null;
|
||
return content2.split("\n").filter((l) => l.trim());
|
||
}
|
||
async function readSessionHeader(filePath) {
|
||
const firstLine = async () => {
|
||
if (filePath.endsWith(".zstd")) {
|
||
if (!zstdDecompress) return null;
|
||
let head;
|
||
try {
|
||
const handle = await open4(filePath, "r");
|
||
try {
|
||
const size = (await handle.stat()).size;
|
||
const length = Math.min(size, 256 * 1024);
|
||
head = Buffer.alloc(length);
|
||
await handle.read(head, 0, length, 0);
|
||
} finally {
|
||
await handle.close();
|
||
}
|
||
} catch {
|
||
return null;
|
||
}
|
||
let { frames } = scanZstdFrames(head, 1);
|
||
if (frames.length === 0) {
|
||
try {
|
||
if ((await stat13(filePath)).size > MAX_SESSION_FILE_BYTES) return null;
|
||
const full = await readFile7(filePath);
|
||
frames = scanZstdFrames(full, 1).frames;
|
||
if (frames.length === 0) return null;
|
||
head = full;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
const text2 = zstdDecompress(head.subarray(frames[0].start, frames[0].end), {
|
||
maxOutputLength: MAX_FRAME_DECODED_BYTES
|
||
}).toString("utf-8");
|
||
return text2.split("\n").find((l) => l.trim()) ?? null;
|
||
}
|
||
for await (const line of readSessionLines(filePath)) {
|
||
if (line.trim()) return line;
|
||
}
|
||
return null;
|
||
};
|
||
try {
|
||
const line = await firstLine();
|
||
if (!line) return null;
|
||
const event = JSON.parse(line);
|
||
if (event.type !== "session") return null;
|
||
return event;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function discoverSessionsInDir3(sessionsDir, onSkippedVersion) {
|
||
const sources = [];
|
||
let projectDirs;
|
||
try {
|
||
projectDirs = await readdir11(sessionsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const dirName of projectDirs) {
|
||
const dirPath = join16(sessionsDir, dirName);
|
||
const dirStat = await stat13(dirPath).catch(() => null);
|
||
if (!dirStat?.isDirectory()) continue;
|
||
let sessionDirs;
|
||
try {
|
||
sessionDirs = await readdir11(dirPath);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const sessionDir of sessionDirs) {
|
||
const sessionPath = join16(dirPath, sessionDir);
|
||
const sessionStat = await stat13(sessionPath).catch(() => null);
|
||
if (!sessionStat?.isDirectory()) continue;
|
||
const generationFiles = [];
|
||
const slots = /* @__PURE__ */ new Set();
|
||
let ambiguous;
|
||
const names = await readdir11(sessionPath).catch(() => []);
|
||
for (const name of names) {
|
||
const match = SESSION_LOG_NAME.exec(name);
|
||
if (!match) continue;
|
||
const version = match[1] === void 0 ? 0 : Number(match[1]);
|
||
const candidate = join16(sessionPath, name);
|
||
const fileStat = await stat13(candidate).catch(() => null);
|
||
if (!fileStat?.isFile()) continue;
|
||
const compressed = name.endsWith(".zstd");
|
||
const slot = `${version}:${String(compressed)}`;
|
||
if (!Number.isSafeInteger(version) || slots.has(slot)) {
|
||
ambiguous ??= version;
|
||
continue;
|
||
}
|
||
slots.add(slot);
|
||
generationFiles.push({ path: candidate, version, compressed });
|
||
}
|
||
if (ambiguous !== void 0) {
|
||
onSkippedVersion?.(ambiguous);
|
||
noticePath("skipping DSH session whose generation filenames are ambiguous", sessionPath);
|
||
continue;
|
||
}
|
||
generationFiles.sort((a, b) => b.version - a.version || Number(b.compressed) - Number(a.compressed));
|
||
const selected = generationFiles[0];
|
||
if (!selected) continue;
|
||
const filePath = selected.path;
|
||
if (!SUPPORTED_SESSION_FORMAT_VERSIONS.has(selected.version)) {
|
||
onSkippedVersion?.(selected.version);
|
||
notice2(`codeburn: skipping DSH sessions written in session format version ${selected.version}; upgrade codeburn.
|
||
`);
|
||
continue;
|
||
}
|
||
if (selected.compressed && !zstdDecompress) {
|
||
onSkippedVersion?.(selected.version);
|
||
notice2("codeburn: DSH sessions need Node >= 22.15 (zstd support); skipping DSH usage.\n");
|
||
continue;
|
||
}
|
||
const header = await readSessionHeader(filePath);
|
||
if (!header) {
|
||
onSkippedVersion?.(selected.version);
|
||
noticePath("skipping unreadable DSH session header", filePath);
|
||
continue;
|
||
}
|
||
if (!headerMatchesPath(header, filePath)) {
|
||
onSkippedVersion?.(selected.version);
|
||
continue;
|
||
}
|
||
const cwd = typeof header.cwd === "string" && header.cwd.trim() ? header.cwd : dirName;
|
||
sources.push({ path: filePath, project: projectFromCwd(cwd, dirName), provider: "dsh" });
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function parseToolArguments(raw) {
|
||
if (!raw) return null;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function usageFromStream(stream) {
|
||
if (!Array.isArray(stream)) return void 0;
|
||
for (let index = stream.length - 1; index >= 0; index -= 1) {
|
||
const record = stream[index];
|
||
if (record?.type === "chunk" && record.chunk?.type === "usage") return record.chunk.usage;
|
||
}
|
||
return void 0;
|
||
}
|
||
function emptyStepBucket() {
|
||
return { observations: [], tools: [], skills: [], bashCommands: [] };
|
||
}
|
||
function createParser8(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const lines = await readEventLines(source.path);
|
||
if (!lines) return;
|
||
const events = [];
|
||
let corruptInterior = false;
|
||
for (const [index, line] of lines.entries()) {
|
||
try {
|
||
const value = JSON.parse(line);
|
||
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
||
if (index === 0) return;
|
||
corruptInterior = true;
|
||
continue;
|
||
}
|
||
events.push(value);
|
||
} catch {
|
||
if (index === 0) return;
|
||
if (index < lines.length - 1) corruptInterior = true;
|
||
}
|
||
}
|
||
const header = events[0];
|
||
if (header?.type !== "session" || !headerMatchesPath(header, source.path)) return;
|
||
const formatVersion = header.version;
|
||
if (formatVersion >= 2 && corruptInterior) {
|
||
noticePath("skipping corrupt DSH session with malformed interior rows", source.path);
|
||
return;
|
||
}
|
||
const sessionId = typeof header.id === "string" ? header.id : "";
|
||
const cwd = typeof header.cwd === "string" ? header.cwd : "";
|
||
let headerModel = "unknown";
|
||
let contextModel = "";
|
||
let currentTurn = 0;
|
||
const sessionStart = isoTimestamp2(header.createdAt, "");
|
||
let inheritedCut = formatVersion <= 1 && typeof header.parentSession === "string" && header.parentSession && typeof header.seedLength === "number" ? header.seedLength - 1 : -1;
|
||
if (formatVersion >= 2) {
|
||
const taggedCuts = events.filter((event) => event.type === "session/end-seed" && event.data?.inherited === true && typeof event.seq === "number").map((event) => event.seq);
|
||
if (header.isSeeded === true && taggedCuts.length === 0) {
|
||
noticePath("skipping corrupt seeded DSH session without an inherited end-seed marker", source.path);
|
||
return;
|
||
}
|
||
if (header.isSeeded !== true && taggedCuts.length > 0) {
|
||
noticePath("skipping corrupt unseeded DSH session with an inherited end-seed marker", source.path);
|
||
return;
|
||
}
|
||
inheritedCut = taggedCuts.at(-1) ?? -1;
|
||
}
|
||
const userMessageByTurn = /* @__PURE__ */ new Map();
|
||
const buckets = /* @__PURE__ */ new Map();
|
||
const activeAttempts = /* @__PURE__ */ new Map();
|
||
for (const event of events) {
|
||
if (event.type === "session") {
|
||
continue;
|
||
}
|
||
if (event.type === "request/header") {
|
||
const nextModel = event.data?.header?.config?.model;
|
||
if (typeof nextModel === "string" && nextModel) {
|
||
if (nextModel !== headerModel) contextModel = "";
|
||
headerModel = nextModel;
|
||
}
|
||
continue;
|
||
}
|
||
if (event.type === "request/context") {
|
||
const nextModel = event.data?.model;
|
||
if (typeof nextModel === "string" && nextModel) contextModel = nextModel;
|
||
continue;
|
||
}
|
||
if (typeof event.seq === "number" && event.seq <= inheritedCut) continue;
|
||
if (event.type === "turn/start") {
|
||
currentTurn = event.data?.turn ?? currentTurn;
|
||
continue;
|
||
}
|
||
if (event.type === "llm/retry-started") {
|
||
const turn2 = event.data?.turn ?? currentTurn;
|
||
const step2 = event.data?.step ?? 0;
|
||
activeAttempts.delete(`${turn2}:${step2}`);
|
||
continue;
|
||
}
|
||
if (event.type === "user/message") {
|
||
if (event.data?.source?.kind !== "user") continue;
|
||
if (userMessageByTurn.has(currentTurn)) continue;
|
||
const content2 = event.data?.content;
|
||
const texts = (Array.isArray(content2) ? content2 : []).filter((c) => c?.type === "text" && typeof c.text === "string" && c.text).map((c) => c.text);
|
||
if (texts.length > 0) userMessageByTurn.set(currentTurn, texts.join(" ").slice(0, 500));
|
||
continue;
|
||
}
|
||
if (event.type === "tool/call") {
|
||
const turn2 = event.data?.turn ?? currentTurn;
|
||
const step2 = event.data?.step ?? 0;
|
||
const rawName = event.data?.name;
|
||
if (typeof rawName !== "string" || !rawName) continue;
|
||
const key2 = `${turn2}:${step2}`;
|
||
let bucket2 = buckets.get(key2);
|
||
if (!bucket2) {
|
||
bucket2 = emptyStepBucket();
|
||
buckets.set(key2, bucket2);
|
||
}
|
||
bucket2.tools.push(mapToolName3(rawName));
|
||
const args = parseToolArguments(event.data?.arguments);
|
||
if ((rawName === "bash" || rawName === "pwsh") && typeof args?.["command"] === "string") {
|
||
bucket2.bashCommands.push(...extractBashCommands(args["command"]));
|
||
}
|
||
if (rawName === "skill" && typeof args?.["name"] === "string") {
|
||
bucket2.skills.push(args["name"]);
|
||
}
|
||
continue;
|
||
}
|
||
let usage;
|
||
let isFinal = false;
|
||
let reportedModel = contextModel || headerModel;
|
||
if (formatVersion <= 1 && event.type === "assistant/chunk" && event.data?.chunk?.type === "usage") {
|
||
usage = event.data.chunk.usage;
|
||
} else if (event.type === "assistant/message") {
|
||
usage = event.data?.usage ?? (formatVersion >= 2 ? usageFromStream(event.data?.stream) : void 0);
|
||
isFinal = true;
|
||
const messageModel = event.data?.message?.source?.model;
|
||
if (typeof messageModel === "string" && messageModel) reportedModel = messageModel;
|
||
} else if (formatVersion >= 2 && event.type === "assistant/attempt") {
|
||
usage = usageFromStream(event.data?.stream);
|
||
isFinal = true;
|
||
} else {
|
||
continue;
|
||
}
|
||
const turn = event.data?.turn ?? currentTurn;
|
||
const step = event.data?.step ?? 0;
|
||
if (![turn, step].every((value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0)) {
|
||
noticePath("skipping DSH usage with invalid attempt coordinates", source.path);
|
||
continue;
|
||
}
|
||
const key = `${turn}:${step}`;
|
||
if (!usage) {
|
||
if (!activeAttempts.has(key)) {
|
||
noticePath("DSH session contains an attempt without usage; totals may be incomplete", source.path);
|
||
}
|
||
continue;
|
||
}
|
||
let bucket = buckets.get(key);
|
||
if (!bucket) {
|
||
bucket = emptyStepBucket();
|
||
buckets.set(key, bucket);
|
||
}
|
||
const observation = { usage, time: event.time, model: reportedModel, final: isFinal };
|
||
const activeIndex = activeAttempts.get(key);
|
||
if (activeIndex !== void 0) {
|
||
if (!bucket.observations[activeIndex]?.final || isFinal) {
|
||
bucket.observations[activeIndex] = observation;
|
||
}
|
||
} else {
|
||
bucket.observations.push(observation);
|
||
activeAttempts.set(key, bucket.observations.length - 1);
|
||
}
|
||
}
|
||
const sortedKeys = [...buckets.keys()].sort((a, b) => {
|
||
const [ta, sa] = a.split(":").map(Number);
|
||
const [tb, sb] = b.split(":").map(Number);
|
||
return ta - tb || sa - sb;
|
||
});
|
||
for (const key of sortedKeys) {
|
||
const bucket = buckets.get(key);
|
||
for (let attempt = 0; attempt < bucket.observations.length; attempt += 1) {
|
||
const observation = bucket.observations[attempt];
|
||
const input = numberOrZero2(observation.usage.inputTokens);
|
||
const output = numberOrZero2(observation.usage.outputTokens);
|
||
const cacheRead = numberOrZero2(observation.usage.cacheReadTokens);
|
||
const cacheWrite = numberOrZero2(observation.usage.cacheWriteTokens);
|
||
const reasoning = Math.min(numberOrZero2(observation.usage.reasoningTokens), output);
|
||
const completeUsage = usageIsComplete(observation.usage);
|
||
if (!completeUsage) {
|
||
noticePath("DSH session contains incomplete or invalid usage; retained counts are estimated", source.path);
|
||
}
|
||
if (input + output + cacheRead + cacheWrite === 0) continue;
|
||
const attemptKey = attempt === 0 ? key : `${key}:attempt:${attempt + 1}`;
|
||
const dedupKey = `dsh:${sessionId || source.path}:${attemptKey}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const costUSD = calculateCost(observation.model, input, billableOutputTokens("dsh", output, reasoning), cacheWrite, cacheRead, 0);
|
||
const [turn] = key.split(":").map(Number);
|
||
yield {
|
||
provider: "dsh",
|
||
model: observation.model,
|
||
inputTokens: input,
|
||
outputTokens: output,
|
||
cacheCreationInputTokens: cacheWrite,
|
||
cacheReadInputTokens: cacheRead,
|
||
cachedInputTokens: cacheRead,
|
||
reasoningTokens: reasoning,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: !completeUsage,
|
||
tools: attempt === bucket.observations.length - 1 ? [...new Set(bucket.tools)] : [],
|
||
bashCommands: attempt === bucket.observations.length - 1 ? bucket.bashCommands : [],
|
||
skills: attempt === bucket.observations.length - 1 && bucket.skills.length > 0 ? [...new Set(bucket.skills)] : void 0,
|
||
timestamp: isoTimestamp2(observation.time, sessionStart),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: userMessageByTurn.get(turn) ?? "",
|
||
sessionId: sessionId || source.path,
|
||
project: cwd ? projectFromCwd(cwd, source.project) : source.project,
|
||
projectPath: cwd || void 0,
|
||
workingDirectory: cwd || void 0
|
||
};
|
||
}
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createDshProvider(dshHomeOverride) {
|
||
const dshHome = getDshHome(dshHomeOverride);
|
||
const sessionsDir = join16(dshHome, "sessions");
|
||
return {
|
||
name: "dsh",
|
||
displayName: "DeepSeek Harness",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return mapToolName3(rawTool);
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: sessionsDir, label: "sessions" }];
|
||
},
|
||
async discoverSessions(onSkippedVersion) {
|
||
return discoverSessionsInDir3(sessionsDir, onSkippedVersion);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser8(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var zstdDecompress, ZSTD_MAGIC, MAX_FRAME_DECODED_BYTES, SUPPORTED_SESSION_FORMAT_VERSIONS, SESSION_LOG_NAME, MIN_REASONABLE_TIMESTAMP_MS2, noticed, PATH_NOTICE_EXAMPLES, noticedPaths, toolNameMap8, dsh;
|
||
var init_dsh = __esm({
|
||
"src/providers/dsh.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
zstdDecompress = zlib.zstdDecompressSync;
|
||
ZSTD_MAGIC = 4247762216;
|
||
MAX_FRAME_DECODED_BYTES = 64 * 1024 * 1024;
|
||
SUPPORTED_SESSION_FORMAT_VERSIONS = /* @__PURE__ */ new Set([0, 1, 2, 3, 4]);
|
||
SESSION_LOG_NAME = /^session(?:\.v(\d+))?\.jsonl(?:\.zstd)?$/u;
|
||
MIN_REASONABLE_TIMESTAMP_MS2 = 1e12;
|
||
noticed = /* @__PURE__ */ new Set();
|
||
PATH_NOTICE_EXAMPLES = 3;
|
||
noticedPaths = /* @__PURE__ */ new Map();
|
||
toolNameMap8 = {
|
||
bash: "Bash",
|
||
pwsh: "Bash",
|
||
read: "Read",
|
||
write: "Write",
|
||
edit: "Edit",
|
||
str_replace_editor: "Edit",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
todo_write: "TodoWrite",
|
||
todo: "TodoWrite",
|
||
web_search: "WebSearch",
|
||
skill: "Skill",
|
||
agent: "Agent",
|
||
ask_user_question: "AskUserQuestion"
|
||
};
|
||
dsh = createDshProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/gemini.ts
|
||
import { readdir as readdir12, stat as stat14 } from "fs/promises";
|
||
import { join as join17 } from "path";
|
||
import { homedir as homedir17 } from "os";
|
||
function parseSession(data, seenKeys) {
|
||
const results = [];
|
||
let lastUserMessage = "";
|
||
let turnOrdinal = 0;
|
||
let currentTurnId = `${data.sessionId}:prelude`;
|
||
let geminiOrdinal = 0;
|
||
for (const msg of data.messages) {
|
||
if (msg.type === "user") {
|
||
if (Array.isArray(msg.content)) {
|
||
lastUserMessage = msg.content.map((c) => c.text).join(" ").slice(0, 500);
|
||
} else if (typeof msg.content === "string") {
|
||
lastUserMessage = msg.content.slice(0, 500);
|
||
}
|
||
currentTurnId = `${data.sessionId}:turn-${turnOrdinal++}`;
|
||
continue;
|
||
}
|
||
if (msg.type !== "gemini" || !msg.tokens || !msg.model) continue;
|
||
const t = msg.tokens;
|
||
const totalInput = t.input ?? 0;
|
||
const totalOutput = t.output ?? 0;
|
||
const totalCached = t.cached ?? 0;
|
||
const totalThoughts = t.thoughts ?? 0;
|
||
if (totalInput === 0 && totalOutput === 0 && totalCached === 0 && totalThoughts === 0) continue;
|
||
const messageKey = msg.id || `idx-${geminiOrdinal}`;
|
||
geminiOrdinal++;
|
||
const dedupKey = `gemini:${data.sessionId}:${messageKey}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
if (msg.toolCalls) {
|
||
for (const tc of msg.toolCalls) {
|
||
const mapped = toolNameMap9[tc.displayName ?? ""] ?? toolNameMap9[tc.name] ?? tc.displayName ?? tc.name;
|
||
tools.push(mapped);
|
||
if (mapped === "Bash" && tc.args && typeof tc.args.command === "string") {
|
||
bashCommands.push(...extractBashCommands(tc.args.command));
|
||
}
|
||
}
|
||
}
|
||
const freshInput = Math.max(0, totalInput - totalCached);
|
||
const tsDate = new Date(msg.timestamp || data.startTime);
|
||
if (isNaN(tsDate.getTime()) || tsDate.getTime() < 1e12) continue;
|
||
seenKeys.add(dedupKey);
|
||
const costUSD = calculateCost(msg.model, freshInput, totalOutput + totalThoughts, 0, totalCached, 0);
|
||
results.push({
|
||
provider: "gemini",
|
||
model: msg.model,
|
||
inputTokens: freshInput,
|
||
outputTokens: totalOutput,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: totalCached,
|
||
cachedInputTokens: totalCached,
|
||
reasoningTokens: totalThoughts,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [...new Set(bashCommands)],
|
||
timestamp: tsDate.toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
turnId: currentTurnId,
|
||
userMessage: lastUserMessage,
|
||
sessionId: data.sessionId
|
||
});
|
||
}
|
||
return results;
|
||
}
|
||
function parseJsonl(raw) {
|
||
const lines = raw.split("\n").filter((l) => l.trim());
|
||
if (lines.length === 0) return null;
|
||
let sessionId = "";
|
||
let startTime = "";
|
||
let projectHash;
|
||
let lastUpdated;
|
||
let kind;
|
||
const messages = [];
|
||
for (const line of lines) {
|
||
let obj;
|
||
try {
|
||
obj = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (obj["$set"] !== void 0) continue;
|
||
if (obj["sessionId"] && obj["startTime"] && !sessionId) {
|
||
sessionId = obj["sessionId"];
|
||
startTime = obj["startTime"];
|
||
projectHash = obj["projectHash"];
|
||
lastUpdated = obj["lastUpdated"];
|
||
kind = obj["kind"];
|
||
} else if (obj["id"] && obj["type"]) {
|
||
messages.push(obj);
|
||
}
|
||
}
|
||
if (!sessionId) return null;
|
||
return { sessionId, projectHash, startTime, lastUpdated, kind, messages };
|
||
}
|
||
function createParser9(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
if (raw === null) return;
|
||
let data = null;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
if (parsed.messages && parsed.sessionId) {
|
||
data = parsed;
|
||
}
|
||
} catch {
|
||
}
|
||
if (!data) {
|
||
data = parseJsonl(raw);
|
||
}
|
||
if (!data?.messages || !data.sessionId) return;
|
||
const calls = parseSession(data, seenKeys);
|
||
for (const call of calls) {
|
||
yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function getGeminiTmpDir() {
|
||
return join17(homedir17(), ".gemini", "tmp");
|
||
}
|
||
async function discoverSessions() {
|
||
const sources = [];
|
||
const tmpDir = getGeminiTmpDir();
|
||
let projectDirs;
|
||
try {
|
||
const entries = await readdir12(tmpDir, { withFileTypes: true });
|
||
projectDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const project of projectDirs) {
|
||
const chatsDir = join17(tmpDir, project, "chats");
|
||
let files;
|
||
try {
|
||
const entries = await readdir12(chatsDir);
|
||
files = entries.filter((f) => f.startsWith("session-") && (f.endsWith(".json") || f.endsWith(".jsonl")));
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const file of files) {
|
||
const filePath = join17(chatsDir, file);
|
||
const s = await stat14(filePath).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({ path: filePath, project, provider: "gemini" });
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createGeminiProvider() {
|
||
return {
|
||
name: "gemini",
|
||
displayName: "Gemini",
|
||
modelDisplayName(model) {
|
||
if (model === "gemini-auto") return "Gemini (auto)";
|
||
const display = {
|
||
"gemini-3-flash-preview": "Gemini 3 Flash",
|
||
"gemini-3.5-flash": "Gemini 3.5 Flash",
|
||
"gemini-3.1-pro-preview": "Gemini 3.1 Pro",
|
||
"gemini-2.5-pro": "Gemini 2.5 Pro",
|
||
"gemini-2.5-flash": "Gemini 2.5 Flash",
|
||
"gemini-2.0-flash": "Gemini 2.0 Flash"
|
||
};
|
||
return display[model] ?? model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap9[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: getGeminiTmpDir(), label: "tmp" }];
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessions();
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser9(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap9, gemini;
|
||
var init_gemini = __esm({
|
||
"src/providers/gemini.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
toolNameMap9 = {
|
||
read_file: "Read",
|
||
write_file: "Write",
|
||
edit_file: "Edit",
|
||
create_file: "Write",
|
||
delete_file: "Delete",
|
||
list_dir: "LS",
|
||
grep_search: "Grep",
|
||
search_files: "Grep",
|
||
find_files: "Glob",
|
||
run_command: "Bash",
|
||
web_search: "WebSearch",
|
||
ReadFile: "Read",
|
||
WriteFile: "Write",
|
||
EditFile: "Edit",
|
||
ListDir: "LS",
|
||
SearchText: "Grep",
|
||
Shell: "Bash"
|
||
};
|
||
gemini = createGeminiProvider();
|
||
}
|
||
});
|
||
|
||
// src/git-origin.ts
|
||
import { existsSync as existsSync6, readFileSync as readFileSync2, renameSync as renameSync2, statSync as statSync3, writeFileSync } from "fs";
|
||
import { tmpdir } from "os";
|
||
import { basename as basename12, dirname as dirname4, isAbsolute, join as join18 } from "path";
|
||
function parseGitConfigSection(config, section, key) {
|
||
const wanted = `[${section.toLowerCase()}]`;
|
||
let inSection = false;
|
||
for (const raw of config.split(/\r?\n/)) {
|
||
const line = raw.trim();
|
||
if (!line || line.startsWith("#") || line.startsWith(";")) continue;
|
||
if (line.startsWith("[")) {
|
||
inSection = line.toLowerCase() === wanted;
|
||
continue;
|
||
}
|
||
if (!inSection) continue;
|
||
const eq = line.indexOf("=");
|
||
if (eq < 0) continue;
|
||
if (line.slice(0, eq).trim().toLowerCase() !== key.toLowerCase()) continue;
|
||
return line.slice(eq + 1).trim();
|
||
}
|
||
return null;
|
||
}
|
||
function entryKind(path) {
|
||
try {
|
||
const st = statSync3(path);
|
||
return st.isDirectory() ? "dir" : st.isFile() ? "file" : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function resolveGitCommonDir(gitDir) {
|
||
const marker = join18(gitDir, "commondir");
|
||
if (!existsSync6(marker)) return gitDir;
|
||
const rel = readFileSync2(marker, "utf8").trim();
|
||
if (!rel) return gitDir;
|
||
if (rel.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(rel)) return rel;
|
||
return join18(gitDir, rel);
|
||
}
|
||
function readGitOriginUrl(path) {
|
||
const memo2 = originByRoot.get(path);
|
||
if (memo2 !== void 0) return memo2;
|
||
const url = readGitOriginUrlUncached(path);
|
||
originByRoot.set(path, url);
|
||
return url;
|
||
}
|
||
function readGitOriginUrlUncached(path) {
|
||
let dir = path;
|
||
for (let depth = 0; depth < 64; depth++) {
|
||
const url = originAt(dir);
|
||
if (url) return url;
|
||
const parent = dirname4(dir);
|
||
if (parent === dir) return null;
|
||
dir = parent;
|
||
}
|
||
return null;
|
||
}
|
||
function originAt(repoRoot) {
|
||
try {
|
||
let gitDir = join18(repoRoot, ".git");
|
||
const kind = entryKind(gitDir);
|
||
if (kind === "file") {
|
||
const match = readFileSync2(gitDir, "utf8").match(/^gitdir:\s*(.+?)\s*$/m);
|
||
if (!match?.[1]) return null;
|
||
gitDir = match[1].startsWith("/") || /^[a-zA-Z]:[\\/]/.test(match[1]) ? match[1] : join18(repoRoot, match[1]);
|
||
} else if (kind !== "dir") {
|
||
return null;
|
||
}
|
||
for (const configPath of [join18(gitDir, "config"), join18(resolveGitCommonDir(gitDir), "config")]) {
|
||
if (!existsSync6(configPath)) continue;
|
||
const url = parseGitConfigSection(readFileSync2(configPath, "utf8"), 'remote "origin"', "url");
|
||
if (url) return url;
|
||
}
|
||
return null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
var originByRoot;
|
||
var init_git_origin = __esm({
|
||
"src/git-origin.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
originByRoot = /* @__PURE__ */ new Map();
|
||
}
|
||
});
|
||
|
||
// src/hermes-session-ledger.ts
|
||
import { open as open5, rename as rename2, unlink as unlink2, mkdir as mkdir2 } from "fs/promises";
|
||
import { existsSync as existsSync7, readFileSync as readFileSync3, unlinkSync as unlinkSync2 } from "fs";
|
||
import { randomBytes as randomBytes3 } from "crypto";
|
||
import { join as join19 } from "path";
|
||
function isHermesLedgerPublicationError(err) {
|
||
return err instanceof HermesLedgerPublicationError;
|
||
}
|
||
function hermesLedgerNow() {
|
||
return nowFn();
|
||
}
|
||
function hermesSessionLedgerPath() {
|
||
return join19(getCodeburnCacheDir(), HERMES_SESSION_LEDGER_FILENAME);
|
||
}
|
||
function emptyHermesSessionLedger() {
|
||
return { version: HERMES_SESSION_LEDGER_VERSION, cursors: {} };
|
||
}
|
||
function hermesBaselineKey(profile, sessionId) {
|
||
return `hermes:${profile}:${sessionId}`;
|
||
}
|
||
function hermesObservationKey(profile, sessionId, n) {
|
||
return `hermes:${profile}:${sessionId}:obs:${n}`;
|
||
}
|
||
function getHermesCursor(ledger, profile, sessionId) {
|
||
return ledger.cursors[profile]?.[sessionId];
|
||
}
|
||
function listHermesCursorSessionIds(ledger, profile) {
|
||
return Object.keys(ledger.cursors[profile] ?? {});
|
||
}
|
||
function zeroHermesTokens() {
|
||
return { ...ZERO_TOKENS };
|
||
}
|
||
function tokenList(t) {
|
||
return [t.inputTokens, t.outputTokens, t.cacheReadTokens, t.cacheWriteTokens, t.reasoningTokens];
|
||
}
|
||
function tokensGte(curr, last) {
|
||
const a = tokenList(curr);
|
||
const b = tokenList(last);
|
||
return a.every((v, i) => v >= b[i]);
|
||
}
|
||
function tokensEqual(a, b) {
|
||
return tokenList(a).every((v, i) => v === tokenList(b)[i]);
|
||
}
|
||
function subtractTokens(curr, last) {
|
||
return {
|
||
inputTokens: curr.inputTokens - last.inputTokens,
|
||
outputTokens: curr.outputTokens - last.outputTokens,
|
||
cacheReadTokens: curr.cacheReadTokens - last.cacheReadTokens,
|
||
cacheWriteTokens: curr.cacheWriteTokens - last.cacheWriteTokens,
|
||
reasoningTokens: curr.reasoningTokens - last.reasoningTokens
|
||
};
|
||
}
|
||
function hasPositiveTokenDelta(delta) {
|
||
return tokenList(delta).some((v) => v > 0);
|
||
}
|
||
function applyHermesSnapshot(existing, snapshot) {
|
||
if (!existing) {
|
||
const first2 = {
|
||
index: 0,
|
||
timestamp: snapshot.startedAt,
|
||
...snapshot.tokens,
|
||
costUSD: snapshot.costUSD,
|
||
costBasis: snapshot.costBasis,
|
||
supplementaryAccounting: false
|
||
};
|
||
return {
|
||
cursor: {
|
||
profile: snapshot.profile,
|
||
sessionId: snapshot.sessionId,
|
||
lastSeen: {
|
||
...snapshot.tokens,
|
||
costUSD: snapshot.costUSD,
|
||
costBasis: snapshot.costBasis
|
||
},
|
||
observations: [first2]
|
||
},
|
||
dirty: true
|
||
};
|
||
}
|
||
const last = existing.lastSeen;
|
||
const sameCost = snapshot.costUSD === last.costUSD && snapshot.costBasis === last.costBasis;
|
||
if (tokensEqual(snapshot.tokens, last) && sameCost) {
|
||
return { cursor: existing, dirty: false };
|
||
}
|
||
if (!tokensGte(snapshot.tokens, last)) {
|
||
return {
|
||
cursor: {
|
||
...existing,
|
||
lastSeen: {
|
||
...snapshot.tokens,
|
||
costUSD: snapshot.costUSD,
|
||
costBasis: snapshot.costBasis
|
||
}
|
||
},
|
||
dirty: true
|
||
};
|
||
}
|
||
const tokenDelta = subtractTokens(snapshot.tokens, last);
|
||
const positiveTokens = hasPositiveTokenDelta(tokenDelta);
|
||
const costGrew = snapshot.costUSD >= last.costUSD;
|
||
const costDelta = costGrew ? snapshot.costUSD - last.costUSD : 0;
|
||
const first = existing.observations[0];
|
||
const legacyIncludedSeed = snapshot.costBasis === "included" && snapshot.costUSD === 0 && last.costBasis === "actual" && last.costUSD === 0 && existing.observations.length === 1 && first?.index === 0 && first.costBasis === "actual" && first.costUSD === 0 && tokensEqual(first, snapshot.tokens);
|
||
if (!positiveTokens && costDelta === 0 && legacyIncludedSeed) {
|
||
return {
|
||
cursor: {
|
||
...existing,
|
||
lastSeen: { ...snapshot.tokens, costUSD: 0, costBasis: "included" },
|
||
observations: [{ ...first, costBasis: "included" }]
|
||
},
|
||
dirty: true
|
||
};
|
||
}
|
||
if (!positiveTokens && costDelta === 0) {
|
||
return {
|
||
cursor: {
|
||
...existing,
|
||
lastSeen: {
|
||
...snapshot.tokens,
|
||
costUSD: snapshot.costUSD,
|
||
costBasis: snapshot.costBasis
|
||
}
|
||
},
|
||
dirty: true
|
||
};
|
||
}
|
||
const nextIndex = existing.observations.reduce((max, obs) => Math.max(max, obs.index), 0) + 1;
|
||
const observation = {
|
||
index: nextIndex,
|
||
timestamp: snapshot.observedAt,
|
||
...tokenDelta,
|
||
costUSD: costDelta,
|
||
costBasis: snapshot.costBasis,
|
||
supplementaryAccounting: true
|
||
};
|
||
return {
|
||
cursor: {
|
||
...existing,
|
||
lastSeen: {
|
||
...snapshot.tokens,
|
||
costUSD: snapshot.costUSD,
|
||
costBasis: snapshot.costBasis
|
||
},
|
||
observations: [...existing.observations, observation]
|
||
},
|
||
dirty: true
|
||
};
|
||
}
|
||
function putCursor(ledger, cursor) {
|
||
return {
|
||
version: HERMES_SESSION_LEDGER_VERSION,
|
||
cursors: {
|
||
...ledger.cursors,
|
||
[cursor.profile]: {
|
||
...ledger.cursors[cursor.profile] ?? {},
|
||
[cursor.sessionId]: cursor
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function isNum(v) {
|
||
return typeof v === "number" && Number.isFinite(v);
|
||
}
|
||
function isCostBasis(v) {
|
||
return v === "actual" || v === "estimated" || v === "calculated" || v === "included";
|
||
}
|
||
function validateTokens(o) {
|
||
return isNum(o["inputTokens"]) && isNum(o["outputTokens"]) && isNum(o["cacheReadTokens"]) && isNum(o["cacheWriteTokens"]) && isNum(o["reasoningTokens"]);
|
||
}
|
||
function validateObservation(v) {
|
||
if (!v || typeof v !== "object") return false;
|
||
const o = v;
|
||
return validateTokens(o) && isNum(o["index"]) && typeof o["timestamp"] === "string" && isNum(o["costUSD"]) && isCostBasis(o["costBasis"]) && typeof o["supplementaryAccounting"] === "boolean";
|
||
}
|
||
function validateCursor(v) {
|
||
if (!v || typeof v !== "object") return false;
|
||
const o = v;
|
||
if (typeof o["profile"] !== "string" || typeof o["sessionId"] !== "string") return false;
|
||
if (!o["lastSeen"] || typeof o["lastSeen"] !== "object") return false;
|
||
const last = o["lastSeen"];
|
||
if (!validateTokens(last) || !isNum(last["costUSD"]) || !isCostBasis(last["costBasis"])) return false;
|
||
if (!Array.isArray(o["observations"]) || !o["observations"].every(validateObservation)) return false;
|
||
return true;
|
||
}
|
||
function validateLedger(raw) {
|
||
if (!raw || typeof raw !== "object") return false;
|
||
const o = raw;
|
||
if (o["version"] !== HERMES_SESSION_LEDGER_VERSION) return false;
|
||
if (!o["cursors"] || typeof o["cursors"] !== "object" || Array.isArray(o["cursors"])) return false;
|
||
for (const profileCursors of Object.values(o["cursors"])) {
|
||
if (!profileCursors || typeof profileCursors !== "object" || Array.isArray(profileCursors)) return false;
|
||
if (!Object.values(profileCursors).every(validateCursor)) return false;
|
||
}
|
||
return true;
|
||
}
|
||
function readLedgerFromDisk() {
|
||
const path = hermesSessionLedgerPath();
|
||
if (!existsSync7(path)) {
|
||
const v1 = join19(getCodeburnCacheDir(), "hermes-session-ledger.v1.json");
|
||
if (existsSync7(v1)) {
|
||
try {
|
||
unlinkSync2(v1);
|
||
} catch {
|
||
}
|
||
}
|
||
return emptyHermesSessionLedger();
|
||
}
|
||
try {
|
||
const parsed = JSON.parse(readFileSync3(path, "utf-8"));
|
||
if (!validateLedger(parsed)) return emptyHermesSessionLedger();
|
||
return parsed;
|
||
} catch {
|
||
return emptyHermesSessionLedger();
|
||
}
|
||
}
|
||
function loadHermesSessionLedger() {
|
||
const dir = getCodeburnCacheDir();
|
||
if (memory && memoryDir === dir) return memory;
|
||
const loaded = readLedgerFromDisk();
|
||
memory = loaded;
|
||
memoryDir = dir;
|
||
return loaded;
|
||
}
|
||
async function writeFileAtomic2(finalPath, payload) {
|
||
const tempPath = `${finalPath}.${randomBytes3(8).toString("hex")}.tmp`;
|
||
const handle = await open5(tempPath, "w", 384);
|
||
try {
|
||
await handle.writeFile(payload, { encoding: "utf-8" });
|
||
await handle.sync();
|
||
} finally {
|
||
await handle.close();
|
||
}
|
||
try {
|
||
for (let attempt = 0; attempt < 3; attempt++) {
|
||
try {
|
||
await rename2(tempPath, finalPath);
|
||
return;
|
||
} catch (err) {
|
||
const code = err.code;
|
||
if (code !== "EPERM" && code !== "EBUSY" || attempt === 2) throw err;
|
||
await new Promise((resolve9) => {
|
||
setTimeout(resolve9, 10 * (attempt + 1));
|
||
});
|
||
}
|
||
}
|
||
} catch (err) {
|
||
await unlink2(tempPath).catch(() => void 0);
|
||
throw err;
|
||
}
|
||
}
|
||
async function persistHermesSessionLedger(ledger) {
|
||
const dir = getCodeburnCacheDir();
|
||
const finalPath = join19(dir, HERMES_SESSION_LEDGER_FILENAME);
|
||
try {
|
||
await mkdir2(dir, { recursive: true });
|
||
await writeFileAtomic2(finalPath, JSON.stringify(ledger));
|
||
} catch (err) {
|
||
throw new HermesLedgerPublicationError(
|
||
`failed to publish Hermes session ledger at ${finalPath}`,
|
||
{ cause: err }
|
||
);
|
||
}
|
||
memory = ledger;
|
||
memoryDir = dir;
|
||
}
|
||
async function recordHermesSnapshot(snapshot) {
|
||
const ledger = loadHermesSessionLedger();
|
||
const existing = getHermesCursor(ledger, snapshot.profile, snapshot.sessionId);
|
||
const { cursor, dirty } = applyHermesSnapshot(existing, snapshot);
|
||
if (dirty) await persistHermesSessionLedger(putCursor(ledger, cursor));
|
||
return cursor;
|
||
}
|
||
var HERMES_SESSION_LEDGER_FILENAME, HERMES_SESSION_LEDGER_VERSION, HermesLedgerPublicationError, ZERO_TOKENS, nowFn, memory, memoryDir;
|
||
var init_hermes_session_ledger = __esm({
|
||
"src/hermes-session-ledger.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
HERMES_SESSION_LEDGER_FILENAME = "hermes-session-ledger.v3.json";
|
||
HERMES_SESSION_LEDGER_VERSION = 3;
|
||
HermesLedgerPublicationError = class extends Error {
|
||
name = "HermesLedgerPublicationError";
|
||
constructor(message, options) {
|
||
super(message, options);
|
||
}
|
||
};
|
||
ZERO_TOKENS = {
|
||
inputTokens: 0,
|
||
outputTokens: 0,
|
||
cacheReadTokens: 0,
|
||
cacheWriteTokens: 0,
|
||
reasoningTokens: 0
|
||
};
|
||
nowFn = () => /* @__PURE__ */ new Date();
|
||
memory = null;
|
||
memoryDir = null;
|
||
}
|
||
});
|
||
|
||
// src/providers/hermes.ts
|
||
import { readdir as readdir13, stat as stat15 } from "fs/promises";
|
||
import { basename as basename13, dirname as dirname5, join as join20 } from "path";
|
||
import { homedir as homedir18 } from "os";
|
||
function getHermesHome(override) {
|
||
if (override !== void 0) return override;
|
||
const configuredHome = process.env["HERMES_HOME"]?.trim();
|
||
if (configuredHome) return configuredHome;
|
||
if (process.platform === "win32") {
|
||
const localAppData = process.env["LOCALAPPDATA"]?.trim();
|
||
return join20(localAppData || join20(homedir18(), "AppData", "Local"), "hermes");
|
||
}
|
||
return join20(homedir18(), ".hermes");
|
||
}
|
||
function displayProjectForProfile(profile) {
|
||
return profile === "default" ? "hermes" : sanitizeProject2(profile);
|
||
}
|
||
function stripCodeRegions(text2) {
|
||
const out = [];
|
||
let fence = null;
|
||
for (const line of text2.split("\n")) {
|
||
const trimmed = line.replace(/\s+$/, "");
|
||
const open7 = trimmed.match(/^(\s*)([`~]{3,})(.*)$/);
|
||
if (!fence) {
|
||
if (open7 && !open7[3].includes(open7[2][0])) {
|
||
fence = { marker: open7[2][0], length: open7[2].length };
|
||
out.push(" ");
|
||
continue;
|
||
}
|
||
if (/^[ \t]{4,}\S/.test(line)) {
|
||
out.push(" ");
|
||
continue;
|
||
}
|
||
out.push(line.replace(/`[^`]*`/g, " "));
|
||
continue;
|
||
}
|
||
const close = trimmed.match(/^(\s*)([`~]{3,})\s*$/);
|
||
if (close && close[2][0] === fence.marker && close[2].length >= fence.length) {
|
||
fence = null;
|
||
}
|
||
out.push(" ");
|
||
}
|
||
return out.join("\n");
|
||
}
|
||
function githubOwnerRepoFromUrl(url) {
|
||
const gh = url.match(/github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?$/i);
|
||
if (!gh) return null;
|
||
return { owner: gh[1].toLowerCase(), repo: gh[2].replace(/\.git$/i, "").toLowerCase() };
|
||
}
|
||
function githubOwnerRepoFromRoot(repoRoot) {
|
||
const memo2 = originIdentityByRoot.get(repoRoot);
|
||
if (memo2 !== void 0) return memo2;
|
||
const identity = readGithubOwnerRepoFromRoot(repoRoot);
|
||
originIdentityByRoot.set(repoRoot, identity);
|
||
return identity;
|
||
}
|
||
function readGithubOwnerRepoFromRoot(repoRoot) {
|
||
const url = readGitOriginUrl(repoRoot);
|
||
return url ? githubOwnerRepoFromUrl(url) : null;
|
||
}
|
||
function extractGithubPullUrls(texts, identity) {
|
||
if (!identity) return [];
|
||
const found = /* @__PURE__ */ new Set();
|
||
const re = /https:\/\/github\.com\/[^/\s"'<>]+\/[^/\s"'<>]+\/pull\/\d+/gi;
|
||
for (const text2 of texts) {
|
||
if (!text2) continue;
|
||
const searchable = stripCodeRegions(text2);
|
||
for (const match of searchable.matchAll(re)) {
|
||
try {
|
||
const url = new URL(match[0]);
|
||
if (url.protocol !== "https:") continue;
|
||
const pathMatch = url.pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/\d+$/);
|
||
if (!pathMatch) continue;
|
||
if (pathMatch[1].toLowerCase() !== identity.owner) continue;
|
||
if (pathMatch[2].toLowerCase() !== identity.repo) continue;
|
||
found.add(`${url.origin}${url.pathname}`);
|
||
} catch {
|
||
}
|
||
}
|
||
}
|
||
return [...found].sort();
|
||
}
|
||
function sanitizeProject2(raw) {
|
||
const trimmed = raw.trim();
|
||
if (!trimmed) return "hermes";
|
||
return trimmed.replace(/^[/\\]+/, "").replace(/[:/\\]/g, "-");
|
||
}
|
||
function parseProfileName(dbPath, hermesHome) {
|
||
const profilesDir = join20(hermesHome, "profiles");
|
||
const dir = dirname5(dbPath);
|
||
if (dirname5(dir) === profilesDir) return basename13(dir);
|
||
return "default";
|
||
}
|
||
async function findStateDbs(hermesHome) {
|
||
const dbs = [];
|
||
const rootDb = join20(hermesHome, "state.db");
|
||
const rootStat = await stat15(rootDb).catch(() => null);
|
||
if (rootStat?.isFile()) dbs.push({ dbPath: rootDb, profile: "default" });
|
||
const profilesDir = join20(hermesHome, "profiles");
|
||
const profiles = await readdir13(profilesDir, { withFileTypes: true }).catch(() => []);
|
||
for (const entry of profiles) {
|
||
if (!entry.isDirectory()) continue;
|
||
const dbPath = join20(profilesDir, entry.name, "state.db");
|
||
const s = await stat15(dbPath).catch(() => null);
|
||
if (s?.isFile()) dbs.push({ dbPath, profile: entry.name });
|
||
}
|
||
return dbs;
|
||
}
|
||
function encodeSourcePath(dbPath, sessionId) {
|
||
return `${dbPath}#hermes-session=${encodeURIComponent(sessionId)}`;
|
||
}
|
||
function decodeSourcePath(path) {
|
||
const marker = "#hermes-session=";
|
||
const idx = path.lastIndexOf(marker);
|
||
if (idx === -1) return null;
|
||
return {
|
||
dbPath: path.slice(0, idx),
|
||
sessionId: decodeURIComponent(path.slice(idx + marker.length))
|
||
};
|
||
}
|
||
function validateSchema(db) {
|
||
try {
|
||
db.query("SELECT session_id, role, content, tool_calls FROM messages LIMIT 1");
|
||
const columns = getSessionColumns(db);
|
||
return columns.has("id") && columns.has("input_tokens") && columns.has("output_tokens");
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return false;
|
||
}
|
||
}
|
||
function getSessionColumns(db) {
|
||
return new Set(db.query("PRAGMA table_info(sessions)").map((row) => row.name));
|
||
}
|
||
function numberColumn(columns, name) {
|
||
return columns.has(name) ? `coalesce(${name}, 0) AS ${name}` : `0 AS ${name}`;
|
||
}
|
||
function nullableColumn(columns, name) {
|
||
return columns.has(name) ? name : `NULL AS ${name}`;
|
||
}
|
||
function getMessageColumns(db) {
|
||
return new Set(db.query("PRAGMA table_info(messages)").map((row) => row.name));
|
||
}
|
||
function usageExpression(columns) {
|
||
const usageColumns = [
|
||
"input_tokens",
|
||
"output_tokens",
|
||
"cache_read_tokens",
|
||
"cache_write_tokens",
|
||
"reasoning_tokens"
|
||
];
|
||
const parts = usageColumns.filter((name) => columns.has(name)).map((name) => `coalesce(${name}, 0)`);
|
||
return parts.length > 0 ? parts.join(" + ") : "0";
|
||
}
|
||
function parseTimestamp(raw) {
|
||
if (raw == null) return "";
|
||
const ms = raw < 1e12 ? raw * 1e3 : raw;
|
||
return new Date(ms).toISOString();
|
||
}
|
||
function firstUserMessage3(messages) {
|
||
const msg = messages.find((m) => m.role === "user" && typeof m.content === "string" && m.content.trim().length > 0);
|
||
return Array.from(msg?.content ?? "").slice(0, 500).join("");
|
||
}
|
||
function mapToolName4(raw) {
|
||
if (raw.startsWith("mcp_composio_")) return "MCP";
|
||
if (raw.startsWith("mcp_") || raw.startsWith("mcp__")) return raw;
|
||
if (raw.startsWith("browser_")) return "Browser";
|
||
return toolNameMap10[raw] ?? raw;
|
||
}
|
||
function parseToolCalls(raw) {
|
||
if (!raw) return [];
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
return Array.isArray(parsed) ? parsed : [];
|
||
} catch {
|
||
return [];
|
||
}
|
||
}
|
||
function collectTools3(messages) {
|
||
const tools = [];
|
||
const toolSequence = [];
|
||
const bashCommands = [];
|
||
for (const msg of messages) {
|
||
if (msg.role === "assistant") {
|
||
const currentTurnTools = [];
|
||
for (const call of parseToolCalls(msg.tool_calls)) {
|
||
const rawName = call.function?.name ?? "";
|
||
if (!rawName) continue;
|
||
const mapped = mapToolName4(rawName);
|
||
tools.push(mapped);
|
||
const toolCall = { tool: mapped };
|
||
const rawArgs = call.function?.arguments;
|
||
if (rawArgs) {
|
||
try {
|
||
const args = JSON.parse(rawArgs);
|
||
const file = args["path"] ?? args["file_path"];
|
||
if (typeof file === "string") toolCall.file = file;
|
||
const command = args["command"];
|
||
if (typeof command === "string") {
|
||
toolCall.command = command;
|
||
bashCommands.push(command);
|
||
}
|
||
} catch {
|
||
}
|
||
}
|
||
currentTurnTools.push(toolCall);
|
||
}
|
||
if (currentTurnTools.length > 0) {
|
||
toolSequence.push(currentTurnTools);
|
||
}
|
||
} else if (msg.role === "tool" && msg.tool_name) {
|
||
tools.push(mapToolName4(msg.tool_name));
|
||
}
|
||
}
|
||
return {
|
||
tools: [...new Set(tools)],
|
||
toolSequence: toolSequence.length > 0 ? toolSequence : [],
|
||
bashCommands
|
||
};
|
||
}
|
||
function isRealWorkspace(cwd) {
|
||
if (!cwd?.trim()) return false;
|
||
const trimmed = cwd.trim();
|
||
const isAbsolute3 = process.platform === "win32" ? /^[a-zA-Z]:[\\/]/.test(trimmed) || /^\\\\[^\\/]+\\/.test(trimmed) || trimmed.startsWith("/") && !trimmed.startsWith("//") : trimmed.startsWith("/") && !trimmed.startsWith("//");
|
||
if (!isAbsolute3) return false;
|
||
const normalized = trimmed.replace(/\\/g, "/").replace(/\/+$/, "");
|
||
if (normalized === "/" || normalized === homedir18() || normalized === homedir18().replace(/\\/g, "/") || isUserHomeRoot(normalized)) return false;
|
||
if (/\.app\/Contents\//.test(normalized)) return false;
|
||
return true;
|
||
}
|
||
function resolveHermesWorkspace(row, messages) {
|
||
const provider = "hermes";
|
||
const repo = row.git_repo_root?.trim();
|
||
if (isRealWorkspace(repo)) {
|
||
return { project: sanitizeProject2(basename13(repo)), projectPath: repo, workingDirectory: repo, provider };
|
||
}
|
||
const cwd = row.cwd?.trim();
|
||
if (isRealWorkspace(cwd)) {
|
||
return { project: sanitizeProject2(cwd), projectPath: cwd, workingDirectory: cwd, provider };
|
||
}
|
||
const inferred = inferProject(messages, "");
|
||
if (isRealWorkspace(inferred.projectPath)) {
|
||
return { project: inferred.project, provider };
|
||
}
|
||
return { project: provider, provider };
|
||
}
|
||
function tokenSum(tokens2) {
|
||
return tokens2.inputTokens + tokens2.outputTokens + tokens2.cacheReadTokens + tokens2.cacheWriteTokens + tokens2.reasoningTokens;
|
||
}
|
||
function resolveHermesCost(row, model, tokens2) {
|
||
const calculatedCost = calculateCost(
|
||
model,
|
||
tokens2.inputTokens,
|
||
tokens2.outputTokens + tokens2.reasoningTokens,
|
||
tokens2.cacheWriteTokens,
|
||
tokens2.cacheReadTokens,
|
||
0
|
||
);
|
||
if (row && row.actual_cost_usd != null) {
|
||
return { costUSD: row.actual_cost_usd, costIsEstimated: false, costBasis: "actual" };
|
||
}
|
||
const costStatus = row?.cost_status?.trim().toLowerCase();
|
||
const costSource = row?.cost_source?.trim().toLowerCase();
|
||
if (costStatus === "included") {
|
||
return { costUSD: 0, costIsEstimated: false, costBasis: "included" };
|
||
}
|
||
if (costStatus === "estimated" && row?.estimated_cost_usd != null) {
|
||
return { costUSD: row.estimated_cost_usd, costIsEstimated: true, costBasis: "estimated" };
|
||
}
|
||
if (!costStatus && !costSource && row && row.estimated_cost_usd != null && row.estimated_cost_usd > 0) {
|
||
return { costUSD: row.estimated_cost_usd, costIsEstimated: true, costBasis: "estimated" };
|
||
}
|
||
return { costUSD: calculatedCost, costIsEstimated: true, costBasis: "calculated" };
|
||
}
|
||
function billingFromCostBasis(basis) {
|
||
if (basis === "included") return "subscription";
|
||
if (basis === "actual") return "metered";
|
||
return void 0;
|
||
}
|
||
function observationToCall(observation, args) {
|
||
const later = observation.index > 0;
|
||
const billing = billingFromCostBasis(observation.costBasis);
|
||
return {
|
||
provider: "hermes",
|
||
model: args.model,
|
||
inputTokens: observation.inputTokens,
|
||
outputTokens: observation.outputTokens,
|
||
cacheCreationInputTokens: observation.cacheWriteTokens,
|
||
cacheReadInputTokens: observation.cacheReadTokens,
|
||
cachedInputTokens: observation.cacheReadTokens,
|
||
reasoningTokens: observation.reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD: observation.costUSD,
|
||
// Later observations keep the stored basis. Included and actual are
|
||
// recorded facts; estimated and calculated remain estimates.
|
||
costIsEstimated: later ? observation.costBasis === "calculated" || observation.costBasis === "estimated" : args.costIsEstimated,
|
||
tools: later ? [] : args.tools,
|
||
bashCommands: later ? [] : args.bashCommands,
|
||
timestamp: observation.timestamp,
|
||
speed: "standard",
|
||
deduplicationKey: later ? hermesObservationKey(args.profile, args.sessionId, observation.index) : hermesBaselineKey(args.profile, args.sessionId),
|
||
turnId: later ? `${args.sessionId}:obs:${observation.index}` : `${args.sessionId}:session`,
|
||
toolSequence: later || args.toolSequence.length === 0 ? void 0 : args.toolSequence,
|
||
userMessage: later ? "" : args.userMessage,
|
||
sessionId: args.sessionId,
|
||
project: args.project,
|
||
projectPath: args.projectPath,
|
||
workingDirectory: args.workingDirectory,
|
||
...later || !args.prLinks?.length ? {} : { prLinks: args.prLinks },
|
||
...later ? { supplementaryAccounting: true } : {},
|
||
...args.route ? { route: args.route } : {},
|
||
...billing ? { billing } : {}
|
||
};
|
||
}
|
||
function inferProject(messages, fallback) {
|
||
const cwdPattern = /^Current working directory:\s*([a-zA-Z]:\\[^\r\n`"]+|\/[^\r\n`"\\]+)/m;
|
||
for (const msg of messages) {
|
||
if (msg.role !== "user" && msg.role !== "system") continue;
|
||
const match = cwdPattern.exec(msg.content ?? "");
|
||
if (match?.[1]) {
|
||
const projectPath = match[1].trim();
|
||
return { project: sanitizeProject2(projectPath), projectPath };
|
||
}
|
||
}
|
||
return { project: fallback };
|
||
}
|
||
async function discoverFromDb(dbPath, profile) {
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return [];
|
||
}
|
||
try {
|
||
if (!validateSchema(db)) return [];
|
||
const columns = getSessionColumns(db);
|
||
const usage = usageExpression(columns);
|
||
const orderBy = columns.has("started_at") ? "started_at DESC" : "id DESC";
|
||
const rows = db.query(
|
||
`SELECT id,
|
||
${nullableColumn(columns, "title")},
|
||
${numberColumn(columns, "input_tokens")},
|
||
${numberColumn(columns, "output_tokens")},
|
||
${numberColumn(columns, "cache_read_tokens")},
|
||
${numberColumn(columns, "cache_write_tokens")},
|
||
${numberColumn(columns, "reasoning_tokens")}
|
||
FROM sessions
|
||
WHERE ${usage} > 0
|
||
ORDER BY ${orderBy}
|
||
LIMIT 10000`
|
||
);
|
||
const sources = rows.map((row) => ({
|
||
path: encodeSourcePath(dbPath, row.id),
|
||
project: displayProjectForProfile(profile),
|
||
provider: "hermes"
|
||
}));
|
||
const discoveredIds = new Set(rows.map((row) => row.id));
|
||
const ledger = loadHermesSessionLedger();
|
||
for (const sessionId of listHermesCursorSessionIds(ledger, profile)) {
|
||
if (discoveredIds.has(sessionId)) continue;
|
||
sources.push({
|
||
path: encodeSourcePath(dbPath, sessionId),
|
||
project: displayProjectForProfile(profile),
|
||
provider: "hermes"
|
||
});
|
||
}
|
||
return sources;
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
process.stderr.write(`codeburn: error querying Hermes database: ${err instanceof Error ? err.message : err}
|
||
`);
|
||
return [];
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
function createParser10(source, seenKeys, hermesHome) {
|
||
return {
|
||
async *parse() {
|
||
if (!isSqliteAvailable()) {
|
||
process.stderr.write(getSqliteLoadError() + "\n");
|
||
return;
|
||
}
|
||
const decoded = decodeSourcePath(source.path);
|
||
if (!decoded) return;
|
||
const profile = parseProfileName(decoded.dbPath, hermesHome);
|
||
let db;
|
||
try {
|
||
db = openDatabase(decoded.dbPath);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
process.stderr.write(`codeburn: cannot open Hermes database: ${err instanceof Error ? err.message : err}
|
||
`);
|
||
return;
|
||
}
|
||
let result;
|
||
try {
|
||
if (!validateSchema(db)) return;
|
||
const columns = getSessionColumns(db);
|
||
const rows = db.query(
|
||
`SELECT id,
|
||
${nullableColumn(columns, "source")},
|
||
${nullableColumn(columns, "model")},
|
||
${nullableColumn(columns, "cwd")},
|
||
${nullableColumn(columns, "git_repo_root")},
|
||
${nullableColumn(columns, "billing_provider")},
|
||
${numberColumn(columns, "input_tokens")},
|
||
${numberColumn(columns, "output_tokens")},
|
||
${numberColumn(columns, "cache_read_tokens")},
|
||
${numberColumn(columns, "cache_write_tokens")},
|
||
${numberColumn(columns, "reasoning_tokens")},
|
||
${nullableColumn(columns, "estimated_cost_usd")},
|
||
${nullableColumn(columns, "actual_cost_usd")},
|
||
${nullableColumn(columns, "cost_status")},
|
||
${nullableColumn(columns, "cost_source")},
|
||
${numberColumn(columns, "api_call_count")},
|
||
${numberColumn(columns, "tool_call_count")},
|
||
${nullableColumn(columns, "started_at")},
|
||
${nullableColumn(columns, "ended_at")},
|
||
${nullableColumn(columns, "title")}
|
||
FROM sessions
|
||
WHERE id = ?`,
|
||
[decoded.sessionId]
|
||
);
|
||
const row = rows[0];
|
||
const ledger = loadHermesSessionLedger();
|
||
const existingCursor = getHermesCursor(ledger, profile, decoded.sessionId);
|
||
if (!row) {
|
||
if (!existingCursor) return;
|
||
const baselineKey = hermesBaselineKey(profile, decoded.sessionId);
|
||
if (seenKeys.has(baselineKey)) return;
|
||
seenKeys.add(baselineKey);
|
||
const cursor = await recordHermesSnapshot({
|
||
profile,
|
||
sessionId: decoded.sessionId,
|
||
startedAt: existingCursor.observations[0]?.timestamp || hermesLedgerNow().toISOString(),
|
||
observedAt: hermesLedgerNow().toISOString(),
|
||
tokens: zeroHermesTokens(),
|
||
costUSD: 0,
|
||
costBasis: "calculated"
|
||
});
|
||
for (const observation of cursor.observations) {
|
||
if (observation.index > 0) seenKeys.add(hermesObservationKey(profile, decoded.sessionId, observation.index));
|
||
}
|
||
result = {
|
||
calls: cursor.observations.map((observation) => observationToCall(observation, {
|
||
profile,
|
||
sessionId: decoded.sessionId,
|
||
model: "unknown",
|
||
tools: [],
|
||
bashCommands: [],
|
||
toolSequence: [],
|
||
userMessage: "",
|
||
project: displayProjectForProfile(profile),
|
||
costIsEstimated: false
|
||
}))
|
||
};
|
||
} else {
|
||
const messageColumns = getMessageColumns(db);
|
||
const orderColumns = ["timestamp", "id"].filter((name) => messageColumns.has(name));
|
||
const orderBy = orderColumns.length > 0 ? `ORDER BY ${orderColumns.join(" ASC, ")} ASC` : "";
|
||
const messages = db.query(
|
||
`SELECT ${numberColumn(messageColumns, "id")},
|
||
role,
|
||
content,
|
||
tool_calls,
|
||
${nullableColumn(messageColumns, "tool_name")},
|
||
${nullableColumn(messageColumns, "timestamp")}
|
||
FROM messages
|
||
WHERE session_id = ?
|
||
${orderBy}`,
|
||
[decoded.sessionId]
|
||
);
|
||
const inputTokens = row.input_tokens ?? 0;
|
||
const outputTokens = row.output_tokens ?? 0;
|
||
const cacheReadTokens = row.cache_read_tokens ?? 0;
|
||
const cacheWriteTokens = row.cache_write_tokens ?? 0;
|
||
const reasoningTokens = row.reasoning_tokens ?? 0;
|
||
const tokens2 = {
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheReadTokens,
|
||
cacheWriteTokens,
|
||
reasoningTokens
|
||
};
|
||
if (tokenSum(tokens2) === 0 && !existingCursor) return;
|
||
const model = row.model ?? "unknown";
|
||
const { tools, toolSequence, bashCommands } = collectTools3(messages);
|
||
const workspace = resolveHermesWorkspace(row, messages);
|
||
const timestamp2 = parseTimestamp(row.started_at);
|
||
const baselineKey = hermesBaselineKey(profile, row.id);
|
||
if (seenKeys.has(baselineKey)) return;
|
||
seenKeys.add(baselineKey);
|
||
const identity = workspace.projectPath ? githubOwnerRepoFromRoot(workspace.projectPath) : null;
|
||
const prLinks = extractGithubPullUrls(
|
||
messages.filter((msg) => msg.role === "assistant" || msg.role === "user").map((msg) => msg.content),
|
||
identity
|
||
);
|
||
const cost = resolveHermesCost(row, model, tokens2);
|
||
const cursor = await recordHermesSnapshot({
|
||
profile,
|
||
sessionId: row.id,
|
||
startedAt: timestamp2 || hermesLedgerNow().toISOString(),
|
||
observedAt: hermesLedgerNow().toISOString(),
|
||
tokens: tokens2,
|
||
costUSD: cost.costUSD,
|
||
costBasis: cost.costBasis
|
||
});
|
||
for (const observation of cursor.observations) {
|
||
if (observation.index > 0) seenKeys.add(hermesObservationKey(profile, row.id, observation.index));
|
||
}
|
||
result = {
|
||
calls: cursor.observations.map((observation) => observationToCall(observation, {
|
||
profile,
|
||
sessionId: row.id,
|
||
model,
|
||
tools,
|
||
bashCommands,
|
||
toolSequence,
|
||
userMessage: firstUserMessage3(messages),
|
||
project: workspace.project,
|
||
projectPath: workspace.projectPath,
|
||
workingDirectory: workspace.workingDirectory,
|
||
prLinks,
|
||
costIsEstimated: cost.costIsEstimated,
|
||
route: routeFromProviderField(row.billing_provider)?.id
|
||
}))
|
||
};
|
||
}
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err) || isHermesLedgerPublicationError(err)) throw err;
|
||
const detail = err instanceof Error ? err.message : err;
|
||
process.stderr.write(`codeburn: error querying Hermes database: ${detail}
|
||
`);
|
||
return;
|
||
} finally {
|
||
db.close();
|
||
}
|
||
if (result) {
|
||
for (const call of result.calls) yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createHermesProvider(hermesHomeOverride) {
|
||
const hermesHome = getHermesHome(hermesHomeOverride);
|
||
return {
|
||
name: "hermes",
|
||
displayName: "Hermes Agent",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return mapToolName4(rawTool);
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: hermesHome, label: "home" }];
|
||
},
|
||
async discoverSessions() {
|
||
if (!isSqliteAvailable()) return [];
|
||
const dbs = await findStateDbs(hermesHome);
|
||
const sessions = [];
|
||
for (const { dbPath, profile } of dbs) {
|
||
sessions.push(...await discoverFromDb(dbPath, profile));
|
||
}
|
||
return sessions;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser10(source, seenKeys, hermesHome);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap10, originIdentityByRoot, hermes;
|
||
var init_hermes = __esm({
|
||
"src/providers/hermes.ts"() {
|
||
"use strict";
|
||
init_git_origin();
|
||
init_models();
|
||
init_path_privacy();
|
||
init_sqlite();
|
||
init_hermes_session_ledger();
|
||
toolNameMap10 = {
|
||
terminal: "Bash",
|
||
execute_code: "CodeExecution",
|
||
read_file: "Read",
|
||
search_files: "Grep",
|
||
write_file: "Write",
|
||
patch: "Edit",
|
||
browser_navigate: "Browser",
|
||
browser_click: "Browser",
|
||
browser_type: "Browser",
|
||
browser_press: "Browser",
|
||
browser_scroll: "Browser",
|
||
browser_snapshot: "Browser",
|
||
browser_vision: "Vision",
|
||
browser_console: "Browser",
|
||
browser_get_images: "Browser",
|
||
web_search: "WebSearch",
|
||
web_extract: "WebFetch",
|
||
delegate_task: "Agent",
|
||
vision_analyze: "Vision",
|
||
process: "Bash",
|
||
todo: "TodoWrite",
|
||
skill_view: "Skill",
|
||
skill_manage: "Skill",
|
||
skills_list: "Skill",
|
||
memory: "Memory",
|
||
session_search: "SessionSearch"
|
||
};
|
||
originIdentityByRoot = /* @__PURE__ */ new Map();
|
||
hermes = createHermesProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/ibm-bob.ts
|
||
import { join as join21 } from "path";
|
||
import { homedir as homedir19 } from "os";
|
||
function getIBMBobGlobalStorageDirs() {
|
||
const home = homedir19();
|
||
if (process.platform === "darwin") {
|
||
return [
|
||
join21(home, "Library", "Application Support", "IBM Bob", "User", "globalStorage", EXTENSION_ID2),
|
||
join21(home, "Library", "Application Support", "Bob-IDE", "User", "globalStorage", EXTENSION_ID2)
|
||
];
|
||
}
|
||
if (process.platform === "win32") {
|
||
const appData = process.env["APPDATA"] ?? join21(home, "AppData", "Roaming");
|
||
return [
|
||
join21(appData, "IBM Bob", "User", "globalStorage", EXTENSION_ID2),
|
||
join21(appData, "Bob-IDE", "User", "globalStorage", EXTENSION_ID2)
|
||
];
|
||
}
|
||
const configHome = process.env["XDG_CONFIG_HOME"] ?? join21(home, ".config");
|
||
return [
|
||
join21(configHome, "IBM Bob", "User", "globalStorage", EXTENSION_ID2),
|
||
join21(configHome, "Bob-IDE", "User", "globalStorage", EXTENSION_ID2)
|
||
];
|
||
}
|
||
function createIBMBobProvider(overrideDir) {
|
||
return {
|
||
name: PROVIDER_NAME2,
|
||
displayName: DISPLAY_NAME2,
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return (overrideDir ? [overrideDir] : getIBMBobGlobalStorageDirs()).map((path) => ({ path, label: "storage" }));
|
||
},
|
||
async discoverSessions() {
|
||
const dirs = overrideDir ? [overrideDir] : getIBMBobGlobalStorageDirs();
|
||
return discoverClineTasksInBaseDirs(dirs, PROVIDER_NAME2, DISPLAY_NAME2);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createClineParser(source, seenKeys, PROVIDER_NAME2, FALLBACK_MODEL);
|
||
}
|
||
};
|
||
}
|
||
var PROVIDER_NAME2, DISPLAY_NAME2, EXTENSION_ID2, FALLBACK_MODEL, ibmBob;
|
||
var init_ibm_bob = __esm({
|
||
"src/providers/ibm-bob.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_vscode_cline_parser();
|
||
PROVIDER_NAME2 = "ibm-bob";
|
||
DISPLAY_NAME2 = "IBM Bob";
|
||
EXTENSION_ID2 = "ibm.bob-code";
|
||
FALLBACK_MODEL = "ibm-bob-auto";
|
||
ibmBob = createIBMBobProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/session-message.ts
|
||
function normalizeToolName(rawTool) {
|
||
if (!rawTool) return "";
|
||
if (rawTool.startsWith("mcp__")) return rawTool;
|
||
const builtIn = toolNameMap11[rawTool];
|
||
if (builtIn) return builtIn;
|
||
const serverSeparator = rawTool.indexOf("_");
|
||
if (serverSeparator > 0 && serverSeparator < rawTool.length - 1) {
|
||
const server = rawTool.slice(0, serverSeparator);
|
||
const tool = rawTool.slice(serverSeparator + 1);
|
||
return `mcp__${server}__${tool}`;
|
||
}
|
||
return rawTool;
|
||
}
|
||
function sanitize(dir) {
|
||
return dir.replace(/^\//, "").replace(/\//g, "-");
|
||
}
|
||
function parseTimestamp2(raw) {
|
||
const ms = raw < 1e12 ? raw * 1e3 : raw;
|
||
return new Date(ms).toISOString();
|
||
}
|
||
function buildAssistantCall(opts) {
|
||
const { data, parts } = opts;
|
||
const tokens2 = {
|
||
input: data.tokens?.input ?? data.usage?.input_tokens ?? 0,
|
||
output: data.tokens?.output ?? data.usage?.output_tokens ?? 0,
|
||
reasoning: data.tokens?.reasoning ?? 0,
|
||
cacheRead: data.tokens?.cache?.read ?? data.usage?.cache_read_input_tokens ?? 0,
|
||
cacheWrite: data.tokens?.cache?.write ?? data.usage?.cache_creation_input_tokens ?? 0
|
||
};
|
||
const toolParts = parts.filter((p) => (p.type === "tool" || p.type === "tool-call" || p.type === "tool_call") && normalizeToolName(p.tool));
|
||
const hasTextOutput = parts.some((p) => p.type === "text" && typeof p.text === "string" && p.text.trim().length > 0);
|
||
const hasToolOrTextParts = hasTextOutput || toolParts.length > 0;
|
||
const hasAnySubstantiveParts = parts.some(
|
||
(p) => p.type === "text" || p.type === "tool" || p.type === "tool-call" || p.type === "tool_call" || p.type === "tool-result" || p.type === "tool_result" || p.type === "reasoning" || p.type === "file"
|
||
);
|
||
const hasActivity = hasToolOrTextParts || hasAnySubstantiveParts;
|
||
const allZero = tokens2.input === 0 && tokens2.output === 0 && tokens2.reasoning === 0 && tokens2.cacheRead === 0 && tokens2.cacheWrite === 0;
|
||
if (allZero && (data.cost ?? 0) === 0 && !hasActivity) return null;
|
||
const tools = toolParts.map((p) => normalizeToolName(p.tool)).filter(Boolean);
|
||
const bashCommands = toolParts.filter((p) => p.tool === "bash" && typeof p.state?.input?.command === "string").flatMap((p) => extractBashCommands(p.state.input.command));
|
||
const skills = toolParts.filter((p) => p.tool === "skill" && typeof p.state?.input?.name === "string").map((p) => p.state.input.name).filter(Boolean);
|
||
const subagentTypes = toolParts.filter((p) => p.tool === "task" && typeof p.state?.input?.subagent_type === "string").map((p) => p.state.input.subagent_type).filter(Boolean);
|
||
const model = data.modelID ?? data.model ?? "unknown";
|
||
const route = routeFromProviderField(data.providerID)?.id;
|
||
let costUSD = calculateCost(
|
||
model,
|
||
tokens2.input,
|
||
// Same single source of truth the cache-rehydration path uses, so a fresh
|
||
// parse and a cached read can never disagree about whether this provider's
|
||
// reasoning tokens already sit inside its output count. (#1075, #1334)
|
||
billableOutputTokens(opts.providerName, tokens2.output, tokens2.reasoning),
|
||
tokens2.cacheWrite,
|
||
tokens2.cacheRead,
|
||
0
|
||
);
|
||
const fallbackCostUSD = recordedCostFallback(model, costUSD, data.cost);
|
||
if (fallbackCostUSD) costUSD = fallbackCostUSD;
|
||
return {
|
||
provider: opts.providerName,
|
||
model,
|
||
...route ? { route } : {},
|
||
inputTokens: tokens2.input,
|
||
outputTokens: tokens2.output,
|
||
cacheCreationInputTokens: tokens2.cacheWrite,
|
||
cacheReadInputTokens: tokens2.cacheRead,
|
||
cachedInputTokens: tokens2.cacheRead,
|
||
reasoningTokens: tokens2.reasoning,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
...fallbackCostUSD ? { fallbackCostUSD } : {},
|
||
// A call with output but no usage recorded has unknown tokens, not zero.
|
||
...allZero && costUSD === 0 ? { costIsEstimated: true } : {},
|
||
tools,
|
||
bashCommands,
|
||
skills,
|
||
subagentTypes,
|
||
timestamp: parseTimestamp2(opts.timeCreatedMs),
|
||
speed: "standard",
|
||
deduplicationKey: opts.dedupKey,
|
||
userMessage: opts.userMessage,
|
||
sessionId: opts.sessionId
|
||
};
|
||
}
|
||
var toolNameMap11;
|
||
var init_session_message = __esm({
|
||
"src/providers/session-message.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_bash_utils();
|
||
toolNameMap11 = {
|
||
bash: "Bash",
|
||
read: "Read",
|
||
edit: "Edit",
|
||
write: "Write",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
task: "Agent",
|
||
fetch: "WebFetch",
|
||
search: "WebSearch",
|
||
todo: "TodoWrite",
|
||
skill: "Skill",
|
||
patch: "Patch"
|
||
};
|
||
}
|
||
});
|
||
|
||
// src/providers/sqlite-session-parser.ts
|
||
import { readdir as readdir14 } from "fs/promises";
|
||
import { join as join22 } from "path";
|
||
function detectGeneration(db) {
|
||
try {
|
||
const v2 = db.query(
|
||
"SELECT COUNT(*) as cnt FROM sqlite_master WHERE type = 'table' AND name IN ('session_v2', 'session_message')"
|
||
);
|
||
if ((v2[0]?.cnt ?? 0) === 2) return "v2";
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
}
|
||
return validateSchemaDetailed(db).ok ? "legacy" : null;
|
||
}
|
||
function sessionInV2(db, id) {
|
||
try {
|
||
const rows = db.query("SELECT COUNT(*) as cnt FROM session_v2 WHERE id = ?", [id]);
|
||
return (rows[0]?.cnt ?? 0) > 0;
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return false;
|
||
}
|
||
}
|
||
function v2RowsToLegacyShape(rows) {
|
||
const messages = [];
|
||
const partsByMsg = /* @__PURE__ */ new Map();
|
||
for (const row of rows) {
|
||
let payload;
|
||
try {
|
||
payload = JSON.parse(blobToText(row.data));
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (row.type === "user") {
|
||
messages.push({ session_id: row.session_id, id: row.id, time_created: row.time_created, data: JSON.stringify({ role: "user" }) });
|
||
const text2 = typeof payload["text"] === "string" ? payload["text"] : "";
|
||
if (text2) partsByMsg.set(row.id, [{ type: "text", text: text2 }]);
|
||
continue;
|
||
}
|
||
if (row.type !== "assistant" && row.type !== "compaction") continue;
|
||
const model = payload["model"];
|
||
const data = { role: "assistant" };
|
||
if (model !== null && typeof model === "object" && !Array.isArray(model)) {
|
||
const ref = model;
|
||
const id = typeof ref["id"] === "string" ? ref["id"] : "";
|
||
const providerID = typeof ref["providerID"] === "string" ? ref["providerID"] : "";
|
||
if (providerID) data.providerID = providerID;
|
||
if (id) data.modelID = id;
|
||
}
|
||
if (typeof payload["cost"] === "number") data.cost = payload["cost"];
|
||
const tokens2 = payload["tokens"];
|
||
if (tokens2 !== null && typeof tokens2 === "object" && !Array.isArray(tokens2)) data.tokens = tokens2;
|
||
const parts = [];
|
||
const content2 = payload["content"];
|
||
if (Array.isArray(content2)) {
|
||
for (const item of content2) {
|
||
if (item === null || typeof item !== "object") continue;
|
||
const c = item;
|
||
if ((c["type"] === "text" || c["type"] === "reasoning") && typeof c["text"] === "string" && c["text"]) {
|
||
parts.push({ type: c["type"], text: c["text"] });
|
||
} else if (c["type"] === "tool") {
|
||
const state = c["state"];
|
||
const input = state !== null && typeof state === "object" && state["input"] !== null && typeof state["input"] === "object" ? state["input"] : {};
|
||
parts.push({ type: "tool", tool: typeof c["name"] === "string" ? c["name"] : "", state: { input } });
|
||
}
|
||
}
|
||
}
|
||
messages.push({ session_id: row.session_id, id: row.id, time_created: row.time_created, data: JSON.stringify(data) });
|
||
partsByMsg.set(row.id, parts);
|
||
}
|
||
return { messages, partsByMsg };
|
||
}
|
||
function parseSessionModel(value) {
|
||
try {
|
||
const parsed = JSON.parse(blobToText(value));
|
||
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return void 0;
|
||
const model = parsed;
|
||
const id = typeof model["id"] === "string" ? model["id"].trim() : "";
|
||
const providerID = typeof model["providerID"] === "string" ? model["providerID"] : "";
|
||
const normalizedProviderID = providerID.trim();
|
||
return id && normalizedProviderID ? { model: id, providerID } : void 0;
|
||
} catch {
|
||
return void 0;
|
||
}
|
||
}
|
||
function tryQuerySessionTokens(db, sessionId, generation) {
|
||
try {
|
||
const table = generation === "v2" ? "session_v2" : "session";
|
||
const rows = db.query(
|
||
`SELECT cost, tokens_input, tokens_output, tokens_reasoning, tokens_cache_read, tokens_cache_write,
|
||
CAST(model AS BLOB) AS model
|
||
FROM ${table} WHERE id = ?`,
|
||
[sessionId]
|
||
);
|
||
if (rows.length === 0) return null;
|
||
const r = rows[0];
|
||
const parsedModel = parseSessionModel(r.model);
|
||
return {
|
||
cost: r.cost ?? 0,
|
||
input: r.tokens_input ?? 0,
|
||
output: r.tokens_output ?? 0,
|
||
reasoning: r.tokens_reasoning ?? 0,
|
||
cacheRead: r.tokens_cache_read ?? 0,
|
||
cacheWrite: r.tokens_cache_write ?? 0,
|
||
model: parsedModel?.model,
|
||
providerID: parsedModel?.providerID
|
||
};
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return null;
|
||
}
|
||
}
|
||
function validateSchemaDetailed(db) {
|
||
const required = ["session", "message", "part"];
|
||
const missing = [];
|
||
for (const table of required) {
|
||
try {
|
||
db.query(`SELECT COUNT(*) as cnt FROM ${table} LIMIT 1`);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
missing.push(table);
|
||
}
|
||
}
|
||
return missing.length === 0 ? { ok: true } : { ok: false, missing };
|
||
}
|
||
function warnUnrecognizedSchemaOnce(providerLabel, missing) {
|
||
const providerSet = warnedSchemas.get(providerLabel) ?? /* @__PURE__ */ new Set();
|
||
const key = missing.slice().sort().join(",");
|
||
if (providerSet.has(key)) return;
|
||
providerSet.add(key);
|
||
warnedSchemas.set(providerLabel, providerSet);
|
||
process.stderr.write(
|
||
`codeburn: ${providerLabel} database is missing expected tables (${missing.join(", ")}). Run ${providerLabel} once to apply migrations, or report at https://github.com/getagentseal/codeburn/issues if this persists.
|
||
`
|
||
);
|
||
}
|
||
function createSqliteSessionParser(source, seenKeys, config) {
|
||
return {
|
||
async *parse() {
|
||
if (!isSqliteAvailable()) {
|
||
process.stderr.write(getSqliteLoadError() + "\n");
|
||
return;
|
||
}
|
||
const segments = source.path.split(":");
|
||
const sessionId = segments[segments.length - 1];
|
||
const dbPath = segments.slice(0, -1).join(":");
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
process.stderr.write(`codeburn: cannot open ${config.displayName} database: ${err instanceof Error ? err.message : err}
|
||
`);
|
||
return;
|
||
}
|
||
try {
|
||
const generation = detectGeneration(db);
|
||
if (generation === null) {
|
||
const schema = validateSchemaDetailed(db);
|
||
if (!schema.ok) warnUnrecognizedSchemaOnce(config.displayName, schema.missing);
|
||
return;
|
||
}
|
||
const legacyOk = generation === "legacy" || validateSchemaDetailed(db).ok;
|
||
const gen = generation === "v2" && !sessionInV2(db, sessionId) && legacyOk ? "legacy" : generation;
|
||
let messages = [];
|
||
const partsByMsg = /* @__PURE__ */ new Map();
|
||
if (legacyOk) {
|
||
messages = db.query(
|
||
`WITH RECURSIVE session_tree(id) AS (
|
||
SELECT id FROM session WHERE id = ?
|
||
UNION
|
||
SELECT child.id
|
||
FROM session child
|
||
JOIN session_tree parent ON child.parent_id = parent.id
|
||
)
|
||
SELECT session_id, id, time_created, CAST(data AS BLOB) AS data
|
||
FROM message
|
||
WHERE session_id IN (SELECT id FROM session_tree)
|
||
ORDER BY time_created ASC, id ASC`,
|
||
[sessionId]
|
||
);
|
||
const parts = db.query(
|
||
`WITH RECURSIVE session_tree(id) AS (
|
||
SELECT id FROM session WHERE id = ?
|
||
UNION
|
||
SELECT child.id
|
||
FROM session child
|
||
JOIN session_tree parent ON child.parent_id = parent.id
|
||
)
|
||
SELECT message_id, CAST(data AS BLOB) AS data
|
||
FROM part
|
||
WHERE session_id IN (SELECT id FROM session_tree)
|
||
ORDER BY message_id, id`,
|
||
[sessionId]
|
||
);
|
||
for (const part of parts) {
|
||
try {
|
||
const parsed = JSON.parse(blobToText(part.data));
|
||
const list = partsByMsg.get(part.message_id) ?? [];
|
||
list.push(parsed);
|
||
partsByMsg.set(part.message_id, list);
|
||
} catch {
|
||
}
|
||
}
|
||
}
|
||
if (gen === "v2") {
|
||
const rows = db.query(
|
||
`WITH RECURSIVE session_tree(id) AS (
|
||
SELECT id FROM session_v2 WHERE id = ?
|
||
UNION
|
||
SELECT child.id
|
||
FROM session_v2 child
|
||
JOIN session_tree parent ON child.parent_id = parent.id
|
||
)
|
||
SELECT session_id, id, type, seq, time_created, CAST(data AS BLOB) AS data
|
||
FROM session_message
|
||
WHERE session_id IN (SELECT id FROM session_tree)
|
||
ORDER BY time_created ASC, session_id ASC, seq ASC`,
|
||
[sessionId]
|
||
);
|
||
const normalized = v2RowsToLegacyShape(rows);
|
||
messages.push(...normalized.messages);
|
||
for (const [id, parts] of normalized.partsByMsg) {
|
||
if (!partsByMsg.has(id)) partsByMsg.set(id, parts);
|
||
}
|
||
}
|
||
const currentUserMessageBySession = /* @__PURE__ */ new Map();
|
||
let yieldCount = 0;
|
||
let parseFailCount = 0;
|
||
let roleSkipCount = 0;
|
||
for (const msg of messages) {
|
||
let data;
|
||
try {
|
||
data = JSON.parse(blobToText(msg.data));
|
||
} catch {
|
||
parseFailCount++;
|
||
continue;
|
||
}
|
||
if (data.role === "user") {
|
||
const textParts = (partsByMsg.get(msg.id) ?? []).filter((p) => p.type === "text").map((p) => p.text ?? "").filter(Boolean);
|
||
if (textParts.length > 0) {
|
||
currentUserMessageBySession.set(msg.session_id, textParts.join(" "));
|
||
}
|
||
continue;
|
||
}
|
||
if (data.role !== "assistant" && data.role !== "model") {
|
||
if (data.role !== "user") roleSkipCount++;
|
||
continue;
|
||
}
|
||
const dedupKey = `${config.providerName}:${msg.session_id}:${msg.id}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
const call = buildAssistantCall({
|
||
providerName: config.providerName,
|
||
dedupKey,
|
||
sessionId,
|
||
data,
|
||
parts: partsByMsg.get(msg.id) ?? [],
|
||
timeCreatedMs: msg.time_created,
|
||
userMessage: currentUserMessageBySession.get(msg.session_id) ?? ""
|
||
});
|
||
if (!call) continue;
|
||
seenKeys.add(dedupKey);
|
||
yieldCount++;
|
||
yield call;
|
||
}
|
||
if (yieldCount === 0 && messages.length > 0) {
|
||
const sessionTokens = tryQuerySessionTokens(db, sessionId, gen);
|
||
if (sessionTokens && (sessionTokens.cost > 0 || sessionTokens.input > 0 || sessionTokens.output > 0)) {
|
||
const dedupKey = `${config.providerName}:${sessionId}:session-level`;
|
||
if (!seenKeys.has(dedupKey)) {
|
||
seenKeys.add(dedupKey);
|
||
const model = sessionTokens.model ?? "unknown";
|
||
const route = routeFromProviderField(sessionTokens.providerID)?.id;
|
||
const outputForCost = billableOutputTokens(config.providerName, sessionTokens.output, sessionTokens.reasoning);
|
||
let costUSD = calculateCost(model, sessionTokens.input, outputForCost, sessionTokens.cacheWrite, sessionTokens.cacheRead, 0);
|
||
const fallbackCostUSD = recordedCostFallback(model, costUSD, sessionTokens.cost);
|
||
if (fallbackCostUSD) costUSD = fallbackCostUSD;
|
||
yield {
|
||
provider: config.providerName,
|
||
model,
|
||
...route ? { route } : {},
|
||
inputTokens: sessionTokens.input,
|
||
outputTokens: sessionTokens.output,
|
||
cacheCreationInputTokens: sessionTokens.cacheWrite,
|
||
cacheReadInputTokens: sessionTokens.cacheRead,
|
||
cachedInputTokens: sessionTokens.cacheRead,
|
||
reasoningTokens: sessionTokens.reasoning,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
...fallbackCostUSD ? { fallbackCostUSD } : {},
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: parseTimestamp2(messages[0].time_created),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
sessionId
|
||
};
|
||
yieldCount++;
|
||
}
|
||
}
|
||
if (yieldCount === 0 && process.env["CODEBURN_VERBOSE"] === "1") {
|
||
process.stderr.write(
|
||
`codeburn: ${config.displayName} session ${sessionId} has ${messages.length} messages (${parseFailCount} unparseable, ${roleSkipCount} non-user/assistant roles) but yielded 0 calls.
|
||
`
|
||
);
|
||
}
|
||
}
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function discoverSqliteSessions(config) {
|
||
if (!isSqliteAvailable()) return [];
|
||
let dbPaths;
|
||
try {
|
||
const entries = await readdir14(config.dbDir);
|
||
dbPaths = entries.filter((f) => f.startsWith(config.dbFilePrefix) && f.endsWith(".db")).map((f) => join22(config.dbDir, f));
|
||
} catch {
|
||
return [];
|
||
}
|
||
if (dbPaths.length === 0) return [];
|
||
const sessions = [];
|
||
for (const dbPath of dbPaths) {
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
if (isSqliteReadonlyError(err)) warnSqliteReadonlyOnce(dbPath);
|
||
continue;
|
||
}
|
||
try {
|
||
const generation = detectGeneration(db);
|
||
if (generation === null) {
|
||
const schema = validateSchemaDetailed(db);
|
||
if (!schema.ok) warnUnrecognizedSchemaOnce(config.displayName, schema.missing);
|
||
continue;
|
||
}
|
||
const table = generation === "v2" ? "session_v2" : "session";
|
||
const rows = db.query(
|
||
`SELECT id, CAST(directory AS BLOB) AS directory, CAST(title AS BLOB) AS title, time_created
|
||
FROM ${table} WHERE parent_id IS NULL ORDER BY time_created DESC`
|
||
);
|
||
if (generation === "v2" && validateSchemaDetailed(db).ok) {
|
||
rows.push(...db.query(
|
||
`SELECT id, CAST(directory AS BLOB) AS directory, CAST(title AS BLOB) AS title, time_created
|
||
FROM session
|
||
WHERE parent_id IS NULL AND id NOT IN (SELECT id FROM session_v2)
|
||
ORDER BY time_created DESC`
|
||
));
|
||
}
|
||
for (const row of rows) {
|
||
const dir = blobToText(row.directory);
|
||
const title = blobToText(row.title);
|
||
sessions.push({
|
||
path: `${dbPath}:${row.id}`,
|
||
project: dir ? sanitize(dir) : sanitize(title),
|
||
provider: config.providerName
|
||
});
|
||
}
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
return sessions;
|
||
}
|
||
var warnedSchemas;
|
||
var init_sqlite_session_parser = __esm({
|
||
"src/providers/sqlite-session-parser.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_sqlite();
|
||
init_session_message();
|
||
warnedSchemas = /* @__PURE__ */ new Map();
|
||
}
|
||
});
|
||
|
||
// src/providers/kilo-code.ts
|
||
import { join as join23 } from "path";
|
||
import { homedir as homedir20 } from "os";
|
||
function getSqliteConfig() {
|
||
const base = process.env["XDG_DATA_HOME"] ?? join23(homedir20(), ".local", "share");
|
||
return {
|
||
providerName: PROVIDER_NAME3,
|
||
displayName: "KiloCode",
|
||
dbDir: join23(base, "kilo"),
|
||
dbFilePrefix: "kilo"
|
||
};
|
||
}
|
||
function createKiloCodeProvider(overrideDir) {
|
||
const sqliteConfig = getSqliteConfig();
|
||
return {
|
||
name: PROVIDER_NAME3,
|
||
displayName: "KiloCode",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [
|
||
...clineTaskRoots(EXTENSION_ID3, overrideDir).map((path) => ({ path, label: "tasks" })),
|
||
{ path: sqliteConfig.dbDir, label: "sqlite" }
|
||
];
|
||
},
|
||
async discoverSessions() {
|
||
const [oldSessions, dbSessions] = await Promise.all([
|
||
discoverClineTasks(EXTENSION_ID3, PROVIDER_NAME3, "KiloCode", overrideDir),
|
||
discoverSqliteSessions(sqliteConfig)
|
||
]);
|
||
return [...oldSessions, ...dbSessions];
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
if (source.path.includes(".db:")) {
|
||
return createSqliteSessionParser(source, seenKeys, sqliteConfig);
|
||
}
|
||
return createClineParser(source, seenKeys, PROVIDER_NAME3);
|
||
}
|
||
};
|
||
}
|
||
var EXTENSION_ID3, PROVIDER_NAME3, kiloCode;
|
||
var init_kilo_code = __esm({
|
||
"src/providers/kilo-code.ts"() {
|
||
"use strict";
|
||
init_vscode_cline_parser();
|
||
init_sqlite_session_parser();
|
||
EXTENSION_ID3 = "kilocode.kilo-code";
|
||
PROVIDER_NAME3 = "kilo-code";
|
||
kiloCode = createKiloCodeProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/kiro.ts
|
||
import { existsSync as existsSync8 } from "fs";
|
||
import { readdir as readdir15, readFile as readFile8, stat as stat16 } from "fs/promises";
|
||
import { basename as basename14, dirname as dirname6, extname, join as join24 } from "path";
|
||
import { homedir as homedir21 } from "os";
|
||
function normalizeModelId(raw) {
|
||
return raw.replace(/(\d+)\.(\d+)/g, "$1-$2");
|
||
}
|
||
function extractToolNames(content2) {
|
||
const tools = [];
|
||
const regex = /<tool_use>\s*<name>([^<]+)<\/name>/g;
|
||
let match;
|
||
while ((match = regex.exec(content2)) !== null) {
|
||
const name = match[1].trim();
|
||
tools.push(toolNameMap12[name] ?? flatString(name));
|
||
}
|
||
return tools;
|
||
}
|
||
function asRecord(value) {
|
||
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
||
}
|
||
function stringField(record, names) {
|
||
if (!record) return "";
|
||
for (const name of names) {
|
||
const value = record[name];
|
||
if (typeof value === "string" && value.trim()) return value.trim();
|
||
}
|
||
return "";
|
||
}
|
||
function timeField(record, names) {
|
||
if (!record) return void 0;
|
||
for (const name of names) {
|
||
const value = record[name];
|
||
if (typeof value === "number" || typeof value === "string") return value;
|
||
}
|
||
return void 0;
|
||
}
|
||
function parseKiroTimestamp(value) {
|
||
if (value === void 0) return null;
|
||
let parsed = value;
|
||
if (typeof value === "string") {
|
||
const trimmed = value.trim();
|
||
if (!trimmed) return null;
|
||
parsed = /^-?\d+(\.\d+)?$/.test(trimmed) ? Number(trimmed) : trimmed;
|
||
}
|
||
if (typeof parsed === "number") {
|
||
if (!Number.isFinite(parsed)) return null;
|
||
const ms = parsed < MIN_REASONABLE_TIMESTAMP_MS3 ? parsed * 1e3 : parsed;
|
||
const date2 = new Date(ms);
|
||
return Number.isNaN(date2.getTime()) || date2.getTime() < MIN_REASONABLE_TIMESTAMP_MS3 ? null : date2;
|
||
}
|
||
const date = new Date(parsed);
|
||
return Number.isNaN(date.getTime()) || date.getTime() < MIN_REASONABLE_TIMESTAMP_MS3 ? null : date;
|
||
}
|
||
function textField(record, names) {
|
||
if (!record) return "";
|
||
for (const name of names) {
|
||
const text2 = extractText(record[name]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function extractText(value) {
|
||
if (typeof value === "string") return value;
|
||
if (Array.isArray(value)) return value.map(extractText).filter(Boolean).join("\n");
|
||
const record = asRecord(value);
|
||
if (!record) return "";
|
||
for (const key of ["content", "text", "message", "value", "parts", "entries"]) {
|
||
const text2 = extractText(record[key]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function messageRole(value) {
|
||
const record = asRecord(value);
|
||
if (!record) return "";
|
||
return stringField(record, ["role", "type", "author"]).toLowerCase();
|
||
}
|
||
function extractStructuredToolNames(value, text2, options = {}) {
|
||
const tools = extractToolNames(text2);
|
||
const record = asRecord(value);
|
||
if (!record) return tools;
|
||
if (options.includeDirectName ?? true) {
|
||
const directName = stringField(record, ["toolName", "name"]);
|
||
if (directName) tools.push(toolNameMap12[directName] ?? directName);
|
||
}
|
||
for (const key of ["toolCalls", "tool_calls", "tools"]) {
|
||
const entries = record[key];
|
||
if (!Array.isArray(entries)) continue;
|
||
for (const entry of entries) {
|
||
const name = stringField(asRecord(entry), ["name", "toolName", "tool_name"]);
|
||
if (name) tools.push(toolNameMap12[name] ?? name);
|
||
}
|
||
}
|
||
return tools;
|
||
}
|
||
function parseChatFile(data, sessionId, project, seenKeys) {
|
||
const results = [];
|
||
const { chat, metadata } = data;
|
||
let modelId = normalizeModelId(metadata.modelId ?? "");
|
||
if (modelId === "auto" || !modelId) modelId = "kiro-auto";
|
||
let pendingUserMessage = "";
|
||
let inputChars = 0;
|
||
const allTools = [];
|
||
const toolSequence = [];
|
||
for (const msg of chat) {
|
||
if (msg.role === "human") {
|
||
if (msg.content.startsWith("<identity>")) continue;
|
||
inputChars += msg.content.length;
|
||
pendingUserMessage = flatSlice(msg.content, 500);
|
||
}
|
||
if (msg.role === "bot") {
|
||
const msgTools = extractToolNames(msg.content);
|
||
allTools.push(...msgTools);
|
||
if (msgTools.length > 0) toolSequence.push(msgTools.map((t) => ({ tool: t })));
|
||
}
|
||
}
|
||
const botMessages = chat.filter((m) => m.role === "bot" && m.content.length > 0);
|
||
const totalOutputChars = botMessages.reduce((sum, m) => sum + m.content.length, 0);
|
||
if (totalOutputChars === 0) return results;
|
||
const dedupKey = `kiro:${sessionId}:${data.executionId}`;
|
||
if (seenKeys.has(dedupKey)) return results;
|
||
const outputTokens = estimateTokensFromChars(totalOutputChars);
|
||
const inputTokens = estimateTokensFromChars(inputChars);
|
||
const costUSD = calculateCost(modelId, inputTokens, outputTokens, 0, 0, 0);
|
||
const tsDate = parseKiroTimestamp(metadata.startTime);
|
||
if (!tsDate) return results;
|
||
const timestamp2 = tsDate.toISOString();
|
||
seenKeys.add(dedupKey);
|
||
results.push({
|
||
provider: "kiro",
|
||
model: modelId,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: true,
|
||
tools: [...new Set(allTools)],
|
||
bashCommands: [],
|
||
toolSequence: toolSequence.length > 1 ? toolSequence : void 0,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId
|
||
});
|
||
return results;
|
||
}
|
||
function parseModernExecution(data, sourcePath, seenKeys) {
|
||
const results = [];
|
||
if (Array.isArray(data["executions"])) return results;
|
||
const metadata = asRecord(data["metadata"]);
|
||
const modelObj = asRecord(data["model"]);
|
||
let modelId = normalizeModelId(
|
||
stringField(data, ["modelId", "modelID", "modelName", "model"]) || stringField(modelObj, ["id", "name"]) || stringField(metadata, ["modelId", "modelID", "modelName"])
|
||
);
|
||
if (modelId === "auto" || !modelId) modelId = "kiro-auto";
|
||
const executionId = stringField(data, ["executionId", "id"]) || basename14(sourcePath);
|
||
const sessionId = stringField(data, ["sessionId", "chatSessionId", "conversationId", "workflowId"]) || stringField(metadata, ["workflowId", "sessionId"]) || basename14(dirname6(sourcePath)) || executionId;
|
||
let inputChars = 0;
|
||
let outputChars = 0;
|
||
let pendingUserMessage = "";
|
||
const allTools = [];
|
||
let hasOutputActivity = false;
|
||
const directInput = textField(data, ["prompt", "input", "userMessage", "user_message", "request"]);
|
||
const directOutput = textField(data, ["response", "output", "assistantMessage", "assistant_message", "result"]);
|
||
const directTools = extractStructuredToolNames(data, directOutput, { includeDirectName: false });
|
||
if (directInput) {
|
||
inputChars += directInput.length;
|
||
pendingUserMessage = flatSlice(directInput, 500);
|
||
}
|
||
if (directOutput) {
|
||
outputChars += directOutput.length;
|
||
hasOutputActivity = true;
|
||
}
|
||
if (directTools.length > 0) {
|
||
hasOutputActivity = true;
|
||
allTools.push(...directTools);
|
||
}
|
||
const context = asRecord(data["context"]);
|
||
const conversationSources = context ? [context, data] : [data];
|
||
for (const source of conversationSources) {
|
||
let found = false;
|
||
for (const key of MODERN_CONVERSATION_KEYS) {
|
||
const messages = source[key];
|
||
if (!Array.isArray(messages)) continue;
|
||
for (const message of messages) {
|
||
const text2 = extractText(message);
|
||
const role = messageRole(message);
|
||
const tools = extractStructuredToolNames(message, text2);
|
||
if (role === "human" || role === "user") {
|
||
if (!text2) continue;
|
||
inputChars += text2.length;
|
||
pendingUserMessage = flatSlice(text2, 500);
|
||
} else if (role === "bot" || role === "assistant" || role === "ai" || role === "model") {
|
||
if (text2) outputChars += text2.length;
|
||
if (text2 || tools.length > 0) hasOutputActivity = true;
|
||
allTools.push(...tools);
|
||
} else if (role === "tool" || role === "system") {
|
||
if (text2) inputChars += text2.length;
|
||
allTools.push(...tools);
|
||
}
|
||
}
|
||
found = true;
|
||
break;
|
||
}
|
||
if (found) break;
|
||
}
|
||
let executionCredits = 0;
|
||
const usageSummary = data["usageSummary"];
|
||
if (Array.isArray(usageSummary)) {
|
||
for (const entry of usageSummary) {
|
||
const rec = asRecord(entry);
|
||
if (!rec) continue;
|
||
const usage = rec["usage"];
|
||
if (typeof usage === "number" && Number.isFinite(usage)) executionCredits += usage;
|
||
const usedTools = rec["usedTools"];
|
||
if (Array.isArray(usedTools)) {
|
||
for (const tool of usedTools) {
|
||
if (typeof tool === "string" && tool) {
|
||
const cleaned = tool.startsWith("mcp_") ? tool.slice(4) : tool;
|
||
allTools.push(toolNameMap12[cleaned] ?? cleaned);
|
||
hasOutputActivity = true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if (!hasOutputActivity) return results;
|
||
const dedupKey = `kiro:${sessionId}:${executionId}`;
|
||
if (seenKeys.has(dedupKey)) return results;
|
||
const rawStartTime = timeField(data, ["startTime", "createdAt", "timestamp"]) ?? timeField(metadata, ["startTime", "createdAt", "timestamp"]);
|
||
const tsDate = parseKiroTimestamp(rawStartTime);
|
||
if (!tsDate) return results;
|
||
const inputTokens = estimateTokensFromChars(inputChars);
|
||
const outputTokens = estimateTokensFromChars(outputChars);
|
||
const costUSD = executionCredits > 0 ? executionCredits * USD_PER_KIRO_CREDIT : calculateCost(modelId, inputTokens, outputTokens, 0, 0, 0);
|
||
seenKeys.add(dedupKey);
|
||
results.push({
|
||
provider: "kiro",
|
||
model: modelId,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: executionCredits === 0,
|
||
tools: [...new Set(allTools)],
|
||
bashCommands: [],
|
||
timestamp: tsDate.toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId
|
||
});
|
||
return results;
|
||
}
|
||
function parseCliSession(meta, entries, seenKeys) {
|
||
const results = [];
|
||
const sessionId = meta.session_id;
|
||
const project = basename14(meta.cwd || "");
|
||
let modelId = meta.session_state?.rts_model_state?.model_info?.model_id ?? "auto";
|
||
if (modelId === "auto" || !modelId) modelId = "kiro-auto";
|
||
else modelId = normalizeModelId(modelId);
|
||
const turns = meta.session_state?.conversation_metadata?.user_turn_metadatas ?? [];
|
||
let turnIndex = 0;
|
||
let pendingUserMessage = "";
|
||
let outputChars = 0;
|
||
let inputChars = 0;
|
||
const allTools = [];
|
||
let turnStartTimestamp;
|
||
function flushTurn() {
|
||
if (outputChars === 0) return;
|
||
const turnMeta = turns[turnIndex];
|
||
const dedupKey = `kiro-cli:${sessionId}:${turnIndex}`;
|
||
if (seenKeys.has(dedupKey)) {
|
||
turnIndex++;
|
||
return;
|
||
}
|
||
const timestamp2 = turnMeta?.end_timestamp ?? turnStartTimestamp ?? meta.created_at;
|
||
const tsDate = parseKiroTimestamp(timestamp2);
|
||
if (!tsDate) {
|
||
turnIndex++;
|
||
return;
|
||
}
|
||
const inputTokens = estimateTokensFromChars(inputChars);
|
||
const outputTokens = estimateTokensFromChars(outputChars);
|
||
const turnCredits = turnMeta?.metering_usage ? turnMeta.metering_usage.reduce((sum, m) => sum + m.value, 0) : 0;
|
||
const costUSD = turnCredits > 0 ? turnCredits * USD_PER_KIRO_CREDIT : calculateCost(modelId, inputTokens, outputTokens, 0, 0, 0);
|
||
seenKeys.add(dedupKey);
|
||
results.push({
|
||
provider: "kiro",
|
||
model: modelId,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: turnCredits === 0,
|
||
tools: [...new Set(allTools)],
|
||
bashCommands: [],
|
||
timestamp: tsDate.toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId,
|
||
project,
|
||
// workingDirectory is what sync attribution reads; see PROVIDER_PARSE_VERSIONS.kiro.
|
||
...meta.cwd ? { projectPath: meta.cwd, workingDirectory: meta.cwd } : {}
|
||
});
|
||
turnIndex++;
|
||
}
|
||
let isFirstPrompt = true;
|
||
for (const entry of entries) {
|
||
if (entry.kind === "Prompt") {
|
||
if (!isFirstPrompt) {
|
||
flushTurn();
|
||
pendingUserMessage = "";
|
||
outputChars = 0;
|
||
inputChars = 0;
|
||
allTools.length = 0;
|
||
}
|
||
isFirstPrompt = false;
|
||
const content2 = entry.data["content"];
|
||
if (Array.isArray(content2)) {
|
||
for (const item of content2) {
|
||
const rec = asRecord(item);
|
||
if (rec && rec["kind"] === "text" && typeof rec["data"] === "string") {
|
||
pendingUserMessage = flatSlice(rec["data"], 500);
|
||
inputChars += rec["data"].length;
|
||
}
|
||
}
|
||
}
|
||
const meta2 = asRecord(entry.data["meta"]);
|
||
if (meta2) {
|
||
const ts = meta2["timestamp"];
|
||
if (typeof ts === "number") turnStartTimestamp = new Date(ts * 1e3).toISOString();
|
||
}
|
||
} else if (entry.kind === "AssistantMessage") {
|
||
const content2 = entry.data["content"];
|
||
if (Array.isArray(content2)) {
|
||
for (const item of content2) {
|
||
const rec = asRecord(item);
|
||
if (!rec) continue;
|
||
if (rec["kind"] === "text" && typeof rec["data"] === "string") {
|
||
outputChars += rec["data"].length;
|
||
} else if (rec["kind"] === "toolUse") {
|
||
const toolData = asRecord(rec["data"]);
|
||
if (toolData) {
|
||
const name = typeof toolData["name"] === "string" ? toolData["name"] : "";
|
||
if (name) allTools.push(toolNameMap12[name] ?? name);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} else if (entry.kind === "ToolResults") {
|
||
const content2 = entry.data["content"];
|
||
if (Array.isArray(content2)) {
|
||
for (const item of content2) {
|
||
const text2 = extractText(item);
|
||
if (text2) inputChars += text2.length;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
flushTurn();
|
||
return results;
|
||
}
|
||
async function parseWorkspaceSession(record, source, seenKeys) {
|
||
const results = [];
|
||
const historyArr = record["history"];
|
||
if (!Array.isArray(historyArr) || typeof record["sessionId"] !== "string") return results;
|
||
const sessionId = record["sessionId"];
|
||
const modelRaw = stringField(record, ["selectedModel"]);
|
||
let modelId = normalizeModelId(modelRaw);
|
||
if (modelId === "auto" || !modelId) modelId = "kiro-auto";
|
||
let inputChars = 0;
|
||
let outputChars = 0;
|
||
let pendingUserMessage = "";
|
||
const allTools = [];
|
||
let hasExecutionRefs = false;
|
||
let hasRealAssistantContent = false;
|
||
for (const item of historyArr) {
|
||
const rec = asRecord(item);
|
||
if (!rec) continue;
|
||
const execBacked = typeof rec["executionId"] === "string";
|
||
if (execBacked) hasExecutionRefs = true;
|
||
const msg = asRecord(rec["message"]);
|
||
if (!msg) continue;
|
||
const role = stringField(msg, ["role"]);
|
||
const text2 = extractText(msg["content"]);
|
||
if (role === "user" && text2) {
|
||
inputChars += text2.length;
|
||
pendingUserMessage = flatSlice(text2, 500);
|
||
} else if (role === "assistant" && !execBacked && text2 && text2 !== "On it.") {
|
||
outputChars += text2.length;
|
||
hasRealAssistantContent = true;
|
||
}
|
||
}
|
||
if (hasExecutionRefs && !hasRealAssistantContent) return results;
|
||
if (inputChars === 0 && outputChars === 0) return results;
|
||
let timestamp2;
|
||
try {
|
||
const s = await stat16(source.path);
|
||
timestamp2 = new Date(s.mtimeMs).toISOString();
|
||
} catch {
|
||
return results;
|
||
}
|
||
const dedupKey = `kiro:ws-session:${sessionId}`;
|
||
if (seenKeys.has(dedupKey)) return results;
|
||
seenKeys.add(dedupKey);
|
||
const inputTokens = estimateTokensFromChars(inputChars);
|
||
const outputTokens = estimateTokensFromChars(outputChars);
|
||
const costUSD = calculateCost(modelId, inputTokens, outputTokens, 0, 0, 0);
|
||
results.push({
|
||
provider: "kiro",
|
||
model: modelId,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: true,
|
||
tools: [...new Set(allTools)],
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId,
|
||
...typeof record["workspaceDirectory"] === "string" && record["workspaceDirectory"] ? {
|
||
projectPath: record["workspaceDirectory"],
|
||
workingDirectory: record["workspaceDirectory"]
|
||
} : {}
|
||
});
|
||
return results;
|
||
}
|
||
async function parseV2Session(source, seenKeys) {
|
||
const results = [];
|
||
const content2 = await readSessionFile(source.path);
|
||
if (content2 === null) return results;
|
||
let meta = {};
|
||
try {
|
||
const raw = await readFile8(join24(dirname6(source.path), "session.json"), "utf-8");
|
||
meta = JSON.parse(raw);
|
||
} catch {
|
||
}
|
||
const sessionId = typeof meta.id === "string" && meta.id || basename14(dirname6(source.path));
|
||
let modelId = normalizeModelId(meta.modelId ?? "");
|
||
if (modelId === "auto" || !modelId) modelId = "kiro-auto";
|
||
let pendingUserMessage = "";
|
||
let pendingUserChars = 0;
|
||
let inTurn = false;
|
||
let execId = "";
|
||
let turnStartTs;
|
||
let outputChars = 0;
|
||
let reasoningChars = 0;
|
||
let toolResultChars = 0;
|
||
let turnCredits = 0;
|
||
let turnUserMessage = "";
|
||
let turnUserChars = 0;
|
||
const tools = [];
|
||
const resetTurn = () => {
|
||
inTurn = false;
|
||
execId = "";
|
||
turnStartTs = void 0;
|
||
outputChars = 0;
|
||
reasoningChars = 0;
|
||
toolResultChars = 0;
|
||
turnCredits = 0;
|
||
turnUserMessage = "";
|
||
turnUserChars = 0;
|
||
tools.length = 0;
|
||
};
|
||
const pushTool = (raw) => {
|
||
if (!raw) return;
|
||
const cleaned = raw.startsWith("mcp_") ? raw.slice(4) : raw;
|
||
tools.push(toolNameMap12[cleaned] ?? cleaned);
|
||
};
|
||
const flushTurn = () => {
|
||
if (!inTurn) {
|
||
resetTurn();
|
||
return;
|
||
}
|
||
const hasActivity = outputChars > 0 || reasoningChars > 0 || tools.length > 0;
|
||
if (hasActivity) {
|
||
const dedupKey = `kiro-v2:${sessionId}:${execId || String(results.length)}`;
|
||
const tsDate = parseKiroTimestamp(turnStartTs);
|
||
if (tsDate && !seenKeys.has(dedupKey)) {
|
||
seenKeys.add(dedupKey);
|
||
const inputTokens = estimateTokensFromChars(turnUserChars + toolResultChars);
|
||
const reasoningTokens = estimateTokensFromChars(reasoningChars);
|
||
const outputTokens = estimateTokensFromChars(outputChars);
|
||
const costUSD = turnCredits > 0 ? turnCredits * USD_PER_KIRO_CREDIT : calculateCost(modelId, inputTokens, outputTokens + reasoningTokens, 0, 0, 0);
|
||
results.push({
|
||
provider: "kiro",
|
||
model: modelId,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
costIsEstimated: turnCredits === 0,
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [],
|
||
timestamp: tsDate.toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: turnUserMessage,
|
||
sessionId,
|
||
project: source.project,
|
||
...meta.workspacePaths?.[0] ? { projectPath: meta.workspacePaths[0], workingDirectory: meta.workspacePaths[0] } : {}
|
||
});
|
||
}
|
||
}
|
||
resetTurn();
|
||
};
|
||
for (const line of content2.split("\n")) {
|
||
if (!line.trim()) continue;
|
||
let evt;
|
||
try {
|
||
evt = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
const payload = asRecord(evt["payload"]);
|
||
if (!payload) continue;
|
||
const type = stringField(payload, ["type"]);
|
||
const ts = typeof evt["timestamp"] === "string" ? evt["timestamp"] : void 0;
|
||
if (type === "user") {
|
||
if (inTurn) flushTurn();
|
||
const text2 = typeof payload["content"] === "string" ? payload["content"] : extractText(payload["content"]);
|
||
pendingUserMessage = flatSlice(text2, 500);
|
||
pendingUserChars = text2.length;
|
||
} else if (type === "turn_start") {
|
||
if (inTurn) flushTurn();
|
||
inTurn = true;
|
||
execId = stringField(payload, ["executionId"]);
|
||
turnStartTs = ts;
|
||
turnUserMessage = pendingUserMessage;
|
||
turnUserChars = pendingUserChars;
|
||
pendingUserMessage = "";
|
||
pendingUserChars = 0;
|
||
} else if (type === "assistant") {
|
||
const text2 = typeof payload["content"] === "string" ? payload["content"] : extractText(payload["content"]);
|
||
if (stringField(payload, ["operationType"]) === "Reasoning") reasoningChars += text2.length;
|
||
else outputChars += text2.length;
|
||
if (!inTurn && text2.length > 0) inTurn = true;
|
||
if (!turnStartTs && ts) turnStartTs = ts;
|
||
} else if (type === "tool_call") {
|
||
pushTool(stringField(payload, ["toolName", "name"]));
|
||
} else if (type === "tool_result") {
|
||
const text2 = typeof payload["content"] === "string" ? payload["content"] : extractText(payload["content"]);
|
||
toolResultChars += text2.length;
|
||
} else if (type === "usage_summary") {
|
||
const summaries = payload["promptTurnSummaries"];
|
||
if (Array.isArray(summaries)) {
|
||
for (const s of summaries) {
|
||
const rec = asRecord(s);
|
||
const used = rec?.["usedTools"];
|
||
if (Array.isArray(used)) {
|
||
for (const u of used) if (typeof u === "string") pushTool(u);
|
||
}
|
||
const usage = rec?.["usage"];
|
||
if (typeof usage === "number" && Number.isFinite(usage)) turnCredits += usage;
|
||
}
|
||
}
|
||
} else if (type === "turn_end") {
|
||
flushTurn();
|
||
}
|
||
}
|
||
flushTurn();
|
||
return results;
|
||
}
|
||
function createParser11(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
if (/[/\\]sess_[^/\\]+[/\\]messages\.jsonl$/.test(source.path)) {
|
||
for (const call of await parseV2Session(source, seenKeys)) yield call;
|
||
return;
|
||
}
|
||
if (source.path.endsWith(".jsonl")) {
|
||
const jsonlContent = await readSessionFile(source.path);
|
||
if (jsonlContent === null) return;
|
||
const entries = [];
|
||
for (const line of jsonlContent.split("\n")) {
|
||
if (!line.trim()) continue;
|
||
try {
|
||
entries.push(JSON.parse(line));
|
||
} catch {
|
||
}
|
||
}
|
||
if (entries.length === 0) return;
|
||
const metaPath = source.path.replace(/\.jsonl$/, ".json");
|
||
let meta;
|
||
try {
|
||
const raw = await readFile8(metaPath, "utf-8");
|
||
meta = JSON.parse(raw);
|
||
} catch {
|
||
meta = { session_id: basename14(source.path, ".jsonl"), cwd: "", created_at: "", updated_at: "" };
|
||
}
|
||
for (const call of parseCliSession(meta, entries, seenKeys)) {
|
||
yield call;
|
||
}
|
||
return;
|
||
}
|
||
const content2 = await readSessionFile(source.path);
|
||
if (content2 === null) return;
|
||
let data;
|
||
try {
|
||
data = JSON.parse(content2);
|
||
} catch {
|
||
return;
|
||
}
|
||
const record = asRecord(data);
|
||
if (!record) return;
|
||
if (Array.isArray(record["history"]) && typeof record["sessionId"] === "string") {
|
||
for (const call of await parseWorkspaceSession(record, source, seenKeys)) yield call;
|
||
return;
|
||
}
|
||
const metadata = asRecord(record["metadata"]);
|
||
const calls = Array.isArray(record["chat"]) && metadata ? parseChatFile(record, stringField(metadata, ["workflowId"]) || basename14(source.path, ".chat"), source.project, seenKeys) : parseModernExecution(record, source.path, seenKeys);
|
||
for (const call of calls) {
|
||
yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function getKiroAgentDirCandidates(override) {
|
||
if (override) return [override];
|
||
if (process.platform === "darwin") {
|
||
return [join24(homedir21(), "Library", "Application Support", "Kiro", "User", "globalStorage", "kiro.kiroagent")];
|
||
}
|
||
if (process.platform === "win32") {
|
||
return [join24(homedir21(), "AppData", "Roaming", "Kiro", "User", "globalStorage", "kiro.kiroagent")];
|
||
}
|
||
return [
|
||
join24(homedir21(), ".kiro-server", "data", "User", "globalStorage", "kiro.kiroagent"),
|
||
join24(homedir21(), ".config", "Kiro", "User", "globalStorage", "kiro.kiroagent")
|
||
];
|
||
}
|
||
function getKiroAgentDir(override) {
|
||
const candidates = getKiroAgentDirCandidates(override);
|
||
if (override || process.platform !== "linux") return candidates;
|
||
const existing = candidates.filter((p) => existsSync8(p));
|
||
return existing.length > 0 ? existing : [candidates[candidates.length - 1]];
|
||
}
|
||
function getKiroWorkspaceStorageDir(override) {
|
||
if (override) return override;
|
||
if (process.platform === "darwin") {
|
||
return join24(homedir21(), "Library", "Application Support", "Kiro", "User", "workspaceStorage");
|
||
}
|
||
if (process.platform === "win32") {
|
||
return join24(homedir21(), "AppData", "Roaming", "Kiro", "User", "workspaceStorage");
|
||
}
|
||
return join24(homedir21(), ".config", "Kiro", "User", "workspaceStorage");
|
||
}
|
||
async function readWorkspaceProject(workspaceDir) {
|
||
try {
|
||
const raw = await readFile8(join24(workspaceDir, "workspace.json"), "utf-8");
|
||
const data = JSON.parse(raw);
|
||
if (data.folder) {
|
||
const url = data.folder.replace(/^file:\/\//, "");
|
||
return basename14(decodeURIComponent(url));
|
||
}
|
||
} catch {
|
||
}
|
||
return basename14(workspaceDir);
|
||
}
|
||
async function resolveWorkspaceProject2(agentDir, workspaceStorageDir, workspaceHash) {
|
||
const wsDir = join24(workspaceStorageDir, workspaceHash);
|
||
const project = await readWorkspaceProject(wsDir);
|
||
if (project !== workspaceHash) return project;
|
||
try {
|
||
const sessionsPath = join24(agentDir, "workspace-sessions");
|
||
const dirs = await readdir15(sessionsPath);
|
||
for (const dir of dirs) {
|
||
const decoded = Buffer.from(dir.replace(/_$/, ""), "base64").toString("utf-8");
|
||
if (decoded) return basename14(decoded);
|
||
}
|
||
} catch {
|
||
}
|
||
return workspaceHash;
|
||
}
|
||
async function discoverSessions2(agentDir, workspaceStorageDir, cliSessionsDir) {
|
||
const sources = [];
|
||
if (cliSessionsDir) {
|
||
try {
|
||
const cliEntries = await readdir15(cliSessionsDir, { withFileTypes: true });
|
||
for (const entry of cliEntries) {
|
||
if (!entry.isFile() || !entry.name.endsWith(".jsonl")) continue;
|
||
const jsonlPath = join24(cliSessionsDir, entry.name);
|
||
const metaPath = jsonlPath.replace(/\.jsonl$/, ".json");
|
||
let project = "kiro-cli";
|
||
try {
|
||
const raw = await readFile8(metaPath, "utf-8");
|
||
const meta = JSON.parse(raw);
|
||
if (meta.cwd) project = basename14(meta.cwd);
|
||
} catch {
|
||
}
|
||
sources.push({ path: jsonlPath, project, provider: "kiro" });
|
||
}
|
||
} catch {
|
||
}
|
||
}
|
||
let workspaceDirs;
|
||
try {
|
||
const entries = await readdir15(agentDir, { withFileTypes: true });
|
||
workspaceDirs = entries.filter((e) => e.isDirectory() && e.name.length === 32).map((e) => e.name);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const wsHash of workspaceDirs) {
|
||
const wsPath = join24(agentDir, wsHash);
|
||
const project = await resolveWorkspaceProject2(agentDir, workspaceStorageDir, wsHash);
|
||
let entries;
|
||
try {
|
||
entries = await readdir15(wsPath, { withFileTypes: true });
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const entry of entries) {
|
||
if (entry.name.startsWith(".")) continue;
|
||
const entryPath = join24(wsPath, entry.name);
|
||
if (entry.isFile() && (entry.name.endsWith(".chat") || extname(entry.name) === "")) {
|
||
sources.push({ path: entryPath, project, provider: "kiro" });
|
||
continue;
|
||
}
|
||
if (!entry.isDirectory()) continue;
|
||
const childEntries = await readdir15(entryPath, { withFileTypes: true }).catch(() => []);
|
||
for (const child of childEntries) {
|
||
if (child.name.startsWith(".")) continue;
|
||
if (!child.isFile()) continue;
|
||
if (extname(child.name) !== "") continue;
|
||
sources.push({ path: join24(entryPath, child.name), project, provider: "kiro" });
|
||
}
|
||
}
|
||
}
|
||
try {
|
||
const wsSessionsDir = join24(agentDir, "workspace-sessions");
|
||
const wsSessionDirs = await readdir15(wsSessionsDir, { withFileTypes: true });
|
||
for (const dir of wsSessionDirs) {
|
||
if (!dir.isDirectory()) continue;
|
||
let project = "kiro-ide";
|
||
try {
|
||
const decoded = Buffer.from(dir.name.replace(/_/g, "="), "base64").toString("utf-8");
|
||
if (decoded) project = basename14(decoded);
|
||
} catch {
|
||
}
|
||
if (project === basename14(homedir21())) project = "kiro-ide";
|
||
const sessionFiles = await readdir15(join24(wsSessionsDir, dir.name), { withFileTypes: true }).catch(() => []);
|
||
for (const sf of sessionFiles) {
|
||
if (!sf.isFile() || !sf.name.endsWith(".json") || sf.name === "sessions.json") continue;
|
||
sources.push({ path: join24(wsSessionsDir, dir.name, sf.name), project, provider: "kiro" });
|
||
}
|
||
}
|
||
} catch {
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverV2Sessions(sessionsRoot) {
|
||
const sources = [];
|
||
let hashDirs;
|
||
try {
|
||
hashDirs = await readdir15(sessionsRoot, { withFileTypes: true });
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const hd of hashDirs) {
|
||
if (!hd.isDirectory() || hd.name === "cli") continue;
|
||
const hashPath = join24(sessionsRoot, hd.name);
|
||
let sessDirs;
|
||
try {
|
||
sessDirs = await readdir15(hashPath, { withFileTypes: true });
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const sd of sessDirs) {
|
||
if (!sd.isDirectory() || !sd.name.startsWith("sess_")) continue;
|
||
const sessDir = join24(hashPath, sd.name);
|
||
const messagesPath = join24(sessDir, "messages.jsonl");
|
||
if (!existsSync8(messagesPath)) continue;
|
||
let project = "kiro-ide";
|
||
try {
|
||
const raw = await readFile8(join24(sessDir, "session.json"), "utf-8");
|
||
const sj = JSON.parse(raw);
|
||
const wp = sj.workspacePaths?.[0];
|
||
if (wp) project = basename14(wp);
|
||
} catch {
|
||
}
|
||
if (project === basename14(homedir21())) project = "kiro-ide";
|
||
sources.push({ path: messagesPath, project, provider: "kiro" });
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createKiroProvider(agentDirOverride, workspaceStorageDirOverride, cliSessionsDirOverride, v2SessionsRootOverride) {
|
||
const agentCandidates = getKiroAgentDirCandidates(agentDirOverride);
|
||
const agentDirs = getKiroAgentDir(agentDirOverride);
|
||
const wsDir = getKiroWorkspaceStorageDir(workspaceStorageDirOverride);
|
||
const defaultCliDir = join24(process.env["KIRO_HOME"] || join24(homedir21(), ".kiro"), "sessions", "cli");
|
||
const cliDir = cliSessionsDirOverride === "" ? void 0 : cliSessionsDirOverride ?? (agentDirOverride ? join24(agentDirOverride, "..", "cli-sessions") : defaultCliDir);
|
||
const v2Root = v2SessionsRootOverride === "" ? void 0 : v2SessionsRootOverride ?? (cliSessionsDirOverride ? dirname6(cliSessionsDirOverride) : agentDirOverride ? void 0 : dirname6(defaultCliDir));
|
||
return {
|
||
name: "kiro",
|
||
displayName: "Kiro",
|
||
modelDisplayName(model) {
|
||
if (model === "kiro-auto") return "Kiro (auto)";
|
||
for (const [key, name] of modelDisplayEntries3) {
|
||
if (model === key || model.startsWith(key + "-")) return name;
|
||
}
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
if (rawTool.startsWith("mcp__")) return rawTool;
|
||
return toolNameMap12[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
const roots = [
|
||
...agentCandidates.map((path) => ({ path, label: "agent" })),
|
||
{ path: wsDir, label: "workspace" }
|
||
];
|
||
if (cliDir) roots.push({ path: cliDir, label: "cli" });
|
||
if (v2Root) roots.push({ path: v2Root, label: "v2" });
|
||
return roots;
|
||
},
|
||
async discoverSessions() {
|
||
const allSources = [];
|
||
for (const agentDir of agentDirs) {
|
||
const sources = await discoverSessions2(agentDir, wsDir, cliDir);
|
||
allSources.push(...sources);
|
||
}
|
||
if (v2Root) allSources.push(...await discoverV2Sessions(v2Root));
|
||
const seen = /* @__PURE__ */ new Set();
|
||
return allSources.filter((s) => {
|
||
if (seen.has(s.path)) return false;
|
||
seen.add(s.path);
|
||
return true;
|
||
});
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser11(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var USD_PER_KIRO_CREDIT, MIN_REASONABLE_TIMESTAMP_MS3, MODERN_CONVERSATION_KEYS, modelDisplayNames4, modelDisplayEntries3, toolNameMap12, kiro;
|
||
var init_kiro = __esm({
|
||
"src/providers/kiro.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_content_utils();
|
||
init_models();
|
||
init_token_estimate();
|
||
USD_PER_KIRO_CREDIT = 0.04;
|
||
MIN_REASONABLE_TIMESTAMP_MS3 = 1e12;
|
||
MODERN_CONVERSATION_KEYS = ["messages", "conversation", "chat", "transcript", "entries", "events"];
|
||
modelDisplayNames4 = {
|
||
"claude-sonnet-4-6": "Sonnet 4.6",
|
||
"claude-sonnet-4-5": "Sonnet 4.5",
|
||
"claude-sonnet-4": "Sonnet 4",
|
||
"claude-haiku-4-5": "Haiku 4.5",
|
||
"claude-3-7-sonnet": "Sonnet 3.7",
|
||
"claude-3-5-sonnet": "Sonnet 3.5",
|
||
"claude-3-5-haiku": "Haiku 3.5"
|
||
};
|
||
modelDisplayEntries3 = Object.entries(modelDisplayNames4).sort((a, b) => b[0].length - a[0].length);
|
||
toolNameMap12 = {
|
||
readFile: "Read",
|
||
read_file: "Read",
|
||
read: "Read",
|
||
writeFile: "Edit",
|
||
write_file: "Edit",
|
||
write: "Edit",
|
||
editFile: "Edit",
|
||
edit_file: "Edit",
|
||
createFile: "Write",
|
||
create_file: "Write",
|
||
deleteFile: "Delete",
|
||
listDir: "LS",
|
||
list_dir: "LS",
|
||
openFolders: "LS",
|
||
runCommand: "Bash",
|
||
run_command: "Bash",
|
||
shell: "Bash",
|
||
executeBash: "Bash",
|
||
searchFiles: "Grep",
|
||
search_files: "Grep",
|
||
grep: "Grep",
|
||
grepSearch: "Grep",
|
||
findFiles: "Glob",
|
||
find_files: "Glob",
|
||
glob: "Glob",
|
||
fileSearch: "Glob",
|
||
webSearch: "WebSearch",
|
||
web_search: "WebSearch",
|
||
web_fetch: "WebFetch",
|
||
fsWrite: "Edit",
|
||
strReplace: "Edit",
|
||
listDirectory: "LS",
|
||
code: "Read",
|
||
subagent: "Agent"
|
||
};
|
||
kiro = createKiroProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/kimi.ts
|
||
import { createHash as createHash3 } from "crypto";
|
||
import { readdir as readdir16, readFile as readFile9, stat as stat17 } from "fs/promises";
|
||
import { basename as basename15, dirname as dirname7, join as join25 } from "path";
|
||
import { homedir as homedir22 } from "os";
|
||
function asObject(value) {
|
||
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
||
}
|
||
function stringField2(obj, key) {
|
||
const value = obj?.[key];
|
||
return typeof value === "string" ? value : void 0;
|
||
}
|
||
function numericField(obj, ...keys) {
|
||
for (const key of keys) {
|
||
const raw = obj[key];
|
||
const n = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
|
||
if (Number.isFinite(n) && n > 0) return Math.trunc(n);
|
||
}
|
||
return 0;
|
||
}
|
||
function getShareDir(overrideDir) {
|
||
return overrideDir ?? process.env["KIMI_SHARE_DIR"] ?? join25(homedir22(), ".kimi");
|
||
}
|
||
function md5(text2) {
|
||
return createHash3("md5").update(text2, "utf-8").digest("hex");
|
||
}
|
||
function projectNameFromPath2(pathValue) {
|
||
const cleaned = pathValue.replace(/\/+$/, "");
|
||
return basename15(cleaned) || cleaned || "kimi";
|
||
}
|
||
async function loadProjectNames(shareDir) {
|
||
const projects = /* @__PURE__ */ new Map();
|
||
const raw = await readFile9(join25(shareDir, "kimi.json"), "utf-8").catch(() => null);
|
||
if (!raw) return projects;
|
||
let data;
|
||
try {
|
||
data = JSON.parse(raw);
|
||
} catch {
|
||
return projects;
|
||
}
|
||
const workDirs = asObject(data)?.["work_dirs"];
|
||
if (!Array.isArray(workDirs)) return projects;
|
||
for (const entry of workDirs) {
|
||
const obj = asObject(entry);
|
||
const pathValue = stringField2(obj, "path");
|
||
if (!pathValue) continue;
|
||
const hash = md5(pathValue);
|
||
const project = projectNameFromPath2(pathValue);
|
||
projects.set(hash, project);
|
||
const kaos = stringField2(obj, "kaos");
|
||
if (kaos && kaos !== "local") projects.set(`${kaos}_${hash}`, project);
|
||
}
|
||
return projects;
|
||
}
|
||
function parseTomlString(raw) {
|
||
const value = raw.trim();
|
||
if (!value) return null;
|
||
if (value.startsWith('"')) {
|
||
const match2 = value.match(/^"((?:[^"\\]|\\.)*)"/);
|
||
if (!match2) return null;
|
||
try {
|
||
return JSON.parse(`"${match2[1]}"`);
|
||
} catch {
|
||
return match2[1] ?? null;
|
||
}
|
||
}
|
||
if (value.startsWith("'")) {
|
||
const match2 = value.match(/^'([^']*)'/);
|
||
return match2?.[1] ?? null;
|
||
}
|
||
const match = value.match(/^([^#\s]+)/);
|
||
return match?.[1] ?? null;
|
||
}
|
||
function parseDefaultModelKey(configToml) {
|
||
for (const line of configToml.split("\n")) {
|
||
const match = line.match(/^\s*default_model\s*=\s*(.+)$/);
|
||
if (!match) continue;
|
||
return parseTomlString(match[1]);
|
||
}
|
||
return null;
|
||
}
|
||
function parseModelSectionName(line) {
|
||
const match = line.trim().match(/^\[models\.(?:"([^"]+)"|'([^']+)'|([^\]]+))\]$/);
|
||
if (!match) return null;
|
||
return (match[1] ?? match[2] ?? match[3] ?? "").trim() || null;
|
||
}
|
||
function parseModelIdForKey(configToml, modelKey) {
|
||
let inSection = false;
|
||
for (const line of configToml.split("\n")) {
|
||
const section = parseModelSectionName(line);
|
||
if (section !== null) {
|
||
inSection = section === modelKey;
|
||
continue;
|
||
}
|
||
if (!inSection) continue;
|
||
if (/^\s*\[/.test(line)) {
|
||
inSection = false;
|
||
continue;
|
||
}
|
||
const match = line.match(/^\s*model\s*=\s*(.+)$/);
|
||
if (!match) continue;
|
||
return parseTomlString(match[1]);
|
||
}
|
||
return null;
|
||
}
|
||
async function getConfiguredModel(shareDir) {
|
||
const envModel = process.env["KIMI_MODEL_NAME"]?.trim();
|
||
if (envModel) return envModel;
|
||
const raw = await readFile9(join25(shareDir, "config.toml"), "utf-8").catch(() => null);
|
||
if (!raw) return "kimi-auto";
|
||
const defaultModel = parseDefaultModelKey(raw);
|
||
if (!defaultModel) return "kimi-auto";
|
||
return parseModelIdForKey(raw, defaultModel) ?? defaultModel;
|
||
}
|
||
function parseJsonObject(text2) {
|
||
if (!text2) return null;
|
||
try {
|
||
return asObject(JSON.parse(text2));
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function extractUserText(value) {
|
||
if (typeof value === "string") return value.slice(0, 500);
|
||
if (!Array.isArray(value)) return "";
|
||
return value.map((part) => stringField2(asObject(part), "text") ?? "").filter(Boolean).join(" ").slice(0, 500);
|
||
}
|
||
function timestampToIso(value) {
|
||
if (typeof value === "string") return value;
|
||
if (typeof value !== "number" || !Number.isFinite(value)) return "";
|
||
const millis = value > 1e12 ? value : value * 1e3;
|
||
const date = new Date(millis);
|
||
return Number.isFinite(date.getTime()) ? date.toISOString() : "";
|
||
}
|
||
function extractEnvelope(record) {
|
||
const message = asObject(record["message"]);
|
||
const envelope = message ?? record;
|
||
const type = stringField2(envelope, "type");
|
||
const payload = asObject(envelope["payload"]);
|
||
if (!type || !payload) return null;
|
||
return { type, payload, timestamp: timestampToIso(record["timestamp"]) };
|
||
}
|
||
function extractUsage(payload) {
|
||
const usage = asObject(payload["token_usage"]) ?? asObject(payload["usage"]);
|
||
if (!usage) return null;
|
||
const cacheReadInputTokens = numericField(usage, "input_cache_read", "cache_read_input_tokens", "cached_input_tokens");
|
||
const cacheCreationInputTokens = numericField(usage, "input_cache_creation", "cache_creation_input_tokens");
|
||
let inputTokens = numericField(usage, "input_other", "input_tokens");
|
||
if (inputTokens === 0) {
|
||
const totalInput = numericField(usage, "input");
|
||
inputTokens = Math.max(0, totalInput - cacheReadInputTokens - cacheCreationInputTokens);
|
||
}
|
||
const outputTokens = numericField(usage, "output", "output_tokens");
|
||
if (inputTokens === 0 && outputTokens === 0 && cacheReadInputTokens === 0 && cacheCreationInputTokens === 0) {
|
||
return null;
|
||
}
|
||
return { inputTokens, outputTokens, cacheReadInputTokens, cacheCreationInputTokens };
|
||
}
|
||
function extractTool(payload) {
|
||
const fn = asObject(payload["function"]);
|
||
const rawName = stringField2(fn, "name") ?? stringField2(payload, "name");
|
||
if (!rawName) return null;
|
||
const tool = toolNameMap13[rawName] ?? rawName;
|
||
const argsText = stringField2(fn, "arguments") ?? stringField2(payload, "arguments");
|
||
const args = parseJsonObject(argsText);
|
||
const command = stringField2(args, "command");
|
||
const bashCommands = tool === "Bash" && command ? extractBashCommands(command) : [];
|
||
return { tool, bashCommands };
|
||
}
|
||
function createParser12(source, shareDir, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const configuredModel2 = await getConfiguredModel(shareDir);
|
||
const tools = /* @__PURE__ */ new Set();
|
||
const bashCommands = /* @__PURE__ */ new Set();
|
||
let currentUserMessage = "";
|
||
const sessionId = basename15(dirname7(source.path));
|
||
let index = 0;
|
||
for await (const line of readSessionLines(source.path)) {
|
||
if (!line.trim()) continue;
|
||
let record = null;
|
||
try {
|
||
record = asObject(JSON.parse(line));
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (!record) continue;
|
||
const envelope = extractEnvelope(record);
|
||
if (!envelope || envelope.type === "metadata") continue;
|
||
if (envelope.type === "TurnBegin" || envelope.type === "SteerInput") {
|
||
currentUserMessage = extractUserText(envelope.payload["user_input"]);
|
||
continue;
|
||
}
|
||
if (envelope.type === "TurnEnd") {
|
||
currentUserMessage = "";
|
||
tools.clear();
|
||
bashCommands.clear();
|
||
continue;
|
||
}
|
||
if (envelope.type === "ToolCall" || envelope.type === "ToolCallRequest") {
|
||
const extracted = extractTool(envelope.payload);
|
||
if (!extracted) continue;
|
||
tools.add(extracted.tool);
|
||
for (const command of extracted.bashCommands) bashCommands.add(command);
|
||
continue;
|
||
}
|
||
if (envelope.type !== "StatusUpdate") continue;
|
||
const usage = extractUsage(envelope.payload);
|
||
if (!usage) continue;
|
||
const rawMessageId = stringField2(envelope.payload, "message_id");
|
||
const dedupKey = `kimi:${sessionId}:${rawMessageId ?? index}`;
|
||
index++;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const model = stringField2(envelope.payload, "model") ?? stringField2(envelope.payload, "model_name") ?? configuredModel2;
|
||
const costUSD = calculateCost(
|
||
pricingModelAt(model, envelope.timestamp),
|
||
usage.inputTokens,
|
||
usage.outputTokens,
|
||
usage.cacheCreationInputTokens,
|
||
usage.cacheReadInputTokens,
|
||
0
|
||
);
|
||
yield {
|
||
provider: "kimi",
|
||
model,
|
||
inputTokens: usage.inputTokens,
|
||
outputTokens: usage.outputTokens,
|
||
cacheCreationInputTokens: usage.cacheCreationInputTokens,
|
||
cacheReadInputTokens: usage.cacheReadInputTokens,
|
||
cachedInputTokens: usage.cacheReadInputTokens,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [...tools],
|
||
bashCommands: [...bashCommands],
|
||
timestamp: envelope.timestamp,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: currentUserMessage,
|
||
sessionId
|
||
};
|
||
tools.clear();
|
||
bashCommands.clear();
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function addWireSource(sources, filePath, project) {
|
||
const s = await stat17(filePath).catch(() => null);
|
||
if (!s?.isFile()) return;
|
||
sources.push({ path: filePath, project, provider: "kimi" });
|
||
}
|
||
function createKimiProvider(overrideDir) {
|
||
const shareDir = getShareDir(overrideDir);
|
||
return {
|
||
name: "kimi",
|
||
displayName: "Kimi",
|
||
async probeRoots() {
|
||
return [{ path: join25(shareDir, "sessions"), label: "sessions" }];
|
||
},
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap13[rawTool] ?? rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
const sources = [];
|
||
const sessionsRoot = join25(shareDir, "sessions");
|
||
const projectNames = await loadProjectNames(shareDir);
|
||
const workDirs = await readdir16(sessionsRoot, { withFileTypes: true }).catch(() => []);
|
||
for (const workDir of workDirs) {
|
||
if (!workDir.isDirectory()) continue;
|
||
const project = projectNames.get(workDir.name) ?? workDir.name;
|
||
const workDirPath = join25(sessionsRoot, workDir.name);
|
||
const sessionDirs = await readdir16(workDirPath, { withFileTypes: true }).catch(() => []);
|
||
for (const sessionDir of sessionDirs) {
|
||
if (!sessionDir.isDirectory()) continue;
|
||
const sessionPath = join25(workDirPath, sessionDir.name);
|
||
await addWireSource(sources, join25(sessionPath, "wire.jsonl"), project);
|
||
const subagentsPath = join25(sessionPath, "subagents");
|
||
const subagents = await readdir16(subagentsPath, { withFileTypes: true }).catch(() => []);
|
||
for (const subagent of subagents) {
|
||
if (!subagent.isDirectory()) continue;
|
||
await addWireSource(sources, join25(subagentsPath, subagent.name, "wire.jsonl"), project);
|
||
}
|
||
}
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser12(source, shareDir, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap13, kimi;
|
||
var init_kimi = __esm({
|
||
"src/providers/kimi.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_fs_utils();
|
||
init_models();
|
||
toolNameMap13 = {
|
||
Shell: "Bash",
|
||
Bash: "Bash",
|
||
bash: "Bash",
|
||
ReadFile: "Read",
|
||
ReadMediaFile: "Read",
|
||
WriteFile: "Write",
|
||
StrReplaceFile: "Edit",
|
||
Grep: "Grep",
|
||
Glob: "Glob",
|
||
SearchWeb: "WebSearch",
|
||
FetchURL: "WebFetch",
|
||
Agent: "Agent",
|
||
AgentTool: "Agent",
|
||
TaskList: "Agent",
|
||
TaskOutput: "Agent",
|
||
TaskStop: "Agent",
|
||
AskUserQuestion: "AskUser",
|
||
SetTodoList: "TodoWrite",
|
||
Think: "Think",
|
||
EnterPlanMode: "EnterPlanMode",
|
||
ExitPlanMode: "ExitPlanMode",
|
||
SendDMail: "DMail"
|
||
};
|
||
kimi = createKimiProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/kimicode.ts
|
||
import { readdir as readdir17, readFile as readFile10, stat as stat18 } from "fs/promises";
|
||
import { homedir as homedir23 } from "os";
|
||
import { basename as basename16, dirname as dirname8, join as join26, resolve as resolve4 } from "path";
|
||
function asObject2(value) {
|
||
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
||
}
|
||
function stringValue(value) {
|
||
return typeof value === "string" ? value.trim() : "";
|
||
}
|
||
function nonNegativeNumber(value) {
|
||
const number = typeof value === "number" ? value : typeof value === "string" && value.trim() ? Number(value) : NaN;
|
||
return Number.isFinite(number) && number >= 0 ? Math.trunc(number) : 0;
|
||
}
|
||
function timestampIso(value) {
|
||
if (typeof value === "string") {
|
||
const date2 = new Date(value);
|
||
return Number.isNaN(date2.getTime()) ? "" : date2.toISOString();
|
||
}
|
||
if (typeof value !== "number" || !Number.isFinite(value)) return "";
|
||
const milliseconds = value > 1e12 ? value : value * 1e3;
|
||
const date = new Date(milliseconds);
|
||
return Number.isNaN(date.getTime()) ? "" : date.toISOString();
|
||
}
|
||
function kimicodeHomes(override) {
|
||
const explicit = override || process.env["KIMI_CODE_HOME"];
|
||
if (explicit) return [resolve4(explicit)];
|
||
const home = homedir23();
|
||
const homes = [
|
||
join26(home, ".kimi-code"),
|
||
join26(home, "Library", "Application Support", "kimi-desktop", "daimon-share", "daimon", "runtime", "kimi-code", "home")
|
||
];
|
||
return [...new Set(homes.map((h) => resolve4(h)))];
|
||
}
|
||
async function directoryEntries(path) {
|
||
try {
|
||
return await readdir17(path, { withFileTypes: true });
|
||
} catch {
|
||
return [];
|
||
}
|
||
}
|
||
async function isFile(path) {
|
||
try {
|
||
return (await stat18(path)).isFile();
|
||
} catch {
|
||
return false;
|
||
}
|
||
}
|
||
async function readState(sessionDir) {
|
||
try {
|
||
const state = asObject2(JSON.parse(await readFile10(join26(sessionDir, "state.json"), "utf8")));
|
||
if (!state) return {};
|
||
const agents = asObject2(state["agents"]);
|
||
let agentsMap;
|
||
if (agents) {
|
||
agentsMap = {};
|
||
for (const [name, descriptor] of Object.entries(agents)) {
|
||
const desc = asObject2(descriptor);
|
||
if (!desc) continue;
|
||
const parent = desc["parentAgentId"];
|
||
agentsMap[name] = { parentAgentId: parent === null || typeof parent === "string" ? parent : void 0 };
|
||
}
|
||
}
|
||
return {
|
||
createdAt: stringValue(state["createdAt"]) || void 0,
|
||
createdAtMs: nonNegativeNumber(state["createdAt"]) || void 0,
|
||
cwd: stringValue(state["cwd"]) || void 0,
|
||
updatedAt: stringValue(state["updatedAt"]) || void 0,
|
||
workDir: stringValue(state["workDir"]) || void 0,
|
||
...agentsMap ? { agents: agentsMap } : {}
|
||
};
|
||
} catch {
|
||
return {};
|
||
}
|
||
}
|
||
function projectFromWorkDir(workDir, workDirKey) {
|
||
if (workDir) return basename16(workDir.replace(/[\\/]+$/, "")) || workDir;
|
||
const match = /^wd_(.+)_[a-f0-9]{12}$/i.exec(workDirKey);
|
||
return match?.[1] || workDirKey.replace(/^wd_/, "") || "kimicode";
|
||
}
|
||
async function discoverSources(root) {
|
||
const sessionsDir = join26(root, "sessions");
|
||
const workDirs = (await directoryEntries(sessionsDir)).filter((e) => e.isDirectory() && e.name.startsWith("wd_")).map((e) => ({ key: e.name, path: join26(sessionsDir, e.name) }));
|
||
const sessionDirs = (await mapWithConcurrency(
|
||
workDirs,
|
||
FS_SCAN_CONCURRENCY,
|
||
async (wd) => (await directoryEntries(wd.path)).filter((e) => e.isDirectory()).map((e) => ({ workDirKey: wd.key, sessionDir: join26(wd.path, e.name) }))
|
||
)).flat();
|
||
const agents = (await mapWithConcurrency(sessionDirs, FS_SCAN_CONCURRENCY, async (sd) => {
|
||
const state = await readState(sd.sessionDir);
|
||
const workDir = state.workDir ?? state.cwd;
|
||
const project = projectFromWorkDir(workDir ?? "", sd.workDirKey);
|
||
const agentsDir = join26(sd.sessionDir, "agents");
|
||
return (await directoryEntries(agentsDir)).filter((e) => e.isDirectory()).map((e) => ({ agentName: e.name, wirePath: join26(agentsDir, e.name, "wire.jsonl"), project, workDir }));
|
||
})).flat();
|
||
const present = await mapWithConcurrency(agents, FS_SCAN_CONCURRENCY, (a) => isFile(a.wirePath));
|
||
const sources = [];
|
||
for (const [i, a] of agents.entries()) {
|
||
if (!present[i]) continue;
|
||
sources.push({
|
||
path: a.wirePath,
|
||
project: a.project,
|
||
provider: "kimicode",
|
||
sourceId: a.agentName,
|
||
sourceLabel: a.agentName,
|
||
sourcePath: a.workDir
|
||
});
|
||
}
|
||
return sources.sort((a, b) => a.path.localeCompare(b.path));
|
||
}
|
||
function sessionDirForWire(path) {
|
||
return dirname8(dirname8(dirname8(path)));
|
||
}
|
||
function sessionIdForWire(path) {
|
||
return basename16(sessionDirForWire(path)).replace(/^session_/, "");
|
||
}
|
||
function agentIdForWire(path) {
|
||
return basename16(dirname8(path));
|
||
}
|
||
function turnIdFromStep(value) {
|
||
const turnStep = stringValue(value);
|
||
if (!turnStep) return "";
|
||
return turnStep.split(".", 1)[0] ?? "";
|
||
}
|
||
function inputText(value) {
|
||
if (typeof value === "string") return value;
|
||
if (!Array.isArray(value)) return "";
|
||
return value.map((part) => {
|
||
const record = asObject2(part);
|
||
return record?.["type"] === "text" ? stringValue(record["text"]) : "";
|
||
}).filter(Boolean).join("\n");
|
||
}
|
||
function toolDetails(value) {
|
||
const event = asObject2(value);
|
||
if (!event || stringValue(event["type"]) !== "tool.call") return null;
|
||
const rawName = stringValue(event["name"]);
|
||
if (!rawName) return null;
|
||
const name = toolNameMap14[rawName] ?? rawName;
|
||
let args = asObject2(event["args"]);
|
||
if (!args && typeof event["args"] === "string") {
|
||
try {
|
||
args = asObject2(JSON.parse(event["args"]));
|
||
} catch {
|
||
args = null;
|
||
}
|
||
}
|
||
const command = stringValue(args?.["command"]);
|
||
return {
|
||
name,
|
||
bashCommands: name === "Bash" && command ? extractBashCommands(command) : []
|
||
};
|
||
}
|
||
function createParser13(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
let contents;
|
||
try {
|
||
contents = await readFile10(source.path, "utf8");
|
||
} catch {
|
||
return;
|
||
}
|
||
const sessionDir = sessionDirForWire(source.path);
|
||
const sessionId = sessionIdForWire(source.path);
|
||
const agentId = source.sourceId || agentIdForWire(source.path);
|
||
const state = await readState(sessionDir);
|
||
const fallbackTimestamp = timestampIso(state.updatedAt) || timestampIso(state.createdAt);
|
||
const projectPath = state.workDir || state.cwd || source.sourcePath;
|
||
const aliasModels = /* @__PURE__ */ new Map();
|
||
const prompts = /* @__PURE__ */ new Map();
|
||
let currentPrompt = "";
|
||
let currentRequest = null;
|
||
let pendingTools = [];
|
||
let pendingBashCommands = [];
|
||
let usageOrdinal = 0;
|
||
const lines = contents.split(/\r?\n/);
|
||
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
||
const line = lines[lineIndex].trim();
|
||
if (!line) continue;
|
||
let record;
|
||
try {
|
||
record = asObject2(JSON.parse(line));
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (!record) continue;
|
||
const type = stringValue(record["type"]);
|
||
if (type === "turn.prompt") {
|
||
pendingTools = [];
|
||
pendingBashCommands = [];
|
||
currentPrompt = inputText(record["input"]);
|
||
continue;
|
||
}
|
||
if (type === "llm.request") {
|
||
const model = stringValue(record["model"]);
|
||
const modelAlias = stringValue(record["modelAlias"]);
|
||
const turnId2 = turnIdFromStep(record["turnStep"]);
|
||
if (model && modelAlias) aliasModels.set(modelAlias, model);
|
||
if (turnId2 && currentPrompt) prompts.set(turnId2, currentPrompt);
|
||
currentRequest = {
|
||
model,
|
||
modelAlias,
|
||
turnId: turnId2,
|
||
timestamp: timestampIso(record["time"])
|
||
};
|
||
continue;
|
||
}
|
||
if (type === "context.append_loop_event") {
|
||
const tool = toolDetails(record["event"]);
|
||
if (tool) {
|
||
pendingTools.push(tool.name);
|
||
pendingBashCommands.push(...tool.bashCommands);
|
||
}
|
||
continue;
|
||
}
|
||
if (type !== "usage.record") continue;
|
||
const usage = asObject2(record["usage"]);
|
||
if (!usage) continue;
|
||
const usageAlias = stringValue(record["model"]);
|
||
const realModel = aliasModels.get(usageAlias) ?? (currentRequest?.model || "kimicode-unknown");
|
||
const turnId = currentRequest?.turnId || "";
|
||
const inputTokens = nonNegativeNumber(usage["inputOther"]);
|
||
const outputTokens = nonNegativeNumber(usage["output"]);
|
||
const cacheReadInputTokens = nonNegativeNumber(usage["inputCacheRead"]);
|
||
const cacheCreationInputTokens = nonNegativeNumber(usage["inputCacheCreation"]);
|
||
const timestamp2 = timestampIso(record["time"]) || currentRequest?.timestamp || fallbackTimestamp;
|
||
if (!timestamp2) {
|
||
pendingTools = [];
|
||
pendingBashCommands = [];
|
||
continue;
|
||
}
|
||
const deduplicationKey = `kimicode:${sessionId}:${agentId}:${lineIndex + 1}:${usageOrdinal}`;
|
||
usageOrdinal++;
|
||
if (seenKeys.has(deduplicationKey)) {
|
||
pendingTools = [];
|
||
pendingBashCommands = [];
|
||
continue;
|
||
}
|
||
seenKeys.add(deduplicationKey);
|
||
yield {
|
||
provider: "kimicode",
|
||
model: realModel,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens,
|
||
cacheReadInputTokens,
|
||
cachedInputTokens: cacheReadInputTokens,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(
|
||
pricingModelAt(realModel, timestamp2),
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens,
|
||
cacheReadInputTokens,
|
||
0
|
||
),
|
||
costIsEstimated: true,
|
||
tools: pendingTools,
|
||
bashCommands: pendingBashCommands,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: turnId || void 0,
|
||
userMessage: prompts.get(turnId) ?? currentPrompt,
|
||
sessionId,
|
||
project: source.project,
|
||
projectPath
|
||
};
|
||
pendingTools = [];
|
||
pendingBashCommands = [];
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createKimicodeProvider(homeOverride) {
|
||
return {
|
||
name: "kimicode",
|
||
displayName: "Kimi Code",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap14[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return kimicodeHomes(homeOverride).map((path) => ({ path, label: "Kimi Code home" }));
|
||
},
|
||
async discoverSessions() {
|
||
const all = [];
|
||
for (const home of kimicodeHomes(homeOverride)) {
|
||
all.push(...await discoverSources(home));
|
||
}
|
||
return all.sort((a, b) => a.path.localeCompare(b.path));
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser13(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap14, kimicode;
|
||
var init_kimicode = __esm({
|
||
"src/providers/kimicode.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_models();
|
||
init_fs_utils();
|
||
toolNameMap14 = {
|
||
Bash: "Bash",
|
||
Shell: "Bash",
|
||
bash: "Bash",
|
||
shell: "Bash",
|
||
Read: "Read",
|
||
ReadFile: "Read",
|
||
read_file: "Read",
|
||
Write: "Write",
|
||
WriteFile: "Write",
|
||
write_file: "Write",
|
||
Edit: "Edit",
|
||
EditFile: "Edit",
|
||
edit_file: "Edit",
|
||
Grep: "Grep",
|
||
grep: "Grep",
|
||
Glob: "Glob",
|
||
glob: "Glob",
|
||
Agent: "Agent",
|
||
Task: "Agent"
|
||
};
|
||
kimicode = createKimicodeProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/lingtai-tui.ts
|
||
import { readdir as readdir18, readFile as readFile11, stat as stat19 } from "fs/promises";
|
||
import { basename as basename17, delimiter, dirname as dirname9, join as join27, resolve as resolve5 } from "path";
|
||
import { homedir as homedir24 } from "os";
|
||
function normalizeOptions(options) {
|
||
return typeof options === "string" ? { lingtaiHomeOverride: options } : options ?? {};
|
||
}
|
||
function expandHome(raw) {
|
||
if (raw === "~") return homedir24();
|
||
if (raw.startsWith("~/") || raw.startsWith("~\\")) return join27(homedir24(), raw.slice(2));
|
||
return raw;
|
||
}
|
||
function splitPathList(raw) {
|
||
return (raw ?? "").split(delimiter).map((p) => p.trim()).filter(Boolean);
|
||
}
|
||
async function existingDir(path) {
|
||
const resolved = resolve5(expandHome(path));
|
||
const s = await stat19(resolved).catch(() => null);
|
||
return s?.isDirectory() ? resolved : null;
|
||
}
|
||
function getDefaultLingTaiHome(options) {
|
||
return options.defaultHomeOverride ?? join27(homedir24(), ".lingtai");
|
||
}
|
||
function getLingTaiGlobalDir(options) {
|
||
return options.globalDirOverride ?? process.env["LINGTAI_TUI_GLOBAL_DIR"] ?? join27(homedir24(), ".lingtai-tui");
|
||
}
|
||
function projectPrefixFromHome(lingtaiHome, defaultLingTaiHome) {
|
||
const defaultHome = resolve5(expandHome(defaultLingTaiHome));
|
||
const resolved = resolve5(lingtaiHome);
|
||
if (resolved === defaultHome) return void 0;
|
||
const projectName3 = basename17(dirname9(resolved));
|
||
return projectName3 && projectName3 !== "." ? sanitizeProject3(projectName3) : void 0;
|
||
}
|
||
async function readRegisteredProjectPaths(globalDir) {
|
||
const projects = [];
|
||
const registryRaw = await readFile11(join27(globalDir, "registry.jsonl"), "utf-8").catch(() => "");
|
||
for (const line of registryRaw.split(/\r?\n/)) {
|
||
if (!line.trim()) continue;
|
||
try {
|
||
const obj = asObject3(JSON.parse(line));
|
||
const path = stringField3(obj, "path");
|
||
if (path) projects.push(path);
|
||
} catch {
|
||
}
|
||
}
|
||
const briefDir = join27(globalDir, "brief", "projects");
|
||
const entries = await readdir18(briefDir, { withFileTypes: true }).catch(() => []);
|
||
for (const entry of entries) {
|
||
if (!entry.isDirectory()) continue;
|
||
const meta = await readJson3(join27(briefDir, entry.name, "meta.json"));
|
||
const path = stringField3(meta, "project_path");
|
||
if (path) projects.push(path);
|
||
}
|
||
return projects;
|
||
}
|
||
function cwdLingTaiHomes(cwd) {
|
||
const homes = [];
|
||
let current = resolve5(cwd);
|
||
for (; ; ) {
|
||
homes.push(join27(current, ".lingtai"));
|
||
const parent = dirname9(current);
|
||
if (parent === current) break;
|
||
current = parent;
|
||
}
|
||
return homes;
|
||
}
|
||
async function getLingTaiHomes(options) {
|
||
const explicit = splitPathList(options.lingtaiHomeOverride ?? process.env["LINGTAI_HOME"] ?? process.env["LINGTAI_TUI_HOME"]);
|
||
const defaultHome = getDefaultLingTaiHome(options);
|
||
const candidates = explicit.length ? explicit : [
|
||
defaultHome,
|
||
...(await readRegisteredProjectPaths(getLingTaiGlobalDir(options))).map((project) => join27(project, ".lingtai")),
|
||
...cwdLingTaiHomes(options.cwdOverride ?? process.cwd())
|
||
];
|
||
const seen = /* @__PURE__ */ new Set();
|
||
const homes = [];
|
||
for (const candidate of candidates) {
|
||
const path = await existingDir(candidate);
|
||
if (!path || seen.has(path)) continue;
|
||
seen.add(path);
|
||
homes.push({ path, projectPrefix: explicit.length ? void 0 : projectPrefixFromHome(path, defaultHome) });
|
||
}
|
||
return homes;
|
||
}
|
||
function sanitizeProject3(raw) {
|
||
const trimmed = raw.trim();
|
||
if (!trimmed) return "lingtai";
|
||
return trimmed.replace(/^[/\\]+/, "").replace(/[:/\\]/g, "-");
|
||
}
|
||
function asObject3(value) {
|
||
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
||
}
|
||
function stringField3(obj, key) {
|
||
const value = obj?.[key];
|
||
return typeof value === "string" && value.trim() ? value : void 0;
|
||
}
|
||
function numericField2(obj, key) {
|
||
const raw = obj[key];
|
||
const n = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw) : NaN;
|
||
if (!Number.isFinite(n) || n <= 0) return 0;
|
||
return Math.trunc(n);
|
||
}
|
||
async function readJson3(path) {
|
||
const raw = await readFile11(path, "utf-8").catch(() => null);
|
||
if (!raw) return null;
|
||
try {
|
||
return JSON.parse(raw);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function readAgentManifest(agentDir) {
|
||
const obj = asObject3(await readJson3(join27(agentDir, ".agent.json")));
|
||
if (!obj) return null;
|
||
const llm = asObject3(obj["llm"]);
|
||
return {
|
||
agent_id: stringField3(obj, "agent_id"),
|
||
agent_name: stringField3(obj, "agent_name"),
|
||
address: stringField3(obj, "address"),
|
||
nickname: stringField3(obj, "nickname") ?? null,
|
||
llm: llm ? { model: stringField3(llm, "model"), base_url: stringField3(llm, "base_url") } : void 0
|
||
};
|
||
}
|
||
function agentDirFromLedgerPath(ledgerPath) {
|
||
return dirname9(dirname9(ledgerPath));
|
||
}
|
||
function projectFromManifest(manifest, fallback, prefix) {
|
||
const name = sanitizeProject3(
|
||
manifest?.nickname ?? manifest?.agent_name ?? manifest?.address ?? fallback
|
||
);
|
||
return prefix ? `${prefix}-${name}` : name;
|
||
}
|
||
function parseTimestamp3(raw) {
|
||
if (typeof raw === "number" && Number.isFinite(raw)) {
|
||
const ms = raw < 1e12 ? raw * 1e3 : raw;
|
||
return new Date(ms).toISOString();
|
||
}
|
||
if (typeof raw !== "string" || !raw.trim()) return "";
|
||
const d = new Date(raw);
|
||
return Number.isNaN(d.getTime()) ? "" : d.toISOString();
|
||
}
|
||
function parseLedgerLine(line) {
|
||
const text2 = Buffer.isBuffer(line) ? line.toString("utf-8") : line;
|
||
if (!text2.trim()) return null;
|
||
try {
|
||
const parsed = JSON.parse(text2);
|
||
const obj = asObject3(parsed);
|
||
return obj ? obj : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function activityForSource(sourceLabel) {
|
||
const normalized = sourceLabel.trim().toLowerCase();
|
||
if (normalized === "tc_wake" || normalized.startsWith("tc_") || normalized.includes("wake")) {
|
||
return {
|
||
userMessage: "LingTai task coordinator wake",
|
||
tools: ["Agent"],
|
||
subagentTypes: ["lingtai-task-coordinator"]
|
||
};
|
||
}
|
||
if (normalized === "daemon") {
|
||
return {
|
||
userMessage: "LingTai daemon task",
|
||
tools: ["Agent"],
|
||
subagentTypes: ["lingtai-daemon"]
|
||
};
|
||
}
|
||
if (normalized === "summarize_apriori" || normalized.includes("summar")) {
|
||
return {
|
||
userMessage: "LingTai planning summary",
|
||
tools: ["EnterPlanMode"],
|
||
subagentTypes: []
|
||
};
|
||
}
|
||
return {
|
||
userMessage: normalized === "main" ? "LingTai main conversation" : `LingTai ${sourceLabel || "main"} conversation`,
|
||
tools: [],
|
||
subagentTypes: []
|
||
};
|
||
}
|
||
async function discoverLedgersInHome(home) {
|
||
const entries = await readdir18(home.path, { withFileTypes: true }).catch(() => []);
|
||
const sources = [];
|
||
for (const entry of entries) {
|
||
if (!entry.isDirectory()) continue;
|
||
const agentDir = join27(home.path, entry.name);
|
||
const ledgerPath = join27(agentDir, "logs", "token_ledger.jsonl");
|
||
const s = await stat19(ledgerPath).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
const manifest = await readAgentManifest(agentDir);
|
||
sources.push({
|
||
path: ledgerPath,
|
||
project: projectFromManifest(manifest, entry.name, home.projectPrefix),
|
||
provider: "lingtai-tui"
|
||
});
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverLedgers(homes) {
|
||
const sources = [];
|
||
const seen = /* @__PURE__ */ new Set();
|
||
for (const home of homes) {
|
||
for (const source of await discoverLedgersInHome(home)) {
|
||
if (seen.has(source.path)) continue;
|
||
seen.add(source.path);
|
||
sources.push(source);
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createParser14(source) {
|
||
return {
|
||
async *parse() {
|
||
const agentDir = agentDirFromLedgerPath(source.path);
|
||
const manifest = await readAgentManifest(agentDir);
|
||
const agentId = manifest?.agent_id ?? basename17(agentDir);
|
||
const fallbackModel = manifest?.llm?.model ?? "unknown";
|
||
const fallbackEndpoint = manifest?.llm?.base_url ?? "";
|
||
const project = source.project || projectFromManifest(manifest, basename17(agentDir));
|
||
const projectPath = agentDir;
|
||
let lineNo = 0;
|
||
for await (const line of readSessionLines(source.path)) {
|
||
lineNo += 1;
|
||
const entry = parseLedgerLine(line);
|
||
if (!entry) continue;
|
||
const obj = entry;
|
||
const inputTotal = numericField2(obj, "input");
|
||
const outputTokens = numericField2(obj, "output");
|
||
const reasoningTokens = numericField2(obj, "thinking");
|
||
const cachedInputTokens = numericField2(obj, "cached");
|
||
const totalTokens = inputTotal + outputTokens + reasoningTokens + cachedInputTokens;
|
||
if (totalTokens === 0) continue;
|
||
const inputTokens = Math.max(0, inputTotal - cachedInputTokens);
|
||
const model = stringField3(obj, "model") ?? fallbackModel;
|
||
const endpoint = stringField3(obj, "endpoint") ?? fallbackEndpoint;
|
||
const timestamp2 = parseTimestamp3(entry.ts);
|
||
const sourceLabel = stringField3(obj, "source") ?? "main";
|
||
const emId = stringField3(obj, "em_id") ?? "";
|
||
const runId = stringField3(obj, "run_id") ?? "";
|
||
const sessionId = runId || `${agentId}:${sourceLabel}`;
|
||
const activity = activityForSource(sourceLabel);
|
||
const dedupKey = [
|
||
"lingtai-tui",
|
||
source.path,
|
||
lineNo,
|
||
timestamp2,
|
||
model,
|
||
endpoint,
|
||
sourceLabel,
|
||
emId,
|
||
runId,
|
||
inputTotal,
|
||
outputTokens,
|
||
reasoningTokens,
|
||
cachedInputTokens
|
||
].join(":");
|
||
const costUSD = calculateCost(
|
||
model,
|
||
inputTokens,
|
||
outputTokens + reasoningTokens,
|
||
0,
|
||
cachedInputTokens,
|
||
0
|
||
);
|
||
yield {
|
||
provider: "lingtai-tui",
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: cachedInputTokens,
|
||
cachedInputTokens,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: activity.tools,
|
||
bashCommands: [],
|
||
subagentTypes: activity.subagentTypes,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
turnId: `${sessionId}:line:${lineNo}`,
|
||
userMessage: activity.userMessage,
|
||
sessionId,
|
||
project,
|
||
projectPath
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createLingTaiTuiProvider(options) {
|
||
const providerOptions = normalizeOptions(options);
|
||
return {
|
||
name: "lingtai-tui",
|
||
displayName: "LingTai TUI",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
const explicit = splitPathList(providerOptions.lingtaiHomeOverride ?? process.env["LINGTAI_HOME"] ?? process.env["LINGTAI_TUI_HOME"]);
|
||
const roots = explicit.length ? explicit.map((path) => ({ path, label: "sessions" })) : [
|
||
{ path: getDefaultLingTaiHome(providerOptions), label: "sessions" },
|
||
{ path: getLingTaiGlobalDir(providerOptions), label: "registry" }
|
||
];
|
||
for (const home of await getLingTaiHomes(providerOptions)) {
|
||
if (!roots.some((root) => root.path === home.path)) roots.push({ path: home.path, label: "sessions" });
|
||
}
|
||
return roots;
|
||
},
|
||
async discoverSessions() {
|
||
return discoverLedgers(await getLingTaiHomes(providerOptions));
|
||
},
|
||
createSessionParser(source) {
|
||
return createParser14(source);
|
||
}
|
||
};
|
||
}
|
||
var lingtaiTui;
|
||
var init_lingtai_tui = __esm({
|
||
"src/providers/lingtai-tui.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
lingtaiTui = createLingTaiTuiProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/mistral-vibe-unified.ts
|
||
import { readdir as readdir19 } from "fs/promises";
|
||
import { basename as basename18, dirname as dirname10, join as join28 } from "path";
|
||
function object(value) {
|
||
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
||
}
|
||
function array(value) {
|
||
return Array.isArray(value) ? value : [];
|
||
}
|
||
function text(value) {
|
||
return typeof value === "string" ? value : "";
|
||
}
|
||
function count(value) {
|
||
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
|
||
}
|
||
async function json(path) {
|
||
const raw = await readSessionFile(path);
|
||
if (raw === null) return null;
|
||
try {
|
||
return object(JSON.parse(raw));
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function usagePoint(sequence, stateValue) {
|
||
const state = object(stateValue);
|
||
const usage = object(object(state.session).tokenUsage);
|
||
if (!Object.keys(usage).length) return null;
|
||
const input = count(usage.inputTokens);
|
||
return { sequence, state, usage: {
|
||
input,
|
||
output: count(usage.outputTokens),
|
||
cached: Math.min(input, count(usage.cachedInputTokens))
|
||
} };
|
||
}
|
||
function content(value) {
|
||
return typeof value === "string" ? value : array(value).map((part) => text(object(part).text)).join(" ");
|
||
}
|
||
function timestamp(value, fallback) {
|
||
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
||
const date = new Date(value);
|
||
return Number.isNaN(date.getTime()) ? fallback : date.toISOString();
|
||
}
|
||
async function readUnifiedVibeCalls(currentPath, toolDisplayName, defaultModel) {
|
||
const dir = dirname10(currentPath);
|
||
const current = await json(currentPath);
|
||
if (current?.store_format !== "mistral.vibe.unified-session-store/v1") return [];
|
||
const generation = text(current.generation);
|
||
if (!/^\d{16}$/.test(generation)) return [];
|
||
const generationDir = join28(dir, "generations", generation);
|
||
const projection = await json(join28(generationDir, "projection-state.json"));
|
||
const runtime = await json(join28(generationDir, "runtime-state.json"));
|
||
const manifest = await json(join28(generationDir, "manifest.json"));
|
||
if (!projection || !runtime || !manifest) return [];
|
||
const sessionId = text(current.session_id) || basename18(dir);
|
||
if (projection.session_id !== sessionId || runtime.session_id !== sessionId) return [];
|
||
const snapshotSequence = count(current.snapshot_sequence);
|
||
const snapshot = object(projection.snapshot);
|
||
const meta = await json(join28(dir, "meta.json"));
|
||
const sessionMetadata = object(runtime.session_metadata);
|
||
const model = text(sessionMetadata.active_model) || text(object(meta?.config).active_model) || defaultModel;
|
||
const fallbackTime = text(meta?.end_time) || text(meta?.start_time);
|
||
const projectPath = text(sessionMetadata.cwd) || text(object(meta?.environment).working_directory);
|
||
const entries = /* @__PURE__ */ new Map();
|
||
const addEntries = (values) => {
|
||
for (const value of array(values)) {
|
||
const entry = object(value);
|
||
if (typeof entry.id === "string") entries.set(entry.id, entry);
|
||
}
|
||
};
|
||
addEntries(object(snapshot.history).entries);
|
||
for (const hash of array(object(manifest.projection_state).chunks)) {
|
||
if (typeof hash !== "string" || !/^[a-f0-9]{64}$/.test(hash)) return [];
|
||
const raw = await readSessionFile(join28(dir, "chunks", `${hash}.json`));
|
||
if (raw === null) return [];
|
||
try {
|
||
addEntries(JSON.parse(raw));
|
||
} catch {
|
||
return [];
|
||
}
|
||
}
|
||
const points = /* @__PURE__ */ new Map();
|
||
const addPoint = (sequence, state) => {
|
||
const point = usagePoint(sequence, state);
|
||
if (point) points.set(sequence, point);
|
||
};
|
||
addPoint(snapshotSequence, snapshot);
|
||
const journalDir = join28(dir, "journal");
|
||
const segments = (await readdir19(journalDir).catch(() => [])).filter((name) => /^\d{16}\.jsonl$/.test(name)).sort();
|
||
const seenSequences = /* @__PURE__ */ new Set();
|
||
for (const segment of segments) {
|
||
for await (const line of readSessionLines(join28(journalDir, segment))) {
|
||
let record;
|
||
try {
|
||
record = object(JSON.parse(line));
|
||
} catch {
|
||
continue;
|
||
}
|
||
const sequence = count(record.sequence);
|
||
if (!sequence || seenSequences.has(sequence)) continue;
|
||
seenSequences.add(sequence);
|
||
const payload = object(record.payload);
|
||
if (record.type === "projection_advanced") {
|
||
addPoint(sequence, payload.snapshot);
|
||
if (sequence > snapshotSequence) {
|
||
entries.clear();
|
||
addEntries(object(object(payload.snapshot).history).entries);
|
||
}
|
||
} else if (record.type === "projection_delta") {
|
||
for (const value of array(payload.delta)) {
|
||
const op = object(value);
|
||
if (op.op === "set_envelope") addPoint(sequence, op.state);
|
||
if (sequence <= snapshotSequence) continue;
|
||
if (op.op === "append_entry" || op.op === "replace_entry") addEntries([op.entry]);
|
||
else if (op.op === "remove_entry") entries.delete(text(op.id));
|
||
else if (op.op === "set_history_entries") {
|
||
entries.clear();
|
||
addEntries(op.entries);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
const history = [...entries.values()].sort((a, b) => count(a.createdAt) - count(b.createdAt));
|
||
const steps = [];
|
||
let previous = { input: 0, output: 0, cached: 0 };
|
||
for (const point of [...points.values()].sort((a, b) => a.sequence - b.sequence)) {
|
||
const { usage } = point;
|
||
if (usage.input < previous.input || usage.output < previous.output || usage.cached < previous.cached) continue;
|
||
const delta = {
|
||
input: usage.input - previous.input,
|
||
output: usage.output - previous.output,
|
||
cached: Math.min(usage.input - previous.input, usage.cached - previous.cached)
|
||
};
|
||
const first = previous.input === 0 && previous.output === 0;
|
||
previous = usage;
|
||
if (delta.input || delta.output) steps.push({ point, delta, first });
|
||
}
|
||
const completions = array(runtime.actions).filter((value) => {
|
||
const action = object(value);
|
||
return action.kind === "completion" && action.state === "succeeded";
|
||
}).length;
|
||
const journalCalls = steps.filter((step) => !step.first && step.point.sequence <= snapshotSequence).length;
|
||
const prefixCalls = Math.max(1, completions - journalCalls);
|
||
const split = (total, index, parts) => Math.floor(total / parts) + (index < total % parts ? 1 : 0);
|
||
const calls = [];
|
||
const turnsWithTools = /* @__PURE__ */ new Set();
|
||
for (const { point, delta, first } of steps) {
|
||
const session = object(point.state.session);
|
||
const pointTime = count(session.updatedAt);
|
||
const turnId = text(object(point.state.latestTurn).id) || `${sessionId}:snapshot`;
|
||
const olderTurns = first ? [...new Set(history.filter((entry) => count(entry.createdAt) <= pointTime && (entry.role === "assistant" || entry.type === "effect")).map((entry) => text(entry.turnId)).filter(Boolean))] : [];
|
||
const turnIds = olderTurns.length ? olderTurns : [turnId];
|
||
const slots = first ? turnIds.flatMap((id, index) => Array(Math.max(1, split(prefixCalls, index, turnIds.length))).fill(id)) : turnIds;
|
||
for (const [index, id] of slots.entries()) {
|
||
const turnEntries = history.filter((entry) => entry.turnId === id);
|
||
const user = turnEntries.find((entry) => entry.role === "user");
|
||
const assistant = turnEntries.find((entry) => entry.role === "assistant" || entry.type === "effect");
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
if (!turnsWithTools.has(id)) {
|
||
turnsWithTools.add(id);
|
||
for (const entry of turnEntries) {
|
||
const detail = object(entry.detail);
|
||
const rawName = text(detail.toolName);
|
||
if (!rawName) continue;
|
||
const name = toolDisplayName(rawName.replace(/^.*\./, ""));
|
||
tools.push(name);
|
||
if (name === "Bash") {
|
||
const command = text(object(detail.input).command);
|
||
if (command) bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
}
|
||
}
|
||
const inputTokens = split(delta.input - delta.cached, index, slots.length);
|
||
const outputTokens = split(delta.output, index, slots.length);
|
||
const cacheReadInputTokens = split(delta.cached, index, slots.length);
|
||
calls.push({
|
||
provider: "mistral-vibe",
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheReadInputTokens,
|
||
cachedInputTokens: cacheReadInputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(model, inputTokens, outputTokens, 0, cacheReadInputTokens, 0),
|
||
costIsEstimated: true,
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [...new Set(bashCommands)],
|
||
timestamp: timestamp(first ? assistant?.createdAt ?? pointTime : pointTime, fallbackTime),
|
||
speed: "standard",
|
||
sessionId,
|
||
turnId: id,
|
||
deduplicationKey: `mistral-vibe:${sessionId}:unified:${point.sequence}:${id}:${index}`,
|
||
userMessage: (content(user?.content) || text(session.preview) || text(meta?.title)).slice(0, 500),
|
||
...projectPath ? { projectPath, workingDirectory: projectPath } : {}
|
||
});
|
||
}
|
||
}
|
||
return calls;
|
||
}
|
||
var init_mistral_vibe_unified = __esm({
|
||
"src/providers/mistral-vibe-unified.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
}
|
||
});
|
||
|
||
// src/providers/mistral-vibe.ts
|
||
import { readdir as readdir20, stat as stat20 } from "fs/promises";
|
||
import { basename as basename19, dirname as dirname11, join as join29 } from "path";
|
||
import { homedir as homedir25 } from "os";
|
||
function getMistralVibeSessionsDir(override) {
|
||
if (override) return override;
|
||
const configuredHome = process.env["VIBE_HOME"];
|
||
const vibeHome = configuredHome ? expandHome2(configuredHome) : join29(homedir25(), ".vibe");
|
||
return join29(vibeHome, "logs", "session");
|
||
}
|
||
function expandHome2(path) {
|
||
if (path === "~") return homedir25();
|
||
if (path.startsWith("~/")) return join29(homedir25(), path.slice(2));
|
||
return path;
|
||
}
|
||
async function isFile2(path) {
|
||
const s = await stat20(path).catch(() => null);
|
||
return Boolean(s?.isFile());
|
||
}
|
||
async function isDirectory(path) {
|
||
const s = await stat20(path).catch(() => null);
|
||
return Boolean(s?.isDirectory());
|
||
}
|
||
async function hasSessionFiles(dir) {
|
||
const [hasMetadata, hasMessages] = await Promise.all([
|
||
isFile2(join29(dir, METADATA_FILENAME)),
|
||
isFile2(join29(dir, MESSAGES_FILENAME))
|
||
]);
|
||
return hasMetadata && hasMessages;
|
||
}
|
||
async function readJsonFile(path) {
|
||
const raw = await readSessionFile(path);
|
||
if (raw === null) return null;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
return typeof parsed === "object" && parsed !== null ? parsed : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function discoverSessionDirs(root) {
|
||
const sessionDirs = [];
|
||
let entries;
|
||
try {
|
||
entries = (await readdir20(root)).sort();
|
||
} catch {
|
||
return sessionDirs;
|
||
}
|
||
for (const entry of entries) {
|
||
const dir = join29(root, entry);
|
||
if (!await isDirectory(dir)) continue;
|
||
if (await hasSessionFiles(dir)) {
|
||
sessionDirs.push(dir);
|
||
}
|
||
const agentsDir = join29(dir, "agents");
|
||
if (!await isDirectory(agentsDir)) continue;
|
||
let agentEntries;
|
||
try {
|
||
agentEntries = (await readdir20(agentsDir)).sort();
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const agentEntry of agentEntries) {
|
||
const agentDir = join29(agentsDir, agentEntry);
|
||
if (await isDirectory(agentDir) && await hasSessionFiles(agentDir)) {
|
||
sessionDirs.push(agentDir);
|
||
}
|
||
}
|
||
}
|
||
return sessionDirs;
|
||
}
|
||
async function configuredModel(sessionsDir) {
|
||
const raw = await readSessionFile(join29(sessionsDir, "..", "..", "config.toml"));
|
||
const topLevel = raw?.split(/^\s*\[/m)[0] ?? "";
|
||
return topLevel.match(/^\s*active_model\s*=\s*["']([^"']+)["']/m)?.[1] ?? DEFAULT_MODEL;
|
||
}
|
||
function activeModelConfig(metadata) {
|
||
const activeModel = metadata.config?.active_model;
|
||
const models = metadata.config?.models;
|
||
if (!activeModel || !Array.isArray(models)) return null;
|
||
return models.find((m) => m.alias === activeModel || m.name === activeModel) ?? null;
|
||
}
|
||
function resolveModel3(metadata) {
|
||
const activeModel = metadata.config?.active_model;
|
||
if (activeModel) return activeModel;
|
||
const configured = activeModelConfig(metadata);
|
||
return configured?.alias ?? configured?.name ?? DEFAULT_MODEL;
|
||
}
|
||
function calculateSessionCost(metadata, model, inputTokens, outputTokens) {
|
||
const stats = metadata.stats ?? {};
|
||
const sessionCost = safeNumber(stats.session_cost);
|
||
if (sessionCost > 0) return sessionCost;
|
||
const configured = activeModelConfig(metadata);
|
||
const inputPrice = safeNumber(stats.input_price_per_million) || safeNumber(configured?.input_price);
|
||
const outputPrice = safeNumber(stats.output_price_per_million) || safeNumber(configured?.output_price);
|
||
if (inputPrice > 0 || outputPrice > 0) {
|
||
return inputTokens / 1e6 * inputPrice + outputTokens / 1e6 * outputPrice;
|
||
}
|
||
return calculateCost(model, inputTokens, outputTokens, 0, 0, 0);
|
||
}
|
||
function normalizeContent(content2) {
|
||
if (typeof content2 === "string") return content2;
|
||
if (Array.isArray(content2)) {
|
||
return content2.map((part) => {
|
||
if (typeof part === "string") return part;
|
||
if (part && typeof part === "object" && "text" in part && typeof part.text === "string") return part.text;
|
||
return "";
|
||
}).filter(Boolean).join(" ");
|
||
}
|
||
return "";
|
||
}
|
||
function parseToolArguments2(raw) {
|
||
if (!raw) return {};
|
||
if (typeof raw === "object") return raw;
|
||
try {
|
||
const parsed = JSON.parse(raw);
|
||
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
||
} catch {
|
||
return {};
|
||
}
|
||
}
|
||
function extractMessageTools(message) {
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
if (message.role !== "assistant") return { tools, bashCommands };
|
||
for (const toolCall of message.tool_calls ?? []) {
|
||
const rawName = toolCall.function?.name;
|
||
if (!rawName) continue;
|
||
const mappedName = toolNameMap15[rawName] ?? rawName;
|
||
tools.push(mappedName);
|
||
if (mappedName !== "Bash") continue;
|
||
const args = parseToolArguments2(toolCall.function?.arguments);
|
||
const command = args["command"];
|
||
if (typeof command === "string") {
|
||
bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
}
|
||
return {
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [...new Set(bashCommands)]
|
||
};
|
||
}
|
||
function extractTools(messages) {
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
for (const message of messages) {
|
||
const extracted = extractMessageTools(message);
|
||
tools.push(...extracted.tools);
|
||
bashCommands.push(...extracted.bashCommands);
|
||
}
|
||
return {
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [...new Set(bashCommands)]
|
||
};
|
||
}
|
||
async function readMessages(path) {
|
||
const messages = [];
|
||
for await (const line of readSessionLines(path)) {
|
||
if (!line.trim()) continue;
|
||
try {
|
||
const parsed = JSON.parse(line);
|
||
if (parsed && typeof parsed === "object") messages.push(parsed);
|
||
} catch {
|
||
continue;
|
||
}
|
||
}
|
||
return messages;
|
||
}
|
||
function firstUserMessage4(messages, fallback) {
|
||
for (const message of messages) {
|
||
if (message.role !== "user") continue;
|
||
const text2 = normalizeContent(message.content).trim();
|
||
if (text2) return text2.slice(0, 500);
|
||
}
|
||
return (fallback ?? "").slice(0, 500);
|
||
}
|
||
function allocateInteger(total, index, count2) {
|
||
if (count2 <= 1) return total;
|
||
const base = Math.floor(total / count2);
|
||
const remainder = total % count2;
|
||
return base + (index < remainder ? 1 : 0);
|
||
}
|
||
function allocateCost(total, count2) {
|
||
return count2 <= 1 ? total : total / count2;
|
||
}
|
||
function createParser15(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const metadataPath = join29(source.path, METADATA_FILENAME);
|
||
const messagesPath = join29(source.path, MESSAGES_FILENAME);
|
||
const metadata = await readJsonFile(metadataPath);
|
||
if (!metadata) return;
|
||
const stats = metadata.stats ?? {};
|
||
const inputTokens = safeNumber(stats.session_prompt_tokens);
|
||
const outputTokens = safeNumber(stats.session_completion_tokens);
|
||
if (inputTokens === 0 && outputTokens === 0) return;
|
||
const sessionId = metadata.session_id || basename19(source.path);
|
||
const messages = await readMessages(messagesPath);
|
||
const model = resolveModel3(metadata);
|
||
const costUSD = calculateSessionCost(metadata, model, inputTokens, outputTokens);
|
||
const assistantMessages = messages.filter((m) => m.role === "assistant");
|
||
const fallbackTimestamp = metadata.end_time ?? metadata.start_time ?? "";
|
||
if (assistantMessages.length === 0) {
|
||
const deduplicationKey = `mistral-vibe:${sessionId}`;
|
||
if (seenKeys.has(deduplicationKey)) return;
|
||
seenKeys.add(deduplicationKey);
|
||
const { tools, bashCommands } = extractTools(messages);
|
||
yield {
|
||
provider: "mistral-vibe",
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools,
|
||
bashCommands,
|
||
timestamp: fallbackTimestamp,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
userMessage: firstUserMessage4(messages, metadata.title),
|
||
sessionId
|
||
};
|
||
return;
|
||
}
|
||
let currentUserMessage = (metadata.title ?? "").slice(0, 500);
|
||
let turnOrdinal = 0;
|
||
let currentTurnId = `${sessionId}:prelude`;
|
||
let assistantOrdinal = 0;
|
||
for (const message of messages) {
|
||
if (message.role === "user") {
|
||
const text2 = normalizeContent(message.content).trim();
|
||
if (text2) currentUserMessage = text2.slice(0, 500);
|
||
currentTurnId = `${sessionId}:turn-${turnOrdinal++}`;
|
||
continue;
|
||
}
|
||
if (message.role !== "assistant") continue;
|
||
const messageKey = message.message_id || `idx-${assistantOrdinal}`;
|
||
const deduplicationKey = `mistral-vibe:${sessionId}:${messageKey}`;
|
||
const allocationIndex = assistantOrdinal;
|
||
assistantOrdinal++;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
const { tools, bashCommands } = extractMessageTools(message);
|
||
yield {
|
||
provider: "mistral-vibe",
|
||
model,
|
||
inputTokens: allocateInteger(inputTokens, allocationIndex, assistantMessages.length),
|
||
outputTokens: allocateInteger(outputTokens, allocationIndex, assistantMessages.length),
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: allocateCost(costUSD, assistantMessages.length),
|
||
tools,
|
||
bashCommands,
|
||
timestamp: message.timestamp ?? fallbackTimestamp,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: currentTurnId,
|
||
userMessage: currentUserMessage,
|
||
sessionId
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createMistralVibeProvider(sessionsDir) {
|
||
const dir = getMistralVibeSessionsDir(sessionsDir);
|
||
const wslDirs = () => sessionsDir ? [] : wslHomes().map((home) => join29(home, ".vibe", "logs", "session"));
|
||
return {
|
||
name: "mistral-vibe",
|
||
displayName: "Mistral Vibe",
|
||
modelDisplayName(model) {
|
||
return modelDisplayNames5[model] ?? model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap15[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [dir, ...wslDirs()].map((path) => ({ path, label: "sessions" }));
|
||
},
|
||
async discoverSessions() {
|
||
const sources = [];
|
||
for (const root of [dir, ...wslDirs()]) sources.push(...await discoverRoot(root));
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
if (basename19(source.path) === "CURRENT") {
|
||
return { async *parse() {
|
||
const defaultModel = await configuredModel(dirname11(dirname11(dirname11(source.path))));
|
||
for (const call of await readUnifiedVibeCalls(source.path, (name) => toolNameMap15[name] ?? name, defaultModel)) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
} };
|
||
}
|
||
return createParser15(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
async function discoverRoot(dir) {
|
||
const dirs = await discoverSessionDirs(dir);
|
||
const sources = [];
|
||
for (const sessionDir of dirs) {
|
||
const metadata = await readJsonFile(join29(sessionDir, METADATA_FILENAME));
|
||
if (!metadata) continue;
|
||
const cwd = metadata.environment?.working_directory;
|
||
sources.push({
|
||
path: sessionDir,
|
||
project: cwd ? basename19(cwd) : basename19(sessionDir),
|
||
provider: "mistral-vibe"
|
||
});
|
||
}
|
||
const unifiedDir = join29(dir, "unified");
|
||
for (const entry of (await readdir20(unifiedDir).catch(() => [])).sort()) {
|
||
const sessionDir = join29(unifiedDir, entry);
|
||
const currentPath = join29(sessionDir, "CURRENT");
|
||
if (!await isFile2(currentPath)) continue;
|
||
const metadata = await readJsonFile(join29(sessionDir, METADATA_FILENAME));
|
||
const cwd = metadata?.environment?.working_directory;
|
||
sources.push({ path: currentPath, project: cwd ? basename19(cwd) : entry, provider: "mistral-vibe" });
|
||
}
|
||
return sources;
|
||
}
|
||
var METADATA_FILENAME, MESSAGES_FILENAME, DEFAULT_MODEL, modelDisplayNames5, toolNameMap15, mistralVibe;
|
||
var init_mistral_vibe = __esm({
|
||
"src/providers/mistral-vibe.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_parser();
|
||
init_wsl();
|
||
init_mistral_vibe_unified();
|
||
METADATA_FILENAME = "meta.json";
|
||
MESSAGES_FILENAME = "messages.jsonl";
|
||
DEFAULT_MODEL = "mistral-medium-3.5";
|
||
modelDisplayNames5 = {
|
||
"mistral-medium-3.5": "Mistral Medium 3.5",
|
||
"mistral-vibe-cli-latest": "Mistral Vibe CLI",
|
||
"devstral-small": "Devstral Small",
|
||
"devstral-small-latest": "Devstral Small",
|
||
devstral: "Devstral",
|
||
local: "Local"
|
||
};
|
||
toolNameMap15 = {
|
||
bash: "Bash",
|
||
read_file: "Read",
|
||
write_file: "Write",
|
||
search_replace: "Edit",
|
||
grep: "Grep",
|
||
task: "Agent",
|
||
todo: "TodoWrite",
|
||
skill: "Skill",
|
||
web_fetch: "WebFetch",
|
||
web_search: "WebSearch",
|
||
ask_user_question: "AskUser",
|
||
exit_plan_mode: "ExitPlanMode"
|
||
};
|
||
mistralVibe = createMistralVibeProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/mux.ts
|
||
import { readdir as readdir21, readFile as readFile12, stat as stat21 } from "fs/promises";
|
||
import { basename as basename20, dirname as dirname12, join as join30, resolve as resolve6 } from "path";
|
||
import { homedir as homedir26 } from "os";
|
||
function expandHome3(p) {
|
||
if (p === "~") return homedir26();
|
||
if (p.startsWith("~/") || p.startsWith("~\\")) return join30(homedir26(), p.slice(2));
|
||
return p;
|
||
}
|
||
function getMuxRoot(override) {
|
||
if (override) return resolve6(expandHome3(override));
|
||
const codeburnOverride = process.env["CODEBURN_MUX_DIR"];
|
||
if (codeburnOverride) return resolve6(expandHome3(codeburnOverride));
|
||
const muxRoot = process.env["MUX_ROOT"];
|
||
if (muxRoot) return resolve6(expandHome3(muxRoot));
|
||
return join30(homedir26(), ".mux");
|
||
}
|
||
function stripProvider(model) {
|
||
const i = model.indexOf(":");
|
||
return i >= 0 ? model.slice(i + 1) : model;
|
||
}
|
||
function asRecord2(v) {
|
||
return v !== null && typeof v === "object" ? v : void 0;
|
||
}
|
||
function toIsoTimestamp(ts, createdAt) {
|
||
if (typeof ts === "number" && Number.isFinite(ts)) {
|
||
const d = new Date(ts);
|
||
if (!Number.isNaN(d.getTime())) return d.toISOString();
|
||
}
|
||
return typeof createdAt === "string" ? createdAt : "";
|
||
}
|
||
async function loadProjectMap(root) {
|
||
const map = /* @__PURE__ */ new Map();
|
||
let data;
|
||
try {
|
||
data = JSON.parse(await readFile12(join30(root, "config.json"), "utf-8"));
|
||
} catch {
|
||
return map;
|
||
}
|
||
const projects = asRecord2(data)?.["projects"];
|
||
if (!Array.isArray(projects)) return map;
|
||
for (const pair of projects) {
|
||
if (!Array.isArray(pair) || pair.length < 2) continue;
|
||
const projectPath = pair[0];
|
||
if (typeof projectPath !== "string") continue;
|
||
const label = basename20(projectPath) || projectPath;
|
||
const workspaces = asRecord2(pair[1])?.["workspaces"];
|
||
if (!Array.isArray(workspaces)) continue;
|
||
for (const ws of workspaces) {
|
||
const id = asRecord2(ws)?.["id"];
|
||
if (typeof id === "string" && id) map.set(id, label);
|
||
}
|
||
}
|
||
return map;
|
||
}
|
||
async function pushChatSource(sources, chatPath, project) {
|
||
const s = await stat21(chatPath).catch(() => null);
|
||
if (s?.isFile()) sources.push({ path: chatPath, project, provider: "mux" });
|
||
}
|
||
async function discoverSessions3(root) {
|
||
const sessionsDir = join30(root, "sessions");
|
||
let workspaceIds;
|
||
try {
|
||
workspaceIds = await readdir21(sessionsDir);
|
||
} catch {
|
||
return [];
|
||
}
|
||
const projectMap = await loadProjectMap(root);
|
||
const sources = [];
|
||
for (const workspaceId of workspaceIds) {
|
||
const workspaceDir = join30(sessionsDir, workspaceId);
|
||
const project = projectMap.get(workspaceId) ?? workspaceId;
|
||
await pushChatSource(sources, join30(workspaceDir, "chat.jsonl"), project);
|
||
const subagentDir = join30(workspaceDir, "subagent-transcripts");
|
||
let childTaskIds;
|
||
try {
|
||
childTaskIds = await readdir21(subagentDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const childTaskId of childTaskIds) {
|
||
await pushChatSource(sources, join30(subagentDir, childTaskId, "chat.jsonl"), project);
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function createParser16(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const workspaceId = basename20(dirname12(source.path));
|
||
let pendingUserMessage = "";
|
||
let lineIdx = 0;
|
||
for await (const line of readSessionLines(source.path)) {
|
||
lineIdx++;
|
||
let msg;
|
||
try {
|
||
msg = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (!msg || typeof msg !== "object") continue;
|
||
if (msg.role === "user") {
|
||
const texts = (Array.isArray(msg.parts) ? msg.parts : []).filter((p) => p?.type === "text" && typeof p.text === "string").map((p) => p.text).filter(Boolean);
|
||
if (texts.length > 0) pendingUserMessage = texts.join(" ").slice(0, 500);
|
||
continue;
|
||
}
|
||
if (msg.role !== "assistant") continue;
|
||
const meta = msg.metadata;
|
||
const usage = asRecord2(meta?.usage);
|
||
if (!meta || !usage) continue;
|
||
const pm = meta.providerMetadata ?? {};
|
||
const anthropic = asRecord2(pm["anthropic"]);
|
||
const cacheRead = safeNumber(usage["cachedInputTokens"]);
|
||
const cacheCreate = safeNumber(anthropic?.["cacheCreationInputTokens"]);
|
||
const reasoning = safeNumber(usage["reasoningTokens"]);
|
||
const inputTokens = Math.max(0, safeNumber(usage["inputTokens"]) - cacheRead - cacheCreate);
|
||
const outputTokens = Math.max(0, safeNumber(usage["outputTokens"]) - reasoning);
|
||
if (inputTokens === 0 && outputTokens === 0 && cacheRead === 0 && cacheCreate === 0 && reasoning === 0) {
|
||
continue;
|
||
}
|
||
const rawModel = typeof meta.model === "string" && meta.model ? meta.model : "unknown";
|
||
const model = stripProvider(rawModel);
|
||
const id = typeof msg.id === "string" && msg.id ? msg.id : `L${lineIdx}`;
|
||
const dedupKey = `mux:${workspaceId}:${id}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const toolParts = (Array.isArray(msg.parts) ? msg.parts : []).filter(
|
||
(p) => p?.type === "dynamic-tool" && typeof p.toolName === "string"
|
||
);
|
||
const tools = toolParts.map((p) => toolNameMap16[p.toolName] ?? p.toolName);
|
||
const bashCommands = toolParts.filter((p) => p.toolName === "bash").flatMap((p) => {
|
||
const input = asRecord2(p.input);
|
||
const script = input?.["script"] ?? input?.["command"];
|
||
return typeof script === "string" ? extractBashCommands(script) : [];
|
||
});
|
||
const costUSD = calculateCost(
|
||
model,
|
||
inputTokens,
|
||
outputTokens + reasoning,
|
||
cacheCreate,
|
||
cacheRead,
|
||
0
|
||
);
|
||
const timestamp2 = toIsoTimestamp(meta.timestamp, msg.createdAt);
|
||
yield {
|
||
provider: "mux",
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheCreate,
|
||
cacheReadInputTokens: cacheRead,
|
||
cachedInputTokens: cacheRead,
|
||
reasoningTokens: reasoning,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools,
|
||
bashCommands,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId: workspaceId
|
||
};
|
||
pendingUserMessage = "";
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createMuxProvider(muxRoot) {
|
||
const root = getMuxRoot(muxRoot);
|
||
return {
|
||
name: "mux",
|
||
displayName: "Mux",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(stripProvider(model));
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap16[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: root, label: "root" }];
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessions3(root);
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser16(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap16, mux;
|
||
var init_mux = __esm({
|
||
"src/providers/mux.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_parser();
|
||
toolNameMap16 = {
|
||
bash: "Bash",
|
||
file_read: "Read",
|
||
file_edit_replace_string: "Edit",
|
||
file_edit_replace_lines: "Edit",
|
||
file_edit_insert: "Edit",
|
||
file_edit_operation: "Edit",
|
||
web_fetch: "WebFetch",
|
||
web_search: "WebSearch",
|
||
task: "Agent",
|
||
todo: "TodoWrite"
|
||
};
|
||
mux = createMuxProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/openclaw.ts
|
||
import { readdir as readdir22, readFile as readFile13, stat as stat22 } from "fs/promises";
|
||
import { basename as basename21, join as join31 } from "path";
|
||
import { homedir as homedir27 } from "os";
|
||
import { createHash as createHash4 } from "crypto";
|
||
import zlib2 from "zlib";
|
||
function newState() {
|
||
return { sessionId: "", sessionTimestamp: "", currentModel: "", pendingUserMessage: "", calls: [], idLessCounts: /* @__PURE__ */ new Map() };
|
||
}
|
||
function consumeEvent(state, entry, rowCreatedAtMs) {
|
||
if (entry.type === "session") {
|
||
state.sessionId = entry.id ?? state.sessionId;
|
||
state.sessionTimestamp = entry.timestamp ?? "";
|
||
return;
|
||
}
|
||
if (entry.type === "model_change") {
|
||
state.currentModel = entry.modelId ?? state.currentModel;
|
||
return;
|
||
}
|
||
if (entry.type === "custom" && entry.customType === "model-snapshot") {
|
||
state.currentModel = entry.data?.modelId ?? state.currentModel;
|
||
return;
|
||
}
|
||
if (entry.type !== "message" || !entry.message) return;
|
||
const msg = entry.message;
|
||
if (msg.role === "user") {
|
||
if (!state.pendingUserMessage && Array.isArray(msg.content)) {
|
||
const textBlock = msg.content.find((c) => c.type === "text" && c.text);
|
||
state.pendingUserMessage = (textBlock?.text ?? "").slice(0, 500);
|
||
}
|
||
return;
|
||
}
|
||
if (msg.role !== "assistant") return;
|
||
const model = msg.model ?? state.currentModel;
|
||
if (msg.usage) {
|
||
const { tools, bashCommands } = extractTools2(msg.content);
|
||
let timestamp2 = entry.timestamp ?? state.sessionTimestamp;
|
||
if (!timestamp2 && rowCreatedAtMs !== void 0) timestamp2 = new Date(rowCreatedAtMs).toISOString();
|
||
let dedupId = entry.id;
|
||
if (!dedupId) {
|
||
const hash = createHash4("sha256").update(JSON.stringify([
|
||
model,
|
||
entry.timestamp ?? state.sessionTimestamp,
|
||
msg.usage.input,
|
||
msg.usage.output,
|
||
msg.usage.cacheRead,
|
||
msg.usage.cacheWrite,
|
||
msg.usage.cost?.total ?? 0,
|
||
tools,
|
||
bashCommands
|
||
])).digest("hex").slice(0, 16);
|
||
const n = state.idLessCounts.get(hash) ?? 0;
|
||
state.idLessCounts.set(hash, n + 1);
|
||
dedupId = `h:${hash}:${n}`;
|
||
}
|
||
state.calls.push({
|
||
model,
|
||
usage: msg.usage,
|
||
tools,
|
||
bashCommands,
|
||
timestamp: timestamp2,
|
||
...rowCreatedAtMs !== void 0 ? { createdAtMs: rowCreatedAtMs } : {},
|
||
userMessage: state.pendingUserMessage,
|
||
dedupId
|
||
});
|
||
state.pendingUserMessage = "";
|
||
}
|
||
}
|
||
async function* finalizeCalls(state, defaultSessionId, fallbackTs, seenKeys) {
|
||
const sessionId = state.sessionId || defaultSessionId;
|
||
for (let i = 0; i < state.calls.length; i++) {
|
||
const call = state.calls[i];
|
||
const dedupKey = `openclaw:${sessionId}:${call.dedupId || i}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const u = call.usage;
|
||
const costFromProvider = u.cost?.total ?? 0;
|
||
const isReported = costFromProvider > 0;
|
||
const costUSD = isReported ? costFromProvider : calculateCost(call.model, u.input, u.output, u.cacheWrite, u.cacheRead, 0);
|
||
let ts = new Date(call.timestamp);
|
||
if (isNaN(ts.getTime()) || ts.getTime() < 1e12) {
|
||
ts = call.createdAtMs !== void 0 ? new Date(call.createdAtMs) : fallbackTs;
|
||
}
|
||
if (isNaN(ts.getTime()) || ts.getTime() < 1e12) ts = fallbackTs;
|
||
if (isNaN(ts.getTime()) || ts.getTime() < 1e12) continue;
|
||
yield {
|
||
provider: "openclaw",
|
||
model: call.model || "openclaw-auto",
|
||
inputTokens: u.input,
|
||
outputTokens: u.output,
|
||
cacheCreationInputTokens: u.cacheWrite,
|
||
cacheReadInputTokens: u.cacheRead,
|
||
cachedInputTokens: u.cacheRead,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
...isReported ? { costFromBilling: true } : {},
|
||
tools: [...new Set(call.tools)],
|
||
bashCommands: [...new Set(call.bashCommands)],
|
||
timestamp: ts.toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: call.userMessage,
|
||
sessionId
|
||
};
|
||
}
|
||
}
|
||
function getOpenClawDirs() {
|
||
const home = homedir27();
|
||
return [
|
||
join31(home, ".openclaw", "agents"),
|
||
join31(home, ".clawdbot", "agents"),
|
||
join31(home, ".moltbot", "agents"),
|
||
join31(home, ".moldbot", "agents")
|
||
];
|
||
}
|
||
function extractTools2(content2) {
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
if (!content2) return { tools, bashCommands };
|
||
for (const block of content2) {
|
||
if ((block.type === "tool_use" || block.type === "toolCall") && block.name) {
|
||
const mapped = toolNameMap17[block.name] ?? block.name;
|
||
tools.push(mapped);
|
||
if (mapped === "Bash" && block.arguments && typeof block.arguments.command === "string") {
|
||
bashCommands.push(...extractBashCommands(block.arguments.command));
|
||
}
|
||
}
|
||
}
|
||
return { tools, bashCommands };
|
||
}
|
||
function createJsonlParser2(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
if (raw === null) return;
|
||
const state = newState();
|
||
for (const line of raw.split("\n")) {
|
||
if (!line.trim()) continue;
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
consumeEvent(state, entry);
|
||
}
|
||
const fileStat = await stat22(source.path).catch(() => null);
|
||
const fileMtime = fileStat ? fileStat.mtime : /* @__PURE__ */ new Date(NaN);
|
||
yield* finalizeCalls(state, basename21(source.path, ".jsonl"), fileMtime, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
function sqliteNotice(message) {
|
||
if (sqliteNoticeSent.has(message)) return;
|
||
sqliteNoticeSent.add(message);
|
||
process.stderr.write(message);
|
||
}
|
||
function transcriptHasZstdColumn(db) {
|
||
try {
|
||
const columns = db.query("PRAGMA table_info(transcript_events)");
|
||
return columns.some((c) => c.name === "event_zstd");
|
||
} catch {
|
||
return false;
|
||
}
|
||
}
|
||
function decodeEventPayload(row, dbPath) {
|
||
if (typeof row.event_json === "string") return row.event_json;
|
||
if (row.event_zstd == null || !(row.event_zstd instanceof Uint8Array)) return null;
|
||
if (!zstdDecompressSync) {
|
||
sqliteNotice(
|
||
`codeburn: openclaw: ${dbPath} stores compressed transcript rows; counting them needs Node 22.15+ (node:zlib zstd)
|
||
`
|
||
);
|
||
return null;
|
||
}
|
||
try {
|
||
return zstdDecompressSync(row.event_zstd, { maxOutputLength: MAX_EVENT_DECODED_BYTES }).toString("utf-8");
|
||
} catch {
|
||
sqliteNotice(`codeburn: openclaw: ${dbPath} has compressed transcript rows that fail to decode; skipping them
|
||
`);
|
||
return null;
|
||
}
|
||
}
|
||
function splitSqliteSource(path) {
|
||
const idx = path.lastIndexOf(":");
|
||
if (idx < 0) return null;
|
||
return { dbPath: path.slice(0, idx), sessionId: path.slice(idx + 1) };
|
||
}
|
||
function createSqliteParser(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
if (!isSqliteAvailable()) {
|
||
process.stderr.write(getSqliteLoadError() + "\n");
|
||
return;
|
||
}
|
||
const split = splitSqliteSource(source.path);
|
||
if (!split) return;
|
||
let db;
|
||
try {
|
||
db = openDatabase(split.dbPath);
|
||
} catch {
|
||
return;
|
||
}
|
||
const state = newState();
|
||
try {
|
||
const zstdColumn = transcriptHasZstdColumn(db) ? ", event_zstd" : "";
|
||
let lastSeq = -1;
|
||
for (; ; ) {
|
||
const rows = db.query(
|
||
`SELECT seq, event_json${zstdColumn}, created_at
|
||
FROM transcript_events
|
||
WHERE session_id = ? AND seq > ?
|
||
ORDER BY seq
|
||
LIMIT ?`,
|
||
[split.sessionId, lastSeq, TRANSCRIPT_BATCH_ROWS]
|
||
);
|
||
for (const row of rows) {
|
||
lastSeq = Number(row.seq);
|
||
const payload = decodeEventPayload(row, split.dbPath);
|
||
if (payload === null) continue;
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(payload);
|
||
} catch {
|
||
continue;
|
||
}
|
||
consumeEvent(state, entry, Number(row.created_at));
|
||
}
|
||
if (rows.length < TRANSCRIPT_BATCH_ROWS) break;
|
||
}
|
||
} finally {
|
||
db.close();
|
||
}
|
||
const fileStat = await stat22(split.dbPath).catch(() => null);
|
||
const fileMtime = fileStat ? fileStat.mtime : /* @__PURE__ */ new Date(NaN);
|
||
yield* finalizeCalls(state, split.sessionId, fileMtime, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
async function discoverSqliteSessions2(agentsDir, agent) {
|
||
const dbPath = join31(agentsDir, agent, "agent", "openclaw-agent.sqlite");
|
||
const dbStat = await stat22(dbPath).catch(() => null);
|
||
if (!dbStat) return { sources: [], sessionIds: /* @__PURE__ */ new Set() };
|
||
if (!isSqliteAvailable()) {
|
||
sqliteNotice(getSqliteLoadError() + "\n");
|
||
return { sources: [], sessionIds: /* @__PURE__ */ new Set() };
|
||
}
|
||
let db;
|
||
try {
|
||
db = openDatabase(dbPath);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return { sources: [], sessionIds: /* @__PURE__ */ new Set() };
|
||
}
|
||
try {
|
||
const rows = db.query(
|
||
"SELECT session_id FROM transcript_events GROUP BY session_id ORDER BY session_id"
|
||
);
|
||
const sources = [];
|
||
const sessionIds = /* @__PURE__ */ new Set();
|
||
for (const row of rows) {
|
||
if (typeof row.session_id !== "string" || !row.session_id) continue;
|
||
sessionIds.add(row.session_id);
|
||
sources.push({ path: `${dbPath}:${row.session_id}`, project: agent, provider: "openclaw" });
|
||
}
|
||
return { sources, sessionIds };
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return { sources: [], sessionIds: /* @__PURE__ */ new Set() };
|
||
} finally {
|
||
db.close();
|
||
}
|
||
}
|
||
async function discoverInDir2(agentsDir) {
|
||
const sources = [];
|
||
let agentDirs;
|
||
try {
|
||
const entries = await readdir22(agentsDir, { withFileTypes: true });
|
||
agentDirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const agent of agentDirs) {
|
||
const sessionsDir = join31(agentsDir, agent, "sessions");
|
||
let indexData = {};
|
||
try {
|
||
const indexRaw = await readFile13(join31(sessionsDir, "sessions.json"), "utf-8");
|
||
indexData = JSON.parse(indexRaw);
|
||
} catch {
|
||
}
|
||
const seenFiles = /* @__PURE__ */ new Set();
|
||
const jsonlSources = [];
|
||
for (const entry of Object.values(indexData)) {
|
||
if (entry.sessionFile) {
|
||
seenFiles.add(entry.sessionFile);
|
||
jsonlSources.push({ source: { path: entry.sessionFile, project: agent, provider: "openclaw" }, sessionId: entry.sessionId });
|
||
} else if (entry.sessionId) {
|
||
const filePath = join31(sessionsDir, `${entry.sessionId}.jsonl`);
|
||
seenFiles.add(filePath);
|
||
jsonlSources.push({ source: { path: filePath, project: agent, provider: "openclaw" }, sessionId: entry.sessionId });
|
||
}
|
||
}
|
||
try {
|
||
const files = await readdir22(sessionsDir);
|
||
for (const f of files) {
|
||
if (!f.endsWith(".jsonl")) continue;
|
||
const filePath = join31(sessionsDir, f);
|
||
if (seenFiles.has(filePath)) continue;
|
||
jsonlSources.push({ source: { path: filePath, project: agent, provider: "openclaw" }, sessionId: basename21(f, ".jsonl") });
|
||
}
|
||
} catch {
|
||
}
|
||
const sqlite = await discoverSqliteSessions2(agentsDir, agent);
|
||
for (const { source, sessionId } of jsonlSources) {
|
||
if (sqlite.sessionIds.has(sessionId)) continue;
|
||
sources.push(source);
|
||
}
|
||
sources.push(...sqlite.sources);
|
||
}
|
||
return sources;
|
||
}
|
||
function createOpenClawProvider(overrideDir) {
|
||
return {
|
||
name: "openclaw",
|
||
displayName: "OpenClaw",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap17[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
const roots = overrideDir ? [overrideDir] : getOpenClawDirs();
|
||
return roots.map((path) => ({ path, label: "agents" }));
|
||
},
|
||
async discoverSessions() {
|
||
if (overrideDir) return discoverInDir2(overrideDir);
|
||
const all = [];
|
||
for (const dir of getOpenClawDirs()) {
|
||
const sessions = await discoverInDir2(dir);
|
||
all.push(...sessions);
|
||
}
|
||
return all;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return source.path.endsWith(".jsonl") ? createJsonlParser2(source, seenKeys) : createSqliteParser(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap17, zstdDecompressSync, MAX_EVENT_DECODED_BYTES, sqliteNoticeSent, TRANSCRIPT_BATCH_ROWS, openclaw;
|
||
var init_openclaw = __esm({
|
||
"src/providers/openclaw.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_sqlite();
|
||
toolNameMap17 = {
|
||
bash: "Bash",
|
||
exec: "Bash",
|
||
read: "Read",
|
||
edit: "Edit",
|
||
write: "Write",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
task: "Agent",
|
||
dispatch_agent: "Agent",
|
||
fetch: "WebFetch",
|
||
search: "WebSearch",
|
||
todo: "TodoWrite",
|
||
patch: "Patch"
|
||
};
|
||
zstdDecompressSync = zlib2.zstdDecompressSync;
|
||
MAX_EVENT_DECODED_BYTES = 8 * 1024 * 1024;
|
||
sqliteNoticeSent = /* @__PURE__ */ new Set();
|
||
TRANSCRIPT_BATCH_ROWS = 2e3;
|
||
openclaw = createOpenClawProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/openclaude.ts
|
||
import { readdir as readdir23 } from "fs/promises";
|
||
import { homedir as homedir28 } from "os";
|
||
import { basename as basename22, join as join32 } from "path";
|
||
function openClaudeRootDir() {
|
||
return process.env["CODEBURN_OPENCLAUDE_DIR"]?.trim() || join32(homedir28(), ".openclaude");
|
||
}
|
||
function getOpenClaudeProjectsDir() {
|
||
return join32(openClaudeRootDir(), "projects");
|
||
}
|
||
function isRecord5(value) {
|
||
return value !== null && typeof value === "object" && !Array.isArray(value);
|
||
}
|
||
function nonEmptyString4(value) {
|
||
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
||
}
|
||
function safeNonNegativeNumber3(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
||
}
|
||
function safeTokenCount3(value) {
|
||
return Math.floor(Math.min(safeNonNegativeNumber3(value), Number.MAX_SAFE_INTEGER));
|
||
}
|
||
function isoTimestamp3(value, fallback) {
|
||
if (typeof value === "number" && Number.isFinite(value) && value > 0) {
|
||
const ms = value < MIN_REASONABLE_TIMESTAMP_MS4 ? value * 1e3 : value;
|
||
const date = new Date(ms);
|
||
if (!Number.isNaN(date.getTime()) && date.getTime() >= MIN_REASONABLE_TIMESTAMP_MS4) {
|
||
return date.toISOString();
|
||
}
|
||
}
|
||
const parsed = nonEmptyString4(value);
|
||
if (parsed) {
|
||
const date = new Date(parsed);
|
||
if (!Number.isNaN(date.getTime())) return date.toISOString();
|
||
}
|
||
return fallback;
|
||
}
|
||
function firstString3(input, keys) {
|
||
if (!isRecord5(input)) return void 0;
|
||
for (const key of keys) {
|
||
const value = nonEmptyString4(input[key]);
|
||
if (value) return value;
|
||
}
|
||
return void 0;
|
||
}
|
||
function collectTools4(content2) {
|
||
const collected = {
|
||
tools: [],
|
||
bashCommands: [],
|
||
toolSequence: [],
|
||
skills: [],
|
||
subagentTypes: []
|
||
};
|
||
if (!Array.isArray(content2)) return collected;
|
||
const turnTools = [];
|
||
for (const block of content2) {
|
||
if (!isRecord5(block) || block["type"] !== "tool_use") continue;
|
||
const name = nonEmptyString4(block["name"]);
|
||
if (!name) continue;
|
||
const input = block["input"];
|
||
const toolCall = { tool: name };
|
||
const file = firstString3(input, ["path", "file_path", "paths", "file"]);
|
||
if (file) toolCall.file = file;
|
||
if (name === "Bash") {
|
||
const command = firstString3(input, ["command"]);
|
||
if (command) {
|
||
toolCall.command = command;
|
||
collected.bashCommands.push(...extractBashCommands(command));
|
||
}
|
||
}
|
||
if (name === "Skill") {
|
||
const skill = firstString3(input, ["name", "skill"]);
|
||
if (skill) collected.skills.push(skill);
|
||
}
|
||
if (name === "Task") {
|
||
const subagentType = firstString3(input, ["subagent_type"]);
|
||
if (subagentType) collected.subagentTypes.push(subagentType);
|
||
}
|
||
collected.tools.push(name);
|
||
turnTools.push(toolCall);
|
||
}
|
||
if (turnTools.length > 0) collected.toolSequence.push(turnTools);
|
||
return collected;
|
||
}
|
||
function textFromContent2(content2) {
|
||
if (typeof content2 === "string") return content2;
|
||
if (!Array.isArray(content2)) return "";
|
||
for (const block of content2) {
|
||
if (!isRecord5(block) || block["type"] !== "text") continue;
|
||
const text2 = nonEmptyString4(block["text"]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function firstUserMessage5(lines) {
|
||
for (const line of lines) {
|
||
if (!isRecord5(line) || line["type"] !== "user") continue;
|
||
const message = line["message"];
|
||
if (!isRecord5(message)) continue;
|
||
const text2 = textFromContent2(message["content"]);
|
||
if (text2) return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function projectFromCwd2(cwd) {
|
||
const parts = cwd.replace(/[\\/]+$/, "").split(/[\\/]/).filter(Boolean);
|
||
return parts.at(-1);
|
||
}
|
||
function createParser17(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
if (raw === null) return;
|
||
const parsedLines = [];
|
||
for (const line of raw.split("\n")) {
|
||
if (!line.trim()) continue;
|
||
try {
|
||
parsedLines.push(JSON.parse(line));
|
||
} catch {
|
||
}
|
||
}
|
||
let fileTimestamp = (/* @__PURE__ */ new Date(0)).toISOString();
|
||
for (const line of parsedLines) {
|
||
if (!isRecord5(line)) continue;
|
||
const ts = nonEmptyString4(line["timestamp"]);
|
||
if (!ts) continue;
|
||
const date = new Date(ts);
|
||
if (Number.isNaN(date.getTime())) continue;
|
||
fileTimestamp = date.toISOString();
|
||
break;
|
||
}
|
||
const userMessage = firstUserMessage5(parsedLines);
|
||
let firstSeenCwd;
|
||
for (const line of parsedLines) {
|
||
if (!isRecord5(line)) continue;
|
||
const cwd = nonEmptyString4(line["cwd"]);
|
||
if (!cwd) continue;
|
||
firstSeenCwd = cwd;
|
||
break;
|
||
}
|
||
const project = firstSeenCwd ? projectFromCwd2(firstSeenCwd) ?? source.project : source.project;
|
||
for (const [index, line] of parsedLines.entries()) {
|
||
if (!isRecord5(line) || line["type"] !== "assistant") continue;
|
||
const message = line["message"];
|
||
if (!isRecord5(message)) continue;
|
||
const usage = message["usage"];
|
||
if (!isRecord5(usage)) continue;
|
||
const inputTokens = safeTokenCount3(usage["input_tokens"]);
|
||
const outputTokens = safeTokenCount3(usage["output_tokens"]);
|
||
const cacheWriteTokens = safeTokenCount3(usage["cache_creation_input_tokens"]);
|
||
const cacheReadTokens = safeTokenCount3(usage["cache_read_input_tokens"]);
|
||
const webSearchRequests = safeTokenCount3(
|
||
isRecord5(usage["server_tool_use"]) ? usage["server_tool_use"]["web_search_requests"] : void 0
|
||
);
|
||
const model = nonEmptyString4(message["model"]) ?? "unknown";
|
||
const sessionId = nonEmptyString4(line["sessionId"]) ?? basename22(source.path).replace(/\.jsonl$/, "");
|
||
const messageId = nonEmptyString4(message["id"]) ?? nonEmptyString4(line["uuid"]) ?? String(index);
|
||
const deduplicationKey = `${PROVIDER_NAME4}:${sessionId}:${messageId}`;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
const { tools, bashCommands, toolSequence, skills, subagentTypes } = collectTools4(message["content"]);
|
||
yield {
|
||
provider: PROVIDER_NAME4,
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: cacheWriteTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests,
|
||
costUSD: calculateCost(model, inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, 0),
|
||
costIsEstimated: true,
|
||
tools,
|
||
bashCommands,
|
||
skills: skills.length > 0 ? skills : void 0,
|
||
subagentTypes: subagentTypes.length > 0 ? subagentTypes : void 0,
|
||
timestamp: isoTimestamp3(line["timestamp"], fileTimestamp),
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
turnId: `${sessionId}:${messageId}`,
|
||
toolSequence: toolSequence.length > 0 ? toolSequence : void 0,
|
||
userMessage,
|
||
sessionId,
|
||
project,
|
||
projectPath: firstSeenCwd,
|
||
workingDirectory: nonEmptyString4(line["cwd"])
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createOpenClaudeProvider(overrideProjectsDir) {
|
||
const projectsDir = () => overrideProjectsDir ?? getOpenClaudeProjectsDir();
|
||
return {
|
||
name: PROVIDER_NAME4,
|
||
displayName: DISPLAY_NAME3,
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: projectsDir(), label: "projects" }];
|
||
},
|
||
async discoverSessions() {
|
||
const dir = projectsDir();
|
||
const projectEntries = await readdir23(dir, { withFileTypes: true }).catch(() => []);
|
||
const sources = [];
|
||
for (const projectEntry of projectEntries.sort((a, b) => a.name.localeCompare(b.name))) {
|
||
if (!projectEntry.isDirectory()) continue;
|
||
const projectDir = join32(dir, projectEntry.name);
|
||
const fileEntries = await readdir23(projectDir, { withFileTypes: true }).catch(() => []);
|
||
for (const fileEntry of fileEntries.sort((a, b) => a.name.localeCompare(b.name))) {
|
||
if (!fileEntry.isFile()) continue;
|
||
if (!fileEntry.name.endsWith(".jsonl")) continue;
|
||
sources.push({
|
||
path: join32(projectDir, fileEntry.name),
|
||
// The whole slug is the discovery-time fallback; parse-time
|
||
// project naming prefers the basename of the first cwd seen in
|
||
// the transcript.
|
||
project: projectEntry.name,
|
||
provider: PROVIDER_NAME4
|
||
});
|
||
}
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser17(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var PROVIDER_NAME4, DISPLAY_NAME3, MIN_REASONABLE_TIMESTAMP_MS4, openclaude;
|
||
var init_openclaude = __esm({
|
||
"src/providers/openclaude.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_fs_utils();
|
||
init_models();
|
||
PROVIDER_NAME4 = "openclaude";
|
||
DISPLAY_NAME3 = "OpenClaude";
|
||
MIN_REASONABLE_TIMESTAMP_MS4 = 1e12;
|
||
openclaude = createOpenClaudeProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/open-design.ts
|
||
import { readdir as readdir24, stat as stat23 } from "fs/promises";
|
||
import { basename as basename23, dirname as dirname13, join as join33 } from "path";
|
||
import { homedir as homedir29, platform as platform2 } from "os";
|
||
function isRecord6(value) {
|
||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||
}
|
||
function stringValue2(value) {
|
||
return typeof value === "string" && value.length > 0 ? value : void 0;
|
||
}
|
||
function tokenValue(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
|
||
}
|
||
function timestampValue(value) {
|
||
const text2 = stringValue2(value);
|
||
if (text2) return text2;
|
||
if (typeof value !== "number" || !Number.isFinite(value)) return "";
|
||
const date = new Date(value);
|
||
return Number.isNaN(date.getTime()) ? "" : date.toISOString();
|
||
}
|
||
function parseEvent(line) {
|
||
const text2 = (typeof line === "string" ? line : line.toString("utf-8")).trim();
|
||
if (!text2) return null;
|
||
try {
|
||
const parsed = JSON.parse(text2);
|
||
return isRecord6(parsed) ? parsed : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function parseUsage(data) {
|
||
if (!isRecord6(data) || data["type"] !== "usage") return null;
|
||
const usage = data["usage"];
|
||
if (!isRecord6(usage)) return null;
|
||
return {
|
||
inputTokens: tokenValue(usage["input_tokens"]),
|
||
outputTokens: tokenValue(usage["output_tokens"]),
|
||
cacheReadTokens: tokenValue(usage["cached_read_tokens"]),
|
||
reasoningTokens: tokenValue(usage["thought_tokens"])
|
||
};
|
||
}
|
||
function getOpenDesignDir() {
|
||
const override = process.env[ENV_DIR];
|
||
if (override) return override;
|
||
const home = homedir29();
|
||
const os = platform2();
|
||
if (os === "darwin") {
|
||
return join33(home, "Library", "Application Support", "Open Design");
|
||
}
|
||
if (os === "win32") {
|
||
return join33(process.env["APPDATA"] ?? join33(home, "AppData", "Roaming"), "Open Design");
|
||
}
|
||
return join33(home, ".config", "Open Design");
|
||
}
|
||
function namespaceFromDataDir(dataDir) {
|
||
const ns = basename23(dirname13(dataDir));
|
||
return ns && ns !== "namespaces" ? ns : PROVIDER_NAME5;
|
||
}
|
||
function namespaceFromRunsDir(runsDir) {
|
||
return namespaceFromDataDir(dirname13(runsDir));
|
||
}
|
||
async function discoverRunsDir(runsDir, project) {
|
||
const sources = [];
|
||
let runDirs;
|
||
try {
|
||
runDirs = await readdir24(runsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const runDir of runDirs) {
|
||
const eventsPath = join33(runsDir, runDir, "events.jsonl");
|
||
const s = await stat23(eventsPath).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({ path: eventsPath, project, provider: PROVIDER_NAME5 });
|
||
}
|
||
return sources;
|
||
}
|
||
async function discoverNamespacesDir(namespacesDir) {
|
||
const sources = [];
|
||
let namespaces;
|
||
try {
|
||
namespaces = await readdir24(namespacesDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const ns of namespaces) {
|
||
const runsDir = join33(namespacesDir, ns, "data", "runs");
|
||
sources.push(...await discoverRunsDir(runsDir, ns));
|
||
}
|
||
return sources;
|
||
}
|
||
function dedupeSources(sources) {
|
||
const seen = /* @__PURE__ */ new Set();
|
||
const out = [];
|
||
for (const source of sources) {
|
||
if (seen.has(source.path)) continue;
|
||
seen.add(source.path);
|
||
out.push(source);
|
||
}
|
||
return out;
|
||
}
|
||
async function discoverOpenDesignSessions(baseDir) {
|
||
const baseName = basename23(baseDir);
|
||
if (baseName === "runs") {
|
||
return discoverRunsDir(baseDir, namespaceFromRunsDir(baseDir));
|
||
}
|
||
if (baseName === "data") {
|
||
return discoverRunsDir(join33(baseDir, "runs"), namespaceFromDataDir(baseDir));
|
||
}
|
||
const sources = [];
|
||
sources.push(...await discoverRunsDir(join33(baseDir, "data", "runs"), basename23(baseDir) || PROVIDER_NAME5));
|
||
sources.push(...await discoverRunsDir(join33(baseDir, "runs"), basename23(baseDir) || PROVIDER_NAME5));
|
||
sources.push(...await discoverNamespacesDir(baseName === "namespaces" ? baseDir : join33(baseDir, "namespaces")));
|
||
return dedupeSources(sources);
|
||
}
|
||
function createParser18(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const sessionId = basename23(dirname13(source.path));
|
||
let currentModel = "";
|
||
let fallbackEventCounter = 0;
|
||
for await (const line of readSessionLines(source.path)) {
|
||
const entry = parseEvent(line);
|
||
if (!entry) continue;
|
||
const eventName = stringValue2(entry.event);
|
||
const data = entry.data;
|
||
if (eventName === "start" && isRecord6(data)) {
|
||
const model = stringValue2(data["model"]);
|
||
if (model) currentModel = model;
|
||
continue;
|
||
}
|
||
if (eventName !== "agent" || !isRecord6(data)) continue;
|
||
if (data["type"] === "status") {
|
||
const model = stringValue2(data["model"]);
|
||
if (model) currentModel = model;
|
||
continue;
|
||
}
|
||
const usage = parseUsage(data);
|
||
if (!usage || !currentModel) continue;
|
||
const eventId = stringValue2(entry.id) ?? `line-${fallbackEventCounter++}`;
|
||
const dedupKey = `${PROVIDER_NAME5}:${sessionId}:${eventId}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const uncachedInputTokens = Math.max(0, usage.inputTokens - usage.cacheReadTokens);
|
||
const costUSD = calculateCost(
|
||
currentModel,
|
||
uncachedInputTokens,
|
||
usage.outputTokens + usage.reasoningTokens,
|
||
0,
|
||
usage.cacheReadTokens,
|
||
0
|
||
);
|
||
yield {
|
||
provider: PROVIDER_NAME5,
|
||
sessionId,
|
||
project: source.project,
|
||
model: currentModel,
|
||
inputTokens: uncachedInputTokens,
|
||
outputTokens: usage.outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: usage.cacheReadTokens,
|
||
cachedInputTokens: usage.cacheReadTokens,
|
||
reasoningTokens: usage.reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: timestampValue(entry.timestamp),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: ""
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createOpenDesignProvider(overrideDir) {
|
||
return {
|
||
name: PROVIDER_NAME5,
|
||
displayName: "Open Design",
|
||
modelDisplayName(model) {
|
||
return modelDisplayNames6.get(model) ?? model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: overrideDir ?? getOpenDesignDir(), label: "sessions" }];
|
||
},
|
||
async discoverSessions() {
|
||
return discoverOpenDesignSessions(overrideDir ?? getOpenDesignDir());
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser18(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var PROVIDER_NAME5, ENV_DIR, modelDisplayNames6, openDesign;
|
||
var init_open_design = __esm({
|
||
"src/providers/open-design.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
PROVIDER_NAME5 = "open-design";
|
||
ENV_DIR = "CODEBURN_OPEN_DESIGN_DIR";
|
||
modelDisplayNames6 = /* @__PURE__ */ new Map([
|
||
["openai-codex:gpt-5.5", "GPT-5.5"],
|
||
["glm-5.2", "GLM-5.2"],
|
||
["GLM-5.2", "GLM-5.2"]
|
||
]);
|
||
openDesign = createOpenDesignProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/pi.ts
|
||
import { readdir as readdir25, stat as stat24 } from "fs/promises";
|
||
import { basename as basename24, join as join34 } from "path";
|
||
import { homedir as homedir30 } from "os";
|
||
function skillLoadName(name, args) {
|
||
if (name !== "read") return null;
|
||
const raw = args?.["path"] ?? args?.["file_path"];
|
||
if (typeof raw !== "string") return null;
|
||
const path = raw.trim();
|
||
if (path.length === 0) return null;
|
||
if (path.startsWith("skill://")) {
|
||
const rest = path.slice("skill://".length).replace(/^\/+/, "");
|
||
const first = rest.split(/[/?#]/)[0]?.trim() ?? "";
|
||
return first.length > 0 ? first : null;
|
||
}
|
||
const segments = path.split(/[\\/]/).filter(Boolean);
|
||
if (segments[segments.length - 1] !== "SKILL.md") return null;
|
||
const parent = segments[segments.length - 2]?.trim();
|
||
return parent && parent.length > 0 ? parent : null;
|
||
}
|
||
function modelUsageCall(entry, source, sessionId, lineIdx, sessionTimestamp, seenKeys) {
|
||
const usage = entry.usage;
|
||
if (!usage) return null;
|
||
const input = usage.input ?? 0;
|
||
const output = usage.output ?? 0;
|
||
const cacheRead = usage.cacheRead ?? 0;
|
||
const cacheWrite = usage.cacheWrite ?? 0;
|
||
if (input === 0 && output === 0 && cacheRead === 0) return null;
|
||
const bare = entry.model ?? "";
|
||
const model = !entry.provider || bare.startsWith(`${entry.provider}/`) ? bare : `${entry.provider}/${bare}`;
|
||
if (!model) return null;
|
||
const dedupKey = `${source.provider}:${source.path}:model_usage:${entry.id || entry.timestamp || String(lineIdx)}`;
|
||
if (seenKeys.has(dedupKey)) return null;
|
||
seenKeys.add(dedupKey);
|
||
const reported = usage.cost?.total;
|
||
const costUSD = typeof reported === "number" && Number.isFinite(reported) && reported !== 0 ? reported : calculateCost(model, input, output, cacheWrite, cacheRead, 0);
|
||
const timestamp2 = entry.timestamp || sessionTimestamp;
|
||
if (!timestamp2) return null;
|
||
return {
|
||
provider: source.provider,
|
||
model,
|
||
inputTokens: input,
|
||
outputTokens: output,
|
||
cacheCreationInputTokens: cacheWrite,
|
||
cacheReadInputTokens: cacheRead,
|
||
cachedInputTokens: cacheRead,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [entry.purpose ? `omp:${entry.purpose}` : "omp:side-call"],
|
||
bashCommands: [],
|
||
skills: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
sessionId
|
||
};
|
||
}
|
||
function getPiSessionsDir(override) {
|
||
return override ?? join34(homedir30(), ".pi", "agent", "sessions");
|
||
}
|
||
function getOmpSessionsDir(override) {
|
||
return override ?? join34(homedir30(), ".omp", "agent", "sessions");
|
||
}
|
||
function looksAbsolutePath(value) {
|
||
const trimmed = value.trim();
|
||
if (!trimmed) return false;
|
||
return trimmed.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(trimmed);
|
||
}
|
||
async function readSessionEntry(filePath) {
|
||
let linesScanned = 0;
|
||
for await (const line of readSessionLines(filePath)) {
|
||
if (linesScanned >= MAX_HEADER_LINES_SCANNED) break;
|
||
linesScanned++;
|
||
const trimmed = line.trim();
|
||
if (!trimmed) continue;
|
||
try {
|
||
const entry = JSON.parse(trimmed);
|
||
if (entry.type === "session") return entry;
|
||
} catch {
|
||
continue;
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
async function discoverSessionsInDir4(sessionsDir, providerName) {
|
||
const sources = [];
|
||
let projectDirs;
|
||
try {
|
||
projectDirs = await readdir25(sessionsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const dirName of projectDirs) {
|
||
const dirPath = join34(sessionsDir, dirName);
|
||
const dirStat = await stat24(dirPath).catch(() => null);
|
||
if (!dirStat?.isDirectory()) continue;
|
||
let entries;
|
||
try {
|
||
entries = await readdir25(dirPath, { withFileTypes: true });
|
||
} catch {
|
||
continue;
|
||
}
|
||
const addSession = async (filePath, agentName) => {
|
||
const entry = await readSessionEntry(filePath);
|
||
if (!entry) return;
|
||
const rawCwd = typeof entry.cwd === "string" ? entry.cwd.trim() : "";
|
||
const cwd = rawCwd || dirName;
|
||
const absCwd = looksAbsolutePath(cwd) ? cwd : void 0;
|
||
sources.push({
|
||
path: filePath,
|
||
project: basename24(cwd) || cwd,
|
||
provider: providerName,
|
||
...absCwd ? { sourcePath: absCwd } : {},
|
||
...agentName ? {
|
||
agentName,
|
||
...typeof entry.timestamp === "string" ? { agentStartedAt: entry.timestamp } : {}
|
||
} : {}
|
||
});
|
||
};
|
||
for (const entry of entries) {
|
||
if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
||
await addSession(join34(dirPath, entry.name));
|
||
continue;
|
||
}
|
||
if (providerName !== "omp" || !entry.isDirectory()) continue;
|
||
const agentDir = join34(dirPath, entry.name);
|
||
const agentEntries = await readdir25(agentDir, { withFileTypes: true }).catch(() => []);
|
||
for (const agentEntry of agentEntries) {
|
||
if (!agentEntry.isFile() || !agentEntry.name.endsWith(".jsonl")) continue;
|
||
await addSession(join34(agentDir, agentEntry.name), basename24(agentEntry.name, ".jsonl"));
|
||
}
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function resolveMessageModel(messageModel, resolvedModel) {
|
||
if (messageModel.includes("/")) return messageModel;
|
||
if (resolvedModel && (!messageModel || resolvedModel === messageModel || resolvedModel.endsWith(`/${messageModel}`))) {
|
||
return resolvedModel;
|
||
}
|
||
return messageModel || resolvedModel || "gpt-5";
|
||
}
|
||
function createParser19(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const content2 = await readSessionFile(source.path);
|
||
if (content2 === null) return;
|
||
const fileStat = await stat24(source.path).catch(() => null);
|
||
const fileMtime = fileStat?.mtime.toISOString() ?? "";
|
||
const lines = content2.split("\n").filter((l) => l.trim());
|
||
let sessionId = basename24(source.path, ".jsonl");
|
||
let resolvedModel = "";
|
||
let pendingUserMessage = "";
|
||
let sessionTimestamp = "";
|
||
let pendingUserTimestamp = "";
|
||
let sessionCwd = typeof source.sourcePath === "string" && looksAbsolutePath(source.sourcePath) ? source.sourcePath.trim() : "";
|
||
for (const [lineIdx, line] of lines.entries()) {
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (entry.type === "session") {
|
||
sessionId = entry.id ?? sessionId;
|
||
if (typeof entry.timestamp === "string" && entry.timestamp) sessionTimestamp = entry.timestamp;
|
||
if (typeof entry.cwd === "string" && entry.cwd.trim()) {
|
||
const headerCwd = entry.cwd.trim();
|
||
if (looksAbsolutePath(headerCwd)) sessionCwd = headerCwd;
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type === "model_change") {
|
||
if (typeof entry.model === "string" && entry.model) resolvedModel = entry.model;
|
||
continue;
|
||
}
|
||
if (entry.type === "model_usage") {
|
||
const call = modelUsageCall(entry, source, sessionId, lineIdx, sessionTimestamp, seenKeys);
|
||
if (call) yield call;
|
||
continue;
|
||
}
|
||
if (entry.type !== "message") continue;
|
||
const msg = entry.message;
|
||
if (!msg) continue;
|
||
if (msg.role === "user") {
|
||
const attributedTimestamp = msg.attribution?.timestamp;
|
||
if (typeof entry.timestamp === "string" && entry.timestamp) {
|
||
pendingUserTimestamp = entry.timestamp;
|
||
} else if (typeof attributedTimestamp === "number" && Number.isFinite(attributedTimestamp)) {
|
||
pendingUserTimestamp = new Date(attributedTimestamp).toISOString();
|
||
}
|
||
const texts = normalizeContentBlocks(msg.content).filter((c) => c.type === "text").map((c) => c.text ?? "").filter(Boolean);
|
||
if (texts.length > 0) pendingUserMessage = texts.join(" ");
|
||
continue;
|
||
}
|
||
if (msg.role !== "assistant" || !msg.usage) continue;
|
||
const input = msg.usage.input ?? 0;
|
||
const output = msg.usage.output ?? 0;
|
||
const cacheRead = msg.usage.cacheRead ?? 0;
|
||
const cacheWrite = msg.usage.cacheWrite ?? 0;
|
||
if (input === 0 && output === 0) continue;
|
||
const messageModel = msg.model ?? "";
|
||
const model = resolveMessageModel(messageModel, resolvedModel);
|
||
const responseId = msg.responseId ?? "";
|
||
const dedupKey = `${source.provider}:${source.path}:${responseId || entry.id || entry.timestamp || String(lineIdx)}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const toolCalls = normalizeContentBlocks(msg.content).filter((c) => c.type === "toolCall" && c.name);
|
||
const tools = [];
|
||
const skills = [];
|
||
for (const c of toolCalls) {
|
||
const skill = skillLoadName(c.name, c.arguments);
|
||
if (skill !== null) {
|
||
skills.push(skill);
|
||
tools.push("Skill");
|
||
continue;
|
||
}
|
||
tools.push(toolNameMap18[c.name] ?? c.name);
|
||
}
|
||
const bashCommands = toolCalls.filter((c) => c.name === "bash").flatMap((c) => {
|
||
const cmd = c.arguments?.["command"];
|
||
return typeof cmd === "string" ? extractBashCommands(cmd) : [];
|
||
});
|
||
const reportedCost2 = msg.usage.cost?.total;
|
||
const isReported = typeof reportedCost2 === "number" && Number.isFinite(reportedCost2) && reportedCost2 !== 0;
|
||
const costUSD = isReported ? reportedCost2 : calculateCost(messageModel || resolvedModel || model, input, output, cacheWrite, cacheRead, 0);
|
||
const timestamp2 = entry.timestamp || pendingUserTimestamp || sessionTimestamp || fileMtime;
|
||
if (!timestamp2) continue;
|
||
yield {
|
||
provider: source.provider,
|
||
model,
|
||
inputTokens: input,
|
||
outputTokens: output,
|
||
cacheCreationInputTokens: cacheWrite,
|
||
cacheReadInputTokens: cacheRead,
|
||
cachedInputTokens: cacheRead,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
...isReported ? { costFromBilling: true } : {},
|
||
tools,
|
||
bashCommands,
|
||
skills,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId,
|
||
project: source.project,
|
||
...sessionCwd ? {
|
||
projectPath: sessionCwd,
|
||
workingDirectory: sessionCwd
|
||
} : {}
|
||
};
|
||
pendingUserMessage = "";
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createPiProvider(sessionsDir) {
|
||
const dir = getPiSessionsDir(sessionsDir);
|
||
return {
|
||
name: "pi",
|
||
async probeRoots() {
|
||
return [{ path: dir, label: "sessions" }];
|
||
},
|
||
displayName: "Pi",
|
||
// No local display table (#1530): every entry one used to carry exists in
|
||
// the global SHORT_NAMES with the same label, and a local list that lags
|
||
// behind it re-creates the #1530 inconsistency (a bare `gpt-5` key
|
||
// swallowing `gpt-5-mini` into "GPT-5"). Echoing the raw id lets the
|
||
// report layer's fallbackRawModelDisplayName resolve every id with the
|
||
// one global getShortModelName all providers share.
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap18[rawTool] ?? rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessionsInDir4(dir, "pi");
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser19(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
function createOmpProvider(sessionsDir) {
|
||
const dir = getOmpSessionsDir(sessionsDir);
|
||
return {
|
||
name: "omp",
|
||
async probeRoots() {
|
||
return [{ path: dir, label: "sessions" }];
|
||
},
|
||
displayName: "OMP",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap18[rawTool] ?? rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
return discoverSessionsInDir4(dir, "omp");
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser19(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap18, MAX_HEADER_LINES_SCANNED, pi, omp;
|
||
var init_pi = __esm({
|
||
"src/providers/pi.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
init_content_utils();
|
||
toolNameMap18 = {
|
||
bash: "Bash",
|
||
read: "Read",
|
||
edit: "Edit",
|
||
write: "Write",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
task: "Agent",
|
||
dispatch_agent: "Agent",
|
||
fetch: "WebFetch",
|
||
search: "WebSearch",
|
||
todo: "TodoWrite",
|
||
patch: "Patch"
|
||
};
|
||
MAX_HEADER_LINES_SCANNED = 20;
|
||
pi = createPiProvider();
|
||
omp = createOmpProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/qwen.ts
|
||
import { readdir as readdir26, stat as stat25 } from "fs/promises";
|
||
import { join as join35 } from "path";
|
||
import { homedir as homedir31 } from "os";
|
||
function getQwenProjectsDir() {
|
||
return process.env["QWEN_DATA_DIR"] ?? join35(homedir31(), ".qwen", "projects");
|
||
}
|
||
function projectNameFromDirName(dirName) {
|
||
const parts = dirName.replace(/^-/, "").split("-");
|
||
return parts[parts.length - 1] || dirName;
|
||
}
|
||
function isoTimestamp4(value, fallback) {
|
||
if (value) {
|
||
const date = new Date(value);
|
||
if (!Number.isNaN(date.getTime())) return date.toISOString();
|
||
}
|
||
return fallback;
|
||
}
|
||
function extractTools3(parts) {
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
for (const part of parts) {
|
||
if (part.functionCall?.name) {
|
||
const mapped = toolNameMap19[part.functionCall.name] ?? part.functionCall.name;
|
||
tools.push(mapped);
|
||
if (mapped === "Bash" && part.functionCall.args && typeof part.functionCall.args["command"] === "string") {
|
||
bashCommands.push(...extractBashCommands(part.functionCall.args["command"]));
|
||
}
|
||
}
|
||
}
|
||
return { tools, bashCommands };
|
||
}
|
||
function createParser20(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const raw = await readSessionFile(source.path);
|
||
if (raw === null) return;
|
||
const fileStat = await stat25(source.path).catch(() => null);
|
||
const fileMtime = fileStat?.mtime.toISOString() ?? "";
|
||
const lines = raw.split("\n").filter((l) => l.trim());
|
||
let pendingUserMessage = "";
|
||
for (const line of lines) {
|
||
let entry;
|
||
try {
|
||
entry = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (entry.type === "user" && entry.message) {
|
||
const texts = (entry.message.parts ?? []).filter((p) => p.text && !p.thought).map((p) => p.text);
|
||
if (texts.length > 0) {
|
||
pendingUserMessage = texts.join(" ").slice(0, 500);
|
||
}
|
||
continue;
|
||
}
|
||
if (entry.type !== "assistant" || !entry.usageMetadata) continue;
|
||
const usage = entry.usageMetadata;
|
||
if (usage.promptTokenCount === 0 && usage.candidatesTokenCount === 0) continue;
|
||
const dedupKey = `qwen:${entry.sessionId}:${entry.uuid}`;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
seenKeys.add(dedupKey);
|
||
const model = entry.model || "qwen-auto";
|
||
const { tools, bashCommands } = extractTools3(entry.message?.parts ?? []);
|
||
const inputTokens = usage.promptTokenCount;
|
||
const outputTokens = usage.candidatesTokenCount;
|
||
const reasoningTokens = usage.thoughtsTokenCount ?? 0;
|
||
const cachedTokens = usage.cachedContentTokenCount ?? 0;
|
||
const costUSD = calculateCost(model, inputTokens, outputTokens + reasoningTokens, 0, cachedTokens, 0);
|
||
yield {
|
||
provider: "qwen",
|
||
model,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: cachedTokens,
|
||
cachedInputTokens: cachedTokens,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [...new Set(tools)],
|
||
bashCommands: [...new Set(bashCommands)],
|
||
timestamp: isoTimestamp4(entry.timestamp, fileMtime),
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: pendingUserMessage,
|
||
sessionId: entry.sessionId
|
||
};
|
||
pendingUserMessage = "";
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createQwenProvider(overrideDir) {
|
||
const projectsDir = overrideDir ?? getQwenProjectsDir();
|
||
return {
|
||
name: "qwen",
|
||
displayName: "Qwen",
|
||
modelDisplayName(model) {
|
||
return model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap19[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: projectsDir, label: "projects" }];
|
||
},
|
||
async discoverSessions() {
|
||
const sources = [];
|
||
let projectDirs;
|
||
try {
|
||
projectDirs = await readdir26(projectsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
for (const projDir of projectDirs) {
|
||
const chatsDir = join35(projectsDir, projDir, "chats");
|
||
const project = projectNameFromDirName(projDir);
|
||
let chatFiles;
|
||
try {
|
||
chatFiles = await readdir26(chatsDir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const file of chatFiles) {
|
||
if (!file.endsWith(".jsonl")) continue;
|
||
const filePath = join35(chatsDir, file);
|
||
const s = await stat25(filePath).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({ path: filePath, project, provider: "qwen" });
|
||
}
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser20(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap19, qwen;
|
||
var init_qwen = __esm({
|
||
"src/providers/qwen.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
toolNameMap19 = {
|
||
read_file: "Read",
|
||
write_to_file: "Write",
|
||
edit_file: "Edit",
|
||
execute_command: "Bash",
|
||
search_files: "Grep",
|
||
list_files: "LS",
|
||
list_directory: "LS",
|
||
browser_action: "WebFetch",
|
||
web_search: "WebSearch",
|
||
ask_followup_question: "AskUser",
|
||
attempt_completion: "Complete"
|
||
};
|
||
qwen = createQwenProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/quickdesk.ts
|
||
import { readdir as readdir27, readFile as readFile14, stat as stat26 } from "fs/promises";
|
||
import { homedir as homedir32 } from "os";
|
||
import { basename as basename26, isAbsolute as isAbsolute2, join as join36, resolve as resolve7 } from "path";
|
||
var init_quickdesk = __esm({
|
||
"src/providers/quickdesk.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
init_token_estimate();
|
||
init_sqlite();
|
||
}
|
||
});
|
||
|
||
// src/providers/zerostack.ts
|
||
import { readdir as readdir28 } from "fs/promises";
|
||
import { basename as basename27, join as join37 } from "path";
|
||
import { homedir as homedir33, platform as platform3 } from "os";
|
||
function defaultSessionsDir() {
|
||
const override = process.env["ZS_DATA_DIR"];
|
||
if (override) return join37(override, "sessions");
|
||
const base = platform3() === "darwin" ? join37(homedir33(), "Library", "Application Support") : process.env["XDG_DATA_HOME"] ?? join37(homedir33(), ".local", "share");
|
||
return join37(base, "zerostack", "sessions");
|
||
}
|
||
function firstUserMessage6(messages) {
|
||
const msg = messages.find((m) => m.role === "user");
|
||
if (!msg) return "";
|
||
if (typeof msg.content === "string") return msg.content;
|
||
return (msg.content ?? []).map((c) => c.text ?? "").filter(Boolean).join(" ");
|
||
}
|
||
async function readSession(path) {
|
||
const content2 = await readSessionFile(path);
|
||
if (content2 === null) return null;
|
||
try {
|
||
return JSON.parse(content2);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function createParser21(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const session = await readSession(source.path);
|
||
if (!session) return;
|
||
const input = session.total_input_tokens ?? 0;
|
||
const output = session.total_output_tokens ?? 0;
|
||
if (input === 0 && output === 0) return;
|
||
const timestamp2 = session.updated_at ?? session.created_at ?? "";
|
||
const sessionId = session.id ?? basename27(source.path, ".json");
|
||
const dedupKey = `${source.provider}:${source.path}:${timestamp2}:${sessionId}`;
|
||
if (seenKeys.has(dedupKey)) return;
|
||
seenKeys.add(dedupKey);
|
||
const model = session.model ?? "";
|
||
yield {
|
||
provider: source.provider,
|
||
model,
|
||
inputTokens: input,
|
||
outputTokens: output,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(model, input, output, 0, 0, 0),
|
||
// zerostack persists only final assistant text, not tool-call records,
|
||
// so there is nothing to extract here.
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: firstUserMessage6(session.messages ?? []),
|
||
sessionId,
|
||
project: source.project,
|
||
projectPath: session.working_dir
|
||
};
|
||
}
|
||
};
|
||
}
|
||
function createZerostackProvider(sessionsDir) {
|
||
const dir = sessionsDir ?? defaultSessionsDir();
|
||
return {
|
||
name: "zerostack",
|
||
displayName: "Zerostack",
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model.replace(/^[^/]+\//, ""));
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap20[rawTool] ?? rawTool;
|
||
},
|
||
async probeRoots() {
|
||
return [{ path: dir, label: "sessions" }];
|
||
},
|
||
async discoverSessions() {
|
||
let files;
|
||
try {
|
||
files = await readdir28(dir);
|
||
} catch {
|
||
return [];
|
||
}
|
||
const sources = [];
|
||
for (const file of files) {
|
||
if (!file.endsWith(".json")) continue;
|
||
const path = join37(dir, file);
|
||
const session = await readSession(path);
|
||
if (!session) continue;
|
||
const project = session.working_dir ? basename27(session.working_dir) : basename27(file, ".json");
|
||
sources.push({ path, project, provider: "zerostack" });
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser21(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap20, zerostack;
|
||
var init_zerostack = __esm({
|
||
"src/providers/zerostack.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
toolNameMap20 = {
|
||
bash: "Bash",
|
||
read: "Read",
|
||
write: "Write",
|
||
edit: "Edit",
|
||
grep: "Grep",
|
||
glob: "Glob",
|
||
fetch: "WebFetch",
|
||
search: "WebSearch",
|
||
task: "Agent"
|
||
};
|
||
zerostack = createZerostackProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/grok.ts
|
||
import { readdir as readdir29, stat as stat27 } from "fs/promises";
|
||
import { basename as basename28, dirname as dirname14, join as join38 } from "path";
|
||
import { homedir as homedir34 } from "os";
|
||
function defaultSessionsDir2() {
|
||
const home = process.env["GROK_HOME"] ?? join38(homedir34(), ".grok");
|
||
return join38(home, "sessions");
|
||
}
|
||
async function readJson4(path) {
|
||
const content2 = await readSessionFile(path);
|
||
if (content2 === null) return null;
|
||
try {
|
||
return JSON.parse(content2);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function safeDecode(name) {
|
||
try {
|
||
return decodeURIComponent(name);
|
||
} catch {
|
||
return name;
|
||
}
|
||
}
|
||
function emptyTokenTotals() {
|
||
return { input: 0, cacheRead: 0, output: 0, cacheCreation: 0, reasoning: 0 };
|
||
}
|
||
function isRecord7(value) {
|
||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||
}
|
||
function finiteNonNegative2(value) {
|
||
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) return void 0;
|
||
return Math.min(value, Number.MAX_SAFE_INTEGER);
|
||
}
|
||
function addTokenCounts(left, right) {
|
||
return Math.min(Number.MAX_SAFE_INTEGER, left + right);
|
||
}
|
||
function readUsageNumber(usage, field) {
|
||
return finiteNonNegative2(usage[field]);
|
||
}
|
||
function readModelUsage(usage) {
|
||
const modelUsage = usage["modelUsage"];
|
||
const result = /* @__PURE__ */ new Map();
|
||
if (!isRecord7(modelUsage)) return result;
|
||
for (const [modelId, rawModelUsage] of Object.entries(modelUsage)) {
|
||
if (!modelId || !isRecord7(rawModelUsage)) continue;
|
||
const values = authoritativeTokenFields.map((field) => finiteNonNegative2(rawModelUsage[field]));
|
||
if (!values.some((value) => value !== void 0)) continue;
|
||
result.set(modelId, {
|
||
inputTokens: values[0] ?? 0,
|
||
outputTokens: values[1] ?? 0,
|
||
cacheReadTokens: values[2] ?? 0,
|
||
cacheCreationTokens: values[3] ?? 0,
|
||
reasoningTokens: values[4] ?? 0
|
||
});
|
||
}
|
||
return result;
|
||
}
|
||
function parseAuthoritativeUsage(raw) {
|
||
if (!isRecord7(raw)) return null;
|
||
const values = authoritativeTokenFields.map((field) => readUsageNumber(raw, field));
|
||
const modelUsage = readModelUsage(raw);
|
||
return {
|
||
inputTokens: values[0] ?? 0,
|
||
outputTokens: values[1] ?? 0,
|
||
cacheReadTokens: values[2] ?? 0,
|
||
cacheCreationTokens: values[3] ?? 0,
|
||
reasoningTokens: values[4] ?? 0,
|
||
modelUsage
|
||
};
|
||
}
|
||
function chooseAuthoritativeModel(modelIds, existingModel) {
|
||
const pricedActualModel = modelIds.find((modelId) => getModelCosts(modelId) !== null);
|
||
if (pricedActualModel) return pricedActualModel;
|
||
if (getModelCosts(existingModel) !== null) return existingModel;
|
||
return modelIds[0] ?? existingModel;
|
||
}
|
||
function parseUpdates(updates) {
|
||
const turns = /* @__PURE__ */ new Map();
|
||
const completedUsages = /* @__PURE__ */ new Map();
|
||
const tools = [];
|
||
const bashCommands = [];
|
||
const subagentTypes = [];
|
||
let prevTotal = -1;
|
||
let segmentPeak = 0;
|
||
let inputFresh = 0;
|
||
let completedWithoutPromptId = 0;
|
||
for (const line of updates.split("\n")) {
|
||
if (!line.trim()) continue;
|
||
let params;
|
||
try {
|
||
params = JSON.parse(line).params;
|
||
} catch {
|
||
continue;
|
||
}
|
||
if (!params) continue;
|
||
const total = finiteNonNegative2(params._meta?.totalTokens);
|
||
if (total !== void 0) {
|
||
if (prevTotal >= 0 && total < prevTotal * 0.5) {
|
||
inputFresh = addTokenCounts(inputFresh, segmentPeak);
|
||
segmentPeak = 0;
|
||
}
|
||
if (total > segmentPeak) segmentPeak = total;
|
||
prevTotal = total;
|
||
const promptId = typeof params._meta?.promptId === "string" ? params._meta.promptId : void 0;
|
||
if (promptId) {
|
||
const turn = turns.get(promptId);
|
||
if (!turn) turns.set(promptId, { first: total, last: total });
|
||
else turn.last = total;
|
||
}
|
||
}
|
||
const update = params.update;
|
||
if (update?.sessionUpdate === "turn_completed") {
|
||
const usage = parseAuthoritativeUsage(update.usage);
|
||
if (usage) {
|
||
const promptId = typeof update.prompt_id === "string" && update.prompt_id.length > 0 ? update.prompt_id : `turn_completed:${completedWithoutPromptId++}`;
|
||
completedUsages.set(promptId, usage);
|
||
}
|
||
}
|
||
if (update?.sessionUpdate === "tool_call" && typeof update.title === "string") {
|
||
tools.push(toolNameMap21[update.title] ?? update.title);
|
||
if (update.title === "run_terminal_command" && typeof update.rawInput?.command === "string") {
|
||
bashCommands.push(...extractBashCommands(update.rawInput.command));
|
||
}
|
||
if (update.title === "spawn_subagent" && typeof update.rawInput?.subagent_type === "string") {
|
||
subagentTypes.push(update.rawInput.subagent_type);
|
||
}
|
||
}
|
||
}
|
||
inputFresh = addTokenCounts(inputFresh, segmentPeak);
|
||
let sumFirst = 0;
|
||
let output = 0;
|
||
for (const { first, last } of turns.values()) {
|
||
sumFirst = addTokenCounts(sumFirst, first);
|
||
output = addTokenCounts(output, Math.max(0, last - first));
|
||
}
|
||
const estimated = {
|
||
input: inputFresh,
|
||
cacheRead: Math.max(0, sumFirst - inputFresh),
|
||
output
|
||
};
|
||
const usageTotals = emptyTokenTotals();
|
||
const modelIds = [];
|
||
const seenModelIds = /* @__PURE__ */ new Set();
|
||
for (const usage of completedUsages.values()) {
|
||
addUsageToTotals(usageTotals, usage);
|
||
for (const modelId of usage.modelUsage.keys()) {
|
||
if (seenModelIds.has(modelId)) continue;
|
||
seenModelIds.add(modelId);
|
||
modelIds.push(modelId);
|
||
}
|
||
}
|
||
const hasPositiveCompletedUsage = [...completedUsages.values()].some(hasPositiveTopLevelUsage);
|
||
if (!hasPositiveCompletedUsage || !hasPositiveTotals(usageTotals)) {
|
||
return {
|
||
usage: { input: estimated.input, cacheRead: estimated.cacheRead, output: estimated.output, cacheCreation: 0, reasoning: 0 },
|
||
modelIds: [],
|
||
authoritative: false,
|
||
hasUncompletedTurn: false,
|
||
tools,
|
||
bashCommands,
|
||
subagentTypes
|
||
};
|
||
}
|
||
const hasUncompletedTurn = [...turns.keys()].some((promptId) => !completedUsages.has(promptId));
|
||
return {
|
||
usage: usageTotals,
|
||
modelIds,
|
||
authoritative: true,
|
||
hasUncompletedTurn,
|
||
tools,
|
||
bashCommands,
|
||
subagentTypes
|
||
};
|
||
}
|
||
function hasPositiveTopLevelUsage(usage) {
|
||
return usage.inputTokens > 0 || usage.outputTokens > 0 || usage.cacheReadTokens > 0 || usage.cacheCreationTokens > 0 || usage.reasoningTokens > 0;
|
||
}
|
||
function addUsageToTotals(totals, usage) {
|
||
const reasoningTokens = Math.min(usage.reasoningTokens, usage.outputTokens);
|
||
totals.input = addTokenCounts(
|
||
totals.input,
|
||
Math.max(0, usage.inputTokens - usage.cacheReadTokens - usage.cacheCreationTokens)
|
||
);
|
||
totals.cacheRead = addTokenCounts(totals.cacheRead, usage.cacheReadTokens);
|
||
totals.output = addTokenCounts(totals.output, usage.outputTokens);
|
||
totals.cacheCreation = addTokenCounts(totals.cacheCreation, usage.cacheCreationTokens);
|
||
totals.reasoning = addTokenCounts(totals.reasoning, reasoningTokens);
|
||
}
|
||
function hasPositiveTotals(totals) {
|
||
return totals.input > 0 || totals.cacheRead > 0 || totals.output > 0 || totals.cacheCreation > 0 || totals.reasoning > 0;
|
||
}
|
||
function createParser22(source, seenKeys, unifiedLogPath) {
|
||
return {
|
||
async *parse() {
|
||
const dir = dirname14(source.path);
|
||
const summary = await readJson4(join38(dir, "summary.json"));
|
||
if (!summary) return;
|
||
const logged = await loggedSessionIds(unifiedLogPath);
|
||
if (logged.has(summary.info?.id ?? basename28(dir)) || logged.has(basename28(dir))) return;
|
||
const updates = await readSessionFile(source.path);
|
||
if (updates === null) return;
|
||
const signals = await readJson4(join38(dir, "signals.json"));
|
||
const existingModel = summary.current_model_id ?? signals?.primaryModelId ?? signals?.modelsUsed?.[0] ?? "grok-build";
|
||
const parsed = parseUpdates(updates);
|
||
if (!hasPositiveTotals(parsed.usage)) return;
|
||
const timestamp2 = summary.updated_at ?? summary.last_active_at ?? summary.created_at ?? "";
|
||
const sessionId = summary.info?.id ?? basename28(dir);
|
||
const model = parsed.authoritative ? chooseAuthoritativeModel(parsed.modelIds, existingModel) : existingModel;
|
||
const baseDedupKey = `${source.provider}:${dir}:${timestamp2}:${sessionId}`;
|
||
if (seenKeys.has(baseDedupKey)) return;
|
||
seenKeys.add(baseDedupKey);
|
||
const reasoningTokens = parsed.usage.reasoning;
|
||
yield {
|
||
provider: source.provider,
|
||
model,
|
||
inputTokens: parsed.usage.input,
|
||
// Grok reports reasoning INSIDE outputTokens, but the repo contract is
|
||
// the opposite: ParsedProviderCall.reasoningTokens is exclusive of
|
||
// outputTokens. Downstream consumers reconstitute the billable total
|
||
// through billableOutputTokens() (models.ts): it adds reasoning back on
|
||
// top for grok and every other provider, except the
|
||
// REASONING_INCLUDED_IN_OUTPUT set (claude, codex) whose reasoning is
|
||
// already inside output_tokens and must not be added again.
|
||
// tests/providers/kiro.test.ts states the exclusive contract outright.
|
||
// So split it here rather than special-casing grok in every downstream
|
||
// site: subtracting reasoning makes `output + reasoning` reconstruct
|
||
// exactly the number Grok reported.
|
||
outputTokens: parsed.usage.output - reasoningTokens,
|
||
cacheCreationInputTokens: parsed.usage.cacheCreation,
|
||
cacheReadInputTokens: parsed.usage.cacheRead,
|
||
cachedInputTokens: parsed.usage.cacheRead,
|
||
reasoningTokens,
|
||
webSearchRequests: 0,
|
||
// Authoritative token counts are measured even though CodeBurn applies
|
||
// its own pricing table; only the legacy context-curve path is an
|
||
// estimate. The full provider output is priced once here, which is
|
||
// what the downstream `output + reasoning` recompute reproduces.
|
||
costUSD: calculateCost(
|
||
model,
|
||
parsed.usage.input,
|
||
parsed.usage.output,
|
||
parsed.usage.cacheCreation,
|
||
parsed.usage.cacheRead,
|
||
0
|
||
),
|
||
costIsEstimated: !parsed.authoritative || parsed.hasUncompletedTurn,
|
||
tools: parsed.tools,
|
||
bashCommands: parsed.bashCommands,
|
||
subagentTypes: parsed.subagentTypes,
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: baseDedupKey,
|
||
userMessage: summary.session_summary ?? summary.generated_title ?? "",
|
||
sessionId,
|
||
project: source.project,
|
||
projectPath: summary.info?.cwd
|
||
};
|
||
}
|
||
};
|
||
}
|
||
function inferenceUsage(record) {
|
||
const { sid, ts, ctx } = record;
|
||
if (record.msg !== "shell.turn.inference_done" || typeof sid !== "string" || !sid || typeof ts !== "string" || !isRecord7(ctx)) return null;
|
||
const prompt = finiteNonNegative2(ctx["prompt_tokens"]);
|
||
const completion = finiteNonNegative2(ctx["completion_tokens"]);
|
||
if (prompt === void 0 || completion === void 0 || prompt === 0 && completion === 0) return null;
|
||
return {
|
||
sid,
|
||
ts,
|
||
prompt,
|
||
cached: Math.min(finiteNonNegative2(ctx["cached_prompt_tokens"]) ?? 0, prompt),
|
||
completion,
|
||
reasoning: Math.min(finiteNonNegative2(ctx["reasoning_tokens"]) ?? 0, completion)
|
||
};
|
||
}
|
||
async function readLoggedSessionIds(path) {
|
||
const sids = /* @__PURE__ */ new Set();
|
||
for await (const line of readSessionLines(path)) {
|
||
if (!line.includes("shell.turn.inference_done")) continue;
|
||
try {
|
||
const usage = inferenceUsage(JSON.parse(line));
|
||
if (usage) sids.add(usage.sid);
|
||
} catch {
|
||
continue;
|
||
}
|
||
}
|
||
return sids;
|
||
}
|
||
async function loggedSessionIds(path) {
|
||
const st = await stat27(path).catch(() => null);
|
||
if (!st) return /* @__PURE__ */ new Set();
|
||
const key = `${path}:${st.size}:${st.mtimeMs}`;
|
||
if (loggedSessions?.key !== key) loggedSessions = { key, sids: readLoggedSessionIds(path) };
|
||
return loggedSessions.sids;
|
||
}
|
||
async function readSessionDirInfo(dir) {
|
||
const summary = dir ? await readJson4(join38(dir, "summary.json")) : null;
|
||
const updates = dir ? await readSessionFile(join38(dir, "updates.jsonl")) : null;
|
||
const parsed = updates === null ? null : parseUpdates(updates);
|
||
return {
|
||
model: summary?.current_model_id,
|
||
cwd: summary?.info?.cwd,
|
||
userMessage: summary?.session_summary ?? summary?.generated_title ?? "",
|
||
tools: parsed?.tools ?? [],
|
||
bashCommands: parsed?.bashCommands ?? [],
|
||
subagentTypes: parsed?.subagentTypes ?? []
|
||
};
|
||
}
|
||
function createUnifiedLogParser(source, seenKeys, sessionsDir) {
|
||
return {
|
||
async *parse() {
|
||
const models = /* @__PURE__ */ new Map();
|
||
const pidModels = /* @__PURE__ */ new Map();
|
||
const cwds = /* @__PURE__ */ new Map();
|
||
const sessionDirs = new Map((await discoverSessions4(sessionsDir)).map((s) => [basename28(dirname14(s.path)), dirname14(s.path)]));
|
||
const dirInfo = /* @__PURE__ */ new Map();
|
||
for await (const line of readSessionLines(source.path)) {
|
||
let record;
|
||
try {
|
||
record = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
const sid = record.sid;
|
||
const ctx = record.ctx;
|
||
if (!isRecord7(ctx)) continue;
|
||
if (record.msg === "model catalog: notifying clients" && typeof ctx["current_model_id"] === "string") {
|
||
pidModels.set(record.pid, ctx["current_model_id"]);
|
||
continue;
|
||
}
|
||
if (typeof sid !== "string" || !sid) continue;
|
||
if (record.msg === "model changed" && typeof ctx["model"] === "string") {
|
||
models.set(sid, ctx["model"]);
|
||
continue;
|
||
}
|
||
if (record.msg === "session created" && typeof ctx["cwd"] === "string") {
|
||
cwds.set(sid, ctx["cwd"]);
|
||
continue;
|
||
}
|
||
const usage = inferenceUsage(record);
|
||
if (!usage) continue;
|
||
const { prompt, cached: cached2, completion, reasoning } = usage;
|
||
const deduplicationKey = `grok:unified:${sid}:${usage.ts}:${String(ctx["loop_index"] ?? 1)}`;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
let info = dirInfo.get(sid);
|
||
const first = !info;
|
||
if (!info) {
|
||
info = await readSessionDirInfo(sessionDirs.get(sid));
|
||
dirInfo.set(sid, info);
|
||
}
|
||
const namedModel = models.get(sid) ?? pidModels.get(record.pid) ?? info.model;
|
||
const model = namedModel ?? "grok-build";
|
||
const cwd = cwds.get(sid) ?? info.cwd;
|
||
yield {
|
||
provider: source.provider,
|
||
model,
|
||
inputTokens: prompt - cached2,
|
||
outputTokens: completion - reasoning,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: cached2,
|
||
cachedInputTokens: cached2,
|
||
reasoningTokens: reasoning,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(model, prompt - cached2, completion, 0, cached2, 0),
|
||
costIsEstimated: namedModel === void 0,
|
||
tools: first ? info.tools : [],
|
||
bashCommands: first ? info.bashCommands : [],
|
||
subagentTypes: first ? info.subagentTypes : [],
|
||
timestamp: usage.ts,
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
userMessage: first ? info.userMessage : "",
|
||
sessionId: sid,
|
||
project: cwd ? basename28(cwd) : source.project,
|
||
projectPath: cwd
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function discoverSessions4(sessionsDir) {
|
||
const sources = [];
|
||
let cwdDirs;
|
||
try {
|
||
cwdDirs = await readdir29(sessionsDir);
|
||
} catch {
|
||
return sources;
|
||
}
|
||
const cwds = (await mapWithConcurrency(cwdDirs, FS_SCAN_CONCURRENCY, async (cwdName) => {
|
||
const cwdPath = join38(sessionsDir, cwdName);
|
||
const cwdStat = await stat27(cwdPath).catch(() => null);
|
||
if (!cwdStat?.isDirectory()) return [];
|
||
const sessionDirs = await readdir29(cwdPath).catch(() => null);
|
||
if (!sessionDirs) return [];
|
||
return sessionDirs.map((sessionName) => ({ cwdName, sessionPath: join38(cwdPath, sessionName) }));
|
||
})).flat();
|
||
const sessions = await mapWithConcurrency(cwds, FS_SCAN_CONCURRENCY, async ({ cwdName, sessionPath }) => {
|
||
const sessionStat = await stat27(sessionPath).catch(() => null);
|
||
if (!sessionStat?.isDirectory()) return null;
|
||
const summary = await readJson4(join38(sessionPath, "summary.json"));
|
||
if (!summary) return null;
|
||
const cwd = summary.info?.cwd ?? safeDecode(cwdName);
|
||
return { path: join38(sessionPath, "updates.jsonl"), project: basename28(cwd), provider: "grok" };
|
||
});
|
||
for (const source of sessions) if (source) sources.push(source);
|
||
return sources;
|
||
}
|
||
function createGrokProvider(sessionsDir) {
|
||
const dir = sessionsDir ?? defaultSessionsDir2();
|
||
const unifiedLogPath = join38(dirname14(dir), "logs", "unified.jsonl");
|
||
return {
|
||
name: "grok",
|
||
displayName: "Grok Build",
|
||
async probeRoots() {
|
||
return [{ path: dir, label: "sessions" }, { path: unifiedLogPath, label: "unified log" }];
|
||
},
|
||
modelDisplayName(model) {
|
||
if (model.startsWith("grok-build")) return "Grok Build";
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return toolNameMap21[rawTool] ?? rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
const sources = await discoverSessions4(dir);
|
||
if (await stat27(unifiedLogPath).catch(() => null)) {
|
||
sources.push({ path: unifiedLogPath, project: "grok", provider: "grok" });
|
||
}
|
||
return sources;
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
if (source.path === unifiedLogPath) return createUnifiedLogParser(source, seenKeys, dir);
|
||
return createParser22(source, seenKeys, unifiedLogPath);
|
||
}
|
||
};
|
||
}
|
||
var toolNameMap21, authoritativeTokenFields, loggedSessions, grok;
|
||
var init_grok = __esm({
|
||
"src/providers/grok.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_bash_utils();
|
||
toolNameMap21 = {
|
||
bash: "Bash",
|
||
run_terminal_command: "Bash",
|
||
read_file: "Read",
|
||
read: "Read",
|
||
write_file: "Write",
|
||
edit_file: "Edit",
|
||
edit: "Edit",
|
||
list_dir: "Glob",
|
||
glob: "Glob",
|
||
grep: "Grep",
|
||
search: "WebSearch",
|
||
web_search: "WebSearch",
|
||
fetch: "WebFetch",
|
||
task: "Agent",
|
||
search_replace: "Edit",
|
||
todo_write: "TodoWrite",
|
||
spawn_subagent: "Agent"
|
||
};
|
||
authoritativeTokenFields = [
|
||
"inputTokens",
|
||
"outputTokens",
|
||
"cachedReadTokens",
|
||
"cacheCreationTokens",
|
||
"reasoningTokens"
|
||
];
|
||
grok = createGrokProvider();
|
||
}
|
||
});
|
||
|
||
// src/cursor-import.ts
|
||
import { existsSync as existsSync9 } from "fs";
|
||
import { mkdir as mkdir3, readFile as readFile15, rename as rename3, stat as stat28, unlink as unlink3, writeFile } from "fs/promises";
|
||
import { dirname as dirname15, join as join39 } from "path";
|
||
function cursorImportPath() {
|
||
return join39(getCodeburnCacheDir(), "imports", "cursor-usage.v1.json");
|
||
}
|
||
function isGrokBotModel(model) {
|
||
return model.startsWith("grok-bot-");
|
||
}
|
||
function billedCost(cost) {
|
||
const m = /^\$?(\d+(?:\.\d+)?)$/.exec(cost.trim());
|
||
return m ? Number(m[1]) : null;
|
||
}
|
||
async function loadCursorImport() {
|
||
const path = cursorImportPath();
|
||
let key;
|
||
try {
|
||
const s = await stat28(path);
|
||
key = `${path}\0${s.ino}\0${s.mtimeMs}\0${s.size}`;
|
||
} catch {
|
||
return null;
|
||
}
|
||
if (memo?.key === key) return memo.store;
|
||
const parsed = JSON.parse(await readFile15(path, "utf-8"));
|
||
if (parsed?.version !== 1 || !Array.isArray(parsed.events) || !Array.isArray(parsed.ranges)) {
|
||
throw new Error(`unrecognized Cursor import file ${path}; remove it with \`codeburn import cursor --remove\``);
|
||
}
|
||
memo = { key, store: parsed };
|
||
return parsed;
|
||
}
|
||
function catalogModel(model) {
|
||
if (model === "auto" || model === "default") return "cursor-auto";
|
||
if (model.startsWith("cursor-grok-")) return model.slice("cursor-".length);
|
||
return model;
|
||
}
|
||
function importedCalls(store, provider) {
|
||
const bot = provider === GROK_BOT_PROVIDER;
|
||
const calls = [];
|
||
for (const e of store.events) {
|
||
if (isGrokBotModel(e.model) !== bot) continue;
|
||
const model = catalogModel(e.model);
|
||
const billed = billedCost(e.cost);
|
||
calls.push({
|
||
provider,
|
||
model,
|
||
inputTokens: e.input,
|
||
outputTokens: e.output,
|
||
cacheCreationInputTokens: e.inputCacheWrite,
|
||
cacheReadInputTokens: e.cacheRead,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: billed ?? calculateCost(model, e.input, e.output, e.inputCacheWrite, e.cacheRead, 0),
|
||
...billed !== null ? { costFromBilling: true } : {},
|
||
// Plan rows carry no dollars, and Auto and Grok Bot never name the model
|
||
// that served them, so their list price is a stand-in.
|
||
...billed === null && (bot || model === "cursor-auto") ? { costIsEstimated: true } : {},
|
||
billing: billed !== null ? "metered" : "subscription",
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: e.date,
|
||
speed: "standard",
|
||
deduplicationKey: `${CURSOR_IMPORT_KEY_PREFIX}${e.hash}`,
|
||
userMessage: "",
|
||
sessionId: e.cloudAgentId || e.automationId || `${CURSOR_IMPORT_KEY_PREFIX}${bot ? "grok-bot:" : ""}${e.date.slice(0, 10)}`,
|
||
project: bot ? GROK_BOT_IMPORT_PROJECT : CURSOR_IMPORT_PROJECT
|
||
});
|
||
}
|
||
return calls;
|
||
}
|
||
function importSource(provider) {
|
||
const path = cursorImportPath();
|
||
if (!existsSync9(path)) return [];
|
||
return [{ path, project: provider === GROK_BOT_PROVIDER ? GROK_BOT_IMPORT_PROJECT : CURSOR_IMPORT_PROJECT, provider }];
|
||
}
|
||
function importSourceParser(source, seenKeys, provider) {
|
||
if (source.path !== cursorImportPath()) return null;
|
||
return {
|
||
async *parse() {
|
||
const store = await loadCursorImport();
|
||
if (!store) return;
|
||
for (const call of importedCalls(store, provider)) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
var CURSOR_IMPORT_KEY_PREFIX, CURSOR_IMPORT_PROJECT, GROK_BOT_IMPORT_PROJECT, GROK_BOT_PROVIDER, memo;
|
||
var init_cursor_import = __esm({
|
||
"src/cursor-import.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_models();
|
||
CURSOR_IMPORT_KEY_PREFIX = "cursor-import:";
|
||
CURSOR_IMPORT_PROJECT = "Cursor (imported)";
|
||
GROK_BOT_IMPORT_PROJECT = "Grok Bot (imported)";
|
||
GROK_BOT_PROVIDER = "grokbot";
|
||
memo = null;
|
||
}
|
||
});
|
||
|
||
// src/providers/grokbot.ts
|
||
import { readdir as readdir30 } from "fs/promises";
|
||
import { homedir as homedir35 } from "os";
|
||
import { join as join40 } from "path";
|
||
function decodeBase32(name) {
|
||
const bytes = [];
|
||
let value = 0;
|
||
let bits = 0;
|
||
for (const char of name) {
|
||
const index = BASE32_ALPHABET.indexOf(char);
|
||
if (index < 0) return null;
|
||
value = value << 5 | index;
|
||
bits += 5;
|
||
if (bits >= 8) {
|
||
bits -= 8;
|
||
bytes.push(value >>> bits & 255);
|
||
}
|
||
}
|
||
try {
|
||
return Buffer.from(bytes).toString("utf-8");
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function grokbotPersistenceDir(platform4 = process.platform, home = homedir35()) {
|
||
const configured = process.env["CODEBURN_GROKBOT_DIR"]?.trim();
|
||
if (configured) return configured;
|
||
if (platform4 === "darwin") return join40(home, "Library", "Application Support", "Grok Bot", PERSISTENCE_DIR);
|
||
if (platform4 === "win32") {
|
||
const appData = process.env["APPDATA"]?.trim() || join40(home, "AppData", "Roaming");
|
||
return join40(appData, "Grok Bot", PERSISTENCE_DIR);
|
||
}
|
||
return join40(home, ".config", "Grok Bot", PERSISTENCE_DIR);
|
||
}
|
||
function isRecord8(value) {
|
||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||
}
|
||
function nonEmptyString5(value) {
|
||
return typeof value === "string" && value.length > 0 ? value : void 0;
|
||
}
|
||
async function readSlice(path) {
|
||
const content2 = await readSessionFile(path);
|
||
if (content2 === null) return null;
|
||
try {
|
||
const parsed = JSON.parse(content2);
|
||
if (!isRecord8(parsed)) return null;
|
||
return isRecord8(parsed["value"]) ? parsed["value"] : null;
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
async function readRoster(path) {
|
||
const names = /* @__PURE__ */ new Map();
|
||
const value = await readSlice(path);
|
||
const rows = value?.["rows"];
|
||
if (!Array.isArray(rows)) return names;
|
||
for (const row of rows) {
|
||
if (!isRecord8(row)) continue;
|
||
const id = nonEmptyString5(row["id"]);
|
||
const name = nonEmptyString5(row["name"]);
|
||
if (id && name) names.set(id, name);
|
||
}
|
||
return names;
|
||
}
|
||
function timestampOf(value) {
|
||
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
||
const ms = value < MIN_TIMESTAMP_MS ? value * 1e3 : value;
|
||
return ms >= MIN_TIMESTAMP_MS && ms < MAX_TIMESTAMP_MS ? ms : null;
|
||
}
|
||
function textOf(value) {
|
||
if (typeof value === "string") return value;
|
||
if (!isRecord8(value)) return "";
|
||
const content2 = value["content"];
|
||
return typeof content2 === "string" ? content2 : "";
|
||
}
|
||
function groupRequests(entries) {
|
||
const requests = /* @__PURE__ */ new Map();
|
||
for (const entry of entries) {
|
||
if (!isRecord8(entry)) continue;
|
||
const kind = entry["kind"];
|
||
if (kind !== "message" && kind !== "send-message") continue;
|
||
const timestampMs = timestampOf(entry["timestampMs"]);
|
||
if (timestampMs === null) continue;
|
||
const key = nonEmptyString5(entry["requestId"]) ?? nonEmptyString5(entry["id"]);
|
||
if (!key) continue;
|
||
let request = requests.get(key);
|
||
if (!request) {
|
||
request = { key, inputChars: 0, outputChars: 0, firstTimestampMs: timestampMs, userMessage: "" };
|
||
requests.set(key, request);
|
||
}
|
||
if (timestampMs < request.firstTimestampMs) request.firstTimestampMs = timestampMs;
|
||
if (kind === "send-message") {
|
||
request.outputChars += textOf(entry["message"]).length;
|
||
continue;
|
||
}
|
||
const content2 = textOf(entry["content"]);
|
||
if (entry["role"] === "assistant") {
|
||
request.outputChars += content2.length;
|
||
continue;
|
||
}
|
||
request.inputChars += content2.length;
|
||
if (!request.userMessage && entry["role"] === "user" && !isRecord8(entry["fromAgent"])) {
|
||
request.userMessage = content2;
|
||
}
|
||
}
|
||
return [...requests.values()];
|
||
}
|
||
function createParser23(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
const value = await readSlice(source.path);
|
||
const entries = value?.["entries"];
|
||
if (!Array.isArray(entries)) return;
|
||
const sessionId = source.sourceId ?? source.project;
|
||
for (const request of groupRequests(entries)) {
|
||
const inputTokens = estimateTokensFromChars(request.inputChars);
|
||
const outputTokens = estimateTokensFromChars(request.outputChars);
|
||
if (inputTokens + outputTokens === 0) continue;
|
||
const deduplicationKey = `grokbot:${sessionId}:${request.key}`;
|
||
if (seenKeys.has(deduplicationKey)) continue;
|
||
seenKeys.add(deduplicationKey);
|
||
yield {
|
||
provider: "grokbot",
|
||
model: MODEL_ID,
|
||
inputTokens,
|
||
outputTokens,
|
||
cacheCreationInputTokens: 0,
|
||
cacheReadInputTokens: 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD: calculateCost(MODEL_ID, inputTokens, outputTokens, 0, 0, 0),
|
||
costIsEstimated: true,
|
||
// The mirror carries chat entries only: no tool call and no shell
|
||
// command the bot ran on its box reaches this machine.
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: new Date(request.firstTimestampMs).toISOString(),
|
||
speed: "standard",
|
||
deduplicationKey,
|
||
userMessage: request.userMessage,
|
||
sessionId,
|
||
project: source.project
|
||
};
|
||
}
|
||
}
|
||
};
|
||
}
|
||
async function discoverSessions5(dir) {
|
||
let files;
|
||
try {
|
||
files = await readdir30(dir);
|
||
} catch {
|
||
return [];
|
||
}
|
||
const slices = files.filter((file) => file.endsWith(".blob")).map((file) => ({ file, key: decodeBase32(file.slice(0, -".blob".length)) })).filter((slice) => slice.key !== null);
|
||
const rosterFiles = slices.filter((slice) => ROSTER_SLICE.test(slice.key));
|
||
const rosters = await mapWithConcurrency(rosterFiles, FS_SCAN_CONCURRENCY, (slice) => readRoster(join40(dir, slice.file)));
|
||
const names = /* @__PURE__ */ new Map();
|
||
for (const roster of rosters) for (const [id, name] of roster) names.set(id, name);
|
||
const sources = [];
|
||
for (const slice of slices) {
|
||
const match = TRANSCRIPT_SLICE.exec(slice.key);
|
||
if (!match) continue;
|
||
const agentId = match[2];
|
||
const botName = names.get(agentId);
|
||
sources.push({
|
||
path: join40(dir, slice.file),
|
||
// Grok Bot has no project: work is organised by bot, so the bot's own
|
||
// name is what the report groups by, with the same name as the agent
|
||
// label for surfaces that show both.
|
||
project: botName ?? agentId,
|
||
provider: "grokbot",
|
||
sourceId: agentId,
|
||
...botName ? { sourceLabel: botName, agentName: botName } : {}
|
||
});
|
||
}
|
||
return sources;
|
||
}
|
||
function createGrokbotProvider(persistenceDir) {
|
||
const resolveDir = () => persistenceDir ?? grokbotPersistenceDir();
|
||
return {
|
||
name: "grokbot",
|
||
displayName: "Grok Bot",
|
||
async probeRoots() {
|
||
return [{ path: resolveDir(), label: "client persistence" }];
|
||
},
|
||
modelDisplayName(model) {
|
||
return getShortModelName(model);
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return rawTool;
|
||
},
|
||
async discoverSessions() {
|
||
return [...await discoverSessions5(resolveDir()), ...importSource("grokbot")];
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return importSourceParser(source, seenKeys, "grokbot") ?? createParser23(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var PERSISTENCE_DIR, TRANSCRIPT_SLICE, ROSTER_SLICE, MODEL_ID, BASE32_ALPHABET, MIN_TIMESTAMP_MS, MAX_TIMESTAMP_MS, grokbot;
|
||
var init_grokbot = __esm({
|
||
"src/providers/grokbot.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_token_estimate();
|
||
init_cursor_import();
|
||
PERSISTENCE_DIR = "sand-client-persistence";
|
||
TRANSCRIPT_SLICE = /^sand\.client\.slice\.account\.(.+)\.transcript\.replicas\.(.+)$/;
|
||
ROSTER_SLICE = /^sand\.client\.slice\.account\.(.+)\.roster\.last-roster$/;
|
||
MODEL_ID = "grokbot-auto";
|
||
BASE32_ALPHABET = "abcdefghijklmnopqrstuvwxyz234567";
|
||
MIN_TIMESTAMP_MS = Date.UTC(2020, 0, 1);
|
||
MAX_TIMESTAMP_MS = Date.UTC(2100, 0, 1);
|
||
grokbot = createGrokbotProvider();
|
||
}
|
||
});
|
||
|
||
// src/providers/index.ts
|
||
var init_providers = __esm({
|
||
"src/providers/index.ts"() {
|
||
"use strict";
|
||
init_amp();
|
||
init_claude();
|
||
init_cline();
|
||
init_cline_cli();
|
||
init_codewhale();
|
||
init_command_code();
|
||
init_codebuff();
|
||
init_codex();
|
||
init_copilot();
|
||
init_droid();
|
||
init_devin();
|
||
init_dsh();
|
||
init_gemini();
|
||
init_hermes();
|
||
init_ibm_bob();
|
||
init_kilo_code();
|
||
init_kiro();
|
||
init_kimi();
|
||
init_kimicode();
|
||
init_lingtai_tui();
|
||
init_mistral_vibe();
|
||
init_mux();
|
||
init_openclaw();
|
||
init_openclaude();
|
||
init_open_design();
|
||
init_pi();
|
||
init_qwen();
|
||
init_quickdesk();
|
||
init_zerostack();
|
||
init_grok();
|
||
init_grokbot();
|
||
init_sqlite();
|
||
}
|
||
});
|
||
|
||
// src/providers/antigravity.ts
|
||
import { readdir as readdir31, readFile as readFile16, mkdir as mkdir4, stat as stat29, open as open6, rename as rename4, unlink as unlink4 } from "fs/promises";
|
||
import { execFile } from "child_process";
|
||
import { basename as basename29, join as join41, resolve as resolve8 } from "path";
|
||
import { homedir as homedir36 } from "os";
|
||
import { fileURLToPath } from "url";
|
||
import https from "https";
|
||
function conversationRoots() {
|
||
const home = homedir36();
|
||
return [
|
||
{
|
||
dir: join41(home, ".gemini", "antigravity", "conversations"),
|
||
project: "antigravity",
|
||
extensions: [".pb", ".db"]
|
||
},
|
||
{
|
||
dir: join41(home, ".gemini", "antigravity-cli", "conversations"),
|
||
project: "antigravity-cli",
|
||
extensions: [".pb", ".db"]
|
||
},
|
||
{
|
||
dir: join41(home, ".gemini", "antigravity-cli", "implicit"),
|
||
project: "antigravity-cli",
|
||
extensions: [".pb"]
|
||
},
|
||
{
|
||
dir: join41(home, ".gemini", "antigravity-ide", "conversations"),
|
||
project: "antigravity-ide",
|
||
extensions: [".pb", ".db"]
|
||
},
|
||
{
|
||
dir: join41(home, ".gemini", "antigravity-ide", "implicit"),
|
||
project: "antigravity-ide",
|
||
extensions: [".pb"]
|
||
}
|
||
];
|
||
}
|
||
function antigravityCacheFileName(version = CACHE_VERSION) {
|
||
return `antigravity-results.v${version}.json`;
|
||
}
|
||
function getAgent() {
|
||
if (!httpsAgent) httpsAgent = new https.Agent({ rejectUnauthorized: false });
|
||
return httpsAgent;
|
||
}
|
||
function currentCacheDir2() {
|
||
return resolve8(getCodeburnCacheDir());
|
||
}
|
||
function getCachePath2(cacheDir) {
|
||
return join41(cacheDir, antigravityCacheFileName());
|
||
}
|
||
function getLegacyCachePath2(cacheDir) {
|
||
return join41(cacheDir, ANTIGRAVITY_LEGACY_CACHE_FILE);
|
||
}
|
||
function isCurrentCache2(cache) {
|
||
return cache.version === CACHE_VERSION && !!cache.cascades && typeof cache.cascades === "object";
|
||
}
|
||
function getAntigravityStatusLineEventsPath() {
|
||
return join41(getCodeburnCacheDir(), "antigravity-statusline.jsonl");
|
||
}
|
||
function execFileText(command, args, timeout = 3e3) {
|
||
return new Promise((resolve9, reject) => {
|
||
execFile(command, args, { encoding: "utf-8", timeout, maxBuffer: 1024 * 1024 }, (err, stdout) => {
|
||
if (err) reject(err);
|
||
else resolve9(stdout);
|
||
});
|
||
});
|
||
}
|
||
function getFlagValue(line, names) {
|
||
for (const name of names) {
|
||
const match = line.match(new RegExp(`--${name}(?:=|\\s+)(?:"([^"]+)"|'([^']+)'|([^\\s]+))`, "i"));
|
||
const value = match?.[1] ?? match?.[2] ?? match?.[3];
|
||
if (value && !value.startsWith("--")) return value;
|
||
}
|
||
return null;
|
||
}
|
||
function isLikelyCsrfToken(value) {
|
||
return value.length >= 16 && /^[A-Za-z0-9._~:/+=-]+$/.test(value);
|
||
}
|
||
function normalizeAppDataDir(value) {
|
||
if (!value) return void 0;
|
||
const normalized = value.replace(/\\/g, "/").toLowerCase();
|
||
if (normalized.includes("antigravity-ide")) return "antigravity-ide";
|
||
if (normalized.includes("antigravity-cli")) return "antigravity-cli";
|
||
if (normalized.includes("antigravity")) return "antigravity";
|
||
return void 0;
|
||
}
|
||
function extractAntigravityAppDataDirFromLine(line) {
|
||
return normalizeAppDataDir(getFlagValue(line, APP_DATA_DIR_FLAGS));
|
||
}
|
||
function parseAntigravityServerCandidateFromLine(line) {
|
||
const lower = line.toLowerCase();
|
||
if (!lower.includes("language_server") || !lower.includes("antigravity")) return null;
|
||
const rawPort = getFlagValue(line, SERVER_PORT_FLAGS);
|
||
const csrfToken = getFlagValue(line, CSRF_TOKEN_FLAGS);
|
||
if (!rawPort || !csrfToken) return null;
|
||
if (!isLikelyCsrfToken(csrfToken)) return null;
|
||
const port2 = Number(rawPort);
|
||
if (!Number.isInteger(port2) || port2 < 0 || port2 > 65535) return null;
|
||
return {
|
||
port: port2,
|
||
csrfToken,
|
||
appDataDir: extractAntigravityAppDataDirFromLine(line)
|
||
};
|
||
}
|
||
function parseAntigravityServerCandidates(lines) {
|
||
return lines.map(parseAntigravityServerCandidateFromLine).filter((server) => server !== null);
|
||
}
|
||
function dropPlaceholderModelId(model) {
|
||
return MODEL_PLACEHOLDER_PATTERN.test(model) ? "unknown" : model;
|
||
}
|
||
function getCanonicalModelId(key, displayName) {
|
||
if (displayName) {
|
||
const lower = displayName.toLowerCase();
|
||
if (lower.includes("3.5 flash")) {
|
||
if (lower.includes("high")) return "gemini-3.5-flash-high";
|
||
if (lower.includes("medium")) return "gemini-3.5-flash-medium";
|
||
if (lower.includes("low")) return "gemini-3.5-flash-low";
|
||
return "gemini-3.5-flash";
|
||
}
|
||
if (lower.includes("3.1 pro")) {
|
||
if (lower.includes("high")) return "gemini-3.1-pro-high";
|
||
if (lower.includes("low")) return "gemini-3.1-pro-low";
|
||
return "gemini-3.1-pro";
|
||
}
|
||
if (lower.includes("3.1 flash")) {
|
||
if (lower.includes("image")) return "gemini-3.1-flash-image";
|
||
if (lower.includes("lite")) return "gemini-3.1-flash-lite";
|
||
return "gemini-3.1-flash";
|
||
}
|
||
if (lower.includes("3 flash")) {
|
||
return "gemini-3-flash";
|
||
}
|
||
if (lower.includes("3 pro")) {
|
||
return "gemini-3-pro";
|
||
}
|
||
}
|
||
return dropPlaceholderModelId(key);
|
||
}
|
||
function extractAntigravityModelMap(resp) {
|
||
if (!resp || typeof resp !== "object") return {};
|
||
const data = resp;
|
||
const models = data.response?.models ?? data.models;
|
||
const map = /* @__PURE__ */ new Map();
|
||
if (!models) return {};
|
||
for (const [key, info] of Object.entries(models)) {
|
||
if (info && typeof info === "object" && typeof info.model === "string") {
|
||
const canonicalKey = getCanonicalModelId(key, info.displayName);
|
||
map.set(info.model, canonicalKey);
|
||
}
|
||
}
|
||
return Object.fromEntries(map);
|
||
}
|
||
function extractAntigravityGeneratorMetadata(resp) {
|
||
if (!resp || typeof resp !== "object") return [];
|
||
const data = resp;
|
||
const metadata = data.response?.generatorMetadata ?? data.generatorMetadata;
|
||
return Array.isArray(metadata) ? metadata : [];
|
||
}
|
||
async function loadCache2(cacheDir) {
|
||
const inMemory = cacheStates.get(cacheDir);
|
||
if (inMemory) return inMemory;
|
||
const versioned = await readExistingTextFile(getCachePath2(cacheDir));
|
||
if (versioned.status === "ok") {
|
||
try {
|
||
const cache = JSON.parse(versioned.text);
|
||
if (isCurrentCache2(cache)) {
|
||
const state2 = { cache, dirty: false };
|
||
cacheStates.set(cacheDir, state2);
|
||
return state2;
|
||
}
|
||
} catch {
|
||
}
|
||
const invalid = {
|
||
cache: { version: CACHE_VERSION, cascades: {} },
|
||
dirty: false
|
||
};
|
||
cacheStates.set(cacheDir, invalid);
|
||
return invalid;
|
||
}
|
||
if (versioned.status === "unreadable") {
|
||
const invalid = {
|
||
cache: { version: CACHE_VERSION, cascades: {} },
|
||
dirty: false
|
||
};
|
||
cacheStates.set(cacheDir, invalid);
|
||
return invalid;
|
||
}
|
||
try {
|
||
const raw = await readFile16(getLegacyCachePath2(cacheDir), "utf-8");
|
||
const cache = JSON.parse(raw);
|
||
if (isCurrentCache2(cache)) {
|
||
const state2 = { cache, dirty: false };
|
||
cacheStates.set(cacheDir, state2);
|
||
return state2;
|
||
}
|
||
} catch {
|
||
}
|
||
const state = {
|
||
cache: { version: CACHE_VERSION, cascades: {} },
|
||
dirty: false
|
||
};
|
||
cacheStates.set(cacheDir, state);
|
||
return state;
|
||
}
|
||
async function adoptPreviousVersionCascade(cacheDir, state, cascadeId) {
|
||
let cascades = previousVersionCascades.get(cacheDir);
|
||
if (!cascades) {
|
||
cascades = {};
|
||
try {
|
||
const cache = JSON.parse(await readFile16(join41(cacheDir, antigravityCacheFileName(CACHE_VERSION - 1)), "utf-8"));
|
||
if (cache.version === CACHE_VERSION - 1 && cache.cascades && typeof cache.cascades === "object") cascades = cache.cascades;
|
||
} catch {
|
||
}
|
||
previousVersionCascades.set(cacheDir, cascades);
|
||
}
|
||
const previous = cascades[cascadeId];
|
||
if (!previous?.calls?.length) return void 0;
|
||
const adopted = { mtimeMs: -1, sizeBytes: previous.sizeBytes, calls: previous.calls };
|
||
state.cache.cascades[cascadeId] = adopted;
|
||
state.dirty = true;
|
||
return adopted;
|
||
}
|
||
async function readProcessCommandLines() {
|
||
if (process.platform === "win32") {
|
||
const script = [
|
||
"$ErrorActionPreference = 'SilentlyContinue'",
|
||
"[Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
|
||
"Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -and $_.CommandLine -like '*language_server*' -and $_.CommandLine -like '*antigravity*' } | ForEach-Object { $_.CommandLine }"
|
||
].join("; ");
|
||
const output2 = await execFileText("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", script], 5e3);
|
||
return output2.split(/\r?\n/);
|
||
}
|
||
const output = await execFileText("ps", ["-ww", "-eo", "args"]);
|
||
return output.split("\n");
|
||
}
|
||
async function resolveEphemeralPort(csrfToken, appDataDir) {
|
||
if (process.platform === "win32") {
|
||
try {
|
||
const script = [
|
||
"$ErrorActionPreference = 'SilentlyContinue'",
|
||
"[Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
|
||
"Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -and $_.CommandLine -like '*language_server*' -and $_.CommandLine -like '*antigravity*' } | ForEach-Object { @{ PID = $_.ProcessId; Cmd = $_.CommandLine } | ConvertTo-Json -Compress }"
|
||
].join("; ");
|
||
const output = await execFileText("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", script], 5e3);
|
||
let targetPid = 0;
|
||
for (const line of output.split(/\r?\n/)) {
|
||
if (!line.trim()) continue;
|
||
try {
|
||
const proc = JSON.parse(line);
|
||
const candidate = parseAntigravityServerCandidateFromLine(proc.Cmd);
|
||
if (candidate && candidate.csrfToken === csrfToken) {
|
||
if (!appDataDir || !candidate.appDataDir || candidate.appDataDir === appDataDir) {
|
||
targetPid = proc.PID;
|
||
break;
|
||
}
|
||
}
|
||
} catch {
|
||
}
|
||
}
|
||
if (targetPid === 0) return null;
|
||
const portScript = `Get-NetTCPConnection -State Listen -OwningProcess ${targetPid} | Select-Object -ExpandProperty LocalPort`;
|
||
const portOutput = await execFileText("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", portScript], 5e3);
|
||
const ports = portOutput.split(/\r?\n/).map((p) => Number(p.trim())).filter((p) => Number.isInteger(p) && p > 0);
|
||
for (const port2 of ports) {
|
||
try {
|
||
await new Promise((resolve9, reject) => {
|
||
const req = https.request({
|
||
hostname: "127.0.0.1",
|
||
port: port2,
|
||
path: "/exa.language_server_pb.LanguageServerService/GetAvailableModels",
|
||
method: "POST",
|
||
headers: {
|
||
"Content-Type": "application/json",
|
||
"Connect-Protocol-Version": "1",
|
||
"X-Codeium-Csrf-Token": csrfToken,
|
||
"Content-Length": 2
|
||
},
|
||
agent: getAgent(),
|
||
timeout: 1e3
|
||
}, (res) => {
|
||
if (res.statusCode === 200) resolve9(true);
|
||
else reject(new Error());
|
||
});
|
||
req.on("error", reject);
|
||
req.write("{}");
|
||
req.end();
|
||
});
|
||
return { port: port2, csrfToken };
|
||
} catch {
|
||
}
|
||
}
|
||
} catch {
|
||
}
|
||
return null;
|
||
}
|
||
try {
|
||
const processOutput = await execFileText("ps", ["-ww", "-eo", "pid=,args="]);
|
||
let pid = "";
|
||
for (const line of processOutput.split("\n")) {
|
||
const match = line.trim().match(/^(\d+)\s+(.+)$/);
|
||
if (!match) continue;
|
||
const candidate = parseAntigravityServerCandidateFromLine(match[2]);
|
||
if (!candidate) continue;
|
||
if (candidate.csrfToken !== csrfToken) continue;
|
||
if (appDataDir && candidate.appDataDir && candidate.appDataDir !== appDataDir) continue;
|
||
pid = match[1];
|
||
break;
|
||
}
|
||
if (!pid) return null;
|
||
const lsofOutput = await execFileText("lsof", ["-a", "-i", "-P", "-n", "-p", pid]);
|
||
for (const line of lsofOutput.split("\n")) {
|
||
if (!line.includes("LISTEN")) continue;
|
||
const match = line.match(/:(\d+)\s+\(LISTEN\)/);
|
||
if (match) {
|
||
const port2 = Number(match[1]);
|
||
if (port2 > 0) return { port: port2, csrfToken };
|
||
}
|
||
}
|
||
} catch {
|
||
}
|
||
return null;
|
||
}
|
||
function antigravityAppDataDirFromSourcePath(path) {
|
||
const lower = path.replace(/\\/g, "/").toLowerCase();
|
||
if (lower.includes("/.gemini/antigravity-ide/")) return "antigravity-ide";
|
||
if (lower.includes("/.gemini/antigravity-cli/")) return "antigravity-cli";
|
||
return "antigravity";
|
||
}
|
||
function cachedValueIsFresh(cached2, failed) {
|
||
if (!cached2) return false;
|
||
const ttl = failed(cached2.value) ? DETECT_FAILURE_TTL_MS : DETECT_SUCCESS_TTL_MS;
|
||
return Date.now() - cached2.at < ttl;
|
||
}
|
||
async function detectServer(appDataDir = "antigravity") {
|
||
const cached2 = cachedServers.get(appDataDir);
|
||
if (cachedValueIsFresh(cached2, (value) => value === null)) return cached2.value;
|
||
let resolved = null;
|
||
try {
|
||
const candidates = parseAntigravityServerCandidates(await readProcessCommandLines());
|
||
const info = candidates.find((candidate) => candidate.appDataDir === appDataDir) ?? (appDataDir === "antigravity" ? candidates.find((candidate) => candidate.appDataDir === void 0) : void 0) ?? null;
|
||
if (info && info.port > 0 && appDataDir !== "antigravity-ide") {
|
||
resolved = { port: info.port, csrfToken: info.csrfToken };
|
||
} else if (info) {
|
||
resolved = await resolveEphemeralPort(info.csrfToken, appDataDir);
|
||
}
|
||
} catch {
|
||
}
|
||
cachedServers.set(appDataDir, { value: resolved, at: Date.now() });
|
||
return resolved;
|
||
}
|
||
async function rpc(server, method, body = {}) {
|
||
return new Promise((resolve9, reject) => {
|
||
const data = JSON.stringify(body);
|
||
const req = https.request({
|
||
hostname: "127.0.0.1",
|
||
port: server.port,
|
||
path: `/exa.language_server_pb.LanguageServerService/${method}`,
|
||
method: "POST",
|
||
headers: {
|
||
"Content-Type": "application/json",
|
||
"Connect-Protocol-Version": "1",
|
||
"X-Codeium-Csrf-Token": server.csrfToken,
|
||
"Content-Length": Buffer.byteLength(data)
|
||
},
|
||
agent: getAgent(),
|
||
timeout: RPC_TIMEOUT_MS
|
||
}, (res) => {
|
||
const chunks = [];
|
||
let totalBytes = 0;
|
||
res.on("data", (chunk) => {
|
||
totalBytes += chunk.length;
|
||
if (totalBytes > MAX_RESPONSE_BYTES) {
|
||
res.destroy();
|
||
reject(new Error(`RPC ${method}: response too large`));
|
||
return;
|
||
}
|
||
chunks.push(chunk);
|
||
});
|
||
res.on("end", () => {
|
||
if (res.statusCode !== 200) {
|
||
reject(new Error(`RPC ${method}: HTTP ${res.statusCode}`));
|
||
return;
|
||
}
|
||
try {
|
||
resolve9(JSON.parse(Buffer.concat(chunks).toString("utf-8")));
|
||
} catch {
|
||
reject(new Error(`RPC ${method}: invalid JSON`));
|
||
}
|
||
});
|
||
res.on("error", reject);
|
||
});
|
||
req.on("error", reject);
|
||
req.on("timeout", () => {
|
||
req.destroy();
|
||
reject(new Error(`RPC ${method}: timeout`));
|
||
});
|
||
req.write(data);
|
||
req.end();
|
||
});
|
||
}
|
||
async function getModelMap(server) {
|
||
const cacheKey = `${server.port}:${server.csrfToken}`;
|
||
const cached2 = cachedModelMaps.get(cacheKey);
|
||
if (cachedValueIsFresh(cached2, (value) => Object.keys(value).length === 0)) return cached2.value;
|
||
try {
|
||
const modelMap = extractAntigravityModelMap(await rpc(server, "GetAvailableModels"));
|
||
cachedModelMaps.set(cacheKey, { value: modelMap, at: Date.now() });
|
||
return modelMap;
|
||
} catch {
|
||
}
|
||
cachedModelMaps.set(cacheKey, { value: {}, at: Date.now() });
|
||
return {};
|
||
}
|
||
function normalizePricingModel(model) {
|
||
const stripped = model.replace(/-(high|medium|low|agent)$/, "");
|
||
return PRICING_ALIASES[stripped] ?? stripped;
|
||
}
|
||
function readProtoVarint(data, startOffset) {
|
||
let value = 0n;
|
||
let shift = 0n;
|
||
let offset = startOffset;
|
||
while (offset < data.length) {
|
||
const byte = BigInt(data[offset]);
|
||
offset += 1;
|
||
value |= (byte & 0x7fn) << shift;
|
||
if ((byte & 0x80n) === 0n) return { value, offset };
|
||
shift += 7n;
|
||
if (shift > 70n) return null;
|
||
}
|
||
return null;
|
||
}
|
||
function parseProtoFields(data) {
|
||
const fields = [];
|
||
let offset = 0;
|
||
while (offset < data.length) {
|
||
const key = readProtoVarint(data, offset);
|
||
if (!key) break;
|
||
offset = key.offset;
|
||
const fieldNumber = Number(key.value >> 3n);
|
||
const wireType = Number(key.value & 0x7n);
|
||
if (!Number.isSafeInteger(fieldNumber) || fieldNumber <= 0) break;
|
||
if (wireType === 0) {
|
||
const value = readProtoVarint(data, offset);
|
||
if (!value) break;
|
||
fields.push({ number: fieldNumber, wireType, value: value.value });
|
||
offset = value.offset;
|
||
continue;
|
||
}
|
||
if (wireType === 1) {
|
||
if (offset + 8 > data.length) break;
|
||
fields.push({ number: fieldNumber, wireType, bytes: data.subarray(offset, offset + 8) });
|
||
offset += 8;
|
||
continue;
|
||
}
|
||
if (wireType === 2) {
|
||
const length = readProtoVarint(data, offset);
|
||
if (!length) break;
|
||
offset = length.offset;
|
||
const byteLength = Number(length.value);
|
||
if (!Number.isSafeInteger(byteLength) || byteLength < 0 || offset + byteLength > data.length) break;
|
||
fields.push({ number: fieldNumber, wireType, bytes: data.subarray(offset, offset + byteLength) });
|
||
offset += byteLength;
|
||
continue;
|
||
}
|
||
if (wireType === 5) {
|
||
if (offset + 4 > data.length) break;
|
||
fields.push({ number: fieldNumber, wireType, bytes: data.subarray(offset, offset + 4) });
|
||
offset += 4;
|
||
continue;
|
||
}
|
||
break;
|
||
}
|
||
return fields;
|
||
}
|
||
function firstProtoField(fields, fieldNumber) {
|
||
return fields.find((field) => field.number === fieldNumber);
|
||
}
|
||
function protoFieldText(field) {
|
||
if (!field?.bytes || field.bytes.length === 0) return void 0;
|
||
const text2 = protoTextDecoder.decode(field.bytes);
|
||
if (!text2 || /[\u0000-\u0008\u000E-\u001F\u007F\uFFFD]/.test(text2)) return void 0;
|
||
return text2;
|
||
}
|
||
function protoFieldPositiveInteger(field) {
|
||
if (field?.value === void 0) return 0;
|
||
const value = Number(field.value);
|
||
return Number.isSafeInteger(value) && value > 0 ? value : 0;
|
||
}
|
||
function protoFieldBytes(field) {
|
||
return field?.bytes;
|
||
}
|
||
function isAntigravityResponseId(value) {
|
||
return /^[^\s]+$/.test(value);
|
||
}
|
||
function antigravitySqliteResponseId(usageFields, fallback) {
|
||
const responseId = protoFieldText(firstProtoField(usageFields, 11));
|
||
return responseId && isAntigravityResponseId(responseId) ? responseId : fallback;
|
||
}
|
||
function genMetadataDataBytes(value) {
|
||
return typeof value === "string" ? new TextEncoder().encode(value) : value;
|
||
}
|
||
function antigravitySqliteMetadataAttributes(chatFields) {
|
||
const attributes = /* @__PURE__ */ new Map();
|
||
for (const field of chatFields) {
|
||
if (field.number !== 20) continue;
|
||
const pairFields = parseProtoFields(protoFieldBytes(field) ?? new Uint8Array());
|
||
const key = protoFieldText(firstProtoField(pairFields, 1));
|
||
const value = protoFieldText(firstProtoField(pairFields, 2));
|
||
if (key && value) attributes.set(key, value);
|
||
}
|
||
return attributes;
|
||
}
|
||
function antigravitySqliteModel(chatFields) {
|
||
const attributes = antigravitySqliteMetadataAttributes(chatFields);
|
||
const displayName = protoFieldText(firstProtoField(chatFields, 21));
|
||
const placeholderModel = PLACEHOLDER_MODELS[attributes.get("model_enum") ?? ""];
|
||
if (!displayName && placeholderModel) return { model: placeholderModel, estimated: true };
|
||
const rawModel = protoFieldText(firstProtoField(chatFields, 19)) ?? attributes.get("model_enum") ?? displayName ?? "unknown";
|
||
return { model: getCanonicalModelId(rawModel, displayName), estimated: false };
|
||
}
|
||
function protoTimestampToIso(field) {
|
||
if (!field) return "";
|
||
const text2 = protoFieldText(field);
|
||
if (text2 && !Number.isNaN(Date.parse(text2))) return new Date(text2).toISOString();
|
||
if (field.bytes) {
|
||
const tsFields = parseProtoFields(field.bytes);
|
||
const seconds = firstProtoField(tsFields, 1)?.value;
|
||
if (seconds !== void 0) {
|
||
const nanos = firstProtoField(tsFields, 2)?.value ?? 0n;
|
||
const ms = Number(seconds) * 1e3 + Math.floor(Number(nanos) / 1e6);
|
||
if (Number.isSafeInteger(ms) && ms > 0) return new Date(ms).toISOString();
|
||
}
|
||
}
|
||
if (field.value !== void 0) {
|
||
const raw = Number(field.value);
|
||
const ms = raw < 1e12 ? raw * 1e3 : raw;
|
||
if (Number.isSafeInteger(ms) && ms > 0) return new Date(ms).toISOString();
|
||
}
|
||
return "";
|
||
}
|
||
function antigravitySqliteCreatedAt(chatFields) {
|
||
const metadataBytes = protoFieldBytes(firstProtoField(chatFields, 9));
|
||
if (!metadataBytes) return "";
|
||
return protoTimestampToIso(firstProtoField(parseProtoFields(metadataBytes), 4));
|
||
}
|
||
function normalizeAntigravityToolCall(toolName, args) {
|
||
if (!toolName) return "";
|
||
if (toolName === "call_mcp_tool") {
|
||
const rawServer = args?.["ServerName"] ?? args?.["server_name"] ?? args?.["serverName"] ?? args?.["server"] ?? args?.["Server"];
|
||
const server = typeof rawServer === "string" ? rawServer.trim() : "";
|
||
const rawTool = args?.["ToolName"] ?? args?.["tool_name"] ?? args?.["toolName"] ?? args?.["tool"] ?? args?.["Tool"];
|
||
const tool = typeof rawTool === "string" ? rawTool.trim() : "";
|
||
if (server && tool) {
|
||
return `mcp__${server}__${tool}`;
|
||
}
|
||
return "call_mcp_tool";
|
||
}
|
||
if (toolName.startsWith("mcp__")) {
|
||
return toolName;
|
||
}
|
||
if (toolName.startsWith("mcp_")) {
|
||
const rest = toolName.slice(4);
|
||
const sep3 = rest.indexOf("_");
|
||
if (sep3 > 0 && sep3 < rest.length - 1) {
|
||
const server = rest.slice(0, sep3);
|
||
const tool = rest.slice(sep3 + 1);
|
||
return `mcp__${server}__${tool}`;
|
||
}
|
||
return toolName;
|
||
}
|
||
return toolName;
|
||
}
|
||
function extractAntigravityToolFromStep(metadataBytes, turn) {
|
||
const fields = parseProtoFields(metadataBytes);
|
||
for (const field of fields) {
|
||
if (field.number !== 4 || !field.bytes) continue;
|
||
const toolFields = parseProtoFields(field.bytes);
|
||
const toolName = protoFieldText(firstProtoField(toolFields, 2));
|
||
if (!toolName || toolName === "send_message") continue;
|
||
const rawArgs = protoFieldText(firstProtoField(toolFields, 3));
|
||
let args = null;
|
||
if (rawArgs) {
|
||
try {
|
||
const parsed = JSON.parse(rawArgs);
|
||
if (parsed && typeof parsed === "object") args = parsed;
|
||
} catch {
|
||
}
|
||
}
|
||
if (toolName === "call_mcp_tool") {
|
||
turn.tools.push(normalizeAntigravityToolCall(toolName, args));
|
||
continue;
|
||
}
|
||
if (toolName === "run_command") {
|
||
turn.tools.push(toolName);
|
||
const cmd = typeof args?.["CommandLine"] === "string" ? args["CommandLine"].trim() : "";
|
||
if (cmd) turn.bashCommands.push(...extractBashCommands(cmd));
|
||
continue;
|
||
}
|
||
if (toolName === "view_file") {
|
||
turn.tools.push(toolName);
|
||
const path = typeof args?.["AbsolutePath"] === "string" ? args["AbsolutePath"] : typeof args?.["file_path"] === "string" ? args["file_path"] : "";
|
||
if (path) {
|
||
const match = path.match(SKILL_MD_PATTERN);
|
||
if (match?.[1]) {
|
||
if (!turn.skills) turn.skills = [];
|
||
turn.skills.push(match[1]);
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
if (toolName === "invoke_subagent") {
|
||
turn.tools.push(toolNameMap22[toolName]);
|
||
if (Array.isArray(args?.["Subagents"])) {
|
||
for (const sa of args["Subagents"]) {
|
||
if (sa && typeof sa === "object") {
|
||
const typeOrRole = typeof sa["TypeName"] === "string" && sa["TypeName"] ? sa["TypeName"] : typeof sa["Role"] === "string" ? sa["Role"] : "";
|
||
if (typeOrRole) {
|
||
if (!turn.subagentTypes) turn.subagentTypes = [];
|
||
turn.subagentTypes.push(typeOrRole);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
continue;
|
||
}
|
||
turn.tools.push(toolNameMap22[toolName] ?? normalizeAntigravityToolCall(toolName, args));
|
||
}
|
||
}
|
||
function decodePackedVarints(data) {
|
||
const values = [];
|
||
let offset = 0;
|
||
while (offset < data.length) {
|
||
const res = readProtoVarint(data, offset);
|
||
if (!res) break;
|
||
values.push(Number(res.value));
|
||
offset = res.offset;
|
||
}
|
||
return values;
|
||
}
|
||
function buildCallFromSqliteGenMetadataRow(cascadeId, row, rootFields, turnTools, firstStepTimestamp = "") {
|
||
const chatFields = parseProtoFields(protoFieldBytes(firstProtoField(rootFields, 1)) ?? new Uint8Array());
|
||
const usageFields = parseProtoFields(protoFieldBytes(firstProtoField(chatFields, 4)) ?? new Uint8Array());
|
||
if (usageFields.length === 0) return null;
|
||
const inputTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 2));
|
||
const totalOutputTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 3));
|
||
const cacheWriteTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 4));
|
||
const cacheReadTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 5));
|
||
let thinkingTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 9));
|
||
let responseTokens = protoFieldPositiveInteger(firstProtoField(usageFields, 10));
|
||
if (responseTokens === 0 && thinkingTokens === 0) {
|
||
responseTokens = totalOutputTokens;
|
||
} else if (totalOutputTokens > 0 && responseTokens + thinkingTokens !== totalOutputTokens) {
|
||
const adjustedResponseTokens = totalOutputTokens - thinkingTokens;
|
||
if (adjustedResponseTokens >= 0) responseTokens = adjustedResponseTokens;
|
||
}
|
||
if (inputTokens === 0 && totalOutputTokens === 0) return null;
|
||
const responseId = antigravitySqliteResponseId(usageFields, String(row.idx));
|
||
const { model, estimated } = antigravitySqliteModel(chatFields);
|
||
const pricingModel = normalizePricingModel(model);
|
||
const costUSD = calculateCost(pricingModel, inputTokens, responseTokens + thinkingTokens, cacheWriteTokens, cacheReadTokens, 0, "standard", 0, "antigravity");
|
||
return {
|
||
provider: "antigravity",
|
||
model,
|
||
inputTokens,
|
||
outputTokens: responseTokens,
|
||
cacheCreationInputTokens: cacheWriteTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: thinkingTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
...estimated ? { costIsEstimated: true } : {},
|
||
tools: turnTools?.tools ?? [],
|
||
bashCommands: turnTools?.bashCommands ?? [],
|
||
...turnTools?.skills && turnTools.skills.length > 0 ? { skills: turnTools.skills } : {},
|
||
...turnTools?.subagentTypes && turnTools.subagentTypes.length > 0 ? { subagentTypes: turnTools.subagentTypes } : {},
|
||
timestamp: antigravitySqliteCreatedAt(chatFields) || firstStepTimestamp,
|
||
speed: "standard",
|
||
deduplicationKey: `antigravity:${cascadeId}:${responseId}`,
|
||
userMessage: "",
|
||
sessionId: cascadeId
|
||
};
|
||
}
|
||
function buildCallsFromSqliteGenMetadata(cascadeId, rows, stepMap) {
|
||
const calls = [];
|
||
const seenResponseIds = /* @__PURE__ */ new Set();
|
||
for (const row of rows) {
|
||
const rootFields = parseProtoFields(genMetadataDataBytes(row.data));
|
||
const stepIndices = [];
|
||
for (const field of rootFields) {
|
||
if (field.number === 2 && field.bytes) {
|
||
stepIndices.push(...decodePackedVarints(field.bytes));
|
||
}
|
||
}
|
||
const turnTools = { tools: [], bashCommands: [] };
|
||
for (const stepIdx of stepIndices) {
|
||
const step = stepMap.get(stepIdx);
|
||
if (step?.metadata) {
|
||
extractAntigravityToolFromStep(genMetadataDataBytes(step.metadata), turnTools);
|
||
}
|
||
}
|
||
const firstStep = stepIndices.length > 0 ? stepMap.get(stepIndices[0]) : void 0;
|
||
const firstStepTimestamp = firstStep?.metadata ? protoTimestampToIso(firstProtoField(parseProtoFields(genMetadataDataBytes(firstStep.metadata)), 1)) : "";
|
||
const call = buildCallFromSqliteGenMetadataRow(cascadeId, row, rootFields, turnTools, firstStepTimestamp);
|
||
if (!call) continue;
|
||
if (seenResponseIds.has(call.deduplicationKey)) continue;
|
||
seenResponseIds.add(call.deduplicationKey);
|
||
calls.push(call);
|
||
}
|
||
return calls;
|
||
}
|
||
async function parseSqliteGenMetadataCalls(filePath, cascadeId) {
|
||
if (!filePath.toLowerCase().endsWith(".db")) return [];
|
||
if (!isSqliteAvailable()) return [];
|
||
let db = null;
|
||
try {
|
||
db = openDatabase(filePath);
|
||
const rows = db.query("SELECT idx, data FROM gen_metadata ORDER BY idx");
|
||
if (rows.length === 0) return [];
|
||
const stepMap = /* @__PURE__ */ new Map();
|
||
try {
|
||
const stepRows = db.query("SELECT idx, metadata FROM steps ORDER BY idx");
|
||
for (const step of stepRows) {
|
||
stepMap.set(step.idx, step);
|
||
}
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
}
|
||
return buildCallsFromSqliteGenMetadata(cascadeId, rows, stepMap);
|
||
} catch (err) {
|
||
if (isSqliteBusyError(err)) throw err;
|
||
return [];
|
||
} finally {
|
||
db?.close();
|
||
}
|
||
}
|
||
function parseFiniteToken(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : 0;
|
||
}
|
||
function usageSignature(event) {
|
||
const u = event.usage;
|
||
return [
|
||
event.model,
|
||
u.inputTokens,
|
||
u.outputTokens,
|
||
u.cacheCreationInputTokens,
|
||
u.cacheReadInputTokens
|
||
].join(":");
|
||
}
|
||
function usageHasTokens(usage) {
|
||
return usage.inputTokens > 0 || usage.outputTokens > 0 || usage.cacheCreationInputTokens > 0 || usage.cacheReadInputTokens > 0;
|
||
}
|
||
function usageIsMonotonic(current, previous) {
|
||
return current.inputTokens >= previous.inputTokens && current.outputTokens >= previous.outputTokens && current.cacheCreationInputTokens >= previous.cacheCreationInputTokens && current.cacheReadInputTokens >= previous.cacheReadInputTokens;
|
||
}
|
||
function usageDelta(current, previous) {
|
||
return {
|
||
inputTokens: current.inputTokens - previous.inputTokens,
|
||
outputTokens: current.outputTokens - previous.outputTokens,
|
||
cacheCreationInputTokens: current.cacheCreationInputTokens - previous.cacheCreationInputTokens,
|
||
cacheReadInputTokens: current.cacheReadInputTokens - previous.cacheReadInputTokens
|
||
};
|
||
}
|
||
function antigravityCascadeIdFromPath(path) {
|
||
return basename29(path).replace(/\.(pb|db)$/i, "");
|
||
}
|
||
function buildCallsFromGeneratorMetadata(cascadeId, metadata, modelMap) {
|
||
const results = [];
|
||
for (let i = 0; i < metadata.length; i++) {
|
||
const entry = metadata[i];
|
||
const usage = entry.chatModel?.usage;
|
||
if (!usage) continue;
|
||
const inputTokens = parseInt(usage.inputTokens ?? "0", 10);
|
||
const outputTokens = parseInt(usage.outputTokens ?? "0", 10);
|
||
const thinkingTokens = parseInt(usage.thinkingOutputTokens ?? "0", 10);
|
||
const responseTokens = parseInt(usage.responseOutputTokens ?? "0", 10);
|
||
const cacheReadTokens = parseInt(usage.cacheReadTokens ?? "0", 10);
|
||
const cacheWriteTokens = parseInt(usage.cacheWriteTokens ?? "0", 10);
|
||
if (inputTokens === 0 && outputTokens === 0) continue;
|
||
const responseId = usage.responseId || String(i);
|
||
const dedupKey = `antigravity:${cascadeId}:${responseId}`;
|
||
const model = dropPlaceholderModelId(modelMap[usage.model] ?? usage.model);
|
||
const pricingModel = normalizePricingModel(model);
|
||
const timestamp2 = entry.chatModel?.chatStartMetadata?.createdAt ?? "";
|
||
const costUSD = calculateCost(pricingModel, inputTokens, responseTokens + thinkingTokens, cacheWriteTokens, cacheReadTokens, 0, "standard", 0, "antigravity");
|
||
results.push({
|
||
provider: "antigravity",
|
||
model,
|
||
inputTokens,
|
||
outputTokens: responseTokens,
|
||
cacheCreationInputTokens: cacheWriteTokens,
|
||
cacheReadInputTokens: cacheReadTokens,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: thinkingTokens,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: timestamp2,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
sessionId: cascadeId
|
||
});
|
||
}
|
||
return results;
|
||
}
|
||
function isConversationFile(file, extensions) {
|
||
const lowerFile = file.toLowerCase();
|
||
return extensions.some((ext) => lowerFile.endsWith(ext));
|
||
}
|
||
function isAntigravityStatusLineEventsPath(path) {
|
||
return path === getAntigravityStatusLineEventsPath();
|
||
}
|
||
async function discoverAntigravitySessionSources(roots) {
|
||
const includeStatusLineEvents = roots === void 0;
|
||
const effectiveRoots = roots ?? conversationRoots();
|
||
const sources = [];
|
||
for (const root of effectiveRoots) {
|
||
let files;
|
||
try {
|
||
files = await readdir31(root.dir);
|
||
} catch {
|
||
continue;
|
||
}
|
||
for (const file of files.sort()) {
|
||
if (!isConversationFile(file, root.extensions)) continue;
|
||
const path = join41(root.dir, file);
|
||
const s = await stat29(path).catch(() => null);
|
||
if (!s?.isFile()) continue;
|
||
sources.push({
|
||
path,
|
||
project: root.project,
|
||
provider: "antigravity"
|
||
});
|
||
}
|
||
}
|
||
if (includeStatusLineEvents) {
|
||
const statusLinePath = getAntigravityStatusLineEventsPath();
|
||
const statusLineStat = await stat29(statusLinePath).catch(() => null);
|
||
if (statusLineStat?.isFile()) {
|
||
sources.push({
|
||
path: statusLinePath,
|
||
project: "antigravity-cli",
|
||
provider: "antigravity"
|
||
});
|
||
}
|
||
}
|
||
return sources;
|
||
}
|
||
function parseStatusLineEvent(input) {
|
||
if (!input || typeof input !== "object") return null;
|
||
const event = input;
|
||
if (typeof event.at !== "string" || Number.isNaN(new Date(event.at).getTime())) return null;
|
||
if (typeof event.conversationId !== "string" || event.conversationId.length === 0) return null;
|
||
if (typeof event.model !== "string" || event.model.length === 0) return null;
|
||
if (!event.usage || typeof event.usage !== "object") return null;
|
||
const usage = {
|
||
inputTokens: parseFiniteToken(event.usage.inputTokens),
|
||
outputTokens: parseFiniteToken(event.usage.outputTokens),
|
||
cacheCreationInputTokens: parseFiniteToken(event.usage.cacheCreationInputTokens),
|
||
cacheReadInputTokens: parseFiniteToken(event.usage.cacheReadInputTokens)
|
||
};
|
||
if (usage.inputTokens === 0 && usage.outputTokens === 0 && usage.cacheCreationInputTokens === 0 && usage.cacheReadInputTokens === 0) return null;
|
||
return {
|
||
at: event.at,
|
||
conversationId: event.conversationId,
|
||
sessionId: typeof event.sessionId === "string" ? event.sessionId : void 0,
|
||
model: event.model,
|
||
usage
|
||
};
|
||
}
|
||
function hasRpcCacheForConversation(seenKeys, conversationId) {
|
||
const prefix = `antigravity:${conversationId}:`;
|
||
for (const key of seenKeys) {
|
||
if (key.startsWith(prefix)) return true;
|
||
}
|
||
return false;
|
||
}
|
||
async function parseStatusLineCalls(source, seenKeys) {
|
||
const raw = await readFile16(source.path, "utf-8").catch(() => "");
|
||
const runsByConversation = /* @__PURE__ */ new Map();
|
||
for (const line of raw.split(/\r?\n/)) {
|
||
if (!line.trim()) continue;
|
||
let parsed;
|
||
try {
|
||
parsed = JSON.parse(line);
|
||
} catch {
|
||
continue;
|
||
}
|
||
const event = parseStatusLineEvent(parsed);
|
||
if (!event) continue;
|
||
if (hasRpcCacheForConversation(seenKeys, event.conversationId)) continue;
|
||
const signature = usageSignature(event);
|
||
const runs = runsByConversation.get(event.conversationId) ?? [];
|
||
const lastRun = runs.at(-1);
|
||
if (lastRun?.signature === signature) {
|
||
lastRun.count += 1;
|
||
lastRun.event = event;
|
||
} else {
|
||
runs.push({ event, signature, count: 1 });
|
||
runsByConversation.set(event.conversationId, runs);
|
||
}
|
||
}
|
||
const results = [];
|
||
for (const runs of runsByConversation.values()) {
|
||
let turnIndex = 0;
|
||
let previousSnapshotUsage = null;
|
||
for (let i = 0; i < runs.length; i++) {
|
||
const run = runs[i];
|
||
const isLastRun = i === runs.length - 1;
|
||
if (run.count === 1 && !isLastRun) continue;
|
||
const event = run.event;
|
||
const signature = run.signature;
|
||
const billableUsage = previousSnapshotUsage && usageIsMonotonic(event.usage, previousSnapshotUsage) ? usageDelta(event.usage, previousSnapshotUsage) : event.usage;
|
||
previousSnapshotUsage = event.usage;
|
||
if (!usageHasTokens(billableUsage)) continue;
|
||
const dedupKey = `antigravity-statusline:${event.conversationId}:${turnIndex}:${signature}`;
|
||
turnIndex += 1;
|
||
if (seenKeys.has(dedupKey)) continue;
|
||
const u = billableUsage;
|
||
const costUSD = calculateCost(
|
||
normalizePricingModel(event.model),
|
||
u.inputTokens,
|
||
u.outputTokens,
|
||
u.cacheCreationInputTokens,
|
||
u.cacheReadInputTokens,
|
||
0
|
||
);
|
||
results.push({
|
||
provider: "antigravity",
|
||
model: event.model,
|
||
inputTokens: u.inputTokens,
|
||
outputTokens: u.outputTokens,
|
||
cacheCreationInputTokens: u.cacheCreationInputTokens,
|
||
cacheReadInputTokens: u.cacheReadInputTokens,
|
||
cachedInputTokens: 0,
|
||
// StatusLine current_usage exposes aggregate output tokens, not a
|
||
// separate thinking/response split. Preserve the exact total instead
|
||
// of inventing a breakdown.
|
||
reasoningTokens: 0,
|
||
webSearchRequests: 0,
|
||
costUSD,
|
||
tools: [],
|
||
bashCommands: [],
|
||
timestamp: event.at,
|
||
speed: "standard",
|
||
deduplicationKey: dedupKey,
|
||
userMessage: "",
|
||
sessionId: event.conversationId,
|
||
project: source.project
|
||
});
|
||
}
|
||
}
|
||
return results;
|
||
}
|
||
async function extractWorkspacePath(filePath) {
|
||
let text2 = "";
|
||
if (filePath.endsWith(".db") && isSqliteAvailable()) {
|
||
try {
|
||
const db = openDatabase(filePath);
|
||
const rows = db.query("SELECT data FROM trajectory_metadata_blob");
|
||
db.close();
|
||
const textDecoder2 = new TextDecoder("utf-8", { fatal: false });
|
||
text2 = rows.map((r) => textDecoder2.decode(r.data)).join(" ");
|
||
} catch {
|
||
}
|
||
}
|
||
if (!text2) {
|
||
try {
|
||
text2 = await readFile16(filePath, "utf-8");
|
||
} catch {
|
||
return void 0;
|
||
}
|
||
}
|
||
const match = text2.match(/file:\/\/\/[^\x00-\x1F\x7F"'\s]+/i);
|
||
if (!match) return void 0;
|
||
try {
|
||
return fileURLToPath(match[0]);
|
||
} catch {
|
||
return void 0;
|
||
}
|
||
}
|
||
function sanitizeProject4(path) {
|
||
return basename29(path.replace(/\\/g, "/"));
|
||
}
|
||
function applyAntigravityProject(call, source, projectPath) {
|
||
if (source.project === "antigravity-cli") {
|
||
call.project = source.project;
|
||
delete call.projectPath;
|
||
return;
|
||
}
|
||
if (projectPath) {
|
||
call.projectPath = projectPath;
|
||
call.project = sanitizeProject4(projectPath);
|
||
return;
|
||
}
|
||
call.project = source.project;
|
||
}
|
||
function assignStableTimestamps(calls, priorCalls, firstSeenTimestamp) {
|
||
const priorByKey = /* @__PURE__ */ new Map();
|
||
for (const prior of priorCalls ?? []) {
|
||
if (prior.timestamp) priorByKey.set(prior.deduplicationKey, prior.timestamp);
|
||
}
|
||
for (const call of calls) {
|
||
if (call.timestamp) continue;
|
||
call.timestamp = priorByKey.get(call.deduplicationKey) ?? firstSeenTimestamp;
|
||
}
|
||
}
|
||
function withFallbackTimestamp(call, fallbackTimestamp) {
|
||
return call.timestamp ? call : { ...call, timestamp: fallbackTimestamp };
|
||
}
|
||
function createParser24(source, seenKeys) {
|
||
return {
|
||
async *parse() {
|
||
if (isAntigravityStatusLineEventsPath(source.path)) {
|
||
for (const call of await parseStatusLineCalls(source, seenKeys)) {
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
return;
|
||
}
|
||
const cascadeId = antigravityCascadeIdFromPath(source.path);
|
||
const state = await loadCache2(currentCacheDir2());
|
||
const cache = state.cache;
|
||
const s = await stat29(source.path).catch(() => null);
|
||
if (!s) return;
|
||
const projectPath = await extractWorkspacePath(source.path);
|
||
const fallbackTimestamp = new Date(s.mtimeMs).toISOString();
|
||
const cached2 = cache.cascades[cascadeId];
|
||
if (cached2 && cached2.mtimeMs === s.mtimeMs && cached2.sizeBytes === s.size && cached2.calls.length > 0) {
|
||
for (const call of cached2.calls) {
|
||
applyAntigravityProject(call, source, projectPath);
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield withFallbackTimestamp(call, fallbackTimestamp);
|
||
}
|
||
return;
|
||
}
|
||
const sqliteResults = await parseSqliteGenMetadataCalls(source.path, cascadeId);
|
||
if (sqliteResults.length > 0) {
|
||
assignStableTimestamps(sqliteResults, cached2?.calls, fallbackTimestamp);
|
||
for (const call of sqliteResults) {
|
||
applyAntigravityProject(call, source, projectPath);
|
||
}
|
||
cache.cascades[cascadeId] = {
|
||
mtimeMs: s.mtimeMs,
|
||
sizeBytes: s.size,
|
||
calls: sqliteResults
|
||
};
|
||
state.dirty = true;
|
||
for (const call of sqliteResults) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
return;
|
||
}
|
||
const server = await detectServer(antigravityAppDataDirFromSourcePath(source.path));
|
||
if (!server) {
|
||
const fallback = cached2 ?? (source.path.toLowerCase().endsWith(".pb") ? await adoptPreviousVersionCascade(currentCacheDir2(), state, cascadeId) : void 0);
|
||
if (fallback) {
|
||
for (const call of fallback.calls) {
|
||
applyAntigravityProject(call, source, projectPath);
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield withFallbackTimestamp(call, fallbackTimestamp);
|
||
}
|
||
}
|
||
return;
|
||
}
|
||
const modelMap = await getModelMap(server);
|
||
let metadata;
|
||
try {
|
||
metadata = extractAntigravityGeneratorMetadata(
|
||
await rpc(server, "GetCascadeTrajectoryGeneratorMetadata", { cascadeId })
|
||
);
|
||
} catch {
|
||
if (cached2) {
|
||
for (const call of cached2.calls) {
|
||
applyAntigravityProject(call, source, projectPath);
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield withFallbackTimestamp(call, fallbackTimestamp);
|
||
}
|
||
}
|
||
return;
|
||
}
|
||
const results = buildCallsFromGeneratorMetadata(cascadeId, metadata, modelMap);
|
||
assignStableTimestamps(results, cached2?.calls, fallbackTimestamp);
|
||
for (const call of results) {
|
||
applyAntigravityProject(call, source, projectPath);
|
||
}
|
||
cache.cascades[cascadeId] = {
|
||
mtimeMs: s.mtimeMs,
|
||
sizeBytes: s.size,
|
||
calls: results
|
||
};
|
||
state.dirty = true;
|
||
for (const call of results) {
|
||
if (seenKeys.has(call.deduplicationKey)) continue;
|
||
seenKeys.add(call.deduplicationKey);
|
||
yield call;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
function createAntigravityProvider() {
|
||
return {
|
||
name: "antigravity",
|
||
displayName: "Antigravity",
|
||
modelDisplayName(model) {
|
||
return modelDisplayNames7[model] ?? model;
|
||
},
|
||
toolDisplayName(rawTool) {
|
||
return normalizeAntigravityToolCall(rawTool);
|
||
},
|
||
async probeRoots() {
|
||
return [
|
||
...conversationRoots().map((root) => ({ path: root.dir, label: "conversations" })),
|
||
{ path: getAntigravityStatusLineEventsPath(), label: "statusline" }
|
||
];
|
||
},
|
||
async discoverSessions() {
|
||
return discoverAntigravitySessionSources();
|
||
},
|
||
createSessionParser(source, seenKeys) {
|
||
return createParser24(source, seenKeys);
|
||
}
|
||
};
|
||
}
|
||
var CACHE_VERSION, ANTIGRAVITY_LEGACY_CACHE_FILE, RPC_TIMEOUT_MS, MAX_RESPONSE_BYTES, DETECT_SUCCESS_TTL_MS, DETECT_FAILURE_TTL_MS, cachedServers, cachedModelMaps, cacheStates, previousVersionCascades, httpsAgent, protoTextDecoder, SERVER_PORT_FLAGS, CSRF_TOKEN_FLAGS, APP_DATA_DIR_FLAGS, MODEL_PLACEHOLDER_PATTERN, PRICING_ALIASES, PLACEHOLDER_MODELS, SKILL_MD_PATTERN, toolNameMap22, modelDisplayNames7, antigravity;
|
||
var init_antigravity = __esm({
|
||
"src/providers/antigravity.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
init_cache_dir();
|
||
init_models();
|
||
init_sqlite();
|
||
CACHE_VERSION = 8;
|
||
ANTIGRAVITY_LEGACY_CACHE_FILE = "antigravity-results.json";
|
||
RPC_TIMEOUT_MS = 5e3;
|
||
MAX_RESPONSE_BYTES = 16 * 1024 * 1024;
|
||
DETECT_SUCCESS_TTL_MS = 6e4;
|
||
DETECT_FAILURE_TTL_MS = 5e3;
|
||
cachedServers = /* @__PURE__ */ new Map();
|
||
cachedModelMaps = /* @__PURE__ */ new Map();
|
||
cacheStates = /* @__PURE__ */ new Map();
|
||
previousVersionCascades = /* @__PURE__ */ new Map();
|
||
protoTextDecoder = new TextDecoder("utf-8", { fatal: false });
|
||
SERVER_PORT_FLAGS = ["https_server_port", "extension_server_port", "https-server-port", "extension-server-port"];
|
||
CSRF_TOKEN_FLAGS = ["csrf_token", "extension_server_csrf_token", "csrf-token", "extension-server-csrf-token"];
|
||
APP_DATA_DIR_FLAGS = ["app_data_dir", "app-data-dir"];
|
||
MODEL_PLACEHOLDER_PATTERN = /^MODEL_PLACEHOLDER_/;
|
||
PRICING_ALIASES = {
|
||
"gemini-pro": "gemini-3.1-pro"
|
||
};
|
||
PLACEHOLDER_MODELS = {
|
||
MODEL_PLACEHOLDER_M16: "gemini-3.1-pro-high",
|
||
MODEL_PLACEHOLDER_M37: "gemini-3.1-pro-high",
|
||
MODEL_PLACEHOLDER_M36: "gemini-3.1-pro-low",
|
||
MODEL_PLACEHOLDER_M84: "gemini-3.5-flash-high",
|
||
MODEL_PLACEHOLDER_M18: "gemini-3-flash",
|
||
MODEL_PLACEHOLDER_M35: "claude-sonnet-4-6",
|
||
MODEL_PLACEHOLDER_M26: "claude-opus-4-6-thinking"
|
||
};
|
||
SKILL_MD_PATTERN = /(?:^|[\\/])([^\\/]+)[\\/]SKILL\.md$/i;
|
||
toolNameMap22 = {
|
||
invoke_subagent: "Agent",
|
||
manage_task: "TodoWrite",
|
||
search_web: "WebSearch",
|
||
read_url_content: "WebFetch"
|
||
};
|
||
modelDisplayNames7 = {
|
||
"gemini-pro-agent": "Gemini Pro",
|
||
"gemini-3-pro": "Gemini 3 Pro",
|
||
"gemini-3.1-pro-high": "Gemini 3.1 Pro",
|
||
"gemini-3.1-pro-low": "Gemini 3.1 Pro (Low)",
|
||
"gemini-3-flash": "Gemini 3 Flash",
|
||
"gemini-3-flash-agent": "Gemini 3 Flash",
|
||
"gemini-3.5-flash": "Gemini 3.5 Flash",
|
||
"gemini-3.5-flash-high": "Gemini 3.5 Flash",
|
||
"gemini-3.5-flash-medium": "Gemini 3.5 Flash",
|
||
"gemini-3.5-flash-low": "Gemini 3.5 Flash",
|
||
"Gemini 3.5 Flash (High)": "Gemini 3.5 Flash",
|
||
"Gemini 3.5 Flash (Medium)": "Gemini 3.5 Flash",
|
||
"Gemini 3.5 Flash (Low)": "Gemini 3.5 Flash",
|
||
"gemini-3.1-flash-image": "Gemini 3.1 Flash",
|
||
"gemini-3.1-flash-lite": "Gemini 3.1 Flash Lite",
|
||
"claude-opus-4-6-thinking": "Opus 4.6",
|
||
"claude-sonnet-4-6": "Sonnet 4.6"
|
||
};
|
||
antigravity = createAntigravityProvider();
|
||
}
|
||
});
|
||
|
||
// src/cache-refresh-lock.ts
|
||
var init_cache_refresh_lock = __esm({
|
||
"src/cache-refresh-lock.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
}
|
||
});
|
||
|
||
// src/session-cache.ts
|
||
var CACHE_VERSION2, CACHE_DIR_NAME, TEMP_FILE_MAX_AGE_MS, UNREFERENCED_SHARD_MAX_AGE_MS, SHARD_READ_CHUNK, SHARD_MEMO_MAX_BYTES, SHARD_MEMO_MAX_AGE_MS, LOCK_FRESH_MS, LOCK_WAIT_MAX_MS;
|
||
var init_session_cache = __esm({
|
||
"src/session-cache.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_cache_refresh_lock();
|
||
init_models();
|
||
init_wsl();
|
||
CACHE_VERSION2 = 10;
|
||
CACHE_DIR_NAME = `session-cache.v${CACHE_VERSION2}`;
|
||
TEMP_FILE_MAX_AGE_MS = 5 * 60 * 1e3;
|
||
UNREFERENCED_SHARD_MAX_AGE_MS = 60 * 60 * 1e3;
|
||
SHARD_READ_CHUNK = 1 << 20;
|
||
SHARD_MEMO_MAX_BYTES = 64 * 1024 * 1024;
|
||
SHARD_MEMO_MAX_AGE_MS = 10 * 60 * 1e3;
|
||
LOCK_FRESH_MS = 15 * 6e4;
|
||
LOCK_WAIT_MAX_MS = 10 * 6e4;
|
||
}
|
||
});
|
||
|
||
// src/parse-workers.ts
|
||
var MIN_PER_WORKER_RSS_BYTES, MAX_PER_WORKER_RSS_BYTES, PER_WORKER_RSS_OVERHEAD_BYTES, MEMORY_BUDGET_CAP_BYTES, MIN_AVAILABLE_BYTES, MIN_BYTES_PER_WORKER, MIN_PENDING_BYTES;
|
||
var init_parse_workers = __esm({
|
||
"src/parse-workers.ts"() {
|
||
"use strict";
|
||
init_models();
|
||
MIN_PER_WORKER_RSS_BYTES = 256 * 1024 * 1024;
|
||
MAX_PER_WORKER_RSS_BYTES = 1024 * 1024 * 1024;
|
||
PER_WORKER_RSS_OVERHEAD_BYTES = 128 * 1024 * 1024;
|
||
MEMORY_BUDGET_CAP_BYTES = 2 * 1024 * 1024 * 1024;
|
||
MIN_AVAILABLE_BYTES = 4 * 1024 * 1024 * 1024;
|
||
MIN_BYTES_PER_WORKER = 200 * 1024 * 1024;
|
||
MIN_PENDING_BYTES = 200 * 1024 * 1024;
|
||
}
|
||
});
|
||
|
||
// src/cursor-cache.ts
|
||
var init_cursor_cache = __esm({
|
||
"src/cursor-cache.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
}
|
||
});
|
||
|
||
// src/cache-sweep.ts
|
||
var SWEEP_INTERVAL_MS, STALE_AFTER_MS;
|
||
var init_cache_sweep = __esm({
|
||
"src/cache-sweep.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_codex_cache();
|
||
init_cursor_cache();
|
||
init_session_cache();
|
||
SWEEP_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
||
STALE_AFTER_MS = 14 * 24 * 60 * 60 * 1e3;
|
||
}
|
||
});
|
||
|
||
// src/daily-cache.ts
|
||
var DAILY_CACHE_VERSION, DAILY_CACHE_FILENAME, lockChain, MS_PER_DAY;
|
||
var init_daily_cache = __esm({
|
||
"src/daily-cache.ts"() {
|
||
"use strict";
|
||
init_cache_dir();
|
||
init_cache_sweep();
|
||
init_git_origin();
|
||
DAILY_CACHE_VERSION = 70;
|
||
DAILY_CACHE_FILENAME = `daily-cache.v${DAILY_CACHE_VERSION}.json`;
|
||
lockChain = Promise.resolve();
|
||
MS_PER_DAY = 24 * 60 * 60 * 1e3;
|
||
}
|
||
});
|
||
|
||
// src/day-aggregator.ts
|
||
var init_day_aggregator = __esm({
|
||
"src/day-aggregator.ts"() {
|
||
"use strict";
|
||
init_daily_cache();
|
||
init_types();
|
||
init_behavioral_weight();
|
||
init_git_origin();
|
||
init_models();
|
||
}
|
||
});
|
||
|
||
// src/classifier.ts
|
||
var EDIT_TOOLS, BASH_TOOLS;
|
||
var init_classifier = __esm({
|
||
"src/classifier.ts"() {
|
||
"use strict";
|
||
init_bash_utils();
|
||
EDIT_TOOLS = /* @__PURE__ */ new Set(["Edit", "Write", "FileEditTool", "FileWriteTool", "NotebookEdit", "cursor:edit"]);
|
||
BASH_TOOLS = /* @__PURE__ */ new Set(["Bash", "BashTool", "PowerShellTool"]);
|
||
}
|
||
});
|
||
|
||
// src/parser.ts
|
||
import { homedir as homedir37 } from "os";
|
||
import { lstat, readFile as readFile17, readdir as readdir32, stat as stat30 } from "fs/promises";
|
||
import { performance } from "perf_hooks";
|
||
function parseJsonlLine(line) {
|
||
if (Buffer.isBuffer(line)) {
|
||
if (line.length > LARGE_JSONL_LINE_BYTES) return parseLargeJsonl(line);
|
||
try {
|
||
return JSON.parse(line.toString("utf-8"));
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
if (line.length > LARGE_JSONL_LINE_BYTES) return parseLargeJsonl(line);
|
||
try {
|
||
return JSON.parse(line);
|
||
} catch {
|
||
return null;
|
||
}
|
||
}
|
||
function isAsciiWhitespace(ch) {
|
||
return ch === 32 || ch === 10 || ch === 13 || ch === 9 || ch === 11 || ch === 12;
|
||
}
|
||
function isBufferWhitespaceAt(source, index) {
|
||
const byte = source[index];
|
||
if (isAsciiWhitespace(byte)) return true;
|
||
if (byte === void 0 || byte < 128) return false;
|
||
let start = index;
|
||
while (start > 0) {
|
||
const preceding = source[start];
|
||
if (preceding === void 0 || (preceding & 192) !== 128) break;
|
||
start--;
|
||
}
|
||
const first = source[start];
|
||
if (first === void 0) return false;
|
||
let codePoint;
|
||
let byteLength = 0;
|
||
if (first >= 194 && first <= 223) {
|
||
const second = source[start + 1];
|
||
if (second === void 0 || (second & 192) !== 128) return false;
|
||
codePoint = (first & 31) << 6 | second & 63;
|
||
byteLength = 2;
|
||
} else if (first >= 224 && first <= 239) {
|
||
const second = source[start + 1];
|
||
const third = source[start + 2];
|
||
if (second === void 0 || third === void 0 || (second & 192) !== 128 || (third & 192) !== 128) return false;
|
||
codePoint = (first & 15) << 12 | (second & 63) << 6 | third & 63;
|
||
byteLength = 3;
|
||
} else if (first >= 240 && first <= 244) {
|
||
const second = source[start + 1];
|
||
const third = source[start + 2];
|
||
const fourth = source[start + 3];
|
||
if (second === void 0 || third === void 0 || fourth === void 0 || (second & 192) !== 128 || (third & 192) !== 128 || (fourth & 192) !== 128) {
|
||
return false;
|
||
}
|
||
codePoint = (first & 7) << 18 | (second & 63) << 12 | (third & 63) << 6 | fourth & 63;
|
||
byteLength = 4;
|
||
}
|
||
if (codePoint === void 0 || index >= start + byteLength) return false;
|
||
return codePoint === 160 || codePoint === 5760 || codePoint >= 8192 && codePoint <= 8202 || codePoint === 8232 || codePoint === 8233 || codePoint === 8239 || codePoint === 8287 || codePoint === 12288 || codePoint === 65279;
|
||
}
|
||
function safeBufferSegmentEnd(source, index) {
|
||
while (index > 0 && ((source[index] ?? 0) & 192) === 128) index--;
|
||
return index;
|
||
}
|
||
function createJsonSource(source) {
|
||
if (typeof source === "string") {
|
||
return {
|
||
raw: source,
|
||
length: source.length,
|
||
slice: (start, end, maxChars = Number.POSITIVE_INFINITY) => source.slice(start, Math.min(end, start + maxChars))
|
||
};
|
||
}
|
||
return {
|
||
raw: source,
|
||
length: source.length,
|
||
slice: (start, end, maxChars = Number.POSITIVE_INFINITY) => {
|
||
const cappedEnd = Number.isFinite(maxChars) ? safeBufferSegmentEnd(source, Math.min(end, start + maxChars * 4)) : end;
|
||
return source.subarray(start, cappedEnd).toString("utf-8").slice(0, maxChars);
|
||
}
|
||
};
|
||
}
|
||
function jsonCharCodeAt(source, index) {
|
||
return typeof source.raw === "string" ? source.raw.charCodeAt(index) : source.raw[index] ?? Number.NaN;
|
||
}
|
||
function skipJsonWhitespace(source, start, limit = source.length) {
|
||
if (typeof source.raw === "string") {
|
||
let i2 = start;
|
||
while (i2 < limit && /\s/.test(source.raw[i2])) i2++;
|
||
return i2;
|
||
}
|
||
let i = start;
|
||
while (i < limit && isBufferWhitespaceAt(source.raw, i)) i++;
|
||
return i;
|
||
}
|
||
function findJsonStringEnd(source, start, limit = source.length) {
|
||
return typeof source.raw === "string" ? findJsonStringEndString(source.raw, start, limit) : findJsonStringEndBuffer(source.raw, start, limit);
|
||
}
|
||
function findJsonContainerEnd(source, start, open7, close, limit = source.length) {
|
||
return typeof source.raw === "string" ? findJsonContainerEndString(source.raw, start, open7, close, limit) : findJsonContainerEndBuffer(source.raw, start, open7, close, limit);
|
||
}
|
||
function findObjectFieldValue(source, objectStart, objectEnd, field) {
|
||
return typeof source.raw === "string" ? findObjectFieldValueString(source.raw, objectStart, objectEnd, field) : findObjectFieldValueBuffer(source.raw, objectStart, objectEnd, field);
|
||
}
|
||
function findJsonValueBounds(source, start, limit = source.length) {
|
||
return typeof source.raw === "string" ? findJsonValueBoundsString(source.raw, start, limit) : findJsonValueBoundsBuffer(source.raw, start, limit);
|
||
}
|
||
function readJsonString(source, bounds, cap = Number.POSITIVE_INFINITY) {
|
||
if (typeof source.raw === "string") return readJsonStringString(source.raw, bounds, cap);
|
||
return readJsonStringBuffer(source.raw, bounds, cap);
|
||
}
|
||
function readJsonNumberField(source, objectBounds, field) {
|
||
if (!objectBounds || objectBounds.kind !== "object") return void 0;
|
||
const bounds = findObjectFieldValue(source, objectBounds.start, objectBounds.end, field);
|
||
if (!bounds) return void 0;
|
||
const value = Number(source.slice(bounds.start, bounds.end));
|
||
return Number.isFinite(value) ? value : void 0;
|
||
}
|
||
function extractAdvisorIterations(usageObjectJson) {
|
||
let parsed;
|
||
try {
|
||
parsed = JSON.parse(usageObjectJson);
|
||
} catch {
|
||
return void 0;
|
||
}
|
||
const iterations = parsed.iterations;
|
||
if (!Array.isArray(iterations)) return void 0;
|
||
const advisor = iterations.filter(
|
||
(it) => !!it && typeof it === "object" && it.type === "advisor_message"
|
||
);
|
||
return advisor.length > 0 ? advisor : void 0;
|
||
}
|
||
function parseLargeUsage(source, usageBounds) {
|
||
const usage = {
|
||
input_tokens: readJsonNumberField(source, usageBounds, "input_tokens") ?? 0,
|
||
output_tokens: readJsonNumberField(source, usageBounds, "output_tokens") ?? 0,
|
||
cache_creation_input_tokens: readJsonNumberField(source, usageBounds, "cache_creation_input_tokens"),
|
||
cache_read_input_tokens: readJsonNumberField(source, usageBounds, "cache_read_input_tokens")
|
||
};
|
||
if (usageBounds?.kind === "object") {
|
||
const cacheCreation = findObjectFieldValue(source, usageBounds.start, usageBounds.end, "cache_creation");
|
||
const ephemeral5m = readJsonNumberField(source, cacheCreation, "ephemeral_5m_input_tokens");
|
||
const ephemeral1h = readJsonNumberField(source, cacheCreation, "ephemeral_1h_input_tokens");
|
||
if (ephemeral5m !== void 0 || ephemeral1h !== void 0) {
|
||
;
|
||
usage.cache_creation = {
|
||
...ephemeral5m !== void 0 ? { ephemeral_5m_input_tokens: ephemeral5m } : {},
|
||
...ephemeral1h !== void 0 ? { ephemeral_1h_input_tokens: ephemeral1h } : {}
|
||
};
|
||
}
|
||
const serverToolUse = findObjectFieldValue(source, usageBounds.start, usageBounds.end, "server_tool_use");
|
||
const webSearch = readJsonNumberField(source, serverToolUse, "web_search_requests");
|
||
const webFetch = readJsonNumberField(source, serverToolUse, "web_fetch_requests");
|
||
if (webSearch !== void 0 || webFetch !== void 0) {
|
||
;
|
||
usage.server_tool_use = {
|
||
...webSearch !== void 0 ? { web_search_requests: webSearch } : {},
|
||
...webFetch !== void 0 ? { web_fetch_requests: webFetch } : {}
|
||
};
|
||
}
|
||
const speed = readJsonString(source, findObjectFieldValue(source, usageBounds.start, usageBounds.end, "speed"));
|
||
if (speed === "standard" || speed === "fast") usage.speed = speed;
|
||
const advisor = extractAdvisorIterations(source.slice(usageBounds.start, usageBounds.end));
|
||
if (advisor) usage.iterations = advisor;
|
||
}
|
||
return usage;
|
||
}
|
||
function extractLargeToolBlocks(source, contentBounds) {
|
||
if (!contentBounds || contentBounds.kind !== "array") return [];
|
||
const tools = [];
|
||
let i = contentBounds.start + 1;
|
||
while (i < contentBounds.end - 1 && tools.length < MAX_TOOL_BLOCKS) {
|
||
i = skipJsonWhitespace(source, i, contentBounds.end);
|
||
if (jsonCharCodeAt(source, i) === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (jsonCharCodeAt(source, i) !== 123) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const objectEnd = findJsonContainerEnd(source, i, 123, 125, contentBounds.end);
|
||
if (objectEnd === -1) break;
|
||
const objectBounds = { start: i, end: objectEnd + 1, kind: "object" };
|
||
const blockType = readJsonString(source, findObjectFieldValue(source, objectBounds.start, objectBounds.end, "type"));
|
||
if (blockType === "tool_use") {
|
||
const name = readJsonString(source, findObjectFieldValue(source, objectBounds.start, objectBounds.end, "name")) ?? "";
|
||
const id = readJsonString(source, findObjectFieldValue(source, objectBounds.start, objectBounds.end, "id")) ?? "";
|
||
const inputBounds = findObjectFieldValue(source, objectBounds.start, objectBounds.end, "input");
|
||
const input = {};
|
||
if (inputBounds?.kind === "object") {
|
||
if (name === "Skill") {
|
||
const skill = readJsonString(source, findObjectFieldValue(source, inputBounds.start, inputBounds.end, "skill"), 200);
|
||
const skillName = readJsonString(source, findObjectFieldValue(source, inputBounds.start, inputBounds.end, "name"), 200);
|
||
if (skill !== void 0) input["skill"] = skill;
|
||
if (skillName !== void 0) input["name"] = skillName;
|
||
} else if (name === "Read" || name === "FileReadTool" || EDIT_TOOLS.has(name)) {
|
||
const filePath = readJsonString(source, findObjectFieldValue(source, inputBounds.start, inputBounds.end, "file_path"), BASH_COMMAND_CAP);
|
||
if (filePath !== void 0) input["file_path"] = filePath;
|
||
} else if (name === "Agent" || name === "Task") {
|
||
const subagentType = readJsonString(source, findObjectFieldValue(source, inputBounds.start, inputBounds.end, "subagent_type"), 200);
|
||
if (subagentType !== void 0) input["subagent_type"] = subagentType;
|
||
} else if (BASH_TOOLS.has(name)) {
|
||
const command = readJsonString(source, findObjectFieldValue(source, inputBounds.start, inputBounds.end, "command"), BASH_COMMAND_CAP);
|
||
if (command !== void 0) input["command"] = command;
|
||
}
|
||
}
|
||
tools.push({ type: "tool_use", id, name, input });
|
||
}
|
||
i = objectEnd + 1;
|
||
}
|
||
return tools;
|
||
}
|
||
function extractLargeUserText(source, contentBounds) {
|
||
if (!contentBounds) return void 0;
|
||
if (contentBounds.kind === "string") return readJsonString(source, contentBounds, USER_TEXT_CAP);
|
||
if (contentBounds.kind !== "array") return void 0;
|
||
let text2 = "";
|
||
let i = contentBounds.start + 1;
|
||
while (i < contentBounds.end - 1 && text2.length < USER_TEXT_CAP) {
|
||
i = skipJsonWhitespace(source, i, contentBounds.end);
|
||
if (jsonCharCodeAt(source, i) === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (jsonCharCodeAt(source, i) !== 123) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const objectEnd = findJsonContainerEnd(source, i, 123, 125, contentBounds.end);
|
||
if (objectEnd === -1) break;
|
||
const objectBounds = { start: i, end: objectEnd + 1, kind: "object" };
|
||
const type = readJsonString(source, findObjectFieldValue(source, objectBounds.start, objectBounds.end, "type"));
|
||
if (type === "text" || type === "input_text") {
|
||
const part = readJsonString(
|
||
source,
|
||
findObjectFieldValue(source, objectBounds.start, objectBounds.end, "text"),
|
||
USER_TEXT_CAP - text2.length
|
||
);
|
||
if (part) text2 += (text2 ? " " : "") + part;
|
||
}
|
||
i = objectEnd + 1;
|
||
}
|
||
return text2 || void 0;
|
||
}
|
||
function extractLargeAddedNames(source, attachmentBounds) {
|
||
if (!attachmentBounds || attachmentBounds.kind !== "object") return [];
|
||
const attachmentType = readJsonString(source, findObjectFieldValue(source, attachmentBounds.start, attachmentBounds.end, "type"));
|
||
if (attachmentType !== "deferred_tools_delta") return [];
|
||
const addedNames = findObjectFieldValue(source, attachmentBounds.start, attachmentBounds.end, "addedNames");
|
||
if (!addedNames || addedNames.kind !== "array") return [];
|
||
const names = [];
|
||
let i = addedNames.start + 1;
|
||
while (i < addedNames.end - 1 && names.length < MAX_ADDED_NAMES) {
|
||
i = skipJsonWhitespace(source, i, addedNames.end);
|
||
if (jsonCharCodeAt(source, i) === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (jsonCharCodeAt(source, i) !== 34) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const end = findJsonStringEnd(source, i, addedNames.end);
|
||
if (end === -1) break;
|
||
const name = readJsonString(source, { start: i, end: end + 1, kind: "string" }, 500);
|
||
if (name) names.push(name);
|
||
i = end + 1;
|
||
}
|
||
return names;
|
||
}
|
||
function matchCapturedField(source, fieldBuffers, keyStart, keyEnd, fields) {
|
||
if (fieldBuffers === null) {
|
||
const key = source.raw.slice(keyStart, keyEnd);
|
||
return fields.includes(key) ? key : null;
|
||
}
|
||
const raw = source.raw;
|
||
const keyLength = keyEnd - keyStart;
|
||
for (let k = 0; k < fields.length; k++) {
|
||
const fieldBuffer = fieldBuffers[k];
|
||
if (keyLength === fieldBuffer.length && raw.subarray(keyStart, keyEnd).equals(fieldBuffer)) return fields[k];
|
||
}
|
||
return null;
|
||
}
|
||
function extractObjectFields(source, objectStart, objectEnd, fields) {
|
||
const captured = {};
|
||
for (const field of fields) captured[field] = null;
|
||
if (jsonCharCodeAt(source, objectStart) !== 123) return captured;
|
||
const fieldBuffers = typeof source.raw === "string" ? null : fields.map((f) => Buffer.from(f));
|
||
let remaining = fields.length;
|
||
let i = objectStart + 1;
|
||
while (i < objectEnd - 1 && remaining > 0) {
|
||
i = skipJsonWhitespace(source, i, objectEnd);
|
||
const ch = jsonCharCodeAt(source, i);
|
||
if (ch === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (ch !== 34) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const keyEnd = findJsonStringEnd(source, i, objectEnd);
|
||
if (keyEnd === -1) break;
|
||
const keyStart = i + 1;
|
||
i = skipJsonWhitespace(source, keyEnd + 1, objectEnd);
|
||
if (jsonCharCodeAt(source, i) !== 58) continue;
|
||
const value = findJsonValueBounds(source, i + 1, objectEnd);
|
||
if (!value) break;
|
||
const matched = matchCapturedField(source, fieldBuffers, keyStart, keyEnd, fields);
|
||
if (matched !== null && captured[matched] === null) {
|
||
captured[matched] = value;
|
||
remaining--;
|
||
}
|
||
i = value.end;
|
||
}
|
||
return captured;
|
||
}
|
||
function parseLargeJsonl(line) {
|
||
const source = createJsonSource(line);
|
||
const rootStart = skipJsonWhitespace(source, 0);
|
||
const rootEnd = findJsonContainerEnd(source, rootStart, 123, 125);
|
||
if (rootEnd === -1) return null;
|
||
const rootLimit = rootEnd + 1;
|
||
const root = extractObjectFields(source, rootStart, rootLimit, LARGE_ROOT_FIELDS);
|
||
const type = readJsonString(source, root["type"]);
|
||
if (!type) return null;
|
||
const entry = { type };
|
||
if (root["isSidechain"]?.kind === "scalar" && source.slice(root["isSidechain"].start, root["isSidechain"].end) === "true") {
|
||
entry.isSidechain = true;
|
||
}
|
||
const timestamp2 = readJsonString(source, root["timestamp"]);
|
||
const sessionId = readJsonString(source, root["sessionId"]);
|
||
const cwd = readJsonString(source, root["cwd"]);
|
||
const gitBranch = readJsonString(source, root["gitBranch"]);
|
||
const promptSource = readJsonString(source, root["promptSource"]);
|
||
if (timestamp2 !== void 0) entry.timestamp = timestamp2;
|
||
if (sessionId !== void 0) entry.sessionId = sessionId;
|
||
if (cwd !== void 0) entry.cwd = cwd;
|
||
if (gitBranch !== void 0) entry.gitBranch = gitBranch;
|
||
if (promptSource !== void 0) entry.promptSource = promptSource;
|
||
const addedNames = extractLargeAddedNames(source, root["attachment"]);
|
||
if (addedNames.length > 0) {
|
||
;
|
||
entry["attachment"] = { type: "deferred_tools_delta", addedNames };
|
||
}
|
||
const message = root["message"];
|
||
if (type === "user") {
|
||
if (message?.kind === "object") {
|
||
const content2 = findObjectFieldValue(source, message.start, message.end, "content");
|
||
const text2 = extractLargeUserText(source, content2);
|
||
if (text2 !== void 0) entry.message = { role: "user", content: text2 };
|
||
}
|
||
return entry;
|
||
}
|
||
if (type !== "assistant") return entry;
|
||
if (message?.kind !== "object") return entry;
|
||
const messageFields = extractObjectFields(source, message.start, message.end, LARGE_ASSISTANT_MESSAGE_FIELDS);
|
||
const model = readJsonString(source, messageFields["model"]);
|
||
const usageBounds = messageFields["usage"];
|
||
if (!model || usageBounds?.kind !== "object") return entry;
|
||
const id = readJsonString(source, messageFields["id"]);
|
||
const contentBounds = messageFields["content"];
|
||
entry.message = {
|
||
type: "message",
|
||
role: "assistant",
|
||
model,
|
||
...id !== void 0 ? { id } : {},
|
||
content: extractLargeToolBlocks(source, contentBounds),
|
||
usage: parseLargeUsage(source, usageBounds)
|
||
};
|
||
return entry;
|
||
}
|
||
function findJsonStringEndString(source, start, limit = source.length) {
|
||
for (let i = start + 1; i < limit; i++) {
|
||
const ch = source.charCodeAt(i);
|
||
if (ch === 92) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (ch === 34) return i;
|
||
}
|
||
return -1;
|
||
}
|
||
function findJsonContainerEndString(source, start, open7, close, limit = source.length) {
|
||
let depth = 0;
|
||
let inString = false;
|
||
for (let i = start; i < limit; i++) {
|
||
const ch = source.charCodeAt(i);
|
||
if (inString) {
|
||
if (ch === 92) {
|
||
i++;
|
||
} else if (ch === 34) {
|
||
inString = false;
|
||
}
|
||
continue;
|
||
}
|
||
if (ch === 34) {
|
||
inString = true;
|
||
} else if (ch === open7) {
|
||
depth++;
|
||
} else if (ch === close) {
|
||
depth--;
|
||
if (depth === 0) return i;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
function findJsonValueBoundsString(source, start, limit = source.length) {
|
||
let i = start;
|
||
while (i < limit && /\s/.test(source[i])) i++;
|
||
if (i >= limit) return null;
|
||
const ch = source.charCodeAt(i);
|
||
if (ch === 34) {
|
||
const end2 = findJsonStringEndString(source, i, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "string" };
|
||
}
|
||
if (ch === 123) {
|
||
const end2 = findJsonContainerEndString(source, i, 123, 125, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "object" };
|
||
}
|
||
if (ch === 91) {
|
||
const end2 = findJsonContainerEndString(source, i, 91, 93, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "array" };
|
||
}
|
||
let end = i;
|
||
while (end < limit) {
|
||
const c = source.charCodeAt(end);
|
||
if (c === 44 || c === 125 || c === 93 || /\s/.test(source[end])) break;
|
||
end++;
|
||
}
|
||
return { start: i, end, kind: "scalar" };
|
||
}
|
||
function findJsonStringEndBuffer(source, start, limit = source.length) {
|
||
for (let i = start + 1; i < limit; i++) {
|
||
const ch = source[i];
|
||
if (ch === 92) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (ch === 34) return i;
|
||
}
|
||
return -1;
|
||
}
|
||
function findJsonContainerEndBuffer(source, start, open7, close, limit = source.length) {
|
||
let depth = 0;
|
||
let inString = false;
|
||
for (let i = start; i < limit; i++) {
|
||
const ch = source[i];
|
||
if (inString) {
|
||
if (ch === 92) {
|
||
i++;
|
||
} else if (ch === 34) {
|
||
inString = false;
|
||
}
|
||
continue;
|
||
}
|
||
if (ch === 34) {
|
||
inString = true;
|
||
} else if (ch === open7) {
|
||
depth++;
|
||
} else if (ch === close) {
|
||
depth--;
|
||
if (depth === 0) return i;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
function findJsonValueBoundsBuffer(source, start, limit = source.length) {
|
||
let i = start;
|
||
while (i < limit && isBufferWhitespaceAt(source, i)) i++;
|
||
if (i >= limit) return null;
|
||
const ch = source[i];
|
||
if (ch === 34) {
|
||
const end2 = findJsonStringEndBuffer(source, i, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "string" };
|
||
}
|
||
if (ch === 123) {
|
||
const end2 = findJsonContainerEndBuffer(source, i, 123, 125, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "object" };
|
||
}
|
||
if (ch === 91) {
|
||
const end2 = findJsonContainerEndBuffer(source, i, 91, 93, limit);
|
||
return end2 === -1 ? null : { start: i, end: end2 + 1, kind: "array" };
|
||
}
|
||
let end = i;
|
||
while (end < limit) {
|
||
const c = source[end];
|
||
if (c === 44 || c === 125 || c === 93 || isBufferWhitespaceAt(source, end)) break;
|
||
end++;
|
||
}
|
||
return { start: i, end, kind: "scalar" };
|
||
}
|
||
function findObjectFieldValueString(source, objectStart, objectEnd, field) {
|
||
if (source.charCodeAt(objectStart) !== 123) return null;
|
||
let i = objectStart + 1;
|
||
while (i < objectEnd - 1) {
|
||
while (i < objectEnd && /\s/.test(source[i])) i++;
|
||
if (source.charCodeAt(i) === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (source.charCodeAt(i) !== 34) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const keyEnd = findJsonStringEndString(source, i, objectEnd);
|
||
if (keyEnd === -1) return null;
|
||
const keyStart = i + 1;
|
||
i = keyEnd + 1;
|
||
while (i < objectEnd && /\s/.test(source[i])) i++;
|
||
if (source.charCodeAt(i) !== 58) continue;
|
||
const value = findJsonValueBoundsString(source, i + 1, objectEnd);
|
||
if (!value) return null;
|
||
if (source.slice(keyStart, keyEnd) === field) return value;
|
||
i = value.end;
|
||
}
|
||
return null;
|
||
}
|
||
function findObjectFieldValueBuffer(source, objectStart, objectEnd, field) {
|
||
if (source[objectStart] !== 123) return null;
|
||
let i = objectStart + 1;
|
||
while (i < objectEnd - 1) {
|
||
while (i < objectEnd && isBufferWhitespaceAt(source, i)) i++;
|
||
if (source[i] === 44) {
|
||
i++;
|
||
continue;
|
||
}
|
||
if (source[i] !== 34) {
|
||
i++;
|
||
continue;
|
||
}
|
||
const keyEnd = findJsonStringEndBuffer(source, i, objectEnd);
|
||
if (keyEnd === -1) return null;
|
||
const keyStart = i + 1;
|
||
i = keyEnd + 1;
|
||
while (i < objectEnd && isBufferWhitespaceAt(source, i)) i++;
|
||
if (source[i] !== 58) continue;
|
||
const value = findJsonValueBoundsBuffer(source, i + 1, objectEnd);
|
||
if (!value) return null;
|
||
if (keyEnd - keyStart === field.length && source.subarray(keyStart, keyEnd).equals(Buffer.from(field))) return value;
|
||
i = value.end;
|
||
}
|
||
return null;
|
||
}
|
||
function appendStringJsonSegment(source, start, end, current, cap) {
|
||
if (start >= end || current.length >= cap) return current;
|
||
return current + source.slice(start, Math.min(end, start + cap - current.length));
|
||
}
|
||
function appendBufferJsonSegment(source, start, end, current, cap) {
|
||
if (start >= end || current.length >= cap) return current;
|
||
const remaining = cap - current.length;
|
||
const cappedEnd = Number.isFinite(cap) ? safeBufferSegmentEnd(source, Math.min(end, start + remaining * 4)) : end;
|
||
return current + source.subarray(start, cappedEnd).toString("utf-8").slice(0, remaining);
|
||
}
|
||
function readJsonStringString(source, bounds, cap = Number.POSITIVE_INFINITY) {
|
||
if (!bounds || bounds.kind !== "string") return void 0;
|
||
let out = "";
|
||
const contentEnd = bounds.end - 1;
|
||
let segmentStart = bounds.start + 1;
|
||
let i = segmentStart;
|
||
let scanLimit = Number.isFinite(cap) ? Math.min(contentEnd, segmentStart + cap) : contentEnd;
|
||
while (i < contentEnd && out.length < cap) {
|
||
if (i >= scanLimit) {
|
||
out = appendStringJsonSegment(source, segmentStart, i, out, cap);
|
||
if (out.length >= cap) break;
|
||
segmentStart = i;
|
||
scanLimit = Number.isFinite(cap) ? Math.min(contentEnd, i + cap - out.length) : contentEnd;
|
||
continue;
|
||
}
|
||
const ch = source.charCodeAt(i);
|
||
if (ch !== 92) {
|
||
i++;
|
||
continue;
|
||
}
|
||
out = appendStringJsonSegment(source, segmentStart, i, out, cap);
|
||
if (out.length >= cap) break;
|
||
i++;
|
||
const next = source.charCodeAt(i);
|
||
if (Number.isNaN(next)) break;
|
||
if (next === 110) out += "\n";
|
||
else if (next === 114) out += "\r";
|
||
else if (next === 116) out += " ";
|
||
else if (next === 98) out += "\b";
|
||
else if (next === 102) out += "\f";
|
||
else if (next === 117 && i + 4 < bounds.end) {
|
||
const code = Number.parseInt(source.slice(i + 1, i + 5), 16);
|
||
if (Number.isFinite(code)) out += String.fromCharCode(code);
|
||
i += 4;
|
||
} else {
|
||
out += String.fromCharCode(next);
|
||
}
|
||
segmentStart = i + 1;
|
||
i++;
|
||
}
|
||
return appendStringJsonSegment(source, segmentStart, contentEnd, out, cap);
|
||
}
|
||
function readJsonStringBuffer(source, bounds, cap = Number.POSITIVE_INFINITY) {
|
||
if (!bounds || bounds.kind !== "string") return void 0;
|
||
let out = "";
|
||
const contentEnd = bounds.end - 1;
|
||
let segmentStart = bounds.start + 1;
|
||
let i = segmentStart;
|
||
let scanLimit = Number.isFinite(cap) ? Math.min(contentEnd, segmentStart + cap * 4) : contentEnd;
|
||
while (i < contentEnd && out.length < cap) {
|
||
if (i >= scanLimit) {
|
||
const segmentEnd = safeBufferSegmentEnd(source, i);
|
||
out = appendBufferJsonSegment(source, segmentStart, segmentEnd, out, cap);
|
||
if (out.length >= cap) break;
|
||
segmentStart = segmentEnd;
|
||
i = segmentEnd;
|
||
scanLimit = Number.isFinite(cap) ? Math.min(contentEnd, i + (cap - out.length) * 4) : contentEnd;
|
||
continue;
|
||
}
|
||
const ch = source[i];
|
||
if (ch !== 92) {
|
||
i++;
|
||
continue;
|
||
}
|
||
out = appendBufferJsonSegment(source, segmentStart, i, out, cap);
|
||
if (out.length >= cap) break;
|
||
i++;
|
||
const next = source[i];
|
||
if (next === void 0) break;
|
||
if (next === 110) out += "\n";
|
||
else if (next === 114) out += "\r";
|
||
else if (next === 116) out += " ";
|
||
else if (next === 98) out += "\b";
|
||
else if (next === 102) out += "\f";
|
||
else if (next === 117 && i + 4 < bounds.end) {
|
||
const code = Number.parseInt(source.subarray(i + 1, i + 5).toString("ascii"), 16);
|
||
if (Number.isFinite(code)) out += String.fromCharCode(code);
|
||
i += 4;
|
||
} else {
|
||
out += String.fromCharCode(next);
|
||
}
|
||
segmentStart = i + 1;
|
||
i++;
|
||
}
|
||
return appendBufferJsonSegment(source, segmentStart, contentEnd, out, cap);
|
||
}
|
||
function isHumanQueuedPrompt(a) {
|
||
const origin = a["origin"];
|
||
return a["type"] === "queued_command" && a["commandMode"] === "prompt" && a["isMeta"] !== true && (origin?.kind ?? "human") === "human";
|
||
}
|
||
function firstPlainText(value) {
|
||
if (typeof value === "string") return value;
|
||
if (!Array.isArray(value)) return "";
|
||
for (const block of value) {
|
||
if (typeof block === "string") return block;
|
||
if (!block || typeof block !== "object") continue;
|
||
const text2 = block["text"];
|
||
if (typeof text2 === "string") return text2;
|
||
}
|
||
return "";
|
||
}
|
||
function compactEntry(raw) {
|
||
const entry = { type: raw.type };
|
||
if (raw.timestamp !== void 0) entry.timestamp = raw.timestamp;
|
||
if (raw.sessionId !== void 0) entry.sessionId = raw.sessionId;
|
||
if (raw.cwd !== void 0) entry.cwd = raw.cwd;
|
||
if (typeof raw.gitBranch === "string" && raw.gitBranch) entry.gitBranch = raw.gitBranch;
|
||
if (raw.type === "pr-link") {
|
||
const prUrl = raw["prUrl"];
|
||
if (typeof prUrl === "string" && prUrl) entry["prUrl"] = prUrl;
|
||
}
|
||
const att = raw["attachment"];
|
||
if (att && typeof att === "object") {
|
||
const a = att;
|
||
if (a["type"] === "deferred_tools_delta" && Array.isArray(a["addedNames"])) {
|
||
const names = [];
|
||
for (let i = 0; i < Math.min(a["addedNames"].length, MAX_ADDED_NAMES); i++) {
|
||
const n = a["addedNames"][i];
|
||
if (typeof n === "string") names.push(n);
|
||
}
|
||
;
|
||
entry["attachment"] = { type: "deferred_tools_delta", addedNames: names };
|
||
} else if (isHumanQueuedPrompt(a)) {
|
||
entry.attachment = {
|
||
type: "queued_command",
|
||
commandMode: "prompt",
|
||
prompt: flatSlice(firstPlainText(a["prompt"]), USER_TEXT_CAP)
|
||
};
|
||
}
|
||
}
|
||
if (!raw.message) return entry;
|
||
if (raw.message.role === "user") {
|
||
const content2 = raw.message.content;
|
||
if (typeof content2 === "string") {
|
||
entry.message = { role: "user", content: content2.slice(0, USER_TEXT_CAP) };
|
||
} else if (Array.isArray(content2)) {
|
||
let remaining = USER_TEXT_CAP;
|
||
const blocks = [];
|
||
for (const b of content2) {
|
||
if (remaining <= 0) break;
|
||
if (!b || typeof b !== "object" || b.type !== "text") continue;
|
||
const text2 = b.text;
|
||
if (typeof text2 !== "string") continue;
|
||
const sliced = text2.slice(0, remaining);
|
||
blocks.push({ type: "text", text: sliced });
|
||
remaining -= sliced.length;
|
||
}
|
||
entry.message = { role: "user", content: blocks };
|
||
}
|
||
return entry;
|
||
}
|
||
const msg = raw.message;
|
||
if (!msg.usage || !msg.model) return entry;
|
||
const rawContent = msg.content;
|
||
const contentArr = Array.isArray(rawContent) ? rawContent : [];
|
||
const toolBlocks = contentArr.filter((b) => b != null && typeof b === "object" && b.type === "tool_use");
|
||
const compactContent = toolBlocks.slice(0, MAX_TOOL_BLOCKS).map((tb) => {
|
||
let input = {};
|
||
if (tb.name === "Skill") {
|
||
const ri = tb.input ?? {};
|
||
if (typeof ri["skill"] === "string") input["skill"] = ri["skill"].slice(0, 200);
|
||
if (typeof ri["name"] === "string") input["name"] = ri["name"].slice(0, 200);
|
||
} else if (tb.name === "Read" || tb.name === "FileReadTool" || EDIT_TOOLS.has(tb.name)) {
|
||
const ri = tb.input ?? {};
|
||
if (typeof ri["file_path"] === "string") input["file_path"] = ri["file_path"].slice(0, BASH_COMMAND_CAP);
|
||
} else if (tb.name === "Agent" || tb.name === "Task") {
|
||
const ri = tb.input ?? {};
|
||
if (typeof ri["subagent_type"] === "string") input["subagent_type"] = ri["subagent_type"].slice(0, 200);
|
||
} else if (BASH_TOOLS.has(tb.name)) {
|
||
const ri = tb.input ?? {};
|
||
if (typeof ri["command"] === "string") {
|
||
input["command"] = ri["command"].slice(0, BASH_COMMAND_CAP);
|
||
}
|
||
}
|
||
return { type: "tool_use", id: tb.id ?? "", name: tb.name, input };
|
||
});
|
||
const u = msg.usage;
|
||
const compactUsage = {
|
||
input_tokens: u.input_tokens,
|
||
output_tokens: u.output_tokens
|
||
};
|
||
if (u.cache_creation_input_tokens) compactUsage.cache_creation_input_tokens = u.cache_creation_input_tokens;
|
||
if (u.cache_creation) {
|
||
compactUsage.cache_creation = {
|
||
...u.cache_creation.ephemeral_5m_input_tokens ? { ephemeral_5m_input_tokens: u.cache_creation.ephemeral_5m_input_tokens } : {},
|
||
...u.cache_creation.ephemeral_1h_input_tokens ? { ephemeral_1h_input_tokens: u.cache_creation.ephemeral_1h_input_tokens } : {}
|
||
};
|
||
}
|
||
if (u.cache_read_input_tokens) compactUsage.cache_read_input_tokens = u.cache_read_input_tokens;
|
||
if (u.server_tool_use) {
|
||
compactUsage.server_tool_use = {
|
||
...u.server_tool_use.web_search_requests ? { web_search_requests: u.server_tool_use.web_search_requests } : {},
|
||
...u.server_tool_use.web_fetch_requests ? { web_fetch_requests: u.server_tool_use.web_fetch_requests } : {}
|
||
};
|
||
}
|
||
if (u.speed) compactUsage.speed = u.speed;
|
||
if (Array.isArray(u.iterations)) {
|
||
const advisorIterations = u.iterations.filter((it) => !!it && it.type === "advisor_message").map((it) => {
|
||
const compact = { type: "advisor_message" };
|
||
if (typeof it.model === "string") compact.model = it.model;
|
||
if (it.input_tokens) compact.input_tokens = it.input_tokens;
|
||
if (it.output_tokens) compact.output_tokens = it.output_tokens;
|
||
if (it.cache_creation_input_tokens) compact.cache_creation_input_tokens = it.cache_creation_input_tokens;
|
||
if (it.cache_read_input_tokens) compact.cache_read_input_tokens = it.cache_read_input_tokens;
|
||
if (it.cache_creation) {
|
||
compact.cache_creation = {
|
||
...it.cache_creation.ephemeral_5m_input_tokens ? { ephemeral_5m_input_tokens: it.cache_creation.ephemeral_5m_input_tokens } : {},
|
||
...it.cache_creation.ephemeral_1h_input_tokens ? { ephemeral_1h_input_tokens: it.cache_creation.ephemeral_1h_input_tokens } : {}
|
||
};
|
||
}
|
||
if (it.server_tool_use?.web_search_requests) compact.server_tool_use = { web_search_requests: it.server_tool_use.web_search_requests };
|
||
if (it.speed) compact.speed = it.speed;
|
||
return compact;
|
||
});
|
||
if (advisorIterations.length > 0) compactUsage.iterations = advisorIterations;
|
||
}
|
||
entry.message = {
|
||
type: "message",
|
||
role: "assistant",
|
||
model: msg.model,
|
||
usage: compactUsage,
|
||
content: compactContent,
|
||
...msg.id ? { id: msg.id } : {}
|
||
};
|
||
return entry;
|
||
}
|
||
function extractToolNames2(content2) {
|
||
return content2.filter((b) => b.type === "tool_use").map((b) => b.name);
|
||
}
|
||
function extractMcpTools(tools) {
|
||
return tools.filter((t) => t.startsWith("mcp__"));
|
||
}
|
||
function extractSkillNames(content2) {
|
||
return content2.filter((b) => b.type === "tool_use" && b.name === "Skill").map((b) => {
|
||
const input = b.input ?? {};
|
||
const raw = input["skill"] ?? input["name"];
|
||
return typeof raw === "string" ? raw.trim() : "";
|
||
}).filter((name) => name.length > 0);
|
||
}
|
||
function extractSubagentTypes(content2) {
|
||
return content2.filter((b) => b.type === "tool_use" && (b.name === "Agent" || b.name === "Task")).map((b) => {
|
||
const input = b.input ?? {};
|
||
const raw = input["subagent_type"];
|
||
return typeof raw === "string" ? raw.trim() : "";
|
||
}).filter((name) => name.length > 0);
|
||
}
|
||
function extractBashCommandsFromContent(content2) {
|
||
return content2.filter((b) => b.type === "tool_use" && BASH_TOOLS.has(b.name)).flatMap((b) => {
|
||
const command = b.input?.command;
|
||
return typeof command === "string" ? extractBashCommands(command) : [];
|
||
});
|
||
}
|
||
function getUserMessageText(entry) {
|
||
if (!entry.message || entry.message.role !== "user") return "";
|
||
const content2 = entry.message.content;
|
||
if (typeof content2 === "string") return content2;
|
||
if (Array.isArray(content2)) {
|
||
return content2.filter((b) => b.type === "text").map((b) => b.text).join(" ");
|
||
}
|
||
return "";
|
||
}
|
||
function getMessageId(entry) {
|
||
if (entry.type !== "assistant") return null;
|
||
const msg = entry.message;
|
||
return msg?.id ?? null;
|
||
}
|
||
function safeNumber(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
|
||
}
|
||
function isPositiveNumber(value) {
|
||
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
||
}
|
||
function extractClaudeCacheCreation(usage) {
|
||
const legacyTotal = safeNumber(usage.cache_creation_input_tokens);
|
||
const cacheCreation = usage.cache_creation;
|
||
const fiveMinuteTokens = safeNumber(cacheCreation?.ephemeral_5m_input_tokens);
|
||
const oneHourTokens = safeNumber(cacheCreation?.ephemeral_1h_input_tokens);
|
||
const splitTotal = fiveMinuteTokens + oneHourTokens;
|
||
if (splitTotal === 0) return { totalTokens: legacyTotal, oneHourTokens: 0 };
|
||
const totalTokens = Math.max(legacyTotal, splitTotal);
|
||
return {
|
||
totalTokens,
|
||
oneHourTokens: Math.min(oneHourTokens, totalTokens)
|
||
};
|
||
}
|
||
function applyLocalModelSavings(call) {
|
||
const u = call.usage;
|
||
const savings = calculateLocalModelSavings(
|
||
call.model,
|
||
u.inputTokens,
|
||
billableOutputTokens(call.provider, u.outputTokens, u.reasoningTokens),
|
||
u.cacheCreationInputTokens,
|
||
u.cacheReadInputTokens,
|
||
u.webSearchRequests,
|
||
call.speed,
|
||
call.cacheCreationOneHourTokens ?? 0
|
||
);
|
||
if (!savings) return call;
|
||
return {
|
||
...call,
|
||
costUSD: 0,
|
||
savingsUSD: savings.savingsUSD,
|
||
savingsBaselineModel: savings.baselineModel,
|
||
isLocalSavings: true
|
||
};
|
||
}
|
||
function emptySessionMeta() {
|
||
return { prLinks: [], isSidechain: false, agentSpawnLinks: {}, ambiguousSpawnAgentIds: [] };
|
||
}
|
||
function countStructuredPatchLoc(patch) {
|
||
let added = 0;
|
||
let removed = 0;
|
||
if (!Array.isArray(patch)) return { added, removed };
|
||
for (const hunk of patch) {
|
||
const lines = hunk?.lines;
|
||
if (!Array.isArray(lines)) continue;
|
||
for (const line of lines) {
|
||
if (typeof line !== "string") continue;
|
||
if (line.startsWith("+")) added++;
|
||
else if (line.startsWith("-")) removed++;
|
||
}
|
||
}
|
||
return { added, removed };
|
||
}
|
||
function collectToolResultMeta(entry, map) {
|
||
if (entry.type !== "user") return;
|
||
const msg = entry.message;
|
||
const content2 = msg && typeof msg === "object" ? msg.content : void 0;
|
||
if (!Array.isArray(content2)) return;
|
||
const tur = entry["toolUseResult"];
|
||
const turObj = tur && typeof tur === "object" ? tur : void 0;
|
||
const loc = countStructuredPatchLoc(turObj?.["structuredPatch"]);
|
||
const interrupted = turObj?.["interrupted"] === true;
|
||
const userModified = turObj?.["userModified"] === true;
|
||
for (const b of content2) {
|
||
if (!b || typeof b !== "object" || b.type !== "tool_result") continue;
|
||
const id = b.tool_use_id;
|
||
if (typeof id !== "string" || !id) continue;
|
||
const isError = b.is_error === true;
|
||
map.set(id, { locAdded: loc.added, locRemoved: loc.removed, interrupted, userModified, isError });
|
||
}
|
||
}
|
||
function collectSessionMeta(entry, meta) {
|
||
if (entry.type === "ai-title") {
|
||
const t = entry["aiTitle"];
|
||
if (typeof t === "string" && t.trim()) meta.title = flatString(t.trim().slice(0, 200));
|
||
} else if (entry.type === "pr-link") {
|
||
const url = entry["prUrl"];
|
||
if (typeof url === "string" && url && !meta.prLinks.includes(url)) meta.prLinks.push(url);
|
||
}
|
||
if (entry.isSidechain === true) {
|
||
meta.isSidechain = true;
|
||
const sid = entry["sessionId"];
|
||
if (!meta.parentSessionId && typeof sid === "string" && sid) meta.parentSessionId = sid;
|
||
}
|
||
const tur = entry["toolUseResult"];
|
||
if (tur && typeof tur === "object") {
|
||
const agentId = tur["agentId"];
|
||
if (typeof agentId === "string" && agentId && !(agentId in meta.agentSpawnLinks)) {
|
||
const msg = entry.message;
|
||
const content2 = msg && typeof msg === "object" ? msg.content : void 0;
|
||
if (Array.isArray(content2)) {
|
||
const results = content2.filter((b) => !!b && typeof b === "object" && b.type === "tool_result" && typeof b.tool_use_id === "string" && !!b.tool_use_id);
|
||
let spawnId;
|
||
if (results.length === 1) {
|
||
spawnId = results[0]["tool_use_id"];
|
||
} else if (results.length > 1) {
|
||
const turContent = JSON.stringify(tur["content"]);
|
||
const matches = results.filter((b) => JSON.stringify(b["content"]) === turContent);
|
||
if (matches.length === 1) spawnId = matches[0]["tool_use_id"];
|
||
}
|
||
if (spawnId) meta.agentSpawnLinks[agentId] = spawnId;
|
||
else if (!meta.ambiguousSpawnAgentIds.includes(agentId)) meta.ambiguousSpawnAgentIds.push(agentId);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
function parseApiCall(entry, toolResultMeta) {
|
||
if (entry.type !== "assistant") return null;
|
||
const msg = entry.message;
|
||
if (!msg?.usage || !msg?.model) return null;
|
||
const usage = msg.usage;
|
||
const cacheCreation = extractClaudeCacheCreation(usage);
|
||
const tokens2 = {
|
||
inputTokens: usage.input_tokens ?? 0,
|
||
outputTokens: usage.output_tokens ?? 0,
|
||
cacheCreationInputTokens: cacheCreation.totalTokens,
|
||
cacheReadInputTokens: usage.cache_read_input_tokens ?? 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: usage.server_tool_use?.web_search_requests ?? 0
|
||
};
|
||
const contentBlocks = normalizeContentBlocks(msg.content);
|
||
const tools = extractToolNames2(contentBlocks);
|
||
const skills = extractSkillNames(contentBlocks);
|
||
const subagentTypes = extractSubagentTypes(contentBlocks);
|
||
const costUSD = calculateCost(
|
||
msg.model,
|
||
tokens2.inputTokens,
|
||
tokens2.outputTokens,
|
||
tokens2.cacheCreationInputTokens,
|
||
tokens2.cacheReadInputTokens,
|
||
tokens2.webSearchRequests,
|
||
usage.speed ?? "standard",
|
||
cacheCreation.oneHourTokens
|
||
);
|
||
const bashCmds = extractBashCommandsFromContent(contentBlocks);
|
||
const spawnIds = contentBlocks.filter((b) => b.type === "tool_use" && (b.name === "Agent" || b.name === "Task") && !!b.id).map((b) => b.id);
|
||
const toolSeq = contentBlocks.filter((b) => b.type === "tool_use").map((b) => {
|
||
const call = { tool: b.name };
|
||
const inp = b.input ?? {};
|
||
if (typeof inp["file_path"] === "string") call.file = inp["file_path"];
|
||
if (typeof inp["command"] === "string") call.command = inp["command"];
|
||
return [call];
|
||
});
|
||
let locAdded = 0;
|
||
let locRemoved = 0;
|
||
let toolErrors = 0;
|
||
let interrupted = false;
|
||
let userModified = false;
|
||
if (toolResultMeta && toolResultMeta.size > 0) {
|
||
for (const b of contentBlocks) {
|
||
if (b.type !== "tool_use") continue;
|
||
const m = toolResultMeta.get(b.id);
|
||
if (!m) continue;
|
||
locAdded += m.locAdded;
|
||
locRemoved += m.locRemoved;
|
||
if (m.isError) toolErrors++;
|
||
if (m.interrupted) interrupted = true;
|
||
if (m.userModified) userModified = true;
|
||
}
|
||
}
|
||
return applyLocalModelSavings({
|
||
provider: "claude",
|
||
model: msg.model,
|
||
usage: tokens2,
|
||
costUSD,
|
||
tools,
|
||
mcpTools: extractMcpTools(tools),
|
||
skills,
|
||
subagentTypes,
|
||
hasAgentSpawn: tools.includes("Agent"),
|
||
hasPlanMode: tools.includes("EnterPlanMode"),
|
||
speed: usage.speed ?? "standard",
|
||
timestamp: entry.timestamp ?? "",
|
||
bashCommands: bashCmds,
|
||
deduplicationKey: msg.id ?? `claude:${entry.timestamp}`,
|
||
cacheCreationOneHourTokens: cacheCreation.oneHourTokens || void 0,
|
||
toolSequence: toolSeq.length > 0 ? toolSeq : void 0,
|
||
...spawnIds.length > 0 ? { spawnToolUseIds: spawnIds } : {},
|
||
...locAdded ? { locAdded } : {},
|
||
...locRemoved ? { locRemoved } : {},
|
||
...interrupted ? { interrupted: true } : {},
|
||
...userModified ? { userModified: true } : {},
|
||
...toolErrors ? { toolErrors } : {}
|
||
});
|
||
}
|
||
function parseAdvisorCalls(entry) {
|
||
if (entry.type !== "assistant") return [];
|
||
const msg = entry.message;
|
||
const iterations = msg?.usage?.iterations;
|
||
if (!msg?.usage || !Array.isArray(iterations)) return [];
|
||
const calls = [];
|
||
const baseKey = msg.id ?? `claude:${entry.timestamp}`;
|
||
let advisorOrdinal = 0;
|
||
for (const it of iterations) {
|
||
if (!it || it.type !== "advisor_message") continue;
|
||
const model = typeof it.model === "string" && it.model ? it.model : msg.model;
|
||
if (!model) continue;
|
||
const index = advisorOrdinal++;
|
||
const cacheCreation = extractClaudeCacheCreation(it);
|
||
const tokens2 = {
|
||
inputTokens: it.input_tokens ?? 0,
|
||
outputTokens: it.output_tokens ?? 0,
|
||
cacheCreationInputTokens: cacheCreation.totalTokens,
|
||
cacheReadInputTokens: it.cache_read_input_tokens ?? 0,
|
||
cachedInputTokens: 0,
|
||
reasoningTokens: 0,
|
||
webSearchRequests: it.server_tool_use?.web_search_requests ?? 0
|
||
};
|
||
const speed = it.speed ?? msg.usage.speed ?? "standard";
|
||
const costUSD = calculateCost(
|
||
model,
|
||
tokens2.inputTokens,
|
||
tokens2.outputTokens,
|
||
tokens2.cacheCreationInputTokens,
|
||
tokens2.cacheReadInputTokens,
|
||
tokens2.webSearchRequests,
|
||
speed,
|
||
cacheCreation.oneHourTokens
|
||
);
|
||
calls.push(applyLocalModelSavings({
|
||
provider: "claude",
|
||
model,
|
||
usage: tokens2,
|
||
costUSD,
|
||
tools: [],
|
||
mcpTools: [],
|
||
skills: [],
|
||
subagentTypes: [],
|
||
hasAgentSpawn: false,
|
||
hasPlanMode: false,
|
||
speed,
|
||
timestamp: entry.timestamp ?? "",
|
||
bashCommands: [],
|
||
deduplicationKey: `${baseKey}:advisor:${index}`,
|
||
cacheCreationOneHourTokens: cacheCreation.oneHourTokens || void 0
|
||
}));
|
||
}
|
||
return calls;
|
||
}
|
||
function dedupeStreamingMessageIds(entries) {
|
||
const firstIdxById = /* @__PURE__ */ new Map();
|
||
const lastIdxById = /* @__PURE__ */ new Map();
|
||
for (let i = 0; i < entries.length; i++) {
|
||
const id = getMessageId(entries[i]);
|
||
if (!id) continue;
|
||
if (!firstIdxById.has(id)) firstIdxById.set(id, i);
|
||
lastIdxById.set(id, i);
|
||
}
|
||
if (lastIdxById.size === 0) return entries;
|
||
const result = [];
|
||
for (let i = 0; i < entries.length; i++) {
|
||
const id = getMessageId(entries[i]);
|
||
if (id && lastIdxById.get(id) !== i) continue;
|
||
if (id && firstIdxById.get(id) !== i) {
|
||
const firstTs = entries[firstIdxById.get(id)].timestamp;
|
||
result.push({ ...entries[i], timestamp: firstTs ?? entries[i].timestamp });
|
||
continue;
|
||
}
|
||
result.push(entries[i]);
|
||
}
|
||
return result;
|
||
}
|
||
function groupIntoTurns(entries, seenMsgIds, toolResultMeta) {
|
||
const turns = [];
|
||
let currentUserMessage = "";
|
||
let currentCalls = [];
|
||
let currentTimestamp = "";
|
||
let currentSessionId = "";
|
||
let currentBranch;
|
||
let currentPrRefs = [];
|
||
let currentSpawnIds = [];
|
||
const pushCurrentTurn = () => {
|
||
if (currentCalls.length === 0) return;
|
||
turns.push({
|
||
userMessage: currentUserMessage,
|
||
assistantCalls: currentCalls,
|
||
timestamp: currentTimestamp,
|
||
sessionId: currentSessionId,
|
||
...currentBranch ? { gitBranch: currentBranch } : {},
|
||
...currentPrRefs.length > 0 ? { prRefs: [...currentPrRefs].sort() } : {},
|
||
...currentSpawnIds.length > 0 ? { spawnToolUseIds: currentSpawnIds } : {}
|
||
});
|
||
};
|
||
for (const entry of entries) {
|
||
const entryBranch = typeof entry.gitBranch === "string" && entry.gitBranch ? entry.gitBranch : void 0;
|
||
if (entry.type === "user") {
|
||
const text2 = getUserMessageText(entry);
|
||
if (text2.trim()) {
|
||
pushCurrentTurn();
|
||
currentUserMessage = text2;
|
||
currentCalls = [];
|
||
currentTimestamp = entry.timestamp ?? "";
|
||
currentSessionId = entry.sessionId ?? "";
|
||
currentBranch = entryBranch;
|
||
currentPrRefs = extractPrUrlsFromText(text2);
|
||
currentSpawnIds = [];
|
||
}
|
||
} else if (entry.type === "attachment") {
|
||
const queuedPrompt = queuedHumanPromptText(entry);
|
||
if (queuedPrompt) {
|
||
pushCurrentTurn();
|
||
currentUserMessage = queuedPrompt;
|
||
currentCalls = [];
|
||
currentTimestamp = entry.timestamp ?? "";
|
||
currentSessionId = entry.sessionId ?? "";
|
||
currentBranch = entryBranch;
|
||
currentPrRefs = extractPrUrlsFromText(queuedPrompt);
|
||
currentSpawnIds = [];
|
||
}
|
||
} else if (entry.type === "assistant") {
|
||
if (entryBranch && !currentBranch) currentBranch = entryBranch;
|
||
const msgId = getMessageId(entry);
|
||
if (msgId && seenMsgIds.has(msgId)) continue;
|
||
if (msgId) seenMsgIds.add(msgId);
|
||
const cwd = typeof entry.cwd === "string" && entry.cwd.trim() ? entry.cwd.trim() : void 0;
|
||
const call = parseApiCall(entry, toolResultMeta);
|
||
if (call) {
|
||
if (cwd) call.cwd = cwd;
|
||
currentCalls.push(call);
|
||
if (call.spawnToolUseIds) {
|
||
for (const id of call.spawnToolUseIds) if (!currentSpawnIds.includes(id)) currentSpawnIds.push(id);
|
||
}
|
||
}
|
||
for (const advisorCall of parseAdvisorCalls(entry)) {
|
||
if (cwd) advisorCall.cwd = cwd;
|
||
currentCalls.push(advisorCall);
|
||
}
|
||
} else if (entry.type === "pr-link") {
|
||
const url = entry["prUrl"];
|
||
if (typeof url === "string" && url && !currentPrRefs.includes(url)) currentPrRefs.push(url);
|
||
}
|
||
}
|
||
pushCurrentTurn();
|
||
return turns;
|
||
}
|
||
function queuedHumanPromptText(entry) {
|
||
if (typeof entry.timestamp !== "string" || !entry.timestamp) return void 0;
|
||
const attachment = entry["attachment"];
|
||
if (!attachment || typeof attachment !== "object") return void 0;
|
||
const data = attachment;
|
||
if (!isHumanQueuedPrompt(data)) return void 0;
|
||
const prompt = firstPlainText(data["prompt"]).trim();
|
||
if (!prompt || prompt.startsWith("<ide_") || prompt.startsWith("<system-reminder")) return void 0;
|
||
if (QUEUED_SLASH_COMMAND.test(prompt)) return void 0;
|
||
return flatSlice(prompt, USER_TEXT_CAP);
|
||
}
|
||
function isMcpToolName(name) {
|
||
if (!name.startsWith("mcp__")) return false;
|
||
const rest = name.slice(5);
|
||
const sep3 = rest.indexOf("__");
|
||
if (sep3 <= 0) return false;
|
||
if (sep3 >= rest.length - 2) return false;
|
||
return true;
|
||
}
|
||
function extractMcpInventory(entries) {
|
||
const inventory = /* @__PURE__ */ new Set();
|
||
for (const entry of entries) {
|
||
const att = entry["attachment"];
|
||
if (!att || typeof att !== "object") continue;
|
||
const a = att;
|
||
if (a.type !== "deferred_tools_delta") continue;
|
||
if (!Array.isArray(a.addedNames)) continue;
|
||
for (const name of a.addedNames) {
|
||
if (typeof name !== "string") continue;
|
||
if (!isMcpToolName(name)) continue;
|
||
inventory.add(name);
|
||
}
|
||
}
|
||
if (inventory.size === 0) return [];
|
||
return Array.from(inventory).sort();
|
||
}
|
||
function extractCanonicalCwd(entries) {
|
||
for (const entry of entries) {
|
||
if (typeof entry.cwd !== "string") continue;
|
||
const cwd = entry.cwd.trim();
|
||
if (cwd) return cwd;
|
||
}
|
||
return void 0;
|
||
}
|
||
async function readAgentType(filePath) {
|
||
if (!/[\\/]subagents[\\/]/.test(filePath)) return void 0;
|
||
const metaPath = filePath.replace(/\.jsonl$/, ".meta.json");
|
||
try {
|
||
const t = JSON.parse(await readFile17(metaPath, "utf8")).agentType;
|
||
if (typeof t === "string" && t.trim()) return flatString(t.trim().slice(0, 100));
|
||
} catch {
|
||
}
|
||
return /[\\/]subagents[\\/]workflows[\\/]/.test(filePath) ? "workflow-subagent" : void 0;
|
||
}
|
||
function extractPrUrlsFromText(text2) {
|
||
return [...new Set(text2.match(PR_URL_IN_TEXT_RE) ?? [])].sort();
|
||
}
|
||
function apiCallToCachedCall(call) {
|
||
return {
|
||
provider: call.provider,
|
||
model: call.model,
|
||
usage: { ...call.usage, cacheCreationOneHourTokens: call.cacheCreationOneHourTokens ?? 0 },
|
||
isEstimated: call.isEstimated || void 0,
|
||
speed: call.speed,
|
||
timestamp: call.timestamp,
|
||
tools: call.tools,
|
||
bashCommands: call.bashCommands,
|
||
skills: call.skills,
|
||
subagentTypes: call.subagentTypes,
|
||
deduplicationKey: call.deduplicationKey,
|
||
toolSequence: call.toolSequence,
|
||
...call.locAdded ? { locAdded: call.locAdded } : {},
|
||
...call.locRemoved ? { locRemoved: call.locRemoved } : {},
|
||
...call.interrupted ? { interrupted: true } : {},
|
||
...call.userModified ? { userModified: true } : {},
|
||
...call.toolErrors ? { toolErrors: call.toolErrors } : {},
|
||
...call.nanoAiu != null ? { nanoAiu: call.nanoAiu } : {},
|
||
...call.route ? { route: call.route } : {},
|
||
...call.billing ? { billing: call.billing } : {},
|
||
activeDurationMs: call.activeDurationMs,
|
||
activeGeneratedTokens: call.activeGeneratedTokens,
|
||
toolWaitMs: call.toolWaitMs
|
||
};
|
||
}
|
||
function parsedTurnToCachedTurn(turn) {
|
||
return {
|
||
timestamp: turn.timestamp,
|
||
sessionId: turn.sessionId,
|
||
userMessage: flatSlice(turn.userMessage, 2e3),
|
||
calls: turn.assistantCalls.map(apiCallToCachedCall),
|
||
// Stored per-turn directly (already sorted/deduped in groupIntoTurns), unlike
|
||
// gitBranch's change-detection dedup, so each turn's refs are self-contained.
|
||
...turn.prRefs?.length ? { prRefs: turn.prRefs } : {},
|
||
...turn.spawnToolUseIds?.length ? { spawnToolUseIds: turn.spawnToolUseIds } : {}
|
||
};
|
||
}
|
||
function parsedTurnsToCachedTurns(turns) {
|
||
const out = [];
|
||
let prevBranch;
|
||
let prevCwd;
|
||
for (const turn of turns) {
|
||
const cached2 = parsedTurnToCachedTurn(turn);
|
||
if (turn.gitBranch && turn.gitBranch !== prevBranch) cached2.gitBranch = turn.gitBranch;
|
||
if (turn.gitBranch) prevBranch = turn.gitBranch;
|
||
turn.assistantCalls.forEach((call, i) => {
|
||
if (!call.cwd || call.cwd === prevCwd) return;
|
||
cached2.calls[i].cwd = call.cwd;
|
||
prevCwd = call.cwd;
|
||
});
|
||
out.push(cached2);
|
||
}
|
||
return out;
|
||
}
|
||
async function parseClaudeEntries(filePath, tracker, startByteOffset, collectors) {
|
||
const entries = [];
|
||
let hasLines = false;
|
||
for await (const line of readSessionLines(filePath, void 0, {
|
||
largeLineAsBuffer: true,
|
||
byteOffsetTracker: tracker,
|
||
...startByteOffset !== void 0 ? { startByteOffset } : {}
|
||
})) {
|
||
hasLines = true;
|
||
const entry = parseJsonlLine(line);
|
||
if (!entry) continue;
|
||
if (collectors?.toolResultMeta) collectToolResultMeta(entry, collectors.toolResultMeta);
|
||
if (collectors?.sessionMeta) collectSessionMeta(entry, collectors.sessionMeta);
|
||
entries.push(compactEntry(entry));
|
||
}
|
||
if (!hasLines || entries.length === 0) return null;
|
||
return entries;
|
||
}
|
||
async function parseClaudeFileFull(filePath, seenMsgIds) {
|
||
const tracker = { lastCompleteLineOffset: 0 };
|
||
const toolResultMeta = /* @__PURE__ */ new Map();
|
||
const sessionMeta = emptySessionMeta();
|
||
const entries = await parseClaudeEntries(filePath, tracker, void 0, { toolResultMeta, sessionMeta });
|
||
if (!entries) return null;
|
||
const turns = groupIntoTurns(dedupeStreamingMessageIds(entries), seenMsgIds, toolResultMeta);
|
||
const cwd = extractCanonicalCwd(entries);
|
||
return {
|
||
lastCompleteLineOffset: tracker.lastCompleteLineOffset,
|
||
...cwd ? { workingDirectory: cwd } : {},
|
||
mcpInventory: extractMcpInventory(entries),
|
||
turns: parsedTurnsToCachedTurns(turns),
|
||
agentType: await readAgentType(filePath),
|
||
...sessionMeta.title ? { title: sessionMeta.title } : {},
|
||
...sessionMeta.prLinks.length > 0 ? { prLinks: sessionMeta.prLinks } : {},
|
||
...sessionMeta.isSidechain ? { isSidechain: true } : {},
|
||
...sessionMeta.parentSessionId ? { parentSessionId: sessionMeta.parentSessionId } : {},
|
||
...Object.keys(sessionMeta.agentSpawnLinks).length > 0 ? { agentSpawnLinks: sessionMeta.agentSpawnLinks } : {},
|
||
...sessionMeta.ambiguousSpawnAgentIds.length > 0 ? { ambiguousSpawnAgentIds: sessionMeta.ambiguousSpawnAgentIds } : {}
|
||
};
|
||
}
|
||
var LARGE_JSONL_LINE_BYTES, LARGE_ROOT_FIELDS, LARGE_ASSISTANT_MESSAGE_FIELDS, USER_TEXT_CAP, BASH_COMMAND_CAP, MAX_TOOL_BLOCKS, MAX_ADDED_NAMES, QUEUED_SLASH_COMMAND, PR_URL_IN_TEXT_RE, FOLD_WINDOW_MS, VALIDATED_REUSE_CAP_MS, SWEEP_MEMO_MAX_AGE_MS, CLAUDE_LEDGER_MATCH_WINDOW_MS, FIRST_PAINT_MTIME_MARGIN_MS;
|
||
var init_parser = __esm({
|
||
"src/parser.ts"() {
|
||
"use strict";
|
||
init_fs_utils();
|
||
init_models();
|
||
init_sessions_report();
|
||
init_content_utils();
|
||
init_providers();
|
||
init_codex_cache();
|
||
init_antigravity();
|
||
init_claude();
|
||
init_kimicode();
|
||
init_sqlite();
|
||
init_cache_dir();
|
||
init_hermes_session_ledger();
|
||
init_session_cache();
|
||
init_cache_refresh_lock();
|
||
init_wsl();
|
||
init_parse_workers();
|
||
init_day_aggregator();
|
||
init_git_origin();
|
||
init_behavioral_weight();
|
||
init_config();
|
||
init_cursor_import();
|
||
init_classifier();
|
||
init_bash_utils();
|
||
init_path_privacy();
|
||
LARGE_JSONL_LINE_BYTES = 32 * 1024;
|
||
LARGE_ROOT_FIELDS = ["type", "timestamp", "sessionId", "cwd", "gitBranch", "attachment", "message", "isSidechain", "promptSource"];
|
||
LARGE_ASSISTANT_MESSAGE_FIELDS = ["model", "usage", "id", "content"];
|
||
USER_TEXT_CAP = 2e3;
|
||
BASH_COMMAND_CAP = 2e3;
|
||
MAX_TOOL_BLOCKS = 500;
|
||
MAX_ADDED_NAMES = 1e3;
|
||
QUEUED_SLASH_COMMAND = /^\/[a-z][\w:.-]*(?:\s|$)/;
|
||
PR_URL_IN_TEXT_RE = /https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/\d+/g;
|
||
FOLD_WINDOW_MS = 30 * 60 * 1e3;
|
||
VALIDATED_REUSE_CAP_MS = 5 * 60 * 1e3;
|
||
SWEEP_MEMO_MAX_AGE_MS = VALIDATED_REUSE_CAP_MS - 3e4;
|
||
CLAUDE_LEDGER_MATCH_WINDOW_MS = 30 * 1e3;
|
||
FIRST_PAINT_MTIME_MARGIN_MS = 48 * 60 * 60 * 1e3;
|
||
}
|
||
});
|
||
|
||
// src/parse-worker.ts
|
||
init_models();
|
||
init_parser();
|
||
init_codex();
|
||
import { parentPort, workerData } from "worker_threads";
|
||
var port = parentPort;
|
||
if (!port) throw new Error("parse-worker must be started as a worker thread");
|
||
restorePricingState(workerData.pricing);
|
||
port.on("message", (msg) => {
|
||
void (async () => {
|
||
try {
|
||
const seen = /* @__PURE__ */ new Set();
|
||
if (msg.kind === "codex") {
|
||
const parsed2 = await parseCodexFileFull(msg.source, seen);
|
||
port.postMessage({ json: JSON.stringify({ ...parsed2, keys: [...seen], path: msg.source.path }) });
|
||
return;
|
||
}
|
||
const parsed = await parseClaudeFileFull(msg.filePath, seen);
|
||
port.postMessage({ json: parsed === null ? null : JSON.stringify({ ...parsed, msgIds: [...seen], path: msg.filePath }) });
|
||
} catch (err) {
|
||
port.postMessage({ error: err instanceof Error ? err.message : String(err) });
|
||
}
|
||
})();
|
||
});
|
||
//# sourceMappingURL=parse-worker.js.map |