@adhdev/daemon-core 0.9.82-rc.1 → 0.9.82-rc.100
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/cli-adapters/provider-cli-adapter.d.ts +10 -0
- package/dist/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +10 -0
- package/dist/commands/router.d.ts +24 -0
- package/dist/config/mesh-config.d.ts +66 -1
- 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 +13 -6
- package/dist/index.js +6068 -1214
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6033 -1201
- package/dist/index.mjs.map +1 -1
- package/dist/installer.d.ts +1 -4
- package/dist/launch.d.ts +1 -1
- package/dist/logging/async-batch-writer.d.ts +10 -0
- package/dist/mesh/beads-db.d.ts +18 -0
- package/dist/mesh/mesh-active-work.d.ts +60 -0
- package/dist/mesh/mesh-events.d.ts +29 -5
- package/dist/mesh/mesh-fast-forward.d.ts +39 -0
- package/dist/mesh/mesh-host-ownership.d.ts +9 -0
- package/dist/mesh/mesh-ledger.d.ts +38 -1
- package/dist/mesh/mesh-work-queue.d.ts +27 -5
- package/dist/mesh/refine-config.d.ts +176 -0
- package/dist/providers/chat-message-normalization.d.ts +1 -0
- package/dist/providers/cli-provider-instance.d.ts +2 -1
- package/dist/repo-mesh-types.d.ts +167 -0
- package/dist/status/reporter.d.ts +2 -0
- package/package.json +3 -1
- package/src/boot/daemon-lifecycle.ts +4 -0
- package/src/cli-adapters/provider-cli-adapter.ts +255 -14
- package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/src/cli-adapters/provider-cli-parse.ts +4 -0
- package/src/cli-adapters/provider-cli-runtime.ts +3 -1
- package/src/cli-adapters/provider-cli-shared.d.ts +2 -0
- package/src/cli-adapters/provider-cli-shared.ts +28 -10
- package/src/commands/chat-commands.ts +570 -20
- package/src/commands/cli-manager.ts +129 -1
- package/src/commands/handler.ts +8 -1
- package/src/commands/mesh-coordinator.ts +13 -143
- package/src/commands/router.ts +3095 -406
- package/src/config/chat-history.ts +9 -7
- package/src/config/mesh-config.ts +245 -1
- package/src/daemon/dev-cli-debug.ts +10 -1
- package/src/detection/ide-detector.ts +26 -16
- 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 +39 -5
- package/src/installer.d.ts +1 -1
- package/src/installer.ts +8 -6
- package/src/launch.d.ts +1 -1
- package/src/launch.ts +37 -28
- package/src/logging/async-batch-writer.ts +55 -0
- package/src/logging/logger.ts +2 -1
- package/src/mesh/beads-db.ts +176 -0
- package/src/mesh/coordinator-prompt.ts +31 -8
- package/src/mesh/mesh-active-work.ts +255 -0
- package/src/mesh/mesh-events.ts +400 -47
- package/src/mesh/mesh-fast-forward.ts +430 -0
- package/src/mesh/mesh-host-ownership.ts +73 -0
- package/src/mesh/mesh-ledger.ts +138 -1
- package/src/mesh/mesh-work-queue.ts +199 -137
- package/src/mesh/refine-config.ts +356 -0
- package/src/providers/chat-message-normalization.ts +7 -12
- package/src/providers/cli-provider-instance.ts +93 -14
- package/src/providers/ide-provider-instance.ts +17 -3
- package/src/providers/provider-loader.ts +10 -4
- package/src/providers/read-chat-contract.ts +1 -1
- package/src/providers/version-archive.ts +38 -20
- package/src/repo-mesh-types.ts +182 -0
- package/src/status/reporter.ts +15 -0
- package/src/system/host-memory.ts +29 -12
|
@@ -19,10 +19,37 @@ export interface RepoMesh {
|
|
|
19
19
|
defaultBranch?: string;
|
|
20
20
|
policy: RepoMeshPolicy;
|
|
21
21
|
coordinator: RepoMeshCoordinatorConfig;
|
|
22
|
+
meshHost?: RepoMeshHostMetadata;
|
|
22
23
|
projectContext: ProjectContextSnapshot;
|
|
23
24
|
nodes: RepoMeshNode[];
|
|
24
25
|
status: 'active' | 'archived' | 'deleted';
|
|
25
26
|
}
|
|
27
|
+
export type RepoMeshDaemonRole = 'host' | 'member';
|
|
28
|
+
export interface RepoMeshHostPairingMetadata {
|
|
29
|
+
status: 'not_configured' | 'pairing' | 'paired' | 'rejected' | 'revoked';
|
|
30
|
+
tokenId?: string;
|
|
31
|
+
joinedAt?: string;
|
|
32
|
+
lastPairedAt?: string;
|
|
33
|
+
lastRejectedAt?: string;
|
|
34
|
+
expiresAt?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface RepoMeshHostMetadata {
|
|
37
|
+
/** Local daemon role for this mesh. Missing metadata defaults to host for standalone compatibility. */
|
|
38
|
+
role: RepoMeshDaemonRole;
|
|
39
|
+
/** Daemon that owns mesh truth/status/git/queue/session/ledger/coordinator ownership. */
|
|
40
|
+
hostDaemonId?: string;
|
|
41
|
+
/** Mesh node that represents the host daemon, when known. */
|
|
42
|
+
hostNodeId?: string;
|
|
43
|
+
/** Future standalone manual pairing endpoint entered by member daemons. */
|
|
44
|
+
hostAddress?: string;
|
|
45
|
+
/** Redacted pairing state only; raw join tokens must not be persisted here. */
|
|
46
|
+
pairing?: RepoMeshHostPairingMetadata;
|
|
47
|
+
}
|
|
48
|
+
export interface RepoMeshHostStatus extends RepoMeshHostMetadata {
|
|
49
|
+
canOwnCoordinator: boolean;
|
|
50
|
+
canOwnQueue: boolean;
|
|
51
|
+
defaulted: boolean;
|
|
52
|
+
}
|
|
26
53
|
export interface RepoMeshNode {
|
|
27
54
|
id: string;
|
|
28
55
|
daemonId: string;
|
|
@@ -37,6 +64,7 @@ export interface RepoMeshNode {
|
|
|
37
64
|
effectiveCapabilities: RepoMeshNodeCapabilities;
|
|
38
65
|
policy: RepoMeshNodePolicy;
|
|
39
66
|
health: RepoMeshNodeHealth;
|
|
67
|
+
role?: RepoMeshDaemonRole;
|
|
40
68
|
status: 'enabled' | 'disabled' | 'removed';
|
|
41
69
|
}
|
|
42
70
|
export type RepoMeshNodeHealth = 'online' | 'offline' | 'degraded' | 'dirty' | 'wrong_branch' | 'unknown';
|
|
@@ -46,6 +74,13 @@ export interface RepoMeshPolicy {
|
|
|
46
74
|
requirePreTaskCheckpoint: boolean;
|
|
47
75
|
requirePostTaskCheckpoint: boolean;
|
|
48
76
|
requireApprovalForPush: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Narrow Refinery opt-in: when validation and patch-equivalence have passed,
|
|
79
|
+
* allow Refinery to publish submodule gitlink commits to each submodule's
|
|
80
|
+
* configured remote main branch with a non-force push, then verify reachability.
|
|
81
|
+
* Defaults to false; root branch pushes/merges are not affected.
|
|
82
|
+
*/
|
|
83
|
+
allowAutoPublishSubmoduleMainCommits?: boolean;
|
|
49
84
|
requireApprovalForDestructiveGit: boolean;
|
|
50
85
|
dirtyWorkspaceBehavior: 'block' | 'warn' | 'checkpoint_then_continue';
|
|
51
86
|
maxParallelTasks: number;
|
|
@@ -185,6 +220,7 @@ export interface LocalMeshEntry {
|
|
|
185
220
|
defaultBranch?: string;
|
|
186
221
|
policy: RepoMeshPolicy;
|
|
187
222
|
coordinator: RepoMeshCoordinatorConfig;
|
|
223
|
+
meshHost?: RepoMeshHostMetadata;
|
|
188
224
|
nodes: LocalMeshNodeEntry[];
|
|
189
225
|
createdAt: string;
|
|
190
226
|
updatedAt: string;
|
|
@@ -206,21 +242,152 @@ export interface LocalMeshNodeEntry {
|
|
|
206
242
|
clonedFromNodeId?: string;
|
|
207
243
|
/** Optional associated/external repos configured as node metadata. */
|
|
208
244
|
relatedRepos?: RepoMeshRelatedRepo[];
|
|
245
|
+
role?: RepoMeshDaemonRole;
|
|
209
246
|
}
|
|
210
247
|
export interface RepoMeshStatus {
|
|
211
248
|
meshId: string;
|
|
212
249
|
meshName: string;
|
|
213
250
|
repoIdentity: string;
|
|
251
|
+
defaultBranch?: string;
|
|
214
252
|
refreshedAt: string;
|
|
253
|
+
meshHost?: RepoMeshHostStatus;
|
|
215
254
|
nodes: RepoMeshNodeStatus[];
|
|
255
|
+
queue?: RepoMeshQueueStatus;
|
|
256
|
+
ledger?: RepoMeshLedgerStatus;
|
|
257
|
+
}
|
|
258
|
+
export interface RepoMeshSessionStatus {
|
|
259
|
+
sessionId: string;
|
|
260
|
+
providerType?: string;
|
|
261
|
+
state?: string;
|
|
262
|
+
lifecycle?: 'starting' | 'running' | 'stopping' | 'stopped' | 'failed' | 'interrupted';
|
|
263
|
+
surfaceKind?: 'live_runtime' | 'recovery_snapshot' | 'inactive_record';
|
|
264
|
+
recoveryState?: string | null;
|
|
265
|
+
workspace?: string | null;
|
|
266
|
+
title?: string | null;
|
|
267
|
+
lastActivityAt?: string | null;
|
|
268
|
+
isCached?: boolean;
|
|
269
|
+
}
|
|
270
|
+
export type RepoMeshPeerConnectionState = 'self' | 'connected' | 'connecting' | 'disconnected' | 'failed' | 'closed' | 'unknown';
|
|
271
|
+
export type RepoMeshPeerConnectionTransport = 'local' | 'direct' | 'relay' | 'unknown';
|
|
272
|
+
export interface RepoMeshPeerConnectionStatus {
|
|
273
|
+
perspective: 'selected_coordinator';
|
|
274
|
+
source: 'mesh_peer_status' | 'not_reported';
|
|
275
|
+
state: RepoMeshPeerConnectionState;
|
|
276
|
+
transport: RepoMeshPeerConnectionTransport;
|
|
277
|
+
reported: boolean;
|
|
278
|
+
reason?: string;
|
|
279
|
+
lastStateChangeAt?: string;
|
|
280
|
+
lastConnectedAt?: string;
|
|
281
|
+
lastCommandAt?: string;
|
|
216
282
|
}
|
|
217
283
|
export interface RepoMeshNodeStatus {
|
|
218
284
|
nodeId: string;
|
|
219
285
|
machineLabel: string;
|
|
220
286
|
workspace: string;
|
|
287
|
+
repoRoot?: string;
|
|
288
|
+
daemonId?: string;
|
|
289
|
+
machineId?: string;
|
|
290
|
+
role?: RepoMeshDaemonRole;
|
|
291
|
+
machineStatus?: string;
|
|
292
|
+
isLocalWorktree?: boolean;
|
|
293
|
+
worktreeBranch?: string;
|
|
221
294
|
health: RepoMeshNodeHealth;
|
|
222
295
|
git?: GitRepoStatus;
|
|
296
|
+
/**
|
|
297
|
+
* True when the selected coordinator has evidence that a peer git probe is still
|
|
298
|
+
* in flight or just timed out during initial mesh handshake, so callers should
|
|
299
|
+
* treat missing git data as pending instead of authoritative absence.
|
|
300
|
+
*/
|
|
301
|
+
gitProbePending?: boolean;
|
|
223
302
|
providers: string[];
|
|
224
303
|
activeSessions: string[];
|
|
304
|
+
activeSessionDetails?: RepoMeshSessionStatus[];
|
|
305
|
+
providerPriority?: string[];
|
|
306
|
+
launchReady?: boolean;
|
|
307
|
+
lastSeenAt?: string;
|
|
308
|
+
updatedAt?: string;
|
|
309
|
+
connection?: RepoMeshPeerConnectionStatus;
|
|
225
310
|
error?: string;
|
|
226
311
|
}
|
|
312
|
+
export type RepoMeshQueueTaskStatus = 'pending' | 'assigned' | 'completed' | 'failed' | 'cancelled';
|
|
313
|
+
export interface RepoMeshQueueTask {
|
|
314
|
+
id: string;
|
|
315
|
+
meshId: string;
|
|
316
|
+
message: string;
|
|
317
|
+
status: RepoMeshQueueTaskStatus;
|
|
318
|
+
targetNodeId?: string;
|
|
319
|
+
targetSessionId?: string;
|
|
320
|
+
assignedNodeId?: string;
|
|
321
|
+
assignedSessionId?: string;
|
|
322
|
+
cancelReason?: string;
|
|
323
|
+
cancelledAt?: string;
|
|
324
|
+
requeueReason?: string;
|
|
325
|
+
requeuedAt?: string;
|
|
326
|
+
requeueCount?: number;
|
|
327
|
+
autoLaunch?: {
|
|
328
|
+
status: 'skipped' | 'started' | 'failed' | 'completed';
|
|
329
|
+
reason?: string;
|
|
330
|
+
nodeId?: string;
|
|
331
|
+
providerType?: string;
|
|
332
|
+
sessionId?: string;
|
|
333
|
+
updatedAt: string;
|
|
334
|
+
};
|
|
335
|
+
dispatchTimestamp?: string;
|
|
336
|
+
createdAt: string;
|
|
337
|
+
updatedAt: string;
|
|
338
|
+
}
|
|
339
|
+
export interface RepoMeshQueueSummary {
|
|
340
|
+
total: number;
|
|
341
|
+
active: number;
|
|
342
|
+
historical: number;
|
|
343
|
+
pending: number;
|
|
344
|
+
assigned: number;
|
|
345
|
+
completed: number;
|
|
346
|
+
failed: number;
|
|
347
|
+
cancelled: number;
|
|
348
|
+
activeCounts: {
|
|
349
|
+
pending: number;
|
|
350
|
+
assigned: number;
|
|
351
|
+
};
|
|
352
|
+
historicalCounts: {
|
|
353
|
+
completed: number;
|
|
354
|
+
failed: number;
|
|
355
|
+
cancelled: number;
|
|
356
|
+
};
|
|
357
|
+
activeAssignments: Array<{
|
|
358
|
+
id: string;
|
|
359
|
+
nodeId?: string;
|
|
360
|
+
sessionId?: string;
|
|
361
|
+
message: string;
|
|
362
|
+
}>;
|
|
363
|
+
}
|
|
364
|
+
export interface RepoMeshQueueStatus {
|
|
365
|
+
tasks: RepoMeshQueueTask[];
|
|
366
|
+
summary: RepoMeshQueueSummary;
|
|
367
|
+
}
|
|
368
|
+
export interface RepoMeshLedgerEntryStatus {
|
|
369
|
+
id: string;
|
|
370
|
+
meshId: string;
|
|
371
|
+
timestamp: string;
|
|
372
|
+
kind: string;
|
|
373
|
+
nodeId?: string;
|
|
374
|
+
sessionId?: string;
|
|
375
|
+
providerType?: string;
|
|
376
|
+
payload: Record<string, unknown>;
|
|
377
|
+
}
|
|
378
|
+
export interface RepoMeshLedgerSummaryStatus {
|
|
379
|
+
meshId: string;
|
|
380
|
+
totalEntries: number;
|
|
381
|
+
taskDispatched: number;
|
|
382
|
+
taskCompleted: number;
|
|
383
|
+
taskFailed: number;
|
|
384
|
+
taskStalled: number;
|
|
385
|
+
sessionLaunched: number;
|
|
386
|
+
checkpointCreated: number;
|
|
387
|
+
lastActivityAt: string | null;
|
|
388
|
+
recentFailures: number;
|
|
389
|
+
}
|
|
390
|
+
export interface RepoMeshLedgerStatus {
|
|
391
|
+
entries: RepoMeshLedgerEntryStatus[];
|
|
392
|
+
summary: RepoMeshLedgerSummaryStatus;
|
|
393
|
+
}
|
|
@@ -46,6 +46,8 @@ export declare class DaemonStatusReporter {
|
|
|
46
46
|
private lastStatusSentAt;
|
|
47
47
|
private statusPendingThrottle;
|
|
48
48
|
private lastP2PStatusHash;
|
|
49
|
+
private lastP2PStatusSentAt;
|
|
50
|
+
private p2pDebounceTimer;
|
|
49
51
|
private lastServerStatusHash;
|
|
50
52
|
private lastStatusSummary;
|
|
51
53
|
private statusTimer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-core",
|
|
3
|
-
"version": "0.9.82-rc.
|
|
3
|
+
"version": "0.9.82-rc.100",
|
|
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",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@adhdev/session-host-core": "*",
|
|
50
50
|
"@agentclientprotocol/sdk": "^0.16.1",
|
|
51
51
|
"@xterm/xterm": "^6.0.0",
|
|
52
|
+
"better-sqlite3": "^12.10.0",
|
|
52
53
|
"chalk": "^5.3.0",
|
|
53
54
|
"chokidar": "^4.0.3",
|
|
54
55
|
"conf": "^13.0.0",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"@adhdev/ghostty-vt-node": "*"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
64
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
63
65
|
"@types/js-yaml": "^4.0.9",
|
|
64
66
|
"@types/node": "^22.0.0",
|
|
65
67
|
"@types/ws": "^8.18.1",
|
|
@@ -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,8 @@ 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,
|
|
312
|
+
dispatchMeshCommand: config.dispatchMeshCommand,
|
|
309
313
|
getCdpLogFn: config.getCdpLogFn || ((ideType: string) => LOG.forComponent(`CDP:${ideType}`).asLogFn()),
|
|
310
314
|
});
|
|
311
315
|
|