@prestyj/boss 4.3.160 → 4.3.162

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.
@@ -7348,21 +7348,21 @@ var require_cross_spawn = __commonJS({
7348
7348
  var cp = __require("child_process");
7349
7349
  var parse3 = require_parse();
7350
7350
  var enoent = require_enoent();
7351
- function spawn9(command, args, options2) {
7351
+ function spawn10(command, args, options2) {
7352
7352
  const parsed = parse3(command, args, options2);
7353
7353
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
7354
7354
  enoent.hookChildProcess(spawned, parsed);
7355
7355
  return spawned;
7356
7356
  }
7357
- function spawnSync2(command, args, options2) {
7357
+ function spawnSync3(command, args, options2) {
7358
7358
  const parsed = parse3(command, args, options2);
7359
7359
  const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
7360
7360
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
7361
7361
  return result;
7362
7362
  }
7363
- module.exports = spawn9;
7364
- module.exports.spawn = spawn9;
7365
- module.exports.sync = spawnSync2;
7363
+ module.exports = spawn10;
7364
+ module.exports.spawn = spawn10;
7365
+ module.exports.sync = spawnSync3;
7366
7366
  module.exports._parse = parse3;
7367
7367
  module.exports._enoent = enoent;
7368
7368
  }
@@ -65162,7 +65162,7 @@ init_esm_shims();
65162
65162
 
65163
65163
  // ../cli/dist/core/process-manager.js
65164
65164
  init_esm_shims();
65165
- import { spawn } from "child_process";
65165
+ import { spawn, spawnSync } from "child_process";
65166
65166
  import fs from "fs";
65167
65167
  import fsp from "fs/promises";
65168
65168
  import path3 from "path";
@@ -65182,11 +65182,77 @@ function killProcessTree(pid) {
65182
65182
  }
65183
65183
  }
65184
65184
 
65185
+ // ../cli/dist/tools/safe-env.js
65186
+ init_esm_shims();
65187
+ var ENV_ALLOWLIST = /* @__PURE__ */ new Set([
65188
+ "PATH",
65189
+ "HOME",
65190
+ "USER",
65191
+ "LOGNAME",
65192
+ "SHELL",
65193
+ "LANG",
65194
+ "LC_ALL",
65195
+ "LC_CTYPE",
65196
+ "TMPDIR",
65197
+ "XDG_CONFIG_HOME",
65198
+ "XDG_DATA_HOME",
65199
+ "XDG_CACHE_HOME",
65200
+ "XDG_RUNTIME_DIR",
65201
+ "EDITOR",
65202
+ "VISUAL",
65203
+ "PAGER",
65204
+ "CLICOLOR",
65205
+ "CLICOLOR_FORCE",
65206
+ "NO_COLOR",
65207
+ "FORCE_COLOR",
65208
+ // Development toolchains
65209
+ "NODE_PATH",
65210
+ "NVM_DIR",
65211
+ "NPM_CONFIG_PREFIX",
65212
+ "PNPM_HOME",
65213
+ "GOPATH",
65214
+ "GOROOT",
65215
+ "CARGO_HOME",
65216
+ "RUSTUP_HOME",
65217
+ "PYENV_ROOT",
65218
+ "VIRTUAL_ENV",
65219
+ "CONDA_DEFAULT_ENV",
65220
+ "CONDA_PREFIX",
65221
+ "JAVA_HOME",
65222
+ "ANDROID_HOME",
65223
+ "ANDROID_SDK_ROOT",
65224
+ "RUBY_VERSION",
65225
+ "GEM_HOME",
65226
+ "RBENV_ROOT"
65227
+ ]);
65228
+ function getSafeToolEnv(sourceEnv = process.env) {
65229
+ const env2 = { TERM: "dumb", EZ_CODER: "true" };
65230
+ for (const key of ENV_ALLOWLIST) {
65231
+ const value = sourceEnv[key];
65232
+ if (value)
65233
+ env2[key] = value;
65234
+ }
65235
+ return env2;
65236
+ }
65237
+
65185
65238
  // ../cli/dist/core/process-manager.js
65186
65239
  var BG_DIR = path3.join(os2.homedir(), ".ezcoder", "bg");
65240
+ function stopProcessTree(pid, ops = {}) {
65241
+ if ((ops.platform ?? process.platform) === "win32") {
65242
+ (ops.spawnSync ?? spawnSync)("taskkill", ["/pid", String(pid), "/T", "/F"], {
65243
+ stdio: "ignore"
65244
+ });
65245
+ return;
65246
+ }
65247
+ (ops.killProcessTree ?? killProcessTree)(pid);
65248
+ }
65187
65249
  var ProcessManager = class {
65250
+ ops;
65188
65251
  processes = /* @__PURE__ */ new Map();
65189
65252
  children = /* @__PURE__ */ new Map();
65253
+ constructor(ops = {}) {
65254
+ this.ops = ops;
65255
+ }
65190
65256
  async start(command, cwd2) {
65191
65257
  await fsp.mkdir(BG_DIR, { recursive: true });
65192
65258
  const id2 = crypto2.randomUUID().slice(0, 8);
@@ -65196,7 +65262,7 @@ var ProcessManager = class {
65196
65262
  cwd: cwd2,
65197
65263
  detached: true,
65198
65264
  stdio: ["ignore", fd3, fd3],
65199
- env: { ...process.env, TERM: "dumb" }
65265
+ env: getSafeToolEnv()
65200
65266
  });
65201
65267
  fs.closeSync(fd3);
65202
65268
  const pid = child.pid;
@@ -65255,10 +65321,10 @@ var ProcessManager = class {
65255
65321
  return `Process ${id2} already exited (code ${proc.exitCode})`;
65256
65322
  }
65257
65323
  try {
65258
- process.kill(-proc.pid, "SIGTERM");
65324
+ (this.ops.kill ?? process.kill)(-proc.pid, "SIGTERM");
65259
65325
  } catch {
65260
65326
  try {
65261
- process.kill(proc.pid, "SIGTERM");
65327
+ (this.ops.kill ?? process.kill)(proc.pid, "SIGTERM");
65262
65328
  } catch {
65263
65329
  return `Process ${id2} already exited`;
65264
65330
  }
@@ -65271,7 +65337,7 @@ var ProcessManager = class {
65271
65337
  });
65272
65338
  });
65273
65339
  if (!exited) {
65274
- killProcessTree(proc.pid);
65340
+ stopProcessTree(proc.pid, this.ops);
65275
65341
  }
65276
65342
  return `Process ${id2} stopped`;
65277
65343
  }
