adhdev 0.9.58 → 0.9.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -2843,19 +2843,19 @@ function resolveCommandPath(command) {
2843
2843
  return null;
2844
2844
  }
2845
2845
  function execAsync(cmd, timeoutMs = 5e3) {
2846
- return new Promise((resolve21) => {
2846
+ return new Promise((resolve22) => {
2847
2847
  const child = (0, import_child_process2.exec)(cmd, {
2848
2848
  encoding: "utf-8",
2849
2849
  timeout: timeoutMs,
2850
2850
  ...process.platform === "win32" ? { windowsHide: true } : {}
2851
2851
  }, (err, stdout) => {
2852
2852
  if (err || !stdout?.trim()) {
2853
- resolve21(null);
2853
+ resolve22(null);
2854
2854
  } else {
2855
- resolve21(stdout.trim());
2855
+ resolve22(stdout.trim());
2856
2856
  }
2857
2857
  });
2858
- child.on("error", () => resolve21(null));
2858
+ child.on("error", () => resolve22(null));
2859
2859
  });
2860
2860
  }
2861
2861
  async function detectCLIs(providerLoader, options) {
@@ -3467,7 +3467,7 @@ var init_manager = __esm({
3467
3467
  * Returns multiple entries if multiple IDE windows are open on same port
3468
3468
  */
3469
3469
  static listAllTargets(port) {
3470
- return new Promise((resolve21) => {
3470
+ return new Promise((resolve22) => {
3471
3471
  const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
3472
3472
  let data = "";
3473
3473
  res.on("data", (chunk) => data += chunk.toString());
@@ -3483,16 +3483,16 @@ var init_manager = __esm({
3483
3483
  (t) => !isNonMain(t.title || "") && t.url?.includes("workbench.html") && !t.url?.includes("agent")
3484
3484
  );
3485
3485
  const fallbackPages = pages.filter((t) => !isNonMain(t.title || ""));
3486
- resolve21(mainPages.length > 0 ? mainPages : fallbackPages);
3486
+ resolve22(mainPages.length > 0 ? mainPages : fallbackPages);
3487
3487
  } catch {
3488
- resolve21([]);
3488
+ resolve22([]);
3489
3489
  }
3490
3490
  });
3491
3491
  });
3492
- req.on("error", () => resolve21([]));
3492
+ req.on("error", () => resolve22([]));
3493
3493
  req.setTimeout(2e3, () => {
3494
3494
  req.destroy();
3495
- resolve21([]);
3495
+ resolve22([]);
3496
3496
  });
3497
3497
  });
3498
3498
  }
@@ -3532,7 +3532,7 @@ var init_manager = __esm({
3532
3532
  }
3533
3533
  }
3534
3534
  findTargetOnPort(port) {
3535
- return new Promise((resolve21) => {
3535
+ return new Promise((resolve22) => {
3536
3536
  const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
3537
3537
  let data = "";
3538
3538
  res.on("data", (chunk) => data += chunk.toString());
@@ -3543,7 +3543,7 @@ var init_manager = __esm({
3543
3543
  (t) => (t.type === "page" || t.type === "browser" || t.type === "Page") && t.webSocketDebuggerUrl
3544
3544
  );
3545
3545
  if (pages.length === 0) {
3546
- resolve21(targets.find((t) => t.webSocketDebuggerUrl) || null);
3546
+ resolve22(targets.find((t) => t.webSocketDebuggerUrl) || null);
3547
3547
  return;
3548
3548
  }
3549
3549
  const titleFilteredPages = pages.filter((t) => !this.isNonMainTitle(t.title || ""));
@@ -3562,25 +3562,25 @@ var init_manager = __esm({
3562
3562
  this._targetId = selected.target.id;
3563
3563
  }
3564
3564
  this._pageTitle = selected.target.title || "";
3565
- resolve21(selected.target);
3565
+ resolve22(selected.target);
3566
3566
  return;
3567
3567
  }
3568
3568
  if (previousTargetId) {
3569
3569
  this.log(`[CDP] Target ${previousTargetId} not found in page list`);
3570
- resolve21(null);
3570
+ resolve22(null);
3571
3571
  return;
3572
3572
  }
3573
3573
  this._pageTitle = list[0]?.title || "";
3574
- resolve21(list[0]);
3574
+ resolve22(list[0]);
3575
3575
  } catch {
3576
- resolve21(null);
3576
+ resolve22(null);
3577
3577
  }
3578
3578
  });
3579
3579
  });
3580
- req.on("error", () => resolve21(null));
3580
+ req.on("error", () => resolve22(null));
3581
3581
  req.setTimeout(2e3, () => {
3582
3582
  req.destroy();
3583
- resolve21(null);
3583
+ resolve22(null);
3584
3584
  });
3585
3585
  });
3586
3586
  }
@@ -3591,7 +3591,7 @@ var init_manager = __esm({
3591
3591
  this.extensionProviders = providers;
3592
3592
  }
3593
3593
  connectToTarget(wsUrl) {
3594
- return new Promise((resolve21) => {
3594
+ return new Promise((resolve22) => {
3595
3595
  this.ws = new import_ws.default(wsUrl);
3596
3596
  this.ws.on("open", async () => {
3597
3597
  this._connected = true;
@@ -3601,17 +3601,17 @@ var init_manager = __esm({
3601
3601
  }
3602
3602
  this.connectBrowserWs().catch(() => {
3603
3603
  });
3604
- resolve21(true);
3604
+ resolve22(true);
3605
3605
  });
3606
3606
  this.ws.on("message", (data) => {
3607
3607
  try {
3608
3608
  const msg = JSON.parse(data.toString());
3609
3609
  if (msg.id && this.pending.has(msg.id)) {
3610
- const { resolve: resolve22, reject } = this.pending.get(msg.id);
3610
+ const { resolve: resolve23, reject } = this.pending.get(msg.id);
3611
3611
  this.pending.delete(msg.id);
3612
3612
  this.failureCount = 0;
3613
3613
  if (msg.error) reject(new Error(msg.error.message));
3614
- else resolve22(msg.result);
3614
+ else resolve23(msg.result);
3615
3615
  } else if (msg.method === "Runtime.executionContextCreated") {
3616
3616
  this.contexts.add(msg.params.context.id);
3617
3617
  } else if (msg.method === "Runtime.executionContextDestroyed") {
@@ -3634,7 +3634,7 @@ var init_manager = __esm({
3634
3634
  this.ws.on("error", (err) => {
3635
3635
  this.log(`[CDP] WebSocket error: ${err.message}`);
3636
3636
  this._connected = false;
3637
- resolve21(false);
3637
+ resolve22(false);
3638
3638
  });
3639
3639
  });
3640
3640
  }
@@ -3648,7 +3648,7 @@ var init_manager = __esm({
3648
3648
  return;
3649
3649
  }
3650
3650
  this.log(`[CDP] Connecting browser WS for target discovery...`);
3651
- await new Promise((resolve21, reject) => {
3651
+ await new Promise((resolve22, reject) => {
3652
3652
  this.browserWs = new import_ws.default(browserWsUrl);
3653
3653
  this.browserWs.on("open", async () => {
3654
3654
  this._browserConnected = true;
@@ -3658,16 +3658,16 @@ var init_manager = __esm({
3658
3658
  } catch (e) {
3659
3659
  this.log(`[CDP] setDiscoverTargets failed: ${e.message}`);
3660
3660
  }
3661
- resolve21();
3661
+ resolve22();
3662
3662
  });
3663
3663
  this.browserWs.on("message", (data) => {
3664
3664
  try {
3665
3665
  const msg = JSON.parse(data.toString());
3666
3666
  if (msg.id && this.browserPending.has(msg.id)) {
3667
- const { resolve: resolve22, reject: reject2 } = this.browserPending.get(msg.id);
3667
+ const { resolve: resolve23, reject: reject2 } = this.browserPending.get(msg.id);
3668
3668
  this.browserPending.delete(msg.id);
3669
3669
  if (msg.error) reject2(new Error(msg.error.message));
3670
- else resolve22(msg.result);
3670
+ else resolve23(msg.result);
3671
3671
  }
3672
3672
  } catch {
3673
3673
  }
@@ -3687,31 +3687,31 @@ var init_manager = __esm({
3687
3687
  }
3688
3688
  }
3689
3689
  getBrowserWsUrl() {
3690
- return new Promise((resolve21) => {
3690
+ return new Promise((resolve22) => {
3691
3691
  const req = http.get(`http://127.0.0.1:${this.port}/json/version`, (res) => {
3692
3692
  let data = "";
3693
3693
  res.on("data", (chunk) => data += chunk.toString());
3694
3694
  res.on("end", () => {
3695
3695
  try {
3696
3696
  const info = JSON.parse(data);
3697
- resolve21(info.webSocketDebuggerUrl || null);
3697
+ resolve22(info.webSocketDebuggerUrl || null);
3698
3698
  } catch {
3699
- resolve21(null);
3699
+ resolve22(null);
3700
3700
  }
3701
3701
  });
3702
3702
  });
3703
- req.on("error", () => resolve21(null));
3703
+ req.on("error", () => resolve22(null));
3704
3704
  req.setTimeout(3e3, () => {
3705
3705
  req.destroy();
3706
- resolve21(null);
3706
+ resolve22(null);
3707
3707
  });
3708
3708
  });
3709
3709
  }
3710
3710
  sendBrowser(method, params = {}, timeoutMs = 15e3) {
3711
- return new Promise((resolve21, reject) => {
3711
+ return new Promise((resolve22, reject) => {
3712
3712
  if (!this.browserWs || !this._browserConnected) return reject(new Error("Browser WS not connected"));
3713
3713
  const id = this.browserMsgId++;
3714
- this.browserPending.set(id, { resolve: resolve21, reject });
3714
+ this.browserPending.set(id, { resolve: resolve22, reject });
3715
3715
  this.browserWs.send(JSON.stringify({ id, method, params }));
3716
3716
  setTimeout(() => {
3717
3717
  if (this.browserPending.has(id)) {
@@ -3751,11 +3751,11 @@ var init_manager = __esm({
3751
3751
  }
3752
3752
  // ─── CDP Protocol ────────────────────────────────────────
3753
3753
  sendInternal(method, params = {}, timeoutMs = 15e3) {
3754
- return new Promise((resolve21, reject) => {
3754
+ return new Promise((resolve22, reject) => {
3755
3755
  if (!this.ws || !this._connected) return reject(new Error("CDP not connected"));
3756
3756
  if (this.ws.readyState !== import_ws.default.OPEN) return reject(new Error("WebSocket not open"));
3757
3757
  const id = this.msgId++;
3758
- this.pending.set(id, { resolve: resolve21, reject });
3758
+ this.pending.set(id, { resolve: resolve22, reject });
3759
3759
  this.ws.send(JSON.stringify({ id, method, params }));
3760
3760
  setTimeout(() => {
3761
3761
  if (this.pending.has(id)) {
@@ -4004,7 +4004,7 @@ var init_manager = __esm({
4004
4004
  const browserWs = this.browserWs;
4005
4005
  let msgId = this.browserMsgId;
4006
4006
  const sendWs = (method, params = {}, sessionId) => {
4007
- return new Promise((resolve21, reject) => {
4007
+ return new Promise((resolve22, reject) => {
4008
4008
  const mid = msgId++;
4009
4009
  this.browserMsgId = msgId;
4010
4010
  const handler = (raw) => {
@@ -4013,7 +4013,7 @@ var init_manager = __esm({
4013
4013
  if (msg.id === mid) {
4014
4014
  browserWs.removeListener("message", handler);
4015
4015
  if (msg.error) reject(new Error(msg.error.message || JSON.stringify(msg.error)));
4016
- else resolve21(msg.result);
4016
+ else resolve22(msg.result);
4017
4017
  }
4018
4018
  } catch {
4019
4019
  }
@@ -4214,14 +4214,14 @@ var init_manager = __esm({
4214
4214
  if (!ws || ws.readyState !== import_ws.default.OPEN) {
4215
4215
  throw new Error("CDP not connected");
4216
4216
  }
4217
- return new Promise((resolve21, reject) => {
4217
+ return new Promise((resolve22, reject) => {
4218
4218
  const id = getNextId();
4219
4219
  pendingMap.set(id, {
4220
4220
  resolve: (result) => {
4221
4221
  if (result?.result?.subtype === "error") {
4222
4222
  reject(new Error(result.result.description));
4223
4223
  } else {
4224
- resolve21(result?.result?.value);
4224
+ resolve22(result?.result?.value);
4225
4225
  }
4226
4226
  },
4227
4227
  reject
@@ -4253,10 +4253,10 @@ var init_manager = __esm({
4253
4253
  throw new Error("CDP not connected");
4254
4254
  }
4255
4255
  const sendViaSession = (method, params = {}) => {
4256
- return new Promise((resolve21, reject) => {
4256
+ return new Promise((resolve22, reject) => {
4257
4257
  const pendingMap = this._browserConnected ? this.browserPending : this.pending;
4258
4258
  const id = this._browserConnected ? this.browserMsgId++ : this.msgId++;
4259
- pendingMap.set(id, { resolve: resolve21, reject });
4259
+ pendingMap.set(id, { resolve: resolve22, reject });
4260
4260
  ws.send(JSON.stringify({ id, sessionId, method, params }));
4261
4261
  setTimeout(() => {
4262
4262
  if (pendingMap.has(id)) {
@@ -9829,7 +9829,7 @@ function getCliVisibleTranscriptCount(adapter) {
9829
9829
  async function getStableExtensionBaseline(h) {
9830
9830
  const first = await readExtensionChatState(h);
9831
9831
  if (getStateMessageCount(first) > 0 || getStateLastSignature(first)) return first;
9832
- await new Promise((resolve21) => setTimeout(resolve21, 150));
9832
+ await new Promise((resolve22) => setTimeout(resolve22, 150));
9833
9833
  const second = await readExtensionChatState(h);
9834
9834
  return getStateMessageCount(second) >= getStateMessageCount(first) ? second : first;
9835
9835
  }
@@ -9837,7 +9837,7 @@ async function verifyExtensionSendObserved(h, before) {
9837
9837
  const beforeCount = getStateMessageCount(before);
9838
9838
  const beforeSignature = getStateLastSignature(before);
9839
9839
  for (let attempt = 0; attempt < 12; attempt += 1) {
9840
- await new Promise((resolve21) => setTimeout(resolve21, 250));
9840
+ await new Promise((resolve22) => setTimeout(resolve22, 250));
9841
9841
  const state = await readExtensionChatState(h);
9842
9842
  if (state?.status === "waiting_approval") return true;
9843
9843
  const afterCount = getStateMessageCount(state);
@@ -11491,7 +11491,7 @@ async function executeProviderScript(h, args, scriptName) {
11491
11491
  const enterCount = cliCommand.enterCount || 1;
11492
11492
  await adapter.writeRaw(cliCommand.text + "\r");
11493
11493
  for (let i = 1; i < enterCount; i += 1) {
11494
- await new Promise((resolve21) => setTimeout(resolve21, 50));
11494
+ await new Promise((resolve22) => setTimeout(resolve22, 50));
11495
11495
  await adapter.writeRaw("\r");
11496
11496
  }
11497
11497
  }
@@ -12207,7 +12207,7 @@ var init_handler = __esm({
12207
12207
  try {
12208
12208
  const http3 = await import("http");
12209
12209
  const postData = JSON.stringify(body);
12210
- const result = await new Promise((resolve21, reject) => {
12210
+ const result = await new Promise((resolve22, reject) => {
12211
12211
  const req = http3.request({
12212
12212
  hostname: "127.0.0.1",
12213
12213
  port: 19280,
@@ -12219,9 +12219,9 @@ var init_handler = __esm({
12219
12219
  res.on("data", (chunk) => data += chunk);
12220
12220
  res.on("end", () => {
12221
12221
  try {
12222
- resolve21(JSON.parse(data));
12222
+ resolve22(JSON.parse(data));
12223
12223
  } catch {
12224
- resolve21({ raw: data });
12224
+ resolve22({ raw: data });
12225
12225
  }
12226
12226
  });
12227
12227
  });
@@ -12239,15 +12239,15 @@ var init_handler = __esm({
12239
12239
  if (!providerType) return { success: false, error: "providerType required" };
12240
12240
  try {
12241
12241
  const http3 = await import("http");
12242
- const result = await new Promise((resolve21, reject) => {
12242
+ const result = await new Promise((resolve22, reject) => {
12243
12243
  http3.get(`http://127.0.0.1:19280/api/providers/${providerType}/${endpoint}`, (res) => {
12244
12244
  let data = "";
12245
12245
  res.on("data", (chunk) => data += chunk);
12246
12246
  res.on("end", () => {
12247
12247
  try {
12248
- resolve21(JSON.parse(data));
12248
+ resolve22(JSON.parse(data));
12249
12249
  } catch {
12250
- resolve21({ raw: data });
12250
+ resolve22({ raw: data });
12251
12251
  }
12252
12252
  });
12253
12253
  }).on("error", reject);
@@ -12261,7 +12261,7 @@ var init_handler = __esm({
12261
12261
  try {
12262
12262
  const http3 = await import("http");
12263
12263
  const postData = JSON.stringify(args || {});
12264
- const result = await new Promise((resolve21, reject) => {
12264
+ const result = await new Promise((resolve22, reject) => {
12265
12265
  const req = http3.request({
12266
12266
  hostname: "127.0.0.1",
12267
12267
  port: 19280,
@@ -12273,9 +12273,9 @@ var init_handler = __esm({
12273
12273
  res.on("data", (chunk) => data += chunk);
12274
12274
  res.on("end", () => {
12275
12275
  try {
12276
- resolve21(JSON.parse(data));
12276
+ resolve22(JSON.parse(data));
12277
12277
  } catch {
12278
- resolve21({ raw: data });
12278
+ resolve22({ raw: data });
12279
12279
  }
12280
12280
  });
12281
12281
  });
@@ -13301,14 +13301,14 @@ function applyTerminalColorEnv(env3) {
13301
13301
  function ensureNodePtySpawnHelperPermissions(logFn) {
13302
13302
  if (os22.platform() === "win32") return;
13303
13303
  try {
13304
- const fs23 = __require("fs");
13304
+ const fs24 = __require("fs");
13305
13305
  const ptyDir = path32.resolve(path32.dirname(__require.resolve("node-pty")), "..");
13306
13306
  const platformArch = `${os22.platform()}-${os22.arch()}`;
13307
13307
  const helper = path32.join(ptyDir, "prebuilds", platformArch, "spawn-helper");
13308
- if (fs23.existsSync(helper)) {
13309
- const stat5 = fs23.statSync(helper);
13308
+ if (fs24.existsSync(helper)) {
13309
+ const stat5 = fs24.statSync(helper);
13310
13310
  if (!(stat5.mode & 73)) {
13311
- fs23.chmodSync(helper, stat5.mode | 493);
13311
+ fs24.chmodSync(helper, stat5.mode | 493);
13312
13312
  logFn?.(`Fixed spawn-helper permissions: ${helper}`);
13313
13313
  }
13314
13314
  }
@@ -13781,8 +13781,8 @@ var init_pty_transport = __esm({
13781
13781
  let cwd = options.cwd;
13782
13782
  if (cwd) {
13783
13783
  try {
13784
- const fs23 = require("fs");
13785
- const stat5 = fs23.statSync(cwd);
13784
+ const fs24 = require("fs");
13785
+ const stat5 = fs24.statSync(cwd);
13786
13786
  if (!stat5.isDirectory()) cwd = os11.homedir();
13787
13787
  } catch {
13788
13788
  cwd = os11.homedir();
@@ -13885,12 +13885,12 @@ function findBinary(name) {
13885
13885
  function isScriptBinary(binaryPath) {
13886
13886
  if (!path14.isAbsolute(binaryPath)) return false;
13887
13887
  try {
13888
- const fs23 = require("fs");
13889
- const resolved = fs23.realpathSync(binaryPath);
13888
+ const fs24 = require("fs");
13889
+ const resolved = fs24.realpathSync(binaryPath);
13890
13890
  const head = Buffer.alloc(8);
13891
- const fd = fs23.openSync(resolved, "r");
13892
- fs23.readSync(fd, head, 0, 8, 0);
13893
- fs23.closeSync(fd);
13891
+ const fd = fs24.openSync(resolved, "r");
13892
+ fs24.readSync(fd, head, 0, 8, 0);
13893
+ fs24.closeSync(fd);
13894
13894
  let i = 0;
13895
13895
  if (head[0] === 239 && head[1] === 187 && head[2] === 191) i = 3;
13896
13896
  return head[i] === 35 && head[i + 1] === 33;
@@ -13901,12 +13901,12 @@ function isScriptBinary(binaryPath) {
13901
13901
  function looksLikeMachOOrElf(filePath) {
13902
13902
  if (!path14.isAbsolute(filePath)) return false;
13903
13903
  try {
13904
- const fs23 = require("fs");
13905
- const resolved = fs23.realpathSync(filePath);
13904
+ const fs24 = require("fs");
13905
+ const resolved = fs24.realpathSync(filePath);
13906
13906
  const buf = Buffer.alloc(8);
13907
- const fd = fs23.openSync(resolved, "r");
13908
- fs23.readSync(fd, buf, 0, 8, 0);
13909
- fs23.closeSync(fd);
13907
+ const fd = fs24.openSync(resolved, "r");
13908
+ fs24.readSync(fd, buf, 0, 8, 0);
13909
+ fs24.closeSync(fd);
13910
13910
  let i = 0;
13911
13911
  if (buf[0] === 239 && buf[1] === 187 && buf[2] === 191) i = 3;
13912
13912
  const b = buf.subarray(i);
@@ -15287,7 +15287,7 @@ var init_provider_cli_adapter = __esm({
15287
15287
  `[${this.cliType}] Waiting for interactive prompt: status=${status} stableMs=${stableMs} recentOutputMs=${recentlyOutput} screen=${JSON.stringify(summarizeCliTraceText(screenText, 220)).slice(0, 260)}`
15288
15288
  );
15289
15289
  }
15290
- await new Promise((resolve21) => setTimeout(resolve21, 50));
15290
+ await new Promise((resolve22) => setTimeout(resolve22, 50));
15291
15291
  }
15292
15292
  const finalScreenText = this.terminalScreen.getText() || "";
15293
15293
  LOG.warn(
@@ -16496,7 +16496,7 @@ var init_provider_cli_adapter = __esm({
16496
16496
  const deadline = Date.now() + 1e4;
16497
16497
  while (this.startupParseGate && Date.now() < deadline) {
16498
16498
  this.resolveStartupState("send_wait");
16499
- await new Promise((resolve21) => setTimeout(resolve21, 50));
16499
+ await new Promise((resolve22) => setTimeout(resolve22, 50));
16500
16500
  }
16501
16501
  }
16502
16502
  if (!allowInterventionPrompt) {
@@ -16577,13 +16577,13 @@ var init_provider_cli_adapter = __esm({
16577
16577
  }
16578
16578
  this.responseEpoch += 1;
16579
16579
  this.responseSettleIgnoreUntil = Date.now() + submitDelayMs + this.timeouts.outputSettle + 250;
16580
- await new Promise((resolve21, reject) => {
16580
+ await new Promise((resolve22, reject) => {
16581
16581
  let resolved = false;
16582
16582
  const completion = {
16583
16583
  resolveOnce: () => {
16584
16584
  if (resolved) return;
16585
16585
  resolved = true;
16586
- resolve21();
16586
+ resolve22();
16587
16587
  },
16588
16588
  rejectOnce: (error48) => {
16589
16589
  if (resolved) return;
@@ -16745,17 +16745,17 @@ var init_provider_cli_adapter = __esm({
16745
16745
  }
16746
16746
  }
16747
16747
  waitForStopped(timeoutMs) {
16748
- return new Promise((resolve21) => {
16748
+ return new Promise((resolve22) => {
16749
16749
  const startedAt = Date.now();
16750
16750
  const timer = setInterval(() => {
16751
16751
  if (!this.ptyProcess || this.currentStatus === "stopped") {
16752
16752
  clearInterval(timer);
16753
- resolve21(true);
16753
+ resolve22(true);
16754
16754
  return;
16755
16755
  }
16756
16756
  if (Date.now() - startedAt >= timeoutMs) {
16757
16757
  clearInterval(timer);
16758
- resolve21(false);
16758
+ resolve22(false);
16759
16759
  }
16760
16760
  }, 100);
16761
16761
  });
@@ -17076,7 +17076,7 @@ async function waitForCliAdapterReady(adapter, options) {
17076
17076
  if (status === "stopped") {
17077
17077
  throw new Error("CLI runtime stopped before it became ready");
17078
17078
  }
17079
- await new Promise((resolve21) => setTimeout(resolve21, pollMs));
17079
+ await new Promise((resolve22) => setTimeout(resolve22, pollMs));
17080
17080
  }
17081
17081
  throw new Error(`CLI runtime did not become ready within ${timeoutMs}ms`);
17082
17082
  }
@@ -17449,7 +17449,7 @@ var init_cli_provider_instance = __esm({
17449
17449
  const enterCount = cliCommand.enterCount || 1;
17450
17450
  await this.adapter.writeRaw(cliCommand.text + "\r");
17451
17451
  for (let i = 1; i < enterCount; i += 1) {
17452
- await new Promise((resolve21) => setTimeout(resolve21, 50));
17452
+ await new Promise((resolve22) => setTimeout(resolve22, 50));
17453
17453
  await this.adapter.writeRaw("\r");
17454
17454
  }
17455
17455
  }
@@ -18236,10 +18236,10 @@ function mergeDefs(...defs) {
18236
18236
  function cloneDef(schema) {
18237
18237
  return mergeDefs(schema._zod.def);
18238
18238
  }
18239
- function getElementAtPath(obj, path39) {
18240
- if (!path39)
18239
+ function getElementAtPath(obj, path40) {
18240
+ if (!path40)
18241
18241
  return obj;
18242
- return path39.reduce((acc, key) => acc?.[key], obj);
18242
+ return path40.reduce((acc, key) => acc?.[key], obj);
18243
18243
  }
18244
18244
  function promiseAllObject(promisesObj) {
18245
18245
  const keys = Object.keys(promisesObj);
@@ -18551,11 +18551,11 @@ function aborted(x, startIndex = 0) {
18551
18551
  }
18552
18552
  return false;
18553
18553
  }
18554
- function prefixIssues(path39, issues) {
18554
+ function prefixIssues(path40, issues) {
18555
18555
  return issues.map((iss) => {
18556
18556
  var _a2;
18557
18557
  (_a2 = iss).path ?? (_a2.path = []);
18558
- iss.path.unshift(path39);
18558
+ iss.path.unshift(path40);
18559
18559
  return iss;
18560
18560
  });
18561
18561
  }
@@ -18798,7 +18798,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
18798
18798
  }
18799
18799
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
18800
18800
  const result = { errors: [] };
18801
- const processError = (error49, path39 = []) => {
18801
+ const processError = (error49, path40 = []) => {
18802
18802
  var _a2, _b;
18803
18803
  for (const issue2 of error49.issues) {
18804
18804
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -18808,7 +18808,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
18808
18808
  } else if (issue2.code === "invalid_element") {
18809
18809
  processError({ issues: issue2.issues }, issue2.path);
18810
18810
  } else {
18811
- const fullpath = [...path39, ...issue2.path];
18811
+ const fullpath = [...path40, ...issue2.path];
18812
18812
  if (fullpath.length === 0) {
18813
18813
  result.errors.push(mapper(issue2));
18814
18814
  continue;
@@ -18840,8 +18840,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
18840
18840
  }
18841
18841
  function toDotPath(_path) {
18842
18842
  const segs = [];
18843
- const path39 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
18844
- for (const seg of path39) {
18843
+ const path40 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
18844
+ for (const seg of path40) {
18845
18845
  if (typeof seg === "number")
18846
18846
  segs.push(`[${seg}]`);
18847
18847
  else if (typeof seg === "symbol")
@@ -31605,13 +31605,13 @@ function resolveRef(ref, ctx) {
31605
31605
  if (!ref.startsWith("#")) {
31606
31606
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
31607
31607
  }
31608
- const path39 = ref.slice(1).split("/").filter(Boolean);
31609
- if (path39.length === 0) {
31608
+ const path40 = ref.slice(1).split("/").filter(Boolean);
31609
+ if (path40.length === 0) {
31610
31610
  return ctx.rootSchema;
31611
31611
  }
31612
31612
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
31613
- if (path39[0] === defsKey) {
31614
- const key = path39[1];
31613
+ if (path40[0] === defsKey) {
31614
+ const key = path40[1];
31615
31615
  if (!key || !ctx.defs[key]) {
31616
31616
  throw new Error(`Reference not found: ${ref}`);
31617
31617
  }
@@ -34038,8 +34038,8 @@ var init_acp = __esm({
34038
34038
  this.#requestHandler = requestHandler;
34039
34039
  this.#notificationHandler = notificationHandler;
34040
34040
  this.#stream = stream;
34041
- this.#closedPromise = new Promise((resolve21) => {
34042
- this.#abortController.signal.addEventListener("abort", () => resolve21());
34041
+ this.#closedPromise = new Promise((resolve22) => {
34042
+ this.#abortController.signal.addEventListener("abort", () => resolve22());
34043
34043
  });
34044
34044
  this.#receive();
34045
34045
  }
@@ -34188,8 +34188,8 @@ var init_acp = __esm({
34188
34188
  }
34189
34189
  async sendRequest(method, params) {
34190
34190
  const id = this.#nextRequestId++;
34191
- const responsePromise = new Promise((resolve21, reject) => {
34192
- this.#pendingResponses.set(id, { resolve: resolve21, reject });
34191
+ const responsePromise = new Promise((resolve22, reject) => {
34192
+ this.#pendingResponses.set(id, { resolve: resolve22, reject });
34193
34193
  });
34194
34194
  await this.#sendMessage({ jsonrpc: "2.0", id, method, params });
34195
34195
  return responsePromise;
@@ -34873,13 +34873,13 @@ var init_acp_provider_instance = __esm({
34873
34873
  }
34874
34874
  this.currentStatus = "waiting_approval";
34875
34875
  this.detectStatusTransition();
34876
- const approved = await new Promise((resolve21) => {
34877
- this.permissionResolvers.push(resolve21);
34876
+ const approved = await new Promise((resolve22) => {
34877
+ this.permissionResolvers.push(resolve22);
34878
34878
  setTimeout(() => {
34879
- const idx = this.permissionResolvers.indexOf(resolve21);
34879
+ const idx = this.permissionResolvers.indexOf(resolve22);
34880
34880
  if (idx >= 0) {
34881
34881
  this.permissionResolvers.splice(idx, 1);
34882
- resolve21(false);
34882
+ resolve22(false);
34883
34883
  }
34884
34884
  }, 3e5);
34885
34885
  });
@@ -36369,7 +36369,7 @@ var init_readdirp = __esm({
36369
36369
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
36370
36370
  const statMethod = opts.lstat ? import_promises3.lstat : import_promises3.stat;
36371
36371
  if (wantBigintFsStats) {
36372
- this._stat = (path39) => statMethod(path39, { bigint: true });
36372
+ this._stat = (path40) => statMethod(path40, { bigint: true });
36373
36373
  } else {
36374
36374
  this._stat = statMethod;
36375
36375
  }
@@ -36394,8 +36394,8 @@ var init_readdirp = __esm({
36394
36394
  const par = this.parent;
36395
36395
  const fil = par && par.files;
36396
36396
  if (fil && fil.length > 0) {
36397
- const { path: path39, depth } = par;
36398
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path39));
36397
+ const { path: path40, depth } = par;
36398
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path40));
36399
36399
  const awaited = await Promise.all(slice);
36400
36400
  for (const entry of awaited) {
36401
36401
  if (!entry)
@@ -36435,20 +36435,20 @@ var init_readdirp = __esm({
36435
36435
  this.reading = false;
36436
36436
  }
36437
36437
  }
36438
- async _exploreDir(path39, depth) {
36438
+ async _exploreDir(path40, depth) {
36439
36439
  let files;
36440
36440
  try {
36441
- files = await (0, import_promises3.readdir)(path39, this._rdOptions);
36441
+ files = await (0, import_promises3.readdir)(path40, this._rdOptions);
36442
36442
  } catch (error48) {
36443
36443
  this._onError(error48);
36444
36444
  }
36445
- return { files, depth, path: path39 };
36445
+ return { files, depth, path: path40 };
36446
36446
  }
36447
- async _formatEntry(dirent, path39) {
36447
+ async _formatEntry(dirent, path40) {
36448
36448
  let entry;
36449
36449
  const basename10 = this._isDirent ? dirent.name : dirent;
36450
36450
  try {
36451
- const fullPath = (0, import_node_path.resolve)((0, import_node_path.join)(path39, basename10));
36451
+ const fullPath = (0, import_node_path.resolve)((0, import_node_path.join)(path40, basename10));
36452
36452
  entry = { path: (0, import_node_path.relative)(this._root, fullPath), fullPath, basename: basename10 };
36453
36453
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
36454
36454
  } catch (err) {
@@ -36505,16 +36505,16 @@ var init_readdirp = __esm({
36505
36505
  });
36506
36506
 
36507
36507
  // ../../oss/packages/daemon-core/node_modules/chokidar/handler.js
36508
- function createFsWatchInstance(path39, options, listener, errHandler, emitRaw) {
36508
+ function createFsWatchInstance(path40, options, listener, errHandler, emitRaw) {
36509
36509
  const handleEvent = (rawEvent, evPath) => {
36510
- listener(path39);
36511
- emitRaw(rawEvent, evPath, { watchedPath: path39 });
36512
- if (evPath && path39 !== evPath) {
36513
- fsWatchBroadcast(sp.resolve(path39, evPath), KEY_LISTENERS, sp.join(path39, evPath));
36510
+ listener(path40);
36511
+ emitRaw(rawEvent, evPath, { watchedPath: path40 });
36512
+ if (evPath && path40 !== evPath) {
36513
+ fsWatchBroadcast(sp.resolve(path40, evPath), KEY_LISTENERS, sp.join(path40, evPath));
36514
36514
  }
36515
36515
  };
36516
36516
  try {
36517
- return (0, import_node_fs2.watch)(path39, {
36517
+ return (0, import_node_fs2.watch)(path40, {
36518
36518
  persistent: options.persistent
36519
36519
  }, handleEvent);
36520
36520
  } catch (error48) {
@@ -36863,12 +36863,12 @@ var init_handler2 = __esm({
36863
36863
  listener(val1, val2, val3);
36864
36864
  });
36865
36865
  };
36866
- setFsWatchListener = (path39, fullPath, options, handlers) => {
36866
+ setFsWatchListener = (path40, fullPath, options, handlers) => {
36867
36867
  const { listener, errHandler, rawEmitter } = handlers;
36868
36868
  let cont = FsWatchInstances.get(fullPath);
36869
36869
  let watcher;
36870
36870
  if (!options.persistent) {
36871
- watcher = createFsWatchInstance(path39, options, listener, errHandler, rawEmitter);
36871
+ watcher = createFsWatchInstance(path40, options, listener, errHandler, rawEmitter);
36872
36872
  if (!watcher)
36873
36873
  return;
36874
36874
  return watcher.close.bind(watcher);
@@ -36879,7 +36879,7 @@ var init_handler2 = __esm({
36879
36879
  addAndConvert(cont, KEY_RAW, rawEmitter);
36880
36880
  } else {
36881
36881
  watcher = createFsWatchInstance(
36882
- path39,
36882
+ path40,
36883
36883
  options,
36884
36884
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
36885
36885
  errHandler,
@@ -36894,7 +36894,7 @@ var init_handler2 = __esm({
36894
36894
  cont.watcherUnusable = true;
36895
36895
  if (isWindows && error48.code === "EPERM") {
36896
36896
  try {
36897
- const fd = await (0, import_promises4.open)(path39, "r");
36897
+ const fd = await (0, import_promises4.open)(path40, "r");
36898
36898
  await fd.close();
36899
36899
  broadcastErr(error48);
36900
36900
  } catch (err) {
@@ -36925,7 +36925,7 @@ var init_handler2 = __esm({
36925
36925
  };
36926
36926
  };
36927
36927
  FsWatchFileInstances = /* @__PURE__ */ new Map();
36928
- setFsWatchFileListener = (path39, fullPath, options, handlers) => {
36928
+ setFsWatchFileListener = (path40, fullPath, options, handlers) => {
36929
36929
  const { listener, rawEmitter } = handlers;
36930
36930
  let cont = FsWatchFileInstances.get(fullPath);
36931
36931
  const copts = cont && cont.options;
@@ -36947,7 +36947,7 @@ var init_handler2 = __esm({
36947
36947
  });
36948
36948
  const currmtime = curr.mtimeMs;
36949
36949
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
36950
- foreach(cont.listeners, (listener2) => listener2(path39, curr));
36950
+ foreach(cont.listeners, (listener2) => listener2(path40, curr));
36951
36951
  }
36952
36952
  })
36953
36953
  };
@@ -36977,13 +36977,13 @@ var init_handler2 = __esm({
36977
36977
  * @param listener on fs change
36978
36978
  * @returns closer for the watcher instance
36979
36979
  */
36980
- _watchWithNodeFs(path39, listener) {
36980
+ _watchWithNodeFs(path40, listener) {
36981
36981
  const opts = this.fsw.options;
36982
- const directory = sp.dirname(path39);
36983
- const basename10 = sp.basename(path39);
36982
+ const directory = sp.dirname(path40);
36983
+ const basename10 = sp.basename(path40);
36984
36984
  const parent = this.fsw._getWatchedDir(directory);
36985
36985
  parent.add(basename10);
36986
- const absolutePath = sp.resolve(path39);
36986
+ const absolutePath = sp.resolve(path40);
36987
36987
  const options = {
36988
36988
  persistent: opts.persistent
36989
36989
  };
@@ -36993,12 +36993,12 @@ var init_handler2 = __esm({
36993
36993
  if (opts.usePolling) {
36994
36994
  const enableBin = opts.interval !== opts.binaryInterval;
36995
36995
  options.interval = enableBin && isBinaryPath(basename10) ? opts.binaryInterval : opts.interval;
36996
- closer = setFsWatchFileListener(path39, absolutePath, options, {
36996
+ closer = setFsWatchFileListener(path40, absolutePath, options, {
36997
36997
  listener,
36998
36998
  rawEmitter: this.fsw._emitRaw
36999
36999
  });
37000
37000
  } else {
37001
- closer = setFsWatchListener(path39, absolutePath, options, {
37001
+ closer = setFsWatchListener(path40, absolutePath, options, {
37002
37002
  listener,
37003
37003
  errHandler: this._boundHandleError,
37004
37004
  rawEmitter: this.fsw._emitRaw
@@ -37020,7 +37020,7 @@ var init_handler2 = __esm({
37020
37020
  let prevStats = stats;
37021
37021
  if (parent.has(basename10))
37022
37022
  return;
37023
- const listener = async (path39, newStats) => {
37023
+ const listener = async (path40, newStats) => {
37024
37024
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
37025
37025
  return;
37026
37026
  if (!newStats || newStats.mtimeMs === 0) {
@@ -37034,11 +37034,11 @@ var init_handler2 = __esm({
37034
37034
  this.fsw._emit(EV.CHANGE, file2, newStats2);
37035
37035
  }
37036
37036
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
37037
- this.fsw._closeFile(path39);
37037
+ this.fsw._closeFile(path40);
37038
37038
  prevStats = newStats2;
37039
37039
  const closer2 = this._watchWithNodeFs(file2, listener);
37040
37040
  if (closer2)
37041
- this.fsw._addPathCloser(path39, closer2);
37041
+ this.fsw._addPathCloser(path40, closer2);
37042
37042
  } else {
37043
37043
  prevStats = newStats2;
37044
37044
  }
@@ -37070,7 +37070,7 @@ var init_handler2 = __esm({
37070
37070
  * @param item basename of this item
37071
37071
  * @returns true if no more processing is needed for this entry.
37072
37072
  */
37073
- async _handleSymlink(entry, directory, path39, item) {
37073
+ async _handleSymlink(entry, directory, path40, item) {
37074
37074
  if (this.fsw.closed) {
37075
37075
  return;
37076
37076
  }
@@ -37080,7 +37080,7 @@ var init_handler2 = __esm({
37080
37080
  this.fsw._incrReadyCount();
37081
37081
  let linkPath;
37082
37082
  try {
37083
- linkPath = await (0, import_promises4.realpath)(path39);
37083
+ linkPath = await (0, import_promises4.realpath)(path40);
37084
37084
  } catch (e) {
37085
37085
  this.fsw._emitReady();
37086
37086
  return true;
@@ -37090,12 +37090,12 @@ var init_handler2 = __esm({
37090
37090
  if (dir.has(item)) {
37091
37091
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
37092
37092
  this.fsw._symlinkPaths.set(full, linkPath);
37093
- this.fsw._emit(EV.CHANGE, path39, entry.stats);
37093
+ this.fsw._emit(EV.CHANGE, path40, entry.stats);
37094
37094
  }
37095
37095
  } else {
37096
37096
  dir.add(item);
37097
37097
  this.fsw._symlinkPaths.set(full, linkPath);
37098
- this.fsw._emit(EV.ADD, path39, entry.stats);
37098
+ this.fsw._emit(EV.ADD, path40, entry.stats);
37099
37099
  }
37100
37100
  this.fsw._emitReady();
37101
37101
  return true;
@@ -37125,9 +37125,9 @@ var init_handler2 = __esm({
37125
37125
  return;
37126
37126
  }
37127
37127
  const item = entry.path;
37128
- let path39 = sp.join(directory, item);
37128
+ let path40 = sp.join(directory, item);
37129
37129
  current.add(item);
37130
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path39, item)) {
37130
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path40, item)) {
37131
37131
  return;
37132
37132
  }
37133
37133
  if (this.fsw.closed) {
@@ -37136,11 +37136,11 @@ var init_handler2 = __esm({
37136
37136
  }
37137
37137
  if (item === target || !target && !previous.has(item)) {
37138
37138
  this.fsw._incrReadyCount();
37139
- path39 = sp.join(dir, sp.relative(dir, path39));
37140
- this._addToNodeFs(path39, initialAdd, wh, depth + 1);
37139
+ path40 = sp.join(dir, sp.relative(dir, path40));
37140
+ this._addToNodeFs(path40, initialAdd, wh, depth + 1);
37141
37141
  }
37142
37142
  }).on(EV.ERROR, this._boundHandleError);
37143
- return new Promise((resolve21, reject) => {
37143
+ return new Promise((resolve22, reject) => {
37144
37144
  if (!stream)
37145
37145
  return reject();
37146
37146
  stream.once(STR_END, () => {
@@ -37149,7 +37149,7 @@ var init_handler2 = __esm({
37149
37149
  return;
37150
37150
  }
37151
37151
  const wasThrottled = throttler ? throttler.clear() : false;
37152
- resolve21(void 0);
37152
+ resolve22(void 0);
37153
37153
  previous.getChildren().filter((item) => {
37154
37154
  return item !== directory && !current.has(item);
37155
37155
  }).forEach((item) => {
@@ -37206,13 +37206,13 @@ var init_handler2 = __esm({
37206
37206
  * @param depth Child path actually targeted for watch
37207
37207
  * @param target Child path actually targeted for watch
37208
37208
  */
37209
- async _addToNodeFs(path39, initialAdd, priorWh, depth, target) {
37209
+ async _addToNodeFs(path40, initialAdd, priorWh, depth, target) {
37210
37210
  const ready = this.fsw._emitReady;
37211
- if (this.fsw._isIgnored(path39) || this.fsw.closed) {
37211
+ if (this.fsw._isIgnored(path40) || this.fsw.closed) {
37212
37212
  ready();
37213
37213
  return false;
37214
37214
  }
37215
- const wh = this.fsw._getWatchHelpers(path39);
37215
+ const wh = this.fsw._getWatchHelpers(path40);
37216
37216
  if (priorWh) {
37217
37217
  wh.filterPath = (entry) => priorWh.filterPath(entry);
37218
37218
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -37228,8 +37228,8 @@ var init_handler2 = __esm({
37228
37228
  const follow = this.fsw.options.followSymlinks;
37229
37229
  let closer;
37230
37230
  if (stats.isDirectory()) {
37231
- const absPath = sp.resolve(path39);
37232
- const targetPath = follow ? await (0, import_promises4.realpath)(path39) : path39;
37231
+ const absPath = sp.resolve(path40);
37232
+ const targetPath = follow ? await (0, import_promises4.realpath)(path40) : path40;
37233
37233
  if (this.fsw.closed)
37234
37234
  return;
37235
37235
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -37239,29 +37239,29 @@ var init_handler2 = __esm({
37239
37239
  this.fsw._symlinkPaths.set(absPath, targetPath);
37240
37240
  }
37241
37241
  } else if (stats.isSymbolicLink()) {
37242
- const targetPath = follow ? await (0, import_promises4.realpath)(path39) : path39;
37242
+ const targetPath = follow ? await (0, import_promises4.realpath)(path40) : path40;
37243
37243
  if (this.fsw.closed)
37244
37244
  return;
37245
37245
  const parent = sp.dirname(wh.watchPath);
37246
37246
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
37247
37247
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
37248
- closer = await this._handleDir(parent, stats, initialAdd, depth, path39, wh, targetPath);
37248
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path40, wh, targetPath);
37249
37249
  if (this.fsw.closed)
37250
37250
  return;
37251
37251
  if (targetPath !== void 0) {
37252
- this.fsw._symlinkPaths.set(sp.resolve(path39), targetPath);
37252
+ this.fsw._symlinkPaths.set(sp.resolve(path40), targetPath);
37253
37253
  }
37254
37254
  } else {
37255
37255
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
37256
37256
  }
37257
37257
  ready();
37258
37258
  if (closer)
37259
- this.fsw._addPathCloser(path39, closer);
37259
+ this.fsw._addPathCloser(path40, closer);
37260
37260
  return false;
37261
37261
  } catch (error48) {
37262
37262
  if (this.fsw._handleError(error48)) {
37263
37263
  ready();
37264
- return path39;
37264
+ return path40;
37265
37265
  }
37266
37266
  }
37267
37267
  }
@@ -37296,24 +37296,24 @@ function createPattern(matcher) {
37296
37296
  }
37297
37297
  return () => false;
37298
37298
  }
37299
- function normalizePath(path39) {
37300
- if (typeof path39 !== "string")
37299
+ function normalizePath(path40) {
37300
+ if (typeof path40 !== "string")
37301
37301
  throw new Error("string expected");
37302
- path39 = sp2.normalize(path39);
37303
- path39 = path39.replace(/\\/g, "/");
37302
+ path40 = sp2.normalize(path40);
37303
+ path40 = path40.replace(/\\/g, "/");
37304
37304
  let prepend = false;
37305
- if (path39.startsWith("//"))
37305
+ if (path40.startsWith("//"))
37306
37306
  prepend = true;
37307
- path39 = path39.replace(DOUBLE_SLASH_RE, "/");
37307
+ path40 = path40.replace(DOUBLE_SLASH_RE, "/");
37308
37308
  if (prepend)
37309
- path39 = "/" + path39;
37310
- return path39;
37309
+ path40 = "/" + path40;
37310
+ return path40;
37311
37311
  }
37312
37312
  function matchPatterns(patterns, testString, stats) {
37313
- const path39 = normalizePath(testString);
37313
+ const path40 = normalizePath(testString);
37314
37314
  for (let index = 0; index < patterns.length; index++) {
37315
37315
  const pattern = patterns[index];
37316
- if (pattern(path39, stats)) {
37316
+ if (pattern(path40, stats)) {
37317
37317
  return true;
37318
37318
  }
37319
37319
  }
@@ -37376,19 +37376,19 @@ var init_chokidar = __esm({
37376
37376
  }
37377
37377
  return str;
37378
37378
  };
37379
- normalizePathToUnix = (path39) => toUnix(sp2.normalize(toUnix(path39)));
37380
- normalizeIgnored = (cwd = "") => (path39) => {
37381
- if (typeof path39 === "string") {
37382
- return normalizePathToUnix(sp2.isAbsolute(path39) ? path39 : sp2.join(cwd, path39));
37379
+ normalizePathToUnix = (path40) => toUnix(sp2.normalize(toUnix(path40)));
37380
+ normalizeIgnored = (cwd = "") => (path40) => {
37381
+ if (typeof path40 === "string") {
37382
+ return normalizePathToUnix(sp2.isAbsolute(path40) ? path40 : sp2.join(cwd, path40));
37383
37383
  } else {
37384
- return path39;
37384
+ return path40;
37385
37385
  }
37386
37386
  };
37387
- getAbsolutePath = (path39, cwd) => {
37388
- if (sp2.isAbsolute(path39)) {
37389
- return path39;
37387
+ getAbsolutePath = (path40, cwd) => {
37388
+ if (sp2.isAbsolute(path40)) {
37389
+ return path40;
37390
37390
  }
37391
- return sp2.join(cwd, path39);
37391
+ return sp2.join(cwd, path40);
37392
37392
  };
37393
37393
  EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
37394
37394
  DirEntry = class {
@@ -37453,10 +37453,10 @@ var init_chokidar = __esm({
37453
37453
  dirParts;
37454
37454
  followSymlinks;
37455
37455
  statMethod;
37456
- constructor(path39, follow, fsw) {
37456
+ constructor(path40, follow, fsw) {
37457
37457
  this.fsw = fsw;
37458
- const watchPath = path39;
37459
- this.path = path39 = path39.replace(REPLACER_RE, "");
37458
+ const watchPath = path40;
37459
+ this.path = path40 = path40.replace(REPLACER_RE, "");
37460
37460
  this.watchPath = watchPath;
37461
37461
  this.fullWatchPath = sp2.resolve(watchPath);
37462
37462
  this.dirParts = [];
@@ -37596,20 +37596,20 @@ var init_chokidar = __esm({
37596
37596
  this._closePromise = void 0;
37597
37597
  let paths = unifyPaths(paths_);
37598
37598
  if (cwd) {
37599
- paths = paths.map((path39) => {
37600
- const absPath = getAbsolutePath(path39, cwd);
37599
+ paths = paths.map((path40) => {
37600
+ const absPath = getAbsolutePath(path40, cwd);
37601
37601
  return absPath;
37602
37602
  });
37603
37603
  }
37604
- paths.forEach((path39) => {
37605
- this._removeIgnoredPath(path39);
37604
+ paths.forEach((path40) => {
37605
+ this._removeIgnoredPath(path40);
37606
37606
  });
37607
37607
  this._userIgnored = void 0;
37608
37608
  if (!this._readyCount)
37609
37609
  this._readyCount = 0;
37610
37610
  this._readyCount += paths.length;
37611
- Promise.all(paths.map(async (path39) => {
37612
- const res = await this._nodeFsHandler._addToNodeFs(path39, !_internal, void 0, 0, _origAdd);
37611
+ Promise.all(paths.map(async (path40) => {
37612
+ const res = await this._nodeFsHandler._addToNodeFs(path40, !_internal, void 0, 0, _origAdd);
37613
37613
  if (res)
37614
37614
  this._emitReady();
37615
37615
  return res;
@@ -37631,17 +37631,17 @@ var init_chokidar = __esm({
37631
37631
  return this;
37632
37632
  const paths = unifyPaths(paths_);
37633
37633
  const { cwd } = this.options;
37634
- paths.forEach((path39) => {
37635
- if (!sp2.isAbsolute(path39) && !this._closers.has(path39)) {
37634
+ paths.forEach((path40) => {
37635
+ if (!sp2.isAbsolute(path40) && !this._closers.has(path40)) {
37636
37636
  if (cwd)
37637
- path39 = sp2.join(cwd, path39);
37638
- path39 = sp2.resolve(path39);
37637
+ path40 = sp2.join(cwd, path40);
37638
+ path40 = sp2.resolve(path40);
37639
37639
  }
37640
- this._closePath(path39);
37641
- this._addIgnoredPath(path39);
37642
- if (this._watched.has(path39)) {
37640
+ this._closePath(path40);
37641
+ this._addIgnoredPath(path40);
37642
+ if (this._watched.has(path40)) {
37643
37643
  this._addIgnoredPath({
37644
- path: path39,
37644
+ path: path40,
37645
37645
  recursive: true
37646
37646
  });
37647
37647
  }
@@ -37705,38 +37705,38 @@ var init_chokidar = __esm({
37705
37705
  * @param stats arguments to be passed with event
37706
37706
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
37707
37707
  */
37708
- async _emit(event, path39, stats) {
37708
+ async _emit(event, path40, stats) {
37709
37709
  if (this.closed)
37710
37710
  return;
37711
37711
  const opts = this.options;
37712
37712
  if (isWindows)
37713
- path39 = sp2.normalize(path39);
37713
+ path40 = sp2.normalize(path40);
37714
37714
  if (opts.cwd)
37715
- path39 = sp2.relative(opts.cwd, path39);
37716
- const args = [path39];
37715
+ path40 = sp2.relative(opts.cwd, path40);
37716
+ const args = [path40];
37717
37717
  if (stats != null)
37718
37718
  args.push(stats);
37719
37719
  const awf = opts.awaitWriteFinish;
37720
37720
  let pw;
37721
- if (awf && (pw = this._pendingWrites.get(path39))) {
37721
+ if (awf && (pw = this._pendingWrites.get(path40))) {
37722
37722
  pw.lastChange = /* @__PURE__ */ new Date();
37723
37723
  return this;
37724
37724
  }
37725
37725
  if (opts.atomic) {
37726
37726
  if (event === EVENTS.UNLINK) {
37727
- this._pendingUnlinks.set(path39, [event, ...args]);
37727
+ this._pendingUnlinks.set(path40, [event, ...args]);
37728
37728
  setTimeout(() => {
37729
- this._pendingUnlinks.forEach((entry, path40) => {
37729
+ this._pendingUnlinks.forEach((entry, path41) => {
37730
37730
  this.emit(...entry);
37731
37731
  this.emit(EVENTS.ALL, ...entry);
37732
- this._pendingUnlinks.delete(path40);
37732
+ this._pendingUnlinks.delete(path41);
37733
37733
  });
37734
37734
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
37735
37735
  return this;
37736
37736
  }
37737
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path39)) {
37737
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path40)) {
37738
37738
  event = EVENTS.CHANGE;
37739
- this._pendingUnlinks.delete(path39);
37739
+ this._pendingUnlinks.delete(path40);
37740
37740
  }
37741
37741
  }
37742
37742
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -37754,16 +37754,16 @@ var init_chokidar = __esm({
37754
37754
  this.emitWithAll(event, args);
37755
37755
  }
37756
37756
  };
37757
- this._awaitWriteFinish(path39, awf.stabilityThreshold, event, awfEmit);
37757
+ this._awaitWriteFinish(path40, awf.stabilityThreshold, event, awfEmit);
37758
37758
  return this;
37759
37759
  }
37760
37760
  if (event === EVENTS.CHANGE) {
37761
- const isThrottled = !this._throttle(EVENTS.CHANGE, path39, 50);
37761
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path40, 50);
37762
37762
  if (isThrottled)
37763
37763
  return this;
37764
37764
  }
37765
37765
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
37766
- const fullPath = opts.cwd ? sp2.join(opts.cwd, path39) : path39;
37766
+ const fullPath = opts.cwd ? sp2.join(opts.cwd, path40) : path40;
37767
37767
  let stats2;
37768
37768
  try {
37769
37769
  stats2 = await (0, import_promises5.stat)(fullPath);
@@ -37794,23 +37794,23 @@ var init_chokidar = __esm({
37794
37794
  * @param timeout duration of time to suppress duplicate actions
37795
37795
  * @returns tracking object or false if action should be suppressed
37796
37796
  */
37797
- _throttle(actionType, path39, timeout) {
37797
+ _throttle(actionType, path40, timeout) {
37798
37798
  if (!this._throttled.has(actionType)) {
37799
37799
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
37800
37800
  }
37801
37801
  const action = this._throttled.get(actionType);
37802
37802
  if (!action)
37803
37803
  throw new Error("invalid throttle");
37804
- const actionPath = action.get(path39);
37804
+ const actionPath = action.get(path40);
37805
37805
  if (actionPath) {
37806
37806
  actionPath.count++;
37807
37807
  return false;
37808
37808
  }
37809
37809
  let timeoutObject;
37810
37810
  const clear = () => {
37811
- const item = action.get(path39);
37811
+ const item = action.get(path40);
37812
37812
  const count = item ? item.count : 0;
37813
- action.delete(path39);
37813
+ action.delete(path40);
37814
37814
  clearTimeout(timeoutObject);
37815
37815
  if (item)
37816
37816
  clearTimeout(item.timeoutObject);
@@ -37818,7 +37818,7 @@ var init_chokidar = __esm({
37818
37818
  };
37819
37819
  timeoutObject = setTimeout(clear, timeout);
37820
37820
  const thr = { timeoutObject, clear, count: 0 };
37821
- action.set(path39, thr);
37821
+ action.set(path40, thr);
37822
37822
  return thr;
37823
37823
  }
37824
37824
  _incrReadyCount() {
@@ -37832,44 +37832,44 @@ var init_chokidar = __esm({
37832
37832
  * @param event
37833
37833
  * @param awfEmit Callback to be called when ready for event to be emitted.
37834
37834
  */
37835
- _awaitWriteFinish(path39, threshold, event, awfEmit) {
37835
+ _awaitWriteFinish(path40, threshold, event, awfEmit) {
37836
37836
  const awf = this.options.awaitWriteFinish;
37837
37837
  if (typeof awf !== "object")
37838
37838
  return;
37839
37839
  const pollInterval = awf.pollInterval;
37840
37840
  let timeoutHandler;
37841
- let fullPath = path39;
37842
- if (this.options.cwd && !sp2.isAbsolute(path39)) {
37843
- fullPath = sp2.join(this.options.cwd, path39);
37841
+ let fullPath = path40;
37842
+ if (this.options.cwd && !sp2.isAbsolute(path40)) {
37843
+ fullPath = sp2.join(this.options.cwd, path40);
37844
37844
  }
37845
37845
  const now = /* @__PURE__ */ new Date();
37846
37846
  const writes = this._pendingWrites;
37847
37847
  function awaitWriteFinishFn(prevStat) {
37848
37848
  (0, import_node_fs3.stat)(fullPath, (err, curStat) => {
37849
- if (err || !writes.has(path39)) {
37849
+ if (err || !writes.has(path40)) {
37850
37850
  if (err && err.code !== "ENOENT")
37851
37851
  awfEmit(err);
37852
37852
  return;
37853
37853
  }
37854
37854
  const now2 = Number(/* @__PURE__ */ new Date());
37855
37855
  if (prevStat && curStat.size !== prevStat.size) {
37856
- writes.get(path39).lastChange = now2;
37856
+ writes.get(path40).lastChange = now2;
37857
37857
  }
37858
- const pw = writes.get(path39);
37858
+ const pw = writes.get(path40);
37859
37859
  const df = now2 - pw.lastChange;
37860
37860
  if (df >= threshold) {
37861
- writes.delete(path39);
37861
+ writes.delete(path40);
37862
37862
  awfEmit(void 0, curStat);
37863
37863
  } else {
37864
37864
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
37865
37865
  }
37866
37866
  });
37867
37867
  }
37868
- if (!writes.has(path39)) {
37869
- writes.set(path39, {
37868
+ if (!writes.has(path40)) {
37869
+ writes.set(path40, {
37870
37870
  lastChange: now,
37871
37871
  cancelWait: () => {
37872
- writes.delete(path39);
37872
+ writes.delete(path40);
37873
37873
  clearTimeout(timeoutHandler);
37874
37874
  return event;
37875
37875
  }
@@ -37880,8 +37880,8 @@ var init_chokidar = __esm({
37880
37880
  /**
37881
37881
  * Determines whether user has asked to ignore this path.
37882
37882
  */
37883
- _isIgnored(path39, stats) {
37884
- if (this.options.atomic && DOT_RE.test(path39))
37883
+ _isIgnored(path40, stats) {
37884
+ if (this.options.atomic && DOT_RE.test(path40))
37885
37885
  return true;
37886
37886
  if (!this._userIgnored) {
37887
37887
  const { cwd } = this.options;
@@ -37891,17 +37891,17 @@ var init_chokidar = __esm({
37891
37891
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
37892
37892
  this._userIgnored = anymatch(list, void 0);
37893
37893
  }
37894
- return this._userIgnored(path39, stats);
37894
+ return this._userIgnored(path40, stats);
37895
37895
  }
37896
- _isntIgnored(path39, stat5) {
37897
- return !this._isIgnored(path39, stat5);
37896
+ _isntIgnored(path40, stat5) {
37897
+ return !this._isIgnored(path40, stat5);
37898
37898
  }
37899
37899
  /**
37900
37900
  * Provides a set of common helpers and properties relating to symlink handling.
37901
37901
  * @param path file or directory pattern being watched
37902
37902
  */
37903
- _getWatchHelpers(path39) {
37904
- return new WatchHelper(path39, this.options.followSymlinks, this);
37903
+ _getWatchHelpers(path40) {
37904
+ return new WatchHelper(path40, this.options.followSymlinks, this);
37905
37905
  }
37906
37906
  // Directory helpers
37907
37907
  // -----------------
@@ -37933,63 +37933,63 @@ var init_chokidar = __esm({
37933
37933
  * @param item base path of item/directory
37934
37934
  */
37935
37935
  _remove(directory, item, isDirectory) {
37936
- const path39 = sp2.join(directory, item);
37937
- const fullPath = sp2.resolve(path39);
37938
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path39) || this._watched.has(fullPath);
37939
- if (!this._throttle("remove", path39, 100))
37936
+ const path40 = sp2.join(directory, item);
37937
+ const fullPath = sp2.resolve(path40);
37938
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path40) || this._watched.has(fullPath);
37939
+ if (!this._throttle("remove", path40, 100))
37940
37940
  return;
37941
37941
  if (!isDirectory && this._watched.size === 1) {
37942
37942
  this.add(directory, item, true);
37943
37943
  }
37944
- const wp = this._getWatchedDir(path39);
37944
+ const wp = this._getWatchedDir(path40);
37945
37945
  const nestedDirectoryChildren = wp.getChildren();
37946
- nestedDirectoryChildren.forEach((nested) => this._remove(path39, nested));
37946
+ nestedDirectoryChildren.forEach((nested) => this._remove(path40, nested));
37947
37947
  const parent = this._getWatchedDir(directory);
37948
37948
  const wasTracked = parent.has(item);
37949
37949
  parent.remove(item);
37950
37950
  if (this._symlinkPaths.has(fullPath)) {
37951
37951
  this._symlinkPaths.delete(fullPath);
37952
37952
  }
37953
- let relPath = path39;
37953
+ let relPath = path40;
37954
37954
  if (this.options.cwd)
37955
- relPath = sp2.relative(this.options.cwd, path39);
37955
+ relPath = sp2.relative(this.options.cwd, path40);
37956
37956
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
37957
37957
  const event = this._pendingWrites.get(relPath).cancelWait();
37958
37958
  if (event === EVENTS.ADD)
37959
37959
  return;
37960
37960
  }
37961
- this._watched.delete(path39);
37961
+ this._watched.delete(path40);
37962
37962
  this._watched.delete(fullPath);
37963
37963
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
37964
- if (wasTracked && !this._isIgnored(path39))
37965
- this._emit(eventName, path39);
37966
- this._closePath(path39);
37964
+ if (wasTracked && !this._isIgnored(path40))
37965
+ this._emit(eventName, path40);
37966
+ this._closePath(path40);
37967
37967
  }
37968
37968
  /**
37969
37969
  * Closes all watchers for a path
37970
37970
  */
37971
- _closePath(path39) {
37972
- this._closeFile(path39);
37973
- const dir = sp2.dirname(path39);
37974
- this._getWatchedDir(dir).remove(sp2.basename(path39));
37971
+ _closePath(path40) {
37972
+ this._closeFile(path40);
37973
+ const dir = sp2.dirname(path40);
37974
+ this._getWatchedDir(dir).remove(sp2.basename(path40));
37975
37975
  }
37976
37976
  /**
37977
37977
  * Closes only file-specific watchers
37978
37978
  */
37979
- _closeFile(path39) {
37980
- const closers = this._closers.get(path39);
37979
+ _closeFile(path40) {
37980
+ const closers = this._closers.get(path40);
37981
37981
  if (!closers)
37982
37982
  return;
37983
37983
  closers.forEach((closer) => closer());
37984
- this._closers.delete(path39);
37984
+ this._closers.delete(path40);
37985
37985
  }
37986
- _addPathCloser(path39, closer) {
37986
+ _addPathCloser(path40, closer) {
37987
37987
  if (!closer)
37988
37988
  return;
37989
- let list = this._closers.get(path39);
37989
+ let list = this._closers.get(path40);
37990
37990
  if (!list) {
37991
37991
  list = [];
37992
- this._closers.set(path39, list);
37992
+ this._closers.set(path40, list);
37993
37993
  }
37994
37994
  list.push(closer);
37995
37995
  }
@@ -39191,7 +39191,7 @@ var init_provider_loader = __esm({
39191
39191
  return { updated: false };
39192
39192
  }
39193
39193
  try {
39194
- const etag = await new Promise((resolve21, reject) => {
39194
+ const etag = await new Promise((resolve22, reject) => {
39195
39195
  const options = {
39196
39196
  method: "HEAD",
39197
39197
  hostname: "github.com",
@@ -39209,7 +39209,7 @@ var init_provider_loader = __esm({
39209
39209
  headers: { "User-Agent": "adhdev-launcher" },
39210
39210
  timeout: 1e4
39211
39211
  }, (res2) => {
39212
- resolve21(res2.headers.etag || res2.headers["last-modified"] || "");
39212
+ resolve22(res2.headers.etag || res2.headers["last-modified"] || "");
39213
39213
  });
39214
39214
  req2.on("error", reject);
39215
39215
  req2.on("timeout", () => {
@@ -39218,7 +39218,7 @@ var init_provider_loader = __esm({
39218
39218
  });
39219
39219
  req2.end();
39220
39220
  } else {
39221
- resolve21(res.headers.etag || res.headers["last-modified"] || "");
39221
+ resolve22(res.headers.etag || res.headers["last-modified"] || "");
39222
39222
  }
39223
39223
  });
39224
39224
  req.on("error", reject);
@@ -39282,7 +39282,7 @@ var init_provider_loader = __esm({
39282
39282
  downloadFile(url2, destPath) {
39283
39283
  const https = require("https");
39284
39284
  const http3 = require("http");
39285
- return new Promise((resolve21, reject) => {
39285
+ return new Promise((resolve22, reject) => {
39286
39286
  const doRequest = (reqUrl, redirectCount = 0) => {
39287
39287
  if (redirectCount > 5) {
39288
39288
  reject(new Error("Too many redirects"));
@@ -39302,7 +39302,7 @@ var init_provider_loader = __esm({
39302
39302
  res.pipe(ws);
39303
39303
  ws.on("finish", () => {
39304
39304
  ws.close();
39305
- resolve21();
39305
+ resolve22();
39306
39306
  });
39307
39307
  ws.on("error", reject);
39308
39308
  });
@@ -39887,17 +39887,17 @@ async function findFreePort(ports) {
39887
39887
  throw new Error("No free port found");
39888
39888
  }
39889
39889
  function checkPortFree(port) {
39890
- return new Promise((resolve21) => {
39890
+ return new Promise((resolve22) => {
39891
39891
  const server = net2.createServer();
39892
39892
  server.unref();
39893
- server.on("error", () => resolve21(false));
39893
+ server.on("error", () => resolve22(false));
39894
39894
  server.listen(port, "127.0.0.1", () => {
39895
- server.close(() => resolve21(true));
39895
+ server.close(() => resolve22(true));
39896
39896
  });
39897
39897
  });
39898
39898
  }
39899
39899
  async function isCdpActive(port) {
39900
- return new Promise((resolve21) => {
39900
+ return new Promise((resolve22) => {
39901
39901
  const req = require("http").get(`http://127.0.0.1:${port}/json/version`, {
39902
39902
  timeout: 2e3
39903
39903
  }, (res) => {
@@ -39906,16 +39906,16 @@ async function isCdpActive(port) {
39906
39906
  res.on("end", () => {
39907
39907
  try {
39908
39908
  const info = JSON.parse(data);
39909
- resolve21(!!info["WebKit-Version"] || !!info["Browser"]);
39909
+ resolve22(!!info["WebKit-Version"] || !!info["Browser"]);
39910
39910
  } catch {
39911
- resolve21(false);
39911
+ resolve22(false);
39912
39912
  }
39913
39913
  });
39914
39914
  });
39915
- req.on("error", () => resolve21(false));
39915
+ req.on("error", () => resolve22(false));
39916
39916
  req.on("timeout", () => {
39917
39917
  req.destroy();
39918
- resolve21(false);
39918
+ resolve22(false);
39919
39919
  });
39920
39920
  });
39921
39921
  }
@@ -40051,7 +40051,7 @@ function detectCurrentWorkspace(ideId) {
40051
40051
  }
40052
40052
  } else if (plat === "win32") {
40053
40053
  try {
40054
- const fs23 = require("fs");
40054
+ const fs24 = require("fs");
40055
40055
  const appNameMap = getMacAppIdentifiers();
40056
40056
  const appName = appNameMap[ideId];
40057
40057
  if (appName) {
@@ -40060,8 +40060,8 @@ function detectCurrentWorkspace(ideId) {
40060
40060
  appName,
40061
40061
  "storage.json"
40062
40062
  );
40063
- if (fs23.existsSync(storagePath)) {
40064
- const data = JSON.parse(fs23.readFileSync(storagePath, "utf-8"));
40063
+ if (fs24.existsSync(storagePath)) {
40064
+ const data = JSON.parse(fs24.readFileSync(storagePath, "utf-8"));
40065
40065
  const workspaces = data?.openedPathsList?.workspaces3 || data?.openedPathsList?.entries || [];
40066
40066
  if (workspaces.length > 0) {
40067
40067
  const recent = workspaces[0];
@@ -40904,7 +40904,7 @@ async function waitForPidExit(pid, timeoutMs) {
40904
40904
  while (Date.now() - start < timeoutMs) {
40905
40905
  try {
40906
40906
  process.kill(pid, 0);
40907
- await new Promise((resolve21) => setTimeout(resolve21, 250));
40907
+ await new Promise((resolve22) => setTimeout(resolve22, 250));
40908
40908
  } catch {
40909
40909
  return;
40910
40910
  }
@@ -41015,7 +41015,7 @@ async function runDaemonUpgradeHelper(payload) {
41015
41015
  appendUpgradeLog(installOutput.trim());
41016
41016
  }
41017
41017
  if (process.platform === "win32") {
41018
- await new Promise((resolve21) => setTimeout(resolve21, 500));
41018
+ await new Promise((resolve22) => setTimeout(resolve22, 500));
41019
41019
  cleanupStaleGlobalInstallDirs(payload.packageName, installCommand.surface);
41020
41020
  appendUpgradeLog("Post-install staging cleanup complete");
41021
41021
  }
@@ -42476,7 +42476,7 @@ var init_provider_adapter = __esm({
42476
42476
  const beforeCount = this.messageCount(before);
42477
42477
  const beforeSignature = this.lastMessageSignature(before);
42478
42478
  for (let attempt = 0; attempt < 12; attempt += 1) {
42479
- await new Promise((resolve21) => setTimeout(resolve21, 250));
42479
+ await new Promise((resolve22) => setTimeout(resolve22, 250));
42480
42480
  let state;
42481
42481
  try {
42482
42482
  state = await this.readChat(evaluate);
@@ -42498,7 +42498,7 @@ var init_provider_adapter = __esm({
42498
42498
  if (this.messageCount(first) > 0 || this.lastMessageSignature(first)) {
42499
42499
  return first;
42500
42500
  }
42501
- await new Promise((resolve21) => setTimeout(resolve21, 150));
42501
+ await new Promise((resolve22) => setTimeout(resolve22, 150));
42502
42502
  const second = await this.readChat(evaluate);
42503
42503
  return this.messageCount(second) >= this.messageCount(first) ? second : first;
42504
42504
  }
@@ -42649,7 +42649,7 @@ var init_provider_adapter = __esm({
42649
42649
  if (typeof data.error === "string" && data.error.trim()) return false;
42650
42650
  }
42651
42651
  for (let attempt = 0; attempt < 6; attempt += 1) {
42652
- await new Promise((resolve21) => setTimeout(resolve21, 250));
42652
+ await new Promise((resolve22) => setTimeout(resolve22, 250));
42653
42653
  const state = await this.readChat(evaluate);
42654
42654
  const title = this.getStateTitle(state);
42655
42655
  if (this.titlesMatch(title, sessionId)) return true;
@@ -45296,7 +45296,7 @@ function getCliTargetBundle(ctx, type, instanceId) {
45296
45296
  return { target, instance, adapter };
45297
45297
  }
45298
45298
  function sleep(ms) {
45299
- return new Promise((resolve21) => setTimeout(resolve21, ms));
45299
+ return new Promise((resolve22) => setTimeout(resolve22, ms));
45300
45300
  }
45301
45301
  async function waitForCliReady(ctx, type, instanceId, timeoutMs) {
45302
45302
  const startedAt = Date.now();
@@ -47544,8 +47544,8 @@ var init_dev_server = __esm({
47544
47544
  }
47545
47545
  getEndpointList() {
47546
47546
  return this.routes.map((r) => {
47547
- const path39 = typeof r.pattern === "string" ? r.pattern : r.pattern.source.replace(/\\\//g, "/").replace(/\(\[.*?\]\+\)/g, ":type").replace(/[\^$]/g, "");
47548
- return `${r.method.padEnd(5)} ${path39}`;
47547
+ const path40 = typeof r.pattern === "string" ? r.pattern : r.pattern.source.replace(/\\\//g, "/").replace(/\(\[.*?\]\+\)/g, ":type").replace(/[\^$]/g, "");
47548
+ return `${r.method.padEnd(5)} ${path40}`;
47549
47549
  });
47550
47550
  }
47551
47551
  async start(port = DEV_SERVER_PORT) {
@@ -47576,15 +47576,15 @@ var init_dev_server = __esm({
47576
47576
  this.json(res, 500, { error: e.message });
47577
47577
  }
47578
47578
  });
47579
- return new Promise((resolve21, reject) => {
47579
+ return new Promise((resolve22, reject) => {
47580
47580
  this.server.listen(port, "127.0.0.1", () => {
47581
47581
  this.log(`Dev server listening on http://127.0.0.1:${port}`);
47582
- resolve21();
47582
+ resolve22();
47583
47583
  });
47584
47584
  this.server.on("error", (e) => {
47585
47585
  if (e.code === "EADDRINUSE") {
47586
47586
  this.log(`Port ${port} in use, skipping dev server`);
47587
- resolve21();
47587
+ resolve22();
47588
47588
  } else {
47589
47589
  reject(e);
47590
47590
  }
@@ -47666,20 +47666,20 @@ var init_dev_server = __esm({
47666
47666
  child.stderr?.on("data", (d) => {
47667
47667
  stderr += d.toString().slice(0, 2e3);
47668
47668
  });
47669
- await new Promise((resolve21) => {
47669
+ await new Promise((resolve22) => {
47670
47670
  const timer = setTimeout(() => {
47671
47671
  child.kill();
47672
- resolve21();
47672
+ resolve22();
47673
47673
  }, 3e3);
47674
47674
  child.on("exit", () => {
47675
47675
  clearTimeout(timer);
47676
- resolve21();
47676
+ resolve22();
47677
47677
  });
47678
47678
  child.stdout?.once("data", () => {
47679
47679
  setTimeout(() => {
47680
47680
  child.kill();
47681
47681
  clearTimeout(timer);
47682
- resolve21();
47682
+ resolve22();
47683
47683
  }, 500);
47684
47684
  });
47685
47685
  });
@@ -48182,14 +48182,14 @@ var init_dev_server = __esm({
48182
48182
  child.stderr?.on("data", (d) => {
48183
48183
  stderr += d.toString();
48184
48184
  });
48185
- await new Promise((resolve21) => {
48185
+ await new Promise((resolve22) => {
48186
48186
  const timer = setTimeout(() => {
48187
48187
  child.kill();
48188
- resolve21();
48188
+ resolve22();
48189
48189
  }, timeout);
48190
48190
  child.on("exit", () => {
48191
48191
  clearTimeout(timer);
48192
- resolve21();
48192
+ resolve22();
48193
48193
  });
48194
48194
  });
48195
48195
  const elapsed = Date.now() - start;
@@ -48859,14 +48859,14 @@ data: ${JSON.stringify(msg.data)}
48859
48859
  res.end(JSON.stringify(data, null, 2));
48860
48860
  }
48861
48861
  async readBody(req) {
48862
- return new Promise((resolve21) => {
48862
+ return new Promise((resolve22) => {
48863
48863
  let body = "";
48864
48864
  req.on("data", (chunk) => body += chunk);
48865
48865
  req.on("end", () => {
48866
48866
  try {
48867
- resolve21(JSON.parse(body));
48867
+ resolve22(JSON.parse(body));
48868
48868
  } catch {
48869
- resolve21({});
48869
+ resolve22({});
48870
48870
  }
48871
48871
  });
48872
48872
  });
@@ -49383,7 +49383,7 @@ async function waitForReady(endpoint, timeoutMs = STARTUP_TIMEOUT_MS) {
49383
49383
  const deadline = Date.now() + timeoutMs;
49384
49384
  while (Date.now() < deadline) {
49385
49385
  if (await canConnect(endpoint)) return;
49386
- await new Promise((resolve21) => setTimeout(resolve21, STARTUP_POLL_MS));
49386
+ await new Promise((resolve22) => setTimeout(resolve22, STARTUP_POLL_MS));
49387
49387
  }
49388
49388
  throw new Error(`Session host did not become ready within ${timeoutMs}ms`);
49389
49389
  }
@@ -49487,12 +49487,12 @@ async function installExtension(ide, extension) {
49487
49487
  const res = await fetch(extension.vsixUrl);
49488
49488
  if (res.ok) {
49489
49489
  const buffer = Buffer.from(await res.arrayBuffer());
49490
- const fs23 = await import("fs");
49491
- fs23.writeFileSync(vsixPath, buffer);
49492
- return new Promise((resolve21) => {
49490
+ const fs24 = await import("fs");
49491
+ fs24.writeFileSync(vsixPath, buffer);
49492
+ return new Promise((resolve22) => {
49493
49493
  const cmd = `"${ide.cliCommand}" --install-extension "${vsixPath}" --force`;
49494
49494
  (0, import_child_process11.exec)(cmd, { timeout: 6e4 }, (error48, _stdout, stderr) => {
49495
- resolve21({
49495
+ resolve22({
49496
49496
  extensionId: extension.id,
49497
49497
  marketplaceId: extension.marketplaceId,
49498
49498
  success: !error48,
@@ -49505,11 +49505,11 @@ async function installExtension(ide, extension) {
49505
49505
  } catch (e) {
49506
49506
  }
49507
49507
  }
49508
- return new Promise((resolve21) => {
49508
+ return new Promise((resolve22) => {
49509
49509
  const cmd = `"${ide.cliCommand}" --install-extension ${extension.marketplaceId} --force`;
49510
49510
  (0, import_child_process11.exec)(cmd, { timeout: 6e4 }, (error48, stdout, stderr) => {
49511
49511
  if (error48) {
49512
- resolve21({
49512
+ resolve22({
49513
49513
  extensionId: extension.id,
49514
49514
  marketplaceId: extension.marketplaceId,
49515
49515
  success: false,
@@ -49517,7 +49517,7 @@ async function installExtension(ide, extension) {
49517
49517
  error: stderr || error48.message
49518
49518
  });
49519
49519
  } else {
49520
- resolve21({
49520
+ resolve22({
49521
49521
  extensionId: extension.id,
49522
49522
  marketplaceId: extension.marketplaceId,
49523
49523
  success: true,
@@ -50213,7 +50213,7 @@ async function sendDaemonCommand(cmd, args = {}, port) {
50213
50213
  const resolvedPort = resolveDaemonCommandPort(port);
50214
50214
  const WebSocket4 = (await import("ws")).default;
50215
50215
  const { DAEMON_WS_PATH: DAEMON_WS_PATH2 } = await Promise.resolve().then(() => (init_src(), src_exports));
50216
- return new Promise((resolve21, reject) => {
50216
+ return new Promise((resolve22, reject) => {
50217
50217
  const wsUrl = `ws://127.0.0.1:${resolvedPort}${DAEMON_WS_PATH2 || "/daemon"}`;
50218
50218
  const ws = new WebSocket4(wsUrl);
50219
50219
  const requestId = `cli-${Date.now()}`;
@@ -50254,7 +50254,7 @@ async function sendDaemonCommand(cmd, args = {}, port) {
50254
50254
  if (msg.type === "ext:command_result" && msg.payload?.requestId === requestId || msg.type === "daemon:command_result" || msg.type === "command_result") {
50255
50255
  clearTimeout(timeout);
50256
50256
  ws.close();
50257
- resolve21(msg.payload?.result || msg.payload || msg);
50257
+ resolve22(msg.payload?.result || msg.payload || msg);
50258
50258
  }
50259
50259
  } catch {
50260
50260
  }
@@ -50273,13 +50273,13 @@ This command needs a running local daemon with IPC enabled. Start with: adhdev d
50273
50273
  }
50274
50274
  async function directCdpEval(expression, port = 9222) {
50275
50275
  const http3 = await import("http");
50276
- const targets = await new Promise((resolve21, reject) => {
50276
+ const targets = await new Promise((resolve22, reject) => {
50277
50277
  http3.get(`http://127.0.0.1:${port}/json`, (res) => {
50278
50278
  let data = "";
50279
50279
  res.on("data", (c) => data += c);
50280
50280
  res.on("end", () => {
50281
50281
  try {
50282
- resolve21(JSON.parse(data));
50282
+ resolve22(JSON.parse(data));
50283
50283
  } catch {
50284
50284
  reject(new Error("Invalid JSON"));
50285
50285
  }
@@ -50292,7 +50292,7 @@ async function directCdpEval(expression, port = 9222) {
50292
50292
  const target = (mainPages.length > 0 ? mainPages[0] : pages[0]) || targets[0];
50293
50293
  if (!target?.webSocketDebuggerUrl) throw new Error("No CDP target found");
50294
50294
  const WebSocket4 = (await import("ws")).default;
50295
- return new Promise((resolve21, reject) => {
50295
+ return new Promise((resolve22, reject) => {
50296
50296
  const ws = new WebSocket4(target.webSocketDebuggerUrl);
50297
50297
  const timeout = setTimeout(() => {
50298
50298
  ws.close();
@@ -50314,11 +50314,11 @@ async function directCdpEval(expression, port = 9222) {
50314
50314
  clearTimeout(timeout);
50315
50315
  ws.close();
50316
50316
  if (msg.result?.result?.value !== void 0) {
50317
- resolve21(msg.result.result.value);
50317
+ resolve22(msg.result.result.value);
50318
50318
  } else if (msg.result?.exceptionDetails) {
50319
50319
  reject(new Error(msg.result.exceptionDetails.text));
50320
50320
  } else {
50321
- resolve21(msg.result);
50321
+ resolve22(msg.result);
50322
50322
  }
50323
50323
  }
50324
50324
  });
@@ -50854,14 +50854,14 @@ var require_run_async = __commonJS({
50854
50854
  return function() {
50855
50855
  var args = arguments;
50856
50856
  var originalThis = this;
50857
- var promise2 = new Promise(function(resolve21, reject) {
50857
+ var promise2 = new Promise(function(resolve22, reject) {
50858
50858
  var resolved = false;
50859
50859
  const wrappedResolve = function(value) {
50860
50860
  if (resolved) {
50861
50861
  console.warn("Run-async promise already resolved.");
50862
50862
  }
50863
50863
  resolved = true;
50864
- resolve21(value);
50864
+ resolve22(value);
50865
50865
  };
50866
50866
  var rejected = false;
50867
50867
  const wrappedReject = function(value) {
@@ -51652,7 +51652,7 @@ var require_Observable = __commonJS({
51652
51652
  Observable2.prototype.forEach = function(next, promiseCtor) {
51653
51653
  var _this = this;
51654
51654
  promiseCtor = getPromiseCtor(promiseCtor);
51655
- return new promiseCtor(function(resolve21, reject) {
51655
+ return new promiseCtor(function(resolve22, reject) {
51656
51656
  var subscriber = new Subscriber_1.SafeSubscriber({
51657
51657
  next: function(value) {
51658
51658
  try {
@@ -51663,7 +51663,7 @@ var require_Observable = __commonJS({
51663
51663
  }
51664
51664
  },
51665
51665
  error: reject,
51666
- complete: resolve21
51666
+ complete: resolve22
51667
51667
  });
51668
51668
  _this.subscribe(subscriber);
51669
51669
  });
@@ -51685,14 +51685,14 @@ var require_Observable = __commonJS({
51685
51685
  Observable2.prototype.toPromise = function(promiseCtor) {
51686
51686
  var _this = this;
51687
51687
  promiseCtor = getPromiseCtor(promiseCtor);
51688
- return new promiseCtor(function(resolve21, reject) {
51688
+ return new promiseCtor(function(resolve22, reject) {
51689
51689
  var value;
51690
51690
  _this.subscribe(function(x) {
51691
51691
  return value = x;
51692
51692
  }, function(err) {
51693
51693
  return reject(err);
51694
51694
  }, function() {
51695
- return resolve21(value);
51695
+ return resolve22(value);
51696
51696
  });
51697
51697
  });
51698
51698
  };
@@ -53788,11 +53788,11 @@ var require_innerFrom = __commonJS({
53788
53788
  "use strict";
53789
53789
  var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
53790
53790
  function adopt(value) {
53791
- return value instanceof P ? value : new P(function(resolve21) {
53792
- resolve21(value);
53791
+ return value instanceof P ? value : new P(function(resolve22) {
53792
+ resolve22(value);
53793
53793
  });
53794
53794
  }
53795
- return new (P || (P = Promise))(function(resolve21, reject) {
53795
+ return new (P || (P = Promise))(function(resolve22, reject) {
53796
53796
  function fulfilled(value) {
53797
53797
  try {
53798
53798
  step(generator.next(value));
@@ -53808,7 +53808,7 @@ var require_innerFrom = __commonJS({
53808
53808
  }
53809
53809
  }
53810
53810
  function step(result) {
53811
- result.done ? resolve21(result.value) : adopt(result.value).then(fulfilled, rejected);
53811
+ result.done ? resolve22(result.value) : adopt(result.value).then(fulfilled, rejected);
53812
53812
  }
53813
53813
  step((generator = generator.apply(thisArg, _arguments || [])).next());
53814
53814
  });
@@ -53890,14 +53890,14 @@ var require_innerFrom = __commonJS({
53890
53890
  }, i);
53891
53891
  function verb(n) {
53892
53892
  i[n] = o[n] && function(v) {
53893
- return new Promise(function(resolve21, reject) {
53894
- v = o[n](v), settle(resolve21, reject, v.done, v.value);
53893
+ return new Promise(function(resolve22, reject) {
53894
+ v = o[n](v), settle(resolve22, reject, v.done, v.value);
53895
53895
  });
53896
53896
  };
53897
53897
  }
53898
- function settle(resolve21, reject, d, v) {
53898
+ function settle(resolve22, reject, d, v) {
53899
53899
  Promise.resolve(v).then(function(v2) {
53900
- resolve21({ value: v2, done: d });
53900
+ resolve22({ value: v2, done: d });
53901
53901
  }, reject);
53902
53902
  }
53903
53903
  };
@@ -54516,7 +54516,7 @@ var require_lastValueFrom = __commonJS({
54516
54516
  var EmptyError_1 = require_EmptyError();
54517
54517
  function lastValueFrom(source, config2) {
54518
54518
  var hasConfig = typeof config2 === "object";
54519
- return new Promise(function(resolve21, reject) {
54519
+ return new Promise(function(resolve22, reject) {
54520
54520
  var _hasValue = false;
54521
54521
  var _value;
54522
54522
  source.subscribe({
@@ -54527,9 +54527,9 @@ var require_lastValueFrom = __commonJS({
54527
54527
  error: reject,
54528
54528
  complete: function() {
54529
54529
  if (_hasValue) {
54530
- resolve21(_value);
54530
+ resolve22(_value);
54531
54531
  } else if (hasConfig) {
54532
- resolve21(config2.defaultValue);
54532
+ resolve22(config2.defaultValue);
54533
54533
  } else {
54534
54534
  reject(new EmptyError_1.EmptyError());
54535
54535
  }
@@ -54551,16 +54551,16 @@ var require_firstValueFrom = __commonJS({
54551
54551
  var Subscriber_1 = require_Subscriber();
54552
54552
  function firstValueFrom(source, config2) {
54553
54553
  var hasConfig = typeof config2 === "object";
54554
- return new Promise(function(resolve21, reject) {
54554
+ return new Promise(function(resolve22, reject) {
54555
54555
  var subscriber = new Subscriber_1.SafeSubscriber({
54556
54556
  next: function(value) {
54557
- resolve21(value);
54557
+ resolve22(value);
54558
54558
  subscriber.unsubscribe();
54559
54559
  },
54560
54560
  error: reject,
54561
54561
  complete: function() {
54562
54562
  if (hasConfig) {
54563
- resolve21(config2.defaultValue);
54563
+ resolve22(config2.defaultValue);
54564
54564
  } else {
54565
54565
  reject(new EmptyError_1.EmptyError());
54566
54566
  }
@@ -61679,15 +61679,15 @@ var require_route = __commonJS({
61679
61679
  };
61680
61680
  }
61681
61681
  function wrapConversion(toModel, graph) {
61682
- const path39 = [graph[toModel].parent, toModel];
61682
+ const path40 = [graph[toModel].parent, toModel];
61683
61683
  let fn = conversions[graph[toModel].parent][toModel];
61684
61684
  let cur = graph[toModel].parent;
61685
61685
  while (graph[cur].parent) {
61686
- path39.unshift(graph[cur].parent);
61686
+ path40.unshift(graph[cur].parent);
61687
61687
  fn = link(conversions[graph[cur].parent][cur], fn);
61688
61688
  cur = graph[cur].parent;
61689
61689
  }
61690
- fn.conversion = path39;
61690
+ fn.conversion = path40;
61691
61691
  return fn;
61692
61692
  }
61693
61693
  module2.exports = function(fromModel) {
@@ -66366,14 +66366,14 @@ var require_async_iterator = __commonJS({
66366
66366
  };
66367
66367
  }
66368
66368
  function readAndResolve(iter) {
66369
- var resolve21 = iter[kLastResolve];
66370
- if (resolve21 !== null) {
66369
+ var resolve22 = iter[kLastResolve];
66370
+ if (resolve22 !== null) {
66371
66371
  var data = iter[kStream].read();
66372
66372
  if (data !== null) {
66373
66373
  iter[kLastPromise] = null;
66374
66374
  iter[kLastResolve] = null;
66375
66375
  iter[kLastReject] = null;
66376
- resolve21(createIterResult(data, false));
66376
+ resolve22(createIterResult(data, false));
66377
66377
  }
66378
66378
  }
66379
66379
  }
@@ -66381,13 +66381,13 @@ var require_async_iterator = __commonJS({
66381
66381
  process.nextTick(readAndResolve, iter);
66382
66382
  }
66383
66383
  function wrapForNext(lastPromise, iter) {
66384
- return function(resolve21, reject) {
66384
+ return function(resolve22, reject) {
66385
66385
  lastPromise.then(function() {
66386
66386
  if (iter[kEnded]) {
66387
- resolve21(createIterResult(void 0, true));
66387
+ resolve22(createIterResult(void 0, true));
66388
66388
  return;
66389
66389
  }
66390
- iter[kHandlePromise](resolve21, reject);
66390
+ iter[kHandlePromise](resolve22, reject);
66391
66391
  }, reject);
66392
66392
  };
66393
66393
  }
@@ -66407,12 +66407,12 @@ var require_async_iterator = __commonJS({
66407
66407
  return Promise.resolve(createIterResult(void 0, true));
66408
66408
  }
66409
66409
  if (this[kStream].destroyed) {
66410
- return new Promise(function(resolve21, reject) {
66410
+ return new Promise(function(resolve22, reject) {
66411
66411
  process.nextTick(function() {
66412
66412
  if (_this[kError]) {
66413
66413
  reject(_this[kError]);
66414
66414
  } else {
66415
- resolve21(createIterResult(void 0, true));
66415
+ resolve22(createIterResult(void 0, true));
66416
66416
  }
66417
66417
  });
66418
66418
  });
@@ -66435,13 +66435,13 @@ var require_async_iterator = __commonJS({
66435
66435
  return this;
66436
66436
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
66437
66437
  var _this2 = this;
66438
- return new Promise(function(resolve21, reject) {
66438
+ return new Promise(function(resolve22, reject) {
66439
66439
  _this2[kStream].destroy(null, function(err) {
66440
66440
  if (err) {
66441
66441
  reject(err);
66442
66442
  return;
66443
66443
  }
66444
- resolve21(createIterResult(void 0, true));
66444
+ resolve22(createIterResult(void 0, true));
66445
66445
  });
66446
66446
  });
66447
66447
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -66463,15 +66463,15 @@ var require_async_iterator = __commonJS({
66463
66463
  value: stream._readableState.endEmitted,
66464
66464
  writable: true
66465
66465
  }), _defineProperty(_Object$create, kHandlePromise, {
66466
- value: function value(resolve21, reject) {
66466
+ value: function value(resolve22, reject) {
66467
66467
  var data = iterator[kStream].read();
66468
66468
  if (data) {
66469
66469
  iterator[kLastPromise] = null;
66470
66470
  iterator[kLastResolve] = null;
66471
66471
  iterator[kLastReject] = null;
66472
- resolve21(createIterResult(data, false));
66472
+ resolve22(createIterResult(data, false));
66473
66473
  } else {
66474
- iterator[kLastResolve] = resolve21;
66474
+ iterator[kLastResolve] = resolve22;
66475
66475
  iterator[kLastReject] = reject;
66476
66476
  }
66477
66477
  },
@@ -66490,12 +66490,12 @@ var require_async_iterator = __commonJS({
66490
66490
  iterator[kError] = err;
66491
66491
  return;
66492
66492
  }
66493
- var resolve21 = iterator[kLastResolve];
66494
- if (resolve21 !== null) {
66493
+ var resolve22 = iterator[kLastResolve];
66494
+ if (resolve22 !== null) {
66495
66495
  iterator[kLastPromise] = null;
66496
66496
  iterator[kLastResolve] = null;
66497
66497
  iterator[kLastReject] = null;
66498
- resolve21(createIterResult(void 0, true));
66498
+ resolve22(createIterResult(void 0, true));
66499
66499
  }
66500
66500
  iterator[kEnded] = true;
66501
66501
  });
@@ -66510,7 +66510,7 @@ var require_async_iterator = __commonJS({
66510
66510
  var require_from2 = __commonJS({
66511
66511
  "../../node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
66512
66512
  "use strict";
66513
- function asyncGeneratorStep(gen, resolve21, reject, _next, _throw, key, arg) {
66513
+ function asyncGeneratorStep(gen, resolve22, reject, _next, _throw, key, arg) {
66514
66514
  try {
66515
66515
  var info = gen[key](arg);
66516
66516
  var value = info.value;
@@ -66519,7 +66519,7 @@ var require_from2 = __commonJS({
66519
66519
  return;
66520
66520
  }
66521
66521
  if (info.done) {
66522
- resolve21(value);
66522
+ resolve22(value);
66523
66523
  } else {
66524
66524
  Promise.resolve(value).then(_next, _throw);
66525
66525
  }
@@ -66527,13 +66527,13 @@ var require_from2 = __commonJS({
66527
66527
  function _asyncToGenerator(fn) {
66528
66528
  return function() {
66529
66529
  var self2 = this, args = arguments;
66530
- return new Promise(function(resolve21, reject) {
66530
+ return new Promise(function(resolve22, reject) {
66531
66531
  var gen = fn.apply(self2, args);
66532
66532
  function _next(value) {
66533
- asyncGeneratorStep(gen, resolve21, reject, _next, _throw, "next", value);
66533
+ asyncGeneratorStep(gen, resolve22, reject, _next, _throw, "next", value);
66534
66534
  }
66535
66535
  function _throw(err) {
66536
- asyncGeneratorStep(gen, resolve21, reject, _next, _throw, "throw", err);
66536
+ asyncGeneratorStep(gen, resolve22, reject, _next, _throw, "throw", err);
66537
66537
  }
66538
66538
  _next(void 0);
66539
66539
  });
@@ -68472,9 +68472,9 @@ var init_base = __esm({
68472
68472
  * @return {Promise}
68473
68473
  */
68474
68474
  run() {
68475
- return new Promise((resolve21, reject) => {
68475
+ return new Promise((resolve22, reject) => {
68476
68476
  this._run(
68477
- (value) => resolve21(value),
68477
+ (value) => resolve22(value),
68478
68478
  (error48) => reject(error48)
68479
68479
  );
68480
68480
  });
@@ -75106,26 +75106,26 @@ var require_lib = __commonJS({
75106
75106
  return matches;
75107
75107
  };
75108
75108
  exports2.analyse = analyse;
75109
- var detectFile = (filepath, opts = {}) => new Promise((resolve21, reject) => {
75109
+ var detectFile = (filepath, opts = {}) => new Promise((resolve22, reject) => {
75110
75110
  let fd;
75111
- const fs23 = (0, node_1.default)();
75111
+ const fs24 = (0, node_1.default)();
75112
75112
  const handler = (err, buffer) => {
75113
75113
  if (fd) {
75114
- fs23.closeSync(fd);
75114
+ fs24.closeSync(fd);
75115
75115
  }
75116
75116
  if (err) {
75117
75117
  reject(err);
75118
75118
  } else if (buffer) {
75119
- resolve21((0, exports2.detect)(buffer));
75119
+ resolve22((0, exports2.detect)(buffer));
75120
75120
  } else {
75121
75121
  reject(new Error("No error and no buffer received"));
75122
75122
  }
75123
75123
  };
75124
75124
  const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
75125
75125
  if (sampleSize > 0) {
75126
- fd = fs23.openSync(filepath, "r");
75126
+ fd = fs24.openSync(filepath, "r");
75127
75127
  let sample = Buffer.allocUnsafe(sampleSize);
75128
- fs23.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
75128
+ fs24.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
75129
75129
  if (err) {
75130
75130
  handler(err, null);
75131
75131
  } else {
@@ -75137,22 +75137,22 @@ var require_lib = __commonJS({
75137
75137
  });
75138
75138
  return;
75139
75139
  }
75140
- fs23.readFile(filepath, handler);
75140
+ fs24.readFile(filepath, handler);
75141
75141
  });
75142
75142
  exports2.detectFile = detectFile;
75143
75143
  var detectFileSync = (filepath, opts = {}) => {
75144
- const fs23 = (0, node_1.default)();
75144
+ const fs24 = (0, node_1.default)();
75145
75145
  if (opts && opts.sampleSize) {
75146
- const fd = fs23.openSync(filepath, "r");
75146
+ const fd = fs24.openSync(filepath, "r");
75147
75147
  let sample = Buffer.allocUnsafe(opts.sampleSize);
75148
- const bytesRead = fs23.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
75148
+ const bytesRead = fs24.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
75149
75149
  if (bytesRead < opts.sampleSize) {
75150
75150
  sample = sample.subarray(0, bytesRead);
75151
75151
  }
75152
- fs23.closeSync(fd);
75152
+ fs24.closeSync(fd);
75153
75153
  return (0, exports2.detect)(sample);
75154
75154
  }
75155
- return (0, exports2.detect)(fs23.readFileSync(filepath));
75155
+ return (0, exports2.detect)(fs24.readFileSync(filepath));
75156
75156
  };
75157
75157
  exports2.detectFileSync = detectFileSync;
75158
75158
  exports2.default = {
@@ -79557,9 +79557,9 @@ var init_prompt = __esm({
79557
79557
  init_utils();
79558
79558
  init_baseUI();
79559
79559
  _ = {
79560
- set: (obj, path39 = "", value) => {
79560
+ set: (obj, path40 = "", value) => {
79561
79561
  let pointer = obj;
79562
- path39.split(".").forEach((key, index, arr) => {
79562
+ path40.split(".").forEach((key, index, arr) => {
79563
79563
  if (key === "__proto__" || key === "constructor") return;
79564
79564
  if (index === arr.length - 1) {
79565
79565
  pointer[key] = value;
@@ -79569,8 +79569,8 @@ var init_prompt = __esm({
79569
79569
  pointer = pointer[key];
79570
79570
  });
79571
79571
  },
79572
- get: (obj, path39 = "", defaultValue) => {
79573
- const travel = (regexp) => String.prototype.split.call(path39, regexp).filter(Boolean).reduce(
79572
+ get: (obj, path40 = "", defaultValue) => {
79573
+ const travel = (regexp) => String.prototype.split.call(path40, regexp).filter(Boolean).reduce(
79574
79574
  // @ts-expect-error implicit any on res[key]
79575
79575
  (res, key) => res !== null && res !== void 0 ? res[key] : res,
79576
79576
  obj
@@ -80986,7 +80986,7 @@ var init_server_connection = __esm({
80986
80986
  * Returns the command result or throws on timeout / auth failure.
80987
80987
  */
80988
80988
  sendMeshCommand(targetDaemonId, command, args = {}, timeoutMs = 3e4) {
80989
- return new Promise((resolve21, reject) => {
80989
+ return new Promise((resolve22, reject) => {
80990
80990
  const requestId = `mesh_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
80991
80991
  const timer = setTimeout(() => {
80992
80992
  this.off("daemon_mesh_result", handler);
@@ -80999,7 +80999,7 @@ var init_server_connection = __esm({
80999
80999
  if (msg.payload?.success === false) {
81000
81000
  reject(new Error(msg.payload?.error ?? "Mesh command failed"));
81001
81001
  } else {
81002
- resolve21(msg.payload?.result);
81002
+ resolve22(msg.payload?.result);
81003
81003
  }
81004
81004
  };
81005
81005
  this.on("daemon_mesh_result", handler);
@@ -82789,27 +82789,27 @@ var require_process = __commonJS({
82789
82789
  var require_filesystem = __commonJS({
82790
82790
  "../../node_modules/detect-libc/lib/filesystem.js"(exports2, module2) {
82791
82791
  "use strict";
82792
- var fs23 = require("fs");
82792
+ var fs24 = require("fs");
82793
82793
  var LDD_PATH = "/usr/bin/ldd";
82794
82794
  var SELF_PATH = "/proc/self/exe";
82795
82795
  var MAX_LENGTH = 2048;
82796
- var readFileSync20 = (path39) => {
82797
- const fd = fs23.openSync(path39, "r");
82796
+ var readFileSync20 = (path40) => {
82797
+ const fd = fs24.openSync(path40, "r");
82798
82798
  const buffer = Buffer.alloc(MAX_LENGTH);
82799
- const bytesRead = fs23.readSync(fd, buffer, 0, MAX_LENGTH, 0);
82800
- fs23.close(fd, () => {
82799
+ const bytesRead = fs24.readSync(fd, buffer, 0, MAX_LENGTH, 0);
82800
+ fs24.close(fd, () => {
82801
82801
  });
82802
82802
  return buffer.subarray(0, bytesRead);
82803
82803
  };
82804
- var readFile2 = (path39) => new Promise((resolve21, reject) => {
82805
- fs23.open(path39, "r", (err, fd) => {
82804
+ var readFile2 = (path40) => new Promise((resolve22, reject) => {
82805
+ fs24.open(path40, "r", (err, fd) => {
82806
82806
  if (err) {
82807
82807
  reject(err);
82808
82808
  } else {
82809
82809
  const buffer = Buffer.alloc(MAX_LENGTH);
82810
- fs23.read(fd, buffer, 0, MAX_LENGTH, 0, (_2, bytesRead) => {
82811
- resolve21(buffer.subarray(0, bytesRead));
82812
- fs23.close(fd, () => {
82810
+ fs24.read(fd, buffer, 0, MAX_LENGTH, 0, (_2, bytesRead) => {
82811
+ resolve22(buffer.subarray(0, bytesRead));
82812
+ fs24.close(fd, () => {
82813
82813
  });
82814
82814
  });
82815
82815
  }
@@ -82876,10 +82876,10 @@ var require_detect_libc = __commonJS({
82876
82876
  var commandOut = "";
82877
82877
  var safeCommand = () => {
82878
82878
  if (!commandOut) {
82879
- return new Promise((resolve21) => {
82879
+ return new Promise((resolve22) => {
82880
82880
  childProcess.exec(command, (err, out) => {
82881
82881
  commandOut = err ? " " : out;
82882
- resolve21(commandOut);
82882
+ resolve22(commandOut);
82883
82883
  });
82884
82884
  });
82885
82885
  }
@@ -82921,11 +82921,11 @@ var require_detect_libc = __commonJS({
82921
82921
  }
82922
82922
  return null;
82923
82923
  };
82924
- var familyFromInterpreterPath = (path39) => {
82925
- if (path39) {
82926
- if (path39.includes("/ld-musl-")) {
82924
+ var familyFromInterpreterPath = (path40) => {
82925
+ if (path40) {
82926
+ if (path40.includes("/ld-musl-")) {
82927
82927
  return MUSL;
82928
- } else if (path39.includes("/ld-linux-")) {
82928
+ } else if (path40.includes("/ld-linux-")) {
82929
82929
  return GLIBC;
82930
82930
  }
82931
82931
  }
@@ -82972,8 +82972,8 @@ var require_detect_libc = __commonJS({
82972
82972
  cachedFamilyInterpreter = null;
82973
82973
  try {
82974
82974
  const selfContent = await readFile2(SELF_PATH);
82975
- const path39 = interpreterPath(selfContent);
82976
- cachedFamilyInterpreter = familyFromInterpreterPath(path39);
82975
+ const path40 = interpreterPath(selfContent);
82976
+ cachedFamilyInterpreter = familyFromInterpreterPath(path40);
82977
82977
  } catch (e) {
82978
82978
  }
82979
82979
  return cachedFamilyInterpreter;
@@ -82985,8 +82985,8 @@ var require_detect_libc = __commonJS({
82985
82985
  cachedFamilyInterpreter = null;
82986
82986
  try {
82987
82987
  const selfContent = readFileSync20(SELF_PATH);
82988
- const path39 = interpreterPath(selfContent);
82989
- cachedFamilyInterpreter = familyFromInterpreterPath(path39);
82988
+ const path40 = interpreterPath(selfContent);
82989
+ cachedFamilyInterpreter = familyFromInterpreterPath(path40);
82990
82990
  } catch (e) {
82991
82991
  }
82992
82992
  return cachedFamilyInterpreter;
@@ -84705,18 +84705,18 @@ var require_sharp = __commonJS({
84705
84705
  `@img/sharp-${runtimePlatform}/sharp.node`,
84706
84706
  "@img/sharp-wasm32/sharp.node"
84707
84707
  ];
84708
- var path39;
84708
+ var path40;
84709
84709
  var sharp;
84710
84710
  var errors = [];
84711
- for (path39 of paths) {
84711
+ for (path40 of paths) {
84712
84712
  try {
84713
- sharp = require(path39);
84713
+ sharp = require(path40);
84714
84714
  break;
84715
84715
  } catch (err) {
84716
84716
  errors.push(err);
84717
84717
  }
84718
84718
  }
84719
- if (sharp && path39.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
84719
+ if (sharp && path40.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
84720
84720
  const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
84721
84721
  err.code = "Unsupported CPU";
84722
84722
  errors.push(err);
@@ -85559,14 +85559,14 @@ var require_input = __commonJS({
85559
85559
  return this;
85560
85560
  } else {
85561
85561
  if (this._isStreamInput()) {
85562
- return new Promise((resolve21, reject) => {
85562
+ return new Promise((resolve22, reject) => {
85563
85563
  const finished = () => {
85564
85564
  this._flattenBufferIn();
85565
85565
  sharp.metadata(this.options, (err, metadata2) => {
85566
85566
  if (err) {
85567
85567
  reject(is.nativeError(err, stack));
85568
85568
  } else {
85569
- resolve21(metadata2);
85569
+ resolve22(metadata2);
85570
85570
  }
85571
85571
  });
85572
85572
  };
@@ -85577,12 +85577,12 @@ var require_input = __commonJS({
85577
85577
  }
85578
85578
  });
85579
85579
  } else {
85580
- return new Promise((resolve21, reject) => {
85580
+ return new Promise((resolve22, reject) => {
85581
85581
  sharp.metadata(this.options, (err, metadata2) => {
85582
85582
  if (err) {
85583
85583
  reject(is.nativeError(err, stack));
85584
85584
  } else {
85585
- resolve21(metadata2);
85585
+ resolve22(metadata2);
85586
85586
  }
85587
85587
  });
85588
85588
  });
@@ -85615,25 +85615,25 @@ var require_input = __commonJS({
85615
85615
  return this;
85616
85616
  } else {
85617
85617
  if (this._isStreamInput()) {
85618
- return new Promise((resolve21, reject) => {
85618
+ return new Promise((resolve22, reject) => {
85619
85619
  this.on("finish", function() {
85620
85620
  this._flattenBufferIn();
85621
85621
  sharp.stats(this.options, (err, stats2) => {
85622
85622
  if (err) {
85623
85623
  reject(is.nativeError(err, stack));
85624
85624
  } else {
85625
- resolve21(stats2);
85625
+ resolve22(stats2);
85626
85626
  }
85627
85627
  });
85628
85628
  });
85629
85629
  });
85630
85630
  } else {
85631
- return new Promise((resolve21, reject) => {
85631
+ return new Promise((resolve22, reject) => {
85632
85632
  sharp.stats(this.options, (err, stats2) => {
85633
85633
  if (err) {
85634
85634
  reject(is.nativeError(err, stack));
85635
85635
  } else {
85636
- resolve21(stats2);
85636
+ resolve22(stats2);
85637
85637
  }
85638
85638
  });
85639
85639
  });
@@ -87625,15 +87625,15 @@ var require_color = __commonJS({
87625
87625
  };
87626
87626
  }
87627
87627
  function wrapConversion(toModel, graph) {
87628
- const path39 = [graph[toModel].parent, toModel];
87628
+ const path40 = [graph[toModel].parent, toModel];
87629
87629
  let fn = conversions_default[graph[toModel].parent][toModel];
87630
87630
  let cur = graph[toModel].parent;
87631
87631
  while (graph[cur].parent) {
87632
- path39.unshift(graph[cur].parent);
87632
+ path40.unshift(graph[cur].parent);
87633
87633
  fn = link(conversions_default[graph[cur].parent][cur], fn);
87634
87634
  cur = graph[cur].parent;
87635
87635
  }
87636
- fn.conversion = path39;
87636
+ fn.conversion = path40;
87637
87637
  return fn;
87638
87638
  }
87639
87639
  function route(fromModel) {
@@ -88250,7 +88250,7 @@ var require_channel = __commonJS({
88250
88250
  var require_output = __commonJS({
88251
88251
  "../../node_modules/sharp/lib/output.js"(exports2, module2) {
88252
88252
  "use strict";
88253
- var path39 = require("path");
88253
+ var path40 = require("path");
88254
88254
  var is = require_is();
88255
88255
  var sharp = require_sharp();
88256
88256
  var formats = /* @__PURE__ */ new Map([
@@ -88281,9 +88281,9 @@ var require_output = __commonJS({
88281
88281
  let err;
88282
88282
  if (!is.string(fileOut)) {
88283
88283
  err = new Error("Missing output file path");
88284
- } else if (is.string(this.options.input.file) && path39.resolve(this.options.input.file) === path39.resolve(fileOut)) {
88284
+ } else if (is.string(this.options.input.file) && path40.resolve(this.options.input.file) === path40.resolve(fileOut)) {
88285
88285
  err = new Error("Cannot use same file for input and output");
88286
- } else if (jp2Regex.test(path39.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
88286
+ } else if (jp2Regex.test(path40.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
88287
88287
  err = errJp2Save();
88288
88288
  }
88289
88289
  if (err) {
@@ -89055,7 +89055,7 @@ var require_output = __commonJS({
89055
89055
  return this;
89056
89056
  } else {
89057
89057
  if (this._isStreamInput()) {
89058
- return new Promise((resolve21, reject) => {
89058
+ return new Promise((resolve22, reject) => {
89059
89059
  this.once("finish", () => {
89060
89060
  this._flattenBufferIn();
89061
89061
  sharp.pipeline(this.options, (err, data, info) => {
@@ -89063,24 +89063,24 @@ var require_output = __commonJS({
89063
89063
  reject(is.nativeError(err, stack));
89064
89064
  } else {
89065
89065
  if (this.options.resolveWithObject) {
89066
- resolve21({ data, info });
89066
+ resolve22({ data, info });
89067
89067
  } else {
89068
- resolve21(data);
89068
+ resolve22(data);
89069
89069
  }
89070
89070
  }
89071
89071
  });
89072
89072
  });
89073
89073
  });
89074
89074
  } else {
89075
- return new Promise((resolve21, reject) => {
89075
+ return new Promise((resolve22, reject) => {
89076
89076
  sharp.pipeline(this.options, (err, data, info) => {
89077
89077
  if (err) {
89078
89078
  reject(is.nativeError(err, stack));
89079
89079
  } else {
89080
89080
  if (this.options.resolveWithObject) {
89081
- resolve21({ data, info });
89081
+ resolve22({ data, info });
89082
89082
  } else {
89083
- resolve21(data);
89083
+ resolve22(data);
89084
89084
  }
89085
89085
  }
89086
89086
  });
@@ -90289,7 +90289,7 @@ var init_adhdev_daemon = __esm({
90289
90289
  init_version();
90290
90290
  init_src();
90291
90291
  init_runtime_defaults();
90292
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.58" });
90292
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.59" });
90293
90293
  AdhdevDaemon = class _AdhdevDaemon {
90294
90294
  localHttpServer = null;
90295
90295
  localWss = null;
@@ -91270,7 +91270,7 @@ ${err?.stack || ""}`);
91270
91270
  this.localWss.emit("connection", ws, req);
91271
91271
  });
91272
91272
  });
91273
- await new Promise((resolve21, reject) => {
91273
+ await new Promise((resolve22, reject) => {
91274
91274
  const cleanup = () => {
91275
91275
  this.localHttpServer?.off("error", onError);
91276
91276
  this.localHttpServer?.off("listening", onListening);
@@ -91281,7 +91281,7 @@ ${err?.stack || ""}`);
91281
91281
  };
91282
91282
  const onListening = () => {
91283
91283
  cleanup();
91284
- resolve21();
91284
+ resolve22();
91285
91285
  };
91286
91286
  this.localHttpServer.once("error", onError);
91287
91287
  this.localHttpServer.once("listening", onListening);
@@ -91455,12 +91455,12 @@ ${err?.stack || ""}`);
91455
91455
  this.localClients.clear();
91456
91456
  this.localWss?.close();
91457
91457
  this.localWss = null;
91458
- await new Promise((resolve21) => {
91458
+ await new Promise((resolve22) => {
91459
91459
  if (!this.localHttpServer) {
91460
- resolve21();
91460
+ resolve22();
91461
91461
  return;
91462
91462
  }
91463
- this.localHttpServer.close(() => resolve21());
91463
+ this.localHttpServer.close(() => resolve22());
91464
91464
  this.localHttpServer = null;
91465
91465
  });
91466
91466
  } catch {
@@ -93660,8 +93660,8 @@ function registerSetupCommands(program2, getProviderLoader2) {
93660
93660
  });
93661
93661
  program2.command("uninstall").description("Completely wipe all setting, configuration, stop daemon and uninstall service").option("-f, --force", "Skip confirmation prompt").action(async (options) => {
93662
93662
  const inquirer2 = await Promise.resolve().then(() => (init_lib(), lib_exports));
93663
- const fs23 = await import("fs");
93664
- const path39 = await import("path");
93663
+ const fs24 = await import("fs");
93664
+ const path40 = await import("path");
93665
93665
  const os31 = await import("os");
93666
93666
  const { spawnSync: spawnSync3 } = await import("child_process");
93667
93667
  if (!options.force) {
@@ -93687,11 +93687,11 @@ function registerSetupCommands(program2, getProviderLoader2) {
93687
93687
  }
93688
93688
  console.log(source_default.gray(" Removing OS background service..."));
93689
93689
  spawnSync3(process.execPath, [process.argv[1], "service", "uninstall"], { stdio: "inherit" });
93690
- const adhdevDir = path39.join(os31.homedir(), ".adhdev");
93691
- if (fs23.existsSync(adhdevDir)) {
93690
+ const adhdevDir = path40.join(os31.homedir(), ".adhdev");
93691
+ if (fs24.existsSync(adhdevDir)) {
93692
93692
  console.log(source_default.gray(` Deleting ${adhdevDir}...`));
93693
93693
  try {
93694
- fs23.rmSync(adhdevDir, { recursive: true, force: true });
93694
+ fs24.rmSync(adhdevDir, { recursive: true, force: true });
93695
93695
  console.log(source_default.green(" \u2713 Data wiped."));
93696
93696
  } catch (e) {
93697
93697
  console.log(source_default.red(` \u2717 Failed to delete ~/.adhdev: ${e.message}`));
@@ -93945,14 +93945,14 @@ async function requestSessionHostDirect(request) {
93945
93945
  }
93946
93946
  async function runRuntimeLaunchSpec(spec) {
93947
93947
  const { spawn: spawn7 } = await import("child_process");
93948
- return await new Promise((resolve21, reject) => {
93948
+ return await new Promise((resolve22, reject) => {
93949
93949
  const child = spawn7(spec.command, spec.args, {
93950
93950
  stdio: "inherit",
93951
93951
  env: spec.env,
93952
93952
  shell: process.platform === "win32" && spec.command !== process.execPath
93953
93953
  });
93954
93954
  child.on("error", reject);
93955
- child.on("exit", (code) => resolve21(code ?? 0));
93955
+ child.on("exit", (code) => resolve22(code ?? 0));
93956
93956
  });
93957
93957
  }
93958
93958
  async function resolveRuntimeSessionId(target, options) {
@@ -94186,7 +94186,7 @@ async function handleTraceCommand(options) {
94186
94186
  }
94187
94187
  }
94188
94188
  while (!stopped) {
94189
- await new Promise((resolve21) => setTimeout(resolve21, intervalMs));
94189
+ await new Promise((resolve22) => setTimeout(resolve22, intervalMs));
94190
94190
  if (stopped) break;
94191
94191
  const nextTrace = await fetchTrace(buildDebugTraceFollowPollArgs(baseArgs, cursor));
94192
94192
  const nextBatch = collectFreshDebugTraceEntries(nextTrace, cursor);
@@ -95952,7 +95952,7 @@ function registerProviderCommands(program2) {
95952
95952
  } catch {
95953
95953
  try {
95954
95954
  const http3 = await import("http");
95955
- const result = await new Promise((resolve21, reject) => {
95955
+ const result = await new Promise((resolve22, reject) => {
95956
95956
  const req = http3.request({
95957
95957
  hostname: "127.0.0.1",
95958
95958
  port: DEV_SERVER_PORT3,
@@ -95964,9 +95964,9 @@ function registerProviderCommands(program2) {
95964
95964
  res.on("data", (c) => data += c);
95965
95965
  res.on("end", () => {
95966
95966
  try {
95967
- resolve21(JSON.parse(data));
95967
+ resolve22(JSON.parse(data));
95968
95968
  } catch {
95969
- resolve21({ raw: data });
95969
+ resolve22({ raw: data });
95970
95970
  }
95971
95971
  });
95972
95972
  });
@@ -96026,35 +96026,35 @@ function registerProviderCommands(program2) {
96026
96026
  let osPaths = {};
96027
96027
  let processNames = {};
96028
96028
  if (category === "ide") {
96029
- const fs23 = await import("fs");
96030
- const path39 = await import("path");
96029
+ const fs24 = await import("fs");
96030
+ const path40 = await import("path");
96031
96031
  const os31 = await import("os");
96032
96032
  if (os31.platform() === "darwin") {
96033
96033
  while (true) {
96034
96034
  const p = (await rl.question(`macOS Application Path (e.g. /Applications/${defaultName}.app): `)).trim() || `/Applications/${defaultName}.app`;
96035
96035
  if (p === "skip") break;
96036
- if (!fs23.existsSync(p)) {
96036
+ if (!fs24.existsSync(p)) {
96037
96037
  console.log(source_default.red(` \u2717 Path not found: ${p}`));
96038
96038
  console.log(source_default.gray(` (Please provide the exact absolute path to the .app or binary, or type 'skip')`));
96039
96039
  continue;
96040
96040
  }
96041
96041
  console.log(source_default.green(` \u2713 Path verified: ${p}`));
96042
96042
  osPaths["darwin"] = [p];
96043
- processNames["darwin"] = path39.basename(p, ".app");
96043
+ processNames["darwin"] = path40.basename(p, ".app");
96044
96044
  break;
96045
96045
  }
96046
96046
  } else if (os31.platform() === "win32") {
96047
96047
  while (true) {
96048
96048
  const p = (await rl.question(`Windows Executable Path (e.g. C:\\Program Files\\${defaultName}\\${defaultName}.exe): `)).trim();
96049
96049
  if (!p || p === "skip") break;
96050
- if (!fs23.existsSync(p)) {
96050
+ if (!fs24.existsSync(p)) {
96051
96051
  console.log(source_default.red(` \u2717 Path not found: ${p}`));
96052
96052
  console.log(source_default.gray(` (Please provide the exact absolute path, or type 'skip')`));
96053
96053
  continue;
96054
96054
  }
96055
96055
  console.log(source_default.green(` \u2713 Path verified: ${p}`));
96056
96056
  osPaths["win32"] = [p];
96057
- processNames["win32"] = path39.basename(p, ".exe");
96057
+ processNames["win32"] = path40.basename(p, ".exe");
96058
96058
  break;
96059
96059
  }
96060
96060
  }
@@ -96068,12 +96068,12 @@ function registerProviderCommands(program2) {
96068
96068
  console.log(source_default.yellow("Invalid port number."));
96069
96069
  continue;
96070
96070
  }
96071
- const isFree = await new Promise((resolve21) => {
96071
+ const isFree = await new Promise((resolve22) => {
96072
96072
  const server = net3.createServer();
96073
96073
  server.unref();
96074
- server.on("error", () => resolve21(false));
96074
+ server.on("error", () => resolve22(false));
96075
96075
  server.listen(port, "127.0.0.1", () => {
96076
- server.close(() => resolve21(true));
96076
+ server.close(() => resolve22(true));
96077
96077
  });
96078
96078
  });
96079
96079
  if (!isFree) {
@@ -96088,7 +96088,7 @@ function registerProviderCommands(program2) {
96088
96088
  rl.close();
96089
96089
  const location = options.builtin ? "builtin" : "user";
96090
96090
  const http3 = await import("http");
96091
- const result = await new Promise((resolve21, reject) => {
96091
+ const result = await new Promise((resolve22, reject) => {
96092
96092
  const postData = JSON.stringify({ type, name, category, location, cdpPorts, osPaths, processNames });
96093
96093
  const req = http3.request({
96094
96094
  hostname: "127.0.0.1",
@@ -96101,9 +96101,9 @@ function registerProviderCommands(program2) {
96101
96101
  res.on("data", (c) => data += c);
96102
96102
  res.on("end", () => {
96103
96103
  try {
96104
- resolve21(JSON.parse(data));
96104
+ resolve22(JSON.parse(data));
96105
96105
  } catch {
96106
- resolve21({ raw: data });
96106
+ resolve22({ raw: data });
96107
96107
  }
96108
96108
  });
96109
96109
  });
@@ -96302,7 +96302,7 @@ function registerProviderCommands(program2) {
96302
96302
  reference,
96303
96303
  ...verification ? { verification } : {}
96304
96304
  });
96305
- const startResult = await new Promise((resolve21, reject) => {
96305
+ const startResult = await new Promise((resolve22, reject) => {
96306
96306
  const req = http3.request({
96307
96307
  hostname: "127.0.0.1",
96308
96308
  port: DEV_SERVER_PORT3,
@@ -96314,9 +96314,9 @@ function registerProviderCommands(program2) {
96314
96314
  res.on("data", (c) => data += c);
96315
96315
  res.on("end", () => {
96316
96316
  try {
96317
- resolve21(JSON.parse(data));
96317
+ resolve22(JSON.parse(data));
96318
96318
  } catch {
96319
- resolve21({ raw: data });
96319
+ resolve22({ raw: data });
96320
96320
  }
96321
96321
  });
96322
96322
  });
@@ -96350,7 +96350,7 @@ function registerProviderCommands(program2) {
96350
96350
  fsMock.writeFileSync(logFile, `=== Auto-Impl Started ===
96351
96351
  `);
96352
96352
  console.log(source_default.gray(` Agent logs: ${logFile}`));
96353
- await new Promise((resolve21, reject) => {
96353
+ await new Promise((resolve22, reject) => {
96354
96354
  http3.get(`http://127.0.0.1:${DEV_SERVER_PORT3}${startResult.sseUrl}`, (res) => {
96355
96355
  let buffer = "";
96356
96356
  res.on("data", (chunk) => {
@@ -96387,7 +96387,7 @@ function registerProviderCommands(program2) {
96387
96387
  if (currentData.success === false) {
96388
96388
  reject(new Error(`Agent failed to implement scripts properly (exit: ${currentData.exitCode})`));
96389
96389
  } else {
96390
- resolve21();
96390
+ resolve22();
96391
96391
  }
96392
96392
  } else if (currentEvent === "error") {
96393
96393
  fsMock.appendFileSync(logFile, `
@@ -96398,7 +96398,7 @@ function registerProviderCommands(program2) {
96398
96398
  }
96399
96399
  }
96400
96400
  });
96401
- res.on("end", resolve21);
96401
+ res.on("end", resolve22);
96402
96402
  }).on("error", reject);
96403
96403
  });
96404
96404
  console.log(source_default.green(`
@@ -96457,7 +96457,7 @@ function registerProviderCommands(program2) {
96457
96457
  ideType: type,
96458
96458
  params: options.param ? { text: options.param, sessionId: options.param, buttonText: options.param } : {}
96459
96459
  });
96460
- const result = await new Promise((resolve21, reject) => {
96460
+ const result = await new Promise((resolve22, reject) => {
96461
96461
  const req = http3.request({
96462
96462
  hostname: "127.0.0.1",
96463
96463
  port: DEV_SERVER_PORT3,
@@ -96469,9 +96469,9 @@ function registerProviderCommands(program2) {
96469
96469
  res.on("data", (c) => data += c);
96470
96470
  res.on("end", () => {
96471
96471
  try {
96472
- resolve21(JSON.parse(data));
96472
+ resolve22(JSON.parse(data));
96473
96473
  } catch {
96474
- resolve21({ raw: data });
96474
+ resolve22({ raw: data });
96475
96475
  }
96476
96476
  });
96477
96477
  });
@@ -96507,15 +96507,15 @@ function registerProviderCommands(program2) {
96507
96507
  provider.command("source <type>").description("View source code of a provider").action(async (type) => {
96508
96508
  try {
96509
96509
  const http3 = await import("http");
96510
- const result = await new Promise((resolve21, reject) => {
96510
+ const result = await new Promise((resolve22, reject) => {
96511
96511
  http3.get(`http://127.0.0.1:${DEV_SERVER_PORT3}/api/providers/${type}/source`, (res) => {
96512
96512
  let data = "";
96513
96513
  res.on("data", (c) => data += c);
96514
96514
  res.on("end", () => {
96515
96515
  try {
96516
- resolve21(JSON.parse(data));
96516
+ resolve22(JSON.parse(data));
96517
96517
  } catch {
96518
- resolve21({ raw: data });
96518
+ resolve22({ raw: data });
96519
96519
  }
96520
96520
  });
96521
96521
  }).on("error", () => {
@@ -96563,7 +96563,7 @@ function registerProviderCommands(program2) {
96563
96563
  try {
96564
96564
  const http3 = await import("http");
96565
96565
  const postData = JSON.stringify({ script: "readChat", params: {} });
96566
- const result = await new Promise((resolve21, reject) => {
96566
+ const result = await new Promise((resolve22, reject) => {
96567
96567
  const req = http3.request({
96568
96568
  hostname: "127.0.0.1",
96569
96569
  port: DEV_SERVER_PORT3,
@@ -96575,9 +96575,9 @@ function registerProviderCommands(program2) {
96575
96575
  res2.on("data", (c) => data += c);
96576
96576
  res2.on("end", () => {
96577
96577
  try {
96578
- resolve21(JSON.parse(data));
96578
+ resolve22(JSON.parse(data));
96579
96579
  } catch {
96580
- resolve21({ raw: data });
96580
+ resolve22({ raw: data });
96581
96581
  }
96582
96582
  });
96583
96583
  });
@@ -96741,8 +96741,8 @@ function registerCdpCommands(program2) {
96741
96741
  }
96742
96742
  const output = typeof result === "string" ? result : JSON.stringify(result, null, 2);
96743
96743
  if (options.output) {
96744
- const fs23 = await import("fs");
96745
- fs23.writeFileSync(options.output, output, "utf-8");
96744
+ const fs24 = await import("fs");
96745
+ fs24.writeFileSync(options.output, output, "utf-8");
96746
96746
  console.log(source_default.green(`
96747
96747
  \u2713 Saved to ${options.output} (${output.length} chars)
96748
96748
  `));
@@ -96818,13 +96818,13 @@ function registerCdpCommands(program2) {
96818
96818
  cdp.command("screenshot").description("Capture IDE screenshot").option("-p, --port <port>", "CDP port", "9222").option("-o, --output <file>", "Output file path", "/tmp/cdp_screenshot.jpg").action(async (options) => {
96819
96819
  try {
96820
96820
  const http3 = await import("http");
96821
- const targets = await new Promise((resolve21, reject) => {
96821
+ const targets = await new Promise((resolve22, reject) => {
96822
96822
  http3.get(`http://127.0.0.1:${options.port}/json`, (res) => {
96823
96823
  let data = "";
96824
96824
  res.on("data", (c) => data += c);
96825
96825
  res.on("end", () => {
96826
96826
  try {
96827
- resolve21(JSON.parse(data));
96827
+ resolve22(JSON.parse(data));
96828
96828
  } catch {
96829
96829
  reject(new Error("Invalid JSON"));
96830
96830
  }
@@ -96838,20 +96838,20 @@ function registerCdpCommands(program2) {
96838
96838
  if (!target?.webSocketDebuggerUrl) throw new Error("No CDP target");
96839
96839
  const WebSocket4 = (await import("ws")).default;
96840
96840
  const ws = new WebSocket4(target.webSocketDebuggerUrl);
96841
- await new Promise((resolve21, reject) => {
96841
+ await new Promise((resolve22, reject) => {
96842
96842
  ws.on("open", () => {
96843
96843
  ws.send(JSON.stringify({ id: 1, method: "Page.captureScreenshot", params: { format: "jpeg", quality: 50 } }));
96844
96844
  });
96845
96845
  ws.on("message", async (data) => {
96846
96846
  const msg = JSON.parse(data.toString());
96847
96847
  if (msg.id === 1 && msg.result?.data) {
96848
- const fs23 = await import("fs");
96849
- fs23.writeFileSync(options.output, Buffer.from(msg.result.data, "base64"));
96848
+ const fs24 = await import("fs");
96849
+ fs24.writeFileSync(options.output, Buffer.from(msg.result.data, "base64"));
96850
96850
  console.log(source_default.green(`
96851
96851
  \u2713 Screenshot saved to ${options.output}
96852
96852
  `));
96853
96853
  ws.close();
96854
- resolve21();
96854
+ resolve22();
96855
96855
  }
96856
96856
  });
96857
96857
  ws.on("error", (e) => reject(e));
@@ -96867,7 +96867,9 @@ function registerCdpCommands(program2) {
96867
96867
 
96868
96868
  // src/cli/mcp-commands.ts
96869
96869
  var import_node_child_process3 = require("child_process");
96870
+ var fs23 = __toESM(require("fs"));
96870
96871
  var import_node_module3 = require("module");
96872
+ var path39 = __toESM(require("path"));
96871
96873
  init_source();
96872
96874
  function registerMcpCommands(program2) {
96873
96875
  program2.command("mcp").description("Start an MCP server to expose IDE agents as tools (for Claude Desktop, etc.)").option("--api-key <key>", "ADHDev cloud API key (switches to cloud mode)").option("--port <n>", "Standalone daemon port (default: 3847)", "3847").option("--password <pass>", "Standalone daemon password (if set)").option("--base-url <url>", "Override cloud API base URL").addHelpText("after", `
@@ -96915,6 +96917,15 @@ Tools available (cloud): list_sessions, read_chat, send_chat, approve
96915
96917
  });
96916
96918
  }
96917
96919
  function resolveMcpBin() {
96920
+ const packagedCandidates = [
96921
+ path39.resolve(__dirname, "../vendor/mcp-server/index.js"),
96922
+ path39.resolve(__dirname, "../../vendor/mcp-server/index.js")
96923
+ ];
96924
+ for (const candidate of packagedCandidates) {
96925
+ if (fs23.existsSync(candidate)) {
96926
+ return candidate;
96927
+ }
96928
+ }
96918
96929
  try {
96919
96930
  const req = (0, import_node_module3.createRequire)(__filename);
96920
96931
  return req.resolve("@adhdev/mcp-server");