@adhdev/daemon-core 0.9.82-rc.28 → 0.9.82-rc.29
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 +16 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -5
- package/dist/index.mjs.map +1 -1
- package/dist/repo-mesh-types.d.ts +6 -0
- package/package.json +1 -1
- package/src/commands/router.ts +29 -5
- package/src/repo-mesh-types.ts +6 -0
|
@@ -254,6 +254,12 @@ export interface RepoMeshNodeStatus {
|
|
|
254
254
|
worktreeBranch?: string;
|
|
255
255
|
health: RepoMeshNodeHealth;
|
|
256
256
|
git?: GitRepoStatus;
|
|
257
|
+
/**
|
|
258
|
+
* True when the selected coordinator has evidence that a peer git probe is still
|
|
259
|
+
* in flight or just timed out during initial mesh handshake, so callers should
|
|
260
|
+
* treat missing git data as pending instead of authoritative absence.
|
|
261
|
+
*/
|
|
262
|
+
gitProbePending?: boolean;
|
|
257
263
|
providers: string[];
|
|
258
264
|
activeSessions: string[];
|
|
259
265
|
activeSessionDetails?: RepoMeshSessionStatus[];
|
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -499,12 +499,16 @@ function collectLiveMeshSessionRecords(args: {
|
|
|
499
499
|
return matches;
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
function applyCachedInlineMeshNodeStatus(
|
|
502
|
+
function applyCachedInlineMeshNodeStatus(
|
|
503
|
+
status: Record<string, unknown>,
|
|
504
|
+
node: any,
|
|
505
|
+
options?: { skipGit?: boolean; skipError?: boolean; skipHealth?: boolean },
|
|
506
|
+
): boolean {
|
|
503
507
|
const cachedStatus = readObjectRecord(node?.cachedStatus);
|
|
504
508
|
const liveGit = buildInlineMeshTransitGitStatus(node);
|
|
505
|
-
const git = liveGit ?? buildCachedInlineMeshGitStatus(node);
|
|
506
|
-
const error = liveGit ? undefined : readStringValue(cachedStatus.error, node?.error);
|
|
507
|
-
const health = liveGit ? undefined : readStringValue(cachedStatus.health, node?.health);
|
|
509
|
+
const git = options?.skipGit ? undefined : (liveGit ?? buildCachedInlineMeshGitStatus(node));
|
|
510
|
+
const error = options?.skipError ? undefined : (liveGit ? undefined : readStringValue(cachedStatus.error, node?.error));
|
|
511
|
+
const health = options?.skipHealth ? undefined : (liveGit ? undefined : readStringValue(cachedStatus.health, node?.health));
|
|
508
512
|
const machineStatus = readStringValue(cachedStatus.machineStatus, node?.machineStatus);
|
|
509
513
|
const lastSeenAt = toIsoTimestamp(cachedStatus.lastSeenAt ?? cachedStatus.last_seen_at ?? node?.lastSeenAt ?? node?.last_seen_at);
|
|
510
514
|
const updatedAt = toIsoTimestamp(cachedStatus.updatedAt ?? cachedStatus.updated_at ?? node?.updatedAt ?? node?.updated_at);
|
|
@@ -3352,7 +3356,27 @@ export class DaemonCommandRouter {
|
|
|
3352
3356
|
}
|
|
3353
3357
|
}
|
|
3354
3358
|
if (!remoteProbeApplied) {
|
|
3355
|
-
|
|
3359
|
+
const connectionState = readStringValue((status.connection as any)?.state);
|
|
3360
|
+
const inlineTransitGit = buildInlineMeshTransitGitStatus(node);
|
|
3361
|
+
const pendingPeerGitProbe = !inlineTransitGit
|
|
3362
|
+
&& !isSelfNode
|
|
3363
|
+
&& !!daemonId
|
|
3364
|
+
&& (
|
|
3365
|
+
readStringValue(status.machineStatus) === 'online'
|
|
3366
|
+
|| readStringValue(status.health) === 'online'
|
|
3367
|
+
|| connectionState === 'connecting'
|
|
3368
|
+
|| connectionState === 'connected'
|
|
3369
|
+
|| connectionState === 'unknown'
|
|
3370
|
+
);
|
|
3371
|
+
if (pendingPeerGitProbe) {
|
|
3372
|
+
status.gitProbePending = true;
|
|
3373
|
+
status.health = 'unknown';
|
|
3374
|
+
}
|
|
3375
|
+
if (applyCachedInlineMeshNodeStatus(
|
|
3376
|
+
status,
|
|
3377
|
+
node,
|
|
3378
|
+
pendingPeerGitProbe ? { skipGit: true, skipError: true, skipHealth: true } : undefined,
|
|
3379
|
+
)) {
|
|
3356
3380
|
status.launchReady = !!daemonId && (readStringValue(status.machineStatus) === 'online' || isSelfNode);
|
|
3357
3381
|
nodeStatuses.push(status);
|
|
3358
3382
|
continue;
|
package/src/repo-mesh-types.ts
CHANGED
|
@@ -306,6 +306,12 @@ export interface RepoMeshNodeStatus {
|
|
|
306
306
|
worktreeBranch?: string;
|
|
307
307
|
health: RepoMeshNodeHealth;
|
|
308
308
|
git?: GitRepoStatus;
|
|
309
|
+
/**
|
|
310
|
+
* True when the selected coordinator has evidence that a peer git probe is still
|
|
311
|
+
* in flight or just timed out during initial mesh handshake, so callers should
|
|
312
|
+
* treat missing git data as pending instead of authoritative absence.
|
|
313
|
+
*/
|
|
314
|
+
gitProbePending?: boolean;
|
|
309
315
|
providers: string[];
|
|
310
316
|
activeSessions: string[];
|
|
311
317
|
activeSessionDetails?: RepoMeshSessionStatus[];
|