@adhdev/daemon-core 0.9.14 → 0.9.16

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
@@ -1964,6 +1964,14 @@ import * as os10 from "os";
1964
1964
  function normalizeComparableTranscriptText(value) {
1965
1965
  return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
1966
1966
  }
1967
+ function hasVisibleInterruptPrompt(text) {
1968
+ const interruptCopyPattern = /\bEnter\s+to\s+interrupt\b(?:\s*,?\s*Ctrl\s*(?:\+|-)?\s*C\s+to\s+cancel)?/i;
1969
+ return sanitizeTerminalText(text || "").split(/\r?\n/g).some((line) => {
1970
+ const trimmed = line.trim();
1971
+ if (!interruptCopyPattern.test(trimmed)) return false;
1972
+ return /^(?:[^A-Za-z0-9\s]{1,8}\s+)?[❯›>]\s+/.test(trimmed);
1973
+ });
1974
+ }
1967
1975
  function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
1968
1976
  if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
1969
1977
  if (parsedMessages.length > committedMessages.length) return true;
@@ -3282,7 +3290,7 @@ var init_provider_cli_adapter = __esm({
3282
3290
  };
3283
3291
  }
3284
3292
  const hasVisibleAssistantMessage = Array.isArray(result?.messages) && result.messages.some((message) => message?.role === "assistant" && typeof message?.content === "string" && message.content.trim());
3285
- const shouldClampStaleGeneratingToIdle = result?.status === "generating" && this.currentStatus === "idle" && !this.currentTurnScope && !result?.activeModal && hasVisibleAssistantMessage;
3293
+ const shouldClampStaleGeneratingToIdle = result?.status === "generating" && this.currentStatus === "idle" && !this.currentTurnScope && !result?.activeModal && hasVisibleAssistantMessage && !hasVisibleInterruptPrompt(screenText);
3286
3294
  if (shouldClampStaleGeneratingToIdle) {
3287
3295
  result = {
3288
3296
  ...result,