@adhdev/daemon-standalone 0.9.82-rc.127 → 0.9.82-rc.128

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
@@ -39133,9 +39133,9 @@ ${effect.notification.body || ""}`.trim();
39133
39133
  ptyMessageCount: ptyMessages.length,
39134
39134
  returnedMessageCount: returnedMessages.length,
39135
39135
  safeMapping: args.safeMapping === true,
39136
- // true when native-history was selected: PTY message bodies are suppressed and
39137
- // must not be treated as chat content. PTY only contributes status/approval/screen evidence.
39138
- ptyMessagesSuppressed: args.selected === "native-history"
39136
+ // true when PTY message bodies are suppressed and must not be treated as
39137
+ // chat content. PTY may still contribute status/approval/screen evidence.
39138
+ ptyMessagesSuppressed: args.selected === "native-history" || args.ptyStatusApprovalOnly === true
39139
39139
  }
39140
39140
  };
39141
39141
  }
@@ -39151,6 +39151,14 @@ ${effect.notification.body || ""}`.trim();
39151
39151
  if (!args.freshEnough) return "native_history_stale";
39152
39152
  return "native_history_not_selected";
39153
39153
  }
39154
+ function isUnsafeNativeTranscriptFallback(reason) {
39155
+ const value = String(reason || "").trim();
39156
+ return value.startsWith("native_history_unavailable") || value === "native_history_not_safely_mapped" || value === "native_history_stale" || value === "native_history_partial";
39157
+ }
39158
+ function coerceUnsafeNativeFallbackStatus(status, activeModal) {
39159
+ if (status === "waiting_approval" && activeModal) return status;
39160
+ return "idle";
39161
+ }
39154
39162
  function supportsCliNativeTranscript(providerType, provider) {
39155
39163
  if (CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType)) return true;
39156
39164
  return provider?.category === "cli" && isNativeSourceCanonicalHistory(provider?.canonicalHistory);
@@ -39886,6 +39894,7 @@ ${effect.notification.body || ""}`.trim();
39886
39894
  let selectedProviderSessionId = providerSessionId;
39887
39895
  let selectedTranscriptAuthority = transcriptAuthority;
39888
39896
  let selectedCoverage = coverage;
39897
+ let selectedStatus = returnedStatus;
39889
39898
  const sessionWorkspace = typeof h.currentSession?.workspace === "string" ? h.currentSession.workspace : typeof adapter.workingDir === "string" ? adapter.workingDir : void 0;
39890
39899
  const intendedWorkspace = typeof args?.workspace === "string" ? args.workspace : void 0;
39891
39900
  let messageSource = buildCliMessageSourceProvenance({
@@ -39997,6 +40006,13 @@ ${effect.notification.body || ""}`.trim();
39997
40006
  safeMapping,
39998
40007
  freshEnough
39999
40008
  });
40009
+ const unsafeNativeFallback = adapter.cliType === "codex-cli" && isUnsafeNativeTranscriptFallback(fallbackReason);
40010
+ if (unsafeNativeFallback) {
40011
+ selectedMessages = [];
40012
+ selectedTranscriptAuthority = void 0;
40013
+ selectedCoverage = void 0;
40014
+ selectedStatus = coerceUnsafeNativeFallbackStatus(returnedStatus, activeModal);
40015
+ }
40000
40016
  messageSource = buildCliMessageSourceProvenance({
40001
40017
  selected: "pty-parser",
40002
40018
  provider: adapter.cliType,
@@ -40013,10 +40029,10 @@ ${effect.notification.body || ""}`.trim();
40013
40029
  unavailableReason,
40014
40030
  nativeMessages,
40015
40031
  ptyMessages: returnedMessages,
40016
- returnedMessages,
40032
+ returnedMessages: unsafeNativeFallback ? [] : returnedMessages,
40017
40033
  safeMapping,
40018
40034
  freshEnough,
40019
- ptyStatusApprovalOnly: false
40035
+ ptyStatusApprovalOnly: unsafeNativeFallback
40020
40036
  });
40021
40037
  }
40022
40038
  }
@@ -40024,7 +40040,7 @@ ${effect.notification.body || ""}`.trim();
40024
40040
  LOG2.debug("Command", `[read_chat] cli-like parsed provider=${adapter.cliType} target=${String(args?.targetSessionId || "")} adapterStatus=${String(adapterStatus.status || "")} parsedStatus=${String(parsedRecord.status || "")} parsedMsgCount=${parsedRecord.messages.length} returnedMsgCount=${returnedMessages.length}`);
40025
40041
  return buildReadChatCommandResult({
40026
40042
  messages: selectedMessages,
40027
- status: returnedStatus,
40043
+ status: selectedStatus,
40028
40044
  activeModal,
40029
40045
  messageSource,
40030
40046
  transcriptProvenance: messageSource,
@@ -40033,10 +40049,10 @@ ${effect.notification.body || ""}`.trim();
40033
40049
  targetSessionId: String(args?.targetSessionId || ""),
40034
40050
  adapterStatus: String(adapterStatus.status || ""),
40035
40051
  parsedStatus: String(parsedRecord.status || ""),
40036
- returnedStatus: String(returnedStatus || ""),
40052
+ returnedStatus: String(selectedStatus || ""),
40037
40053
  selectedMessageSource: messageSource.selected,
40038
40054
  messageSource,
40039
- shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && isNativeSourceCanonicalHistory(provider?.canonicalHistory) && messageSource.selected !== "native-history" && typeof messageSource.fallbackReason === "string" && messageSource.fallbackReason.startsWith("native_history_") && messageSource.fallbackReason !== "native_history_not_checked" && !(selectedTranscriptAuthority === "provider" && selectedCoverage === "full"),
40055
+ shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && isNativeSourceCanonicalHistory(provider?.canonicalHistory) && messageSource.selected !== "native-history" && typeof messageSource.fallbackReason === "string" && messageSource.fallbackReason.startsWith("native_history_") && messageSource.fallbackReason !== "native_history_not_checked" && !isUnsafeNativeTranscriptFallback(messageSource.fallbackReason) && !(selectedTranscriptAuthority === "provider" && selectedCoverage === "full"),
40040
40056
  parsedMsgCount: parsedRecord.messages.length,
40041
40057
  returnedMsgCount: selectedMessages.length
40042
40058
  },