@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 CHANGED
@@ -16224,6 +16224,15 @@ function normalizeReadChatCommandStatus(status, activeModal) {
16224
16224
  function isGeneratingLikeStatus(status) {
16225
16225
  return status === "generating" || status === "streaming" || status === "long_generating" || status === "starting";
16226
16226
  }
16227
+ function hasVisibleAssistantMessage(messages) {
16228
+ if (!Array.isArray(messages)) return false;
16229
+ return messages.some((message) => {
16230
+ if (!message || message.role !== "assistant") return false;
16231
+ const kind = typeof message.kind === "string" ? message.kind : "standard";
16232
+ if (kind !== "standard") return false;
16233
+ return String(message.content || "").trim().length > 0;
16234
+ });
16235
+ }
16227
16236
  function shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus) {
16228
16237
  if (!isGeneratingLikeStatus(parsedStatus)) return false;
16229
16238
  if (hasNonEmptyModalButtons(activeModal)) return false;
@@ -16237,6 +16246,9 @@ function normalizeCliReadChatStatus(parsedStatus, activeModal, adapter, adapterS
16237
16246
  if (adapterRawStatus === "starting" && isGeneratingLikeStatus(parsedStatus) && !hasNonEmptyModalButtons(activeModal) && Array.isArray(parsedMessages) && parsedMessages.length === 0 && Array.isArray(adapterStatus?.messages) && adapterStatus.messages.length === 0 && !(typeof adapter.isProcessing === "function" && adapter.isProcessing())) {
16238
16247
  return "starting";
16239
16248
  }
16249
+ if (isGeneratingLikeStatus(adapterRawStatus) && parsedStatus === "idle" && !hasNonEmptyModalButtons(activeModal) && !hasVisibleAssistantMessage(parsedMessages)) {
16250
+ return adapterRawStatus;
16251
+ }
16240
16252
  if (shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus)) return "idle";
16241
16253
  return typeof parsedStatus === "string" && parsedStatus.trim() ? parsedStatus : "idle";
16242
16254
  }