@qmediat.io/gemini-code-context-mcp 1.24.0 → 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 (98) hide show
  1. package/CHANGELOG.md +90 -1
  2. package/README.md +1 -1
  3. package/dist/tools/agentic/dispatch.d.ts +68 -0
  4. package/dist/tools/agentic/dispatch.d.ts.map +1 -0
  5. package/dist/tools/agentic/dispatch.js +167 -0
  6. package/dist/tools/agentic/dispatch.js.map +1 -0
  7. package/dist/tools/agentic/input.d.ts +28 -0
  8. package/dist/tools/agentic/input.d.ts.map +1 -0
  9. package/dist/tools/agentic/input.js +66 -0
  10. package/dist/tools/agentic/input.js.map +1 -0
  11. package/dist/tools/agentic/instructions.d.ts +46 -0
  12. package/dist/tools/agentic/instructions.d.ts.map +1 -0
  13. package/dist/tools/agentic/instructions.js +170 -0
  14. package/dist/tools/agentic/instructions.js.map +1 -0
  15. package/dist/tools/agentic/iteration.d.ts +81 -0
  16. package/dist/tools/agentic/iteration.d.ts.map +1 -0
  17. package/dist/tools/agentic/iteration.js +317 -0
  18. package/dist/tools/agentic/iteration.js.map +1 -0
  19. package/dist/tools/agentic/ledger.d.ts +64 -0
  20. package/dist/tools/agentic/ledger.d.ts.map +1 -0
  21. package/dist/tools/agentic/ledger.js +110 -0
  22. package/dist/tools/agentic/ledger.js.map +1 -0
  23. package/dist/tools/agentic/loop.d.ts +10 -0
  24. package/dist/tools/agentic/loop.d.ts.map +1 -0
  25. package/dist/tools/agentic/loop.js +179 -0
  26. package/dist/tools/agentic/loop.js.map +1 -0
  27. package/dist/tools/agentic/no-progress.d.ts +90 -0
  28. package/dist/tools/agentic/no-progress.d.ts.map +1 -0
  29. package/dist/tools/agentic/no-progress.js +107 -0
  30. package/dist/tools/agentic/no-progress.js.map +1 -0
  31. package/dist/tools/agentic/pass-clock.d.ts +85 -0
  32. package/dist/tools/agentic/pass-clock.d.ts.map +1 -0
  33. package/dist/tools/agentic/pass-clock.js +162 -0
  34. package/dist/tools/agentic/pass-clock.js.map +1 -0
  35. package/dist/tools/agentic/phase-defaults.d.ts +29 -0
  36. package/dist/tools/agentic/phase-defaults.d.ts.map +1 -0
  37. package/dist/tools/agentic/phase-defaults.js +23 -0
  38. package/dist/tools/agentic/phase-defaults.js.map +1 -0
  39. package/dist/tools/agentic/rescue.d.ts +69 -0
  40. package/dist/tools/agentic/rescue.d.ts.map +1 -0
  41. package/dist/tools/agentic/rescue.js +203 -0
  42. package/dist/tools/agentic/rescue.js.map +1 -0
  43. package/dist/tools/agentic/response.d.ts +16 -0
  44. package/dist/tools/agentic/response.d.ts.map +1 -0
  45. package/dist/tools/agentic/response.js +25 -0
  46. package/dist/tools/agentic/response.js.map +1 -0
  47. package/dist/tools/agentic/results.d.ts +76 -0
  48. package/dist/tools/agentic/results.d.ts.map +1 -0
  49. package/dist/tools/agentic/results.js +228 -0
  50. package/dist/tools/agentic/results.js.map +1 -0
  51. package/dist/tools/agentic/run.d.ts +130 -0
  52. package/dist/tools/agentic/run.d.ts.map +1 -0
  53. package/dist/tools/agentic/run.js +131 -0
  54. package/dist/tools/agentic/run.js.map +1 -0
  55. package/dist/tools/agentic/sandbox.d.ts +13 -2
  56. package/dist/tools/agentic/sandbox.d.ts.map +1 -1
  57. package/dist/tools/agentic/sandbox.js +127 -111
  58. package/dist/tools/agentic/sandbox.js.map +1 -1
  59. package/dist/tools/agentic/workspace-tools.d.ts +30 -27
  60. package/dist/tools/agentic/workspace-tools.d.ts.map +1 -1
  61. package/dist/tools/agentic/workspace-tools.js +324 -385
  62. package/dist/tools/agentic/workspace-tools.js.map +1 -1
  63. package/dist/tools/ask-agentic-fallback.d.ts +33 -0
  64. package/dist/tools/ask-agentic-fallback.d.ts.map +1 -0
  65. package/dist/tools/ask-agentic-fallback.js +113 -0
  66. package/dist/tools/ask-agentic-fallback.js.map +1 -0
  67. package/dist/tools/ask-agentic.tool.d.ts +11 -44
  68. package/dist/tools/ask-agentic.tool.d.ts.map +1 -1
  69. package/dist/tools/ask-agentic.tool.js +142 -1615
  70. package/dist/tools/ask-agentic.tool.js.map +1 -1
  71. package/dist/tools/ask.tool.d.ts.map +1 -1
  72. package/dist/tools/ask.tool.js +29 -178
  73. package/dist/tools/ask.tool.js.map +1 -1
  74. package/dist/tools/code.tool.js +9 -20
  75. package/dist/tools/code.tool.js.map +1 -1
  76. package/dist/tools/shared/abort-timeout.d.ts +43 -5
  77. package/dist/tools/shared/abort-timeout.d.ts.map +1 -1
  78. package/dist/tools/shared/abort-timeout.js +111 -102
  79. package/dist/tools/shared/abort-timeout.js.map +1 -1
  80. package/dist/tools/shared/call-ledger.d.ts +27 -12
  81. package/dist/tools/shared/call-ledger.d.ts.map +1 -1
  82. package/dist/tools/shared/call-ledger.js +57 -39
  83. package/dist/tools/shared/call-ledger.js.map +1 -1
  84. package/dist/tools/shared/continuation.d.ts +1 -1
  85. package/dist/tools/shared/continuation.d.ts.map +1 -1
  86. package/dist/tools/shared/question-fields.d.ts +10 -0
  87. package/dist/tools/shared/question-fields.d.ts.map +1 -0
  88. package/dist/tools/shared/question-fields.js +13 -0
  89. package/dist/tools/shared/question-fields.js.map +1 -0
  90. package/dist/tools/shared/settle-call.d.ts +11 -6
  91. package/dist/tools/shared/settle-call.d.ts.map +1 -1
  92. package/dist/tools/shared/settle-call.js +14 -10
  93. package/dist/tools/shared/settle-call.js.map +1 -1
  94. package/dist/tools/shared/throttle.d.ts +7 -0
  95. package/dist/tools/shared/throttle.d.ts.map +1 -1
  96. package/dist/tools/shared/throttle.js +18 -0
  97. package/dist/tools/shared/throttle.js.map +1 -1
  98. package/package.json +1 -1
