@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.mjs CHANGED
@@ -15965,6 +15965,15 @@ function normalizeReadChatCommandStatus(status, activeModal) {
15965
15965
  function isGeneratingLikeStatus(status) {
15966
15966
  return status === "generating" || status === "streaming" || status === "long_generating" || status === "starting";
15967
15967
  }
15968
+ function hasVisibleAssistantMessage(messages) {
15969
+ if (!Array.isArray(messages)) return false;
15970
+ return messages.some((message) => {
15971
+ if (!message || message.role !== "assistant") return false;
15972
+ const kind = typeof message.kind === "string" ? message.kind : "standard";
15973
+ if (kind !== "standard") return false;
15974
+ return String(message.content || "").trim().length > 0;
15975
+ });
15976
+ }
15968
15977
  function shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus) {
15969
15978
  if (!isGeneratingLikeStatus(parsedStatus)) return false;
15970
15979
  if (hasNonEmptyModalButtons(activeModal)) return false;
@@ -15978,6 +15987,9 @@ function normalizeCliReadChatStatus(parsedStatus, activeModal, adapter, adapterS
15978
15987
  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())) {
15979
15988
  return "starting";
15980
15989
  }
15990
+ if (isGeneratingLikeStatus(adapterRawStatus) && parsedStatus === "idle" && !hasNonEmptyModalButtons(activeModal) && !hasVisibleAssistantMessage(parsedMessages)) {
15991
+ return adapterRawStatus;
15992
+ }
15981
15993
  if (shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus)) return "idle";
15982
15994
  return typeof parsedStatus === "string" && parsedStatus.trim() ? parsedStatus : "idle";
15983
15995
  }