@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.js CHANGED
@@ -24092,49 +24092,7 @@ function readGitSubmodules(value) {
24092
24092
  }).filter((entry) => entry !== null);
24093
24093
  return submodules.length > 0 ? submodules : void 0;
24094
24094
  }
24095
- function buildCachedInlineMeshGitStatus(node) {
24096
- const cachedStatus = readObjectRecord(node?.cachedStatus);
24097
- const cachedGit = readObjectRecord(cachedStatus.git);
24098
- if (Object.keys(cachedGit).length) {
24099
- const conflictFiles2 = Array.isArray(cachedGit.conflictFiles) ? cachedGit.conflictFiles.filter((value) => typeof value === "string") : [];
24100
- const conflictCount2 = readNumberValue(cachedGit.conflicts) ?? conflictFiles2.length;
24101
- const hasConflicts2 = readBooleanValue(cachedGit.hasConflicts) ?? conflictCount2 > 0;
24102
- const isGitRepo2 = readBooleanValue(cachedGit.isGitRepo);
24103
- if (isGitRepo2 !== void 0) {
24104
- const submodules2 = readGitSubmodules(cachedGit.submodules);
24105
- return {
24106
- workspace: readStringValue(cachedGit.workspace, node?.workspace) || "",
24107
- repoRoot: readStringValue(cachedGit.repoRoot, node?.repoRoot, node?.workspace) || null,
24108
- isGitRepo: isGitRepo2,
24109
- branch: readStringValue(cachedGit.branch) ?? null,
24110
- headCommit: readStringValue(cachedGit.headCommit) ?? null,
24111
- headMessage: readStringValue(cachedGit.headMessage) ?? null,
24112
- upstream: readStringValue(cachedGit.upstream) ?? null,
24113
- ahead: readNumberValue(cachedGit.ahead) ?? 0,
24114
- behind: readNumberValue(cachedGit.behind) ?? 0,
24115
- staged: readNumberValue(cachedGit.staged) ?? 0,
24116
- modified: readNumberValue(cachedGit.modified) ?? 0,
24117
- untracked: readNumberValue(cachedGit.untracked) ?? 0,
24118
- deleted: readNumberValue(cachedGit.deleted) ?? 0,
24119
- renamed: readNumberValue(cachedGit.renamed) ?? 0,
24120
- hasConflicts: hasConflicts2,
24121
- conflictFiles: conflictFiles2,
24122
- stashCount: readNumberValue(cachedGit.stashCount) ?? 0,
24123
- lastCheckedAt: readNumberValue(cachedGit.lastCheckedAt) ?? Date.now(),
24124
- ...submodules2 ? { submodules: submodules2 } : {}
24125
- };
24126
- }
24127
- }
24128
- const rawGit = readObjectRecord(node?.lastGit ?? node?.last_git);
24129
- const gitResult = readObjectRecord(rawGit.result);
24130
- const directStatus = readObjectRecord(rawGit.status);
24131
- const nestedStatus = readObjectRecord(gitResult.status);
24132
- const rawProbe = readObjectRecord(node?.lastProbe ?? node?.last_probe);
24133
- const probeGit = readObjectRecord(rawProbe.git);
24134
- const probeGitResult = readObjectRecord(probeGit.result);
24135
- const probeDirectStatus = readObjectRecord(probeGit.status);
24136
- const probeNestedStatus = readObjectRecord(probeGitResult.status);
24137
- const status = Object.keys(directStatus).length ? directStatus : Object.keys(nestedStatus).length ? nestedStatus : Object.keys(probeDirectStatus).length ? probeDirectStatus : Object.keys(probeNestedStatus).length ? probeNestedStatus : {};
24095
+ function normalizeInlineMeshGitStatus(status, node, options) {
24138
24096
  const isGitRepo = readBooleanValue(status.isGitRepo);
24139
24097
  if (!Object.keys(status).length || isGitRepo === void 0) return void 0;
24140
24098
  const conflictFiles = Array.isArray(status.conflictFiles) ? status.conflictFiles.filter((value) => typeof value === "string") : [];
@@ -24159,10 +24117,31 @@ function buildCachedInlineMeshGitStatus(node) {
24159
24117
  hasConflicts,
24160
24118
  conflictFiles,
24161
24119
  stashCount: readNumberValue(status.stashCount) ?? 0,
24162
- lastCheckedAt: Date.now(),
24120
+ lastCheckedAt: options?.lastCheckedAt ?? readNumberValue(status.lastCheckedAt) ?? Date.now(),
24163
24121
  ...submodules ? { submodules } : {}
24164
24122
  };
24165
24123
  }
24124
+ function buildInlineMeshTransitGitStatus(node) {
24125
+ const rawGit = readObjectRecord(node?.lastGit ?? node?.last_git);
24126
+ const gitResult = readObjectRecord(rawGit.result);
24127
+ const directStatus = readObjectRecord(rawGit.status);
24128
+ const nestedStatus = readObjectRecord(gitResult.status);
24129
+ const rawProbe = readObjectRecord(node?.lastProbe ?? node?.last_probe);
24130
+ const probeGit = readObjectRecord(rawProbe.git);
24131
+ const probeGitResult = readObjectRecord(probeGit.result);
24132
+ const probeDirectStatus = readObjectRecord(probeGit.status);
24133
+ const probeNestedStatus = readObjectRecord(probeGitResult.status);
24134
+ const status = Object.keys(directStatus).length ? directStatus : Object.keys(nestedStatus).length ? nestedStatus : Object.keys(probeDirectStatus).length ? probeDirectStatus : Object.keys(probeNestedStatus).length ? probeNestedStatus : {};
24135
+ return normalizeInlineMeshGitStatus(status, node, { lastCheckedAt: Date.now() });
24136
+ }
24137
+ function buildCachedInlineMeshGitStatus(node) {
24138
+ const liveGit = buildInlineMeshTransitGitStatus(node);
24139
+ if (liveGit) return liveGit;
24140
+ const cachedStatus = readObjectRecord(node?.cachedStatus);
24141
+ const cachedGit = readObjectRecord(cachedStatus.git);
24142
+ if (!Object.keys(cachedGit).length) return void 0;
24143
+ return normalizeInlineMeshGitStatus(cachedGit, node);
24144
+ }
24166
24145
  function shouldDiscardCachedInlineMeshStatus(node) {
24167
24146
  const cachedStatus = readObjectRecord(node?.cachedStatus);
24168
24147
  if (!Object.keys(cachedStatus).length) return false;
@@ -24391,9 +24370,10 @@ function collectLiveMeshSessionRecords(args) {
24391
24370
  }
24392
24371
  function applyCachedInlineMeshNodeStatus(status, node) {
24393
24372
  const cachedStatus = readObjectRecord(node?.cachedStatus);
24394
- const git = buildCachedInlineMeshGitStatus(node);
24395
- const error = readStringValue(cachedStatus.error, node?.error);
24396
- const health = readStringValue(cachedStatus.health, node?.health);
24373
+ const liveGit = buildInlineMeshTransitGitStatus(node);
24374
+ const git = liveGit ?? buildCachedInlineMeshGitStatus(node);
24375
+ const error = liveGit ? void 0 : readStringValue(cachedStatus.error, node?.error);
24376
+ const health = liveGit ? void 0 : readStringValue(cachedStatus.health, node?.health);
24397
24377
  const machineStatus = readStringValue(cachedStatus.machineStatus, node?.machineStatus);
24398
24378
  const lastSeenAt = toIsoTimestamp(cachedStatus.lastSeenAt ?? cachedStatus.last_seen_at ?? node?.lastSeenAt ?? node?.last_seen_at);
24399
24379
  const updatedAt = toIsoTimestamp(cachedStatus.updatedAt ?? cachedStatus.updated_at ?? node?.updatedAt ?? node?.updated_at);