@@ -21,20 +21,28 @@
21
21
  * unsafe. This module implements `realpath + root jail` per that feedback.
22
22
  */
23
23
  import { type PathKind } from '../../indexer/globs.js';
24
+ /** Which list of the secret denylist a file name is on: its exact basename, or its extension. */
25
+ export type SecretList = 'basename' | 'extension';
26
+ /**
27
+ * The list of the secret denylist `fileName` (a basename) is on, case-insensitively, or `null` when it is on neither.
28
+ * The one test of the denylist: `read_file` refuses such a file (`resolveInsideWorkspace`), `list_directory` hides it,
29
+ * and the walk of `find_files` and `grep` never visits it — its name, size and content stay out of every response.
30
+ */
31
+ export declare function secretListOf(fileName: string): SecretList | null;
24
32
  /**
25
33
  * Where each code fires (v1.9.0 — keep this map current as new throw sites
26
34
  * are added):
27
35
  *
28
36
  * PATH_TRAVERSAL — sandbox.ts (jail violation: symlink escape, abs path outside)
29
37
  * SECRET_DENYLIST — sandbox.ts (basename / extension / dir on hardcoded secret list)
30
- * EXCLUDED_DIR — sandbox.ts (DEFAULT_EXCLUDE_DIRS hit, line ~302)
38
+ * EXCLUDED_DIR — sandbox.ts (DEFAULT_EXCLUDE_DIRS hit, excludedDirError)
31
39
  * AND workspace-tools.ts top-level gates (v1.9.0+):
32
40
  * listDirectoryExecutor + grepExecutor's pathPrefix,
33
41
  * when the requested dir matches user-supplied excludeGlobs
34
42
  * EXCLUDED_FILE — workspace-tools.ts (v1.9.0+): readFileExecutor when
35
43
  * the file is excluded by user globs (filename / extension
36
44
  * / dir-prefix). Generic message — no path leak.
37
- * EXCLUDED_FILENAME — sandbox.ts (DEFAULT_EXCLUDE_FILE_NAMES hit, line ~321)
45
+ * EXCLUDED_FILENAME — sandbox.ts (DEFAULT_EXCLUDE_FILE_NAMES hit, refuseDefaultExcluded)
38
46
  * NON_SOURCE_FILE — workspace-tools.ts: readFileExecutor when no
39
47
  * include-extension matches (path retained — different
40
48
  * threat model from EXCLUDED_FILE)
@@ -73,6 +81,9 @@ export declare function resolveWorkspaceRoot(rootInput: string): Promise<string>
73
81
  * attacker — indirect enumeration signal. Acceptable trade-off: the
74
82
  * missing-file error for a valid path inside the root still surfaces as
75
83
  * `NOT_FOUND` once the parent resolves.
84
+ *
85
+ * The steps run in this order and each refuses with its own code: the argument, the jail, the secret denylist (before
86
+ * the `stat` of the target), the default excludes.
76
87
  */
