@adhdev/daemon-core 0.9.82-rc.5 → 0.9.82-rc.51

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.
@@ -23,11 +23,42 @@ export interface RepoMesh {
23
23
  defaultBranch?: string;
24
24
  policy: RepoMeshPolicy;
25
25
  coordinator: RepoMeshCoordinatorConfig;
26
+ meshHost?: RepoMeshHostMetadata;
26
27
  projectContext: ProjectContextSnapshot;
27
28
  nodes: RepoMeshNode[];
28
29
  status: 'active' | 'archived' | 'deleted';
29
30
  }
30
31
 
32
+ export type RepoMeshDaemonRole = 'host' | 'member';
33
+
34
+ export interface RepoMeshHostPairingMetadata {
35
+ status: 'not_configured' | 'pairing' | 'paired' | 'rejected' | 'revoked';
36
+ tokenId?: string;
37
+ joinedAt?: string;
38
+ lastPairedAt?: string;
39
+ lastRejectedAt?: string;
40
+ expiresAt?: string;
41
+ }
42
+
43
+ export interface RepoMeshHostMetadata {
44
+ /** Local daemon role for this mesh. Missing metadata defaults to host for standalone compatibility. */
45
+ role: RepoMeshDaemonRole;
46
+ /** Daemon that owns mesh truth/status/git/queue/session/ledger/coordinator ownership. */
47
+ hostDaemonId?: string;
48
+ /** Mesh node that represents the host daemon, when known. */
49
+ hostNodeId?: string;
50
+ /** Future standalone manual pairing endpoint entered by member daemons. */
51
+ hostAddress?: string;
52
+ /** Redacted pairing state only; raw join tokens must not be persisted here. */
53
+ pairing?: RepoMeshHostPairingMetadata;
54
+ }
55
+
56
+ export interface RepoMeshHostStatus extends RepoMeshHostMetadata {
57
+ canOwnCoordinator: boolean;
58
+ canOwnQueue: boolean;
59
+ defaulted: boolean;
60
+ }
61
+
31
62
  export interface RepoMeshNode {
32
63
  id: string;
33
64
  daemonId: string;
@@ -42,6 +73,7 @@ export interface RepoMeshNode {
42
73
  effectiveCapabilities: RepoMeshNodeCapabilities;
43
74
  policy: RepoMeshNodePolicy;
44
75
  health: RepoMeshNodeHealth;
76
+ role?: RepoMeshDaemonRole;
45
77
  status: 'enabled' | 'disabled' | 'removed';
46
78
  }
47
79
 
@@ -229,6 +261,7 @@ export interface LocalMeshEntry {
229
261
  defaultBranch?: string;
230
262
  policy: RepoMeshPolicy;
231
263
  coordinator: RepoMeshCoordinatorConfig;
264
+ meshHost?: RepoMeshHostMetadata;
232
265
  nodes: LocalMeshNodeEntry[];
233
266
  createdAt: string;
234
267
  updatedAt: string;
@@ -251,6 +284,7 @@ export interface LocalMeshNodeEntry {
251
284
  clonedFromNodeId?: string;
252
285
  /** Optional associated/external repos configured as node metadata. */
253
286
  relatedRepos?: RepoMeshRelatedRepo[];
287
+ role?: RepoMeshDaemonRole;
254
288
  }
255
289
 
256
290
  // ─── Mesh Status (runtime, not persisted) ───────
@@ -259,17 +293,157 @@ export interface RepoMeshStatus {
259
293
  meshId: string;
260
294
  meshName: string;
261
295
  repoIdentity: string;
296
+ defaultBranch?: string;
262
297
  refreshedAt: string;
298
+ meshHost?: RepoMeshHostStatus;
263
299
  nodes: RepoMeshNodeStatus[];
300
+ queue?: RepoMeshQueueStatus;
301
+ ledger?: RepoMeshLedgerStatus;
302
+ }
303
+
304
+ export interface RepoMeshSessionStatus {
305
+ sessionId: string;
306
+ providerType?: string;
307
+ state?: string;
308
+ lifecycle?: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'interrupted';
309
+ surfaceKind?: 'live_runtime' | 'recovery_snapshot' | 'inactive_record';
310
+ recoveryState?: string | null;
311
+ workspace?: string | null;
312
+ title?: string | null;
313
+ lastActivityAt?: string | null;
314
+ isCached?: boolean;
315
+ }
316
+
317
+ export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
318
+ export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
319
+
320
+ export interface RepoMeshPeerConnectionStatus {
321
+ perspective: 'selected_coordinator';
322
+ source: 'mesh_peer_status' | 'not_reported';
323
+ state: RepoMeshPeerConnectionState;
324
+ transport: RepoMeshPeerConnectionTransport;
325
+ reported: boolean;
326
+ reason?: string;
327
+ lastStateChangeAt?: string;
328
+ lastConnectedAt?: string;
329
+ lastCommandAt?: string;
264
330
  }
265
331
 
266
332
  export interface RepoMeshNodeStatus {
267
333
  nodeId: string;
268
334
  machineLabel: string;
269
335
  workspace: string;
336
+ repoRoot?: string;
337
+ daemonId?: string;
338
+ machineId?: string;
339
+ role?: RepoMeshDaemonRole;
340
+ machineStatus?: string;
341
+ isLocalWorktree?: boolean;
342
+ worktreeBranch?: string;
270
343
  health: RepoMeshNodeHealth;
271
344
  git?: GitRepoStatus;
345
+ /**
346
+ * True when the selected coordinator has evidence that a peer git probe is still
347
+ * in flight or just timed out during initial mesh handshake, so callers should
348
+ * treat missing git data as pending instead of authoritative absence.
349
+ */
350
+ gitProbePending?: boolean;
272
351
  providers: string[];
273
352
  activeSessions: string[];
353
+ activeSessionDetails?: RepoMeshSessionStatus[];
354
+ providerPriority?: string[];
355
+ launchReady?: boolean;
356
+ lastSeenAt?: string;
357
+ updatedAt?: string;
358
+ connection?: RepoMeshPeerConnectionStatus;
274
359
  error?: string;
275
360
  }
361
+
362
+ export type RepoMeshQueueTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
363
+
364
+ export interface RepoMeshQueueTask {
365
+ id: string;
366
+ meshId: string;
367
+ message: string;
368
+ status: RepoMeshQueueTaskStatus;
369
+ targetNodeId?: string;
370
+ targetSessionId?: string;
371
+ assignedNodeId?: string;
372
+ assignedSessionId?: string;
373
+ cancelReason?: string;
374
+ cancelledAt?: string;
375
+ requeueReason?: string;
376
+ requeuedAt?: string;
377
+ requeueCount?: number;
378
+ autoLaunch?: {
379
+ status: 'skipped' | 'started' | 'failed' | 'completed';
380
+ reason?: string;
381
+ nodeId?: string;
382
+ providerType?: string;
383
+ sessionId?: string;
384
+ updatedAt: string;
385
+ };
386
+ dispatchTimestamp?: string;
387
+ createdAt: string;
388
+ updatedAt: string;
389
+ }
390
+
391
+ export interface RepoMeshQueueSummary {
392
+ total: number;
393
+ active: number;
394
+ historical: number;
395
+ pending: number;
396
+ assigned: number;
397
+ completed: number;
398
+ failed: number;
399
+ cancelled: number;
400
+ activeCounts: {
401
+ pending: number;
402
+ assigned: number;
403
+ };
404
+ historicalCounts: {
405
+ completed: number;
406
+ failed: number;
407
+ cancelled: number;
408
+ };
409
+ activeAssignments: Array<{
410
+ id: string;
411
+ nodeId?: string;
412
+ sessionId?: string;
413
+ message: string;
414
+ }>;
415
+ }
416
+
417
+ export interface RepoMeshQueueStatus {
418
+ tasks: RepoMeshQueueTask[];
419
+ summary: RepoMeshQueueSummary;
420
+ }
421
+
422
+ export interface RepoMeshLedgerEntryStatus {
423
+ id: string;
424
+ meshId: string;
425
+ timestamp: string;
426
+ kind: string;
427
+ nodeId?: string;
428
+ sessionId?: string;
429
+ providerType?: string;
430
+ payload: Record<string, unknown>;
431
+ }
432
+
433
+ export interface RepoMeshLedgerSummaryStatus {
434
+ meshId: string;
435
+ totalEntries: number;
436
+ taskDispatched: number;
437
+ taskCompleted: number;
438
+ taskFailed: number;
439
+ taskStalled: number;
440
+ sessionLaunched: number;
441
+ checkpointCreated: number;
442
+ lastActivityAt: string | null;
443
+ recentFailures: number;
444
+ }
445
+
446
+ export interface RepoMeshLedgerStatus {
447
+ entries: RepoMeshLedgerEntryStatus[];
448
+ summary: RepoMeshLedgerSummaryStatus;
449
+ }