@adhdev/mesh-shared 1.0.58-rc.99 → 1.0.58

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
@@ -174,9 +174,10 @@ function readGitSubmodules(value, parentRepoRoot) {
174
174
  path,
175
175
  commit,
176
176
  dirty: readBoolean(submodule.dirty) ?? false,
177
- outOfSync: readBoolean(submodule.outOfSync, submodule.out_of_sync) ?? false,
178
- lastCheckedAt: readNumber(submodule.lastCheckedAt, submodule.last_checked_at) ?? Date.now()
177
+ outOfSync: readBoolean(submodule.outOfSync, submodule.out_of_sync) ?? false
179
178
  };
179
+ const lastCheckedAt = readNumber(submodule.lastCheckedAt, submodule.last_checked_at);
180
+ if (lastCheckedAt !== void 0) result.lastCheckedAt = lastCheckedAt;
180
181
  if (repoPath) result.repoPath = repoPath;
181
182
  const error = readString(submodule.error);
182
183
  if (error) result.error = error;
@@ -215,6 +216,7 @@ function normalizeGitStatus(status, node, options) {
215
216
  const untracked = readNumber(status.untracked) ?? 0;
216
217
  const deleted = readNumber(status.deleted) ?? 0;
217
218
  const renamed = readNumber(status.renamed) ?? 0;
219
+ const lastCheckedAt = options?.lastCheckedAt ?? readNumber(status.lastCheckedAt, status.last_checked_at);
218
220
  return {
219
221
  workspace: readString(status.workspace, node.workspace) || "",
220
222
  repoRoot: repoRoot ?? null,
@@ -237,7 +239,7 @@ function normalizeGitStatus(status, node, options) {
237
239
  hasConflicts,
238
240
  conflictFiles,
239
241
  stashCount: readNumber(status.stashCount, status.stash_count) ?? 0,
240
- lastCheckedAt: options?.lastCheckedAt ?? readNumber(status.lastCheckedAt, status.last_checked_at) ?? Date.now(),
242
+ ...lastCheckedAt !== void 0 ? { lastCheckedAt } : {},
241
243
  ...submodules ? { submodules } : {},
242
244
  // Deploy-lag visibility: daemonBuildBehind is computed by the reporting
243
245
  // daemon's git probe (build commit vs workspace/submodule HEAD). It must
@@ -273,10 +275,9 @@ function pickBestTransitGitStatus(node, options) {
273
275
  const probeGitResult = readRecord(probeGit.result);
274
276
  const probeDirectStatus = readRecord(probeGit.status);
275
277
  const probeNestedStatus = readRecord(probeGitResult.status);
276
- const lastCheckedAt = options?.lastCheckedAt;
277
278
  let best = null;
278
279
  for (const status of [directStatus, nestedStatus, probeDirectStatus, probeNestedStatus]) {
279
- const normalized = normalizeGitStatus(status, node, { lastCheckedAt: lastCheckedAt ?? Date.now() });
280
+ const normalized = normalizeGitStatus(status, node, options);
280
281
  if (!normalized) continue;
281
282
  const score = scoreGitStatusCandidate(normalized);
282
283
  if (!best || score > best.score) best = { git: normalized, score };