@adhdev/daemon-core 0.9.23 → 0.9.25

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
@@ -3972,8 +3972,10 @@ var init_provider_cli_adapter = __esm({
3972
3972
  if (buttonIndex in this.approvalKeys) {
3973
3973
  this.ptyProcess.write(this.approvalKeys[buttonIndex]);
3974
3974
  } else {
3975
+ const buttonCount = Array.isArray(modal?.buttons) ? modal.buttons.length : 0;
3976
+ const clampedIndex = buttonCount > 0 ? Math.min(Math.max(0, buttonIndex), buttonCount - 1) : Math.max(0, buttonIndex);
3975
3977
  const DOWN = "\x1B[B";
3976
- const keys = DOWN.repeat(Math.max(0, buttonIndex)) + "\r";
3978
+ const keys = DOWN.repeat(clampedIndex) + "\r";
3977
3979
  this.ptyProcess.write(keys);
3978
3980
  }
3979
3981
  }
@@ -12388,6 +12390,7 @@ function handleWorkspaceSetDefault(args) {
12388
12390
 
12389
12391
  // src/commands/handler.ts
12390
12392
  var COMMAND_DEBUG_LEVELS = /* @__PURE__ */ new Set([
12393
+ "read_chat",
12391
12394
  "pty_input",
12392
12395
  "pty_resize",
12393
12396
  "cdp_eval",
@@ -18555,6 +18558,9 @@ var DaemonCommandRouter = class {
18555
18558
  if (logs.length > 0) {
18556
18559
  return { success: true, logs, totalBuffered: logs.length };
18557
18560
  }
18561
+ if (sinceTs > 0) {
18562
+ return { success: true, logs: [], totalBuffered: 0 };
18563
+ }
18558
18564
  if (fs9.existsSync(LOG_PATH)) {
18559
18565
  const content = fs9.readFileSync(LOG_PATH, "utf-8");
18560
18566
  const allLines = content.split("\n");
@@ -26325,8 +26331,8 @@ var SessionHostRuntimeTransport = class {
26325
26331
  }
26326
26332
  try {
26327
26333
  await this.client.close();
26328
- } catch {
26329
- if (destroy) throw new Error(`Failed to close session host client: ${this.options.runtimeId}`);
26334
+ } catch (err) {
26335
+ if (destroy) throw err instanceof Error ? err : new Error(`Failed to close session host client: ${this.options.runtimeId}`);
26330
26336
  }
26331
26337
  }
26332
26338
  };