@adhdev/daemon-core 0.6.79 → 0.7.0
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/index.d.mts +84 -87
- package/dist/index.d.ts +84 -87
- package/dist/index.js +798 -706
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +797 -702
- package/dist/index.mjs.map +1 -1
- package/dist/{normalize-igHDb198.d.mts → normalize-S2PmiRgB.d.mts} +32 -53
- package/dist/{normalize-igHDb198.d.ts → normalize-S2PmiRgB.d.ts} +32 -53
- package/dist/status/normalize.d.mts +1 -1
- package/dist/status/normalize.d.ts +1 -1
- package/package.json +1 -1
- package/src/agent-stream/manager.ts +203 -180
- package/src/agent-stream/poller.ts +45 -22
- package/src/boot/daemon-lifecycle.ts +28 -9
- package/src/cdp/initializer.ts +47 -0
- package/src/cdp/manager.ts +19 -1
- package/src/cdp/setup.ts +26 -11
- package/src/commands/chat-commands.ts +136 -88
- package/src/commands/cli-manager.ts +31 -6
- package/src/commands/handler.ts +69 -138
- package/src/commands/router.ts +4 -20
- package/src/commands/stream-commands.ts +34 -162
- package/src/daemon-core.ts +3 -9
- package/src/index.ts +6 -5
- package/src/logging/command-log.ts +1 -1
- package/src/providers/acp-provider-instance.ts +4 -0
- package/src/providers/provider-instance-manager.ts +1 -0
- package/src/sessions/registry.ts +76 -0
- package/src/shared-types.ts +45 -54
- package/src/status/builders.ts +156 -120
- package/src/status/reporter.ts +16 -15
- package/src/status/snapshot.ts +3 -11
|
@@ -262,55 +262,14 @@ declare function getWorkspaceState(config: ADHDevConfig): {
|
|
|
262
262
|
* IMPORTANT: This file must remain runtime-free (types only).
|
|
263
263
|
*/
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
interface
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
instanceId: string;
|
|
270
|
-
workspace: string | null;
|
|
271
|
-
terminals: number;
|
|
272
|
-
aiAgents: unknown[];
|
|
273
|
-
activeChat: ActiveChatData | null;
|
|
274
|
-
chats: unknown[];
|
|
275
|
-
agentStreams: ManagedAgentStream[];
|
|
276
|
-
cdpConnected: boolean;
|
|
277
|
-
currentModel?: string;
|
|
278
|
-
currentPlan?: string;
|
|
279
|
-
currentAutoApprove?: string;
|
|
280
|
-
}
|
|
281
|
-
/** CLI entry as reported by daemon to dashboard */
|
|
282
|
-
interface ManagedCliEntry {
|
|
283
|
-
id: string;
|
|
284
|
-
instanceId: string;
|
|
285
|
-
cliType: string;
|
|
286
|
-
cliName: string;
|
|
287
|
-
status: string;
|
|
288
|
-
mode: 'terminal';
|
|
289
|
-
workspace: string;
|
|
290
|
-
activeChat: ActiveChatData | null;
|
|
291
|
-
}
|
|
292
|
-
/** ACP entry as reported by daemon to dashboard */
|
|
293
|
-
interface ManagedAcpEntry {
|
|
294
|
-
id: string;
|
|
295
|
-
acpType: string;
|
|
296
|
-
acpName: string;
|
|
297
|
-
status: string;
|
|
298
|
-
mode: 'chat';
|
|
299
|
-
workspace: string;
|
|
300
|
-
activeChat: ActiveChatData | null;
|
|
301
|
-
currentModel?: string;
|
|
302
|
-
currentPlan?: string;
|
|
303
|
-
acpConfigOptions?: AcpConfigOption[];
|
|
304
|
-
acpModes?: AcpMode[];
|
|
305
|
-
/** Error details */
|
|
306
|
-
errorMessage?: string;
|
|
307
|
-
errorReason?: 'not_installed' | 'auth_failed' | 'spawn_error' | 'init_failed' | 'crash' | 'timeout' | 'cdp_error' | 'disconnected';
|
|
308
|
-
}
|
|
309
|
-
/** Agent stream within an IDE (extension status) */
|
|
310
|
-
interface ManagedAgentStream {
|
|
265
|
+
/** Agent stream snapshot carried by flattened UI entries. */
|
|
266
|
+
interface AgentSessionStream {
|
|
267
|
+
sessionId?: string;
|
|
268
|
+
parentSessionId?: string | null;
|
|
311
269
|
agentType: string;
|
|
312
270
|
agentName: string;
|
|
313
271
|
extensionId: string;
|
|
272
|
+
transport?: SessionTransport;
|
|
314
273
|
status: string;
|
|
315
274
|
messages: ChatMessage[];
|
|
316
275
|
inputContent: string;
|
|
@@ -320,6 +279,30 @@ interface ManagedAgentStream {
|
|
|
320
279
|
buttons: string[];
|
|
321
280
|
} | null;
|
|
322
281
|
}
|
|
282
|
+
type SessionTransport = 'cdp-page' | 'cdp-webview' | 'pty' | 'acp';
|
|
283
|
+
type SessionKind = 'workspace' | 'agent';
|
|
284
|
+
type SessionCapability = 'read_chat' | 'send_message' | 'new_session' | 'list_sessions' | 'switch_session' | 'resolve_action' | 'terminal_io' | 'resize_terminal' | 'change_model' | 'set_mode' | 'set_thought_level';
|
|
285
|
+
interface SessionEntry {
|
|
286
|
+
id: string;
|
|
287
|
+
parentId: string | null;
|
|
288
|
+
providerType: string;
|
|
289
|
+
providerName: string;
|
|
290
|
+
kind: SessionKind;
|
|
291
|
+
transport: SessionTransport;
|
|
292
|
+
status: 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
293
|
+
title: string;
|
|
294
|
+
workspace: string | null;
|
|
295
|
+
activeChat: ActiveChatData | null;
|
|
296
|
+
capabilities: SessionCapability[];
|
|
297
|
+
cdpConnected?: boolean;
|
|
298
|
+
currentModel?: string;
|
|
299
|
+
currentPlan?: string;
|
|
300
|
+
currentAutoApprove?: string;
|
|
301
|
+
acpConfigOptions?: AcpConfigOption[];
|
|
302
|
+
acpModes?: AcpMode[];
|
|
303
|
+
errorMessage?: string;
|
|
304
|
+
errorReason?: ProviderErrorReason;
|
|
305
|
+
}
|
|
323
306
|
/** Available provider information */
|
|
324
307
|
interface AvailableProviderInfo {
|
|
325
308
|
type: string;
|
|
@@ -397,12 +380,8 @@ interface StatusReportPayload {
|
|
|
397
380
|
peers: number;
|
|
398
381
|
screenshotActive?: boolean;
|
|
399
382
|
};
|
|
400
|
-
/**
|
|
401
|
-
|
|
402
|
-
/** Managed CLI instances */
|
|
403
|
-
managedClis: ManagedCliEntry[];
|
|
404
|
-
/** Managed ACP instances */
|
|
405
|
-
managedAcps: ManagedAcpEntry[];
|
|
383
|
+
/** Canonical daemon runtime sessions */
|
|
384
|
+
sessions: SessionEntry[];
|
|
406
385
|
/** Saved workspaces */
|
|
407
386
|
workspaces?: WorkspaceEntry[];
|
|
408
387
|
defaultWorkspaceId?: string | null;
|
|
@@ -861,4 +840,4 @@ declare function isManagedStatusWaiting(status?: string | null, opts?: {
|
|
|
861
840
|
}): boolean;
|
|
862
841
|
declare function normalizeActiveChatData<T extends ActiveChatData | null | undefined>(activeChat: T): T;
|
|
863
842
|
|
|
864
|
-
export { type
|
|
843
|
+
export { updateConfig as $, type AvailableProviderInfo as A, type ProviderStatus as B, type CommandResult as C, type DaemonEvent as D, type ExtensionInfo as E, type SessionCapability as F, type SessionKind as G, type SystemInfo as H, type InstanceContext as I, type WorkspaceEntry as J, addCliHistory as K, getWorkspaceActivity as L, type MachineInfo as M, getWorkspaceState as N, isManagedStatusWaiting as O, type ProviderCategory as P, isManagedStatusWorking as Q, type ResolvedProvider as R, type StatusResponse as S, isSetupComplete as T, loadConfig as U, markSetupComplete as V, type WorkspaceActivity as W, normalizeActiveChatData as X, normalizeManagedStatus as Y, resetConfig as Z, saveConfig as _, type SessionEntry as a, type ProviderModule as b, type ProviderSettingSchema as c, type CdpTargetFilter as d, type ProviderInstance as e, type ProviderState as f, type ProviderEvent as g, type SessionTransport as h, type StatusReportPayload as i, type AcpProviderState as j, type ContentBlock as k, type AcpConfigOption as l, type AcpMode as m, type ActiveChatData as n, type AgentEntry as o, type AgentSessionStream as p, type ChatMessage as q, type CliProviderState as r, type DetectedIde as s, type DetectedIdeInfo as t, type ExtensionProviderState as u, type IdeProviderState as v, type ManagedStatus as w, type ProviderConfig as x, type ProviderErrorReason as y, type ProviderInfo as z };
|
|
@@ -262,55 +262,14 @@ declare function getWorkspaceState(config: ADHDevConfig): {
|
|
|
262
262
|
* IMPORTANT: This file must remain runtime-free (types only).
|
|
263
263
|
*/
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
interface
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
instanceId: string;
|
|
270
|
-
workspace: string | null;
|
|
271
|
-
terminals: number;
|
|
272
|
-
aiAgents: unknown[];
|
|
273
|
-
activeChat: ActiveChatData | null;
|
|
274
|
-
chats: unknown[];
|
|
275
|
-
agentStreams: ManagedAgentStream[];
|
|
276
|
-
cdpConnected: boolean;
|
|
277
|
-
currentModel?: string;
|
|
278
|
-
currentPlan?: string;
|
|
279
|
-
currentAutoApprove?: string;
|
|
280
|
-
}
|
|
281
|
-
/** CLI entry as reported by daemon to dashboard */
|
|
282
|
-
interface ManagedCliEntry {
|
|
283
|
-
id: string;
|
|
284
|
-
instanceId: string;
|
|
285
|
-
cliType: string;
|
|
286
|
-
cliName: string;
|
|
287
|
-
status: string;
|
|
288
|
-
mode: 'terminal';
|
|
289
|
-
workspace: string;
|
|
290
|
-
activeChat: ActiveChatData | null;
|
|
291
|
-
}
|
|
292
|
-
/** ACP entry as reported by daemon to dashboard */
|
|
293
|
-
interface ManagedAcpEntry {
|
|
294
|
-
id: string;
|
|
295
|
-
acpType: string;
|
|
296
|
-
acpName: string;
|
|
297
|
-
status: string;
|
|
298
|
-
mode: 'chat';
|
|
299
|
-
workspace: string;
|
|
300
|
-
activeChat: ActiveChatData | null;
|
|
301
|
-
currentModel?: string;
|
|
302
|
-
currentPlan?: string;
|
|
303
|
-
acpConfigOptions?: AcpConfigOption[];
|
|
304
|
-
acpModes?: AcpMode[];
|
|
305
|
-
/** Error details */
|
|
306
|
-
errorMessage?: string;
|
|
307
|
-
errorReason?: 'not_installed' | 'auth_failed' | 'spawn_error' | 'init_failed' | 'crash' | 'timeout' | 'cdp_error' | 'disconnected';
|
|
308
|
-
}
|
|
309
|
-
/** Agent stream within an IDE (extension status) */
|
|
310
|
-
interface ManagedAgentStream {
|
|
265
|
+
/** Agent stream snapshot carried by flattened UI entries. */
|
|
266
|
+
interface AgentSessionStream {
|
|
267
|
+
sessionId?: string;
|
|
268
|
+
parentSessionId?: string | null;
|
|
311
269
|
agentType: string;
|
|
312
270
|
agentName: string;
|
|
313
271
|
extensionId: string;
|
|
272
|
+
transport?: SessionTransport;
|
|
314
273
|
status: string;
|
|
315
274
|
messages: ChatMessage[];
|
|
316
275
|
inputContent: string;
|
|
@@ -320,6 +279,30 @@ interface ManagedAgentStream {
|
|
|
320
279
|
buttons: string[];
|
|
321
280
|
} | null;
|
|
322
281
|
}
|
|
282
|
+
type SessionTransport = 'cdp-page' | 'cdp-webview' | 'pty' | 'acp';
|
|
283
|
+
type SessionKind = 'workspace' | 'agent';
|
|
284
|
+
type SessionCapability = 'read_chat' | 'send_message' | 'new_session' | 'list_sessions' | 'switch_session' | 'resolve_action' | 'terminal_io' | 'resize_terminal' | 'change_model' | 'set_mode' | 'set_thought_level';
|
|
285
|
+
interface SessionEntry {
|
|
286
|
+
id: string;
|
|
287
|
+
parentId: string | null;
|
|
288
|
+
providerType: string;
|
|
289
|
+
providerName: string;
|
|
290
|
+
kind: SessionKind;
|
|
291
|
+
transport: SessionTransport;
|
|
292
|
+
status: 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
293
|
+
title: string;
|
|
294
|
+
workspace: string | null;
|
|
295
|
+
activeChat: ActiveChatData | null;
|
|
296
|
+
capabilities: SessionCapability[];
|
|
297
|
+
cdpConnected?: boolean;
|
|
298
|
+
currentModel?: string;
|
|
299
|
+
currentPlan?: string;
|
|
300
|
+
currentAutoApprove?: string;
|
|
301
|
+
acpConfigOptions?: AcpConfigOption[];
|
|
302
|
+
acpModes?: AcpMode[];
|
|
303
|
+
errorMessage?: string;
|
|
304
|
+
errorReason?: ProviderErrorReason;
|
|
305
|
+
}
|
|
323
306
|
/** Available provider information */
|
|
324
307
|
interface AvailableProviderInfo {
|
|
325
308
|
type: string;
|
|
@@ -397,12 +380,8 @@ interface StatusReportPayload {
|
|
|
397
380
|
peers: number;
|
|
398
381
|
screenshotActive?: boolean;
|
|
399
382
|
};
|
|
400
|
-
/**
|
|
401
|
-
|
|
402
|
-
/** Managed CLI instances */
|
|
403
|
-
managedClis: ManagedCliEntry[];
|
|
404
|
-
/** Managed ACP instances */
|
|
405
|
-
managedAcps: ManagedAcpEntry[];
|
|
383
|
+
/** Canonical daemon runtime sessions */
|
|
384
|
+
sessions: SessionEntry[];
|
|
406
385
|
/** Saved workspaces */
|
|
407
386
|
workspaces?: WorkspaceEntry[];
|
|
408
387
|
defaultWorkspaceId?: string | null;
|
|
@@ -861,4 +840,4 @@ declare function isManagedStatusWaiting(status?: string | null, opts?: {
|
|
|
861
840
|
}): boolean;
|
|
862
841
|
declare function normalizeActiveChatData<T extends ActiveChatData | null | undefined>(activeChat: T): T;
|
|
863
842
|
|
|
864
|
-
export { type
|
|
843
|
+
export { updateConfig as $, type AvailableProviderInfo as A, type ProviderStatus as B, type CommandResult as C, type DaemonEvent as D, type ExtensionInfo as E, type SessionCapability as F, type SessionKind as G, type SystemInfo as H, type InstanceContext as I, type WorkspaceEntry as J, addCliHistory as K, getWorkspaceActivity as L, type MachineInfo as M, getWorkspaceState as N, isManagedStatusWaiting as O, type ProviderCategory as P, isManagedStatusWorking as Q, type ResolvedProvider as R, type StatusResponse as S, isSetupComplete as T, loadConfig as U, markSetupComplete as V, type WorkspaceActivity as W, normalizeActiveChatData as X, normalizeManagedStatus as Y, resetConfig as Z, saveConfig as _, type SessionEntry as a, type ProviderModule as b, type ProviderSettingSchema as c, type CdpTargetFilter as d, type ProviderInstance as e, type ProviderState as f, type ProviderEvent as g, type SessionTransport as h, type StatusReportPayload as i, type AcpProviderState as j, type ContentBlock as k, type AcpConfigOption as l, type AcpMode as m, type ActiveChatData as n, type AgentEntry as o, type AgentSessionStream as p, type ChatMessage as q, type CliProviderState as r, type DetectedIde as s, type DetectedIdeInfo as t, type ExtensionProviderState as u, type IdeProviderState as v, type ManagedStatus as w, type ProviderConfig as x, type ProviderErrorReason as y, type ProviderInfo as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { w as ManagedStatus, O as isManagedStatusWaiting, Q as isManagedStatusWorking, X as normalizeActiveChatData, Y as normalizeManagedStatus } from '../normalize-S2PmiRgB.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { w as ManagedStatus, O as isManagedStatusWaiting, Q as isManagedStatusWorking, X as normalizeActiveChatData, Y as normalizeManagedStatus } from '../normalize-S2PmiRgB.js';
|