@adhdev/daemon-core 0.9.82-rc.95 → 0.9.82-rc.96
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 +113 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +114 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +1 -1
- package/src/commands/router.ts +134 -3
package/dist/index.mjs
CHANGED
|
@@ -15865,7 +15865,7 @@ var RECENT_SEND_WINDOW_MS = 1200;
|
|
|
15865
15865
|
var READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS = 25e3;
|
|
15866
15866
|
var HERMES_CLI_STARTING_SEND_SETTLE_MS = 2e3;
|
|
15867
15867
|
var CLI_NATIVE_HISTORY_FRESH_MS = 5 * 6e4;
|
|
15868
|
-
var CLI_NATIVE_TRANSCRIPT_PROVIDERS = /* @__PURE__ */ new Set(["codex-cli", "claude-cli", "hermes-cli"]);
|
|
15868
|
+
var CLI_NATIVE_TRANSCRIPT_PROVIDERS = /* @__PURE__ */ new Set(["codex-cli", "claude-cli", "hermes-cli", "antigravity-cli"]);
|
|
15869
15869
|
var recentSendByTarget = /* @__PURE__ */ new Map();
|
|
15870
15870
|
function getCurrentProviderType(h, fallback = "") {
|
|
15871
15871
|
return h.currentSession?.providerType || h.currentProviderType || fallback;
|
|
@@ -26096,7 +26096,7 @@ async function maybeRunDaemonUpgradeHelperFromEnv() {
|
|
|
26096
26096
|
|
|
26097
26097
|
// src/commands/router.ts
|
|
26098
26098
|
init_mesh_work_queue();
|
|
26099
|
-
import { homedir as homedir19 } from "os";
|
|
26099
|
+
import { homedir as homedir19, hostname as osHostname } from "os";
|
|
26100
26100
|
import { basename as pathBasename, join as pathJoin, resolve as pathResolve } from "path";
|
|
26101
26101
|
import * as fs11 from "fs";
|
|
26102
26102
|
var CHANNEL_NPM_TAG = { stable: "latest", preview: "next" };
|
|
@@ -26245,12 +26245,114 @@ function buildMeshNodeDisplayLabel(node, nodeId, providerPriority) {
|
|
|
26245
26245
|
if (explicit) return explicit;
|
|
26246
26246
|
const workspace = readStringValue(node.workspace, node.repoRoot, node.repo_root);
|
|
26247
26247
|
const workspaceName = workspace ? pathBasename(workspace) : void 0;
|
|
26248
|
-
const host = readStringValue(node.hostname, node.host, node.daemonId, node.daemon_id, node.machineId, node.machine_id);
|
|
26248
|
+
const host = readStringValue(node.machineName, node.machine_name, node.hostname, node.host, node.daemonId, node.daemon_id, node.machineId, node.machine_id);
|
|
26249
26249
|
const provider = providerPriority[0] || (Array.isArray(node.providers) ? readStringValue(...node.providers) : void 0);
|
|
26250
26250
|
const parts = [workspaceName, host, provider].filter(Boolean);
|
|
26251
26251
|
if (parts.length > 0) return parts.join(" \xB7 ");
|
|
26252
26252
|
return nodeId || "unidentified mesh node";
|
|
26253
26253
|
}
|
|
26254
|
+
function normalizeMeshHostname(value) {
|
|
26255
|
+
const hostname2 = readStringValue(value);
|
|
26256
|
+
if (!hostname2) return void 0;
|
|
26257
|
+
return hostname2.toLowerCase().replace(/\.$/, "");
|
|
26258
|
+
}
|
|
26259
|
+
function readMeshNodeMachineId(node) {
|
|
26260
|
+
return readStringValue(
|
|
26261
|
+
node.machineId,
|
|
26262
|
+
node.machine_id,
|
|
26263
|
+
readObjectRecord(node.machine)?.id,
|
|
26264
|
+
readObjectRecord(node.machine)?.machineId,
|
|
26265
|
+
readObjectRecord(node.lastProbe)?.machineId,
|
|
26266
|
+
readObjectRecord(node.last_probe)?.machine_id,
|
|
26267
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.id,
|
|
26268
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.machineId,
|
|
26269
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.id,
|
|
26270
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.machine_id
|
|
26271
|
+
);
|
|
26272
|
+
}
|
|
26273
|
+
function readMeshNodeDaemonId(node) {
|
|
26274
|
+
return readStringValue(
|
|
26275
|
+
node.daemonId,
|
|
26276
|
+
node.daemon_id,
|
|
26277
|
+
readObjectRecord(node.machine)?.daemonId,
|
|
26278
|
+
readObjectRecord(node.machine)?.daemon_id,
|
|
26279
|
+
readObjectRecord(node.lastProbe)?.daemonId,
|
|
26280
|
+
readObjectRecord(node.last_probe)?.daemon_id,
|
|
26281
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.daemonId,
|
|
26282
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.daemon_id,
|
|
26283
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.daemonId,
|
|
26284
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.daemon_id
|
|
26285
|
+
);
|
|
26286
|
+
}
|
|
26287
|
+
function readMeshNodeHostname(node) {
|
|
26288
|
+
return readStringValue(
|
|
26289
|
+
node.hostname,
|
|
26290
|
+
node.host,
|
|
26291
|
+
node.machineHostname,
|
|
26292
|
+
node.machine_hostname,
|
|
26293
|
+
readObjectRecord(node.machine)?.hostname,
|
|
26294
|
+
readObjectRecord(node.machine)?.host,
|
|
26295
|
+
readObjectRecord(node.lastProbe)?.hostname,
|
|
26296
|
+
readObjectRecord(node.last_probe)?.hostname,
|
|
26297
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.hostname,
|
|
26298
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.hostname
|
|
26299
|
+
);
|
|
26300
|
+
}
|
|
26301
|
+
function readMeshNodeDisplayMachineName(node) {
|
|
26302
|
+
return readStringValue(
|
|
26303
|
+
node.machineName,
|
|
26304
|
+
node.machine_name,
|
|
26305
|
+
node.machineLabel,
|
|
26306
|
+
node.machine_label,
|
|
26307
|
+
node.machineNickname,
|
|
26308
|
+
node.machine_nickname,
|
|
26309
|
+
node.alias,
|
|
26310
|
+
readObjectRecord(node.machine)?.name,
|
|
26311
|
+
readObjectRecord(node.machine)?.displayName,
|
|
26312
|
+
readObjectRecord(node.machine)?.display_name,
|
|
26313
|
+
readObjectRecord(node.lastProbe)?.machineName,
|
|
26314
|
+
readObjectRecord(node.last_probe)?.machine_name,
|
|
26315
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.name,
|
|
26316
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.name,
|
|
26317
|
+
readMeshNodeHostname(node)
|
|
26318
|
+
);
|
|
26319
|
+
}
|
|
26320
|
+
function compactMeshIdentityEvidence(value) {
|
|
26321
|
+
if (!value) return void 0;
|
|
26322
|
+
return value.length > 24 ? `${value.slice(0, 12)}\u2026${value.slice(-8)}` : value;
|
|
26323
|
+
}
|
|
26324
|
+
function buildMeshNodeMachineIdentity(node, opts) {
|
|
26325
|
+
const machineId = readMeshNodeMachineId(node);
|
|
26326
|
+
const daemonId = readMeshNodeDaemonId(node);
|
|
26327
|
+
const hostname2 = readMeshNodeHostname(node);
|
|
26328
|
+
const machineName = readMeshNodeDisplayMachineName(node);
|
|
26329
|
+
const coordinatorHostname = readStringValue(opts.coordinatorHostname);
|
|
26330
|
+
const machineIdMatches = Boolean(opts.localMachineId && machineId && opts.localMachineId === machineId);
|
|
26331
|
+
const daemonIdMatches = Boolean(opts.localDaemonId && daemonId && opts.localDaemonId === daemonId);
|
|
26332
|
+
const hostnameMatches = Boolean(
|
|
26333
|
+
normalizeMeshHostname(hostname2) && normalizeMeshHostname(coordinatorHostname) && normalizeMeshHostname(hostname2) === normalizeMeshHostname(coordinatorHostname)
|
|
26334
|
+
);
|
|
26335
|
+
const sameMachine = opts.isSelfNode === true || machineIdMatches || daemonIdMatches || hostnameMatches;
|
|
26336
|
+
const evidence = [];
|
|
26337
|
+
for (const [label, value] of [["machineName", machineName], ["hostname", hostname2], ["machineId", machineId], ["daemonId", daemonId]]) {
|
|
26338
|
+
const compact = compactMeshIdentityEvidence(value);
|
|
26339
|
+
if (compact) evidence.push(`${label}:${compact}`);
|
|
26340
|
+
}
|
|
26341
|
+
const locality = sameMachine ? "same_machine" : evidence.length > 0 ? "remote_known" : "remote_or_unknown";
|
|
26342
|
+
const localityReason = sameMachine ? machineIdMatches ? "matched coordinator machine id" : daemonIdMatches ? "matched coordinator daemon id" : hostnameMatches ? "matched coordinator hostname" : "selected coordinator node" : evidence.length > 0 ? `known remote/other machine identity; no local coordinator match (${evidence.join(", ")})` : "no useful machine identity evidence available";
|
|
26343
|
+
return {
|
|
26344
|
+
daemonId,
|
|
26345
|
+
machineId,
|
|
26346
|
+
hostname: hostname2,
|
|
26347
|
+
machineName,
|
|
26348
|
+
displayName: machineName || hostname2 || daemonId || machineId,
|
|
26349
|
+
coordinatorHostname,
|
|
26350
|
+
sameMachine,
|
|
26351
|
+
locality,
|
|
26352
|
+
localityReason,
|
|
26353
|
+
identityEvidence: evidence
|
|
26354
|
+
};
|
|
26355
|
+
}
|
|
26254
26356
|
function normalizeInlineMeshGitStatus(status, node, options) {
|
|
26255
26357
|
const isGitRepo = readBooleanValue(status.isGitRepo);
|
|
26256
26358
|
if (!Object.keys(status).length || isGitRepo === void 0) return void 0;
|
|
@@ -30309,6 +30411,7 @@ ${block2}`);
|
|
|
30309
30411
|
return failureResult;
|
|
30310
30412
|
}
|
|
30311
30413
|
const directTruthUnavailableNodeIds = new Set(effectiveDirectTruth.unavailableNodeIds);
|
|
30414
|
+
const coordinatorHostname = osHostname();
|
|
30312
30415
|
const selectedCoordinatorNodeId = readStringValue(
|
|
30313
30416
|
mesh.coordinator?.preferredNodeId,
|
|
30314
30417
|
mesh.nodes?.[0]?.id,
|
|
@@ -30326,6 +30429,12 @@ ${block2}`);
|
|
|
30326
30429
|
) || Boolean(
|
|
30327
30430
|
daemonId && (daemonId === localMachineId || daemonId === this.deps.statusInstanceId)
|
|
30328
30431
|
) || Boolean(meshRecord?.inline && nodeIndex === 0);
|
|
30432
|
+
const machineIdentity = buildMeshNodeMachineIdentity(node, {
|
|
30433
|
+
localMachineId,
|
|
30434
|
+
localDaemonId: this.deps.statusInstanceId,
|
|
30435
|
+
coordinatorHostname,
|
|
30436
|
+
isSelfNode
|
|
30437
|
+
});
|
|
30329
30438
|
const status = {
|
|
30330
30439
|
nodeId,
|
|
30331
30440
|
machineLabel: buildMeshNodeDisplayLabel(node, nodeId, providerPriority),
|
|
@@ -30336,7 +30445,8 @@ ${block2}`);
|
|
|
30336
30445
|
worktreeBranch: node.worktreeBranch,
|
|
30337
30446
|
role: normalizeMeshDaemonRole(node.role) || (meshHost.hostNodeId && nodeId === meshHost.hostNodeId ? "host" : void 0),
|
|
30338
30447
|
daemonId,
|
|
30339
|
-
machineId: node.machineId,
|
|
30448
|
+
machineId: readMeshNodeMachineId(node) || node.machineId,
|
|
30449
|
+
machine: machineIdentity,
|
|
30340
30450
|
machineStatus: node.machineStatus,
|
|
30341
30451
|
health: "unknown",
|
|
30342
30452
|
providers: node.providers || [],
|