@adhdev/daemon-core 0.9.82-rc.480 → 0.9.82-rc.482
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/config/mesh-config.d.ts +5 -28
- package/dist/index.d.ts +2 -2
- package/dist/index.js +243 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +243 -241
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/contracts.d.ts +8 -5
- package/dist/mesh/mesh-reconcile-loop.d.ts +4 -0
- package/dist/mesh/mesh-runtime-store.d.ts +47 -2
- package/dist/mesh/mesh-unresolved-forward-outbox.d.ts +4 -0
- package/dist/repo-mesh-types.d.ts +7 -13
- package/dist/types.d.ts +15 -6
- package/package.json +3 -3
- package/src/commands/chat-commands-read.ts +81 -60
- package/src/commands/med-family/mesh-crud.ts +8 -62
- package/src/config/mesh-config.ts +9 -140
- package/src/index.ts +1 -2
- package/src/mesh/contracts.ts +17 -11
- package/src/mesh/coordinator-prompt.ts +3 -6
- package/src/mesh/mesh-event-forwarding.ts +38 -102
- package/src/mesh/mesh-reconcile-loop.ts +157 -2
- package/src/mesh/mesh-runtime-store.ts +118 -3
- package/src/mesh/mesh-unresolved-forward-outbox.ts +30 -0
- package/src/repo-mesh-types.ts +7 -13
- package/src/types.ts +21 -6
|
@@ -65,6 +65,36 @@ function getStore(): MeshRuntimeStore | undefined {
|
|
|
65
65
|
try { return MeshRuntimeStore.getInstance(); } catch { return undefined; }
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// Reconcile-nudge registry (polling-single-model §2.1 (B)).
|
|
70
|
+
//
|
|
71
|
+
// The spontaneous best-effort immediate push that used to run inline in
|
|
72
|
+
// forwardUnresolvedDelegateEvent was removed: the durable outbox row + the
|
|
73
|
+
// reconcile loop's PHASE 0 retry (acked, retry-capped) is now the ONLY delivery
|
|
74
|
+
// path for an unresolved-delegate event. To keep the happy-path latency low
|
|
75
|
+
// without re-introducing a spontaneous data push, the enqueue site emits a
|
|
76
|
+
// data-free NUDGE: "outbox has work — run the PHASE 0 retry soon". The reconcile
|
|
77
|
+
// loop registers the handler at setup; a lost/unregistered nudge is harmless —
|
|
78
|
+
// the next periodic tick (default 4s) covers it, so nudge loss = bounded delay,
|
|
79
|
+
// never event loss.
|
|
80
|
+
//
|
|
81
|
+
// A registry (rather than a direct import of the reconcile loop) keeps the
|
|
82
|
+
// module graph acyclic: mesh-reconcile-loop already imports from
|
|
83
|
+
// mesh-event-forwarding (via the mesh-events-coordinator barrel), so the
|
|
84
|
+
// forwarding side must not import the loop back.
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
let retryNudgeHandler: (() => void) | undefined;
|
|
87
|
+
|
|
88
|
+
/** Register (or clear, with undefined) the PHASE 0 retry nudge handler. */
|
|
89
|
+
export function registerUnresolvedForwardRetryNudge(handler?: () => void): void {
|
|
90
|
+
retryNudgeHandler = handler;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Fire-and-forget nudge: ask the reconcile loop to run the outbox retry soon. */
|
|
94
|
+
export function nudgeUnresolvedForwardRetry(): void {
|
|
95
|
+
try { retryNudgeHandler?.(); } catch { /* nudge is best-effort; the periodic tick covers */ }
|
|
96
|
+
}
|
|
97
|
+
|
|
68
98
|
/**
|
|
69
99
|
* Durably enqueue an unresolved-delegate forward for a coordinator daemon. The
|
|
70
100
|
* `forwardPayload` is the flat shape handleMeshForwardEvent reads on the coordinator.
|
package/src/repo-mesh-types.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { GitRepoStatus, GitCompactSummary } from './git/git-types.js';
|
|
15
15
|
import type { MeshMissionSummary, MeshMissionSlimSummary } from './mesh/mesh-missions.js';
|
|
16
16
|
import type { MeshMagiActivitySummary } from './mesh/mesh-magi-status.js';
|
|
17
|
-
import type {
|
|
17
|
+
import type { MagiKindPanelMap } from '@adhdev/mesh-shared';
|
|
18
18
|
|
|
19
19
|
// ─── Core Mesh Types ────────────────────────────
|
|
20
20
|
|
|
@@ -814,18 +814,12 @@ export interface RepoMeshCoordinatorConfig {
|
|
|
814
814
|
export interface LocalMeshConfig {
|
|
815
815
|
meshes: LocalMeshEntry[];
|
|
816
816
|
/**
|
|
817
|
-
* MAGI
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* MAGI-KIND-PANEL: per-task_kind panel bindings (machine-local). Keyed by
|
|
825
|
-
* task_kind (rca / design / claim_audit / freeform); each maps to ≥1
|
|
826
|
-
* `(node × provider × model?)` slot. A `mesh_magi_review` invoked with a bare
|
|
827
|
-
* `task_kind` resolves its panel from here — an unconfigured kind is a hard
|
|
828
|
-
* error, never a synthesized fallback. Optional; absent on pre-feature configs.
|
|
817
|
+
* MAGI-KIND-PANEL: per-task_kind panel bindings (machine-local), the SOLE MAGI
|
|
818
|
+
* panel-resolution surface (the former named-panel `magiPanels` map was removed).
|
|
819
|
+
* Keyed by task_kind (rca / design / claim_audit / freeform); each maps to ≥1
|
|
820
|
+
* `(node × provider × model?)` slot. A `mesh_magi_review` resolves its panel from
|
|
821
|
+
* here — an unconfigured kind is a hard error, never a synthesized fallback.
|
|
822
|
+
* Optional; absent on pre-feature configs.
|
|
829
823
|
*/
|
|
830
824
|
magiKindPanels?: MagiKindPanelMap;
|
|
831
825
|
}
|
package/src/types.ts
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
* When modifying this file, also update interface contracts in AGENT_PROTOCOL.md.
|
|
6
6
|
*/
|
|
7
7
|
import type { StatusReportPayload, AvailableProviderInfo } from './shared-types.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
ChatMessageKind,
|
|
10
|
+
ChatMessageVisibility,
|
|
11
|
+
ChatMessageTranscriptVisibility,
|
|
12
|
+
ChatMessageAudience,
|
|
13
|
+
ChatMessageSource,
|
|
14
|
+
} from './providers/chat-message-normalization.js';
|
|
9
15
|
|
|
10
16
|
// ── Daemon Status ──
|
|
11
17
|
|
|
@@ -54,11 +60,20 @@ export interface ChatMessage {
|
|
|
54
60
|
/** Optional: fiber metadata */
|
|
55
61
|
_type?: string;
|
|
56
62
|
_sub?: string;
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Transcript visibility/audience contract for separating chat-visible content
|
|
65
|
+
* from internal/debug runtime rows. These reference the canonical named unions
|
|
66
|
+
* declared alongside the classifier (chat-message-normalization.ts) so the known
|
|
67
|
+
* values have one source of truth instead of a hand-inlined copy that drifts.
|
|
68
|
+
* Each alias keeps the `| (string & {})` escape hatch: the read-chat contract
|
|
69
|
+
* (read-chat-contract.ts) preserves ANY producer-supplied string verbatim, so
|
|
70
|
+
* the type must stay open — it documents the known values without forbidding
|
|
71
|
+
* provider-specific extensions.
|
|
72
|
+
*/
|
|
73
|
+
visibility?: ChatMessageVisibility;
|
|
74
|
+
transcriptVisibility?: ChatMessageTranscriptVisibility;
|
|
75
|
+
audience?: ChatMessageAudience;
|
|
76
|
+
source?: ChatMessageSource;
|
|
62
77
|
userFacing?: boolean;
|
|
63
78
|
internal?: boolean;
|
|
64
79
|
isInternal?: boolean;
|