@adhdev/daemon-standalone 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
@@ -29832,6 +29832,11 @@ var require_dist2 = __commonJS({
29832
29832
  function normalizeComparableTranscriptText(value) {
29833
29833
  return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
29834
29834
  }
29835
+ function hasVisibleInterruptPrompt(text) {
29836
+ return /\bEnter\s+to\s+interrupt\b(?:\s*,?\s*Ctrl\s*(?:\+|-)?\s*C\s+to\s+cancel)?/i.test(
29837
+ sanitizeTerminalText(text || "")
29838
+ );
29839
+ }
29835
29840
  function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
29836
29841
  if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
29837
29842
  if (parsedMessages.length > committedMessages.length) return true;
@@ -31152,7 +31157,7 @@ var require_dist2 = __commonJS({
31152
31157
  };
31153
31158
  }
31154
31159
  const hasVisibleAssistantMessage = Array.isArray(result?.messages) && result.messages.some((message) => message?.role === "assistant" && typeof message?.content === "string" && message.content.trim());
31155
- const shouldClampStaleGeneratingToIdle = result?.status === "generating" && this.currentStatus === "idle" && !this.currentTurnScope && !result?.activeModal && hasVisibleAssistantMessage;
31160
+ const shouldClampStaleGeneratingToIdle = result?.status === "generating" && this.currentStatus === "idle" && !this.currentTurnScope && !result?.activeModal && hasVisibleAssistantMessage && !hasVisibleInterruptPrompt(screenText);
31156
31161
  if (shouldClampStaleGeneratingToIdle) {
31157
31162
  result = {
31158
31163
  ...result,
@@ -46521,10 +46526,14 @@ Run 'adhdev doctor' for detailed diagnostics.`
46521
46526
  currentInstalled = parsed?.dependencies?.[pkgName]?.version || null;
46522
46527
  } catch {
46523
46528
  }
46524
- if (currentInstalled === latest) {
46529
+ const runningVersion = typeof this.deps.statusVersion === "string" ? this.deps.statusVersion.trim().replace(/^v/, "") : null;
46530
+ if (currentInstalled === latest && runningVersion === latest) {
46525
46531
  LOG2.info("Upgrade", `Already on latest version v${latest}; skipping install`);
46526
46532
  return { success: true, upgraded: false, alreadyLatest: true, version: latest };
46527
46533
  }
46534
+ if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
46535
+ LOG2.info("Upgrade", `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
46536
+ }
46528
46537
  spawnDetachedDaemonUpgradeHelper({
46529
46538
  packageName: pkgName,
46530
46539
  targetVersion: latest,