@adhdev/daemon-core 0.9.76-rc.41 → 0.9.76-rc.43
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 +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cli-adapters/provider-cli-adapter.ts +15 -1
- package/src/commands/chat-commands.ts +18 -3
package/dist/index.js
CHANGED
|
@@ -3336,7 +3336,14 @@ ${lastSnapshot}`;
|
|
|
3336
3336
|
})() : null;
|
|
3337
3337
|
const parsedSessionStatus = typeof parsedStatusBeforeSend?.status === "string" ? String(parsedStatusBeforeSend.status) : "";
|
|
3338
3338
|
if (!allowInputDuringGeneration && (parsedSessionStatus === "generating" || parsedSessionStatus === "long_generating")) {
|
|
3339
|
-
|
|
3339
|
+
const parsedModal = parsedStatusBeforeSend?.activeModal ?? parsedStatusBeforeSend?.modal ?? null;
|
|
3340
|
+
const parsedHasActionableModal = Boolean(
|
|
3341
|
+
parsedModal && Array.isArray(parsedModal.buttons) && parsedModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim())
|
|
3342
|
+
);
|
|
3343
|
+
const terminalLooksIdle = this.currentStatus === "idle" && this.runDetectStatus(this.recentOutputBuffer) === "idle" && !this.isWaitingForResponse && !this.currentTurnScope && !this.hasActionableApproval() && !parsedHasActionableModal;
|
|
3344
|
+
if (!terminalLooksIdle) {
|
|
3345
|
+
throw new Error(`${this.cliName} is still processing the previous prompt`);
|
|
3346
|
+
}
|
|
3340
3347
|
}
|
|
3341
3348
|
if (this.isWaitingForResponse && !allowInputDuringGeneration) {
|
|
3342
3349
|
if (!this.clearStaleIdleResponseGuard("send_message_guard")) {
|
|
@@ -13317,9 +13324,17 @@ async function handleResolveAction(h, args) {
|
|
|
13317
13324
|
const targetState = targetInstance?.getState?.();
|
|
13318
13325
|
const surfacedModal = targetState?.activeChat?.activeModal && Array.isArray(targetState.activeChat.activeModal.buttons) && targetState.activeChat.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? targetState.activeChat.activeModal : null;
|
|
13319
13326
|
const statusModal = status?.activeModal && Array.isArray(status.activeModal.buttons) && status.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? status.activeModal : null;
|
|
13320
|
-
const
|
|
13321
|
-
|
|
13322
|
-
|
|
13327
|
+
const parsedStatus = !statusModal && !surfacedModal && typeof adapter.getScriptParsedStatus === "function" ? (() => {
|
|
13328
|
+
try {
|
|
13329
|
+
return parseMaybeJson(adapter.getScriptParsedStatus());
|
|
13330
|
+
} catch {
|
|
13331
|
+
return null;
|
|
13332
|
+
}
|
|
13333
|
+
})() : null;
|
|
13334
|
+
const parsedModal = parsedStatus?.status === "waiting_approval" && parsedStatus?.activeModal && Array.isArray(parsedStatus.activeModal.buttons) && parsedStatus.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? parsedStatus.activeModal : null;
|
|
13335
|
+
const effectiveModal = statusModal || surfacedModal || parsedModal;
|
|
13336
|
+
const effectiveStatus = status?.status === "waiting_approval" || targetState?.activeChat?.status === "waiting_approval" || parsedStatus?.status === "waiting_approval" ? "waiting_approval" : status?.status;
|
|
13337
|
+
LOG.info("Command", `[resolveAction] CLI PTY gate target=${String(args?.targetSessionId || "")} rawStatus=${String(status?.status || "")} effectiveStatus=${String(effectiveStatus || "")} statusModal=${statusModal ? "yes" : "no"} surfacedModal=${surfacedModal ? "yes" : "no"} parsedModal=${parsedModal ? "yes" : "no"} instance=${targetInstance ? "yes" : "no"}`);
|
|
13323
13338
|
if (!effectiveModal) {
|
|
13324
13339
|
return { success: false, error: "Not in approval state" };
|
|
13325
13340
|
}
|