@adhdev/daemon-core 0.9.77-rc.4 → 0.9.77-rc.40

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.
@@ -57,6 +57,8 @@ export interface DaemonInitConfig {
57
57
  workspace: string;
58
58
  sessionId: string;
59
59
  }) => void;
60
+ /** Relays a command to a remote mesh node daemon */
61
+ dispatchMeshCommand?: (daemonId: string, command: string, args: Record<string, unknown>) => Promise<any>;
60
62
  }
61
63
  export interface DaemonComponents {
62
64
  providerLoader: ProviderLoader;
@@ -73,6 +75,7 @@ export interface DaemonComponents {
73
75
  value: IDEInfo[];
74
76
  };
75
77
  refreshProviderAvailability: (providerType?: string) => Promise<void>;
78
+ dispatchMeshCommand?: (daemonId: string, command: string, args: Record<string, unknown>) => Promise<any>;
76
79
  }
77
80
  export interface DaemonDevSupportOptions {
78
81
  components: DaemonComponents;
@@ -77,6 +77,8 @@ export declare class ProviderCliAdapter implements CliAdapter {
77
77
  private resizeSuppressUntil;
78
78
  private statusHistory;
79
79
  private cliScripts;
80
+ /** Per-session opaque state object created by cliScripts.createState(), reset on stop. */
81
+ private scriptState;
80
82
  private runtimeSettings;
81
83
  /** Full accumulated rendered PTY transcript for parser/readback use */
82
84
  private accumulatedBuffer;
@@ -161,6 +163,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
161
163
  private finishResponse;
162
164
  private maybeCommitVisibleIdleTranscript;
163
165
  private commitCurrentTranscript;
166
+ private invokeCliScript;
164
167
  private runParseSession;
165
168
  private runDetectStatus;
166
169
  private runParseApproval;
@@ -63,17 +63,27 @@ export interface ParsedSession {
63
63
  coverage?: 'full' | 'tail' | 'current-turn';
64
64
  }
65
65
  export interface CliScripts {
66
- parseSession?: (input: CliScriptInput & {
66
+ /**
67
+ * Optional state factory. Called once per CLI session start (or script reload).
68
+ * The returned object is passed as the first argument to detectStatus, parseApproval,
69
+ * and parseSession on every invocation, allowing scripts to maintain per-session state
70
+ * (e.g. last-seen status, approval fingerprints, stability counters).
71
+ *
72
+ * Scripts that don't define createState() receive null as the state argument,
73
+ * making this change fully backward compatible.
74
+ */
75
+ createState?: () => unknown;
76
+ parseSession?: (state: unknown, input: CliScriptInput & {
67
77
  tail?: string;
68
78
  tailScreen?: CliScreenSnapshot;
69
79
  }) => ParsedSession | null;
70
- detectStatus?: (input: CliStatusInput) => string | null;
71
- parseApproval?: (input: CliApprovalInput) => {
80
+ detectStatus?: (state: unknown, input: CliStatusInput) => string | null;
81
+ parseApproval?: (state: unknown, input: CliApprovalInput) => {
72
82
  message: string;
73
83
  buttons: string[];
74
84
  } | null;
75
85
  resolveAction?: (data: any) => string;
76
- [name: string]: ((input: any) => any) | undefined;
86
+ [name: string]: ((state: unknown, input: any) => any) | ((data: any) => any) | (() => unknown) | undefined;
77
87
  }
78
88
  export interface CliScreenLine {
79
89
  index: number;
@@ -17,6 +17,14 @@ export type MeshCoordinatorSetup = {
17
17
  requiresRestart: boolean;
18
18
  instructions: string;
19
19
  template: string;
20
+ } | {
21
+ /** Provider registers MCP via its own CLI command (e.g. `codex mcp add` / `gemini mcp add`). */
22
+ kind: 'cli_command';
23
+ serverName: string;
24
+ /** The rendered shell command to execute before launching the coordinator session. */
25
+ command: string;
26
+ requiresRestart: boolean;
27
+ instructions: string;
20
28
  } | {
21
29
  kind: 'unsupported';
22
30
  reason: string;
@@ -29,6 +37,8 @@ export interface ResolveMeshCoordinatorSetupOptions {
29
37
  adhdevMcpCommand?: string;
30
38
  adhdevMcpEntryPath?: string;
31
39
  nodeExecutable?: string;
40
+ adhdevMcpTransport?: 'local' | 'ipc';
41
+ adhdevMcpPort?: number;
32
42
  }
33
43
  export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
34
44
  export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
@@ -84,7 +84,7 @@ export declare class DaemonCommandRouter {
84
84
  * the mesh doesn't exist in the local meshes.json file. */
85
85
  private inlineMeshCache;
86
86
  constructor(deps: CommandRouterDeps);
87
- private getCachedInlineMesh;
87
+ getCachedInlineMesh(meshId: string, inlineMesh?: unknown): any | undefined;
88
88
  private getMeshForCommand;
89
89
  private updateInlineMeshNode;
90
90
  private removeInlineMeshNode;
package/dist/index.d.ts CHANGED
@@ -33,8 +33,8 @@ export { syncMeshes } from './mesh/mesh-sync.js';
33
33
  export type { MeshSyncTransport, MeshSyncResult, RemoteMeshRecord } from './mesh/mesh-sync.js';
34
34
  export { appendLedgerEntry, readLedgerEntries, getLedgerSummary, getLedgerDir, getSessionRecoveryContext } from './mesh/mesh-ledger.js';
35
35
  export type { MeshLedgerEntry, MeshLedgerKind, MeshLedgerSummary, ReadLedgerOptions, SessionRecoveryContext } from './mesh/mesh-ledger.js';
36
- export { enqueueTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus } from './mesh/mesh-work-queue.js';
37
- export type { MeshWorkQueueEntry, MeshTaskStatus } from './mesh/mesh-work-queue.js';
36
+ export { enqueueTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus, cancelTask, requeueTask, getMeshQueueStats } from './mesh/mesh-work-queue.js';
37
+ export type { MeshWorkQueueEntry, MeshTaskStatus, MeshWorkQueueStats } from './mesh/mesh-work-queue.js';
38
38
  export { triggerMeshQueue } from './mesh/mesh-events.js';
39
39
  export { loadState, saveState, resetState } from './config/state-store.js';
40
40
  export type { DaemonState } from './config/state-store.js';