@akasecurity/ai-tc-codex 0.9.17 → 0.9.19
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/.codex-plugin/plugin.json +1 -1
- package/package.json +4 -4
- package/scripts/apply-suppressions.js +3862 -3406
- package/scripts/backfill.js +38341 -37864
- package/scripts/content-retention.js +399 -69
- package/scripts/filescan.js +39330 -38850
- package/scripts/firstrun.js +3127 -2662
- package/scripts/history-sync.js +407 -71
- package/scripts/intro.js +334 -37
- package/scripts/onboard.js +3093 -2637
- package/scripts/post-tool-use.js +4017 -3540
- package/scripts/pre-tool-use.js +38359 -37882
- package/scripts/query.js +3191 -2726
- package/scripts/reconcile.js +38095 -37630
- package/scripts/remediate.js +3934 -3457
- package/scripts/scan-worker.js +338 -37
- package/scripts/session-start.js +4177 -3709
- package/scripts/start-light.js +338 -37
- package/scripts/stop.js +405 -78
- package/scripts/sync.js +5250 -4574
- package/scripts/user-prompt-submit.js +38366 -37889
|
@@ -19846,7 +19846,10 @@ function date4(params) {
|
|
|
19846
19846
|
var LongContextTier = external_exports.object({
|
|
19847
19847
|
thresholdInputTokens: external_exports.number().int().positive(),
|
|
19848
19848
|
input: external_exports.number().nonnegative().nullable(),
|
|
19849
|
-
output: external_exports.number().nonnegative().nullable()
|
|
19849
|
+
output: external_exports.number().nonnegative().nullable(),
|
|
19850
|
+
cacheRead: external_exports.number().nonnegative().nullable().optional(),
|
|
19851
|
+
cacheWrite5m: external_exports.number().nonnegative().nullable().optional(),
|
|
19852
|
+
cacheWrite1h: external_exports.number().nonnegative().nullable().optional()
|
|
19850
19853
|
});
|
|
19851
19854
|
var ModelPrice = external_exports.object({
|
|
19852
19855
|
/** USD per 1M uncached input tokens, at or below any long-context threshold. */
|
|
@@ -19855,7 +19858,8 @@ var ModelPrice = external_exports.object({
|
|
|
19855
19858
|
output: external_exports.number().nonnegative(),
|
|
19856
19859
|
/**
|
|
19857
19860
|
* Rate band above a size threshold, or `null` when the model is flat-rated.
|
|
19858
|
-
*
|
|
19861
|
+
* OpenAI, Google, xAI and some Anthropic models (Haiku 5.5) band; most
|
|
19862
|
+
* Claude models are flat across their window.
|
|
19859
19863
|
*/
|
|
19860
19864
|
longContext: LongContextTier.nullable(),
|
|
19861
19865
|
/** USD per 1M tokens written to a 5-minute ephemeral cache, or null if unpriced. */
|
|
@@ -19868,18 +19872,35 @@ var ModelPrice = external_exports.object({
|
|
|
19868
19872
|
webSearch: external_exports.number().nonnegative().nullable()
|
|
19869
19873
|
});
|
|
19870
19874
|
var WEB_SEARCH_PER_REQUEST = 0.01;
|
|
19871
|
-
function anthropicPrice(input2, output2, cacheRead) {
|
|
19875
|
+
function anthropicPrice(input2, output2, cacheRead, longContext = null) {
|
|
19872
19876
|
return Object.freeze({
|
|
19873
19877
|
input: input2,
|
|
19874
19878
|
output: output2,
|
|
19875
|
-
longContext: null,
|
|
19876
|
-
// flat across the full window on every current Claude
|
|
19879
|
+
longContext: longContext === null ? null : Object.freeze(longContext),
|
|
19877
19880
|
cacheWrite5m: input2 * 1.25,
|
|
19878
19881
|
cacheWrite1h: input2 * 2,
|
|
19879
19882
|
cacheRead,
|
|
19880
19883
|
webSearch: WEB_SEARCH_PER_REQUEST
|
|
19881
19884
|
});
|
|
19882
19885
|
}
|
|
19886
|
+
function anthropicBand(thresholdInputTokens, input2, output2, cacheRead) {
|
|
19887
|
+
return {
|
|
19888
|
+
thresholdInputTokens,
|
|
19889
|
+
input: input2,
|
|
19890
|
+
output: output2,
|
|
19891
|
+
cacheRead,
|
|
19892
|
+
cacheWrite5m: input2 * 1.25,
|
|
19893
|
+
cacheWrite1h: input2 * 2
|
|
19894
|
+
};
|
|
19895
|
+
}
|
|
19896
|
+
function scaledBand(thresholdInputTokens, base, scale) {
|
|
19897
|
+
return {
|
|
19898
|
+
thresholdInputTokens,
|
|
19899
|
+
input: base.input * scale.input,
|
|
19900
|
+
output: base.output * scale.output,
|
|
19901
|
+
...base.cacheRead === void 0 ? {} : { cacheRead: base.cacheRead * scale.cacheRead }
|
|
19902
|
+
};
|
|
19903
|
+
}
|
|
19883
19904
|
function tokenPrice(input2, output2, options = {}) {
|
|
19884
19905
|
return Object.freeze({
|
|
19885
19906
|
input: input2,
|
|
@@ -19912,17 +19933,19 @@ function serviceTierMultiplier(tier) {
|
|
|
19912
19933
|
function promptTokensOf(usage) {
|
|
19913
19934
|
return usage.promptTokens ?? (usage.inputTokens ?? 0) + (usage.cacheReadTokens ?? 0) + (usage.cacheWrite1hTokens ?? 0) + (usage.cacheWrite5mTokens ?? 0);
|
|
19914
19935
|
}
|
|
19936
|
+
function bandRate(column, base) {
|
|
19937
|
+
return column === void 0 ? base : column;
|
|
19938
|
+
}
|
|
19915
19939
|
function costOf(price, usage) {
|
|
19940
|
+
const band = price.longContext !== null && promptTokensOf(usage) > price.longContext.thresholdInputTokens ? price.longContext : null;
|
|
19916
19941
|
const metered = [
|
|
19917
|
-
[usage.
|
|
19918
|
-
[usage.
|
|
19919
|
-
[usage.
|
|
19942
|
+
[usage.inputTokens ?? 0, bandRate(band?.input, price.input)],
|
|
19943
|
+
[usage.outputTokens ?? 0, bandRate(band?.output, price.output)],
|
|
19944
|
+
[usage.cacheWrite1hTokens ?? 0, bandRate(band?.cacheWrite1h, price.cacheWrite1h)],
|
|
19945
|
+
[usage.cacheWrite5mTokens ?? 0, bandRate(band?.cacheWrite5m, price.cacheWrite5m)],
|
|
19946
|
+
[usage.cacheReadTokens ?? 0, bandRate(band?.cacheRead, price.cacheRead)]
|
|
19920
19947
|
];
|
|
19921
|
-
|
|
19922
|
-
if (band !== null && (band.input === null || band.output === null)) return null;
|
|
19923
|
-
const inputRate = band?.input ?? price.input;
|
|
19924
|
-
const outputRate = band?.output ?? price.output;
|
|
19925
|
-
let tokenCost = (usage.inputTokens ?? 0) * inputRate + (usage.outputTokens ?? 0) * outputRate;
|
|
19948
|
+
let tokenCost = 0;
|
|
19926
19949
|
for (const [tokens, rate] of metered) {
|
|
19927
19950
|
if (tokens === 0) continue;
|
|
19928
19951
|
if (rate === null) return null;
|
|
@@ -20212,10 +20235,20 @@ anthropic.model("claude-fable-5-1", {
|
|
|
20212
20235
|
});
|
|
20213
20236
|
anthropic.model("claude-fable-5", {
|
|
20214
20237
|
name: "Claude Fable 5",
|
|
20238
|
+
ctx: 1e6,
|
|
20239
|
+
maxOut: 128e3,
|
|
20215
20240
|
capability: "reasoning",
|
|
20216
20241
|
price: anthropicPrice(10, 50, 1),
|
|
20217
20242
|
on: [...CLAUDE_RESELLERS]
|
|
20218
20243
|
});
|
|
20244
|
+
anthropic.model("claude-opus-5-5", {
|
|
20245
|
+
name: "Claude Opus 5.5",
|
|
20246
|
+
ctx: 1e6,
|
|
20247
|
+
maxOut: 128e3,
|
|
20248
|
+
capability: "reasoning",
|
|
20249
|
+
price: anthropicPrice(4, 20, 0.2),
|
|
20250
|
+
on: [...CLAUDE_RESELLERS]
|
|
20251
|
+
});
|
|
20219
20252
|
anthropic.model("claude-opus-5", {
|
|
20220
20253
|
name: "Claude Opus 5",
|
|
20221
20254
|
ctx: 1e6,
|
|
@@ -20226,24 +20259,32 @@ anthropic.model("claude-opus-5", {
|
|
|
20226
20259
|
});
|
|
20227
20260
|
anthropic.model("claude-opus-4-8", {
|
|
20228
20261
|
name: "Claude Opus 4.8",
|
|
20262
|
+
ctx: 1e6,
|
|
20263
|
+
maxOut: 128e3,
|
|
20229
20264
|
capability: "reasoning",
|
|
20230
20265
|
price: anthropicPrice(5, 25, 0.5),
|
|
20231
20266
|
on: [...CLAUDE_RESELLERS]
|
|
20232
20267
|
});
|
|
20233
20268
|
anthropic.model("claude-opus-4-7", {
|
|
20234
20269
|
name: "Claude Opus 4.7",
|
|
20270
|
+
ctx: 1e6,
|
|
20271
|
+
maxOut: 128e3,
|
|
20235
20272
|
capability: "reasoning",
|
|
20236
20273
|
price: anthropicPrice(5, 25, 0.5),
|
|
20237
20274
|
on: [...CLAUDE_RESELLERS]
|
|
20238
20275
|
});
|
|
20239
20276
|
anthropic.model("claude-opus-4-6", {
|
|
20240
20277
|
name: "Claude Opus 4.6",
|
|
20278
|
+
ctx: 1e6,
|
|
20279
|
+
maxOut: 128e3,
|
|
20241
20280
|
capability: "reasoning",
|
|
20242
20281
|
price: anthropicPrice(5, 25, 0.5),
|
|
20243
20282
|
on: [...CLAUDE_RESELLERS]
|
|
20244
20283
|
});
|
|
20245
20284
|
anthropic.model("claude-opus-4-5", {
|
|
20246
20285
|
name: "Claude Opus 4.5",
|
|
20286
|
+
ctx: 2e5,
|
|
20287
|
+
maxOut: 64e3,
|
|
20247
20288
|
capability: "reasoning",
|
|
20248
20289
|
price: anthropicPrice(5, 25, 0.5),
|
|
20249
20290
|
on: [...CLAUDE_RESELLERS]
|
|
@@ -20254,6 +20295,14 @@ anthropic.model("claude-opus-4-1", {
|
|
|
20254
20295
|
price: anthropicPrice(15, 75, 1.5),
|
|
20255
20296
|
on: [...CLAUDE_RESELLERS]
|
|
20256
20297
|
});
|
|
20298
|
+
anthropic.model("claude-sonnet-5-5", {
|
|
20299
|
+
name: "Claude Sonnet 5.5",
|
|
20300
|
+
ctx: 1e6,
|
|
20301
|
+
maxOut: 128e3,
|
|
20302
|
+
capability: "reasoning",
|
|
20303
|
+
price: anthropicPrice(2, 10, 0.1),
|
|
20304
|
+
on: [...CLAUDE_RESELLERS]
|
|
20305
|
+
});
|
|
20257
20306
|
anthropic.model("claude-sonnet-5", {
|
|
20258
20307
|
name: "Claude Sonnet 5",
|
|
20259
20308
|
ctx: 1e6,
|
|
@@ -20264,16 +20313,30 @@ anthropic.model("claude-sonnet-5", {
|
|
|
20264
20313
|
});
|
|
20265
20314
|
anthropic.model("claude-sonnet-4-6", {
|
|
20266
20315
|
name: "Claude Sonnet 4.6",
|
|
20316
|
+
ctx: 1e6,
|
|
20317
|
+
maxOut: 128e3,
|
|
20267
20318
|
capability: "reasoning",
|
|
20268
20319
|
price: anthropicPrice(3, 15, 0.3),
|
|
20269
20320
|
on: [...CLAUDE_RESELLERS]
|
|
20270
20321
|
});
|
|
20271
20322
|
anthropic.model("claude-sonnet-4-5", {
|
|
20272
20323
|
name: "Claude Sonnet 4.5",
|
|
20324
|
+
ctx: 2e5,
|
|
20325
|
+
maxOut: 64e3,
|
|
20273
20326
|
capability: "reasoning",
|
|
20274
20327
|
price: anthropicPrice(3, 15, 0.3),
|
|
20275
20328
|
on: [...CLAUDE_RESELLERS]
|
|
20276
20329
|
});
|
|
20330
|
+
anthropic.model("claude-haiku-5-5", {
|
|
20331
|
+
name: "Claude Haiku 5.5",
|
|
20332
|
+
ctx: 1e6,
|
|
20333
|
+
maxOut: 128e3,
|
|
20334
|
+
capability: null,
|
|
20335
|
+
// A prompt over 100,000 tokens, cache reads and writes included, bills the
|
|
20336
|
+
// whole request at the higher band.
|
|
20337
|
+
price: anthropicPrice(0.1, 0.5, 0.01, anthropicBand(1e5, 0.5, 2.5, 0.05)),
|
|
20338
|
+
on: [...CLAUDE_RESELLERS]
|
|
20339
|
+
});
|
|
20277
20340
|
anthropic.model("claude-haiku-4-5", {
|
|
20278
20341
|
name: "Claude Haiku 4.5",
|
|
20279
20342
|
ctx: 2e5,
|
|
@@ -20296,7 +20359,13 @@ var OPENAI_TRAINING = {
|
|
|
20296
20359
|
consumerControl: "opt-out",
|
|
20297
20360
|
source: "https://developers.openai.com/api/docs/guides/your-data"
|
|
20298
20361
|
};
|
|
20299
|
-
|
|
20362
|
+
function gptPrice(input2, output2, cacheRead) {
|
|
20363
|
+
const base = { input: input2, output: output2, ...cacheRead === void 0 ? {} : { cacheRead } };
|
|
20364
|
+
return tokenPrice(input2, output2, {
|
|
20365
|
+
...base,
|
|
20366
|
+
longContext: scaledBand(272e3, base, { input: 2, output: 1.5, cacheRead: 2 })
|
|
20367
|
+
});
|
|
20368
|
+
}
|
|
20300
20369
|
var openai = vendor("openai", {
|
|
20301
20370
|
family: { id: "gpt", name: "GPT" },
|
|
20302
20371
|
region: "us",
|
|
@@ -20304,12 +20373,45 @@ var openai = vendor("openai", {
|
|
|
20304
20373
|
training: OPENAI_TRAINING
|
|
20305
20374
|
});
|
|
20306
20375
|
var OPENAI_RESELLERS = ["azure", "foundry"];
|
|
20376
|
+
openai.model("gpt-6-astra", {
|
|
20377
|
+
name: "GPT-6 Astra",
|
|
20378
|
+
ctx: 105e4,
|
|
20379
|
+
maxOut: 128e3,
|
|
20380
|
+
capability: "reasoning",
|
|
20381
|
+
price: gptPrice(10, 50, 1),
|
|
20382
|
+
on: [...OPENAI_RESELLERS]
|
|
20383
|
+
});
|
|
20384
|
+
openai.model("gpt-6.1-sol", {
|
|
20385
|
+
name: "GPT-6.1 Sol",
|
|
20386
|
+
ctx: 105e4,
|
|
20387
|
+
maxOut: 128e3,
|
|
20388
|
+
capability: "reasoning",
|
|
20389
|
+
price: gptPrice(2, 10, 0.1),
|
|
20390
|
+
on: [...OPENAI_RESELLERS]
|
|
20391
|
+
});
|
|
20392
|
+
openai.model("gpt-6-sol", {
|
|
20393
|
+
name: "GPT-6 Sol",
|
|
20394
|
+
ctx: 105e4,
|
|
20395
|
+
maxOut: 128e3,
|
|
20396
|
+
capability: "reasoning",
|
|
20397
|
+
price: gptPrice(2, 10, 0.2),
|
|
20398
|
+
on: [...OPENAI_RESELLERS]
|
|
20399
|
+
});
|
|
20400
|
+
openai.model("gpt-6-luna", {
|
|
20401
|
+
name: "GPT-6 Luna",
|
|
20402
|
+
ctx: 105e4,
|
|
20403
|
+
maxOut: 128e3,
|
|
20404
|
+
capability: null,
|
|
20405
|
+
price: gptPrice(0.1, 0.5, 0.01),
|
|
20406
|
+
on: [...OPENAI_RESELLERS]
|
|
20407
|
+
});
|
|
20307
20408
|
openai.model("gpt-5.6-sol", {
|
|
20308
20409
|
name: "GPT-5.6 Sol",
|
|
20410
|
+
// Promotional rate, published as available at least through 2026-11-21.
|
|
20309
20411
|
ctx: 105e4,
|
|
20310
20412
|
maxOut: 128e3,
|
|
20311
20413
|
capability: "reasoning",
|
|
20312
|
-
price:
|
|
20414
|
+
price: gptPrice(4, 20, 0.4),
|
|
20313
20415
|
on: [...OPENAI_RESELLERS]
|
|
20314
20416
|
});
|
|
20315
20417
|
openai.model("gpt-5.6-terra", {
|
|
@@ -20317,7 +20419,7 @@ openai.model("gpt-5.6-terra", {
|
|
|
20317
20419
|
ctx: 105e4,
|
|
20318
20420
|
maxOut: 128e3,
|
|
20319
20421
|
capability: "reasoning",
|
|
20320
|
-
price:
|
|
20422
|
+
price: gptPrice(2, 12, 0.2),
|
|
20321
20423
|
on: [...OPENAI_RESELLERS]
|
|
20322
20424
|
});
|
|
20323
20425
|
openai.model("gpt-5.6-luna", {
|
|
@@ -20325,7 +20427,7 @@ openai.model("gpt-5.6-luna", {
|
|
|
20325
20427
|
ctx: 105e4,
|
|
20326
20428
|
maxOut: 128e3,
|
|
20327
20429
|
capability: null,
|
|
20328
|
-
price:
|
|
20430
|
+
price: gptPrice(0.2, 1.2, 0.02),
|
|
20329
20431
|
on: [...OPENAI_RESELLERS]
|
|
20330
20432
|
});
|
|
20331
20433
|
openai.model("gpt-5.5", {
|
|
@@ -20333,7 +20435,15 @@ openai.model("gpt-5.5", {
|
|
|
20333
20435
|
ctx: 105e4,
|
|
20334
20436
|
maxOut: 128e3,
|
|
20335
20437
|
capability: "reasoning",
|
|
20336
|
-
price:
|
|
20438
|
+
price: gptPrice(5, 30, 0.5),
|
|
20439
|
+
on: [...OPENAI_RESELLERS]
|
|
20440
|
+
});
|
|
20441
|
+
openai.model("gpt-5.5-pro", {
|
|
20442
|
+
name: "GPT-5.5 Pro",
|
|
20443
|
+
ctx: 105e4,
|
|
20444
|
+
maxOut: 128e3,
|
|
20445
|
+
capability: "reasoning",
|
|
20446
|
+
price: gptPrice(30, 180),
|
|
20337
20447
|
on: [...OPENAI_RESELLERS]
|
|
20338
20448
|
});
|
|
20339
20449
|
openai.model("gpt-5.4", {
|
|
@@ -20341,7 +20451,7 @@ openai.model("gpt-5.4", {
|
|
|
20341
20451
|
ctx: 105e4,
|
|
20342
20452
|
maxOut: 128e3,
|
|
20343
20453
|
capability: "reasoning",
|
|
20344
|
-
price:
|
|
20454
|
+
price: gptPrice(2.5, 15, 0.25),
|
|
20345
20455
|
on: [...OPENAI_RESELLERS]
|
|
20346
20456
|
});
|
|
20347
20457
|
openai.model("gpt-5.4-mini", {
|
|
@@ -20387,6 +20497,7 @@ openai.model("gpt-5", {
|
|
|
20387
20497
|
openai.model("gpt-5-mini", {
|
|
20388
20498
|
name: "GPT-5 mini",
|
|
20389
20499
|
ctx: 4e5,
|
|
20500
|
+
maxOut: 128e3,
|
|
20390
20501
|
capability: null,
|
|
20391
20502
|
price: tokenPrice(0.25, 2, { cacheRead: 0.025 }),
|
|
20392
20503
|
on: [...OPENAI_RESELLERS]
|
|
@@ -20401,11 +20512,15 @@ openai.model("gpt-5-nano", {
|
|
|
20401
20512
|
});
|
|
20402
20513
|
openai.model("gpt-4.1", {
|
|
20403
20514
|
name: "GPT-4.1",
|
|
20515
|
+
ctx: 1047576,
|
|
20516
|
+
maxOut: 32768,
|
|
20404
20517
|
price: tokenPrice(2, 8, { cacheRead: 0.5 }),
|
|
20405
20518
|
on: [...OPENAI_RESELLERS]
|
|
20406
20519
|
});
|
|
20407
20520
|
openai.model("gpt-4o", {
|
|
20408
20521
|
name: "GPT-4o",
|
|
20522
|
+
ctx: 128e3,
|
|
20523
|
+
maxOut: 16384,
|
|
20409
20524
|
price: tokenPrice(2.5, 10, { cacheRead: 1.25 }),
|
|
20410
20525
|
on: [...OPENAI_RESELLERS]
|
|
20411
20526
|
});
|
|
@@ -20429,6 +20544,8 @@ openai.model("gpt-4-turbo", {
|
|
|
20429
20544
|
});
|
|
20430
20545
|
openai.model("o3", {
|
|
20431
20546
|
name: "o3",
|
|
20547
|
+
ctx: 2e5,
|
|
20548
|
+
maxOut: 1e5,
|
|
20432
20549
|
capability: "reasoning",
|
|
20433
20550
|
price: tokenPrice(2, 8, { cacheRead: 0.5 }),
|
|
20434
20551
|
on: [...OPENAI_RESELLERS]
|
|
@@ -20481,57 +20598,100 @@ var google = vendor("google", {
|
|
|
20481
20598
|
retention: "configurable",
|
|
20482
20599
|
training: GOOGLE_TRAINING
|
|
20483
20600
|
});
|
|
20601
|
+
google.model("gemini-3.8-flash", {
|
|
20602
|
+
name: "Gemini 3.8 Flash",
|
|
20603
|
+
ctx: 1048576,
|
|
20604
|
+
maxOut: 65536,
|
|
20605
|
+
capability: null,
|
|
20606
|
+
price: tokenPrice(0.75, 3.75, { cacheRead: 0.075 }),
|
|
20607
|
+
on: ["vertex"]
|
|
20608
|
+
});
|
|
20484
20609
|
google.model("gemini-3.7-flash", {
|
|
20485
20610
|
name: "Gemini 3.7 Flash",
|
|
20486
20611
|
capability: null,
|
|
20487
|
-
// Promotional rate; the published post-promotion rate is 1.50 / 7.50.
|
|
20488
20612
|
price: tokenPrice(0.75, 3.75),
|
|
20489
20613
|
on: ["vertex"]
|
|
20490
20614
|
});
|
|
20491
20615
|
google.model("gemini-3.6-flash", {
|
|
20492
20616
|
name: "Gemini 3.6 Flash",
|
|
20617
|
+
ctx: 1048576,
|
|
20618
|
+
maxOut: 65536,
|
|
20493
20619
|
capability: null,
|
|
20494
|
-
price: tokenPrice(0.75, 3.75),
|
|
20620
|
+
price: tokenPrice(0.75, 3.75, { cacheRead: 0.075 }),
|
|
20495
20621
|
on: ["vertex"]
|
|
20496
20622
|
});
|
|
20497
20623
|
google.model("gemini-3.5-flash", {
|
|
20498
20624
|
name: "Gemini 3.5 Flash",
|
|
20499
20625
|
capability: null,
|
|
20500
|
-
price: tokenPrice(1.5, 9),
|
|
20501
20626
|
on: ["vertex"]
|
|
20502
20627
|
});
|
|
20503
20628
|
google.model("gemini-3.5-flash-lite", {
|
|
20504
20629
|
name: "Gemini 3.5 Flash Lite",
|
|
20630
|
+
ctx: 1048576,
|
|
20631
|
+
maxOut: 65536,
|
|
20505
20632
|
capability: null,
|
|
20506
|
-
price: tokenPrice(0.3, 2.5),
|
|
20633
|
+
price: tokenPrice(0.3, 2.5, { cacheRead: 0.03 }),
|
|
20634
|
+
on: ["vertex"]
|
|
20635
|
+
});
|
|
20636
|
+
google.model("gemini-3.1-flash-lite", {
|
|
20637
|
+
name: "Gemini 3.1 Flash Lite",
|
|
20638
|
+
ctx: 1048576,
|
|
20639
|
+
maxOut: 65536,
|
|
20640
|
+
capability: null,
|
|
20641
|
+
price: tokenPrice(0.25, 1.5, { cacheRead: 0.025 }),
|
|
20642
|
+
on: ["vertex"]
|
|
20643
|
+
});
|
|
20644
|
+
google.model("gemini-3-flash-preview", {
|
|
20645
|
+
name: "Gemini 3 Flash Preview",
|
|
20646
|
+
ctx: 1048576,
|
|
20647
|
+
maxOut: 65536,
|
|
20648
|
+
capability: null,
|
|
20649
|
+
price: tokenPrice(0.5, 3, { cacheRead: 0.05 }),
|
|
20507
20650
|
on: ["vertex"]
|
|
20508
20651
|
});
|
|
20509
20652
|
google.model("gemini-3.1-pro-preview", {
|
|
20510
20653
|
name: "Gemini 3.1 Pro Preview",
|
|
20654
|
+
ctx: 1048576,
|
|
20655
|
+
maxOut: 65536,
|
|
20511
20656
|
capability: "reasoning",
|
|
20512
20657
|
price: tokenPrice(2, 12, {
|
|
20513
|
-
|
|
20658
|
+
cacheRead: 0.2,
|
|
20659
|
+
longContext: { thresholdInputTokens: 2e5, input: 4, output: 18, cacheRead: 0.4 }
|
|
20514
20660
|
}),
|
|
20661
|
+
aliases: ["gemini-3.1-pro-preview-customtools"],
|
|
20515
20662
|
on: ["vertex"]
|
|
20516
20663
|
});
|
|
20517
20664
|
google.model("gemini-2.5-pro", {
|
|
20518
20665
|
name: "Gemini 2.5 Pro",
|
|
20666
|
+
ctx: 1048576,
|
|
20667
|
+
maxOut: 65536,
|
|
20519
20668
|
capability: "reasoning",
|
|
20520
20669
|
price: tokenPrice(1.25, 10, {
|
|
20521
|
-
|
|
20670
|
+
cacheRead: 0.125,
|
|
20671
|
+
longContext: { thresholdInputTokens: 2e5, input: 2.5, output: 15, cacheRead: 0.25 }
|
|
20522
20672
|
}),
|
|
20523
20673
|
on: ["vertex"]
|
|
20524
20674
|
});
|
|
20525
20675
|
google.model("gemini-2.5-flash", {
|
|
20526
20676
|
name: "Gemini 2.5 Flash",
|
|
20677
|
+
ctx: 1048576,
|
|
20678
|
+
maxOut: 65536,
|
|
20527
20679
|
capability: null,
|
|
20528
|
-
price: tokenPrice(0.3, 2.5),
|
|
20680
|
+
price: tokenPrice(0.3, 2.5, { cacheRead: 0.03 }),
|
|
20529
20681
|
on: ["vertex"]
|
|
20530
20682
|
});
|
|
20531
20683
|
google.model("gemini-2.5-flash-lite", {
|
|
20532
20684
|
name: "Gemini 2.5 Flash Lite",
|
|
20685
|
+
ctx: 1048576,
|
|
20686
|
+
maxOut: 65536,
|
|
20533
20687
|
capability: null,
|
|
20534
|
-
price: tokenPrice(0.1, 0.4),
|
|
20688
|
+
price: tokenPrice(0.1, 0.4, { cacheRead: 0.01 }),
|
|
20689
|
+
on: ["vertex"]
|
|
20690
|
+
});
|
|
20691
|
+
google.model("gemini-embedding-2", {
|
|
20692
|
+
name: "Gemini Embedding 2",
|
|
20693
|
+
capability: "embedding",
|
|
20694
|
+
price: tokenPrice(0.2, 0),
|
|
20535
20695
|
on: ["vertex"]
|
|
20536
20696
|
});
|
|
20537
20697
|
google.model("gemini-1-5-pro", { name: "Gemini 1.5 Pro", on: ["vertex"] });
|
|
@@ -20547,43 +20707,62 @@ var xai = vendor("xai", {
|
|
|
20547
20707
|
source: "https://docs.x.ai/developers/faq/security"
|
|
20548
20708
|
}
|
|
20549
20709
|
});
|
|
20710
|
+
function grokPrice(input2, output2, cacheRead) {
|
|
20711
|
+
const base = { input: input2, output: output2, cacheRead };
|
|
20712
|
+
return tokenPrice(input2, output2, {
|
|
20713
|
+
cacheRead,
|
|
20714
|
+
longContext: scaledBand(2e5, base, { input: 2, output: 2, cacheRead: 2 })
|
|
20715
|
+
});
|
|
20716
|
+
}
|
|
20717
|
+
xai.model("grok-4.7", {
|
|
20718
|
+
name: "Grok 4.7",
|
|
20719
|
+
ctx: 5e5,
|
|
20720
|
+
capability: "reasoning",
|
|
20721
|
+
price: grokPrice(2, 6, 0.5)
|
|
20722
|
+
});
|
|
20550
20723
|
xai.model("grok-4.6", {
|
|
20551
20724
|
name: "Grok 4.6",
|
|
20552
20725
|
ctx: 5e5,
|
|
20553
20726
|
capability: "reasoning",
|
|
20554
|
-
price:
|
|
20555
|
-
cacheRead: 0.5,
|
|
20556
|
-
longContext: { thresholdInputTokens: 2e5, input: 4, output: 12 }
|
|
20557
|
-
}),
|
|
20727
|
+
price: grokPrice(2, 6, 0.5),
|
|
20558
20728
|
on: ["bedrock"]
|
|
20559
20729
|
});
|
|
20560
20730
|
xai.model("grok-4.5", {
|
|
20561
20731
|
name: "Grok 4.5",
|
|
20562
20732
|
ctx: 5e5,
|
|
20563
20733
|
capability: "reasoning",
|
|
20564
|
-
price:
|
|
20565
|
-
cacheRead: 0.3,
|
|
20566
|
-
longContext: { thresholdInputTokens: 2e5, input: 4, output: 12 }
|
|
20567
|
-
})
|
|
20734
|
+
price: grokPrice(2, 6, 0.3)
|
|
20568
20735
|
});
|
|
20569
20736
|
xai.model("grok-4.3", {
|
|
20570
20737
|
name: "Grok 4.3",
|
|
20571
20738
|
ctx: 1e6,
|
|
20572
20739
|
capability: "reasoning",
|
|
20573
|
-
price:
|
|
20574
|
-
cacheRead: 0.2,
|
|
20575
|
-
longContext: { thresholdInputTokens: 2e5, input: 2.5, output: 5 }
|
|
20576
|
-
}),
|
|
20740
|
+
price: grokPrice(1.25, 2.5, 0.2),
|
|
20577
20741
|
on: ["bedrock"]
|
|
20578
20742
|
});
|
|
20743
|
+
xai.model("grok-4.20-0309-reasoning", {
|
|
20744
|
+
name: "Grok 4.20 Reasoning",
|
|
20745
|
+
capability: "reasoning",
|
|
20746
|
+
ctx: 1e6,
|
|
20747
|
+
price: grokPrice(1.25, 2.5, 0.2)
|
|
20748
|
+
});
|
|
20749
|
+
xai.model("grok-4.20-0309-non-reasoning", {
|
|
20750
|
+
name: "Grok 4.20",
|
|
20751
|
+
capability: null,
|
|
20752
|
+
ctx: 1e6,
|
|
20753
|
+
price: grokPrice(1.25, 2.5, 0.2)
|
|
20754
|
+
});
|
|
20755
|
+
xai.model("grok-4.20-multi-agent-0309", {
|
|
20756
|
+
name: "Grok 4.20 Multi-Agent",
|
|
20757
|
+
capability: "reasoning",
|
|
20758
|
+
ctx: 1e6,
|
|
20759
|
+
price: grokPrice(1.25, 2.5, 0.2)
|
|
20760
|
+
});
|
|
20579
20761
|
xai.model("grok-build-0.1", {
|
|
20580
20762
|
name: "Grok Build 0.1",
|
|
20581
20763
|
ctx: 256e3,
|
|
20582
20764
|
capability: "code",
|
|
20583
|
-
price:
|
|
20584
|
-
cacheRead: 0.2,
|
|
20585
|
-
longContext: { thresholdInputTokens: 2e5, input: 2, output: 4 }
|
|
20586
|
-
})
|
|
20765
|
+
price: grokPrice(1, 2, 0.2)
|
|
20587
20766
|
});
|
|
20588
20767
|
var deepseek = vendor("deepseek", {
|
|
20589
20768
|
family: { id: "deepseek", name: "DeepSeek" },
|
|
@@ -20596,16 +20775,25 @@ var deepseek = vendor("deepseek", {
|
|
|
20596
20775
|
source: "https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html"
|
|
20597
20776
|
}
|
|
20598
20777
|
});
|
|
20778
|
+
deepseek.model("deepseek-flash", {
|
|
20779
|
+
name: "DeepSeek V4.1 Flash",
|
|
20780
|
+
ctx: 1e6,
|
|
20781
|
+
maxOut: 384e3,
|
|
20782
|
+
capability: null,
|
|
20783
|
+
price: tokenPrice(0.3, 1.2, { cacheRead: 6e-3 })
|
|
20784
|
+
});
|
|
20599
20785
|
deepseek.model("deepseek-v4-flash", {
|
|
20600
20786
|
name: "DeepSeek V4 Flash",
|
|
20601
20787
|
ctx: 1e6,
|
|
20788
|
+
maxOut: 384e3,
|
|
20602
20789
|
capability: null,
|
|
20603
|
-
price: tokenPrice(0.
|
|
20790
|
+
price: tokenPrice(0.3, 1.2, { cacheRead: 6e-3 }),
|
|
20604
20791
|
on: ["bedrock", "together", "fireworks", "openrouter", "ollama", "local"]
|
|
20605
20792
|
});
|
|
20606
20793
|
deepseek.model("deepseek-v4-pro", {
|
|
20607
20794
|
name: "DeepSeek V4 Pro",
|
|
20608
20795
|
ctx: 1e6,
|
|
20796
|
+
maxOut: 384e3,
|
|
20609
20797
|
capability: "reasoning",
|
|
20610
20798
|
price: tokenPrice(1.32, 3.96, { cacheRead: 0.044 }),
|
|
20611
20799
|
on: ["bedrock", "together", "fireworks", "openrouter"]
|
|
@@ -20652,7 +20840,14 @@ cohere.model("command-r-plus-08-2024", {
|
|
|
20652
20840
|
ctx: 128e3,
|
|
20653
20841
|
maxOut: 4e3,
|
|
20654
20842
|
price: tokenPrice(2.5, 10),
|
|
20655
|
-
|
|
20843
|
+
on: ["bedrock"]
|
|
20844
|
+
});
|
|
20845
|
+
cohere.model("command-r-plus-04-2024", {
|
|
20846
|
+
name: "Command R+ (04-2024)",
|
|
20847
|
+
seen: "discovered",
|
|
20848
|
+
ctx: 128e3,
|
|
20849
|
+
maxOut: 4e3,
|
|
20850
|
+
price: tokenPrice(3, 15),
|
|
20656
20851
|
aliases: ["command-r-plus"],
|
|
20657
20852
|
on: ["bedrock"]
|
|
20658
20853
|
});
|
|
@@ -20720,6 +20915,65 @@ var mistral = vendor("mistral", {
|
|
|
20720
20915
|
retention: "unknown",
|
|
20721
20916
|
defaultHosting: "local"
|
|
20722
20917
|
});
|
|
20918
|
+
var MISTRAL_API = { defaultHosting: "api" };
|
|
20919
|
+
mistral.model("mistral-large-4", {
|
|
20920
|
+
...MISTRAL_API,
|
|
20921
|
+
name: "Mistral Large 4",
|
|
20922
|
+
ctx: 1e6,
|
|
20923
|
+
capability: null,
|
|
20924
|
+
// Public preview at a sale rate; the published original is 1.36 / 4.18 / 0.14.
|
|
20925
|
+
price: tokenPrice(0.68, 2.09, { cacheRead: 0.07 })
|
|
20926
|
+
});
|
|
20927
|
+
mistral.model("mistral-large-2512", {
|
|
20928
|
+
...MISTRAL_API,
|
|
20929
|
+
name: "Mistral Large 3",
|
|
20930
|
+
ctx: 256e3,
|
|
20931
|
+
capability: null,
|
|
20932
|
+
price: tokenPrice(0.5, 1.5, { cacheRead: 0.05 })
|
|
20933
|
+
});
|
|
20934
|
+
mistral.model("mistral-medium-3-5", {
|
|
20935
|
+
...MISTRAL_API,
|
|
20936
|
+
name: "Mistral Medium 3.5",
|
|
20937
|
+
ctx: 256e3,
|
|
20938
|
+
capability: null,
|
|
20939
|
+
price: tokenPrice(1.5, 7.5, { cacheRead: 0.15 })
|
|
20940
|
+
});
|
|
20941
|
+
mistral.model("mistral-small-2603", {
|
|
20942
|
+
...MISTRAL_API,
|
|
20943
|
+
name: "Mistral Small 4",
|
|
20944
|
+
ctx: 256e3,
|
|
20945
|
+
capability: null,
|
|
20946
|
+
price: tokenPrice(0.15, 0.6, { cacheRead: 0.015 })
|
|
20947
|
+
});
|
|
20948
|
+
mistral.model("ministral-14b-2512", {
|
|
20949
|
+
...MISTRAL_API,
|
|
20950
|
+
name: "Ministral 3 14B",
|
|
20951
|
+
ctx: 256e3,
|
|
20952
|
+
capability: null,
|
|
20953
|
+
price: tokenPrice(0.2, 0.2, { cacheRead: 0.02 })
|
|
20954
|
+
});
|
|
20955
|
+
mistral.model("ministral-8b-2512", {
|
|
20956
|
+
...MISTRAL_API,
|
|
20957
|
+
name: "Ministral 3 8B",
|
|
20958
|
+
ctx: 256e3,
|
|
20959
|
+
capability: null,
|
|
20960
|
+
price: tokenPrice(0.15, 0.15, { cacheRead: 0.015 })
|
|
20961
|
+
});
|
|
20962
|
+
mistral.model("ministral-3b-2512", {
|
|
20963
|
+
...MISTRAL_API,
|
|
20964
|
+
name: "Ministral 3 3B",
|
|
20965
|
+
ctx: 256e3,
|
|
20966
|
+
capability: null,
|
|
20967
|
+
price: tokenPrice(0.1, 0.1, { cacheRead: 0.01 })
|
|
20968
|
+
});
|
|
20969
|
+
mistral.model("codestral-2508", {
|
|
20970
|
+
...MISTRAL_API,
|
|
20971
|
+
name: "Codestral",
|
|
20972
|
+
ctx: 128e3,
|
|
20973
|
+
capability: "code",
|
|
20974
|
+
openWeights: false,
|
|
20975
|
+
price: tokenPrice(0.3, 0.9, { cacheRead: 0.03 })
|
|
20976
|
+
});
|
|
20723
20977
|
mistral.model("mixtral-8x7b", {
|
|
20724
20978
|
name: "Mixtral 8x7B",
|
|
20725
20979
|
seen: "discovered",
|
|
@@ -20883,11 +21137,14 @@ var COMPACT = new Intl.NumberFormat("en-US", {
|
|
|
20883
21137
|
// ../../packages/schema/src/token/token-report.ts
|
|
20884
21138
|
var num = (value) => value ?? 0;
|
|
20885
21139
|
function costUsageOf(a, promptTokens) {
|
|
21140
|
+
const write1h = num(a.ephemeral_1h_input_tokens);
|
|
21141
|
+
const write5m = num(a.ephemeral_5m_input_tokens);
|
|
21142
|
+
const unsplit = Math.max(num(a.cache_creation_input_tokens) - write1h - write5m, 0);
|
|
20886
21143
|
const usage = {
|
|
20887
21144
|
inputTokens: num(a.input_tokens),
|
|
20888
21145
|
outputTokens: num(a.output_tokens),
|
|
20889
|
-
cacheWrite1hTokens:
|
|
20890
|
-
cacheWrite5mTokens:
|
|
21146
|
+
cacheWrite1hTokens: write1h,
|
|
21147
|
+
cacheWrite5mTokens: write5m + unsplit,
|
|
20891
21148
|
cacheReadTokens: num(a.cache_read_input_tokens),
|
|
20892
21149
|
webSearchRequests: num(a.web_search_requests)
|
|
20893
21150
|
};
|
|
@@ -22906,6 +23163,31 @@ var DeviceCommandAckBody = external_exports.discriminatedUnion("outcome", [
|
|
|
22906
23163
|
projectsScanned: external_exports.number().int().nonnegative()
|
|
22907
23164
|
}).strict()
|
|
22908
23165
|
]);
|
|
23166
|
+
var SIGHTING_KEY_MATERIAL = /^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/;
|
|
23167
|
+
var sightingKeyMaterial = external_exports.string().regex(SIGHTING_KEY_MATERIAL, "must be the base64url encoding of exactly 32 bytes");
|
|
23168
|
+
var sightingKeyVersion = external_exports.number().int().min(1);
|
|
23169
|
+
var SightingKeyVersion = external_exports.object({
|
|
23170
|
+
keyVersion: sightingKeyVersion,
|
|
23171
|
+
key: sightingKeyMaterial
|
|
23172
|
+
});
|
|
23173
|
+
var SightingKeyResponse = external_exports.object({
|
|
23174
|
+
keyVersion: sightingKeyVersion,
|
|
23175
|
+
algorithm: external_exports.literal("hmac-sha256"),
|
|
23176
|
+
key: sightingKeyMaterial,
|
|
23177
|
+
previous: external_exports.array(SightingKeyVersion).optional()
|
|
23178
|
+
}).refine(
|
|
23179
|
+
(body) => {
|
|
23180
|
+
const versions = [body.keyVersion, ...(body.previous ?? []).map((p) => p.keyVersion)];
|
|
23181
|
+
return new Set(versions).size === versions.length;
|
|
23182
|
+
},
|
|
23183
|
+
{ message: "key versions must be distinct", path: ["previous"] }
|
|
23184
|
+
);
|
|
23185
|
+
var StoredSightingKeys = SightingKeyResponse.and(
|
|
23186
|
+
external_exports.object({
|
|
23187
|
+
fetchedAtMs: external_exports.number().int().nonnegative(),
|
|
23188
|
+
endpointFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/)
|
|
23189
|
+
})
|
|
23190
|
+
);
|
|
22909
23191
|
|
|
22910
23192
|
// ../../packages/schema/src/zod/registry.ts
|
|
22911
23193
|
var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
@@ -24899,6 +25181,26 @@ var ManagedSettings = external_exports.object({
|
|
|
24899
25181
|
};
|
|
24900
25182
|
}).meta({ id: "ManagedSettings" });
|
|
24901
25183
|
|
|
25184
|
+
// ../../packages/schema/src/zod/mod-finding.ts
|
|
25185
|
+
var MOD_FINDINGS_MAX_BYTES = 4 * 1024 * 1024;
|
|
25186
|
+
var ModFindingAction = external_exports.enum(["redacted", "vaulted", "blocked", "warned", "logged"]).meta({ id: "ModFindingAction" });
|
|
25187
|
+
var ModFindingWhere = external_exports.enum(["prompt", "attachment", "tool-input", "tool-output", "memory", "subagent"]).meta({ id: "ModFindingWhere" });
|
|
25188
|
+
var ModFinding = external_exports.strictObject({
|
|
25189
|
+
v: external_exports.literal(1),
|
|
25190
|
+
id: external_exports.string().regex(/^[0-9a-f]{16}$/),
|
|
25191
|
+
at: external_exports.iso.datetime(),
|
|
25192
|
+
ruleId: external_exports.string().min(1),
|
|
25193
|
+
shortName: external_exports.string().min(1).max(64).optional(),
|
|
25194
|
+
category: DetectionCategory,
|
|
25195
|
+
severity: Severity,
|
|
25196
|
+
action: ModFindingAction,
|
|
25197
|
+
where: ModFindingWhere,
|
|
25198
|
+
pointer: external_exports.string().regex(POINTER_TOKEN_ANCHORED).optional()
|
|
25199
|
+
}).refine((f) => f.action === "vaulted" === (f.pointer !== void 0), {
|
|
25200
|
+
path: ["pointer"],
|
|
25201
|
+
message: "pointer is present only for a vaulted finding, and a vaulted finding has one"
|
|
25202
|
+
}).meta({ id: "ModFinding" });
|
|
25203
|
+
|
|
24902
25204
|
// ../../packages/schema/src/zod/mod-policy-snapshot.ts
|
|
24903
25205
|
var MOD_POLICY_SNAPSHOT_VERSION = 1;
|
|
24904
25206
|
var MOD_POLICY_SNAPSHOT_MAX_BYTES = 4 * 1024 * 1024;
|
|
@@ -27673,11 +27975,21 @@ var TIMELINE_COLUMNS = `
|
|
|
27673
27975
|
json_extract(attributes, '$.targetId') AS target_id,
|
|
27674
27976
|
json_extract(attributes, '$.internal') AS internal,
|
|
27675
27977
|
json_extract(attributes, '$.flagged') AS flagged`;
|
|
27978
|
+
var CALL_WRITE_SPLIT = `(coalesce(ephemeral_1h_input_tokens, 0) + coalesce(ephemeral_5m_input_tokens, 0))`;
|
|
27676
27979
|
var CALL_PROMPT_TOKENS = `(coalesce(input_tokens, 0) + coalesce(cache_read_input_tokens, 0)
|
|
27677
|
-
+ coalesce(
|
|
27678
|
-
var CALL_BAND = LONG_CONTEXT_THRESHOLDS.
|
|
27679
|
-
|
|
27980
|
+
+ max(coalesce(cache_creation_input_tokens, 0), ${CALL_WRITE_SPLIT}))`;
|
|
27981
|
+
var CALL_BAND = LONG_CONTEXT_THRESHOLDS.map(
|
|
27982
|
+
(t) => `(${CALL_PROMPT_TOKENS} > ${String(Math.trunc(t))})`
|
|
27680
27983
|
);
|
|
27984
|
+
var CALL_USAGE_SHAPE = [
|
|
27985
|
+
"coalesce(input_tokens, 0) > 0",
|
|
27986
|
+
"coalesce(output_tokens, 0) > 0",
|
|
27987
|
+
"coalesce(cache_read_input_tokens, 0) > 0",
|
|
27988
|
+
"coalesce(ephemeral_1h_input_tokens, 0) > 0",
|
|
27989
|
+
"coalesce(ephemeral_5m_input_tokens, 0) > 0",
|
|
27990
|
+
`coalesce(cache_creation_input_tokens, 0) > ${CALL_WRITE_SPLIT}`,
|
|
27991
|
+
"coalesce(web_search_requests, 0) > 0"
|
|
27992
|
+
].map((condition) => `(${condition})`);
|
|
27681
27993
|
var LLM_USAGE_SELECT = `
|
|
27682
27994
|
SELECT root_session_id AS sessionId,
|
|
27683
27995
|
provider,
|
|
@@ -27692,7 +28004,14 @@ var LLM_USAGE_SELECT = `
|
|
|
27692
28004
|
coalesce(sum(web_search_requests), 0) AS webSearchRequests,
|
|
27693
28005
|
coalesce(max(${CALL_PROMPT_TOKENS}), 0) AS promptTokens`;
|
|
27694
28006
|
var LLM_USAGE_SCOPE = `event_type = 'llm_call' AND attributes IS NOT NULL AND root_session_id IS NOT NULL`;
|
|
27695
|
-
var LLM_USAGE_GROUP = `GROUP BY
|
|
28007
|
+
var LLM_USAGE_GROUP = `GROUP BY ${[
|
|
28008
|
+
"root_session_id",
|
|
28009
|
+
"provider",
|
|
28010
|
+
"model",
|
|
28011
|
+
"service_tier",
|
|
28012
|
+
...CALL_BAND.length === 0 ? [] : [CALL_BAND.join(" + ")],
|
|
28013
|
+
...CALL_USAGE_SHAPE
|
|
28014
|
+
].join(", ")}`;
|
|
27696
28015
|
function usageLeaves(rows) {
|
|
27697
28016
|
return rows.map((row) => {
|
|
27698
28017
|
const attributes = {
|
|
@@ -27978,7 +28297,9 @@ var SqliteActivityRepository = class {
|
|
|
27978
28297
|
* store carries, since opening runs the migrations, so the hard requirement
|
|
27979
28298
|
* `INDEXED BY` introduces is already met; token-rollup-plans.test.ts pins
|
|
27980
28299
|
* the plan. All-time is a scan of the whole index — still one narrow entry
|
|
27981
|
-
* per call, no bag parsed.
|
|
28300
|
+
* per call, no bag parsed. The usage-shape terms in the key cost the
|
|
28301
|
+
* all-time read ~9 ms at 50k calls (34 → 43 ms, fastest of the run), against
|
|
28302
|
+
* 68 ms for folding the bags in JS.
|
|
27982
28303
|
*/
|
|
27983
28304
|
tokenReports(fromMs) {
|
|
27984
28305
|
const rows = allRows(
|
|
@@ -27993,8 +28314,8 @@ var SqliteActivityRepository = class {
|
|
|
27993
28314
|
return Promise.resolve(buildTokenReports(usageLeaves(rows), defaultCostModel));
|
|
27994
28315
|
}
|
|
27995
28316
|
/**
|
|
27996
|
-
* One session's token report — its `llm_call`s grouped
|
|
27997
|
-
*
|
|
28317
|
+
* One session's token report — its `llm_call`s grouped as `tokenReports`
|
|
28318
|
+
* groups them (see LlmUsageRow) with derived cost, or `null` when the session made no
|
|
27998
28319
|
* `llm_call`s (an empty/tool-only session). Feeds the session-detail pane's
|
|
27999
28320
|
* per-model breakdown + estimated cost. The same rollup as `tokenReports`,
|
|
28000
28321
|
* seeking one root through a root-led `llm_call` index; the bag-reading fold
|
|
@@ -34931,21 +35252,27 @@ import {
|
|
|
34931
35252
|
createDecipheriv,
|
|
34932
35253
|
createHmac as createHmac2,
|
|
34933
35254
|
hkdfSync,
|
|
35255
|
+
randomBytes as randomBytes2,
|
|
34934
35256
|
timingSafeEqual
|
|
34935
35257
|
} from "crypto";
|
|
34936
35258
|
|
|
34937
35259
|
// ../../packages/persistence/src/vault/key-provider.ts
|
|
34938
35260
|
import { execFileSync } from "child_process";
|
|
34939
|
-
import { randomBytes as
|
|
35261
|
+
import { randomBytes as randomBytes3 } from "crypto";
|
|
34940
35262
|
import { chmodSync as chmodSync3, readFileSync as readFileSync10, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
34941
35263
|
import { join as join15 } from "path";
|
|
34942
35264
|
|
|
35265
|
+
// ../../packages/persistence/src/vault/sighting-keys.ts
|
|
35266
|
+
import { createHash as createHash6 } from "crypto";
|
|
35267
|
+
import { readFileSync as readFileSync11, rmSync as rmSync7 } from "fs";
|
|
35268
|
+
import { join as join16 } from "path";
|
|
35269
|
+
|
|
34943
35270
|
// ../../packages/persistence/src/vault/vault.ts
|
|
34944
|
-
import { randomBytes as
|
|
35271
|
+
import { randomBytes as randomBytes4, randomUUID as randomUUID12 } from "crypto";
|
|
34945
35272
|
|
|
34946
35273
|
// ../../packages/persistence/src/warn-era-cap.ts
|
|
34947
35274
|
import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
34948
|
-
import { join as
|
|
35275
|
+
import { join as join17 } from "path";
|
|
34949
35276
|
|
|
34950
35277
|
// ../../packages/remote/src/http.ts
|
|
34951
35278
|
import { request as httpRequest } from "http";
|
|
@@ -34959,16 +35286,16 @@ var SLASH2 = "/".charCodeAt(0);
|
|
|
34959
35286
|
var REQUEST_TIMEOUT_MS = 2e3;
|
|
34960
35287
|
|
|
34961
35288
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
34962
|
-
import { readFileSync as
|
|
34963
|
-
import { join as
|
|
35289
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
35290
|
+
import { join as join18 } from "path";
|
|
34964
35291
|
|
|
34965
35292
|
// ../../packages/plugin-runtime/src/attached/forward-policy.ts
|
|
34966
35293
|
import { randomUUID as randomUUID13 } from "crypto";
|
|
34967
35294
|
import { readFile, rename, writeFile } from "fs/promises";
|
|
34968
|
-
import { join as
|
|
35295
|
+
import { join as join19 } from "path";
|
|
34969
35296
|
|
|
34970
35297
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
34971
|
-
import { createHash as
|
|
35298
|
+
import { createHash as createHash7 } from "crypto";
|
|
34972
35299
|
import { hostname as hostname4 } from "os";
|
|
34973
35300
|
|
|
34974
35301
|
// ../../packages/plugin-runtime/src/attached/capture-rebuild.ts
|
|
@@ -34988,16 +35315,16 @@ var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
|
|
|
34988
35315
|
|
|
34989
35316
|
// ../../packages/plugin-runtime/src/attached/install-record.ts
|
|
34990
35317
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
34991
|
-
import { basename as basename2, dirname as dirname4, join as
|
|
35318
|
+
import { basename as basename2, dirname as dirname4, join as join20, resolve as resolve2 } from "path";
|
|
34992
35319
|
|
|
34993
35320
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
34994
|
-
import { readFileSync as
|
|
35321
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
34995
35322
|
var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
|
|
34996
35323
|
|
|
34997
35324
|
// ../../packages/plugin-runtime/src/attached/policy-store.ts
|
|
34998
35325
|
import { randomUUID as randomUUID14 } from "crypto";
|
|
34999
35326
|
import { readFile as readFile3, rm, writeFile as writeFile2 } from "fs/promises";
|
|
35000
|
-
import { join as
|
|
35327
|
+
import { join as join21 } from "path";
|
|
35001
35328
|
|
|
35002
35329
|
// ../../packages/plugin-runtime/src/attached/atomic-publish.ts
|
|
35003
35330
|
import { rename as rename2 } from "fs/promises";
|
|
@@ -35006,8 +35333,8 @@ var TIMED_RETRIES = 4;
|
|
|
35006
35333
|
var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
|
|
35007
35334
|
|
|
35008
35335
|
// ../../packages/plugin-runtime/src/attached/posture-report-state.ts
|
|
35009
|
-
import { readFileSync as
|
|
35010
|
-
import { join as
|
|
35336
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
35337
|
+
import { join as join22 } from "path";
|
|
35011
35338
|
var OUTCOME_KEYS = {
|
|
35012
35339
|
ok: true,
|
|
35013
35340
|
unauthorized: true,
|
|
@@ -35030,11 +35357,11 @@ import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
|
35030
35357
|
// ../../packages/plugin-runtime/src/attached/posture-store.ts
|
|
35031
35358
|
import { randomUUID as randomUUID15 } from "crypto";
|
|
35032
35359
|
import { readFile as readFile4, rm as rm2, writeFile as writeFile3 } from "fs/promises";
|
|
35033
|
-
import { join as
|
|
35360
|
+
import { join as join23 } from "path";
|
|
35034
35361
|
|
|
35035
35362
|
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
35036
|
-
import { readFileSync as
|
|
35037
|
-
import { join as
|
|
35363
|
+
import { readFileSync as readFileSync15 } from "fs";
|
|
35364
|
+
import { join as join24 } from "path";
|
|
35038
35365
|
|
|
35039
35366
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
35040
35367
|
var REFUSAL_LINES = {
|
|
@@ -35050,6 +35377,9 @@ var OUTCOME_LINES = {
|
|
|
35050
35377
|
"invalid-bundle": "control plane sent a policy bundle this build cannot read"
|
|
35051
35378
|
};
|
|
35052
35379
|
|
|
35380
|
+
// ../../packages/plugin-runtime/src/attached/sighting-key-sync.ts
|
|
35381
|
+
var SIGHTING_KEY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
35382
|
+
|
|
35053
35383
|
// ../../packages/plugin-runtime/src/attached/sync-trigger.ts
|
|
35054
35384
|
import { spawn as spawn2 } from "child_process";
|
|
35055
35385
|
import { fileURLToPath as fileURLToPath2 } from "url";
|