adhdev 0.8.61 → 0.8.63

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
@@ -10508,6 +10508,7 @@ function buildCliParseInput(options) {
10508
10508
  terminalScreenText,
10509
10509
  baseMessages,
10510
10510
  partialResponse,
10511
+ isWaitingForResponse,
10511
10512
  scope,
10512
10513
  runtimeSettings
10513
10514
  } = options;
@@ -10525,6 +10526,7 @@ function buildCliParseInput(options) {
10525
10526
  recentScreen: buildCliScreenSnapshot(recentBuffer),
10526
10527
  messages: [...baseMessages],
10527
10528
  partialResponse,
10529
+ isWaitingForResponse,
10528
10530
  promptText: scope?.prompt || "",
10529
10531
  settings: { ...runtimeSettings }
10530
10532
  };
@@ -11263,6 +11265,18 @@ var init_provider_cli_adapter = __esm({
11263
11265
  const holdMs = this.getStatusActivityHoldMs();
11264
11266
  return quietForMs < holdMs || screenStableMs < holdMs;
11265
11267
  }
11268
+ shouldDeferIdleTimeoutFinish() {
11269
+ if (!this.isWaitingForResponse || this.currentStatus === "waiting_approval") {
11270
+ return false;
11271
+ }
11272
+ const latestStatus = this.runDetectStatus(this.recentOutputBuffer) || this.currentStatus;
11273
+ if (latestStatus === "generating") {
11274
+ this.settledBuffer = this.recentOutputBuffer;
11275
+ this.evaluateSettled();
11276
+ return true;
11277
+ }
11278
+ return false;
11279
+ }
11266
11280
  getStartupConfirmationModal(screenText) {
11267
11281
  const text = sanitizeTerminalText(String(screenText || ""));
11268
11282
  if (!text.trim()) return null;
@@ -11421,6 +11435,7 @@ var init_provider_cli_adapter = __esm({
11421
11435
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
11422
11436
  this.idleTimeout = setTimeout(() => {
11423
11437
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
11438
+ if (this.shouldDeferIdleTimeoutFinish()) return;
11424
11439
  this.finishResponse();
11425
11440
  }
11426
11441
  }, this.timeouts.generatingIdle);
@@ -11456,6 +11471,7 @@ var init_provider_cli_adapter = __esm({
11456
11471
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
11457
11472
  this.idleTimeout = setTimeout(() => {
11458
11473
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
11474
+ if (this.shouldDeferIdleTimeoutFinish()) return;
11459
11475
  this.finishResponse();
11460
11476
  }
11461
11477
  }, this.timeouts.generatingIdle);
@@ -11498,7 +11514,10 @@ var init_provider_cli_adapter = __esm({
11498
11514
  this.setStatus("generating", "script_detect");
11499
11515
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
11500
11516
  this.idleTimeout = setTimeout(() => {
11501
- if (this.isWaitingForResponse) this.finishResponse();
11517
+ if (this.isWaitingForResponse) {
11518
+ if (this.shouldDeferIdleTimeoutFinish()) return;
11519
+ this.finishResponse();
11520
+ }
11502
11521
  }, this.timeouts.generatingIdle);
11503
11522
  this.onStatusChange?.();
11504
11523
  return;
@@ -11566,6 +11585,7 @@ var init_provider_cli_adapter = __esm({
11566
11585
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
11567
11586
  this.idleTimeout = setTimeout(() => {
11568
11587
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
11588
+ if (this.shouldDeferIdleTimeoutFinish()) return;
11569
11589
  this.clearIdleFinishCandidate("idle_timeout_finish");
11570
11590
  this.finishResponse();
11571
11591
  }
@@ -11704,6 +11724,7 @@ var init_provider_cli_adapter = __esm({
11704
11724
  tail: text.slice(-500),
11705
11725
  screenText,
11706
11726
  rawBuffer: this.accumulatedRawBuffer,
11727
+ isWaitingForResponse: this.isWaitingForResponse,
11707
11728
  screen: buildCliScreenSnapshot(screenText),
11708
11729
  tailScreen: buildCliScreenSnapshot(text.slice(-500))
11709
11730
  });
@@ -11813,6 +11834,7 @@ var init_provider_cli_adapter = __esm({
11813
11834
  terminalScreenText: this.terminalScreen.getText(),
11814
11835
  baseMessages: this.committedMessages,
11815
11836
  partialResponse: this.responseBuffer,
11837
+ isWaitingForResponse: this.isWaitingForResponse,
11816
11838
  scope: this.currentTurnScope,
11817
11839
  runtimeSettings: this.runtimeSettings
11818
11840
  });
@@ -11831,6 +11853,7 @@ var init_provider_cli_adapter = __esm({
11831
11853
  terminalScreenText: this.terminalScreen.getText(),
11832
11854
  baseMessages,
11833
11855
  partialResponse,
11856
+ isWaitingForResponse: this.isWaitingForResponse,
11834
11857
  scope,
11835
11858
  runtimeSettings: this.runtimeSettings
11836
11859
  });
@@ -84103,7 +84126,7 @@ var init_adhdev_daemon = __esm({
84103
84126
  import_ws3 = require("ws");
84104
84127
  init_source();
84105
84128
  init_version();
84106
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.61" });
84129
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.63" });
84107
84130
  ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
84108
84131
  "generating",
84109
84132
  "waiting_approval",