@adhdev/daemon-core 0.9.82-rc.361 → 0.9.82-rc.363

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.
Files changed (33) hide show
  1. package/dist/cli-adapters/cli-state-engine.d.ts +1 -1
  2. package/dist/cli-adapters/provider-cli-shared.d.ts +10 -0
  3. package/dist/commands/low-family/coordinator-prompt.d.ts +9 -0
  4. package/dist/commands/low-family/daemon-lifecycle.d.ts +2 -0
  5. package/dist/commands/low-family/diagnostics.d.ts +2 -0
  6. package/dist/commands/low-family/mesh-ledger.d.ts +10 -0
  7. package/dist/commands/low-family/mesh-node-logs.d.ts +2 -0
  8. package/dist/commands/low-family/notification.d.ts +2 -0
  9. package/dist/commands/low-family/status-meta.d.ts +2 -0
  10. package/dist/commands/low-family/types.d.ts +17 -0
  11. package/dist/index.js +2290 -2177
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +2296 -2183
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/mesh/mesh-events-utils.d.ts +1 -0
  16. package/dist/providers/cli-provider-instance.d.ts +2 -0
  17. package/package.json +2 -2
  18. package/src/cli-adapters/cli-state-engine.ts +7 -1
  19. package/src/cli-adapters/provider-cli-adapter.ts +1 -0
  20. package/src/cli-adapters/provider-cli-shared.ts +10 -0
  21. package/src/commands/low-family/coordinator-prompt.ts +72 -0
  22. package/src/commands/low-family/daemon-lifecycle.ts +107 -0
  23. package/src/commands/low-family/diagnostics.ts +57 -0
  24. package/src/commands/low-family/index.ts +14 -0
  25. package/src/commands/low-family/mesh-ledger.ts +62 -0
  26. package/src/commands/low-family/mesh-node-logs.ts +81 -0
  27. package/src/commands/low-family/notification.ts +116 -0
  28. package/src/commands/low-family/status-meta.ts +112 -0
  29. package/src/commands/low-family/types.ts +20 -0
  30. package/src/commands/router.ts +8 -522
  31. package/src/mesh/mesh-events-coordinator.ts +37 -0
  32. package/src/mesh/mesh-events-utils.ts +28 -2
  33. package/src/providers/cli-provider-instance.ts +46 -0
@@ -83,7 +83,7 @@ export declare class CliStateEngine {
83
83
  * seq) is always a real, distinct approval and must be written.
84
84
  */
85
85
  approvalEntrySeq: number;
86
- private lastResolvedEntrySeq;
86
+ lastResolvedEntrySeq: number;
87
87
  /**
88
88
  * When the engine previously held a modal but the latest parse failed
89
89
  * to extract one, we record the timestamp here and only drop the modal
@@ -36,6 +36,16 @@ export interface CliSessionStatus {
36
36
  * seq is the only reliable discriminator.
37
37
  */
38
38
  approvalEntrySeq?: number;
39
+ /**
40
+ * The approval entry seq that the engine's last resolveModal() handled. When
41
+ * `lastResolvedEntrySeq >= approvalEntrySeq` (and approvalEntrySeq > 0) it is positive
42
+ * evidence that the current/latest approval entry was resolved through ADHDev (auto-approve
43
+ * fire, dashboard / mesh_approve, or dev-cli-debug — all route through resolveModal). The
44
+ * completion finalization gate uses this to avoid confirming a waiting_approval→idle
45
+ * transition for which no resolution actually occurred (a false idle: the spec's text-based
46
+ * approval→idle rule tripped while the modal is still on screen).
47
+ */
48
+ lastResolvedEntrySeq?: number;
39
49
  activeInteractivePrompt?: InteractivePrompt | null;
40
50
  pendingOutboundCount?: number;
41
51
  pendingOutboundMessages?: Array<{
@@ -0,0 +1,9 @@
1
+ /**
2
+ * RF-ROUTER LOW family — coordinator-prompt override/append file commands.
3
+ *
4
+ * Extracted verbatim from DaemonCommandRouter.executeDaemonCommand. Both handlers
5
+ * read/write only the on-disk ~/.adhdev/coordinator-prompts directory (no router
6
+ * instance state) and return the same CommandRouterResult the inlined cases did.
7
+ */
8
+ import type { LowFamilyHandler } from './types.js';
9
+ export declare const coordinatorPromptHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,2 @@
1
+ import type { LowFamilyHandler } from './types.js';
2
+ export declare const daemonLifecycleHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,2 @@
1
+ import type { LowFamilyHandler } from './types.js';
2
+ export declare const diagnosticsHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * RF-ROUTER LOW family — mesh ledger read / slice / import commands.
3
+ *
4
+ * Extracted verbatim from DaemonCommandRouter.executeDaemonCommand. Each handler
5
+ * touches only the on-disk mesh ledger (dynamically imported mesh-ledger module)
6
+ * keyed by meshId — no router instance state — and returns the same
7
+ * CommandRouterResult the inlined cases did.
8
+ */
9
+ import type { LowFamilyHandler } from './types.js';
10
+ export declare const meshLedgerHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,2 @@
1
+ import type { LowFamilyHandler } from './types.js';
2
+ export declare const meshNodeLogsHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,2 @@
1
+ import type { LowFamilyHandler } from './types.js';
2
+ export declare const notificationHandlers: Record<string, LowFamilyHandler>;
@@ -0,0 +1,2 @@
1
+ import type { LowFamilyHandler } from './types.js';
2
+ export declare const statusMetaHandlers: Record<string, LowFamilyHandler>;
@@ -9,8 +9,25 @@
9
9
  * falls through to the remaining switch (and ultimately CommandHandler delegation).
10
10
  */
11
11
  import type { CommandRouterDeps, CommandRouterResult } from '../router.js';
12
+ /** Mesh record resolved from the router's inline-mesh cache + local config. */
13
+ export type ResolvedMeshForCommand = {
14
+ mesh: any;
15
+ inline: boolean;
16
+ source: 'inline_cache' | 'inline_bootstrap' | 'local_config';
17
+ } | null;
12
18
  export interface LowFamilyContext {
13
19
  deps: CommandRouterDeps;
20
+ /**
21
+ * Bound `DaemonCommandRouter.getMeshForCommand`. A handful of LOW handlers
22
+ * (mesh-node-logs) must resolve a mesh node's owning daemonId from the
23
+ * router's inline-mesh cache, which is router instance state not present in
24
+ * `deps`. The router injects it at dispatch; handlers that don't need it
25
+ * ignore it. Optional so unit tests can omit it (and assert the guarded
26
+ * fallback) without constructing a full router.
27
+ */
28
+ getMeshForCommand?: (meshId: string, inlineMesh?: unknown, options?: {
29
+ preferInline?: boolean;
30
+ }) => Promise<ResolvedMeshForCommand>;
14
31
  }
15
32
  export type LowFamilyHandler = (ctx: LowFamilyContext, args: any) => Promise<CommandRouterResult>;
16
33
  export type LowFamilyRegistry = Map<string, LowFamilyHandler>;