77
88
  export declare function resolveInsideWorkspace(workspaceRoot: string, relOrAbs: string): Promise<ResolvedPath>;
78
89
  /** A path inside the workspace, resolved: what it is decides whether it can be an excluded directory itself. */
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAGL,KAAK,QAAQ,EAId,MAAM,wBAAwB,CAAC;AAqDhC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,WAAW,GACX,iBAAiB,GACjB,eAAe,CAAC;AAuBpB,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,YAAY,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAKzE;CACF;AAED;;wCAEwC;AACxC,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU7E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAmJvB;AAED,gHAAgH;AAChH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC;CAChB"}
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAGL,KAAK,QAAQ,EAId,MAAM,wBAAwB,CAAC;AAqDhC,iGAAiG;AACjG,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAIhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,WAAW,GACX,iBAAiB,GACjB,eAAe,CAAC;AAuBpB,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,YAAY,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAKzE;CACF;AAED;;wCAEwC;AACxC,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU7E;AA6JD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CASvB;AAED,gHAAgH;AAChH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,CAAC;CAChB"}
@@ -69,6 +69,17 @@ const AGENTIC_SECRET_EXTENSIONS = [
69
69
  '.ppk',
70
70
  '.ovpn',
71
71
  ];
72
+ /**
73
+ * The list of the secret denylist `fileName` (a basename) is on, case-insensitively, or `null` when it is on neither.
74
+ * The one test of the denylist: `read_file` refuses such a file (`resolveInsideWorkspace`), `list_directory` hides it,
75
+ * and the walk of `find_files` and `grep` never visits it — its name, size and content stay out of every response.
76
+ */
77
+ export function secretListOf(fileName) {
78
+ const lowerBase = fileName.toLowerCase();
79
+ if (AGENTIC_SECRET_BASENAMES_LOWER.has(lowerBase))
80
+ return 'basename';
81
+ return AGENTIC_SECRET_EXTENSIONS.some((ext) => lowerBase.endsWith(ext)) ? 'extension' : null;
82
+ }
72
83
  // ---------------------------------------------------------------------------
73
84
  // Path-compare helpers (declared at the top of the file so no function is
74
85
  // referenced before its declaration in source order — a defensive tidy-up
@@ -109,142 +120,147 @@ export async function resolveWorkspaceRoot(rootInput) {
109
120
  throw new SandboxError('NOT_FOUND', `workspace root does not exist or is unreadable: ${rootInput} (${String(err)})`, rootInput);
110
121
  }
111
122
  }
