@adhdev/daemon-core 0.9.82-rc.2 → 0.9.82-rc.21

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.
@@ -3,9 +3,12 @@ export interface PendingMeshCoordinatorEvent {
3
3
  event: string;
4
4
  meshId: string;
5
5
  nodeLabel: string;
6
+ nodeId?: string;
7
+ workspace?: string;
6
8
  metadataEvent: Record<string, unknown>;
7
9
  queuedAt: number;
8
10
  }
11
+ export declare function queuePendingMeshCoordinatorEvent(event: PendingMeshCoordinatorEvent): boolean;
9
12
  /** Drain and return all pending coordinator events, clearing the queue. */
10
13
  export declare function drainPendingMeshCoordinatorEvents(): PendingMeshCoordinatorEvent[];
11
14
  /** Peek at pending coordinator events without draining (non-destructive). */
@@ -1,4 +1,5 @@
1
1
  import type { ChatMessage } from '../types.js';
2
+ export declare const DEFAULT_FINAL_SUMMARY_MAX_CHARS = 4000;
2
3
  export declare function extractFinalSummaryFromMessages(messages: ChatMessage[] | null | undefined, maxChars?: number): string;
3
4
  export declare const BUILTIN_CHAT_MESSAGE_KINDS: readonly ["standard", "thought", "tool", "terminal", "system"];
4
5
  export type BuiltinChatMessageKind = typeof BUILTIN_CHAT_MESSAGE_KINDS[number];
@@ -211,16 +211,138 @@ export interface RepoMeshStatus {
211
211
  meshId: string;
212
212
  meshName: string;
213
213
  repoIdentity: string;
214
+ defaultBranch?: string;
214
215
  refreshedAt: string;
215
216
  nodes: RepoMeshNodeStatus[];
217
+ queue?: RepoMeshQueueStatus;
218
+ ledger?: RepoMeshLedgerStatus;
219
+ }
220
+ export interface RepoMeshSessionStatus {
221
+ sessionId: string;
222
+ providerType?: string;
223
+ state?: string;
224
+ lifecycle?: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'interrupted';
225
+ surfaceKind?: 'live_runtime' | 'recovery_snapshot' | 'inactive_record';
226
+ recoveryState?: string | null;
227
+ workspace?: string | null;
228
+ title?: string | null;
229
+ lastActivityAt?: string | null;
230
+ isCached?: boolean;
231
+ }
232
+ export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
233
+ export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
234
+ export interface RepoMeshPeerConnectionStatus {
235
+ perspective: 'selected_coordinator';
236
+ source: 'mesh_peer_status' | 'not_reported';
237
+ state: RepoMeshPeerConnectionState;
238
+ transport: RepoMeshPeerConnectionTransport;
239
+ reported: boolean;
240
+ reason?: string;
241
+ lastStateChangeAt?: string;
242
+ lastConnectedAt?: string;
243
+ lastCommandAt?: string;
216
244
  }
217
245
  export interface RepoMeshNodeStatus {
218
246
  nodeId: string;
219
247
  machineLabel: string;
220
248
  workspace: string;
249
+ repoRoot?: string;
250
+ daemonId?: string;
251
+ machineId?: string;
252
+ machineStatus?: string;
253
+ isLocalWorktree?: boolean;
254
+ worktreeBranch?: string;
221
255
  health: RepoMeshNodeHealth;
222
256
  git?: GitRepoStatus;
223
257
  providers: string[];
224
258
  activeSessions: string[];
259
+ activeSessionDetails?: RepoMeshSessionStatus[];
260
+ providerPriority?: string[];
261
+ launchReady?: boolean;
262
+ lastSeenAt?: string;
263
+ updatedAt?: string;
264
+ connection?: RepoMeshPeerConnectionStatus;
225
265
  error?: string;
226
266
  }
267
+ export type RepoMeshQueueTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
268
+ export interface RepoMeshQueueTask {
269
+ id: string;
270
+ meshId: string;
271
+ message: string;
272
+ status: RepoMeshQueueTaskStatus;
273
+ targetNodeId?: string;
274
+ targetSessionId?: string;
275
+ assignedNodeId?: string;
276
+ assignedSessionId?: string;
277
+ cancelReason?: string;
278
+ cancelledAt?: string;
279
+ requeueReason?: string;
280
+ requeuedAt?: string;
281
+ requeueCount?: number;
282
+ autoLaunch?: {
283
+ status: 'skipped' | 'started' | 'failed' | 'completed';
284
+ reason?: string;
285
+ nodeId?: string;
286
+ providerType?: string;
287
+ sessionId?: string;
288
+ updatedAt: string;
289
+ };
290
+ dispatchTimestamp?: string;
291
+ createdAt: string;
292
+ updatedAt: string;
293
+ }
294
+ export interface RepoMeshQueueSummary {
295
+ total: number;
296
+ active: number;
297
+ historical: number;
298
+ pending: number;
299
+ assigned: number;
300
+ completed: number;
301
+ failed: number;
302
+ cancelled: number;
303
+ activeCounts: {
304
+ pending: number;
305
+ assigned: number;
306
+ };
307
+ historicalCounts: {
308
+ completed: number;
309
+ failed: number;
310
+ cancelled: number;
311
+ };
312
+ activeAssignments: Array<{
313
+ id: string;
314
+ nodeId?: string;
315
+ sessionId?: string;
316
+ message: string;
317
+ }>;
318
+ }
319
+ export interface RepoMeshQueueStatus {
320
+ tasks: RepoMeshQueueTask[];
321
+ summary: RepoMeshQueueSummary;
322
+ }
323
+ export interface RepoMeshLedgerEntryStatus {
324
+ id: string;
325
+ meshId: string;
326
+ timestamp: string;
327
+ kind: string;
328
+ nodeId?: string;
329
+ sessionId?: string;
330
+ providerType?: string;
331
+ payload: Record<string, unknown>;
332
+ }
333
+ export interface RepoMeshLedgerSummaryStatus {
334
+ meshId: string;
335
+ totalEntries: number;
336
+ taskDispatched: number;
337
+ taskCompleted: number;
338
+ taskFailed: number;
339
+ taskStalled: number;
340
+ sessionLaunched: number;
341
+ checkpointCreated: number;
342
+ lastActivityAt: string | null;
343
+ recentFailures: number;
344
+ }
345
+ export interface RepoMeshLedgerStatus {
346
+ entries: RepoMeshLedgerEntryStatus[];
347
+ summary: RepoMeshLedgerSummaryStatus;
348
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.2",
3
+ "version": "0.9.82-rc.21",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -86,6 +86,8 @@ export interface DaemonInitConfig {
86
86
 
87
87
  /** Relays a command to a remote mesh node daemon */
88
88
  dispatchMeshCommand?: (daemonId: string, command: string, args: Record<string, unknown>) => Promise<any>;
89
+ /** Returns selected-coordinator mesh peer telemetry for a target daemon when available. */
90
+ getMeshPeerConnectionStatus?: (daemonId: string) => Record<string, unknown> | null;
89
91
  }
90
92
 
91
93
  // ─── Result ───
@@ -306,6 +308,7 @@ export async function initDaemonComponents(config: DaemonInitConfig): Promise<Da
306
308
  sessionHostControl: config.sessionHostControl,
307
309
  statusInstanceId: config.statusInstanceId,
308
310
  statusVersion: config.statusVersion,
311
+ getMeshPeerConnectionStatus: config.getMeshPeerConnectionStatus,
309
312
  getCdpLogFn: config.getCdpLogFn || ((ideType: string) => LOG.forComponent(`CDP:${ideType}`).asLogFn()),
310
313
  });
311
314