@genesislcap/ai-assistant 15.88.1 → 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.
@@ -1404,6 +1404,7 @@ var SUPPORTED_GEMINI_MODEL_IDS = [
1404
1404
  "gemini-2.5-pro",
1405
1405
  "gemini-2.5-flash",
1406
1406
  "gemini-2.5-flash-lite",
1407
+ "gemini-4-argon",
1407
1408
  "gemini-3.8-flash",
1408
1409
  "gemini-3.5-flash",
1409
1410
  "gemini-3.1-flash-lite",
@@ -1492,6 +1493,7 @@ function anthropicTokenCost(model, usage) {
1492
1493
  var GEMINI_LONG_CONTEXT_THRESHOLD = 2e5;
1493
1494
  var GEMINI_CACHED_INPUT_MULTIPLIER = 0.1;
1494
1495
  var GEMINI_3_8_FLASH_INTRO_RATE_ENDS = Date.parse("2027-01-01T00:00:00Z");
1496
+ var GEMINI_4_ARGON_LAUNCH_RATE_ENDS = Date.parse("2026-12-01T00:00:00Z");
1495
1497
  var GEMINI_PRICING = {
1496
1498
  "gemini-2.5-flash-lite": {
1497
1499
  kind: "flat",
@@ -1508,37 +1510,50 @@ var GEMINI_PRICING = {
1508
1510
  rate: { promptPerMillion: 0.25, candidatePerMillion: 1.5 }
1509
1511
  },
1510
1512
  "gemini-3.5-flash": { kind: "flat", rate: { promptPerMillion: 1.5, candidatePerMillion: 9 } },
1511
- // INTRODUCTORY RATE, and the only dated entry in this file. Google publishes
1512
- // $0.75 / $3.75 per MTok **through 2026-12-31**, rising to $1.50 / $7.50 on 2027-01-01 —
1513
- // so today this model is CHEAPER than gemini-3.5-flash above and in January it is not.
1513
+ // INTRODUCTORY RATE. Google publishes $0.75 / $3.75 per MTok **through 2026-12-31**, rising
1514
+ // to $1.50 / $7.50 on 2027-01-01 — so until then this model is CHEAPER than gemini-3.5-flash
1515
+ // above, and from then it is not.
1514
1516
  //
1515
- // The listed figure is the one in force, not the one coming. That is the lesson the
1516
- // `claude-sonnet-5` entry records from the other direction: charging a scheduled future
1517
- // rate early over-billed every request by 50% for as long as nobody noticed. A rate that
1518
- // has not taken effect is not a price, and `GeminiPricing` deliberately has no time
1519
- // dimension to express one — flip these two numbers on 2027-01-01 instead.
1520
- //
1521
- // That flip is ENFORCED, not remembered: `token-cost.test.ts` carries a dated assertion that
1522
- // turns the build red on 2027-01-01 and names the three-line edit (these two rates, plus the
1523
- // now-false `< gemini-3.5-flash` comparison in that same test — both models are $1.50 input
1524
- // from that date). There is no ticket to lose.
1517
+ // `dated`, carrying BOTH rates and the switch instant, rather than today's rate plus a test
1518
+ // that goes red on the day. Each request is priced at the rate in force when it is made, so a
1519
+ // scheduled future rate is never charged early — the trap the `claude-sonnet-5` entry records,
1520
+ // where that over-billed every request by 50% — and the switch needs no edit and no release.
1521
+ // That second half is the point: a failing test only reaches our own CI, while every version
1522
+ // already published would keep billing the old rate until a fix shipped and apps upgraded.
1523
+ // https://ai.google.dev/gemini-api/docs/pricing
1524
+ "gemini-3.8-flash": {
1525
+ kind: "dated",
1526
+ before: { promptPerMillion: 0.75, candidatePerMillion: 3.75 },
1527
+ after: { promptPerMillion: 1.5, candidatePerMillion: 7.5 },
1528
+ switchAtMs: GEMINI_3_8_FLASH_INTRO_RATE_ENDS
1529
+ },
1530
+ // Launch rate $2 / $10 per MTok until 30 Nov 2026, then $4 / $20 — `dated`, like
1531
+ // gemini-3.8-flash above. Selected by the `at` argument of `geminiRatesFor` (default: now).
1525
1532
  // https://ai.google.dev/gemini-api/docs/pricing
1526
- "gemini-3.8-flash": { kind: "flat", rate: { promptPerMillion: 0.75, candidatePerMillion: 3.75 } },
1533
+ "gemini-4-argon": {
1534
+ kind: "dated",
1535
+ before: { promptPerMillion: 2, candidatePerMillion: 10 },
1536
+ after: { promptPerMillion: 4, candidatePerMillion: 20 },
1537
+ switchAtMs: GEMINI_4_ARGON_LAUNCH_RATE_ENDS
1538
+ },
1527
1539
  "gemini-3.1-pro-preview": {
1528
1540
  kind: "tiered",
1529
1541
  standard: { promptPerMillion: 2, candidatePerMillion: 12 },
1530
1542
  longContext: { promptPerMillion: 4, candidatePerMillion: 18 }
1531
1543
  }
1532
1544
  };
1533
- function geminiRatesFor(model, promptTokens) {
1545
+ function geminiRatesFor(model, promptTokens, at = /* @__PURE__ */ new Date()) {
1534
1546
  const pricing = GEMINI_PRICING[model];
1535
1547
  if (pricing.kind === "flat") {
1536
1548
  return pricing.rate;
1537
1549
  }
1550
+ if (pricing.kind === "dated") {
1551
+ return at.getTime() < pricing.switchAtMs ? pricing.before : pricing.after;
1552
+ }
1538
1553
  return promptTokens > GEMINI_LONG_CONTEXT_THRESHOLD ? pricing.longContext : pricing.standard;
1539
1554
  }
1540
- function geminiTokenCost(model, usage) {
1541
- const { promptPerMillion, candidatePerMillion } = geminiRatesFor(model, usage.promptTokens);
1555
+ function geminiTokenCost(model, usage, at = /* @__PURE__ */ new Date()) {
1556
+ const { promptPerMillion, candidatePerMillion } = geminiRatesFor(model, usage.promptTokens, at);
1542
1557
  const m = TOKENS_PER_MILLION;
1543
1558
  const uncachedPromptTokens = Math.max(0, usage.promptTokens - usage.cachedTokens);
1544
1559
  const promptCost = uncachedPromptTokens / m * promptPerMillion;
@@ -3132,6 +3147,7 @@ var GEMINI_CONTEXT_LIMITS = {
3132
3147
  "gemini-2.5-pro": 1048576,
3133
3148
  "gemini-2.5-flash": 1048576,
3134
3149
  "gemini-2.5-flash-lite": 1048576,
3150
+ "gemini-4-argon": 1048576,
3135
3151
  "gemini-3.8-flash": 1048576,
3136
3152
  "gemini-3.5-flash": 1048576,
3137
3153
  "gemini-3.1-flash-lite": 1048576,
@@ -3157,10 +3173,15 @@ var GEMINI_MODEL_WARNINGS = {
3157
3173
  "gemini-2.5-flash": "GeminiTransport: using gemini-2.5-flash \u2014 higher cost than flash-lite; use for harder reasoning or agent tasks.",
3158
3174
  "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.",
3159
3175
  "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.",
3160
- // Warns despite currently costing LESS than gemini-3.5-flash, because that is temporary: the
3161
- // rate doubles on 2027-01-01 (see GEMINI_PRICING). A caller that picks this tier on today's
3162
- // price and never revisits the choice gets twice the bill in January without changing a line.
3163
- "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.",
3176
+ // Warns despite costing LESS than gemini-3.5-flash until 2027-01-01, because that is temporary:
3177
+ // the rate doubles that day (see GEMINI_PRICING, which switches on its own). A caller that picks
3178
+ // this tier on the introductory price and never revisits the choice gets twice the bill in
3179
+ // January without changing a line. Worded to stay true after the switch.
3180
+ "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.",
3181
+ // Like gemini-3.8-flash, warns about a scheduled rate change: $2/$10 per MTok until 2026-11-30,
3182
+ // then $4/$20 (see GEMINI_PRICING, which switches on its own). Worded to stay true after the
3183
+ // switch, so the message needs no edit on the day.
3184
+ "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.",
3164
3185
  "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."
3165
3186
  };
3166
3187
  var GEMINI_THINKING_DISABLEABLE = [
@@ -3173,8 +3194,18 @@ var GEMINI_MEDIA_RESOLUTION_TIERS = [
3173
3194
  "gemini-3.1-flash-lite",
3174
3195
  "gemini-3.1-pro-preview"
3175
3196
  ];
3197
+ var GEMINI_SCHEMA_WITH_TOOLS_TIERS = [
3198
+ "gemini-4-argon",
3199
+ "gemini-3.8-flash",
3200
+ "gemini-3.5-flash",
3201
+ "gemini-3.1-flash-lite",
3202
+ "gemini-3.1-pro-preview"
3203
+ ];
3176
3204
  var GEMINI_LEVEL_LADDER = ["minimal", "low", "medium", "high"];
3177
3205
  var GEMINI_THINKING_LEVELS = {
3206
+ // Same accepted set as gemini-3.8-flash (Google docs, 2026-10-29: low/medium/high, default
3207
+ // medium, no `minimal`) — documented rather than probed, so re-measure when convenient.
3208
+ "gemini-4-argon": ["low", "medium", "high"],
3178
3209
  "gemini-3.8-flash": ["low", "medium", "high"],
3179
3210
  "gemini-3.5-flash": ["minimal", "low", "medium", "high"],
3180
3211
  "gemini-3.1-flash-lite": ["minimal", "low", "medium", "high"],
@@ -3262,8 +3293,8 @@ var GeminiTransport = class _GeminiTransport {
3262
3293
  * default posture. Without this, a caller asking for `high` on `gemini-2.5-pro` and quietly
3263
3294
  * getting the default is left to wonder why.
3264
3295
  * - A graded depth whose DIALECT a Gemini 3 tier speaks but whose particular value it does not
3265
- * accept — `minimal` on `gemini-3.8-flash` or `gemini-3.1-pro-preview`, the two tiers that
3266
- * reject it outright. Nothing is dropped here; `clampThinkingLevel` MOVES the level onto the
3296
+ * accept — `minimal` on `gemini-4-argon`, `gemini-3.8-flash` or `gemini-3.1-pro-preview`, the tiers
3297
+ * that reject it outright. Nothing is dropped here; `clampThinkingLevel` MOVES the level onto the
3267
3298
  * nearest one the tier takes, and since ties resolve upward the move is usually to something
3268
3299
  * DEARER than the caller chose. A cost decision reversed on the wire in the expensive
3269
3300
  * direction is exactly what this warning exists for — without it the only trace is the bill.
@@ -3392,7 +3423,7 @@ var GeminiTransport = class _GeminiTransport {
3392
3423
  });
3393
3424
  }
3394
3425
  const offeredToolNames = new Set(((_c = options === null || options === void 0 ? void 0 : options.tools) !== null && _c !== void 0 ? _c : []).map((t) => t.name));
3395
- const schemaCoexistsWithTools = this.model.startsWith("gemini-3");
3426
+ const schemaCoexistsWithTools = GEMINI_SCHEMA_WITH_TOOLS_TIERS.includes(this.model);
3396
3427
  const applyResponseSchema = (options === null || options === void 0 ? void 0 : options.responseSchema) != null && (!tools || schemaCoexistsWithTools);
3397
3428
  const response = yield this.post(Object.assign({
3398
3429
  model: this.model,
@@ -3905,7 +3936,7 @@ var DEFAULT_AI_TIERS = Object.freeze({
3905
3936
  timeoutMs: AI_NO_RESPONSE_TIMEOUT_MS
3906
3937
  }),
3907
3938
  // On an INTRODUCTORY rate that doubles to $1.50 / $7.50 on 2027-01-01, from which point it
3908
- // is dearer on input than the gemini-3.5-flash it replaced. Chosen at the introductory rate
3939
+ // no longer undercuts the gemini-3.5-flash it replaced on input. Chosen at the introductory rate
3909
3940
  // knowingly; `ai-tiers.test.ts` fails that day to force the re-bench.
3910
3941
  high: Object.freeze({
3911
3942
  model: "gemini-3.8-flash",