@qmediat.io/gemini-code-context-mcp 1.25.0 → 1.25.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +1 -1
  3. package/dist/cache/cache-manager.d.ts +23 -34
  4. package/dist/cache/cache-manager.d.ts.map +1 -1
  5. package/dist/cache/cache-manager.js +324 -272
  6. package/dist/cache/cache-manager.js.map +1 -1
  7. package/dist/cache/caching-mode.d.ts +5 -3
  8. package/dist/cache/caching-mode.d.ts.map +1 -1
  9. package/dist/cache/caching-mode.js +6 -4
  10. package/dist/cache/caching-mode.js.map +1 -1
  11. package/dist/cache/ttl-watcher.d.ts.map +1 -1
  12. package/dist/cache/ttl-watcher.js +7 -1
  13. package/dist/cache/ttl-watcher.js.map +1 -1
  14. package/dist/cache/ttl.d.ts +8 -0
  15. package/dist/cache/ttl.d.ts.map +1 -0
  16. package/dist/cache/ttl.js +10 -0
  17. package/dist/cache/ttl.js.map +1 -0
  18. package/dist/manifest/db.d.ts.map +1 -1
  19. package/dist/manifest/db.js +2 -1
  20. package/dist/manifest/db.js.map +1 -1
  21. package/dist/tools/agentic/run.d.ts.map +1 -1
  22. package/dist/tools/agentic/run.js +3 -6
  23. package/dist/tools/agentic/run.js.map +1 -1
  24. package/dist/tools/ask/answer.d.ts +9 -0
  25. package/dist/tools/ask/answer.d.ts.map +1 -0
  26. package/dist/tools/ask/answer.js +28 -0
  27. package/dist/tools/ask/answer.js.map +1 -0
  28. package/dist/tools/ask/attachments.d.ts +25 -0
  29. package/dist/tools/ask/attachments.d.ts.map +1 -0
  30. package/dist/tools/ask/attachments.js +85 -0
  31. package/dist/tools/ask/attachments.js.map +1 -0
  32. package/dist/tools/ask/call.d.ts +61 -0
  33. package/dist/tools/ask/call.d.ts.map +1 -0
  34. package/dist/tools/ask/call.js +6 -0
  35. package/dist/tools/ask/call.js.map +1 -0
  36. package/dist/tools/ask/guard.d.ts +24 -0
  37. package/dist/tools/ask/guard.d.ts.map +1 -0
  38. package/dist/tools/ask/guard.js +79 -0
  39. package/dist/tools/ask/guard.js.map +1 -0
  40. package/dist/tools/ask/input.d.ts +45 -0
  41. package/dist/tools/ask/input.d.ts.map +1 -0
  42. package/dist/tools/ask/input.js +93 -0
  43. package/dist/tools/ask/input.js.map +1 -0
  44. package/dist/tools/ask/instruction.d.ts +8 -0
  45. package/dist/tools/ask/instruction.d.ts.map +1 -0
  46. package/dist/tools/ask/instruction.js +13 -0
  47. package/dist/tools/ask/instruction.js.map +1 -0
  48. package/dist/tools/ask/request.d.ts +14 -0
  49. package/dist/tools/ask/request.d.ts.map +1 -0
  50. package/dist/tools/ask/request.js +38 -0
  51. package/dist/tools/ask/request.js.map +1 -0
  52. package/dist/tools/ask/results.d.ts +23 -0
  53. package/dist/tools/ask/results.d.ts.map +1 -0
  54. package/dist/tools/ask/results.js +107 -0
  55. package/dist/tools/ask/results.js.map +1 -0
  56. package/dist/tools/ask/setup.d.ts +22 -0
  57. package/dist/tools/ask/setup.d.ts.map +1 -0
  58. package/dist/tools/ask/setup.js +57 -0
  59. package/dist/tools/ask/setup.js.map +1 -0
  60. package/dist/tools/ask/sizing.d.ts +10 -0
  61. package/dist/tools/ask/sizing.d.ts.map +1 -0
  62. package/dist/tools/ask/sizing.js +33 -0
  63. package/dist/tools/ask/sizing.js.map +1 -0
  64. package/dist/tools/ask/thinking.d.ts +54 -0
  65. package/dist/tools/ask/thinking.d.ts.map +1 -0
  66. package/dist/tools/ask/thinking.js +69 -0
  67. package/dist/tools/ask/thinking.js.map +1 -0
  68. package/dist/tools/ask-agentic-fallback.d.ts +1 -1
  69. package/dist/tools/ask-agentic-fallback.d.ts.map +1 -1
  70. package/dist/tools/ask-agentic.tool.d.ts.map +1 -1
  71. package/dist/tools/ask-agentic.tool.js +4 -10
  72. package/dist/tools/ask-agentic.tool.js.map +1 -1
  73. package/dist/tools/ask.tool.d.ts +3 -41
  74. package/dist/tools/ask.tool.d.ts.map +1 -1
  75. package/dist/tools/ask.tool.js +46 -795
  76. package/dist/tools/ask.tool.js.map +1 -1
  77. package/dist/tools/code.tool.d.ts.map +1 -1
  78. package/dist/tools/code.tool.js +375 -502
  79. package/dist/tools/code.tool.js.map +1 -1
  80. package/dist/tools/reindex.tool.d.ts.map +1 -1
  81. package/dist/tools/reindex.tool.js +19 -22
  82. package/dist/tools/reindex.tool.js.map +1 -1
  83. package/dist/tools/shared/eager-answer.d.ts +78 -0
  84. package/dist/tools/shared/eager-answer.d.ts.map +1 -0
  85. package/dist/tools/shared/eager-answer.js +130 -0
  86. package/dist/tools/shared/eager-answer.js.map +1 -0
  87. package/dist/tools/shared/eager-call.d.ts +114 -0
  88. package/dist/tools/shared/eager-call.d.ts.map +1 -0
  89. package/dist/tools/shared/eager-call.js +95 -0
  90. package/dist/tools/shared/eager-call.js.map +1 -0
  91. package/dist/tools/shared/eager-steps.d.ts +114 -0
  92. package/dist/tools/shared/eager-steps.d.ts.map +1 -0
  93. package/dist/tools/shared/eager-steps.js +152 -0
  94. package/dist/tools/shared/eager-steps.js.map +1 -0
  95. package/dist/tools/shared/service-tier.d.ts +9 -0
  96. package/dist/tools/shared/service-tier.d.ts.map +1 -1
  97. package/dist/tools/shared/service-tier.js +15 -0
  98. package/dist/tools/shared/service-tier.js.map +1 -1
  99. package/dist/tools/shared/thinking.d.ts +9 -0
  100. package/dist/tools/shared/thinking.d.ts.map +1 -1
  101. package/dist/tools/shared/thinking.js +10 -0
  102. package/dist/tools/shared/thinking.js.map +1 -1
  103. package/dist/tools/shared/workspace-refusal.d.ts +13 -0
  104. package/dist/tools/shared/workspace-refusal.d.ts.map +1 -0
  105. package/dist/tools/shared/workspace-refusal.js +23 -0
  106. package/dist/tools/shared/workspace-refusal.js.map +1 -0
  107. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.25.1] - 2026-11-18
