@agentclientprotocol/claude-agent-acp 0.113.1-preview.6 → 0.113.1-preview.7
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/session-index/service.d.ts.map +1 -1
- package/dist/session-index/service.js +9 -17
- package/dist/session-index/session-index.d.ts +1 -13
- package/dist/session-index/session-index.d.ts.map +1 -1
- package/dist/session-index/session-index.js +3 -29
- package/dist/session-index/transcript-scan.d.ts +7 -4
- package/dist/session-index/transcript-scan.d.ts.map +1 -1
- package/dist/session-index/transcript-scan.js +28 -3
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/session-index/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/session-index/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CA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tE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,4EAA4E;IAC5E,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAInD;sDACkD;IAClD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIpC,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -19,8 +19,8 @@ import { ForkHolds, ListSubscriptions, } from "./list-subscriptions.js";
|
|
|
19
19
|
import { LiveSessionRegistry } from "./live-registry.js";
|
|
20
20
|
import { isSessionId } from "../paths.js";
|
|
21
21
|
import { canonicalPath, exists, isExactProjectDir, projectDirMatches, sameProjectPath, } from "./project-dirs.js";
|
|
22
|
-
import { readHeadTail, readHeadTailOf,
|
|
23
|
-
import { DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT, ARCHIVED_FILTERS,
|
|
22
|
+
import { customTitleSidecarPath, readHeadTail, readHeadTailOf, readSidecarTitle, readTranscriptTitles, transcriptAgentName, transcriptProjectCwd, } from "./transcript-scan.js";
|
|
23
|
+
import { DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT, ARCHIVED_FILTERS, SessionIndex, } from "./session-index.js";
|
|
24
24
|
import { sessionInfoOf } from "./session-info.js";
|
|
25
25
|
export const SESSION_RENAME_METHOD = "_session/rename";
|
|
26
26
|
export const SESSION_ARCHIVE_METHOD = "_session/archive";
|
|
@@ -129,17 +129,12 @@ export function decodeListCursor(cursor, scope) {
|
|
|
129
129
|
}
|
|
130
130
|
return { orderAtMs: payload.u, sessionId: payload.id };
|
|
131
131
|
}
|
|
132
|
-
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
|
133
|
-
function sidecarPath(transcriptPath) {
|
|
134
|
-
const sessionId = path.basename(transcriptPath, ".jsonl");
|
|
135
|
-
return path.join(path.dirname(transcriptPath), sessionId, "custom-title.json");
|
|
136
|
-
}
|
|
137
132
|
/** Writes `<projectDir>/<sessionId>/custom-title.json` the way the CLI's
|
|
138
133
|
* `/rename` does: file 0600 in a 0700 directory, replaced atomically. The
|
|
139
134
|
* temporary file has a random name of the CLI's `custom-title.json.tmp.*`
|
|
140
135
|
* pattern, and only a temporary file this call created is removed. */
|
|
141
136
|
export async function writeCustomTitleSidecar(transcriptPath, title) {
|
|
142
|
-
const target =
|
|
137
|
+
const target = customTitleSidecarPath(transcriptPath);
|
|
143
138
|
await fs.mkdir(path.dirname(target), { recursive: true, mode: 0o700 });
|
|
144
139
|
const temporary = `${target}.tmp.${randomBytes(8).toString("hex")}`;
|
|
145
140
|
const handle = await fs.open(temporary, "wx", 0o600);
|
|
@@ -213,13 +208,10 @@ async function ensureAgentName(filePath, sessionId, title) {
|
|
|
213
208
|
* {@link effectiveTitle}): its agent name, else the title the SDK reports.
|
|
214
209
|
* It carries the archive prefix only when the copy is archived: a generated
|
|
215
210
|
* title never archives a session. */
|
|
216
|
-
async function copyTitle(filePath
|
|
211
|
+
async function copyTitle(filePath) {
|
|
217
212
|
const { size } = await fs.stat(filePath);
|
|
218
213
|
const headTail = await readHeadTail(filePath, size);
|
|
219
|
-
const
|
|
220
|
-
? await readSidecarTitle(filePath, sessionId)
|
|
221
|
-
: undefined;
|
|
222
|
-
const { title, archived } = effectiveTitle(transcriptAgentName(headTail), sdkTitles(headTail, sidecar));
|
|
214
|
+
const { title, archived } = effectiveTitle(transcriptAgentName(headTail), await readTranscriptTitles(filePath, headTail));
|
|
223
215
|
return title !== undefined && !archived && isArchivedTitle(title) ? visibleTitle(title) : title;
|
|
224
216
|
}
|
|
225
217
|
/** Rewrites the sidecar of a copy whose title is `current` when the
|
|
@@ -228,7 +220,7 @@ async function copyTitle(filePath, sessionId) {
|
|
|
228
220
|
async function alignSidecar(transcript, current, sessionId) {
|
|
229
221
|
if (current === undefined)
|
|
230
222
|
return;
|
|
231
|
-
const sidecar = await readSidecarTitle(transcript
|
|
223
|
+
const sidecar = await readSidecarTitle(transcript);
|
|
232
224
|
if (sidecar === undefined || isArchivedTitle(sidecar) === isArchivedTitle(current))
|
|
233
225
|
return;
|
|
234
226
|
await writeCustomTitleSidecar(transcript, storedTitle(current, isArchivedTitle(current), sessionId));
|
|
@@ -451,7 +443,7 @@ export class SessionIndexService {
|
|
|
451
443
|
// The transcript holds the current title, also one changed otherwise
|
|
452
444
|
// (a `/rename`); without one, the title last given to the CLI.
|
|
453
445
|
const primary = cli ?? others[0];
|
|
454
|
-
const read = primary ? await copyTitle(primary
|
|
446
|
+
const read = primary ? await copyTitle(primary) : undefined;
|
|
455
447
|
const current = read ?? live.stored() ?? live.shown;
|
|
456
448
|
stored = change(current, sessionId);
|
|
457
449
|
if (stored !== undefined) {
|
|
@@ -496,7 +488,7 @@ export class SessionIndexService {
|
|
|
496
488
|
async titleCopies(sessionId, transcripts, change, sidecar) {
|
|
497
489
|
let first;
|
|
498
490
|
for (const transcript of transcripts) {
|
|
499
|
-
const current = await copyTitle(transcript
|
|
491
|
+
const current = await copyTitle(transcript);
|
|
500
492
|
const title = change(current, sessionId);
|
|
501
493
|
if (title === undefined) {
|
|
502
494
|
await alignSidecar(transcript, current, sessionId);
|
|
@@ -504,7 +496,7 @@ export class SessionIndexService {
|
|
|
504
496
|
}
|
|
505
497
|
await ensureTitleRecords(transcript, sessionId, title);
|
|
506
498
|
first ??= title;
|
|
507
|
-
if (sidecar === "always" || (await exists(
|
|
499
|
+
if (sidecar === "always" || (await exists(customTitleSidecarPath(transcript)))) {
|
|
508
500
|
await writeCustomTitleSidecar(transcript, title);
|
|
509
501
|
}
|
|
510
502
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `stat` per transcript. The pages after a cursor reuse that enumeration for
|
|
7
7
|
* a short while (see {@link SessionIndex.reusableListing}). The metadata of a transcript is
|
|
8
8
|
* cached by `(path, mtime, size)` in an LRU and read on a miss from one head
|
|
9
|
-
* and tail read (the titles by the SDK's rule, see {@link
|
|
9
|
+
* and tail read (the titles by the SDK's rule, see {@link readTranscriptTitles}; the
|
|
10
10
|
* facts, see {@link scanTranscriptFile}) and the title sidecar. Misses are
|
|
11
11
|
* read in parallel batches.
|
|
12
12
|
*
|
|
@@ -73,8 +73,6 @@ export type ListQuery = {
|
|
|
73
73
|
archived: ArchivedFilter;
|
|
74
74
|
after?: ListCursor;
|
|
75
75
|
};
|
|
76
|
-
/** The title of the CLI's `custom-title.json` sidecar of a transcript. */
|
|
77
|
-
export declare function readSidecarTitle(filePath: string, sessionId: string): Promise<string | undefined>;
|
|
78
76
|
export type SessionIndexOptions = {
|
|
79
77
|
/** Whether a live process holds the session. Only for such a session the
|
|
80
78
|
* whole transcript is searched for its background tasks. */
|
|
@@ -235,16 +233,6 @@ export declare class SessionIndex {
|
|
|
235
233
|
* then the whole transcript is read.
|
|
236
234
|
*/
|
|
237
235
|
private withAllBackgroundTasks;
|
|
238
|
-
/**
|
|
239
|
-
* The titles the SDK gives the listed transcript (`customTitle` and
|
|
240
|
-
* `summary` of its `getSessionInfo`), by the SDK's rule from the head and
|
|
241
|
-
* tail read here and the sidecar (see {@link sdkTitles}). Not through the
|
|
242
|
-
* SDK itself: its lookup of the transcript reads the whole project
|
|
243
|
-
* directory on every call, which made each page of a large project cost a
|
|
244
|
-
* listing of every transcript per row, and it may read another copy of the
|
|
245
|
-
* session than the listed one.
|
|
246
|
-
*/
|
|
247
|
-
private titlesOf;
|
|
248
236
|
/** Whether a successor of a continued transcript holds history: the SDK
|
|
249
237
|
* list then hides the predecessor. */
|
|
250
238
|
private continuedElsewhere;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-index.d.ts","sourceRoot":"","sources":["../../src/session-index/session-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAmBH,OAAO,
|
|
1
|
+
{"version":3,"file":"session-index.d.ts","sourceRoot":"","sources":["../../src/session-index/session-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAmBH,OAAO,EAYL,KAAK,eAAe,EACrB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AAE,EAC1C,QAAQ,EAAE,MAAM,SAAS,mBAAmB,EAAE,GAC7C,OAAO,CAAC,QAAQ,EAAE,CAAC;IAStB;;;;;;;;OAQG;IACG,YAAY,CAChB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,UAAU,EAAE,SAAS,mBAAmB,EAAE,EAC1C,EAAE,IAAW,EAAE,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAO,GACvC,OAAO,CAAC;QAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IAkCtD;;;;;;;;;;;;OAYG;YACW,WAAW;IAqGzB;iCAC6B;IAC7B,OAAO,CAAC,YAAY;IAkBpB;;;uDAGmD;YACrC,YAAY;IAyC1B,iEAAiE;IACjE,OAAO,CAAC,WAAW;YAaL,UAAU;YAwBV,YAAY;YA2BZ,YAAY;IAgD1B;;;;;OAKG;YACW,sBAAsB;IAYpC;2CACuC;YACzB,kBAAkB;IAKhC;;yDAEqD;YACvC,UAAU;CAazB"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `stat` per transcript. The pages after a cursor reuse that enumeration for
|
|
7
7
|
* a short while (see {@link SessionIndex.reusableListing}). The metadata of a transcript is
|
|
8
8
|
* cached by `(path, mtime, size)` in an LRU and read on a miss from one head
|
|
9
|
-
* and tail read (the titles by the SDK's rule, see {@link
|
|
9
|
+
* and tail read (the titles by the SDK's rule, see {@link readTranscriptTitles}; the
|
|
10
10
|
* facts, see {@link scanTranscriptFile}) and the title sidecar. Misses are
|
|
11
11
|
* read in parallel batches.
|
|
12
12
|
*
|
|
@@ -24,7 +24,7 @@ import { sanitizeTitle } from "../session-titles.js";
|
|
|
24
24
|
import { effectiveTitle, visibleTitle } from "./archive-title.js";
|
|
25
25
|
import { isSessionId, projectsRoot } from "../paths.js";
|
|
26
26
|
import { canonicalPath, encodeProjectPath, errorCode, exists, isExactProjectDir, normalizePath, pathAndAncestors, projectDirMatches, projectDirsOf, sameProjectPath, } from "./project-dirs.js";
|
|
27
|
-
import { continuedInSessionId, hasHistory, isSidechainTranscript, lastTimestamp, readHeadTail, relocatedCwd, scanTranscriptFile,
|
|
27
|
+
import { continuedInSessionId, hasHistory, isSidechainTranscript, lastTimestamp, readHeadTail, readTranscriptTitles, relocatedCwd, scanTranscriptFile, transcriptAgentName, transcriptProjectCwd, } from "./transcript-scan.js";
|
|
28
28
|
import { searchBackgroundTasks } from "./background-tasks.js";
|
|
29
29
|
import { DirListings, statFiles } from "./dir-listing.js";
|
|
30
30
|
import { isInLinkedWorktree, worktreeCounterparts } from "./worktrees.js";
|
|
@@ -168,17 +168,6 @@ function byMtimeDescending(a, b) {
|
|
|
168
168
|
return b.mtimeMs - a.mtimeMs;
|
|
169
169
|
return a.sessionId < b.sessionId ? -1 : a.sessionId > b.sessionId ? 1 : 0;
|
|
170
170
|
}
|
|
171
|
-
/** The title of the CLI's `custom-title.json` sidecar of a transcript. */
|
|
172
|
-
export async function readSidecarTitle(filePath, sessionId) {
|
|
173
|
-
try {
|
|
174
|
-
const text = await fs.readFile(path.join(path.dirname(filePath), sessionId, "custom-title.json"), "utf8");
|
|
175
|
-
const title = JSON.parse(text).customTitle;
|
|
176
|
-
return typeof title === "string" && title.trim() ? title : undefined;
|
|
177
|
-
}
|
|
178
|
-
catch {
|
|
179
|
-
return undefined;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
171
|
/**
|
|
183
172
|
* On macOS the SDK opens `<projects>/<encoded cwd>` through the file system,
|
|
184
173
|
* which ignores case on the usual volumes: a directory whose name differs in
|
|
@@ -876,7 +865,7 @@ export class SessionIndex {
|
|
|
876
865
|
]);
|
|
877
866
|
if (fileCwd)
|
|
878
867
|
this.dirCwds.set(candidate.dirName, fileCwd);
|
|
879
|
-
const sdk = await
|
|
868
|
+
const sdk = await readTranscriptTitles(candidate.filePath, headTail);
|
|
880
869
|
// No title at all: the SDK does not list it either.
|
|
881
870
|
if (!sdk.summary)
|
|
882
871
|
return null;
|
|
@@ -916,21 +905,6 @@ export class SessionIndex {
|
|
|
916
905
|
const backgroundTasks = await searchBackgroundTasks(candidate.filePath, candidate.size);
|
|
917
906
|
return { ...facts, backgroundTasks };
|
|
918
907
|
}
|
|
919
|
-
/**
|
|
920
|
-
* The titles the SDK gives the listed transcript (`customTitle` and
|
|
921
|
-
* `summary` of its `getSessionInfo`), by the SDK's rule from the head and
|
|
922
|
-
* tail read here and the sidecar (see {@link sdkTitles}). Not through the
|
|
923
|
-
* SDK itself: its lookup of the transcript reads the whole project
|
|
924
|
-
* directory on every call, which made each page of a large project cost a
|
|
925
|
-
* listing of every transcript per row, and it may read another copy of the
|
|
926
|
-
* session than the listed one.
|
|
927
|
-
*/
|
|
928
|
-
async titlesOf(candidate, headTail) {
|
|
929
|
-
const sidecar = tailCustomTitle(headTail) === undefined
|
|
930
|
-
? await readSidecarTitle(candidate.filePath, candidate.sessionId)
|
|
931
|
-
: undefined;
|
|
932
|
-
return sdkTitles(headTail, sidecar);
|
|
933
|
-
}
|
|
934
908
|
/** Whether a successor of a continued transcript holds history: the SDK
|
|
935
909
|
* list then hides the predecessor. */
|
|
936
910
|
async continuedElsewhere(candidate, metadata) {
|
|
@@ -133,9 +133,10 @@ export declare function scanTranscript({ head, tail }: HeadTail, options?: {
|
|
|
133
133
|
/** Whether the first record of the transcript is a sidechain one, which the
|
|
134
134
|
* SDK never lists. */
|
|
135
135
|
export declare function isSidechainTranscript(head: string): boolean;
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
|
137
|
+
export declare function customTitleSidecarPath(transcriptPath: string): string;
|
|
138
|
+
/** The title of the CLI's sidecar, if it has a readable title. */
|
|
139
|
+
export declare function readSidecarTitle(transcriptPath: string): Promise<string | undefined>;
|
|
139
140
|
/** The last agent name of a transcript, as AIR's native Claude provider
|
|
140
141
|
* reads it: the top-level `agentName` of any record, from the tail, else
|
|
141
142
|
* from the head. */
|
|
@@ -154,7 +155,9 @@ export type SdkTitles = {
|
|
|
154
155
|
* file, without its lookup of the file. The sidecar title counts only when
|
|
155
156
|
* the tail has no custom title.
|
|
156
157
|
*/
|
|
157
|
-
export declare function sdkTitles(
|
|
158
|
+
export declare function sdkTitles(headTail: HeadTail, sidecarTitle?: string): SdkTitles;
|
|
159
|
+
/** Reads the titles of this transcript copy without another SDK project lookup. */
|
|
160
|
+
export declare function readTranscriptTitles(transcriptPath: string, headTail: HeadTail): Promise<SdkTitles>;
|
|
158
161
|
/** The title of a transcript without a custom title, in the SDK's order: AI
|
|
159
162
|
* title, last prompt, summary, first prompt. The last prompt and the summary
|
|
160
163
|
* 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;
|
|
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;AAchF,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;0BACsB;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;8EAC0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,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AED,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG;IACtB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAU9E;AAED,mFAAmF;AACnF,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,SAAS,CAAC,CAIpB;AAED;;6CAE6C;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"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* earlier scan (see `background-tasks.ts`).
|
|
13
13
|
*/
|
|
14
14
|
import * as fs from "node:fs/promises";
|
|
15
|
+
import * as path from "node:path";
|
|
15
16
|
import { backgroundTasksOf } from "./background-tasks.js";
|
|
16
17
|
import { firstPrompt, isUserPrompt, mediaPrompt, promptOf } from "./first-prompt.js";
|
|
17
18
|
const CHUNK_SIZE = 64 * 1024;
|
|
@@ -532,9 +533,25 @@ export function isSidechainTranscript(head) {
|
|
|
532
533
|
}
|
|
533
534
|
/** The title of the last `custom-title` record of the tail, as the SDK reads
|
|
534
535
|
* it (see {@link lastRecordField}). */
|
|
535
|
-
|
|
536
|
+
function tailCustomTitle({ tail, sdkTail }) {
|
|
536
537
|
return lastRecordField(sdkTail ?? tail, "customTitle", "custom-title");
|
|
537
538
|
}
|
|
539
|
+
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
|
540
|
+
export function customTitleSidecarPath(transcriptPath) {
|
|
541
|
+
const sessionId = path.basename(transcriptPath, ".jsonl");
|
|
542
|
+
return path.join(path.dirname(transcriptPath), sessionId, "custom-title.json");
|
|
543
|
+
}
|
|
544
|
+
/** The title of the CLI's sidecar, if it has a readable title. */
|
|
545
|
+
export async function readSidecarTitle(transcriptPath) {
|
|
546
|
+
try {
|
|
547
|
+
const text = await fs.readFile(customTitleSidecarPath(transcriptPath), "utf8");
|
|
548
|
+
const title = JSON.parse(text).customTitle;
|
|
549
|
+
return typeof title === "string" && title.trim() ? title : undefined;
|
|
550
|
+
}
|
|
551
|
+
catch {
|
|
552
|
+
return undefined;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
538
555
|
/** The last non-blank top-level `agentName` of the records of `text`, the
|
|
539
556
|
* name `/rename`, a `rename_session` and AIR write with the custom title. */
|
|
540
557
|
function lastAgentName(text) {
|
|
@@ -564,15 +581,23 @@ export function transcriptAgentName({ head, tail }) {
|
|
|
564
581
|
* file, without its lookup of the file. The sidecar title counts only when
|
|
565
582
|
* the tail has no custom title.
|
|
566
583
|
*/
|
|
567
|
-
export function sdkTitles(
|
|
584
|
+
export function sdkTitles(headTail, sidecarTitle) {
|
|
585
|
+
const { head, tail: wholeLines, sdkTail } = headTail;
|
|
568
586
|
const tail = sdkTail ?? wholeLines;
|
|
569
|
-
const customTitle =
|
|
587
|
+
const customTitle = tailCustomTitle(headTail) ??
|
|
570
588
|
sidecarTitle ??
|
|
571
589
|
lastRecordField(head, "customTitle", "custom-title") ??
|
|
572
590
|
lastRecordField(tail, "aiTitle", "ai-title") ??
|
|
573
591
|
lastRecordField(head, "aiTitle", "ai-title");
|
|
574
592
|
return { customTitle, summary: customTitle ?? generatedTitle({ head, tail }) };
|
|
575
593
|
}
|
|
594
|
+
/** Reads the titles of this transcript copy without another SDK project lookup. */
|
|
595
|
+
export async function readTranscriptTitles(transcriptPath, headTail) {
|
|
596
|
+
const customTitle = tailCustomTitle(headTail);
|
|
597
|
+
if (customTitle !== undefined)
|
|
598
|
+
return { customTitle, summary: customTitle };
|
|
599
|
+
return sdkTitles(headTail, await readSidecarTitle(transcriptPath));
|
|
600
|
+
}
|
|
576
601
|
/** The title of a transcript without a custom title, in the SDK's order: AI
|
|
577
602
|
* title, last prompt, summary, first prompt. The last prompt and the summary
|
|
578
603
|
* are the field of a record of any type. */
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.113.1-preview.
|
|
6
|
+
"version": "0.113.1-preview.7",
|
|
7
7
|
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
|
8
8
|
"main": "dist/lib.js",
|
|
9
9
|
"types": "dist/lib.d.ts",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@typescript-eslint/parser": "8.74.0",
|
|
83
83
|
"ajv": "8.20.0",
|
|
84
84
|
"ajv-formats": "3.0.1",
|
|
85
|
-
"eslint": "10.
|
|
85
|
+
"eslint": "10.16.0",
|
|
86
86
|
"eslint-config-prettier": "10.1.9",
|
|
87
87
|
"globals": "17.14.0",
|
|
88
88
|
"prettier": "3.10.1",
|