adhdev 0.8.59 → 0.8.60

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
@@ -9745,6 +9745,7 @@ var init_provider_cli_adapter = __esm({
9745
9745
  static MAX_TRACE_ENTRIES = 250;
9746
9746
  providerResolutionMeta;
9747
9747
  static IDLE_FINISH_CONFIRM_MS = 2e3;
9748
+ static HERMES_IDLE_FINISH_CONFIRM_MS = 5e3;
9748
9749
  static STATUS_ACTIVITY_HOLD_MS = 2e3;
9749
9750
  static FINISH_RETRY_DELAY_MS = 300;
9750
9751
  static MAX_FINISH_RETRIES = 2;
@@ -9752,6 +9753,12 @@ var init_provider_cli_adapter = __esm({
9752
9753
  this.messages = [...this.committedMessages];
9753
9754
  this.structuredMessages = [...this.committedMessages];
9754
9755
  }
9756
+ getIdleFinishConfirmMs() {
9757
+ return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS;
9758
+ }
9759
+ getStatusActivityHoldMs() {
9760
+ return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS;
9761
+ }
9755
9762
  setStatus(status, trigger) {
9756
9763
  const prev = this.currentStatus;
9757
9764
  if (prev === status) return;
@@ -9774,6 +9781,7 @@ var init_provider_cli_adapter = __esm({
9774
9781
  }
9775
9782
  armIdleFinishCandidate(assistantLength) {
9776
9783
  const now = Date.now();
9784
+ const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
9777
9785
  this.idleFinishCandidate = {
9778
9786
  armedAt: now,
9779
9787
  lastOutputAt: this.lastOutputAt,
@@ -9782,7 +9790,7 @@ var init_provider_cli_adapter = __esm({
9782
9790
  assistantLength
9783
9791
  };
9784
9792
  this.recordTrace("idle_candidate_armed", {
9785
- confirmMs: _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS,
9793
+ confirmMs: idleFinishConfirmMs,
9786
9794
  candidate: this.idleFinishCandidate,
9787
9795
  ...buildCliTraceParseSnapshot({
9788
9796
  accumulatedBuffer: this.accumulatedBuffer,
@@ -9797,7 +9805,7 @@ var init_provider_cli_adapter = __esm({
9797
9805
  this.settleTimer = null;
9798
9806
  this.settledBuffer = this.recentOutputBuffer;
9799
9807
  this.evaluateSettled();
9800
- }, _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS);
9808
+ }, idleFinishConfirmMs);
9801
9809
  }
9802
9810
  recordTrace(type, payload = {}) {
9803
9811
  const entry = {
@@ -10176,7 +10184,8 @@ var init_provider_cli_adapter = __esm({
10176
10184
  hasRecentInteractiveActivity(now) {
10177
10185
  const quietForMs = this.lastNonEmptyOutputAt ? now - this.lastNonEmptyOutputAt : Number.MAX_SAFE_INTEGER;
10178
10186
  const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : Number.MAX_SAFE_INTEGER;
10179
- return quietForMs < _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS || screenStableMs < _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS;
10187
+ const holdMs = this.getStatusActivityHoldMs();
10188
+ return quietForMs < holdMs || screenStableMs < holdMs;
10180
10189
  }
10181
10190
  getStartupConfirmationModal(screenText) {
10182
10191
  const text = sanitizeTerminalText(String(screenText || ""));
@@ -10328,6 +10337,7 @@ var init_provider_cli_adapter = __esm({
10328
10337
  clearPendingScriptStatus();
10329
10338
  }
10330
10339
  const recentInteractiveActivity = this.hasRecentInteractiveActivity(now);
10340
+ const statusActivityHoldMs = this.getStatusActivityHoldMs();
10331
10341
  const shouldHoldGenerating = scriptStatus === "idle" && this.isWaitingForResponse && !modal && recentInteractiveActivity;
10332
10342
  if (shouldHoldGenerating) {
10333
10343
  this.clearIdleFinishCandidate("hold_generating_recent_activity");
@@ -10343,7 +10353,7 @@ var init_provider_cli_adapter = __esm({
10343
10353
  recentInteractiveActivity,
10344
10354
  lastNonEmptyOutputAt: this.lastNonEmptyOutputAt,
10345
10355
  lastScreenChangeAt: this.lastScreenChangeAt,
10346
- holdMs: _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS,
10356
+ holdMs: statusActivityHoldMs,
10347
10357
  ...buildCliTraceParseSnapshot({
10348
10358
  accumulatedBuffer: this.accumulatedBuffer,
10349
10359
  accumulatedRawBuffer: this.accumulatedRawBuffer,
@@ -10432,11 +10442,12 @@ var init_provider_cli_adapter = __esm({
10432
10442
  const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : 0;
10433
10443
  const hasAssistantTurn = !!lastParsedAssistant;
10434
10444
  const assistantLength = lastParsedAssistant?.content?.length || 0;
10435
- const idleQuietThresholdMs = Math.max(2e3, this.timeouts.outputSettle);
10436
- const idleStableThresholdMs = 2e3;
10445
+ const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
10446
+ const idleQuietThresholdMs = Math.max(idleFinishConfirmMs, this.timeouts.outputSettle);
10447
+ const idleStableThresholdMs = idleFinishConfirmMs;
10437
10448
  const idleReady = visibleIdlePrompt && !modal && hasAssistantTurn && quietForMs >= idleQuietThresholdMs && screenStableMs >= idleStableThresholdMs;
10438
10449
  const candidate = this.idleFinishCandidate;
10439
- const candidateQuiet = !!candidate && candidate.responseEpoch === this.responseEpoch && candidate.lastOutputAt === this.lastOutputAt && candidate.lastScreenChangeAt === this.lastScreenChangeAt && assistantLength >= candidate.assistantLength && now - candidate.armedAt >= _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS;
10450
+ const candidateQuiet = !!candidate && candidate.responseEpoch === this.responseEpoch && candidate.lastOutputAt === this.lastOutputAt && candidate.lastScreenChangeAt === this.lastScreenChangeAt && assistantLength >= candidate.assistantLength && now - candidate.armedAt >= idleFinishConfirmMs;
10440
10451
  const canFinishImmediately = idleReady && candidateQuiet;
10441
10452
  this.recordTrace("idle_decision", {
10442
10453
  visibleIdlePrompt,
@@ -10448,7 +10459,7 @@ var init_provider_cli_adapter = __esm({
10448
10459
  idleQuietThresholdMs,
10449
10460
  idleStableThresholdMs,
10450
10461
  idleReady,
10451
- idleFinishConfirmMs: _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS,
10462
+ idleFinishConfirmMs,
10452
10463
  idleFinishCandidate: candidate,
10453
10464
  candidateQuiet,
10454
10465
  canFinishImmediately,
@@ -52242,7 +52253,7 @@ var init_adhdev_daemon = __esm({
52242
52253
  import_ws3 = require("ws");
52243
52254
  init_source2();
52244
52255
  init_version();
52245
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.59" });
52256
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.60" });
52246
52257
  ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
52247
52258
  "generating",
52248
52259
  "waiting_approval",