@adhdev/daemon-core 0.9.82-rc.94 → 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 +124 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +8 -2
- package/src/commands/cli-manager.ts +10 -0
- package/src/commands/router.ts +134 -3
package/dist/index.js
CHANGED
|
@@ -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;
|
|
@@ -17179,7 +17179,7 @@ async function handleReadChat(h, args) {
|
|
|
17179
17179
|
returnedStatus: String(returnedStatus || ""),
|
|
17180
17180
|
selectedMessageSource: messageSource.selected,
|
|
17181
17181
|
messageSource,
|
|
17182
|
-
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && messageSource.selected !== "native-history",
|
|
17182
|
+
shouldPreferAdapterMessages: supportsCliNativeTranscript(providerType, provider) && isNativeSourceCanonicalHistory(provider?.canonicalHistory) && messageSource.selected !== "native-history" && typeof messageSource.fallbackReason === "string" && messageSource.fallbackReason.startsWith("native_history_") && messageSource.fallbackReason !== "native_history_not_checked" && !(selectedTranscriptAuthority === "provider" && selectedCoverage === "full"),
|
|
17183
17183
|
parsedMsgCount: parsedRecord.messages.length,
|
|
17184
17184
|
returnedMsgCount: selectedMessages.length
|
|
17185
17185
|
},
|
|
@@ -22313,10 +22313,14 @@ function detectExplicitProviderSessionId(provider, args) {
|
|
|
22313
22313
|
}
|
|
22314
22314
|
const subcommands = resume?.sessionIdFromSubcommand;
|
|
22315
22315
|
if (Array.isArray(subcommands) && subcommands.length > 0) {
|
|
22316
|
+
const hasResumeSubcommand = args.some((arg) => subcommands.includes(arg));
|
|
22316
22317
|
const subcommandSessionId = readSubcommandSessionId(args, subcommands);
|
|
22317
22318
|
if (subcommandSessionId) {
|
|
22318
22319
|
return { providerSessionId: subcommandSessionId, launchMode: "resume" };
|
|
22319
22320
|
}
|
|
22321
|
+
if (hasResumeSubcommand) {
|
|
22322
|
+
return { launchMode: "resume" };
|
|
22323
|
+
}
|
|
22320
22324
|
}
|
|
22321
22325
|
return { launchMode: "manual" };
|
|
22322
22326
|
}
|
|
@@ -22340,6 +22344,12 @@ function resolveCliSessionBinding(provider, normalizedType, cliArgs, requestedRe
|
|
|
22340
22344
|
launchMode: explicit.launchMode
|
|
22341
22345
|
};
|
|
22342
22346
|
}
|
|
22347
|
+
if (explicit.launchMode === "resume") {
|
|
22348
|
+
return {
|
|
22349
|
+
cliArgs: baseArgs,
|
|
22350
|
+
launchMode: "resume"
|
|
22351
|
+
};
|
|
22352
|
+
}
|
|
22343
22353
|
if (explicit.launchMode === "manual" && hasArg(baseArgs || [], ["--session-id"])) {
|
|
22344
22354
|
return {
|
|
22345
22355
|
cliArgs: baseArgs,
|
|
@@ -26489,12 +26499,114 @@ function buildMeshNodeDisplayLabel(node, nodeId, providerPriority) {
|
|
|
26489
26499
|
if (explicit) return explicit;
|
|
26490
26500
|
const workspace = readStringValue(node.workspace, node.repoRoot, node.repo_root);
|
|
26491
26501
|
const workspaceName = workspace ? (0, import_path8.basename)(workspace) : void 0;
|
|
26492
|
-
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);
|
|
26493
26503
|
const provider = providerPriority[0] || (Array.isArray(node.providers) ? readStringValue(...node.providers) : void 0);
|
|
26494
26504
|
const parts = [workspaceName, host, provider].filter(Boolean);
|
|
26495
26505
|
if (parts.length > 0) return parts.join(" \xB7 ");
|
|
26496
26506
|
return nodeId || "unidentified mesh node";
|
|
26497
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
|
+
}
|
|
26498
26610
|
function normalizeInlineMeshGitStatus(status, node, options) {
|
|
26499
26611
|
const isGitRepo = readBooleanValue(status.isGitRepo);
|
|
26500
26612
|
if (!Object.keys(status).length || isGitRepo === void 0) return void 0;
|
|
@@ -30553,6 +30665,7 @@ ${block2}`);
|
|
|
30553
30665
|
return failureResult;
|
|
30554
30666
|
}
|
|
30555
30667
|
const directTruthUnavailableNodeIds = new Set(effectiveDirectTruth.unavailableNodeIds);
|
|
30668
|
+
const coordinatorHostname = (0, import_os3.hostname)();
|
|
30556
30669
|
const selectedCoordinatorNodeId = readStringValue(
|
|
30557
30670
|
mesh.coordinator?.preferredNodeId,
|
|
30558
30671
|
mesh.nodes?.[0]?.id,
|
|
@@ -30570,6 +30683,12 @@ ${block2}`);
|
|
|
30570
30683
|
) || Boolean(
|
|
30571
30684
|
daemonId && (daemonId === localMachineId || daemonId === this.deps.statusInstanceId)
|
|
30572
30685
|
) || Boolean(meshRecord?.inline && nodeIndex === 0);
|
|
30686
|
+
const machineIdentity = buildMeshNodeMachineIdentity(node, {
|
|
30687
|
+
localMachineId,
|
|
30688
|
+
localDaemonId: this.deps.statusInstanceId,
|
|
30689
|
+
coordinatorHostname,
|
|
30690
|
+
isSelfNode
|
|
30691
|
+
});
|
|
30573
30692
|
const status = {
|
|
30574
30693
|
nodeId,
|
|
30575
30694
|
machineLabel: buildMeshNodeDisplayLabel(node, nodeId, providerPriority),
|
|
@@ -30580,7 +30699,8 @@ ${block2}`);
|
|
|
30580
30699
|
worktreeBranch: node.worktreeBranch,
|
|
30581
30700
|
role: normalizeMeshDaemonRole(node.role) || (meshHost.hostNodeId && nodeId === meshHost.hostNodeId ? "host" : void 0),
|
|
30582
30701
|
daemonId,
|
|
30583
|
-
machineId: node.machineId,
|
|
30702
|
+
machineId: readMeshNodeMachineId(node) || node.machineId,
|
|
30703
|
+
machine: machineIdentity,
|
|
30584
30704
|
machineStatus: node.machineStatus,
|
|
30585
30705
|
health: "unknown",
|
|
30586
30706
|
providers: node.providers || [],
|