@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.js CHANGED
@@ -1966,6 +1966,11 @@ __export(provider_cli_adapter_exports, {
1966
1966
  function normalizeComparableTranscriptText(value) {
1967
1967
  return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
1968
1968
  }
1969
+ function hasVisibleInterruptPrompt(text) {
1970
+ return /\bEnter\s+to\s+interrupt\b(?:\s*,?\s*Ctrl\s*(?:\+|-)?\s*C\s+to\s+cancel)?/i.test(
1971
+ sanitizeTerminalText(text || "")
1972
+ );
1973
+ }
1969
1974
  function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
1970
1975
  if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
1971
1976
  if (parsedMessages.length > committedMessages.length) return true;
@@ -3285,7 +3290,7 @@ var init_provider_cli_adapter = __esm({
3285
3290
  };
3286
3291
  }
3287
3292
  const hasVisibleAssistantMessage = Array.isArray(result?.messages) && result.messages.some((message) => message?.role === "assistant" && typeof message?.content === "string" && message.content.trim());
3288
- 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);
3289
3294
  if (shouldClampStaleGeneratingToIdle) {
3290
3295
  result = {
3291
3296
  ...result,
@@ -18790,10 +18795,14 @@ var DaemonCommandRouter = class {
18790
18795
  currentInstalled = parsed?.dependencies?.[pkgName]?.version || null;
18791
18796
  } catch {
18792
18797
  }
18793
- if (currentInstalled === latest) {
18798
+ const runningVersion = typeof this.deps.statusVersion === "string" ? this.deps.statusVersion.trim().replace(/^v/, "") : null;
18799
+ if (currentInstalled === latest && runningVersion === latest) {
18794
18800
  LOG.info("Upgrade", `Already on latest version v${latest}; skipping install`);
18795
18801
  return { success: true, upgraded: false, alreadyLatest: true, version: latest };
18796
18802
  }
18803
+ if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
18804
+ LOG.info("Upgrade", `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
18805
+ }
18797
18806
  spawnDetachedDaemonUpgradeHelper({
18798
18807
  packageName: pkgName,
18799
18808
  targetVersion: latest,