@adhdev/daemon-core 0.9.81 → 0.9.82-rc.10
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/boot/daemon-lifecycle.d.ts +2 -0
- package/dist/commands/router.d.ts +2 -0
- package/dist/git/git-commands.d.ts +1 -0
- package/dist/git/git-status.d.ts +5 -0
- package/dist/git/git-types.d.ts +10 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +415 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +414 -78
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-events.d.ts +3 -0
- package/dist/repo-mesh-types.d.ts +121 -0
- package/package.json +1 -1
- package/src/boot/daemon-lifecycle.ts +3 -0
- package/src/commands/router.ts +373 -67
- package/src/git/git-commands.ts +3 -3
- package/src/git/git-status.ts +97 -6
- package/src/git/git-summary.ts +3 -0
- package/src/git/git-types.ts +11 -0
- package/src/index.ts +9 -1
- package/src/mesh/mesh-events.ts +14 -3
- package/src/repo-mesh-types.ts +131 -0
|
@@ -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). */
|
|
@@ -213,14 +213,135 @@ export interface RepoMeshStatus {
|
|
|
213
213
|
repoIdentity: string;
|
|
214
214
|
refreshedAt: string;
|
|
215
215
|
nodes: RepoMeshNodeStatus[];
|
|
216
|
+
queue?: RepoMeshQueueStatus;
|
|
217
|
+
ledger?: RepoMeshLedgerStatus;
|
|
218
|
+
}
|
|
219
|
+
export interface RepoMeshSessionStatus {
|
|
220
|
+
sessionId: string;
|
|
221
|
+
providerType?: string;
|
|
222
|
+
state?: string;
|
|
223
|
+
lifecycle?: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'interrupted';
|
|
224
|
+
surfaceKind?: 'live_runtime' | 'recovery_snapshot' | 'inactive_record';
|
|
225
|
+
recoveryState?: string | null;
|
|
226
|
+
workspace?: string | null;
|
|
227
|
+
title?: string | null;
|
|
228
|
+
lastActivityAt?: string | null;
|
|
229
|
+
isCached?: boolean;
|
|
230
|
+
}
|
|
231
|
+
export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
|
|
232
|
+
export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
|
|
233
|
+
export interface RepoMeshPeerConnectionStatus {
|
|
234
|
+
perspective: 'selected_coordinator';
|
|
235
|
+
source: 'mesh_peer_status' | 'not_reported';
|
|
236
|
+
state: RepoMeshPeerConnectionState;
|
|
237
|
+
transport: RepoMeshPeerConnectionTransport;
|
|
238
|
+
reported: boolean;
|
|
239
|
+
reason?: string;
|
|
240
|
+
lastStateChangeAt?: string;
|
|
241
|
+
lastConnectedAt?: string;
|
|
242
|
+
lastCommandAt?: string;
|
|
216
243
|
}
|
|
217
244
|
export interface RepoMeshNodeStatus {
|
|
218
245
|
nodeId: string;
|
|
219
246
|
machineLabel: string;
|
|
220
247
|
workspace: string;
|
|
248
|
+
repoRoot?: string;
|
|
249
|
+
daemonId?: string;
|
|
250
|
+
machineId?: string;
|
|
251
|
+
machineStatus?: string;
|
|
252
|
+
isLocalWorktree?: boolean;
|
|
253
|
+
worktreeBranch?: string;
|
|
221
254
|
health: RepoMeshNodeHealth;
|
|
222
255
|
git?: GitRepoStatus;
|
|
223
256
|
providers: string[];
|
|
224
257
|
activeSessions: string[];
|
|
258
|
+
activeSessionDetails?: RepoMeshSessionStatus[];
|
|
259
|
+
providerPriority?: string[];
|
|
260
|
+
launchReady?: boolean;
|
|
261
|
+
lastSeenAt?: string;
|
|
262
|
+
updatedAt?: string;
|
|
263
|
+
connection?: RepoMeshPeerConnectionStatus;
|
|
225
264
|
error?: string;
|
|
226
265
|
}
|
|
266
|
+
export type RepoMeshQueueTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
|
|
267
|
+
export interface RepoMeshQueueTask {
|
|
268
|
+
id: string;
|
|
269
|
+
meshId: string;
|
|
270
|
+
message: string;
|
|
271
|
+
status: RepoMeshQueueTaskStatus;
|
|
272
|
+
targetNodeId?: string;
|
|
273
|
+
targetSessionId?: string;
|
|
274
|
+
assignedNodeId?: string;
|
|
275
|
+
assignedSessionId?: string;
|
|
276
|
+
cancelReason?: string;
|
|
277
|
+
cancelledAt?: string;
|
|
278
|
+
requeueReason?: string;
|
|
279
|
+
requeuedAt?: string;
|
|
280
|
+
requeueCount?: number;
|
|
281
|
+
autoLaunch?: {
|
|
282
|
+
status: 'skipped' | 'started' | 'failed' | 'completed';
|
|
283
|
+
reason?: string;
|
|
284
|
+
nodeId?: string;
|
|
285
|
+
providerType?: string;
|
|
286
|
+
sessionId?: string;
|
|
287
|
+
updatedAt: string;
|
|
288
|
+
};
|
|
289
|
+
dispatchTimestamp?: string;
|
|
290
|
+
createdAt: string;
|
|
291
|
+
updatedAt: string;
|
|
292
|
+
}
|
|
293
|
+
export interface RepoMeshQueueSummary {
|
|
294
|
+
total: number;
|
|
295
|
+
active: number;
|
|
296
|
+
historical: number;
|
|
297
|
+
pending: number;
|
|
298
|
+
assigned: number;
|
|
299
|
+
completed: number;
|
|
300
|
+
failed: number;
|
|
301
|
+
cancelled: number;
|
|
302
|
+
activeCounts: {
|
|
303
|
+
pending: number;
|
|
304
|
+
assigned: number;
|
|
305
|
+
};
|
|
306
|
+
historicalCounts: {
|
|
307
|
+
completed: number;
|
|
308
|
+
failed: number;
|
|
309
|
+
cancelled: number;
|
|
310
|
+
};
|
|
311
|
+
activeAssignments: Array<{
|
|
312
|
+
id: string;
|
|
313
|
+
nodeId?: string;
|
|
314
|
+
sessionId?: string;
|
|
315
|
+
message: string;
|
|
316
|
+
}>;
|
|
317
|
+
}
|
|
318
|
+
export interface RepoMeshQueueStatus {
|
|
319
|
+
tasks: RepoMeshQueueTask[];
|
|
320
|
+
summary: RepoMeshQueueSummary;
|
|
321
|
+
}
|
|
322
|
+
export interface RepoMeshLedgerEntryStatus {
|
|
323
|
+
id: string;
|
|
324
|
+
meshId: string;
|
|
325
|
+
timestamp: string;
|
|
326
|
+
kind: string;
|
|
327
|
+
nodeId?: string;
|
|
328
|
+
sessionId?: string;
|
|
329
|
+
providerType?: string;
|
|
330
|
+
payload: Record<string, unknown>;
|
|
331
|
+
}
|
|
332
|
+
export interface RepoMeshLedgerSummaryStatus {
|
|
333
|
+
meshId: string;
|
|
334
|
+
totalEntries: number;
|
|
335
|
+
taskDispatched: number;
|
|
336
|
+
taskCompleted: number;
|
|
337
|
+
taskFailed: number;
|
|
338
|
+
taskStalled: number;
|
|
339
|
+
sessionLaunched: number;
|
|
340
|
+
checkpointCreated: number;
|
|
341
|
+
lastActivityAt: string | null;
|
|
342
|
+
recentFailures: number;
|
|
343
|
+
}
|
|
344
|
+
export interface RepoMeshLedgerStatus {
|
|
345
|
+
entries: RepoMeshLedgerEntryStatus[];
|
|
346
|
+
summary: RepoMeshLedgerSummaryStatus;
|
|
347
|
+
}
|
package/package.json
CHANGED
|
@@ -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
|
|