@adhdev/daemon-core 0.7.45 → 0.7.46
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/cli-adapters/provider-cli-adapter.d.ts +1 -0
- package/dist/cli-adapters/pty-transport.d.ts +1 -0
- package/dist/commands/cli-manager.d.ts +11 -2
- package/dist/config/chat-history.d.ts +29 -2
- package/dist/config/config.d.ts +4 -0
- package/dist/config/recent-activity.d.ts +3 -1
- package/dist/config/saved-sessions.d.ts +22 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4619 -3969
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4613 -3965
- package/dist/index.mjs.map +1 -1
- package/dist/providers/cli-provider-instance.d.ts +24 -1
- package/dist/providers/contracts.d.ts +3 -0
- package/dist/providers/provider-instance.d.ts +1 -0
- package/dist/shared-types.d.ts +2 -0
- package/node_modules/@adhdev/session-host-core/dist/index.d.mts +12 -1
- package/node_modules/@adhdev/session-host-core/dist/index.d.ts +12 -1
- package/node_modules/@adhdev/session-host-core/dist/index.js +9 -0
- package/node_modules/@adhdev/session-host-core/dist/index.js.map +1 -1
- package/node_modules/@adhdev/session-host-core/dist/index.mjs +9 -0
- package/node_modules/@adhdev/session-host-core/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/boot/daemon-lifecycle.ts +19 -15
- package/src/cli-adapters/provider-cli-adapter.ts +7 -1
- package/src/cli-adapters/pty-transport.ts +1 -0
- package/src/cli-adapters/session-host-transport.ts +19 -0
- package/src/commands/chat-commands.ts +28 -8
- package/src/commands/cli-manager.ts +259 -22
- package/src/commands/router.ts +52 -1
- package/src/config/chat-history.ts +193 -10
- package/src/config/config.d.ts +4 -0
- package/src/config/config.ts +6 -0
- package/src/config/recent-activity.ts +13 -2
- package/src/config/saved-sessions.ts +73 -0
- package/src/daemon/dev-auto-implement.ts +23 -5
- package/src/daemon/dev-server.ts +22 -4
- package/src/index.ts +2 -0
- package/src/providers/cli-provider-instance.ts +205 -4
- package/src/providers/contracts.ts +3 -0
- package/src/providers/provider-instance.d.ts +1 -0
- package/src/providers/provider-instance.ts +1 -0
- package/src/session-host/runtime-support.ts +1 -0
- package/src/shared-types.d.ts +2 -0
- package/src/shared-types.ts +2 -0
- package/src/status/builders.ts +1 -0
- package/src/status/snapshot.ts +1 -0
|
@@ -212,6 +212,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
212
212
|
sendMessage(text: string): Promise<void>;
|
|
213
213
|
getPartialResponse(): string;
|
|
214
214
|
getRuntimeMetadata(): PtyRuntimeMetadata | null;
|
|
215
|
+
updateRuntimeMeta(meta: Record<string, unknown>, replace?: boolean): void;
|
|
215
216
|
cancel(): void;
|
|
216
217
|
saveAndStop(): Promise<void>;
|
|
217
218
|
private waitForStopped;
|
|
@@ -30,6 +30,7 @@ export interface PtyRuntimeTransport {
|
|
|
30
30
|
kill(): void;
|
|
31
31
|
clearBuffer?(): void;
|
|
32
32
|
detach?(): void;
|
|
33
|
+
updateMeta?(meta: Record<string, unknown>, replace?: boolean): void;
|
|
33
34
|
getMetadata?(): PtyRuntimeMetadata | null;
|
|
34
35
|
onData(callback: (data: string) => void): void;
|
|
35
36
|
onExit(callback: (info: {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ProviderInstanceManager } from '../providers/provider-instance-manager.js';
|
|
8
8
|
import { ProviderLoader } from '../providers/provider-loader.js';
|
|
9
|
+
import type { ProviderResumeCapability } from '../providers/contracts.js';
|
|
9
10
|
import type { CliAdapter } from '../cli-adapter-types.js';
|
|
10
11
|
import type { PtyTransportFactory } from '../cli-adapters/pty-transport.js';
|
|
11
12
|
import type { SessionRegistry } from '../sessions/registry.js';
|
|
@@ -14,7 +15,7 @@ export interface CliManagerDeps {
|
|
|
14
15
|
getServerConn(): any | null;
|
|
15
16
|
/** P2P — PTY output transmit */
|
|
16
17
|
getP2p(): {
|
|
17
|
-
|
|
18
|
+
broadcastSessionOutput(key: string, data: string): void;
|
|
18
19
|
} | null;
|
|
19
20
|
/** StatusReporter callback */
|
|
20
21
|
onStatusChange(): void;
|
|
@@ -34,6 +35,7 @@ export interface CliTransportFactoryParams {
|
|
|
34
35
|
providerType: string;
|
|
35
36
|
workspace: string;
|
|
36
37
|
cliArgs?: string[];
|
|
38
|
+
providerSessionId?: string;
|
|
37
39
|
attachExisting?: boolean;
|
|
38
40
|
}
|
|
39
41
|
export interface HostedCliRuntimeDescriptor {
|
|
@@ -46,7 +48,9 @@ export interface HostedCliRuntimeDescriptor {
|
|
|
46
48
|
cliType: string;
|
|
47
49
|
workspace: string;
|
|
48
50
|
cliArgs?: string[];
|
|
51
|
+
providerSessionId?: string;
|
|
49
52
|
}
|
|
53
|
+
export declare function supportsExplicitSessionResume(resume?: ProviderResumeCapability): boolean;
|
|
50
54
|
export declare class DaemonCliManager {
|
|
51
55
|
readonly adapters: Map<string, CliAdapter>;
|
|
52
56
|
private deps;
|
|
@@ -60,7 +64,12 @@ export declare class DaemonCliManager {
|
|
|
60
64
|
private createAdapter;
|
|
61
65
|
private startCliExitMonitor;
|
|
62
66
|
private registerCliInstance;
|
|
63
|
-
startSession(cliType: string, workingDir: string, cliArgs?: string[], initialModel?: string
|
|
67
|
+
startSession(cliType: string, workingDir: string, cliArgs?: string[], initialModel?: string, options?: {
|
|
68
|
+
resumeSessionId?: string;
|
|
69
|
+
}): Promise<{
|
|
70
|
+
runtimeSessionId: string;
|
|
71
|
+
providerSessionId?: string;
|
|
72
|
+
}>;
|
|
64
73
|
stopSession(key: string): Promise<void>;
|
|
65
74
|
stopSessionWithMode(key: string, mode: 'hard' | 'save'): Promise<void>;
|
|
66
75
|
shutdownAll(): void;
|
|
@@ -13,10 +13,20 @@ interface HistoryMessage {
|
|
|
13
13
|
receivedAt: number;
|
|
14
14
|
role: 'user' | 'assistant' | 'system';
|
|
15
15
|
content: string;
|
|
16
|
+
kind?: string;
|
|
16
17
|
agent: string;
|
|
17
18
|
instanceId?: string;
|
|
19
|
+
historySessionId?: string;
|
|
18
20
|
sessionTitle?: string;
|
|
19
21
|
}
|
|
22
|
+
export interface SavedHistorySessionSummary {
|
|
23
|
+
historySessionId: string;
|
|
24
|
+
sessionTitle?: string;
|
|
25
|
+
messageCount: number;
|
|
26
|
+
firstMessageAt: number;
|
|
27
|
+
lastMessageAt: number;
|
|
28
|
+
preview?: string;
|
|
29
|
+
}
|
|
20
30
|
export declare class ChatHistoryWriter {
|
|
21
31
|
/** Last seen message count per agent (deduplication) */
|
|
22
32
|
private lastSeenCounts;
|
|
@@ -35,7 +45,17 @@ export declare class ChatHistoryWriter {
|
|
|
35
45
|
role: string;
|
|
36
46
|
content: string;
|
|
37
47
|
receivedAt?: number;
|
|
38
|
-
|
|
48
|
+
kind?: string;
|
|
49
|
+
historyDedupKey?: string;
|
|
50
|
+
}>, sessionTitle?: string, instanceId?: string, historySessionId?: string): void;
|
|
51
|
+
appendSystemMarker(agentType: string, content: string, options?: {
|
|
52
|
+
sessionTitle?: string;
|
|
53
|
+
instanceId?: string;
|
|
54
|
+
historySessionId?: string;
|
|
55
|
+
dedupKey?: string;
|
|
56
|
+
receivedAt?: number;
|
|
57
|
+
}): void;
|
|
58
|
+
promoteHistorySession(agentType: string, previousHistorySessionId: string, nextHistorySessionId: string): void;
|
|
39
59
|
/** Called when agent session is explicitly changed */
|
|
40
60
|
onSessionChange(agentType: string): void;
|
|
41
61
|
/** Delete history files older than 30 days */
|
|
@@ -50,8 +70,15 @@ export declare class ChatHistoryWriter {
|
|
|
50
70
|
* When instanceId is specified, reads only that instance file.
|
|
51
71
|
* Offset/limit-based paging.
|
|
52
72
|
*/
|
|
53
|
-
export declare function readChatHistory(agentType: string, offset?: number, limit?: number,
|
|
73
|
+
export declare function readChatHistory(agentType: string, offset?: number, limit?: number, historySessionId?: string): {
|
|
54
74
|
messages: HistoryMessage[];
|
|
55
75
|
hasMore: boolean;
|
|
56
76
|
};
|
|
77
|
+
export declare function listSavedHistorySessions(agentType: string, options?: {
|
|
78
|
+
offset?: number;
|
|
79
|
+
limit?: number;
|
|
80
|
+
}): {
|
|
81
|
+
sessions: SavedHistorySessionSummary[];
|
|
82
|
+
hasMore: boolean;
|
|
83
|
+
};
|
|
57
84
|
export {};
|
package/dist/config/config.d.ts
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { WorkspaceEntry } from './workspaces.js';
|
|
7
7
|
import type { RecentActivityEntry } from './recent-activity.js';
|
|
8
|
+
import type { SavedProviderSessionEntry } from './saved-sessions.js';
|
|
8
9
|
export type { WorkspaceEntry } from './workspaces.js';
|
|
9
10
|
export type { RecentActivityEntry } from './recent-activity.js';
|
|
11
|
+
export type { SavedProviderSessionEntry } from './saved-sessions.js';
|
|
10
12
|
export interface ADHDevConfig {
|
|
11
13
|
serverUrl: string;
|
|
12
14
|
selectedIde: string | null;
|
|
@@ -23,6 +25,8 @@ export interface ADHDevConfig {
|
|
|
23
25
|
defaultWorkspaceId?: string | null;
|
|
24
26
|
/** Unified recent activity across IDE / CLI / ACP launch flows */
|
|
25
27
|
recentActivity?: RecentActivityEntry[];
|
|
28
|
+
/** Persistent resume-capable provider sessions keyed by providerSessionId */
|
|
29
|
+
savedProviderSessions?: SavedProviderSessionEntry[];
|
|
26
30
|
/** Last seen timestamps for live sessions, keyed by sessionId */
|
|
27
31
|
sessionReads?: Record<string, number>;
|
|
28
32
|
/** Last seen completion marker for live sessions, keyed by sessionId */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Unlike live session state, this is launch oriented:
|
|
5
5
|
* - one normalized row shape for IDE / CLI / ACP
|
|
6
|
-
* - deduped by kind + providerType + workspace
|
|
6
|
+
* - deduped by provider session when available, else by kind + providerType + workspace
|
|
7
7
|
* - used only for quick-launch shortcuts
|
|
8
8
|
*/
|
|
9
9
|
import type { ADHDevConfig } from './config.js';
|
|
@@ -12,12 +12,14 @@ export interface RecentActivityEntry {
|
|
|
12
12
|
kind: 'ide' | 'cli' | 'acp';
|
|
13
13
|
providerType: string;
|
|
14
14
|
providerName: string;
|
|
15
|
+
providerSessionId?: string;
|
|
15
16
|
workspace?: string | null;
|
|
16
17
|
currentModel?: string;
|
|
17
18
|
title?: string;
|
|
18
19
|
lastUsedAt: number;
|
|
19
20
|
}
|
|
20
21
|
export declare function buildRecentActivityKey(entry: Pick<RecentActivityEntry, 'kind' | 'providerType' | 'workspace'>): string;
|
|
22
|
+
export declare function buildRecentActivityKeyForEntry(entry: Pick<RecentActivityEntry, 'kind' | 'providerType' | 'workspace' | 'providerSessionId'>): string;
|
|
21
23
|
export declare function appendRecentActivity(config: ADHDevConfig, entry: Omit<RecentActivityEntry, 'id' | 'lastUsedAt'> & {
|
|
22
24
|
lastUsedAt?: number;
|
|
23
25
|
}): ADHDevConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ADHDevConfig } from './config.js';
|
|
2
|
+
export interface SavedProviderSessionEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: 'cli' | 'acp';
|
|
5
|
+
providerType: string;
|
|
6
|
+
providerName: string;
|
|
7
|
+
providerSessionId: string;
|
|
8
|
+
workspace?: string | null;
|
|
9
|
+
currentModel?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
lastUsedAt: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildSavedProviderSessionKey(providerSessionId: string): string;
|
|
15
|
+
export declare function upsertSavedProviderSession(config: ADHDevConfig, entry: Omit<SavedProviderSessionEntry, 'id' | 'createdAt' | 'lastUsedAt'> & {
|
|
16
|
+
createdAt?: number;
|
|
17
|
+
lastUsedAt?: number;
|
|
18
|
+
}): ADHDevConfig;
|
|
19
|
+
export declare function getSavedProviderSessions(config: ADHDevConfig, filters?: {
|
|
20
|
+
providerType?: string;
|
|
21
|
+
kind?: SavedProviderSessionEntry['kind'];
|
|
22
|
+
}): SavedProviderSessionEntry[];
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { loadConfig, saveConfig, resetConfig, isSetupComplete, markSetupComplete
|
|
|
20
20
|
export { getWorkspaceState } from './config/workspaces.js';
|
|
21
21
|
export { appendRecentActivity, getRecentActivity } from './config/recent-activity.js';
|
|
22
22
|
export type { RecentActivityEntry } from './config/recent-activity.js';
|
|
23
|
+
export { getSavedProviderSessions, upsertSavedProviderSession } from './config/saved-sessions.js';
|
|
24
|
+
export type { SavedProviderSessionEntry } from './config/saved-sessions.js';
|
|
23
25
|
export { detectIDEs } from './detection/ide-detector.js';
|
|
24
26
|
export type { IDEInfo } from './detection/ide-detector.js';
|
|
25
27
|
export { detectCLIs } from './detection/cli-detector.js';
|