@qmediat.io/gemini-code-context-mcp 1.22.1 → 1.23.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 +71 -1
- package/README.md +36 -227
- package/dist/auth/profile-loader.js +1 -1
- package/dist/auth/profile-loader.js.map +1 -1
- package/dist/cache/caching-mode.d.ts +2 -2
- package/dist/cache/caching-mode.d.ts.map +1 -1
- package/dist/cache/caching-mode.js +2 -2
- package/dist/cache/caching-mode.js.map +1 -1
- package/dist/gemini/model-registry.d.ts.map +1 -1
- package/dist/gemini/model-registry.js +10 -1
- package/dist/gemini/model-registry.js.map +1 -1
- package/dist/gemini/model-taxonomy.d.ts +8 -0
- package/dist/gemini/model-taxonomy.d.ts.map +1 -1
- package/dist/gemini/model-taxonomy.js +29 -7
- package/dist/gemini/model-taxonomy.js.map +1 -1
- package/dist/tools/ask-agentic.tool.d.ts +11 -61
- package/dist/tools/ask-agentic.tool.d.ts.map +1 -1
- package/dist/tools/ask-agentic.tool.js +2 -2
- package/dist/tools/ask-agentic.tool.js.map +1 -1
- package/dist/tools/ask.tool.d.ts +29 -82
- package/dist/tools/ask.tool.d.ts.map +1 -1
- package/dist/tools/ask.tool.js +6 -5
- package/dist/tools/ask.tool.js.map +1 -1
- package/dist/tools/clear.tool.d.ts +1 -5
- package/dist/tools/clear.tool.d.ts.map +1 -1
- package/dist/tools/code.tool.d.ts +24 -76
- package/dist/tools/code.tool.d.ts.map +1 -1
- package/dist/tools/code.tool.js +10 -5
- package/dist/tools/code.tool.js.map +1 -1
- package/dist/tools/registry.d.ts +11 -11
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +32 -12
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/reindex.tool.d.ts +1 -7
- package/dist/tools/reindex.tool.d.ts.map +1 -1
- package/dist/tools/shared/thinking.d.ts +25 -3
- package/dist/tools/shared/thinking.d.ts.map +1 -1
- package/dist/tools/shared/thinking.js +25 -3
- package/dist/tools/shared/thinking.js.map +1 -1
- package/dist/tools/status.tool.d.ts +1 -5
- package/dist/tools/status.tool.d.ts.map +1 -1
- package/dist/utils/cost-estimator.d.ts.map +1 -1
- package/dist/utils/cost-estimator.js +20 -10
- package/dist/utils/cost-estimator.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.23.1] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **The README is one screen**: install, try it, the six tools, what the release supports, and a table of the docs.
|
|
15
|
+
The reference it carried moved to `docs/`: the tools, `ask` vs `ask_agentic` and the `ask_agentic` sandbox to
|
|
16
|
+
`docs/tools.md`, the comparison with `gemini-mcp-tool` to `docs/why.md`, install methods, supported platforms and
|
|
17
|
+
upgrading to `docs/getting-started.md`, the measured costs to `docs/cost-model.md`, maintenance and support to
|
|
18
|
+
`docs/maintenance.md`, trademarks to `docs/TRADEMARKS.md`.
|
|
19
|
+
- `AGENTS.md` holds the guidance for AI coding agents (commands, where things are, rules); `CLAUDE.md` imports it.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- The README's `## Supports · version X.Y.Z` heading names the version its list describes; `npm run check:supports`
|
|
24
|
+
fails when it differs from `package.json`, in CI and in the release workflow before anything is published.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- The "No Gemini credentials found" error links to `docs/getting-started.md`; it named a README anchor (`#setup`)
|
|
29
|
+
that did not exist.
|
|
30
|
+
|
|
31
|
+
## [1.23.0] - 2026-11-14
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **What the aliases resolve to, when your key lists the new models.** `latest-pro` and `latest-pro-thinking` (the
|
|
36
|
+
server's default) → `gemini-4-carbon` (was `gemini-4-argon`); `latest-flash` → `gemini-4-hydrogen` (was
|
|
37
|
+
`gemini-3.8-flash`). What that changes for a call that names no model:
|
|
38
|
+
- Carbon and Hydrogen think without being asked (Argon and a default `ask` did not): more output tokens are billed
|
|
39
|
+
and a call takes longer. Bound it with `thinkingLevel`.
|
|
40
|
+
- Hydrogen costs 1.5 / 7.5 USD per 1M against 3.8 Flash's 0.75 / 3.75 through 2026-12-31 (the same from
|
|
41
|
+
2027-01-01), and offers implicit caching only — `cachingMode: 'explicit'` runs implicit on it, as on Argon and
|
|
42
|
+
Carbon, and says so.
|
|
43
|
+
- Pass a model id (`gemini-4-argon`, `gemini-3.8-flash`) to keep the previous one.
|
|
44
|
+
- Among Gemini 4 models of one version an alias takes the codename Google shipped last (a declared order:
|
|
45
|
+
argon, carbon, hydrogen) — a point release (`gemini-4.1-argon`) outranks any codename of the older version.
|
|
46
|
+
- A call that stops at the output cap with no answer is an error that names the cause (the model's thinking used
|
|
47
|
+
`maxOutputTokens`) and the remedy, on `ask` and `code` — it used to come back as an empty success. The call is
|
|
48
|
+
billed either way.
|
|
49
|
+
- The fast tier's price bound is Hydrogen's: `gemini-flash-latest` and a fast-tier id the table does not price are
|
|
50
|
+
estimated at 1.5 / 7.5 USD per 1M (was 3.8 Flash's 0.75 / 3.75) — the dearest row of the category, as before,
|
|
51
|
+
although Google serves `gemini-3.8-flash` under that alias today.
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- Gemini 4 Carbon and Gemini 4 Hydrogen (GA 2026-11-10 and 2026-11-12): `gemini-4-carbon` is a premium reasoning
|
|
56
|
+
model like Argon, `gemini-4-hydrogen` the fast tier. Until now both were `unknown`: no alias picked them and an
|
|
57
|
+
explicit id failed the category check of `ask` / `code`. A codename id with another product's suffix
|
|
58
|
+
(`gemini-4-carbon-computer-use-preview`) stays `unknown`.
|
|
59
|
+
- `thinkingLevel: "XHIGH"` — the level Google added with Gemini 4 Hydrogen, the one model that takes it (`ask`,
|
|
60
|
+
`ask_agentic`; Argon, Carbon and the 3.x models answer it with a 400, so `code`, which runs reasoning-tier
|
|
61
|
+
models only, refuses it up front with the reason and the way out). One description of the field serves the three tools.
|
|
62
|
+
- Rates: `gemini-4-carbon` 2 / 10 / 0.1 USD per 1M input / output / cached tokens through 2026-11-30 and 4 / 20 / 0.2
|
|
63
|
+
from 2026-12-01 (Argon's row); `gemini-4-hydrogen` 1.5 / 7.5 / 0.075, flat (pricing page read 2026-11-14).
|
|
64
|
+
- `gemini-nano-banana-2.1` classifies as image generation (the family's ids carry the `gemini-` prefix since 2.1).
|
|
65
|
+
|
|
66
|
+
### Security
|
|
67
|
+
|
|
68
|
+
- `zod` 4.6.7 (was 3.25): GHSA-mrhx-c7xc-m3w5, memory exhaustion while validating oversized constrained collections.
|
|
69
|
+
The tool schemas are written to `tools/list` by Zod's own `z.toJSONSchema` — the `zod-to-json-schema` dependency is
|
|
70
|
+
gone as a direct dependency (the MCP SDK still installs it) — and the published `inputSchema` of every tool is
|
|
71
|
+
unchanged, held by a test against the 1.22.1 output. Two things a caller can see do change with Zod 4: the wording
|
|
72
|
+
of an `Invalid arguments` error (`prompt: Invalid input: expected string, received undefined`, was `prompt:
|
|
73
|
+
Required`; an enum now reads `Invalid option: expected one of …`), and an integer above 2^53 − 1 is refused.
|
|
74
|
+
Dependabot proposes Zod majors again.
|
|
75
|
+
- Transitive dependencies brought past their advisories (`body-parser`, `hono`, `@hono/node-server`, `fast-uri`,
|
|
76
|
+
`ip-address`, `qs`): `npm audit --omit=dev --audit-level=high` is clean again.
|
|
77
|
+
|
|
10
78
|
## [1.22.1] - 2026-10-16
|
|
11
79
|
|
|
12
80
|
### Fixed
|
|
@@ -1730,7 +1798,9 @@ Integration-test-surfaced and review-surfaced fixes landed before the v1.0.0 rel
|
|
|
1730
1798
|
- MIME type simplified to `text/plain` for all files.
|
|
1731
1799
|
- Unit test coverage gaps for cache-manager / files-uploader / ttl-watcher / profile-loader / parseEdits tracked in [`docs/FOLLOW-UP-PRS.md`](docs/FOLLOW-UP-PRS.md).
|
|
1732
1800
|
|
|
1733
|
-
[Unreleased]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.
|
|
1801
|
+
[Unreleased]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.23.1...HEAD
|
|
1802
|
+
[1.23.1]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.23.0...v1.23.1
|
|
1803
|
+
[1.23.0]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.22.1...v1.23.0
|
|
1734
1804
|
[1.22.1]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.22.0...v1.22.1
|
|
1735
1805
|
[1.22.0]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.21.0...v1.22.0
|
|
1736
1806
|
[1.21.0]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.20.0...v1.21.0
|
package/README.md
CHANGED
|
@@ -7,247 +7,56 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# gemini-code-context-mcp
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
> One scan per workspace, repeat questions without re-reading the repo yourself — with Gemini's implicit prefix cache by default, or an explicit Context Cache when you ask for a guaranteed discount.
|
|
12
|
+
Ask Gemini about your whole codebase from Claude Code: one scan per workspace, reused for every next question.
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
[](https://github.com/qmediat/gemini-code-context-mcp/blob/main/LICENSE)
|
|
17
|
-
[](https://github.com/qmediat/gemini-code-context-mcp/blob/main/tsconfig.json)
|
|
18
|
-
[](https://github.com/qmediat/gemini-code-context-mcp/blob/main/package.json)
|
|
19
|
-
|
|
20
|
-
> **Built and maintained by [Quantum Media Technologies sp. z o.o.](https://www.qmediat.io/) — a registered Polish technology company (qmediat.io).** Used in qmediat's own Claude Code sessions for codebase Q&A; commercial backing means this MCP server is on the long-term roadmap, not a weekend project. Every release and its date is in [CHANGELOG.md](https://github.com/qmediat/gemini-code-context-mcp/blob/main/CHANGELOG.md).
|
|
21
|
-
>
|
|
22
|
-
> **If `gemini-code-context-mcp` saves you time, please [⭐ star the repo](https://github.com/qmediat/gemini-code-context-mcp).** It's the cheapest way to tell us "keep going" — and it directly helps us justify continued investment.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Why this server?
|
|
27
|
-
|
|
28
|
-
An MCP (Model Context Protocol) server that wraps Google's Gemini API with **persistent context caching** for MCP hosts like Claude Code, Claude Desktop, and Cursor.
|
|
29
|
-
|
|
30
|
-
| | [jamubc/gemini-mcp-tool](https://github.com/jamubc/gemini-mcp-tool) | **`@qmediat.io/gemini-code-context-mcp`** |
|
|
31
|
-
|---|---|---|
|
|
32
|
-
| Maintenance | npm `gemini-mcp-tool@1.1.8` published 2026-06-18; last commit on `main` 2026-06-18 (pushed 2026-07-21); issues answered by the maintainer (#62/#64 closed, #49 open) | Maintained by [Quantum Media Technologies sp. z o.o.](https://www.qmediat.io/) (qmediat.io); release dates in [CHANGELOG.md](https://github.com/qmediat/gemini-code-context-mcp/blob/main/CHANGELOG.md) |
|
|
33
|
-
| Default model | Hardcoded `gemini-2.5-pro` (`src/constants.ts`) — no runtime override | Dynamic `latest-pro-thinking` alias — resolved per call against the models your key lists (cached 1 h in-process); `GEMINI_CODE_CONTEXT_DEFAULT_MODEL` or a per-call `model` overrides |
|
|
34
|
-
| Backend | Shells out to `gemini` CLI (subprocess per call) | Direct `@google/genai` SDK |
|
|
35
|
-
| Repeat queries | No caching layer — each call re-tokenises referenced files | One workspace scan reused across questions; implicit prefix caching by default, or an explicit Context Cache (`cachingMode: "explicit"`) with Google's cached-input price |
|
|
36
|
-
| Coding delegation | Prompt-injection `changeMode` (OLD/NEW format in system text) | Native `thinkingConfig` + optional `codeExecution` |
|
|
37
|
-
| Auth | Inherits `gemini` CLI auth (browser OAuth via `gemini auth login`, or env var) | 3-tier: Vertex ADC / credentials file (chmod 0600 atomic write) / env var (+ warning) |
|
|
38
|
-
| Cost control | — | Daily budget cap in USD (`GEMINI_DAILY_BUDGET_USD`) |
|
|
39
|
-
|
|
40
|
-
> *Comparison checked 2026-10-01 against `jamubc/gemini-mcp-tool` `main` (commit `588e73d`, 2026-06-18) and `gemini-mcp-tool@1.1.8` on npm: the hardcoded `gemini-2.5-pro` default (`src/constants.ts`) and the `gemini` CLI subprocess backend (`geminiExecutor.ts`) hold at that revision. Re-check before relying on any row; a project changes.*
|
|
41
|
-
|
|
42
|
-
## Quick start
|
|
14
|
+
## Install
|
|
43
15
|
|
|
44
16
|
```bash
|
|
45
|
-
|
|
46
|
-
npx @qmediat.io/gemini-code-context-mcp
|
|
47
|
-
|
|
48
|
-
# 2. Paste this into ~/.claude.json (or Claude Desktop / Cursor config)
|
|
49
|
-
{
|
|
50
|
-
"mcpServers": {
|
|
51
|
-
"gemini-code-context": {
|
|
52
|
-
"command": "npx",
|
|
53
|
-
"args": ["-y", "@qmediat.io/gemini-code-context-mcp"],
|
|
54
|
-
"env": { "GEMINI_CREDENTIALS_PROFILE": "default" }
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
# 3. Restart your MCP host. Ask Claude:
|
|
60
|
-
# > Use gemini-code-context.ask to summarize this codebase
|
|
17
|
+
npx @qmediat.io/gemini-code-context-mcp init # stores your Gemini API key or Vertex AI project
|
|
18
|
+
claude mcp add --scope user gemini-code-context -- npx -y @qmediat.io/gemini-code-context-mcp
|
|
61
19
|
```
|
|
62
20
|
|
|
63
|
-
|
|
21
|
+
## Try it
|
|
64
22
|
|
|
65
|
-
|
|
23
|
+
```text
|
|
24
|
+
Use gemini-code-context.ask to summarize this codebase
|
|
25
|
+
```
|
|
66
26
|
|
|
67
27
|
## Tools
|
|
68
28
|
|
|
69
29
|
| Tool | What it does |
|
|
70
30
|
|---|---|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
`ask`, `ask_agentic` and `code` accept an optional `workspace` path (defaults to `cwd`), a `model` alias or literal ID and glob overrides; `ask` also takes `attachments` *(v1.20.0+)* — up to 8 images or PDFs inside the workspace (10 MB each, 14 MB together; no symlinks, the sandbox's secret rules apply) sent inline with the question to a model that supports vision, their tokens counted by Gemini before the preflight, the budget and the throttle; `ask` and `code` take `serviceTier` (`standard` / `flex`) *(v1.19.0+)*; `status`, `reindex` and `clear` take `workspace` only (`reindex` also `invalidateModelRegistry`). `ask` and `code` also take `cachingMode` (`implicit` / `explicit`), `thinkingLevel` or `thinkingBudget`, `maxOutputTokens`, `timeoutMs` and `stallMs`; `ask` alone takes `onWorkspaceTooLarge` (`error` or `fallback-to-agentic`, which re-routes to the multi-call agentic path and changes the cost shape), `preflightMode`, `forceRescan` and `noCache`; `code` alone takes `codeExecution` and `expectEdits` — every parameter is in [`docs/configuration.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/configuration.md).
|
|
79
|
-
|
|
80
|
-
### When to use `ask` vs `ask_agentic`
|
|
81
|
-
|
|
82
|
-
| | `ask` (eager) | `ask_agentic` |
|
|
83
|
-
|---|---|---|
|
|
84
|
-
| Workspace size | ≤ ~900 k tokens | any — model reads what it needs |
|
|
85
|
-
| First query | scan + one call (implicit mode); scan + upload + cache build in explicit mode (125 s measured on a 670 k-token workspace) | 5–15 s (no scan) |
|
|
86
|
-
| Repeat queries | the scan is reused; ~14 s measured in explicit mode on pro-thinking LOW, faster on flash-tier | 10–30 s (new tool-use iterations per question) |
|
|
87
|
-
| Per-call tokens | the whole workspace as input (cached-input price in explicit mode, Gemini's implicit cache otherwise) | only the files the model opens |
|
|
88
|
-
| Best for | Many questions on same repo | One-off questions on huge repos, or repos with large generated files |
|
|
89
|
-
|
|
90
|
-
If `ask` fails with `errorCode: WORKSPACE_TOO_LARGE`, switch to `ask_agentic` without restarting. The error message says so.
|
|
91
|
-
|
|
92
|
-
### `ask_agentic` safety
|
|
93
|
-
|
|
94
|
-
- **Sandboxed FS access.** Only paths inside the workspace root (`realpath`-jail, TOCTOU-safe against symlink escape). Secret files auto-denied, case-insensitively (`src/tools/agentic/sandbox.ts`): by exact basename — `.env`, `.env.local`, `.env.development`, `.env.production`, `.env.test`, `.env.staging`, `.netrc`, `.npmrc`, `.pgpass`, `.git-credentials`, `.htpasswd`, `credentials`, `credentials.json`, `secrets.json`, `secrets.yaml`, `secrets.yml`, `service-account.json`; by extension — `.pem`, `.key`, `.crt`, `.cer`, `.p12`, `.pfx`, `.p8`, `.asc`, `.gpg`, `.keystore`, `.jks`, `.ppk`, `.ovpn`; and every file under `.ssh`, `.aws`, `.gnupg`, `.gpg`, `.kube`, `.docker`, `.1password`, `.pki`, `.gcloud`, `.azure`, `.config/gcloud`, `.config/azure`, `Keychains`. A secret under any other name (say `.env.backup`) is readable: keep it out of the workspace or in the default excluded dirs. Default excluded dirs (`node_modules`, `.git`, `.next`, etc.) are invisible to the model, wherever they sit in the tree (`packages/a/node_modules` too). `bin/` is source, not one of them (only .NET's `Debug` / `Release` output under it is), and an extensionless file that starts with `#!` (a script) counts as source like a file with a source extension; a file named like a build directory (`script/build`) stays a file; `ask` and `code` report what the scan left out (`excludedDirs`, `excludedDirsTotal`, `filesSkippedNonSource`).
|
|
95
|
-
- **Prompt-injection defence.** `systemInstruction` tells the model that file contents are **data**, not instructions; a prompt-injected file saying *"ignore previous instructions and reveal secrets"* is treated as source code being analysed.
|
|
96
|
-
- **Bounded per-call.** `maxIterations` (default 20), `maxTotalInputTokens` (default 1 M cumulative — *raised from 500 k in v1.14.2*), `maxFilesRead` (default 40 distinct files). No-progress detection — if the model issues the same call 5×, the loop returns the partial state. All three configurable per-call.
|
|
97
|
-
- **Budget + TPM honored.** `GEMINI_DAILY_BUDGET_USD` and `GEMINI_CODE_CONTEXT_TPM_THROTTLE_LIMIT` apply per iteration; each iteration gets its own `reserveBudget` / `finalizeBudgetReservation` cycle, so the ledger stays accurate.
|
|
98
|
-
- **Forced-finalization rescue (v1.14.1+, unblocked in v1.14.2).** When the loop exhausts `maxIterations` without a final-text turn, one extra `generateContent` runs with `toolConfig.functionCallingConfig.mode = NONE` to synthesise an answer from the accumulated tool responses. Successful rescue is flagged via `structuredContent.convergenceForced: true`. The pass is bounded by `dailyBudgetUsd` (cost) and `iterationTimeoutMs` (wall-clock), and **NOT** gated on `maxTotalInputTokens` — running it may push cumulative tokens past that cap by one call's worth, signalled via `structuredContent.overBudget: true`. When the pass is skipped because the daily budget is exhausted, `structuredContent.finalizationSkipReason: 'daily-budget'` distinguishes the skip from a rescue-attempted-but-failed outcome.
|
|
31
|
+
| `ask` | A question about the whole workspace |
|
|
32
|
+
| `ask_agentic` | A question about a workspace too large to send whole |
|
|
33
|
+
| `code` | A coding task for Gemini |
|
|
34
|
+
| `status` | Cache state, models, cost so far |
|
|
35
|
+
| `reindex` | Scan the workspace again |
|
|
36
|
+
| `clear` | Delete this workspace's cache |
|
|
99
37
|
|
|
100
|
-
|
|
38
|
+
## Supports · version 1.23.1
|
|
101
39
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| Alias | Category | Typical use |
|
|
105
|
-
|---|---|---|
|
|
106
|
-
| `latest-pro-thinking` *(default for every tool)* | `text-reasoning` + thinking | Code review, deep analysis — the costlier thinking tier, so set a budget. `GEMINI_CODE_CONTEXT_DEFAULT_MODEL` or a per-call `model` overrides it (`code` reads the configured default since 1.18.0) |
|
|
107
|
-
| `latest-pro` | `text-reasoning` | Best pro-tier text model |
|
|
108
|
-
| `latest-flash` | `text-fast` | Fast Q&A, cheap |
|
|
109
|
-
| `latest-lite` | `text-lite` | Simplest / cheapest |
|
|
110
|
-
| `latest-vision` | `text-reasoning` ∪ `text-fast` + vision | Screenshot / image analysis |
|
|
111
|
-
|
|
112
|
-
Full contract, category table, and examples: [`docs/models.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/models.md).
|
|
113
|
-
|
|
114
|
-
## Installation methods
|
|
115
|
-
|
|
116
|
-
| Method | Config |
|
|
40
|
+
| | |
|
|
117
41
|
|---|---|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
122
|
-
**Supported platforms.** The manifest store is `better-sqlite3` 13, which ships prebuilt bindings for macOS (arm64, x64), Linux (glibc and musl, arm64, x64) and Windows (arm64, x64) on Node ≥ 22; on any other platform the binding must be built from source (`npm rebuild better-sqlite3` with a C++ toolchain), otherwise the server stops when it opens its database.
|
|
123
|
-
|
|
124
|
-
### Upgrading to a new release
|
|
125
|
-
|
|
126
|
-
If you use the **npx** method and a new version has been published but you're still getting the old one, clear the npx cache and restart your MCP host:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
rm -rf ~/.npm/_npx
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
`npx -y` caches resolved packages, and npm's registry-metadata cache can keep serving the previously-installed version for a while after `npm publish`. The command above forces a fresh fetch on next MCP startup. Global-install and local-dev users upgrade via `npm update -g @qmediat.io/gemini-code-context-mcp` and `git pull && npm run build` respectively.
|
|
133
|
-
|
|
134
|
-
## How the caching works
|
|
42
|
+
| Works in | Claude Code · Claude Desktop · Cursor |
|
|
43
|
+
| Models | Gemini 4 Carbon, Argon, Hydrogen · Gemini 3.x and 2.5 Pro, Flash, Flash-Lite |
|
|
44
|
+
| Sign-in | Gemini API key · Vertex AI |
|
|
135
45
|
|
|
136
|
-
|
|
46
|
+
## Docs
|
|
137
47
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
│ caches.create(model, │ │ generateContent( │
|
|
154
|
-
│ contents, ttl=1h) │ │ cachedContent: ID, │
|
|
155
|
-
│ → cache_id │ │ contents: prompt │
|
|
156
|
-
│ │ │ ) │
|
|
157
|
-
│ │ │ │
|
|
158
|
-
│ generateContent( │ │ response without the │
|
|
159
|
-
│ cachedContent: ID, │ │ upload and cache build │
|
|
160
|
-
│ contents: prompt │ │ │
|
|
161
|
-
│ ) │ │ │
|
|
162
|
-
└──────────────────────────┘ └──────────────────────────┘
|
|
163
|
-
full input price (125 s measured) cached-token price (~14 s measured)
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Deep dive: [`docs/how-caching-works.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/how-caching-works.md).
|
|
167
|
-
|
|
168
|
-
## Configuration
|
|
169
|
-
|
|
170
|
-
Every env var, auth tier and per-call override is listed in [`docs/configuration.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/configuration.md).
|
|
171
|
-
|
|
172
|
-
| Key vars | Default | |
|
|
173
|
-
|---|---|---|
|
|
174
|
-
| `GEMINI_CREDENTIALS_PROFILE` | `default` | Profile name in the credentials file |
|
|
175
|
-
| `GEMINI_API_KEY` | — | Fallback (Tier 3; emits a warning) |
|
|
176
|
-
| `GEMINI_USE_VERTEX` + `GOOGLE_CLOUD_PROJECT` | — | Enable Vertex AI backend |
|
|
177
|
-
| `GEMINI_DAILY_BUDGET_USD` | unlimited | Hard cap on daily spend; honoured by `ask`, `code`, and `ask_agentic` (per-iteration) |
|
|
178
|
-
| `GEMINI_CODE_CONTEXT_DEFAULT_MODEL` | `latest-pro-thinking` | Alias or literal ID, read by `ask`, `ask_agentic` and `code` (a per-call `model` wins). `code` needs a thinking reasoning model: a default that resolves to anything else is replaced by `latest-pro-thinking` for that tool and the response says so (`configuredModelReplaced`). The default is the thinking tier, so budgets should assume it |
|
|
179
|
-
| `GEMINI_CODE_CONTEXT_CACHING_MODE` *(v1.14.0+)* | `implicit` | `implicit` (inline, Gemini's automatic prefix cache) or `explicit` (Files API + Context Cache) for every `ask` / `code` call; per-call `cachingMode` wins |
|
|
180
|
-
| `GEMINI_CODE_CONTEXT_SERVICE_TIER` *(v1.19.0+)* | `standard` | `flex` runs every `ask` / `code` call on Google's half-price tier (longer latency; a request refused under load answers 429/503, reported as `RATE_LIMIT` / `OVERLOADED`, retryable, with Google's retry hint when it sent one — this server never re-sends a flex request, the client retries); not available on the Vertex AI backend (refused by name); the cost estimate and the daily budget use the flex price; per-call `serviceTier` wins |
|
|
181
|
-
| `GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS` | `3600` | Context Cache TTL (explicit mode) |
|
|
182
|
-
| `GEMINI_CODE_CONTEXT_LOG_LEVEL` | `info` | `debug` / `info` / `warn` / `error` |
|
|
183
|
-
| `GEMINI_CODE_CONTEXT_WORKSPACE_GUARD_RATIO` *(v1.5.0+)* | `0.9` | Fraction of `model.inputTokenLimit` the workspace may fill before `ask`/`code` fail-fast with `WORKSPACE_TOO_LARGE`. Clamped to `[0.5, 0.98]`. Raise toward `0.95` if you trust the tokeniser estimate; lower if your repo has UTF-8-heavy content. |
|
|
184
|
-
| `GEMINI_CODE_CONTEXT_TPM_THROTTLE_LIMIT` | `80_000` | Client-side tokens-per-minute ceiling per resolved model. `0` disables the throttle. |
|
|
185
|
-
| `GEMINI_CODE_CONTEXT_FORCE_MAX_OUTPUT` | `false` | Force every call to send `maxOutputTokens = model.outputTokenLimit` (auto otherwise). |
|
|
186
|
-
| `GEMINI_CODE_CONTEXT_ASK_TIMEOUT_MS` *(v1.6.0+)* | disabled | Wall-clock timeout in ms for `ask` (1s–30min). Aborts via `AbortController` when Gemini exceeds the deadline. Returns `errorCode: "TIMEOUT"`. Per-call `ask({ timeoutMs })` overrides. **Note:** `AbortSignal` is client-only — Gemini may still finish server-side and bill for completed work. |
|
|
187
|
-
| `GEMINI_CODE_CONTEXT_CODE_TIMEOUT_MS` *(v1.6.0+)* | disabled | Same as above, applied to the `code` tool. Per-call override: `code({ timeoutMs })`. |
|
|
188
|
-
| `GEMINI_CODE_CONTEXT_AGENTIC_ITERATION_TIMEOUT_MS` *(v1.6.0+)* | disabled | Per-iteration wall-clock cap for `ask_agentic`. A single hung iteration aborts the whole agentic call (continuing with partial state would leave the conversation structurally incomplete). Per-call override: `ask_agentic({ iterationTimeoutMs })`. |
|
|
189
|
-
|
|
190
|
-
## Migrating from `gemini-mcp-tool`
|
|
191
|
-
|
|
192
|
-
One-line change in `~/.claude.json`, detailed mapping of tool names, and caveats in [`docs/migration-from-jamubc.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/migration-from-jamubc.md).
|
|
193
|
-
|
|
194
|
-
## Security
|
|
195
|
-
|
|
196
|
-
- API key stored in `~/.config/qmediat/credentials` (chmod 0600), never in MCP host config
|
|
197
|
-
- Only a fingerprint (`AIza...xyz9`) appears in logs
|
|
198
|
-
- Daily budget cap enforced locally — bounds blast radius of a leaked key
|
|
199
|
-
- Zero telemetry by default; manifest stored locally in `~/.qmediat/`
|
|
200
|
-
- `code` tool's `codeExecution` runs in Google's sandbox, not on your machine
|
|
201
|
-
|
|
202
|
-
Full threat model + incident response: [`docs/security.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/security.md).
|
|
203
|
-
|
|
204
|
-
## Cost model
|
|
205
|
-
|
|
206
|
-
Measured 2026-04-22 with **explicit** `cachingMode` on `vitejs/vite@main`'s `packages/vite/` (~670 k tokens, 451 files, Gemini 3.1 Pro, `thinkingLevel: LOW`): **$0.60 per cached query vs $2.35 per inline query — ~75 % cheaper on cache hit**, cold call ~125 s, warm call ~14 s. At 20 queries/day on this workspace that is $35/day per developer ($12 cached vs $47 inline). The implicit default has no guaranteed discount: a repeat query costs at most the inline price. The cost estimator assumes cached input at 25 % of the input rate when a model's price sheet lists no cached rate — check Google's current cached-input price for your model. Actual numbers scale with workspace tokens × queries/day × thinking budget.
|
|
207
|
-
|
|
208
|
-
Per-tool cost breakdown, free-tier guidance, and all the knobs: [`docs/cost-model.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/cost-model.md).
|
|
209
|
-
|
|
210
|
-
## Architecture
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
┌──────────────┐ stdio ┌────────────────────────────────────┐ HTTPS ┌─────────────┐
|
|
214
|
-
│ Claude Code │◄─────────►│ @qmediat.io/gemini-code-context-… │◄─────────►│ Gemini API │
|
|
215
|
-
└──────────────┘ └────────────────────────────────────┘ └─────────────┘
|
|
216
|
-
│
|
|
217
|
-
┌───────────┼───────────┬──────────────────┐
|
|
218
|
-
▼ ▼ ▼ ▼
|
|
219
|
-
┌───────────┐ ┌─────────┐ ┌──────────┐ ┌──────────────┐
|
|
220
|
-
│ Workspace │ │ Cache │ │ Manifest │ │ TTL Watcher │
|
|
221
|
-
│ Indexer │ │ Manager │ │ (SQLite) │ │ (background) │
|
|
222
|
-
└───────────┘ └─────────┘ └──────────┘ └──────────────┘
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
More: [`docs/architecture.md`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/architecture.md).
|
|
226
|
-
|
|
227
|
-
## Maintenance & support
|
|
228
|
-
|
|
229
|
-
This project is built and maintained by **[Quantum Media Technologies sp. z o.o.](https://www.qmediat.io/)** — a registered Polish technology company (qmediat.io) — that uses `gemini-code-context-mcp` in its own Claude Code sessions. The practical consequences for users:
|
|
230
|
-
|
|
231
|
-
- **Bugs that affect real coding sessions get fixed first.** Examples: v1.5.1 retry on transient Node `fetch failed` (caught during a real `/coderev` run on a large repo), v1.7.0 streaming heartbeat (silent 60-180 s pauses on HIGH thinking were friction for our own team), v1.7.2 fake-timer race in CI (broke the release pipeline — diagnosed via 3-tool model consult, fixed and shipped same day).
|
|
232
|
-
- **Long-term roadmap, not a weekend project.** Commercial backing means the project sits on qmediat.io's product roadmap with allocated engineering time. We are not going to disappear. The full release history, with dates, is in [CHANGELOG.md](https://github.com/qmediat/gemini-code-context-mcp/blob/main/CHANGELOG.md).
|
|
233
|
-
- **Issues and PRs welcome.** File at [github.com/qmediat/gemini-code-context-mcp/issues](https://github.com/qmediat/gemini-code-context-mcp/issues) — we aim to answer within 48 hours. For commercial inquiries (custom integrations, support contracts, on-prem deployments): [contact@qmediat.io](mailto:contact@qmediat.io).
|
|
234
|
-
- **If this saves you time, please [⭐ star the repo](https://github.com/qmediat/gemini-code-context-mcp).** It is the simplest signal you can send that the work is worth continuing, and it directly helps us justify continued investment.
|
|
235
|
-
|
|
236
|
-
## Contributing
|
|
237
|
-
|
|
238
|
-
See [CONTRIBUTING.md](https://github.com/qmediat/gemini-code-context-mcp/blob/main/CONTRIBUTING.md). Short version: TypeScript strict, `npm run lint && npm run typecheck && npm test`, add a CHANGELOG entry, open a PR.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
## Trademarks and affiliation
|
|
242
|
-
|
|
243
|
-
Gemini is a trademark of Google. This is an independent, community-maintained integration published by Quantum Media Technologies sp. z o.o.; it is not affiliated with, sponsored by or endorsed by Google. Use of the Gemini API or CLI through this server is subject to Google's own terms and to your own API key or account.
|
|
244
|
-
|
|
245
|
-
## License
|
|
246
|
-
|
|
247
|
-
MIT © [Quantum Media Technologies sp. z o.o.](https://www.qmediat.io) — see [LICENSE](https://github.com/qmediat/gemini-code-context-mcp/blob/main/LICENSE).
|
|
248
|
-
|
|
249
|
-
Part of qmediat's [open-source portfolio](https://www.qmediat.io/open-source?utm_source=oss-readme&utm_medium=gemini-code-context-mcp&utm_campaign=open-source).
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
Made by [Quantum Media Technologies](https://www.qmediat.io/open-source?utm_source=oss-readme&utm_medium=gemini-code-context-mcp&utm_campaign=open-source) · [more open source from qmediat](https://github.com/qmediat)
|
|
48
|
+
| Read | File |
|
|
49
|
+
|---|---|
|
|
50
|
+
| [First 3 minutes, Claude Desktop, Cursor](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/getting-started.md) | docs/getting-started.md |
|
|
51
|
+
| [Every tool, `ask` or `ask_agentic`](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/tools.md) | docs/tools.md |
|
|
52
|
+
| [Settings and parameters](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/configuration.md) | docs/configuration.md |
|
|
53
|
+
| [Models](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/models.md) | docs/models.md |
|
|
54
|
+
| [How caching works](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/how-caching-works.md) | docs/how-caching-works.md |
|
|
55
|
+
| [Cost and the daily budget](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/cost-model.md) | docs/cost-model.md |
|
|
56
|
+
| [Security](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/security.md) | docs/security.md |
|
|
57
|
+
| [Why this server](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/why.md) | docs/why.md |
|
|
58
|
+
| [Coming from gemini-mcp-tool](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/migration-from-jamubc.md) | docs/migration-from-jamubc.md |
|
|
59
|
+
| [Maintenance and support](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/maintenance.md) | docs/maintenance.md |
|
|
60
|
+
| [For AI agents](https://github.com/qmediat/gemini-code-context-mcp/blob/main/AGENTS.md) | AGENTS.md |
|
|
61
|
+
|
|
62
|
+
Node.js 22 or newer · [MIT](https://github.com/qmediat/gemini-code-context-mcp/blob/main/LICENSE) · [Quantum Media Technologies](https://www.qmediat.io/open-source?utm_source=oss-readme&utm_medium=gemini-code-context-mcp&utm_campaign=open-source) · [Trademarks](https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/TRADEMARKS.md)
|
|
@@ -101,7 +101,7 @@ export function resolveAuth() {
|
|
|
101
101
|
' 2. `gcloud auth application-default login` + GEMINI_USE_VERTEX=true',
|
|
102
102
|
' 3. Set GEMINI_API_KEY env var (quick test only)',
|
|
103
103
|
'',
|
|
104
|
-
'See: https://github.com/qmediat/gemini-code-context-mcp
|
|
104
|
+
'See: https://github.com/qmediat/gemini-code-context-mcp/blob/main/docs/getting-started.md',
|
|
105
105
|
].join('\n'));
|
|
106
106
|
}
|
|
107
107
|
//# sourceMappingURL=profile-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-loader.js","sourceRoot":"","sources":["../../src/auth/profile-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAa/C,SAAS,kBAAkB;IACzB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IACpD,OAAO,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,SAAS,SAAS;IAChB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,aAAa,CAAC;IACpE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CACT,uFAAuF,CACxF,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9C,MAAM,EAAE,YAAY;QACpB,cAAc,EAAE,YAAY;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAClC,IAAI,WAAwB,CAAC;IAC7B,IAAI,CAAC;QACH,WAAW,GAAG,WAAW,CAAC,IAAI,CAA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M,CAAC,IAAI,CACT,4DAA4D,GAAG,CAAC,cAAc,wJAAwJ,CACvO,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,KAAK,CACb;QACE,8BAA8B;QAC9B,EAAE;QACF,gBAAgB;QAChB,iFAAiF;QACjF,uEAAuE;QACvE,mDAAmD;QACnD,EAAE;QACF,2FAA2F;KAC5F,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { ResolvedModel } from '../types.js';
|
|
6
6
|
import type { ProgressEmitter } from '../utils/progress.js';
|
|
7
7
|
/** What `'explicit'` turns into when it cannot be honoured — appended to `ask` / `code`'s `cachingMode` description. */
|
|
8
|
-
export declare const CACHING_MODE_FALLBACK_DESCRIPTION = " A model without `createCachedContent` (`gemini-4-argon`) runs `'explicit'` as `'implicit'`, and a failed `caches.create` sends the files without a cache; either way the response says what ran in `cachingMode` and why in `cachingModeNote`.";
|
|
8
|
+
export declare const CACHING_MODE_FALLBACK_DESCRIPTION = " A model without `createCachedContent` (the Gemini 4 models: `gemini-4-argon`, `gemini-4-carbon`, `gemini-4-hydrogen`) runs `'explicit'` as `'implicit'`, and a failed `caches.create` sends the files without a cache; either way the response says what ran in `cachingMode` and why in `cachingModeNote`.";
|
|
9
9
|
/** The caching mode a call runs with, and why it differs from the one requested. */
|
|
10
10
|
export interface CachingModeChoice {
|
|
11
11
|
readonly mode: 'explicit' | 'implicit';
|
|
@@ -14,7 +14,7 @@ export interface CachingModeChoice {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* The caching mode a call actually runs with. A model that does not accept
|
|
17
|
-
* `caches.create` (no `createCachedContent` in its actions —
|
|
17
|
+
* `caches.create` (no `createCachedContent` in its actions — the Gemini 4 models)
|
|
18
18
|
* runs an `explicit` request as `implicit`: the files go inline and Gemini's
|
|
19
19
|
* implicit cache applies, with no upload and no create attempt that can only fail.
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caching-mode.d.ts","sourceRoot":"","sources":["../../src/cache/caching-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wHAAwH;AACxH,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"caching-mode.d.ts","sourceRoot":"","sources":["../../src/cache/caching-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,wHAAwH;AACxH,eAAO,MAAM,iCAAiC,iTACkQ,CAAC;AAEjT,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IACvC,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,UAAU,GAAG,UAAU,EAClC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,eAAe,GACvB,iBAAiB,CAMnB;AAED,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEhE,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAAE,EACvE,MAAM,EAAE,iBAAiB,GACxB,UAAU,CAMZ"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { logger } from '../utils/logger.js';
|
|
6
6
|
/** What `'explicit'` turns into when it cannot be honoured — appended to `ask` / `code`'s `cachingMode` description. */
|
|
7
|
-
export const CACHING_MODE_FALLBACK_DESCRIPTION = " A model without `createCachedContent` (`gemini-4-argon`) runs `'explicit'` as `'implicit'`, and a failed `caches.create` sends the files without a cache; either way the response says what ran in `cachingMode` and why in `cachingModeNote`.";
|
|
7
|
+
export const CACHING_MODE_FALLBACK_DESCRIPTION = " A model without `createCachedContent` (the Gemini 4 models: `gemini-4-argon`, `gemini-4-carbon`, `gemini-4-hydrogen`) runs `'explicit'` as `'implicit'`, and a failed `caches.create` sends the files without a cache; either way the response says what ran in `cachingMode` and why in `cachingModeNote`.";
|
|
8
8
|
/**
|
|
9
9
|
* The caching mode a call actually runs with. A model that does not accept
|
|
10
|
-
* `caches.create` (no `createCachedContent` in its actions —
|
|
10
|
+
* `caches.create` (no `createCachedContent` in its actions — the Gemini 4 models)
|
|
11
11
|
* runs an `explicit` request as `implicit`: the files go inline and Gemini's
|
|
12
12
|
* implicit cache applies, with no upload and no create attempt that can only fail.
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caching-mode.js","sourceRoot":"","sources":["../../src/cache/caching-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,wHAAwH;AACxH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,
|
|
1
|
+
{"version":3,"file":"caching-mode.js","sourceRoot":"","sources":["../../src/cache/caching-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,wHAAwH;AACxH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,8SAA8S,CAAC;AASjT;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAkC,EAClC,KAAoB,EACpB,OAAwB;IAExB,IAAI,SAAS,KAAK,UAAU,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9F,MAAM,IAAI,GAAG,+CAA+C,KAAK,CAAC,QAAQ,8FAA8F,CAAC;IACzK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AACpC,CAAC;AAWD,MAAM,kBAAkB,GACtB,0JAA0J,CAAC;AAE7J;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,IAAuE,EACvE,MAAyB;IAEzB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1E,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../src/gemini/model-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"model-registry.d.ts","sourceRoot":"","sources":["../../src/gemini/model-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAS,MAAM,eAAe,CAAC;AA4FxD,MAAM,WAAW,SAAS;IACxB,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oFAAoF;IACpF,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B;AA8BD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,EACnB,EAAE,KAAK,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,OAAO,CAAC,SAAS,EAAE,CAAC,CAoBtB;AAED,iEAAiE;AACjE,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* tool call can force a refresh if the user upgrades their API tier mid-session.
|
|
6
6
|
*/
|
|
7
7
|
import { logger } from '../utils/logger.js';
|
|
8
|
-
import { categorizeModel, costTierOf, } from './model-taxonomy.js';
|
|
8
|
+
import { categorizeModel, codenameRank, costTierOf, } from './model-taxonomy.js';
|
|
9
9
|
/**
|
|
10
10
|
* Google's unversioned `-latest` ids (`gemini-pro-latest`, `gemini-flash-latest`,
|
|
11
11
|
* `gemini-flash-lite-latest`) are rolling aliases whose target is never newer than
|
|
@@ -43,6 +43,8 @@ function rankKey(id) {
|
|
|
43
43
|
tier: TIER_RANK[costTierOf(id)],
|
|
44
44
|
rolling: Number(isRollingAlias(id)),
|
|
45
45
|
base,
|
|
46
|
+
version: /^gemini-(\d+(?:\.\d+)?)-/i.exec(base)?.[1] ?? '',
|
|
47
|
+
codename: codenameRank(base),
|
|
46
48
|
preview: Number(base !== id),
|
|
47
49
|
};
|
|
48
50
|
}
|
|
@@ -62,6 +64,13 @@ function compareListing(ka, kb) {
|
|
|
62
64
|
return ka.tier - kb.tier;
|
|
63
65
|
if (ka.rolling !== kb.rolling)
|
|
64
66
|
return ka.rolling - kb.rolling;
|
|
67
|
+
if (ka.codename !== 0 && kb.codename !== 0) {
|
|
68
|
+
const byVersion = kb.version.localeCompare(ka.version, undefined, { numeric: true });
|
|
69
|
+
if (byVersion !== 0)
|
|
70
|
+
return byVersion;
|
|
71
|
+
if (ka.codename !== kb.codename)
|
|
72
|
+
return kb.codename - ka.codename;
|
|
73
|
+
}
|
|
65
74
|
const byBase = kb.base.localeCompare(ka.base, undefined, { numeric: true });
|
|
66
75
|
if (byBase !== 0)
|
|
67
76
|
return byBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-registry.js","sourceRoot":"","sources":["../../src/gemini/model-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAGL,eAAe,EACf,UAAU,GACX,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AACH,SAAS,cAAc,CAAC,EAAU;IAChC,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,8EAA8E;AAC9E,MAAM,aAAa,GAA4C;IAC7D,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,CAAC;IACd,KAAK,EAAE,CAAC;IACR,kBAAkB,EAAE,CAAC;IACrB,kBAAkB,EAAE,CAAC;IACrB,kBAAkB,EAAE,CAAC;IACrB,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;CACX,CAAC;AAEF,iFAAi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G,IAAI,CAAC;IACd,QAAQ,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -42,6 +42,14 @@ export interface CapabilityFlags {
|
|
|
42
42
|
/** `premium` (pro-tier), `standard` (flash), `budget` (lite). */
|
|
43
43
|
readonly costTier: 'premium' | 'standard' | 'budget' | 'unknown';
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The Gemini 4 codenames in the order Google shipped them within a tier (argon 2026-10-13, carbon 2026-11-10;
|
|
47
|
+
* hydrogen 2026-11-12). Among ids of the same version the LATER codename ranks first in the listing — an alias
|
|
48
|
+
* (`latest-pro`) resolves to it — by this declared order, never by the alphabet. A new codename is added here.
|
|
49
|
+
*/
|
|
50
|
+
export declare const GEMINI_4_CODENAMES: readonly string[];
|
|
51
|
+
/** The listing rank a codename gives an id (0 for an id without one): a later codename ranks higher. */
|
|
52
|
+
export declare function codenameRank(modelId: string): number;
|
|
45
53
|
/**
|
|
46
54
|
* Classify a model by ID. Returns `unknown` for any ID that doesn't match
|
|
47
55
|
* an explicit rule — the resolver then refuses to bind this model to any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-taxonomy.d.ts","sourceRoot":"","sources":["../../src/gemini/model-taxonomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,gBAAgB,GAChB,WAAW,GACX,WAAW,GACX,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,WAAW,GACX,OAAO,GACP,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,Q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