@adhdev/daemon-standalone 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
@@ -29270,6 +29270,7 @@ var require_dist2 = __commonJS({
29270
29270
  static MAX_TRACE_ENTRIES = 250;
29271
29271
  providerResolutionMeta;
29272
29272
  static IDLE_FINISH_CONFIRM_MS = 2e3;
29273
+ static HERMES_IDLE_FINISH_CONFIRM_MS = 5e3;
29273
29274
  static STATUS_ACTIVITY_HOLD_MS = 2e3;
29274
29275
  static FINISH_RETRY_DELAY_MS = 300;
29275
29276
  static MAX_FINISH_RETRIES = 2;
@@ -29277,6 +29278,12 @@ var require_dist2 = __commonJS({
29277
29278
  this.messages = [...this.committedMessages];
29278
29279
  this.structuredMessages = [...this.committedMessages];
29279
29280
  }
29281
+ getIdleFinishConfirmMs() {
29282
+ return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS;
29283
+ }
29284
+ getStatusActivityHoldMs() {
29285
+ return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS;
29286
+ }
29280
29287
  setStatus(status, trigger) {
29281
29288
  const prev = this.currentStatus;
29282
29289
  if (prev === status) return;
@@ -29299,6 +29306,7 @@ var require_dist2 = __commonJS({
29299
29306
  }
29300
29307
  armIdleFinishCandidate(assistantLength) {
29301
29308
  const now = Date.now();
29309
+ const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
29302
29310
  this.idleFinishCandidate = {
29303
29311
  armedAt: now,
29304
29312
  lastOutputAt: this.lastOutputAt,
@@ -29307,7 +29315,7 @@ var require_dist2 = __commonJS({
29307
29315
  assistantLength
29308
29316
  };
29309
29317
  this.recordTrace("idle_candidate_armed", {
29310
- confirmMs: _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS,
29318
+ confirmMs: idleFinishConfirmMs,
29311
29319
  candidate: this.idleFinishCandidate,
29312
29320
  ...buildCliTraceParseSnapshot({
29313
29321
  accumulatedBuffer: this.accumulatedBuffer,
@@ -29322,7 +29330,7 @@ var require_dist2 = __commonJS({
29322
29330
  this.settleTimer = null;
29323
29331
  this.settledBuffer = this.recentOutputBuffer;
29324
29332
  this.evaluateSettled();
29325
- }, _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS);
29333
+ }, idleFinishConfirmMs);
29326
29334
  }
29327
29335
  recordTrace(type, payload = {}) {
29328
29336
  const entry = {
@@ -29701,7 +29709,8 @@ var require_dist2 = __commonJS({
29701
29709
  hasRecentInteractiveActivity(now) {
29702
29710
  const quietForMs = this.lastNonEmptyOutputAt ? now - this.lastNonEmptyOutputAt : Number.MAX_SAFE_INTEGER;
29703
29711
  const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : Number.MAX_SAFE_INTEGER;
29704
- return quietForMs < _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS || screenStableMs < _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS;
29712
+ const holdMs = this.getStatusActivityHoldMs();
29713
+ return quietForMs < holdMs || screenStableMs < holdMs;
29705
29714
  }
29706
29715
  getStartupConfirmationModal(screenText) {
29707
29716
  const text = sanitizeTerminalText(String(screenText || ""));
@@ -29853,6 +29862,7 @@ var require_dist2 = __commonJS({
29853
29862
  clearPendingScriptStatus();
29854
29863
  }
29855
29864
  const recentInteractiveActivity = this.hasRecentInteractiveActivity(now);
29865
+ const statusActivityHoldMs = this.getStatusActivityHoldMs();
29856
29866
  const shouldHoldGenerating = scriptStatus === "idle" && this.isWaitingForResponse && !modal && recentInteractiveActivity;
29857
29867
  if (shouldHoldGenerating) {
29858
29868
  this.clearIdleFinishCandidate("hold_generating_recent_activity");
@@ -29868,7 +29878,7 @@ var require_dist2 = __commonJS({
29868
29878
  recentInteractiveActivity,
29869
29879
  lastNonEmptyOutputAt: this.lastNonEmptyOutputAt,
29870
29880
  lastScreenChangeAt: this.lastScreenChangeAt,
29871
- holdMs: _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS,
29881
+ holdMs: statusActivityHoldMs,
29872
29882
  ...buildCliTraceParseSnapshot({
29873
29883
  accumulatedBuffer: this.accumulatedBuffer,
29874
29884
  accumulatedRawBuffer: this.accumulatedRawBuffer,
@@ -29957,11 +29967,12 @@ var require_dist2 = __commonJS({
29957
29967
  const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : 0;
29958
29968
  const hasAssistantTurn = !!lastParsedAssistant;
29959
29969
  const assistantLength = lastParsedAssistant?.content?.length || 0;
29960
- const idleQuietThresholdMs = Math.max(2e3, this.timeouts.outputSettle);
29961
- const idleStableThresholdMs = 2e3;
29970
+ const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
29971
+ const idleQuietThresholdMs = Math.max(idleFinishConfirmMs, this.timeouts.outputSettle);
29972
+ const idleStableThresholdMs = idleFinishConfirmMs;
29962
29973
  const idleReady = visibleIdlePrompt && !modal && hasAssistantTurn && quietForMs >= idleQuietThresholdMs && screenStableMs >= idleStableThresholdMs;
29963
29974
  const candidate = this.idleFinishCandidate;
29964
- 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;
29975
+ const candidateQuiet = !!candidate && candidate.responseEpoch === this.responseEpoch && candidate.lastOutputAt === this.lastOutputAt && candidate.lastScreenChangeAt === this.lastScreenChangeAt && assistantLength >= candidate.assistantLength && now - candidate.armedAt >= idleFinishConfirmMs;
29965
29976
  const canFinishImmediately = idleReady && candidateQuiet;
29966
29977
  this.recordTrace("idle_decision", {
29967
29978
  visibleIdlePrompt,
@@ -29973,7 +29984,7 @@ var require_dist2 = __commonJS({
29973
29984
  idleQuietThresholdMs,
29974
29985
  idleStableThresholdMs,
29975
29986
  idleReady,
29976
- idleFinishConfirmMs: _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS,
29987
+ idleFinishConfirmMs,
29977
29988
  idleFinishCandidate: candidate,
29978
29989
  candidateQuiet,
29979
29990
  canFinishImmediately,