@adhdev/daemon-standalone 0.7.31 → 0.7.35

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/index.js CHANGED
@@ -18226,7 +18226,20 @@ var SessionHostClient = class {
18226
18226
  request
18227
18227
  };
18228
18228
  const response = await new Promise((resolve12, reject) => {
18229
- this.requestWaiters.set(requestId, { resolve: resolve12, reject });
18229
+ const timeout = setTimeout(() => {
18230
+ this.requestWaiters.delete(requestId);
18231
+ reject(new Error(`Session host request timed out after 30s (${request.type})`));
18232
+ }, 3e4);
18233
+ this.requestWaiters.set(requestId, {
18234
+ resolve: (value) => {
18235
+ clearTimeout(timeout);
18236
+ resolve12(value);
18237
+ },
18238
+ reject: (error48) => {
18239
+ clearTimeout(timeout);
18240
+ reject(error48);
18241
+ }
18242
+ });
18230
18243
  this.socket?.write(serializeEnvelope(envelope));
18231
18244
  });
18232
18245
  return response;
@@ -19517,8 +19530,12 @@ var init_provider_cli_adapter = __esm2({
19517
19530
  LOG.info("CLI", `[${this.cliType}] Using login shell (script shim or non-native binary)`);
19518
19531
  }
19519
19532
  shellCmd = isWin ? "cmd.exe" : process.env.SHELL || "/bin/zsh";
19520
- const fullCmd = [binaryPath, ...allArgs].map(shSingleQuote).join(" ");
19521
- shellArgs = isWin ? ["/c", fullCmd] : ["-l", "-c", fullCmd];
19533
+ if (isWin) {
19534
+ shellArgs = ["/c", binaryPath, ...allArgs];
19535
+ } else {
19536
+ const fullCmd = [binaryPath, ...allArgs].map(shSingleQuote).join(" ");
19537
+ shellArgs = ["-l", "-c", fullCmd];
19538
+ }
19522
19539
  } else {
19523
19540
  shellCmd = binaryPath;
19524
19541
  shellArgs = allArgs;
@@ -20454,16 +20471,16 @@ async function detectCLIs(providerLoader) {
20454
20471
  const results = await Promise.all(
20455
20472
  cliList.map(async (cli) => {
20456
20473
  try {
20457
- const pathResult = await execAsync(`${whichCmd} ${cli.command} 2>/dev/null`);
20474
+ const pathResult = await execAsync(`${whichCmd} ${cli.command}`);
20458
20475
  if (!pathResult) return { ...cli, installed: false };
20459
20476
  const firstPath = pathResult.split("\n")[0];
20460
20477
  let version2;
20461
20478
  try {
20462
20479
  const versionCommands = [
20463
20480
  cli.versionCommand,
20464
- `${cli.command} --version 2>/dev/null`,
20465
- `${cli.command} -V 2>/dev/null`,
20466
- `${cli.command} -v 2>/dev/null`
20481
+ `${cli.command} --version`,
20482
+ `${cli.command} -V`,
20483
+ `${cli.command} -v`
20467
20484
  ].filter((v) => !!v);
20468
20485
  for (const versionCommand of versionCommands) {
20469
20486
  const versionResult = await execAsync(versionCommand, 3e3);
@@ -22586,10 +22603,13 @@ var IdeProviderInstance = class {
22586
22603
  if (result?.found && result.x != null && result.y != null) {
22587
22604
  const x = result.x;
22588
22605
  const y = result.y;
22589
- const anyCdp = cdp;
22590
- await anyCdp.send("Input.dispatchMouseEvent", { type: "mousePressed", x, y, button: "left", clickCount: 1 });
22591
- await anyCdp.send("Input.dispatchMouseEvent", { type: "mouseReleased", x, y, button: "left", clickCount: 1 });
22592
- LOG.info("IdeInstance", `[IdeInstance:${this.type}] autoApprove: dispatched mouse event at ${x},${y}`);
22606
+ if (cdp.send) {
22607
+ await cdp.send("Input.dispatchMouseEvent", { type: "mousePressed", x, y, button: "left", clickCount: 1 });
22608
+ await cdp.send("Input.dispatchMouseEvent", { type: "mouseReleased", x, y, button: "left", clickCount: 1 });
22609
+ LOG.info("IdeInstance", `[IdeInstance:${this.type}] autoApprove: dispatched mouse event at ${x},${y}`);
22610
+ } else {
22611
+ LOG.warn("IdeInstance", `[IdeInstance:${this.type}] autoApprove: cdp.send() not available for coordinate click`);
22612
+ }
22593
22613
  }
22594
22614
  this.pushEvent({
22595
22615
  event: "agent:auto_approved",
@@ -25044,14 +25064,6 @@ var ProviderLoader = class _ProviderLoader {
25044
25064
  }
25045
25065
  /**
25046
25066
  * Get raw provider metadata by type (NO scripts loaded).
25047
- * Use resolve() when you need scripts (readChat, listModels, etc).
25048
- * @deprecated Use getMeta() for metadata or resolve() for scripts.
25049
- */
25050
- get(type) {
25051
- return this.providers.get(type);
25052
- }
25053
- /**
25054
- * Get raw provider metadata by type (NO scripts loaded).
25055
25067
  * Safe for: category checks, icon, displayName, targetFilter, cdpPorts.
25056
25068
  * NOT safe for: script execution (readChat, listModels, sendMessage).
25057
25069
  * Use resolve() when scripts are needed.
@@ -26597,7 +26609,7 @@ var DaemonCommandRouter = class {
26597
26609
  }
26598
26610
  }
26599
26611
  const keysToRemove = [];
26600
- for (const key of this.deps.instanceManager.instances?.keys?.() || []) {
26612
+ for (const key of this.deps.instanceManager.listInstanceIds()) {
26601
26613
  if (key === `ide:${ideType}` || typeof key === "string" && key.startsWith(`ide:${ideType}_`)) {
26602
26614
  keysToRemove.push(key);
26603
26615
  }
@@ -28891,6 +28903,12 @@ var ProviderInstanceManager = class {
28891
28903
  get size() {
28892
28904
  return this.instances.size;
28893
28905
  }
28906
+ /**
28907
+ * All Instance IDs (for iteration without exposing the private Map)
28908
+ */
28909
+ listInstanceIds() {
28910
+ return [...this.instances.keys()];
28911
+ }
28894
28912
  // ─── State collect ────────────────────────────────
28895
28913
  /**
28896
28914
  * all Instance's current status collect