112
- /**
113
- * Resolve `relOrAbs` to a real (symlink-resolved) absolute path, or throw
114
- * `SandboxError` if it escapes the workspace or matches a denylist.
115
- *
116
- * Returns both the resolved absolute path and the POSIX relative path —
117
- * callers need the absolute for FS operations and the relative for logging
118
- * and response payloads. Relative path is always forward-slash form
119
- * regardless of host OS.
120
- *
121
- * Missing-file policy: when the target path doesn't exist on disk, we
122
- * still enforce the structural jail on the PARENT of the missing leaf so
123
- * a request like `read_file(".ssh/id_ed25519")` fails with `PATH_TRAVERSAL`
124
- * even if that specific file is absent. Without walking to a real parent
125
- * we'd leak a `NOT_FOUND` error that confirms the path shape to an
126
- * attacker — indirect enumeration signal. Acceptable trade-off: the
127
- * missing-file error for a valid path inside the root still surfaces as
128
- * `NOT_FOUND` once the parent resolves.
129
- */
130
- export async function resolveInsideWorkspace(workspaceRoot, relOrAbs) {
123
+ /** The argument trimmed; an empty, non-string or whitespace-only argument is refused before any file system call. */
124
+ function cleanedPathArgument(relOrAbs) {
131
125
  if (typeof relOrAbs !== 'string' || relOrAbs.length === 0) {
132
126
  throw new SandboxError('PATH_TRAVERSAL', 'path argument is empty', relOrAbs);
133
127
  }
134
- // Empty after normalisation (only whitespace) → reject.
135
128
  const cleaned = relOrAbs.trim();
136
129
  if (cleaned.length === 0) {
137
130
  throw new SandboxError('PATH_TRAVERSAL', 'path argument is whitespace only', relOrAbs);
138
131
  }
139
- const candidate = resolve(workspaceRoot, cleaned);
140
- // First pass: try to realpath the target. If it exists, we get a canonical
141
- // symlink-resolved form. If not, walk up to the nearest existing parent
142
- // and realpath that — so we detect escapes through symlinks that exist
143
- // even if the leaf does not.
132
+ return cleaned;
133
+ }
134
+ /** The real path of the nearest ancestor of `candidate` that exists, or `null` when none does up to the file system
135
+ * root. `candidate` itself is not tried: the caller's `realpath` of it has already failed. */
136
+ async function nearestExistingAncestor(candidate) {
137
+ let parent = candidate;
138
+ while (true) {
139
+ const next = resolve(parent, '..');
140
+ if (next === parent)
141
+ return null; // hit filesystem root
142
+ parent = next;
143
+ try {
144
+ return await realpath(parent);
145
+ }
146
+ catch {
147
+ /* keep walking */
148
+ }
149
+ }
150
+ }
151
+ /**
152
+ * The refusal of a target that does not exist. The structural jail still holds on its nearest existing ancestor, so a
153
+ * path that is structurally illegal is refused as traversal and never answered with "file not found": an ancestor
154
+ * inside the jail means the leaf is legitimately absent in the workspace (`NOT_FOUND`); one outside means the request
155
+ * tried to escape through a path whose leaf does not exist (`PATH_TRAVERSAL`).
156
+ */
157
+ async function refuseMissingPath(workspaceRoot, candidate, relOrAbs) {
158
+ const existingAncestor = await nearestExistingAncestor(candidate);
159
+ if (existingAncestor === null) {
160
+ throw new SandboxError('NOT_FOUND', `path has no existing ancestor: ${relOrAbs}`, relOrAbs);
161
+ }
162
+ if (!isInside(workspaceRoot, existingAncestor)) {
163
+ throw new SandboxError('PATH_TRAVERSAL', `path escapes workspace root: ${relOrAbs}`, relOrAbs);
164
+ }
165
+ throw new SandboxError('NOT_FOUND', `path does not exist: ${relOrAbs}`, relOrAbs);
166
+ }
167
+ /** The canonical (symlink-resolved) form of `candidate`, inside the jail. The jail is enforced on the RESOLVED path,
168
+ * so a symlink inside the root that points outside it is caught. */
169
+ async function realpathInsideRoot(workspaceRoot, candidate, relOrAbs) {
144
170
  let resolved;
145
171
  try {
146
172
  resolved = await realpath(candidate);
147
173
  }
148
174
  catch {
149
- // Target doesn't exist (yet). Walk to nearest existing ancestor so we
150
- // can still assert "the parent is inside the workspace". This avoids
151
- // leaking "file not found" for paths that are structurally illegal.
152
- let parent = candidate;
153
- let existingAncestor = null;
154
- while (true) {
155
- const next = resolve(parent, '..');
156
- if (next === parent)
157
- break; // hit filesystem root
158
- parent = next;
159
- try {
160
- existingAncestor = await realpath(parent);
161
- break;
162
- }
163
- catch {
164
- /* keep walking */
165
- }
166
- }
167
- if (existingAncestor === null) {
168
- throw new SandboxError('NOT_FOUND', `path has no existing ancestor: ${relOrAbs}`, relOrAbs);
169
- }
170
- // Assert the existing ancestor is inside the jail. If YES, the missing
171
- // leaf is legitimately absent inside the workspace; we return a
172
- // `NOT_FOUND`. If NO, the request was trying to escape via a path
173
- // whose leaf doesn't exist — treat as traversal.
174
- if (!isInside(workspaceRoot, existingAncestor)) {
175
- throw new SandboxError('PATH_TRAVERSAL', `path escapes workspace root: ${relOrAbs}`, relOrAbs);
176
- }
177
- throw new SandboxError('NOT_FOUND', `path does not exist: ${relOrAbs}`, relOrAbs);
175
+ return refuseMissingPath(workspaceRoot, candidate, relOrAbs);
178
176
  }
179
- // realpath succeeded — enforce jail on the RESOLVED path so symlinks are caught.
180
177
  if (!isInside(workspaceRoot, resolved)) {
181
178
  throw new SandboxError('PATH_TRAVERSAL', `path escapes workspace root (symlink or absolute outside): ${relOrAbs}`, relOrAbs);
182
179
  }
183
- const rel = toPosix(relative(workspaceRoot, resolved));
184
- // Content denylist (Codex #4): secrets-by-basename + extension.
185
- // Both checks are case-insensitive — macOS/APFS and Windows/NTFS are
186
- // case-insensitive by default, so `.ENV` resolves to the same inode as
187
- // `.env`. Comparing pre-lowercased protects against a file literally
188
- // stored as `.ENV` (or `.Env.Local`, `CREDENTIALS`, …) bypassing the
189
- // list. Extension check was already case-insensitive; basename check
190
- // used to be strict-equal — bug reported in PR #24 review by Gemini.
191
- const base = basename(resolved);
192
- const lowerBase = base.toLowerCase();
193
- if (AGENTIC_SECRET_BASENAMES_LOWER.has(lowerBase)) {
194
- throw new SandboxError('SECRET_DENYLIST', `filename on secret-basename denylist: ${base}`, relOrAbs);
180
+ return resolved;
181
+ }
182
+ /** Content denylist: secrets by basename or extension, case-insensitively — macOS/APFS and Windows/NTFS are
183
+ * case-insensitive by default, so `.ENV` (or `.Env.Local`, `CREDENTIALS`, …) is the same file as `.env`. */
184
+ function refuseSecretFile(base, relOrAbs) {
185
+ const secretList = secretListOf(base);
186
+ if (secretList !== null) {
187
+ throw new SandboxError('SECRET_DENYLIST', `filename on secret-${secretList} denylist: ${base}`, relOrAbs);
195
188
  }
196
- for (const ext of AGENTIC_SECRET_EXTENSIONS) {
197
- if (lowerBase.endsWith(ext)) {
198
- throw new SandboxError('SECRET_DENYLIST', `filename on secret-extension denylist: ${base}`, relOrAbs);
199
- }
189
+ }
190
+ /**
191
+ * The refusal of a path that `pathHitsDir` placed in the excluded directory `dir`. `SECRET_EXCLUDE_DIRS` wins over
192
+ * the generic list, so `.ssh/id_ed25519` yields `SECRET_DENYLIST` (not `EXCLUDED_DIR`) — "user tried to exfiltrate"
193
+ * stays distinct from "this dir is just boring build output" in observability; functionally both are blocked. The
194
+ * message says whether the path is inside the directory, is the directory, or is a file named like it.
195
+ */
196
+ function excludedDirError(dir, relLower, kind, relOrAbs) {
197
+ const dirLower = dir.toLowerCase();
198
+ if (SECRET_EXCLUDE_DIRS.has(dirLower)) {
199
+ return new SandboxError('SECRET_DENYLIST', `path is inside a secret-bearing directory: ${dir}`, relOrAbs);
200
200
  }
201
- // Excluded-dir check: if the POSIX relative path sits under any entry in
202
- // `DEFAULT_EXCLUDE_DIRS`, refuse. Same semantics as `globs.ts#isPathExcluded`
203
- // but we reuse the table rather than the function to skip the MatchConfig
204
- // plumbing (we already know we're inside the jail, so only dir-name
205
- // matching matters here).
206
- //
207
- // Case-insensitive matching (PR #24 round-3 #2): we compare against the
208
- // lowercased relative path + lowercased dir entries so macOS APFS /
209
- // Windows NTFS (case-insensitive by default) don't let a file named
210
- // `NODE_MODULES/foo.js` slip past a strict-case check.
211
- //
212
- // `SECRET_EXCLUDE_DIRS` wins before the generic list so `.ssh/id_ed25519`
213
- // yields `SECRET_DENYLIST` (not `EXCLUDED_DIR`) — distinguishes "user
214
- // tried to exfiltrate" from "this dir is just boring build output" in
215
- // observability. Functionally both are blocked.
216
- const relLower = rel.toLowerCase();
217
- const kind = await kindOf(resolved, relOrAbs);
201
+ const namesTheDir = relLower === dirLower || relLower.endsWith(`/${dirLower}`);
202
+ if (!namesTheDir) {
203
+ return new SandboxError('EXCLUDED_DIR', `path is inside excluded directory: ${dir}`, relOrAbs);
204
+ }
205
+ const detail = kind === 'dir'
206
+ ? `path is an excluded directory: ${dir}`
207
+ : `path is a file named like an excluded directory: ${dir}`;
208
+ return new SandboxError('EXCLUDED_DIR', detail, relOrAbs);
209
+ }
210
+ /**
211
+ * The default excludes, in this order: the excluded directories, the excluded file names, .NET build output.
212
+ *
213
+ * Excluded-dir check: the POSIX relative path sitting under any entry of `DEFAULT_EXCLUDE_DIRS` is refused. Same
214
+ * semantics as `globs.ts#isPathExcluded`, but it reuses the table rather than the function to skip the MatchConfig
215
+ * plumbing (the path is already inside the jail, so only dir-name matching matters). The comparison is on the
216
+ * lowercased path and entries, so on a case-insensitive file system `NODE_MODULES/foo.js` does not slip past.
217
+ *
218
+ * `DEFAULT_EXCLUDE_FILE_NAMES` (lockfiles, `tsconfig.tsbuildinfo`, …) are matched through their lowercased `Set`, so
219
+ * mis-cased files (`PACKAGE-LOCK.JSON`) match too; their code `EXCLUDED_FILENAME` is distinct from `EXCLUDED_DIR` so
220
+ * the calling model can tell a refused file name from a refused directory in the `functionResponse.error` payload.
221
+ */
222
+ function refuseDefaultExcluded(base, relLower, kind, relOrAbs) {
218
223
  for (const dir of DEFAULT_EXCLUDE_DIRS) {
219
- const dirLower = dir.toLowerCase();
220
- if (!pathHitsDir(relLower, dirLower, kind))
221
- continue;
222
- const code = SECRET_EXCLUDE_DIRS.has(dirLower)
223
- ? 'SECRET_DENYLIST'
224
- : 'EXCLUDED_DIR';
225
- const detail = code === 'SECRET_DENYLIST'
226
- ? `path is inside a secret-bearing directory: ${dir}`
227
- : !(relLower === dirLower || relLower.endsWith(`/${dirLower}`))
228
- ? `path is inside excluded directory: ${dir}`
229
- : kind === 'dir'
230
- ? `path is an excluded directory: ${dir}`
231
- : `path is a file named like an excluded directory: ${dir}`;
232
- throw new SandboxError(code, detail, relOrAbs);
224
+ if (pathHitsDir(relLower, dir.toLowerCase(), kind)) {
225
+ throw excludedDirError(dir, relLower, kind, relOrAbs);
226
+ }
233
227
  }
234
- // And one more pass over DEFAULT_EXCLUDE_FILE_NAMES — lockfiles,
235
- // tsconfig.tsbuildinfo, etc. — they were uninteresting even in the
236
- // eager path, and definitely shouldn't cost agentic iterations.
237
- // Uses the lowercased `Set` so mis-cased files (e.g. `PACKAGE-LOCK.JSON`
238
- // on case-insensitive FS) still match. Uses `EXCLUDED_FILENAME`
239
- // (distinct from `EXCLUDED_DIR`) so the calling model can tell
240
- // "this is a blacklisted filename" from "this is a blacklisted
241
- // directory" in the `functionResponse.error` payload.
242
- if (DEFAULT_EXCLUDE_FILE_NAMES_LOWER.has(lowerBase)) {
228
+ if (DEFAULT_EXCLUDE_FILE_NAMES_LOWER.has(base.toLowerCase())) {
243
229
  throw new SandboxError('EXCLUDED_FILENAME', `filename on default exclude list: ${base}`, relOrAbs);
244
230
  }
245
231
  if (isDotnetBuildOutput(relLower, kind)) {
246
232
  throw new SandboxError('EXCLUDED_DIR', 'path is .NET build output (bin/…/Debug or Release)', relOrAbs);
247
233
  }
234
+ }
235
+ /**
236
+ * Resolve `relOrAbs` to a real (symlink-resolved) absolute path, or throw
237
+ * `SandboxError` if it escapes the workspace or matches a denylist.
238
+ *
239
+ * Returns both the resolved absolute path and the POSIX relative path —
240
+ * callers need the absolute for FS operations and the relative for logging
241
+ * and response payloads. Relative path is always forward-slash form
242
+ * regardless of host OS.
243
+ *
244
+ * Missing-file policy: when the target path doesn't exist on disk, we
245
+ * still enforce the structural jail on the PARENT of the missing leaf so
246
+ * a request like `read_file(".ssh/id_ed25519")` fails with `PATH_TRAVERSAL`
247
+ * even if that specific file is absent. Without walking to a real parent
248
+ * we'd leak a `NOT_FOUND` error that confirms the path shape to an
249
+ * attacker — indirect enumeration signal. Acceptable trade-off: the
250
+ * missing-file error for a valid path inside the root still surfaces as
251
+ * `NOT_FOUND` once the parent resolves.
252
+ *
253
+ * The steps run in this order and each refuses with its own code: the argument, the jail, the secret denylist (before
254
+ * the `stat` of the target), the default excludes.
255
+ */
256
+ export async function resolveInsideWorkspace(workspaceRoot, relOrAbs) {
257
+ const candidate = resolve(workspaceRoot, cleanedPathArgument(relOrAbs));
258
+ const resolved = await realpathInsideRoot(workspaceRoot, candidate, relOrAbs);
259
+ const rel = toPosix(relative(workspaceRoot, resolved));
260
+ const base = basename(resolved);
261
+ refuseSecretFile(base, relOrAbs);
262
+ const kind = await kindOf(resolved, relOrAbs);
263
+ refuseDefaultExcluded(base, rel.toLowerCase(), kind, relOrAbs);
248
264
  return { absolutePath: resolved, relpath: rel, kind };
249
265
  }
250
266
  async function kindOf(resolved, relOrAbs) {
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/tools/agentic/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAEhC,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;4DAO4D;AAC5D,MAAM,wBAAwB,GAAsB;IAClD,MAAM;IACN,YAAY;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+19,18 @@
19
19
  * minified bundle or a massive listing burning output tokens on one call.
20
20
  */
21
21
  import { type MatchConfig } from '../../indexer/globs.js';
22
+ /** What an executor reports to, and is stopped by: the pass that runs it. */
23
+ export interface ToolWatch {
24
+ /** Fires when a bound of the pass fired: the executor then rejects with its reason at its next checkpoint. */
25
+ readonly signal?: AbortSignal;
26
+ /** Called at every checkpoint the executor passes: progress, which defers the tools phase's bound on silence. */
27
+ readonly onProgress?: () => void;
28
+ }
29
+ /**
30
+ * A checkpoint of an executor's work — every place it reads the signal: rejects with the signal's reason once it
31
+ * fired, else reports progress. Reading the signal and reporting progress are one call, so they cannot drift apart.
32
+ */
33
+ export declare function checkpoint(watch: ToolWatch | undefined): void;
22
34
  export interface DirEntry {
23
35
  relpath: string;
24
36
  type: 'file' | 'dir';
@@ -31,11 +43,12 @@ export interface ListDirectoryResult {
31
43
  totalEntries: number;
32
44
  }
33
45
  /**
34
- * List immediate children of `relPath` (non-recursive). Default-excluded
35
- * dirs and denylisted filenames are silently omitted; the model sees only
36
- * paths it is allowed to ask for via `read_file` / `grep`.
46
+ * List immediate children of `relPath` (non-recursive). Default-excluded dirs and denylisted filenames are omitted; the
47
+ * model sees only paths it is allowed to ask for via `read_file` / `grep`. The requested directory itself is checked
48
+ * against the caller's `excludeGlobs` first — with a message that names no path, so success vs `NOT_FOUND` is no oracle
49
+ * for an excluded directory's existence. A checkpoint (`watch`) precedes the read and each entry.
37
50
  */
38
- export declare function listDirectoryExecutor(workspaceRoot: string, relPath: string, matchConfig?: MatchConfig): Promise<ListDirectoryResult>;
51
+ export declare function listDirectoryExecutor(workspaceRoot: string, relPath: string, matchConfig?: MatchConfig, watch?: ToolWatch): Promise<ListDirectoryResult>;
39
52
  export interface FindFilesResult {
40
53
  pattern: string;
41
54
  matches: string[];
@@ -43,12 +56,10 @@ export interface FindFilesResult {
43
56
  totalMatches: number;
44
57
  }
45
58
  /**
46
- * Recursive glob search inside the workspace. Respects default excludes +
47
- * extension gating (same rules as the eager scanner, so the model never
48
- * sees paths it couldn't `read_file` on anyway — avoids a foot-gun where
49
- * the model tries to open a secret it saw in a `find_files` response).
59
+ * Recursive glob search inside the workspace. Respects default excludes, the secret denylist and extension gating, so
60
+ * the model never sees paths it could not `read_file` on anyway.
50
61
  */
51
- export declare function findFilesExecutor(workspaceRoot: string, pattern: string, matchConfig?: MatchConfig): Promise<FindFilesResult>;
62
+ export declare function findFilesExecutor(workspaceRoot: string, pattern: string, matchConfig?: MatchConfig, watch?: ToolWatch): Promise<FindFilesResult>;
52
63
  export interface ReadFileResult {
53
64
  relpath: string;
54
65
  content: string;
@@ -60,16 +71,12 @@ export interface ReadFileResult {
60
71
  totalBytes: number;
61
72
  }
62
73
  /**
63
- * Read a file with bounded bytes + lines. Every response includes enough
64
- * metadata (`totalLines`, `totalBytes`, `truncated`, `truncationReason`) for
65
- * the model to request the next slice intelligently.
66
- *
67
- * Slicing semantics:
68
- * - `startLine` / `endLine` are 1-indexed inclusive ranges when given.
69
- * - Omit both → return the first `DEFAULT_READ_LINE_LIMIT` lines, up to
70
- * `MAX_READ_BYTES`, whichever hits first.
74
+ * Read a file with bounded bytes + lines. Every response includes enough metadata (`totalLines`, `totalBytes`,
75
+ * `truncated`, `truncationReason`) for the model to request the next slice intelligently. `startLine` / `endLine` are
76
+ * 1-indexed inclusive; omit both → the first `DEFAULT_READ_LINE_LIMIT` lines, up to `MAX_READ_BYTES`, whichever hits
77
+ * first. A checkpoint (`watch`) precedes the read and follows it; the signal aborts the read itself.
71
78
  */
72
- export declare function readFileExecutor(workspaceRoot: string, relPath: string, startLine?: number, endLine?: number, matchConfig?: MatchConfig): Promise<ReadFileResult>;
79
+ export declare function readFileExecutor(workspaceRoot: string, relPath: string, startLine?: number, endLine?: number, matchConfig?: MatchConfig, watch?: ToolWatch): Promise<ReadFileResult>;
73
80
  export interface GrepMatch {
74
81
  relpath: string;
75
82
  line: number;
@@ -83,16 +90,12 @@ export interface GrepResult {
83
90
  totalMatches: number;
84
91
  }
85
92
  /**
86
- * Recursive regex search. Supports a basic anchored `pathPrefix` so the
87
- * model can scope to a subtree. Pattern is compiled as JS RegExp — the
88
- * model can use standard metacharacters.
89
- *
90
- * Hard caps:
91
- * - `MAX_GREP_MATCHES` matches returned
92
- * - each match line truncated to 500 chars (guard against minified
93
- * lines flooding the payload)
93
+ * Recursive regex search. Supports a basic anchored `pathPrefix` so the model can scope to a subtree. Pattern is
94
+ * compiled as JS RegExp — the model can use standard metacharacters. Hard caps: `MAX_GREP_MATCHES` matches returned,
95
+ * each match line truncated to 500 chars, the walk ends once the response reaches `MAX_RESPONSE_BYTES`. The walk
96
+ * honours the caller's directory excludes, so a regex like `password|secret` reads no file in an excluded directory.
94
97
  */
95
- export declare function grepExecutor(workspaceRoot: string, pattern: string, pathPrefix?: string, matchConfig?: MatchConfig): Promise<GrepResult>;
98
+ export declare function grepExecutor(workspaceRoot: string, pattern: string, pathPrefix?: string, matchConfig?: MatchConfig, watch?: ToolWatch): Promise<GrepResult>;
96
99
  /** Export knobs for tests to reference without re-declaring numeric values. */
97
100
  export declare const AGENTIC_LIMITS: Readonly<{
98
101
  readonly MAX_READ_BYTES: 200000;
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/agentic/workspace-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,KAAK,WAAW,EAAsC,MAAM,wBAAwB,CAAC;AAsI9F,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,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