@agentclientprotocol/claude-agent-acp 0.90.1-preview.14 → 0.90.1-preview.16

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.
@@ -34,6 +34,12 @@ export declare const AIR_SESSION_RENAME_CAPABILITY = "sessionRename";
34
34
  * {@link AIR_SESSION_INDEX_CAPABILITY} is; the client does not declare it.
35
35
  */
36
36
  export declare const AIR_SESSION_LIST_SUBSCRIBE_CAPABILITY = "sessionListSubscribe";
37
+ /**
38
+ * Session index rows carry `agentWorktree: true` when the session runs in a
39
+ * linked git worktree that Claude Code made for it. Advertised exactly when
40
+ * {@link AIR_SESSION_INDEX_CAPABILITY} is; the client does not declare it.
41
+ */
42
+ export declare const AIR_SESSION_WORKTREES_CAPABILITY = "sessionWorktrees";
37
43
  /** The `_meta.jetbrains.air` keys that the ACP tool call contract defines. */
38
44
  export declare const AIR_COMMAND_TITLE_KEY = "commandTitle";
39
45
  export declare const AIR_SUBAGENT_KEY = "subagent";
@@ -1 +1 @@
1
- {"version":3,"file":"air-extension.d.ts","sourceRoot":"","sources":["../src/air-extension.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,2BAA2B,CAAC;AAChF,eAAO,MAAM,0BAA0B,eAAe,CAAC;AACvD,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D,eAAO,MAAM,uCAAuC,qBAAqB,CAAC;AAC1E,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,yBAAyB,cAAc,CAAC;AACrD,4EAA4E;AAC5E,eAAO,MAAM,kCAAkC,sBAAsB,CAAC;AACtE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAC/D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,kBAAkB,CA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kB,eAAe,CAAC;AAC/C,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AACpD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAQ3E,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,GAAG,YAAY,EAAE,MAAM,EAAE,2BAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAChD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAErC;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAY9F;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIvE"}
@@ -34,6 +34,12 @@ export const AIR_SESSION_RENAME_CAPABILITY = "sessionRename";
34
34
  * {@link AIR_SESSION_INDEX_CAPABILITY} is; the client does not declare it.
35
35
  */
36
36
  export const AIR_SESSION_LIST_SUBSCRIBE_CAPABILITY = "sessionListSubscribe";
37
+ /**
38
+ * Session index rows carry `agentWorktree: true` when the session runs in a
39
+ * linked git worktree that Claude Code made for it. Advertised exactly when
40
+ * {@link AIR_SESSION_INDEX_CAPABILITY} is; the client does not declare it.
41
+ */
42
+ export const AIR_SESSION_WORKTREES_CAPABILITY = "sessionWorktrees";
37
43
  /** The `_meta.jetbrains.air` keys that the ACP tool call contract defines. */
38
44
  export const AIR_COMMAND_TITLE_KEY = "commandTitle";
39
45
  export const AIR_SUBAGENT_KEY = "subagent";
@@ -70,8 +70,8 @@ export declare class SessionIndexConnection {
70
70
  * every other client the title as stored. */
71
71
  clientTitle(title: string): string;
72
72
  /** The AIR capabilities the agent advertises for the index: the index
73
- * itself, archive, rename and the list subscription, all only to a client
74
- * that declared `sessionIndex`. */
73
+ * itself, archive, rename, the list subscription and the `agentWorktree`
74
+ * row field, all only to a client that declared `sessionIndex`. */
75
75
  capabilities(): string[];
76
76
  dispose(): void;
77
77
  /** The query of a session that ran here failed (not a cancel): its row
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/session-index/connection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAWlE,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAUL,mBAAmB,EACnB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EAEtB,MAAM,cAAc,CAAC;AAEtB,sDAAsD;AACtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;kEAC8D;IAC9D,eAAe,CAAC,EAA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O;IA8CrB;;;;;;;;;OASG;IACG,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAiBjF,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,cAAc;IAKtB,yEAAyE;IACzE,OAAO,CAAC,eAAe;IAgBvB;;wEAEoE;IACpE,OAAO,CAAC,kBAAkB;IAU1B;;;sCAGkC;YACpB,cAAc;CAc7B;AAED,oEAAoE;AACpE,KAAK,mBAAmB,GAAG;IACzB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACnF,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/E,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACzE,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACjE,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACpE,CAAC;AAEF;sEACsE;AACtE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,GAAG,QAAQ,CA2BhG"}
@@ -7,7 +7,7 @@
7
7
  * Wire contract: docs/air-extensions.md, "Session index".
8
8
  */
9
9
  import { RequestError, } from "@agentclientprotocol/sdk";
10
- import { AIR_SESSION_ARCHIVE_CAPABILITY, AIR_SESSION_INDEX_CAPABILITY, AIR_SESSION_LIST_SUBSCRIBE_CAPABILITY, AIR_SESSION_RENAME_CAPABILITY, clientSupportsAirCapability, withAirMeta, } from "../air-extension.js";
10
+ import { AIR_SESSION_ARCHIVE_CAPABILITY, AIR_SESSION_INDEX_CAPABILITY, AIR_SESSION_LIST_SUBSCRIBE_CAPABILITY, AIR_SESSION_RENAME_CAPABILITY, AIR_SESSION_WORKTREES_CAPABILITY, clientSupportsAirCapability, withAirMeta, } from "../air-extension.js";
11
11
  import { isArchivedTitle, storedTitle, visibleTitle } from "./archive-title.js";
12
12
  import { LIST_CHANGES_METHOD, LIST_SUBSCRIBE_METHOD, LIST_UNSUBSCRIBE_METHOD, parseListSubscribeRequest, parseListUnsubscribeRequest, } from "./list-subscriptions.js";
13
13
  import { archiveInsteadOfDelete, deleteSessionIfStored, archiveTo, renameTo, parseRenameSessionRequest, parseSessionIdRequest, SESSION_ARCHIVE_METHOD, SESSION_RENAME_METHOD, SESSION_UNARCHIVE_METHOD, SessionIndexService, } from "./service.js";
@@ -56,8 +56,8 @@ export class SessionIndexConnection {
56
56
  return this.host.isAirClient() && isArchivedTitle(title) ? visibleTitle(title) : title;
57
57
  }
58
58
  /** The AIR capabilities the agent advertises for the index: the index
59
- * itself, archive, rename and the list subscription, all only to a client
60
- * that declared `sessionIndex`. */
59
+ * itself, archive, rename, the list subscription and the `agentWorktree`
60
+ * row field, all only to a client that declared `sessionIndex`. */
61
61
  capabilities() {
62
62
  return this.service
63
63
  ? [
@@ -65,6 +65,7 @@ export class SessionIndexConnection {
65
65
  AIR_SESSION_ARCHIVE_CAPABILITY,
66
66
  AIR_SESSION_RENAME_CAPABILITY,
67
67
  AIR_SESSION_LIST_SUBSCRIBE_CAPABILITY,
68
+ AIR_SESSION_WORKTREES_CAPABILITY,
68
69
  ]
69
70
  : [];
70
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-subscriptions.d.ts","sourceRoot":"","sources":["../../src/session-index/list-subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAIL,KAAK,mBAAmB,EAEzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAiB,KA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ACgD;YAClC,YAAY;IAqC1B,OAAO,CAAC,aAAa;IAsBrB,mEAAmE;YACrD,WAAW;IAiDzB,OAAO,CAAC,QAAQ;IAOhB,2EAA2E;IAC3E,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,OAAO;IASf;yEACqE;YACvD,IAAI;YA8BJ,IAAI;IAsOlB;;yBAEqB;IACrB,OAAO,CAAC,eAAe;IAOvB;;;;;OAKG;YACW,SAAS;IAsCvB,oDAAoD;IACpD,OAAO,CAAC,OAAO;IASf;;;;;;;OAOG;YACW,WAAW;IAmBzB;;yCAEqC;IACrC,OAAO,CAAC,OAAO;IAkDf,wEAAwE;IACxE,OAAO,CAAC,cAAc;CAMvB"}
@@ -1115,7 +1115,10 @@ export class ListSubscriptions {
1115
1115
  }
1116
1116
  if (candidates.length === 0)
1117
1117
  return new Set();
1118
- const { rows, unknown } = await this.deps.index.cachedRowsOf(paths, candidates);
1118
+ // Only the ids count: no worktree check.
1119
+ const { rows, unknown } = await this.deps.index.cachedRowsOf(paths, candidates, {
1120
+ mark: false,
1121
+ });
1119
1122
  for (const row of rows)
1120
1123
  unknown.add(row.sessionId);
1121
1124
  return unknown;
@@ -52,6 +52,10 @@ export type IndexRow = {
52
52
  facts: TranscriptFacts;
53
53
  mtimeMs: number;
54
54
  archived: boolean;
55
+ /** The session runs in a linked git worktree that Claude Code made for
56
+ * it: its transcript says so (`facts.agentWorktree`) and `cwd` lies in
57
+ * a linked worktree. See {@link markAgentWorktrees}. */
58
+ agentWorktree?: true;
55
59
  };
56
60
  /** A keyset position: the order key and the session id of the last row. */
57
61
  export type ListCursor = {
@@ -171,9 +175,13 @@ export declare class SessionIndex {
171
175
  * alone gives, read from it at once, and the ids of the sessions it gives
172
176
  * no answer for: a transcript of it has nothing cached at its stat, no cwd
173
177
  * known, or is continued in another session (whether the successor hides
174
- * it depends on the successor now). Reads no transcript.
178
+ * it depends on the successor now). Reads no transcript. The rows carry
179
+ * `agentWorktree` ({@link markAgentWorktrees}, which reads git files)
180
+ * unless `mark` is false, for a caller that uses only their ids.
175
181
  */
176
- cachedRowsOf(paths: readonly string[], candidates: readonly TranscriptCandidate[]): Promise<{
182
+ cachedRowsOf(paths: readonly string[], candidates: readonly TranscriptCandidate[], { mark }?: {
183
+ mark?: boolean;
184
+ }): Promise<{
177
185
  rows: IndexRow[];
178
186
  unknown: Set<string>;
179
187
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"session-index.d.ts","sourceRoot":"","sources":["../../src/session-index/session-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAkBH,OAAO,EAeL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,cAAc,MAAM,CAAC;AAelC;;aAEa;AACb,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAAsC,CAAC;AAE7F,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEtF;AAED,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAmBF,MAAM,MAAM,QAAQ,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB;;4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;YACzB,kBAAkB;IAKhC;;yDAEqD;YACvC,UAAU;CAazB"}
@@ -25,7 +25,7 @@ import { effectiveTitle, visibleTitle } from "./archive-title.js";
25
25
  import { canonicalPath, encodeProjectPath, isExactProjectDir, isSessionId, normalizePath, pathAndAncestors, projectDirMatches, projectDirsOf, projectsRoot, sameProjectPath, } from "./project-dirs.js";
26
26
  import { continuedInSessionId, hasHistory, isSidechainTranscript, lastTimestamp, readHeadTail, relocatedCwd, scanTranscriptFile, sdkTitles, tailCustomTitle, transcriptAgentName, transcriptProjectCwd, } from "./transcript-scan.js";
27
27
  import { DirListings, statFiles } from "./dir-listing.js";
28
- import { worktreeCounterparts } from "./worktrees.js";
28
+ import { isInLinkedWorktree, worktreeCounterparts } from "./worktrees.js";
29
29
  export const DEFAULT_LIST_LIMIT = 50;
30
30
  export const MAX_LIST_LIMIT = 200;
31
31
  /** Entries of the metadata cache: a few hundred bytes each, so the
@@ -130,6 +130,19 @@ function toRow({ candidate, metadata }, cwd) {
130
130
  mtimeMs: candidate.mtimeMs,
131
131
  };
132
132
  }
133
+ /**
134
+ * Sets `agentWorktree` on the rows whose transcript says Claude Code made
135
+ * their worktree and whose cwd lies in a linked worktree now. Only those rows
136
+ * are checked; the check is not cached, so a removed worktree shows at once.
137
+ */
138
+ async function markAgentWorktrees(rows) {
139
+ await Promise.all(rows.map(async (row) => {
140
+ if (row.facts.agentWorktree === true && (await isInLinkedWorktree(row.cwd))) {
141
+ row.agentWorktree = true;
142
+ }
143
+ }));
144
+ return rows;
145
+ }
133
146
  function isAfter(row, cursor) {
134
147
  return compareRows(row, cursor) > 0;
135
148
  }
@@ -517,9 +530,11 @@ export class SessionIndex {
517
530
  * alone gives, read from it at once, and the ids of the sessions it gives
518
531
  * no answer for: a transcript of it has nothing cached at its stat, no cwd
519
532
  * known, or is continued in another session (whether the successor hides
520
- * it depends on the successor now). Reads no transcript.
533
+ * it depends on the successor now). Reads no transcript. The rows carry
534
+ * `agentWorktree` ({@link markAgentWorktrees}, which reads git files)
535
+ * unless `mark` is false, for a caller that uses only their ids.
521
536
  */
522
- async cachedRowsOf(paths, candidates) {
537
+ async cachedRowsOf(paths, candidates, { mark = true } = {}) {
523
538
  const unknown = new Set();
524
539
  const resolved = [];
525
540
  for (const candidate of candidates) {
@@ -552,7 +567,8 @@ export class SessionIndex {
552
567
  continue;
553
568
  newest.set(id, { row: toRow(item, cwd), mtimeMs: item.candidate.mtimeMs });
554
569
  }
555
- return { rows: [...newest.values()].map(({ row }) => row), unknown };
570
+ const rows = [...newest.values()].map(({ row }) => row);
571
+ return { rows: mark ? await markAgentWorktrees(rows) : rows, unknown };
556
572
  }
557
573
  /**
558
574
  * Reads `candidates` in order into rows, one per session, sorted. A
@@ -645,7 +661,7 @@ export class SessionIndex {
645
661
  await this.learnDirCwds(new Set(pending.map(({ candidate }) => candidate.dirName)), options.unread(read), options.restat ?? false);
646
662
  await settlePending();
647
663
  }
648
- return rows();
664
+ return markAgentWorktrees(rows());
649
665
  }
650
666
  /** Whether the cached metadata of `candidate`, still current, places it
651
667
  * at or before `cursor`. */
@@ -1 +1 @@
1
- {"version":3,"file":"session-info.d.ts","sourceRoot":"","sources":["../../src/session-index/session-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAMnD;kEACkE;AAClE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,GAAG,EAAE,MAAM,GACV,WAAW,CAgCb;AAED;gCACgC;AAChC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEzD"}
1
+ {"version":3,"file":"session-info.d.ts","sourceRoot":"","sources":["../../src/session-index/session-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAMnD;kEACkE;AAClE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,GAAG,EAAE,MAAM,GACV,WAAW,CAiCb;AAED;gCACgC;AAChC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEzD"}
@@ -27,6 +27,7 @@ export function sessionInfoOf(row, own, live, now) {
27
27
  lastPromptAt: iso(facts.lastPromptAt),
28
28
  model: facts.model,
29
29
  forkedFrom: facts.forkedFrom,
30
+ agentWorktree: row.agentWorktree,
30
31
  state: activity?.state,
31
32
  lastTurnEndedAt: activity?.lastTurnEndedAt,
32
33
  cost: cost === undefined ? undefined : { amount: cost, currency: "USD" },
@@ -36,6 +36,11 @@ export type TranscriptFacts = {
36
36
  /** The session this one was forked from: the `forkedFrom.sessionId` that
37
37
  * the SDK and CLI fork write on every copied record. */
38
38
  forkedFrom?: string;
39
+ /** What the last `worktree-state` record says: true when its
40
+ * `worktreeSession` is set and not `enteredExisting` (Claude Code made the
41
+ * worktree and the session is in it), false when it says otherwise.
42
+ * Undefined when no such record was read. See {@link agentWorktreeOf}. */
43
+ agentWorktree?: boolean;
39
44
  /** Whether the head or the tail holds a user or an assistant message. A
40
45
  * transcript without one is a metadata-only stub. */
41
46
  hasMessages: boolean;
@@ -50,7 +55,7 @@ export type HeadTail = {
50
55
  sdkTail?: string;
51
56
  };
52
57
  /** Facts that an earlier scan may have found before the tail window. */
53
- declare const INHERITED_FACTS: readonly ["model", "tailCwd", "lastTurnEndedAt"];
58
+ declare const INHERITED_FACTS: readonly ["model", "tailCwd", "lastTurnEndedAt", "agentWorktree"];
54
59
  /** What an earlier scan of the same file found, at `size`. */
55
60
  export type PreviousScan = {
56
61
  size: number;
@@ -80,6 +85,25 @@ identity?: number): Promise<TranscriptFacts>;
80
85
  /** The cwd of the last `relocated` record of the tail: where the session
81
86
  * was moved, whatever cwd its earlier messages carry. */
82
87
  export declare function relocatedCwd(tail: string): string | undefined;
88
+ /**
89
+ * Whether the last `worktree-state` record of `text` says the session is in
90
+ * a worktree that Claude Code made for it, as AIR's native Claude provider
91
+ * reads it: a `worktreeSession` that is an object without
92
+ * `enteredExisting: true`. The last line that parses as a `worktree-state`
93
+ * record decides; any other `worktreeSession` (`null`, which the CLI writes
94
+ * when the session leaves the worktree, missing, or no object) means false.
95
+ * Only lines that are not JSON (such as the cut first line of a window) are
96
+ * skipped. Undefined when `text` holds no such record.
97
+ *
98
+ * The CLI writes the record when it enters or leaves a worktree (for
99
+ * `claude --worktree`, at the start of the session, so in the head), and
100
+ * writes it again with the other session metadata at the end of the
101
+ * transcript (on exit and as the transcript grows), so the tail usually
102
+ * holds the latest one. Only the head and the tail are read: a session that
103
+ * entered a worktree midway through a long transcript, with no metadata
104
+ * written after it yet, is not seen until the CLI writes the metadata again.
105
+ */
106
+ export declare function agentWorktreeOf(text: string): boolean | undefined;
83
107
  /** The cwd a transcript belongs to, as the SDK reads it: the last
84
108
  * `relocated` record of the tail, else the first cwd of the head. */
85
109
  export declare function transcriptProjectCwd({ head, tail }: HeadTail): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-scan.d.ts","sourceRoot":"","sources":["../../src/session-index/transcript-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,C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tB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,QAAQ,EAC7C,YAAY,CAAC,EAAE,MAAM,GACpB,SAAS,CASX;AAED;iDACiD;AACjD,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"}
@@ -20,7 +20,7 @@ const FULL_SEARCH_CACHE_SIZE = 512;
20
20
  * the same size is not searched again. */
21
21
  const fullySearched = new Map();
22
22
  /** Facts that an earlier scan may have found before the tail window. */
23
- const INHERITED_FACTS = ["model", "tailCwd", "lastTurnEndedAt"];
23
+ const INHERITED_FACTS = ["model", "tailCwd", "lastTurnEndedAt", "agentWorktree"];
24
24
  /** The last `window` bytes of a file of `size` bytes, without the first,
25
25
  * cut line. The whole file when it fits. */
26
26
  async function readTail(handle, size, window) {
@@ -88,6 +88,13 @@ identity) {
88
88
  }
89
89
  }
90
90
  }
91
+ // No worktree record in the tail (or before it, by an earlier scan): the
92
+ // one `claude --worktree` writes at the start may still be in the head.
93
+ if (facts.agentWorktree === undefined) {
94
+ const agentWorktree = agentWorktreeOf(read.head);
95
+ if (agentWorktree !== undefined)
96
+ facts.agentWorktree = agentWorktree;
97
+ }
91
98
  if (facts.lastPromptAt !== undefined || size <= CHUNK_SIZE) {
92
99
  facts.promptSearched = true;
93
100
  }
@@ -135,6 +142,11 @@ identity) {
135
142
  ...wider,
136
143
  ...(facts.model !== undefined && { model: facts.model }),
137
144
  ...(facts.tailCwd !== undefined && { tailCwd: facts.tailCwd }),
145
+ // The wider tail holds the narrow one, so a record it has is the
146
+ // latest; else the narrow scan's (inherited or from the head) stands.
147
+ ...((wider.agentWorktree ?? facts.agentWorktree) !== undefined && {
148
+ agentWorktree: wider.agentWorktree ?? facts.agentWorktree,
149
+ }),
138
150
  // A turn end the wider tail lacks may lie before it: the
139
151
  // narrow scan inherited it from an earlier scan of this file.
140
152
  lastTurnEndedAt: wider.lastTurnEndedAt ?? facts.lastTurnEndedAt,
@@ -174,6 +186,45 @@ export function relocatedCwd(tail) {
174
186
  }
175
187
  return undefined;
176
188
  }
189
+ const WORKTREE_STATE_MARKER = '"worktree-state"';
190
+ /**
191
+ * Whether the last `worktree-state` record of `text` says the session is in
192
+ * a worktree that Claude Code made for it, as AIR's native Claude provider
193
+ * reads it: a `worktreeSession` that is an object without
194
+ * `enteredExisting: true`. The last line that parses as a `worktree-state`
195
+ * record decides; any other `worktreeSession` (`null`, which the CLI writes
196
+ * when the session leaves the worktree, missing, or no object) means false.
197
+ * Only lines that are not JSON (such as the cut first line of a window) are
198
+ * skipped. Undefined when `text` holds no such record.
199
+ *
200
+ * The CLI writes the record when it enters or leaves a worktree (for
201
+ * `claude --worktree`, at the start of the session, so in the head), and
202
+ * writes it again with the other session metadata at the end of the
203
+ * transcript (on exit and as the transcript grows), so the tail usually
204
+ * holds the latest one. Only the head and the tail are read: a session that
205
+ * entered a worktree midway through a long transcript, with no metadata
206
+ * written after it yet, is not seen until the CLI writes the metadata again.
207
+ */
208
+ export function agentWorktreeOf(text) {
209
+ if (!text.includes(WORKTREE_STATE_MARKER))
210
+ return undefined;
211
+ const lines = text.split("\n");
212
+ for (let i = lines.length - 1; i >= 0; i--) {
213
+ const line = lines[i];
214
+ if (!line.includes(WORKTREE_STATE_MARKER))
215
+ continue;
216
+ const entry = parseLine(line);
217
+ // Only a line that is no JSON record is skipped: the latest record that
218
+ // parses decides, even when its `worktreeSession` is missing or no object.
219
+ if (entry?.type !== "worktree-state")
220
+ continue;
221
+ const session = entry.worktreeSession;
222
+ if (!session || typeof session !== "object" || Array.isArray(session))
223
+ return false;
224
+ return session.enteredExisting !== true;
225
+ }
226
+ return undefined;
227
+ }
177
228
  /** The cwd a transcript belongs to, as the SDK reads it: the last
178
229
  * `relocated` record of the tail, else the first cwd of the head. */
179
230
  export function transcriptProjectCwd({ head, tail }) {
@@ -274,6 +325,11 @@ export function scanTranscript({ head, tail }, options = {}) {
274
325
  const forkedFrom = FORKED_FROM_PATTERN.exec(head)?.[1];
275
326
  if (forkedFrom !== undefined)
276
327
  facts.forkedFrom = forkedFrom;
328
+ // The tail only: scanTranscriptFile falls back to the head after it
329
+ // inherits what an earlier scan found before the tail.
330
+ const agentWorktree = agentWorktreeOf(tail);
331
+ if (agentWorktree !== undefined)
332
+ facts.agentWorktree = agentWorktree;
277
333
  const lines = tail.split("\n");
278
334
  let turnEndFound = false;
279
335
  let messageFound = false;
@@ -17,6 +17,12 @@
17
17
  * worktree root, the worktree roots. Empty outside a repository.
18
18
  */
19
19
  export declare function worktreeCounterparts(cwd: string): Promise<string[]>;
20
+ /**
21
+ * Whether `cwd` lies in a linked worktree: its git dir is
22
+ * `<common-dir>/worktrees/<name>`. False in the main worktree, in a
23
+ * submodule and outside a repository.
24
+ */
25
+ export declare function isInLinkedWorktree(cwd: string): Promise<boolean>;
20
26
  /**
21
27
  * Every existing worktree of the repository that contains `cwd`: the main
22
28
  * worktree and the linked ones. Empty outside a repository.
@@ -1 +1 @@
1
- {"version":3,"file":"worktrees.d.ts","sourceRoot":"","sources":["../../src/session-index/worktrees.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqFH;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAazE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAaxE"}
1
+ {"version":3,"file":"worktrees.d.ts","sourceRoot":"","sources":["../../src/session-index/worktrees.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqFH;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAazE;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKtE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAaxE"}
@@ -110,6 +110,18 @@ export async function worktreeCounterparts(cwd) {
110
110
  const existing = await Promise.all(candidates.map(async (candidate) => (await statOrUndefined(candidate))?.isDirectory() ? normalizePath(candidate) : undefined));
111
111
  return [...new Set(existing.filter((value) => value !== undefined))];
112
112
  }
113
+ /**
114
+ * Whether `cwd` lies in a linked worktree: its git dir is
115
+ * `<common-dir>/worktrees/<name>`. False in the main worktree, in a
116
+ * submodule and outside a repository.
117
+ */
118
+ export async function isInLinkedWorktree(cwd) {
119
+ const gitDir = await findGitDir(cwd);
120
+ if (!gitDir)
121
+ return false;
122
+ const commonDir = await commonDirOf(gitDir);
123
+ return path.resolve(path.dirname(gitDir)) === path.resolve(commonDir, "worktrees");
124
+ }
113
125
  /**
114
126
  * Every existing worktree of the repository that contains `cwd`: the main
115
127
  * worktree and the linked ones. Empty outside a repository.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.90.1-preview.14",
6
+ "version": "0.90.1-preview.16",
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",
@@ -66,12 +66,12 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@agentclientprotocol/sdk": "1.8.0",
69
- "@anthropic-ai/claude-agent-sdk": "0.3.296",
69
+ "@anthropic-ai/claude-agent-sdk": "0.3.300",
70
70
  "diff": "9.0.0",
71
71
  "zod": "4.6.7"
72
72
  },
73
73
  "devDependencies": {
74
- "@anthropic-ai/sdk": "0.133.0",
74
+ "@anthropic-ai/sdk": "0.134.0",
75
75
  "@eslint/js": "10.0.1",
76
76
  "@tsconfig/node22": "22.0.6",
77
77
  "@types/node": "26.6.5",