@adhdev/daemon-core 0.5.3 → 0.5.6
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.ts +88 -2
- package/dist/index.js +1230 -439
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/providers/_builtin/extension/cline/scripts/read_chat.js +14 -1
- package/providers/_builtin/ide/antigravity/scripts/1.106/read_chat.js +24 -1
- package/providers/_builtin/ide/antigravity/scripts/1.107/read_chat.js +24 -1
- package/providers/_builtin/ide/cursor/scripts/0.49/focus_editor.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/0.49/list_models.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/0.49/list_modes.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/0.49/open_panel.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/0.49/read_chat.js +5 -1
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/dismiss_notification.js +30 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/focus_editor.js +13 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_models.js +78 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_modes.js +40 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_notifications.js +23 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_sessions.js +42 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/new_session.js +20 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/open_panel.js +23 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/read_chat.js +79 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/resolve_action.js +19 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/scripts.js +78 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/send_message.js +23 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/set_mode.js +38 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/set_model.js +81 -0
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/switch_session.js +28 -0
- package/providers/_builtin/ide/windsurf/scripts/read_chat.js +18 -1
- package/src/cli-adapters/provider-cli-adapter.ts +231 -12
- package/src/commands/chat-commands.ts +36 -0
- package/src/commands/cli-manager.ts +128 -30
- package/src/commands/handler.ts +47 -3
- package/src/commands/router.ts +32 -2
- package/src/commands/workspace-commands.ts +108 -0
- package/src/config/config.ts +29 -1
- package/src/config/workspace-activity.ts +65 -0
- package/src/config/workspaces.ts +250 -0
- package/src/daemon/dev-server.ts +1 -1
- package/src/index.ts +5 -0
- package/src/launch.ts +1 -1
- package/src/providers/cli-provider-instance.ts +7 -2
- package/src/providers/ide-provider-instance.ts +11 -0
- package/src/status/reporter.ts +23 -4
- package/src/system/host-memory.ts +65 -0
- package/src/types.ts +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -345,7 +345,7 @@ interface IdeEntry {
|
|
|
345
345
|
agentStreams?: AgentStreamEntry[];
|
|
346
346
|
/** Extension agents monitored via CDP */
|
|
347
347
|
extensions?: ExtensionInfo$1[];
|
|
348
|
-
/**
|
|
348
|
+
/** IDE-reported workspace roots (name + path) */
|
|
349
349
|
workspaceFolders?: {
|
|
350
350
|
name: string;
|
|
351
351
|
path: string;
|
|
@@ -451,6 +451,8 @@ interface SystemInfo {
|
|
|
451
451
|
cpus: number;
|
|
452
452
|
totalMem: number;
|
|
453
453
|
freeMem: number;
|
|
454
|
+
/** macOS: reclaimable-inclusive; prefer for UI used% (see host-memory.ts) */
|
|
455
|
+
availableMem?: number;
|
|
454
456
|
loadavg: number[];
|
|
455
457
|
uptime: number;
|
|
456
458
|
arch: string;
|
|
@@ -481,6 +483,21 @@ interface StatusResponse {
|
|
|
481
483
|
detectedIdes: DetectedIde[];
|
|
482
484
|
availableProviders: ProviderInfo[];
|
|
483
485
|
system: SystemInfo;
|
|
486
|
+
/** Saved workspaces (standalone WS / HTTP status) */
|
|
487
|
+
workspaces?: {
|
|
488
|
+
id: string;
|
|
489
|
+
path: string;
|
|
490
|
+
label?: string;
|
|
491
|
+
addedAt: number;
|
|
492
|
+
}[];
|
|
493
|
+
defaultWorkspaceId?: string | null;
|
|
494
|
+
defaultWorkspacePath?: string | null;
|
|
495
|
+
workspaceActivity?: {
|
|
496
|
+
path: string;
|
|
497
|
+
lastUsedAt: number;
|
|
498
|
+
kind?: string;
|
|
499
|
+
agentType?: string;
|
|
500
|
+
}[];
|
|
484
501
|
}
|
|
485
502
|
/** Agent stream entry within an IDE */
|
|
486
503
|
interface AgentStreamEntry {
|
|
@@ -544,11 +561,42 @@ interface IDaemonCore {
|
|
|
544
561
|
getManagedAcps(): AcpEntry[];
|
|
545
562
|
}
|
|
546
563
|
|
|
564
|
+
/**
|
|
565
|
+
* Saved workspaces — shared by IDE launch, CLI, ACP (daemon-local).
|
|
566
|
+
*/
|
|
567
|
+
|
|
568
|
+
interface WorkspaceEntry {
|
|
569
|
+
id: string;
|
|
570
|
+
path: string;
|
|
571
|
+
label?: string;
|
|
572
|
+
addedAt: number;
|
|
573
|
+
}
|
|
574
|
+
declare function getWorkspaceState(config: ADHDevConfig): {
|
|
575
|
+
workspaces: WorkspaceEntry[];
|
|
576
|
+
defaultWorkspaceId: string | null;
|
|
577
|
+
defaultWorkspacePath: string | null;
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Recent workspace activity — quick "pick up where you left off" (daemon-local).
|
|
582
|
+
*/
|
|
583
|
+
|
|
584
|
+
interface WorkspaceActivityEntry {
|
|
585
|
+
path: string;
|
|
586
|
+
lastUsedAt: number;
|
|
587
|
+
/** `active` legacy — same meaning as default */
|
|
588
|
+
kind?: 'ide' | 'cli' | 'acp' | 'default' | 'active';
|
|
589
|
+
/** IDE id or CLI/ACP provider type */
|
|
590
|
+
agentType?: string;
|
|
591
|
+
}
|
|
592
|
+
declare function getWorkspaceActivity(config: ADHDevConfig, limit?: number): WorkspaceActivityEntry[];
|
|
593
|
+
|
|
547
594
|
/**
|
|
548
595
|
* ADHDev Launcher — Configuration
|
|
549
596
|
*
|
|
550
597
|
* Manages launcher config, server connection tokens, and user preferences.
|
|
551
598
|
*/
|
|
599
|
+
|
|
552
600
|
interface ADHDevConfig {
|
|
553
601
|
serverUrl: string;
|
|
554
602
|
apiToken: string | null;
|
|
@@ -565,6 +613,12 @@ interface ADHDevConfig {
|
|
|
565
613
|
configuredCLIs: string[];
|
|
566
614
|
enabledIdes: string[];
|
|
567
615
|
recentCliWorkspaces: string[];
|
|
616
|
+
/** Saved workspaces for IDE/CLI/ACP launch (daemon-local) */
|
|
617
|
+
workspaces?: WorkspaceEntry[];
|
|
618
|
+
/** Default workspace id (from workspaces[]) — never used implicitly for launch */
|
|
619
|
+
defaultWorkspaceId?: string | null;
|
|
620
|
+
/** Recently used workspaces (IDE / CLI / ACP / default) for quick resume */
|
|
621
|
+
recentWorkspaceActivity?: WorkspaceActivityEntry[];
|
|
568
622
|
machineNickname: string | null;
|
|
569
623
|
cliHistory: CliHistoryEntry[];
|
|
570
624
|
providerSettings: Record<string, Record<string, any>>;
|
|
@@ -941,6 +995,26 @@ interface CLIInfo {
|
|
|
941
995
|
*/
|
|
942
996
|
declare function detectCLIs(providerLoader?: ProviderLoader): Promise<CLIInfo[]>;
|
|
943
997
|
|
|
998
|
+
/**
|
|
999
|
+
* Host memory metrics — macOS-aware "available" memory.
|
|
1000
|
+
*
|
|
1001
|
+
* Node's os.freemem() on darwin reports only the tiny truly-free pool; most RAM
|
|
1002
|
+
* sits in inactive/file-backed cache that the OS can reclaim. Dashboard "used %"
|
|
1003
|
+
* based on (total - freemem) looks ~99% almost always — misleading.
|
|
1004
|
+
*
|
|
1005
|
+
* On macOS we parse `vm_stat` and approximate available bytes as:
|
|
1006
|
+
* (free + inactive + speculative + purgeable [+ file_backed]) × page size
|
|
1007
|
+
* (aligned with common Activity Monitor–style interpretations.)
|
|
1008
|
+
*/
|
|
1009
|
+
interface HostMemorySnapshot {
|
|
1010
|
+
totalMem: number;
|
|
1011
|
+
/** Raw kernel "free" — small on macOS; kept for debugging / API compat */
|
|
1012
|
+
freeMem: number;
|
|
1013
|
+
/** Use this for UI "used %" — on darwin from vm_stat; else equals freeMem */
|
|
1014
|
+
availableMem: number;
|
|
1015
|
+
}
|
|
1016
|
+
declare function getHostMemorySnapshot(): HostMemorySnapshot;
|
|
1017
|
+
|
|
944
1018
|
/**
|
|
945
1019
|
* CDP Manager for ADHDev Daemon
|
|
946
1020
|
*
|
|
@@ -1895,6 +1969,7 @@ declare class DaemonCliManager {
|
|
|
1895
1969
|
private providerLoader;
|
|
1896
1970
|
constructor(deps: CliManagerDeps, providerLoader: ProviderLoader);
|
|
1897
1971
|
getCliKey(cliType: string, dir: string): string;
|
|
1972
|
+
private persistRecentDir;
|
|
1898
1973
|
private createAdapter;
|
|
1899
1974
|
startSession(cliType: string, workingDir: string, cliArgs?: string[], initialModel?: string): Promise<void>;
|
|
1900
1975
|
stopSession(key: string): Promise<void>;
|
|
@@ -2040,6 +2115,8 @@ declare class DaemonStatusReporter {
|
|
|
2040
2115
|
emitStatusEvent(event: Record<string, unknown>): void;
|
|
2041
2116
|
removeAgentTracking(_key: string): void;
|
|
2042
2117
|
updateAgentStreams(_ideType: string, _streams: any[]): void;
|
|
2118
|
+
/** Reset P2P dedup hash — forces next send to transmit even if content unchanged */
|
|
2119
|
+
resetP2PHash(): void;
|
|
2043
2120
|
private ts;
|
|
2044
2121
|
sendUnifiedStatusReport(opts?: {
|
|
2045
2122
|
p2pOnly?: boolean;
|
|
@@ -2290,6 +2367,9 @@ declare class ProviderCliAdapter implements CliAdapter {
|
|
|
2290
2367
|
private serverConn;
|
|
2291
2368
|
private logBuffer;
|
|
2292
2369
|
private lastApprovalResolvedAt;
|
|
2370
|
+
private approvalTransitionBuffer;
|
|
2371
|
+
private approvalExitTimeout;
|
|
2372
|
+
private resizeSuppressUntil;
|
|
2293
2373
|
private readonly timeouts;
|
|
2294
2374
|
constructor(provider: CliProviderModule, workingDir: string, extraArgs?: string[]);
|
|
2295
2375
|
setServerConn(serverConn: any): void;
|
|
@@ -2307,6 +2387,12 @@ declare class ProviderCliAdapter implements CliAdapter {
|
|
|
2307
2387
|
isProcessing(): boolean;
|
|
2308
2388
|
isReady(): boolean;
|
|
2309
2389
|
writeRaw(data: string): void;
|
|
2390
|
+
/**
|
|
2391
|
+
* Resolve an approval modal by navigating to the button at `buttonIndex` and pressing Enter.
|
|
2392
|
+
* Index 0 = first option (already selected by default — just Enter).
|
|
2393
|
+
* Index N = press Arrow Down N times, then Enter.
|
|
2394
|
+
*/
|
|
2395
|
+
resolveModal(buttonIndex: number): void;
|
|
2310
2396
|
resize(cols: number, rows: number): void;
|
|
2311
2397
|
}
|
|
2312
2398
|
|
|
@@ -2659,4 +2745,4 @@ declare function initDaemonComponents(config: DaemonInitConfig): Promise<DaemonC
|
|
|
2659
2745
|
*/
|
|
2660
2746
|
declare function shutdownDaemonComponents(components: DaemonComponents): Promise<void>;
|
|
2661
2747
|
|
|
2662
|
-
export { type AcpEntry, AcpProviderInstance, type AgentEntry, type AgentStreamEntry, AgentStreamPoller, type AgentStreamPollerDeps, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, type CdpTargetFilter, type ChatMessage, type CliAdapter, type CliEntry, CliProviderInstance, type CommandContext, type CommandResult$1 as CommandResult, type CommandRouterDeps, type CommandRouterResult, type CommandResult$2 as CoreCommandResult, DAEMON_WS_PATH, DEFAULT_DAEMON_PORT, DaemonAgentStreamManager, DaemonCdpInitializer, DaemonCdpManager, DaemonCdpScanner, DaemonCliManager, DaemonCommandHandler, DaemonCommandRouter, type DaemonComponents, type DaemonCoreOptions, type DaemonEvent, type DaemonInitConfig, type DaemonStatus, DaemonStatusReporter, type DetectedIde, DevServer, type ExtensionInfo$1 as ExtensionInfo, type IDEInfo, type IDaemonCore, type IdeEntry, IdeProviderInstance, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, ProviderCliAdapter, type ProviderConfig, type ProviderInfo, ProviderInstanceManager, ProviderLoader, type ProviderModule, type ProviderVersionInfo, type ScopedLogger, type SetupIdeInstanceOptions, type StatusResponse, type SystemInfo, VersionArchive, type VersionHistory, addCliHistory, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, getAIExtensions, getAvailableIdeIds, getLogLevel, getRecentCommands, getRecentLogs, initDaemonComponents, installExtensions, installGlobalInterceptor, isExtensionInstalled, isSetupComplete, launchIDE, launchWithCdp, loadConfig, logCommand, markSetupComplete, probeCdpPort, readChatHistory, registerExtensionProviders, resetConfig, saveConfig, setLogLevel, setupIdeInstance, shutdownDaemonComponents, updateConfig };
|
|
2748
|
+
export { type AcpEntry, AcpProviderInstance, type AgentEntry, type AgentStreamEntry, AgentStreamPoller, type AgentStreamPollerDeps, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, type CdpTargetFilter, type ChatMessage, type CliAdapter, type CliEntry, CliProviderInstance, type CommandContext, type CommandResult$1 as CommandResult, type CommandRouterDeps, type CommandRouterResult, type CommandResult$2 as CoreCommandResult, DAEMON_WS_PATH, DEFAULT_DAEMON_PORT, DaemonAgentStreamManager, DaemonCdpInitializer, DaemonCdpManager, DaemonCdpScanner, DaemonCliManager, DaemonCommandHandler, DaemonCommandRouter, type DaemonComponents, type DaemonCoreOptions, type DaemonEvent, type DaemonInitConfig, type DaemonStatus, DaemonStatusReporter, type DetectedIde, DevServer, type ExtensionInfo$1 as ExtensionInfo, type HostMemorySnapshot, type IDEInfo, type IDaemonCore, type IdeEntry, IdeProviderInstance, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, ProviderCliAdapter, type ProviderConfig, type ProviderInfo, ProviderInstanceManager, ProviderLoader, type ProviderModule, type ProviderVersionInfo, type ScopedLogger, type SetupIdeInstanceOptions, type StatusResponse, type SystemInfo, VersionArchive, type VersionHistory, type WorkspaceEntry, addCliHistory, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, getAIExtensions, getAvailableIdeIds, getHostMemorySnapshot, getLogLevel, getRecentCommands, getRecentLogs, getWorkspaceActivity, getWorkspaceState, initDaemonComponents, installExtensions, installGlobalInterceptor, isExtensionInstalled, isSetupComplete, launchIDE, launchWithCdp, loadConfig, logCommand, markSetupComplete, probeCdpPort, readChatHistory, registerExtensionProviders, resetConfig, saveConfig, setLogLevel, setupIdeInstance, shutdownDaemonComponents, updateConfig };
|