remote-codex 0.11.30 → 0.11.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/supervisor-api/dist/index.js +64 -10
- package/apps/supervisor-web/dist/apple-touch-icon.png +0 -0
- package/apps/supervisor-web/dist/assets/index-BkwJP0KB.js +6 -0
- package/apps/supervisor-web/dist/assets/{thread-ui-C0VPL4Uk.js → thread-ui-BOqbjoiB.js} +28 -28
- package/apps/supervisor-web/dist/favicon-16x16.png +0 -0
- package/apps/supervisor-web/dist/favicon-32x32.png +0 -0
- package/apps/supervisor-web/dist/favicon-48x48.png +0 -0
- package/apps/supervisor-web/dist/icon-192.png +0 -0
- package/apps/supervisor-web/dist/icon-512.png +0 -0
- package/apps/supervisor-web/dist/index.html +9 -3
- package/apps/supervisor-web/dist/remote-codex-icon.png +0 -0
- package/apps/supervisor-web/dist/site.webmanifest +19 -0
- package/config/codex-model-pricing.json +44 -0
- package/package.json +1 -1
- package/packages/agent-runtime/src/model-pricing.ts +66 -6
- package/packages/claude/src/runtimeAdapter.ts +4 -0
- package/packages/codex/src/modelPricing.test.ts +84 -0
- package/packages/codex/src/types.ts +3 -1
- package/packages/opencode/src/runtimeAdapter.ts +15 -0
- package/packages/shared/src/index.ts +4 -1
- package/apps/supervisor-web/dist/assets/index-BnpZn_3_.js +0 -6
|
@@ -291,19 +291,35 @@ function parsePricingConfig(raw) {
|
|
|
291
291
|
if (!isPositiveNumber(entry.inputUsdPerMillion) || !isPositiveNumber(entry.cachedInputUsdPerMillion) || !isPositiveNumber(entry.outputUsdPerMillion) || typeof entry.supportsFastMode !== "boolean") {
|
|
292
292
|
throw new Error(`Pricing config model "${modelKey2}" has invalid fields.`);
|
|
293
293
|
}
|
|
294
|
+
if (entry.cacheWriteInputUsdPerMillion !== void 0 && !isPositiveNumber(entry.cacheWriteInputUsdPerMillion)) {
|
|
295
|
+
throw new Error(`Pricing config model "${modelKey2}" cacheWriteInputUsdPerMillion must be a non-negative number.`);
|
|
296
|
+
}
|
|
294
297
|
if (entry.fastMultiplier !== void 0 && !isPositiveNumber(entry.fastMultiplier)) {
|
|
295
298
|
throw new Error(`Pricing config model "${modelKey2}" fastMultiplier must be a non-negative number.`);
|
|
296
299
|
}
|
|
297
300
|
if (entry.contextWindowTokens !== void 0 && !isPositiveNumber(entry.contextWindowTokens)) {
|
|
298
301
|
throw new Error(`Pricing config model "${modelKey2}" contextWindowTokens must be a non-negative number.`);
|
|
299
302
|
}
|
|
303
|
+
for (const field of [
|
|
304
|
+
"longContextThresholdTokens",
|
|
305
|
+
"longContextInputMultiplier",
|
|
306
|
+
"longContextOutputMultiplier"
|
|
307
|
+
]) {
|
|
308
|
+
if (entry[field] !== void 0 && !isPositiveNumber(entry[field])) {
|
|
309
|
+
throw new Error(`Pricing config model "${modelKey2}" ${field} must be a non-negative number.`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
300
312
|
models[modelKey2] = {
|
|
301
313
|
inputUsdPerMillion: entry.inputUsdPerMillion,
|
|
302
314
|
cachedInputUsdPerMillion: entry.cachedInputUsdPerMillion,
|
|
315
|
+
...entry.cacheWriteInputUsdPerMillion !== void 0 ? { cacheWriteInputUsdPerMillion: entry.cacheWriteInputUsdPerMillion } : {},
|
|
303
316
|
outputUsdPerMillion: entry.outputUsdPerMillion,
|
|
304
317
|
supportsFastMode: entry.supportsFastMode,
|
|
305
318
|
...entry.fastMultiplier !== void 0 ? { fastMultiplier: entry.fastMultiplier } : {},
|
|
306
|
-
...entry.contextWindowTokens !== void 0 ? { contextWindowTokens: entry.contextWindowTokens } : {}
|
|
319
|
+
...entry.contextWindowTokens !== void 0 ? { contextWindowTokens: entry.contextWindowTokens } : {},
|
|
320
|
+
...entry.longContextThresholdTokens !== void 0 ? { longContextThresholdTokens: entry.longContextThresholdTokens } : {},
|
|
321
|
+
...entry.longContextInputMultiplier !== void 0 ? { longContextInputMultiplier: entry.longContextInputMultiplier } : {},
|
|
322
|
+
...entry.longContextOutputMultiplier !== void 0 ? { longContextOutputMultiplier: entry.longContextOutputMultiplier } : {}
|
|
307
323
|
};
|
|
308
324
|
}
|
|
309
325
|
return {
|
|
@@ -396,23 +412,32 @@ function estimateTurnPrice(usage, snapshot) {
|
|
|
396
412
|
return null;
|
|
397
413
|
}
|
|
398
414
|
const nonCachedInputTokens = Math.max(
|
|
399
|
-
usage.total.inputTokens - usage.total.cachedInputTokens,
|
|
415
|
+
usage.total.inputTokens - usage.total.cachedInputTokens - (usage.total.cacheWriteInputTokens ?? 0),
|
|
400
416
|
0
|
|
401
417
|
);
|
|
402
418
|
const cachedInputTokens = Math.max(usage.total.cachedInputTokens, 0);
|
|
419
|
+
const cacheWriteInputTokens = Math.max(
|
|
420
|
+
usage.total.cacheWriteInputTokens ?? 0,
|
|
421
|
+
0
|
|
422
|
+
);
|
|
403
423
|
const outputTokens = Math.max(usage.total.outputTokens, 0);
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
const
|
|
407
|
-
const
|
|
424
|
+
const tierMultiplier = tierKey === "fast" && modelPricing.fastMultiplier !== void 0 ? modelPricing.fastMultiplier : tier.multiplier;
|
|
425
|
+
const usesLongContextPricing = typeof modelPricing.longContextThresholdTokens === "number" && usage.total.inputTokens > modelPricing.longContextThresholdTokens;
|
|
426
|
+
const inputMultiplier = tierMultiplier * (usesLongContextPricing ? modelPricing.longContextInputMultiplier ?? 1 : 1);
|
|
427
|
+
const outputMultiplier = tierMultiplier * (usesLongContextPricing ? modelPricing.longContextOutputMultiplier ?? 1 : 1);
|
|
428
|
+
const inputUsd = nonCachedInputTokens * modelPricing.inputUsdPerMillion * inputMultiplier / TOKEN_PRICE_DENOMINATOR;
|
|
429
|
+
const cachedInputUsd = cachedInputTokens * modelPricing.cachedInputUsdPerMillion * inputMultiplier / TOKEN_PRICE_DENOMINATOR;
|
|
430
|
+
const cacheWriteInputUsd = cacheWriteInputTokens * (modelPricing.cacheWriteInputUsdPerMillion ?? modelPricing.inputUsdPerMillion) * inputMultiplier / TOKEN_PRICE_DENOMINATOR;
|
|
431
|
+
const outputUsd = outputTokens * modelPricing.outputUsdPerMillion * outputMultiplier / TOKEN_PRICE_DENOMINATOR;
|
|
408
432
|
return {
|
|
409
433
|
pricingModelKey,
|
|
410
434
|
pricingTierKey: tierKey,
|
|
411
435
|
currency: pricingConfig.currency,
|
|
412
436
|
inputUsd,
|
|
413
437
|
cachedInputUsd,
|
|
438
|
+
cacheWriteInputUsd,
|
|
414
439
|
outputUsd,
|
|
415
|
-
totalUsd: inputUsd + cachedInputUsd + outputUsd
|
|
440
|
+
totalUsd: inputUsd + cachedInputUsd + cacheWriteInputUsd + outputUsd
|
|
416
441
|
};
|
|
417
442
|
}
|
|
418
443
|
|
|
@@ -11970,6 +11995,7 @@ function addClaudeUsage(left, right) {
|
|
|
11970
11995
|
totalTokens: left.totalTokens + right.totalTokens,
|
|
11971
11996
|
inputTokens: left.inputTokens + right.inputTokens,
|
|
11972
11997
|
cachedInputTokens: left.cachedInputTokens + right.cachedInputTokens,
|
|
11998
|
+
cacheWriteInputTokens: left.cacheWriteInputTokens + right.cacheWriteInputTokens,
|
|
11973
11999
|
outputTokens: left.outputTokens + right.outputTokens,
|
|
11974
12000
|
reasoningOutputTokens: left.reasoningOutputTokens + right.reasoningOutputTokens
|
|
11975
12001
|
};
|
|
@@ -11995,6 +12021,7 @@ function normalizeClaudeUsage(value) {
|
|
|
11995
12021
|
totalTokens: totalTokens2,
|
|
11996
12022
|
inputTokens,
|
|
11997
12023
|
cachedInputTokens: cacheReadInputTokens,
|
|
12024
|
+
cacheWriteInputTokens: cacheCreationInputTokens,
|
|
11998
12025
|
outputTokens,
|
|
11999
12026
|
reasoningOutputTokens: 0
|
|
12000
12027
|
};
|
|
@@ -14278,6 +14305,9 @@ function openCodeUsageFromTokens(tokens) {
|
|
|
14278
14305
|
const cachedInputTokens = nonNegativeNumberValue(
|
|
14279
14306
|
tokens.cachedInputTokens ?? tokens.cached_input_tokens ?? cache?.read
|
|
14280
14307
|
) ?? 0;
|
|
14308
|
+
const cacheWriteInputTokens = nonNegativeNumberValue(
|
|
14309
|
+
tokens.cacheWriteInputTokens ?? tokens.cache_write_input_tokens ?? tokens.cacheWriteTokens ?? tokens.cache_write_tokens ?? cache?.write
|
|
14310
|
+
) ?? 0;
|
|
14281
14311
|
const totalTokens2 = nonNegativeNumberValue(tokens.total ?? tokens.totalTokens ?? tokens.total_tokens) ?? inputTokens + outputTokens;
|
|
14282
14312
|
if (totalTokens2 <= 0) {
|
|
14283
14313
|
return null;
|
|
@@ -14287,6 +14317,7 @@ function openCodeUsageFromTokens(tokens) {
|
|
|
14287
14317
|
totalTokens: totalTokens2,
|
|
14288
14318
|
inputTokens,
|
|
14289
14319
|
cachedInputTokens,
|
|
14320
|
+
...cacheWriteInputTokens > 0 ? { cacheWriteInputTokens } : {},
|
|
14290
14321
|
outputTokens,
|
|
14291
14322
|
reasoningOutputTokens
|
|
14292
14323
|
},
|
|
@@ -14344,6 +14375,9 @@ function turnTokenUsage(messages, model) {
|
|
|
14344
14375
|
totalTokens: sum.totalTokens + usage.totalTokens,
|
|
14345
14376
|
inputTokens: sum.inputTokens + usage.inputTokens,
|
|
14346
14377
|
cachedInputTokens: sum.cachedInputTokens + usage.cachedInputTokens,
|
|
14378
|
+
...(sum.cacheWriteInputTokens ?? 0) + (usage.cacheWriteInputTokens ?? 0) > 0 ? {
|
|
14379
|
+
cacheWriteInputTokens: (sum.cacheWriteInputTokens ?? 0) + (usage.cacheWriteInputTokens ?? 0)
|
|
14380
|
+
} : {},
|
|
14347
14381
|
outputTokens: sum.outputTokens + usage.outputTokens,
|
|
14348
14382
|
reasoningOutputTokens: sum.reasoningOutputTokens + usage.reasoningOutputTokens
|
|
14349
14383
|
}), firstRecord);
|
|
@@ -17311,11 +17345,18 @@ function shouldResetThreadContextUsageForTurnStart(current) {
|
|
|
17311
17345
|
}
|
|
17312
17346
|
function buildTurnTokenBreakdown(payload) {
|
|
17313
17347
|
const usage = isRecord12(payload) ? payload : null;
|
|
17348
|
+
const inputDetails = isRecord12(
|
|
17349
|
+
usage?.inputTokensDetails ?? usage?.input_tokens_details
|
|
17350
|
+
) ? usage?.inputTokensDetails ?? usage?.input_tokens_details : null;
|
|
17351
|
+
const cache = isRecord12(usage?.cache) ? usage.cache : null;
|
|
17314
17352
|
const totalTokens2 = numberOrNull2(usage?.totalTokens ?? usage?.total_tokens);
|
|
17315
17353
|
const inputTokens = numberOrNull2(usage?.inputTokens ?? usage?.input_tokens);
|
|
17316
17354
|
const cachedInputTokens = numberOrNull2(
|
|
17317
|
-
usage?.cachedInputTokens ?? usage?.cached_input_tokens
|
|
17355
|
+
usage?.cachedInputTokens ?? usage?.cached_input_tokens ?? inputDetails?.cachedTokens ?? inputDetails?.cached_tokens ?? cache?.read
|
|
17318
17356
|
);
|
|
17357
|
+
const cacheWriteInputTokens = numberOrNull2(
|
|
17358
|
+
usage?.cacheWriteInputTokens ?? usage?.cache_write_input_tokens ?? usage?.cacheWriteTokens ?? usage?.cache_write_tokens ?? usage?.cacheCreationInputTokens ?? usage?.cache_creation_input_tokens ?? inputDetails?.cacheWriteTokens ?? inputDetails?.cache_write_tokens ?? cache?.write
|
|
17359
|
+
) ?? 0;
|
|
17319
17360
|
const outputTokens = numberOrNull2(usage?.outputTokens ?? usage?.output_tokens);
|
|
17320
17361
|
const reasoningOutputTokens = numberOrNull2(
|
|
17321
17362
|
usage?.reasoningOutputTokens ?? usage?.reasoning_output_tokens
|
|
@@ -17327,6 +17368,7 @@ function buildTurnTokenBreakdown(payload) {
|
|
|
17327
17368
|
totalTokens: totalTokens2,
|
|
17328
17369
|
inputTokens,
|
|
17329
17370
|
cachedInputTokens,
|
|
17371
|
+
cacheWriteInputTokens,
|
|
17330
17372
|
outputTokens,
|
|
17331
17373
|
reasoningOutputTokens
|
|
17332
17374
|
};
|
|
@@ -17336,6 +17378,7 @@ function zeroTurnTokenBreakdown() {
|
|
|
17336
17378
|
totalTokens: 0,
|
|
17337
17379
|
inputTokens: 0,
|
|
17338
17380
|
cachedInputTokens: 0,
|
|
17381
|
+
cacheWriteInputTokens: 0,
|
|
17339
17382
|
outputTokens: 0,
|
|
17340
17383
|
reasoningOutputTokens: 0
|
|
17341
17384
|
};
|
|
@@ -17348,6 +17391,10 @@ function subtractTurnTokenBreakdowns(current, previous) {
|
|
|
17348
17391
|
current.cachedInputTokens - previous.cachedInputTokens,
|
|
17349
17392
|
0
|
|
17350
17393
|
),
|
|
17394
|
+
cacheWriteInputTokens: Math.max(
|
|
17395
|
+
current.cacheWriteInputTokens - previous.cacheWriteInputTokens,
|
|
17396
|
+
0
|
|
17397
|
+
),
|
|
17351
17398
|
outputTokens: Math.max(current.outputTokens - previous.outputTokens, 0),
|
|
17352
17399
|
reasoningOutputTokens: Math.max(
|
|
17353
17400
|
current.reasoningOutputTokens - previous.reasoningOutputTokens,
|
|
@@ -17406,12 +17453,16 @@ function cumulativeTotalFromStoredThreadTurnTokenUsageState(state) {
|
|
|
17406
17453
|
return null;
|
|
17407
17454
|
}
|
|
17408
17455
|
if (!state.baselineTotal) {
|
|
17409
|
-
return
|
|
17456
|
+
return {
|
|
17457
|
+
...state.usage.total,
|
|
17458
|
+
cacheWriteInputTokens: state.usage.total.cacheWriteInputTokens ?? 0
|
|
17459
|
+
};
|
|
17410
17460
|
}
|
|
17411
17461
|
return {
|
|
17412
17462
|
totalTokens: state.baselineTotal.totalTokens + state.usage.total.totalTokens,
|
|
17413
17463
|
inputTokens: state.baselineTotal.inputTokens + state.usage.total.inputTokens,
|
|
17414
17464
|
cachedInputTokens: state.baselineTotal.cachedInputTokens + state.usage.total.cachedInputTokens,
|
|
17465
|
+
cacheWriteInputTokens: state.baselineTotal.cacheWriteInputTokens + (state.usage.total.cacheWriteInputTokens ?? 0),
|
|
17415
17466
|
outputTokens: state.baselineTotal.outputTokens + state.usage.total.outputTokens,
|
|
17416
17467
|
reasoningOutputTokens: state.baselineTotal.reasoningOutputTokens + state.usage.total.reasoningOutputTokens
|
|
17417
17468
|
};
|
|
@@ -18763,6 +18814,7 @@ function normalizeReasoningEffort(value) {
|
|
|
18763
18814
|
case "high":
|
|
18764
18815
|
case "xhigh":
|
|
18765
18816
|
case "max":
|
|
18817
|
+
case "ultra":
|
|
18766
18818
|
return value;
|
|
18767
18819
|
default:
|
|
18768
18820
|
return null;
|
|
@@ -18779,6 +18831,7 @@ function normalizeReasoningEffort2(value) {
|
|
|
18779
18831
|
case "high":
|
|
18780
18832
|
case "xhigh":
|
|
18781
18833
|
case "max":
|
|
18834
|
+
case "ultra":
|
|
18782
18835
|
return value;
|
|
18783
18836
|
default:
|
|
18784
18837
|
return null;
|
|
@@ -23519,7 +23572,8 @@ var reasoningEffortValues = [
|
|
|
23519
23572
|
"medium",
|
|
23520
23573
|
"high",
|
|
23521
23574
|
"xhigh",
|
|
23522
|
-
"max"
|
|
23575
|
+
"max",
|
|
23576
|
+
"ultra"
|
|
23523
23577
|
];
|
|
23524
23578
|
var createThreadSchema = z5.object({
|
|
23525
23579
|
workspaceId: z5.string().uuid(),
|
|
Binary file
|