@adhdev/daemon-standalone 1.0.39-rc.3 → 1.0.39-rc.4
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 +133 -118
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -36528,10 +36528,10 @@ var require_dist3 = __commonJS({
|
|
|
36528
36528
|
}
|
|
36529
36529
|
function getDaemonBuildInfo() {
|
|
36530
36530
|
if (cached2) return cached2;
|
|
36531
|
-
const commit = readInjected(true ? "
|
|
36532
|
-
const commitShort = readInjected(true ? "
|
|
36533
|
-
const version2 = readInjected(true ? "1.0.39-rc.
|
|
36534
|
-
const builtAt = readInjected(true ? "2026-08-
|
|
36531
|
+
const commit = readInjected(true ? "501b92e11df69e7a1e1a20767fd4c924e8bd4f95" : void 0) ?? "unknown";
|
|
36532
|
+
const commitShort = readInjected(true ? "501b92e1" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
36533
|
+
const version2 = readInjected(true ? "1.0.39-rc.4" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
36534
|
+
const builtAt = readInjected(true ? "2026-08-07T12:41:05.960Z" : void 0);
|
|
36535
36535
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
36536
36536
|
return cached2;
|
|
36537
36537
|
}
|
|
@@ -40714,7 +40714,7 @@ child.on('exit', () => process.exit(0));
|
|
|
40714
40714
|
resolveWorktreePath: () => resolveWorktreePath
|
|
40715
40715
|
});
|
|
40716
40716
|
function getDefaultWorktreeBaseDir() {
|
|
40717
|
-
return path11.join(
|
|
40717
|
+
return path11.join(resolveConfigDir(), WORKTREE_DIR_NAME);
|
|
40718
40718
|
}
|
|
40719
40719
|
function resolveWorktreeBaseDir(worktreeBaseDir) {
|
|
40720
40720
|
const override = typeof worktreeBaseDir === "string" ? worktreeBaseDir.trim() : "";
|
|
@@ -41004,7 +41004,6 @@ ${error48.message || ""}`;
|
|
|
41004
41004
|
}
|
|
41005
41005
|
}
|
|
41006
41006
|
var path11;
|
|
41007
|
-
var os52;
|
|
41008
41007
|
var import_promises3;
|
|
41009
41008
|
var import_node_fs2;
|
|
41010
41009
|
var import_node_child_process3;
|
|
@@ -41018,11 +41017,11 @@ ${error48.message || ""}`;
|
|
|
41018
41017
|
"src/git/git-worktree.ts"() {
|
|
41019
41018
|
"use strict";
|
|
41020
41019
|
path11 = __toESM2(require("path"));
|
|
41021
|
-
os52 = __toESM2(require("os"));
|
|
41022
41020
|
import_promises3 = require("fs/promises");
|
|
41023
41021
|
import_node_fs2 = require("fs");
|
|
41024
41022
|
import_node_child_process3 = require("child_process");
|
|
41025
41023
|
import_node_util2 = require("util");
|
|
41024
|
+
init_config_dir();
|
|
41026
41025
|
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process3.execFile);
|
|
41027
41026
|
WORKTREE_DIR_NAME = "worktrees";
|
|
41028
41027
|
GIT_TIMEOUT_MS = 3e4;
|
|
@@ -41033,7 +41032,7 @@ ${error48.message || ""}`;
|
|
|
41033
41032
|
function expandPath(p) {
|
|
41034
41033
|
const t = (p || "").trim();
|
|
41035
41034
|
if (!t) return "";
|
|
41036
|
-
if (t.startsWith("~")) return path13.join(
|
|
41035
|
+
if (t.startsWith("~")) return path13.join(os62.homedir(), t.slice(1).replace(/^\//, ""));
|
|
41037
41036
|
return path13.resolve(t);
|
|
41038
41037
|
}
|
|
41039
41038
|
function validateWorkspacePath(absPath) {
|
|
@@ -41106,7 +41105,7 @@ ${error48.message || ""}`;
|
|
|
41106
41105
|
};
|
|
41107
41106
|
}
|
|
41108
41107
|
if (a.useHome === true) {
|
|
41109
|
-
return { ok: true, path:
|
|
41108
|
+
return { ok: true, path: os62.homedir(), source: "home" };
|
|
41110
41109
|
}
|
|
41111
41110
|
return {
|
|
41112
41111
|
ok: false,
|
|
@@ -41190,7 +41189,7 @@ ${error48.message || ""}`;
|
|
|
41190
41189
|
return { config: { ...config2, defaultWorkspaceId: id } };
|
|
41191
41190
|
}
|
|
41192
41191
|
var fs7;
|
|
41193
|
-
var
|
|
41192
|
+
var os62;
|
|
41194
41193
|
var path13;
|
|
41195
41194
|
var import_crypto22;
|
|
41196
41195
|
var MAX_WORKSPACES;
|
|
@@ -41198,7 +41197,7 @@ ${error48.message || ""}`;
|
|
|
41198
41197
|
"src/config/workspaces.ts"() {
|
|
41199
41198
|
"use strict";
|
|
41200
41199
|
fs7 = __toESM2(require("fs"));
|
|
41201
|
-
|
|
41200
|
+
os62 = __toESM2(require("os"));
|
|
41202
41201
|
path13 = __toESM2(require("path"));
|
|
41203
41202
|
import_crypto22 = require("crypto");
|
|
41204
41203
|
MAX_WORKSPACES = 50;
|
|
@@ -46795,11 +46794,11 @@ Next step: ${nextStep}`;
|
|
|
46795
46794
|
const pinnedProvider = typeof providerType === "string" && providerType.trim() ? providerType.trim() : void 0;
|
|
46796
46795
|
const providerTags = pinnedProvider ? [pinnedProvider] : readNodeProviderTypes(node?.policy);
|
|
46797
46796
|
const worktreeBranch = typeof node?.worktreeBranch === "string" && node.worktreeBranch.trim() ? node.worktreeBranch.trim() : null;
|
|
46798
|
-
const
|
|
46797
|
+
const os29 = readNodeOverride(node, "platform") ?? readNodeReporter(node, "platform") ?? process.platform;
|
|
46799
46798
|
const arch2 = readNodeOverride(node, "arch") ?? readNodeReporter(node, "arch") ?? process.arch;
|
|
46800
46799
|
return normalizeMeshCapabilityTags([
|
|
46801
46800
|
...Array.isArray(node?.capabilities) ? node.capabilities : [],
|
|
46802
|
-
`os=${
|
|
46801
|
+
`os=${os29}`,
|
|
46803
46802
|
`arch=${arch2}`,
|
|
46804
46803
|
...providerTags.map((p) => `provider=${p}`),
|
|
46805
46804
|
// Worktree nodes automatically expose a "worktree=<branch>" tag so that
|
|
@@ -53181,14 +53180,14 @@ When the user asks to **set up / configure / onboard** this repo for Repo Mesh (
|
|
|
53181
53180
|
}
|
|
53182
53181
|
function resolveHermesCoordinatorHome(meshId, workspace) {
|
|
53183
53182
|
const key2 = `${meshId || "mesh"}
|
|
53184
|
-
${(0, import_node_path3.resolve)(workspace ||
|
|
53183
|
+
${(0, import_node_path3.resolve)(workspace || os7.tmpdir())}`;
|
|
53185
53184
|
const hash2 = shortHash(key2);
|
|
53186
|
-
return (0, import_node_path3.join)(
|
|
53185
|
+
return (0, import_node_path3.join)(os7.tmpdir(), `adhdev-hermes-mesh-coordinator-${hash2}`);
|
|
53187
53186
|
}
|
|
53188
53187
|
function resolveMcpConfigPath(configPath, workspace) {
|
|
53189
53188
|
const trimmed = configPath.trim();
|
|
53190
|
-
if (trimmed === "~") return
|
|
53191
|
-
if (trimmed.startsWith("~/")) return (0, import_node_path3.join)(
|
|
53189
|
+
if (trimmed === "~") return os7.homedir();
|
|
53190
|
+
if (trimmed.startsWith("~/")) return (0, import_node_path3.join)(os7.homedir(), trimmed.slice(2));
|
|
53192
53191
|
if ((0, import_node_path3.isAbsolute)(trimmed)) return trimmed;
|
|
53193
53192
|
return (0, import_node_path3.join)(workspace, trimmed);
|
|
53194
53193
|
}
|
|
@@ -53394,7 +53393,7 @@ ${rendered}`, "utf-8");
|
|
|
53394
53393
|
});
|
|
53395
53394
|
}
|
|
53396
53395
|
var import_node_fs3;
|
|
53397
|
-
var
|
|
53396
|
+
var os7;
|
|
53398
53397
|
var import_session_host_core32;
|
|
53399
53398
|
var import_node_path3;
|
|
53400
53399
|
var DEFAULT_SERVER_NAME;
|
|
@@ -53405,7 +53404,7 @@ ${rendered}`, "utf-8");
|
|
|
53405
53404
|
"src/commands/mesh-coordinator.ts"() {
|
|
53406
53405
|
"use strict";
|
|
53407
53406
|
import_node_fs3 = require("fs");
|
|
53408
|
-
|
|
53407
|
+
os7 = __toESM2(require("os"));
|
|
53409
53408
|
import_session_host_core32 = require_dist();
|
|
53410
53409
|
import_node_path3 = require("path");
|
|
53411
53410
|
init_logger();
|
|
@@ -61201,7 +61200,7 @@ The mesh has no work in flight. For each mission, decide its outcome: continue i
|
|
|
61201
61200
|
continue;
|
|
61202
61201
|
}
|
|
61203
61202
|
if (!isLaunchableNode(node)) {
|
|
61204
|
-
markSkip(nodeId, "
|
|
61203
|
+
markSkip(nodeId, "node_health_not_launchable");
|
|
61205
61204
|
continue;
|
|
61206
61205
|
}
|
|
61207
61206
|
if (!isMeshNodeFreshEnoughToLaunch(node, freshnessGate)) {
|
|
@@ -62240,7 +62239,7 @@ The mesh has no work in flight. For each mission, decide its outcome: continue i
|
|
|
62240
62239
|
}
|
|
62241
62240
|
});
|
|
62242
62241
|
async function updateDarwinMemoryCache() {
|
|
62243
|
-
if (
|
|
62242
|
+
if (os8.platform() !== "darwin") return;
|
|
62244
62243
|
try {
|
|
62245
62244
|
const { stdout } = await execAsync2("vm_stat", {
|
|
62246
62245
|
encoding: "utf-8",
|
|
@@ -62264,26 +62263,26 @@ The mesh has no work in flight. For each mission, decide its outcome: continue i
|
|
|
62264
62263
|
const fileBacked = counts["file_backed"] ?? 0;
|
|
62265
62264
|
const availPages = free + inactive + speculative + purgeable + fileBacked;
|
|
62266
62265
|
const bytes = availPages * pageSize;
|
|
62267
|
-
cachedDarwinAvail = Number.isFinite(bytes) && bytes >= 0 ? Math.min(bytes,
|
|
62266
|
+
cachedDarwinAvail = Number.isFinite(bytes) && bytes >= 0 ? Math.min(bytes, os8.totalmem()) : null;
|
|
62268
62267
|
} catch {
|
|
62269
62268
|
}
|
|
62270
62269
|
}
|
|
62271
62270
|
function getHostMemorySnapshot() {
|
|
62272
|
-
if (
|
|
62271
|
+
if (os8.platform() === "darwin" && !darwinMemoryInterval) {
|
|
62273
62272
|
updateDarwinMemoryCache();
|
|
62274
62273
|
darwinMemoryInterval = setInterval(updateDarwinMemoryCache, 3e3);
|
|
62275
62274
|
darwinMemoryInterval.unref();
|
|
62276
62275
|
}
|
|
62277
|
-
const totalMem =
|
|
62278
|
-
const freeMem =
|
|
62279
|
-
const availableMem =
|
|
62276
|
+
const totalMem = os8.totalmem();
|
|
62277
|
+
const freeMem = os8.freemem();
|
|
62278
|
+
const availableMem = os8.platform() === "darwin" ? cachedDarwinAvail ?? freeMem : freeMem;
|
|
62280
62279
|
return {
|
|
62281
62280
|
totalMem,
|
|
62282
62281
|
freeMem,
|
|
62283
62282
|
availableMem
|
|
62284
62283
|
};
|
|
62285
62284
|
}
|
|
62286
|
-
var
|
|
62285
|
+
var os8;
|
|
62287
62286
|
var import_child_process4;
|
|
62288
62287
|
var import_util3;
|
|
62289
62288
|
var execAsync2;
|
|
@@ -62292,7 +62291,7 @@ The mesh has no work in flight. For each mission, decide its outcome: continue i
|
|
|
62292
62291
|
var init_host_memory = __esm2({
|
|
62293
62292
|
"src/system/host-memory.ts"() {
|
|
62294
62293
|
"use strict";
|
|
62295
|
-
|
|
62294
|
+
os8 = __toESM2(require("os"));
|
|
62296
62295
|
import_child_process4 = require("child_process");
|
|
62297
62296
|
import_util3 = require("util");
|
|
62298
62297
|
execAsync2 = (0, import_util3.promisify)(import_child_process4.exec);
|
|
@@ -63431,8 +63430,8 @@ ${cleanBody}`;
|
|
|
63431
63430
|
}
|
|
63432
63431
|
function buildMachineInfo2(profile = "full") {
|
|
63433
63432
|
const base = {
|
|
63434
|
-
hostname:
|
|
63435
|
-
platform:
|
|
63433
|
+
hostname: os9.hostname(),
|
|
63434
|
+
platform: os9.platform()
|
|
63436
63435
|
};
|
|
63437
63436
|
if (profile === "live") {
|
|
63438
63437
|
return base;
|
|
@@ -63441,23 +63440,23 @@ ${cleanBody}`;
|
|
|
63441
63440
|
const memSnap2 = getHostMemorySnapshot();
|
|
63442
63441
|
return {
|
|
63443
63442
|
...base,
|
|
63444
|
-
arch:
|
|
63445
|
-
cpus:
|
|
63443
|
+
arch: os9.arch(),
|
|
63444
|
+
cpus: os9.cpus().length,
|
|
63446
63445
|
totalMem: memSnap2.totalMem,
|
|
63447
|
-
release:
|
|
63446
|
+
release: os9.release()
|
|
63448
63447
|
};
|
|
63449
63448
|
}
|
|
63450
63449
|
const memSnap = getHostMemorySnapshot();
|
|
63451
63450
|
return {
|
|
63452
63451
|
...base,
|
|
63453
|
-
arch:
|
|
63454
|
-
cpus:
|
|
63452
|
+
arch: os9.arch(),
|
|
63453
|
+
cpus: os9.cpus().length,
|
|
63455
63454
|
totalMem: memSnap.totalMem,
|
|
63456
63455
|
freeMem: memSnap.freeMem,
|
|
63457
63456
|
availableMem: memSnap.availableMem,
|
|
63458
|
-
loadavg:
|
|
63459
|
-
uptime:
|
|
63460
|
-
release:
|
|
63457
|
+
loadavg: os9.loadavg(),
|
|
63458
|
+
uptime: os9.uptime(),
|
|
63459
|
+
release: os9.release()
|
|
63461
63460
|
};
|
|
63462
63461
|
}
|
|
63463
63462
|
function parseMessageTime(value) {
|
|
@@ -63694,13 +63693,13 @@ ${cleanBody}`;
|
|
|
63694
63693
|
}
|
|
63695
63694
|
};
|
|
63696
63695
|
}
|
|
63697
|
-
var
|
|
63696
|
+
var os9;
|
|
63698
63697
|
var READ_DEBUG_ENABLED;
|
|
63699
63698
|
var recentReadDebugSignatureBySession;
|
|
63700
63699
|
var init_snapshot2 = __esm2({
|
|
63701
63700
|
"src/status/snapshot.ts"() {
|
|
63702
63701
|
"use strict";
|
|
63703
|
-
|
|
63702
|
+
os9 = __toESM2(require("os"));
|
|
63704
63703
|
init_config();
|
|
63705
63704
|
init_state_store();
|
|
63706
63705
|
init_recent_activity();
|
|
@@ -70331,14 +70330,14 @@ ${cleanBody}`;
|
|
|
70331
70330
|
}
|
|
70332
70331
|
return cachedPty;
|
|
70333
70332
|
}
|
|
70334
|
-
var
|
|
70333
|
+
var os12;
|
|
70335
70334
|
var cachedPty;
|
|
70336
70335
|
var NodePtyRuntimeTransport;
|
|
70337
70336
|
var NodePtyTransportFactory;
|
|
70338
70337
|
var init_pty_transport = __esm2({
|
|
70339
70338
|
"src/cli-adapters/pty-transport.ts"() {
|
|
70340
70339
|
"use strict";
|
|
70341
|
-
|
|
70340
|
+
os12 = __toESM2(require("os"));
|
|
70342
70341
|
init_spawn_env();
|
|
70343
70342
|
init_resolve_executable();
|
|
70344
70343
|
NodePtyRuntimeTransport = class {
|
|
@@ -70378,9 +70377,9 @@ ${cleanBody}`;
|
|
|
70378
70377
|
try {
|
|
70379
70378
|
const fs54 = require("fs");
|
|
70380
70379
|
const stat2 = fs54.statSync(cwd);
|
|
70381
|
-
if (!stat2.isDirectory()) cwd =
|
|
70380
|
+
if (!stat2.isDirectory()) cwd = os12.homedir();
|
|
70382
70381
|
} catch {
|
|
70383
|
-
cwd =
|
|
70382
|
+
cwd = os12.homedir();
|
|
70384
70383
|
}
|
|
70385
70384
|
}
|
|
70386
70385
|
const handle = pty.spawn(resolveWin32Executable(command), args, {
|
|
@@ -72843,7 +72842,7 @@ ${cont}` : cont;
|
|
|
72843
72842
|
function resolveCliSpawnPlanFromParts(options) {
|
|
72844
72843
|
const { command, baseArgs, shell, baseEnv, workingDir, extraArgs, extraEnv, geometry, diagnosticCliType, diagnosticProviderVersion } = options;
|
|
72845
72844
|
const binaryPath = findBinary(command);
|
|
72846
|
-
const isWin =
|
|
72845
|
+
const isWin = os13.platform() === "win32";
|
|
72847
72846
|
const allArgs = [...baseArgs ?? [], ...extraArgs ?? []].map(
|
|
72848
72847
|
(arg) => typeof arg === "string" ? arg.replace(/\{\{workingDir\}\}/g, workingDir) : arg
|
|
72849
72848
|
);
|
|
@@ -72931,13 +72930,13 @@ ${cont}` : cont;
|
|
|
72931
72930
|
}
|
|
72932
72931
|
return "";
|
|
72933
72932
|
}
|
|
72934
|
-
var
|
|
72933
|
+
var os13;
|
|
72935
72934
|
var path27;
|
|
72936
72935
|
var import_session_host_core7;
|
|
72937
72936
|
var init_provider_cli_runtime = __esm2({
|
|
72938
72937
|
"src/cli-adapters/provider-cli-runtime.ts"() {
|
|
72939
72938
|
"use strict";
|
|
72940
|
-
|
|
72939
|
+
os13 = __toESM2(require("os"));
|
|
72941
72940
|
path27 = __toESM2(require("path"));
|
|
72942
72941
|
init_logger();
|
|
72943
72942
|
import_session_host_core7 = require_dist();
|
|
@@ -73081,7 +73080,7 @@ ${cont}` : cont;
|
|
|
73081
73080
|
}
|
|
73082
73081
|
function expandTemplateRootForEnumeration(template, input) {
|
|
73083
73082
|
if (!template) return "";
|
|
73084
|
-
const posixHome = () => toPosixPath(
|
|
73083
|
+
const posixHome = () => toPosixPath(os14.homedir());
|
|
73085
73084
|
let out = template;
|
|
73086
73085
|
if (out === "~") out = posixHome();
|
|
73087
73086
|
else if (out.startsWith("~/")) out = `${posixHome()}/${out.slice(2)}`;
|
|
@@ -73639,13 +73638,13 @@ ${cont}` : cont;
|
|
|
73639
73638
|
if (!template) return null;
|
|
73640
73639
|
let out = template;
|
|
73641
73640
|
if (out.startsWith("~/") || out === "~") {
|
|
73642
|
-
out = path28.join(
|
|
73641
|
+
out = path28.join(os14.homedir(), out.slice(2));
|
|
73643
73642
|
}
|
|
73644
73643
|
out = out.replace(/\$\{([A-Z_][A-Z0-9_]*)(?::-(.*?))?\}/g, (_m, name, fallback) => {
|
|
73645
73644
|
const v = input.envOverrides?.[name] ?? process.env[name];
|
|
73646
73645
|
return v != null && v !== "" ? v : fallback ?? "";
|
|
73647
73646
|
});
|
|
73648
|
-
if (out.startsWith("~/")) out = path28.join(
|
|
73647
|
+
if (out.startsWith("~/")) out = path28.join(os14.homedir(), out.slice(2));
|
|
73649
73648
|
const now = /* @__PURE__ */ new Date();
|
|
73650
73649
|
const workspaceRaw = input.workspace ?? "";
|
|
73651
73650
|
let workspaceResolved = workspaceRaw;
|
|
@@ -73688,7 +73687,7 @@ ${cont}` : cont;
|
|
|
73688
73687
|
function scanProjectsRootForSessionFile(template, input, requestedSessionId) {
|
|
73689
73688
|
if (!requestedSessionId) return null;
|
|
73690
73689
|
let head = template;
|
|
73691
|
-
if (head.startsWith("~/") || head === "~") head = path28.join(
|
|
73690
|
+
if (head.startsWith("~/") || head === "~") head = path28.join(os14.homedir(), head.slice(2));
|
|
73692
73691
|
const base = staticTemplateBase(head);
|
|
73693
73692
|
if (!base) return null;
|
|
73694
73693
|
let baseStat = null;
|
|
@@ -73837,13 +73836,13 @@ ${cont}` : cont;
|
|
|
73837
73836
|
if (!template) return null;
|
|
73838
73837
|
let out = template;
|
|
73839
73838
|
if (out.startsWith("~/") || out === "~") {
|
|
73840
|
-
out = path28.join(
|
|
73839
|
+
out = path28.join(os14.homedir(), out.slice(2));
|
|
73841
73840
|
}
|
|
73842
73841
|
out = out.replace(/\$\{([A-Z_][A-Z0-9_]*)(?::-(.*?))?\}/g, (_m, name, fallback) => {
|
|
73843
73842
|
const v = input.envOverrides?.[name] ?? process.env[name];
|
|
73844
73843
|
return v != null && v !== "" ? v : fallback ?? "";
|
|
73845
73844
|
});
|
|
73846
|
-
if (out.startsWith("~/")) out = path28.join(
|
|
73845
|
+
if (out.startsWith("~/")) out = path28.join(os14.homedir(), out.slice(2));
|
|
73847
73846
|
const workspaceRaw = input.workspace ?? "";
|
|
73848
73847
|
let workspaceResolved = workspaceRaw;
|
|
73849
73848
|
if (workspaceRaw) {
|
|
@@ -74302,7 +74301,7 @@ ${cont}` : cont;
|
|
|
74302
74301
|
return t.negate ? !result : result;
|
|
74303
74302
|
}
|
|
74304
74303
|
var fs222;
|
|
74305
|
-
var
|
|
74304
|
+
var os14;
|
|
74306
74305
|
var path28;
|
|
74307
74306
|
var UUID_RE;
|
|
74308
74307
|
var DEFAULT_TOOL_CALL_TYPES;
|
|
@@ -74311,7 +74310,7 @@ ${cont}` : cont;
|
|
|
74311
74310
|
"src/providers/spec/native-history-executor.ts"() {
|
|
74312
74311
|
"use strict";
|
|
74313
74312
|
fs222 = __toESM2(require("fs"));
|
|
74314
|
-
|
|
74313
|
+
os14 = __toESM2(require("os"));
|
|
74315
74314
|
path28 = __toESM2(require("path"));
|
|
74316
74315
|
init_logger();
|
|
74317
74316
|
init_load_better_sqlite3();
|
|
@@ -74607,7 +74606,7 @@ ${cont}` : cont;
|
|
|
74607
74606
|
missingBackgroundSourceWarned.add(cliType);
|
|
74608
74607
|
LOG2.warn("CLI", `[${cliType}] background-task tracking declared but nativeHistory.source missing after provider resolve; background detection inactive`);
|
|
74609
74608
|
}
|
|
74610
|
-
var
|
|
74609
|
+
var os15;
|
|
74611
74610
|
var import_crypto11;
|
|
74612
74611
|
var import_session_host_core8;
|
|
74613
74612
|
var missingBackgroundSourceWarned;
|
|
@@ -74616,7 +74615,7 @@ ${cont}` : cont;
|
|
|
74616
74615
|
var init_provider_cli_adapter = __esm2({
|
|
74617
74616
|
"src/cli-adapters/provider-cli-adapter.ts"() {
|
|
74618
74617
|
"use strict";
|
|
74619
|
-
|
|
74618
|
+
os15 = __toESM2(require("os"));
|
|
74620
74619
|
import_crypto11 = require("crypto");
|
|
74621
74620
|
init_logger();
|
|
74622
74621
|
init_debug_config();
|
|
@@ -74643,7 +74642,7 @@ ${cont}` : cont;
|
|
|
74643
74642
|
this.transportFactory = transportFactory;
|
|
74644
74643
|
this.cliType = provider.type;
|
|
74645
74644
|
this.cliName = provider.name;
|
|
74646
|
-
this.workingDir = workingDir.startsWith("~") ? workingDir.replace(/^~/,
|
|
74645
|
+
this.workingDir = workingDir.startsWith("~") ? workingDir.replace(/^~/, os15.homedir()) : workingDir;
|
|
74647
74646
|
const resolvedConfig = resolveCliAdapterConfig(provider);
|
|
74648
74647
|
this.timeouts = resolvedConfig.timeouts;
|
|
74649
74648
|
this.approvalKeys = resolvedConfig.approvalKeys;
|
|
@@ -78879,7 +78878,7 @@ ${lastSnapshot}`;
|
|
|
78879
78878
|
};
|
|
78880
78879
|
init_git_worktree();
|
|
78881
78880
|
init_config();
|
|
78882
|
-
var
|
|
78881
|
+
var os52 = __toESM2(require("os"));
|
|
78883
78882
|
var path12 = __toESM2(require("path"));
|
|
78884
78883
|
var import_session_host_core22 = require_dist();
|
|
78885
78884
|
init_config_dir();
|
|
@@ -78923,7 +78922,7 @@ ${lastSnapshot}`;
|
|
|
78923
78922
|
var cached22 = null;
|
|
78924
78923
|
function resolveInstanceContext(options = {}) {
|
|
78925
78924
|
const env2 = options.env ?? process.env;
|
|
78926
|
-
const homeDir = options.homeDir ??
|
|
78925
|
+
const homeDir = options.homeDir ?? os52.homedir();
|
|
78927
78926
|
const envDir = typeof env2.ADHDEV_CONFIG_DIR === "string" ? env2.ADHDEV_CONFIG_DIR.trim() : "";
|
|
78928
78927
|
const explicitDir = typeof options.configDir === "string" ? options.configDir.trim() : "";
|
|
78929
78928
|
if (explicitDir && envDir && (0, import_session_host_core22.canonicalizeInstancePath)(explicitDir) !== (0, import_session_host_core22.canonicalizeInstancePath)(envDir)) {
|
|
@@ -78944,7 +78943,7 @@ ${lastSnapshot}`;
|
|
|
78944
78943
|
}
|
|
78945
78944
|
function getProcessInstanceContext(options = {}) {
|
|
78946
78945
|
const envDir = typeof process.env.ADHDEV_CONFIG_DIR === "string" ? process.env.ADHDEV_CONFIG_DIR.trim() : "";
|
|
78947
|
-
const key2 = `${envDir}|${
|
|
78946
|
+
const key2 = `${envDir}|${os52.homedir()}|${options.standalone ? "standalone" : "daemon"}`;
|
|
78948
78947
|
if (!cached22 || cached22.key !== key2) {
|
|
78949
78948
|
cached22 = { key: key2, context: resolveInstanceContext({ standalone: options.standalone }) };
|
|
78950
78949
|
}
|
|
@@ -80236,17 +80235,17 @@ ${lastSnapshot}`;
|
|
|
80236
80235
|
return null;
|
|
80237
80236
|
}
|
|
80238
80237
|
async function detectIDEs(providerLoader) {
|
|
80239
|
-
const
|
|
80238
|
+
const os29 = (0, import_os3.platform)();
|
|
80240
80239
|
const results = [];
|
|
80241
80240
|
for (const def of getMergedDefinitions()) {
|
|
80242
80241
|
const cliPath = findCliCommand(providerLoader?.getIdeCliCommand(def.id, def.cli) || def.cli);
|
|
80243
|
-
const appPath = checkPathExists(providerLoader?.getIdePathCandidates(def.id, def.paths[
|
|
80242
|
+
const appPath = checkPathExists(providerLoader?.getIdePathCandidates(def.id, def.paths[os29] || []) || []);
|
|
80244
80243
|
let resolvedCli = cliPath;
|
|
80245
|
-
if (!resolvedCli && appPath &&
|
|
80244
|
+
if (!resolvedCli && appPath && os29 === "darwin") {
|
|
80246
80245
|
const bundledCli = `${appPath}/Contents/Resources/app/bin/${def.cli}`;
|
|
80247
80246
|
if ((0, import_fs18.existsSync)(bundledCli)) resolvedCli = bundledCli;
|
|
80248
80247
|
}
|
|
80249
|
-
if (!resolvedCli && appPath &&
|
|
80248
|
+
if (!resolvedCli && appPath && os29 === "win32") {
|
|
80250
80249
|
const { dirname: dirname22 } = await import("path");
|
|
80251
80250
|
const appDir = dirname22(appPath);
|
|
80252
80251
|
const candidates = [
|
|
@@ -80263,7 +80262,7 @@ ${lastSnapshot}`;
|
|
|
80263
80262
|
}
|
|
80264
80263
|
}
|
|
80265
80264
|
}
|
|
80266
|
-
const installed =
|
|
80265
|
+
const installed = os29 === "darwin" ? !!(resolvedCli || appPath) : !!resolvedCli;
|
|
80267
80266
|
const version2 = null;
|
|
80268
80267
|
results.push({
|
|
80269
80268
|
id: def.id,
|
|
@@ -86971,7 +86970,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
86971
86970
|
}
|
|
86972
86971
|
var fs15 = __toESM2(require("fs"));
|
|
86973
86972
|
var path232 = __toESM2(require("path"));
|
|
86974
|
-
var
|
|
86973
|
+
var os10 = __toESM2(require("os"));
|
|
86975
86974
|
var KEY_TO_VK = {
|
|
86976
86975
|
Backspace: 8,
|
|
86977
86976
|
Tab: 9,
|
|
@@ -87225,7 +87224,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
87225
87224
|
function resolveSafePath(requestedPath) {
|
|
87226
87225
|
const rawPath = typeof requestedPath === "string" ? requestedPath.trim() : "";
|
|
87227
87226
|
const inputPath = rawPath || ".";
|
|
87228
|
-
const home =
|
|
87227
|
+
const home = os10.homedir();
|
|
87229
87228
|
if (inputPath.startsWith("~")) {
|
|
87230
87229
|
return path232.resolve(path232.join(home, inputPath.slice(1)));
|
|
87231
87230
|
}
|
|
@@ -89839,12 +89838,13 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
89839
89838
|
var import_child_process8 = require("child_process");
|
|
89840
89839
|
var import_child_process9 = require("child_process");
|
|
89841
89840
|
var fs20 = __toESM2(require("fs"));
|
|
89842
|
-
var
|
|
89841
|
+
var os11 = __toESM2(require("os"));
|
|
89843
89842
|
var path26 = __toESM2(require("path"));
|
|
89844
89843
|
var import_child_process7 = require("child_process");
|
|
89845
89844
|
var fs19 = __toESM2(require("fs"));
|
|
89846
89845
|
var http2 = __toESM2(require("http"));
|
|
89847
89846
|
var path25 = __toESM2(require("path"));
|
|
89847
|
+
init_track_identity();
|
|
89848
89848
|
var import_child_process6 = require("child_process");
|
|
89849
89849
|
init_logger();
|
|
89850
89850
|
function errorText(error48) {
|
|
@@ -90041,7 +90041,9 @@ ${formatManifestValidationIssues2(validation.issues)}`,
|
|
|
90041
90041
|
}
|
|
90042
90042
|
var POINTER_NAME = ".adhdev-current";
|
|
90043
90043
|
var STABLE_FILES = [POINTER_NAME, "adhdev.cmd", "adhdev.ps1", "adhdev"];
|
|
90044
|
-
|
|
90044
|
+
function resolveDefaultHealthPort(env2 = process.env) {
|
|
90045
|
+
return getTrackIdentity(resolveBuildTrack(env2)).defaultPort;
|
|
90046
|
+
}
|
|
90045
90047
|
var DEFAULT_HEALTH_TIMEOUT_MS = 12e4;
|
|
90046
90048
|
function fetchLocalJson(port, pathname) {
|
|
90047
90049
|
return new Promise((resolve29) => {
|
|
@@ -90411,7 +90413,7 @@ exec "${portableNode}" "${cliEntry}" "$@"
|
|
|
90411
90413
|
}
|
|
90412
90414
|
}
|
|
90413
90415
|
function createDefaultWindowsAtomicHooks(options) {
|
|
90414
|
-
const healthPort = options.healthPort ??
|
|
90416
|
+
const healthPort = options.healthPort ?? resolveDefaultHealthPort(options.env);
|
|
90415
90417
|
const healthTimeoutMs = options.healthTimeoutMs ?? DEFAULT_HEALTH_TIMEOUT_MS;
|
|
90416
90418
|
return {
|
|
90417
90419
|
install: (stagedPrefix, portableNode) => {
|
|
@@ -90650,7 +90652,7 @@ exec "${portableNode}" "${cliEntry}" "$@"
|
|
|
90650
90652
|
const packageRoot = findCurrentPackageRoot(options.currentCliPath || process.argv[1], options.packageName);
|
|
90651
90653
|
const npmInvocation = resolveSiblingNpmInvocation(options.nodeExecutable || process.execPath, options.platform);
|
|
90652
90654
|
const platform10 = options.platform || process.platform;
|
|
90653
|
-
const homeDir = options.homeDir ||
|
|
90655
|
+
const homeDir = options.homeDir || os11.homedir();
|
|
90654
90656
|
const instanceDir = options.instanceDir || resolveInstanceDir();
|
|
90655
90657
|
let installPrefix = packageRoot ? resolveInstallPrefixFromPackageRoot(packageRoot, options.packageName) : null;
|
|
90656
90658
|
if (platform10 === "win32" && isPortableNode22Prefix(installPrefix, homeDir, instanceDir)) {
|
|
@@ -91008,12 +91010,12 @@ ${marker}`,
|
|
|
91008
91010
|
}
|
|
91009
91011
|
const instanceDir = resolveInstanceDir();
|
|
91010
91012
|
const windowsInstallerLayout = resolveWindowsInstallerLayout({
|
|
91011
|
-
homeDir:
|
|
91013
|
+
homeDir: os11.homedir(),
|
|
91012
91014
|
installPrefix: installCommand.surface.installPrefix,
|
|
91013
91015
|
instanceDir
|
|
91014
91016
|
});
|
|
91015
91017
|
if (windowsInstallerLayout) {
|
|
91016
|
-
const portableNode = findPortableNode22(
|
|
91018
|
+
const portableNode = findPortableNode22(os11.homedir(), process.execPath, instanceDir);
|
|
91017
91019
|
if (!portableNode) {
|
|
91018
91020
|
throw new Error("installer-managed Windows update requires the portable Node.js 22 runtime");
|
|
91019
91021
|
}
|
|
@@ -92137,7 +92139,7 @@ ${marker}`,
|
|
|
92137
92139
|
})
|
|
92138
92140
|
);
|
|
92139
92141
|
init_dist();
|
|
92140
|
-
var
|
|
92142
|
+
var os20 = __toESM2(require("os"));
|
|
92141
92143
|
var path35 = __toESM2(require("path"));
|
|
92142
92144
|
var crypto6 = __toESM2(require("crypto"));
|
|
92143
92145
|
var import_fs19 = require("fs");
|
|
@@ -92231,7 +92233,7 @@ ${marker}`,
|
|
|
92231
92233
|
}
|
|
92232
92234
|
}
|
|
92233
92235
|
init_summary_metadata();
|
|
92234
|
-
var
|
|
92236
|
+
var os19 = __toESM2(require("os"));
|
|
92235
92237
|
var crypto5 = __toESM2(require("crypto"));
|
|
92236
92238
|
var fs29 = __toESM2(require("fs"));
|
|
92237
92239
|
init_contracts2();
|
|
@@ -92369,7 +92371,7 @@ ${marker}`,
|
|
|
92369
92371
|
var path31 = __toESM2(require("path"));
|
|
92370
92372
|
init_provider_cli_adapter();
|
|
92371
92373
|
var fs25 = __toESM2(require("fs"));
|
|
92372
|
-
var
|
|
92374
|
+
var os17 = __toESM2(require("os"));
|
|
92373
92375
|
var path30 = __toESM2(require("path"));
|
|
92374
92376
|
init_terminal_screen();
|
|
92375
92377
|
var import_session_host_core9 = require_dist();
|
|
@@ -92548,12 +92550,12 @@ ${marker}`,
|
|
|
92548
92550
|
init_fsm_types();
|
|
92549
92551
|
init_fsm_loader();
|
|
92550
92552
|
var fs24 = __toESM2(require("fs"));
|
|
92551
|
-
var
|
|
92553
|
+
var os16 = __toESM2(require("os"));
|
|
92552
92554
|
var path29 = __toESM2(require("path"));
|
|
92553
92555
|
init_logger();
|
|
92554
92556
|
function expandHome2(p) {
|
|
92555
|
-
if (p === "~") return
|
|
92556
|
-
if (p.startsWith("~/")) return path29.join(
|
|
92557
|
+
if (p === "~") return os16.homedir();
|
|
92558
|
+
if (p.startsWith("~/")) return path29.join(os16.homedir(), p.slice(2));
|
|
92557
92559
|
return p;
|
|
92558
92560
|
}
|
|
92559
92561
|
function realWorkspacePath(workingDir) {
|
|
@@ -93363,7 +93365,7 @@ ${marker}`,
|
|
|
93363
93365
|
}
|
|
93364
93366
|
fireDelegate(d) {
|
|
93365
93367
|
const ev = this.currentEval;
|
|
93366
|
-
const task = d.task_template.replace(/\{node\}/g,
|
|
93368
|
+
const task = d.task_template.replace(/\{node\}/g, os17.hostname()).replace(/\{state\.label\}/g, ev?.state.label ?? "").replace(/\{state\.title\}/g, ev?.state.title ?? "").replace(/\{duration_ms\}/g, String(d.after_duration_ms ?? 0));
|
|
93367
93369
|
this.emit({ kind: "delegate", id: d.id, task });
|
|
93368
93370
|
}
|
|
93369
93371
|
// ────────────────────────────────────────────────────────────────────
|
|
@@ -93661,7 +93663,7 @@ ${marker}`,
|
|
|
93661
93663
|
const ctl = (this.spec.control_bar ?? []).find((c) => c.action.type === "attach_image");
|
|
93662
93664
|
if (!ctl || ctl.action.type !== "attach_image") return;
|
|
93663
93665
|
const ext = guessExt(mime);
|
|
93664
|
-
const tmp = path30.join(
|
|
93666
|
+
const tmp = path30.join(os17.tmpdir(), `adhdev-attach-${Date.now()}${ext}`);
|
|
93665
93667
|
try {
|
|
93666
93668
|
fs25.writeFileSync(tmp, Buffer.from(blob, "base64"));
|
|
93667
93669
|
} catch {
|
|
@@ -94962,7 +94964,7 @@ ${marker}`,
|
|
|
94962
94964
|
init_transcript_claim_registry();
|
|
94963
94965
|
init_chat_message_normalization();
|
|
94964
94966
|
init_working_dir();
|
|
94965
|
-
var
|
|
94967
|
+
var os18 = __toESM2(require("os"));
|
|
94966
94968
|
var path322 = __toESM2(require("path"));
|
|
94967
94969
|
var crypto4 = __toESM2(require("crypto"));
|
|
94968
94970
|
var fs28 = __toESM2(require("fs"));
|
|
@@ -95033,7 +95035,7 @@ ${marker}`,
|
|
|
95033
95035
|
const promptParts = [];
|
|
95034
95036
|
const imageRefs = [];
|
|
95035
95037
|
const resourceRefs = [];
|
|
95036
|
-
const materializeDir = options.materializeDir || path322.join(
|
|
95038
|
+
const materializeDir = options.materializeDir || path322.join(os18.tmpdir(), "adhdev-input-media");
|
|
95037
95039
|
input.parts.forEach((part, index) => {
|
|
95038
95040
|
if (part.type === "text" && part.text.trim()) {
|
|
95039
95041
|
promptParts.push(part.text.trim());
|
|
@@ -95772,7 +95774,7 @@ ${marker}`,
|
|
|
95772
95774
|
* Replaces the previously duplicated probeOpenCode/Codex/Goose functions.
|
|
95773
95775
|
*/
|
|
95774
95776
|
probeSessionIdFromConfig(probe) {
|
|
95775
|
-
const resolvedDbPath = probe.dbPath.replace(/^~/,
|
|
95777
|
+
const resolvedDbPath = probe.dbPath.replace(/^~/, os19.homedir());
|
|
95776
95778
|
const now = Date.now();
|
|
95777
95779
|
if (this.cachedSqliteDbMissingUntil > now) return null;
|
|
95778
95780
|
if (!fs29.existsSync(resolvedDbPath)) {
|
|
@@ -100567,7 +100569,7 @@ ${rawInput}` : rawInput;
|
|
|
100567
100569
|
}
|
|
100568
100570
|
function expandExecutable(command) {
|
|
100569
100571
|
const trimmed = command.trim();
|
|
100570
|
-
return trimmed.startsWith("~") ? path35.join(
|
|
100572
|
+
return trimmed.startsWith("~") ? path35.join(os20.homedir(), trimmed.slice(1)) : trimmed;
|
|
100571
100573
|
}
|
|
100572
100574
|
function commandExists(command) {
|
|
100573
100575
|
const trimmed = command.trim();
|
|
@@ -100717,9 +100719,9 @@ ${rawInput}` : rawInput;
|
|
|
100717
100719
|
return false;
|
|
100718
100720
|
}
|
|
100719
100721
|
function ensureEmptyDelegatedMcpConfig(workspace) {
|
|
100720
|
-
const baseDir = path35.join(
|
|
100722
|
+
const baseDir = path35.join(os20.tmpdir(), "adhdev-delegated-agent-empty-mcp");
|
|
100721
100723
|
(0, import_fs19.mkdirSync)(baseDir, { recursive: true });
|
|
100722
|
-
const workspaceHash = shortHash(path35.resolve(workspace ||
|
|
100724
|
+
const workspaceHash = shortHash(path35.resolve(workspace || os20.tmpdir()));
|
|
100723
100725
|
const filePath = path35.join(baseDir, `${workspaceHash}.json`);
|
|
100724
100726
|
(0, import_fs19.writeFileSync)(filePath, JSON.stringify({ mcpServers: {} }, null, 2), "utf-8");
|
|
100725
100727
|
return filePath;
|
|
@@ -101114,7 +101116,7 @@ ${rawInput}` : rawInput;
|
|
|
101114
101116
|
async startSession(cliType, workingDir, cliArgs, initialModel, options) {
|
|
101115
101117
|
const trimmed = (workingDir || "").trim();
|
|
101116
101118
|
if (!trimmed) throw new Error("working directory required");
|
|
101117
|
-
const resolvedDir = trimmed.startsWith("~") ? trimmed.replace(/^~/,
|
|
101119
|
+
const resolvedDir = trimmed.startsWith("~") ? trimmed.replace(/^~/, os20.homedir()) : path35.resolve(trimmed);
|
|
101118
101120
|
const normalizedType = this.providerLoader.resolveAlias(cliType);
|
|
101119
101121
|
const rawProvider = this.providerLoader.getByAlias(cliType);
|
|
101120
101122
|
const provider = rawProvider ? this.providerLoader.resolve(normalizedType) || rawProvider : void 0;
|
|
@@ -102141,11 +102143,11 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
102141
102143
|
};
|
|
102142
102144
|
var import_child_process12 = require("child_process");
|
|
102143
102145
|
var net3 = __toESM2(require("net"));
|
|
102144
|
-
var
|
|
102146
|
+
var os25 = __toESM2(require("os"));
|
|
102145
102147
|
var path46 = __toESM2(require("path"));
|
|
102146
102148
|
var fs39 = __toESM2(require("fs"));
|
|
102147
102149
|
var path45 = __toESM2(require("path"));
|
|
102148
|
-
var
|
|
102150
|
+
var os24 = __toESM2(require("os"));
|
|
102149
102151
|
var chokidar = __toESM2(require_chokidar());
|
|
102150
102152
|
init_hash();
|
|
102151
102153
|
init_logger();
|
|
@@ -102620,7 +102622,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
102620
102622
|
init_config();
|
|
102621
102623
|
init_native_history_executor();
|
|
102622
102624
|
var fs35 = __toESM2(require("fs"));
|
|
102623
|
-
var
|
|
102625
|
+
var os23 = __toESM2(require("os"));
|
|
102624
102626
|
var path40 = __toESM2(require("path"));
|
|
102625
102627
|
var fs31 = __toESM2(require("fs"));
|
|
102626
102628
|
var path36 = __toESM2(require("path"));
|
|
@@ -103126,7 +103128,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
103126
103128
|
}
|
|
103127
103129
|
var fs33 = __toESM2(require("fs"));
|
|
103128
103130
|
var path38 = __toESM2(require("path"));
|
|
103129
|
-
var
|
|
103131
|
+
var os21 = __toESM2(require("os"));
|
|
103130
103132
|
init_load_better_sqlite3();
|
|
103131
103133
|
init_logger();
|
|
103132
103134
|
function extractTimestampValue3(value) {
|
|
@@ -103150,7 +103152,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
103150
103152
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
103151
103153
|
}
|
|
103152
103154
|
function antigravityRoot() {
|
|
103153
|
-
return path38.join(
|
|
103155
|
+
return path38.join(os21.homedir(), ".gemini", "antigravity-cli");
|
|
103154
103156
|
}
|
|
103155
103157
|
function historyJsonlPath() {
|
|
103156
103158
|
return path38.join(antigravityRoot(), "history.jsonl");
|
|
@@ -103737,11 +103739,11 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
103737
103739
|
}
|
|
103738
103740
|
var fs34 = __toESM2(require("fs"));
|
|
103739
103741
|
var path39 = __toESM2(require("path"));
|
|
103740
|
-
var
|
|
103742
|
+
var os222 = __toESM2(require("os"));
|
|
103741
103743
|
init_load_better_sqlite3();
|
|
103742
103744
|
init_usage_normalize();
|
|
103743
|
-
var HERMES_STATE_DB = path39.join(
|
|
103744
|
-
var HERMES_LEGACY_SESSIONS_DIR = path39.join(
|
|
103745
|
+
var HERMES_STATE_DB = path39.join(os222.homedir(), ".hermes", "state.db");
|
|
103746
|
+
var HERMES_LEGACY_SESSIONS_DIR = path39.join(os222.homedir(), ".hermes", "sessions");
|
|
103745
103747
|
function statMtimeMs4(p) {
|
|
103746
103748
|
try {
|
|
103747
103749
|
return Math.floor(fs34.statSync(p).mtimeMs);
|
|
@@ -104026,7 +104028,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
104026
104028
|
}
|
|
104027
104029
|
}
|
|
104028
104030
|
function resolveClaudePath(workspace, sessionId) {
|
|
104029
|
-
const dir = path40.join(
|
|
104031
|
+
const dir = path40.join(os23.homedir(), ".claude", "projects", cwdAsDashes(workspace));
|
|
104030
104032
|
if (!fs35.existsSync(dir)) return null;
|
|
104031
104033
|
if (sessionId) {
|
|
104032
104034
|
const candidate = path40.join(dir, `${sessionId}.jsonl`);
|
|
@@ -104148,7 +104150,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
104148
104150
|
}
|
|
104149
104151
|
var AGY_SPAWN_CLAIM_GRACE_MS = 2e3;
|
|
104150
104152
|
function resolveAntigravityPath(workspace, sessionId, sessionStartedAtMs, instanceId) {
|
|
104151
|
-
const agyRoot = path40.join(
|
|
104153
|
+
const agyRoot = path40.join(os23.homedir(), ".gemini", "antigravity-cli");
|
|
104152
104154
|
const owner = antigravityOwnerToken(workspace, sessionStartedAtMs, instanceId);
|
|
104153
104155
|
if (sessionId && isUuidLikeSessionId2(sessionId)) {
|
|
104154
104156
|
const dbPath = path40.join(agyRoot, "conversations", `${sessionId}.db`);
|
|
@@ -104232,9 +104234,9 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
104232
104234
|
function resolveHermesPath(workspace, sessionId) {
|
|
104233
104235
|
void workspace;
|
|
104234
104236
|
void sessionId;
|
|
104235
|
-
const dbPath = path40.join(
|
|
104237
|
+
const dbPath = path40.join(os23.homedir(), ".hermes", "state.db");
|
|
104236
104238
|
if (fs35.existsSync(dbPath)) return dbPath;
|
|
104237
|
-
const dir = path40.join(
|
|
104239
|
+
const dir = path40.join(os23.homedir(), ".hermes", "sessions");
|
|
104238
104240
|
if (!fs35.existsSync(dir)) return null;
|
|
104239
104241
|
return newestRecentFile2(dir, /^session_.*\.json$/);
|
|
104240
104242
|
}
|
|
@@ -104260,7 +104262,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
104260
104262
|
return cwd.replace(/\//g, "-");
|
|
104261
104263
|
}
|
|
104262
104264
|
function codexSessionsRoot() {
|
|
104263
|
-
return path40.join(
|
|
104265
|
+
return path40.join(os23.homedir(), ".codex", "sessions");
|
|
104264
104266
|
}
|
|
104265
104267
|
function isUuidLikeSessionId2(sessionId) {
|
|
104266
104268
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(sessionId);
|
|
@@ -106666,8 +106668,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
106666
106668
|
return { updated: false };
|
|
106667
106669
|
}
|
|
106668
106670
|
this.log("Downloading latest providers from GitHub...");
|
|
106669
|
-
const tmpTar = path45.join(
|
|
106670
|
-
const tmpExtract = path45.join(
|
|
106671
|
+
const tmpTar = path45.join(os24.tmpdir(), `adhdev-providers-${Date.now()}.tar.gz`);
|
|
106672
|
+
const tmpExtract = path45.join(os24.tmpdir(), `adhdev-providers-extract-${Date.now()}`);
|
|
106671
106673
|
await this.downloadFile(tarballTarget.url, tmpTar);
|
|
106672
106674
|
fs39.mkdirSync(tmpExtract, { recursive: true });
|
|
106673
106675
|
await extractTarballGz(tmpTar, tmpExtract);
|
|
@@ -107422,7 +107424,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
107422
107424
|
});
|
|
107423
107425
|
}
|
|
107424
107426
|
async function killIdeProcess(ideId) {
|
|
107425
|
-
const plat =
|
|
107427
|
+
const plat = os25.platform();
|
|
107426
107428
|
const appName = getMacAppIdentifiers()[ideId];
|
|
107427
107429
|
const winProcesses = getWinProcessNames()[ideId];
|
|
107428
107430
|
try {
|
|
@@ -107483,7 +107485,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
107483
107485
|
}
|
|
107484
107486
|
}
|
|
107485
107487
|
async function isIdeRunning(ideId) {
|
|
107486
|
-
const plat =
|
|
107488
|
+
const plat = os25.platform();
|
|
107487
107489
|
try {
|
|
107488
107490
|
if (plat === "darwin") {
|
|
107489
107491
|
const appName = getMacAppIdentifiers()[ideId];
|
|
@@ -107538,7 +107540,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
107538
107540
|
}
|
|
107539
107541
|
}
|
|
107540
107542
|
async function detectCurrentWorkspace(ideId) {
|
|
107541
|
-
const plat =
|
|
107543
|
+
const plat = os25.platform();
|
|
107542
107544
|
if (plat === "darwin") {
|
|
107543
107545
|
try {
|
|
107544
107546
|
const appName = getMacAppIdentifiers()[ideId];
|
|
@@ -107558,7 +107560,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
107558
107560
|
const appName = appNameMap[ideId];
|
|
107559
107561
|
if (appName) {
|
|
107560
107562
|
const storagePath = path46.join(
|
|
107561
|
-
process.env.APPDATA || path46.join(
|
|
107563
|
+
process.env.APPDATA || path46.join(os25.homedir(), "AppData", "Roaming"),
|
|
107562
107564
|
appName,
|
|
107563
107565
|
"storage.json"
|
|
107564
107566
|
);
|
|
@@ -107580,7 +107582,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
107580
107582
|
return void 0;
|
|
107581
107583
|
}
|
|
107582
107584
|
async function launchWithCdp(options = {}) {
|
|
107583
|
-
const platform10 =
|
|
107585
|
+
const platform10 = os25.platform();
|
|
107584
107586
|
let targetIde;
|
|
107585
107587
|
const ides = await detectIDEs(getProviderLoader());
|
|
107586
107588
|
if (options.ideId) {
|
|
@@ -108654,6 +108656,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
108654
108656
|
if (sessionCleanup.success === false) return { success: false, removed: false, sessionCleanup };
|
|
108655
108657
|
}
|
|
108656
108658
|
let worktreeCleanup;
|
|
108659
|
+
let remoteForwardedResult;
|
|
108657
108660
|
if (node?.isLocalWorktree) {
|
|
108658
108661
|
const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
108659
108662
|
const isRemoteWorktree = nodeDaemonId && !daemonIdsEquivalent(nodeDaemonId, ctx.deps.statusInstanceId) && ctx.deps.dispatchMeshCommand && !args?._meshDirectDispatch;
|
|
@@ -108662,7 +108665,11 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
108662
108665
|
...typeof args === "object" && args !== null ? args : {},
|
|
108663
108666
|
_meshDirectDispatch: true
|
|
108664
108667
|
});
|
|
108665
|
-
|
|
108668
|
+
const forwardedResult = forwarded ?? { success: false, error: "no response from remote node" };
|
|
108669
|
+
const forwardedRemoved = forwardedResult.success === true && forwardedResult.removed !== false;
|
|
108670
|
+
if (!forwardedRemoved) return forwardedResult;
|
|
108671
|
+
remoteForwardedResult = forwardedResult;
|
|
108672
|
+
worktreeCleanup = forwardedResult.worktreeCleanup !== null && typeof forwardedResult.worktreeCleanup === "object" ? forwardedResult.worktreeCleanup : void 0;
|
|
108666
108673
|
}
|
|
108667
108674
|
const cleanupResult = await ctx.cleanupLocalWorktreeNode({ mesh, node, nodeId, force: args?.force === true });
|
|
108668
108675
|
if (cleanupResult.success === false) {
|
|
@@ -108714,6 +108721,10 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
108714
108721
|
nodeId,
|
|
108715
108722
|
payload: {
|
|
108716
108723
|
worktree: !!node?.isLocalWorktree,
|
|
108724
|
+
// Distinguish a removal executed by a remote owning daemon
|
|
108725
|
+
// (this entry records only the coordinator-side membership
|
|
108726
|
+
// reconciliation) from a fully local one.
|
|
108727
|
+
...remoteForwardedResult ? { removedByRemoteDaemon: true } : {},
|
|
108717
108728
|
sessionCleanupMode,
|
|
108718
108729
|
workspace: typeof node?.workspace === "string" ? node.workspace : void 0,
|
|
108719
108730
|
daemonId: typeof node?.daemonId === "string" ? node.daemonId : void 0,
|
|
@@ -108734,6 +108745,10 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
108734
108745
|
const orphanedSessionsRemaining = skippedLiveSessionIds.length > 0;
|
|
108735
108746
|
const orphanNextAction = orphanedSessionsRemaining ? `Live session(s) [${skippedLiveSessionIds.join(", ")}] were skipped and still survive this node removal. Run mesh_cleanup_sessions with mode:'stop_and_delete' and sessionIds:[${skippedLiveSessionIds.map((id) => `'${id}'`).join(", ")}] to release them.` : void 0;
|
|
108736
108747
|
return {
|
|
108748
|
+
// Remote-forwarded removal: start from the owning daemon's own response
|
|
108749
|
+
// so its detail fields survive, then overlay this coordinator's
|
|
108750
|
+
// membership bookkeeping (removed/ledger/cache) computed above.
|
|
108751
|
+
...remoteForwardedResult ?? {},
|
|
108737
108752
|
success: true,
|
|
108738
108753
|
removed,
|
|
108739
108754
|
...residueWarning ? { residueWarning } : {},
|
|
@@ -118388,7 +118403,7 @@ ${e?.stderr || ""}`;
|
|
|
118388
118403
|
init_chat_message_normalization();
|
|
118389
118404
|
var fs47 = __toESM2(require("fs"));
|
|
118390
118405
|
var path48 = __toESM2(require("path"));
|
|
118391
|
-
var
|
|
118406
|
+
var os26 = __toESM2(require("os"));
|
|
118392
118407
|
var import_os6 = require("os");
|
|
118393
118408
|
init_config();
|
|
118394
118409
|
var import_child_process13 = require("child_process");
|
|
@@ -118513,7 +118528,7 @@ ${e?.stderr || ""}`;
|
|
|
118513
118528
|
function checkPathExists2(paths) {
|
|
118514
118529
|
for (const p of paths) {
|
|
118515
118530
|
if (p.includes("*")) {
|
|
118516
|
-
const home =
|
|
118531
|
+
const home = os26.homedir();
|
|
118517
118532
|
const resolved = p.replace(/\*/g, home.split(path48.sep).pop() || "");
|
|
118518
118533
|
if (fs47.existsSync(resolved)) return resolved;
|
|
118519
118534
|
} else {
|
|
@@ -120910,7 +120925,7 @@ async (params) => {
|
|
|
120910
120925
|
}
|
|
120911
120926
|
var fs50 = __toESM2(require("fs"));
|
|
120912
120927
|
var path51 = __toESM2(require("path"));
|
|
120913
|
-
var
|
|
120928
|
+
var os27 = __toESM2(require("os"));
|
|
120914
120929
|
var import_session_host_core11 = require_dist();
|
|
120915
120930
|
function getAutoImplPid(ctx) {
|
|
120916
120931
|
const pid = ctx.autoImplProcess?.pid;
|
|
@@ -121112,7 +121127,7 @@ async (params) => {
|
|
|
121112
121127
|
});
|
|
121113
121128
|
const referenceScripts = loadAutoImplReferenceScripts(ctx, resolvedReference);
|
|
121114
121129
|
const prompt = buildAutoImplPrompt(ctx, type2, provider, providerDir, functions, domContext, referenceScripts, comment, resolvedReference, verification);
|
|
121115
|
-
const tmpDir = path51.join(
|
|
121130
|
+
const tmpDir = path51.join(os27.tmpdir(), "adhdev-autoimpl");
|
|
121116
121131
|
if (!fs50.existsSync(tmpDir)) fs50.mkdirSync(tmpDir, { recursive: true });
|
|
121117
121132
|
const promptFile = path51.join(tmpDir, `prompt-${type2}-${Date.now()}.md`);
|
|
121118
121133
|
fs50.writeFileSync(promptFile, prompt, "utf-8");
|
|
@@ -121267,7 +121282,7 @@ async (params) => {
|
|
|
121267
121282
|
const interactiveFlags = ["--yolo", "--interactive", "-i"];
|
|
121268
121283
|
const baseArgs = [...spawn7.args || []].filter((a) => !interactiveFlags.includes(a));
|
|
121269
121284
|
let shellCmd;
|
|
121270
|
-
const isWin =
|
|
121285
|
+
const isWin = os27.platform() === "win32";
|
|
121271
121286
|
const escapeArg = (a) => isWin ? `"${a.replace(/"/g, '""')}"` : `'${a.replace(/'/g, "'\\''")}'`;
|
|
121272
121287
|
const promptMode = autoImpl?.promptMode ?? "stdin";
|
|
121273
121288
|
const extraArgs = autoImpl?.extraArgs ?? [];
|
|
@@ -121306,7 +121321,7 @@ async (params) => {
|
|
|
121306
121321
|
try {
|
|
121307
121322
|
const pty = require("node-pty");
|
|
121308
121323
|
ctx.log(`Auto-implement spawn (PTY): ${shellCmd}`);
|
|
121309
|
-
const isWin2 =
|
|
121324
|
+
const isWin2 = os27.platform() === "win32";
|
|
121310
121325
|
child = pty.spawn(isWin2 ? "cmd.exe" : process.env.SHELL || "/bin/zsh", [isWin2 ? "/c" : "-c", shellCmd], {
|
|
121311
121326
|
name: "xterm-256color",
|
|
121312
121327
|
cols: import_session_host_core11.DEFAULT_SESSION_HOST_COLS,
|
|
@@ -123961,7 +123976,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
123961
123976
|
}
|
|
123962
123977
|
var import_child_process14 = require("child_process");
|
|
123963
123978
|
var fs52 = __toESM2(require("fs"));
|
|
123964
|
-
var
|
|
123979
|
+
var os28 = __toESM2(require("os"));
|
|
123965
123980
|
var path53 = __toESM2(require("path"));
|
|
123966
123981
|
var import_session_host_core15 = require_dist();
|
|
123967
123982
|
init_logger();
|
|
@@ -124033,7 +124048,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
124033
124048
|
}
|
|
124034
124049
|
let portableNode = null;
|
|
124035
124050
|
try {
|
|
124036
|
-
portableNode = findPortableNode22(
|
|
124051
|
+
portableNode = findPortableNode22(os28.homedir(), process.execPath, resolveInstanceDir());
|
|
124037
124052
|
} catch (error48) {
|
|
124038
124053
|
LOG2.warn(
|
|
124039
124054
|
"SessionHost",
|