@adhdev/daemon-standalone 0.9.82-rc.16 → 0.9.82-rc.18
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 +61 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +2 -3
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -46075,6 +46075,36 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
|
|
|
46075
46075
|
isCached: false
|
|
46076
46076
|
};
|
|
46077
46077
|
}
|
|
46078
|
+
function readLiveMeshNodeWorkspace(args) {
|
|
46079
|
+
const directNodeWorkspace = args.liveSessionRecords.find((record2) => readStringValue(record2?.meta?.meshNodeId) === args.nodeId && readStringValue(record2?.workspace));
|
|
46080
|
+
if (directNodeWorkspace) {
|
|
46081
|
+
return readStringValue(directNodeWorkspace.workspace) || "";
|
|
46082
|
+
}
|
|
46083
|
+
if (args.allowCoordinatorSession) {
|
|
46084
|
+
const coordinatorWorkspace = args.liveSessionRecords.find((record2) => readStringValue(record2?.meta?.meshCoordinatorFor) === args.meshId && readStringValue(record2?.workspace));
|
|
46085
|
+
if (coordinatorWorkspace) {
|
|
46086
|
+
return readStringValue(coordinatorWorkspace.workspace) || "";
|
|
46087
|
+
}
|
|
46088
|
+
}
|
|
46089
|
+
return "";
|
|
46090
|
+
}
|
|
46091
|
+
function collectLiveMeshSessionRecords(args) {
|
|
46092
|
+
const matches = args.liveSessionRecords.filter((record2) => {
|
|
46093
|
+
if (readStringValue(record2?.meta?.meshNodeId) === args.nodeId) return true;
|
|
46094
|
+
const recordWorkspace = readStringValue(record2?.workspace);
|
|
46095
|
+
const nodeWorkspace = readStringValue(args.node?.workspace);
|
|
46096
|
+
return !!recordWorkspace && !!nodeWorkspace && recordWorkspace === nodeWorkspace;
|
|
46097
|
+
});
|
|
46098
|
+
if (args.allowCoordinatorSession) {
|
|
46099
|
+
for (const record2 of args.liveSessionRecords) {
|
|
46100
|
+
if (readStringValue(record2?.meta?.meshCoordinatorFor) !== args.meshId) continue;
|
|
46101
|
+
const sessionId = readStringValue(record2?.sessionId);
|
|
46102
|
+
if (sessionId && matches.some((entry) => readStringValue(entry?.sessionId) === sessionId)) continue;
|
|
46103
|
+
matches.push(record2);
|
|
46104
|
+
}
|
|
46105
|
+
}
|
|
46106
|
+
return matches;
|
|
46107
|
+
}
|
|
46078
46108
|
function applyCachedInlineMeshNodeStatus(status, node) {
|
|
46079
46109
|
const cachedStatus = readObjectRecord(node?.cachedStatus);
|
|
46080
46110
|
const git = buildCachedInlineMeshGitStatus(node);
|
|
@@ -48027,7 +48057,14 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
|
|
|
48027
48057
|
cliType
|
|
48028
48058
|
};
|
|
48029
48059
|
}
|
|
48030
|
-
const
|
|
48060
|
+
const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
|
|
48061
|
+
const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
|
|
48062
|
+
const workspace = readLiveMeshNodeWorkspace({
|
|
48063
|
+
meshId,
|
|
48064
|
+
nodeId: String(coordinatorNode.id || coordinatorNode.nodeId || preferredCoordinatorNodeId || ""),
|
|
48065
|
+
liveSessionRecords: liveMeshSessions,
|
|
48066
|
+
allowCoordinatorSession: true
|
|
48067
|
+
}) || (typeof coordinatorNode.workspace === "string" ? coordinatorNode.workspace.trim() : "");
|
|
48031
48068
|
if (!workspace) return { success: false, error: "Coordinator node workspace required", meshId, cliType };
|
|
48032
48069
|
if (!cliType) {
|
|
48033
48070
|
const resolved = await resolveProviderTypeFromPriority({
|
|
@@ -48338,7 +48375,12 @@ ${block}`);
|
|
|
48338
48375
|
const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
|
|
48339
48376
|
const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
|
|
48340
48377
|
const localMachineId = loadConfig2().machineId || "";
|
|
48341
|
-
const
|
|
48378
|
+
const selectedCoordinatorNodeId = readStringValue(
|
|
48379
|
+
mesh.coordinator?.preferredNodeId,
|
|
48380
|
+
mesh.nodes?.[0]?.id,
|
|
48381
|
+
mesh.nodes?.[0]?.nodeId
|
|
48382
|
+
);
|
|
48383
|
+
const inlineCoordinatorNodeId = meshRecord?.inline && Array.isArray(mesh.nodes) ? selectedCoordinatorNodeId : void 0;
|
|
48342
48384
|
const refreshedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
48343
48385
|
const nodeStatuses = [];
|
|
48344
48386
|
for (const [nodeIndex, node] of (mesh.nodes || []).entries()) {
|
|
@@ -48397,7 +48439,20 @@ ${block}`);
|
|
|
48397
48439
|
reason: "Node has no daemon id, so mesh transport cannot be reported from the selected coordinator."
|
|
48398
48440
|
};
|
|
48399
48441
|
}
|
|
48400
|
-
const matchedLiveSessionRecords =
|
|
48442
|
+
const matchedLiveSessionRecords = collectLiveMeshSessionRecords({
|
|
48443
|
+
meshId,
|
|
48444
|
+
node,
|
|
48445
|
+
nodeId,
|
|
48446
|
+
liveSessionRecords: liveMeshSessions,
|
|
48447
|
+
allowCoordinatorSession: nodeId === selectedCoordinatorNodeId
|
|
48448
|
+
});
|
|
48449
|
+
const workspace = readLiveMeshNodeWorkspace({
|
|
48450
|
+
meshId,
|
|
48451
|
+
nodeId,
|
|
48452
|
+
liveSessionRecords: matchedLiveSessionRecords,
|
|
48453
|
+
allowCoordinatorSession: nodeId === selectedCoordinatorNodeId
|
|
48454
|
+
}) || (typeof node.workspace === "string" ? node.workspace : "");
|
|
48455
|
+
status.workspace = workspace || node.workspace;
|
|
48401
48456
|
if (matchedLiveSessionRecords.length > 0) {
|
|
48402
48457
|
const sessionIds = matchedLiveSessionRecords.map((record2) => typeof record2?.sessionId === "string" ? record2.sessionId : "").filter(Boolean);
|
|
48403
48458
|
const providerTypes = matchedLiveSessionRecords.map((record2) => readStringValue(record2?.providerType)).filter(Boolean);
|
|
@@ -48407,14 +48462,14 @@ ${block}`);
|
|
|
48407
48462
|
status.providers = Array.from(/* @__PURE__ */ new Set([...Array.isArray(status.providers) ? status.providers : [], ...providerTypes]));
|
|
48408
48463
|
}
|
|
48409
48464
|
}
|
|
48410
|
-
if (
|
|
48411
|
-
if (!fs10.existsSync(
|
|
48465
|
+
if (workspace) {
|
|
48466
|
+
if (!fs10.existsSync(workspace) && applyCachedInlineMeshNodeStatus(status, node)) {
|
|
48412
48467
|
status.launchReady = !!daemonId && (readStringValue(status.machineStatus) === "online" || isSelfNode);
|
|
48413
48468
|
nodeStatuses.push(status);
|
|
48414
48469
|
continue;
|
|
48415
48470
|
}
|
|
48416
48471
|
try {
|
|
48417
|
-
const gitStatus = await getGitRepoStatus(
|
|
48472
|
+
const gitStatus = await getGitRepoStatus(workspace, { timeoutMs: 1e4, refreshUpstream: true });
|
|
48418
48473
|
status.git = gitStatus;
|
|
48419
48474
|
if (gitStatus.isGitRepo) {
|
|
48420
48475
|
status.health = deriveMeshNodeHealthFromGit(gitStatus);
|