@adhdev/daemon-core 0.9.82-rc.25 → 0.9.82-rc.26

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.mjs CHANGED
@@ -23859,49 +23859,7 @@ function readGitSubmodules(value) {
23859
23859
  }).filter((entry) => entry !== null);
23860
23860
  return submodules.length > 0 ? submodules : void 0;
23861
23861
  }
23862
- function buildCachedInlineMeshGitStatus(node) {
23863
- const cachedStatus = readObjectRecord(node?.cachedStatus);
23864
- const cachedGit = readObjectRecord(cachedStatus.git);
23865
- if (Object.keys(cachedGit).length) {
23866
- const conflictFiles2 = Array.isArray(cachedGit.conflictFiles) ? cachedGit.conflictFiles.filter((value) => typeof value === "string") : [];
23867
- const conflictCount2 = readNumberValue(cachedGit.conflicts) ?? conflictFiles2.length;
23868
- const hasConflicts2 = readBooleanValue(cachedGit.hasConflicts) ?? conflictCount2 > 0;
23869
- const isGitRepo2 = readBooleanValue(cachedGit.isGitRepo);
23870
- if (isGitRepo2 !== void 0) {
23871
- const submodules2 = readGitSubmodules(cachedGit.submodules);
23872
- return {
23873
- workspace: readStringValue(cachedGit.workspace, node?.workspace) || "",
23874
- repoRoot: readStringValue(cachedGit.repoRoot, node?.repoRoot, node?.workspace) || null,
23875
- isGitRepo: isGitRepo2,
23876
- branch: readStringValue(cachedGit.branch) ?? null,
23877
- headCommit: readStringValue(cachedGit.headCommit) ?? null,
23878
- headMessage: readStringValue(cachedGit.headMessage) ?? null,
23879
- upstream: readStringValue(cachedGit.upstream) ?? null,
23880
- ahead: readNumberValue(cachedGit.ahead) ?? 0,
23881
- behind: readNumberValue(cachedGit.behind) ?? 0,
23882
- staged: readNumberValue(cachedGit.staged) ?? 0,
23883
- modified: readNumberValue(cachedGit.modified) ?? 0,
23884
- untracked: readNumberValue(cachedGit.untracked) ?? 0,
23885
- deleted: readNumberValue(cachedGit.deleted) ?? 0,
23886
- renamed: readNumberValue(cachedGit.renamed) ?? 0,
23887
- hasConflicts: hasConflicts2,
23888
- conflictFiles: conflictFiles2,
23889
- stashCount: readNumberValue(cachedGit.stashCount) ?? 0,
23890
- lastCheckedAt: readNumberValue(cachedGit.lastCheckedAt) ?? Date.now(),
23891
- ...submodules2 ? { submodules: submodules2 } : {}
23892
- };
23893
- }
23894
- }
23895
- const rawGit = readObjectRecord(node?.lastGit ?? node?.last_git);
23896
- const gitResult = readObjectRecord(rawGit.result);
23897
- const directStatus = readObjectRecord(rawGit.status);
23898
- const nestedStatus = readObjectRecord(gitResult.status);
23899
- const rawProbe = readObjectRecord(node?.lastProbe ?? node?.last_probe);
23900
- const probeGit = readObjectRecord(rawProbe.git);
23901
- const probeGitResult = readObjectRecord(probeGit.result);
23902
- const probeDirectStatus = readObjectRecord(probeGit.status);
23903
- const probeNestedStatus = readObjectRecord(probeGitResult.status);
23904
- const status = Object.keys(directStatus).length ? directStatus : Object.keys(nestedStatus).length ? nestedStatus : Object.keys(probeDirectStatus).length ? probeDirectStatus : Object.keys(probeNestedStatus).length ? probeNestedStatus : {};
23862
+ function normalizeInlineMeshGitStatus(status, node, options) {
23905
23863
  const isGitRepo = readBooleanValue(status.isGitRepo);
23906
23864
  if (!Object.keys(status).length || isGitRepo === void 0) return void 0;
23907
23865
  const conflictFiles = Array.isArray(status.conflictFiles) ? status.conflictFiles.filter((value) => typeof value === "string") : [];
@@ -23926,10 +23884,31 @@ function buildCachedInlineMeshGitStatus(node) {
23926
23884
  hasConflicts,
23927
23885
  conflictFiles,
23928
23886
  stashCount: readNumberValue(status.stashCount) ?? 0,
23929
- lastCheckedAt: Date.now(),
23887
+ lastCheckedAt: options?.lastCheckedAt ?? readNumberValue(status.lastCheckedAt) ?? Date.now(),
23930
23888
  ...submodules ? { submodules } : {}
23931
23889
  };
23932
23890
  }
23891
+ function buildInlineMeshTransitGitStatus(node) {
23892
+ const rawGit = readObjectRecord(node?.lastGit ?? node?.last_git);
23893
+ const gitResult = readObjectRecord(rawGit.result);
23894
+ const directStatus = readObjectRecord(rawGit.status);
23895
+ const nestedStatus = readObjectRecord(gitResult.status);
23896
+ const rawProbe = readObjectRecord(node?.lastProbe ?? node?.last_probe);
23897
+ const probeGit = readObjectRecord(rawProbe.git);
23898
+ const probeGitResult = readObjectRecord(probeGit.result);
23899
+ const probeDirectStatus = readObjectRecord(probeGit.status);
23900
+ const probeNestedStatus = readObjectRecord(probeGitResult.status);
23901
+ const status = Object.keys(directStatus).length ? directStatus : Object.keys(nestedStatus).length ? nestedStatus : Object.keys(probeDirectStatus).length ? probeDirectStatus : Object.keys(probeNestedStatus).length ? probeNestedStatus : {};
23902
+ return normalizeInlineMeshGitStatus(status, node, { lastCheckedAt: Date.now() });
23903
+ }
23904
+ function buildCachedInlineMeshGitStatus(node) {
23905
+ const liveGit = buildInlineMeshTransitGitStatus(node);
23906
+ if (liveGit) return liveGit;
23907
+ const cachedStatus = readObjectRecord(node?.cachedStatus);
23908
+ const cachedGit = readObjectRecord(cachedStatus.git);
23909
+ if (!Object.keys(cachedGit).length) return void 0;
23910
+ return normalizeInlineMeshGitStatus(cachedGit, node);
23911
+ }
23933
23912
  function shouldDiscardCachedInlineMeshStatus(node) {
23934
23913
  const cachedStatus = readObjectRecord(node?.cachedStatus);
23935
23914
  if (!Object.keys(cachedStatus).length) return false;
@@ -24158,9 +24137,10 @@ function collectLiveMeshSessionRecords(args) {
24158
24137
  }
24159
24138
  function applyCachedInlineMeshNodeStatus(status, node) {
24160
24139
  const cachedStatus = readObjectRecord(node?.cachedStatus);
24161
- const git = buildCachedInlineMeshGitStatus(node);
24162
- const error = readStringValue(cachedStatus.error, node?.error);
24163
- const health = readStringValue(cachedStatus.health, node?.health);
24140
+ const liveGit = buildInlineMeshTransitGitStatus(node);
24141
+ const git = liveGit ?? buildCachedInlineMeshGitStatus(node);
24142
+ const error = liveGit ? void 0 : readStringValue(cachedStatus.error, node?.error);
24143
+ const health = liveGit ? void 0 : readStringValue(cachedStatus.health, node?.health);
24164
24144
  const machineStatus = readStringValue(cachedStatus.machineStatus, node?.machineStatus);
24165
24145
  const lastSeenAt = toIsoTimestamp(cachedStatus.lastSeenAt ?? cachedStatus.last_seen_at ?? node?.lastSeenAt ?? node?.last_seen_at);
24166
24146
  const updatedAt = toIsoTimestamp(cachedStatus.updatedAt ?? cachedStatus.updated_at ?? node?.updatedAt ?? node?.updated_at);