@qmediat.io/gemini-code-context-mcp 1.22.0 → 1.22.1
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/CHANGELOG.md +45 -1
- package/dist/gemini/model-registry.d.ts.map +1 -1
- package/dist/gemini/model-registry.js +4 -3
- package/dist/gemini/model-registry.js.map +1 -1
- package/dist/tools/ask-agentic.tool.d.ts.map +1 -1
- package/dist/tools/ask-agentic.tool.js +16 -13
- package/dist/tools/ask-agentic.tool.js.map +1 -1
- package/dist/tools/ask.tool.js +1 -0
- package/dist/tools/ask.tool.js.map +1 -1
- package/dist/tools/code.tool.js +1 -0
- package/dist/tools/code.tool.js.map +1 -1
- package/dist/tools/shared/abort-timeout.d.ts +6 -0
- package/dist/tools/shared/abort-timeout.d.ts.map +1 -1
- package/dist/tools/shared/abort-timeout.js +12 -5
- package/dist/tools/shared/abort-timeout.js.map +1 -1
- package/dist/utils/cost-estimator.d.ts +58 -4
- package/dist/utils/cost-estimator.d.ts.map +1 -1
- package/dist/utils/cost-estimator.js +196 -78
- package/dist/utils/cost-estimator.js.map +1 -1
- package/dist/utils/pricing-overrides.d.ts +10 -0
- package/dist/utils/pricing-overrides.d.ts.map +1 -0
- package/dist/utils/pricing-overrides.js +104 -0
- package/dist/utils/pricing-overrides.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,55 +1,97 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Approximate cost estimator for reporting (not billing authoritative).
|
|
3
3
|
*
|
|
4
|
-
* Rates are per million tokens
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Rates are per million tokens, Standard tier, the rates of Google's pricing page
|
|
5
|
+
* (https://ai.google.dev/gemini-api/docs/pricing, read 2026-10-16) with the dates
|
|
6
|
+
* they take effect. Where the page has a prompt-size tier (≤ 200k / > 200k tokens)
|
|
7
|
+
* the dearer tier is the row: the estimator does not see the prompt's size, so the
|
|
8
|
+
* row stays an upper bound. An unpriced id takes the dearest row of its category.
|
|
9
|
+
* `GEMINI_PRICING_OVERRIDES` (JSON, keyed by model id) replaces a row at run time.
|
|
7
10
|
*/
|
|
8
11
|
import { categorizeModel, costTierOf, isTextGenCategory } from '../gemini/model-taxonomy.js';
|
|
12
|
+
import { parsePricingOverrides } from './pricing-overrides.js';
|
|
13
|
+
const FLASH_3X = {
|
|
14
|
+
inputPerMillion: 0.75,
|
|
15
|
+
outputPerMillion: 3.75,
|
|
16
|
+
cachedInputPerMillion: 0.075,
|
|
17
|
+
next: {
|
|
18
|
+
from: '2027-01-01',
|
|
19
|
+
inputPerMillion: 1.5,
|
|
20
|
+
outputPerMillion: 7.5,
|
|
21
|
+
cachedInputPerMillion: 0.15,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/** The > 200k-token tier of the 3.x Pro previews (≤ 200k: 2 / 12 / 0.2). */
|
|
25
|
+
const PRO_3X_PREVIEW = {
|
|
26
|
+
inputPerMillion: 4,
|
|
27
|
+
outputPerMillion: 18,
|
|
28
|
+
cachedInputPerMillion: 0.4,
|
|
29
|
+
};
|
|
30
|
+
/** The 3.1 Flash-Lite rates; the page prices the model once, GA and preview ids alike. */
|
|
31
|
+
const FLASH_LITE_31 = {
|
|
32
|
+
inputPerMillion: 0.25,
|
|
33
|
+
outputPerMillion: 1.5,
|
|
34
|
+
cachedInputPerMillion: 0.025,
|
|
35
|
+
};
|
|
9
36
|
const DEFAULT_PRICING = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'gemini-
|
|
22
|
-
'gemini-
|
|
23
|
-
'gemini-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
'gemini-4-argon': {
|
|
38
|
+
inputPerMillion: 2,
|
|
39
|
+
outputPerMillion: 10,
|
|
40
|
+
cachedInputPerMillion: 0.1,
|
|
41
|
+
next: {
|
|
42
|
+
from: '2026-12-01',
|
|
43
|
+
inputPerMillion: 4,
|
|
44
|
+
outputPerMillion: 20,
|
|
45
|
+
cachedInputPerMillion: 0.2,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
'gemini-3-pro-preview': PRO_3X_PREVIEW,
|
|
49
|
+
'gemini-3.1-pro-preview': PRO_3X_PREVIEW,
|
|
50
|
+
'gemini-3.8-flash': FLASH_3X,
|
|
51
|
+
'gemini-3.7-flash': FLASH_3X,
|
|
52
|
+
'gemini-3.6-flash': FLASH_3X,
|
|
53
|
+
'gemini-3-flash-preview': {
|
|
54
|
+
inputPerMillion: 0.5,
|
|
55
|
+
outputPerMillion: 3,
|
|
56
|
+
cachedInputPerMillion: 0.05,
|
|
57
|
+
},
|
|
58
|
+
// The page lists it as `gemini-3.1-flash-image` (text input / text and thinking output).
|
|
59
|
+
'gemini-3.1-flash-image-preview': { inputPerMillion: 0.5, outputPerMillion: 3 },
|
|
60
|
+
'gemini-3.5-flash-lite': {
|
|
61
|
+
inputPerMillion: 0.3,
|
|
62
|
+
outputPerMillion: 2.5,
|
|
63
|
+
cachedInputPerMillion: 0.03,
|
|
64
|
+
},
|
|
65
|
+
'gemini-3.1-flash-lite': FLASH_LITE_31,
|
|
66
|
+
'gemini-3.1-flash-lite-preview': FLASH_LITE_31,
|
|
67
|
+
// The > 200k-token tier (≤ 200k: 1.25 / 10 / 0.125).
|
|
68
|
+
'gemini-2.5-pro': { inputPerMillion: 2.5, outputPerMillion: 15, cachedInputPerMillion: 0.25 },
|
|
69
|
+
'gemini-2.5-flash': { inputPerMillion: 0.3, outputPerMillion: 2.5, cachedInputPerMillion: 0.03 },
|
|
70
|
+
'gemini-2.5-flash-lite': {
|
|
71
|
+
inputPerMillion: 0.1,
|
|
72
|
+
outputPerMillion: 0.4,
|
|
73
|
+
cachedInputPerMillion: 0.01,
|
|
74
|
+
},
|
|
30
75
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
overrides = {};
|
|
51
|
-
}
|
|
52
|
-
return overrides;
|
|
76
|
+
/**
|
|
77
|
+
* Google's rolling aliases and the versioned id each served on 2026-10-16 (measured
|
|
78
|
+
* by the response's `modelVersion`; re-measure when Google moves them). The target
|
|
79
|
+
* only names the category: Google can move an alias to a dearer model between two
|
|
80
|
+
* measurements, so an alias prices at the dearest rate of its target's category.
|
|
81
|
+
*/
|
|
82
|
+
// Exported for the tests, which check every target is a priced id.
|
|
83
|
+
export const ALIAS_TARGET = {
|
|
84
|
+
'gemini-pro-latest': 'gemini-3.1-pro-preview',
|
|
85
|
+
'gemini-flash-latest': 'gemini-3.8-flash',
|
|
86
|
+
'gemini-flash-lite-latest': 'gemini-3.5-flash-lite',
|
|
87
|
+
};
|
|
88
|
+
/** `record[key]` when `key` is the record's own (never a prototype member such as `constructor`). */
|
|
89
|
+
function own(record, key) {
|
|
90
|
+
return Object.hasOwn(record, key) ? record[key] : undefined;
|
|
91
|
+
}
|
|
92
|
+
/** The ids the table prices (an alias is never one of them). Exported for the tests. */
|
|
93
|
+
export function isPricedId(id) {
|
|
94
|
+
return own(DEFAULT_PRICING, id) !== undefined;
|
|
53
95
|
}
|
|
54
96
|
/**
|
|
55
97
|
* Conservative defaults for models we've never seen — one for each cost tier
|
|
@@ -76,38 +118,96 @@ const UNKNOWN_RATE_BY_TIER = {
|
|
|
76
118
|
function cachedRate(row) {
|
|
77
119
|
return row.cachedInputPerMillion ?? row.inputPerMillion * 0.25;
|
|
78
120
|
}
|
|
121
|
+
/** The UTC calendar date of `at`, `YYYY-MM-DD`. */
|
|
122
|
+
function utcDate(at) {
|
|
123
|
+
return at.toISOString().slice(0, 10);
|
|
124
|
+
}
|
|
125
|
+
/** The highest of two rate sets, per component. */
|
|
126
|
+
function dearerRates(a, b) {
|
|
127
|
+
return {
|
|
128
|
+
inputPerMillion: Math.max(a.inputPerMillion, b.inputPerMillion),
|
|
129
|
+
outputPerMillion: Math.max(a.outputPerMillion, b.outputPerMillion),
|
|
130
|
+
cachedInputPerMillion: Math.max(cachedRate(a), cachedRate(b)),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** The rates of `entry` in force at `at`: its `next` rates from their UTC date on. */
|
|
134
|
+
function ratesAt(entry, at) {
|
|
135
|
+
const next = entry.next;
|
|
136
|
+
if (next === undefined || utcDate(at) < next.from)
|
|
137
|
+
return entry;
|
|
138
|
+
return next;
|
|
139
|
+
}
|
|
79
140
|
/**
|
|
80
|
-
* The dearest
|
|
81
|
-
*
|
|
82
|
-
* unpriced model of that category, read from the table instead of a fixed number.
|
|
141
|
+
* The dearest rates `entry` bills at `at` or at any later dated change, per component:
|
|
142
|
+
* what a call that may settle at any time from `at` on can cost.
|
|
83
143
|
*/
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
144
|
+
function dearestEverRates(entry, at) {
|
|
145
|
+
const next = entry.next;
|
|
146
|
+
if (next === undefined || utcDate(at) >= next.from)
|
|
147
|
+
return ratesAt(entry, at);
|
|
148
|
+
return dearerRates(entry, next);
|
|
149
|
+
}
|
|
150
|
+
/** The rates of `entry` for `moment`. */
|
|
151
|
+
function ratesFor(entry, moment) {
|
|
152
|
+
return moment.onward ? dearestEverRates(entry, moment.at) : ratesAt(entry, moment.at);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The dearest rate `rows` have for `moment` in a text category, per component (the
|
|
156
|
+
* highest input, output and cached rate of its rows): an upper bound for an unpriced
|
|
157
|
+
* model or an alias of that category, or `undefined` for a category no text row prices.
|
|
158
|
+
*/
|
|
159
|
+
function dearestTextRate(category, moment, rows) {
|
|
160
|
+
if (!isTextGenCategory(category))
|
|
161
|
+
return undefined;
|
|
162
|
+
let held;
|
|
163
|
+
for (const [id, entry] of Object.entries(rows)) {
|
|
164
|
+
if (categorizeModel(id) !== category)
|
|
89
165
|
continue;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
inputPerMillion: Math.max(held.inputPerMillion, row.inputPerMillion),
|
|
93
|
-
outputPerMillion: Math.max(held.outputPerMillion, row.outputPerMillion),
|
|
94
|
-
cachedInputPerMillion: Math.max(cachedRate(held), cachedRate(row)),
|
|
95
|
-
});
|
|
166
|
+
const row = ratesFor(entry, moment);
|
|
167
|
+
held = held === undefined ? row : dearerRates(held, row);
|
|
96
168
|
}
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
169
|
+
return held;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The row that prices `model`, or `undefined` when its category's bound applies:
|
|
173
|
+
* an override of the id itself; for an alias, its target's override (an alias never
|
|
174
|
+
* prices as a row — neither its own nor its target's); else the id's row.
|
|
175
|
+
*/
|
|
176
|
+
export function pricedRow(model, src) {
|
|
177
|
+
const override = own(src.overrides, model);
|
|
178
|
+
if (override !== undefined)
|
|
179
|
+
return override;
|
|
180
|
+
const target = own(src.aliasTarget, model);
|
|
181
|
+
if (target !== undefined)
|
|
182
|
+
return own(src.overrides, target);
|
|
183
|
+
return own(src.rows, model);
|
|
184
|
+
}
|
|
185
|
+
let loaded = null;
|
|
186
|
+
function loadPricing() {
|
|
187
|
+
if (loaded !== null)
|
|
188
|
+
return loaded;
|
|
189
|
+
const overrides = parsePricingOverrides(process.env.GEMINI_PRICING_OVERRIDES);
|
|
190
|
+
const boundRows = Object.assign(Object.create(null), DEFAULT_PRICING);
|
|
191
|
+
for (const [id, entry] of Object.entries(overrides)) {
|
|
192
|
+
// An alias never prices as a row, so its override never sets a category's bound.
|
|
193
|
+
if (own(ALIAS_TARGET, id) === undefined)
|
|
194
|
+
boundRows[id] = entry;
|
|
195
|
+
}
|
|
196
|
+
loaded = { sources: { overrides, aliasTarget: ALIAS_TARGET, rows: DEFAULT_PRICING }, boundRows };
|
|
197
|
+
return loaded;
|
|
198
|
+
}
|
|
199
|
+
function pricingFor(model, moment) {
|
|
200
|
+
const { sources, boundRows } = loadPricing();
|
|
201
|
+
const row = pricedRow(model, sources);
|
|
202
|
+
if (row)
|
|
203
|
+
return ratesFor(row, moment);
|
|
204
|
+
// An alias or an unpriced text model: the dearest rate of its category (an alias's
|
|
205
|
+
// is its measured target's). Anything else: the conservative rate of its cost tier —
|
|
206
|
+
// a model the taxonomy cannot place gets the premium rate rather than flash: better
|
|
207
|
+
// to block an over-budget user than let a never-seen model undercharge past the cap.
|
|
208
|
+
const categoryId = own(sources.aliasTarget, model) ?? model;
|
|
209
|
+
const bound = dearestTextRate(categorizeModel(categoryId), moment, boundRows);
|
|
210
|
+
return bound ?? UNKNOWN_RATE_BY_TIER[costTierOf(categoryId)];
|
|
111
211
|
}
|
|
112
212
|
/** Google's flex tier is billed at half the standard price for the same model. */
|
|
113
213
|
export const FLEX_PRICE_FACTOR = 0.5;
|
|
@@ -116,10 +216,12 @@ function tierFactor(tier) {
|
|
|
116
216
|
}
|
|
117
217
|
/** Estimated cost in USD (float). Multiply by 1e6 for micros before storing. */
|
|
118
218
|
export function estimateCostUsd(input) {
|
|
119
|
-
|
|
120
|
-
|
|
219
|
+
return costFor(input, { at: input.at ?? new Date(), onward: false });
|
|
220
|
+
}
|
|
221
|
+
function costFor(input, moment) {
|
|
222
|
+
const p = pricingFor(input.model, moment);
|
|
121
223
|
const uncached = (input.uncachedInputTokens / 1_000_000) * p.inputPerMillion;
|
|
122
|
-
const cached = (input.cachedInputTokens / 1_000_000) * cachedRate;
|
|
224
|
+
const cached = (input.cachedInputTokens / 1_000_000) * cachedRate(p);
|
|
123
225
|
const output = (input.outputTokens / 1_000_000) * p.outputPerMillion;
|
|
124
226
|
// Thinking tokens are currently billed as output tokens on Gemini Pro family.
|
|
125
227
|
const thinking = input.thinkingTokens
|
|
@@ -127,6 +229,20 @@ export function estimateCostUsd(input) {
|
|
|
127
229
|
: 0;
|
|
128
230
|
return (uncached + cached + output + thinking) * tierFactor(input.serviceTier);
|
|
129
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* A reservation for a call that may run up to `coverMs` (its timeout; `null`: none):
|
|
234
|
+
* the dearer of the cost at the rates in force at its start and at the end of that
|
|
235
|
+
* window, so a call that crosses a price change settles at or under what it reserved.
|
|
236
|
+
* A call without a timeout reserves at the dearest rate, per component, of every rate
|
|
237
|
+
* in force from its start on.
|
|
238
|
+
*/
|
|
239
|
+
export function estimateReservationUsd(input, coverMs) {
|
|
240
|
+
const start = input.at ?? new Date();
|
|
241
|
+
if (coverMs === null)
|
|
242
|
+
return costFor(input, { at: start, onward: true });
|
|
243
|
+
const end = new Date(start.getTime() + coverMs);
|
|
244
|
+
return Math.max(costFor(input, { at: start, onward: false }), costFor(input, { at: end, onward: false }));
|
|
245
|
+
}
|
|
130
246
|
export function toMicrosUsd(dollars) {
|
|
131
247
|
return Math.round(dollars * 1_000_000);
|
|
132
248
|
}
|
|
@@ -142,14 +258,16 @@ export function toMicrosUsd(dollars) {
|
|
|
142
258
|
export function estimatePreCallCostUsd(input) {
|
|
143
259
|
const workspaceTokens = Math.ceil(Math.max(0, input.workspaceBytes) / 4);
|
|
144
260
|
const promptTokens = Math.ceil(Math.max(0, input.promptChars) / 4);
|
|
145
|
-
|
|
261
|
+
const call = {
|
|
146
262
|
model: input.model,
|
|
147
263
|
serviceTier: input.serviceTier,
|
|
148
264
|
uncachedInputTokens: workspaceTokens + promptTokens + Math.max(0, input.extraInputTokens ?? 0),
|
|
149
265
|
cachedInputTokens: 0,
|
|
150
266
|
outputTokens: Math.max(0, input.expectedOutputTokens),
|
|
267
|
+
at: input.at,
|
|
151
268
|
...(input.thinkingTokens !== undefined ? { thinkingTokens: input.thinkingTokens } : {}),
|
|
152
|
-
}
|
|
269
|
+
};
|
|
270
|
+
return estimateReservationUsd(call, input.coverMs);
|
|
153
271
|
}
|
|
154
272
|
/**
|
|
155
273
|
* Raw conversion: `micros → dollars` as a full-precision float. Sub-cent values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost-estimator.js","sourceRoot":"","sources":["../../src/utils/cost-estimator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cost-estimator.js","sourceRoot":"","sources":["../../src/utils/cost-estimator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAoB/D,MAAM,QAAQ,GAAiB;IAC7B,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,qBAAqB,EAAE,KAAK;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,eAAe,EAAE,GAAG;QACpB,gBAAgB,EAAE,GAAG;QACrB,qBAAqB,EAAE,IAAI;KAC5B;CACF,CAAC;AAEF,4EAA4E;AAC5E,MAAM,cAAc,GAAiB;IACnC,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,EAAE;IACpB,qBAAqB,EAAE,GAAG;CAC3B,CAAC;AAEF,0FAA0F;AAC1F,MAAM,aAAa,GAAiB;IAClC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,GAAG;IACrB,qBAAqB,EAAE,KAAK;CAC7B,CAAC;AAEF,MAAM,eAAe,GAA2C;IAC9D,gBAAgB,EAAE;QAChB,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAA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,CAAC,OAAe;IAClD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GEMINI_PRICING_OVERRIDES`: the operator's price rows, validated at load. An entry
|
|
3
|
+
* the estimator could not price with (a rate that is not a finite number ≥ 0, a
|
|
4
|
+
* `next` without a `YYYY-MM-DD` `from` or without all three rates) is dropped with
|
|
5
|
+
* one warning naming the model and the reason; the table's row for it stays.
|
|
6
|
+
*/
|
|
7
|
+
import type { PricingEntry } from './cost-estimator.js';
|
|
8
|
+
/** The valid rows of `raw` (the variable's JSON) by model id; nothing when unset. */
|
|
9
|
+
export declare function parsePricingOverrides(raw: string | undefined): Record<string, PricingEntry>;
|
|
10
|
+
//# sourceMappingURL=pricing-overrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-overrides.d.ts","sourceRoot":"","sources":["../../src/utils/pricing-overrides.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,qBAAqB,CAAC;AAuE/D,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CA4B3F"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GEMINI_PRICING_OVERRIDES`: the operator's price rows, validated at load. An entry
|
|
3
|
+
* the estimator could not price with (a rate that is not a finite number ≥ 0, a
|
|
4
|
+
* `next` without a `YYYY-MM-DD` `from` or without all three rates) is dropped with
|
|
5
|
+
* one warning naming the model and the reason; the table's row for it stays.
|
|
6
|
+
*/
|
|
7
|
+
import { logger } from './logger.js';
|
|
8
|
+
const UTC_DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
9
|
+
const RATE_KEYS = ['inputPerMillion', 'outputPerMillion', 'cachedInputPerMillion'];
|
|
10
|
+
function asFields(value) {
|
|
11
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
12
|
+
return null;
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
function isRate(value) {
|
|
16
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0;
|
|
17
|
+
}
|
|
18
|
+
/** `value` is a real UTC calendar day written `YYYY-MM-DD` (`2026-13-01` is not). */
|
|
19
|
+
function isUtcDay(value) {
|
|
20
|
+
if (typeof value !== 'string' || !UTC_DAY.test(value))
|
|
21
|
+
return false;
|
|
22
|
+
const day = new Date(`${value}T00:00:00Z`);
|
|
23
|
+
return !Number.isNaN(day.getTime()) && day.toISOString().slice(0, 10) === value;
|
|
24
|
+
}
|
|
25
|
+
/** Why `value` cannot be a row's `next`, or `null` when it can. */
|
|
26
|
+
function nextProblem(value) {
|
|
27
|
+
const next = asFields(value);
|
|
28
|
+
if (next === null)
|
|
29
|
+
return 'next is not an object';
|
|
30
|
+
if (!isUtcDay(next.from))
|
|
31
|
+
return 'next.from is not a YYYY-MM-DD calendar date';
|
|
32
|
+
const missing = RATE_KEYS.find((key) => !isRate(next[key]));
|
|
33
|
+
return missing === undefined ? null : `next.${missing} is not a finite rate >= 0`;
|
|
34
|
+
}
|
|
35
|
+
/** Why `fields` cannot be a price row, or `null` when it can. */
|
|
36
|
+
function entryProblem(fields) {
|
|
37
|
+
if (!isRate(fields.inputPerMillion))
|
|
38
|
+
return 'inputPerMillion is not a finite rate >= 0';
|
|
39
|
+
if (!isRate(fields.outputPerMillion))
|
|
40
|
+
return 'outputPerMillion is not a finite rate >= 0';
|
|
41
|
+
const cached = fields.cachedInputPerMillion;
|
|
42
|
+
if (cached !== undefined && !isRate(cached))
|
|
43
|
+
return 'cachedInputPerMillion is not a finite rate >= 0';
|
|
44
|
+
return fields.next === undefined ? null : nextProblem(fields.next);
|
|
45
|
+
}
|
|
46
|
+
/** Why `model`'s value `fields` cannot be a price row, or `null` when it can. */
|
|
47
|
+
function rowProblem(model, fields) {
|
|
48
|
+
if (model === '__proto__')
|
|
49
|
+
return 'not a model id';
|
|
50
|
+
return fields === null ? 'not an object' : entryProblem(fields);
|
|
51
|
+
}
|
|
52
|
+
/** A typed copy of a row `entryProblem` accepted. */
|
|
53
|
+
function toEntry(fields) {
|
|
54
|
+
const rates = {
|
|
55
|
+
inputPerMillion: fields.inputPerMillion,
|
|
56
|
+
outputPerMillion: fields.outputPerMillion,
|
|
57
|
+
};
|
|
58
|
+
if (fields.cachedInputPerMillion !== undefined) {
|
|
59
|
+
rates.cachedInputPerMillion = fields.cachedInputPerMillion;
|
|
60
|
+
}
|
|
61
|
+
const next = asFields(fields.next);
|
|
62
|
+
if (next === null)
|
|
63
|
+
return rates;
|
|
64
|
+
return {
|
|
65
|
+
...rates,
|
|
66
|
+
next: {
|
|
67
|
+
from: next.from,
|
|
68
|
+
inputPerMillion: next.inputPerMillion,
|
|
69
|
+
outputPerMillion: next.outputPerMillion,
|
|
70
|
+
cachedInputPerMillion: next.cachedInputPerMillion,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** The valid rows of `raw` (the variable's JSON) by model id; nothing when unset. */
|
|
75
|
+
export function parsePricingOverrides(raw) {
|
|
76
|
+
if (!raw)
|
|
77
|
+
return {};
|
|
78
|
+
let parsed;
|
|
79
|
+
try {
|
|
80
|
+
parsed = JSON.parse(raw);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
logger.warn(`GEMINI_PRICING_OVERRIDES is not JSON and is ignored: ${String(err)}`);
|
|
84
|
+
return {};
|
|
85
|
+
}
|
|
86
|
+
const map = asFields(parsed);
|
|
87
|
+
if (map === null) {
|
|
88
|
+
logger.warn('GEMINI_PRICING_OVERRIDES is not a JSON object of model rows and is ignored');
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
// A null-prototype map: a key such as `__proto__` is a plain key, never a setter.
|
|
92
|
+
const rows = Object.create(null);
|
|
93
|
+
for (const [model, value] of Object.entries(map)) {
|
|
94
|
+
const fields = asFields(value);
|
|
95
|
+
const problem = rowProblem(model, fields);
|
|
96
|
+
if (fields === null || problem !== null) {
|
|
97
|
+
logger.warn(`GEMINI_PRICING_OVERRIDES: ${JSON.stringify(model)} dropped (${problem}); the table row stays`);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
rows[model] = toEntry(fields);
|
|
101
|
+
}
|
|
102
|
+
return rows;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=pricing-overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-overrides.js","sourceRoot":"","sources":["../../src/utils/pricing-overrides.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AACtC,MAAM,SAAS,GAAG,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,uBAAuB,CAAU,CAAC;AAI5F,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrF,OAAO,KAAe,CAAC;AACzB,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,qFAAqF;AACrF,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpE,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG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C;IAC7B,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;QAC1F,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,kFAAkF;IAClF,MAAM,IAAI,GAAiC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CACT,6BAA6B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,OAAO,wBAAwB,CAC/F,CAAC;YACF,SAAS;QACX,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qmediat.io/gemini-code-context-mcp",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"mcpName": "io.github.qmediat/gemini-code-context-mcp",
|
|
5
5
|
"description": "MCP server that gives Claude Code and other MCP hosts long-context memory of a codebase through Gemini's 1M-token window: `ask`/`code` send the scanned workspace with implicit caching by default or an explicit Context Cache on request; `ask_agentic` reads files on demand for repos beyond the limit.",
|
|
6
6
|
"keywords": [
|