@adhdev/daemon-standalone 0.9.82-rc.356 → 0.9.82-rc.358
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 +133 -81
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30036,10 +30036,10 @@ var require_dist3 = __commonJS({
|
|
|
30036
30036
|
}
|
|
30037
30037
|
function getDaemonBuildInfo() {
|
|
30038
30038
|
if (cached2) return cached2;
|
|
30039
|
-
const commit = readInjected(true ? "
|
|
30040
|
-
const commitShort = readInjected(true ? "
|
|
30041
|
-
const version2 = readInjected(true ? "0.9.82-rc.
|
|
30042
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
30039
|
+
const commit = readInjected(true ? "7210e80591d8d9ab378ee786ffb233027437461a" : void 0) ?? "unknown";
|
|
30040
|
+
const commitShort = readInjected(true ? "7210e805" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30041
|
+
const version2 = readInjected(true ? "0.9.82-rc.358" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30042
|
+
const builtAt = readInjected(true ? "2026-06-23T01:41:19.647Z" : void 0);
|
|
30043
30043
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30044
30044
|
return cached2;
|
|
30045
30045
|
}
|
|
@@ -42462,8 +42462,22 @@ ${cleanBody}`;
|
|
|
42462
42462
|
}
|
|
42463
42463
|
function getMeshWithCache(components, meshId) {
|
|
42464
42464
|
const localMesh = getMesh(meshId);
|
|
42465
|
-
|
|
42466
|
-
|
|
42465
|
+
const cachedMesh = components.router?.getCachedInlineMesh(meshId);
|
|
42466
|
+
if (!localMesh) return cachedMesh;
|
|
42467
|
+
if (!cachedMesh) return localMesh;
|
|
42468
|
+
return mergeInlineCacheOnlyNodes(localMesh, cachedMesh);
|
|
42469
|
+
}
|
|
42470
|
+
function mergeInlineCacheOnlyNodes(localMesh, cachedMesh) {
|
|
42471
|
+
const localNodes = Array.isArray(localMesh?.nodes) ? localMesh.nodes : [];
|
|
42472
|
+
const cachedNodes = Array.isArray(cachedMesh?.nodes) ? cachedMesh.nodes : [];
|
|
42473
|
+
if (!cachedNodes.length) return localMesh;
|
|
42474
|
+
const cacheOnly = cachedNodes.filter((cachedNode) => {
|
|
42475
|
+
const cachedId = readMeshNodeId(cachedNode);
|
|
42476
|
+
if (!cachedId) return false;
|
|
42477
|
+
return !localNodes.some((localNode) => meshNodeIdMatches(localNode, cachedId));
|
|
42478
|
+
});
|
|
42479
|
+
if (!cacheOnly.length) return localMesh;
|
|
42480
|
+
return { ...localMesh, nodes: [...localNodes, ...cacheOnly] };
|
|
42467
42481
|
}
|
|
42468
42482
|
function isIntentionalCleanupStopMetadata(event) {
|
|
42469
42483
|
return event.intentional === true || event.intentionalStop === true || event.operatorCleanup === true || event.reason === "operator_cleanup" || event.stopReason === "operator_cleanup" || event.cleanupReason === "operator_cleanup" || event.source === "mesh_cleanup_sessions" || event.source === "mesh_remove_node";
|
|
@@ -43526,7 +43540,7 @@ ${cleanBody}`;
|
|
|
43526
43540
|
occurredAt: occurredAtMs != null ? new Date(occurredAtMs).toISOString() : void 0,
|
|
43527
43541
|
taskId: eventTaskId
|
|
43528
43542
|
});
|
|
43529
|
-
const leaveDirectDispatchActive = !task && opts?.tentativeIfDirect === true;
|
|
43543
|
+
const leaveDirectDispatchActive = !task && opts?.tentativeIfDirect === true || !eventTaskId && !sessionHasActiveAssignment(args.meshId, sessionId);
|
|
43530
43544
|
if (!leaveDirectDispatchActive) {
|
|
43531
43545
|
updateDirectDispatchStatus(args.meshId, sessionId, outcome, eventTaskId);
|
|
43532
43546
|
}
|
|
@@ -43625,7 +43639,9 @@ ${cleanBody}`;
|
|
|
43625
43639
|
}
|
|
43626
43640
|
if (sessionId) {
|
|
43627
43641
|
const startedTaskId = readNonEmptyString2(args.metadataEvent.taskId) || void 0;
|
|
43628
|
-
|
|
43642
|
+
if (startedTaskId || sessionHasActiveAssignment(args.meshId, sessionId)) {
|
|
43643
|
+
updateDirectDispatchStatus(args.meshId, sessionId, "acked", startedTaskId);
|
|
43644
|
+
}
|
|
43629
43645
|
const activeDeliveries = (() => {
|
|
43630
43646
|
try {
|
|
43631
43647
|
return MeshRuntimeStore.getInstance().getActiveSessionDeliveries(args.meshId, sessionId);
|
|
@@ -43800,6 +43816,76 @@ ${cleanBody}`;
|
|
|
43800
43816
|
}
|
|
43801
43817
|
return { success: true, forwarded: 0 };
|
|
43802
43818
|
}
|
|
43819
|
+
function buildRelayMetadataEvent(payload) {
|
|
43820
|
+
const relayModalMessage = readNonEmptyString2(payload.modalMessage);
|
|
43821
|
+
const relayModalButtons = Array.isArray(payload.modalButtons) ? payload.modalButtons.filter((b) => typeof b === "string" && b.trim().length > 0) : null;
|
|
43822
|
+
return {
|
|
43823
|
+
// Preserve the dispatch task id across the machine boundary. The `received` trace
|
|
43824
|
+
// stage reads payload.taskId; without mirroring it here the rebuilt metadataEvent
|
|
43825
|
+
// loses it, so injectMeshSystemMessage's traceCtx.taskId and the
|
|
43826
|
+
// updateDirectDispatchStatus(eventTaskId) call go undefined — the EvtTrace
|
|
43827
|
+
// queued/surfaced stages show task=- and the direct-dispatch ledger falls back to a
|
|
43828
|
+
// session_id match (which can flip a sibling row). The local in-process forward path
|
|
43829
|
+
// keeps event.taskId/meshActiveTaskId for free; this mirrors it for the remote relay.
|
|
43830
|
+
// Same taskId/meshActiveTaskId ordering the local unroutable trace uses.
|
|
43831
|
+
taskId: readNonEmptyString2(payload.taskId) || readNonEmptyString2(payload.meshActiveTaskId),
|
|
43832
|
+
targetSessionId: readNonEmptyString2(payload.targetSessionId) || readNonEmptyString2(payload.sessionId) || readNonEmptyString2(payload.instanceId),
|
|
43833
|
+
providerType: readNonEmptyString2(payload.providerType),
|
|
43834
|
+
providerSessionId: readNonEmptyString2(payload.providerSessionId),
|
|
43835
|
+
// Preserve the originating coordinator SESSION id across the machine boundary so
|
|
43836
|
+
// the completion routes back to the exact coordinator session (multi-coordinator).
|
|
43837
|
+
// buildForwardPayloadFromPending spreads the worker event's metadata, so the id
|
|
43838
|
+
// arrives as payload.meshCoordinatorSessionId; the top-level targetCoordinatorSessionId
|
|
43839
|
+
// is also accepted as a fallback. injectMeshSystemMessage re-derives the routing
|
|
43840
|
+
// anchors from this. Absent → daemon-level fallback (version-skew safe).
|
|
43841
|
+
meshCoordinatorSessionId: readNonEmptyString2(payload.meshCoordinatorSessionId) || readNonEmptyString2(payload.targetCoordinatorSessionId),
|
|
43842
|
+
// Carry the session identity fields the worker provider event emits so the
|
|
43843
|
+
// coordinator's mirror (updateMeshOwnedSession) gets a real workspace/title/
|
|
43844
|
+
// settings. Without these the remote-relay hop reconstructs metadataEvent with
|
|
43845
|
+
// an empty workspace, and the dashboard flaps to the generic
|
|
43846
|
+
// "Terminal (Mesh Node)" title (and degrades the provider label) between live
|
|
43847
|
+
// events and the periodic get_status_metadata snapshot. The local in-process
|
|
43848
|
+
// forward path (onMeshCoordinatorEventForwarded) already preserves these; this
|
|
43849
|
+
// mirrors them for the remote-only relay path.
|
|
43850
|
+
workspace: readNonEmptyString2(payload.workspace) || readNonEmptyString2(payload.workspaceName),
|
|
43851
|
+
workspaceName: readNonEmptyString2(payload.workspaceName) || readNonEmptyString2(payload.workspace),
|
|
43852
|
+
sessionTitle: readNonEmptyString2(payload.sessionTitle),
|
|
43853
|
+
sessionStatus: readNonEmptyString2(payload.sessionStatus),
|
|
43854
|
+
sessionChatStatus: readNonEmptyString2(payload.sessionChatStatus),
|
|
43855
|
+
providerName: readNonEmptyString2(payload.providerName),
|
|
43856
|
+
...payload.sessionSettings && typeof payload.sessionSettings === "object" && !Array.isArray(payload.sessionSettings) ? { sessionSettings: payload.sessionSettings } : {},
|
|
43857
|
+
finalSummary: readNonEmptyString2(payload.finalSummary) || readNonEmptyString2(payload.summary),
|
|
43858
|
+
// T2: carry the worker's status-snapshot last-message preview across the machine
|
|
43859
|
+
// boundary so a summary-less completion still surfaces the assistant reply in the
|
|
43860
|
+
// coordinator's inbox mirror. resolveMeshSurfacedSessionPreview reads these
|
|
43861
|
+
// (assistant-role only) when finalSummary is absent.
|
|
43862
|
+
lastMessagePreview: readNonEmptyString2(payload.lastMessagePreview),
|
|
43863
|
+
lastMessageRole: readNonEmptyString2(payload.lastMessageRole),
|
|
43864
|
+
...payload.lastMessageAt !== void 0 ? { lastMessageAt: payload.lastMessageAt } : {},
|
|
43865
|
+
jobId: readNonEmptyString2(payload.jobId),
|
|
43866
|
+
interactionId: readNonEmptyString2(payload.interactionId),
|
|
43867
|
+
status: readNonEmptyString2(payload.status),
|
|
43868
|
+
targetDaemonId: readNonEmptyString2(payload.targetDaemonId),
|
|
43869
|
+
startedAt: readNonEmptyString2(payload.startedAt),
|
|
43870
|
+
completedAt: readNonEmptyString2(payload.completedAt),
|
|
43871
|
+
retryOfJobId: readNonEmptyString2(payload.retryOfJobId),
|
|
43872
|
+
...relayModalMessage ? { modalMessage: relayModalMessage } : {},
|
|
43873
|
+
...relayModalButtons && relayModalButtons.length > 0 ? { modalButtons: relayModalButtons } : {},
|
|
43874
|
+
...payload.result && typeof payload.result === "object" && !Array.isArray(payload.result) ? { result: payload.result } : {},
|
|
43875
|
+
...payload.completionDiagnostic && typeof payload.completionDiagnostic === "object" && !Array.isArray(payload.completionDiagnostic) ? { completionDiagnostic: payload.completionDiagnostic } : {},
|
|
43876
|
+
...payload.workerResult && typeof payload.workerResult === "object" && !Array.isArray(payload.workerResult) ? { workerResult: payload.workerResult } : {},
|
|
43877
|
+
...payload.meshWorkerResult && typeof payload.meshWorkerResult === "object" && !Array.isArray(payload.meshWorkerResult) ? { meshWorkerResult: payload.meshWorkerResult } : {},
|
|
43878
|
+
...payload.structuredResult && typeof payload.structuredResult === "object" && !Array.isArray(payload.structuredResult) ? { structuredResult: payload.structuredResult } : {},
|
|
43879
|
+
...payload.timestamp !== void 0 ? { timestamp: payload.timestamp } : {},
|
|
43880
|
+
intentional: payload.intentional === true,
|
|
43881
|
+
intentionalStop: payload.intentionalStop === true,
|
|
43882
|
+
operatorCleanup: payload.operatorCleanup === true,
|
|
43883
|
+
reason: readNonEmptyString2(payload.reason),
|
|
43884
|
+
stopReason: readNonEmptyString2(payload.stopReason),
|
|
43885
|
+
cleanupReason: readNonEmptyString2(payload.cleanupReason),
|
|
43886
|
+
source: readNonEmptyString2(payload.source)
|
|
43887
|
+
};
|
|
43888
|
+
}
|
|
43803
43889
|
function handleMeshForwardEvent(components, payload) {
|
|
43804
43890
|
const eventName = readNonEmptyString2(payload.event);
|
|
43805
43891
|
if (!isMeshCoordinatorEvent(eventName)) {
|
|
@@ -43825,70 +43911,12 @@ ${cleanBody}`;
|
|
|
43825
43911
|
event: eventName
|
|
43826
43912
|
});
|
|
43827
43913
|
const nodeLabel = nodeId ? `Node '${nodeId}'` : workspace ? `Agent at ${workspace}` : "Remote agent";
|
|
43828
|
-
const relayModalMessage = readNonEmptyString2(payload.modalMessage);
|
|
43829
|
-
const relayModalButtons = Array.isArray(payload.modalButtons) ? payload.modalButtons.filter((b) => typeof b === "string" && b.trim().length > 0) : null;
|
|
43830
43914
|
return injectMeshSystemMessage(components, {
|
|
43831
43915
|
meshId,
|
|
43832
43916
|
nodeId,
|
|
43833
43917
|
nodeLabel,
|
|
43834
43918
|
event: eventName,
|
|
43835
|
-
metadataEvent:
|
|
43836
|
-
targetSessionId: readNonEmptyString2(payload.targetSessionId) || readNonEmptyString2(payload.sessionId) || readNonEmptyString2(payload.instanceId),
|
|
43837
|
-
providerType: readNonEmptyString2(payload.providerType),
|
|
43838
|
-
providerSessionId: readNonEmptyString2(payload.providerSessionId),
|
|
43839
|
-
// Preserve the originating coordinator SESSION id across the machine boundary so
|
|
43840
|
-
// the completion routes back to the exact coordinator session (multi-coordinator).
|
|
43841
|
-
// buildForwardPayloadFromPending spreads the worker event's metadata, so the id
|
|
43842
|
-
// arrives as payload.meshCoordinatorSessionId; the top-level targetCoordinatorSessionId
|
|
43843
|
-
// is also accepted as a fallback. injectMeshSystemMessage re-derives the routing
|
|
43844
|
-
// anchors from this. Absent → daemon-level fallback (version-skew safe).
|
|
43845
|
-
meshCoordinatorSessionId: readNonEmptyString2(payload.meshCoordinatorSessionId) || readNonEmptyString2(payload.targetCoordinatorSessionId),
|
|
43846
|
-
// Carry the session identity fields the worker provider event emits so the
|
|
43847
|
-
// coordinator's mirror (updateMeshOwnedSession) gets a real workspace/title/
|
|
43848
|
-
// settings. Without these the remote-relay hop reconstructs metadataEvent with
|
|
43849
|
-
// an empty workspace, and the dashboard flaps to the generic
|
|
43850
|
-
// "Terminal (Mesh Node)" title (and degrades the provider label) between live
|
|
43851
|
-
// events and the periodic get_status_metadata snapshot. The local in-process
|
|
43852
|
-
// forward path (onMeshCoordinatorEventForwarded) already preserves these; this
|
|
43853
|
-
// mirrors them for the remote-only relay path.
|
|
43854
|
-
workspace: readNonEmptyString2(payload.workspace) || readNonEmptyString2(payload.workspaceName),
|
|
43855
|
-
workspaceName: readNonEmptyString2(payload.workspaceName) || readNonEmptyString2(payload.workspace),
|
|
43856
|
-
sessionTitle: readNonEmptyString2(payload.sessionTitle),
|
|
43857
|
-
sessionStatus: readNonEmptyString2(payload.sessionStatus),
|
|
43858
|
-
sessionChatStatus: readNonEmptyString2(payload.sessionChatStatus),
|
|
43859
|
-
providerName: readNonEmptyString2(payload.providerName),
|
|
43860
|
-
...payload.sessionSettings && typeof payload.sessionSettings === "object" && !Array.isArray(payload.sessionSettings) ? { sessionSettings: payload.sessionSettings } : {},
|
|
43861
|
-
finalSummary: readNonEmptyString2(payload.finalSummary) || readNonEmptyString2(payload.summary),
|
|
43862
|
-
// T2: carry the worker's status-snapshot last-message preview across the machine
|
|
43863
|
-
// boundary so a summary-less completion still surfaces the assistant reply in the
|
|
43864
|
-
// coordinator's inbox mirror. resolveMeshSurfacedSessionPreview reads these
|
|
43865
|
-
// (assistant-role only) when finalSummary is absent.
|
|
43866
|
-
lastMessagePreview: readNonEmptyString2(payload.lastMessagePreview),
|
|
43867
|
-
lastMessageRole: readNonEmptyString2(payload.lastMessageRole),
|
|
43868
|
-
...payload.lastMessageAt !== void 0 ? { lastMessageAt: payload.lastMessageAt } : {},
|
|
43869
|
-
jobId: readNonEmptyString2(payload.jobId),
|
|
43870
|
-
interactionId: readNonEmptyString2(payload.interactionId),
|
|
43871
|
-
status: readNonEmptyString2(payload.status),
|
|
43872
|
-
targetDaemonId: readNonEmptyString2(payload.targetDaemonId),
|
|
43873
|
-
startedAt: readNonEmptyString2(payload.startedAt),
|
|
43874
|
-
completedAt: readNonEmptyString2(payload.completedAt),
|
|
43875
|
-
retryOfJobId: readNonEmptyString2(payload.retryOfJobId),
|
|
43876
|
-
...relayModalMessage ? { modalMessage: relayModalMessage } : {},
|
|
43877
|
-
...relayModalButtons && relayModalButtons.length > 0 ? { modalButtons: relayModalButtons } : {},
|
|
43878
|
-
...payload.result && typeof payload.result === "object" && !Array.isArray(payload.result) ? { result: payload.result } : {},
|
|
43879
|
-
...payload.completionDiagnostic && typeof payload.completionDiagnostic === "object" && !Array.isArray(payload.completionDiagnostic) ? { completionDiagnostic: payload.completionDiagnostic } : {},
|
|
43880
|
-
...payload.workerResult && typeof payload.workerResult === "object" && !Array.isArray(payload.workerResult) ? { workerResult: payload.workerResult } : {},
|
|
43881
|
-
...payload.meshWorkerResult && typeof payload.meshWorkerResult === "object" && !Array.isArray(payload.meshWorkerResult) ? { meshWorkerResult: payload.meshWorkerResult } : {},
|
|
43882
|
-
...payload.structuredResult && typeof payload.structuredResult === "object" && !Array.isArray(payload.structuredResult) ? { structuredResult: payload.structuredResult } : {},
|
|
43883
|
-
...payload.timestamp !== void 0 ? { timestamp: payload.timestamp } : {},
|
|
43884
|
-
intentional: payload.intentional === true,
|
|
43885
|
-
intentionalStop: payload.intentionalStop === true,
|
|
43886
|
-
operatorCleanup: payload.operatorCleanup === true,
|
|
43887
|
-
reason: readNonEmptyString2(payload.reason),
|
|
43888
|
-
stopReason: readNonEmptyString2(payload.stopReason),
|
|
43889
|
-
cleanupReason: readNonEmptyString2(payload.cleanupReason),
|
|
43890
|
-
source: readNonEmptyString2(payload.source)
|
|
43891
|
-
}
|
|
43919
|
+
metadataEvent: buildRelayMetadataEvent(payload)
|
|
43892
43920
|
});
|
|
43893
43921
|
}
|
|
43894
43922
|
function forwardUnresolvedDelegateEvent(components, routing, event) {
|
|
@@ -49315,6 +49343,7 @@ ${lastSnapshot}`;
|
|
|
49315
49343
|
evaluateCondition: () => evaluateCondition,
|
|
49316
49344
|
extractButtonsFromRule: () => extractButtonsFromRule,
|
|
49317
49345
|
extractTitle: () => extractTitle,
|
|
49346
|
+
lastContiguousNumberedBlock: () => lastContiguousNumberedBlock,
|
|
49318
49347
|
resolveSections: () => resolveSections,
|
|
49319
49348
|
sectionText: () => sectionText
|
|
49320
49349
|
});
|
|
@@ -49555,7 +49584,6 @@ ${lastSnapshot}`;
|
|
|
49555
49584
|
label += " " + next.trim();
|
|
49556
49585
|
j += 1;
|
|
49557
49586
|
}
|
|
49558
|
-
if (buttons.some((b) => b.index === idx)) continue;
|
|
49559
49587
|
const key = keyTemplate.replace(/\{index\}/g, String(idx));
|
|
49560
49588
|
buttons.push({ index: idx, label, key, current });
|
|
49561
49589
|
i = j - 1;
|
|
@@ -49567,13 +49595,22 @@ ${lastSnapshot}`;
|
|
|
49567
49595
|
const idx = Number(m[1]);
|
|
49568
49596
|
const label = String(m[2] ?? "").trim();
|
|
49569
49597
|
if (!Number.isFinite(idx) || idx <= 0 || !label) continue;
|
|
49570
|
-
if (buttons.some((b) => b.index === idx)) continue;
|
|
49571
49598
|
const key = keyTemplate.replace(/\{index\}/g, String(idx));
|
|
49572
49599
|
buttons.push({ index: idx, label, key, current: hasCursorMarker(m[0]) });
|
|
49573
49600
|
}
|
|
49574
49601
|
}
|
|
49575
|
-
|
|
49576
|
-
|
|
49602
|
+
const block2 = lastContiguousNumberedBlock(buttons);
|
|
49603
|
+
block2.sort((a, b) => a.index - b.index);
|
|
49604
|
+
return block2;
|
|
49605
|
+
}
|
|
49606
|
+
function lastContiguousNumberedBlock(entries) {
|
|
49607
|
+
if (entries.length <= 1) return entries.slice();
|
|
49608
|
+
let start = entries.length - 1;
|
|
49609
|
+
for (let i = entries.length - 1; i > 0; i -= 1) {
|
|
49610
|
+
if (entries[i - 1].index === entries[i].index - 1) start = i - 1;
|
|
49611
|
+
else break;
|
|
49612
|
+
}
|
|
49613
|
+
return entries.slice(start);
|
|
49577
49614
|
}
|
|
49578
49615
|
function hasCursorMarker(text) {
|
|
49579
49616
|
return /^\s*[❯›>]/.test(text);
|
|
@@ -49606,6 +49643,11 @@ ${lastSnapshot}`;
|
|
|
49606
49643
|
if (state.id === "busy" || state.id === "generating") return "generating";
|
|
49607
49644
|
return "idle";
|
|
49608
49645
|
}
|
|
49646
|
+
function modalKindForState(state) {
|
|
49647
|
+
if (state.modal_kind) return state.modal_kind;
|
|
49648
|
+
if (state.modal) return "approval";
|
|
49649
|
+
return null;
|
|
49650
|
+
}
|
|
49609
49651
|
var init_fsm_types = __esm2({
|
|
49610
49652
|
"src/providers/spec/fsm-types.ts"() {
|
|
49611
49653
|
"use strict";
|
|
@@ -63368,7 +63410,12 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
63368
63410
|
this.emit({
|
|
63369
63411
|
kind: "state_changed",
|
|
63370
63412
|
state: next.state,
|
|
63371
|
-
|
|
63413
|
+
// kind is the SEMANTIC modal class (approval vs picker/confirm)
|
|
63414
|
+
// derived from the FSM state, NOT from the parsed buttons — the
|
|
63415
|
+
// status field already collapsed it to 'approval' so the modal is
|
|
63416
|
+
// surfaced. The auto-approve worker needs the distinction back to
|
|
63417
|
+
// avoid answering a /model picker on the user's behalf.
|
|
63418
|
+
modal: next.modal ? { title: next.modal.title, buttons: next.modal.buttons.map((b) => ({ index: b.index, label: b.label })), kind: modalKindForState(state) } : null,
|
|
63372
63419
|
controls: next.controls.map((c) => ({ id: c.id, label: c.label, action_type: c.actionType }))
|
|
63373
63420
|
});
|
|
63374
63421
|
this.fireNotifications(state.id, title);
|
|
@@ -63849,6 +63896,7 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
63849
63896
|
return;
|
|
63850
63897
|
}
|
|
63851
63898
|
}
|
|
63899
|
+
init_evaluator();
|
|
63852
63900
|
var fs13 = __toESM2(require("fs"));
|
|
63853
63901
|
var os18 = __toESM2(require("os"));
|
|
63854
63902
|
var path222 = __toESM2(require("path"));
|
|
@@ -64784,7 +64832,9 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
64784
64832
|
messages: [],
|
|
64785
64833
|
// Surface buttons when we have them; an approval state with no parsed
|
|
64786
64834
|
// modal this frame still stays waiting_approval (no activeModal yet).
|
|
64787
|
-
|
|
64835
|
+
// `kind` carries the semantic modal class through to the auto-approve
|
|
64836
|
+
// gate so a /model picker (kind='picker') is never auto-answered.
|
|
64837
|
+
activeModal: modal ? { message: modal.title ?? state.label, buttons: modal.buttons.map((b) => b.label), kind: modal.kind ?? null } : null,
|
|
64788
64838
|
activeInteractivePrompt: this.activeInteractivePrompt,
|
|
64789
64839
|
...sessionFields
|
|
64790
64840
|
};
|
|
@@ -65058,21 +65108,19 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
65058
65108
|
const ec = action.extract_choices;
|
|
65059
65109
|
if (!ec?.pattern) return [];
|
|
65060
65110
|
const text = this.readScreenSectionText(ec.section);
|
|
65061
|
-
const
|
|
65062
|
-
const seen = /* @__PURE__ */ new Set();
|
|
65111
|
+
const all = [];
|
|
65063
65112
|
for (const rawLine of text.split("\n")) {
|
|
65064
65113
|
const line = rawLine.replace(/\r$/, "");
|
|
65065
65114
|
const m = new RegExp(ec.pattern, ec.flags ?? "").exec(line);
|
|
65066
65115
|
if (!m) continue;
|
|
65067
65116
|
const idx = Number(m[1]);
|
|
65068
|
-
if (!Number.isFinite(idx) ||
|
|
65117
|
+
if (!Number.isFinite(idx) || idx <= 0) continue;
|
|
65069
65118
|
const label = (m[2] ?? "").replace(/\s+/g, " ").trim();
|
|
65070
65119
|
if (!label) continue;
|
|
65071
65120
|
const current = /^\s*[❯›>]/.test(line) || /[✔✓●]\s*$/.test(label);
|
|
65072
|
-
|
|
65073
|
-
out.push({ index: idx, label, current });
|
|
65121
|
+
all.push({ index: idx, label, current });
|
|
65074
65122
|
}
|
|
65075
|
-
return
|
|
65123
|
+
return lastContiguousNumberedBlock(all);
|
|
65076
65124
|
}
|
|
65077
65125
|
/** Live text of a named screen section (or the whole screen when no
|
|
65078
65126
|
* section is named), resolved from the driver's current sections. */
|
|
@@ -66739,8 +66787,12 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
66739
66787
|
if (!modal || buttons.length === 0) {
|
|
66740
66788
|
return autoApproveActive;
|
|
66741
66789
|
}
|
|
66742
|
-
const
|
|
66743
|
-
if (
|
|
66790
|
+
const modalKind = typeof modal?.kind === "string" ? modal.kind : "approval";
|
|
66791
|
+
if (modalKind !== "approval") {
|
|
66792
|
+
return autoApproveActive;
|
|
66793
|
+
}
|
|
66794
|
+
const { index: buttonIndex, label: buttonLabel } = pickApprovalButton(buttons, this.provider);
|
|
66795
|
+
if (buttonIndex < 0 || !hasNegativeApprovalOption(buttons)) {
|
|
66744
66796
|
return autoApproveActive;
|
|
66745
66797
|
}
|
|
66746
66798
|
const modalSignature = [
|