@adhdev/daemon-standalone 0.9.82-rc.303 → 0.9.82-rc.305
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 +40 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30004,10 +30004,10 @@ var require_dist3 = __commonJS({
|
|
|
30004
30004
|
}
|
|
30005
30005
|
function getDaemonBuildInfo() {
|
|
30006
30006
|
if (cached2) return cached2;
|
|
30007
|
-
const commit = readInjected(true ? "
|
|
30008
|
-
const commitShort = readInjected(true ? "
|
|
30009
|
-
const version2 = readInjected(true ? "0.9.82-rc.
|
|
30010
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
30007
|
+
const commit = readInjected(true ? "6103da081f92baaf891d3410e3d7ebc36d9e300d" : void 0) ?? "unknown";
|
|
30008
|
+
const commitShort = readInjected(true ? "6103da08" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30009
|
+
const version2 = readInjected(true ? "0.9.82-rc.305" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30010
|
+
const builtAt = readInjected(true ? "2026-06-17T06:08:38.971Z" : void 0);
|
|
30011
30011
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30012
30012
|
return cached2;
|
|
30013
30013
|
}
|
|
@@ -71863,6 +71863,15 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71863
71863
|
const connectionState = readStringValue(readObjectRecord(status.connection).state);
|
|
71864
71864
|
status.launchReady = !!daemonId && (readStringValue(status.machineStatus) === "online" || connectionState === "connected" || isSelfNode);
|
|
71865
71865
|
}
|
|
71866
|
+
function readMeshTimeoutEnvMs(name, defaultMs) {
|
|
71867
|
+
const raw = process.env[name]?.trim();
|
|
71868
|
+
if (!raw) return defaultMs;
|
|
71869
|
+
const parsed = Number.parseInt(raw, 10);
|
|
71870
|
+
if (Number.isFinite(parsed) && parsed >= 1e3 && parsed <= 12e4) return parsed;
|
|
71871
|
+
return defaultMs;
|
|
71872
|
+
}
|
|
71873
|
+
var MESH_DIRECT_PROBE_TIMEOUT_MS = readMeshTimeoutEnvMs("MESH_DIRECT_PROBE_TIMEOUT_MS", 25e3);
|
|
71874
|
+
var MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS = readMeshTimeoutEnvMs("MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS", 25e3);
|
|
71866
71875
|
async function probeRemoteMeshGitStatus(args) {
|
|
71867
71876
|
if (!args.dispatchMeshCommand) return null;
|
|
71868
71877
|
const remoteResult = await Promise.race([
|
|
@@ -71880,6 +71889,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71880
71889
|
localConfirmedCount: 0,
|
|
71881
71890
|
peerAttemptedCount: 0,
|
|
71882
71891
|
peerConfirmedCount: 0,
|
|
71892
|
+
standingEvidenceCount: 0,
|
|
71883
71893
|
unavailableNodeIds: []
|
|
71884
71894
|
};
|
|
71885
71895
|
}
|
|
@@ -71891,6 +71901,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71891
71901
|
let localConfirmedCount = 0;
|
|
71892
71902
|
let peerAttemptedCount = 0;
|
|
71893
71903
|
let peerConfirmedCount = 0;
|
|
71904
|
+
let standingEvidenceCount = 0;
|
|
71894
71905
|
const unavailableNodeIds = [];
|
|
71895
71906
|
for (const [nodeIndex, node] of nodes.entries()) {
|
|
71896
71907
|
const nodeId = normalizeMeshNodeId(node) || `node_${nodeIndex}`;
|
|
@@ -71916,6 +71927,14 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71916
71927
|
} catch {
|
|
71917
71928
|
}
|
|
71918
71929
|
}
|
|
71930
|
+
const standingGit = buildInlineMeshTransitGitStatus(node);
|
|
71931
|
+
if (standingGit) {
|
|
71932
|
+
standingEvidenceCount += 1;
|
|
71933
|
+
continue;
|
|
71934
|
+
}
|
|
71935
|
+
if (!args.probeRemotePeers) {
|
|
71936
|
+
continue;
|
|
71937
|
+
}
|
|
71919
71938
|
if (!daemonId || !args.dispatchMeshCommand) {
|
|
71920
71939
|
if (!isSelfNode) unavailableNodeIds.push(nodeId);
|
|
71921
71940
|
continue;
|
|
@@ -71926,7 +71945,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71926
71945
|
dispatchMeshCommand: args.dispatchMeshCommand,
|
|
71927
71946
|
daemonId,
|
|
71928
71947
|
workspace,
|
|
71929
|
-
timeoutMs:
|
|
71948
|
+
timeoutMs: MESH_DIRECT_PROBE_TIMEOUT_MS
|
|
71930
71949
|
});
|
|
71931
71950
|
if (remoteGit) {
|
|
71932
71951
|
recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
@@ -71938,10 +71957,11 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71938
71957
|
unavailableNodeIds.push(nodeId);
|
|
71939
71958
|
}
|
|
71940
71959
|
return {
|
|
71941
|
-
directEvidenceCount: localConfirmedCount + peerConfirmedCount,
|
|
71960
|
+
directEvidenceCount: localConfirmedCount + peerConfirmedCount + standingEvidenceCount,
|
|
71942
71961
|
localConfirmedCount,
|
|
71943
71962
|
peerAttemptedCount,
|
|
71944
71963
|
peerConfirmedCount,
|
|
71964
|
+
standingEvidenceCount,
|
|
71945
71965
|
unavailableNodeIds
|
|
71946
71966
|
};
|
|
71947
71967
|
}
|
|
@@ -76145,12 +76165,14 @@ ${hintLines.join("\n")}` : "",
|
|
|
76145
76165
|
const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh, { preferInline: true });
|
|
76146
76166
|
if (!meshRecord?.mesh) return { success: false, error: "Mesh not found" };
|
|
76147
76167
|
const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
|
|
76168
|
+
const probeRemotePeers = args?.refresh === true || args?.forceRefresh === true;
|
|
76148
76169
|
const directTruth = await hydrateInlineMeshDirectTruth({
|
|
76149
76170
|
mesh: meshRecord.mesh,
|
|
76150
76171
|
meshSource: meshRecord.source,
|
|
76151
76172
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
76152
76173
|
statusInstanceId: this.deps.statusInstanceId,
|
|
76153
|
-
localMachineId: loadConfig2().machineId || ""
|
|
76174
|
+
localMachineId: loadConfig2().machineId || "",
|
|
76175
|
+
probeRemotePeers
|
|
76154
76176
|
});
|
|
76155
76177
|
const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
|
|
76156
76178
|
const sourceOfTruth = {
|
|
@@ -77731,20 +77753,25 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
77731
77753
|
meshSource: meshRecord.source,
|
|
77732
77754
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
77733
77755
|
statusInstanceId: this.deps.statusInstanceId,
|
|
77734
|
-
localMachineId
|
|
77756
|
+
localMachineId,
|
|
77757
|
+
// Standing-state model: only an explicit refresh fans
|
|
77758
|
+
// out a blocking peer git probe. Default loads return
|
|
77759
|
+
// held truth so one slow peer can't block the graph.
|
|
77760
|
+
probeRemotePeers: refreshRequested
|
|
77735
77761
|
}) : {
|
|
77736
77762
|
directEvidenceCount: 0,
|
|
77737
77763
|
localConfirmedCount: 0,
|
|
77738
77764
|
peerAttemptedCount: 0,
|
|
77739
77765
|
peerConfirmedCount: 0,
|
|
77766
|
+
standingEvidenceCount: 0,
|
|
77740
77767
|
unavailableNodeIds: []
|
|
77741
77768
|
};
|
|
77742
77769
|
const passivePeerTruthNotAttempted = requireDirectPeerTruth && !refreshRequested && directTruth.directEvidenceCount > 0 && directTruth.peerAttemptedCount === 0;
|
|
77743
77770
|
const effectiveDirectTruth = passivePeerTruthNotAttempted ? { ...directTruth, unavailableNodeIds: [] } : directTruth;
|
|
77744
77771
|
const unavailableDirectTruthNodeIds = new Set(effectiveDirectTruth.unavailableNodeIds);
|
|
77745
77772
|
const unavailableNodesAreOnlyRemovedWorktrees = unavailableDirectTruthNodeIds.size > 0 && Array.isArray(mesh.nodes) && mesh.nodes.filter((node) => unavailableDirectTruthNodeIds.has(normalizeMeshNodeId(node) ?? "")).every((node) => node?.isLocalWorktree === true);
|
|
77746
|
-
const directTruthSatisfied = !requireDirectPeerTruth || effectiveDirectTruth.directEvidenceCount > 0 && (effectiveDirectTruth.unavailableNodeIds.length === 0 || unavailableNodesAreOnlyRemovedWorktrees);
|
|
77747
|
-
if (requireDirectPeerTruth && !directTruthSatisfied) {
|
|
77773
|
+
const directTruthSatisfied = !requireDirectPeerTruth || !refreshRequested || effectiveDirectTruth.directEvidenceCount > 0 && (effectiveDirectTruth.unavailableNodeIds.length === 0 || unavailableNodesAreOnlyRemovedWorktrees);
|
|
77774
|
+
if (requireDirectPeerTruth && refreshRequested && !directTruthSatisfied) {
|
|
77748
77775
|
const failureResult = {
|
|
77749
77776
|
success: false,
|
|
77750
77777
|
code: "mesh_direct_peer_truth_unavailable",
|
|
@@ -77890,13 +77917,13 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
77890
77917
|
status.connection = buildLivePeerGitConnection(connection, refreshedAt);
|
|
77891
77918
|
}
|
|
77892
77919
|
remoteProbeApplied = true;
|
|
77893
|
-
} else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
|
|
77920
|
+
} else if (refreshRequested && !isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
|
|
77894
77921
|
try {
|
|
77895
77922
|
const remoteGit = await probeRemoteMeshGitStatus({
|
|
77896
77923
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
77897
77924
|
daemonId,
|
|
77898
77925
|
workspace,
|
|
77899
|
-
timeoutMs:
|
|
77926
|
+
timeoutMs: MESH_DIRECT_PROBE_TIMEOUT_MS
|
|
77900
77927
|
});
|
|
77901
77928
|
if (remoteGit) {
|
|
77902
77929
|
status.git = remoteGit;
|
|
@@ -77920,7 +77947,7 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
77920
77947
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
77921
77948
|
daemonId,
|
|
77922
77949
|
workspace,
|
|
77923
|
-
timeoutMs:
|
|
77950
|
+
timeoutMs: MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS
|
|
77924
77951
|
});
|
|
77925
77952
|
if (remoteGit) {
|
|
77926
77953
|
status.git = remoteGit;
|