@adhdev/daemon-core 0.9.82-rc.83 → 0.9.82-rc.84
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 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +18 -0
package/package.json
CHANGED
|
@@ -417,6 +417,16 @@ function isGeneratingLikeStatus(status: unknown): boolean {
|
|
|
417
417
|
return status === 'generating' || status === 'streaming' || status === 'long_generating' || status === 'starting';
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
function hasVisibleAssistantMessage(messages: unknown[] | undefined): boolean {
|
|
421
|
+
if (!Array.isArray(messages)) return false;
|
|
422
|
+
return messages.some((message: any) => {
|
|
423
|
+
if (!message || message.role !== 'assistant') return false;
|
|
424
|
+
const kind = typeof message.kind === 'string' ? message.kind : 'standard';
|
|
425
|
+
if (kind !== 'standard') return false;
|
|
426
|
+
return String(message.content || '').trim().length > 0;
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
420
430
|
function shouldTrustCliAdapterTerminalStatus(parsedStatus: unknown, activeModal: unknown, adapter: CliAdapter, adapterStatus: any): boolean {
|
|
421
431
|
if (!isGeneratingLikeStatus(parsedStatus)) return false;
|
|
422
432
|
if (hasNonEmptyModalButtons(activeModal)) return false;
|
|
@@ -438,6 +448,14 @@ function normalizeCliReadChatStatus(parsedStatus: unknown, activeModal: unknown,
|
|
|
438
448
|
&& !(typeof adapter.isProcessing === 'function' && adapter.isProcessing())) {
|
|
439
449
|
return 'starting';
|
|
440
450
|
}
|
|
451
|
+
if (
|
|
452
|
+
isGeneratingLikeStatus(adapterRawStatus)
|
|
453
|
+
&& parsedStatus === 'idle'
|
|
454
|
+
&& !hasNonEmptyModalButtons(activeModal)
|
|
455
|
+
&& !hasVisibleAssistantMessage(parsedMessages)
|
|
456
|
+
) {
|
|
457
|
+
return adapterRawStatus;
|
|
458
|
+
}
|
|
441
459
|
if (shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus)) return 'idle';
|
|
442
460
|
return typeof parsedStatus === 'string' && parsedStatus.trim() ? parsedStatus : 'idle';
|
|
443
461
|
}
|