11
+
12
+ ### Fixed
13
+
14
+ - `ask` and `code` with `cachingMode: 'explicit'`: when Gemini created a Context Cache without a name, the question went
15
+ with neither the cache nor the workspace files; the files now go inline, as after any failed cache build, and the
16
+ warning says a cache without a usable name may stay billed on Google's side until its TTL. A cache id an earlier
17
+ release stored empty reads as none: the next rebuild no longer sends a delete for an empty name.
18
+ - `ask` and `code` with `cachingMode: 'explicit'`: with `GEMINI_CODE_CONTEXT_CACHE_TTL_SECONDS` below 60, the Context
19
+ Cache was created for 60 s but recorded as expiring at the shorter TTL, so the next call rebuilt a cache that was
20
+ still alive; the recorded expiry is now the TTL the cache was created with, and the TTL watcher refreshes the cache
21
+ with that TTL too.
22
+ - `ask` and `code` with `cachingMode: 'explicit'`: when the Context Cache was created but recording it in the manifest
23
+ failed, the cache stayed on Google's side, billed until its TTL, and the warning said the cache build had failed; the
24
+ new cache is now deleted, the warning names the manifest write, the response's `cachingModeNote` says the cache
25
+ could not be built or recorded, and the files go inline as before.
26
+ - `ask` and `code` with `cachingMode: 'explicit'`: when rebuilding the Context Cache failed, the previous cache stayed on
27
+ Google's side, unreachable and billed until its TTL; it is now deleted, as after a successful rebuild.
28
+
10
29
  ## [1.25.0] - 2026-11-17
11
30
 
12
31
  ### Changed
@@ -1956,7 +1975,8 @@ Integration-test-surfaced and review-surfaced fixes landed before the v1.0.0 rel
1956
1975
  - MIME type simplified to `text/plain` for all files.
1957
1976
  - 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).
1958
1977
 
1959
- [Unreleased]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.25.0...HEAD
1978
+ [Unreleased]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.25.1...HEAD
1979
+ [1.25.1]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.25.0...v1.25.1
1960
1980
  [1.25.0]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.24.0...v1.25.0
1961
1981
  [1.24.0]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.23.1...v1.24.0
1962
1982
  [1.23.1]: https://github.com/qmediat/gemini-code-context-mcp/compare/v1.23.0...v1.23.1
package/README.md CHANGED
@@ -35,7 +35,7 @@ Use gemini-code-context.ask to summarize this codebase
35
35
  | `reindex` | Scan the workspace again |
36
36
  | `clear` | Delete this workspace's cache |
37
37
 
38
- ## Supports · version 1.25.0
38
+ ## Supports · version 1.25.1
39
39
 
