@adhdev/daemon-core 0.9.82-rc.84 → 0.9.82-rc.86

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
@@ -15877,7 +15877,7 @@ function buildCliMessageSourceProvenance(args) {
15877
15877
  };
15878
15878
  }
15879
15879
  function buildNativeHistoryFallbackReason(args) {
15880
- if (!supportsCliNativeTranscript(args.providerType)) return "provider_native_transcript_not_supported";
15880
+ if (!supportsCliNativeTranscript(args.providerType, args.provider)) return "provider_native_transcript_not_supported";
15881
15881
  if (args.nativeSource === "native-unavailable") return "native_history_unavailable";
15882
15882
  if (args.nativeSource && args.nativeSource !== "provider-native") return `native_history_source_${args.nativeSource}`;
15883
15883
  if (args.nativeMessageCount <= 0) return "native_history_empty";
@@ -15885,8 +15885,9 @@ function buildNativeHistoryFallbackReason(args) {
15885
15885
  if (!args.freshEnough) return "native_history_stale";
15886
15886
  return "native_history_not_selected";
15887
15887
  }
15888
- function supportsCliNativeTranscript(providerType) {
15889
- return CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType);
15888
+ function supportsCliNativeTranscript(providerType, provider) {
15889
+ if (CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType)) return true;
15890
+ return provider?.category === "cli" && provider?.canonicalHistory?.mode === "native-source";
15890
15891
  }
15891
15892
  function hasSafeNativeHistoryMapping(args) {
15892
15893
  const explicitSessionId = String(args.historySessionId || args.providerSessionId || "").trim();
@@ -16493,12 +16494,12 @@ async function handleReadChat(h, args) {
16493
16494
  let messageSource = buildCliMessageSourceProvenance({
16494
16495
  selected: "pty-parser",
16495
16496
  provider: adapter.cliType,
16496
- fallbackReason: supportsCliNativeTranscript(providerType) ? "native_history_not_checked" : "provider_native_transcript_not_supported",
16497
+ fallbackReason: supportsCliNativeTranscript(providerType, provider) ? "native_history_not_checked" : "provider_native_transcript_not_supported",
16497
16498
  ptyMessages: returnedMessages,
16498
16499
  returnedMessages,
16499
16500
  ptyStatusApprovalOnly: false
16500
16501
  });
16501
- if (supportsCliNativeTranscript(providerType) && provider?.canonicalHistory?.mode === "native-source") {
16502
+ if (supportsCliNativeTranscript(providerType, provider) && provider?.canonicalHistory?.mode === "native-source") {
16502
16503
  const agentStr = provider?.type || args?.agentType || getCurrentProviderType(h, adapter.cliType);
16503
16504
  const workspace = typeof args?.workspace === "string" ? args.workspace : typeof h.currentSession?.workspace === "string" ? h.currentSession.workspace : typeof adapter.workingDir === "string" ? adapter.workingDir : void 0;
16504
16505
  const nativeHistoryLimit = Math.max(
@@ -16566,6 +16567,7 @@ async function handleReadChat(h, args) {
16566
16567
  } else {
16567
16568
  const fallbackReason = buildNativeHistoryFallbackReason({
16568
16569
  providerType,
16570
+ provider,
16569
16571
  nativeSource: nativeHistory.source,
16570
16572
  nativeMessageCount: nativeMessages.length,
16571
16573
  safeMapping,
@@ -16604,7 +16606,7 @@ async function handleReadChat(h, args) {
16604
16606
  returnedStatus: String(returnedStatus || ""),
16605
16607
  selectedMessageSource: messageSource.selected,
16606
16608
  messageSource,
16607
- shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType) && messageSource.selected !== "native-history",
16609
+ shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && messageSource.selected !== "native-history",
16608
16610
  parsedMsgCount: parsedRecord.messages.length,
16609
16611
  returnedMsgCount: selectedMessages.length
16610
16612
  },
@@ -16630,19 +16632,20 @@ async function handleReadChat(h, args) {
16630
16632
  });
16631
16633
  const historyProviderSessionId = typeof history?.providerSessionId === "string" ? history.providerSessionId : historySessionId;
16632
16634
  const historyMessages = Array.isArray(history?.messages) ? normalizeChatMessages(history.messages) : [];
16633
- const safeMapping = supportsCliNativeTranscript(agentStr) ? hasSafeNativeHistoryMapping({
16635
+ const safeMapping = supportsCliNativeTranscript(agentStr, provider) ? hasSafeNativeHistoryMapping({
16634
16636
  historySessionId,
16635
16637
  providerSessionId: historyProviderSessionId,
16636
16638
  workspace,
16637
16639
  nativeMessages: historyMessages
16638
16640
  }) : false;
16639
- const nativeSelected = supportsCliNativeTranscript(agentStr) && history.source === "provider-native" && historyMessages.length > 0 && safeMapping;
16641
+ const nativeSelected = supportsCliNativeTranscript(agentStr, provider) && history.source === "provider-native" && historyMessages.length > 0 && safeMapping;
16640
16642
  const messageSource = buildCliMessageSourceProvenance({
16641
16643
  selected: nativeSelected ? "native-history" : "pty-parser",
16642
16644
  provider: agentStr,
16643
16645
  nativeHandle: historyProviderSessionId || historySessionId,
16644
16646
  fallbackReason: nativeSelected ? void 0 : buildNativeHistoryFallbackReason({
16645
16647
  providerType: agentStr,
16648
+ provider,
16646
16649
  nativeSource: history.source,
16647
16650
  nativeMessageCount: historyMessages.length,
16648
16651
  safeMapping,
@@ -16657,7 +16660,7 @@ async function handleReadChat(h, args) {
16657
16660
  freshEnough: true,
16658
16661
  ptyStatusApprovalOnly: false
16659
16662
  });
16660
- const requiresNativeSource = supportsCliNativeTranscript(agentStr) && provider?.canonicalHistory?.mode === "native-source";
16663
+ const requiresNativeSource = supportsCliNativeTranscript(agentStr, provider) && provider?.canonicalHistory?.mode === "native-source";
16661
16664
  if (requiresNativeSource && !nativeSelected) {
16662
16665
  return {
16663
16666
  success: false,