@adhdev/daemon-standalone 0.9.82-rc.302 → 0.9.82-rc.304
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 +88 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29784,6 +29784,7 @@ var require_dist3 = __commonJS({
|
|
|
29784
29784
|
});
|
|
29785
29785
|
var git_executor_exports = {};
|
|
29786
29786
|
__export2(git_executor_exports, {
|
|
29787
|
+
GIT_STATUS_TIMEOUT_MS: () => GIT_STATUS_TIMEOUT_MS,
|
|
29787
29788
|
GitCommandError: () => GitCommandError,
|
|
29788
29789
|
isPathInside: () => isPathInside,
|
|
29789
29790
|
normalizeGitOutput: () => normalizeGitOutput,
|
|
@@ -29956,6 +29957,7 @@ var require_dist3 = __commonJS({
|
|
|
29956
29957
|
var execFileAsync;
|
|
29957
29958
|
var DEFAULT_TIMEOUT_MS;
|
|
29958
29959
|
var DEFAULT_MAX_BUFFER;
|
|
29960
|
+
var GIT_STATUS_TIMEOUT_MS;
|
|
29959
29961
|
var GitCommandError;
|
|
29960
29962
|
var init_git_executor = __esm2({
|
|
29961
29963
|
"src/git/git-executor.ts"() {
|
|
@@ -29968,6 +29970,7 @@ var require_dist3 = __commonJS({
|
|
|
29968
29970
|
execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
29969
29971
|
DEFAULT_TIMEOUT_MS = 5e3;
|
|
29970
29972
|
DEFAULT_MAX_BUFFER = 1024 * 1024;
|
|
29973
|
+
GIT_STATUS_TIMEOUT_MS = process.platform === "win32" ? 3e4 : 2e4;
|
|
29971
29974
|
GitCommandError = class extends Error {
|
|
29972
29975
|
reason;
|
|
29973
29976
|
stdout;
|
|
@@ -30001,10 +30004,10 @@ var require_dist3 = __commonJS({
|
|
|
30001
30004
|
}
|
|
30002
30005
|
function getDaemonBuildInfo() {
|
|
30003
30006
|
if (cached2) return cached2;
|
|
30004
|
-
const commit = readInjected(true ? "
|
|
30005
|
-
const commitShort = readInjected(true ? "
|
|
30006
|
-
const version2 = readInjected(true ? "0.9.82-rc.
|
|
30007
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
30007
|
+
const commit = readInjected(true ? "1d8f7eabac25d169c6344185357519db0c0ffd13" : void 0) ?? "unknown";
|
|
30008
|
+
const commitShort = readInjected(true ? "1d8f7eab" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30009
|
+
const version2 = readInjected(true ? "0.9.82-rc.304" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30010
|
+
const builtAt = readInjected(true ? "2026-06-17T05:27:28.772Z" : void 0);
|
|
30008
30011
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30009
30012
|
return cached2;
|
|
30010
30013
|
}
|
|
@@ -30014,65 +30017,80 @@ var require_dist3 = __commonJS({
|
|
|
30014
30017
|
"use strict";
|
|
30015
30018
|
}
|
|
30016
30019
|
});
|
|
30020
|
+
function isTransientGitFailure(error48) {
|
|
30021
|
+
return error48.reason === "timeout" || error48.reason === "git_command_failed";
|
|
30022
|
+
}
|
|
30017
30023
|
async function getGitRepoStatus(workspace, options = {}) {
|
|
30018
30024
|
const lastCheckedAt = Date.now();
|
|
30019
30025
|
const includeSubmodules = options.includeSubmodules !== false;
|
|
30026
|
+
const effectiveOptions = options.timeoutMs === void 0 ? { ...options, timeoutMs: GIT_STATUS_TIMEOUT_MS } : options;
|
|
30020
30027
|
try {
|
|
30021
|
-
const repo = await resolveGitRepository(workspace,
|
|
30022
|
-
|
|
30023
|
-
|
|
30024
|
-
|
|
30025
|
-
upstreamProbe = await refreshTrackedUpstream(repo, parsed, options);
|
|
30026
|
-
if (upstreamProbe.upstreamStatus === "fresh") {
|
|
30027
|
-
parsed = await readPorcelainStatus(repo, options);
|
|
30028
|
-
}
|
|
30029
|
-
}
|
|
30030
|
-
const head = await readHead(repo, options);
|
|
30031
|
-
const stashCount = await readStashCount(repo, options);
|
|
30032
|
-
let submodules;
|
|
30033
|
-
if (includeSubmodules) {
|
|
30034
|
-
submodules = await getSubmoduleStatuses(repo, options);
|
|
30035
|
-
}
|
|
30036
|
-
const submoduleDirty = (submodules || []).some((submodule) => submodule.dirty || submodule.outOfSync || !!submodule.error);
|
|
30037
|
-
const dirty = parsed.staged + parsed.modified + parsed.untracked + parsed.deleted + parsed.renamed > 0 || parsed.conflictFiles.length > 0 || stashCount > 0 || submoduleDirty;
|
|
30038
|
-
const daemonBuildBehind = await detectDaemonBuildBehind(repo, submodules, options);
|
|
30039
|
-
return {
|
|
30040
|
-
workspace: repo.workspace,
|
|
30041
|
-
repoRoot: repo.repoRoot,
|
|
30042
|
-
isGitRepo: true,
|
|
30043
|
-
branch: parsed.branch,
|
|
30044
|
-
headCommit: head.commit,
|
|
30045
|
-
headMessage: head.message,
|
|
30046
|
-
upstream: parsed.upstream,
|
|
30047
|
-
upstreamStatus: parsed.upstream ? upstreamProbe.upstreamStatus : "no_upstream",
|
|
30048
|
-
upstreamFetchedAt: upstreamProbe.upstreamFetchedAt,
|
|
30049
|
-
upstreamFetchError: upstreamProbe.upstreamFetchError,
|
|
30050
|
-
ahead: parsed.ahead,
|
|
30051
|
-
behind: parsed.behind,
|
|
30052
|
-
staged: parsed.staged,
|
|
30053
|
-
modified: parsed.modified,
|
|
30054
|
-
untracked: parsed.untracked,
|
|
30055
|
-
deleted: parsed.deleted,
|
|
30056
|
-
renamed: parsed.renamed,
|
|
30057
|
-
dirty,
|
|
30058
|
-
hasConflicts: parsed.conflictFiles.length > 0,
|
|
30059
|
-
conflictFiles: parsed.conflictFiles,
|
|
30060
|
-
stashCount,
|
|
30061
|
-
lastCheckedAt,
|
|
30062
|
-
submodules,
|
|
30063
|
-
...daemonBuildBehind ? { daemonBuildBehind } : {}
|
|
30064
|
-
};
|
|
30028
|
+
const repo = await resolveGitRepository(workspace, effectiveOptions);
|
|
30029
|
+
const status = await collectGitRepoStatus(repo, includeSubmodules, lastCheckedAt, effectiveOptions);
|
|
30030
|
+
lastKnownGoodStatus.set(workspace, status);
|
|
30031
|
+
return status;
|
|
30065
30032
|
} catch (error48) {
|
|
30066
|
-
|
|
30067
|
-
|
|
30033
|
+
const gitError = error48 instanceof GitCommandError ? error48 : new GitCommandError("git_command_failed", "Failed to read Git status", { cause: error48 });
|
|
30034
|
+
if (isTransientGitFailure(gitError)) {
|
|
30035
|
+
const cached22 = lastKnownGoodStatus.get(workspace);
|
|
30036
|
+
if (cached22) {
|
|
30037
|
+
return {
|
|
30038
|
+
...cached22,
|
|
30039
|
+
lastCheckedAt,
|
|
30040
|
+
upstreamStatus: "unavailable",
|
|
30041
|
+
error: gitError.stderr || gitError.message,
|
|
30042
|
+
reason: gitError.reason
|
|
30043
|
+
};
|
|
30044
|
+
}
|
|
30068
30045
|
}
|
|
30069
|
-
return emptyStatus(
|
|
30070
|
-
workspace,
|
|
30071
|
-
lastCheckedAt,
|
|
30072
|
-
new GitCommandError("git_command_failed", "Failed to read Git status", { cause: error48 })
|
|
30073
|
-
);
|
|
30046
|
+
return emptyStatus(workspace, lastCheckedAt, gitError);
|
|
30074
30047
|
}
|
|
30075
30048
|
}
|
|
30049
|
+
async function collectGitRepoStatus(repo, includeSubmodules, lastCheckedAt, options) {
|
|
30050
|
+
let parsed = await readPorcelainStatus(repo, options);
|
|
30051
|
+
let upstreamProbe = getInitialUpstreamProbe(parsed);
|
|
30052
|
+
if (options.refreshUpstream) {
|
|
30053
|
+
upstreamProbe = await refreshTrackedUpstream(repo, parsed, options);
|
|
30054
|
+
if (upstreamProbe.upstreamStatus === "fresh") {
|
|
30055
|
+
parsed = await readPorcelainStatus(repo, options);
|
|
30056
|
+
}
|
|
30057
|
+
}
|
|
30058
|
+
const head = await readHead(repo, options);
|
|
30059
|
+
const stashCount = await readStashCount(repo, options);
|
|
30060
|
+
let submodules;
|
|
30061
|
+
if (includeSubmodules) {
|
|
30062
|
+
submodules = await getSubmoduleStatuses(repo, options);
|
|
30063
|
+
}
|
|
30064
|
+
const submoduleDirty = (submodules || []).some((submodule) => submodule.dirty || submodule.outOfSync || !!submodule.error);
|
|
30065
|
+
const dirty = parsed.staged + parsed.modified + parsed.untracked + parsed.deleted + parsed.renamed > 0 || parsed.conflictFiles.length > 0 || stashCount > 0 || submoduleDirty;
|
|
30066
|
+
const daemonBuildBehind = await detectDaemonBuildBehind(repo, submodules, options);
|
|
30067
|
+
return {
|
|
30068
|
+
workspace: repo.workspace,
|
|
30069
|
+
repoRoot: repo.repoRoot,
|
|
30070
|
+
isGitRepo: true,
|
|
30071
|
+
branch: parsed.branch,
|
|
30072
|
+
headCommit: head.commit,
|
|
30073
|
+
headMessage: head.message,
|
|
30074
|
+
upstream: parsed.upstream,
|
|
30075
|
+
upstreamStatus: parsed.upstream ? upstreamProbe.upstreamStatus : "no_upstream",
|
|
30076
|
+
upstreamFetchedAt: upstreamProbe.upstreamFetchedAt,
|
|
30077
|
+
upstreamFetchError: upstreamProbe.upstreamFetchError,
|
|
30078
|
+
ahead: parsed.ahead,
|
|
30079
|
+
behind: parsed.behind,
|
|
30080
|
+
staged: parsed.staged,
|
|
30081
|
+
modified: parsed.modified,
|
|
30082
|
+
untracked: parsed.untracked,
|
|
30083
|
+
deleted: parsed.deleted,
|
|
30084
|
+
renamed: parsed.renamed,
|
|
30085
|
+
dirty,
|
|
30086
|
+
hasConflicts: parsed.conflictFiles.length > 0,
|
|
30087
|
+
conflictFiles: parsed.conflictFiles,
|
|
30088
|
+
stashCount,
|
|
30089
|
+
lastCheckedAt,
|
|
30090
|
+
submodules,
|
|
30091
|
+
...daemonBuildBehind ? { daemonBuildBehind } : {}
|
|
30092
|
+
};
|
|
30093
|
+
}
|
|
30076
30094
|
function isNonRuntimeRootFile(file2) {
|
|
30077
30095
|
const base = file2.slice(file2.lastIndexOf("/") + 1);
|
|
30078
30096
|
if (/^\.(?:verify|marker|converge|ff-verify|patch-equiv|live-verify)\b/i.test(base)) return true;
|
|
@@ -30313,7 +30331,7 @@ var require_dist3 = __commonJS({
|
|
|
30313
30331
|
async function getSubmoduleStatuses(repo, options) {
|
|
30314
30332
|
if (!repo.repoRoot) return [];
|
|
30315
30333
|
try {
|
|
30316
|
-
const result = await runGit(repo, ["submodule", "status"
|
|
30334
|
+
const result = await runGit(repo, ["submodule", "status"], options);
|
|
30317
30335
|
const submodules = parseSubmoduleStatusOutput(result.stdout, repo.repoRoot, options.submoduleIgnorePaths);
|
|
30318
30336
|
await Promise.all(submodules.map((submodule) => enrichSubmoduleWorktreeStatus(repo, submodule, options)));
|
|
30319
30337
|
return submodules;
|
|
@@ -30357,6 +30375,7 @@ var require_dist3 = __commonJS({
|
|
|
30357
30375
|
}
|
|
30358
30376
|
return submodules;
|
|
30359
30377
|
}
|
|
30378
|
+
var lastKnownGoodStatus;
|
|
30360
30379
|
var DAEMON_RUNTIME_PACKAGES;
|
|
30361
30380
|
var WEB_ONLY_PACKAGES;
|
|
30362
30381
|
var init_git_status = __esm2({
|
|
@@ -30364,6 +30383,7 @@ var require_dist3 = __commonJS({
|
|
|
30364
30383
|
"use strict";
|
|
30365
30384
|
init_git_executor();
|
|
30366
30385
|
init_build_info();
|
|
30386
|
+
lastKnownGoodStatus = /* @__PURE__ */ new Map();
|
|
30367
30387
|
DAEMON_RUNTIME_PACKAGES = /* @__PURE__ */ new Set([
|
|
30368
30388
|
"daemon-core",
|
|
30369
30389
|
"daemon-standalone",
|
|
@@ -71843,6 +71863,15 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71843
71863
|
const connectionState = readStringValue(readObjectRecord(status.connection).state);
|
|
71844
71864
|
status.launchReady = !!daemonId && (readStringValue(status.machineStatus) === "online" || connectionState === "connected" || isSelfNode);
|
|
71845
71865
|
}
|
|
71866
|
+
function readMeshTimeoutEnvMs(name, defaultMs) {
|
|
71867
|
+
const raw = process.env[name]?.trim();
|
|
71868
|
+
if (!raw) return defaultMs;
|
|
71869
|
+
const parsed = Number.parseInt(raw, 10);
|
|
71870
|
+
if (Number.isFinite(parsed) && parsed >= 1e3 && parsed <= 12e4) return parsed;
|
|
71871
|
+
return defaultMs;
|
|
71872
|
+
}
|
|
71873
|
+
var MESH_DIRECT_PROBE_TIMEOUT_MS = readMeshTimeoutEnvMs("MESH_DIRECT_PROBE_TIMEOUT_MS", 25e3);
|
|
71874
|
+
var MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS = readMeshTimeoutEnvMs("MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS", 25e3);
|
|
71846
71875
|
async function probeRemoteMeshGitStatus(args) {
|
|
71847
71876
|
if (!args.dispatchMeshCommand) return null;
|
|
71848
71877
|
const remoteResult = await Promise.race([
|
|
@@ -71906,7 +71935,7 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
|
|
|
71906
71935
|
dispatchMeshCommand: args.dispatchMeshCommand,
|
|
71907
71936
|
daemonId,
|
|
71908
71937
|
workspace,
|
|
71909
|
-
timeoutMs:
|
|
71938
|
+
timeoutMs: MESH_DIRECT_PROBE_TIMEOUT_MS
|
|
71910
71939
|
});
|
|
71911
71940
|
if (remoteGit) {
|
|
71912
71941
|
recordInlineMeshDirectGitTruth(node, remoteGit, "selected_coordinator_mesh_p2p_git");
|
|
@@ -77876,7 +77905,7 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
77876
77905
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
77877
77906
|
daemonId,
|
|
77878
77907
|
workspace,
|
|
77879
|
-
timeoutMs:
|
|
77908
|
+
timeoutMs: MESH_DIRECT_PROBE_TIMEOUT_MS
|
|
77880
77909
|
});
|
|
77881
77910
|
if (remoteGit) {
|
|
77882
77911
|
status.git = remoteGit;
|
|
@@ -77900,7 +77929,7 @@ ${ptyResult.output.slice(-2e3)}`);
|
|
|
77900
77929
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
77901
77930
|
daemonId,
|
|
77902
77931
|
workspace,
|
|
77903
|
-
timeoutMs:
|
|
77932
|
+
timeoutMs: MESH_DIRECT_PROBE_RETRY_TIMEOUT_MS
|
|
77904
77933
|
});
|
|
77905
77934
|
if (remoteGit) {
|
|
77906
77935
|
status.git = remoteGit;
|