@@ -65287,7 +65353,7 @@ var ProcessManager = class {
65287
65353
  shutdownAll() {
65288
65354
  for (const [id2, proc] of this.processes) {
65289
65355
  if (this.children.has(id2)) {
65290
- killProcessTree(proc.pid);
65356
+ stopProcessTree(proc.pid, this.ops);
65291
65357
  proc.exitCode = proc.exitCode ?? 1;
65292
65358
  this.children.delete(id2);
65293
65359
  }
@@ -66826,55 +66892,6 @@ ${failures.length} ${noun} skipped \u2014 re-issue ONLY these (the rest are alre
66826
66892
  init_esm_shims();
66827
66893
  var DEFAULT_TIMEOUT = 12e4;
66828
66894
  var MAX_OUTPUT_BYTES = 10 * 1024 * 1024;
66829
- var ENV_ALLOWLIST = /* @__PURE__ */ new Set([
66830
- "PATH",
66831
- "HOME",
66832
- "USER",
66833
- "LOGNAME",
66834
- "SHELL",
66835
- "LANG",
66836
- "LC_ALL",
66837
- "LC_CTYPE",
66838
- "TMPDIR",
66839
- "XDG_CONFIG_HOME",
66840
- "XDG_DATA_HOME",
66841
- "XDG_CACHE_HOME",
66842
- "XDG_RUNTIME_DIR",
66843
- "EDITOR",
66844
- "VISUAL",
66845
- "PAGER",
66846
- "CLICOLOR",
66847
- "CLICOLOR_FORCE",
66848
- "NO_COLOR",
66849
- "FORCE_COLOR",
66850
- // Development toolchains
66851
- "NODE_PATH",
66852
- "NVM_DIR",
66853
- "NPM_CONFIG_PREFIX",
66854
- "PNPM_HOME",
66855
- "GOPATH",
66856
- "GOROOT",
66857
- "CARGO_HOME",
66858
- "RUSTUP_HOME",
66859
- "PYENV_ROOT",
66860
- "VIRTUAL_ENV",
66861
- "CONDA_DEFAULT_ENV",
66862
- "CONDA_PREFIX",
66863
- "JAVA_HOME",
66864
- "ANDROID_HOME",
66865
- "ANDROID_SDK_ROOT",
66866
- "RUBY_VERSION",
66867
- "GEM_HOME",
66868
- "RBENV_ROOT"
66869
- ]);
66870
- function getSafeEnv() {
66871
- const env2 = { TERM: "dumb", EZ_CODER: "true" };
66872
- for (const key of ENV_ALLOWLIST) {
66873
- if (process.env[key])
66874
- env2[key] = process.env[key];
66875
- }
66876
- return env2;
66877
- }
66878
66895
  var BashParams = external_exports.object({
66879
66896
  command: external_exports.string().describe("The bash command to execute"),
66880
66897
  timeout: external_exports.number().int().min(1e3).optional().describe("Timeout in milliseconds (default: 120000)"),
@@ -66904,7 +66921,7 @@ Use task_output with id="${result.id}" to read output.`;
66904
66921
  cwd: cwd2,
66905
66922
  detached: true,
66906
66923
  stdio: ["ignore", "pipe", "pipe"],
66907
- env: getSafeEnv()
66924
+ env: getSafeToolEnv()
66908
66925
  });
66909
66926
  const chunks = [];
66910
66927
  let totalBytes = 0;
@@ -67043,6 +67060,7 @@ var GrepParams = external_exports.object({
67043
67060
  var DEFAULT_MAX_RESULTS = 50;
67044
67061
  var MAX_LINE_LENGTH = 500;
67045
67062
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
67063
+ var MAX_CANDIDATE_FILES = 1e4;
67046
67064
  function createGrepTool(cwd2, ops = localOperations) {
67047
67065
  return {
67048
67066
  name: "grep",
@@ -67071,12 +67089,22 @@ function createGrepTool(cwd2, ops = localOperations) {
67071
67089
  onlyFiles: true,
67072
67090
  ignore: ["**/node_modules/**", "**/.git/**"],
67073
67091
  suppressErrors: true,
67074
- followSymbolicLinks: false
67092
+ followSymbolicLinks: false,
67093
+ objectMode: true,
67094
+ stats: false
67075
67095
  });
67076
67096
  const results = [];
67077
- for (const entry of entries) {
67097
+ let scannedCandidates = 0;
67098
+ let candidateLimitHit = false;
67099
+ for (const item of entries) {
67078
67100
  if (results.length >= maxResults)
67079
67101
  break;
67102
+ if (scannedCandidates >= MAX_CANDIDATE_FILES) {
67103
+ candidateLimitHit = true;
67104
+ break;
67105
+ }
67106
+ scannedCandidates += 1;
67107
+ const entry = typeof item === "string" ? item : item.path;
67080
67108
  const ext = path11.extname(entry).toLowerCase();
67081
67109
  if (BINARY_EXTENSIONS.has(ext))
67082
67110
  continue;
@@ -67084,7 +67112,7 @@ function createGrepTool(cwd2, ops = localOperations) {
67084
67112
  const fileResults = await searchFile(filePath, regex2, cwd2, maxResults - results.length, ops);
67085
67113
  results.push(...fileResults);
67086
67114
  }
67087
- return formatResults(results, maxResults);
67115
+ return formatResults(results, maxResults, candidateLimitHit);
67088
67116
  }
67089
67117
  };
67090
67118
  }
@@ -67129,9 +67157,10 @@ async function searchFile(filePath, regex2, cwd2, maxResults, ops) {
67129
67157
  }
67130
67158
  return results;
67131
67159
  }
67132
- function formatResults(results, maxResults) {
67133
- if (results.length === 0)
67134
- return "No matches found.";
67160
+ function formatResults(results, maxResults, candidateLimitHit = false) {
67161
+ if (results.length === 0) {
67162
+ return candidateLimitHit ? `No matches found. [Stopped after scanning ${MAX_CANDIDATE_FILES} candidate files]` : "No matches found.";
67163
+ }
67135
67164
  let output = results.join("\n");
67136
67165
  if (results.length >= maxResults) {
67137
67166
  output += `
@@ -67141,6 +67170,10 @@ function formatResults(results, maxResults) {
67141
67170
  output += `
67142
67171
 
67143
67172
  ${results.length} match(es) found`;
67173
+ }
67174
+ if (candidateLimitHit) {
67175
+ output += `
67176
+ [Stopped after scanning ${MAX_CANDIDATE_FILES} candidate files]`;
67144
67177
  }
67145
67178
  return output;
67146
67179
  }
@@ -67606,8 +67639,19 @@ function createWebFetchTool() {
67606
67639
  "User-Agent": "Mozilla/5.0 (compatible; EZCoder/1.0)",
67607
67640
  Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
67608
67641
  },
67642
+ redirect: "manual",
67609
67643
  signal: AbortSignal.timeout(3e4)
67610
67644
  });
67645
+ if (response.status >= 300 && response.status < 400) {
67646
+ const location = response.headers.get("location");
67647
+ if (!location)
67648
+ return `Error: HTTP ${response.status} redirect without Location header`;
67649
+ const redirectUrl = new URL(location, args.url).toString();
67650
+ if (isBlockedUrl(redirectUrl)) {
67651
+ return "Error: Redirect blocked \u2014 target URL is private/internal or unsupported.";
67652
+ }
67653
+ return `Error: Redirects are not followed automatically. Safe redirect target: ${redirectUrl}`;
67654
+ }
67611
67655
  if (!response.ok) {
67612
67656
  return `Error: HTTP ${response.status} ${response.statusText}`;
67613
67657
  }
@@ -80475,6 +80519,8 @@ function unquoteGitPath(filePath) {
80475
80519
  }
80476
80520
  }
80477
80521
  async function listCandidateFiles(cwd2) {
80522
+ if (isUnboundedRepoMapRoot(cwd2))
80523
+ return [];
80478
80524
  const ignorePatterns = await loadGitignore2(cwd2);
80479
80525
  const ig = (0, import_ignore.default)().add(ignorePatterns);
80480
80526
  const entries = await (0, import_fast_glob.default)("**/*", {
@@ -80487,6 +80533,11 @@ async function listCandidateFiles(cwd2) {
80487
80533
  });
80488
80534
  return entries.filter((entry) => !BINARY_EXTENSIONS2.has(path27.extname(entry).toLowerCase())).filter((entry) => !ig.ignores(entry)).sort((a, b) => a.localeCompare(b));
80489
80535
  }
80536
+ function isUnboundedRepoMapRoot(cwd2) {
80537
+ const resolvedCwd = path27.resolve(cwd2);
80538
+ const home = process.env.HOME;
80539
+ return resolvedCwd === path27.parse(resolvedCwd).root || !!home && resolvedCwd === path27.resolve(home);
80540
+ }
80490
80541
  async function loadGitignore2(cwd2) {
80491
80542
  const content = await fs26.readFile(path27.join(cwd2, ".gitignore"), "utf-8").catch(() => "");
80492
80543
  return content.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
@@ -80540,7 +80591,7 @@ function extractSignatures(content, maxSignatures) {
80540
80591
  return unique(signatures).slice(0, maxSignatures);
80541
80592
  }
80542
80593
  function stripTemplateLiterals(content) {
80543
- return content.replace(/`(?:\\.|[^`])*`/gs, "``");
80594
+ return content.replace(/`(?:\\.|[^`\\])*`/gs, "``");
80544
80595
  }
80545
80596
  function unique(values) {
80546
80597
  return [...new Set(values.filter((value) => value.length > 0))];
@@ -90527,7 +90578,7 @@ var taskBarStore = createStore({
90527
90578
  import { createHash as createHash4 } from "crypto";
90528
90579
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
90529
90580
  import { homedir as homedir6 } from "os";
90530
- import { join as join8 } from "path";
90581
+ import { join as join9 } from "path";
90531
90582
 
90532
90583
  // ../cli/dist/utils/sound.js
90533
90584
  init_esm_shims();
@@ -96547,7 +96598,7 @@ var SIDE_BY_SIDE_MIN5 = LOGO_WIDTH4 + GAP5.length + 20;
96547
96598
  init_esm_shims();
96548
96599
  var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
96549
96600
  var import_react70 = __toESM(require_react(), 1);
96550
- import { spawnSync } from "child_process";
96601
+ import { spawnSync as spawnSync2 } from "child_process";
96551
96602
  import { createRequire } from "module";
96552
96603
  var GAP6 = " ";
96553
96604
  var LOGO_WIDTH5 = 11;
@@ -96606,13 +96657,20 @@ var HISTORY_PATH = path31.join(os10.homedir(), ".ezcoder", "setup-history.json")
96606
96657
  // ../cli/dist/ui/live-item-flush.js
96607
96658
  init_esm_shims();
96608
96659
 
96609
- // ../cli/dist/core/goal-worker.js
96660
+ // ../cli/dist/core/goal-verifier.js
96610
96661
  init_esm_shims();
96611
96662
  import { spawn as spawn7 } from "child_process";
96663
+ import { mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
96664
+ import { join as join7 } from "path";
96665
+ var DEFAULT_GOAL_VERIFIER_TIMEOUT_MS = 10 * 60 * 1e3;
96666
+
96667
+ // ../cli/dist/core/goal-worker.js
96668
+ init_esm_shims();
96669
+ import { spawn as spawn8 } from "child_process";
96612
96670
  import { createInterface as createInterface3 } from "readline";
96613
96671
  import { createWriteStream, existsSync as existsSync6 } from "fs";
96614
- import { mkdir as mkdir4 } from "fs/promises";
96615
- import { join as join7 } from "path";
96672
+ import { mkdir as mkdir5 } from "fs/promises";
96673
+ import { join as join8 } from "path";
96616
96674
  import { randomUUID as randomUUID5 } from "crypto";
96617
96675
 
96618
96676
  // ../cli/dist/ui/goal-events.js
@@ -98510,7 +98568,7 @@ function createTaskTools(deps) {
98510
98568
 
98511
98569
  // src/audio.ts
98512
98570
  init_esm_shims();
98513
- import { spawn as spawn8, execFileSync as execFileSync3 } from "child_process";
98571
+ import { spawn as spawn9, execFileSync as execFileSync3 } from "child_process";
98514
98572
  import { fileURLToPath as fileURLToPath3 } from "url";
98515
98573
  import path35 from "path";
98516
98574
  import fs35 from "fs";
@@ -98585,7 +98643,7 @@ function trySpawn(cmd, args) {
98585
98643
  return new Promise((resolve4) => {
98586
98644
  let resolved = false;
98587
98645
  try {
98588
- const child = spawn8(cmd, args, {
98646
+ const child = spawn9(cmd, args, {
98589
98647
  detached: true,
98590
98648
  stdio: "ignore"
98591
98649
  });
@@ -98644,7 +98702,7 @@ async function tryPlayOnWindowsHost(file2) {
98644
98702
  return new Promise((resolve4) => {
98645
98703
  let resolved2 = false;
98646
98704
  try {
98647
- const child = spawn8(
98705
+ const child = spawn9(
98648
98706
  "powershell.exe",
98649
98707
  ["-NoProfile", "-WindowStyle", "Hidden", "-Command", script],
98650
98708
  {
@@ -99789,4 +99847,4 @@ react/cjs/react-jsx-runtime.development.js:
99789
99847
  * LICENSE file in the root directory of this source tree.
99790
99848
  *)
99791
99849
  */
99792
- //# sourceMappingURL=chunk-PGC5XQTC.js.map
99850
+ //# sourceMappingURL=chunk-A7L3ZRW2.js.map