@qmediat.io/gemini-code-context-mcp 1.23.1 → 1.25.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.
Files changed (147) hide show
  1. package/CHANGELOG.md +161 -1
  2. package/README.md +1 -1
  3. package/dist/cache/ttl-watcher.d.ts +29 -0
  4. package/dist/cache/ttl-watcher.d.ts.map +1 -1
  5. package/dist/cache/ttl-watcher.js +104 -43
  6. package/dist/cache/ttl-watcher.js.map +1 -1
  7. package/dist/gemini/client.d.ts +7 -0
  8. package/dist/gemini/client.d.ts.map +1 -1
  9. package/dist/gemini/client.js +8 -1
  10. package/dist/gemini/client.js.map +1 -1
  11. package/dist/gemini/long-decode.d.ts +153 -0
  12. package/dist/gemini/long-decode.d.ts.map +1 -0
  13. package/dist/gemini/long-decode.js +178 -0
  14. package/dist/gemini/long-decode.js.map +1 -0
  15. package/dist/gemini/model-registry.d.ts +2 -0
  16. package/dist/gemini/model-registry.d.ts.map +1 -1
  17. package/dist/gemini/model-registry.js +5 -2
  18. package/dist/gemini/model-registry.js.map +1 -1
  19. package/dist/gemini/models.d.ts.map +1 -1
  20. package/dist/gemini/models.js +1 -0
  21. package/dist/gemini/models.js.map +1 -1
  22. package/dist/gemini/retry.d.ts +8 -0
  23. package/dist/gemini/retry.d.ts.map +1 -1
  24. package/dist/gemini/retry.js +33 -1
  25. package/dist/gemini/retry.js.map +1 -1
  26. package/dist/tools/agentic/dispatch.d.ts +68 -0
  27. package/dist/tools/agentic/dispatch.d.ts.map +1 -0
  28. package/dist/tools/agentic/dispatch.js +167 -0
  29. package/dist/tools/agentic/dispatch.js.map +1 -0
  30. package/dist/tools/agentic/input.d.ts +28 -0
  31. package/dist/tools/agentic/input.d.ts.map +1 -0
  32. package/dist/tools/agentic/input.js +66 -0
  33. package/dist/tools/agentic/input.js.map +1 -0
  34. package/dist/tools/agentic/instructions.d.ts +46 -0
  35. package/dist/tools/agentic/instructions.d.ts.map +1 -0
  36. package/dist/tools/agentic/instructions.js +170 -0
  37. package/dist/tools/agentic/instructions.js.map +1 -0
  38. package/dist/tools/agentic/iteration.d.ts +81 -0
  39. package/dist/tools/agentic/iteration.d.ts.map +1 -0
  40. package/dist/tools/agentic/iteration.js +317 -0
  41. package/dist/tools/agentic/iteration.js.map +1 -0
  42. package/dist/tools/agentic/ledger.d.ts +64 -0
  43. package/dist/tools/agentic/ledger.d.ts.map +1 -0
  44. package/dist/tools/agentic/ledger.js +110 -0
  45. package/dist/tools/agentic/ledger.js.map +1 -0
  46. package/dist/tools/agentic/loop.d.ts +10 -0
  47. package/dist/tools/agentic/loop.d.ts.map +1 -0
  48. package/dist/tools/agentic/loop.js +179 -0
  49. package/dist/tools/agentic/loop.js.map +1 -0
  50. package/dist/tools/agentic/no-progress.d.ts +90 -0
  51. package/dist/tools/agentic/no-progress.d.ts.map +1 -0
  52. package/dist/tools/agentic/no-progress.js +107 -0
  53. package/dist/tools/agentic/no-progress.js.map +1 -0
  54. package/dist/tools/agentic/pass-clock.d.ts +85 -0
  55. package/dist/tools/agentic/pass-clock.d.ts.map +1 -0
  56. package/dist/tools/agentic/pass-clock.js +162 -0
  57. package/dist/tools/agentic/pass-clock.js.map +1 -0
  58. package/dist/tools/agentic/phase-defaults.d.ts +29 -0
  59. package/dist/tools/agentic/phase-defaults.d.ts.map +1 -0
  60. package/dist/tools/agentic/phase-defaults.js +23 -0
  61. package/dist/tools/agentic/phase-defaults.js.map +1 -0
  62. package/dist/tools/agentic/rescue.d.ts +69 -0
  63. package/dist/tools/agentic/rescue.d.ts.map +1 -0
  64. package/dist/tools/agentic/rescue.js +203 -0
  65. package/dist/tools/agentic/rescue.js.map +1 -0
  66. package/dist/tools/agentic/response.d.ts +16 -0
  67. package/dist/tools/agentic/response.d.ts.map +1 -0
  68. package/dist/tools/agentic/response.js +25 -0
  69. package/dist/tools/agentic/response.js.map +1 -0
  70. package/dist/tools/agentic/results.d.ts +76 -0
  71. package/dist/tools/agentic/results.d.ts.map +1 -0
  72. package/dist/tools/agentic/results.js +228 -0
  73. package/dist/tools/agentic/results.js.map +1 -0
  74. package/dist/tools/agentic/run.d.ts +130 -0
  75. package/dist/tools/agentic/run.d.ts.map +1 -0
  76. package/dist/tools/agentic/run.js +131 -0
  77. package/dist/tools/agentic/run.js.map +1 -0
  78. package/dist/tools/agentic/sandbox.d.ts +13 -2
  79. package/dist/tools/agentic/sandbox.d.ts.map +1 -1
  80. package/dist/tools/agentic/sandbox.js +127 -111
  81. package/dist/tools/agentic/sandbox.js.map +1 -1
  82. package/dist/tools/agentic/workspace-tools.d.ts +30 -27
  83. package/dist/tools/agentic/workspace-tools.d.ts.map +1 -1
  84. package/dist/tools/agentic/workspace-tools.js +324 -385
  85. package/dist/tools/agentic/workspace-tools.js.map +1 -1
  86. package/dist/tools/ask-agentic-fallback.d.ts +33 -0
  87. package/dist/tools/ask-agentic-fallback.d.ts.map +1 -0
  88. package/dist/tools/ask-agentic-fallback.js +113 -0
  89. package/dist/tools/ask-agentic-fallback.js.map +1 -0
  90. package/dist/tools/ask-agentic.tool.d.ts +11 -44
  91. package/dist/tools/ask-agentic.tool.d.ts.map +1 -1
  92. package/dist/tools/ask-agentic.tool.js +143 -1618
  93. package/dist/tools/ask-agentic.tool.js.map +1 -1
  94. package/dist/tools/ask.tool.d.ts.map +1 -1
  95. package/dist/tools/ask.tool.js +195 -555
  96. package/dist/tools/ask.tool.js.map +1 -1
  97. package/dist/tools/code.tool.d.ts +6 -0
  98. package/dist/tools/code.tool.d.ts.map +1 -1
  99. package/dist/tools/code.tool.js +155 -306
  100. package/dist/tools/code.tool.js.map +1 -1
  101. package/dist/tools/shared/abort-timeout.d.ts +48 -4
  102. package/dist/tools/shared/abort-timeout.d.ts.map +1 -1
  103. package/dist/tools/shared/abort-timeout.js +116 -95
  104. package/dist/tools/shared/abort-timeout.js.map +1 -1
  105. package/dist/tools/shared/call-ledger.d.ts +88 -0
  106. package/dist/tools/shared/call-ledger.d.ts.map +1 -0
  107. package/dist/tools/shared/call-ledger.js +133 -0
  108. package/dist/tools/shared/call-ledger.js.map +1 -0
  109. package/dist/tools/shared/context-decode.d.ts +77 -0
  110. package/dist/tools/shared/context-decode.d.ts.map +1 -0
  111. package/dist/tools/shared/context-decode.js +125 -0
  112. package/dist/tools/shared/context-decode.js.map +1 -0
  113. package/dist/tools/shared/continuation.d.ts +124 -0
  114. package/dist/tools/shared/continuation.d.ts.map +1 -0
  115. package/dist/tools/shared/continuation.js +302 -0
  116. package/dist/tools/shared/continuation.js.map +1 -0
  117. package/dist/tools/shared/dispatch-throttle.d.ts +43 -0
  118. package/dist/tools/shared/dispatch-throttle.d.ts.map +1 -0
  119. package/dist/tools/shared/dispatch-throttle.js +65 -0
  120. package/dist/tools/shared/dispatch-throttle.js.map +1 -0
  121. package/dist/tools/shared/question-fields.d.ts +10 -0
  122. package/dist/tools/shared/question-fields.d.ts.map +1 -0
  123. package/dist/tools/shared/question-fields.js +13 -0
  124. package/dist/tools/shared/question-fields.js.map +1 -0
  125. package/dist/tools/shared/settle-call.d.ts +68 -0
  126. package/dist/tools/shared/settle-call.d.ts.map +1 -0
  127. package/dist/tools/shared/settle-call.js +59 -0
  128. package/dist/tools/shared/settle-call.js.map +1 -0
  129. package/dist/tools/shared/stream-collector.d.ts +7 -0
  130. package/dist/tools/shared/stream-collector.d.ts.map +1 -1
  131. package/dist/tools/shared/stream-collector.js +5 -1
  132. package/dist/tools/shared/stream-collector.js.map +1 -1
  133. package/dist/tools/shared/thinking.d.ts +41 -11
  134. package/dist/tools/shared/thinking.d.ts.map +1 -1
  135. package/dist/tools/shared/thinking.js +62 -9
  136. package/dist/tools/shared/thinking.js.map +1 -1
  137. package/dist/tools/shared/throttle.d.ts +7 -0
  138. package/dist/tools/shared/throttle.d.ts.map +1 -1
  139. package/dist/tools/shared/throttle.js +18 -0
  140. package/dist/tools/shared/throttle.js.map +1 -1
  141. package/dist/types.d.ts +2 -0
  142. package/dist/types.d.ts.map +1 -1
  143. package/dist/utils/cost-estimator.d.ts +17 -0
  144. package/dist/utils/cost-estimator.d.ts.map +1 -1
  145. package/dist/utils/cost-estimator.js +15 -2
  146. package/dist/utils/cost-estimator.js.map +1 -1
  147. package/package.json +4 -3
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Tool executor dispatcher — takes a FunctionCall, routes to the right
3
+ * executor, maps `SandboxError` → `response.error` (recoverable signal), and
4
+ * runs one iteration's calls in parallel under the concurrency cap. Every
5
+ * executor gets the pass's watch (its abort signal, its progress report); once
6
+ * the signal fired, no queued call starts.
7
+ */
8
+ import { logger, safeForLog } from '../../utils/logger.js';
9
+ import { SandboxError } from './sandbox.js';
10
+ import { findFilesExecutor, grepExecutor, listDirectoryExecutor, readFileExecutor, } from './workspace-tools.js';
11
+ /**
12
+ * Default cap on parallel tool-call dispatch within a single iteration.
13
+ *
14
+ * Bumped 3 → 10 in v1.15.1 (P9_a). Pre-bump rationale was "be conservative,
15
+ * avoid hammering local filesystem I/O." Empirical: today's `read_file` /
16
+ * `grep` / `find_files` run against the SQLite-backed manifest + workspace
17
+ * mmap, all of which are CPU-bound and parallelism-friendly. The 3-wide cap
18
+ * forced the model to serialise even small batches like 5 `read_file` calls
19
+ * into 2 round-trips of the iteration loop, eating ~30-60s of HIGH-thinking
20
+ * latency per artificial split. 10-wide handles the typical batch a Gemini
21
+ * 3 Pro response emits without queuing.
22
+ *
23
+ * Operators can override via `GEMINI_CODE_CONTEXT_AGENTIC_TOOL_CONCURRENCY`
24
+ * env var (clamped to [1, 50]) — kill switch for environments where
25
+ * filesystem contention or local I/O bandwidth makes wider concurrency
26
+ * counter-productive.
27
+ */
28
+ const DEFAULT_TOOL_EXECUTION_CONCURRENCY = 10;
29
+ /** Read + clamp the tool-execution concurrency at dispatch time.
30
+ *
31
+ * Why a function not a top-level const: env vars can change between calls
32
+ * within a long-lived MCP-server process (operator ctrl-Cs and re-launches
33
+ * with a different value mid-session). Resolving per-call keeps behaviour
34
+ * predictable. Cost: one env-read per iter; negligible vs the
35
+ * `generateContent` round-trip dominating wall-clock.
36
+ *
37
+ * Clamps numeric inputs to `[1, 50]`. Only NaN / unset / empty falls back
38
+ * to default. 50 cap prevents pathological "concurrency: 99999" misconfig
39
+ * from spawning ~unbounded `read_file` Promise chains. 0 / negative inputs
40
+ * clamp UP to 1 (= serial dispatch) — operators setting `0` or `-3` mean
41
+ * "minimise parallelism", not "use the default" (the v1.15.1 PR-Round-1
42
+ * 2-of-2 cross-reviewer correction: gemini-cli F2 + grok F1 flagged that
43
+ * silently mapping operator-supplied `0` back to 10× was the opposite of
44
+ * intent and a confusing UX on resource-constrained CI / Windows hosts).
45
+ *
46
+ * Exported for unit testing — not part of the public MCP surface. */
47
+ export function resolveToolExecutionConcurrency() {
48
+ const raw = process.env.GEMINI_CODE_CONTEXT_AGENTIC_TOOL_CONCURRENCY;
49
+ if (raw === undefined || raw === '')
50
+ return DEFAULT_TOOL_EXECUTION_CONCURRENCY;
51
+ const parsed = Number.parseInt(raw, 10);
52
+ // Only NaN (genuinely malformed input like `'banana'`) falls back to
53
+ // default. Numeric inputs always clamp into [1, 50] so the operator's
54
+ // stated intent (lower bound = serial; upper bound = throughput cap)
55
+ // is honoured for any value parseInt can extract a number from.
56
+ if (Number.isNaN(parsed))
57
+ return DEFAULT_TOOL_EXECUTION_CONCURRENCY;
58
+ return Math.max(1, Math.min(parsed, 50));
59
+ }
60
+ /** A line number the model sent, or `undefined` when it is not a finite number. */
61
+ const finiteLine = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
62
+ const runListDirectory = async (workspaceRoot, args, matchConfig, watch) => {
63
+ const path = String(args.path ?? '.');
64
+ return (await listDirectoryExecutor(workspaceRoot, path, matchConfig, watch));
65
+ };
66
+ const runFindFiles = async (workspaceRoot, args, matchConfig, watch) => {
67
+ const pattern = String(args.pattern ?? '');
68
+ return (await findFilesExecutor(workspaceRoot, pattern, matchConfig, watch));
69
+ };
70
+ const runReadFile = async (workspaceRoot, args, matchConfig, watch) => {
71
+ const path = String(args.path ?? '');
72
+ const startLine = finiteLine(args.startLine);
73
+ const endLine = finiteLine(args.endLine);
74
+ return (await readFileExecutor(workspaceRoot, path, startLine, endLine, matchConfig, watch));
75
+ };
76
+ const runGrep = async (workspaceRoot, args, matchConfig, watch) => {
77
+ const pattern = String(args.pattern ?? '');
78
+ const pathPrefix = typeof args.pathPrefix === 'string' && args.pathPrefix.length > 0 ? args.pathPrefix : undefined;
79
+ return (await grepExecutor(workspaceRoot, pattern, pathPrefix, matchConfig, watch));
80
+ };
81
+ /** The executor of each tool the model may call, by its declared name. */
82
+ const EXECUTORS = new Map([
83
+ ['list_directory', runListDirectory],
84
+ ['find_files', runFindFiles],
85
+ ['read_file', runReadFile],
86
+ ['grep', runGrep],
87
+ ]);
88
+ /** The recoverable `response.error` text of an executor failure. */
89
+ function failureMessage(err) {
90
+ if (err instanceof SandboxError)
91
+ return `${err.code}: ${err.message}`;
92
+ return err instanceof Error ? err.message : String(err);
93
+ }
94
+ /**
95
+ * A sandbox refusal is logged at debug level with the path the model asked for: the message the model
96
+ * gets for `EXCLUDED_FILE` / `EXCLUDED_DIR` is path-free (no existence oracle), so this line is how an
97
+ * operator maps it back to a path (`GEMINI_CODE_CONTEXT_LOG_LEVEL=debug`).
98
+ */
99
+ function logSandboxRefusal(name, err) {
100
+ if (!(err instanceof SandboxError))
101
+ return;
102
+ logger.debug(`agentic dispatch refused: tool=${safeForLog(name)} code=${safeForLog(err.code)} requestedPath=${safeForLog(err.requestedPath)}`);
103
+ }
104
+ /**
105
+ * Run one function call. SandboxError and anything else that happens in the
106
+ * executor surfaces as recoverable `response.error` so the model can try a
107
+ * different path. Hard failures (e.g. filesystem I/O errors) follow the same
108
+ * path — the worst case is we waste one iteration. An unknown function name
109
+ * returns an error response rather than throwing: the model may recover by
110
+ * picking a valid tool.
111
+ */
112
+ export async function dispatchToolCall(workspaceRoot, name, args, matchConfig, watch) {
113
+ try {
114
+ const executor = EXECUTORS.get(name);
115
+ if (executor === undefined) {
116
+ return {
117
+ name,
118
+ response: { error: `unknown tool: ${name}` },
119
+ isError: true,
120
+ };
121
+ }
122
+ const response = await executor(workspaceRoot, args, matchConfig, watch);
123
+ return { name, response, isError: false };
124
+ }
125
+ catch (err) {
126
+ const message = failureMessage(err);
127
+ logSandboxRefusal(name, err);
128
+ return {
129
+ name,
130
+ response: { error: message },
131
+ isError: true,
132
+ };
133
+ }
134
+ }
135
+ /**
136
+ * Run up to `concurrency` dispatches in parallel, preserving call order. A worker takes the next call only while the
137
+ * watch's signal has not fired, so no queued call starts after it; a running executor gets the watch.
138
+ */
139
+ export function startToolBatch(workspaceRoot, calls, concurrency, matchConfig, watch) {
140
+ const { signal } = watch;
141
+ const results = new Array(calls.length);
142
+ let next = 0;
143
+ let running = 0;
144
+ const worker = async () => {
145
+ while (next < calls.length && !signal.aborted) {
146
+ const i = next;
147
+ next += 1;
148
+ const call = calls[i];
149
+ if (!call)
150
+ continue;
151
+ running += 1;
152
+ try {
153
+ results[i] = await dispatchToolCall(workspaceRoot, call.name, call.args, matchConfig, watch);
154
+ }
155
+ finally {
156
+ running -= 1;
157
+ }
158
+ }
159
+ };
160
+ const workers = Array.from({ length: Math.max(1, Math.min(concurrency, calls.length)) }, worker);
161
+ return {
162
+ settled: Promise.all(workers).then(() => results),
163
+ running: () => running,
164
+ neverStarted: () => calls.length - next,
165
+ };
166
+ }
167
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/tools/agentic/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;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,EAAE,MAAM,CAAC,CAAC;IACjG,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACjD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;QACtB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI;KACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The input of `ask_agentic`: its zod schema (what the MCP host sees as the tool's input schema) and the type the
3
+ * call reads it as.
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const askAgenticInputSchema: z.ZodObject<{
7
+ prompt: z.ZodString;
8
+ workspace: z.ZodOptional<z.ZodString>;
9
+ model: z.ZodOptional<z.ZodString>;
10
+ includeGlobs: z.ZodOptional<z.ZodArray<z.ZodString>>;
11
+ excludeGlobs: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ thinkingBudget: z.ZodOptional<z.ZodNumber>;
13
+ thinkingLevel: z.ZodOptional<z.ZodEnum<{
14
+ HIGH: "HIGH";
15
+ LOW: "LOW";
16
+ MEDIUM: "MEDIUM";
17
+ MINIMAL: "MINIMAL";
18
+ XHIGH: "XHIGH";
19
+ }>>;
20
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
21
+ maxIterations: z.ZodOptional<z.ZodNumber>;
22
+ maxTotalInputTokens: z.ZodOptional<z.ZodNumber>;
23
+ maxFilesRead: z.ZodOptional<z.ZodNumber>;
24
+ iterationTimeoutMs: z.ZodOptional<z.ZodNumber>;
25
+ stallMs: z.ZodOptional<z.ZodNumber>;
26
+ }, z.core.$strip>;
27
+ export type AskAgenticInput = z.infer<typeof askAgenticInputSchema>;
28
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/input.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;iBA0E9B,CAAC;AAEL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The input of `ask_agentic`: its zod schema (what the MCP host sees as the tool's input schema) and the type the
3
+ * call reads it as.
4
+ */
5
+ import { z } from 'zod';
6
+ import { PROMPT_FIELD, WORKSPACE_FIELD } from '../shared/question-fields.js';
7
+ import { THINKING_LEVEL_FIELD } from '../shared/thinking.js';
8
+ export const askAgenticInputSchema = z
9
+ .object({
10
+ prompt: PROMPT_FIELD,
11
+ workspace: WORKSPACE_FIELD,
12
+ model: z
13
+ .string()
14
+ .optional()
15
+ .describe("Model alias ('latest-pro', 'latest-pro-thinking', 'latest-flash') or literal model ID. Defaults to the configured default (GEMINI_CODE_CONTEXT_DEFAULT_MODEL, then the credentials profile, then `latest-pro-thinking`)."),
16
+ includeGlobs: z
17
+ .array(z.string())
18
+ .optional()
19
+ .describe('Additional file extensions or filenames to include. Honoured by the four agentic tools (`list_directory`, `find_files`, `read_file`, `grep`) — the model never sees paths outside these globs. Mirrors the `ask` / `code` semantics so callers (or `ask` → `ask_agentic` fallback in v1.9.0+) get consistent filtering.'),
20
+ excludeGlobs: z
21
+ .array(z.string())
22
+ .optional()
23
+ .describe('Additional patterns to exclude. Same three shapes as `ask` / `code`: (1) directory names or path prefixes (`node_modules`, `src/vendor`, `./dist/`, `.vercel/`), (2) literal filenames exact-match including bare dot-prefixed names (`pr27-diff.txt`, `foo.bar.baz`, `.env`, `.tsbuildinfo`), (3) extension globs that match via endsWith (`*.tsbuildinfo`, `*.map`). Bare dot-prefixed names like `.env` are treated as exact filename literals — write `*.env` for extension semantics. Paths are POSIX-normalised. Case-insensitive. No mid-string `*` / `**` / `?`. **Privacy-relevant:** when `ask` falls back to `ask_agentic` on `WORKSPACE_TOO_LARGE`, the user-supplied excludes here are honoured by every executor: `read_file` rejects with `EXCLUDED_FILE` (generic message — does NOT echo the excluded path, so the error string cannot be used as a path-existence oracle); `list_directory` and `grep` reject the requested directory / `pathPrefix` itself with `EXCLUDED_DIR` when it matches an exclude (top-level gate, not just child filtering); `find_files` skips the dir during walk; child entries inside an unexcluded parent are still hidden when they themselves match an exclude.'),
24
+ thinkingBudget: z.number().int().min(-1).max(65_536).optional(),
25
+ thinkingLevel: THINKING_LEVEL_FIELD,
26
+ maxOutputTokens: z.number().int().min(1).optional(),
27
+ maxIterations: z
28
+ .number()
29
+ .int()
30
+ .min(1)
31
+ .max(50)
32
+ .optional()
33
+ .describe("Hard cap on agentic LOOP iterations (each iteration = one Gemini generateContent + possible tool calls). Default 20. When the loop exhausts this cap without producing final-text, ONE additional non-tool `generateContent` (forced-finalization rescue) runs to synthesise an answer from gathered tool responses. **`structuredContent.apiCalls` is the authoritative total `generateContent` count** (loop iterations + 1 if the rescue dispatched, regardless of outcome). `convergenceForced: true` indicates ONLY that the rescue produced text successfully — an attempted-but-failed rescue increments `apiCalls` without setting `convergenceForced`. Rescue is bounded by `dailyBudgetUsd` and `iterationTimeoutMs`, else the finalization default (600 s per request); see `maxTotalInputTokens` for the cap-overshoot contract. **v1.15.0:** rescue-attempted-but-failed paths additionally surface `structuredContent.rescueErrorCode` (`'TIMEOUT' | 'RATE_LIMIT' | 'INTERNAL' | 'API_ERROR' | 'NETWORK' | 'EMPTY_TEXT'`) + `rescueErrorMessage` (truncated to 500 chars) so wrappers can branch retry behaviour without log scraping. Retry policy: TIMEOUT → raise iterationTimeoutMs; RATE_LIMIT → wait retry-hint window; INTERNAL → investigate code (don't retry blindly); API_ERROR → check status (don't retry 4xx); NETWORK → safe to retry; EMPTY_TEXT → narrow prompt."),
34
+ maxTotalInputTokens: z
35
+ .number()
36
+ .int()
37
+ .min(10_000)
38
+ .optional()
39
+ .describe("Cumulative input-token budget across all iterations. Default 1_000_000. Loop iterations HARD-STOP past this cap (subReason: 'AGENTIC_INPUT_BUDGET_EXCEEDED'). The post-loop forced-finalization rescue is NOT gated on this cap — it may push cumulative tokens past by one call's worth, signalled via `overBudget: true` on the result. Rescue cost remains bounded by `dailyBudgetUsd`; wall-clock by `iterationTimeoutMs`, else the finalization default (600 s per request)."),
40
+ maxFilesRead: z
41
+ .number()
42
+ .int()
43
+ .min(1)
44
+ .max(500)
45
+ .optional()
46
+ .describe('Cap on distinct files opened via `read_file` during this agentic call. Default 40.'),
47
+ iterationTimeoutMs: z
48
+ .number()
49
+ .int()
50
+ .min(1_000)
51
+ .max(1_800_000)
52
+ .optional()
53
+ .describe("Per-iteration wall-clock timeout in ms (1s–30min). Each agentic iteration (its TPM throttle wait, the request, its stream, the path resolution and the tool batch) is bounded by this: a tool batch is ended at this bound, not when it returns. **A single iteration that times out FAILS THE WHOLE agentic call** with `errorCode: 'TIMEOUT'` (the failed iteration's function-call results never came back, leaving the conversation structurally incomplete — continuing with partial state would 400 on the next turn); `timeoutPhase` says where it fired (`tpm-wait`, `opening`, `stream`, `tools`) and `timeoutSource` which bound (`iterationTimeoutMs`, `stallMs`, `default`, or `external` for a timeout no bound of the call raised). A TIMEOUT is `retryable: true` unless tool calls of the iteration still run after a 1 s grace (`retryable: false`, `toolCallsRunning`). The post-loop forced-finalization rescue pass is ALSO bounded by this timeout, but its timeout behaviour DIFFERS: rescue timeouts are caught best-effort and fall through to the original `subReason: 'AGENTIC_MAX_ITERATIONS'` shape with `errorCode: 'UNKNOWN'` (NOT `'TIMEOUT'`; `rescueErrorCode: 'TIMEOUT'`, `timeoutPhase` and `timeoutSource` say what fired) — the rescue is the documented exit path, and surfacing TIMEOUT for it would obscure the underlying maxIterations exhaustion. Operators detect rescue-attempted-but-failed via `apiCalls > iterations` and `convergenceForced` absent. Whole-loop budget is also bounded by `maxIterations` × `maxTotalInputTokens`. When omitted, falls back to env var `GEMINI_CODE_CONTEXT_AGENTIC_ITERATION_TIMEOUT_MS`; when neither is set, each phase has a default bound: 600 s for each request's opening (until its first chunk) and for each request of the forced-finalization pass, 120 s without progress in an iteration's path resolution and tool batch, and 600 s for a silent stream (a `stall`) unless `stallMs` is set."),
54
+ stallMs: z
55
+ .number()
56
+ .int()
57
+ .min(1_000)
58
+ .max(600_000)
59
+ .optional()
60
+ .describe('Per-iteration HEARTBEAT-AWARE stall watchdog in ms (1s–10min). Armed at a stream\'s first chunk and reset on every chunk yielded by `generateContentStream` (text or thought) — fires ONLY when the stream goes silent for this long. Does NOT fire while the model is actively thinking, and bounds neither a request\'s opening (before its first chunk) nor the tool batch: a batch longer than `stallMs` answers. Right knob for "kill dead sockets quickly without penalising deep reasoning." Recommended: `60_000` (60s). Falls back to env var `GEMINI_CODE_CONTEXT_AGENTIC_STALL_MS`; when neither it nor `iterationTimeoutMs` is set, a stream silent for 600 s is a stall. Returns `errorCode: "TIMEOUT"` with `timeoutKind: "stall"`, `timeoutPhase: "stream"` on abort. Independent of `iterationTimeoutMs` — both can be set; whichever fires first wins. **Loop iterations only — the post-loop forced-finalization rescue pass does not stream and has no stall watchdog.**'),
61
+ })
62
+ .refine((data) => !(data.thinkingBudget !== undefined && data.thinkingLevel !== undefined), {
63
+ message: 'Cannot specify both `thinkingBudget` and `thinkingLevel` — mutually exclusive (Gemini rejects).',
64
+ path: [],
65
+ });
66
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/tools/agentic/input.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,eAAe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,QAAQ,CACP,63DAA63D,CAC93D;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,KAAK,CAAC;SACV,GAAG,CAAC,OAAO,CAAC;SACZ,QAAQ,EAAE;SACV,QAAQ,CACP,67BAA67B,CAC97B;CACJ,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,EAAE;IAC1F,OAAO,EACL,iGAAiG;IACnG,IAAI,EAAE,EAAE;CACT,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * What `ask_agentic` sends the model besides the conversation: the system instructions of the loop and of the
3
+ * forced-finalization pass, and the declarations of the four sandboxed tools the loop may call.
4
+ */
5
+ import type { FunctionDeclaration } from '@google/genai';
6
+ export declare const SYSTEM_INSTRUCTION_AGENTIC: string;
7
+ /**
8
+ * Forced-finalization system instruction. Sent on the post-loop synthesis
9
+ * pass when the iteration budget is exhausted. Combined with
10
+ * `toolConfig.functionCallingConfig.mode = NONE`, the model is prohibited
11
+ * from emitting further function calls (per Gemini API spec, NONE mode is
12
+ * "equivalent to sending a request without any function declarations") and
13
+ * must answer with text using the conversation it has already accumulated.
14
+ *
15
+ * Tightened in v1.14.4 after empirical replay (2026-04-30) showed Gemini 3 Pro
16
+ * under HIGH thinking treating the previous "Synthesize the evidence ... in
17
+ * the format the user originally requested" wording as an invitation to
18
+ * narrate its thought process — producing stream-of-consciousness output
19
+ * instead of the structured findings the caller requested. The CRITICAL
20
+ * OUTPUT INSTRUCTIONS block below is authoritative ordering: parse the
21
+ * caller's format spec, synthesize evidence into it, no preamble, no narrative,
22
+ * no apologies. The user's original prompt (with any output-format directive)
23
+ * is preserved across the rescue via `contents[0]`, so the model has the
24
+ * format spec available — the system instruction's job is to enforce
25
+ * compliance.
26
+ *
27
+ * SAFETY: this rescue runs with `mode: NONE` (tools disabled) but still
28
+ * evaluates the FULL conversation history including any malicious payloads
29
+ * surfaced by prior `read_file` / `grep` results (LLM calls are stateless
30
+ * per Gemini API semantics — each turn's output is generated under THAT
31
+ * turn's systemInstruction). The shared `SYSTEM_INSTRUCTION_SAFETY_AGENTIC` block
32
+ * (data-vs-instruction firewall) is therefore prepended below. A 3-of-3
33
+ * cross-reviewer audit on 2026-04-30 (gemini-cli + gemini-chat + grok)
34
+ * flagged the prior absence as an indirect-prompt-injection vector.
35
+ *
36
+ * v1.15.0 (C2): citation directive conditionalised symmetrically with the
37
+ * "Unknown" handling — both gemini-chat (Round-2) and Copilot (Round-1)
38
+ * flagged the v1.14.4 unconditional `Cite specific file:line` as a
39
+ * potential format-break for strict JSON / fixed-shape outputs (e.g., a
40
+ * pure JSON array of strings can't carry `(file:42)` annotations without
41
+ * mutating the data). Now reads "ONLY where the requested format provides
42
+ * a compatible place to put citations".
43
+ */
44
+ export declare const SYSTEM_INSTRUCTION_FINALIZATION: string;
45
+ export declare function buildFunctionDeclarations(): FunctionDeclaration[];
46
+ //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAU,MAAM,eAAe,CAAC;AAmBjE,eAAO,MAAM,0BAA0B,QA0B3B,CAAC;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,+BAA+B,QAYhC,CAAC;AAqFb,wBAAgB,yBAAyB,IAAI,mBAAmB,EAAE,CAOjE"}
@@ -0,0 +1,170 @@
1
+ /**
2
+ * What `ask_agentic` sends the model besides the conversation: the system instructions of the loop and of the
3
+ * forced-finalization pass, and the declarations of the four sandboxed tools the loop may call.
4
+ */
5
+ import { Type as GeminiType } from '@google/genai';
6
+ import { SYSTEM_INSTRUCTION_SAFETY_AGENTIC } from '../shared/system-instruction-safety.js';
7
+ // ---------------------------------------------------------------------------
8
+ // systemInstruction — prompt-injection defence + tool usage guidance
9
+ // ---------------------------------------------------------------------------
10
+ // Safety preamble — moved to `../shared/system-instruction-safety.ts` in v1.15.2
11
+ // so `ask` and `code` can share the same firewall. See that module for the
12
+ // full rationale + threat model. Two variants exist (AGENTIC vs EAGER) because
13
+ // the data-vs-instruction wording must match the file-delivery channel.
14
+ //
15
+ // `ask_agentic` uses the AGENTIC variant (references the four agentic
16
+ // executors that surface file content into `conversation`). The rescue pass
17
+ // uses the same variant — even though tool dispatch is disabled on the
18
+ // rescue, the conversation history still contains tool-response data that
19
+ // could carry adversarial text, so the firewall stays in effect.
20
+ export const SYSTEM_INSTRUCTION_AGENTIC = [
21
+ 'You are a senior code reviewer analysing a user codebase via sandboxed file-access tools.',
22
+ '',
23
+ SYSTEM_INSTRUCTION_SAFETY_AGENTIC,
24
+ '',
25
+ '# TOOLS AVAILABLE',
26
+ '- `list_directory(path)` — list immediate children (files + subdirs) of a workspace-relative path. Start with `"."` to see the root.',
27
+ '- `find_files(pattern)` — recursive glob (`*` any-except-slash, `**` any). Good for locating files by name without reading them.',
28
+ '- `read_file(path, startLine?, endLine?)` — read a file (or slice). Responses are hard-capped at 200 KB; you will see `truncated: true` with `totalLines` metadata — page through large files via startLine/endLine.',
29
+ '- `grep(pattern, pathPrefix?)` — JS RegExp search. Great for finding symbols before opening files.',
30
+ '',
31
+ '# STRATEGY',
32
+ 'Prefer narrow tool calls over wide ones. A typical flow:',
33
+ '1. Scout with `list_directory(".")` or `find_files("**/*.ts")`',
34
+ '2. Locate relevant symbols with `grep`',
35
+ '3. Open only the handful of files that actually bear on the question via `read_file`',
36
+ 'When you have enough context, respond with a plain-text answer and make NO further tool calls.',
37
+ 'Batch your tool calls within a single iteration. If you need to read 5 files, issue all 5 `read_file` calls in ONE turn rather than one-per-iteration across 5 turns — each iteration costs 30-60s of thinking-token latency that you only pay once when calls are batched. The dispatcher runs the batch in parallel (up to 10 concurrent by default). Only batch calls for paths you have already seen in prior tool results (e.g., from `list_directory`, `find_files`, or `grep` output) or that the user provided. Never synthesize or guess additional paths solely to fill a batch — a hallucinated path costs the same iteration latency as the split you were trying to avoid, and the executors will reject it.',
38
+ '',
39
+ '# DECISIVENESS',
40
+ "Be decisive. Once you have read the relevant files and gathered evidence, produce your final answer. Continuing to call tools when you already have an answer is a failure mode — it wastes the user's budget and delays the response.",
41
+ 'When the user provides a complete diff inline, your primary task is reasoning ABOUT the diff. Read each touched file at most once unless a specific concern requires re-reading; do not recursively explore the project tree to verify what the diff already shows.',
42
+ 'A focused investigation typically converges in 3–8 iterations. If you find yourself on iteration 10+ still calling tools, stop and synthesize what you know — state findings as Known / Unknown / Next checks rather than chasing completeness.',
43
+ '',
44
+ '# OUTPUT',
45
+ "Your final response (the one with no function calls) should directly answer the user's prompt. Cite specific `file:line` when referring to code. Be concrete; do not speculate beyond what you read.",
46
+ ].join('\n');
47
+ /**
48
+ * Forced-finalization system instruction. Sent on the post-loop synthesis
49
+ * pass when the iteration budget is exhausted. Combined with
50
+ * `toolConfig.functionCallingConfig.mode = NONE`, the model is prohibited
51
+ * from emitting further function calls (per Gemini API spec, NONE mode is
52
+ * "equivalent to sending a request without any function declarations") and
53
+ * must answer with text using the conversation it has already accumulated.
54
+ *
55
+ * Tightened in v1.14.4 after empirical replay (2026-04-30) showed Gemini 3 Pro
56
+ * under HIGH thinking treating the previous "Synthesize the evidence ... in
57
+ * the format the user originally requested" wording as an invitation to
58
+ * narrate its thought process — producing stream-of-consciousness output
59
+ * instead of the structured findings the caller requested. The CRITICAL
60
+ * OUTPUT INSTRUCTIONS block below is authoritative ordering: parse the
61
+ * caller's format spec, synthesize evidence into it, no preamble, no narrative,
62
+ * no apologies. The user's original prompt (with any output-format directive)
63
+ * is preserved across the rescue via `contents[0]`, so the model has the
64
+ * format spec available — the system instruction's job is to enforce
65
+ * compliance.
66
+ *
67
+ * SAFETY: this rescue runs with `mode: NONE` (tools disabled) but still
68
+ * evaluates the FULL conversation history including any malicious payloads
69
+ * surfaced by prior `read_file` / `grep` results (LLM calls are stateless
70
+ * per Gemini API semantics — each turn's output is generated under THAT
71
+ * turn's systemInstruction). The shared `SYSTEM_INSTRUCTION_SAFETY_AGENTIC` block
72
+ * (data-vs-instruction firewall) is therefore prepended below. A 3-of-3
73
+ * cross-reviewer audit on 2026-04-30 (gemini-cli + gemini-chat + grok)
74
+ * flagged the prior absence as an indirect-prompt-injection vector.
75
+ *
76
+ * v1.15.0 (C2): citation directive conditionalised symmetrically with the
77
+ * "Unknown" handling — both gemini-chat (Round-2) and Copilot (Round-1)
78
+ * flagged the v1.14.4 unconditional `Cite specific file:line` as a
79
+ * potential format-break for strict JSON / fixed-shape outputs (e.g., a
80
+ * pure JSON array of strings can't carry `(file:42)` annotations without
81
+ * mutating the data). Now reads "ONLY where the requested format provides
82
+ * a compatible place to put citations".
83
+ */
84
+ export const SYSTEM_INSTRUCTION_FINALIZATION = [
85
+ SYSTEM_INSTRUCTION_SAFETY_AGENTIC,
86
+ '',
87
+ 'You are wrapping up an investigation. The conversation history above already contains the tool responses you have gathered.',
88
+ 'Your iteration budget is now exhausted. You CANNOT call any more tools — function calling is disabled for this turn.',
89
+ '',
90
+ 'CRITICAL OUTPUT INSTRUCTIONS:',
91
+ "1. PARSE the user's original prompt for exact output format specifications (e.g., markdown headers, JSON shape, tables).",
92
+ '2. STRICTLY follow that requested structure.',
93
+ '3. Synthesize the gathered evidence into the final answer and output it DIRECTLY in the requested structure. Provide NO preamble, NO apologies, NO "Here is the summary", and NO internal thinking or narrative notes.',
94
+ '',
95
+ 'If some details remain unverified, integrate an "Unknown" element ONLY if it is compatible with the parsed output shape (e.g., adds a row to a table, a field to a JSON object, a sub-bullet under a heading); never add extraneous keys or sections that would invalidate the requested format. Cite specific `file:line` for the claims you can support — but ONLY where the requested format provides a compatible place to put citations (e.g., a sub-bullet, an additional column, embedded inside an existing string field); never break the requested structure to add citations.',
96
+ ].join('\n');
97
+ // ---------------------------------------------------------------------------
98
+ // Function declarations — these get serialised and sent to Gemini so the
99
+ // model knows which tools it may invoke + what arguments each takes.
100
+ //
101
+ // Schemas use the SDK's Upper-Case type enum values (`STRING`, `INTEGER`,
102
+ // `OBJECT`). Each declaration is built fresh per call, so no request shares
103
+ // an object with another.
104
+ // ---------------------------------------------------------------------------
105
+ const stringProp = (description) => ({ type: GeminiType.STRING, description });
106
+ const intProp = (description) => ({ type: GeminiType.INTEGER, description });
107
+ function listDirectoryDeclaration() {
108
+ return {
109
+ name: 'list_directory',
110
+ description: 'List the immediate children (files + subdirectories) of a workspace-relative directory path. Does NOT recurse. Excluded directories (node_modules, .git, .next, etc.) and denylisted filenames (lockfiles, .env, etc.) are silently filtered out.',
111
+ parameters: {
112
+ type: GeminiType.OBJECT,
113
+ properties: {
114
+ path: stringProp('Workspace-relative directory path. Use "." for the workspace root. No leading `/`.'),
115
+ },
116
+ required: ['path'],
117
+ },
118
+ };
119
+ }
120
+ function findFilesDeclaration() {
121
+ return {
122
+ name: 'find_files',
123
+ description: 'Recursive glob search for files under the workspace root. Supports `*` (match any character except `/`) and `**` (match any character including `/`). Examples: `**/*.ts`, `src/**/index.*`, `README.md`. Respects the same default excludes as list_directory.',
124
+ parameters: {
125
+ type: GeminiType.OBJECT,
126
+ properties: {
127
+ pattern: stringProp('Glob pattern relative to workspace root. Uses `*` and `**` only (no `?`, no character classes, no `{a,b}`). Match is anchored — the pattern must match the whole relative path.'),
128
+ },
129
+ required: ['pattern'],
130
+ },
131
+ };
132
+ }
133
+ function readFileDeclaration() {
134
+ return {
135
+ name: 'read_file',
136
+ description: 'Read a file from the workspace, optionally a line-range slice. Responses are hard-capped at 200 KB; if the file is larger you get a head-truncated slice with `truncated: true` and `totalLines` metadata. Call again with `startLine` / `endLine` to page through. Rejects binary / non-source extensions.',
137
+ parameters: {
138
+ type: GeminiType.OBJECT,
139
+ properties: {
140
+ path: stringProp('Workspace-relative file path.'),
141
+ startLine: intProp('1-indexed inclusive start line. Omit for line 1.'),
142
+ endLine: intProp('1-indexed inclusive end line. Omit to read until the default or byte cap kicks in.'),
143
+ },
144
+ required: ['path'],
145
+ },
146
+ };
147
+ }
148
+ function grepDeclaration() {
149
+ return {
150
+ name: 'grep',
151
+ description: 'Regular-expression search through source files in the workspace. Pattern is compiled as a JavaScript RegExp (standard metacharacters). Each match line is capped at 500 characters. At most 100 matches per call.',
152
+ parameters: {
153
+ type: GeminiType.OBJECT,
154
+ properties: {
155
+ pattern: stringProp('JavaScript regular-expression pattern (unanchored, no flags).'),
156
+ pathPrefix: stringProp('Optional: limit search to files under this workspace-relative directory prefix.'),
157
+ },
158
+ required: ['pattern'],
159
+ },
160
+ };
161
+ }
162
+ export function buildFunctionDeclarations() {
163
+ return [
164
+ listDirectoryDeclaration(),
165
+ findFilesDeclaration(),
166
+ readFileDeclaration(),
167
+ grepDeclaration(),
168
+ ];
169
+ }
170
+ //# sourceMappingURL=instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../../src/tools/agentic/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAE3F,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAE9E,iFAAiF;AACjF,2EAA2E;AAC3E,+EAA+E;AAC/E,wEAAwE;AACxE,EAAE;AACF,sEAAsE;AACtE,4EAA4E;AAC5E,uEAAuE;AACvE,0EAA0E;AAC1E,iEAAiE;AAEjE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,2FAA2F;IAC3F,EAAE;IACF,iCAAiC;IACjC,EAAE;IACF,mBAAmB;IACnB,sIAAsI;IACtI,kIAAkI;IAClI,sNAAsN;IACtN,oGAAoG;IACpG,EAAE;IACF,YAAY;IACZ,0DAA0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W,EACT,iQAAiQ;QACnQ,UAAU,EAAE;YACV,IAAI,EAAE,UAAU,CAAC,MAAM;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,UAAU,CACjB,iLAAiL,CAClL;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACZ;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,6SAA6S;QAC/S,UAAU,EAAE;YACV,IAAI,EAAE,UAAU,CAAC,MAAM;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE,UAAU,CAAC,+BAA+B,CAAC;gBACjD,SAAS,EAAE,OAAO,CAAC,kDAAkD,CAAC;gBACtE,OAAO,EAAE,OAAO,CACd,oFAAoF,CACrF;aACF;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACT;KACZ,CAAC;AACJ,CAAC;AAED,SAAS,eAAe;IACtB,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,mNAAmN;QACrN,UAAU,EAAE;YACV,IAAI,EAAE,UAAU,CAAC,MAAM;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,UAAU,CAAC,+DAA+D,CAAC;gBACpF,UAAU,EAAE,UAAU,CACpB,iFAAiF,CAClF;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACZ;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,wBAAwB,EAAE;QAC1B,oBAAoB,EAAE;QACtB,mBAAmB,EAAE;QACrB,eAAe,EAAE;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * One iteration of the `ask_agentic` loop: one streamed `generateContent` and, when the model asked for function
3
+ * calls, one parallel batch of tool executions whose responses are appended to the conversation. Every phase reads its
4
+ * bound from the pass's clock: each request's opening and its stream through the SDK's abort signal, the tools phase
5
+ * (path resolution and the batch, raced as one) through `abortable`, the workers' check before each call and the
6
+ * executors' checkpoints, which also report their progress to the clock.
7
+ */
8
+ import type { Content, GenerateContentConfig } from '@google/genai';
9
+ import type { MatchConfig } from '../../indexer/globs.js';
10
+ import type { ToolContext } from '../registry.js';
11
+ import { type ToolCall } from './dispatch.js';
12
+ import { type PassCall } from './ledger.js';
13
+ import type { PassClock } from './pass-clock.js';
14
+ import { type UsageCounts } from './response.js';
15
+ export interface IterationResult {
16
+ /** Text from the final model turn (no function calls) — or null when
17
+ * the model requested more function calls. */
18
+ finalText: string | null;
19
+ functionCallCount: number;
20
+ /** Tool-call signatures observed in THIS iteration (for no-progress
21
+ * detection). Empty on a final-text iteration. */
22
+ signatures: ToolCall[];
23
+ usage: UsageCounts;
24
+ thinkingSummary: string | null;
25
+ /** Approximate token count of the tool-response Parts appended to
26
+ * `conversation` after this iteration's `[model fc]` turn. Bytes/4
27
+ * heuristic — over-estimates dense Unicode but bias is intentional
28
+ * (post-loop rescue's TPM/budget reservation needs to over-reserve
29
+ * rather than under-reserve, which would risk a 429 mid-rescue).
30
+ *
31
+ * Used by the rescue's `finalizationEstimate` (P5/v1.15.0): the rescue
32
+ * replays the entire accumulated conversation, so its actual prompt
33
+ * size ≈ `lastIterationPromptTokens` + size of the tool-response Parts
34
+ * appended AFTER that iteration's `generateContent` returned. Pre-P5
35
+ * the estimate omitted the tool-response delta, undershooting by 100k+
36
+ * tokens when the final iter read several large files concurrently
37
+ * (post-v1.15.1 default `TOOL_EXECUTION_CONCURRENCY = 10`; operator
38
+ * override via `GEMINI_CODE_CONTEXT_AGENTIC_TOOL_CONCURRENCY`). */
39
+ toolResponseTokens: number;
40
+ }
41
+ export interface IterationArgs {
42
+ ctx: ToolContext;
43
+ resolvedModel: string;
44
+ conversation: Content[];
45
+ baseConfig: GenerateContentConfig;
46
+ workspaceRoot: string;
47
+ filesReadSet: Set<string>;
48
+ maxFilesRead: number;
49
+ /** The pass's clock: its signal threads into `withNetworkRetry`, the SDK config and the tools phase; each request
50
+ * enters `opening`, and so does a retry's announcement, so the backoff before a request runs under a fresh default;
51
+ * every chunk reaches `recordChunk`; the tools phase is entered the moment the call completed and its executors'
52
+ * progress reaches `recordProgress`. */
53
+ clock: PassClock;
54
+ /** The pass's model call: marked completed once the stream ended, then given the usage read (`completeCall`). */
55
+ call: PassCall;
56
+ /** User glob filters (v1.9.0+). Honoured by all four agentic executors so
57
+ * a fallback from `ask` (which already applies the same globs to its
58
+ * eager scanner) preserves filter semantics — no privacy regression. */
59
+ matchConfig: MatchConfig;
60
+ /** Surface live thought-chunk previews via the MCP progress channel
61
+ * (T33, v1.16.2). Mirrors the ask/code streaming UX. */
62
+ onThoughtChunk: (text: string) => void;
63
+ }
64
+ /** How an iteration ended: with its result, or at the bound of its tools phase. */
65
+ export type IterationOutcome = {
66
+ readonly kind: 'done';
67
+ readonly iteration: IterationResult;
68
+ } | {
69
+ readonly kind: 'tools-timed-out';
70
+ readonly running: number;
71
+ };
72
+ /**
73
+ * Run one iteration. The model's response (including the function calls) is recorded so the next turn has full
74
+ * context — Gemini requires the full call-response pair to stay in the conversation; both turns are appended only when
75
+ * the tools phase answered. The non-capped calls are dispatched in parallel; the concurrency resolves per call from the
76
+ * env override (`GEMINI_CODE_CONTEXT_AGENTIC_TOOL_CONCURRENCY`), default 10. Remaining `null` slots shouldn't happen in
77
+ * practice (every call gets either a short-circuit or a dispatched response), but are skipped rather than sending a
78
+ * malformed turn to Gemini.
79
+ */
80
+ export declare function runAgenticIteration(args: IterationArgs): Promise<IterationOutcome>;
81
+ //# sourceMappingURL=iteration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iteration.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/iteration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAgB,qBAAqB,EAAQ,MAAM,eAAe,CAAC;AAExF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,WA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