40
40
  | | |
41
41
  |---|---|
@@ -2,9 +2,9 @@
2
2
  * Build / reuse / invalidate Gemini Context Caches keyed by workspace state.
3
3
  *
4
4
  * Cache key = `(workspaceRoot, filesHash, model, systemPromptHash)`. When any
5
- * component changes, we rebuild. When the same key is requested concurrently
6
- * (two ask() calls in parallel), we coalesce via a per-workspace in-process
7
- * mutex so only one cache is created.
5
+ * component changes, we rebuild. Concurrent calls with the same whole call
6
+ * fingerprint (`inFlightKey`: the cache key plus the caching options) coalesce
7
+ * onto one in-process build, so only one cache is created for them.
8
8
  *
9
9
  * Inline fallback path: for small workspaces or `noCache:true`, we skip the
10
10
  * Files API upload entirely and embed file text inline. This avoids unnecessary
@@ -62,41 +62,30 @@ export interface BuildOptions {
62
62
  emitter: ProgressEmitter;
63
63
  allowCaching: boolean;
64
64
  /**
65
- * Optional abort signal (v1.12.1+). When fired, the upload pool stops
66
- * QUEUEING new per-file work and the post-pool abort check throws
67
- * `signal.reason` so the caller's `timeoutMs` budget surfaces as a
68
- * proper TIMEOUT errorCode. Already-flying `client.files.upload`
69
- * calls complete on their own — the SDK doesn't expose abort plumbing
70
- * on `files.upload`, so the abort honours user intent best-effort
71
- * (stops scheduling new work, propagates the abort error after the
72
- * in-flight tasks settle).
73
- *
74
- * Pre-v1.12.1 the upload phase ignored aborts entirely — the signal
75
- * was only threaded into `generateContent`, so a 30s `timeoutMs`
76
- * against a workspace whose upload took 90s would burn 60s of
77
- * bandwidth before the abort took effect at `generateContent`-call
78
- * time. The fix bounds the worst case to "in-flight pool size × max
79
- * upload duration" instead of "total file count × max upload duration".
65
+ * Optional abort signal. When fired, the upload pool stops QUEUEING new
66
+ * per-file work and the post-pool abort check throws `signal.reason` so the
67
+ * caller's `timeoutMs` budget surfaces as a proper TIMEOUT errorCode.
68
+ * Already-flying `client.files.upload` calls complete on their own — the SDK
69
+ * doesn't expose abort plumbing on `files.upload` — so the time an abort
70
+ * waits is bounded by "in-flight pool size × max upload duration", never by
71
+ * "total file count × max upload duration".
80
72
  */
81
73
  signal?: AbortSignal;
82
74
  /**
83
- * Caching mode (v1.13.0+). Controls whether `prepareContext` builds
84
- * an explicit Gemini Context Cache (`caches.create`) or falls through
85
- * to the inline path and relies on Gemini's automatic implicit
86
- * caching for Gemini 2.5+/3 models.
75
+ * Caching mode. Controls whether `prepareContext` builds an explicit Gemini
76
+ * Context Cache (`caches.create`) or falls through to the inline path and
77
+ * relies on Gemini's automatic implicit caching for Gemini 2.5+/3 models.
87
78
  *
88
- * - `'explicit'` (today's behaviour): build + reuse a Context Cache
89
- * for the workspace. Hard ~75 % discount on cached input. Pays
90
- * 60–180 s `caches.create` cost on file change.
91
- * - `'implicit'` (v1.13.0+ opt-in): skip `caches.create` entirely;
92
- * send file content inline every call. Gemini's automatic implicit
93
- * caching applies a discount when the prefix matches across calls
94
- * (4 096-token minimum, no guarantee). No rebuild wait on file
95
- * change. **Best fit for review→edit→review workflows** where
96
- * files change between queries.
97
- * - `undefined`: caller doesn't care; behave as `'explicit'` (the
98
- * v1.12.x default; flip planned for v1.14.0 pending dogfood
99
- * telemetry).
79
+ * - `'explicit'`: build + reuse a Context Cache for the workspace. Hard
80
+ * ~75 % discount on cached input. Pays 60–180 s `caches.create` cost on
81
+ * file change.
82
+ * - `'implicit'`: skip `caches.create` entirely; send file content inline
83
+ * every call. Gemini's automatic implicit caching applies a discount when
84
+ * the prefix matches across calls (4 096-token minimum, no guarantee). No
85
+ * rebuild wait on file change. **Best fit for review→edit→review
86
+ * workflows** where files change between queries.
87
+ * - `undefined`: behaves as `'explicit'`; the tools pass the mode they
88
+ * resolved from the call and the configuration.
100
89
  */
101
90
  cachingMode?: 'explicit' | 'implicit';
102
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cache-manager.d.ts","sourceRoot":"","sources":["../../src/cache/cache-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAE9E,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;;OAKG;IACH,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OA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