@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.83",
3
+ "version": "0.9.82-rc.84",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
  }