@agentclientprotocol/claude-agent-acp 0.99.1-preview.4 → 0.99.1-preview.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fork-session.d.ts","sourceRoot":"","sources":["../src/fork-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,mCAAmC,CAAC;AA0B3C,KAAK,uBAAuB,GAAG;IAC7B,mBAAmB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC;IAC/C,oBAAoB,EAAE,CAAC,OAAO,EAAE;QAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,KAAK,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AA+IF,wBAAsB,WAAW,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,YAAY,EAAE,uBAAuB,GACpC,OAAO,CAAC,mBAAmB,CAAC,CAsD9B"}
1
+ {"version":3,"file":"fork-session.d.ts","sourceRoot":"","sources":["../src/fork-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,mCAAmC,CAAC;AA0B3C,KAAK,uBAAuB,GAAG;IAC7B,mBAAmB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;KAAE,CAAC;IAC/C,oBAAoB,EAAE,CAAC,OAAO,EAAE;QAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,KAAK,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AA4IF,wBAAsB,WAAW,CAC/B,MAAM,EAAE,kBAAkB,EAC1B,YAAY,EAAE,uBAAuB,GACpC,OAAO,CAAC,mBAAmB,CAAC,CAqD9B"}
@@ -28,7 +28,7 @@ function forkPointMessageIdCandidates(messageId) {
28
28
  const protocolMessageId = messageId.replace(/:segment:\d+$/, "");
29
29
  return protocolMessageId === messageId ? [messageId] : [messageId, protocolMessageId];
30
30
  }
31
- async function loadFullSessionHistory(sessionId, cwd) {
31
+ async function loadFullSessionHistory(sessionId) {
32
32
  // getSessionMessages returns only the active parentUuid chain. The import keeps inactive branches that AIR can still reference.
33
33
  const entries = [];
34
34
  const store = {
@@ -37,7 +37,7 @@ async function loadFullSessionHistory(sessionId, cwd) {
37
37
  },
38
38
  load: async () => null,
39
39
  };
40
- await importSessionToStore(sessionId, store, { dir: cwd, includeSubagents: false });
40
+ await importSessionToStore(sessionId, store, { includeSubagents: false });
41
41
  return entries;
42
42
  }
43
43
  function assistantGroups(entries, messageIdForGrouping) {
@@ -107,8 +107,10 @@ function resolveFromFullHistory(entries, candidates, point, messageIdForGrouping
107
107
  export async function forkSession(params, dependencies) {
108
108
  const timing = new SessionTiming(dependencies.logger, "fork", params.sessionId);
109
109
  const point = forkPoint(params._meta);
110
+ // SDK `dir` scopes source lookup, not the fork's working directory. Search
111
+ // all projects: params.cwd can name a different workspace for the new session.
110
112
  if (!point) {
111
- const forked = await forkClaudeSession(params.sessionId, { dir: params.cwd });
113
+ const forked = await forkClaudeSession(params.sessionId);
112
114
  timing.phase("sdk-fork", " resolution=latest");
113
115
  return { sessionId: forked.sessionId };
114
116
  }
@@ -116,9 +118,7 @@ export async function forkSession(params, dependencies) {
116
118
  const liveUuid = candidateIds
117
119
  .map((candidateId) => dependencies.liveMessageIdToUuid?.get(candidateId))
118
120
  .find(Boolean);
119
- const history = liveUuid
120
- ? undefined
121
- : await getSessionMessages(params.sessionId, { dir: params.cwd });
121
+ const history = liveUuid ? undefined : await getSessionMessages(params.sessionId);
122
122
  timing.phase("active-history", ` resolution=${liveUuid ? "live" : "pending"}`);
123
123
  const messageUuid = liveUuid ??
124
124
  candidateIds
@@ -129,13 +129,12 @@ export async function forkSession(params, dependencies) {
129
129
  .find(Boolean);
130
130
  const fullHistoryUuid = messageUuid
131
131
  ? undefined
132
- : resolveFromFullHistory(await loadFullSessionHistory(params.sessionId, params.cwd), candidateIds, point, dependencies.messageIdForGrouping);
132
+ : resolveFromFullHistory(await loadFullSessionHistory(params.sessionId), candidateIds, point, dependencies.messageIdForGrouping);
133
133
  timing.phase("full-history", ` resolution=${liveUuid ? "live" : messageUuid ? "active" : fullHistoryUuid ? "full" : "missing"}`);
134
134
  if (!messageUuid && !fullHistoryUuid) {
135
135
  throw RequestError.invalidParams({ messageId: point.messageId }, `Fork point message ${point.messageId} was not found in session ${params.sessionId}`);
136
136
  }
137
137
  const forked = await forkClaudeSession(params.sessionId, {
138
- dir: params.cwd,
139
138
  upToMessageId: messageUuid ?? fullHistoryUuid,
140
139
  });
141
140
  timing.phase("sdk-fork");
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.99.1-preview.4",
6
+ "version": "0.99.1-preview.5",
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",