@adhdev/daemon-core 0.9.82-rc.84 → 0.9.82-rc.85
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 +12 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +13 -9
package/dist/index.js
CHANGED
|
@@ -16136,7 +16136,7 @@ function buildCliMessageSourceProvenance(args) {
|
|
|
16136
16136
|
};
|
|
16137
16137
|
}
|
|
16138
16138
|
function buildNativeHistoryFallbackReason(args) {
|
|
16139
|
-
if (!supportsCliNativeTranscript(args.providerType)) return "provider_native_transcript_not_supported";
|
|
16139
|
+
if (!supportsCliNativeTranscript(args.providerType, args.provider)) return "provider_native_transcript_not_supported";
|
|
16140
16140
|
if (args.nativeSource === "native-unavailable") return "native_history_unavailable";
|
|
16141
16141
|
if (args.nativeSource && args.nativeSource !== "provider-native") return `native_history_source_${args.nativeSource}`;
|
|
16142
16142
|
if (args.nativeMessageCount <= 0) return "native_history_empty";
|
|
@@ -16144,8 +16144,9 @@ function buildNativeHistoryFallbackReason(args) {
|
|
|
16144
16144
|
if (!args.freshEnough) return "native_history_stale";
|
|
16145
16145
|
return "native_history_not_selected";
|
|
16146
16146
|
}
|
|
16147
|
-
function supportsCliNativeTranscript(providerType) {
|
|
16148
|
-
|
|
16147
|
+
function supportsCliNativeTranscript(providerType, provider) {
|
|
16148
|
+
if (CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType)) return true;
|
|
16149
|
+
return provider?.category === "cli" && provider?.canonicalHistory?.mode === "native-source";
|
|
16149
16150
|
}
|
|
16150
16151
|
function hasSafeNativeHistoryMapping(args) {
|
|
16151
16152
|
const explicitSessionId = String(args.historySessionId || args.providerSessionId || "").trim();
|
|
@@ -16752,12 +16753,12 @@ async function handleReadChat(h, args) {
|
|
|
16752
16753
|
let messageSource = buildCliMessageSourceProvenance({
|
|
16753
16754
|
selected: "pty-parser",
|
|
16754
16755
|
provider: adapter.cliType,
|
|
16755
|
-
fallbackReason: supportsCliNativeTranscript(providerType) ? "native_history_not_checked" : "provider_native_transcript_not_supported",
|
|
16756
|
+
fallbackReason: supportsCliNativeTranscript(providerType, provider) ? "native_history_not_checked" : "provider_native_transcript_not_supported",
|
|
16756
16757
|
ptyMessages: returnedMessages,
|
|
16757
16758
|
returnedMessages,
|
|
16758
16759
|
ptyStatusApprovalOnly: false
|
|
16759
16760
|
});
|
|
16760
|
-
if (supportsCliNativeTranscript(providerType) && provider?.canonicalHistory?.mode === "native-source") {
|
|
16761
|
+
if (supportsCliNativeTranscript(providerType, provider) && provider?.canonicalHistory?.mode === "native-source") {
|
|
16761
16762
|
const agentStr = provider?.type || args?.agentType || getCurrentProviderType(h, adapter.cliType);
|
|
16762
16763
|
const workspace = typeof args?.workspace === "string" ? args.workspace : typeof h.currentSession?.workspace === "string" ? h.currentSession.workspace : typeof adapter.workingDir === "string" ? adapter.workingDir : void 0;
|
|
16763
16764
|
const nativeHistoryLimit = Math.max(
|
|
@@ -16825,6 +16826,7 @@ async function handleReadChat(h, args) {
|
|
|
16825
16826
|
} else {
|
|
16826
16827
|
const fallbackReason = buildNativeHistoryFallbackReason({
|
|
16827
16828
|
providerType,
|
|
16829
|
+
provider,
|
|
16828
16830
|
nativeSource: nativeHistory.source,
|
|
16829
16831
|
nativeMessageCount: nativeMessages.length,
|
|
16830
16832
|
safeMapping,
|
|
@@ -16863,7 +16865,7 @@ async function handleReadChat(h, args) {
|
|
|
16863
16865
|
returnedStatus: String(returnedStatus || ""),
|
|
16864
16866
|
selectedMessageSource: messageSource.selected,
|
|
16865
16867
|
messageSource,
|
|
16866
|
-
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType) && messageSource.selected !== "native-history",
|
|
16868
|
+
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && messageSource.selected !== "native-history",
|
|
16867
16869
|
parsedMsgCount: parsedRecord.messages.length,
|
|
16868
16870
|
returnedMsgCount: selectedMessages.length
|
|
16869
16871
|
},
|
|
@@ -16889,19 +16891,20 @@ async function handleReadChat(h, args) {
|
|
|
16889
16891
|
});
|
|
16890
16892
|
const historyProviderSessionId = typeof history?.providerSessionId === "string" ? history.providerSessionId : historySessionId;
|
|
16891
16893
|
const historyMessages = Array.isArray(history?.messages) ? normalizeChatMessages(history.messages) : [];
|
|
16892
|
-
const safeMapping = supportsCliNativeTranscript(agentStr) ? hasSafeNativeHistoryMapping({
|
|
16894
|
+
const safeMapping = supportsCliNativeTranscript(agentStr, provider) ? hasSafeNativeHistoryMapping({
|
|
16893
16895
|
historySessionId,
|
|
16894
16896
|
providerSessionId: historyProviderSessionId,
|
|
16895
16897
|
workspace,
|
|
16896
16898
|
nativeMessages: historyMessages
|
|
16897
16899
|
}) : false;
|
|
16898
|
-
const nativeSelected = supportsCliNativeTranscript(agentStr) && history.source === "provider-native" && historyMessages.length > 0 && safeMapping;
|
|
16900
|
+
const nativeSelected = supportsCliNativeTranscript(agentStr, provider) && history.source === "provider-native" && historyMessages.length > 0 && safeMapping;
|
|
16899
16901
|
const messageSource = buildCliMessageSourceProvenance({
|
|
16900
16902
|
selected: nativeSelected ? "native-history" : "pty-parser",
|
|
16901
16903
|
provider: agentStr,
|
|
16902
16904
|
nativeHandle: historyProviderSessionId || historySessionId,
|
|
16903
16905
|
fallbackReason: nativeSelected ? void 0 : buildNativeHistoryFallbackReason({
|
|
16904
16906
|
providerType: agentStr,
|
|
16907
|
+
provider,
|
|
16905
16908
|
nativeSource: history.source,
|
|
16906
16909
|
nativeMessageCount: historyMessages.length,
|
|
16907
16910
|
safeMapping,
|
|
@@ -16916,7 +16919,7 @@ async function handleReadChat(h, args) {
|
|
|
16916
16919
|
freshEnough: true,
|
|
16917
16920
|
ptyStatusApprovalOnly: false
|
|
16918
16921
|
});
|
|
16919
|
-
const requiresNativeSource = supportsCliNativeTranscript(agentStr) && provider?.canonicalHistory?.mode === "native-source";
|
|
16922
|
+
const requiresNativeSource = supportsCliNativeTranscript(agentStr, provider) && provider?.canonicalHistory?.mode === "native-source";
|
|
16920
16923
|
if (requiresNativeSource && !nativeSelected) {
|
|
16921
16924
|
return {
|
|
16922
16925
|
success: false,
|