@adhdev/daemon-standalone 0.9.76-rc.17 → 0.9.76-rc.19
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 +31 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +85 -28
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -43149,6 +43149,34 @@ ${effect.notification.body || ""}`.trim();
|
|
|
43149
43149
|
return raw;
|
|
43150
43150
|
}
|
|
43151
43151
|
}
|
|
43152
|
+
function isGeneratingLikeStatus(status) {
|
|
43153
|
+
return status === "generating" || status === "streaming" || status === "long_generating" || status === "starting";
|
|
43154
|
+
}
|
|
43155
|
+
function shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus) {
|
|
43156
|
+
if (!isGeneratingLikeStatus(parsedStatus)) return false;
|
|
43157
|
+
if (hasNonEmptyModalButtons(activeModal)) return false;
|
|
43158
|
+
const adapterRawStatus = typeof adapterStatus?.status === "string" ? adapterStatus.status.trim() : "";
|
|
43159
|
+
if (adapterRawStatus !== "idle") return false;
|
|
43160
|
+
if (typeof adapter.isProcessing === "function" && adapter.isProcessing()) return false;
|
|
43161
|
+
return true;
|
|
43162
|
+
}
|
|
43163
|
+
function normalizeCliReadChatStatus(parsedStatus, activeModal, adapter, adapterStatus) {
|
|
43164
|
+
if (shouldTrustCliAdapterTerminalStatus(parsedStatus, activeModal, adapter, adapterStatus)) return "idle";
|
|
43165
|
+
return typeof parsedStatus === "string" && parsedStatus.trim() ? parsedStatus : "idle";
|
|
43166
|
+
}
|
|
43167
|
+
function finalizeStreamingMessagesWhenIdle(messages, status) {
|
|
43168
|
+
if (status !== "idle") return messages;
|
|
43169
|
+
return messages.map((message) => {
|
|
43170
|
+
const meta3 = message.meta && typeof message.meta === "object" ? message.meta : void 0;
|
|
43171
|
+
const hasStreamingMeta = meta3?.streaming === true;
|
|
43172
|
+
if (message.bubbleState !== "streaming" && !hasStreamingMeta) return message;
|
|
43173
|
+
return {
|
|
43174
|
+
...message,
|
|
43175
|
+
...message.bubbleState === "streaming" ? { bubbleState: "final" } : {},
|
|
43176
|
+
...hasStreamingMeta ? { meta: { ...meta3, streaming: false } } : {}
|
|
43177
|
+
};
|
|
43178
|
+
});
|
|
43179
|
+
}
|
|
43152
43180
|
function buildReadChatCommandResult(payload, args) {
|
|
43153
43181
|
let validatedPayload;
|
|
43154
43182
|
const debugReadChat = payload?.debugReadChat && typeof payload.debugReadChat === "object" ? payload.debugReadChat : void 0;
|
|
@@ -43587,9 +43615,10 @@ ${effect.notification.body || ""}`.trim();
|
|
|
43587
43615
|
const transcriptAuthority = parsedRecord.transcriptAuthority === "provider" || parsedRecord.transcriptAuthority === "daemon" ? parsedRecord.transcriptAuthority : void 0;
|
|
43588
43616
|
const coverage = parsedRecord.coverage === "full" || parsedRecord.coverage === "tail" || parsedRecord.coverage === "current-turn" ? parsedRecord.coverage : void 0;
|
|
43589
43617
|
const activeModal = parsedRecord.activeModal ?? parsedRecord.modal ?? null;
|
|
43590
|
-
const returnedStatus = parsedRecord.status
|
|
43618
|
+
const returnedStatus = normalizeCliReadChatStatus(parsedRecord.status, activeModal, adapter, adapterStatus);
|
|
43591
43619
|
const runtimeMessageMerger = getTargetInstance(h, args);
|
|
43592
|
-
const
|
|
43620
|
+
const parsedMessages = finalizeStreamingMessagesWhenIdle(parsedRecord.messages, returnedStatus);
|
|
43621
|
+
const returnedMessages = runtimeMessageMerger?.category === "cli" && runtimeMessageMerger.type === adapter.cliType && typeof runtimeMessageMerger.mergeRuntimeChatMessages === "function" ? runtimeMessageMerger.mergeRuntimeChatMessages(parsedMessages) : parsedMessages;
|
|
43593
43622
|
LOG2.debug("Command", `[read_chat] cli-like parsed provider=${adapter.cliType} target=${String(args?.targetSessionId || "")} adapterStatus=${String(adapterStatus.status || "")} parsedStatus=${String(parsedRecord.status || "")} parsedMsgCount=${parsedRecord.messages.length} returnedMsgCount=${returnedMessages.length}`);
|
|
43594
43623
|
return buildReadChatCommandResult({
|
|
43595
43624
|
messages: returnedMessages,
|