@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.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/package.json
CHANGED
|
@@ -290,12 +290,13 @@ function buildCliMessageSourceProvenance(args: {
|
|
|
290
290
|
|
|
291
291
|
function buildNativeHistoryFallbackReason(args: {
|
|
292
292
|
providerType: string;
|
|
293
|
+
provider?: ProviderModule;
|
|
293
294
|
nativeSource?: string;
|
|
294
295
|
nativeMessageCount: number;
|
|
295
296
|
safeMapping: boolean;
|
|
296
297
|
freshEnough: boolean;
|
|
297
298
|
}): string {
|
|
298
|
-
if (!supportsCliNativeTranscript(args.providerType)) return 'provider_native_transcript_not_supported';
|
|
299
|
+
if (!supportsCliNativeTranscript(args.providerType, args.provider)) return 'provider_native_transcript_not_supported';
|
|
299
300
|
if (args.nativeSource === 'native-unavailable') return 'native_history_unavailable';
|
|
300
301
|
if (args.nativeSource && args.nativeSource !== 'provider-native') return `native_history_source_${args.nativeSource}`;
|
|
301
302
|
if (args.nativeMessageCount <= 0) return 'native_history_empty';
|
|
@@ -304,8 +305,9 @@ function buildNativeHistoryFallbackReason(args: {
|
|
|
304
305
|
return 'native_history_not_selected';
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
function supportsCliNativeTranscript(providerType: string): boolean {
|
|
308
|
-
|
|
308
|
+
function supportsCliNativeTranscript(providerType: string, provider?: ProviderModule): boolean {
|
|
309
|
+
if (CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType)) return true;
|
|
310
|
+
return provider?.category === 'cli' && (provider?.canonicalHistory as any)?.mode === 'native-source';
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
function hasSafeNativeHistoryMapping(args: {
|
|
@@ -1047,13 +1049,13 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1047
1049
|
let messageSource = buildCliMessageSourceProvenance({
|
|
1048
1050
|
selected: 'pty-parser',
|
|
1049
1051
|
provider: adapter.cliType,
|
|
1050
|
-
fallbackReason: supportsCliNativeTranscript(providerType) ? 'native_history_not_checked' : 'provider_native_transcript_not_supported',
|
|
1052
|
+
fallbackReason: supportsCliNativeTranscript(providerType, provider) ? 'native_history_not_checked' : 'provider_native_transcript_not_supported',
|
|
1051
1053
|
ptyMessages: returnedMessages,
|
|
1052
1054
|
returnedMessages,
|
|
1053
1055
|
ptyStatusApprovalOnly: false,
|
|
1054
1056
|
});
|
|
1055
1057
|
|
|
1056
|
-
if (supportsCliNativeTranscript(providerType) && (provider?.canonicalHistory as any)?.mode === 'native-source') {
|
|
1058
|
+
if (supportsCliNativeTranscript(providerType, provider) && (provider?.canonicalHistory as any)?.mode === 'native-source') {
|
|
1057
1059
|
const agentStr = provider?.type || args?.agentType || getCurrentProviderType(h, adapter.cliType);
|
|
1058
1060
|
const workspace = typeof args?.workspace === 'string'
|
|
1059
1061
|
? args.workspace
|
|
@@ -1132,6 +1134,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1132
1134
|
} else {
|
|
1133
1135
|
const fallbackReason = buildNativeHistoryFallbackReason({
|
|
1134
1136
|
providerType,
|
|
1137
|
+
provider,
|
|
1135
1138
|
nativeSource: (nativeHistory as any).source,
|
|
1136
1139
|
nativeMessageCount: nativeMessages.length,
|
|
1137
1140
|
safeMapping,
|
|
@@ -1170,7 +1173,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1170
1173
|
returnedStatus: String(returnedStatus || ''),
|
|
1171
1174
|
selectedMessageSource: (messageSource as any).selected,
|
|
1172
1175
|
messageSource,
|
|
1173
|
-
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType) && (messageSource as any).selected !== 'native-history',
|
|
1176
|
+
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && (messageSource as any).selected !== 'native-history',
|
|
1174
1177
|
parsedMsgCount: parsedRecord.messages.length,
|
|
1175
1178
|
returnedMsgCount: selectedMessages.length,
|
|
1176
1179
|
},
|
|
@@ -1204,7 +1207,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1204
1207
|
const historyMessages = Array.isArray((history as any)?.messages)
|
|
1205
1208
|
? normalizeChatMessages((history as any).messages as ChatMessage[])
|
|
1206
1209
|
: [];
|
|
1207
|
-
const safeMapping = supportsCliNativeTranscript(agentStr)
|
|
1210
|
+
const safeMapping = supportsCliNativeTranscript(agentStr, provider)
|
|
1208
1211
|
? hasSafeNativeHistoryMapping({
|
|
1209
1212
|
historySessionId,
|
|
1210
1213
|
providerSessionId: historyProviderSessionId,
|
|
@@ -1212,7 +1215,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1212
1215
|
nativeMessages: historyMessages,
|
|
1213
1216
|
})
|
|
1214
1217
|
: false;
|
|
1215
|
-
const nativeSelected = supportsCliNativeTranscript(agentStr)
|
|
1218
|
+
const nativeSelected = supportsCliNativeTranscript(agentStr, provider)
|
|
1216
1219
|
&& (history as any).source === 'provider-native'
|
|
1217
1220
|
&& historyMessages.length > 0
|
|
1218
1221
|
&& safeMapping;
|
|
@@ -1224,6 +1227,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1224
1227
|
? undefined
|
|
1225
1228
|
: buildNativeHistoryFallbackReason({
|
|
1226
1229
|
providerType: agentStr,
|
|
1230
|
+
provider,
|
|
1227
1231
|
nativeSource: (history as any).source,
|
|
1228
1232
|
nativeMessageCount: historyMessages.length,
|
|
1229
1233
|
safeMapping,
|
|
@@ -1238,7 +1242,7 @@ export async function handleReadChat(h: CommandHelpers, args: any): Promise<Comm
|
|
|
1238
1242
|
freshEnough: true,
|
|
1239
1243
|
ptyStatusApprovalOnly: false,
|
|
1240
1244
|
});
|
|
1241
|
-
const requiresNativeSource = supportsCliNativeTranscript(agentStr)
|
|
1245
|
+
const requiresNativeSource = supportsCliNativeTranscript(agentStr, provider)
|
|
1242
1246
|
&& (provider?.canonicalHistory as any)?.mode === 'native-source';
|
|
1243
1247
|
if (requiresNativeSource && !nativeSelected) {
|
|
1244
1248
|
return {
|