@adhdev/daemon-core 0.9.82-rc.291 → 0.9.82-rc.293
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/commands/router.d.ts +50 -0
- package/dist/index.js +637 -327
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +639 -329
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-missions.d.ts +25 -1
- package/dist/mesh/mesh-runtime-store.d.ts +15 -0
- package/dist/mesh/mesh-unresolved-forward-outbox.d.ts +30 -0
- package/package.json +2 -2
- package/src/commands/router.ts +274 -58
- package/src/git/git-status.ts +46 -11
- package/src/mesh/coordinator-prompt.ts +2 -2
- package/src/mesh/mesh-active-work.ts +2 -1
- package/src/mesh/mesh-events-coordinator.ts +58 -10
- package/src/mesh/mesh-missions.ts +41 -3
- package/src/mesh/mesh-reconcile-loop.ts +55 -0
- package/src/mesh/mesh-runtime-store.ts +30 -0
- package/src/mesh/mesh-unresolved-forward-outbox.ts +185 -0
- package/src/providers/cli-provider-instance.ts +21 -16
- package/src/providers/extension-provider-instance.ts +5 -1
- package/src/providers/ide-provider-instance.ts +6 -1
|
@@ -37,6 +37,23 @@ export interface MeshMissionTaskAggregate {
|
|
|
37
37
|
export interface MeshMissionSummary extends MeshMissionRecord {
|
|
38
38
|
tasks: MeshMissionTaskAggregate;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Slim mission summary for the mesh_status compact (default) surface. Drops the
|
|
42
|
+
* full `goal` text — which can be hundreds of chars per mission and is repeated
|
|
43
|
+
* for every mission on every status call — keeping only a short preview plus a
|
|
44
|
+
* `goalTruncated` flag when the original was longer. The stored goal is never
|
|
45
|
+
* mutated; this is an output-only projection. Coordinators that need the full
|
|
46
|
+
* goal call mesh_status with verbose=true, or read the mission directly via
|
|
47
|
+
* mesh_mission_upsert / getMeshMission.
|
|
48
|
+
*/
|
|
49
|
+
export interface MeshMissionSlimSummary extends Omit<MeshMissionSummary, 'goal'> {
|
|
50
|
+
/** Short preview of the goal (≤ GOAL_PREVIEW_MAX chars), '' when goal empty. */
|
|
51
|
+
goalPreview: string;
|
|
52
|
+
/** True when the stored goal was longer than the preview (full text elided). */
|
|
53
|
+
goalTruncated: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Max chars of goal text retained in the slim (compact) mission summary. */
|
|
56
|
+
export declare const GOAL_PREVIEW_MAX = 120;
|
|
40
57
|
export declare function upsertMeshMission(meshId: string, input: {
|
|
41
58
|
id?: string;
|
|
42
59
|
title: string;
|
|
@@ -56,10 +73,17 @@ export declare function getActiveMeshMissionSummaries(meshId: string): MeshMissi
|
|
|
56
73
|
* the dashboard can render a collapsible "history" section without unbounded
|
|
57
74
|
* payload growth. Returned newest-first within each group (active/paused first,
|
|
58
75
|
* then history), so the frontend can split on `status` directly.
|
|
76
|
+
*
|
|
77
|
+
* Compact mode (the default) elides each mission's full `goal` text — which is
|
|
78
|
+
* repeated verbatim on every status poll and dominates the payload when a mesh
|
|
79
|
+
* has many missions — returning only a short `goalPreview` + `goalTruncated`
|
|
80
|
+
* flag. Pass `verbose: true` to get the full `goal` text per mission. The stored
|
|
81
|
+
* goal is untouched in both modes; this is an output-only projection.
|
|
59
82
|
*/
|
|
60
83
|
export declare function getMeshStatusMissionSummaries(meshId: string, options?: {
|
|
61
84
|
historyLimit?: number;
|
|
62
|
-
|
|
85
|
+
verbose?: boolean;
|
|
86
|
+
}): MeshMissionSummary[] | MeshMissionSlimSummary[];
|
|
63
87
|
/**
|
|
64
88
|
* M3-3: render active missions as a prompt section for {{mission}}.
|
|
65
89
|
* Empty string when no active mission — the prompt stays byte-identical to
|
|
@@ -342,4 +342,19 @@ export declare class MeshRuntimeStore {
|
|
|
342
342
|
/** Remove all pending-event rows (drained included) for a mesh — mesh deletion / test cleanup. */
|
|
343
343
|
clearPendingEventsForMesh(meshId: string): number;
|
|
344
344
|
pendingEventCount(meshId: string): number;
|
|
345
|
+
/**
|
|
346
|
+
* Mark specific pending-event rows drained by id (ack). Used by the
|
|
347
|
+
* unresolved-delegate durable-forward outbox: an event is peeked (not drained)
|
|
348
|
+
* while its push to the coordinator is unconfirmed, then marked drained ONLY
|
|
349
|
+
* after the push is acked. A failed push leaves the row undrained so the next
|
|
350
|
+
* reconcile tick retries it. Returns the number of rows newly marked drained.
|
|
351
|
+
*/
|
|
352
|
+
markPendingEventsDrainedById(ids: ReadonlyArray<string>): number;
|
|
353
|
+
/**
|
|
354
|
+
* Hard-delete pending-event rows by id (including the dedup fingerprint history).
|
|
355
|
+
* Used to expire an unresolved-delegate outbox entry that has exhausted its retry
|
|
356
|
+
* budget — fully removing it frees the fingerprint so a genuinely new completion
|
|
357
|
+
* for the same task could be re-queued later. Returns the number of rows deleted.
|
|
358
|
+
*/
|
|
359
|
+
deletePendingEventsById(ids: ReadonlyArray<string>): number;
|
|
345
360
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const UNRESOLVED_FORWARD_OUTBOX_MESH_ID = "__unresolved_forward_outbox__";
|
|
2
|
+
export interface UnresolvedForwardEntry {
|
|
3
|
+
/** Row id in mesh_pending_events; pass back to ack/expire after a push attempt. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The coordinator daemon to push this event to (mesh_forward_event target). */
|
|
6
|
+
coordinatorDaemonId: string;
|
|
7
|
+
/** The flat payload to forward (already shaped for handleMeshForwardEvent). */
|
|
8
|
+
payload: Record<string, unknown>;
|
|
9
|
+
/** When the entry was first enqueued (epoch ms) — used for age-based expiry. */
|
|
10
|
+
queuedAt: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Durably enqueue an unresolved-delegate forward for a coordinator daemon. The
|
|
14
|
+
* `forwardPayload` is the flat shape handleMeshForwardEvent reads on the coordinator.
|
|
15
|
+
* Idempotent on the event fingerprint. Returns true when a new row was written (or a
|
|
16
|
+
* duplicate was harmlessly ignored), false on a hard persistence failure.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enqueueUnresolvedDelegateForward(coordinatorDaemonId: string, eventName: string, forwardPayload: Record<string, unknown>): boolean;
|
|
19
|
+
/** Peek (non-destructive) every undrained outbox entry across all coordinators. */
|
|
20
|
+
export declare function peekUnresolvedDelegateForwards(): UnresolvedForwardEntry[];
|
|
21
|
+
/** Mark an outbox entry delivered (acked) after a successful push. */
|
|
22
|
+
export declare function ackUnresolvedDelegateForward(id: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Drop outbox entries that have exceeded the max retry age. Returns the count
|
|
25
|
+
* expired so the caller can log a fail-loud trace (a dropped completion is a real
|
|
26
|
+
* loss; it must be visible, not silent).
|
|
27
|
+
*/
|
|
28
|
+
export declare function expireStaleUnresolvedDelegateForwards(nowMs?: number): number;
|
|
29
|
+
/** Test helper: purge the entire outbox. */
|
|
30
|
+
export declare function __clearUnresolvedDelegateForwardOutboxForTests(): void;
|
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.293",
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"author": "vilmire",
|
|
47
47
|
"license": "AGPL-3.0-or-later",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@adhdev/mesh-shared": "0.9.82-rc.
|
|
49
|
+
"@adhdev/mesh-shared": "0.9.82-rc.293",
|
|
50
50
|
"@adhdev/session-host-core": "*",
|
|
51
51
|
"@agentclientprotocol/sdk": "^0.16.1",
|
|
52
52
|
"ajv": "^8.20.0",
|