@adhdev/daemon-core 0.7.33 → 0.7.36
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 +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +637 -253
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +637 -255
- package/dist/index.mjs.map +1 -1
- package/dist/{normalize-auJAPmKy.d.mts → normalize-DVI4Lo5I.d.mts} +63 -1
- package/dist/{normalize-auJAPmKy.d.ts → normalize-DVI4Lo5I.d.ts} +63 -1
- package/dist/status/normalize.d.mts +1 -1
- package/dist/status/normalize.d.ts +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/agent-stream/manager.ts +14 -1
- package/src/agent-stream/provider-adapter.ts +45 -3
- package/src/agent-stream/types.ts +4 -0
- package/src/cli-adapters/terminal-screen.ts +15 -0
- package/src/commands/cli-manager.ts +35 -0
- package/src/commands/router.ts +44 -1
- package/src/commands/workspace-commands.ts +2 -1
- package/src/config/config.d.ts +4 -0
- package/src/config/config.ts +9 -1
- package/src/config/recent-activity.ts +83 -0
- package/src/config/workspaces.d.ts +3 -1
- package/src/config/workspaces.ts +15 -1
- package/src/index.ts +16 -0
- package/src/providers/acp-provider-instance.ts +5 -0
- package/src/providers/cli-provider-instance.ts +2 -0
- package/src/providers/contracts.ts +94 -0
- package/src/providers/extension-provider-instance.ts +4 -0
- package/src/providers/ide-provider-instance.ts +2 -0
- package/src/providers/provider-instance.ts +5 -1
- package/src/shared-types.d.ts +35 -0
- package/src/shared-types.ts +70 -0
- package/src/status/builders.ts +90 -1
- package/src/status/reporter.ts +8 -0
- package/src/status/snapshot.ts +162 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StatusResponse, D as DaemonEvent, C as CommandResult$2, a as SessionEntry, P as ProviderCategory, b as ProviderModule, R as ResolvedProvider, c as ProviderSettingSchema, d as CdpTargetFilter, e as ProviderInstance, I as InstanceContext, f as ProviderState, g as ProviderEvent, h as SessionTransport, i as StatusReportPayload, A as AvailableProviderInfo, j as ProviderResumeCapability, k as AcpProviderState, l as ContentBlock } from './normalize-
|
|
2
|
-
export { m as AcpConfigOption, n as AcpMode, o as ActiveChatData, p as AgentEntry, q as AgentSessionStream, r as ChatMessage, s as CliProviderState, t as DetectedIde, u as DetectedIdeInfo, E as ExtensionInfo, v as ExtensionProviderState, w as IdeProviderState, M as MachineInfo, x as ManagedStatus, y as ProviderConfig, z as
|
|
1
|
+
import { S as StatusResponse, D as DaemonEvent, C as CommandResult$2, a as SessionEntry, P as ProviderCategory, b as ProviderModule, R as ResolvedProvider, c as ProviderSettingSchema, d as CdpTargetFilter, e as ProviderInstance, I as InstanceContext, f as ProviderState, g as ProviderEvent, h as SessionTransport, i as StatusReportPayload, A as AvailableProviderInfo, j as ProviderResumeCapability, k as AcpProviderState, l as ContentBlock } from './normalize-DVI4Lo5I.mjs';
|
|
2
|
+
export { m as AcpConfigOption, n as AcpMode, o as ActiveChatData, p as AgentEntry, q as AgentSessionStream, r as ChatMessage, s as CliProviderState, t as DetectedIde, u as DetectedIdeInfo, E as ExtensionInfo, v as ExtensionProviderState, w as IdeProviderState, M as MachineInfo, x as ManagedStatus, y as ProviderConfig, z as ProviderControlSchema, B as ProviderErrorReason, F as ProviderInfo, G as ProviderStatus, H as RecentActivityEntry, J as SessionCapability, K as SessionKind, L as SystemInfo, W as WorkspaceActivity, N as WorkspaceEntry, O as addCliHistory, Q as appendRecentActivity, T as getRecentActivity, U as getWorkspaceActivity, V as getWorkspaceState, X as isManagedStatusWaiting, Y as isManagedStatusWorking, Z as isSetupComplete, _ as loadConfig, $ as markSetupComplete, a0 as normalizeActiveChatData, a1 as normalizeManagedStatus, a2 as resetConfig, a3 as saveConfig, a4 as updateConfig } from './normalize-DVI4Lo5I.mjs';
|
|
3
3
|
import * as child_process from 'child_process';
|
|
4
4
|
import { ChildProcess } from 'child_process';
|
|
5
5
|
import * as http from 'http';
|
|
@@ -709,12 +709,16 @@ interface AgentStreamState {
|
|
|
709
709
|
status: 'idle' | 'streaming' | 'waiting_approval' | 'error' | 'disconnected' | 'panel_hidden' | 'not_monitored';
|
|
710
710
|
messages: AgentChatMessage[];
|
|
711
711
|
inputContent: string;
|
|
712
|
+
/** @deprecated Use controlValues['model'] — kept for backward compatibility */
|
|
712
713
|
model?: string;
|
|
714
|
+
/** @deprecated Use controlValues['mode'] — kept for backward compatibility */
|
|
713
715
|
mode?: string;
|
|
714
716
|
activeModal?: {
|
|
715
717
|
message: string;
|
|
716
718
|
buttons: string[];
|
|
717
719
|
};
|
|
720
|
+
/** Dynamic control current values (populated from readChat + provider controls schema) */
|
|
721
|
+
controlValues?: Record<string, string | number | boolean>;
|
|
718
722
|
}
|
|
719
723
|
/** Agent stream adapter interface */
|
|
720
724
|
interface IAgentStreamAdapter {
|
|
@@ -766,6 +770,7 @@ declare class DaemonAgentStreamManager {
|
|
|
766
770
|
setEnabled(enabled: boolean): void;
|
|
767
771
|
get isEnabled(): boolean;
|
|
768
772
|
getActiveSessionId(parentSessionId: string): string | null;
|
|
773
|
+
private isRecoverableSessionError;
|
|
769
774
|
private getSessionTarget;
|
|
770
775
|
resetParentSession(parentSessionId: string): void;
|
|
771
776
|
/** Panel focus based on provider.js focusPanel or extensionId (currently no-op) */
|
|
@@ -1053,6 +1058,7 @@ declare class ExtensionProviderInstance implements ProviderInstance {
|
|
|
1053
1058
|
private activeModal;
|
|
1054
1059
|
private currentModel;
|
|
1055
1060
|
private currentMode;
|
|
1061
|
+
private controlValues;
|
|
1056
1062
|
private lastAgentStatus;
|
|
1057
1063
|
private generatingStartedAt;
|
|
1058
1064
|
private monitor;
|
|
@@ -1421,6 +1427,7 @@ declare class DaemonCliManager {
|
|
|
1421
1427
|
constructor(deps: CliManagerDeps, providerLoader: ProviderLoader);
|
|
1422
1428
|
getCliKey(cliType: string, dir: string): string;
|
|
1423
1429
|
private persistRecentDir;
|
|
1430
|
+
private persistRecentActivity;
|
|
1424
1431
|
private getTransportFactory;
|
|
1425
1432
|
private createAdapter;
|
|
1426
1433
|
private startCliExitMonitor;
|
|
@@ -2475,4 +2482,23 @@ declare function startDaemonDevSupport(options: DaemonDevSupportOptions): Promis
|
|
|
2475
2482
|
*/
|
|
2476
2483
|
declare function shutdownDaemonComponents(components: DaemonComponents): Promise<void>;
|
|
2477
2484
|
|
|
2478
|
-
|
|
2485
|
+
/**
|
|
2486
|
+
* @adhdev/daemon-core — Public API
|
|
2487
|
+
*
|
|
2488
|
+
* Core logic for daemon: CDP, Provider, IDE detection, CLI/ACP adapters and more.
|
|
2489
|
+
*/
|
|
2490
|
+
|
|
2491
|
+
interface RecentSessionEntry {
|
|
2492
|
+
id: string;
|
|
2493
|
+
sessionId?: string | null;
|
|
2494
|
+
providerType: string;
|
|
2495
|
+
providerName: string;
|
|
2496
|
+
kind: 'ide' | 'cli' | 'acp';
|
|
2497
|
+
title: string;
|
|
2498
|
+
workspace?: string | null;
|
|
2499
|
+
currentModel?: string;
|
|
2500
|
+
status?: 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
2501
|
+
lastUsedAt: number;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
export { AcpProviderInstance, AcpProviderState, AgentStreamPoller, type AgentStreamPollerDeps, AvailableProviderInfo, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, CdpTargetFilter, type CliAdapter, CliProviderInstance, type CliTransportFactoryParams, type CommandContext, type CommandResult$1 as CommandResult, type CommandRouterDeps, type CommandRouterResult, CommandResult$2 as CoreCommandResult, DAEMON_WS_PATH, DEFAULT_DAEMON_PORT, DaemonAgentStreamManager, DaemonCdpInitializer, DaemonCdpManager, DaemonCdpScanner, DaemonCliManager, DaemonCommandHandler, DaemonCommandRouter, type DaemonComponents, type DaemonCoreOptions, type DaemonDevSupportOptions, DaemonEvent, type DaemonInitConfig, DaemonStatusReporter, DevServer, type HostMemorySnapshot, type HostedCliRuntimeDescriptor, type IDEInfo, type IDaemonCore, IdeProviderInstance, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, NodePtyTransportFactory, ProviderCliAdapter, ProviderInstanceManager, ProviderLoader, ProviderModule, ProviderResumeCapability, type ProviderVersionInfo, type PtyRuntimeTransport, type PtySpawnOptions, type PtyTransportFactory, type RecentSessionEntry, type ScopedLogger, SessionEntry, SessionHostPtyTransportFactory, SessionTransport, type SetupIdeInstanceOptions, StatusReportPayload, StatusResponse, type StatusSnapshot, type StatusSnapshotOptions, VersionArchive, type VersionHistory, buildSessionEntries, buildStatusSnapshot, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, ensureSessionHostReady, findCdpManager, forwardAgentStreamsToIdeInstance, getAIExtensions, getAvailableIdeIds, getHostMemorySnapshot, getLogLevel, getRecentCommands, getRecentLogs, hasCdpManager, initDaemonComponents, installExtensions, installGlobalInterceptor, isCdpConnected, isExtensionInstalled, isIdeRunning, killIdeProcess, launchIDE, launchWithCdp, listHostedCliRuntimes, logCommand, probeCdpPort, readChatHistory, registerExtensionProviders, setLogLevel, setupIdeInstance, shutdownDaemonComponents, startDaemonDevSupport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StatusResponse, D as DaemonEvent, C as CommandResult$2, a as SessionEntry, P as ProviderCategory, b as ProviderModule, R as ResolvedProvider, c as ProviderSettingSchema, d as CdpTargetFilter, e as ProviderInstance, I as InstanceContext, f as ProviderState, g as ProviderEvent, h as SessionTransport, i as StatusReportPayload, A as AvailableProviderInfo, j as ProviderResumeCapability, k as AcpProviderState, l as ContentBlock } from './normalize-
|
|
2
|
-
export { m as AcpConfigOption, n as AcpMode, o as ActiveChatData, p as AgentEntry, q as AgentSessionStream, r as ChatMessage, s as CliProviderState, t as DetectedIde, u as DetectedIdeInfo, E as ExtensionInfo, v as ExtensionProviderState, w as IdeProviderState, M as MachineInfo, x as ManagedStatus, y as ProviderConfig, z as
|
|
1
|
+
import { S as StatusResponse, D as DaemonEvent, C as CommandResult$2, a as SessionEntry, P as ProviderCategory, b as ProviderModule, R as ResolvedProvider, c as ProviderSettingSchema, d as CdpTargetFilter, e as ProviderInstance, I as InstanceContext, f as ProviderState, g as ProviderEvent, h as SessionTransport, i as StatusReportPayload, A as AvailableProviderInfo, j as ProviderResumeCapability, k as AcpProviderState, l as ContentBlock } from './normalize-DVI4Lo5I.js';
|
|
2
|
+
export { m as AcpConfigOption, n as AcpMode, o as ActiveChatData, p as AgentEntry, q as AgentSessionStream, r as ChatMessage, s as CliProviderState, t as DetectedIde, u as DetectedIdeInfo, E as ExtensionInfo, v as ExtensionProviderState, w as IdeProviderState, M as MachineInfo, x as ManagedStatus, y as ProviderConfig, z as ProviderControlSchema, B as ProviderErrorReason, F as ProviderInfo, G as ProviderStatus, H as RecentActivityEntry, J as SessionCapability, K as SessionKind, L as SystemInfo, W as WorkspaceActivity, N as WorkspaceEntry, O as addCliHistory, Q as appendRecentActivity, T as getRecentActivity, U as getWorkspaceActivity, V as getWorkspaceState, X as isManagedStatusWaiting, Y as isManagedStatusWorking, Z as isSetupComplete, _ as loadConfig, $ as markSetupComplete, a0 as normalizeActiveChatData, a1 as normalizeManagedStatus, a2 as resetConfig, a3 as saveConfig, a4 as updateConfig } from './normalize-DVI4Lo5I.js';
|
|
3
3
|
import * as child_process from 'child_process';
|
|
4
4
|
import { ChildProcess } from 'child_process';
|
|
5
5
|
import * as http from 'http';
|
|
@@ -709,12 +709,16 @@ interface AgentStreamState {
|
|
|
709
709
|
status: 'idle' | 'streaming' | 'waiting_approval' | 'error' | 'disconnected' | 'panel_hidden' | 'not_monitored';
|
|
710
710
|
messages: AgentChatMessage[];
|
|
711
711
|
inputContent: string;
|
|
712
|
+
/** @deprecated Use controlValues['model'] — kept for backward compatibility */
|
|
712
713
|
model?: string;
|
|
714
|
+
/** @deprecated Use controlValues['mode'] — kept for backward compatibility */
|
|
713
715
|
mode?: string;
|
|
714
716
|
activeModal?: {
|
|
715
717
|
message: string;
|
|
716
718
|
buttons: string[];
|
|
717
719
|
};
|
|
720
|
+
/** Dynamic control current values (populated from readChat + provider controls schema) */
|
|
721
|
+
controlValues?: Record<string, string | number | boolean>;
|
|
718
722
|
}
|
|
719
723
|
/** Agent stream adapter interface */
|
|
720
724
|
interface IAgentStreamAdapter {
|
|
@@ -766,6 +770,7 @@ declare class DaemonAgentStreamManager {
|
|
|
766
770
|
setEnabled(enabled: boolean): void;
|
|
767
771
|
get isEnabled(): boolean;
|
|
768
772
|
getActiveSessionId(parentSessionId: string): string | null;
|
|
773
|
+
private isRecoverableSessionError;
|
|
769
774
|
private getSessionTarget;
|
|
770
775
|
resetParentSession(parentSessionId: string): void;
|
|
771
776
|
/** Panel focus based on provider.js focusPanel or extensionId (currently no-op) */
|
|
@@ -1053,6 +1058,7 @@ declare class ExtensionProviderInstance implements ProviderInstance {
|
|
|
1053
1058
|
private activeModal;
|
|
1054
1059
|
private currentModel;
|
|
1055
1060
|
private currentMode;
|
|
1061
|
+
private controlValues;
|
|
1056
1062
|
private lastAgentStatus;
|
|
1057
1063
|
private generatingStartedAt;
|
|
1058
1064
|
private monitor;
|
|
@@ -1421,6 +1427,7 @@ declare class DaemonCliManager {
|
|
|
1421
1427
|
constructor(deps: CliManagerDeps, providerLoader: ProviderLoader);
|
|
1422
1428
|
getCliKey(cliType: string, dir: string): string;
|
|
1423
1429
|
private persistRecentDir;
|
|
1430
|
+
private persistRecentActivity;
|
|
1424
1431
|
private getTransportFactory;
|
|
1425
1432
|
private createAdapter;
|
|
1426
1433
|
private startCliExitMonitor;
|
|
@@ -2475,4 +2482,23 @@ declare function startDaemonDevSupport(options: DaemonDevSupportOptions): Promis
|
|
|
2475
2482
|
*/
|
|
2476
2483
|
declare function shutdownDaemonComponents(components: DaemonComponents): Promise<void>;
|
|
2477
2484
|
|
|
2478
|
-
|
|
2485
|
+
/**
|
|
2486
|
+
* @adhdev/daemon-core — Public API
|
|
2487
|
+
*
|
|
2488
|
+
* Core logic for daemon: CDP, Provider, IDE detection, CLI/ACP adapters and more.
|
|
2489
|
+
*/
|
|
2490
|
+
|
|
2491
|
+
interface RecentSessionEntry {
|
|
2492
|
+
id: string;
|
|
2493
|
+
sessionId?: string | null;
|
|
2494
|
+
providerType: string;
|
|
2495
|
+
providerName: string;
|
|
2496
|
+
kind: 'ide' | 'cli' | 'acp';
|
|
2497
|
+
title: string;
|
|
2498
|
+
workspace?: string | null;
|
|
2499
|
+
currentModel?: string;
|
|
2500
|
+
status?: 'idle' | 'generating' | 'waiting_approval' | 'error' | 'stopped' | 'starting' | 'panel_hidden' | 'not_monitored' | 'disconnected';
|
|
2501
|
+
lastUsedAt: number;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
export { AcpProviderInstance, AcpProviderState, AgentStreamPoller, type AgentStreamPollerDeps, AvailableProviderInfo, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, CdpTargetFilter, type CliAdapter, CliProviderInstance, type CliTransportFactoryParams, type CommandContext, type CommandResult$1 as CommandResult, type CommandRouterDeps, type CommandRouterResult, CommandResult$2 as CoreCommandResult, DAEMON_WS_PATH, DEFAULT_DAEMON_PORT, DaemonAgentStreamManager, DaemonCdpInitializer, DaemonCdpManager, DaemonCdpScanner, DaemonCliManager, DaemonCommandHandler, DaemonCommandRouter, type DaemonComponents, type DaemonCoreOptions, type DaemonDevSupportOptions, DaemonEvent, type DaemonInitConfig, DaemonStatusReporter, DevServer, type HostMemorySnapshot, type HostedCliRuntimeDescriptor, type IDEInfo, type IDaemonCore, IdeProviderInstance, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, NodePtyTransportFactory, ProviderCliAdapter, ProviderInstanceManager, ProviderLoader, ProviderModule, ProviderResumeCapability, type ProviderVersionInfo, type PtyRuntimeTransport, type PtySpawnOptions, type PtyTransportFactory, type RecentSessionEntry, type ScopedLogger, SessionEntry, SessionHostPtyTransportFactory, SessionTransport, type SetupIdeInstanceOptions, StatusReportPayload, StatusResponse, type StatusSnapshot, type StatusSnapshotOptions, VersionArchive, type VersionHistory, buildSessionEntries, buildStatusSnapshot, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, ensureSessionHostReady, findCdpManager, forwardAgentStreamsToIdeInstance, getAIExtensions, getAvailableIdeIds, getHostMemorySnapshot, getLogLevel, getRecentCommands, getRecentLogs, hasCdpManager, initDaemonComponents, installExtensions, installGlobalInterceptor, isCdpConnected, isExtensionInstalled, isIdeRunning, killIdeProcess, launchIDE, launchWithCdp, listHostedCliRuntimes, logCommand, probeCdpPort, readChatHistory, registerExtensionProviders, setLogLevel, setupIdeInstance, shutdownDaemonComponents, startDaemonDevSupport };
|