@adhdev/daemon-core 0.6.71 → 0.6.73
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 +41 -24
- package/dist/index.js +275 -198
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/boot/daemon-lifecycle.ts +24 -0
- package/src/cli-adapters/provider-cli-adapter.ts +39 -8
- package/src/config/config.ts +16 -2
- package/src/daemon/dev-server.ts +108 -57
- package/src/index.ts +2 -2
- package/src/providers/provider-loader.ts +51 -59
package/dist/index.d.ts
CHANGED
|
@@ -168,8 +168,24 @@ interface ADHDevConfig {
|
|
|
168
168
|
/** Recently used workspaces (IDE / CLI / ACP / default) for quick resume */
|
|
169
169
|
recentWorkspaceActivity?: WorkspaceActivityEntry[];
|
|
170
170
|
machineNickname: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Stable local machine ID (prefix: `mach_`) — generated locally on first run.
|
|
173
|
+
* Used as daemon instance key (`daemon_<machineId>`) and in status reports.
|
|
174
|
+
* NOT the same as the server-side D1 `machines.id` — see `registeredMachineId`.
|
|
175
|
+
*/
|
|
171
176
|
machineId?: string;
|
|
172
177
|
machineSecret?: string | null;
|
|
178
|
+
/**
|
|
179
|
+
* Server-side D1 `machines.id` — the row ID assigned when daemon registers via
|
|
180
|
+
* `POST /cli/complete`. Corresponds to `machineId` in server DO context
|
|
181
|
+
* (`DaemonConnection.machineId`, `StatusContext.machineId`).
|
|
182
|
+
*
|
|
183
|
+
* Naming differs from server-side `machineId` to avoid confusion with the local
|
|
184
|
+
* `config.machineId` (mach_ prefix) which is a different value.
|
|
185
|
+
*
|
|
186
|
+
* @deprecated Legacy bridge field — will be removed after 2026-04-06.
|
|
187
|
+
* Modern auth flow uses `machineSecret` (adm_) to identify machines.
|
|
188
|
+
*/
|
|
173
189
|
registeredMachineId?: string;
|
|
174
190
|
cliHistory: CliHistoryEntry[];
|
|
175
191
|
providerSettings: Record<string, Record<string, any>>;
|
|
@@ -962,7 +978,6 @@ declare function detectAllVersions(loader: ProviderLoader, archive?: VersionArch
|
|
|
962
978
|
|
|
963
979
|
declare class ProviderLoader {
|
|
964
980
|
private providers;
|
|
965
|
-
private builtinDirs;
|
|
966
981
|
private userDir;
|
|
967
982
|
private upstreamDir;
|
|
968
983
|
private disableUpstream;
|
|
@@ -975,7 +990,6 @@ declare class ProviderLoader {
|
|
|
975
990
|
private static readonly GITHUB_TARBALL_URL;
|
|
976
991
|
private static readonly META_FILE;
|
|
977
992
|
constructor(options?: {
|
|
978
|
-
builtinDir?: string | string[];
|
|
979
993
|
userDir?: string;
|
|
980
994
|
logFn?: (msg: string) => void;
|
|
981
995
|
/** Disable upstream auto-download (for dev/testing/OSS) */
|
|
@@ -983,25 +997,17 @@ declare class ProviderLoader {
|
|
|
983
997
|
});
|
|
984
998
|
private log;
|
|
985
999
|
/**
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
getBuiltinDirs(): string[];
|
|
989
|
-
/**
|
|
990
|
-
* Primary builtin root used for local scaffolding/reference flows.
|
|
991
|
-
*/
|
|
992
|
-
getPrimaryBuiltinDir(): string;
|
|
993
|
-
/**
|
|
994
|
-
* User override root (~/.adhdev/providers by default).
|
|
995
|
-
*/
|
|
1000
|
+
* User override root (~/.adhdev/providers by default).
|
|
1001
|
+
*/
|
|
996
1002
|
getUserDir(): string;
|
|
997
1003
|
/**
|
|
998
1004
|
* Auto-updated upstream root (~/.adhdev/providers/.upstream by default).
|
|
999
1005
|
*/
|
|
1000
1006
|
getUpstreamDir(): string;
|
|
1001
1007
|
/**
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1008
|
+
* Provider search order for on-disk lookups.
|
|
1009
|
+
* Highest-priority editable overrides come first.
|
|
1010
|
+
*/
|
|
1005
1011
|
getProviderRoots(): string[];
|
|
1006
1012
|
/**
|
|
1007
1013
|
* Canonical provider directory shape for a given root.
|
|
@@ -1016,13 +1022,9 @@ declare class ProviderLoader {
|
|
|
1016
1022
|
*/
|
|
1017
1023
|
getUpstreamProviderDir(category: ProviderCategory, type: string): string;
|
|
1018
1024
|
/**
|
|
1019
|
-
*
|
|
1025
|
+
* Find the on-disk directory for a provider by type.
|
|
1026
|
+
* Search order: user override → upstream.
|
|
1020
1027
|
*/
|
|
1021
|
-
getBuiltinProviderDir(category: ProviderCategory, type: string): string;
|
|
1022
|
-
/**
|
|
1023
|
-
* Find the on-disk directory for a provider by type.
|
|
1024
|
-
* Search order: user override → upstream → builtin fallback.
|
|
1025
|
-
*/
|
|
1026
1028
|
findProviderDir(type: string): string | null;
|
|
1027
1029
|
/**
|
|
1028
1030
|
* Resolve a file within a provider directory.
|
|
@@ -1151,8 +1153,8 @@ declare class ProviderLoader {
|
|
|
1151
1153
|
*/
|
|
1152
1154
|
private loadScriptsFromDir;
|
|
1153
1155
|
/**
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
+
* Hot-reload: start watching for file changes
|
|
1157
|
+
*/
|
|
1156
1158
|
watch(): void;
|
|
1157
1159
|
/**
|
|
1158
1160
|
* Stop hot-reload
|
|
@@ -2699,6 +2701,8 @@ declare class ProviderCliAdapter implements CliAdapter {
|
|
|
2699
2701
|
private startupParseGate;
|
|
2700
2702
|
private spawnAt;
|
|
2701
2703
|
private onPtyDataCallback;
|
|
2704
|
+
private pendingOutputParseBuffer;
|
|
2705
|
+
private pendingOutputParseTimer;
|
|
2702
2706
|
private ptyOutputBuffer;
|
|
2703
2707
|
private ptyOutputFlushTimer;
|
|
2704
2708
|
private serverConn;
|
|
@@ -2743,6 +2747,7 @@ declare class ProviderCliAdapter implements CliAdapter {
|
|
|
2743
2747
|
setServerConn(serverConn: any): void;
|
|
2744
2748
|
setOnStatusChange(callback: () => void): void;
|
|
2745
2749
|
setOnPtyData(callback: (data: string) => void): void;
|
|
2750
|
+
private flushPendingOutputParse;
|
|
2746
2751
|
spawn(): Promise<void>;
|
|
2747
2752
|
private handleOutput;
|
|
2748
2753
|
private scheduleSettle;
|
|
@@ -3009,6 +3014,8 @@ declare class DevServer {
|
|
|
3009
3014
|
private handleDomContext;
|
|
3010
3015
|
private getDefaultAutoImplReference;
|
|
3011
3016
|
private resolveAutoImplReference;
|
|
3017
|
+
private getLatestScriptVersionDir;
|
|
3018
|
+
private resolveAutoImplWritableProviderDir;
|
|
3012
3019
|
private loadAutoImplReferenceScripts;
|
|
3013
3020
|
private handleAutoImplement;
|
|
3014
3021
|
private buildAutoImplPrompt;
|
|
@@ -3136,6 +3143,10 @@ interface DaemonComponents {
|
|
|
3136
3143
|
value: any[];
|
|
3137
3144
|
};
|
|
3138
3145
|
}
|
|
3146
|
+
interface DaemonDevSupportOptions {
|
|
3147
|
+
components: DaemonComponents;
|
|
3148
|
+
logFn?: (msg: string) => void;
|
|
3149
|
+
}
|
|
3139
3150
|
/**
|
|
3140
3151
|
* Initialize all daemon core components.
|
|
3141
3152
|
*
|
|
@@ -3150,6 +3161,12 @@ interface DaemonComponents {
|
|
|
3150
3161
|
* 8. Start instance ticking
|
|
3151
3162
|
*/
|
|
3152
3163
|
declare function initDaemonComponents(config: DaemonInitConfig): Promise<DaemonComponents>;
|
|
3164
|
+
/**
|
|
3165
|
+
* Start shared dev-only helpers:
|
|
3166
|
+
* - DevServer on port 19280
|
|
3167
|
+
* - Provider hot-reload watcher
|
|
3168
|
+
*/
|
|
3169
|
+
declare function startDaemonDevSupport(options: DaemonDevSupportOptions): Promise<DevServer>;
|
|
3153
3170
|
/**
|
|
3154
3171
|
* Graceful shutdown of all daemon components.
|
|
3155
3172
|
*
|
|
@@ -3162,4 +3179,4 @@ declare function initDaemonComponents(config: DaemonInitConfig): Promise<DaemonC
|
|
|
3162
3179
|
*/
|
|
3163
3180
|
declare function shutdownDaemonComponents(components: DaemonComponents): Promise<void>;
|
|
3164
3181
|
|
|
3165
|
-
export { type AcpConfigOption, type AcpMode, AcpProviderInstance, type AcpProviderState, type ActiveChatData, type AgentEntry, AgentStreamPoller, type AgentStreamPollerDeps, type AvailableProviderInfo, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, type CdpTargetFilter, type ChatMessage, type CliAdapter, CliProviderInstance, type CliProviderState, 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, DaemonStatusReporter, type DetectedIde, type DetectedIdeInfo, DevServer, type ExtensionInfo$1 as ExtensionInfo, type ExtensionProviderState, type HostMemorySnapshot, type IDEInfo, type IDaemonCore, IdeProviderInstance, type IdeProviderState, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, type MachineInfo, type ManagedAcpEntry, type ManagedAgentStream, type ManagedCliEntry, type ManagedIdeEntry, ProviderCliAdapter, type ProviderConfig, type ProviderErrorReason, type ProviderInfo, ProviderInstanceManager, ProviderLoader, type ProviderModule, type ProviderStatus, type ProviderVersionInfo, type ScopedLogger, type SetupIdeInstanceOptions, type StatusReportPayload, type StatusResponse, type StatusSnapshot, type StatusSnapshotOptions, type SystemInfo, VersionArchive, type VersionHistory, type WorkspaceActivity, type WorkspaceEntry, addCliHistory, buildAllManagedEntries, buildManagedAcps, buildManagedClis, buildManagedIdes, buildStatusSnapshot, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, findCdpManager, forwardAgentStreamsToIdeInstance, getAIExtensions, getAvailableIdeIds, getHostMemorySnapshot, getLogLevel, getRecentCommands, getRecentLogs, getWorkspaceActivity, getWorkspaceState, hasCdpManager, initDaemonComponents, installExtensions, installGlobalInterceptor, isCdpConnected, isExtensionInstalled, isIdeRunning, isSetupComplete, killIdeProcess, launchIDE, launchWithCdp, loadConfig, logCommand, markSetupComplete, probeCdpPort, readChatHistory, registerExtensionProviders, resetConfig, saveConfig, setLogLevel, setupIdeInstance, shutdownDaemonComponents, updateConfig };
|
|
3182
|
+
export { type AcpConfigOption, type AcpMode, AcpProviderInstance, type AcpProviderState, type ActiveChatData, type AgentEntry, AgentStreamPoller, type AgentStreamPollerDeps, type AvailableProviderInfo, CdpDomHandlers, type CdpInitializerConfig, type CdpScannerOptions, type CdpSetupContext, type CdpTargetFilter, type ChatMessage, type CliAdapter, CliProviderInstance, type CliProviderState, 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 DaemonDevSupportOptions, type DaemonEvent, type DaemonInitConfig, DaemonStatusReporter, type DetectedIde, type DetectedIdeInfo, DevServer, type ExtensionInfo$1 as ExtensionInfo, type ExtensionProviderState, type HostMemorySnapshot, type IDEInfo, type IDaemonCore, IdeProviderInstance, type IdeProviderState, type ExtensionInfo as InstallerExtensionInfo, LOG, type LogEntry, type LogLevel, type MachineInfo, type ManagedAcpEntry, type ManagedAgentStream, type ManagedCliEntry, type ManagedIdeEntry, ProviderCliAdapter, type ProviderConfig, type ProviderErrorReason, type ProviderInfo, ProviderInstanceManager, ProviderLoader, type ProviderModule, type ProviderStatus, type ProviderVersionInfo, type ScopedLogger, type SetupIdeInstanceOptions, type StatusReportPayload, type StatusResponse, type StatusSnapshot, type StatusSnapshotOptions, type SystemInfo, VersionArchive, type VersionHistory, type WorkspaceActivity, type WorkspaceEntry, addCliHistory, buildAllManagedEntries, buildManagedAcps, buildManagedClis, buildManagedIdes, buildStatusSnapshot, connectCdpManager, detectAllVersions, detectCLIs, detectIDEs, findCdpManager, forwardAgentStreamsToIdeInstance, getAIExtensions, getAvailableIdeIds, getHostMemorySnapshot, getLogLevel, getRecentCommands, getRecentLogs, getWorkspaceActivity, getWorkspaceState, hasCdpManager, initDaemonComponents, installExtensions, installGlobalInterceptor, isCdpConnected, isExtensionInstalled, isIdeRunning, isSetupComplete, killIdeProcess, launchIDE, launchWithCdp, loadConfig, logCommand, markSetupComplete, probeCdpPort, readChatHistory, registerExtensionProviders, resetConfig, saveConfig, setLogLevel, setupIdeInstance, shutdownDaemonComponents, startDaemonDevSupport, updateConfig };
|