@thacio/auditaria 0.30.1 → 0.30.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/gemini.js +378 -47
- package/bundle/node_modules/@browserbasehq/stagehand/dist/index.js +165265 -0
- package/bundle/node_modules/@browserbasehq/stagehand/package.json +102 -0
- package/bundle/web-client/components/FileTreePanel.js +164 -58
- package/bundle/web-client/managers/FileTreeManager.js +301 -69
- package/bundle/web-client/styles/file-browser.css +42 -0
- package/package.json +2 -1
package/bundle/gemini.js
CHANGED
|
@@ -120030,7 +120030,7 @@ function getVersion() {
|
|
|
120030
120030
|
}
|
|
120031
120031
|
versionPromise = (async () => {
|
|
120032
120032
|
const pkgJson = await getPackageJson(__dirname3);
|
|
120033
|
-
return "0.30.
|
|
120033
|
+
return "0.30.12";
|
|
120034
120034
|
})();
|
|
120035
120035
|
return versionPromise;
|
|
120036
120036
|
}
|
|
@@ -184383,7 +184383,7 @@ var require_util11 = __commonJS({
|
|
|
184383
184383
|
var os39 = __require("os");
|
|
184384
184384
|
var fs132 = __require("fs");
|
|
184385
184385
|
var path154 = __require("path");
|
|
184386
|
-
var
|
|
184386
|
+
var spawn18 = __require("child_process").spawn;
|
|
184387
184387
|
var exec7 = __require("child_process").exec;
|
|
184388
184388
|
var execSync8 = __require("child_process").execSync;
|
|
184389
184389
|
var util5 = __require("util");
|
|
@@ -184747,7 +184747,7 @@ var require_util11 = __commonJS({
|
|
|
184747
184747
|
}
|
|
184748
184748
|
function powerShellStart() {
|
|
184749
184749
|
if (!_psChild) {
|
|
184750
|
-
_psChild =
|
|
184750
|
+
_psChild = spawn18(_powerShell, ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-Command", "-"], {
|
|
184751
184751
|
stdio: "pipe",
|
|
184752
184752
|
windowsHide: true,
|
|
184753
184753
|
maxBuffer: 1024 * 102400,
|
|
@@ -184821,7 +184821,7 @@ var require_util11 = __commonJS({
|
|
|
184821
184821
|
try {
|
|
184822
184822
|
const osVersion = os39.release().split(".").map(Number);
|
|
184823
184823
|
const spanOptions = osVersion[0] < 10 ? ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"] : ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-ExecutionPolicy", "Unrestricted", "-Command", cmd];
|
|
184824
|
-
const child =
|
|
184824
|
+
const child = spawn18(_powerShell, spanOptions, {
|
|
184825
184825
|
stdio: "pipe",
|
|
184826
184826
|
windowsHide: true,
|
|
184827
184827
|
maxBuffer: 1024 * 102400,
|
|
@@ -184875,7 +184875,7 @@ var require_util11 = __commonJS({
|
|
|
184875
184875
|
return new Promise((resolve34) => {
|
|
184876
184876
|
process.nextTick(() => {
|
|
184877
184877
|
try {
|
|
184878
|
-
const child =
|
|
184878
|
+
const child = spawn18(cmd, args2, options);
|
|
184879
184879
|
if (child && !child.pid) {
|
|
184880
184880
|
child.on("error", () => {
|
|
184881
184881
|
resolve34(result2);
|
|
@@ -202503,8 +202503,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
|
|
|
202503
202503
|
var init_git_commit = __esm({
|
|
202504
202504
|
"packages/core/dist/src/generated/git-commit.js"() {
|
|
202505
202505
|
"use strict";
|
|
202506
|
-
GIT_COMMIT_INFO = "
|
|
202507
|
-
CLI_VERSION = "0.30.
|
|
202506
|
+
GIT_COMMIT_INFO = "f9d3697df";
|
|
202507
|
+
CLI_VERSION = "0.30.12";
|
|
202508
202508
|
}
|
|
202509
202509
|
});
|
|
202510
202510
|
|
|
@@ -319412,7 +319412,7 @@ var require_cross_spawn = __commonJS({
|
|
|
319412
319412
|
var cp3 = __require("child_process");
|
|
319413
319413
|
var parse15 = require_parse7();
|
|
319414
319414
|
var enoent = require_enoent();
|
|
319415
|
-
function
|
|
319415
|
+
function spawn18(command2, args2, options) {
|
|
319416
319416
|
const parsed = parse15(command2, args2, options);
|
|
319417
319417
|
const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options);
|
|
319418
319418
|
enoent.hookChildProcess(spawned, parsed);
|
|
@@ -319424,8 +319424,8 @@ var require_cross_spawn = __commonJS({
|
|
|
319424
319424
|
result2.error = result2.error || enoent.verifyENOENTSync(result2.status, parsed);
|
|
319425
319425
|
return result2;
|
|
319426
319426
|
}
|
|
319427
|
-
module2.exports =
|
|
319428
|
-
module2.exports.spawn =
|
|
319427
|
+
module2.exports = spawn18;
|
|
319428
|
+
module2.exports.spawn = spawn18;
|
|
319429
319429
|
module2.exports.sync = spawnSync6;
|
|
319430
319430
|
module2.exports._parse = parse15;
|
|
319431
319431
|
module2.exports._enoent = enoent;
|
|
@@ -398156,12 +398156,14 @@ var init_stagehand_adapter = __esm({
|
|
|
398156
398156
|
return this.resolutionPaths;
|
|
398157
398157
|
}
|
|
398158
398158
|
this.resolutionPaths = [
|
|
398159
|
-
// 1. Try from bundle
|
|
398159
|
+
// 1. Try from bundle directory (self-contained stagehand in bundle/node_modules/)
|
|
398160
398160
|
// __dirname is set by esbuild banner to the bundle directory
|
|
398161
|
+
typeof __dirname !== "undefined" ? `file://${__dirname}/package.json` : null,
|
|
398162
|
+
// 2. Try from package root (global install - npm-installed deps in node_modules/)
|
|
398161
398163
|
typeof __dirname !== "undefined" ? `file://${__dirname}/../package.json` : null,
|
|
398162
|
-
//
|
|
398164
|
+
// 3. Try from CLI package (when running from project root)
|
|
398163
398165
|
`file://${process.cwd()}/packages/cli/package.json`,
|
|
398164
|
-
//
|
|
398166
|
+
// 4. Try from browser-agent package (local dev fallback)
|
|
398165
398167
|
`file://${process.cwd()}/packages/browser-agent/package.json`
|
|
398166
398168
|
].filter(Boolean);
|
|
398167
398169
|
return this.resolutionPaths;
|
|
@@ -499122,10 +499124,12 @@ import { EventEmitter as EventEmitter16 } from "events";
|
|
|
499122
499124
|
// packages/cli/src/services/FileSystemService.ts
|
|
499123
499125
|
import path85 from "node:path";
|
|
499124
499126
|
import { promises as fs70 } from "node:fs";
|
|
499125
|
-
|
|
499127
|
+
import { spawn as spawn12 } from "node:child_process";
|
|
499128
|
+
var FileSystemService = class _FileSystemService {
|
|
499126
499129
|
workspaceRoot;
|
|
499127
499130
|
maxFileSize;
|
|
499128
499131
|
ignoredPatterns;
|
|
499132
|
+
rgPath = null;
|
|
499129
499133
|
/**
|
|
499130
499134
|
* Create a new FileSystemService
|
|
499131
499135
|
* @param workspaceRoot - Absolute path to workspace root directory
|
|
@@ -499158,6 +499162,14 @@ var FileSystemService = class {
|
|
|
499158
499162
|
"temp"
|
|
499159
499163
|
];
|
|
499160
499164
|
}
|
|
499165
|
+
/**
|
|
499166
|
+
* Set ripgrep binary path for fast file search.
|
|
499167
|
+
* When set, searchFiles() uses ripgrep with BFS fallback.
|
|
499168
|
+
* @param rgPath - Absolute path to rg binary
|
|
499169
|
+
*/
|
|
499170
|
+
setRgPath(rgPath2) {
|
|
499171
|
+
this.rgPath = rgPath2;
|
|
499172
|
+
}
|
|
499161
499173
|
/**
|
|
499162
499174
|
* Get workspace root path
|
|
499163
499175
|
*/
|
|
@@ -499172,33 +499184,65 @@ var FileSystemService = class {
|
|
|
499172
499184
|
getIgnoredPatterns() {
|
|
499173
499185
|
return [...this.ignoredPatterns];
|
|
499174
499186
|
}
|
|
499187
|
+
/**
|
|
499188
|
+
* Options for lazy tree loading
|
|
499189
|
+
*/
|
|
499190
|
+
static TREE_DEFAULTS = {
|
|
499191
|
+
maxDepth: 1,
|
|
499192
|
+
maxChildren: 500,
|
|
499193
|
+
searchMaxResults: 200,
|
|
499194
|
+
searchMaxDirsVisited: 5e3
|
|
499195
|
+
};
|
|
499175
499196
|
/**
|
|
499176
499197
|
* Get directory tree structure
|
|
499177
499198
|
*
|
|
499178
499199
|
* @param relativePath - Optional subdirectory path (relative to workspace root)
|
|
499200
|
+
* @param options - Lazy loading options (maxDepth, maxChildren, currentDepth)
|
|
499179
499201
|
* @returns Array of tree nodes representing files and folders
|
|
499180
499202
|
* @throws Error if path is invalid or outside workspace
|
|
499181
499203
|
*/
|
|
499182
|
-
async getFileTree(relativePath = ".") {
|
|
499204
|
+
async getFileTree(relativePath = ".", options = {}) {
|
|
499205
|
+
const maxDepth = options.maxDepth ?? Infinity;
|
|
499206
|
+
const maxChildren = options.maxChildren ?? Infinity;
|
|
499207
|
+
const currentDepth = options.currentDepth ?? 0;
|
|
499183
499208
|
const absolutePath = this.validatePath(relativePath);
|
|
499184
499209
|
try {
|
|
499185
499210
|
const entries2 = await fs70.readdir(absolutePath, { withFileTypes: true });
|
|
499186
499211
|
const nodes = [];
|
|
499212
|
+
let totalValid = 0;
|
|
499187
499213
|
for (const entry of entries2) {
|
|
499188
499214
|
if (this.shouldIgnore(entry.name)) {
|
|
499189
499215
|
continue;
|
|
499190
499216
|
}
|
|
499217
|
+
totalValid++;
|
|
499218
|
+
if (nodes.length >= maxChildren) {
|
|
499219
|
+
continue;
|
|
499220
|
+
}
|
|
499191
499221
|
const entryRelativePath = path85.join(relativePath, entry.name);
|
|
499192
499222
|
const absoluteEntryPath = path85.join(absolutePath, entry.name);
|
|
499193
499223
|
try {
|
|
499194
499224
|
if (entry.isDirectory()) {
|
|
499195
|
-
|
|
499196
|
-
|
|
499197
|
-
|
|
499198
|
-
|
|
499199
|
-
|
|
499200
|
-
|
|
499201
|
-
|
|
499225
|
+
if (currentDepth < maxDepth) {
|
|
499226
|
+
const children = await this.getFileTree(entryRelativePath, {
|
|
499227
|
+
maxDepth,
|
|
499228
|
+
maxChildren,
|
|
499229
|
+
currentDepth: currentDepth + 1
|
|
499230
|
+
});
|
|
499231
|
+
nodes.push({
|
|
499232
|
+
label: entry.name,
|
|
499233
|
+
path: entryRelativePath,
|
|
499234
|
+
type: "folder",
|
|
499235
|
+
children
|
|
499236
|
+
});
|
|
499237
|
+
} else {
|
|
499238
|
+
const hasChildren2 = await this.folderHasChildren(absoluteEntryPath);
|
|
499239
|
+
nodes.push({
|
|
499240
|
+
label: entry.name,
|
|
499241
|
+
path: entryRelativePath,
|
|
499242
|
+
type: "folder",
|
|
499243
|
+
hasChildren: hasChildren2
|
|
499244
|
+
});
|
|
499245
|
+
}
|
|
499202
499246
|
} else if (entry.isFile()) {
|
|
499203
499247
|
const stats = await fs70.stat(absoluteEntryPath);
|
|
499204
499248
|
nodes.push({
|
|
@@ -499216,7 +499260,19 @@ var FileSystemService = class {
|
|
|
499216
499260
|
continue;
|
|
499217
499261
|
}
|
|
499218
499262
|
}
|
|
499263
|
+
if (totalValid > maxChildren && nodes.length > 0) {
|
|
499264
|
+
const lastNode = nodes[nodes.length - 1];
|
|
499265
|
+
nodes.push({
|
|
499266
|
+
label: `... and ${totalValid - maxChildren} more items`,
|
|
499267
|
+
path: path85.join(relativePath, "__truncated__"),
|
|
499268
|
+
type: "file",
|
|
499269
|
+
truncated: true,
|
|
499270
|
+
totalChildren: totalValid
|
|
499271
|
+
});
|
|
499272
|
+
}
|
|
499219
499273
|
nodes.sort((a2, b) => {
|
|
499274
|
+
if (a2.truncated) return 1;
|
|
499275
|
+
if (b.truncated) return -1;
|
|
499220
499276
|
if (a2.type !== b.type) {
|
|
499221
499277
|
return a2.type === "folder" ? -1 : 1;
|
|
499222
499278
|
}
|
|
@@ -499233,6 +499289,178 @@ var FileSystemService = class {
|
|
|
499233
499289
|
throw new Error(`Failed to read directory: ${error40.message}`);
|
|
499234
499290
|
}
|
|
499235
499291
|
}
|
|
499292
|
+
/**
|
|
499293
|
+
* Lightweight check: does a folder contain any non-ignored children?
|
|
499294
|
+
* Used at depth limit to decide if the expand arrow should show.
|
|
499295
|
+
*/
|
|
499296
|
+
async folderHasChildren(absoluteFolderPath) {
|
|
499297
|
+
try {
|
|
499298
|
+
const entries2 = await fs70.readdir(absoluteFolderPath, { withFileTypes: true });
|
|
499299
|
+
for (const entry of entries2) {
|
|
499300
|
+
if (!this.shouldIgnore(entry.name) && (entry.isFile() || entry.isDirectory())) {
|
|
499301
|
+
return true;
|
|
499302
|
+
}
|
|
499303
|
+
}
|
|
499304
|
+
return false;
|
|
499305
|
+
} catch {
|
|
499306
|
+
return false;
|
|
499307
|
+
}
|
|
499308
|
+
}
|
|
499309
|
+
/**
|
|
499310
|
+
* Search files by name. Uses ripgrep when available for speed and regex support,
|
|
499311
|
+
* falls back to Node.js BFS traversal otherwise.
|
|
499312
|
+
*
|
|
499313
|
+
* The query is treated as a regex pattern. If the regex is invalid, it falls
|
|
499314
|
+
* back to case-insensitive substring matching.
|
|
499315
|
+
*
|
|
499316
|
+
* @param query - Search string (regex or plain substring)
|
|
499317
|
+
* @param maxResults - Maximum results to return
|
|
499318
|
+
* @returns Flat array of matching TreeNode items
|
|
499319
|
+
*/
|
|
499320
|
+
async searchFiles(query, maxResults = _FileSystemService.TREE_DEFAULTS.searchMaxResults) {
|
|
499321
|
+
if (this.rgPath) {
|
|
499322
|
+
try {
|
|
499323
|
+
return await this.searchFilesWithRg(query, maxResults);
|
|
499324
|
+
} catch (error40) {
|
|
499325
|
+
console.error("Ripgrep search failed, falling back to BFS:", error40);
|
|
499326
|
+
}
|
|
499327
|
+
}
|
|
499328
|
+
return this.searchFilesBFS(query, maxResults);
|
|
499329
|
+
}
|
|
499330
|
+
/**
|
|
499331
|
+
* Build a name matcher from a query string.
|
|
499332
|
+
* Tries regex first; falls back to case-insensitive substring.
|
|
499333
|
+
*/
|
|
499334
|
+
buildNameMatcher(query) {
|
|
499335
|
+
try {
|
|
499336
|
+
const regex3 = new RegExp(query, "i");
|
|
499337
|
+
return (name4) => regex3.test(name4);
|
|
499338
|
+
} catch {
|
|
499339
|
+
const lower2 = query.toLowerCase();
|
|
499340
|
+
return (name4) => name4.toLowerCase().includes(lower2);
|
|
499341
|
+
}
|
|
499342
|
+
}
|
|
499343
|
+
/**
|
|
499344
|
+
* Search files using ripgrep (fast, multi-threaded, respects .gitignore).
|
|
499345
|
+
* Spawns `rg --files` and filters output by name.
|
|
499346
|
+
*
|
|
499347
|
+
* Note: rg --files only lists files, not directories. This is acceptable
|
|
499348
|
+
* since users typically search for files. Directories matching the query
|
|
499349
|
+
* are found via BFS fallback when rg is unavailable.
|
|
499350
|
+
*/
|
|
499351
|
+
searchFilesWithRg(query, maxResults) {
|
|
499352
|
+
const matcher = this.buildNameMatcher(query);
|
|
499353
|
+
const args2 = [
|
|
499354
|
+
"--files",
|
|
499355
|
+
// List files only (no content search)
|
|
499356
|
+
"--hidden",
|
|
499357
|
+
// Include hidden files (we exclude specific ones below)
|
|
499358
|
+
"--no-ignore",
|
|
499359
|
+
// Don't respect .gitignore/.ignore — use our custom excludes only
|
|
499360
|
+
"--threads",
|
|
499361
|
+
"4"
|
|
499362
|
+
// Multi-threaded for large directories
|
|
499363
|
+
];
|
|
499364
|
+
for (const pattern of this.ignoredPatterns) {
|
|
499365
|
+
args2.push("--glob", `!${pattern}`);
|
|
499366
|
+
}
|
|
499367
|
+
args2.push(this.workspaceRoot);
|
|
499368
|
+
return new Promise((resolve34, reject) => {
|
|
499369
|
+
const results = [];
|
|
499370
|
+
const rg = spawn12(this.rgPath, args2, { stdio: ["ignore", "pipe", "ignore"] });
|
|
499371
|
+
let buffer = "";
|
|
499372
|
+
let done = false;
|
|
499373
|
+
const finish = () => {
|
|
499374
|
+
if (done) return;
|
|
499375
|
+
done = true;
|
|
499376
|
+
const lastLine = buffer.trim();
|
|
499377
|
+
if (lastLine && results.length < maxResults) {
|
|
499378
|
+
const basename25 = path85.basename(lastLine);
|
|
499379
|
+
if (matcher(basename25)) {
|
|
499380
|
+
results.push({
|
|
499381
|
+
label: basename25,
|
|
499382
|
+
path: path85.relative(this.workspaceRoot, lastLine),
|
|
499383
|
+
type: "file"
|
|
499384
|
+
});
|
|
499385
|
+
}
|
|
499386
|
+
}
|
|
499387
|
+
resolve34(results);
|
|
499388
|
+
};
|
|
499389
|
+
rg.stdout.on("data", (chunk2) => {
|
|
499390
|
+
if (done) return;
|
|
499391
|
+
buffer += chunk2.toString();
|
|
499392
|
+
const lines = buffer.split("\n");
|
|
499393
|
+
buffer = lines.pop();
|
|
499394
|
+
for (const line of lines) {
|
|
499395
|
+
const filePath = line.trim();
|
|
499396
|
+
if (!filePath) continue;
|
|
499397
|
+
const basename25 = path85.basename(filePath);
|
|
499398
|
+
if (matcher(basename25)) {
|
|
499399
|
+
results.push({
|
|
499400
|
+
label: basename25,
|
|
499401
|
+
path: path85.relative(this.workspaceRoot, filePath),
|
|
499402
|
+
type: "file"
|
|
499403
|
+
});
|
|
499404
|
+
if (results.length >= maxResults) {
|
|
499405
|
+
done = true;
|
|
499406
|
+
rg.kill();
|
|
499407
|
+
resolve34(results);
|
|
499408
|
+
return;
|
|
499409
|
+
}
|
|
499410
|
+
}
|
|
499411
|
+
}
|
|
499412
|
+
});
|
|
499413
|
+
rg.on("close", finish);
|
|
499414
|
+
rg.on("error", (err2) => {
|
|
499415
|
+
if (!done) {
|
|
499416
|
+
done = true;
|
|
499417
|
+
reject(err2);
|
|
499418
|
+
}
|
|
499419
|
+
});
|
|
499420
|
+
setTimeout(() => {
|
|
499421
|
+
if (!done) {
|
|
499422
|
+
done = true;
|
|
499423
|
+
rg.kill();
|
|
499424
|
+
resolve34(results);
|
|
499425
|
+
}
|
|
499426
|
+
}, 1e4);
|
|
499427
|
+
});
|
|
499428
|
+
}
|
|
499429
|
+
/**
|
|
499430
|
+
* Search files by name using BFS through directories (fallback when rg is unavailable).
|
|
499431
|
+
* Supports regex patterns — falls back to substring match on invalid regex.
|
|
499432
|
+
*/
|
|
499433
|
+
async searchFilesBFS(query, maxResults) {
|
|
499434
|
+
const matcher = this.buildNameMatcher(query);
|
|
499435
|
+
const results = [];
|
|
499436
|
+
const queue = ["."];
|
|
499437
|
+
const maxDirs = _FileSystemService.TREE_DEFAULTS.searchMaxDirsVisited;
|
|
499438
|
+
let queueIdx = 0;
|
|
499439
|
+
while (queueIdx < queue.length && results.length < maxResults && queueIdx < maxDirs) {
|
|
499440
|
+
const currentRelPath = queue[queueIdx++];
|
|
499441
|
+
const absolutePath = this.validatePath(currentRelPath);
|
|
499442
|
+
let entries2;
|
|
499443
|
+
try {
|
|
499444
|
+
entries2 = await fs70.readdir(absolutePath, { withFileTypes: true });
|
|
499445
|
+
} catch {
|
|
499446
|
+
continue;
|
|
499447
|
+
}
|
|
499448
|
+
for (const entry of entries2) {
|
|
499449
|
+
if (this.shouldIgnore(entry.name)) continue;
|
|
499450
|
+
if (results.length >= maxResults) break;
|
|
499451
|
+
const entryRelPath = path85.join(currentRelPath, entry.name);
|
|
499452
|
+
if (entry.isDirectory()) {
|
|
499453
|
+
queue.push(entryRelPath);
|
|
499454
|
+
if (matcher(entry.name)) {
|
|
499455
|
+
results.push({ label: entry.name, path: entryRelPath, type: "folder" });
|
|
499456
|
+
}
|
|
499457
|
+
} else if (entry.isFile() && matcher(entry.name)) {
|
|
499458
|
+
results.push({ label: entry.name, path: entryRelPath, type: "file" });
|
|
499459
|
+
}
|
|
499460
|
+
}
|
|
499461
|
+
}
|
|
499462
|
+
return results;
|
|
499463
|
+
}
|
|
499236
499464
|
/**
|
|
499237
499465
|
* Read file contents
|
|
499238
499466
|
*
|
|
@@ -499537,12 +499765,12 @@ var FileSystemService = class {
|
|
|
499537
499765
|
}
|
|
499538
499766
|
const platform22 = process.platform;
|
|
499539
499767
|
if (platform22 === "win32") {
|
|
499540
|
-
const { spawn:
|
|
499768
|
+
const { spawn: spawn18 } = await import("node:child_process");
|
|
499541
499769
|
const stats = await fs70.stat(absolutePath);
|
|
499542
499770
|
if (stats.isDirectory()) {
|
|
499543
|
-
|
|
499771
|
+
spawn18("explorer", [absolutePath], { detached: true, stdio: "ignore" });
|
|
499544
499772
|
} else {
|
|
499545
|
-
|
|
499773
|
+
spawn18("explorer", ["/select,", absolutePath], { detached: true, stdio: "ignore" });
|
|
499546
499774
|
}
|
|
499547
499775
|
return;
|
|
499548
499776
|
}
|
|
@@ -500194,6 +500422,8 @@ async function getSearchModule() {
|
|
|
500194
500422
|
var LATEST_ONLY_MESSAGE_TYPES = /* @__PURE__ */ new Set([
|
|
500195
500423
|
"file_tree_response",
|
|
500196
500424
|
// Full tree snapshot (5MB+) - only latest matters
|
|
500425
|
+
"file_tree_search_response",
|
|
500426
|
+
// Search results snapshot - only latest matters
|
|
500197
500427
|
"mcp_servers",
|
|
500198
500428
|
// Full server list - only latest matters
|
|
500199
500429
|
"slash_commands",
|
|
@@ -500802,6 +501032,7 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
500802
501032
|
});
|
|
500803
501033
|
this.setupWebSocketHandlers();
|
|
500804
501034
|
this.fileSystemService = new FileSystemService(process.cwd());
|
|
501035
|
+
this.initRipgrepForSearch();
|
|
500805
501036
|
this.fileWatcherService = new FileWatcherService(process.cwd());
|
|
500806
501037
|
this.setupFileWatcherHandlers();
|
|
500807
501038
|
this.directoryWatcherService = new DirectoryWatcherService(process.cwd(), this.fileSystemService?.getIgnoredPatterns());
|
|
@@ -501375,6 +501606,10 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501375
501606
|
});
|
|
501376
501607
|
} else if (message.type === "file_tree_request") {
|
|
501377
501608
|
this.handleFileTreeRequest(message.relativePath);
|
|
501609
|
+
} else if (message.type === "file_tree_children_request" && message.path) {
|
|
501610
|
+
this.handleFileTreeChildrenRequest(message.path);
|
|
501611
|
+
} else if (message.type === "file_tree_search_request" && message.query) {
|
|
501612
|
+
this.handleFileTreeSearchRequest(message.query);
|
|
501378
501613
|
} else if (message.type === "file_read_request" && message.path) {
|
|
501379
501614
|
this.handleFileReadRequest(message.path);
|
|
501380
501615
|
} else if (message.type === "file_write_request" && message.path && message.content !== void 0) {
|
|
@@ -501729,6 +501964,18 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501729
501964
|
});
|
|
501730
501965
|
}
|
|
501731
501966
|
// AUDITARIA_END
|
|
501967
|
+
/**
|
|
501968
|
+
* Resolve ripgrep binary path and enable rg-backed file search.
|
|
501969
|
+
* Non-blocking: if rg isn't available, search falls back to BFS.
|
|
501970
|
+
*/
|
|
501971
|
+
initRipgrepForSearch() {
|
|
501972
|
+
ensureRgPath().then((rgPath2) => {
|
|
501973
|
+
if (this.fileSystemService) {
|
|
501974
|
+
this.fileSystemService.setRgPath(rgPath2);
|
|
501975
|
+
}
|
|
501976
|
+
}).catch(() => {
|
|
501977
|
+
});
|
|
501978
|
+
}
|
|
501732
501979
|
// WEB_INTERFACE_START: File operation handler methods
|
|
501733
501980
|
/**
|
|
501734
501981
|
* Handle file tree request
|
|
@@ -501739,7 +501986,14 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501739
501986
|
return;
|
|
501740
501987
|
}
|
|
501741
501988
|
try {
|
|
501742
|
-
const
|
|
501989
|
+
const {
|
|
501990
|
+
maxDepth,
|
|
501991
|
+
maxChildren
|
|
501992
|
+
} = FileSystemService.TREE_DEFAULTS;
|
|
501993
|
+
const tree = await this.fileSystemService.getFileTree(relativePath || ".", {
|
|
501994
|
+
maxDepth,
|
|
501995
|
+
maxChildren
|
|
501996
|
+
});
|
|
501743
501997
|
this.broadcastWithSequence("file_tree_response", {
|
|
501744
501998
|
tree,
|
|
501745
501999
|
workspaceRoot: this.fileSystemService.getWorkspaceRoot()
|
|
@@ -501753,6 +502007,60 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501753
502007
|
});
|
|
501754
502008
|
}
|
|
501755
502009
|
}
|
|
502010
|
+
/**
|
|
502011
|
+
* Handle request to load children of a specific folder (lazy expand)
|
|
502012
|
+
*/
|
|
502013
|
+
async handleFileTreeChildrenRequest(relativePath) {
|
|
502014
|
+
if (!this.fileSystemService) {
|
|
502015
|
+
console.error("FileSystemService not initialized");
|
|
502016
|
+
return;
|
|
502017
|
+
}
|
|
502018
|
+
try {
|
|
502019
|
+
const {
|
|
502020
|
+
maxDepth,
|
|
502021
|
+
maxChildren
|
|
502022
|
+
} = FileSystemService.TREE_DEFAULTS;
|
|
502023
|
+
const children = await this.fileSystemService.getFileTree(relativePath, {
|
|
502024
|
+
maxDepth,
|
|
502025
|
+
maxChildren
|
|
502026
|
+
});
|
|
502027
|
+
this.broadcastWithSequence("file_tree_children_response", {
|
|
502028
|
+
path: relativePath,
|
|
502029
|
+
children,
|
|
502030
|
+
workspaceRoot: this.fileSystemService.getWorkspaceRoot()
|
|
502031
|
+
});
|
|
502032
|
+
} catch (error40) {
|
|
502033
|
+
console.error("Error reading folder children:", error40);
|
|
502034
|
+
this.broadcastWithSequence("file_tree_children_response", {
|
|
502035
|
+
path: relativePath,
|
|
502036
|
+
children: [],
|
|
502037
|
+
error: error40.message
|
|
502038
|
+
});
|
|
502039
|
+
}
|
|
502040
|
+
}
|
|
502041
|
+
/**
|
|
502042
|
+
* Handle server-side file search request
|
|
502043
|
+
*/
|
|
502044
|
+
async handleFileTreeSearchRequest(query) {
|
|
502045
|
+
if (!this.fileSystemService) {
|
|
502046
|
+
console.error("FileSystemService not initialized");
|
|
502047
|
+
return;
|
|
502048
|
+
}
|
|
502049
|
+
try {
|
|
502050
|
+
const results = await this.fileSystemService.searchFiles(query);
|
|
502051
|
+
this.broadcastWithSequence("file_tree_search_response", {
|
|
502052
|
+
query,
|
|
502053
|
+
results
|
|
502054
|
+
});
|
|
502055
|
+
} catch (error40) {
|
|
502056
|
+
console.error("Error searching files:", error40);
|
|
502057
|
+
this.broadcastWithSequence("file_tree_search_response", {
|
|
502058
|
+
query,
|
|
502059
|
+
results: [],
|
|
502060
|
+
error: error40.message
|
|
502061
|
+
});
|
|
502062
|
+
}
|
|
502063
|
+
}
|
|
501756
502064
|
/**
|
|
501757
502065
|
* Handle file read request
|
|
501758
502066
|
*/
|
|
@@ -501815,7 +502123,10 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501815
502123
|
path: path154,
|
|
501816
502124
|
message: t("File created successfully")
|
|
501817
502125
|
});
|
|
501818
|
-
|
|
502126
|
+
const parentDir = path154.includes("/") || path154.includes("\\") ? path154.substring(0, Math.max(path154.lastIndexOf("/"), path154.lastIndexOf("\\"))) : ".";
|
|
502127
|
+
this.broadcastWithSequence("directory_change_notification", {
|
|
502128
|
+
path: parentDir || "."
|
|
502129
|
+
});
|
|
501819
502130
|
} catch (error40) {
|
|
501820
502131
|
console.error("Error creating file:", error40);
|
|
501821
502132
|
this.broadcastWithSequence("file_operation_error", {
|
|
@@ -501840,7 +502151,10 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501840
502151
|
path: path154,
|
|
501841
502152
|
message: t("File deleted successfully")
|
|
501842
502153
|
});
|
|
501843
|
-
|
|
502154
|
+
const parentDir = path154.includes("/") || path154.includes("\\") ? path154.substring(0, Math.max(path154.lastIndexOf("/"), path154.lastIndexOf("\\"))) : ".";
|
|
502155
|
+
this.broadcastWithSequence("directory_change_notification", {
|
|
502156
|
+
path: parentDir || "."
|
|
502157
|
+
});
|
|
501844
502158
|
} catch (error40) {
|
|
501845
502159
|
console.error("Error deleting file:", error40);
|
|
501846
502160
|
this.broadcastWithSequence("file_operation_error", {
|
|
@@ -501866,7 +502180,20 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
501866
502180
|
newPath,
|
|
501867
502181
|
message: t("File renamed successfully")
|
|
501868
502182
|
});
|
|
501869
|
-
|
|
502183
|
+
const getParent = (p) => {
|
|
502184
|
+
const idx = Math.max(p.lastIndexOf("/"), p.lastIndexOf("\\"));
|
|
502185
|
+
return idx > 0 ? p.substring(0, idx) : ".";
|
|
502186
|
+
};
|
|
502187
|
+
const oldParent = getParent(oldPath);
|
|
502188
|
+
const newParent = getParent(newPath);
|
|
502189
|
+
this.broadcastWithSequence("directory_change_notification", {
|
|
502190
|
+
path: oldParent
|
|
502191
|
+
});
|
|
502192
|
+
if (newParent !== oldParent) {
|
|
502193
|
+
this.broadcastWithSequence("directory_change_notification", {
|
|
502194
|
+
path: newParent
|
|
502195
|
+
});
|
|
502196
|
+
}
|
|
501870
502197
|
} catch (error40) {
|
|
501871
502198
|
console.error("Error renaming file:", error40);
|
|
501872
502199
|
this.broadcastWithSequence("file_operation_error", {
|
|
@@ -502172,8 +502499,12 @@ var WebInterfaceService = class extends EventEmitter16 {
|
|
|
502172
502499
|
if (!this.directoryWatcherService) {
|
|
502173
502500
|
return;
|
|
502174
502501
|
}
|
|
502175
|
-
this.directoryWatcherService.on("directory-change", (
|
|
502176
|
-
|
|
502502
|
+
this.directoryWatcherService.on("directory-change", (event) => {
|
|
502503
|
+
const changedPath = event?.path || event?.relativePath || ".";
|
|
502504
|
+
const parentDir = changedPath.includes("/") || changedPath.includes("\\") ? changedPath.substring(0, Math.max(changedPath.lastIndexOf("/"), changedPath.lastIndexOf("\\"))) : ".";
|
|
502505
|
+
this.broadcastWithSequence("directory_change_notification", {
|
|
502506
|
+
path: parentDir || "."
|
|
502507
|
+
});
|
|
502177
502508
|
});
|
|
502178
502509
|
this.directoryWatcherService.on("error", (error40) => {
|
|
502179
502510
|
console.error("Directory watcher error:", error40);
|
|
@@ -502740,7 +503071,7 @@ function useSubmitQueryRegistration() {
|
|
|
502740
503071
|
}
|
|
502741
503072
|
|
|
502742
503073
|
// packages/cli/src/utils/browserUtils.ts
|
|
502743
|
-
import { spawn as
|
|
503074
|
+
import { spawn as spawn13 } from "node:child_process";
|
|
502744
503075
|
import { platform as platform13 } from "node:os";
|
|
502745
503076
|
async function openBrowser(url3) {
|
|
502746
503077
|
return new Promise((resolve34, reject) => {
|
|
@@ -502761,7 +503092,7 @@ async function openBrowser(url3) {
|
|
|
502761
503092
|
args2 = [url3];
|
|
502762
503093
|
break;
|
|
502763
503094
|
}
|
|
502764
|
-
const child =
|
|
503095
|
+
const child = spawn13(command2, args2, {
|
|
502765
503096
|
detached: true,
|
|
502766
503097
|
stdio: "ignore"
|
|
502767
503098
|
});
|
|
@@ -512429,7 +512760,7 @@ import * as path98 from "node:path";
|
|
|
512429
512760
|
init_dist8();
|
|
512430
512761
|
import * as fs81 from "node:fs/promises";
|
|
512431
512762
|
import { createWriteStream as createWriteStream6, existsSync as existsSync23, statSync as statSync5 } from "node:fs";
|
|
512432
|
-
import { execSync as execSync4, spawn as
|
|
512763
|
+
import { execSync as execSync4, spawn as spawn14 } from "node:child_process";
|
|
512433
512764
|
import * as path97 from "node:path";
|
|
512434
512765
|
var IMAGE_EXTENSIONS = [
|
|
512435
512766
|
".png",
|
|
@@ -512461,7 +512792,7 @@ function getUserLinuxClipboardTool() {
|
|
|
512461
512792
|
}
|
|
512462
512793
|
async function saveFromCommand(command2, args2, destination) {
|
|
512463
512794
|
return new Promise((resolve34) => {
|
|
512464
|
-
const child =
|
|
512795
|
+
const child = spawn14(command2, args2);
|
|
512465
512796
|
const fileStream = createWriteStream6(destination);
|
|
512466
512797
|
let resolved = false;
|
|
512467
512798
|
const safeResolve = (value) => {
|
|
@@ -535590,7 +535921,7 @@ var WarningMessage = ({ text }) => {
|
|
|
535590
535921
|
init_dist8();
|
|
535591
535922
|
|
|
535592
535923
|
// packages/cli/src/generated/git-commit.ts
|
|
535593
|
-
var GIT_COMMIT_INFO2 = "
|
|
535924
|
+
var GIT_COMMIT_INFO2 = "f9d3697df";
|
|
535594
535925
|
|
|
535595
535926
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
535596
535927
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -570127,8 +570458,8 @@ import { EventEmitter as EventEmitter17 } from "node:events";
|
|
|
570127
570458
|
var updateEventEmitter = new EventEmitter17();
|
|
570128
570459
|
|
|
570129
570460
|
// packages/cli/src/utils/spawnWrapper.ts
|
|
570130
|
-
import { spawn as
|
|
570131
|
-
var spawnWrapper =
|
|
570461
|
+
import { spawn as spawn15 } from "node:child_process";
|
|
570462
|
+
var spawnWrapper = spawn15;
|
|
570132
570463
|
|
|
570133
570464
|
// packages/cli/src/utils/handleAutoUpdate.ts
|
|
570134
570465
|
function handleAutoUpdate(info2, settings, projectRoot, spawnFn = spawnWrapper) {
|
|
@@ -584054,7 +584385,7 @@ import dns from "node:dns";
|
|
|
584054
584385
|
// packages/cli/src/utils/sandbox.ts
|
|
584055
584386
|
var import_shell_quote5 = __toESM(require_shell_quote(), 1);
|
|
584056
584387
|
init_dist8();
|
|
584057
|
-
import { exec as exec6, execSync as execSync7, spawn as
|
|
584388
|
+
import { exec as exec6, execSync as execSync7, spawn as spawn16 } from "node:child_process";
|
|
584058
584389
|
import path151 from "node:path";
|
|
584059
584390
|
import fs128 from "node:fs";
|
|
584060
584391
|
import os36 from "node:os";
|
|
@@ -584306,7 +584637,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
584306
584637
|
sandboxEnv["NO_PROXY"] = noProxy;
|
|
584307
584638
|
sandboxEnv["no_proxy"] = noProxy;
|
|
584308
584639
|
}
|
|
584309
|
-
proxyProcess2 =
|
|
584640
|
+
proxyProcess2 = spawn16(proxyCommand2, {
|
|
584310
584641
|
stdio: ["ignore", "pipe", "pipe"],
|
|
584311
584642
|
shell: true,
|
|
584312
584643
|
detached: true
|
|
@@ -584340,7 +584671,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
584340
584671
|
);
|
|
584341
584672
|
}
|
|
584342
584673
|
process.stdin.pause();
|
|
584343
|
-
sandboxProcess2 =
|
|
584674
|
+
sandboxProcess2 = spawn16(config2.command, args3, {
|
|
584344
584675
|
stdio: "inherit"
|
|
584345
584676
|
});
|
|
584346
584677
|
return await new Promise((resolve34, reject) => {
|
|
@@ -584664,7 +584995,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
584664
584995
|
let sandboxProcess = void 0;
|
|
584665
584996
|
if (proxyCommand) {
|
|
584666
584997
|
const proxyContainerCommand = `${config2.command} run --rm --init ${userFlag} --name ${SANDBOX_PROXY_NAME} --network ${SANDBOX_PROXY_NAME} -p 8877:8877 -v ${process.cwd()}:${workdir} --workdir ${workdir} ${image3} ${proxyCommand}`;
|
|
584667
|
-
proxyProcess =
|
|
584998
|
+
proxyProcess = spawn16(proxyContainerCommand, {
|
|
584668
584999
|
stdio: ["ignore", "pipe", "pipe"],
|
|
584669
585000
|
shell: true,
|
|
584670
585001
|
detached: true
|
|
@@ -584699,7 +585030,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
584699
585030
|
);
|
|
584700
585031
|
}
|
|
584701
585032
|
process.stdin.pause();
|
|
584702
|
-
sandboxProcess =
|
|
585033
|
+
sandboxProcess = spawn16(config2.command, args2, {
|
|
584703
585034
|
stdio: "inherit"
|
|
584704
585035
|
});
|
|
584705
585036
|
return await new Promise((resolve34, reject) => {
|
|
@@ -584724,7 +585055,7 @@ async function start_sandbox(config2, nodeArgs = [], cliConfig, cliArgs = []) {
|
|
|
584724
585055
|
async function imageExists(sandbox, image3) {
|
|
584725
585056
|
return new Promise((resolve34) => {
|
|
584726
585057
|
const args2 = ["images", "-q", image3];
|
|
584727
|
-
const checkProcess =
|
|
585058
|
+
const checkProcess = spawn16(sandbox, args2);
|
|
584728
585059
|
let stdoutData = "";
|
|
584729
585060
|
if (checkProcess.stdout) {
|
|
584730
585061
|
checkProcess.stdout.on("data", (data) => {
|
|
@@ -584748,7 +585079,7 @@ async function pullImage(sandbox, image3, cliConfig) {
|
|
|
584748
585079
|
debugLogger.debug(`Attempting to pull image ${image3} using ${sandbox}...`);
|
|
584749
585080
|
return new Promise((resolve34) => {
|
|
584750
585081
|
const args2 = ["pull", image3];
|
|
584751
|
-
const pullProcess =
|
|
585082
|
+
const pullProcess = spawn16(sandbox, args2, { stdio: "pipe" });
|
|
584752
585083
|
let stderrData = "";
|
|
584753
585084
|
const onStdoutData = (data) => {
|
|
584754
585085
|
if (cliConfig?.getDebugMode() || process.env["DEBUG"]) {
|
|
@@ -587909,7 +588240,7 @@ async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, n
|
|
|
587909
588240
|
}
|
|
587910
588241
|
|
|
587911
588242
|
// packages/cli/src/utils/relaunch.ts
|
|
587912
|
-
import { spawn as
|
|
588243
|
+
import { spawn as spawn17 } from "node:child_process";
|
|
587913
588244
|
init_dist8();
|
|
587914
588245
|
async function relaunchOnExitCode(runner) {
|
|
587915
588246
|
while (true) {
|
|
@@ -587947,7 +588278,7 @@ async function relaunchAppInChildProcess(additionalNodeArgs, additionalScriptArg
|
|
|
587947
588278
|
];
|
|
587948
588279
|
const newEnv = { ...process.env, GEMINI_CLI_NO_RELAUNCH: "true" };
|
|
587949
588280
|
process.stdin.pause();
|
|
587950
|
-
const child =
|
|
588281
|
+
const child = spawn17(process.execPath, nodeArgs, {
|
|
587951
588282
|
stdio: ["inherit", "inherit", "inherit", "ipc"],
|
|
587952
588283
|
env: newEnv
|
|
587953
588284
|
});
|