@adhdev/daemon-standalone 0.9.82-rc.367 → 0.9.82-rc.368
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 +57 -11
- 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 ? "8cb6cfc5399f55c6b625095bacc9a27e1741df17" : void 0) ?? "unknown";
|
|
30040
|
+
const commitShort = readInjected(true ? "8cb6cfc5" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30041
|
+
const version2 = readInjected(true ? "0.9.82-rc.368" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30042
|
+
const builtAt = readInjected(true ? "2026-06-24T06:15:00.243Z" : void 0);
|
|
30043
30043
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30044
30044
|
return cached2;
|
|
30045
30045
|
}
|
|
@@ -42656,13 +42656,25 @@ ${cleanBody}`;
|
|
|
42656
42656
|
const mesh = getMeshWithCache(components, meshId);
|
|
42657
42657
|
const node = mesh?.nodes.find((n) => readMeshNodeId(n) === nodeId);
|
|
42658
42658
|
const localClaimAdapter = components.cliManager?.adapters?.get(sessionId);
|
|
42659
|
-
|
|
42660
|
-
|
|
42661
|
-
|
|
42662
|
-
|
|
42663
|
-
|
|
42659
|
+
let claimInstanceWorkspace = "";
|
|
42660
|
+
let claimStampedNodeId = "";
|
|
42661
|
+
try {
|
|
42662
|
+
const claimState = components.instanceManager?.getInstance?.(sessionId)?.getState?.();
|
|
42663
|
+
claimInstanceWorkspace = readNonEmptyString2(claimState?.workspace);
|
|
42664
|
+
const claimSettings = claimState?.settings || {};
|
|
42665
|
+
claimStampedNodeId = readNonEmptyString2(claimSettings.meshNodeId);
|
|
42666
|
+
} catch {
|
|
42667
|
+
}
|
|
42668
|
+
const nodeWorkspaceRaw = readNonEmptyString2(node?.workspace);
|
|
42669
|
+
const sessionWorkspaceRaw = readNonEmptyString2(localClaimAdapter?.workingDir) || claimInstanceWorkspace;
|
|
42670
|
+
if (claimStampedNodeId && nodeId) {
|
|
42671
|
+
if (!meshNodeIdMatches({ id: claimStampedNodeId }, nodeId)) {
|
|
42672
|
+
LOG2.info("MeshQueue", `WTDISPATCH: refusing claim for node ${nodeId} (${sessionId}) \u2014 session is bound to node "${claimStampedNodeId}" (cross-node claim blocked)`);
|
|
42664
42673
|
return false;
|
|
42665
42674
|
}
|
|
42675
|
+
} else if (sessionWorkspaceRaw && nodeWorkspaceRaw && !meshWorkspacesEquivalent(sessionWorkspaceRaw, nodeWorkspaceRaw)) {
|
|
42676
|
+
LOG2.info("MeshQueue", `WTCLAIM: refusing claim for node ${nodeId} (${sessionId}) \u2014 session workspace "${normalizeMeshWorkspaceForCompare(sessionWorkspaceRaw)}" \u2260 node workspace "${normalizeMeshWorkspaceForCompare(nodeWorkspaceRaw)}" (cross-workspace dispatch blocked)`);
|
|
42677
|
+
return false;
|
|
42666
42678
|
}
|
|
42667
42679
|
const capabilityTags = buildMeshNodeCapabilityTags(node, providerType);
|
|
42668
42680
|
const providerMaxParallel = resolveProviderMaxParallel(node?.policy, providerType);
|
|
@@ -43940,6 +43952,25 @@ ${cleanBody}`;
|
|
|
43940
43952
|
metadataEvent: buildRelayMetadataEvent(payload)
|
|
43941
43953
|
});
|
|
43942
43954
|
}
|
|
43955
|
+
function enqueueCoordinatorForwardPush(coordinatorDaemonId, run) {
|
|
43956
|
+
let lane = coordinatorForwardLanes.get(coordinatorDaemonId);
|
|
43957
|
+
if (!lane) {
|
|
43958
|
+
lane = { tail: Promise.resolve(), depth: 0 };
|
|
43959
|
+
coordinatorForwardLanes.set(coordinatorDaemonId, lane);
|
|
43960
|
+
}
|
|
43961
|
+
const wasIdle = lane.depth === 0;
|
|
43962
|
+
lane.depth += 1;
|
|
43963
|
+
const dec = () => {
|
|
43964
|
+
lane.depth -= 1;
|
|
43965
|
+
};
|
|
43966
|
+
if (wasIdle) {
|
|
43967
|
+
lane.tail = Promise.resolve(run()).catch(() => {
|
|
43968
|
+
}).then(dec, dec);
|
|
43969
|
+
} else {
|
|
43970
|
+
lane.tail = lane.tail.then(() => run()).catch(() => {
|
|
43971
|
+
}).then(dec, dec);
|
|
43972
|
+
}
|
|
43973
|
+
}
|
|
43943
43974
|
function forwardUnresolvedDelegateEvent(components, routing, event) {
|
|
43944
43975
|
const coordinatorDaemonId = readNonEmptyString2(routing.coordinatorDaemonId);
|
|
43945
43976
|
if (!coordinatorDaemonId) return false;
|
|
@@ -43971,7 +44002,8 @@ ${cleanBody}`;
|
|
|
43971
44002
|
};
|
|
43972
44003
|
traceMeshEventStage("outbox_enqueue", fwdTraceCtx, `coordinatorDaemon=${coordinatorDaemonId} meshId=absent`);
|
|
43973
44004
|
traceMeshEventStage("forward_send", fwdTraceCtx, "immediate push");
|
|
43974
|
-
|
|
44005
|
+
const dispatchMeshCommand = components.dispatchMeshCommand;
|
|
44006
|
+
enqueueCoordinatorForwardPush(coordinatorDaemonId, () => Promise.resolve(dispatchMeshCommand(coordinatorDaemonId, "mesh_forward_event", payload)).then((result) => {
|
|
43975
44007
|
if (result && result.success === false) {
|
|
43976
44008
|
LOG2.warn("MeshEvents", `Immediate forward of ${eventName} to coordinator ${coordinatorDaemonId} rejected (${readNonEmptyString2(result.error) || "no reason"}) \u2014 left queued for retry`);
|
|
43977
44009
|
traceMeshEventDrop("immediate_forward_rejected", fwdTraceCtx, readNonEmptyString2(result.error) || "no reason");
|
|
@@ -43980,7 +44012,7 @@ ${cleanBody}`;
|
|
|
43980
44012
|
if (persisted) ackUnresolvedDelegateForwardByFingerprint(coordinatorDaemonId, eventName, payload);
|
|
43981
44013
|
}).catch((e) => {
|
|
43982
44014
|
LOG2.warn("MeshEvents", `Immediate forward of ${eventName} to coordinator ${coordinatorDaemonId} failed: ${e?.message || e} \u2014 left queued for retry`);
|
|
43983
|
-
});
|
|
44015
|
+
}));
|
|
43984
44016
|
LOG2.info("MeshEvents", `Durably forwarded ${eventName} for unresolved-mesh worker at ${routing.workspace || "(no workspace)"} to coordinator daemon ${coordinatorDaemonId}`);
|
|
43985
44017
|
return true;
|
|
43986
44018
|
}
|
|
@@ -44081,6 +44113,7 @@ ${cleanBody}`;
|
|
|
44081
44113
|
var MESH_COORDINATOR_EVENTS;
|
|
44082
44114
|
var EVENT_TO_LEDGER_KIND;
|
|
44083
44115
|
var MESH_FORCE_INJECT_EVENTS;
|
|
44116
|
+
var coordinatorForwardLanes;
|
|
44084
44117
|
var init_mesh_events_coordinator = __esm2({
|
|
44085
44118
|
"src/mesh/mesh-events-coordinator.ts"() {
|
|
44086
44119
|
"use strict";
|
|
@@ -44145,6 +44178,7 @@ ${cleanBody}`;
|
|
|
44145
44178
|
"worktree_bootstrap_complete",
|
|
44146
44179
|
"worktree_bootstrap_failed"
|
|
44147
44180
|
]);
|
|
44181
|
+
coordinatorForwardLanes = /* @__PURE__ */ new Map();
|
|
44148
44182
|
}
|
|
44149
44183
|
});
|
|
44150
44184
|
function resolveAutoPruneMinAgeMs() {
|
|
@@ -71144,6 +71178,18 @@ ${rawInput}` : rawInput;
|
|
|
71144
71178
|
throw new Error(`Failed to start ${provider.displayName || provider.name || cliType}: ${spawnErr?.message}`);
|
|
71145
71179
|
}
|
|
71146
71180
|
this.adapters.set(key, cliInstance.getAdapter());
|
|
71181
|
+
const launchMeshNodeId = typeof settings?.meshNodeId === "string" ? settings.meshNodeId.trim() : "";
|
|
71182
|
+
const launchMeshNodeFor = typeof settings?.meshNodeFor === "string" ? settings.meshNodeFor.trim() : "";
|
|
71183
|
+
if (launchMeshNodeId || launchMeshNodeFor) {
|
|
71184
|
+
try {
|
|
71185
|
+
cliInstance.getAdapter().updateRuntimeMeta?.({
|
|
71186
|
+
...launchMeshNodeId ? { meshNodeId: launchMeshNodeId } : {},
|
|
71187
|
+
...launchMeshNodeFor ? { meshNodeFor: launchMeshNodeFor } : {},
|
|
71188
|
+
...settings?.launchedByCoordinator === true ? { launchedByCoordinator: true } : {}
|
|
71189
|
+
});
|
|
71190
|
+
} catch {
|
|
71191
|
+
}
|
|
71192
|
+
}
|
|
71147
71193
|
this.startCliExitMonitor(key, cliType);
|
|
71148
71194
|
}
|
|
71149
71195
|
// ─── Session start/management ──────────────────────────────
|