@genesislcap/ai-assistant 15.88.2 → 15.89.0

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.
@@ -1315,6 +1315,7 @@ var SUPPORTED_GEMINI_MODEL_IDS = [
1315
1315
  "gemini-2.5-pro",
1316
1316
  "gemini-2.5-flash",
1317
1317
  "gemini-2.5-flash-lite",
1318
+ "gemini-4-argon",
1318
1319
  "gemini-3.8-flash",
1319
1320
  "gemini-3.5-flash",
1320
1321
  "gemini-3.1-flash-lite",
@@ -1403,6 +1404,7 @@ function anthropicTokenCost(model, usage) {
1403
1404
  var GEMINI_LONG_CONTEXT_THRESHOLD = 2e5;
1404
1405
  var GEMINI_CACHED_INPUT_MULTIPLIER = 0.1;
1405
1406
  var GEMINI_3_8_FLASH_INTRO_RATE_ENDS = Date.parse("2027-01-01T00:00:00Z");
1407
+ var GEMINI_4_ARGON_LAUNCH_RATE_ENDS = Date.parse("2026-12-01T00:00:00Z");
1406
1408
  var GEMINI_PRICING = {
1407
1409
  "gemini-2.5-flash-lite": {
1408
1410
  kind: "flat",
@@ -1419,37 +1421,50 @@ var GEMINI_PRICING = {
1419
1421
  rate: { promptPerMillion: 0.25, candidatePerMillion: 1.5 }
1420
1422
  },
1421
1423
  "gemini-3.5-flash": { kind: "flat", rate: { promptPerMillion: 1.5, candidatePerMillion: 9 } },
1422
- // INTRODUCTORY RATE, and the only dated entry in this file. Google publishes
1423
- // $0.75 / $3.75 per MTok **through 2026-12-31**, rising to $1.50 / $7.50 on 2027-01-01 —
1424
- // so today this model is CHEAPER than gemini-3.5-flash above and in January it is not.
1424
+ // INTRODUCTORY RATE. Google publishes $0.75 / $3.75 per MTok **through 2026-12-31**, rising
1425
+ // to $1.50 / $7.50 on 2027-01-01 — so until then this model is CHEAPER than gemini-3.5-flash
1426
+ // above, and from then it is not.
1425
1427
  //
1426
- // The listed figure is the one in force, not the one coming. That is the lesson the
1427
- // `claude-sonnet-5` entry records from the other direction: charging a scheduled future
1428
- // rate early over-billed every request by 50% for as long as nobody noticed. A rate that
1429
- // has not taken effect is not a price, and `GeminiPricing` deliberately has no time
1430
- // dimension to express one — flip these two numbers on 2027-01-01 instead.
1431
- //
1432
- // That flip is ENFORCED, not remembered: `token-cost.test.ts` carries a dated assertion that
1433
- // turns the build red on 2027-01-01 and names the three-line edit (these two rates, plus the
1434
- // now-false `< gemini-3.5-flash` comparison in that same test — both models are $1.50 input
1435
- // from that date). There is no ticket to lose.
1428
+ // `dated`, carrying BOTH rates and the switch instant, rather than today's rate plus a test
1429
+ // that goes red on the day. Each request is priced at the rate in force when it is made, so a
1430
+ // scheduled future rate is never charged early — the trap the `claude-sonnet-5` entry records,
1431
+ // where that over-billed every request by 50% — and the switch needs no edit and no release.
1432
+ // That second half is the point: a failing test only reaches our own CI, while every version
1433
+ // already published would keep billing the old rate until a fix shipped and apps upgraded.
1434
+ // https://ai.google.dev/gemini-api/docs/pricing
1435
+ "gemini-3.8-flash": {
1436
+ kind: "dated",
1437
+ before: { promptPerMillion: 0.75, candidatePerMillion: 3.75 },
1438
+ after: { promptPerMillion: 1.5, candidatePerMillion: 7.5 },
1439
+ switchAtMs: GEMINI_3_8_FLASH_INTRO_RATE_ENDS
1440
+ },
1441
+ // Launch rate $2 / $10 per MTok until 30 Nov 2026, then $4 / $20 — `dated`, like
1442
+ // gemini-3.8-flash above. Selected by the `at` argument of `geminiRatesFor` (default: now).
1436
1443
  // https://ai.google.dev/gemini-api/docs/pricing
1437
- "gemini-3.8-flash": { kind: "flat", rate: { promptPerMillion: 0.75, candidatePerMillion: 3.75 } },
1444
+ "gemini-4-argon": {
1445
+ kind: "dated",
1446
+ before: { promptPerMillion: 2, candidatePerMillion: 10 },
1447
+ after: { promptPerMillion: 4, candidatePerMillion: 20 },
1448
+ switchAtMs: GEMINI_4_ARGON_LAUNCH_RATE_ENDS
1449
+ },
1438
1450
  "gemini-3.1-pro-preview": {
1439
1451
  kind: "tiered",
1440
1452
  standard: { promptPerMillion: 2, candidatePerMillion: 12 },
1441
1453
  longContext: { promptPerMillion: 4, candidatePerMillion: 18 }
1442
1454
  }
1443
1455
  };
1444
- function geminiRatesFor(model, promptTokens) {
1456
+ function geminiRatesFor(model, promptTokens, at = /* @__PURE__ */ new Date()) {
1445
1457
  const pricing = GEMINI_PRICING[model];
1446
1458
  if (pricing.kind === "flat") {
1447
1459
  return pricing.rate;
1448
1460
  }
1461
+ if (pricing.kind === "dated") {
1462
+ return at.getTime() < pricing.switchAtMs ? pricing.before : pricing.after;
1463
+ }
1449
1464
  return promptTokens > GEMINI_LONG_CONTEXT_THRESHOLD ? pricing.longContext : pricing.standard;
1450
1465
  }
1451
- function geminiTokenCost(model, usage) {
1452
- const { promptPerMillion, candidatePerMillion } = geminiRatesFor(model, usage.promptTokens);
1466
+ function geminiTokenCost(model, usage, at = /* @__PURE__ */ new Date()) {
1467
+ const { promptPerMillion, candidatePerMillion } = geminiRatesFor(model, usage.promptTokens, at);
1453
1468
  const m = TOKENS_PER_MILLION;
1454
1469
  const uncachedPromptTokens = Math.max(0, usage.promptTokens - usage.cachedTokens);
1455
1470
  const promptCost = uncachedPromptTokens / m * promptPerMillion;
@@ -3043,6 +3058,7 @@ var GEMINI_CONTEXT_LIMITS = {
3043
3058
  "gemini-2.5-pro": 1048576,
3044
3059
  "gemini-2.5-flash": 1048576,
3045
3060
  "gemini-2.5-flash-lite": 1048576,
3061
+ "gemini-4-argon": 1048576,
3046
3062
  "gemini-3.8-flash": 1048576,
3047
3063
  "gemini-3.5-flash": 1048576,
3048
3064
  "gemini-3.1-flash-lite": 1048576,
@@ -3068,10 +3084,15 @@ var GEMINI_MODEL_WARNINGS = {
3068
3084
  "gemini-2.5-flash": "GeminiTransport: using gemini-2.5-flash \u2014 higher cost than flash-lite; use for harder reasoning or agent tasks.",
3069
3085
  "gemini-2.5-pro": "GeminiTransport: using gemini-2.5-pro \u2014 significantly higher, prompt-size-tiered cost; reserve for tasks where flash reliability is insufficient.",
3070
3086
  "gemini-3.5-flash": "GeminiTransport: using gemini-3.5-flash \u2014 frontier model, materially higher cost than flash-lite; use for harder reasoning or agent tasks.",
3071
- // Warns despite currently costing LESS than gemini-3.5-flash, because that is temporary: the
3072
- // rate doubles on 2027-01-01 (see GEMINI_PRICING). A caller that picks this tier on today's
3073
- // price and never revisits the choice gets twice the bill in January without changing a line.
3074
- "gemini-3.8-flash": "GeminiTransport: using gemini-3.8-flash \u2014 frontier model, materially higher cost than flash-lite. Its $0.75/$3.75 per-MTok rate is introductory and DOUBLES to $1.50/$7.50 on 2027-01-01; re-check this tier choice before then.",
3087
+ // Warns despite costing LESS than gemini-3.5-flash until 2027-01-01, because that is temporary:
3088
+ // the rate doubles that day (see GEMINI_PRICING, which switches on its own). A caller that picks
3089
+ // this tier on the introductory price and never revisits the choice gets twice the bill in
3090
+ // January without changing a line. Worded to stay true after the switch.
3091
+ "gemini-3.8-flash": "GeminiTransport: using gemini-3.8-flash \u2014 frontier model, materially higher cost than flash-lite. Billed at an introductory $0.75/$3.75 per MTok through 2026-12-31 and $1.50/$7.50 from 2027-01-01; weigh a tier choice against the later rate.",
3092
+ // Like gemini-3.8-flash, warns about a scheduled rate change: $2/$10 per MTok until 2026-11-30,
3093
+ // then $4/$20 (see GEMINI_PRICING, which switches on its own). Worded to stay true after the
3094
+ // switch, so the message needs no edit on the day.
3095
+ "gemini-4-argon": "GeminiTransport: using gemini-4-argon \u2014 premium reasoning model, materially higher cost than the flash tiers. Billed at $2/$10 per MTok through 2026-11-30 and $4/$20 from 2026-12-01; weigh a tier choice against the later rate.",
3075
3096
  "gemini-3.1-pro-preview": "GeminiTransport: using gemini-3.1-pro-preview \u2014 PREVIEW model (no stability guarantee, may be withdrawn) with significantly higher, prompt-size-tiered cost; reserve for tasks where flash reliability is insufficient."
3076
3097
  };
3077
3098
  var GEMINI_THINKING_DISABLEABLE = [
@@ -3084,8 +3105,18 @@ var GEMINI_MEDIA_RESOLUTION_TIERS = [
3084
3105
  "gemini-3.1-flash-lite",
3085
3106
  "gemini-3.1-pro-preview"
3086
3107
  ];
3108
+ var GEMINI_SCHEMA_WITH_TOOLS_TIERS = [
3109
+ "gemini-4-argon",
3110
+ "gemini-3.8-flash",
3111
+ "gemini-3.5-flash",
3112
+ "gemini-3.1-flash-lite",
3113
+ "gemini-3.1-pro-preview"
3114
+ ];
3087
3115
  var GEMINI_LEVEL_LADDER = ["minimal", "low", "medium", "high"];
3088
3116
  var GEMINI_THINKING_LEVELS = {
3117
+ // Same accepted set as gemini-3.8-flash (Google docs, 2026-10-29: low/medium/high, default
3118
+ // medium, no `minimal`) — documented rather than probed, so re-measure when convenient.
3119
+ "gemini-4-argon": ["low", "medium", "high"],
3089
3120
  "gemini-3.8-flash": ["low", "medium", "high"],
3090
3121
  "gemini-3.5-flash": ["minimal", "low", "medium", "high"],
3091
3122
  "gemini-3.1-flash-lite": ["minimal", "low", "medium", "high"],
@@ -3173,8 +3204,8 @@ var GeminiTransport = class _GeminiTransport {
3173
3204
  * default posture. Without this, a caller asking for `high` on `gemini-2.5-pro` and quietly
3174
3205
  * getting the default is left to wonder why.
3175
3206
  * - A graded depth whose DIALECT a Gemini 3 tier speaks but whose particular value it does not
3176
- * accept — `minimal` on `gemini-3.8-flash` or `gemini-3.1-pro-preview`, the two tiers that
3177
- * reject it outright. Nothing is dropped here; `clampThinkingLevel` MOVES the level onto the
3207
+ * accept — `minimal` on `gemini-4-argon`, `gemini-3.8-flash` or `gemini-3.1-pro-preview`, the tiers
3208
+ * that reject it outright. Nothing is dropped here; `clampThinkingLevel` MOVES the level onto the
3178
3209
  * nearest one the tier takes, and since ties resolve upward the move is usually to something
3179
3210
  * DEARER than the caller chose. A cost decision reversed on the wire in the expensive
3180
3211
  * direction is exactly what this warning exists for — without it the only trace is the bill.
@@ -3303,7 +3334,7 @@ var GeminiTransport = class _GeminiTransport {
3303
3334
  });
3304
3335
  }
3305
3336
  const offeredToolNames = new Set(((_c = options === null || options === void 0 ? void 0 : options.tools) !== null && _c !== void 0 ? _c : []).map((t) => t.name));
3306
- const schemaCoexistsWithTools = this.model.startsWith("gemini-3");
3337
+ const schemaCoexistsWithTools = GEMINI_SCHEMA_WITH_TOOLS_TIERS.includes(this.model);
3307
3338
  const applyResponseSchema = (options === null || options === void 0 ? void 0 : options.responseSchema) != null && (!tools || schemaCoexistsWithTools);
3308
3339
  const response = yield this.post(Object.assign({
3309
3340
  model: this.model,
@@ -3816,7 +3847,7 @@ var DEFAULT_AI_TIERS = Object.freeze({
3816
3847
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
3817
3848
  }),
3818
3849
  // On an INTRODUCTORY rate that doubles to $1.50 / $7.50 on 2027-01-01, from which point it
3819
- // is dearer on input than the gemini-3.5-flash it replaced. Chosen at the introductory rate
3850
+ // no longer undercuts the gemini-3.5-flash it replaced on input. Chosen at the introductory rate
3820
3851
  // knowingly; `ai-tiers.test.ts` fails that day to force the re-bench.
3821
3852
  high: Object.freeze({
3822
3853
  model: "gemini-3.8-flash",