@adhdev/daemon-core 0.8.89 → 0.8.90

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
@@ -1662,8 +1662,8 @@ function buildCliParseInput(options) {
1662
1662
  scope,
1663
1663
  runtimeSettings
1664
1664
  } = options;
1665
- const buffer = scope ? sliceFromOffset(accumulatedBuffer, scope.bufferStart) || accumulatedBuffer : accumulatedBuffer;
1666
- const rawBuffer = scope ? sliceFromOffset(accumulatedRawBuffer, scope.rawBufferStart) || accumulatedRawBuffer : accumulatedRawBuffer;
1665
+ const buffer = scope ? sliceFromOffset(accumulatedBuffer, scope.bufferStart) : accumulatedBuffer;
1666
+ const rawBuffer = scope ? sliceFromOffset(accumulatedRawBuffer, scope.rawBufferStart) : accumulatedRawBuffer;
1667
1667
  const screenText = terminalScreenText;
1668
1668
  const recentBuffer = buffer.slice(-1e3) || recentOutputBuffer;
1669
1669
  return {
@@ -1695,8 +1695,8 @@ function summarizeCliTraceMessages(messages, limit = 3) {
1695
1695
  }
1696
1696
  function buildCliTraceParseSnapshot(options) {
1697
1697
  const { accumulatedBuffer, accumulatedRawBuffer, responseBuffer, partialResponse, scope } = options;
1698
- const scopedBuffer = scope ? sliceFromOffset(accumulatedBuffer, scope.bufferStart) || accumulatedBuffer : accumulatedBuffer;
1699
- const scopedRawBuffer = scope ? sliceFromOffset(accumulatedRawBuffer, scope.rawBufferStart) || accumulatedRawBuffer : accumulatedRawBuffer;
1698
+ const scopedBuffer = scope ? sliceFromOffset(accumulatedBuffer, scope.bufferStart) : accumulatedBuffer;
1699
+ const scopedRawBuffer = scope ? sliceFromOffset(accumulatedRawBuffer, scope.rawBufferStart) : accumulatedRawBuffer;
1700
1700
  return {
1701
1701
  currentTurnScope: scope || null,
1702
1702
  responseBuffer: summarizeCliTraceText(responseBuffer, 1200),
@@ -2359,6 +2359,7 @@ var init_provider_cli_adapter = __esm({
2359
2359
  looksLikeClaudeGeneratingLine(line) {
2360
2360
  const trimmed = String(line || "").trim();
2361
2361
  if (!trimmed) return false;
2362
+ if (/^⏵⏵\s+accept edits on/i.test(trimmed)) return false;
2362
2363
  if (/esc to (cancel|interrupt|stop)/i.test(trimmed)) return true;
2363
2364
  if (/^[✻✶✳✢✽⠂⠐⠒⠓⠦⠴⠶⠷⠿]+\s+\S+.*\b(?:thinking|thought for \d+s?)\b/i.test(trimmed)) return true;
2364
2365
  if (/^[✻✶✳✢✽⠂⠐⠒⠓⠦⠴⠶⠷⠿]+\s+[A-Z][A-Za-z-]{3,}ing\b.*(?:…|\.{3})/u.test(trimmed)) return true;
@@ -2671,7 +2672,7 @@ var init_provider_cli_adapter = __esm({
2671
2672
  `[${this.cliType}] settled diagnostics prompt=${JSON.stringify(this.currentTurnScope.prompt).slice(0, 140)} scriptStatus=${String(scriptStatus || "")} parsedStatus=${String(parsedTranscript?.status || "")} parsedMsgCount=${parsedMessages.length} lastParsedAssistant=${JSON.stringify(summarizeCliTraceText(lastParsedAssistant?.content || "", 120)).slice(0, 160)} visibleIdlePrompt=${String(visibleIdlePrompt)} visibleAssistantCandidate=${String(visibleAssistantCandidate)} responseBuffer=${JSON.stringify(summarizeCliTraceText(this.responseBuffer, 160)).slice(0, 220)} screen=${JSON.stringify(summarizeCliTraceText(screenText, 160)).slice(0, 220)}`
2672
2673
  );
2673
2674
  }
2674
- const shouldHoldGenerating = scriptStatus === "idle" && this.isWaitingForResponse && !modal && recentInteractiveActivity && !(visibleIdlePrompt && visibleAssistantCandidate);
2675
+ const shouldHoldGenerating = scriptStatus === "idle" && this.isWaitingForResponse && !modal && recentInteractiveActivity && !(visibleIdlePrompt && visibleAssistantCandidate) && !(parsedTranscript?.status === "idle" && !!lastParsedAssistant);
2675
2676
  if (shouldHoldGenerating) {
2676
2677
  this.clearIdleFinishCandidate("hold_generating_recent_activity");
2677
2678
  this.setStatus("generating", "recent_activity_hold");
@@ -3073,11 +3074,17 @@ var init_provider_cli_adapter = __esm({
3073
3074
  return null;
3074
3075
  }
3075
3076
  }
3077
+ projectEffectiveStatus(startupModal = null) {
3078
+ if (this.parseErrorMessage) return "error";
3079
+ if (startupModal) return "waiting_approval";
3080
+ if (this.isWaitingForResponse && this.currentTurnScope && this.currentStatus === "idle") return "generating";
3081
+ return this.currentStatus;
3082
+ }
3076
3083
  // ─── Public API (CliAdapter) ───────────────────
3077
3084
  getStatus() {
3078
3085
  const screenText = this.terminalScreen.getText() || "";
3079
3086
  const startupModal = this.startupParseGate ? this.getStartupConfirmationModal(screenText) : null;
3080
- const effectiveStatus = this.parseErrorMessage ? "error" : startupModal ? "waiting_approval" : this.currentStatus;
3087
+ const effectiveStatus = this.projectEffectiveStatus(startupModal);
3081
3088
  return {
3082
3089
  status: effectiveStatus,
3083
3090
  messages: [...this.committedMessages],
@@ -3784,7 +3791,7 @@ ${data.message || ""}`.trim();
3784
3791
  }
3785
3792
  this.setStatus("generating", "approval_resolved");
3786
3793
  this.onStatusChange?.();
3787
- const startupTrustModal = /Quick safety check|project trust|trust (?:this project|the contents of this directory|the files in this folder)/i.test(String(modal?.message || ""));
3794
+ const startupTrustModal = /Quick safety check|project trust|Confirm Claude Code project trust|trust (?:this project|the contents of this directory|the files in this folder)/i.test(String(modal?.message || ""));
3788
3795
  if (startupTrustModal && buttonIndex in this.approvalKeys) {
3789
3796
  this.ptyProcess.write(`${this.approvalKeys[buttonIndex]}\r`);
3790
3797
  } else if (this.shouldResolveModalWithEnter(modal, buttonIndex)) {
@@ -3810,7 +3817,7 @@ ${data.message || ""}`.trim();
3810
3817
  getDebugState() {
3811
3818
  const screenText = sanitizeTerminalText(this.terminalScreen.getText());
3812
3819
  const startupModal = this.startupParseGate ? this.getStartupConfirmationModal(screenText) : null;
3813
- const effectiveStatus = startupModal ? "waiting_approval" : this.currentStatus;
3820
+ const effectiveStatus = this.projectEffectiveStatus(startupModal);
3814
3821
  const effectiveReady = this.ready || !!startupModal;
3815
3822
  return {
3816
3823
  type: this.cliType,