@adhdev/daemon-core 0.9.23 → 0.9.24

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.mjs CHANGED
@@ -3969,8 +3969,10 @@ var init_provider_cli_adapter = __esm({
3969
3969
  if (buttonIndex in this.approvalKeys) {
3970
3970
  this.ptyProcess.write(this.approvalKeys[buttonIndex]);
3971
3971
  } else {
3972
+ const buttonCount = Array.isArray(modal?.buttons) ? modal.buttons.length : 0;
3973
+ const clampedIndex = buttonCount > 0 ? Math.min(Math.max(0, buttonIndex), buttonCount - 1) : Math.max(0, buttonIndex);
3972
3974
  const DOWN = "\x1B[B";
3973
- const keys = DOWN.repeat(Math.max(0, buttonIndex)) + "\r";
3975
+ const keys = DOWN.repeat(clampedIndex) + "\r";
3974
3976
  this.ptyProcess.write(keys);
3975
3977
  }
3976
3978
  }
@@ -26179,8 +26181,8 @@ var SessionHostRuntimeTransport = class {
26179
26181
  }
26180
26182
  try {
26181
26183
  await this.client.close();
26182
- } catch {
26183
- if (destroy) throw new Error(`Failed to close session host client: ${this.options.runtimeId}`);
26184
+ } catch (err) {
26185
+ if (destroy) throw err instanceof Error ? err : new Error(`Failed to close session host client: ${this.options.runtimeId}`);
26184
26186
  }
26185
26187
  }
26186
26188
  };