@adhdev/daemon-core 0.9.82-rc.226 → 0.9.82-rc.228
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 +47 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -8
- 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/commands/router.ts +43 -2
- package/src/providers/cli-provider-instance.ts +2 -2
- package/src/sessions/registry.ts +3 -0
- package/src/status/builders.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -22768,7 +22768,7 @@ function buildCliSession(state, options) {
|
|
|
22768
22768
|
mode: state.mode,
|
|
22769
22769
|
resume: state.resume,
|
|
22770
22770
|
activeChat,
|
|
22771
|
-
|
|
22771
|
+
activeInteractivePrompt: state.activeInteractivePrompt ?? null,
|
|
22772
22772
|
...summaryMetadata && { summaryMetadata },
|
|
22773
22773
|
...includeSessionMetadata && {
|
|
22774
22774
|
capabilities: state.mode === "terminal" ? PTY_SESSION_CAPABILITIES : CLI_CHAT_SESSION_CAPABILITIES,
|
|
@@ -22783,7 +22783,8 @@ function buildCliSession(state, options) {
|
|
|
22783
22783
|
lastUpdated: state.lastUpdated,
|
|
22784
22784
|
settings: state.settings,
|
|
22785
22785
|
...coordinator && { coordinator },
|
|
22786
|
-
...meshQueueStats && { meshQueueStats }
|
|
22786
|
+
...meshQueueStats && { meshQueueStats },
|
|
22787
|
+
...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
|
|
22787
22788
|
};
|
|
22788
22789
|
}
|
|
22789
22790
|
function buildAcpSession(state, options) {
|
|
@@ -22823,7 +22824,8 @@ function buildAcpSession(state, options) {
|
|
|
22823
22824
|
lastUpdated: state.lastUpdated,
|
|
22824
22825
|
settings: state.settings,
|
|
22825
22826
|
...coordinator && { coordinator },
|
|
22826
|
-
...meshQueueStats && { meshQueueStats }
|
|
22827
|
+
...meshQueueStats && { meshQueueStats },
|
|
22828
|
+
...state.settings?.spawnedSessionVisibility === "hidden" && { surfaceHidden: true }
|
|
22827
22829
|
};
|
|
22828
22830
|
}
|
|
22829
22831
|
function buildSessionEntries(allStates, cdpManagers, options = {}) {
|
|
@@ -31236,7 +31238,7 @@ var CliProviderInstance = class {
|
|
|
31236
31238
|
const latestStatus = this.adapter.getStatus({ allowParse: false });
|
|
31237
31239
|
const latestAutoApproveActive = latestStatus.status === "waiting_approval" && this.shouldAutoApprove();
|
|
31238
31240
|
const externalNativeFinal = this.getExternalNativeFinalReconciliation(void 0, latestStatus);
|
|
31239
|
-
const latestVisibleStatus = externalNativeFinal && isCliGeneratingLikeStatus(latestStatus.status) ? "idle" : latestAutoApproveActive ? "generating" : latestStatus.status;
|
|
31241
|
+
const latestVisibleStatus = externalNativeFinal && isCliGeneratingLikeStatus(latestStatus.status) ? "idle" : latestAutoApproveActive || this.autoApproveBusy ? "generating" : latestStatus.status;
|
|
31240
31242
|
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?.()}`);
|
|
31241
31243
|
if (latestVisibleStatus !== "idle") {
|
|
31242
31244
|
LOG.info("CLI", `[${this.type}] cancelled pending completed (resumed ${latestVisibleStatus})`);
|
|
@@ -31332,7 +31334,7 @@ var CliProviderInstance = class {
|
|
|
31332
31334
|
this.autoApproveBusy = false;
|
|
31333
31335
|
this.autoApproveBusyTimer = null;
|
|
31334
31336
|
this.lastAutoApprovalSignature = "";
|
|
31335
|
-
},
|
|
31337
|
+
}, 5e3);
|
|
31336
31338
|
this.recordAutoApproval(modal?.message, buttonLabel, now);
|
|
31337
31339
|
setTimeout(() => {
|
|
31338
31340
|
this.adapter.resolveModal(buttonIndex);
|
|
@@ -33708,6 +33710,7 @@ var DaemonCliManager = class {
|
|
|
33708
33710
|
transport: "pty",
|
|
33709
33711
|
adapterKey: key,
|
|
33710
33712
|
instanceKey: key,
|
|
33713
|
+
workspace: resolvedDir,
|
|
33711
33714
|
// attachExisting === true means we're restoring an already-spawned
|
|
33712
33715
|
// hosted runtime after a daemon restart, not starting a fresh PTY.
|
|
33713
33716
|
// The real spawn time is in the past and we don't have it on the
|
|
@@ -33771,7 +33774,8 @@ ${installInfo}`
|
|
|
33771
33774
|
providerType: normalizedType,
|
|
33772
33775
|
transport: "acp",
|
|
33773
33776
|
adapterKey: key,
|
|
33774
|
-
instanceKey: key
|
|
33777
|
+
instanceKey: key,
|
|
33778
|
+
workspace: resolvedDir
|
|
33775
33779
|
});
|
|
33776
33780
|
this.adapters.set(key, {
|
|
33777
33781
|
cliType: normalizedType,
|
|
@@ -43791,14 +43795,27 @@ ${tail}` : ""
|
|
|
43791
43795
|
const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
|
|
43792
43796
|
let workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
|
|
43793
43797
|
let submoduleIgnorePaths = Array.isArray(args?.submoduleIgnorePaths) ? args.submoduleIgnorePaths.filter((value) => typeof value === "string") : void 0;
|
|
43794
|
-
|
|
43798
|
+
let nodeDaemonId;
|
|
43799
|
+
if (meshId && nodeId) {
|
|
43795
43800
|
const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh);
|
|
43796
43801
|
const mesh = meshRecord?.mesh;
|
|
43797
43802
|
const node = mesh?.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
|
|
43798
|
-
|
|
43803
|
+
if (!workspace) {
|
|
43804
|
+
workspace = typeof node?.workspace === "string" ? node.workspace.trim() : "";
|
|
43805
|
+
}
|
|
43799
43806
|
if (!submoduleIgnorePaths && Array.isArray(node?.policy?.submoduleIgnorePaths)) {
|
|
43800
43807
|
submoduleIgnorePaths = node.policy.submoduleIgnorePaths.filter((value) => typeof value === "string");
|
|
43801
43808
|
}
|
|
43809
|
+
nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
43810
|
+
}
|
|
43811
|
+
const selfDaemonId = this.deps.statusInstanceId;
|
|
43812
|
+
const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
|
|
43813
|
+
if (isRemote && this.deps.dispatchMeshCommand) {
|
|
43814
|
+
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
|
|
43815
|
+
...typeof args === "object" && args !== null ? args : {},
|
|
43816
|
+
workspace
|
|
43817
|
+
});
|
|
43818
|
+
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43802
43819
|
}
|
|
43803
43820
|
const result = await fastForwardMeshNode({
|
|
43804
43821
|
meshId: meshId || void 0,
|
|
@@ -43836,6 +43853,14 @@ ${tail}` : ""
|
|
|
43836
43853
|
}
|
|
43837
43854
|
let worktreeCleanup;
|
|
43838
43855
|
if (node?.isLocalWorktree) {
|
|
43856
|
+
const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
43857
|
+
const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
|
|
43858
|
+
if (isRemoteWorktree) {
|
|
43859
|
+
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
|
|
43860
|
+
...typeof args === "object" && args !== null ? args : {}
|
|
43861
|
+
});
|
|
43862
|
+
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43863
|
+
}
|
|
43839
43864
|
const cleanupResult = await this.cleanupLocalWorktreeNode({ mesh, node, nodeId, force: args?.force === true });
|
|
43840
43865
|
if (cleanupResult.success === false) {
|
|
43841
43866
|
return {
|
|
@@ -43902,6 +43927,13 @@ ${tail}` : ""
|
|
|
43902
43927
|
if (!mesh) return { success: false, error: "Mesh not found" };
|
|
43903
43928
|
const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
|
|
43904
43929
|
if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
|
|
43930
|
+
const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
|
|
43931
|
+
if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
|
|
43932
|
+
const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
|
|
43933
|
+
...typeof args === "object" && args !== null ? args : {}
|
|
43934
|
+
});
|
|
43935
|
+
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43936
|
+
}
|
|
43905
43937
|
const repoRoot = sourceNode.repoRoot || sourceNode.workspace;
|
|
43906
43938
|
const { createWorktree: createWorktree2 } = await Promise.resolve().then(() => (init_git_worktree(), git_worktree_exports));
|
|
43907
43939
|
const result = await createWorktree2({
|
|
@@ -44134,6 +44166,13 @@ ${tail}` : ""
|
|
|
44134
44166
|
const node = mesh.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
|
|
44135
44167
|
if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
|
|
44136
44168
|
if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
|
|
44169
|
+
const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
44170
|
+
if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
|
|
44171
|
+
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
|
|
44172
|
+
...typeof args === "object" && args !== null ? args : {}
|
|
44173
|
+
});
|
|
44174
|
+
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
44175
|
+
}
|
|
44137
44176
|
const currentBootstrap = node.worktreeBootstrap;
|
|
44138
44177
|
if (currentBootstrap?.status === "running") {
|
|
44139
44178
|
return { success: false, error: "Bootstrap is already running for this node" };
|