@adhdev/daemon-core 0.9.13 → 0.9.15

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,11 @@ 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
+ return /\bEnter\s+to\s+interrupt\b(?:\s*,?\s*Ctrl\s*(?:\+|-)?\s*C\s+to\s+cancel)?/i.test(
1969
+ sanitizeTerminalText(text || "")
1970
+ );
1971
+ }
1967
1972
  function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
1968
1973
  if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
1969
1974
  if (parsedMessages.length > committedMessages.length) return true;
@@ -3282,7 +3287,7 @@ var init_provider_cli_adapter = __esm({
3282
3287
  };
3283
3288
  }
3284
3289
  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;
3290
+ const shouldClampStaleGeneratingToIdle = result?.status === "generating" && this.currentStatus === "idle" && !this.currentTurnScope && !result?.activeModal && hasVisibleAssistantMessage && !hasVisibleInterruptPrompt(screenText);
3286
3291
  if (shouldClampStaleGeneratingToIdle) {
3287
3292
  result = {
3288
3293
  ...result,
@@ -18642,10 +18647,14 @@ var DaemonCommandRouter = class {
18642
18647
  currentInstalled = parsed?.dependencies?.[pkgName]?.version || null;
18643
18648
  } catch {
18644
18649
  }
18645
- if (currentInstalled === latest) {
18650
+ const runningVersion = typeof this.deps.statusVersion === "string" ? this.deps.statusVersion.trim().replace(/^v/, "") : null;
18651
+ if (currentInstalled === latest && runningVersion === latest) {
18646
18652
  LOG.info("Upgrade", `Already on latest version v${latest}; skipping install`);
18647
18653
  return { success: true, upgraded: false, alreadyLatest: true, version: latest };
18648
18654
  }
18655
+ if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
18656
+ LOG.info("Upgrade", `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
18657
+ }
18649
18658
  spawnDetachedDaemonUpgradeHelper({
18650
18659
  packageName: pkgName,
18651
18660
  targetVersion: latest,