@adhdev/daemon-core 0.9.44 → 0.9.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 +3 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +6 -0
- package/dist/config/chat-history.d.ts +34 -11
- package/dist/index.js +410 -310
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +410 -310
- package/dist/index.mjs.map +1 -1
- package/dist/launch/macos-app-process.d.ts +2 -0
- package/dist/providers/cli-provider-instance.d.ts +2 -5
- package/dist/providers/contracts.d.ts +33 -11
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +25 -3
- package/src/cli-adapters/provider-cli-shared.ts +6 -0
- package/src/commands/chat-commands.ts +28 -3
- package/src/commands/router.ts +13 -3
- package/src/config/chat-history.ts +282 -284
- package/src/launch/macos-app-process.ts +37 -0
- package/src/launch.ts +43 -5
- package/src/providers/cli-provider-instance.ts +57 -46
- package/src/providers/contracts.ts +35 -12
- package/src/providers/provider-schema.ts +40 -0
- package/src/providers/read-chat-contract.ts +2 -0
|
@@ -24,6 +24,7 @@ type SeedCliChatMessage = Omit<Partial<CliChatMessage>, 'role'> & {
|
|
|
24
24
|
};
|
|
25
25
|
export declare function appendBoundedText(current: string, chunk: string, maxChars: number): string;
|
|
26
26
|
export declare function sanitizeCliStandardMessageContent(content: unknown): string;
|
|
27
|
+
export declare function trimLastAssistantEchoForCliMessages(messages: CliChatMessage[], prompt: string | undefined): void;
|
|
27
28
|
export declare class ProviderCliAdapter implements CliAdapter {
|
|
28
29
|
private extraArgs;
|
|
29
30
|
readonly cliType: string;
|
|
@@ -117,6 +118,8 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
117
118
|
private shouldReadTerminalScreenSnapshot;
|
|
118
119
|
private resetTerminalScreen;
|
|
119
120
|
private getFreshParsedStatusCache;
|
|
121
|
+
private providerOwnsTranscript;
|
|
122
|
+
private shouldUseFullProviderTranscriptContext;
|
|
120
123
|
private selectParseBaseMessages;
|
|
121
124
|
private messagesShareStableIdentity;
|
|
122
125
|
private messagesComparable;
|
|
@@ -31,6 +31,8 @@ export interface ParsedSession {
|
|
|
31
31
|
buttons: string[];
|
|
32
32
|
} | null;
|
|
33
33
|
parsedStatus: string | null;
|
|
34
|
+
transcriptAuthority?: 'provider' | 'daemon';
|
|
35
|
+
coverage?: 'full' | 'tail' | 'current-turn';
|
|
34
36
|
}
|
|
35
37
|
export interface CliScripts {
|
|
36
38
|
parseSession?: (input: CliScriptInput & {
|
|
@@ -123,6 +125,10 @@ export interface CliProviderModule {
|
|
|
123
125
|
submitStrategy?: 'wait_for_echo' | 'immediate';
|
|
124
126
|
/** Allow sending another prompt while the CLI is still generating so users can intervene mid-turn. */
|
|
125
127
|
allowInputDuringGeneration?: boolean;
|
|
128
|
+
/** When provider-owned, daemon treats provider parser output as canonical transcript authority. */
|
|
129
|
+
transcriptAuthority?: 'provider' | 'daemon';
|
|
130
|
+
/** Full context lets provider-owned parsers canonicalize retained history instead of daemon prefix stitching. */
|
|
131
|
+
transcriptContext?: 'full' | 'tail';
|
|
126
132
|
scripts?: CliScripts;
|
|
127
133
|
spawn: {
|
|
128
134
|
command: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Auto-rotation (delete files older than 30 days)
|
|
9
9
|
* - Async/non-blocking (no impact on chat collection)
|
|
10
10
|
*/
|
|
11
|
-
import type { ProviderHistoryBehavior } from '../providers/contracts.js';
|
|
11
|
+
import type { ProviderCanonicalHistoryConfig, ProviderHistoryBehavior } from '../providers/contracts.js';
|
|
12
12
|
export declare const SAVED_HISTORY_ROLLUP_THRESHOLD_BYTES: number;
|
|
13
13
|
interface HistoryMessage {
|
|
14
14
|
ts: string;
|
|
@@ -31,6 +31,9 @@ export interface SavedHistorySessionSummary {
|
|
|
31
31
|
lastMessageAt: number;
|
|
32
32
|
preview?: string;
|
|
33
33
|
workspace?: string;
|
|
34
|
+
source?: 'adhdev-mirror' | 'provider-native';
|
|
35
|
+
sourcePath?: string;
|
|
36
|
+
sourceMtimeMs?: number;
|
|
34
37
|
}
|
|
35
38
|
export declare function shouldScheduleSavedHistoryRollup(totalBytes: number): boolean;
|
|
36
39
|
export declare class ChatHistoryWriter {
|
|
@@ -84,14 +87,6 @@ export declare class ChatHistoryWriter {
|
|
|
84
87
|
/** Allow only filename-safe characters */
|
|
85
88
|
private sanitize;
|
|
86
89
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Read history (static — called from P2P commands)
|
|
89
|
-
*
|
|
90
|
-
* Read JSONL files for a session and return a chronological page while paging
|
|
91
|
-
* backwards from the newest saved messages. When excludeRecentCount is set,
|
|
92
|
-
* the newest N messages are skipped so older-history pagination can avoid
|
|
93
|
-
* duplicating the live transcript tail already shown in the UI.
|
|
94
|
-
*/
|
|
95
90
|
export declare function readChatHistory(agentType: string, offset?: number, limit?: number, historySessionId?: string, excludeRecentCount?: number, historyBehavior?: ProviderHistoryBehavior): {
|
|
96
91
|
messages: HistoryMessage[];
|
|
97
92
|
hasMore: boolean;
|
|
@@ -103,6 +98,34 @@ export declare function listSavedHistorySessions(agentType: string, options?: {
|
|
|
103
98
|
sessions: SavedHistorySessionSummary[];
|
|
104
99
|
hasMore: boolean;
|
|
105
100
|
};
|
|
106
|
-
export
|
|
107
|
-
export declare function
|
|
101
|
+
export type ProviderNativeHistoryScripts = Record<string, ((input: any) => any) | undefined>;
|
|
102
|
+
export declare function materializeProviderNativeHistory(agentType: string, canonicalHistory: ProviderCanonicalHistoryConfig | undefined, historySessionId: string, workspace?: string, scripts?: ProviderNativeHistoryScripts): boolean;
|
|
103
|
+
export declare function isNativeSourceCanonicalHistory(canonicalHistory?: ProviderCanonicalHistoryConfig): boolean;
|
|
104
|
+
export declare function readProviderChatHistory(agentType: string, options?: {
|
|
105
|
+
canonicalHistory?: ProviderCanonicalHistoryConfig;
|
|
106
|
+
historySessionId?: string;
|
|
107
|
+
workspace?: string;
|
|
108
|
+
offset?: number;
|
|
109
|
+
limit?: number;
|
|
110
|
+
excludeRecentCount?: number;
|
|
111
|
+
historyBehavior?: ProviderHistoryBehavior;
|
|
112
|
+
scripts?: ProviderNativeHistoryScripts;
|
|
113
|
+
}): {
|
|
114
|
+
messages: HistoryMessage[];
|
|
115
|
+
hasMore: boolean;
|
|
116
|
+
source: 'provider-native' | 'adhdev-mirror' | 'native-unavailable';
|
|
117
|
+
sourcePath?: string;
|
|
118
|
+
sourceMtimeMs?: number;
|
|
119
|
+
};
|
|
120
|
+
export declare function listProviderHistorySessions(agentType: string, options?: {
|
|
121
|
+
canonicalHistory?: ProviderCanonicalHistoryConfig;
|
|
122
|
+
offset?: number;
|
|
123
|
+
limit?: number;
|
|
124
|
+
historyBehavior?: ProviderHistoryBehavior;
|
|
125
|
+
scripts?: ProviderNativeHistoryScripts;
|
|
126
|
+
}): {
|
|
127
|
+
sessions: SavedHistorySessionSummary[];
|
|
128
|
+
hasMore: boolean;
|
|
129
|
+
source: 'provider-native' | 'adhdev-mirror';
|
|
130
|
+
};
|
|
108
131
|
export {};
|