@adhdev/daemon-core 0.9.82-rc.326 → 0.9.82-rc.327
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/config/mesh-config.d.ts +5 -0
- package/dist/index.js +36 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -11
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-work-queue.d.ts +2 -0
- package/dist/repo-mesh-types.d.ts +12 -0
- package/package.json +2 -2
- package/src/commands/router.ts +47 -6
- package/src/config/mesh-config.ts +7 -0
- package/src/mesh/mesh-work-queue.ts +28 -8
- package/src/repo-mesh-types.ts +12 -0
|
@@ -119,4 +119,9 @@ export declare function updateNode(meshId: string, nodeId: string, opts: {
|
|
|
119
119
|
/** Per-node instruction surfaced in the coordinator prompt. Pass an
|
|
120
120
|
* empty string or undefined to clear it. */
|
|
121
121
|
systemPrompt?: string;
|
|
122
|
+
/** Live self-reported platform/arch from the owning daemon's git_status
|
|
123
|
+
* envelope. Persisted distinctly from userOverrides (auto-detected, not
|
|
124
|
+
* operator intent) so capability-tag os=/arch= self-heals across loads. */
|
|
125
|
+
reportedPlatform?: string;
|
|
126
|
+
reportedArch?: string;
|
|
122
127
|
}): LocalMeshNodeEntry | undefined;
|
package/dist/index.js
CHANGED
|
@@ -313,10 +313,10 @@ function readInjected(value) {
|
|
|
313
313
|
}
|
|
314
314
|
function getDaemonBuildInfo() {
|
|
315
315
|
if (cached) return cached;
|
|
316
|
-
const commit = readInjected(true ? "
|
|
317
|
-
const commitShort = readInjected(true ? "
|
|
318
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
319
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
316
|
+
const commit = readInjected(true ? "993e3922de8abe554822450e2b4c26c2c9f5f64a" : void 0) ?? "unknown";
|
|
317
|
+
const commitShort = readInjected(true ? "993e3922" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
318
|
+
const version = readInjected(true ? "0.9.82-rc.327" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
319
|
+
const builtAt = readInjected(true ? "2026-06-19T12:31:25.870Z" : void 0);
|
|
320
320
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
321
321
|
return cached;
|
|
322
322
|
}
|
|
@@ -1942,6 +1942,8 @@ function updateNode(meshId, nodeId, opts) {
|
|
|
1942
1942
|
const node = mesh.nodes.find((n) => n.id === nodeId);
|
|
1943
1943
|
if (!node) return void 0;
|
|
1944
1944
|
if (opts.userOverrides) node.userOverrides = { ...node.userOverrides, ...opts.userOverrides };
|
|
1945
|
+
if (opts.reportedPlatform && opts.reportedPlatform.trim()) node.reportedPlatform = opts.reportedPlatform.trim();
|
|
1946
|
+
if (opts.reportedArch && opts.reportedArch.trim()) node.reportedArch = opts.reportedArch.trim();
|
|
1945
1947
|
if (opts.policy) node.policy = { ...node.policy, ...opts.policy };
|
|
1946
1948
|
if (opts.worktreeBootstrap) node.worktreeBootstrap = opts.worktreeBootstrap;
|
|
1947
1949
|
if (Object.prototype.hasOwnProperty.call(opts, "systemPrompt")) {
|
|
@@ -3108,11 +3110,15 @@ function readNodeOverride(node, key) {
|
|
|
3108
3110
|
const value = overrides[key];
|
|
3109
3111
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3110
3112
|
}
|
|
3113
|
+
function readNodeReporter(node, key) {
|
|
3114
|
+
const value = key === "platform" ? node?.reportedPlatform : node?.reportedArch;
|
|
3115
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3116
|
+
}
|
|
3111
3117
|
function buildMeshNodeCapabilityTags(node, providerType) {
|
|
3112
3118
|
const provider = typeof providerType === "string" && providerType.trim() ? providerType.trim() : firstProviderPriority(node?.policy);
|
|
3113
3119
|
const worktreeBranch = typeof node?.worktreeBranch === "string" && node.worktreeBranch.trim() ? node.worktreeBranch.trim() : null;
|
|
3114
|
-
const os30 = readNodeOverride(node, "platform") ?? process.platform;
|
|
3115
|
-
const arch2 = readNodeOverride(node, "arch") ?? process.arch;
|
|
3120
|
+
const os30 = readNodeOverride(node, "platform") ?? readNodeReporter(node, "platform") ?? process.platform;
|
|
3121
|
+
const arch2 = readNodeOverride(node, "arch") ?? readNodeReporter(node, "arch") ?? process.arch;
|
|
3116
3122
|
return normalizeMeshCapabilityTags([
|
|
3117
3123
|
...Array.isArray(node?.capabilities) ? node.capabilities : [],
|
|
3118
3124
|
`os=${os30}`,
|
|
@@ -43204,7 +43210,9 @@ function buildLivePeerGitConnection(connection, timestamp = (/* @__PURE__ */ new
|
|
|
43204
43210
|
};
|
|
43205
43211
|
}
|
|
43206
43212
|
function recordInlineMeshDirectGitTruth(node, git, source) {
|
|
43207
|
-
if (!node || typeof node !== "object" || Array.isArray(node))
|
|
43213
|
+
if (!node || typeof node !== "object" || Array.isArray(node)) {
|
|
43214
|
+
return { reporterPlatform: null, reporterArch: null };
|
|
43215
|
+
}
|
|
43208
43216
|
const checkedAt = readNumberValue(git.lastCheckedAt) ?? Date.now();
|
|
43209
43217
|
const updatedAt = new Date(checkedAt).toISOString();
|
|
43210
43218
|
const nextGit = {
|
|
@@ -43226,6 +43234,9 @@ function recordInlineMeshDirectGitTruth(node, git, source) {
|
|
|
43226
43234
|
const reporterPlatform = readStringValue(git.reporterPlatform) ?? (isLocalSource ? process.platform : null);
|
|
43227
43235
|
const reporterArch = readStringValue(git.reporterArch) ?? (isLocalSource ? process.arch : null);
|
|
43228
43236
|
stampNodeReporterPlatform(node, reporterPlatform, reporterArch);
|
|
43237
|
+
if (reporterPlatform) node.reportedPlatform = reporterPlatform;
|
|
43238
|
+
if (reporterArch) node.reportedArch = reporterArch;
|
|
43239
|
+
return { reporterPlatform, reporterArch };
|
|
43229
43240
|
}
|
|
43230
43241
|
function stampNodeReporterPlatform(node, platform10, arch2) {
|
|
43231
43242
|
if (!node || typeof node !== "object" || Array.isArray(node)) return;
|
|
@@ -43242,6 +43253,16 @@ function stampNodeReporterPlatform(node, platform10, arch2) {
|
|
|
43242
43253
|
}
|
|
43243
43254
|
if (changed) node.userOverrides = overrides;
|
|
43244
43255
|
}
|
|
43256
|
+
function persistNodeReporterPlatform(meshSource, mesh, nodeId, reporter) {
|
|
43257
|
+
if (meshSource !== "local_config") return;
|
|
43258
|
+
const meshId = readStringValue(mesh?.id);
|
|
43259
|
+
if (!meshId || !nodeId) return;
|
|
43260
|
+
const reportedPlatform = reporter.reporterPlatform ?? void 0;
|
|
43261
|
+
const reportedArch = reporter.reporterArch ?? void 0;
|
|
43262
|
+
if (!reportedPlatform && !reportedArch) return;
|
|
43263
|
+
void Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports)).then(({ updateNode: updateNode2 }) => updateNode2(meshId, nodeId, { reportedPlatform, reportedArch })).catch(() => {
|
|
43264
|
+
});
|
|
43265
|
+
}
|
|
43245
43266
|
function buildCachedInlineMeshGitStatus(node) {
|
|
43246
43267
|
const liveGit = buildInlineMeshTransitGitStatus(node);
|
|
43247
43268
|
if (liveGit) return liveGit;
|
|
@@ -43823,7 +43844,8 @@ async function hydrateInlineMeshDirectTruth(args) {
|
|
|
43823
43844
|
try {
|
|
43824
43845
|
const localGit = await getGitRepoStatus(workspace, { timeoutMs: 1e4, refreshUpstream: true });
|
|
43825
43846
|
if (localGit?.isGitRepo) {
|
|
43826
|
-
recordInlineMeshDirectGitTruth(node, localGit, "selected_coordinator_local_git");
|
|
43847
|
+
const reporter = recordInlineMeshDirectGitTruth(node, localGit, "selected_coordinator_local_git");
|
|
43848
|
+
persistNodeReporterPlatform(args.meshSource, args.mesh, nodeId, reporter);
|
|
43827
43849
|
localConfirmedCount += 1;
|
|
43828
43850
|
continue;
|
|
43829
43851
|
}
|
|
@@ -43853,7 +43875,8 @@ async function hydrateInlineMeshDirectTruth(args) {
|
|
|
43853
43875
|
});
|
|
43854
43876
|
const remoteGit = args.probeCache ? await args.probeCache.probe(daemonId, workspace, runProbe) : await runProbe();
|
|
43855
43877
|
if (remoteGit) {
|
|
43856
|
-
recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
43878
|
+
const reporter = recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
43879
|
+
persistNodeReporterPlatform(args.meshSource, args.mesh, nodeId, reporter);
|
|
43857
43880
|
peerConfirmedCount += 1;
|
|
43858
43881
|
continue;
|
|
43859
43882
|
}
|
|
@@ -50070,7 +50093,8 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
50070
50093
|
if (!connectionReported || connectionState === "unknown") {
|
|
50071
50094
|
status.connection = buildLivePeerGitConnection(connection, refreshedAt);
|
|
50072
50095
|
}
|
|
50073
|
-
recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
50096
|
+
const reporter = recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
50097
|
+
persistNodeReporterPlatform(meshRecord.source, mesh, nodeId, reporter);
|
|
50074
50098
|
remoteProbeApplied = true;
|
|
50075
50099
|
}
|
|
50076
50100
|
}
|
|
@@ -50102,7 +50126,8 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
50102
50126
|
try {
|
|
50103
50127
|
const gitStatus = await getGitRepoStatus(workspace, { timeoutMs: 1e4, refreshUpstream: true });
|
|
50104
50128
|
status.git = gitStatus;
|
|
50105
|
-
recordInlineMeshDirectGitTruth(node, gitStatus, "selected_coordinator_local_git");
|
|
50129
|
+
const reporter = recordInlineMeshDirectGitTruth(node, gitStatus, "selected_coordinator_local_git");
|
|
50130
|
+
persistNodeReporterPlatform(meshRecord.source, mesh, nodeId, reporter);
|
|
50106
50131
|
if (gitStatus.isGitRepo) {
|
|
50107
50132
|
status.health = deriveMeshNodeHealthFromGit(gitStatus);
|
|
50108
50133
|
} else {
|