@adhdev/daemon-core 0.9.82-rc.225 → 0.9.82-rc.227
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 +22 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -9
- package/dist/index.mjs.map +1 -1
- package/dist/sessions/registry.d.ts +3 -0
- package/package.json +1 -1
- package/src/commands/cli-manager.ts +2 -0
- package/src/mesh/coordinator-prompt.ts +1 -0
- package/src/mesh/mesh-events-coordinator.ts +11 -0
- package/src/providers/cli-provider-instance.ts +11 -8
- package/src/sessions/registry.ts +3 -0
package/dist/index.js
CHANGED
|
@@ -1887,6 +1887,7 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
1887
1887
|
- **Refinery is config-driven.** \`mesh_refine_node\` must run validation from \`.adhdev/refine.{json,yaml,yml}\` or \`repo-mesh.refine.*\`. Heuristics are scaffolding only.
|
|
1888
1888
|
- **Submodule reachability = publish-needed.** \`submodule_reachability_failed\` \u2192 classify as \`blocked_review\`, request user approval to push to submodule main, then rerun \`mesh_refine_node\`.
|
|
1889
1889
|
- **Honor per-node instructions.** When a node carries a \u{1F4CC} Node instruction in the nodes section, include the relevant parts of that instruction in the task message you send to that node. Don't paraphrase the instruction into your own words \u2014 quote it verbatim so the worker agent sees exactly what the user wrote.
|
|
1890
|
+
- **Mission status does not update itself.** When a mission's tasks are all done or the work is abandoned, explicitly call \`mesh_mission_upsert\` to set status \`completed\` or \`abandoned\`. Never leave a finished mission in \`active\`. All-cancelled tasks with no further work \u2192 \`abandoned\`.
|
|
1890
1891
|
- **Never fabricate tool results.** Always call the actual tool.
|
|
1891
1892
|
- **Keep the user informed.** One or two sentences after each delegation round.${coordinatorNote}`;
|
|
1892
1893
|
}
|
|
@@ -6694,6 +6695,13 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
|
|
|
6694
6695
|
return true;
|
|
6695
6696
|
}
|
|
6696
6697
|
}
|
|
6698
|
+
try {
|
|
6699
|
+
const inst = components.instanceManager.getInstance(sessionId);
|
|
6700
|
+
if (inst && typeof inst.updateSettings === "function") {
|
|
6701
|
+
inst.updateSettings({ meshNodeFor: meshId, meshNodeId: nodeId, launchedByCoordinator: true });
|
|
6702
|
+
}
|
|
6703
|
+
} catch {
|
|
6704
|
+
}
|
|
6697
6705
|
const delivery = createSessionDelivery({
|
|
6698
6706
|
meshId,
|
|
6699
6707
|
nodeId,
|
|
@@ -30599,7 +30607,8 @@ var CliProviderInstance = class {
|
|
|
30599
30607
|
typeof adapterStatus?.providerSessionId === "string" ? adapterStatus.providerSessionId : ""
|
|
30600
30608
|
);
|
|
30601
30609
|
const autoApproveActive = this.maybeAutoApproveStatus(adapterStatus, Date.now());
|
|
30602
|
-
|
|
30610
|
+
const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
|
|
30611
|
+
let visibleStatus = parseErrorMessage || parsedStatus?.status === "error" ? "error" : autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
|
|
30603
30612
|
const externalNativeFinal = this.getExternalNativeFinalReconciliation(parsedStatus?.messages, adapterStatus);
|
|
30604
30613
|
if (externalNativeFinal && isCliGeneratingLikeStatus(visibleStatus)) {
|
|
30605
30614
|
visibleStatus = "idle";
|
|
@@ -30686,7 +30695,7 @@ var CliProviderInstance = class {
|
|
|
30686
30695
|
summaryMetadata: this.summaryMetadata,
|
|
30687
30696
|
controlValues: this.controlValues
|
|
30688
30697
|
});
|
|
30689
|
-
const activeChatStatus = parseErrorMessage ? "error" : autoApproveActive && parsedStatus?.status === "waiting_approval" ? "generating" : adapterStatus.status !== "idle" ? visibleStatus : suppressStaleParsedBusyStatus ? visibleStatus : parsedChatStatus || visibleStatus;
|
|
30698
|
+
const activeChatStatus = parseErrorMessage ? "error" : autoApproveActive && parsedStatus?.status === "waiting_approval" || autoApproveHoldIdle ? "generating" : adapterStatus.status !== "idle" ? visibleStatus : suppressStaleParsedBusyStatus ? visibleStatus : parsedChatStatus || visibleStatus;
|
|
30690
30699
|
const hasInteractivePrompt = !!this.activeInteractivePrompt;
|
|
30691
30700
|
const finalStatus = hasInteractivePrompt ? "waiting_choice" : visibleStatus;
|
|
30692
30701
|
const finalChatStatus = hasInteractivePrompt ? "waiting_choice" : activeChatStatus;
|
|
@@ -30701,7 +30710,7 @@ var CliProviderInstance = class {
|
|
|
30701
30710
|
title: parsedStatus?.title || dirName,
|
|
30702
30711
|
status: finalChatStatus,
|
|
30703
30712
|
messages: statusMessages,
|
|
30704
|
-
activeModal: autoApproveActive ? null : parsedStatus?.activeModal ?? adapterStatus.activeModal,
|
|
30713
|
+
activeModal: autoApproveActive || autoApproveHoldIdle ? null : parsedStatus?.activeModal ?? adapterStatus.activeModal,
|
|
30705
30714
|
activeInteractivePrompt: this.activeInteractivePrompt,
|
|
30706
30715
|
inputContent: ""
|
|
30707
30716
|
},
|
|
@@ -30743,7 +30752,8 @@ var CliProviderInstance = class {
|
|
|
30743
30752
|
getHotChatSessionState() {
|
|
30744
30753
|
const adapterStatus = this.adapter.getStatus({ allowParse: false });
|
|
30745
30754
|
const autoApproveActive = adapterStatus.status === "waiting_approval" && this.shouldAutoApprove();
|
|
30746
|
-
const
|
|
30755
|
+
const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
|
|
30756
|
+
const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
|
|
30747
30757
|
const runtime = this.adapter.getRuntimeMetadata();
|
|
30748
30758
|
return {
|
|
30749
30759
|
id: this.instanceId,
|
|
@@ -30757,7 +30767,8 @@ var CliProviderInstance = class {
|
|
|
30757
30767
|
getSessionModalState(sessionId) {
|
|
30758
30768
|
const adapterStatus = this.adapter.getStatus({ allowParse: true });
|
|
30759
30769
|
const autoApproveActive = adapterStatus.status === "waiting_approval" && this.shouldAutoApprove();
|
|
30760
|
-
const
|
|
30770
|
+
const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
|
|
30771
|
+
const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
|
|
30761
30772
|
const dirName = this.workingDir.split("/").filter(Boolean).pop() || "session";
|
|
30762
30773
|
return {
|
|
30763
30774
|
// Honor the caller-supplied sessionId — InstanceMgr rejects the
|
|
@@ -30767,7 +30778,7 @@ var CliProviderInstance = class {
|
|
|
30767
30778
|
id: sessionId ?? this.instanceId,
|
|
30768
30779
|
status: visibleStatus,
|
|
30769
30780
|
title: dirName,
|
|
30770
|
-
activeModal: autoApproveActive ? null : adapterStatus.activeModal
|
|
30781
|
+
activeModal: autoApproveActive || autoApproveHoldIdle ? null : adapterStatus.activeModal
|
|
30771
30782
|
};
|
|
30772
30783
|
}
|
|
30773
30784
|
updateSettings(newSettings) {
|
|
@@ -31225,7 +31236,7 @@ var CliProviderInstance = class {
|
|
|
31225
31236
|
const latestStatus = this.adapter.getStatus({ allowParse: false });
|
|
31226
31237
|
const latestAutoApproveActive = latestStatus.status === "waiting_approval" && this.shouldAutoApprove();
|
|
31227
31238
|
const externalNativeFinal = this.getExternalNativeFinalReconciliation(void 0, latestStatus);
|
|
31228
|
-
const latestVisibleStatus = externalNativeFinal && isCliGeneratingLikeStatus(latestStatus.status) ? "idle" : latestAutoApproveActive ? "generating" : latestStatus.status;
|
|
31239
|
+
const latestVisibleStatus = externalNativeFinal && isCliGeneratingLikeStatus(latestStatus.status) ? "idle" : latestAutoApproveActive || this.autoApproveBusy ? "generating" : latestStatus.status;
|
|
31229
31240
|
LOG.debug("CLI", `[${this.type}] flush attempt: adapterStatus=${latestStatus.status} latestVisible=${latestVisibleStatus} externalNativeFinal=${!!externalNativeFinal} generatingStartedAt=${this.generatingStartedAt} isWaitingForResponse=${!!this.adapter?.isWaitingForResponse} hasPartial=${!!this.adapter.getPartialResponse?.()}`);
|
|
31230
31241
|
if (latestVisibleStatus !== "idle") {
|
|
31231
31242
|
LOG.info("CLI", `[${this.type}] cancelled pending completed (resumed ${latestVisibleStatus})`);
|
|
@@ -31321,7 +31332,7 @@ var CliProviderInstance = class {
|
|
|
31321
31332
|
this.autoApproveBusy = false;
|
|
31322
31333
|
this.autoApproveBusyTimer = null;
|
|
31323
31334
|
this.lastAutoApprovalSignature = "";
|
|
31324
|
-
},
|
|
31335
|
+
}, 5e3);
|
|
31325
31336
|
this.recordAutoApproval(modal?.message, buttonLabel, now);
|
|
31326
31337
|
setTimeout(() => {
|
|
31327
31338
|
this.adapter.resolveModal(buttonIndex);
|
|
@@ -33697,6 +33708,7 @@ var DaemonCliManager = class {
|
|
|
33697
33708
|
transport: "pty",
|
|
33698
33709
|
adapterKey: key,
|
|
33699
33710
|
instanceKey: key,
|
|
33711
|
+
workspace: resolvedDir,
|
|
33700
33712
|
// attachExisting === true means we're restoring an already-spawned
|
|
33701
33713
|
// hosted runtime after a daemon restart, not starting a fresh PTY.
|
|
33702
33714
|
// The real spawn time is in the past and we don't have it on the
|
|
@@ -33760,7 +33772,8 @@ ${installInfo}`
|
|
|
33760
33772
|
providerType: normalizedType,
|
|
33761
33773
|
transport: "acp",
|
|
33762
33774
|
adapterKey: key,
|
|
33763
|
-
instanceKey: key
|
|
33775
|
+
instanceKey: key,
|
|
33776
|
+
workspace: resolvedDir
|
|
33764
33777
|
});
|
|
33765
33778
|
this.adapters.set(key, {
|
|
33766
33779
|
cliType: normalizedType,
|