@adhdev/daemon-standalone 0.9.82-rc.302 → 0.9.82-rc.303
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 +76 -56
- 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 ? "21741b4b2d3c1f2ed8a280045e6158b2730391ed" : void 0) ?? "unknown";
|
|
30008
|
+
const commitShort = readInjected(true ? "21741b4b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
30009
|
+
const version2 = readInjected(true ? "0.9.82-rc.303" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
30010
|
+
const builtAt = readInjected(true ? "2026-06-17T04:16:33.179Z" : void 0);
|
|
30008
30011
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
30009
30012
|
return cached2;
|
|
30010
30013
|
}
|
|
@@ -30014,64 +30017,79 @@ 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
|
-
|
|
30071
|
-
|
|
30072
|
-
|
|
30073
|
-
|
|
30046
|
+
return emptyStatus(workspace, lastCheckedAt, gitError);
|
|
30047
|
+
}
|
|
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);
|
|
30074
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
|
+
};
|
|
30075
30093
|
}
|
|
30076
30094
|
function isNonRuntimeRootFile(file2) {
|
|
30077
30095
|
const base = file2.slice(file2.lastIndexOf("/") + 1);
|
|
@@ -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",
|