@parcha/agentrun-harness-acp 0.1.0-beta.59 → 0.1.0-beta.60

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.60 (2026-11-26)
6
+
7
+ - An ACP agent's answer is the text it writes after its last call ended, not that text joined to what it wrote while the call was in flight. Cursor 2026.11.13 writes a line such as "Running it now…" after announcing its own shell call and before it ends, and the answer read "…approved.6765". What it writes before a call ends is the answer only when nothing follows. The fake agent's native step takes `narrate`, text written in that window. <!-- changes/acp-final-after-call-end.md -->
8
+
5
9
  ## 0.1.0-beta.59 (2026-11-25)
6
10
 
7
11
  **Breaking:**
package/dist/harness.js CHANGED
@@ -263,7 +263,7 @@ export function acpHarness(options, control) {
263
263
  if (!cur)
264
264
  return;
265
265
  if (cur.turn)
266
- cur.turn.final = "";
266
+ cur.turn.final = cur.turn.kept = "";
267
267
  countCall(rt, cur, update.toolCallId);
268
268
  // Kept for the MCP call it may be, named by the recipe's announces field, never by its title (announceCall).
269
269
  announceCall(rt.calls, update, recipe.announces, names);
@@ -281,6 +281,9 @@ export function acpHarness(options, control) {
281
281
  // Its status is the agent's word only: what it changes is the mirror of the agent's session store.
282
282
  if (update.status !== "completed" && update.status !== "failed")
283
283
  return;
284
+ // What the agent wrote before the call ended is set aside: what it writes after is the answer.
285
+ if (cur.turn?.final.trim())
286
+ [cur.turn.kept, cur.turn.final] = [cur.turn.final, ""];
284
287
  // An ended call takes no MCP call's id (CallIds.settle).
285
288
  rt.calls.settle(update.toolCallId);
286
289
  mirrorInto(rt, cur.journal);
@@ -805,7 +808,7 @@ export function acpHarness(options, control) {
805
808
  await journal.flush();
806
809
  const prompt = [...agent.firstBlocks.splice(0), ...body].map((text) => ({ type: "text", text }));
807
810
  let ended;
808
- const turn = { final: "", stop: new AbortController(), ended: new Promise((resolve) => (ended = resolve)) };
811
+ const turn = { final: "", kept: "", stop: new AbortController(), ended: new Promise((resolve) => (ended = resolve)) };
809
812
  cur.turn = turn;
810
813
  let answer;
811
814
  let failure;
@@ -873,8 +876,10 @@ export function acpHarness(options, control) {
873
876
  else
874
877
  outcome = { status: "failed", error: `acp: the agent ended the turn with an unknown stop reason ${JSON.stringify(reason)}` };
875
878
  }
876
- if (turn.final)
877
- journal.message({ type: "message", role: "assistant", text: turn.final });
879
+ // Only whitespace after the call (a trailing newline) is no answer of its own: the text before it is.
880
+ const lastText = turn.final.trim() ? turn.final : turn.kept;
881
+ if (lastText)
882
+ journal.message({ type: "message", role: "assistant", text: lastText });
878
883
  journal.message({ type: "turn", ...outcome });
879
884
  await journal.flush();
880
885
  return outcome;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-harness-acp",
3
- "version": "0.1.0-beta.59",
3
+ "version": "0.1.0-beta.60",
4
4
  "description": "Any Agent Client Protocol agent as an AgentRun harness: the agent over stdio in a private HOME, the host's tools as one loopback MCP server, its permission asks through the host's gate, durable in AgentRun's own store.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@agentclientprotocol/sdk": "2.7.0",
52
- "@parcha/agentrun-kernel": "0.1.0-beta.59",
52
+ "@parcha/agentrun-kernel": "0.1.0-beta.60",
53
53
  "zod": "4.6.6"
54
54
  },
55
55
  "publishConfig": {
@@ -31,6 +31,8 @@
31
31
  // (a call step's `ask`, {kind, title}: what its permission request says instead of the call's own kind and title;)
32
32
  // (a native step's `lateInput`: a tool_call_update after its tool_call with that rawInput, a release that echoes the
33
33
  // model's arguments in a later update;)
34
+ // (a native step's `narrate`: text the agent writes after the call's tool_call and before it ends, as Cursor
35
+ // 2026.11.13 does;)
34
36
  // (styles "goose" and "goose-1.59": each tool_call names its tool in _meta.goose.toolCall.toolName, as Goose 1.59.2
35
37
  // does: `agentrun__<tool>` for ours, a native step's `toolName` or `developer__<kind>` for the agent's own;)
36
38
  // models: the models session/new and session/load list ({modelId, name}), the first current; session/set_model
@@ -351,6 +353,7 @@ async function takeTurn(client, session, prompt, signal) {
351
353
  // {announce: false}: a permission request for a call no tool_call announced.
352
354
  if (s.announce !== false) await notify({ sessionUpdate: "tool_call", ...update, ...gooseMeta(s.toolName ?? `developer__${s.native}`) });
353
355
  if (s.lateInput) await notify({ sessionUpdate: "tool_call_update", toolCallId: id, rawInput: s.lateInput });
356
+ if (s.narrate) await notify({ sessionUpdate: "agent_message_chunk", content: { type: "text", text: s.narrate } });
354
357
  const allowed = deniesWrite && EDITS.has(s.native) ? false : askNative.has(s.native) ? await permitted(client, session, update) : true;
355
358
  if (signal.aborted) return { stopReason: "cancelled" };
356
359
  if (allowed && config.nativeLog) appendFileSync(config.nativeLog, `${update.title}\n`);