@adhdev/daemon-core 0.9.43 → 0.9.45
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 +4 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +6 -0
- package/dist/config/chat-history.d.ts +30 -9
- package/dist/index.js +724 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +724 -39
- 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 -0
- package/dist/providers/contracts.d.ts +14 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +105 -6
- package/src/cli-adapters/provider-cli-shared.ts +6 -0
- package/src/commands/chat-commands.ts +27 -3
- package/src/commands/router.ts +9 -3
- package/src/config/chat-history.ts +541 -24
- package/src/launch/macos-app-process.ts +37 -0
- package/src/launch.ts +43 -5
- package/src/providers/cli-provider-instance.ts +52 -3
- package/src/providers/contracts.ts +15 -2
- package/src/providers/read-chat-contract.ts +2 -0
|
@@ -23,6 +23,8 @@ type SeedCliChatMessage = Omit<Partial<CliChatMessage>, 'role'> & {
|
|
|
23
23
|
content?: string;
|
|
24
24
|
};
|
|
25
25
|
export declare function appendBoundedText(current: string, chunk: string, maxChars: number): string;
|
|
26
|
+
export declare function sanitizeCliStandardMessageContent(content: unknown): string;
|
|
27
|
+
export declare function trimLastAssistantEchoForCliMessages(messages: CliChatMessage[], prompt: string | undefined): void;
|
|
26
28
|
export declare class ProviderCliAdapter implements CliAdapter {
|
|
27
29
|
private extraArgs;
|
|
28
30
|
readonly cliType: string;
|
|
@@ -116,6 +118,8 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
116
118
|
private shouldReadTerminalScreenSnapshot;
|
|
117
119
|
private resetTerminalScreen;
|
|
118
120
|
private getFreshParsedStatusCache;
|
|
121
|
+
private providerOwnsTranscript;
|
|
122
|
+
private shouldUseFullProviderTranscriptContext;
|
|
119
123
|
private selectParseBaseMessages;
|
|
120
124
|
private messagesShareStableIdentity;
|
|
121
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;
|
|
@@ -105,4 +100,30 @@ export declare function listSavedHistorySessions(agentType: string, options?: {
|
|
|
105
100
|
};
|
|
106
101
|
export declare function rebuildHermesSavedHistoryFromCanonicalSession(historySessionId: string): boolean;
|
|
107
102
|
export declare function rebuildClaudeSavedHistoryFromNativeProject(historySessionId: string, workspace?: string): boolean;
|
|
103
|
+
export declare function resolveCodexSessionTranscriptPath(historySessionId: string, workspace?: string): string | null;
|
|
104
|
+
export declare function rebuildCodexSavedHistoryFromNativeSession(historySessionId: string, workspace?: string): boolean;
|
|
105
|
+
export declare function isNativeSourceCanonicalHistory(canonicalHistory?: ProviderCanonicalHistoryConfig): boolean;
|
|
106
|
+
export declare function readProviderChatHistory(agentType: string, options?: {
|
|
107
|
+
canonicalHistory?: ProviderCanonicalHistoryConfig;
|
|
108
|
+
historySessionId?: string;
|
|
109
|
+
workspace?: string;
|
|
110
|
+
offset?: number;
|
|
111
|
+
limit?: number;
|
|
112
|
+
excludeRecentCount?: number;
|
|
113
|
+
historyBehavior?: ProviderHistoryBehavior;
|
|
114
|
+
}): {
|
|
115
|
+
messages: HistoryMessage[];
|
|
116
|
+
hasMore: boolean;
|
|
117
|
+
source: 'provider-native' | 'adhdev-mirror' | 'native-unavailable';
|
|
118
|
+
};
|
|
119
|
+
export declare function listProviderHistorySessions(agentType: string, options?: {
|
|
120
|
+
canonicalHistory?: ProviderCanonicalHistoryConfig;
|
|
121
|
+
offset?: number;
|
|
122
|
+
limit?: number;
|
|
123
|
+
historyBehavior?: ProviderHistoryBehavior;
|
|
124
|
+
}): {
|
|
125
|
+
sessions: SavedHistorySessionSummary[];
|
|
126
|
+
hasMore: boolean;
|
|
127
|
+
source: 'provider-native' | 'adhdev-mirror';
|
|
128
|
+
};
|
|
108
129
|
export {};
|