@adhdev/daemon-core 0.9.82-rc.365 → 0.9.82-rc.366
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/high-family/index.d.ts +3 -0
- package/dist/commands/high-family/mesh-coordinator-launch.d.ts +2 -0
- package/dist/commands/high-family/mesh-events.d.ts +2 -0
- package/dist/commands/high-family/mesh-status.d.ts +2 -0
- package/dist/commands/high-family/types.d.ts +60 -0
- package/dist/commands/router.d.ts +208 -0
- package/dist/index.js +1937 -1755
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1922 -1740
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-events-coordinator.d.ts +8 -0
- package/package.json +2 -2
- package/src/commands/cli-manager.ts +28 -2
- package/src/commands/high-family/index.ts +28 -0
- package/src/commands/high-family/mesh-coordinator-launch.ts +592 -0
- package/src/commands/high-family/mesh-events.ts +47 -0
- package/src/commands/high-family/mesh-status.ts +639 -0
- package/src/commands/high-family/types.ts +76 -0
- package/src/commands/router.ts +272 -1246
- package/src/mesh/mesh-events-coordinator.ts +35 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RF-ROUTER HIGH family — shared types for the extracted high-coupling command
|
|
3
|
+
* handlers. Like the LOW and MED families, each handler is a function of
|
|
4
|
+
* (context, args) that returns the exact CommandRouterResult the original
|
|
5
|
+
* `executeDaemonCommand` switch case returned, so the router facade is unchanged.
|
|
6
|
+
*
|
|
7
|
+
* HIGH handlers are the most router-coupled of the three families: in addition to
|
|
8
|
+
* the MED collaborators (mesh resolution, owner gating, inline-cache), they reach
|
|
9
|
+
* the router's aggregate-status memory cache and running-refine-job table — state
|
|
10
|
+
* the router owns and the `mesh_status` aggregate render and `get_mesh_review_inbox`
|
|
11
|
+
* re-entry both depend on. The router binds those onto HighFamilyContext at
|
|
12
|
+
* dispatch; they are NOT reachable from `deps`.
|
|
13
|
+
*
|
|
14
|
+
* Registry dispatch: DaemonCommandRouter.executeDaemonCommand looks up the cmd in
|
|
15
|
+
* highFamilyRegistry AFTER the LOW and MED registries and BEFORE its remaining
|
|
16
|
+
* switch; a hit returns the handler result, a miss falls through to the switch
|
|
17
|
+
* (and ultimately CommandHandler delegation).
|
|
18
|
+
*/
|
|
19
|
+
import type {
|
|
20
|
+
CommandRouterDeps,
|
|
21
|
+
CommandRouterResult,
|
|
22
|
+
MeshGitProbeCache,
|
|
23
|
+
MeshRefineJobHandle,
|
|
24
|
+
} from '../router.js';
|
|
25
|
+
import type { ResolvedMeshForCommand } from '../med-family/types.js';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Router-private collaborators injected at dispatch. Each is a bound method or
|
|
29
|
+
* field of DaemonCommandRouter; handlers that don't need a given collaborator
|
|
30
|
+
* simply ignore it. The router owns this instance state (inline-mesh cache,
|
|
31
|
+
* aggregate-status memory cache, running-refine-job table, git-probe cache), so
|
|
32
|
+
* it cannot be read from `deps` — the registry receives bound references instead.
|
|
33
|
+
*/
|
|
34
|
+
export interface HighFamilyContext {
|
|
35
|
+
deps: CommandRouterDeps;
|
|
36
|
+
|
|
37
|
+
/** Bound `DaemonCommandRouter.getMeshForCommand`. */
|
|
38
|
+
getMeshForCommand: (
|
|
39
|
+
meshId: string,
|
|
40
|
+
inlineMesh?: unknown,
|
|
41
|
+
options?: { preferInline?: boolean },
|
|
42
|
+
) => Promise<ResolvedMeshForCommand>;
|
|
43
|
+
|
|
44
|
+
/** Bound `DaemonCommandRouter.getCachedAggregateMeshStatus`. */
|
|
45
|
+
getCachedAggregateMeshStatus: (
|
|
46
|
+
meshId: string,
|
|
47
|
+
mesh?: any,
|
|
48
|
+
options?: { requireDirectPeerTruth?: boolean },
|
|
49
|
+
) => any | null;
|
|
50
|
+
|
|
51
|
+
/** Bound `DaemonCommandRouter.rememberAggregateMeshStatus`. */
|
|
52
|
+
rememberAggregateMeshStatus: (meshId: string, snapshot: any, refreshReason: string) => any;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Bound `DaemonCommandRouter.execute`. `get_mesh_review_inbox` re-enters the
|
|
56
|
+
* router with a `mesh_status` refresh to obtain computed node fields; this is
|
|
57
|
+
* the same self-call the inlined case made.
|
|
58
|
+
*/
|
|
59
|
+
execute: (cmd: string, args: any, source?: string) => Promise<CommandRouterResult>;
|
|
60
|
+
|
|
61
|
+
/** Router's aggregate-status memory cache (`.has()` probe in mesh_status). */
|
|
62
|
+
aggregateMeshStatusCache: Map<string, { builtAt: number; snapshot: any; queueRevision: string }>;
|
|
63
|
+
|
|
64
|
+
/** Router's running-refine-job table (surfaced as activeRefineJobs in mesh_status). */
|
|
65
|
+
runningRefineJobs: Map<string, MeshRefineJobHandle>;
|
|
66
|
+
|
|
67
|
+
/** Router's inline-mesh cache (launch_mesh_coordinator caches cloud inline mesh). */
|
|
68
|
+
inlineMeshCache: Map<string, any>;
|
|
69
|
+
|
|
70
|
+
/** Router's mesh git-probe cache (shared probe dedup for mesh_status). */
|
|
71
|
+
meshGitProbeCache: MeshGitProbeCache;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type HighFamilyHandler = (ctx: HighFamilyContext, args: any) => Promise<CommandRouterResult | null>;
|
|
75
|
+
|
|
76
|
+
export type HighFamilyRegistry = Map<string, HighFamilyHandler>;
|