@adhdev/daemon-core 0.9.82-rc.95 → 0.9.82-rc.97
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 +114 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +115 -5
- 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/src/mesh/coordinator-prompt.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1258,7 +1258,7 @@ Before doing any coordinator work, confirm that the actual callable tool list in
|
|
|
1258
1258
|
c. **Targeted Tasks**: Use \`mesh_send_task\` only when you need to bypass the queue and force a specific node to execute a task immediately.
|
|
1259
1259
|
d. For the first dispatch of a new task, provide a **complete, self-contained** instruction that includes all context the agent needs (file paths, line numbers, what to change, why). Do not send partial instructions expecting future follow-up.
|
|
1260
1260
|
e. For a continuation of the same issue in an existing session, send a concise **delta instruction**: current verified state, the exact failed/blocked step, the newly approved action, and final reporting requirements. Do not resend the full original task or open a new chat solely to continue the same work; that wastes coordinator and worker context.
|
|
1261
|
-
4. **Monitor** \u2014 Prefer event-driven completion/status notifications. Do **not** poll \`mesh_read_chat\` repeatedly.
|
|
1261
|
+
4. **Monitor** \u2014 Prefer event-driven completion/status notifications. Do **not** poll \`mesh_read_chat\` repeatedly. Do **not** repeatedly call \`mesh_status\` or \`mesh_view_queue\` just to wait for assigned/generating work. After dispatching a direct or queued task, send one progress update with the task/session handle, then stop. Wait for \`pendingCoordinatorEvents\` or another completion/approval/status signal, an explicit user status request, or a real timeout/stall signal before reading status/chat/queue again. Use at most one compact \`mesh_read_chat\` check after a terminal signal. Handle approvals via \`mesh_approve\`.
|
|
1262
1262
|
5. **Verify** \u2014 When a task reports completion or git work is visible, call \`mesh_git_status\` to verify changes were made.
|
|
1263
1263
|
6. **Checkpoint** \u2014 Call \`mesh_checkpoint\` to save the work.
|
|
1264
1264
|
7. **Converge branches** \u2014 Before marking any task complete, classify every touched node/branch into exactly one final state: \`merged_to_main\`, \`pushed_feature_branch_needs_merge\`, \`blocked_review\`, \`cleanup_candidate\`, or \`not_mergeable\`. Use \`mesh_status\` branchConvergenceSummary. For obvious clean branch catch-up (ahead 0, behind > 0, upstream fresh, no dirty/stash/submodule issues), use \`mesh_fast_forward_node\` dry-run first and execute only when explicitly safe/approved; this avoids consuming an agent session. Use \`mesh_refine_node\` for clean worktree branches when safe. Before/refine merging root commits that contain submodule gitlink changes, require each submodule commit to be reachable from the configured submodule remote main branch, not merely present on a feature ref or local checkout. If \`mesh_refine_node\` returns \`submodule_reachability_failed\` or publish-required evidence, keep the public convergence bucket as \`blocked_review\`; unless \`allowAutoPublishSubmoduleMainCommits\` is explicitly enabled and Refinery reports successful non-force publish plus post-publish verification, ask the user for explicit approval to push/publish the unreachable submodule commit(s) to submodule main, then rerun \`mesh_refine_node\`. Do not merge the root branch until the submodule commit(s) are reachable from submodule origin/main. A task that remains on a non-main branch is not fully complete unless the final report names the follow-up state and next step.
|
|
@@ -16124,7 +16124,7 @@ var RECENT_SEND_WINDOW_MS = 1200;
|
|
|
16124
16124
|
var READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS = 25e3;
|
|
16125
16125
|
var HERMES_CLI_STARTING_SEND_SETTLE_MS = 2e3;
|
|
16126
16126
|
var CLI_NATIVE_HISTORY_FRESH_MS = 5 * 6e4;
|
|
16127
|
-
var CLI_NATIVE_TRANSCRIPT_PROVIDERS = /* @__PURE__ */ new Set(["codex-cli", "claude-cli", "hermes-cli"]);
|
|
16127
|
+
var CLI_NATIVE_TRANSCRIPT_PROVIDERS = /* @__PURE__ */ new Set(["codex-cli", "claude-cli", "hermes-cli", "antigravity-cli"]);
|
|
16128
16128
|
var recentSendByTarget = /* @__PURE__ */ new Map();
|
|
16129
16129
|
function getCurrentProviderType(h, fallback = "") {
|
|
16130
16130
|
return h.currentSession?.providerType || h.currentProviderType || fallback;
|
|
@@ -26499,12 +26499,114 @@ function buildMeshNodeDisplayLabel(node, nodeId, providerPriority) {
|
|
|
26499
26499
|
if (explicit) return explicit;
|
|
26500
26500
|
const workspace = readStringValue(node.workspace, node.repoRoot, node.repo_root);
|
|
26501
26501
|
const workspaceName = workspace ? (0, import_path8.basename)(workspace) : void 0;
|
|
26502
|
-
const host = readStringValue(node.hostname, node.host, node.daemonId, node.daemon_id, node.machineId, node.machine_id);
|
|
26502
|
+
const host = readStringValue(node.machineName, node.machine_name, node.hostname, node.host, node.daemonId, node.daemon_id, node.machineId, node.machine_id);
|
|
26503
26503
|
const provider = providerPriority[0] || (Array.isArray(node.providers) ? readStringValue(...node.providers) : void 0);
|
|
26504
26504
|
const parts = [workspaceName, host, provider].filter(Boolean);
|
|
26505
26505
|
if (parts.length > 0) return parts.join(" \xB7 ");
|
|
26506
26506
|
return nodeId || "unidentified mesh node";
|
|
26507
26507
|
}
|
|
26508
|
+
function normalizeMeshHostname(value) {
|
|
26509
|
+
const hostname2 = readStringValue(value);
|
|
26510
|
+
if (!hostname2) return void 0;
|
|
26511
|
+
return hostname2.toLowerCase().replace(/\.$/, "");
|
|
26512
|
+
}
|
|
26513
|
+
function readMeshNodeMachineId(node) {
|
|
26514
|
+
return readStringValue(
|
|
26515
|
+
node.machineId,
|
|
26516
|
+
node.machine_id,
|
|
26517
|
+
readObjectRecord(node.machine)?.id,
|
|
26518
|
+
readObjectRecord(node.machine)?.machineId,
|
|
26519
|
+
readObjectRecord(node.lastProbe)?.machineId,
|
|
26520
|
+
readObjectRecord(node.last_probe)?.machine_id,
|
|
26521
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.id,
|
|
26522
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.machineId,
|
|
26523
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.id,
|
|
26524
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.machine_id
|
|
26525
|
+
);
|
|
26526
|
+
}
|
|
26527
|
+
function readMeshNodeDaemonId(node) {
|
|
26528
|
+
return readStringValue(
|
|
26529
|
+
node.daemonId,
|
|
26530
|
+
node.daemon_id,
|
|
26531
|
+
readObjectRecord(node.machine)?.daemonId,
|
|
26532
|
+
readObjectRecord(node.machine)?.daemon_id,
|
|
26533
|
+
readObjectRecord(node.lastProbe)?.daemonId,
|
|
26534
|
+
readObjectRecord(node.last_probe)?.daemon_id,
|
|
26535
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.daemonId,
|
|
26536
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.daemon_id,
|
|
26537
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.daemonId,
|
|
26538
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.daemon_id
|
|
26539
|
+
);
|
|
26540
|
+
}
|
|
26541
|
+
function readMeshNodeHostname(node) {
|
|
26542
|
+
return readStringValue(
|
|
26543
|
+
node.hostname,
|
|
26544
|
+
node.host,
|
|
26545
|
+
node.machineHostname,
|
|
26546
|
+
node.machine_hostname,
|
|
26547
|
+
readObjectRecord(node.machine)?.hostname,
|
|
26548
|
+
readObjectRecord(node.machine)?.host,
|
|
26549
|
+
readObjectRecord(node.lastProbe)?.hostname,
|
|
26550
|
+
readObjectRecord(node.last_probe)?.hostname,
|
|
26551
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.hostname,
|
|
26552
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.hostname
|
|
26553
|
+
);
|
|
26554
|
+
}
|
|
26555
|
+
function readMeshNodeDisplayMachineName(node) {
|
|
26556
|
+
return readStringValue(
|
|
26557
|
+
node.machineName,
|
|
26558
|
+
node.machine_name,
|
|
26559
|
+
node.machineLabel,
|
|
26560
|
+
node.machine_label,
|
|
26561
|
+
node.machineNickname,
|
|
26562
|
+
node.machine_nickname,
|
|
26563
|
+
node.alias,
|
|
26564
|
+
readObjectRecord(node.machine)?.name,
|
|
26565
|
+
readObjectRecord(node.machine)?.displayName,
|
|
26566
|
+
readObjectRecord(node.machine)?.display_name,
|
|
26567
|
+
readObjectRecord(node.lastProbe)?.machineName,
|
|
26568
|
+
readObjectRecord(node.last_probe)?.machine_name,
|
|
26569
|
+
readObjectRecord(readObjectRecord(node.lastProbe)?.machine)?.name,
|
|
26570
|
+
readObjectRecord(readObjectRecord(node.last_probe)?.machine)?.name,
|
|
26571
|
+
readMeshNodeHostname(node)
|
|
26572
|
+
);
|
|
26573
|
+
}
|
|
26574
|
+
function compactMeshIdentityEvidence(value) {
|
|
26575
|
+
if (!value) return void 0;
|
|
26576
|
+
return value.length > 24 ? `${value.slice(0, 12)}\u2026${value.slice(-8)}` : value;
|
|
26577
|
+
}
|
|
26578
|
+
function buildMeshNodeMachineIdentity(node, opts) {
|
|
26579
|
+
const machineId = readMeshNodeMachineId(node);
|
|
26580
|
+
const daemonId = readMeshNodeDaemonId(node);
|
|
26581
|
+
const hostname2 = readMeshNodeHostname(node);
|
|
26582
|
+
const machineName = readMeshNodeDisplayMachineName(node);
|
|
26583
|
+
const coordinatorHostname = readStringValue(opts.coordinatorHostname);
|
|
26584
|
+
const machineIdMatches = Boolean(opts.localMachineId && machineId && opts.localMachineId === machineId);
|
|
26585
|
+
const daemonIdMatches = Boolean(opts.localDaemonId && daemonId && opts.localDaemonId === daemonId);
|
|
26586
|
+
const hostnameMatches = Boolean(
|
|
26587
|
+
normalizeMeshHostname(hostname2) && normalizeMeshHostname(coordinatorHostname) && normalizeMeshHostname(hostname2) === normalizeMeshHostname(coordinatorHostname)
|
|
26588
|
+
);
|
|
26589
|
+
const sameMachine = opts.isSelfNode === true || machineIdMatches || daemonIdMatches || hostnameMatches;
|
|
26590
|
+
const evidence = [];
|
|
26591
|
+
for (const [label, value] of [["machineName", machineName], ["hostname", hostname2], ["machineId", machineId], ["daemonId", daemonId]]) {
|
|
26592
|
+
const compact = compactMeshIdentityEvidence(value);
|
|
26593
|
+
if (compact) evidence.push(`${label}:${compact}`);
|
|
26594
|
+
}
|
|
26595
|
+
const locality = sameMachine ? "same_machine" : evidence.length > 0 ? "remote_known" : "remote_or_unknown";
|
|
26596
|
+
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";
|
|
26597
|
+
return {
|
|
26598
|
+
daemonId,
|
|
26599
|
+
machineId,
|
|
26600
|
+
hostname: hostname2,
|
|
26601
|
+
machineName,
|
|
26602
|
+
displayName: machineName || hostname2 || daemonId || machineId,
|
|
26603
|
+
coordinatorHostname,
|
|
26604
|
+
sameMachine,
|
|
26605
|
+
locality,
|
|
26606
|
+
localityReason,
|
|
26607
|
+
identityEvidence: evidence
|
|
26608
|
+
};
|
|
26609
|
+
}
|
|
26508
26610
|
function normalizeInlineMeshGitStatus(status, node, options) {
|
|
26509
26611
|
const isGitRepo = readBooleanValue(status.isGitRepo);
|
|
26510
26612
|
if (!Object.keys(status).length || isGitRepo === void 0) return void 0;
|
|
@@ -30563,6 +30665,7 @@ ${block2}`);
|
|
|
30563
30665
|
return failureResult;
|
|
30564
30666
|
}
|
|
30565
30667
|
const directTruthUnavailableNodeIds = new Set(effectiveDirectTruth.unavailableNodeIds);
|
|
30668
|
+
const coordinatorHostname = (0, import_os3.hostname)();
|
|
30566
30669
|
const selectedCoordinatorNodeId = readStringValue(
|
|
30567
30670
|
mesh.coordinator?.preferredNodeId,
|
|
30568
30671
|
mesh.nodes?.[0]?.id,
|
|
@@ -30580,6 +30683,12 @@ ${block2}`);
|
|
|
30580
30683
|
) || Boolean(
|
|
30581
30684
|
daemonId && (daemonId === localMachineId || daemonId === this.deps.statusInstanceId)
|
|
30582
30685
|
) || Boolean(meshRecord?.inline && nodeIndex === 0);
|
|
30686
|
+
const machineIdentity = buildMeshNodeMachineIdentity(node, {
|
|
30687
|
+
localMachineId,
|
|
30688
|
+
localDaemonId: this.deps.statusInstanceId,
|
|
30689
|
+
coordinatorHostname,
|
|
30690
|
+
isSelfNode
|
|
30691
|
+
});
|
|
30583
30692
|
const status = {
|
|
30584
30693
|
nodeId,
|
|
30585
30694
|
machineLabel: buildMeshNodeDisplayLabel(node, nodeId, providerPriority),
|
|
@@ -30590,7 +30699,8 @@ ${block2}`);
|
|
|
30590
30699
|
worktreeBranch: node.worktreeBranch,
|
|
30591
30700
|
role: normalizeMeshDaemonRole(node.role) || (meshHost.hostNodeId && nodeId === meshHost.hostNodeId ? "host" : void 0),
|
|
30592
30701
|
daemonId,
|
|
30593
|
-
machineId: node.machineId,
|
|
30702
|
+
machineId: readMeshNodeMachineId(node) || node.machineId,
|
|
30703
|
+
machine: machineIdentity,
|
|
30594
30704
|
machineStatus: node.machineStatus,
|
|
30595
30705
|
health: "unknown",
|
|
30596
30706
|
providers: node.providers || [],
|