@kenkaiiii/gg-boss 4.8.6 → 4.9.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.
@@ -3225,8 +3225,8 @@ var require_utils = __commonJS({
3225
3225
  }
3226
3226
  return ind;
3227
3227
  }
3228
- function removeDotSegments(path43) {
3229
- let input = path43;
3228
+ function removeDotSegments(path45) {
3229
+ let input = path45;
3230
3230
  const output = [];
3231
3231
  let nextSlash = -1;
3232
3232
  let len = 0;
@@ -3426,8 +3426,8 @@ var require_schemes = __commonJS({
3426
3426
  wsComponent.secure = void 0;
3427
3427
  }
3428
3428
  if (wsComponent.resourceName) {
3429
- const [path43, query] = wsComponent.resourceName.split("?");
3430
- wsComponent.path = path43 && path43 !== "/" ? path43 : void 0;
3429
+ const [path45, query] = wsComponent.resourceName.split("?");
3430
+ wsComponent.path = path45 && path45 !== "/" ? path45 : void 0;
3431
3431
  wsComponent.query = query;
3432
3432
  wsComponent.resourceName = void 0;
3433
3433
  }
@@ -6835,12 +6835,12 @@ var require_dist = __commonJS({
6835
6835
  throw new Error(`Unknown format "${name}"`);
6836
6836
  return f;
6837
6837
  };
6838
- function addFormats(ajv, list, fs37, exportName) {
6838
+ function addFormats(ajv, list, fs38, exportName) {
6839
6839
  var _a6;
6840
6840
  var _b;
6841
6841
  (_a6 = (_b = ajv.opts.code).formats) !== null && _a6 !== void 0 ? _a6 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6842
6842
  for (const f of list)
6843
- ajv.addFormat(f, fs37[f]);
6843
+ ajv.addFormat(f, fs38[f]);
6844
6844
  }
6845
6845
  module.exports = exports = formatsPlugin;
6846
6846
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6855,8 +6855,8 @@ var require_windows = __commonJS({
6855
6855
  init_esm_shims();
6856
6856
  module.exports = isexe;
6857
6857
  isexe.sync = sync;
6858
- var fs37 = __require("fs");
6859
- function checkPathExt(path43, options) {
6858
+ var fs38 = __require("fs");
6859
+ function checkPathExt(path45, options) {
6860
6860
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
6861
6861
  if (!pathext) {
6862
6862
  return true;
@@ -6867,25 +6867,25 @@ var require_windows = __commonJS({
6867
6867
  }
6868
6868
  for (var i = 0; i < pathext.length; i++) {
6869
6869
  var p = pathext[i].toLowerCase();
6870
- if (p && path43.substr(-p.length).toLowerCase() === p) {
6870
+ if (p && path45.substr(-p.length).toLowerCase() === p) {
6871
6871
  return true;
6872
6872
  }
6873
6873
  }
6874
6874
  return false;
6875
6875
  }
6876
- function checkStat(stat, path43, options) {
6876
+ function checkStat(stat, path45, options) {
6877
6877
  if (!stat.isSymbolicLink() && !stat.isFile()) {
6878
6878
  return false;
6879
6879
  }
6880
- return checkPathExt(path43, options);
6880
+ return checkPathExt(path45, options);
6881
6881
  }
6882
- function isexe(path43, options, cb) {
6883
- fs37.stat(path43, function(er, stat) {
6884
- cb(er, er ? false : checkStat(stat, path43, options));
6882
+ function isexe(path45, options, cb) {
6883
+ fs38.stat(path45, function(er, stat) {
6884
+ cb(er, er ? false : checkStat(stat, path45, options));
6885
6885
  });
6886
6886
  }
6887
- function sync(path43, options) {
6888
- return checkStat(fs37.statSync(path43), path43, options);
6887
+ function sync(path45, options) {
6888
+ return checkStat(fs38.statSync(path45), path45, options);
6889
6889
  }
6890
6890
  }
6891
6891
  });
@@ -6897,14 +6897,14 @@ var require_mode = __commonJS({
6897
6897
  init_esm_shims();
6898
6898
  module.exports = isexe;
6899
6899
  isexe.sync = sync;
6900
- var fs37 = __require("fs");
6901
- function isexe(path43, options, cb) {
6902
- fs37.stat(path43, function(er, stat) {
6900
+ var fs38 = __require("fs");
6901
+ function isexe(path45, options, cb) {
6902
+ fs38.stat(path45, function(er, stat) {
6903
6903
  cb(er, er ? false : checkStat(stat, options));
6904
6904
  });
6905
6905
  }
6906
- function sync(path43, options) {
6907
- return checkStat(fs37.statSync(path43), options);
6906
+ function sync(path45, options) {
6907
+ return checkStat(fs38.statSync(path45), options);
6908
6908
  }
6909
6909
  function checkStat(stat, options) {
6910
6910
  return stat.isFile() && checkMode(stat, options);
@@ -6930,7 +6930,7 @@ var require_isexe = __commonJS({
6930
6930
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
6931
6931
  "use strict";
6932
6932
  init_esm_shims();
6933
- var fs37 = __require("fs");
6933
+ var fs38 = __require("fs");
6934
6934
  var core;
6935
6935
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
6936
6936
  core = require_windows();
@@ -6939,7 +6939,7 @@ var require_isexe = __commonJS({
6939
6939
  }
6940
6940
  module.exports = isexe;
6941
6941
  isexe.sync = sync;
6942
- function isexe(path43, options, cb) {
6942
+ function isexe(path45, options, cb) {
6943
6943
  if (typeof options === "function") {
6944
6944
  cb = options;
6945
6945
  options = {};
@@ -6949,7 +6949,7 @@ var require_isexe = __commonJS({
6949
6949
  throw new TypeError("callback not provided");
6950
6950
  }
6951
6951
  return new Promise(function(resolve2, reject) {
6952
- isexe(path43, options || {}, function(er, is) {
6952
+ isexe(path45, options || {}, function(er, is) {
6953
6953
  if (er) {
6954
6954
  reject(er);
6955
6955
  } else {
@@ -6958,7 +6958,7 @@ var require_isexe = __commonJS({
6958
6958
  });
6959
6959
  });
6960
6960
  }
6961
- core(path43, options || {}, function(er, is) {
6961
+ core(path45, options || {}, function(er, is) {
6962
6962
  if (er) {
6963
6963
  if (er.code === "EACCES" || options && options.ignoreErrors) {
6964
6964
  er = null;
@@ -6968,9 +6968,9 @@ var require_isexe = __commonJS({
6968
6968
  cb(er, is);
6969
6969
  });
6970
6970
  }
6971
- function sync(path43, options) {
6971
+ function sync(path45, options) {
6972
6972
  try {
6973
- return core.sync(path43, options || {});
6973
+ return core.sync(path45, options || {});
6974
6974
  } catch (er) {
6975
6975
  if (options && options.ignoreErrors || er.code === "EACCES") {
6976
6976
  return false;
@@ -6988,7 +6988,7 @@ var require_which = __commonJS({
6988
6988
  "use strict";
6989
6989
  init_esm_shims();
6990
6990
  var isWindows3 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
6991
- var path43 = __require("path");
6991
+ var path45 = __require("path");
6992
6992
  var COLON = isWindows3 ? ";" : ":";
6993
6993
  var isexe = require_isexe();
6994
6994
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -7026,7 +7026,7 @@ var require_which = __commonJS({
7026
7026
  return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
7027
7027
  const ppRaw = pathEnv[i];
7028
7028
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
7029
- const pCmd = path43.join(pathPart, cmd);
7029
+ const pCmd = path45.join(pathPart, cmd);
7030
7030
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
7031
7031
  resolve2(subStep(p, i, 0));
7032
7032
  });
@@ -7053,7 +7053,7 @@ var require_which = __commonJS({
7053
7053
  for (let i = 0; i < pathEnv.length; i++) {
7054
7054
  const ppRaw = pathEnv[i];
7055
7055
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
7056
- const pCmd = path43.join(pathPart, cmd);
7056
+ const pCmd = path45.join(pathPart, cmd);
7057
7057
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
7058
7058
  for (let j = 0; j < pathExt.length; j++) {
7059
7059
  const cur = p + pathExt[j];
@@ -7103,7 +7103,7 @@ var require_resolveCommand = __commonJS({
7103
7103
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
7104
7104
  "use strict";
7105
7105
  init_esm_shims();
7106
- var path43 = __require("path");
7106
+ var path45 = __require("path");
7107
7107
  var which = require_which();
7108
7108
  var getPathKey = require_path_key();
7109
7109
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -7121,7 +7121,7 @@ var require_resolveCommand = __commonJS({
7121
7121
  try {
7122
7122
  resolved = which.sync(parsed.command, {
7123
7123
  path: env2[getPathKey({ env: env2 })],
7124
- pathExt: withoutPathExt ? path43.delimiter : void 0
7124
+ pathExt: withoutPathExt ? path45.delimiter : void 0
7125
7125
  });
7126
7126
  } catch (e) {
7127
7127
  } finally {
@@ -7130,7 +7130,7 @@ var require_resolveCommand = __commonJS({
7130
7130
  }
7131
7131
  }
7132
7132
  if (resolved) {
7133
- resolved = path43.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
7133
+ resolved = path45.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
7134
7134
  }
7135
7135
  return resolved;
7136
7136
  }
@@ -7187,8 +7187,8 @@ var require_shebang_command = __commonJS({
7187
7187
  if (!match) {
7188
7188
  return null;
7189
7189
  }
7190
- const [path43, argument] = match[0].replace(/#! ?/, "").split(" ");
7191
- const binary = path43.split("/").pop();
7190
+ const [path45, argument] = match[0].replace(/#! ?/, "").split(" ");
7191
+ const binary = path45.split("/").pop();
7192
7192
  if (binary === "env") {
7193
7193
  return argument;
7194
7194
  }
@@ -7202,16 +7202,16 @@ var require_readShebang = __commonJS({
7202
7202
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
7203
7203
  "use strict";
7204
7204
  init_esm_shims();
7205
- var fs37 = __require("fs");
7205
+ var fs38 = __require("fs");
7206
7206
  var shebangCommand = require_shebang_command();
7207
7207
  function readShebang(command) {
7208
7208
  const size = 150;
7209
7209
  const buffer = Buffer.alloc(size);
7210
7210
  let fd2;
7211
7211
  try {
7212
- fd2 = fs37.openSync(command, "r");
7213
- fs37.readSync(fd2, buffer, 0, size, 0);
7214
- fs37.closeSync(fd2);
7212
+ fd2 = fs38.openSync(command, "r");
7213
+ fs38.readSync(fd2, buffer, 0, size, 0);
7214
+ fs38.closeSync(fd2);
7215
7215
  } catch (e) {
7216
7216
  }
7217
7217
  return shebangCommand(buffer.toString());
@@ -7225,7 +7225,7 @@ var require_parse = __commonJS({
7225
7225
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
7226
7226
  "use strict";
7227
7227
  init_esm_shims();
7228
- var path43 = __require("path");
7228
+ var path45 = __require("path");
7229
7229
  var resolveCommand = require_resolveCommand();
7230
7230
  var escape4 = require_escape();
7231
7231
  var readShebang = require_readShebang();
@@ -7250,7 +7250,7 @@ var require_parse = __commonJS({
7250
7250
  const needsShell = !isExecutableRegExp.test(commandFile);
7251
7251
  if (parsed.options.forceShell || needsShell) {
7252
7252
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
7253
- parsed.command = path43.normalize(parsed.command);
7253
+ parsed.command = path45.normalize(parsed.command);
7254
7254
  parsed.command = escape4.command(parsed.command);
7255
7255
  parsed.args = parsed.args.map((arg) => escape4.argument(arg, needsDoubleEscapeMetaChars));
7256
7256
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -7342,7 +7342,7 @@ var require_cross_spawn = __commonJS({
7342
7342
  var cp = __require("child_process");
7343
7343
  var parse3 = require_parse();
7344
7344
  var enoent = require_enoent();
7345
- function spawn8(command, args, options) {
7345
+ function spawn9(command, args, options) {
7346
7346
  const parsed = parse3(command, args, options);
7347
7347
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
7348
7348
  enoent.hookChildProcess(spawned, parsed);
@@ -7354,8 +7354,8 @@ var require_cross_spawn = __commonJS({
7354
7354
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
7355
7355
  return result;
7356
7356
  }
7357
- module.exports = spawn8;
7358
- module.exports.spawn = spawn8;
7357
+ module.exports = spawn9;
7358
+ module.exports.spawn = spawn9;
7359
7359
  module.exports.sync = spawnSync2;
7360
7360
  module.exports._parse = parse3;
7361
7361
  module.exports._enoent = enoent;
@@ -17765,10 +17765,10 @@ var require_react_reconciler_development = __commonJS({
17765
17765
  fiber = fiber.next, id2--;
17766
17766
  return fiber;
17767
17767
  }
17768
- function copyWithSetImpl(obj, path43, index, value) {
17769
- if (index >= path43.length) return value;
17770
- var key = path43[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
17771
- updated[key] = copyWithSetImpl(obj[key], path43, index + 1, value);
17768
+ function copyWithSetImpl(obj, path45, index, value) {
17769
+ if (index >= path45.length) return value;
17770
+ var key = path45[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
17771
+ updated[key] = copyWithSetImpl(obj[key], path45, index + 1, value);
17772
17772
  return updated;
17773
17773
  }
17774
17774
  function copyWithRename(obj, oldPath, newPath) {
@@ -17795,11 +17795,11 @@ var require_react_reconciler_development = __commonJS({
17795
17795
  );
17796
17796
  return updated;
17797
17797
  }
17798
- function copyWithDeleteImpl(obj, path43, index) {
17799
- var key = path43[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
17800
- if (index + 1 === path43.length)
17798
+ function copyWithDeleteImpl(obj, path45, index) {
17799
+ var key = path45[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
17800
+ if (index + 1 === path45.length)
17801
17801
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
17802
- updated[key] = copyWithDeleteImpl(obj[key], path43, index + 1);
17802
+ updated[key] = copyWithDeleteImpl(obj[key], path45, index + 1);
17803
17803
  return updated;
17804
17804
  }
17805
17805
  function shouldSuspendImpl() {
@@ -31076,29 +31076,29 @@ var require_react_reconciler_development = __commonJS({
31076
31076
  var didWarnAboutNestedUpdates = false;
31077
31077
  var didWarnAboutFindNodeInStrictMode = {};
31078
31078
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
31079
- overrideHookState = function(fiber, id2, path43, value) {
31079
+ overrideHookState = function(fiber, id2, path45, value) {
31080
31080
  id2 = findHook(fiber, id2);
31081
- null !== id2 && (path43 = copyWithSetImpl(id2.memoizedState, path43, 0, value), id2.memoizedState = path43, id2.baseState = path43, fiber.memoizedProps = assign({}, fiber.memoizedProps), path43 = enqueueConcurrentRenderForLane(fiber, 2), null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2));
31081
+ null !== id2 && (path45 = copyWithSetImpl(id2.memoizedState, path45, 0, value), id2.memoizedState = path45, id2.baseState = path45, fiber.memoizedProps = assign({}, fiber.memoizedProps), path45 = enqueueConcurrentRenderForLane(fiber, 2), null !== path45 && scheduleUpdateOnFiber(path45, fiber, 2));
31082
31082
  };
31083
- overrideHookStateDeletePath = function(fiber, id2, path43) {
31083
+ overrideHookStateDeletePath = function(fiber, id2, path45) {
31084
31084
  id2 = findHook(fiber, id2);
31085
- null !== id2 && (path43 = copyWithDeleteImpl(id2.memoizedState, path43, 0), id2.memoizedState = path43, id2.baseState = path43, fiber.memoizedProps = assign({}, fiber.memoizedProps), path43 = enqueueConcurrentRenderForLane(fiber, 2), null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2));
31085
+ null !== id2 && (path45 = copyWithDeleteImpl(id2.memoizedState, path45, 0), id2.memoizedState = path45, id2.baseState = path45, fiber.memoizedProps = assign({}, fiber.memoizedProps), path45 = enqueueConcurrentRenderForLane(fiber, 2), null !== path45 && scheduleUpdateOnFiber(path45, fiber, 2));
31086
31086
  };
31087
31087
  overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) {
31088
31088
  id2 = findHook(fiber, id2);
31089
31089
  null !== id2 && (oldPath = copyWithRename(id2.memoizedState, oldPath, newPath), id2.memoizedState = oldPath, id2.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
31090
31090
  };
31091
- overrideProps = function(fiber, path43, value) {
31092
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path43, 0, value);
31091
+ overrideProps = function(fiber, path45, value) {
31092
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path45, 0, value);
31093
31093
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
31094
- path43 = enqueueConcurrentRenderForLane(fiber, 2);
31095
- null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2);
31094
+ path45 = enqueueConcurrentRenderForLane(fiber, 2);
31095
+ null !== path45 && scheduleUpdateOnFiber(path45, fiber, 2);
31096
31096
  };
31097
- overridePropsDeletePath = function(fiber, path43) {
31098
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path43, 0);
31097
+ overridePropsDeletePath = function(fiber, path45) {
31098
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path45, 0);
31099
31099
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
31100
- path43 = enqueueConcurrentRenderForLane(fiber, 2);
31101
- null !== path43 && scheduleUpdateOnFiber(path43, fiber, 2);
31100
+ path45 = enqueueConcurrentRenderForLane(fiber, 2);
31101
+ null !== path45 && scheduleUpdateOnFiber(path45, fiber, 2);
31102
31102
  };
31103
31103
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
31104
31104
  fiber.pendingProps = copyWithRename(
@@ -34333,15 +34333,15 @@ function redactSensitive(body) {
34333
34333
  }
34334
34334
  return null;
34335
34335
  }
34336
- async function checkCredentialsFileSafety(path43, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) {
34336
+ async function checkCredentialsFileSafety(path45, onWarn = (m) => console.warn(`anthropic-sdk: ${m}`)) {
34337
34337
  if (typeof process === "undefined" || process.platform === "win32")
34338
34338
  return;
34339
- const fs37 = await import("fs");
34340
- let resolved = path43;
34339
+ const fs38 = await import("fs");
34340
+ let resolved = path45;
34341
34341
  let st;
34342
34342
  try {
34343
- resolved = await fs37.promises.realpath(path43);
34344
- st = await fs37.promises.stat(resolved);
34343
+ resolved = await fs38.promises.realpath(path45);
34344
+ st = await fs38.promises.stat(resolved);
34345
34345
  } catch {
34346
34346
  return;
34347
34347
  }
@@ -34357,27 +34357,27 @@ async function checkCredentialsFileSafety(path43, onWarn = (m) => console.warn(`
34357
34357
  }
34358
34358
  }
34359
34359
  async function writeCredentialsFileAtomic(targetPath, data) {
34360
- const fs37 = await import("fs");
34361
- const path43 = await import("path");
34362
- const dir = path43.dirname(targetPath);
34363
- await fs37.promises.mkdir(dir, { recursive: true, mode: 448 });
34360
+ const fs38 = await import("fs");
34361
+ const path45 = await import("path");
34362
+ const dir = path45.dirname(targetPath);
34363
+ await fs38.promises.mkdir(dir, { recursive: true, mode: 448 });
34364
34364
  const tmpPath = `${targetPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
34365
34365
  try {
34366
- const fh = await fs37.promises.open(tmpPath, "w", 384);
34366
+ const fh = await fs38.promises.open(tmpPath, "w", 384);
34367
34367
  try {
34368
34368
  await fh.writeFile(JSON.stringify(data, null, 2));
34369
34369
  await fh.sync();
34370
34370
  } finally {
34371
34371
  await fh.close();
34372
34372
  }
34373
- await fs37.promises.rename(tmpPath, targetPath);
34373
+ await fs38.promises.rename(tmpPath, targetPath);
34374
34374
  } catch (err) {
34375
- await fs37.promises.unlink(tmpPath).catch(() => {
34375
+ await fs38.promises.unlink(tmpPath).catch(() => {
34376
34376
  });
34377
34377
  throw err;
34378
34378
  }
34379
34379
  try {
34380
- const dirFh = await fs37.promises.open(dir, "r");
34380
+ const dirFh = await fs38.promises.open(dir, "r");
34381
34381
  try {
34382
34382
  await dirFh.sync();
34383
34383
  } finally {
@@ -34679,12 +34679,12 @@ var loadConfigWithSource = async (profile) => {
34679
34679
  return null;
34680
34680
  }
34681
34681
  validateProfileName(profileName);
34682
- const fs37 = await import("fs");
34683
- const path43 = await import("path");
34684
- const configPath = path43.join(rootConfigPath, "configs", `${profileName}.json`);
34682
+ const fs38 = await import("fs");
34683
+ const path45 = await import("path");
34684
+ const configPath = path45.join(rootConfigPath, "configs", `${profileName}.json`);
34685
34685
  let configRaw;
34686
34686
  try {
34687
- configRaw = await fs37.promises.readFile(configPath, "utf-8");
34687
+ configRaw = await fs38.promises.readFile(configPath, "utf-8");
34688
34688
  } catch (err) {
34689
34689
  if (err?.code !== "ENOENT") {
34690
34690
  throw new Error(`failed to read config file ${configPath}: ${err}`);
@@ -34765,14 +34765,14 @@ var getCredentialsPath = async (config2, profile) => {
34765
34765
  return null;
34766
34766
  }
34767
34767
  validateProfileName(profileName);
34768
- const path43 = await import("path");
34769
- return path43.join(rootConfigPath, "credentials", `${profileName}.json`);
34768
+ const path45 = await import("path");
34769
+ return path45.join(rootConfigPath, "credentials", `${profileName}.json`);
34770
34770
  };
34771
34771
  var getRootConfigPath = async () => {
34772
34772
  if (!supportsLocalConfigFiles()) {
34773
34773
  return null;
34774
34774
  }
34775
- const path43 = await import("path");
34775
+ const path45 = await import("path");
34776
34776
  const configDir = readEnv("ANTHROPIC_CONFIG_DIR");
34777
34777
  if (configDir) {
34778
34778
  return configDir;
@@ -34781,21 +34781,21 @@ var getRootConfigPath = async () => {
34781
34781
  if (os12 === "Windows") {
34782
34782
  const appData = readEnv("APPDATA");
34783
34783
  if (appData) {
34784
- return path43.join(appData, "Anthropic");
34784
+ return path45.join(appData, "Anthropic");
34785
34785
  }
34786
34786
  const userProfile = readEnv("USERPROFILE");
34787
34787
  if (userProfile) {
34788
- return path43.join(userProfile, "AppData", "Roaming", "Anthropic");
34788
+ return path45.join(userProfile, "AppData", "Roaming", "Anthropic");
34789
34789
  }
34790
34790
  return null;
34791
34791
  }
34792
34792
  const xdgConfigHome = readEnv("XDG_CONFIG_HOME");
34793
34793
  if (xdgConfigHome) {
34794
- return path43.join(xdgConfigHome, "anthropic");
34794
+ return path45.join(xdgConfigHome, "anthropic");
34795
34795
  }
34796
34796
  const home = readEnv("HOME");
34797
34797
  if (home) {
34798
- return path43.join(home, ".config", "anthropic");
34798
+ return path45.join(home, ".config", "anthropic");
34799
34799
  }
34800
34800
  return null;
34801
34801
  };
@@ -34812,11 +34812,11 @@ var getActiveProfileName = async () => {
34812
34812
  if (profileName) {
34813
34813
  return profileName;
34814
34814
  }
34815
- const fs37 = await import("fs");
34816
- const path43 = await import("path");
34817
- const filePath = path43.join(rootConfigPath, "active_config");
34815
+ const fs38 = await import("fs");
34816
+ const path45 = await import("path");
34817
+ const filePath = path45.join(rootConfigPath, "active_config");
34818
34818
  try {
34819
- return (await fs37.promises.readFile(filePath, "utf-8")).trim() || "default";
34819
+ return (await fs38.promises.readFile(filePath, "utf-8")).trim() || "default";
34820
34820
  } catch (err) {
34821
34821
  if (err?.code !== "ENOENT") {
34822
34822
  throw new Error(`failed to read ${filePath}: ${err}`);
@@ -34827,21 +34827,21 @@ var getActiveProfileName = async () => {
34827
34827
 
34828
34828
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.94.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs
34829
34829
  init_esm_shims();
34830
- function identityTokenFromFile(path43) {
34831
- if (!path43) {
34830
+ function identityTokenFromFile(path45) {
34831
+ if (!path45) {
34832
34832
  throw new AnthropicError("Identity token file path is empty");
34833
34833
  }
34834
34834
  return async () => {
34835
- const fs37 = await import("fs");
34835
+ const fs38 = await import("fs");
34836
34836
  let content;
34837
34837
  try {
34838
- content = await fs37.promises.readFile(path43, "utf-8");
34838
+ content = await fs38.promises.readFile(path45, "utf-8");
34839
34839
  } catch (err) {
34840
- throw new AnthropicError(`Failed to read identity token file at ${path43}: ${err}`);
34840
+ throw new AnthropicError(`Failed to read identity token file at ${path45}: ${err}`);
34841
34841
  }
34842
34842
  const token = content.trim();
34843
34843
  if (!token) {
34844
- throw new AnthropicError(`Identity token file at ${path43} is empty`);
34844
+ throw new AnthropicError(`Identity token file at ${path45} is empty`);
34845
34845
  }
34846
34846
  return token;
34847
34847
  };
@@ -34916,11 +34916,11 @@ function oidcFederationProvider(config2) {
34916
34916
  init_esm_shims();
34917
34917
  function userOAuthProvider(config2) {
34918
34918
  return async (opts) => {
34919
- const fs37 = await import("fs");
34919
+ const fs38 = await import("fs");
34920
34920
  await checkCredentialsFileSafety(config2.credentialsPath, config2.onSafetyWarning);
34921
34921
  let raw;
34922
34922
  try {
34923
- raw = await fs37.promises.readFile(config2.credentialsPath, "utf-8");
34923
+ raw = await fs38.promises.readFile(config2.credentialsPath, "utf-8");
34924
34924
  } catch (err) {
34925
34925
  throw new WorkloadIdentityError(`Credentials file not found at ${config2.credentialsPath}: ${err}`);
34926
34926
  }
@@ -35084,11 +35084,11 @@ function resolveIdentityTokenProvider(auth2) {
35084
35084
  }
35085
35085
  function cachedExchangeProvider(exchange, credentialsPath, onCacheWriteError, onSafetyWarning) {
35086
35086
  return async (opts) => {
35087
- const fs37 = await import("fs");
35087
+ const fs38 = await import("fs");
35088
35088
  await checkCredentialsFileSafety(credentialsPath, onSafetyWarning);
35089
35089
  let existing;
35090
35090
  try {
35091
- const raw = await fs37.promises.readFile(credentialsPath, "utf-8");
35091
+ const raw = await fs38.promises.readFile(credentialsPath, "utf-8");
35092
35092
  existing = JSON.parse(raw);
35093
35093
  const token = existing?.["access_token"];
35094
35094
  if (token && !opts?.forceRefresh) {
@@ -35927,12 +35927,12 @@ function encodeURIPath(str2) {
35927
35927
  return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
35928
35928
  }
35929
35929
  var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
35930
- var createPathTagFunction = (pathEncoder = encodeURIPath) => function path43(statics, ...params) {
35930
+ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path45(statics, ...params) {
35931
35931
  if (statics.length === 1)
35932
35932
  return statics[0];
35933
35933
  let postPath = false;
35934
35934
  const invalidSegments = [];
35935
- const path44 = statics.reduce((previousValue, currentValue, index) => {
35935
+ const path46 = statics.reduce((previousValue, currentValue, index) => {
35936
35936
  if (/[?#]/.test(currentValue)) {
35937
35937
  postPath = true;
35938
35938
  }
@@ -35949,7 +35949,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path43(sta
35949
35949
  }
35950
35950
  return previousValue + currentValue + (index === params.length ? "" : encoded);
35951
35951
  }, "");
35952
- const pathOnly = path44.split(/[?#]/, 1)[0];
35952
+ const pathOnly = path46.split(/[?#]/, 1)[0];
35953
35953
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
35954
35954
  let match;
35955
35955
  while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -35970,10 +35970,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path43(sta
35970
35970
  }, "");
35971
35971
  throw new AnthropicError(`Path parameters result in path with invalid segments:
35972
35972
  ${invalidSegments.map((e) => e.error).join("\n")}
35973
- ${path44}
35973
+ ${path46}
35974
35974
  ${underline}`);
35975
35975
  }
35976
- return path44;
35976
+ return path46;
35977
35977
  };
35978
35978
  var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
35979
35979
 
@@ -40734,9 +40734,9 @@ var BaseAnthropic = class {
40734
40734
  makeStatusError(status, error51, message, headers) {
40735
40735
  return APIError.generate(status, error51, message, headers);
40736
40736
  }
40737
- buildURL(path43, query, defaultBaseURL) {
40737
+ buildURL(path45, query, defaultBaseURL) {
40738
40738
  const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
40739
- const url2 = isAbsoluteURL(path43) ? new URL(path43) : new URL(baseURL + (baseURL.endsWith("/") && path43.startsWith("/") ? path43.slice(1) : path43));
40739
+ const url2 = isAbsoluteURL(path45) ? new URL(path45) : new URL(baseURL + (baseURL.endsWith("/") && path45.startsWith("/") ? path45.slice(1) : path45));
40740
40740
  const defaultQuery = this.defaultQuery();
40741
40741
  const pathQuery = Object.fromEntries(url2.searchParams);
40742
40742
  if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
@@ -40780,24 +40780,24 @@ var BaseAnthropic = class {
40780
40780
  request.headers = headers;
40781
40781
  }
40782
40782
  }
40783
- get(path43, opts) {
40784
- return this.methodRequest("get", path43, opts);
40783
+ get(path45, opts) {
40784
+ return this.methodRequest("get", path45, opts);
40785
40785
  }
40786
- post(path43, opts) {
40787
- return this.methodRequest("post", path43, opts);
40786
+ post(path45, opts) {
40787
+ return this.methodRequest("post", path45, opts);
40788
40788
  }
40789
- patch(path43, opts) {
40790
- return this.methodRequest("patch", path43, opts);
40789
+ patch(path45, opts) {
40790
+ return this.methodRequest("patch", path45, opts);
40791
40791
  }
40792
- put(path43, opts) {
40793
- return this.methodRequest("put", path43, opts);
40792
+ put(path45, opts) {
40793
+ return this.methodRequest("put", path45, opts);
40794
40794
  }
40795
- delete(path43, opts) {
40796
- return this.methodRequest("delete", path43, opts);
40795
+ delete(path45, opts) {
40796
+ return this.methodRequest("delete", path45, opts);
40797
40797
  }
40798
- methodRequest(method, path43, opts) {
40798
+ methodRequest(method, path45, opts) {
40799
40799
  return this.request(Promise.resolve(opts).then((opts2) => {
40800
- return { method, path: path43, ...opts2 };
40800
+ return { method, path: path45, ...opts2 };
40801
40801
  }));
40802
40802
  }
40803
40803
  request(options, remainingRetries = null) {
@@ -40902,8 +40902,8 @@ var BaseAnthropic = class {
40902
40902
  }));
40903
40903
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
40904
40904
  }
40905
- getAPIList(path43, Page3, opts) {
40906
- return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path43, ...opts2 })) : { method: "get", path: path43, ...opts });
40905
+ getAPIList(path45, Page3, opts) {
40906
+ return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path45, ...opts2 })) : { method: "get", path: path45, ...opts });
40907
40907
  }
40908
40908
  requestAPIList(Page3, options) {
40909
40909
  const request = this.makeRequest(options, null, void 0);
@@ -40997,14 +40997,14 @@ var BaseAnthropic = class {
40997
40997
  }
40998
40998
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
40999
40999
  const options = { ...inputOptions };
41000
- const { method, path: path43, query, defaultBaseURL } = options;
41000
+ const { method, path: path45, query, defaultBaseURL } = options;
41001
41001
  if (this._authState.resolution) {
41002
41002
  await this._authState.resolution;
41003
41003
  }
41004
41004
  if (!this._baseURLIsExplicit && this._authState.baseURL && this.baseURL !== this._authState.baseURL) {
41005
41005
  this.baseURL = this._authState.baseURL;
41006
41006
  }
41007
- const url2 = this.buildURL(path43, query, defaultBaseURL);
41007
+ const url2 = this.buildURL(path45, query, defaultBaseURL);
41008
41008
  if ("timeout" in options)
41009
41009
  validatePositiveInteger("timeout", options.timeout);
41010
41010
  options.timeout = options.timeout ?? this.timeout;
@@ -41891,10 +41891,10 @@ function mergeDefs(...defs) {
41891
41891
  function cloneDef(schema) {
41892
41892
  return mergeDefs(schema._zod.def);
41893
41893
  }
41894
- function getElementAtPath(obj, path43) {
41895
- if (!path43)
41894
+ function getElementAtPath(obj, path45) {
41895
+ if (!path45)
41896
41896
  return obj;
41897
- return path43.reduce((acc, key) => acc?.[key], obj);
41897
+ return path45.reduce((acc, key) => acc?.[key], obj);
41898
41898
  }
41899
41899
  function promiseAllObject(promisesObj) {
41900
41900
  const keys = Object.keys(promisesObj);
@@ -42303,11 +42303,11 @@ function explicitlyAborted(x, startIndex = 0) {
42303
42303
  }
42304
42304
  return false;
42305
42305
  }
42306
- function prefixIssues(path43, issues) {
42306
+ function prefixIssues(path45, issues) {
42307
42307
  return issues.map((iss) => {
42308
42308
  var _a6;
42309
42309
  (_a6 = iss).path ?? (_a6.path = []);
42310
- iss.path.unshift(path43);
42310
+ iss.path.unshift(path45);
42311
42311
  return iss;
42312
42312
  });
42313
42313
  }
@@ -42454,16 +42454,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
42454
42454
  }
42455
42455
  function formatError(error51, mapper = (issue2) => issue2.message) {
42456
42456
  const fieldErrors = { _errors: [] };
42457
- const processError = (error52, path43 = []) => {
42457
+ const processError = (error52, path45 = []) => {
42458
42458
  for (const issue2 of error52.issues) {
42459
42459
  if (issue2.code === "invalid_union" && issue2.errors.length) {
42460
- issue2.errors.map((issues) => processError({ issues }, [...path43, ...issue2.path]));
42460
+ issue2.errors.map((issues) => processError({ issues }, [...path45, ...issue2.path]));
42461
42461
  } else if (issue2.code === "invalid_key") {
42462
- processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
42462
+ processError({ issues: issue2.issues }, [...path45, ...issue2.path]);
42463
42463
  } else if (issue2.code === "invalid_element") {
42464
- processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
42464
+ processError({ issues: issue2.issues }, [...path45, ...issue2.path]);
42465
42465
  } else {
42466
- const fullpath = [...path43, ...issue2.path];
42466
+ const fullpath = [...path45, ...issue2.path];
42467
42467
  if (fullpath.length === 0) {
42468
42468
  fieldErrors._errors.push(mapper(issue2));
42469
42469
  } else {
@@ -42490,17 +42490,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
42490
42490
  }
42491
42491
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
42492
42492
  const result = { errors: [] };
42493
- const processError = (error52, path43 = []) => {
42493
+ const processError = (error52, path45 = []) => {
42494
42494
  var _a6, _b;
42495
42495
  for (const issue2 of error52.issues) {
42496
42496
  if (issue2.code === "invalid_union" && issue2.errors.length) {
42497
- issue2.errors.map((issues) => processError({ issues }, [...path43, ...issue2.path]));
42497
+ issue2.errors.map((issues) => processError({ issues }, [...path45, ...issue2.path]));
42498
42498
  } else if (issue2.code === "invalid_key") {
42499
- processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
42499
+ processError({ issues: issue2.issues }, [...path45, ...issue2.path]);
42500
42500
  } else if (issue2.code === "invalid_element") {
42501
- processError({ issues: issue2.issues }, [...path43, ...issue2.path]);
42501
+ processError({ issues: issue2.issues }, [...path45, ...issue2.path]);
42502
42502
  } else {
42503
- const fullpath = [...path43, ...issue2.path];
42503
+ const fullpath = [...path45, ...issue2.path];
42504
42504
  if (fullpath.length === 0) {
42505
42505
  result.errors.push(mapper(issue2));
42506
42506
  continue;
@@ -42532,8 +42532,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
42532
42532
  }
42533
42533
  function toDotPath(_path) {
42534
42534
  const segs = [];
42535
- const path43 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
42536
- for (const seg of path43) {
42535
+ const path45 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
42536
+ for (const seg of path45) {
42537
42537
  if (typeof seg === "number")
42538
42538
  segs.push(`[${seg}]`);
42539
42539
  else if (typeof seg === "symbol")
@@ -55306,13 +55306,13 @@ function resolveRef(ref, ctx) {
55306
55306
  if (!ref.startsWith("#")) {
55307
55307
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
55308
55308
  }
55309
- const path43 = ref.slice(1).split("/").filter(Boolean);
55310
- if (path43.length === 0) {
55309
+ const path45 = ref.slice(1).split("/").filter(Boolean);
55310
+ if (path45.length === 0) {
55311
55311
  return ctx.rootSchema;
55312
55312
  }
55313
55313
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
55314
- if (path43[0] === defsKey) {
55315
- const key = path43[1];
55314
+ if (path45[0] === defsKey) {
55315
+ const key = path45[1];
55316
55316
  if (!key || !ctx.defs[key]) {
55317
55317
  throw new Error(`Reference not found: ${ref}`);
55318
55318
  }
@@ -57541,12 +57541,12 @@ function encodeURIPath2(str2) {
57541
57541
  return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
57542
57542
  }
57543
57543
  var EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
57544
- var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path43(statics, ...params) {
57544
+ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path45(statics, ...params) {
57545
57545
  if (statics.length === 1)
57546
57546
  return statics[0];
57547
57547
  let postPath = false;
57548
57548
  const invalidSegments = [];
57549
- const path44 = statics.reduce((previousValue, currentValue, index) => {
57549
+ const path46 = statics.reduce((previousValue, currentValue, index) => {
57550
57550
  if (/[?#]/.test(currentValue)) {
57551
57551
  postPath = true;
57552
57552
  }
@@ -57563,7 +57563,7 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path43(s
57563
57563
  }
57564
57564
  return previousValue + currentValue + (index === params.length ? "" : encoded);
57565
57565
  }, "");
57566
- const pathOnly = path44.split(/[?#]/, 1)[0];
57566
+ const pathOnly = path46.split(/[?#]/, 1)[0];
57567
57567
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
57568
57568
  let match;
57569
57569
  while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -57584,10 +57584,10 @@ var createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path43(s
57584
57584
  }, "");
57585
57585
  throw new OpenAIError(`Path parameters result in path with invalid segments:
57586
57586
  ${invalidSegments.map((e) => e.error).join("\n")}
57587
- ${path44}
57587
+ ${path46}
57588
57588
  ${underline}`);
57589
57589
  }
57590
- return path44;
57590
+ return path46;
57591
57591
  };
57592
57592
  var path2 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2);
57593
57593
 
@@ -62713,9 +62713,9 @@ var OpenAI = class {
62713
62713
  this.apiKey = token;
62714
62714
  return true;
62715
62715
  }
62716
- buildURL(path43, query, defaultBaseURL) {
62716
+ buildURL(path45, query, defaultBaseURL) {
62717
62717
  const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
62718
- const url2 = isAbsoluteURL2(path43) ? new URL(path43) : new URL(baseURL + (baseURL.endsWith("/") && path43.startsWith("/") ? path43.slice(1) : path43));
62718
+ const url2 = isAbsoluteURL2(path45) ? new URL(path45) : new URL(baseURL + (baseURL.endsWith("/") && path45.startsWith("/") ? path45.slice(1) : path45));
62719
62719
  const defaultQuery = this.defaultQuery();
62720
62720
  const pathQuery = Object.fromEntries(url2.searchParams);
62721
62721
  if (!isEmptyObj2(defaultQuery) || !isEmptyObj2(pathQuery)) {
@@ -62740,24 +62740,24 @@ var OpenAI = class {
62740
62740
  */
62741
62741
  async prepareRequest(request, { url: url2, options }) {
62742
62742
  }
62743
- get(path43, opts) {
62744
- return this.methodRequest("get", path43, opts);
62743
+ get(path45, opts) {
62744
+ return this.methodRequest("get", path45, opts);
62745
62745
  }
62746
- post(path43, opts) {
62747
- return this.methodRequest("post", path43, opts);
62746
+ post(path45, opts) {
62747
+ return this.methodRequest("post", path45, opts);
62748
62748
  }
62749
- patch(path43, opts) {
62750
- return this.methodRequest("patch", path43, opts);
62749
+ patch(path45, opts) {
62750
+ return this.methodRequest("patch", path45, opts);
62751
62751
  }
62752
- put(path43, opts) {
62753
- return this.methodRequest("put", path43, opts);
62752
+ put(path45, opts) {
62753
+ return this.methodRequest("put", path45, opts);
62754
62754
  }
62755
- delete(path43, opts) {
62756
- return this.methodRequest("delete", path43, opts);
62755
+ delete(path45, opts) {
62756
+ return this.methodRequest("delete", path45, opts);
62757
62757
  }
62758
- methodRequest(method, path43, opts) {
62758
+ methodRequest(method, path45, opts) {
62759
62759
  return this.request(Promise.resolve(opts).then((opts2) => {
62760
- return { method, path: path43, ...opts2 };
62760
+ return { method, path: path45, ...opts2 };
62761
62761
  }));
62762
62762
  }
62763
62763
  request(options, remainingRetries = null) {
@@ -62875,8 +62875,8 @@ var OpenAI = class {
62875
62875
  }));
62876
62876
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
62877
62877
  }
62878
- getAPIList(path43, Page3, opts) {
62879
- return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path43, ...opts2 })) : { method: "get", path: path43, ...opts });
62878
+ getAPIList(path45, Page3, opts) {
62879
+ return this.requestAPIList(Page3, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path45, ...opts2 })) : { method: "get", path: path45, ...opts });
62880
62880
  }
62881
62881
  requestAPIList(Page3, options) {
62882
62882
  const request = this.makeRequest(options, null, void 0);
@@ -62967,8 +62967,8 @@ var OpenAI = class {
62967
62967
  }
62968
62968
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
62969
62969
  const options = { ...inputOptions };
62970
- const { method, path: path43, query, defaultBaseURL } = options;
62971
- const url2 = this.buildURL(path43, query, defaultBaseURL);
62970
+ const { method, path: path45, query, defaultBaseURL } = options;
62971
+ const url2 = this.buildURL(path45, query, defaultBaseURL);
62972
62972
  if ("timeout" in options)
62973
62973
  validatePositiveInteger2("timeout", options.timeout);
62974
62974
  options.timeout = options.timeout ?? this.timeout;
@@ -64703,11 +64703,11 @@ async function* runStream2(options) {
64703
64703
  }
64704
64704
  }
64705
64705
  if (getEnvironment()?.GGAI_DUMP_REQUEST) {
64706
- const fs37 = await import("fs");
64706
+ const fs38 = await import("fs");
64707
64707
  const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
64708
64708
  const dumpPath = `/tmp/ggai-request-${ts}.json`;
64709
- fs37.writeFileSync(dumpPath, JSON.stringify(params, null, 2));
64710
- fs37.appendFileSync(
64709
+ fs38.writeFileSync(dumpPath, JSON.stringify(params, null, 2));
64710
+ fs38.appendFileSync(
64711
64711
  "/tmp/ggai-requests.log",
64712
64712
  `[${ts}] ${dumpPath} messages=${params.messages.length}
64713
64713
  `
@@ -69290,25 +69290,715 @@ var ProcessManager = class {
69290
69290
  }
69291
69291
  };
69292
69292
 
69293
+ // ../ggcoder/dist/core/lsp/manager.js
69294
+ init_esm_shims();
69295
+ import path8 from "path";
69296
+
69297
+ // ../ggcoder/dist/core/logger.js
69298
+ init_esm_shims();
69299
+
69300
+ // ../ggcoder/dist/core/lsp/client.js
69301
+ init_esm_shims();
69302
+ import { spawn as spawn3 } from "child_process";
69303
+ import { pathToFileURL } from "url";
69304
+
69305
+ // ../ggcoder/dist/core/lsp/jsonrpc.js
69306
+ init_esm_shims();
69307
+ var JsonRpcRequestError = class extends Error {
69308
+ code;
69309
+ constructor(method, code, message) {
69310
+ super(`${method}: ${message} (code ${code})`);
69311
+ this.name = "JsonRpcRequestError";
69312
+ this.code = code;
69313
+ }
69314
+ };
69315
+ var HEADER_SEPARATOR = "\r\n\r\n";
69316
+ var JsonRpcConnection = class {
69317
+ output;
69318
+ buffer = Buffer.alloc(0);
69319
+ nextId = 1;
69320
+ pending = /* @__PURE__ */ new Map();
69321
+ notificationHandlers = /* @__PURE__ */ new Map();
69322
+ disposed = false;
69323
+ constructor(input, output) {
69324
+ this.output = output;
69325
+ input.on("data", (chunk) => this.onData(chunk));
69326
+ output.on("error", () => {
69327
+ });
69328
+ }
69329
+ onNotification(method, handler) {
69330
+ const handlers = this.notificationHandlers.get(method) ?? [];
69331
+ handlers.push(handler);
69332
+ this.notificationHandlers.set(method, handlers);
69333
+ }
69334
+ request(method, params, timeoutMs) {
69335
+ if (this.disposed) {
69336
+ return Promise.reject(new JsonRpcRequestError(method, -32099, "connection disposed"));
69337
+ }
69338
+ const id2 = this.nextId++;
69339
+ return new Promise((resolve2, reject) => {
69340
+ const timer = setTimeout(() => {
69341
+ this.pending.delete(id2);
69342
+ reject(new JsonRpcRequestError(method, -32803, `timed out after ${timeoutMs}ms`));
69343
+ }, timeoutMs);
69344
+ timer.unref();
69345
+ this.pending.set(id2, (msg) => {
69346
+ clearTimeout(timer);
69347
+ if (msg.error) {
69348
+ reject(new JsonRpcRequestError(method, msg.error.code, msg.error.message));
69349
+ } else {
69350
+ resolve2(msg.result);
69351
+ }
69352
+ });
69353
+ this.send({ jsonrpc: "2.0", id: id2, method, params });
69354
+ });
69355
+ }
69356
+ notify(method, params) {
69357
+ this.send({ jsonrpc: "2.0", method, params });
69358
+ }
69359
+ /** Reject all in-flight requests and stop accepting new work. */
69360
+ dispose() {
69361
+ if (this.disposed)
69362
+ return;
69363
+ this.disposed = true;
69364
+ for (const [id2, settle] of this.pending) {
69365
+ this.pending.delete(id2);
69366
+ settle({ error: { code: -32099, message: "connection disposed" } });
69367
+ }
69368
+ }
69369
+ send(msg) {
69370
+ if (this.disposed)
69371
+ return;
69372
+ const body = JSON.stringify(msg);
69373
+ try {
69374
+ this.output.write(`Content-Length: ${Buffer.byteLength(body)}\r
69375
+ \r
69376
+ ${body}`);
69377
+ } catch {
69378
+ }
69379
+ }
69380
+ onData(chunk) {
69381
+ this.buffer = Buffer.concat([this.buffer, chunk]);
69382
+ for (; ; ) {
69383
+ const headerEnd = this.buffer.indexOf(HEADER_SEPARATOR);
69384
+ if (headerEnd === -1)
69385
+ return;
69386
+ const header = this.buffer.subarray(0, headerEnd).toString();
69387
+ const match = /Content-Length: (\d+)/i.exec(header);
69388
+ if (!match) {
69389
+ this.buffer = this.buffer.subarray(headerEnd + HEADER_SEPARATOR.length);
69390
+ continue;
69391
+ }
69392
+ const length = Number(match[1]);
69393
+ const bodyStart = headerEnd + HEADER_SEPARATOR.length;
69394
+ if (this.buffer.length < bodyStart + length)
69395
+ return;
69396
+ const body = this.buffer.subarray(bodyStart, bodyStart + length).toString();
69397
+ this.buffer = this.buffer.subarray(bodyStart + length);
69398
+ let msg;
69399
+ try {
69400
+ msg = JSON.parse(body);
69401
+ } catch {
69402
+ continue;
69403
+ }
69404
+ this.onMessage(msg);
69405
+ }
69406
+ }
69407
+ onMessage(msg) {
69408
+ if (msg.id !== void 0 && msg.method === void 0) {
69409
+ const settle = typeof msg.id === "number" ? this.pending.get(msg.id) : void 0;
69410
+ if (settle && typeof msg.id === "number") {
69411
+ this.pending.delete(msg.id);
69412
+ settle(msg);
69413
+ }
69414
+ return;
69415
+ }
69416
+ if (msg.id !== void 0 && msg.method !== void 0) {
69417
+ let result = null;
69418
+ if (msg.method === "workspace/configuration") {
69419
+ const items = msg.params?.items ?? [];
69420
+ result = items.map(() => null);
69421
+ }
69422
+ this.send({ jsonrpc: "2.0", id: msg.id, result });
69423
+ return;
69424
+ }
69425
+ if (msg.method !== void 0) {
69426
+ const handlers = this.notificationHandlers.get(msg.method);
69427
+ if (handlers) {
69428
+ for (const handler of handlers)
69429
+ handler(msg.params);
69430
+ }
69431
+ }
69432
+ }
69433
+ };
69434
+
69435
+ // ../ggcoder/dist/core/lsp/client.js
69436
+ var SERVER_CANCELLED = -32802;
69437
+ var METHOD_NOT_FOUND = -32601;
69438
+ var PULL_POLL_INTERVAL_MS = 300;
69439
+ var SHUTDOWN_TIMEOUT_MS = 2e3;
69440
+ var KILL_GRACE_MS = 1500;
69441
+ function sleep4(ms) {
69442
+ return new Promise((resolve2) => {
69443
+ setTimeout(resolve2, ms).unref();
69444
+ });
69445
+ }
69446
+ var LspClient = class {
69447
+ spec;
69448
+ rootPath;
69449
+ proc;
69450
+ conn;
69451
+ versions = /* @__PURE__ */ new Map();
69452
+ published = /* @__PURE__ */ new Map();
69453
+ waiters = [];
69454
+ hasPullDiagnostics = false;
69455
+ alive = true;
69456
+ initializationOptions;
69457
+ constructor(spec, rootPath, command) {
69458
+ this.spec = spec;
69459
+ this.rootPath = rootPath;
69460
+ this.initializationOptions = command.initializationOptions ?? {};
69461
+ this.proc = spawn3(command.command, command.args, {
69462
+ cwd: rootPath,
69463
+ stdio: ["pipe", "pipe", "ignore"],
69464
+ env: getSafeToolEnv()
69465
+ });
69466
+ this.proc.on("error", () => this.markDead());
69467
+ this.proc.on("exit", () => this.markDead());
69468
+ const { stdout, stdin } = this.proc;
69469
+ if (!stdout || !stdin) {
69470
+ this.proc.kill("SIGKILL");
69471
+ throw new Error(`failed to open stdio pipes for ${spec.id} language server`);
69472
+ }
69473
+ this.conn = new JsonRpcConnection(stdout, stdin);
69474
+ this.conn.onNotification("textDocument/publishDiagnostics", (params) => {
69475
+ const publish = params;
69476
+ this.published.set(publish.uri, publish.diagnostics);
69477
+ this.waiters = this.waiters.filter((waiter) => {
69478
+ if (waiter.uri !== publish.uri)
69479
+ return true;
69480
+ waiter.resolve(publish.diagnostics);
69481
+ return false;
69482
+ });
69483
+ });
69484
+ }
69485
+ get isAlive() {
69486
+ return this.alive;
69487
+ }
69488
+ async initialize(timeoutMs) {
69489
+ const rootUri = pathToFileURL(this.rootPath).href;
69490
+ const result = await this.conn.request("initialize", {
69491
+ processId: process.pid,
69492
+ rootUri,
69493
+ workspaceFolders: [{ uri: rootUri, name: "ggcoder" }],
69494
+ initializationOptions: this.initializationOptions,
69495
+ capabilities: {
69496
+ textDocument: {
69497
+ synchronization: { didSave: true },
69498
+ publishDiagnostics: { relatedInformation: false },
69499
+ diagnostic: { dynamicRegistration: false, relatedDocumentSupport: false }
69500
+ },
69501
+ workspace: { configuration: true, workspaceFolders: true }
69502
+ }
69503
+ }, timeoutMs);
69504
+ this.hasPullDiagnostics = Boolean(result?.capabilities?.diagnosticProvider);
69505
+ this.conn.notify("initialized", {});
69506
+ }
69507
+ /**
69508
+ * Sync `content` into the server's overlay for `filePath` — didOpen the
69509
+ * first time, didChange (full text) + didSave afterwards. Clears the
69510
+ * push-diagnostics cache for the uri so a subsequent collect waits for a
69511
+ * report computed against THIS content rather than a stale one.
69512
+ */
69513
+ syncDocument(filePath, content) {
69514
+ const uri = pathToFileURL(filePath).href;
69515
+ this.published.delete(uri);
69516
+ const previousVersion = this.versions.get(uri);
69517
+ if (previousVersion === void 0) {
69518
+ this.versions.set(uri, 1);
69519
+ this.conn.notify("textDocument/didOpen", {
69520
+ textDocument: {
69521
+ uri,
69522
+ languageId: this.spec.languageIdFor(extensionOf(filePath)),
69523
+ version: 1,
69524
+ text: content
69525
+ }
69526
+ });
69527
+ } else {
69528
+ const version2 = previousVersion + 1;
69529
+ this.versions.set(uri, version2);
69530
+ this.conn.notify("textDocument/didChange", {
69531
+ textDocument: { uri, version: version2 },
69532
+ contentChanges: [{ text: content }]
69533
+ });
69534
+ this.conn.notify("textDocument/didSave", { textDocument: { uri }, text: content });
69535
+ }
69536
+ return uri;
69537
+ }
69538
+ /**
69539
+ * Current diagnostics for `uri`, racing the push channel (next
69540
+ * publishDiagnostics after the last sync) against a pull-diagnostics poll
69541
+ * loop when the server supports LSP 3.17 pull. Returns null on timeout.
69542
+ */
69543
+ async collectDiagnostics(uri, timeoutMs) {
69544
+ const push = this.waitForPublish(uri, timeoutMs);
69545
+ if (!this.hasPullDiagnostics)
69546
+ return push;
69547
+ let stopped = false;
69548
+ const pull = (async () => {
69549
+ const deadline = Date.now() + timeoutMs;
69550
+ while (!stopped && this.alive && Date.now() < deadline) {
69551
+ const items = await this.pullDiagnostics(uri, Math.max(1, deadline - Date.now()));
69552
+ if (items === "unsupported")
69553
+ return push;
69554
+ if (items !== "retry")
69555
+ return items;
69556
+ await sleep4(PULL_POLL_INTERVAL_MS);
69557
+ }
69558
+ return push;
69559
+ })();
69560
+ try {
69561
+ return await Promise.race([push, pull]);
69562
+ } finally {
69563
+ stopped = true;
69564
+ }
69565
+ }
69566
+ /**
69567
+ * Graceful shutdown/exit handshake with SIGKILL fallback. Synchronous so it
69568
+ * is safe inside `process.on("exit")` handlers: the shutdown request and
69569
+ * exit notification are written immediately; the SIGKILL timer covers
69570
+ * servers that ignore them (and stdin EOF reaps them when we die first).
69571
+ */
69572
+ shutdown() {
69573
+ if (!this.alive)
69574
+ return;
69575
+ void this.conn.request("shutdown", null, SHUTDOWN_TIMEOUT_MS).catch(() => {
69576
+ });
69577
+ this.conn.notify("exit");
69578
+ const killTimer = setTimeout(() => {
69579
+ if (this.alive)
69580
+ this.proc.kill("SIGKILL");
69581
+ }, KILL_GRACE_MS);
69582
+ killTimer.unref();
69583
+ }
69584
+ markDead() {
69585
+ this.alive = false;
69586
+ this.conn.dispose();
69587
+ const waiters = this.waiters;
69588
+ this.waiters = [];
69589
+ for (const waiter of waiters)
69590
+ waiter.resolve([]);
69591
+ }
69592
+ waitForPublish(uri, timeoutMs) {
69593
+ const cached4 = this.published.get(uri);
69594
+ if (cached4 !== void 0)
69595
+ return Promise.resolve(cached4);
69596
+ if (!this.alive)
69597
+ return Promise.resolve(null);
69598
+ return new Promise((resolve2) => {
69599
+ const waiter = {
69600
+ uri,
69601
+ resolve: (diagnostics) => {
69602
+ clearTimeout(timer);
69603
+ resolve2(diagnostics);
69604
+ }
69605
+ };
69606
+ const timer = setTimeout(() => {
69607
+ this.waiters = this.waiters.filter((w) => w !== waiter);
69608
+ resolve2(null);
69609
+ }, timeoutMs);
69610
+ timer.unref();
69611
+ this.waiters.push(waiter);
69612
+ });
69613
+ }
69614
+ async pullDiagnostics(uri, timeoutMs) {
69615
+ try {
69616
+ const report = await this.conn.request("textDocument/diagnostic", { textDocument: { uri } }, timeoutMs);
69617
+ if (report?.kind === "full")
69618
+ return report.items ?? [];
69619
+ if (report?.kind === "unchanged")
69620
+ return this.published.get(uri) ?? [];
69621
+ return "unsupported";
69622
+ } catch (error51) {
69623
+ if (error51 instanceof JsonRpcRequestError) {
69624
+ if (error51.code === SERVER_CANCELLED)
69625
+ return "retry";
69626
+ if (error51.code === METHOD_NOT_FOUND)
69627
+ return "unsupported";
69628
+ }
69629
+ return "unsupported";
69630
+ }
69631
+ }
69632
+ };
69633
+ function extensionOf(filePath) {
69634
+ const dot = filePath.lastIndexOf(".");
69635
+ return dot === -1 ? "" : filePath.slice(dot).toLowerCase();
69636
+ }
69637
+
69638
+ // ../ggcoder/dist/core/lsp/format.js
69639
+ init_esm_shims();
69640
+ var SEVERITY_ERROR = 1;
69641
+ var MAX_DIAGNOSTICS = 5;
69642
+ function formatDiagnostics(relPath, diagnostics) {
69643
+ const errors = diagnostics.filter((d) => (d.severity ?? SEVERITY_ERROR) === SEVERITY_ERROR);
69644
+ if (errors.length === 0)
69645
+ return "";
69646
+ const lines = errors.slice(0, MAX_DIAGNOSTICS).map((d) => {
69647
+ const line = d.range.start.line + 1;
69648
+ const character = d.range.start.character + 1;
69649
+ const message = d.message.split("\n")[0];
69650
+ const source2 = d.source ? ` (${d.source})` : "";
69651
+ return `L${line}:${character} ${message}${source2}`;
69652
+ });
69653
+ const overflow = errors.length > MAX_DIAGNOSTICS ? `
69654
+ \u2026and ${errors.length - MAX_DIAGNOSTICS} more error${errors.length - MAX_DIAGNOSTICS === 1 ? "" : "s"}` : "";
69655
+ return `
69656
+
69657
+ Diagnostics in ${relPath} (informational \u2014 may resolve after related edits):
69658
+ ` + lines.join("\n") + overflow;
69659
+ }
69660
+
69661
+ // ../ggcoder/dist/core/lsp/servers.js
69662
+ init_esm_shims();
69663
+ import fs7 from "fs";
69664
+ import path7 from "path";
69665
+ import { fileURLToPath } from "url";
69666
+ var WINDOWS_SUFFIXES = [".cmd", ".exe", ".bat"];
69667
+ function isExecutableFile(candidate) {
69668
+ try {
69669
+ const stat = fs7.statSync(candidate);
69670
+ return stat.isFile();
69671
+ } catch {
69672
+ return false;
69673
+ }
69674
+ }
69675
+ function candidateNames(name) {
69676
+ if (process.platform !== "win32")
69677
+ return [name];
69678
+ return [name, ...WINDOWS_SUFFIXES.map((suffix) => `${name}${suffix}`)];
69679
+ }
69680
+ var MODULE_DIR = path7.dirname(fileURLToPath(import.meta.url));
69681
+ function binDirsUpFrom(start) {
69682
+ const dirs = [];
69683
+ let dir = start;
69684
+ for (; ; ) {
69685
+ dirs.push(path7.join(dir, "node_modules", ".bin"));
69686
+ const parent = path7.dirname(dir);
69687
+ if (parent === dir)
69688
+ break;
69689
+ dir = parent;
69690
+ }
69691
+ return dirs;
69692
+ }
69693
+ function findExecutable(name, projectRoot) {
69694
+ const names = candidateNames(name);
69695
+ const binDirs = [...binDirsUpFrom(projectRoot), ...binDirsUpFrom(MODULE_DIR)];
69696
+ for (const binDir of binDirs) {
69697
+ for (const candidate of names) {
69698
+ const binPath = path7.join(binDir, candidate);
69699
+ if (isExecutableFile(binPath))
69700
+ return binPath;
69701
+ }
69702
+ }
69703
+ const pathEnv = process.env.PATH ?? "";
69704
+ for (const pathDir of pathEnv.split(path7.delimiter)) {
69705
+ if (!pathDir)
69706
+ continue;
69707
+ for (const candidate of names) {
69708
+ const binPath = path7.join(pathDir, candidate);
69709
+ if (isExecutableFile(binPath))
69710
+ return binPath;
69711
+ }
69712
+ }
69713
+ return null;
69714
+ }
69715
+ function findInNodeModulesUp(relPath, start) {
69716
+ let dir = start;
69717
+ for (; ; ) {
69718
+ const candidate = path7.join(dir, "node_modules", relPath);
69719
+ if (fs7.existsSync(candidate))
69720
+ return candidate;
69721
+ const parent = path7.dirname(dir);
69722
+ if (parent === dir)
69723
+ return null;
69724
+ dir = parent;
69725
+ }
69726
+ }
69727
+ function findPackageBinScript(pkgName, binName, start) {
69728
+ const pkgJsonPath = findInNodeModulesUp(path7.join(pkgName, "package.json"), start);
69729
+ if (!pkgJsonPath)
69730
+ return null;
69731
+ try {
69732
+ const pkg = JSON.parse(fs7.readFileSync(pkgJsonPath, "utf8"));
69733
+ const bin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.[binName];
69734
+ if (!bin)
69735
+ return null;
69736
+ const script = path7.join(path7.dirname(pkgJsonPath), bin);
69737
+ return fs7.existsSync(script) ? script : null;
69738
+ } catch {
69739
+ return null;
69740
+ }
69741
+ }
69742
+ function resolveNodeServer(pkgName, binName, projectRoot, args) {
69743
+ const script = findPackageBinScript(pkgName, binName, projectRoot) ?? findPackageBinScript(pkgName, binName, MODULE_DIR);
69744
+ if (script)
69745
+ return { command: process.execPath, args: [script, ...args] };
69746
+ const bin = findExecutable(binName, projectRoot);
69747
+ return bin ? { command: bin, args } : null;
69748
+ }
69749
+ var TSSERVER_REL_PATH = path7.join("typescript", "lib", "tsserver.js");
69750
+ function projectTsserverPath(projectRoot) {
69751
+ return findInNodeModulesUp(TSSERVER_REL_PATH, projectRoot);
69752
+ }
69753
+ function bundledTsserverPath() {
69754
+ return findInNodeModulesUp(TSSERVER_REL_PATH, MODULE_DIR);
69755
+ }
69756
+ var TS_LANGUAGE_IDS = {
69757
+ ".ts": "typescript",
69758
+ ".mts": "typescript",
69759
+ ".cts": "typescript",
69760
+ ".tsx": "typescriptreact",
69761
+ ".js": "javascript",
69762
+ ".mjs": "javascript",
69763
+ ".cjs": "javascript",
69764
+ ".jsx": "javascriptreact"
69765
+ };
69766
+ var LSP_SERVER_CATALOG = [
69767
+ {
69768
+ id: "typescript",
69769
+ extensions: [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"],
69770
+ rootMarkers: [
69771
+ "tsconfig.json",
69772
+ "jsconfig.json",
69773
+ "pnpm-lock.yaml",
69774
+ "package-lock.json",
69775
+ "yarn.lock",
69776
+ "bun.lockb"
69777
+ ],
69778
+ languageIdFor: (extension) => TS_LANGUAGE_IDS[extension] ?? "typescript",
69779
+ resolveCommand(projectRoot) {
69780
+ const command = resolveNodeServer("typescript-language-server", "typescript-language-server", projectRoot, ["--stdio"]);
69781
+ if (!command)
69782
+ return null;
69783
+ if (projectTsserverPath(projectRoot))
69784
+ return command;
69785
+ const tsserver = bundledTsserverPath();
69786
+ if (!tsserver)
69787
+ return null;
69788
+ return { ...command, initializationOptions: { tsserver: { path: tsserver } } };
69789
+ }
69790
+ },
69791
+ {
69792
+ id: "python",
69793
+ extensions: [".py"],
69794
+ rootMarkers: [
69795
+ "pyrightconfig.json",
69796
+ "pyproject.toml",
69797
+ "setup.py",
69798
+ "setup.cfg",
69799
+ "requirements.txt",
69800
+ "Pipfile"
69801
+ ],
69802
+ languageIdFor: () => "python",
69803
+ resolveCommand(projectRoot) {
69804
+ return resolveNodeServer("pyright", "pyright-langserver", projectRoot, ["--stdio"]);
69805
+ }
69806
+ },
69807
+ {
69808
+ id: "go",
69809
+ extensions: [".go"],
69810
+ rootMarkers: ["go.mod"],
69811
+ languageIdFor: () => "go",
69812
+ resolveCommand(projectRoot) {
69813
+ const bin = findExecutable("gopls", projectRoot);
69814
+ return bin ? { command: bin, args: ["serve"] } : null;
69815
+ }
69816
+ },
69817
+ {
69818
+ id: "rust",
69819
+ extensions: [".rs"],
69820
+ rootMarkers: ["Cargo.toml"],
69821
+ languageIdFor: () => "rust",
69822
+ resolveCommand(projectRoot) {
69823
+ const bin = findExecutable("rust-analyzer", projectRoot);
69824
+ return bin ? { command: bin, args: [] } : null;
69825
+ }
69826
+ },
69827
+ {
69828
+ id: "clangd",
69829
+ extensions: [".c", ".h", ".cc", ".cpp", ".cxx", ".hpp", ".hh"],
69830
+ rootMarkers: ["compile_commands.json", ".clangd", "CMakeLists.txt"],
69831
+ languageIdFor: (extension) => extension === ".c" || extension === ".h" ? "c" : "cpp",
69832
+ resolveCommand(projectRoot) {
69833
+ const bin = findExecutable("clangd", projectRoot);
69834
+ return bin ? { command: bin, args: ["--log=error"] } : null;
69835
+ }
69836
+ }
69837
+ ];
69838
+ function serverForFile(filePath, catalog = LSP_SERVER_CATALOG) {
69839
+ const extension = path7.extname(filePath).toLowerCase();
69840
+ if (!extension)
69841
+ return null;
69842
+ return catalog.find((spec) => spec.extensions.includes(extension)) ?? null;
69843
+ }
69844
+ function findProjectRoot(filePath, markers, ceiling) {
69845
+ const fileDir = path7.dirname(path7.resolve(filePath));
69846
+ const cap = path7.resolve(ceiling);
69847
+ const underCeiling = fileDir === cap || fileDir.startsWith(cap + path7.sep);
69848
+ let dir = fileDir;
69849
+ for (; ; ) {
69850
+ for (const marker of markers) {
69851
+ try {
69852
+ fs7.statSync(path7.join(dir, marker));
69853
+ return dir;
69854
+ } catch {
69855
+ }
69856
+ }
69857
+ if (underCeiling && dir === cap)
69858
+ break;
69859
+ const parent = path7.dirname(dir);
69860
+ if (parent === dir)
69861
+ break;
69862
+ dir = parent;
69863
+ }
69864
+ return fileDir;
69865
+ }
69866
+
69867
+ // ../ggcoder/dist/core/lsp/manager.js
69868
+ var DEFAULT_WARM_BUDGET_MS = 3e3;
69869
+ var DEFAULT_FIRST_BUDGET_MS = 8e3;
69870
+ var INIT_TIMEOUT_MS = 1e4;
69871
+ var LspManager = class {
69872
+ cwd;
69873
+ catalog;
69874
+ warmBudgetMs;
69875
+ firstBudgetMs;
69876
+ /** (serverId\0root) → in-flight or settled client; null = broken for session. */
69877
+ clients = /* @__PURE__ */ new Map();
69878
+ /** Keys that have completed at least one diagnostics pass (warm). */
69879
+ warmKeys = /* @__PURE__ */ new Set();
69880
+ shutDown = false;
69881
+ constructor(cwd2, options) {
69882
+ this.cwd = cwd2;
69883
+ this.catalog = options?.catalog ?? LSP_SERVER_CATALOG;
69884
+ this.warmBudgetMs = options?.warmBudgetMs ?? DEFAULT_WARM_BUDGET_MS;
69885
+ this.firstBudgetMs = options?.firstBudgetMs ?? DEFAULT_FIRST_BUDGET_MS;
69886
+ }
69887
+ /**
69888
+ * Diagnostics for `filePath` after its content became `content` on disk.
69889
+ * Returns a formatted informational block, or "" when the file is clean,
69890
+ * unsupported, or anything at all goes wrong (silent graceful degradation).
69891
+ */
69892
+ async diagnosticsAfterWrite(filePath, content) {
69893
+ if (this.shutDown)
69894
+ return "";
69895
+ try {
69896
+ const spec = serverForFile(filePath, this.catalog);
69897
+ if (!spec)
69898
+ return "";
69899
+ const root = findProjectRoot(filePath, spec.rootMarkers, this.cwd);
69900
+ const key = `${spec.id}\0${root}`;
69901
+ const budgetMs = this.warmKeys.has(key) ? this.warmBudgetMs : this.firstBudgetMs;
69902
+ const work = this.collect(key, spec, root, filePath, content, budgetMs);
69903
+ return await withBudget(work, budgetMs);
69904
+ } catch (error51) {
69905
+ log("WARN", "lsp", `diagnostics failed for ${filePath}`, {
69906
+ error: error51 instanceof Error ? error51.message : String(error51)
69907
+ });
69908
+ return "";
69909
+ }
69910
+ }
69911
+ /** Shut down every pooled server. Safe in process exit handlers. */
69912
+ shutdownAll() {
69913
+ this.shutDown = true;
69914
+ for (const pending of this.clients.values()) {
69915
+ void pending.then((client) => client?.shutdown()).catch(() => {
69916
+ });
69917
+ }
69918
+ this.clients.clear();
69919
+ this.warmKeys.clear();
69920
+ }
69921
+ async collect(key, spec, root, filePath, content, budgetMs) {
69922
+ const client = await this.ensureClient(key, spec, root);
69923
+ if (!client)
69924
+ return "";
69925
+ if (!client.isAlive) {
69926
+ this.clients.set(key, Promise.resolve(null));
69927
+ log("WARN", "lsp", `${spec.id} server died`, { root });
69928
+ return "";
69929
+ }
69930
+ const uri = client.syncDocument(path8.resolve(this.cwd, filePath), content);
69931
+ const diagnostics = await client.collectDiagnostics(uri, budgetMs);
69932
+ this.warmKeys.add(key);
69933
+ if (diagnostics === null)
69934
+ return "";
69935
+ const relPath = path8.relative(this.cwd, path8.resolve(this.cwd, filePath));
69936
+ return formatDiagnostics(relPath, diagnostics);
69937
+ }
69938
+ ensureClient(key, spec, root) {
69939
+ const existing = this.clients.get(key);
69940
+ if (existing)
69941
+ return existing;
69942
+ const pending = (async () => {
69943
+ const command = spec.resolveCommand(root);
69944
+ if (!command) {
69945
+ log("INFO", "lsp", `${spec.id} language server not available`, { root });
69946
+ return null;
69947
+ }
69948
+ try {
69949
+ const startedAt = Date.now();
69950
+ const client = new LspClient(spec, root, command);
69951
+ await client.initialize(INIT_TIMEOUT_MS);
69952
+ log("INFO", "lsp", `${spec.id} server initialized`, {
69953
+ root,
69954
+ ms: String(Date.now() - startedAt)
69955
+ });
69956
+ return client;
69957
+ } catch (error51) {
69958
+ log("WARN", "lsp", `${spec.id} server failed to start`, {
69959
+ root,
69960
+ error: error51 instanceof Error ? error51.message : String(error51)
69961
+ });
69962
+ return null;
69963
+ }
69964
+ })();
69965
+ this.clients.set(key, pending);
69966
+ return pending;
69967
+ }
69968
+ };
69969
+ function withBudget(work, budgetMs) {
69970
+ return new Promise((resolve2) => {
69971
+ const timer = setTimeout(() => resolve2(""), budgetMs);
69972
+ timer.unref();
69973
+ work.then((result) => {
69974
+ clearTimeout(timer);
69975
+ resolve2(result);
69976
+ }).catch(() => {
69977
+ clearTimeout(timer);
69978
+ resolve2("");
69979
+ });
69980
+ });
69981
+ }
69982
+
69293
69983
  // ../ggcoder/dist/tools/read.js
69294
69984
  init_esm_shims();
69295
- import fs11 from "fs/promises";
69296
- import path10 from "path";
69985
+ import fs12 from "fs/promises";
69986
+ import path12 from "path";
69297
69987
 
69298
69988
  // ../ggcoder/dist/tools/path-utils.js
69299
69989
  init_esm_shims();
69300
- import fs7 from "fs/promises";
69301
- import path7 from "path";
69990
+ import fs8 from "fs/promises";
69991
+ import path9 from "path";
69302
69992
  import os4 from "os";
69303
69993
  function resolvePath(cwd2, filePath) {
69304
69994
  if (filePath.startsWith("~")) {
69305
- filePath = path7.join(os4.homedir(), filePath.slice(1));
69995
+ filePath = path9.join(os4.homedir(), filePath.slice(1));
69306
69996
  }
69307
- return path7.resolve(cwd2, filePath);
69997
+ return path9.resolve(cwd2, filePath);
69308
69998
  }
69309
69999
  async function rejectSymlink(resolved) {
69310
70000
  try {
69311
- const stat = await fs7.lstat(resolved);
70001
+ const stat = await fs8.lstat(resolved);
69312
70002
  if (stat.isSymbolicLink()) {
69313
70003
  throw new Error(`Refusing to follow symlink: ${resolved}`);
69314
70004
  }
@@ -69369,34 +70059,34 @@ function truncateTail(content, maxLines = MAX_LINES, maxBytes = MAX_BYTES2) {
69369
70059
 
69370
70060
  // ../ggcoder/dist/tools/overflow.js
69371
70061
  init_esm_shims();
69372
- import fs8 from "fs/promises";
70062
+ import fs9 from "fs/promises";
69373
70063
  import os5 from "os";
69374
- import path8 from "path";
70064
+ import path10 from "path";
69375
70065
  async function writeOverflow(content, prefix) {
69376
- const filePath = path8.join(os5.tmpdir(), `gg-${prefix}-${Date.now()}.txt`);
69377
- await fs8.writeFile(filePath, content, { encoding: "utf-8", mode: 384 });
70066
+ const filePath = path10.join(os5.tmpdir(), `gg-${prefix}-${Date.now()}.txt`);
70067
+ await fs9.writeFile(filePath, content, { encoding: "utf-8", mode: 384 });
69378
70068
  return filePath;
69379
70069
  }
69380
70070
 
69381
70071
  // ../ggcoder/dist/tools/operations.js
69382
70072
  init_esm_shims();
69383
- import fs9 from "fs/promises";
69384
- import { spawn as spawn3 } from "child_process";
70073
+ import fs10 from "fs/promises";
70074
+ import { spawn as spawn4 } from "child_process";
69385
70075
  import { createReadStream } from "fs";
69386
70076
  var localOperations = {
69387
- readFile: (path43) => fs9.readFile(path43, "utf-8"),
69388
- writeFile: async (path43, content) => {
70077
+ readFile: (path45) => fs10.readFile(path45, "utf-8"),
70078
+ writeFile: async (path45, content) => {
69389
70079
  const { dirname: dirname3 } = await import("path");
69390
- await fs9.mkdir(dirname3(path43), { recursive: true });
69391
- await fs9.writeFile(path43, content, "utf-8");
70080
+ await fs10.mkdir(dirname3(path45), { recursive: true });
70081
+ await fs10.writeFile(path45, content, "utf-8");
69392
70082
  },
69393
- stat: (path43) => fs9.stat(path43),
69394
- lstat: (path43) => fs9.lstat(path43),
69395
- readdir: (path43, options) => fs9.readdir(path43, options),
69396
- mkdir: (path43) => fs9.mkdir(path43, { recursive: true }).then(() => {
70083
+ stat: (path45) => fs10.stat(path45),
70084
+ lstat: (path45) => fs10.lstat(path45),
70085
+ readdir: (path45, options) => fs10.readdir(path45, options),
70086
+ mkdir: (path45) => fs10.mkdir(path45, { recursive: true }).then(() => {
69397
70087
  }),
69398
- createReadStream: (path43, encoding) => createReadStream(path43, { encoding }),
69399
- spawn: (command, args, options) => spawn3(command, args, {
70088
+ createReadStream: (path45, encoding) => createReadStream(path45, { encoding }),
70089
+ spawn: (command, args, options) => spawn4(command, args, {
69400
70090
  cwd: options.cwd,
69401
70091
  env: options.env,
69402
70092
  detached: options.detached,
@@ -69439,9 +70129,9 @@ async function assertFresh(tracker, resolvedPath, ops) {
69439
70129
 
69440
70130
  // ../ggcoder/dist/utils/image.js
69441
70131
  init_esm_shims();
69442
- import fs10 from "fs/promises";
70132
+ import fs11 from "fs/promises";
69443
70133
  import os6 from "os";
69444
- import path9 from "path";
70134
+ import path11 from "path";
69445
70135
  import { execFile } from "child_process";
69446
70136
  import { promisify } from "util";
69447
70137
  var execFileAsync = promisify(execFile);
@@ -69489,7 +70179,7 @@ async function compressVideoToFit(inputPath, targetBytes = COMPRESS_TARGET_BYTES
69489
70179
  }
69490
70180
  const totalKbps = Math.floor(targetBytes * 8 / durationSec / 1e3 * 0.9);
69491
70181
  const videoKbps = Math.max(COMPRESS_MIN_VIDEO_KBPS, totalKbps - COMPRESS_AUDIO_KBPS);
69492
- const outPath = path9.join(os6.tmpdir(), `ggcoder-compressed-${Date.now()}.mp4`);
70182
+ const outPath = path11.join(os6.tmpdir(), `ggcoder-compressed-${Date.now()}.mp4`);
69493
70183
  try {
69494
70184
  await execFileAsync("ffmpeg", [
69495
70185
  "-y",
@@ -69517,7 +70207,7 @@ async function compressVideoToFit(inputPath, targetBytes = COMPRESS_TARGET_BYTES
69517
70207
  outPath
69518
70208
  ], { signal, maxBuffer: 16 * 1024 * 1024 });
69519
70209
  } catch (err) {
69520
- await fs10.unlink(outPath).catch(() => {
70210
+ await fs11.unlink(outPath).catch(() => {
69521
70211
  });
69522
70212
  return {
69523
70213
  ok: false,
@@ -69527,15 +70217,15 @@ async function compressVideoToFit(inputPath, targetBytes = COMPRESS_TARGET_BYTES
69527
70217
  let compressedBytes;
69528
70218
  let originalBytes;
69529
70219
  try {
69530
- compressedBytes = (await fs10.stat(outPath)).size;
69531
- originalBytes = (await fs10.stat(inputPath)).size;
70220
+ compressedBytes = (await fs11.stat(outPath)).size;
70221
+ originalBytes = (await fs11.stat(inputPath)).size;
69532
70222
  } catch {
69533
- await fs10.unlink(outPath).catch(() => {
70223
+ await fs11.unlink(outPath).catch(() => {
69534
70224
  });
69535
70225
  return { ok: false, reason: "compression produced no usable output" };
69536
70226
  }
69537
70227
  if (compressedBytes > targetBytes) {
69538
- await fs10.unlink(outPath).catch(() => {
70228
+ await fs11.unlink(outPath).catch(() => {
69539
70229
  });
69540
70230
  return {
69541
70231
  ok: false,
@@ -69561,7 +70251,7 @@ var VIDEO_MEDIA_TYPES = {
69561
70251
  };
69562
70252
  var MEDIA_TYPES = IMAGE_MEDIA_TYPES;
69563
70253
  function isAttachablePath(filePath) {
69564
- const ext = path9.extname(filePath).toLowerCase();
70254
+ const ext = path11.extname(filePath).toLowerCase();
69565
70255
  return ATTACHABLE_EXTENSIONS.has(ext);
69566
70256
  }
69567
70257
  function resolvePath2(filePath, cwd2) {
@@ -69574,9 +70264,9 @@ function resolvePath2(filePath, cwd2) {
69574
70264
  }
69575
70265
  resolved = resolved.replace(/\\(.)/g, "$1");
69576
70266
  if (resolved.startsWith("~/")) {
69577
- resolved = path9.join(process.env.HOME ?? "/", resolved.slice(2));
69578
- } else if (!path9.isAbsolute(resolved)) {
69579
- resolved = path9.join(cwd2, resolved);
70267
+ resolved = path11.join(process.env.HOME ?? "/", resolved.slice(2));
70268
+ } else if (!path11.isAbsolute(resolved)) {
70269
+ resolved = path11.join(cwd2, resolved);
69580
70270
  }
69581
70271
  return resolved;
69582
70272
  }
@@ -69611,7 +70301,7 @@ async function extractImagePaths(text, cwd2) {
69611
70301
  var extractMediaPaths = extractImagePaths;
69612
70302
  async function fileExists(filePath) {
69613
70303
  try {
69614
- const stat = await fs10.stat(filePath);
70304
+ const stat = await fs11.stat(filePath);
69615
70305
  return stat.isFile();
69616
70306
  } catch {
69617
70307
  return false;
@@ -69689,13 +70379,13 @@ async function downscaleForPreview(buffer) {
69689
70379
  }
69690
70380
  }
69691
70381
  async function readImageFile(filePath) {
69692
- const ext = path9.extname(filePath).toLowerCase();
69693
- const fileName = path9.basename(filePath);
70382
+ const ext = path11.extname(filePath).toLowerCase();
70383
+ const fileName = path11.basename(filePath);
69694
70384
  if (VIDEO_EXTENSIONS.has(ext)) {
69695
70385
  try {
69696
70386
  const mediaType = VIDEO_MEDIA_TYPES[ext] ?? "video/mp4";
69697
- const stat = await fs10.stat(filePath);
69698
- const data = stat.size <= MAX_VIDEO_BYTES ? (await fs10.readFile(filePath)).toString("base64") : "";
70387
+ const stat = await fs11.stat(filePath);
70388
+ const data = stat.size <= MAX_VIDEO_BYTES ? (await fs11.readFile(filePath)).toString("base64") : "";
69699
70389
  return { kind: "video", fileName, filePath, mediaType, data };
69700
70390
  } catch (err) {
69701
70391
  const reason = err instanceof Error ? err.message : String(err);
@@ -69710,7 +70400,7 @@ async function readImageFile(filePath) {
69710
70400
  }
69711
70401
  if (TEXT_EXTENSIONS.has(ext)) {
69712
70402
  try {
69713
- const content = await fs10.readFile(filePath, "utf-8");
70403
+ const content = await fs11.readFile(filePath, "utf-8");
69714
70404
  return { kind: "text", fileName, filePath, mediaType: "text/plain", data: content };
69715
70405
  } catch (err) {
69716
70406
  const reason = err instanceof Error ? err.message : String(err);
@@ -69725,7 +70415,7 @@ async function readImageFile(filePath) {
69725
70415
  }
69726
70416
  try {
69727
70417
  const mediaType = MEDIA_TYPES[ext] ?? "image/png";
69728
- const rawBuffer = await fs10.readFile(filePath);
70418
+ const rawBuffer = await fs11.readFile(filePath);
69729
70419
  const { buffer, mediaType: finalMediaType } = await shrinkToFit(rawBuffer, mediaType);
69730
70420
  return {
69731
70421
  kind: "image",
@@ -69773,8 +70463,8 @@ function getClipboardImage() {
69773
70463
  return;
69774
70464
  }
69775
70465
  try {
69776
- const rawBuffer = await fs10.readFile(tmpPath);
69777
- await fs10.unlink(tmpPath).catch(() => {
70466
+ const rawBuffer = await fs11.readFile(tmpPath);
70467
+ await fs11.unlink(tmpPath).catch(() => {
69778
70468
  });
69779
70469
  const { buffer: finalBuffer, mediaType: finalMediaType } = await shrinkToFit(rawBuffer, mediaType);
69780
70470
  resolve2({
@@ -69855,10 +70545,10 @@ function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead, vide
69855
70545
  async execute({ file_path, offset, limit: limit2 }, context) {
69856
70546
  const resolved = resolvePath(cwd2, file_path);
69857
70547
  await rejectSymlink(resolved);
69858
- const ext = path10.extname(resolved).toLowerCase();
70548
+ const ext = path12.extname(resolved).toLowerCase();
69859
70549
  if (IMAGE_EXTENSIONS.has(ext)) {
69860
70550
  try {
69861
- const rawBuffer = await fs11.readFile(resolved);
70551
+ const rawBuffer = await fs12.readFile(resolved);
69862
70552
  const mediaType = IMAGE_MEDIA_TYPES[ext] ?? "image/png";
69863
70553
  const { buffer, mediaType: finalMediaType } = await shrinkToFit(rawBuffer, mediaType);
69864
70554
  const resizedNote = buffer.length < rawBuffer.length ? ` (resized from ${rawBuffer.length} to ${buffer.length} bytes)` : "";
@@ -69908,7 +70598,7 @@ function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead, vide
69908
70598
  videoPath = result2.path;
69909
70599
  note = ` (auto-compressed from ${(result2.originalBytes / (1024 * 1024)).toFixed(0)} MB to ${(result2.compressedBytes / (1024 * 1024)).toFixed(0)} MB for analysis)`;
69910
70600
  }
69911
- const rawBuffer = await fs11.readFile(videoPath);
70601
+ const rawBuffer = await fs12.readFile(videoPath);
69912
70602
  const mediaType = VIDEO_MEDIA_TYPES[ext] ?? "video/mp4";
69913
70603
  return {
69914
70604
  content: [
@@ -69926,7 +70616,7 @@ function createReadTool(cwd2, readFiles, ops = localOperations, onFileRead, vide
69926
70616
  return `Could not read video ${resolved}: ${reason}`;
69927
70617
  } finally {
69928
70618
  if (compressedPath)
69929
- await fs11.unlink(compressedPath).catch(() => {
70619
+ await fs12.unlink(compressedPath).catch(() => {
69930
70620
  });
69931
70621
  }
69932
70622
  }
@@ -69981,8 +70671,8 @@ init_esm_shims();
69981
70671
 
69982
70672
  // ../ggcoder/dist/tools/write.js
69983
70673
  init_esm_shims();
69984
- import fs12 from "fs/promises";
69985
- import path11 from "path";
70674
+ import fs13 from "fs/promises";
70675
+ import path13 from "path";
69986
70676
 
69987
70677
  // ../ggcoder/dist/core/runtime-mode.js
69988
70678
  init_esm_shims();
@@ -70004,7 +70694,7 @@ var WriteParams = external_exports.object({
70004
70694
  file_path: external_exports.string().describe("The file path to write to"),
70005
70695
  content: external_exports.string().describe("The content to write")
70006
70696
  });
70007
- function createWriteTool(cwd2, readFiles, ops = localOperations, planModeRefOrOnFileMutated, onFileMutated, onPreFileMutation) {
70697
+ function createWriteTool(cwd2, readFiles, ops = localOperations, planModeRefOrOnFileMutated, onFileMutated, onPreFileMutation, getDiagnostics) {
70008
70698
  const planModeRef = isPlanModeRef(planModeRefOrOnFileMutated) ? planModeRefOrOnFileMutated : void 0;
70009
70699
  const mutationCallback = isMutationCallback(planModeRefOrOnFileMutated) ? planModeRefOrOnFileMutated : onFileMutated;
70010
70700
  return {
@@ -70016,12 +70706,12 @@ function createWriteTool(cwd2, readFiles, ops = localOperations, planModeRefOrOn
70016
70706
  const resolved = resolvePath(cwd2, file_path);
70017
70707
  await rejectSymlink(resolved);
70018
70708
  if (isPlanModeActive(planModeRef)) {
70019
- const plansDir = path11.join(cwd2, ".gg", "plans");
70020
- const relative = path11.relative(plansDir, resolved);
70021
- if (relative.startsWith("..") || path11.isAbsolute(relative)) {
70709
+ const plansDir = path13.join(cwd2, ".gg", "plans");
70710
+ const relative = path13.relative(plansDir, resolved);
70711
+ if (relative.startsWith("..") || path13.isAbsolute(relative)) {
70022
70712
  return `Error: write is restricted in plan mode. You can only write to .gg/plans/. Got: ${file_path}`;
70023
70713
  }
70024
- await fs12.mkdir(plansDir, { recursive: true });
70714
+ await fs13.mkdir(plansDir, { recursive: true });
70025
70715
  }
70026
70716
  if (readFiles) {
70027
70717
  const exists = await ops.stat(resolved).then(() => true, () => false);
@@ -70033,15 +70723,22 @@ function createWriteTool(cwd2, readFiles, ops = localOperations, planModeRefOrOn
70033
70723
  await ops.writeFile(resolved, content);
70034
70724
  await recordWrite(readFiles, resolved, content, ops);
70035
70725
  await mutationCallback?.(resolved);
70726
+ let diagnosticsNote = "";
70727
+ if (getDiagnostics) {
70728
+ try {
70729
+ diagnosticsNote = await getDiagnostics(resolved, content);
70730
+ } catch {
70731
+ }
70732
+ }
70036
70733
  const lines = content.split("\n").length;
70037
- return `Wrote ${lines} lines to ${resolved}`;
70734
+ return `Wrote ${lines} lines to ${resolved}` + diagnosticsNote;
70038
70735
  }
70039
70736
  };
70040
70737
  }
70041
70738
 
70042
70739
  // ../ggcoder/dist/tools/edit.js
70043
70740
  init_esm_shims();
70044
- import path12 from "path";
70741
+ import path14 from "path";
70045
70742
 
70046
70743
  // ../ggcoder/dist/tools/edit-diff.js
70047
70744
  init_esm_shims();
@@ -70150,16 +70847,16 @@ var Diff = class {
70150
70847
  }
70151
70848
  }
70152
70849
  }
70153
- addToPath(path43, added, removed, oldPosInc, options) {
70154
- const last = path43.lastComponent;
70850
+ addToPath(path45, added, removed, oldPosInc, options) {
70851
+ const last = path45.lastComponent;
70155
70852
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
70156
70853
  return {
70157
- oldPos: path43.oldPos + oldPosInc,
70854
+ oldPos: path45.oldPos + oldPosInc,
70158
70855
  lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
70159
70856
  };
70160
70857
  } else {
70161
70858
  return {
70162
- oldPos: path43.oldPos + oldPosInc,
70859
+ oldPos: path45.oldPos + oldPosInc,
70163
70860
  lastComponent: { count: 1, added, removed, previousComponent: last }
70164
70861
  };
70165
70862
  }
@@ -70907,7 +71604,7 @@ function tryMatch(working, old, next, replaceAll) {
70907
71604
  newWorking: working.slice(0, match.index) + next + working.slice(match.index + match.matchLength)
70908
71605
  };
70909
71606
  }
70910
- function createEditTool(cwd2, readFiles, ops = localOperations, planModeRefOrOnFileMutated, onFileMutated, onPreFileMutation) {
71607
+ function createEditTool(cwd2, readFiles, ops = localOperations, planModeRefOrOnFileMutated, onFileMutated, onPreFileMutation, getDiagnostics) {
70911
71608
  const planModeRef = isPlanModeRef2(planModeRefOrOnFileMutated) ? planModeRefOrOnFileMutated : void 0;
70912
71609
  const mutationCallback = isMutationCallback2(planModeRefOrOnFileMutated) ? planModeRefOrOnFileMutated : onFileMutated;
70913
71610
  return {
@@ -70926,7 +71623,7 @@ function createEditTool(cwd2, readFiles, ops = localOperations, planModeRefOrOnF
70926
71623
  const hasCRLF = original.includes("\r\n");
70927
71624
  const originalNormalized = hasCRLF ? original.replace(/\r\n/g, "\n") : original;
70928
71625
  let working = originalNormalized;
70929
- const fileName = path12.basename(resolved);
71626
+ const fileName = path14.basename(resolved);
70930
71627
  const outcomes = new Array(edits.length);
70931
71628
  for (let i = 0; i < edits.length; i++) {
70932
71629
  const { old_text, new_text, replace_all } = edits[i];
@@ -71028,15 +71725,22 @@ ${f.closestSnippet}`;
71028
71725
  ` : "";
71029
71726
  throw new Error(header + formatFailures());
71030
71727
  }
71031
- const relPath = path12.relative(cwd2, resolved);
71728
+ const relPath = path14.relative(cwd2, resolved);
71032
71729
  const diff3 = generateDiff(originalNormalized, working, relPath);
71033
71730
  const changed = working !== originalNormalized;
71731
+ let diagnosticsNote = "";
71034
71732
  if (changed) {
71035
71733
  const finalContent = hasCRLF ? working.replace(/\n/g, "\r\n") : working;
71036
71734
  await onPreFileMutation?.(resolved);
71037
71735
  await ops.writeFile(resolved, finalContent);
71038
71736
  await recordWrite(readFiles, resolved, finalContent, ops);
71039
71737
  await mutationCallback?.(resolved);
71738
+ if (getDiagnostics) {
71739
+ try {
71740
+ diagnosticsNote = await getDiagnostics(resolved, finalContent);
71741
+ } catch {
71742
+ }
71743
+ }
71040
71744
  }
71041
71745
  if (failures.length === 0) {
71042
71746
  if (!changed) {
@@ -71044,13 +71748,13 @@ ${f.closestSnippet}`;
71044
71748
  return { content: summary2, details: { diff: diff3 } };
71045
71749
  }
71046
71750
  const summary = edits.length > 1 ? `Successfully applied ${edits.length} edits to ${relPath}.` : `Successfully replaced text in ${relPath}.`;
71047
- return { content: summary, details: { diff: diff3 } };
71751
+ return { content: summary + diagnosticsNote, details: { diff: diff3 } };
71048
71752
  }
71049
71753
  const noun = failures.length === 1 ? "edit" : "edits";
71050
71754
  const content = `Applied ${successCount} of ${edits.length} edits to ${relPath}.
71051
71755
  ${failures.length} ${noun} skipped \u2014 re-issue ONLY these (the rest are already done, do not redo them):
71052
71756
 
71053
- ` + formatFailures();
71757
+ ` + formatFailures() + diagnosticsNote;
71054
71758
  return { content, details: { diff: diff3 } };
71055
71759
  }
71056
71760
  };
@@ -71293,8 +71997,8 @@ Failed to spawn: ${err.message}`);
71293
71997
 
71294
71998
  // ../ggcoder/dist/tools/find.js
71295
71999
  init_esm_shims();
71296
- import fs13 from "fs/promises";
71297
- import path13 from "path";
72000
+ import fs14 from "fs/promises";
72001
+ import path15 from "path";
71298
72002
  var FindParams = external_exports.object({
71299
72003
  pattern: external_exports.string().describe("Glob pattern to match files (e.g. '**/*.ts', 'src/**/*.tsx')"),
71300
72004
  path: external_exports.string().optional().describe("Directory to search in (defaults to cwd)")
@@ -71340,7 +72044,7 @@ ${filtered.length} file(s) found`;
71340
72044
  }
71341
72045
  async function loadGitignore(dir) {
71342
72046
  try {
71343
- const content = await fs13.readFile(path13.join(dir, ".gitignore"), "utf-8");
72047
+ const content = await fs14.readFile(path15.join(dir, ".gitignore"), "utf-8");
71344
72048
  return content.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
71345
72049
  } catch {
71346
72050
  return [];
@@ -71350,7 +72054,7 @@ async function loadGitignore(dir) {
71350
72054
  // ../ggcoder/dist/tools/grep.js
71351
72055
  init_esm_shims();
71352
72056
  import readline from "readline";
71353
- import path14 from "path";
72057
+ import path16 from "path";
71354
72058
  var GrepParams = external_exports.object({
71355
72059
  pattern: external_exports.string().describe("Search pattern (regex supported)"),
71356
72060
  path: external_exports.string().optional().describe("File or directory to search (defaults to cwd)"),
@@ -71406,10 +72110,10 @@ function createGrepTool(cwd2, ops = localOperations) {
71406
72110
  }
71407
72111
  scannedCandidates += 1;
71408
72112
  const entry = typeof item === "string" ? item : item.path;
71409
- const ext = path14.extname(entry).toLowerCase();
72113
+ const ext = path16.extname(entry).toLowerCase();
71410
72114
  if (BINARY_EXTENSIONS.has(ext))
71411
72115
  continue;
71412
- const filePath = path14.join(dir, entry);
72116
+ const filePath = path16.join(dir, entry);
71413
72117
  const fileResults = await searchFile(filePath, regex2, cwd2, maxResults - results.length, ops);
71414
72118
  results.push(...fileResults);
71415
72119
  }
@@ -71419,7 +72123,7 @@ function createGrepTool(cwd2, ops = localOperations) {
71419
72123
  }
71420
72124
  async function searchFile(filePath, regex2, cwd2, maxResults, ops) {
71421
72125
  const results = [];
71422
- const relPath = path14.relative(cwd2, filePath);
72126
+ const relPath = path16.relative(cwd2, filePath);
71423
72127
  try {
71424
72128
  const fileStat = await ops.stat(filePath);
71425
72129
  if (fileStat.size > MAX_FILE_SIZE)
@@ -71481,7 +72185,7 @@ ${results.length} match(es) found`;
71481
72185
 
71482
72186
  // ../ggcoder/dist/tools/ls.js
71483
72187
  init_esm_shims();
71484
- import path15 from "path";
72188
+ import path17 from "path";
71485
72189
  var LsParams = external_exports.object({
71486
72190
  path: external_exports.string().optional().describe("Directory path (defaults to cwd)"),
71487
72191
  all: external_exports.boolean().optional().describe("Show hidden files (default: false)")
@@ -71503,7 +72207,7 @@ function createLsTool(cwd2, ops = localOperations) {
71503
72207
  }
71504
72208
  for (const file2 of files) {
71505
72209
  try {
71506
- const stat = await ops.stat(path15.join(resolved, file2.name));
72210
+ const stat = await ops.stat(path17.join(resolved, file2.name));
71507
72211
  const size = formatSize(stat.size);
71508
72212
  const type2 = file2.isSymbolicLink() ? "l" : "f";
71509
72213
  lines.push(`${type2} ${size.padStart(8)} ${file2.name}`);
@@ -71529,13 +72233,8 @@ function formatSize(bytes) {
71529
72233
 
71530
72234
  // ../ggcoder/dist/tools/subagent.js
71531
72235
  init_esm_shims();
71532
- import { spawn as spawn4 } from "child_process";
72236
+ import { spawn as spawn5 } from "child_process";
71533
72237
  import { createInterface } from "readline";
71534
-
71535
- // ../ggcoder/dist/core/logger.js
71536
- init_esm_shims();
71537
-
71538
- // ../ggcoder/dist/tools/subagent.js
71539
72238
  var SUB_AGENT_MAX_TURNS = 10;
71540
72239
  var SUB_AGENT_MAX_OUTPUT_CHARS = 1e5;
71541
72240
  var SUB_AGENT_MAX_OUTPUT_LINES = 500;
@@ -71594,7 +72293,7 @@ ${agentList}` : "\n\nNo named agents configured.";
71594
72293
  }
71595
72294
  cliArgs.push(args.task);
71596
72295
  const binPath = process.argv[1];
71597
- const child = spawn4(process.execPath, [binPath, ...cliArgs], {
72296
+ const child = spawn5(process.execPath, [binPath, ...cliArgs], {
71598
72297
  cwd: cwd2,
71599
72298
  stdio: ["ignore", "pipe", "pipe"],
71600
72299
  env: { ...process.env }
@@ -72987,9 +73686,9 @@ function createWebSearchTool() {
72987
73686
 
72988
73687
  // ../ggcoder/dist/tools/source-path.js
72989
73688
  init_esm_shims();
72990
- import { spawn as spawn5 } from "child_process";
72991
- import path16 from "path";
72992
- import { fileURLToPath } from "url";
73689
+ import { spawn as spawn6 } from "child_process";
73690
+ import path18 from "path";
73691
+ import { fileURLToPath as fileURLToPath2 } from "url";
72993
73692
  var SOURCE_PATH_TIMEOUT_MS = 12e4;
72994
73693
  var MAX_STDERR_CHARS = 1e4;
72995
73694
  var OPENSRC_BIN_ENV = "GG_CODER_OPENSRC_BIN";
@@ -73010,7 +73709,7 @@ function createSourcePathTool(cwd2) {
73010
73709
  cliArgs.push("--verbose");
73011
73710
  log("INFO", "source_path", "opensrc path start", { package: args.package, cwd: cwd2 });
73012
73711
  return new Promise((resolve2) => {
73013
- const child = spawn5(process.execPath, [opensrcBin, ...cliArgs], {
73712
+ const child = spawn6(process.execPath, [opensrcBin, ...cliArgs], {
73014
73713
  cwd: cwd2,
73015
73714
  stdio: ["ignore", "pipe", "pipe"],
73016
73715
  env: getOpenSrcEnv()
@@ -73088,8 +73787,8 @@ function getBundledOpenSrcBinPath() {
73088
73787
  const override = process.env[OPENSRC_BIN_ENV]?.trim();
73089
73788
  if (override)
73090
73789
  return override;
73091
- const currentDir = path16.dirname(fileURLToPath(import.meta.url));
73092
- return path16.resolve(currentDir, "../../node_modules/opensrc/bin/opensrc.js");
73790
+ const currentDir = path18.dirname(fileURLToPath2(import.meta.url));
73791
+ return path18.resolve(currentDir, "../../node_modules/opensrc/bin/opensrc.js");
73093
73792
  }
73094
73793
  function getOpenSrcEnv() {
73095
73794
  return {
@@ -73337,7 +74036,7 @@ ${list}`;
73337
74036
 
73338
74037
  // ../ggcoder/dist/tools/screenshot.js
73339
74038
  init_esm_shims();
73340
- import path17 from "path";
74039
+ import path19 from "path";
73341
74040
  import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
73342
74041
  var INSTALL_HINT = "Browser engine not installed. Add the optional dependency and download Chromium:\n pnpm add -w playwright && npx playwright install chromium\nThen retry the screenshot.";
73343
74042
  var ActionInput = external_exports.object({
@@ -73375,7 +74074,7 @@ function isBrowserBinaryMissing(err) {
73375
74074
  }
73376
74075
  function defaultOutPath(cwd2) {
73377
74076
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
73378
- return path17.join(cwd2, ".gg", "screenshots", `${stamp}.png`);
74077
+ return path19.join(cwd2, ".gg", "screenshots", `${stamp}.png`);
73379
74078
  }
73380
74079
  async function runActions(page, actions) {
73381
74080
  for (const action of actions ?? []) {
@@ -73426,7 +74125,7 @@ function createScreenshotTool(cwd2) {
73426
74125
  await runActions(page, args.actions);
73427
74126
  const raw = await page.screenshot({ fullPage: args.full_page ?? false });
73428
74127
  context.signal.removeEventListener("abort", onAbort);
73429
- await mkdir2(path17.dirname(outPath), { recursive: true });
74128
+ await mkdir2(path19.dirname(outPath), { recursive: true });
73430
74129
  await writeFile2(outPath, raw);
73431
74130
  const { buffer, mediaType } = await shrinkToFit(raw, "image/png");
73432
74131
  const previewBuffer = await downscaleForPreview(buffer);
@@ -73478,8 +74177,8 @@ function createEnterPlanTool(onEnterPlan) {
73478
74177
 
73479
74178
  // ../ggcoder/dist/tools/exit-plan.js
73480
74179
  init_esm_shims();
73481
- import fs14 from "fs/promises";
73482
- import path18 from "path";
74180
+ import fs15 from "fs/promises";
74181
+ import path20 from "path";
73483
74182
  var ExitPlanParams = external_exports.object({
73484
74183
  plan_path: external_exports.string().describe("Path to the plan markdown file; must be under .gg/plans/")
73485
74184
  });
@@ -73491,13 +74190,13 @@ function createExitPlanTool(cwd2, onExitPlan) {
73491
74190
  executionMode: "sequential",
73492
74191
  async execute({ plan_path }) {
73493
74192
  const resolved = resolvePath(cwd2, plan_path);
73494
- const plansDir = path18.join(cwd2, ".gg", "plans");
73495
- const relative = path18.relative(plansDir, resolved);
73496
- if (relative.startsWith("..") || path18.isAbsolute(relative)) {
74193
+ const plansDir = path20.join(cwd2, ".gg", "plans");
74194
+ const relative = path20.relative(plansDir, resolved);
74195
+ if (relative.startsWith("..") || path20.isAbsolute(relative)) {
73497
74196
  return `Error: plan_path must be under .gg/plans/. Got: ${plan_path}`;
73498
74197
  }
73499
74198
  try {
73500
- const content = await fs14.readFile(resolved, "utf-8");
74199
+ const content = await fs15.readFile(resolved, "utf-8");
73501
74200
  if (!content.trim()) {
73502
74201
  return "Error: Plan file is empty. Write your plan before calling exit_plan.";
73503
74202
  }
@@ -73515,11 +74214,14 @@ function createTools(cwd2, opts) {
73515
74214
  const processManager = new ProcessManager();
73516
74215
  const ops = opts?.operations ?? localOperations;
73517
74216
  const planModeRef = opts?.planModeRef;
74217
+ const lspEnabled = (opts?.lspDiagnostics ?? true) && ops === localOperations;
74218
+ const lspManager = lspEnabled ? new LspManager(cwd2) : void 0;
74219
+ const getDiagnostics = lspManager ? (filePath, content) => lspManager.diagnosticsAfterWrite(filePath, content) : void 0;
73518
74220
  const videoByteLimit = opts?.model ? getVideoByteLimit(opts.model) : void 0;
73519
74221
  const tools = [
73520
74222
  createReadTool(cwd2, readFiles, ops, opts?.onFileRead, videoByteLimit),
73521
- createWriteTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation),
73522
- createEditTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation),
74223
+ createWriteTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation, getDiagnostics),
74224
+ createEditTool(cwd2, readFiles, ops, planModeRef, opts?.onFileMutated, opts?.onPreFileMutation, getDiagnostics),
73523
74225
  createBashTool(cwd2, processManager, ops, planModeRef),
73524
74226
  createFindTool(cwd2),
73525
74227
  createGrepTool(cwd2, ops),
@@ -73548,24 +74250,24 @@ function createTools(cwd2, opts) {
73548
74250
  tools.push(createExitPlanTool(cwd2, opts.onExitPlan));
73549
74251
  }
73550
74252
  const rebuildReadTool = (model) => createReadTool(cwd2, readFiles, ops, opts?.onFileRead, getVideoByteLimit(model));
73551
- return { tools, processManager, rebuildReadTool };
74253
+ return { tools, processManager, rebuildReadTool, lspManager };
73552
74254
  }
73553
74255
 
73554
74256
  // ../ggcoder/dist/system-prompt.js
73555
74257
  init_esm_shims();
73556
- import fs19 from "fs/promises";
73557
- import path24 from "path";
74258
+ import fs20 from "fs/promises";
74259
+ import path26 from "path";
73558
74260
 
73559
74261
  // ../ggcoder/dist/core/skills.js
73560
74262
  init_esm_shims();
73561
- import fs15 from "fs/promises";
73562
- import path19 from "path";
74263
+ import fs16 from "fs/promises";
74264
+ import path21 from "path";
73563
74265
  async function discoverSkills(options) {
73564
74266
  const skills = [];
73565
74267
  const globalSkills = await loadSkillsFromDir(options.globalSkillsDir, "global");
73566
74268
  skills.push(...globalSkills);
73567
74269
  if (options.projectDir) {
73568
- const projectSkillsDir = path19.join(options.projectDir, ".gg", "skills");
74270
+ const projectSkillsDir = path21.join(options.projectDir, ".gg", "skills");
73569
74271
  const projectSkills = await loadSkillsFromDir(projectSkillsDir, "project");
73570
74272
  skills.push(...projectSkills);
73571
74273
  }
@@ -73575,27 +74277,27 @@ async function loadSkillsFromDir(dir, source2) {
73575
74277
  const skills = [];
73576
74278
  let dirents;
73577
74279
  try {
73578
- dirents = await fs15.readdir(dir, { withFileTypes: true });
74280
+ dirents = await fs16.readdir(dir, { withFileTypes: true });
73579
74281
  } catch {
73580
74282
  return skills;
73581
74283
  }
73582
74284
  for (const entry of dirents) {
73583
- const entryPath = path19.join(dir, entry.name);
74285
+ const entryPath = path21.join(dir, entry.name);
73584
74286
  if (entry.isFile() && entry.name.endsWith(".md")) {
73585
74287
  try {
73586
- const content = await fs15.readFile(entryPath, "utf-8");
74288
+ const content = await fs16.readFile(entryPath, "utf-8");
73587
74289
  const skill = parseSkillFile(content, source2);
73588
74290
  if (!skill.name)
73589
- skill.name = path19.basename(entry.name, ".md");
74291
+ skill.name = path21.basename(entry.name, ".md");
73590
74292
  skills.push(skill);
73591
74293
  } catch {
73592
74294
  }
73593
74295
  continue;
73594
74296
  }
73595
74297
  if (entry.isDirectory()) {
73596
- const skillFile = path19.join(entryPath, "SKILL.md");
74298
+ const skillFile = path21.join(entryPath, "SKILL.md");
73597
74299
  try {
73598
- const content = await fs15.readFile(skillFile, "utf-8");
74300
+ const content = await fs16.readFile(skillFile, "utf-8");
73599
74301
  const skill = parseSkillFile(content, source2);
73600
74302
  if (!skill.name)
73601
74303
  skill.name = entry.name;
@@ -73695,13 +74397,13 @@ var DEFAULT_TOOL_NAMES = [
73695
74397
 
73696
74398
  // ../ggcoder/dist/core/style-packs/index.js
73697
74399
  init_esm_shims();
73698
- import fs17 from "fs";
73699
- import path21 from "path";
74400
+ import fs18 from "fs";
74401
+ import path24 from "path";
73700
74402
 
73701
74403
  // ../ggcoder/dist/core/language-detector.js
73702
74404
  init_esm_shims();
73703
- import fs16 from "fs";
73704
- import path20 from "path";
74405
+ import fs17 from "fs";
74406
+ import path23 from "path";
73705
74407
  var MARKERS = {
73706
74408
  typescript: { manifests: ["tsconfig.json"], extensions: [".ts", ".tsx", ".mts", ".cts"] },
73707
74409
  // JS is only flagged when there's a package.json AND no tsconfig — pure JS projects.
@@ -73989,11 +74691,11 @@ var PACKS = {
73989
74691
 
73990
74692
  // ../ggcoder/dist/core/style-packs/index.js
73991
74693
  function loadPack(id2, cwd2) {
73992
- const overridePath = path21.join(cwd2, ".gg", "styles", `${id2}.md`);
74694
+ const overridePath = path24.join(cwd2, ".gg", "styles", `${id2}.md`);
73993
74695
  try {
73994
- const stat = fs17.statSync(overridePath);
74696
+ const stat = fs18.statSync(overridePath);
73995
74697
  if (stat.isFile()) {
73996
- return fs17.readFileSync(overridePath, "utf-8").trim();
74698
+ return fs18.readFileSync(overridePath, "utf-8").trim();
73997
74699
  }
73998
74700
  } catch {
73999
74701
  }
@@ -74032,8 +74734,8 @@ Universal rules for agent-written code:
74032
74734
 
74033
74735
  // ../ggcoder/dist/core/verify-commands.js
74034
74736
  init_esm_shims();
74035
- import fs18 from "fs";
74036
- import path23 from "path";
74737
+ import fs19 from "fs";
74738
+ import path25 from "path";
74037
74739
  function detectVerifyCommands(cwd2, active) {
74038
74740
  const cmds = [];
74039
74741
  if (active.has("typescript") || active.has("javascript")) {
@@ -74060,12 +74762,12 @@ function detectVerifyCommands(cwd2, active) {
74060
74762
  const testScript = pick2("test", "test:unit");
74061
74763
  if (testScript)
74062
74764
  cmds.push({ label: "test", command: `${runner} ${testScript}`, language: lang });
74063
- } else if (active.has("typescript") && fileExists2(path23.join(cwd2, "tsconfig.json"))) {
74765
+ } else if (active.has("typescript") && fileExists2(path25.join(cwd2, "tsconfig.json"))) {
74064
74766
  cmds.push({ label: "typecheck", command: "tsc --noEmit", language: "typescript" });
74065
74767
  }
74066
74768
  }
74067
74769
  if (active.has("python")) {
74068
- const pyproject = readFileSafe(path23.join(cwd2, "pyproject.toml"));
74770
+ const pyproject = readFileSafe(path25.join(cwd2, "pyproject.toml"));
74069
74771
  if (pyproject) {
74070
74772
  if (/\[tool\.ruff/.test(pyproject)) {
74071
74773
  cmds.push({ label: "lint", command: "ruff check .", language: "python" });
@@ -74097,10 +74799,10 @@ function detectVerifyCommands(cwd2, active) {
74097
74799
  }
74098
74800
  if (active.has("java") || active.has("kotlin")) {
74099
74801
  const lang = active.has("kotlin") ? "kotlin" : "java";
74100
- if (fileExists2(path23.join(cwd2, "gradlew"))) {
74802
+ if (fileExists2(path25.join(cwd2, "gradlew"))) {
74101
74803
  cmds.push({ label: "build", command: "./gradlew build", language: lang });
74102
74804
  cmds.push({ label: "test", command: "./gradlew test", language: lang });
74103
- } else if (fileExists2(path23.join(cwd2, "pom.xml"))) {
74805
+ } else if (fileExists2(path25.join(cwd2, "pom.xml"))) {
74104
74806
  cmds.push({ label: "verify", command: "mvn verify", language: lang });
74105
74807
  }
74106
74808
  }
@@ -74114,7 +74816,7 @@ function detectVerifyCommands(cwd2, active) {
74114
74816
  cmds.push({ label: "test", command: "dotnet test", language: "csharp" });
74115
74817
  }
74116
74818
  if (active.has("ruby")) {
74117
- if (fileExists2(path23.join(cwd2, "Gemfile"))) {
74819
+ if (fileExists2(path25.join(cwd2, "Gemfile"))) {
74118
74820
  cmds.push({ label: "lint", command: "bundle exec rubocop", language: "ruby" });
74119
74821
  cmds.push({ label: "test", command: "bundle exec rspec", language: "ruby" });
74120
74822
  }
@@ -74124,7 +74826,7 @@ function detectVerifyCommands(cwd2, active) {
74124
74826
  cmds.push({ label: "test", command: "mix test", language: "elixir" });
74125
74827
  }
74126
74828
  if (active.has("php")) {
74127
- if (fileExists2(path23.join(cwd2, "composer.json"))) {
74829
+ if (fileExists2(path25.join(cwd2, "composer.json"))) {
74128
74830
  cmds.push({ label: "test", command: "composer test", language: "php" });
74129
74831
  }
74130
74832
  }
@@ -74143,20 +74845,20 @@ function detectVerifyCommands(cwd2, active) {
74143
74845
  }
74144
74846
  function fileExists2(p) {
74145
74847
  try {
74146
- return fs18.statSync(p).isFile();
74848
+ return fs19.statSync(p).isFile();
74147
74849
  } catch {
74148
74850
  return false;
74149
74851
  }
74150
74852
  }
74151
74853
  function readFileSafe(p) {
74152
74854
  try {
74153
- return fs18.readFileSync(p, "utf-8");
74855
+ return fs19.readFileSync(p, "utf-8");
74154
74856
  } catch {
74155
74857
  return null;
74156
74858
  }
74157
74859
  }
74158
74860
  function readPackageJsonScripts(cwd2) {
74159
- const raw = readFileSafe(path23.join(cwd2, "package.json"));
74861
+ const raw = readFileSafe(path25.join(cwd2, "package.json"));
74160
74862
  if (!raw)
74161
74863
  return null;
74162
74864
  try {
@@ -74167,11 +74869,11 @@ function readPackageJsonScripts(cwd2) {
74167
74869
  }
74168
74870
  }
74169
74871
  function detectNodeRunner(cwd2) {
74170
- if (fileExists2(path23.join(cwd2, "pnpm-lock.yaml")))
74872
+ if (fileExists2(path25.join(cwd2, "pnpm-lock.yaml")))
74171
74873
  return "pnpm";
74172
- if (fileExists2(path23.join(cwd2, "yarn.lock")))
74874
+ if (fileExists2(path25.join(cwd2, "yarn.lock")))
74173
74875
  return "yarn";
74174
- if (fileExists2(path23.join(cwd2, "bun.lockb")))
74876
+ if (fileExists2(path25.join(cwd2, "bun.lockb")))
74175
74877
  return "bun";
74176
74878
  return "npm run";
74177
74879
  }
@@ -74278,7 +74980,7 @@ Explore with read/search/docs tools and read-only bash (e.g. \`git log\`, \`git
74278
74980
  async function renderApprovedPlanSection(approvedPlanPath) {
74279
74981
  if (!approvedPlanPath)
74280
74982
  return null;
74281
- const planContent = await fs19.readFile(approvedPlanPath, "utf-8").catch(() => null);
74983
+ const planContent = await fs20.readFile(approvedPlanPath, "utf-8").catch(() => null);
74282
74984
  if (planContent === null)
74283
74985
  return null;
74284
74986
  if (!planContent.trim())
@@ -74331,17 +75033,17 @@ async function collectProjectContext(cwd2) {
74331
75033
  while (!visited.has(dir)) {
74332
75034
  visited.add(dir);
74333
75035
  for (const name of CONTEXT_FILES) {
74334
- const filePath = path24.join(dir, name);
75036
+ const filePath = path26.join(dir, name);
74335
75037
  try {
74336
- const content = await fs19.readFile(filePath, "utf-8");
74337
- const relPath = path24.relative(cwd2, filePath) || name;
75038
+ const content = await fs20.readFile(filePath, "utf-8");
75039
+ const relPath = path26.relative(cwd2, filePath) || name;
74338
75040
  contextParts.push(`### ${relPath}
74339
75041
 
74340
75042
  ${content.trim()}`);
74341
75043
  } catch {
74342
75044
  }
74343
75045
  }
74344
- const parent = path24.dirname(dir);
75046
+ const parent = path26.dirname(dir);
74345
75047
  if (parent === dir)
74346
75048
  break;
74347
75049
  dir = parent;
@@ -74407,11 +75109,11 @@ async function buildSystemPrompt(cwd2, skills, planMode, approvedPlanPath, toolN
74407
75109
 
74408
75110
  // ../ggcoder/dist/session.js
74409
75111
  init_esm_shims();
74410
- import fs20 from "fs/promises";
74411
- import path25 from "path";
75112
+ import fs21 from "fs/promises";
75113
+ import path27 from "path";
74412
75114
  import os7 from "os";
74413
75115
  import crypto4 from "crypto";
74414
- var SESSION_DIR = path25.join(os7.homedir(), ".gg", "sessions");
75116
+ var SESSION_DIR = path27.join(os7.homedir(), ".gg", "sessions");
74415
75117
 
74416
75118
  // ../ggcoder/dist/core/index.js
74417
75119
  init_esm_shims();
@@ -74524,20 +75226,20 @@ init_esm_shims();
74524
75226
 
74525
75227
  // ../ggcoder/dist/core/settings-manager.js
74526
75228
  init_esm_shims();
74527
- import fs22 from "fs/promises";
75229
+ import fs23 from "fs/promises";
74528
75230
 
74529
75231
  // ../ggcoder/dist/config.js
74530
75232
  init_esm_shims();
74531
- import path26 from "path";
74532
- import fs21 from "fs/promises";
75233
+ import path28 from "path";
75234
+ import fs22 from "fs/promises";
74533
75235
  import fsSync from "fs";
74534
75236
  async function ensureAppDirs() {
74535
75237
  const paths = getAppPaths();
74536
- await fs21.mkdir(paths.agentDir, { recursive: true, mode: 448 });
74537
- await fs21.mkdir(paths.sessionsDir, { recursive: true, mode: 448 });
74538
- await fs21.mkdir(paths.skillsDir, { recursive: true, mode: 448 });
74539
- await fs21.mkdir(paths.extensionsDir, { recursive: true, mode: 448 });
74540
- await fs21.mkdir(paths.agentsDir, { recursive: true, mode: 448 });
75238
+ await fs22.mkdir(paths.agentDir, { recursive: true, mode: 448 });
75239
+ await fs22.mkdir(paths.sessionsDir, { recursive: true, mode: 448 });
75240
+ await fs22.mkdir(paths.skillsDir, { recursive: true, mode: 448 });
75241
+ await fs22.mkdir(paths.extensionsDir, { recursive: true, mode: 448 });
75242
+ await fs22.mkdir(paths.agentsDir, { recursive: true, mode: 448 });
74541
75243
  await seedDefaultAgents(paths.agentsDir);
74542
75244
  await seedDefaultSkills(paths.skillsDir);
74543
75245
  return paths;
@@ -74594,11 +75296,11 @@ Rules:
74594
75296
  `
74595
75297
  };
74596
75298
  for (const [filename, content] of Object.entries(defaults2)) {
74597
- const filePath = path26.join(agentsDir, filename);
75299
+ const filePath = path28.join(agentsDir, filename);
74598
75300
  try {
74599
- await fs21.access(filePath);
75301
+ await fs22.access(filePath);
74600
75302
  } catch {
74601
- await fs21.writeFile(filePath, content, "utf-8");
75303
+ await fs22.writeFile(filePath, content, "utf-8");
74602
75304
  }
74603
75305
  }
74604
75306
  }
@@ -74607,11 +75309,11 @@ async function seedDefaultSkills(skillsDir) {
74607
75309
  "find-skills.md": FIND_SKILLS_MD
74608
75310
  };
74609
75311
  for (const [filename, content] of Object.entries(defaults2)) {
74610
- const filePath = path26.join(skillsDir, filename);
75312
+ const filePath = path28.join(skillsDir, filename);
74611
75313
  try {
74612
- await fs21.access(filePath);
75314
+ await fs22.access(filePath);
74613
75315
  } catch {
74614
- await fs21.writeFile(filePath, content, "utf-8");
75316
+ await fs22.writeFile(filePath, content, "utf-8");
74615
75317
  }
74616
75318
  }
74617
75319
  }
@@ -74730,6 +75432,8 @@ var SettingsSchema = external_exports.object({
74730
75432
  ]).default("auto"),
74731
75433
  showTokenUsage: external_exports.boolean().default(true),
74732
75434
  idealReviewEnabled: external_exports.boolean().default(true),
75435
+ /** Append LSP diagnostics to edit/write tool results. */
75436
+ lspDiagnostics: external_exports.boolean().default(true),
74733
75437
  enabledTools: external_exports.array(external_exports.string()).optional(),
74734
75438
  /** Delete session transcripts older than this many days at startup. 0 disables pruning. */
74735
75439
  sessionRetentionDays: external_exports.number().int().min(0).default(30)
@@ -74743,6 +75447,7 @@ var DEFAULT_SETTINGS = {
74743
75447
  theme: "auto",
74744
75448
  showTokenUsage: true,
74745
75449
  idealReviewEnabled: true,
75450
+ lspDiagnostics: true,
74746
75451
  sessionRetentionDays: 30
74747
75452
  };
74748
75453
  var SettingsManager = class {
@@ -74754,7 +75459,7 @@ var SettingsManager = class {
74754
75459
  }
74755
75460
  async load() {
74756
75461
  try {
74757
- const content = await fs22.readFile(this.filePath, "utf-8");
75462
+ const content = await fs23.readFile(this.filePath, "utf-8");
74758
75463
  const raw = JSON.parse(content);
74759
75464
  this.settings = SettingsSchema.parse({ ...DEFAULT_SETTINGS, ...raw });
74760
75465
  } catch {
@@ -74765,7 +75470,7 @@ var SettingsManager = class {
74765
75470
  }
74766
75471
  async save() {
74767
75472
  const content = JSON.stringify(this.settings, null, 2);
74768
- await fs22.writeFile(this.filePath, content, "utf-8");
75473
+ await fs23.writeFile(this.filePath, content, "utf-8");
74769
75474
  }
74770
75475
  get(key) {
74771
75476
  return this.settings[key];
@@ -74781,10 +75486,10 @@ var SettingsManager = class {
74781
75486
 
74782
75487
  // ../ggcoder/dist/core/session-manager.js
74783
75488
  init_esm_shims();
74784
- import fs23 from "fs/promises";
75489
+ import fs24 from "fs/promises";
74785
75490
  import { createReadStream as createReadStream2 } from "fs";
74786
75491
  import { createInterface as createInterface2 } from "readline";
74787
- import path27 from "path";
75492
+ import path29 from "path";
74788
75493
  import crypto6 from "crypto";
74789
75494
  var DISPLAY_ITEM_CUSTOM_KIND = "display_item";
74790
75495
  function isCompletedItemLike(value) {
@@ -74819,15 +75524,15 @@ var SessionManager = class _SessionManager {
74819
75524
  this.onPersistError?.(err);
74820
75525
  }
74821
75526
  dirForCwd(cwd2) {
74822
- return path27.join(this.sessionsDir, encodeCwd(cwd2));
75527
+ return path29.join(this.sessionsDir, encodeCwd(cwd2));
74823
75528
  }
74824
75529
  async create(cwd2, provider, model) {
74825
75530
  const id2 = crypto6.randomUUID();
74826
75531
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
74827
75532
  const dir = this.dirForCwd(cwd2);
74828
- await fs23.mkdir(dir, { recursive: true });
75533
+ await fs24.mkdir(dir, { recursive: true });
74829
75534
  const fileName = `${timestamp.replace(/[:.]/g, "-")}_${id2.slice(0, 8)}.jsonl`;
74830
- const filePath = path27.join(dir, fileName);
75535
+ const filePath = path29.join(dir, fileName);
74831
75536
  const header = {
74832
75537
  type: "session",
74833
75538
  version: 2,
@@ -74838,7 +75543,7 @@ var SessionManager = class _SessionManager {
74838
75543
  model,
74839
75544
  leafId: null
74840
75545
  };
74841
- await fs23.appendFile(filePath, JSON.stringify(header) + "\n", "utf-8");
75546
+ await fs24.appendFile(filePath, JSON.stringify(header) + "\n", "utf-8");
74842
75547
  return { id: id2, path: filePath, header };
74843
75548
  }
74844
75549
  async load(sessionPath) {
@@ -74891,7 +75596,7 @@ var SessionManager = class _SessionManager {
74891
75596
  const dir = this.dirForCwd(cwd2);
74892
75597
  let files;
74893
75598
  try {
74894
- files = await fs23.readdir(dir);
75599
+ files = await fs24.readdir(dir);
74895
75600
  } catch {
74896
75601
  return [];
74897
75602
  }
@@ -74899,7 +75604,7 @@ var SessionManager = class _SessionManager {
74899
75604
  for (const file2 of files) {
74900
75605
  if (!file2.endsWith(".jsonl"))
74901
75606
  continue;
74902
- const filePath = path27.join(dir, file2);
75607
+ const filePath = path29.join(dir, file2);
74903
75608
  try {
74904
75609
  const rl = createInterface2({
74905
75610
  input: createReadStream2(filePath, { encoding: "utf-8" }),
@@ -74958,21 +75663,21 @@ var SessionManager = class _SessionManager {
74958
75663
  if (options.maxAgeDays <= 0)
74959
75664
  return result;
74960
75665
  const cutoffMs = Date.now() - options.maxAgeDays * 864e5;
74961
- const keep = new Set((options.keepPaths ?? []).map((p) => path27.resolve(p)));
75666
+ const keep = new Set((options.keepPaths ?? []).map((p) => path29.resolve(p)));
74962
75667
  let cwdDirs;
74963
75668
  try {
74964
- cwdDirs = await fs23.readdir(this.sessionsDir);
75669
+ cwdDirs = await fs24.readdir(this.sessionsDir);
74965
75670
  } catch {
74966
75671
  return result;
74967
75672
  }
74968
75673
  for (const dirName of cwdDirs) {
74969
- const dir = path27.join(this.sessionsDir, dirName);
75674
+ const dir = path29.join(this.sessionsDir, dirName);
74970
75675
  let files;
74971
75676
  try {
74972
- const stat = await fs23.stat(dir);
75677
+ const stat = await fs24.stat(dir);
74973
75678
  if (!stat.isDirectory())
74974
75679
  continue;
74975
- files = await fs23.readdir(dir);
75680
+ files = await fs24.readdir(dir);
74976
75681
  } catch {
74977
75682
  continue;
74978
75683
  }
@@ -74980,14 +75685,14 @@ var SessionManager = class _SessionManager {
74980
75685
  for (const file2 of files) {
74981
75686
  if (!file2.endsWith(".jsonl"))
74982
75687
  continue;
74983
- const filePath = path27.join(dir, file2);
74984
- if (keep.has(path27.resolve(filePath)))
75688
+ const filePath = path29.join(dir, file2);
75689
+ if (keep.has(path29.resolve(filePath)))
74985
75690
  continue;
74986
75691
  try {
74987
- const stat = await fs23.stat(filePath);
75692
+ const stat = await fs24.stat(filePath);
74988
75693
  if (stat.mtimeMs >= cutoffMs)
74989
75694
  continue;
74990
- await fs23.unlink(filePath);
75695
+ await fs24.unlink(filePath);
74991
75696
  result.deletedFiles += 1;
74992
75697
  result.freedBytes += stat.size;
74993
75698
  remaining -= 1;
@@ -74995,7 +75700,7 @@ var SessionManager = class _SessionManager {
74995
75700
  }
74996
75701
  }
74997
75702
  if (remaining === 0) {
74998
- await fs23.rmdir(dir).catch(() => {
75703
+ await fs24.rmdir(dir).catch(() => {
74999
75704
  });
75000
75705
  }
75001
75706
  }
@@ -75003,7 +75708,7 @@ var SessionManager = class _SessionManager {
75003
75708
  }
75004
75709
  async appendEntry(sessionPath, entry) {
75005
75710
  try {
75006
- await fs23.appendFile(sessionPath, JSON.stringify(entry) + "\n", "utf-8");
75711
+ await fs24.appendFile(sessionPath, JSON.stringify(entry) + "\n", "utf-8");
75007
75712
  } catch (error51) {
75008
75713
  this.handlePersistError(error51, "appendEntry");
75009
75714
  }
@@ -75016,7 +75721,7 @@ var SessionManager = class _SessionManager {
75016
75721
  }
75017
75722
  }
75018
75723
  async updateLeafUnsafe(sessionPath, leafId) {
75019
- const fd2 = await fs23.open(sessionPath, "r+");
75724
+ const fd2 = await fs24.open(sessionPath, "r+");
75020
75725
  try {
75021
75726
  const buf = Buffer.alloc(4096);
75022
75727
  const { bytesRead } = await fd2.read(buf, 0, 4096, 0);
@@ -75034,9 +75739,9 @@ var SessionManager = class _SessionManager {
75034
75739
  await fd2.write(newHeaderLine, 0, "utf-8");
75035
75740
  } else {
75036
75741
  await fd2.close();
75037
- const content = await fs23.readFile(sessionPath, "utf-8");
75742
+ const content = await fs24.readFile(sessionPath, "utf-8");
75038
75743
  const firstNewline = content.indexOf("\n");
75039
- await fs23.writeFile(sessionPath, newHeaderLine + content.slice(firstNewline), "utf-8");
75744
+ await fs24.writeFile(sessionPath, newHeaderLine + content.slice(firstNewline), "utf-8");
75040
75745
  return;
75041
75746
  }
75042
75747
  } finally {
@@ -75980,25 +76685,25 @@ function getPromptCommand(name) {
75980
76685
 
75981
76686
  // ../ggcoder/dist/core/custom-commands.js
75982
76687
  init_esm_shims();
75983
- import fs24 from "fs/promises";
75984
- import path28 from "path";
76688
+ import fs25 from "fs/promises";
76689
+ import path30 from "path";
75985
76690
  async function loadCustomCommands(cwd2) {
75986
- const commandsDir = path28.join(cwd2, ".gg", "commands");
76691
+ const commandsDir = path30.join(cwd2, ".gg", "commands");
75987
76692
  const commands = [];
75988
76693
  let files;
75989
76694
  try {
75990
- files = await fs24.readdir(commandsDir);
76695
+ files = await fs25.readdir(commandsDir);
75991
76696
  } catch {
75992
76697
  return commands;
75993
76698
  }
75994
76699
  for (const file2 of files) {
75995
76700
  if (!file2.endsWith(".md"))
75996
76701
  continue;
75997
- const filePath = path28.join(commandsDir, file2);
76702
+ const filePath = path30.join(commandsDir, file2);
75998
76703
  try {
75999
- const raw = await fs24.readFile(filePath, "utf-8");
76704
+ const raw = await fs25.readFile(filePath, "utf-8");
76000
76705
  const parsed = parseSkillFile(raw, "project");
76001
- const name = parsed.name || path28.basename(file2, ".md");
76706
+ const name = parsed.name || path30.basename(file2, ".md");
76002
76707
  commands.push({
76003
76708
  name,
76004
76709
  description: parsed.description || `Custom command from .gg/commands/${file2}`,
@@ -76019,21 +76724,21 @@ init_esm_shims();
76019
76724
 
76020
76725
  // ../ggcoder/dist/core/extensions/loader.js
76021
76726
  init_esm_shims();
76022
- import fs25 from "fs/promises";
76023
- import path29 from "path";
76727
+ import fs26 from "fs/promises";
76728
+ import path31 from "path";
76024
76729
  var ExtensionLoader = class {
76025
76730
  loaded = [];
76026
76731
  async loadAll(extensionsDir, context) {
76027
76732
  let files;
76028
76733
  try {
76029
- files = await fs25.readdir(extensionsDir);
76734
+ files = await fs26.readdir(extensionsDir);
76030
76735
  } catch {
76031
76736
  return;
76032
76737
  }
76033
76738
  for (const file2 of files) {
76034
76739
  if (!file2.endsWith(".js"))
76035
76740
  continue;
76036
- const filePath = path29.join(extensionsDir, file2);
76741
+ const filePath = path31.join(extensionsDir, file2);
76037
76742
  try {
76038
76743
  const mod = await import(filePath);
76039
76744
  const factory = typeof mod.default === "function" ? mod.default : mod.createExtension;
@@ -82438,8 +83143,8 @@ init_esm_shims();
82438
83143
 
82439
83144
  // ../ggcoder/dist/core/mcp/store.js
82440
83145
  init_esm_shims();
82441
- import path30 from "path";
82442
- import fs26 from "fs/promises";
83146
+ import path33 from "path";
83147
+ import fs27 from "fs/promises";
82443
83148
  var StoredServerEntrySchema = external_exports.object({
82444
83149
  type: external_exports.enum(["stdio", "http", "streamable-http", "sse"]).optional(),
82445
83150
  url: external_exports.string().optional(),
@@ -82457,12 +83162,12 @@ function globalMcpPath() {
82457
83162
  return getAppPaths().mcpFile;
82458
83163
  }
82459
83164
  function projectMcpPath(cwd2) {
82460
- return path30.join(cwd2, ".gg", "mcp.json");
83165
+ return path33.join(cwd2, ".gg", "mcp.json");
82461
83166
  }
82462
83167
  async function readMcpFile(filePath) {
82463
83168
  let content;
82464
83169
  try {
82465
- content = await fs26.readFile(filePath, "utf-8");
83170
+ content = await fs27.readFile(filePath, "utf-8");
82466
83171
  } catch {
82467
83172
  return { mcpServers: {} };
82468
83173
  }
@@ -82565,12 +83270,12 @@ init_esm_shims();
82565
83270
 
82566
83271
  // ../ggcoder/dist/core/agents.js
82567
83272
  init_esm_shims();
82568
- import fs27 from "fs/promises";
82569
- import path31 from "path";
83273
+ import fs28 from "fs/promises";
83274
+ import path34 from "path";
82570
83275
  async function discoverAgents(options) {
82571
83276
  const agents = [];
82572
83277
  if (options.projectDir) {
82573
- const projectAgentsDir = path31.join(options.projectDir, ".gg", "agents");
83278
+ const projectAgentsDir = path34.join(options.projectDir, ".gg", "agents");
82574
83279
  const projectAgents = await loadAgentsFromDir(projectAgentsDir, "project");
82575
83280
  agents.push(...projectAgents);
82576
83281
  }
@@ -82588,19 +83293,19 @@ async function loadAgentsFromDir(dir, source2) {
82588
83293
  const agents = [];
82589
83294
  let files;
82590
83295
  try {
82591
- files = await fs27.readdir(dir);
83296
+ files = await fs28.readdir(dir);
82592
83297
  } catch {
82593
83298
  return agents;
82594
83299
  }
82595
83300
  for (const file2 of files) {
82596
83301
  if (!file2.endsWith(".md"))
82597
83302
  continue;
82598
- const filePath = path31.join(dir, file2);
83303
+ const filePath = path34.join(dir, file2);
82599
83304
  try {
82600
- const content = await fs27.readFile(filePath, "utf-8");
83305
+ const content = await fs28.readFile(filePath, "utf-8");
82601
83306
  const agent = parseAgentFile(content, source2);
82602
83307
  if (!agent.name) {
82603
- agent.name = path31.basename(file2, ".md");
83308
+ agent.name = path34.basename(file2, ".md");
82604
83309
  }
82605
83310
  agents.push(agent);
82606
83311
  } catch {
@@ -82733,8 +83438,8 @@ var BUNDLED_AGENTS = [
82733
83438
 
82734
83439
  // ../ggcoder/dist/core/agent-session.js
82735
83440
  import crypto8 from "crypto";
82736
- import fs28 from "fs/promises";
82737
- import path33 from "path";
83441
+ import fs29 from "fs/promises";
83442
+ import path35 from "path";
82738
83443
  var AgentSession = class {
82739
83444
  eventBus = new EventBus();
82740
83445
  slashCommands = new SlashCommandRegistry();
@@ -82747,6 +83452,7 @@ var AgentSession = class {
82747
83452
  skills = [];
82748
83453
  cacheKeyLogged = false;
82749
83454
  processManager;
83455
+ lspManager;
82750
83456
  mcpManager;
82751
83457
  provider;
82752
83458
  model;
@@ -82779,10 +83485,10 @@ var AgentSession = class {
82779
83485
  this.authStorage = new AuthStorage(paths.authFile);
82780
83486
  await this.authStorage.load();
82781
83487
  this.sessionManager = new SessionManager(paths.sessionsDir);
82782
- const localGGDir = path33.join(this.cwd, ".gg");
82783
- await fs28.mkdir(path33.join(localGGDir, "skills"), { recursive: true });
82784
- await fs28.mkdir(path33.join(localGGDir, "commands"), { recursive: true });
82785
- await fs28.mkdir(path33.join(localGGDir, "agents"), { recursive: true });
83488
+ const localGGDir = path35.join(this.cwd, ".gg");
83489
+ await fs29.mkdir(path35.join(localGGDir, "skills"), { recursive: true });
83490
+ await fs29.mkdir(path35.join(localGGDir, "commands"), { recursive: true });
83491
+ await fs29.mkdir(path35.join(localGGDir, "agents"), { recursive: true });
82786
83492
  this.skills = await discoverSkills({
82787
83493
  globalSkillsDir: paths.skillsDir,
82788
83494
  projectDir: this.cwd
@@ -82791,17 +83497,19 @@ var AgentSession = class {
82791
83497
  globalAgentsDir: paths.agentsDir,
82792
83498
  projectDir: this.cwd
82793
83499
  });
82794
- const { tools, processManager } = createTools(this.cwd, {
83500
+ const { tools, processManager, lspManager } = createTools(this.cwd, {
82795
83501
  agents,
82796
83502
  skills: this.skills,
82797
83503
  provider: this.provider,
82798
83504
  model: this.model,
83505
+ lspDiagnostics: this.settingsManager.get("lspDiagnostics"),
82799
83506
  // Lazy — sessionId isn't assigned yet when createTools() runs, so we
82800
83507
  // must defer reading the cache key until the sub-agent actually fires.
82801
83508
  getCacheKey: () => this.getPromptCacheKey()
82802
83509
  });
82803
83510
  this.tools = tools;
82804
83511
  this.processManager = processManager;
83512
+ this.lspManager = lspManager;
82805
83513
  this.mcpManager = new MCPClientManager();
82806
83514
  try {
82807
83515
  let apiKey;
@@ -83134,6 +83842,7 @@ ${parsed.args}` : promptText;
83134
83842
  }
83135
83843
  async dispose() {
83136
83844
  this.processManager?.shutdownAll();
83845
+ this.lspManager?.shutdownAll();
83137
83846
  await this.mcpManager?.dispose();
83138
83847
  await this.extensionLoader.deactivateAll();
83139
83848
  this.eventBus.removeAllListeners();
@@ -83996,19 +84705,19 @@ function wrapAnsi(string4, columns, options) {
83996
84705
  return String(string4).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(expandTabs(line), columns, options)).join("\n");
83997
84706
  }
83998
84707
 
83999
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/index.js
84708
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/index.js
84000
84709
  init_esm_shims();
84001
84710
 
84002
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render.js
84711
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render.js
84003
84712
  init_esm_shims();
84004
84713
  import { Stream as Stream3 } from "stream";
84005
84714
  import process14 from "process";
84006
84715
 
84007
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
84716
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
84008
84717
  init_esm_shims();
84009
84718
  var import_react15 = __toESM(require_react(), 1);
84010
84719
  import process13 from "process";
84011
- import fs31 from "fs";
84720
+ import fs32 from "fs";
84012
84721
 
84013
84722
  // ../../node_modules/.pnpm/es-toolkit@1.46.1/node_modules/es-toolkit/dist/compat/index.mjs
84014
84723
  init_esm_shims();
@@ -84382,7 +85091,7 @@ function autoBind(self, { include, exclude } = {}) {
84382
85091
  return self;
84383
85092
  }
84384
85093
 
84385
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
85094
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
84386
85095
  var import_signal_exit2 = __toESM(require_signal_exit(), 1);
84387
85096
 
84388
85097
  // ../../node_modules/.pnpm/patch-console@2.0.0/node_modules/patch-console/dist/index.js
@@ -84432,7 +85141,7 @@ var patchConsole = (callback) => {
84432
85141
  };
84433
85142
  var dist_default = patchConsole;
84434
85143
 
84435
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
85144
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
84436
85145
  var import_constants4 = __toESM(require_constants(), 1);
84437
85146
 
84438
85147
  // ../../node_modules/.pnpm/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js
@@ -86201,7 +86910,7 @@ function wrapAnsi2(string4, columns, options) {
86201
86910
  init_esm_shims();
86202
86911
  import process5 from "process";
86203
86912
  import { execFileSync as execFileSync2 } from "child_process";
86204
- import fs29 from "fs";
86913
+ import fs30 from "fs";
86205
86914
  import tty from "tty";
86206
86915
  var defaultColumns = 80;
86207
86916
  var defaultRows = 24;
@@ -86231,7 +86940,7 @@ var isForegroundProcess = () => {
86231
86940
  return true;
86232
86941
  }
86233
86942
  try {
86234
- const statContents = fs29.readFileSync("/proc/self/stat", "utf8");
86943
+ const statContents = fs30.readFileSync("/proc/self/stat", "utf8");
86235
86944
  const closingParenthesisIndex = statContents.lastIndexOf(") ");
86236
86945
  if (closingParenthesisIndex === -1) {
86237
86946
  return false;
@@ -86275,8 +86984,8 @@ function terminalSize() {
86275
86984
  }
86276
86985
  var devTty = () => {
86277
86986
  try {
86278
- const flags = process5.platform === "darwin" ? fs29.constants.O_EVTONLY | fs29.constants.O_NONBLOCK : fs29.constants.O_NONBLOCK;
86279
- const { columns, rows } = tty.WriteStream(fs29.openSync("/dev/tty", flags));
86987
+ const flags = process5.platform === "darwin" ? fs30.constants.O_EVTONLY | fs30.constants.O_NONBLOCK : fs30.constants.O_NONBLOCK;
86988
+ const { columns, rows } = tty.WriteStream(fs30.openSync("/dev/tty", flags));
86280
86989
  return { columns, rows };
86281
86990
  } catch {
86282
86991
  }
@@ -86304,22 +87013,22 @@ var resize = () => {
86304
87013
  }
86305
87014
  };
86306
87015
 
86307
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/utils.js
87016
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/utils.js
86308
87017
  init_esm_shims();
86309
87018
  import process6 from "process";
86310
87019
  var isDev = () => process6.env["DEV"] === "true";
86311
87020
 
86312
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/reconciler.js
87021
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/reconciler.js
86313
87022
  init_esm_shims();
86314
87023
  var import_react_reconciler = __toESM(require_react_reconciler(), 1);
86315
87024
  var import_constants3 = __toESM(require_constants(), 1);
86316
87025
  var Scheduler = __toESM(require_scheduler(), 1);
86317
87026
  var import_react = __toESM(require_react(), 1);
86318
87027
 
86319
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/dom.js
87028
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/dom.js
86320
87029
  init_esm_shims();
86321
87030
 
86322
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-text.js
87031
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-text.js
86323
87032
  init_esm_shims();
86324
87033
 
86325
87034
  // ../../node_modules/.pnpm/widest-line@6.0.0/node_modules/widest-line/index.js
@@ -86460,7 +87169,7 @@ function widestLine(string4) {
86460
87169
  return lineWidth;
86461
87170
  }
86462
87171
 
86463
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-text.js
87172
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-text.js
86464
87173
  var cache = /* @__PURE__ */ new Map();
86465
87174
  var measureText = (text) => {
86466
87175
  if (text.length === 0) {
@@ -86481,7 +87190,7 @@ var measureText = (text) => {
86481
87190
  };
86482
87191
  var measure_text_default = measureText;
86483
87192
 
86484
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/wrap-text.js
87193
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/wrap-text.js
86485
87194
  init_esm_shims();
86486
87195
 
86487
87196
  // ../../node_modules/.pnpm/cli-truncate@5.2.0/node_modules/cli-truncate/index.js
@@ -87437,7 +88146,7 @@ function cliTruncate(text, columns, options = {}) {
87437
88146
  throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
87438
88147
  }
87439
88148
 
87440
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/wrap-text.js
88149
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/wrap-text.js
87441
88150
  var cache2 = {};
87442
88151
  var wrapText = (text, maxWidth, wrapType) => {
87443
88152
  const cacheKey = text + String(maxWidth) + String(wrapType);
@@ -87467,13 +88176,13 @@ var wrapText = (text, maxWidth, wrapType) => {
87467
88176
  };
87468
88177
  var wrap_text_default = wrapText;
87469
88178
 
87470
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/squash-text-nodes.js
88179
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/squash-text-nodes.js
87471
88180
  init_esm_shims();
87472
88181
 
87473
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/sanitize-ansi.js
88182
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/sanitize-ansi.js
87474
88183
  init_esm_shims();
87475
88184
 
87476
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ansi-tokenizer.js
88185
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ansi-tokenizer.js
87477
88186
  init_esm_shims();
87478
88187
  var bellCharacter = "\x07";
87479
88188
  var escapeCharacter = "\x1B";
@@ -87781,7 +88490,7 @@ var tokenizeAnsi2 = (text) => {
87781
88490
  return tokens2;
87782
88491
  };
87783
88492
 
87784
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/sanitize-ansi.js
88493
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/sanitize-ansi.js
87785
88494
  var sgrParametersRegex = /^[\d:;]*$/;
87786
88495
  var sanitizeAnsi = (text) => {
87787
88496
  if (!hasAnsiControlCharacters(text)) {
@@ -87801,7 +88510,7 @@ var sanitizeAnsi = (text) => {
87801
88510
  };
87802
88511
  var sanitize_ansi_default = sanitizeAnsi;
87803
88512
 
87804
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/squash-text-nodes.js
88513
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/squash-text-nodes.js
87805
88514
  var squashTextNodes = (node) => {
87806
88515
  let text = "";
87807
88516
  for (let index = 0; index < node.childNodes.length; index++) {
@@ -87826,7 +88535,7 @@ var squashTextNodes = (node) => {
87826
88535
  };
87827
88536
  var squash_text_nodes_default = squashTextNodes;
87828
88537
 
87829
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/dom.js
88538
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/dom.js
87830
88539
  var createNode = (nodeName) => {
87831
88540
  const node = {
87832
88541
  nodeName,
@@ -87942,7 +88651,7 @@ var setTextNodeValue = (node, text) => {
87942
88651
  markNodeAsDirty(node);
87943
88652
  };
87944
88653
 
87945
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/styles.js
88654
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/styles.js
87946
88655
  init_esm_shims();
87947
88656
  var applyPositionStyles = (node, style) => {
87948
88657
  if ("position" in style) {
@@ -88164,10 +88873,10 @@ var styles2 = (node, style = {}) => {
88164
88873
  };
88165
88874
  var styles_default = styles2;
88166
88875
 
88167
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/reconciler.js
88876
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/reconciler.js
88168
88877
  if (isDev()) {
88169
88878
  try {
88170
- await import("./devtools-V37F5FXY.js");
88879
+ await import("./devtools-UOTIITAN.js");
88171
88880
  } catch (error51) {
88172
88881
  if (error51.code === "ERR_MODULE_NOT_FOUND") {
88173
88882
  console.warn(`
@@ -88216,8 +88925,8 @@ var cleanupYogaNode = (node) => {
88216
88925
  var currentUpdatePriority = import_constants3.NoEventPriority;
88217
88926
  var currentRootNode;
88218
88927
  async function loadPackageJson() {
88219
- const fs37 = await import("fs");
88220
- const content = fs37.readFileSync(new URL("../package.json", import.meta.url), "utf8");
88928
+ const fs38 = await import("fs");
88929
+ const content = fs38.readFileSync(new URL("../package.json", import.meta.url), "utf8");
88221
88930
  return JSON.parse(content);
88222
88931
  }
88223
88932
  var packageJson = isDev() ? await loadPackageJson() : { name: void 0, version: void 0 };
@@ -88425,10 +89134,10 @@ var reconciler_default = (0, import_react_reconciler.default)({
88425
89134
  rendererVersion: packageJson.version
88426
89135
  });
88427
89136
 
88428
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/renderer.js
89137
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/renderer.js
88429
89138
  init_esm_shims();
88430
89139
 
88431
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-node-to-output.js
89140
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-node-to-output.js
88432
89141
  init_esm_shims();
88433
89142
 
88434
89143
  // ../../node_modules/.pnpm/indent-string@5.0.0/node_modules/indent-string/index.js
@@ -88465,18 +89174,18 @@ function indentString(string4, count = 1, options = {}) {
88465
89174
  return string4.replace(regex2, indent2.repeat(count));
88466
89175
  }
88467
89176
 
88468
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/get-max-width.js
89177
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/get-max-width.js
88469
89178
  init_esm_shims();
88470
89179
  var getMaxWidth = (yogaNode) => {
88471
89180
  return yogaNode.getComputedWidth() - yogaNode.getComputedPadding(src_default.EDGE_LEFT) - yogaNode.getComputedPadding(src_default.EDGE_RIGHT) - yogaNode.getComputedBorder(src_default.EDGE_LEFT) - yogaNode.getComputedBorder(src_default.EDGE_RIGHT);
88472
89181
  };
88473
89182
  var get_max_width_default = getMaxWidth;
88474
89183
 
88475
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-border.js
89184
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-border.js
88476
89185
  init_esm_shims();
88477
89186
  var import_cli_boxes = __toESM(require_cli_boxes(), 1);
88478
89187
 
88479
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/colorize.js
89188
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/colorize.js
88480
89189
  init_esm_shims();
88481
89190
  var rgbRegex = /^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;
88482
89191
  var ansiRegex2 = /^ansi256\(\s?(\d+)\s?\)$/;
@@ -88519,7 +89228,7 @@ var colorize = (str2, color2, type2) => {
88519
89228
  };
88520
89229
  var colorize_default = colorize;
88521
89230
 
88522
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-border.js
89231
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-border.js
88523
89232
  var renderBorder = (x, y, node, output) => {
88524
89233
  if (node.style.borderStyle) {
88525
89234
  const width = node.yogaNode.getComputedWidth();
@@ -88580,7 +89289,7 @@ var renderBorder = (x, y, node, output) => {
88580
89289
  };
88581
89290
  var render_border_default = renderBorder;
88582
89291
 
88583
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-background.js
89292
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-background.js
88584
89293
  init_esm_shims();
88585
89294
  var renderBackground = (x, y, node, output) => {
88586
89295
  if (!node.style.backgroundColor) {
@@ -88604,7 +89313,7 @@ var renderBackground = (x, y, node, output) => {
88604
89313
  };
88605
89314
  var render_background_default = renderBackground;
88606
89315
 
88607
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-node-to-output.js
89316
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-node-to-output.js
88608
89317
  var applyPaddingToText = (node, text) => {
88609
89318
  const yogaNode = node.childNodes[0]?.yogaNode;
88610
89319
  if (yogaNode) {
@@ -88712,7 +89421,7 @@ var renderNodeToOutput = (node, output, options) => {
88712
89421
  };
88713
89422
  var render_node_to_output_default = renderNodeToOutput;
88714
89423
 
88715
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/output.js
89424
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/output.js
88716
89425
  init_esm_shims();
88717
89426
 
88718
89427
  // ../../node_modules/.pnpm/@alcalzone+ansi-tokenize@0.2.5/node_modules/@alcalzone/ansi-tokenize/build/index.js
@@ -88981,7 +89690,7 @@ function tokenize4(str2, endChar = Number.POSITIVE_INFINITY) {
88981
89690
  return ret;
88982
89691
  }
88983
89692
 
88984
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/output.js
89693
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/output.js
88985
89694
  var OutputCaches = class {
88986
89695
  widths = /* @__PURE__ */ new Map();
88987
89696
  blockWidths = /* @__PURE__ */ new Map();
@@ -89153,7 +89862,7 @@ var Output = class {
89153
89862
  }
89154
89863
  };
89155
89864
 
89156
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/renderer.js
89865
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/renderer.js
89157
89866
  var renderer = (node, isScreenReaderEnabled) => {
89158
89867
  if (node.yogaNode) {
89159
89868
  if (isScreenReaderEnabled) {
@@ -89209,7 +89918,7 @@ var renderer = (node, isScreenReaderEnabled) => {
89209
89918
  };
89210
89919
  var renderer_default = renderer;
89211
89920
 
89212
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/log-update.js
89921
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/log-update.js
89213
89922
  init_esm_shims();
89214
89923
 
89215
89924
  // ../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js
@@ -89258,7 +89967,7 @@ cliCursor.toggle = (force, writableStream) => {
89258
89967
  };
89259
89968
  var cli_cursor_default = cliCursor;
89260
89969
 
89261
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/cursor-helpers.js
89970
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/cursor-helpers.js
89262
89971
  init_esm_shims();
89263
89972
  var showCursorEscape = "\x1B[?25h";
89264
89973
  var hideCursorEscape = "\x1B[?25l";
@@ -89290,7 +89999,7 @@ var buildReturnToBottomPrefix = (cursorWasShown, previousLineCount, previousCurs
89290
89999
  return hideCursorEscape + buildReturnToBottom(previousLineCount, previousCursorPosition);
89291
90000
  };
89292
90001
 
89293
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/log-update.js
90002
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/log-update.js
89294
90003
  var visibleLineCount = (lines, str2) => str2.endsWith("\n") ? lines.length - 1 : lines.length;
89295
90004
  var createStandard = (stream2, { showCursor = false } = {}) => {
89296
90005
  let previousLineCount = 0;
@@ -89508,7 +90217,7 @@ var create2 = (stream2, { showCursor = false, incremental = false } = {}) => {
89508
90217
  var logUpdate = { create: create2 };
89509
90218
  var log_update_default = logUpdate;
89510
90219
 
89511
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/write-synchronized.js
90220
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/write-synchronized.js
89512
90221
  init_esm_shims();
89513
90222
  var bsu = "\x1B[?2026h";
89514
90223
  var esu = "\x1B[?2026l";
@@ -89516,18 +90225,18 @@ function shouldSynchronize(stream2) {
89516
90225
  return "isTTY" in stream2 && stream2.isTTY === true && !is_in_ci_default;
89517
90226
  }
89518
90227
 
89519
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/instances.js
90228
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/instances.js
89520
90229
  init_esm_shims();
89521
90230
  var instances = /* @__PURE__ */ new WeakMap();
89522
90231
  var instances_default = instances;
89523
90232
 
89524
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/App.js
90233
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/App.js
89525
90234
  init_esm_shims();
89526
90235
  var import_react14 = __toESM(require_react(), 1);
89527
90236
  import { EventEmitter as EventEmitter2 } from "events";
89528
90237
  import process12 from "process";
89529
90238
 
89530
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/input-parser.js
90239
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/input-parser.js
89531
90240
  init_esm_shims();
89532
90241
  var escape2 = "\x1B";
89533
90242
  var isCsiParameterByte = (byte) => {
@@ -89682,7 +90391,7 @@ var createInputParser = () => {
89682
90391
  };
89683
90392
  };
89684
90393
 
89685
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/AppContext.js
90394
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/AppContext.js
89686
90395
  init_esm_shims();
89687
90396
  var import_react2 = __toESM(require_react(), 1);
89688
90397
  var AppContext = (0, import_react2.createContext)({
@@ -89692,7 +90401,7 @@ var AppContext = (0, import_react2.createContext)({
89692
90401
  AppContext.displayName = "InternalAppContext";
89693
90402
  var AppContext_default = AppContext;
89694
90403
 
89695
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StdinContext.js
90404
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StdinContext.js
89696
90405
  init_esm_shims();
89697
90406
  var import_react3 = __toESM(require_react(), 1);
89698
90407
  import { EventEmitter } from "events";
@@ -89710,7 +90419,7 @@ var StdinContext = (0, import_react3.createContext)({
89710
90419
  StdinContext.displayName = "InternalStdinContext";
89711
90420
  var StdinContext_default = StdinContext;
89712
90421
 
89713
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StdoutContext.js
90422
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StdoutContext.js
89714
90423
  init_esm_shims();
89715
90424
  var import_react4 = __toESM(require_react(), 1);
89716
90425
  import process10 from "process";
@@ -89722,7 +90431,7 @@ var StdoutContext = (0, import_react4.createContext)({
89722
90431
  StdoutContext.displayName = "InternalStdoutContext";
89723
90432
  var StdoutContext_default = StdoutContext;
89724
90433
 
89725
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StderrContext.js
90434
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/StderrContext.js
89726
90435
  init_esm_shims();
89727
90436
  var import_react5 = __toESM(require_react(), 1);
89728
90437
  import process11 from "process";
@@ -89734,7 +90443,7 @@ var StderrContext = (0, import_react5.createContext)({
89734
90443
  StderrContext.displayName = "InternalStderrContext";
89735
90444
  var StderrContext_default = StderrContext;
89736
90445
 
89737
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/FocusContext.js
90446
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/FocusContext.js
89738
90447
  init_esm_shims();
89739
90448
  var import_react6 = __toESM(require_react(), 1);
89740
90449
  var FocusContext = (0, import_react6.createContext)({
@@ -89761,7 +90470,7 @@ var FocusContext = (0, import_react6.createContext)({
89761
90470
  FocusContext.displayName = "InternalFocusContext";
89762
90471
  var FocusContext_default = FocusContext;
89763
90472
 
89764
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/CursorContext.js
90473
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/CursorContext.js
89765
90474
  init_esm_shims();
89766
90475
  var import_react7 = __toESM(require_react(), 1);
89767
90476
  var CursorContext = (0, import_react7.createContext)({
@@ -89771,15 +90480,15 @@ var CursorContext = (0, import_react7.createContext)({
89771
90480
  CursorContext.displayName = "InternalCursorContext";
89772
90481
  var CursorContext_default = CursorContext;
89773
90482
 
89774
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorBoundary.js
90483
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorBoundary.js
89775
90484
  init_esm_shims();
89776
90485
  var import_react13 = __toESM(require_react(), 1);
89777
90486
 
89778
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorOverview.js
90487
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorOverview.js
89779
90488
  init_esm_shims();
89780
90489
  var import_react12 = __toESM(require_react(), 1);
89781
90490
  var import_stack_utils = __toESM(require_stack_utils(), 1);
89782
- import * as fs30 from "fs";
90491
+ import * as fs31 from "fs";
89783
90492
  import { cwd } from "process";
89784
90493
 
89785
90494
  // ../../node_modules/.pnpm/code-excerpt@4.0.0/node_modules/code-excerpt/dist/index.js
@@ -89818,23 +90527,23 @@ var codeExcerpt = (source2, line, options = {}) => {
89818
90527
  };
89819
90528
  var dist_default3 = codeExcerpt;
89820
90529
 
89821
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Box.js
90530
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Box.js
89822
90531
  init_esm_shims();
89823
90532
  var import_react10 = __toESM(require_react(), 1);
89824
90533
 
89825
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/AccessibilityContext.js
90534
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/AccessibilityContext.js
89826
90535
  init_esm_shims();
89827
90536
  var import_react8 = __toESM(require_react(), 1);
89828
90537
  var accessibilityContext = (0, import_react8.createContext)({
89829
90538
  isScreenReaderEnabled: false
89830
90539
  });
89831
90540
 
89832
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/BackgroundContext.js
90541
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/BackgroundContext.js
89833
90542
  init_esm_shims();
89834
90543
  var import_react9 = __toESM(require_react(), 1);
89835
90544
  var backgroundContext = (0, import_react9.createContext)(void 0);
89836
90545
 
89837
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Box.js
90546
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Box.js
89838
90547
  var Box = (0, import_react10.forwardRef)(({ children, backgroundColor, "aria-label": ariaLabel, "aria-hidden": ariaHidden, "aria-role": role, "aria-state": ariaState, ...style }, ref) => {
89839
90548
  const { isScreenReaderEnabled } = (0, import_react10.useContext)(accessibilityContext);
89840
90549
  const label = ariaLabel ? import_react10.default.createElement("ink-text", null, ariaLabel) : void 0;
@@ -89862,7 +90571,7 @@ var Box = (0, import_react10.forwardRef)(({ children, backgroundColor, "aria-lab
89862
90571
  Box.displayName = "Box";
89863
90572
  var Box_default = Box;
89864
90573
 
89865
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Text.js
90574
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Text.js
89866
90575
  init_esm_shims();
89867
90576
  var import_react11 = __toESM(require_react(), 1);
89868
90577
  function Text({ color: color2, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = "wrap", children, "aria-label": ariaLabel, "aria-hidden": ariaHidden = false }) {
@@ -89906,9 +90615,9 @@ function Text({ color: color2, backgroundColor, dimColor = false, bold = false,
89906
90615
  return import_react11.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: "row", textWrap: wrap }, internal_transform: transform2 }, isScreenReaderEnabled && ariaLabel ? ariaLabel : children);
89907
90616
  }
89908
90617
 
89909
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorOverview.js
89910
- var cleanupPath = (path43) => {
89911
- return path43?.replace(`file://${cwd()}/`, "");
90618
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorOverview.js
90619
+ var cleanupPath = (path45) => {
90620
+ return path45?.replace(`file://${cwd()}/`, "");
89912
90621
  };
89913
90622
  var stackUtils = new import_stack_utils.default({
89914
90623
  cwd: cwd(),
@@ -89920,8 +90629,8 @@ function ErrorOverview({ error: error51 }) {
89920
90629
  const filePath = cleanupPath(origin?.file);
89921
90630
  let excerpt;
89922
90631
  let lineWidth = 0;
89923
- if (filePath && origin?.line && fs30.existsSync(filePath)) {
89924
- const sourceCode = fs30.readFileSync(filePath, "utf8");
90632
+ if (filePath && origin?.line && fs31.existsSync(filePath)) {
90633
+ const sourceCode = fs31.readFileSync(filePath, "utf8");
89925
90634
  excerpt = dist_default3(sourceCode, origin.line);
89926
90635
  if (excerpt) {
89927
90636
  for (const { line } of excerpt) {
@@ -90015,7 +90724,7 @@ function ErrorOverview({ error: error51 }) {
90015
90724
  );
90016
90725
  }
90017
90726
 
90018
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorBoundary.js
90727
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/ErrorBoundary.js
90019
90728
  var ErrorBoundary = class extends import_react13.PureComponent {
90020
90729
  static displayName = "InternalErrorBoundary";
90021
90730
  static getDerivedStateFromError(error51) {
@@ -90035,7 +90744,7 @@ var ErrorBoundary = class extends import_react13.PureComponent {
90035
90744
  }
90036
90745
  };
90037
90746
 
90038
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/App.js
90747
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/App.js
90039
90748
  var tab = " ";
90040
90749
  var shiftTab = "\x1B[Z";
90041
90750
  var escape3 = "\x1B";
@@ -90369,7 +91078,7 @@ function App({ children, stdin, stdout, stderr, writeToStdout, writeToStderr, ex
90369
91078
  App.displayName = "InternalApp";
90370
91079
  var App_default = App;
90371
91080
 
90372
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/kitty-keyboard.js
91081
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/kitty-keyboard.js
90373
91082
  init_esm_shims();
90374
91083
  var kittyFlags = {
90375
91084
  disambiguateEscapeCodes: 1,
@@ -90396,7 +91105,7 @@ var kittyModifiers = {
90396
91105
  numLock: 128
90397
91106
  };
90398
91107
 
90399
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
91108
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/ink.js
90400
91109
  var noop4 = () => {
90401
91110
  };
90402
91111
  var kittyQueryEscapeByte = 27;
@@ -90740,7 +91449,7 @@ var Ink = class {
90740
91449
  }
90741
91450
  if (process13.env["GG_INK_DEBUG"] === "1" && (delta !== 0 || this.framePadDebt > 0)) {
90742
91451
  try {
90743
- fs31.appendFileSync("/tmp/gg-ink-debug.log", JSON.stringify({
91452
+ fs32.appendFileSync("/tmp/gg-ink-debug.log", JSON.stringify({
90744
91453
  t: Date.now() % 1e5,
90745
91454
  delta,
90746
91455
  ins: insertLineCount,
@@ -90831,8 +91540,60 @@ var Ink = class {
90831
91540
  }
90832
91541
  }
90833
91542
  // [gg patch] Toggle pad creation at runtime. See frameAnchorActive.
91543
+ // Deactivation reclaims leftover pad debt: a frame shrink right before the
91544
+ // run ended (tool panel collapse, finalization without a compensating
91545
+ // insert) left blank pad rows above the frame, and at idle nothing else
91546
+ // consumes them — they sit on screen as a permanent blank gap right above
91547
+ // the final response. While the frame is bottom-pinned the gap is
91548
+ // repainted in place with the app-provided transcript tail (footer stays
91549
+ // put); otherwise the frame rises over the pads (the vacated rows below
91550
+ // the risen frame are unwritten screen, not content).
90834
91551
  setFrameAnchorActive(active) {
91552
+ const reclaimDebt = this.frameAnchorActive && !active ? this.framePadDebt : 0;
90835
91553
  this.frameAnchorActive = active;
91554
+ if (reclaimDebt <= 0 || this.isUnmounted) {
91555
+ return;
91556
+ }
91557
+ this.framePadDebt = 0;
91558
+ if (this.options.debug || is_in_ci_default || !this.options.stdout.isTTY) {
91559
+ return;
91560
+ }
91561
+ const debt = Math.min(reclaimDebt, Math.max(0, this.options.stdout.rows - 2));
91562
+ const outputHeight = this.lastOutputHeight;
91563
+ const sync = shouldSynchronize(this.options.stdout);
91564
+ const bottomPinned = this.linesAboveFrame + outputHeight + 1 >= this.options.stdout.rows;
91565
+ if (bottomPinned && typeof this.frameShrinkBackfill === "function") {
91566
+ const needRows = Math.max(0, this.options.stdout.rows - outputHeight - 1);
91567
+ let fill;
91568
+ try {
91569
+ fill = needRows > 0 ? this.frameShrinkBackfill(needRows) : "";
91570
+ } catch {
91571
+ fill = void 0;
91572
+ }
91573
+ if (typeof fill === "string") {
91574
+ const backfillText = fill === "" || fill.endsWith("\n") ? fill : fill + "\n";
91575
+ if (sync) {
91576
+ this.options.stdout.write(bsu);
91577
+ }
91578
+ this.options.stdout.write(base_exports.cursorTo(0, 0) + base_exports.eraseDown + backfillText + this.lastOutputToRender);
91579
+ this.log.sync(this.lastOutputToRender);
91580
+ if (sync) {
91581
+ this.options.stdout.write(esu);
91582
+ }
91583
+ this.linesAboveFrame = (backfillText.match(/\n/g) ?? []).length;
91584
+ return;
91585
+ }
91586
+ }
91587
+ if (sync) {
91588
+ this.options.stdout.write(bsu);
91589
+ }
91590
+ this.log.clear();
91591
+ this.options.stdout.write(base_exports.cursorUp(debt));
91592
+ this.log(this.lastOutputToRender);
91593
+ if (sync) {
91594
+ this.options.stdout.write(esu);
91595
+ }
91596
+ this.linesAboveFrame = Math.max(0, this.linesAboveFrame - debt);
90836
91597
  }
90837
91598
  // [gg patch] Install the transcript-tail provider. See frameShrinkBackfill.
90838
91599
  setFrameShrinkBackfill(fn) {
@@ -91093,7 +91854,7 @@ var Ink = class {
91093
91854
  }
91094
91855
  };
91095
91856
 
91096
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render.js
91857
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render.js
91097
91858
  var render = (node, options) => {
91098
91859
  const inkOptions = {
91099
91860
  stdout: process14.stdout,
@@ -91148,31 +91909,31 @@ var getInstance = (stdout, createInstance, concurrent) => {
91148
91909
  return instance;
91149
91910
  };
91150
91911
 
91151
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-to-string.js
91912
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/render-to-string.js
91152
91913
  init_esm_shims();
91153
91914
  var import_constants5 = __toESM(require_constants(), 1);
91154
91915
 
91155
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Static.js
91916
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Static.js
91156
91917
  init_esm_shims();
91157
91918
  var import_react16 = __toESM(require_react(), 1);
91158
91919
 
91159
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Transform.js
91920
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Transform.js
91160
91921
  init_esm_shims();
91161
91922
  var import_react17 = __toESM(require_react(), 1);
91162
91923
 
91163
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Newline.js
91924
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Newline.js
91164
91925
  init_esm_shims();
91165
91926
  var import_react18 = __toESM(require_react(), 1);
91166
91927
 
91167
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Spacer.js
91928
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/components/Spacer.js
91168
91929
  init_esm_shims();
91169
91930
  var import_react19 = __toESM(require_react(), 1);
91170
91931
 
91171
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-input.js
91932
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-input.js
91172
91933
  init_esm_shims();
91173
91934
  var import_react21 = __toESM(require_react(), 1);
91174
91935
 
91175
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/parse-keypress.js
91936
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/parse-keypress.js
91176
91937
  init_esm_shims();
91177
91938
  import { Buffer as Buffer2 } from "buffer";
91178
91939
  var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/;
@@ -91602,13 +92363,13 @@ var parseKeypress = (s = "") => {
91602
92363
  };
91603
92364
  var parse_keypress_default = parseKeypress;
91604
92365
 
91605
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stdin.js
92366
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stdin.js
91606
92367
  init_esm_shims();
91607
92368
  var import_react20 = __toESM(require_react(), 1);
91608
92369
  var useStdin = () => (0, import_react20.useContext)(StdinContext_default);
91609
92370
  var use_stdin_default = useStdin;
91610
92371
 
91611
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-input.js
92372
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-input.js
91612
92373
  var useInput = (inputHandler, options = {}) => {
91613
92374
  const { stdin, setRawMode, internal_exitOnCtrlC, internal_eventEmitter } = use_stdin_default();
91614
92375
  (0, import_react21.useEffect)(() => {
@@ -91691,31 +92452,31 @@ var useInput = (inputHandler, options = {}) => {
91691
92452
  };
91692
92453
  var use_input_default = useInput;
91693
92454
 
91694
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-app.js
92455
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-app.js
91695
92456
  init_esm_shims();
91696
92457
  var import_react22 = __toESM(require_react(), 1);
91697
92458
  var useApp = () => (0, import_react22.useContext)(AppContext_default);
91698
92459
  var use_app_default = useApp;
91699
92460
 
91700
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stdout.js
92461
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stdout.js
91701
92462
  init_esm_shims();
91702
92463
  var import_react23 = __toESM(require_react(), 1);
91703
92464
  var useStdout = () => (0, import_react23.useContext)(StdoutContext_default);
91704
92465
  var use_stdout_default = useStdout;
91705
92466
 
91706
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stderr.js
92467
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-stderr.js
91707
92468
  init_esm_shims();
91708
92469
  var import_react24 = __toESM(require_react(), 1);
91709
92470
 
91710
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-focus.js
92471
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-focus.js
91711
92472
  init_esm_shims();
91712
92473
  var import_react25 = __toESM(require_react(), 1);
91713
92474
 
91714
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-focus-manager.js
92475
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-focus-manager.js
91715
92476
  init_esm_shims();
91716
92477
  var import_react26 = __toESM(require_react(), 1);
91717
92478
 
91718
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-is-screen-reader-enabled.js
92479
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-is-screen-reader-enabled.js
91719
92480
  init_esm_shims();
91720
92481
  var import_react27 = __toESM(require_react(), 1);
91721
92482
  var useIsScreenReaderEnabled = () => {
@@ -91724,11 +92485,11 @@ var useIsScreenReaderEnabled = () => {
91724
92485
  };
91725
92486
  var use_is_screen_reader_enabled_default = useIsScreenReaderEnabled;
91726
92487
 
91727
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-cursor.js
92488
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/hooks/use-cursor.js
91728
92489
  init_esm_shims();
91729
92490
  var import_react28 = __toESM(require_react(), 1);
91730
92491
 
91731
- // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.1_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-element.js
92492
+ // ../../node_modules/.pnpm/@kenkaiiii+ink@6.8.0-gg.2_@types+react@19.2.14_react@19.2.5/node_modules/@kenkaiiii/ink/build/measure-element.js
91732
92493
  init_esm_shims();
91733
92494
  var measureElement = (node) => ({
91734
92495
  width: node.yogaNode?.getComputedWidth() ?? 0,
@@ -92524,9 +93285,9 @@ var taskBarStore = createStore({
92524
93285
  // ../ggcoder/dist/utils/sound.js
92525
93286
  init_esm_shims();
92526
93287
  import { execFile as execFile2 } from "child_process";
92527
- import { fileURLToPath as fileURLToPath2 } from "url";
93288
+ import { fileURLToPath as fileURLToPath3 } from "url";
92528
93289
  import { resolve, dirname } from "path";
92529
- var __dirname2 = dirname(fileURLToPath2(import.meta.url));
93290
+ var __dirname2 = dirname(fileURLToPath3(import.meta.url));
92530
93291
  var notificationPath = resolve(__dirname2, "../../assets/end-notification.mp3");
92531
93292
 
92532
93293
  // ../ggcoder/dist/ui/hooks/useAgentLoop.js
@@ -93144,8 +93905,8 @@ function shortenValue(value, maxLength = MAX_DETAIL_LENGTH) {
93144
93905
  const tailLength = maxLength - 1 - headLength;
93145
93906
  return `${normalized.slice(0, headLength)}\u2026${normalized.slice(-tailLength)}`;
93146
93907
  }
93147
- function basename2(path43) {
93148
- const trimmed = path43.replace(/\/+$/u, "");
93908
+ function basename2(path45) {
93909
+ const trimmed = path45.replace(/\/+$/u, "");
93149
93910
  return trimmed.split("/").filter(Boolean).at(-1) ?? trimmed;
93150
93911
  }
93151
93912
  function uniqueValues(values) {
@@ -93557,7 +94318,7 @@ function estimateLiveAreaRows({ liveItems, streamingText, columns, perItemBudget
93557
94318
  const textRows = item.text.trim().length > 0 ? estimateWrappedRows(item.text, columns) : 0;
93558
94319
  const thinkingRows = item.thinking ? THINKING_HEADER_ROWS : 0;
93559
94320
  rows += Math.min(textRows, perItemBudget) + thinkingRows + BLOCK_OVERHEAD_ROWS;
93560
- } else if (item.kind === "tombstone" || item.kind === "banner" || isPanelReplacedToolItem(item)) {
94321
+ } else if (item.kind === "tombstone" || item.kind === "banner" || item.kind === "plan_transition" && !item.active || isPanelReplacedToolItem(item)) {
93561
94322
  continue;
93562
94323
  } else {
93563
94324
  rows += NON_TEXT_ROW_ESTIMATE;
@@ -108128,8 +108889,8 @@ function collapseSubmittedUserText(text) {
108128
108889
  }
108129
108890
 
108130
108891
  // ../ggcoder/dist/ui/terminal-history.js
108131
- import path34 from "path";
108132
- import { pathToFileURL } from "url";
108892
+ import path36 from "path";
108893
+ import { pathToFileURL as pathToFileURL2 } from "url";
108133
108894
 
108134
108895
  // ../ggcoder/dist/ui/utils/terminal-graphics.js
108135
108896
  init_esm_shims();
@@ -110417,9 +111178,9 @@ init_esm_shims();
110417
111178
  import { execFile as execFile3 } from "child_process";
110418
111179
  import { readFileSync as readFileSync5 } from "fs";
110419
111180
  import { dirname as dirname2, join as join3 } from "path";
110420
- import { fileURLToPath as fileURLToPath3 } from "url";
111181
+ import { fileURLToPath as fileURLToPath4 } from "url";
110421
111182
  function resolveCliVersion() {
110422
- let dir = dirname2(fileURLToPath3(import.meta.url));
111183
+ let dir = dirname2(fileURLToPath4(import.meta.url));
110423
111184
  for (let i = 0; i < 6; i++) {
110424
111185
  try {
110425
111186
  const manifest = JSON.parse(readFileSync5(join3(dir, "package.json"), "utf8"));
@@ -110485,11 +111246,11 @@ import { execFile as execFile4 } from "child_process";
110485
111246
 
110486
111247
  // ../ggcoder/dist/core/auto-update.js
110487
111248
  init_esm_shims();
110488
- import path35 from "path";
111249
+ import path37 from "path";
110489
111250
  import os10 from "os";
110490
111251
  var updater = createAutoUpdater({
110491
111252
  packageName: "@kenkaiiii/ggcoder",
110492
- stateFilePath: () => path35.join(os10.homedir(), ".gg", "update-state.json")
111253
+ stateFilePath: () => path37.join(os10.homedir(), ".gg", "update-state.json")
110493
111254
  });
110494
111255
  var checkAndAutoUpdate = updater.checkAndAutoUpdate;
110495
111256
  var getPendingUpdate = updater.getPendingUpdate;
@@ -110501,10 +111262,10 @@ init_esm_shims();
110501
111262
 
110502
111263
  // ../ggcoder/dist/core/setup-history.js
110503
111264
  init_esm_shims();
110504
- import fs32 from "fs";
110505
- import path36 from "path";
111265
+ import fs33 from "fs";
111266
+ import path38 from "path";
110506
111267
  import os11 from "os";
110507
- var HISTORY_PATH = path36.join(os11.homedir(), ".gg", "setup-history.json");
111268
+ var HISTORY_PATH = path38.join(os11.homedir(), ".gg", "setup-history.json");
110508
111269
 
110509
111270
  // ../ggcoder/dist/ui/components/RewindOverlay.js
110510
111271
  init_esm_shims();
@@ -110754,7 +111515,7 @@ function MessageResponse({ children, height, accentColor }) {
110754
111515
 
110755
111516
  // ../ggcoder/dist/ui/utils/highlight.js
110756
111517
  init_esm_shims();
110757
- import path37 from "path";
111518
+ import path39 from "path";
110758
111519
  var EXT_TO_LANG = {
110759
111520
  ts: "typescript",
110760
111521
  tsx: "typescript",
@@ -110782,7 +111543,7 @@ var EXT_TO_LANG = {
110782
111543
  dockerfile: "dockerfile"
110783
111544
  };
110784
111545
  function langFromPath(filePath) {
110785
- const ext = path37.extname(filePath).replace(/^\./, "").toLowerCase();
111546
+ const ext = path39.extname(filePath).replace(/^\./, "").toLowerCase();
110786
111547
  return EXT_TO_LANG[ext];
110787
111548
  }
110788
111549
  var hlModule;
@@ -112892,17 +113653,17 @@ var EventQueue = class {
112892
113653
 
112893
113654
  // src/settings.ts
112894
113655
  init_esm_shims();
112895
- import fs33 from "fs/promises";
112896
- import path38 from "path";
113656
+ import fs34 from "fs/promises";
113657
+ import path40 from "path";
112897
113658
  function settingsPath() {
112898
- return path38.join(getAppPaths().agentDir, "boss", "settings.json");
113659
+ return path40.join(getAppPaths().agentDir, "boss", "settings.json");
112899
113660
  }
112900
113661
  async function ensureDir() {
112901
- await fs33.mkdir(path38.dirname(settingsPath()), { recursive: true, mode: 448 });
113662
+ await fs34.mkdir(path40.dirname(settingsPath()), { recursive: true, mode: 448 });
112902
113663
  }
112903
113664
  async function loadSettings() {
112904
113665
  try {
112905
- const content = await fs33.readFile(settingsPath(), "utf-8");
113666
+ const content = await fs34.readFile(settingsPath(), "utf-8");
112906
113667
  const parsed = JSON.parse(content);
112907
113668
  if (!parsed || typeof parsed !== "object") return {};
112908
113669
  return parsed;
@@ -112917,8 +113678,8 @@ async function saveSettings(patch) {
112917
113678
  const merged = { ...current, ...patch };
112918
113679
  await ensureDir();
112919
113680
  const tmp = `${settingsPath()}.${process.pid}.tmp`;
112920
- await fs33.writeFile(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
112921
- await fs33.rename(tmp, settingsPath());
113681
+ await fs34.writeFile(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
113682
+ await fs34.rename(tmp, settingsPath());
112922
113683
  });
112923
113684
  writeChain = next.catch(() => void 0);
112924
113685
  await next;
@@ -113310,18 +114071,18 @@ init_esm_shims();
113310
114071
  // src/tasks-store.ts
113311
114072
  init_esm_shims();
113312
114073
  var import_react98 = __toESM(require_react(), 1);
113313
- import fs34 from "fs/promises";
113314
- import path39 from "path";
114074
+ import fs35 from "fs/promises";
114075
+ import path41 from "path";
113315
114076
  import crypto10 from "crypto";
113316
114077
  function getPlanPath() {
113317
- return path39.join(getAppPaths().agentDir, "boss", "plan.json");
114078
+ return path41.join(getAppPaths().agentDir, "boss", "plan.json");
113318
114079
  }
113319
114080
  async function ensureDir2() {
113320
- await fs34.mkdir(path39.dirname(getPlanPath()), { recursive: true, mode: 448 });
114081
+ await fs35.mkdir(path41.dirname(getPlanPath()), { recursive: true, mode: 448 });
113321
114082
  }
113322
114083
  async function loadPlan() {
113323
114084
  try {
113324
- const content = await fs34.readFile(getPlanPath(), "utf-8");
114085
+ const content = await fs35.readFile(getPlanPath(), "utf-8");
113325
114086
  const parsed = JSON.parse(content);
113326
114087
  return Array.isArray(parsed.tasks) ? parsed.tasks : [];
113327
114088
  } catch {
@@ -113335,8 +114096,8 @@ async function persist(tasks) {
113335
114096
  await ensureDir2();
113336
114097
  const finalPath = getPlanPath();
113337
114098
  const tmpPath = `${finalPath}.${process.pid}.tmp`;
113338
- await fs34.writeFile(tmpPath, snapshot, "utf-8");
113339
- await fs34.rename(tmpPath, finalPath);
114099
+ await fs35.writeFile(tmpPath, snapshot, "utf-8");
114100
+ await fs35.rename(tmpPath, finalPath);
113340
114101
  });
113341
114102
  persistChain = next.catch(() => void 0);
113342
114103
  await next;
@@ -113604,13 +114365,13 @@ function createTaskTools(deps) {
113604
114365
 
113605
114366
  // src/audio.ts
113606
114367
  init_esm_shims();
113607
- import { spawn as spawn7, execFileSync as execFileSync4 } from "child_process";
113608
- import { fileURLToPath as fileURLToPath4 } from "url";
113609
- import path40 from "path";
113610
- import fs35 from "fs";
114368
+ import { spawn as spawn8, execFileSync as execFileSync4 } from "child_process";
114369
+ import { fileURLToPath as fileURLToPath5 } from "url";
114370
+ import path43 from "path";
114371
+ import fs36 from "fs";
113611
114372
  function readMp3DurationMs(file2) {
113612
114373
  try {
113613
- const buf = fs35.readFileSync(file2);
114374
+ const buf = fs36.readFileSync(file2);
113614
114375
  let i = 0;
113615
114376
  if (buf.length >= 10 && buf[0] === 73 && buf[1] === 68 && buf[2] === 51) {
113616
114377
  const tagSize = (buf[6] & 127) << 21 | (buf[7] & 127) << 14 | (buf[8] & 127) << 7 | buf[9] & 127;
@@ -113667,10 +114428,10 @@ function getSplashAudioDurationMs() {
113667
114428
  return ms && ms > 0 ? ms : 1500;
113668
114429
  }
113669
114430
  function assetPath(name) {
113670
- const here = path40.dirname(fileURLToPath4(import.meta.url));
113671
- const dist = path40.join(here, name);
113672
- if (fs35.existsSync(dist)) return dist;
113673
- return path40.join(here, "..", "assets", name);
114431
+ const here = path43.dirname(fileURLToPath5(import.meta.url));
114432
+ const dist = path43.join(here, name);
114433
+ if (fs36.existsSync(dist)) return dist;
114434
+ return path43.join(here, "..", "assets", name);
113674
114435
  }
113675
114436
  function splashAssetPath() {
113676
114437
  return assetPath("splash.mp3");
@@ -113679,7 +114440,7 @@ function trySpawn(cmd, args) {
113679
114440
  return new Promise((resolve2) => {
113680
114441
  let resolved = false;
113681
114442
  try {
113682
- const child = spawn7(cmd, args, {
114443
+ const child = spawn8(cmd, args, {
113683
114444
  detached: true,
113684
114445
  stdio: "ignore"
113685
114446
  });
@@ -113710,15 +114471,15 @@ function trySpawn(cmd, args) {
113710
114471
  }
113711
114472
  function isWsl() {
113712
114473
  if (process.platform !== "linux") return false;
113713
- return !!process.env.WSL_DISTRO_NAME || fs35.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop");
114474
+ return !!process.env.WSL_DISTRO_NAME || fs36.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop");
113714
114475
  }
113715
114476
  async function tryPlayOnWindowsHost(file2) {
113716
114477
  try {
113717
- const here = path40.dirname(fileURLToPath4(import.meta.url));
113718
- const devAssets = path40.resolve(here, "..", "assets");
113719
- const resolved = path40.resolve(file2);
113720
- const inDist = resolved === here || resolved.startsWith(here + path40.sep);
113721
- const inAssets = resolved === devAssets || resolved.startsWith(devAssets + path40.sep);
114478
+ const here = path43.dirname(fileURLToPath5(import.meta.url));
114479
+ const devAssets = path43.resolve(here, "..", "assets");
114480
+ const resolved = path43.resolve(file2);
114481
+ const inDist = resolved === here || resolved.startsWith(here + path43.sep);
114482
+ const inAssets = resolved === devAssets || resolved.startsWith(devAssets + path43.sep);
113722
114483
  if (!inDist && !inAssets) {
113723
114484
  return false;
113724
114485
  }
@@ -113738,7 +114499,7 @@ async function tryPlayOnWindowsHost(file2) {
113738
114499
  return new Promise((resolve2) => {
113739
114500
  let resolved2 = false;
113740
114501
  try {
113741
- const child = spawn7(
114502
+ const child = spawn8(
113742
114503
  "powershell.exe",
113743
114504
  ["-NoProfile", "-WindowStyle", "Hidden", "-Command", script],
113744
114505
  {
@@ -113782,7 +114543,7 @@ async function tryPlayOnWindowsHost(file2) {
113782
114543
  }
113783
114544
  }
113784
114545
  async function playFile(file2) {
113785
- if (!fs35.existsSync(file2)) return;
114546
+ if (!fs36.existsSync(file2)) return;
113786
114547
  const platform2 = process.platform;
113787
114548
  if (platform2 === "darwin") {
113788
114549
  await trySpawn("afplay", [file2]);
@@ -113880,37 +114641,37 @@ function truncateOversizedToolResults2(messages, opts = {}) {
113880
114641
 
113881
114642
  // src/sessions.ts
113882
114643
  init_esm_shims();
113883
- import fs36 from "fs/promises";
113884
- import path41 from "path";
114644
+ import fs37 from "fs/promises";
114645
+ import path44 from "path";
113885
114646
  import crypto11 from "crypto";
113886
114647
  var BOSS_SUBDIR = "boss";
113887
114648
  var SESSIONS_SUBDIR = "sessions";
113888
114649
  function getBossDir() {
113889
- return path41.join(getAppPaths().agentDir, BOSS_SUBDIR);
114650
+ return path44.join(getAppPaths().agentDir, BOSS_SUBDIR);
113890
114651
  }
113891
114652
  function getSessionsDir() {
113892
- return path41.join(getBossDir(), SESSIONS_SUBDIR);
114653
+ return path44.join(getBossDir(), SESSIONS_SUBDIR);
113893
114654
  }
113894
114655
  async function ensureSessionsDir() {
113895
114656
  const dir = getSessionsDir();
113896
- await fs36.mkdir(dir, { recursive: true, mode: 448 });
114657
+ await fs37.mkdir(dir, { recursive: true, mode: 448 });
113897
114658
  return dir;
113898
114659
  }
113899
114660
  async function createSession2() {
113900
114661
  await ensureSessionsDir();
113901
114662
  const id2 = `${Date.now()}-${crypto11.randomBytes(4).toString("hex")}`;
113902
- const filePath = path41.join(getSessionsDir(), `${id2}.jsonl`);
113903
- await fs36.writeFile(filePath, "", "utf-8");
114663
+ const filePath = path44.join(getSessionsDir(), `${id2}.jsonl`);
114664
+ await fs37.writeFile(filePath, "", "utf-8");
113904
114665
  return { id: id2, filePath };
113905
114666
  }
113906
114667
  async function appendMessages(filePath, msgs) {
113907
114668
  if (msgs.length === 0) return;
113908
114669
  const lines = msgs.map((m) => JSON.stringify(m)).join("\n") + "\n";
113909
- await fs36.appendFile(filePath, lines, "utf-8");
114670
+ await fs37.appendFile(filePath, lines, "utf-8");
113910
114671
  }
113911
114672
  async function loadSession2(filePath) {
113912
114673
  try {
113913
- const content = await fs36.readFile(filePath, "utf-8");
114674
+ const content = await fs37.readFile(filePath, "utf-8");
113914
114675
  const lines = content.split("\n").filter((l) => l.length > 0);
113915
114676
  const messages = [];
113916
114677
  for (const line of lines) {
@@ -113926,8 +114687,8 @@ async function loadSession2(filePath) {
113926
114687
  }
113927
114688
  async function inspectSession(filePath, id2) {
113928
114689
  try {
113929
- const stat = await fs36.stat(filePath);
113930
- const content = await fs36.readFile(filePath, "utf-8");
114690
+ const stat = await fs37.stat(filePath);
114691
+ const content = await fs37.readFile(filePath, "utf-8");
113931
114692
  const lines = content.split("\n").filter((l) => l.length > 0);
113932
114693
  let firstUserMessage;
113933
114694
  for (const line of lines) {
@@ -113960,7 +114721,7 @@ async function listSessions2() {
113960
114721
  await ensureSessionsDir();
113961
114722
  let entries;
113962
114723
  try {
113963
- entries = await fs36.readdir(getSessionsDir());
114724
+ entries = await fs37.readdir(getSessionsDir());
113964
114725
  } catch {
113965
114726
  return [];
113966
114727
  }
@@ -113968,7 +114729,7 @@ async function listSessions2() {
113968
114729
  for (const name of entries) {
113969
114730
  if (!name.endsWith(".jsonl")) continue;
113970
114731
  const id2 = name.replace(/\.jsonl$/, "");
113971
- const info = await inspectSession(path41.join(getSessionsDir(), name), id2);
114732
+ const info = await inspectSession(path44.join(getSessionsDir(), name), id2);
113972
114733
  if (info) infos.push(info);
113973
114734
  }
113974
114735
  infos.sort((a, b) => b.lastModified - a.lastModified);
@@ -113979,7 +114740,7 @@ async function getMostRecent() {
113979
114740
  return all[0] ?? null;
113980
114741
  }
113981
114742
  async function getSessionById(id2) {
113982
- const filePath = path41.join(getSessionsDir(), `${id2}.jsonl`);
114743
+ const filePath = path44.join(getSessionsDir(), `${id2}.jsonl`);
113983
114744
  return inspectSession(filePath, id2);
113984
114745
  }
113985
114746
 
@@ -114933,4 +115694,4 @@ react/cjs/react-jsx-runtime.development.js:
114933
115694
  * LICENSE file in the root directory of this source tree.
114934
115695
  *)
114935
115696
  */
114936
- //# sourceMappingURL=chunk-43D6KHTA.js.map
115697
+ //# sourceMappingURL=chunk-QDOB5CCW.js.map