@koalaauto/agentchannel 3.98.0 → 3.98.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.
@@ -673,6 +673,7 @@ export declare class Client {
673
673
  text: string;
674
674
  url?: string;
675
675
  act?: string;
676
+ undoable?: boolean;
676
677
  }>;
677
678
  /** The person's own word on a card, chosen in their client's question box (never a model's argument): docs/specs/mcp-client.md §4.2. */
678
679
  yodaDecide(act: string, decision: 'confirm' | 'decline'): Promise<{
package/dist/src/mcp.js CHANGED
@@ -371,8 +371,11 @@ export function buildMcpServer(client, o = {}) {
371
371
  const sent = async (tool, args, label) => wrap(async () => {
372
372
  const r = await client.yodaAct(tool, args);
373
373
  const text = r.text || `(${r.status || 'the hub said nothing'})`;
374
+ // not done is an error to the client (and counted as one), with the hub's reason
375
+ if (r.status === 'failed')
376
+ throw new Error(text);
374
377
  if (r.status !== 'waiting')
375
- return r.act && r.status === 'done' ? `${text}\nact: ${r.act} (take_back undoes it)` : text;
378
+ return r.act && r.undoable ? `${text}\nact: ${r.act} (take_back undoes it)` : text;
376
379
  // it waits on a card: the person is asked here, in their client's own question box, when it has one
377
380
  const word = r.act ? await askToConfirm(server, label) : null;
378
381
  if (word && r.act)
@@ -933,6 +936,12 @@ export async function startMcp(client, where = { cwd: process.cwd() }) {
933
936
  // this machine's runner, when it stopped and should not have (watchdog.ts): started again from here
934
937
  // (a session connected as a person has no runner to look after)
935
938
  const watchdog = linked && !hand ? { stop() { } } : startRunnerWatchdog({ me: () => (hand ? hand.client : client).me(), log: (s) => process.stderr.write(`[ach mcp] ${s}\n`) });
939
+ // the client ends a session by closing the pipe and then killing the process: what was counted since the last report is
940
+ // told first (a session shorter than a minute would otherwise leave no trace), within a second and a half
941
+ const lastWord = () => Promise.race([server.toolUse?.flush(), new Promise((r) => setTimeout(r, 1500))]).catch(() => { });
942
+ process.stdin.once('end', () => void lastWord());
943
+ for (const sig of ['SIGTERM', 'SIGINT', 'SIGHUP'])
944
+ process.once(sig, () => void lastWord().finally(() => process.exit(0)));
936
945
  server.server.onclose = () => {
937
946
  void server.toolUse?.flush();
938
947
  notices?.stop();
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.98.0";
1
+ export declare const VERSION = "3.98.1";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.98.0';
1
+ export const VERSION = '3.98.1';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.98.0",
3
+ "version": "3.98.1",
4
4
  "description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
5
5
  "keywords": [
6
6
  "agentchannel",