@agentclientprotocol/claude-agent-acp 0.113.1-preview.9 → 0.114.1-preview.1
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/README.md +2 -0
- package/dist/query-settings.d.ts +42 -0
- package/dist/query-settings.d.ts.map +1 -0
- package/dist/query-settings.js +43 -0
- package/dist/resumed-session.d.ts +9 -2
- package/dist/resumed-session.d.ts.map +1 -1
- package/dist/resumed-session.js +51 -7
- package/dist/sdk-to-acp.js +4 -2
- package/dist/session-cursors.d.ts +1 -1
- package/dist/session-cursors.d.ts.map +1 -1
- package/dist/session-cursors.js +8 -2
- package/dist/session-index/transcript-scan.d.ts +11 -3
- package/dist/session-index/transcript-scan.d.ts.map +1 -1
- package/dist/session-index/transcript-scan.js +21 -5
- package/dist/session-mode.d.ts +31 -2
- package/dist/session-mode.d.ts.map +1 -1
- package/dist/session-mode.js +35 -5
- package/dist/session-model.d.ts +4 -1
- package/dist/session-model.d.ts.map +1 -1
- package/dist/session-model.js +26 -4
- package/dist/session-read.d.ts +59 -0
- package/dist/session-read.d.ts.map +1 -0
- package/dist/session-read.js +407 -0
- package/dist/session-rewind.d.ts +6 -2
- package/dist/session-rewind.d.ts.map +1 -1
- package/dist/session-rewind.js +13 -4
- package/dist/session-ultracode.d.ts +4 -1
- package/dist/session-ultracode.d.ts.map +1 -1
- package/dist/session-ultracode.js +14 -25
- package/dist/settings.d.ts +34 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +55 -4
- package/dist/subagent-history.d.ts +9 -1
- package/dist/subagent-history.d.ts.map +1 -1
- package/dist/subagent-history.js +55 -13
- package/dist/v1/acp-agent.d.ts +6 -0
- package/dist/v1/acp-agent.d.ts.map +1 -1
- package/dist/v1/acp-agent.js +146 -72
- package/dist/v1/session-read.d.ts +31 -0
- package/dist/v1/session-read.d.ts.map +1 -0
- package/dist/v1/session-read.js +63 -0
- package/dist/v2/agent.d.ts.map +1 -1
- package/dist/v2/agent.js +62 -27
- package/dist/v2/config.d.ts +6 -5
- package/dist/v2/config.d.ts.map +1 -1
- package/dist/v2/config.js +4 -1
- package/dist/v2/session-read.d.ts +16 -0
- package/dist/v2/session-read.d.ts.map +1 -0
- package/dist/v2/session-read.js +28 -0
- package/dist/v2/setup.d.ts +4 -1
- package/dist/v2/setup.d.ts.map +1 -1
- package/dist/v2/setup.js +4 -2
- package/dist/v2/stream.d.ts +9 -13
- package/dist/v2/stream.d.ts.map +1 -1
- package/dist/v2/stream.js +10 -9
- package/dist/v2/subagent-replay.d.ts +16 -4
- package/dist/v2/subagent-replay.d.ts.map +1 -1
- package/dist/v2/subagent-replay.js +22 -10
- package/dist/v2/tasks.d.ts.map +1 -1
- package/dist/v2/tasks.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,6 +85,8 @@ is inserted once, and the retry gets the first `messageId`. The key is known for
|
|
|
85
85
|
Code stores the message, also after a restart. A prompt that Claude Code does not store, such as a
|
|
86
86
|
local command, keeps its key until `session/close` or the end of the connection.
|
|
87
87
|
|
|
88
|
+
A client can [read and follow a stored session](docs/session-read.md) through `_session/read` while a terminal continues writing it.
|
|
89
|
+
|
|
88
90
|
The adapter announces a session cursor (`cursor_update`) before each user message that follows
|
|
89
91
|
another entry of the conversation, live and in a replay. `session/fork` with its `cursorId` copies
|
|
90
92
|
the history before that message, and fails with `-32602` for any other `cursorId`. A v1 client gets
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Query, SDKSettingsParseError, Settings } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import type { SettingsManager } from "./settings.js";
|
|
3
|
+
/** The fields used from Claude Code's `get_settings` control response. */
|
|
4
|
+
export type QuerySettings = {
|
|
5
|
+
effective?: Settings;
|
|
6
|
+
sources?: Array<{
|
|
7
|
+
source?: unknown;
|
|
8
|
+
settings?: Settings;
|
|
9
|
+
}>;
|
|
10
|
+
applied?: {
|
|
11
|
+
model?: unknown;
|
|
12
|
+
ultracodeAvailable?: unknown;
|
|
13
|
+
ultracodeRequested?: unknown;
|
|
14
|
+
};
|
|
15
|
+
errors?: SDKSettingsParseError[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Claude Code's answer to `get_settings`. Undefined when the SDK has no
|
|
19
|
+
* `getSettings` or the request fails; a failure is logged when a `logger` is
|
|
20
|
+
* given.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readQuerySettings(query: Query, logger?: {
|
|
23
|
+
error: (...args: unknown[]) => void;
|
|
24
|
+
}): Promise<QuerySettings | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* The policy tier the running CLI applies: its managed settings, remote ones
|
|
27
|
+
* included. Undefined when the CLI reports none.
|
|
28
|
+
*/
|
|
29
|
+
export declare function cliPolicySettings(report: QuerySettings | undefined): Settings | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Reads the settings that the query's Claude Code applies, once it has
|
|
32
|
+
* answered `initialize`, and has `settings` follow its policy tier from then
|
|
33
|
+
* on (see `SettingsManager.followCliPolicy`). Call it before the first reader
|
|
34
|
+
* of a value that a policy can set, such as the `apiKeyHelper` of the
|
|
35
|
+
* session's identity. Returns the answer that it read, for the start's other
|
|
36
|
+
* readers (`getAvailableModels`), or undefined without one: the settings then
|
|
37
|
+
* stay those of this process, and the failure is logged.
|
|
38
|
+
*/
|
|
39
|
+
export declare function followQueryPolicy(query: Query, settings: Pick<SettingsManager, "followCliPolicy">, logger: {
|
|
40
|
+
error: (...args: unknown[]) => void;
|
|
41
|
+
}): Promise<QuerySettings | undefined>;
|
|
42
|
+
//# sourceMappingURL=query-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-settings.d.ts","sourceRoot":"","sources":["../src/query-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAClC,CAAC;AAMF;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,KAAK,EACZ,MAAM,CAAC,EAAE;IAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAAE,GAC/C,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CASpC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAKzF;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,EAClD,MAAM,EAAE;IAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;CAAE,GAC9C,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAQpC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code's answer to `get_settings`. Undefined when the SDK has no
|
|
3
|
+
* `getSettings` or the request fails; a failure is logged when a `logger` is
|
|
4
|
+
* given.
|
|
5
|
+
*/
|
|
6
|
+
export async function readQuerySettings(query, logger) {
|
|
7
|
+
const getSettings = query.getSettings;
|
|
8
|
+
if (typeof getSettings !== "function")
|
|
9
|
+
return undefined;
|
|
10
|
+
try {
|
|
11
|
+
return await getSettings.call(query);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
logger?.error("Failed to read the settings that Claude Code applies:", error);
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The policy tier the running CLI applies: its managed settings, remote ones
|
|
20
|
+
* included. Undefined when the CLI reports none.
|
|
21
|
+
*/
|
|
22
|
+
export function cliPolicySettings(report) {
|
|
23
|
+
const sources = Array.isArray(report?.sources) ? report.sources : [];
|
|
24
|
+
const policy = sources.find((entry) => entry?.source === "policySettings")?.settings;
|
|
25
|
+
if (!policy || typeof policy !== "object" || Object.keys(policy).length === 0)
|
|
26
|
+
return undefined;
|
|
27
|
+
return policy;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Reads the settings that the query's Claude Code applies, once it has
|
|
31
|
+
* answered `initialize`, and has `settings` follow its policy tier from then
|
|
32
|
+
* on (see `SettingsManager.followCliPolicy`). Call it before the first reader
|
|
33
|
+
* of a value that a policy can set, such as the `apiKeyHelper` of the
|
|
34
|
+
* session's identity. Returns the answer that it read, for the start's other
|
|
35
|
+
* readers (`getAvailableModels`), or undefined without one: the settings then
|
|
36
|
+
* stay those of this process, and the failure is logged.
|
|
37
|
+
*/
|
|
38
|
+
export async function followQueryPolicy(query, settings, logger) {
|
|
39
|
+
const read = () => readQuerySettings(query, logger);
|
|
40
|
+
const report = await read();
|
|
41
|
+
await settings.followCliPolicy(async () => cliPolicySettings(await read()), cliPolicySettings(report));
|
|
42
|
+
return report;
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type SessionMessage, type SessionStoreEntry } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import { type FileHandle } from "node:fs/promises";
|
|
2
3
|
type ResumeLogger = {
|
|
3
4
|
log: (...args: unknown[]) => void;
|
|
4
5
|
error: (...args: unknown[]) => void;
|
|
@@ -39,7 +40,7 @@ export declare function readResumedSession(sessionId: string, logger?: ResumeLog
|
|
|
39
40
|
* the chain loops and ends there. Without it, the kept messages stay where
|
|
40
41
|
* they were said, before the boundary.
|
|
41
42
|
*/
|
|
42
|
-
export declare function readHistoryAcrossCompactions(sessionId: string, messages: SessionMessage[], logger?: ResumeLogger, dir?: string): Promise<SessionMessage[]>;
|
|
43
|
+
export declare function readHistoryAcrossCompactions(sessionId: string, messages: SessionMessage[], logger?: ResumeLogger, dir?: string, snapshot?: SessionStoreEntry[]): Promise<SessionMessage[]>;
|
|
43
44
|
/** Every record of a session's transcript, including the inactive branches
|
|
44
45
|
* and the history before a compaction that `getSessionMessages` leaves out.
|
|
45
46
|
* Without `dir`, all project directories are searched. */
|
|
@@ -64,6 +65,12 @@ export type ResumedTail = {
|
|
|
64
65
|
*/
|
|
65
66
|
export declare function readResumedTail(sessionId: string, logger?: ResumeLogger, withModel?: boolean): Promise<ResumedTail>;
|
|
66
67
|
/** The local transcript of a session in any project directory, as the SDK looks it up. */
|
|
67
|
-
export declare function findTranscript(sessionId: string
|
|
68
|
+
export declare function findTranscript(sessionId: string, options?: {
|
|
69
|
+
strict: boolean;
|
|
70
|
+
}): Promise<string | undefined>;
|
|
71
|
+
/** Read the records once so the SDK projects the active branch and its compactions
|
|
72
|
+
* from the same bytes. An unfinished JSON line can be completed by the next poll. */
|
|
73
|
+
export declare function readTranscriptEntries(file: string): Promise<SessionStoreEntry[]>;
|
|
74
|
+
export declare function readTranscriptEntriesOf(file: string, handle: FileHandle, size: number): Promise<SessionStoreEntry[]>;
|
|
68
75
|
export {};
|
|
69
76
|
//# sourceMappingURL=resumed-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resumed-session.d.ts","sourceRoot":"","sources":["../src/resumed-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,K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AACnE,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,YAAY,EACrB,SAAS,UAAO,GACf,OAAO,CAAC,WAAW,CAAC,CAiBtB;AAED,0FAA0F;AAC1F,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAC5B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuB7B;AAED;qFACqF;AACrF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAOtF;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgB9B"}
|
package/dist/resumed-session.js
CHANGED
|
@@ -2,7 +2,8 @@ import { getSessionMessages, importSessionToStore, } from "@anthropic-ai/claude-
|
|
|
2
2
|
import { access, open, readdir } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { isCompactSummaryMessage } from "./context-compaction.js";
|
|
5
|
-
import {
|
|
5
|
+
import { projectsRoot } from "./paths.js";
|
|
6
|
+
import { errorCode } from "./session-index/project-dirs.js";
|
|
6
7
|
import { SessionTiming } from "./session-timing.js";
|
|
7
8
|
/** The size of one backward read of a transcript. */
|
|
8
9
|
const TAIL_CHUNK_BYTES = 64 * 1024;
|
|
@@ -76,11 +77,11 @@ export async function readResumedSession(sessionId, logger) {
|
|
|
76
77
|
* the chain loops and ends there. Without it, the kept messages stay where
|
|
77
78
|
* they were said, before the boundary.
|
|
78
79
|
*/
|
|
79
|
-
export async function readHistoryAcrossCompactions(sessionId, messages, logger, dir) {
|
|
80
|
+
export async function readHistoryAcrossCompactions(sessionId, messages, logger, dir, snapshot) {
|
|
80
81
|
if (!isCompactSummaryMessage(messages[0]))
|
|
81
82
|
return messages;
|
|
82
83
|
try {
|
|
83
|
-
const entries = (await loadFullSessionHistory(sessionId, dir)).map(linkCompactBoundary);
|
|
84
|
+
const entries = (snapshot ?? (await loadFullSessionHistory(sessionId, dir))).map(linkCompactBoundary);
|
|
84
85
|
const history = await getSessionMessages(sessionId, {
|
|
85
86
|
dir,
|
|
86
87
|
sessionStore: { append: async () => { }, load: async () => entries },
|
|
@@ -88,12 +89,16 @@ export async function readHistoryAcrossCompactions(sessionId, messages, logger,
|
|
|
88
89
|
const leaf = messages.at(-1)?.uuid;
|
|
89
90
|
const end = history.findIndex((message) => message.uuid === leaf);
|
|
90
91
|
if (end < 0) {
|
|
92
|
+
if (snapshot)
|
|
93
|
+
throw new Error("Compacted history does not reach the active branch");
|
|
91
94
|
logger?.error(`The history before the last compaction of session ${sessionId} does not reach message ${leaf}: replaying the messages after it`);
|
|
92
95
|
return messages;
|
|
93
96
|
}
|
|
94
97
|
return history.slice(0, end + 1);
|
|
95
98
|
}
|
|
96
99
|
catch (error) {
|
|
100
|
+
if (snapshot)
|
|
101
|
+
throw error;
|
|
97
102
|
logger?.error(`Failed to read the history before the last compaction of session ${sessionId}:`, error);
|
|
98
103
|
return messages;
|
|
99
104
|
}
|
|
@@ -155,27 +160,66 @@ export async function readResumedTail(sessionId, logger, withModel = true) {
|
|
|
155
160
|
return withModel ? { model: (await readResumedSession(sessionId, logger)).model } : {};
|
|
156
161
|
}
|
|
157
162
|
/** The local transcript of a session in any project directory, as the SDK looks it up. */
|
|
158
|
-
export async function findTranscript(sessionId) {
|
|
159
|
-
const projects =
|
|
163
|
+
export async function findTranscript(sessionId, options) {
|
|
164
|
+
const projects = projectsRoot();
|
|
160
165
|
let directories;
|
|
161
166
|
try {
|
|
162
167
|
directories = await readdir(projects);
|
|
163
168
|
}
|
|
164
|
-
catch {
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (options?.strict && errorCode(error) !== "ENOENT")
|
|
171
|
+
throw error;
|
|
165
172
|
return undefined;
|
|
166
173
|
}
|
|
174
|
+
let lookupError;
|
|
167
175
|
for (const directory of directories) {
|
|
168
176
|
const candidate = path.join(projects, directory, `${sessionId}.jsonl`);
|
|
169
177
|
try {
|
|
170
178
|
await access(candidate);
|
|
171
179
|
return candidate;
|
|
172
180
|
}
|
|
173
|
-
catch {
|
|
181
|
+
catch (error) {
|
|
182
|
+
if (options?.strict && errorCode(error) !== "ENOENT" && errorCode(error) !== "ENOTDIR")
|
|
183
|
+
lookupError ??= error;
|
|
174
184
|
// Not in this project directory.
|
|
175
185
|
}
|
|
176
186
|
}
|
|
187
|
+
if (lookupError)
|
|
188
|
+
throw lookupError;
|
|
177
189
|
return undefined;
|
|
178
190
|
}
|
|
191
|
+
/** Read the records once so the SDK projects the active branch and its compactions
|
|
192
|
+
* from the same bytes. An unfinished JSON line can be completed by the next poll. */
|
|
193
|
+
export async function readTranscriptEntries(file) {
|
|
194
|
+
const handle = await open(file, "r");
|
|
195
|
+
try {
|
|
196
|
+
return await readTranscriptEntriesOf(file, handle, (await handle.stat()).size);
|
|
197
|
+
}
|
|
198
|
+
finally {
|
|
199
|
+
await handle.close();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
export async function readTranscriptEntriesOf(file, handle, size) {
|
|
203
|
+
if (size === 0)
|
|
204
|
+
return [];
|
|
205
|
+
try {
|
|
206
|
+
const records = [];
|
|
207
|
+
for await (const line of handle.readLines({ start: 0, end: size - 1 })) {
|
|
208
|
+
try {
|
|
209
|
+
const record = JSON.parse(line);
|
|
210
|
+
if (record && typeof record.type === "string")
|
|
211
|
+
records.push(record);
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// Claude's transcript reader skips lines that do not parse.
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return records;
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
throw Object.assign(new Error(`Could not read ${file}`, { cause: error }), { path: file });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
179
223
|
/** The model of the last real assistant record and the last permission mode
|
|
180
224
|
* of the main thread in a JSONL transcript. */
|
|
181
225
|
async function lastTailRecords(filePath, withModel) {
|
package/dist/sdk-to-acp.js
CHANGED
|
@@ -324,7 +324,8 @@ export function toAcpNotifications(content, role, sessionId, toolUseCache, clien
|
|
|
324
324
|
// Resolve the server tool through the normal result path without rendering
|
|
325
325
|
// opaque ciphertext. Server tools have no later PostToolUse hook to await.
|
|
326
326
|
const result = chunk.content;
|
|
327
|
-
|
|
327
|
+
if (registerHooks)
|
|
328
|
+
unregisterHookCallback(chunk.tool_use_id);
|
|
328
329
|
output.push(...toAcpNotifications([
|
|
329
330
|
{
|
|
330
331
|
type: "tool_result",
|
|
@@ -349,7 +350,8 @@ export function toAcpNotifications(content, role, sessionId, toolUseCache, clien
|
|
|
349
350
|
case "mcp_tool_result": {
|
|
350
351
|
const wasEmitted = options?.emittedToolCalls?.has(chunk.tool_use_id) === true;
|
|
351
352
|
options?.emittedToolCalls?.delete(chunk.tool_use_id);
|
|
352
|
-
|
|
353
|
+
if (registerHooks)
|
|
354
|
+
completeHookCallback(chunk.tool_use_id);
|
|
353
355
|
finishedToolCallId = chunk.tool_use_id;
|
|
354
356
|
// Why this is_error result carries harness prose instead of tool
|
|
355
357
|
// output (user-rejected / interrupted / …), when the SDK said so.
|
|
@@ -95,7 +95,7 @@ export declare class LastReportedEntity {
|
|
|
95
95
|
sessionUpdate: string;
|
|
96
96
|
_meta?: unknown;
|
|
97
97
|
} & Record<string, unknown>;
|
|
98
|
-
}): void;
|
|
98
|
+
}, protocol?: 1 | 2): void;
|
|
99
99
|
/** The position after the last entity of the session, if the client holds one. */
|
|
100
100
|
after(sessionId: string): CursorAnchor | undefined;
|
|
101
101
|
/** The last entity of the session that the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
@@ -52,27 +52,33 @@ export class LastReportedEntity {
|
|
|
52
52
|
bySession = new Map();
|
|
53
53
|
/** Per session, in announcement order: the entity before each announced cursor. */
|
|
54
54
|
beforeCursor = new Map();
|
|
55
|
-
sending(notification) {
|
|
55
|
+
sending(notification, protocol = 1) {
|
|
56
56
|
const { sessionId, update } = notification;
|
|
57
57
|
const meta = update._meta;
|
|
58
58
|
if (meta?.claudeCode?.parentToolUseId)
|
|
59
59
|
return;
|
|
60
60
|
const messageId = typeof update.messageId === "string" ? update.messageId : undefined;
|
|
61
61
|
switch (update.sessionUpdate) {
|
|
62
|
+
case "user_message":
|
|
62
63
|
case "user_message_chunk":
|
|
63
64
|
if (messageId)
|
|
64
65
|
this.bySession.set(sessionId, { type: "user_message", messageId });
|
|
65
66
|
break;
|
|
67
|
+
case "agent_message":
|
|
66
68
|
case "agent_message_chunk":
|
|
67
69
|
if (messageId)
|
|
68
70
|
this.bySession.set(sessionId, { type: "agent_message", messageId });
|
|
69
71
|
break;
|
|
72
|
+
case "agent_thought":
|
|
70
73
|
case "agent_thought_chunk":
|
|
71
74
|
if (messageId)
|
|
72
75
|
this.bySession.set(sessionId, { type: "agent_thought", messageId });
|
|
73
76
|
break;
|
|
74
77
|
case "tool_call":
|
|
75
|
-
|
|
78
|
+
case "tool_call_update":
|
|
79
|
+
if ((update.sessionUpdate === "tool_call" ||
|
|
80
|
+
(protocol === 2 && typeof update.name === "string")) &&
|
|
81
|
+
typeof update.toolCallId === "string") {
|
|
76
82
|
this.bySession.set(sessionId, { type: "tool_call", toolCallId: update.toolCallId });
|
|
77
83
|
}
|
|
78
84
|
break;
|
|
@@ -135,8 +135,14 @@ export declare function scanTranscript({ head, tail }: HeadTail, options?: {
|
|
|
135
135
|
export declare function isSidechainTranscript(head: string): boolean;
|
|
136
136
|
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
|
137
137
|
export declare function customTitleSidecarPath(transcriptPath: string): string;
|
|
138
|
-
/** The title
|
|
139
|
-
|
|
138
|
+
/** The custom title that the SDK reads first: the tail's, else the CLI's
|
|
139
|
+
* sidecar's, read by `readSidecar`. */
|
|
140
|
+
export declare function readRecentCustomTitle(transcriptPath: string, headTail: HeadTail, readSidecar?: (transcriptPath: string) => Promise<string | undefined>): Promise<string | undefined>;
|
|
141
|
+
/** The title of the CLI's sidecar, if it has a readable title. A strict read
|
|
142
|
+
* throws when the sidecar exists but cannot be read. */
|
|
143
|
+
export declare function readSidecarTitle(transcriptPath: string, options?: {
|
|
144
|
+
strict: boolean;
|
|
145
|
+
}): Promise<string | undefined>;
|
|
140
146
|
/** The last agent name of a transcript, as AIR's native Claude provider
|
|
141
147
|
* reads it: the top-level `agentName` of any record, from the tail, else
|
|
142
148
|
* from the head. */
|
|
@@ -157,7 +163,9 @@ export type SdkTitles = {
|
|
|
157
163
|
*/
|
|
158
164
|
export declare function sdkTitles(headTail: HeadTail, sidecarTitle?: string): SdkTitles;
|
|
159
165
|
/** Reads the titles of this transcript copy without another SDK project lookup. */
|
|
160
|
-
export declare function readTranscriptTitles(transcriptPath: string, headTail: HeadTail
|
|
166
|
+
export declare function readTranscriptTitles(transcriptPath: string, headTail: HeadTail, options?: {
|
|
167
|
+
strict: boolean;
|
|
168
|
+
}): Promise<SdkTitles>;
|
|
161
169
|
/** The title of a transcript without a custom title, in the SDK's order: AI
|
|
162
170
|
* title, last prompt, summary, first prompt. The last prompt and the summary
|
|
163
171
|
* are the field of a record of any type. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript-scan.d.ts","sourceRoot":"","sources":["../../src/session-index/transcript-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"transcript-scan.d.ts","sourceRoot":"","sources":["../../src/session-index/transcript-scan.ts"],"names":[],"mappings":"A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;AAC7C,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAQ3E;AAED;6EAC6E;AAC7E,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB/F;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAsBrE;AAOD;0EAC0E;AAC1E,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA2BnE"}
|
|
@@ -15,6 +15,7 @@ import * as fs from "node:fs/promises";
|
|
|
15
15
|
import * as path from "node:path";
|
|
16
16
|
import { backgroundTasksOf } from "./background-tasks.js";
|
|
17
17
|
import { firstPrompt, isUserPrompt, mediaPrompt, promptOf } from "./first-prompt.js";
|
|
18
|
+
import { errorCode } from "./project-dirs.js";
|
|
18
19
|
const CHUNK_SIZE = 64 * 1024;
|
|
19
20
|
/** The largest tail window read to find the last message. */
|
|
20
21
|
const MAX_TAIL_SIZE = 4 * 1024 * 1024;
|
|
@@ -541,10 +542,25 @@ export function customTitleSidecarPath(transcriptPath) {
|
|
|
541
542
|
const sessionId = path.basename(transcriptPath, ".jsonl");
|
|
542
543
|
return path.join(path.dirname(transcriptPath), sessionId, "custom-title.json");
|
|
543
544
|
}
|
|
544
|
-
/** The title
|
|
545
|
-
|
|
545
|
+
/** The custom title that the SDK reads first: the tail's, else the CLI's
|
|
546
|
+
* sidecar's, read by `readSidecar`. */
|
|
547
|
+
export async function readRecentCustomTitle(transcriptPath, headTail, readSidecar = readSidecarTitle) {
|
|
548
|
+
return tailCustomTitle(headTail) ?? (await readSidecar(transcriptPath));
|
|
549
|
+
}
|
|
550
|
+
/** The title of the CLI's sidecar, if it has a readable title. A strict read
|
|
551
|
+
* throws when the sidecar exists but cannot be read. */
|
|
552
|
+
export async function readSidecarTitle(transcriptPath, options) {
|
|
553
|
+
const file = customTitleSidecarPath(transcriptPath);
|
|
554
|
+
let text;
|
|
555
|
+
try {
|
|
556
|
+
text = await fs.readFile(file, "utf8");
|
|
557
|
+
}
|
|
558
|
+
catch (error) {
|
|
559
|
+
if (options?.strict && errorCode(error) !== "ENOENT")
|
|
560
|
+
throw error;
|
|
561
|
+
return undefined;
|
|
562
|
+
}
|
|
546
563
|
try {
|
|
547
|
-
const text = await fs.readFile(customTitleSidecarPath(transcriptPath), "utf8");
|
|
548
564
|
const title = JSON.parse(text).customTitle;
|
|
549
565
|
return typeof title === "string" && title.trim() ? title : undefined;
|
|
550
566
|
}
|
|
@@ -592,11 +608,11 @@ export function sdkTitles(headTail, sidecarTitle) {
|
|
|
592
608
|
return { customTitle, summary: customTitle ?? generatedTitle({ head, tail }) };
|
|
593
609
|
}
|
|
594
610
|
/** Reads the titles of this transcript copy without another SDK project lookup. */
|
|
595
|
-
export async function readTranscriptTitles(transcriptPath, headTail) {
|
|
611
|
+
export async function readTranscriptTitles(transcriptPath, headTail, options) {
|
|
596
612
|
const customTitle = tailCustomTitle(headTail);
|
|
597
613
|
if (customTitle !== undefined)
|
|
598
614
|
return { customTitle, summary: customTitle };
|
|
599
|
-
return sdkTitles(headTail, await readSidecarTitle(transcriptPath));
|
|
615
|
+
return sdkTitles(headTail, await readSidecarTitle(transcriptPath, options));
|
|
600
616
|
}
|
|
601
617
|
/** The title of a transcript without a custom title, in the SDK's order: AI
|
|
602
618
|
* title, last prompt, summary, first prompt. The last prompt and the summary
|
package/dist/session-mode.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SessionConfigOption, type SessionModeState, type SessionNotification, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk/unstable";
|
|
2
|
-
import type { ModelInfo, PermissionMode, PermissionResult, Query } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
import type { ModelInfo, PermissionMode, PermissionResult, Query, Settings } from "@anthropic-ai/claude-agent-sdk";
|
|
3
3
|
export declare const MODE_CONFIG_ID = "mode";
|
|
4
4
|
export declare const AUTO_MODE_FALLBACK: PermissionMode;
|
|
5
5
|
export type SessionMode = {
|
|
@@ -45,9 +45,19 @@ type InitializeSessionModeParams = ModeAvailability & {
|
|
|
45
45
|
requestedMode: PermissionMode;
|
|
46
46
|
/** The mode is the built-in default: no request, transcript or setting chose it. */
|
|
47
47
|
builtInDefault?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The mode the query was started in, when `requestedMode` was decided after
|
|
50
|
+
* that (see {@link startModeUnderPolicy}). Without it, `requestedMode`.
|
|
51
|
+
*/
|
|
52
|
+
startedIn?: PermissionMode;
|
|
48
53
|
currentModelInfo?: ModelInfo;
|
|
49
54
|
currentModelId: string;
|
|
50
55
|
};
|
|
56
|
+
/** The modes a session offers and the mode it starts in. */
|
|
57
|
+
export type StartMode = ModeAvailability & {
|
|
58
|
+
mode: PermissionMode;
|
|
59
|
+
builtInDefault: boolean;
|
|
60
|
+
};
|
|
51
61
|
/**
|
|
52
62
|
* The permission mode a new Claude query starts in.
|
|
53
63
|
*
|
|
@@ -72,11 +82,30 @@ export declare function resolveInitialPermissionMode(sources: {
|
|
|
72
82
|
mode: PermissionMode;
|
|
73
83
|
builtInDefault: boolean;
|
|
74
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* The start mode of a query that already runs in `started.mode`, decided
|
|
87
|
+
* again under settings that include the policy Claude Code reported after it
|
|
88
|
+
* started (see `SettingsManager.followCliPolicy`). That policy can turn off
|
|
89
|
+
* a mode that the query was started with, or name another
|
|
90
|
+
* `permissions.defaultMode`. A mode that was off at the start stays off: the
|
|
91
|
+
* SDK's bypass flag was set then. `started` itself when the policy changes
|
|
92
|
+
* none of these. `SessionModeManager.initialize` sets another mode on the
|
|
93
|
+
* query (`startedIn`).
|
|
94
|
+
*/
|
|
95
|
+
export declare function startModeUnderPolicy(started: StartMode, sources: {
|
|
96
|
+
explicit?: PermissionMode;
|
|
97
|
+
resumed?: string;
|
|
98
|
+
}, settings: {
|
|
99
|
+
atStart: Settings;
|
|
100
|
+
withPolicy: Settings;
|
|
101
|
+
}, logger: {
|
|
102
|
+
error: (...args: unknown[]) => void;
|
|
103
|
+
}): StartMode;
|
|
75
104
|
/** Owns session-mode policy and the ACP/SDK synchronization it requires. */
|
|
76
105
|
export declare class SessionModeManager<S extends SessionMode> {
|
|
77
106
|
private readonly options;
|
|
78
107
|
constructor(options: SessionModeManagerOptions<S>);
|
|
79
|
-
initialize({ query, requestedMode, builtInDefault, currentModelInfo, currentModelId, allowBypass, allowAuto, }: InitializeSessionModeParams): Promise<{
|
|
108
|
+
initialize({ query, requestedMode, builtInDefault, startedIn, currentModelInfo, currentModelId, allowBypass, allowAuto, }: InitializeSessionModeParams): Promise<{
|
|
80
109
|
modes: SessionModeState;
|
|
81
110
|
autoModeFallbackWarningPending: boolean;
|
|
82
111
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-mode.d.ts","sourceRoot":"","sources":["../src/session-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,KAAK,
|
|
1
|
+
{"version":3,"file":"session-mode.d.ts","sourceRoot":"","sources":["../src/session-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACT,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1B,8FAA8F;IAC9F,OAAO,CAAC,SAAS;IAgBX,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAS9E,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpE;;;;;;;;;;;;;;;;OAgBG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAchF,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBpF;;;;;OAKG;IACH,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAI1C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlF,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,SAAS;IAcjB;;;OAGG;YACW,WAAW;CAa1B;AAED,wBAAgB,mBAAmB,CACjC,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,EAC5C,GAAG,UAAQ,GACV,gBAAgB,CAAC,gBAAgB,CAAC,CA2CpC"}
|
package/dist/session-mode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RequestError, } from "@agentclientprotocol/sdk/unstable";
|
|
2
2
|
import { AIR_KIND_KEY, airOnlyMeta } from "./air-extension.js";
|
|
3
|
-
import { resolvePermissionMode } from "./permissions/modes.js";
|
|
3
|
+
import { autoModeDisabled, resolvePermissionMode } from "./permissions/modes.js";
|
|
4
4
|
import { noticeOrTranscriptUpdate, noticeTranscriptText, sentenceCase, } from "./session-notices.js";
|
|
5
5
|
export const MODE_CONFIG_ID = "mode";
|
|
6
6
|
export const AUTO_MODE_FALLBACK = "acceptEdits";
|
|
@@ -54,13 +54,39 @@ export function resolveInitialPermissionMode(sources, logger, availability) {
|
|
|
54
54
|
}
|
|
55
55
|
return { mode: configuredMode, builtInDefault: false };
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* The start mode of a query that already runs in `started.mode`, decided
|
|
59
|
+
* again under settings that include the policy Claude Code reported after it
|
|
60
|
+
* started (see `SettingsManager.followCliPolicy`). That policy can turn off
|
|
61
|
+
* a mode that the query was started with, or name another
|
|
62
|
+
* `permissions.defaultMode`. A mode that was off at the start stays off: the
|
|
63
|
+
* SDK's bypass flag was set then. `started` itself when the policy changes
|
|
64
|
+
* none of these. `SessionModeManager.initialize` sets another mode on the
|
|
65
|
+
* query (`startedIn`).
|
|
66
|
+
*/
|
|
67
|
+
export function startModeUnderPolicy(started, sources, settings, logger) {
|
|
68
|
+
const { atStart, withPolicy } = settings;
|
|
69
|
+
const availability = {
|
|
70
|
+
allowBypass: started.allowBypass && withPolicy.permissions?.disableBypassPermissionsMode !== "disable",
|
|
71
|
+
allowAuto: started.allowAuto && !autoModeDisabled(withPolicy),
|
|
72
|
+
};
|
|
73
|
+
if (availability.allowBypass === started.allowBypass &&
|
|
74
|
+
availability.allowAuto === started.allowAuto &&
|
|
75
|
+
withPolicy.permissions?.defaultMode === atStart.permissions?.defaultMode) {
|
|
76
|
+
return started;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
...availability,
|
|
80
|
+
...resolveInitialPermissionMode({ ...sources, defaultMode: withPolicy.permissions?.defaultMode }, logger, availability),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
57
83
|
/** Owns session-mode policy and the ACP/SDK synchronization it requires. */
|
|
58
84
|
export class SessionModeManager {
|
|
59
85
|
options;
|
|
60
86
|
constructor(options) {
|
|
61
87
|
this.options = options;
|
|
62
88
|
}
|
|
63
|
-
async initialize({ query, requestedMode, builtInDefault = false, currentModelInfo, currentModelId, allowBypass, allowAuto, }) {
|
|
89
|
+
async initialize({ query, requestedMode, builtInDefault = false, startedIn = requestedMode, currentModelInfo, currentModelId, allowBypass, allowAuto, }) {
|
|
64
90
|
const availableModes = buildAvailableModes({ allowBypass, allowAuto }, this.options.airClient?.() ?? false);
|
|
65
91
|
let effectiveMode = requestedMode;
|
|
66
92
|
let autoModeFallbackWarningPending = false;
|
|
@@ -70,19 +96,23 @@ export class SessionModeManager {
|
|
|
70
96
|
if (!this.isAvailable(availableModes, effectiveMode)) {
|
|
71
97
|
this.options.logError(`permissions.defaultMode "${effectiveMode}" is not available in ` +
|
|
72
98
|
`this session; falling back to "default".`);
|
|
73
|
-
effectiveMode =
|
|
99
|
+
effectiveMode = "default";
|
|
74
100
|
}
|
|
75
101
|
else if (autoUnsupported && builtInDefault) {
|
|
76
102
|
// Like Claude Code: a built-in Auto default the model can't serve starts
|
|
77
103
|
// in Manual, without a warning. Nobody chose Auto, so don't escalate to
|
|
78
104
|
// acceptEdits.
|
|
79
|
-
effectiveMode =
|
|
105
|
+
effectiveMode = "default";
|
|
80
106
|
}
|
|
81
107
|
else if (autoUnsupported) {
|
|
82
108
|
this.options.logError(`permissions.defaultMode "auto" is not available for model ` +
|
|
83
109
|
`"${currentModelId}"; falling back to "${AUTO_MODE_FALLBACK}".`);
|
|
84
110
|
autoModeFallbackWarningPending = true;
|
|
85
|
-
effectiveMode =
|
|
111
|
+
effectiveMode = AUTO_MODE_FALLBACK;
|
|
112
|
+
}
|
|
113
|
+
// The query runs in `startedIn`: another mode is set on it.
|
|
114
|
+
if (effectiveMode !== startedIn) {
|
|
115
|
+
effectiveMode = await this.trySyncMode(query, availableModes, effectiveMode, "Failed to sync permissionMode to SDK:");
|
|
86
116
|
}
|
|
87
117
|
return {
|
|
88
118
|
modes: { currentModeId: effectiveMode, availableModes },
|
package/dist/session-model.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SessionConfigOption } from "@agentclientprotocol/sdk/unstable";
|
|
2
2
|
import { type ModelInfo, type Query, type Settings } from "@anthropic-ai/claude-agent-sdk";
|
|
3
|
+
import type { QuerySettings } from "./query-settings.js";
|
|
3
4
|
export declare const MODEL_CONFIG_ID = "model";
|
|
4
5
|
export type SessionModelState = {
|
|
5
6
|
availableModels: Array<{
|
|
@@ -142,7 +143,9 @@ export declare function withCurrentModelInfo(allowedModels: ModelInfo[], sdkMode
|
|
|
142
143
|
currentModelInfo: ModelInfo | undefined;
|
|
143
144
|
modelInfos: ModelInfo[];
|
|
144
145
|
};
|
|
145
|
-
export declare function getAvailableModels(query: Query, models: ModelInfo[], sdkModels: ModelInfo[], settingsManager: ModelSettingsSource, logger: ModelLogger, isResumedSession: boolean, sessionId: string, resumedModelHint?: string, narrowedByGateway?: boolean
|
|
146
|
+
export declare function getAvailableModels(query: Query, models: ModelInfo[], sdkModels: ModelInfo[], settingsManager: ModelSettingsSource, logger: ModelLogger, isResumedSession: boolean, sessionId: string, resumedModelHint?: string, narrowedByGateway?: boolean,
|
|
147
|
+
/** Claude Code's `get_settings` answer for this query, read after `initialize`. */
|
|
148
|
+
cliSettings?: QuerySettings): Promise<SessionModelState>;
|
|
146
149
|
/** The display name of the model id `model` in `modelInfos`, if it is there. */
|
|
147
150
|
export declare function modelDisplayName(modelInfos: ModelInfo[], model: string): string | undefined;
|
|
148
151
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-model.d.ts","sourceRoot":"","sources":["../src/session-model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"session-model.d.ts","sourceRoot":"","sources":["../src/session-model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAEL,K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