aiterm-mcp 0.70.49 → 0.70.50

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
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.70.50] - 2026-11-13
11
+
12
+ - seat-turns no longer returns one unknown (null) turn at every turn end for Claude, Grok, Cursor and Antigravity seats. The first ready frame only started the 250 ms settle clock, so a caller polling every ~10 s saw running → unknown → idle; the read now looks once more past the settle time itself.
13
+ - An Antigravity spinner over an `esc to cancel` footer (`Running command...`, `Loading...`) reads as the running turn (it read unknown).
14
+
10
15
  ## [0.70.49] - 2026-11-13
11
16
 
12
17
  - An Antigravity seat no longer reads unknown for a moment when a background task ends: agy reruns the model with a `Loading...` spinner over an `esc to cancel` footer, which now reads as the running turn.
@@ -3422,7 +3427,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3422
3427
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3423
3428
  provenance.
3424
3429
 
3425
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.49...HEAD
3430
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.50...HEAD
3431
+ [0.70.50]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.49...v0.70.50
3426
3432
  [0.70.49]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.48...v0.70.49
3427
3433
  [0.70.48]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.47...v0.70.48
3428
3434
  [0.70.47]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.46...v0.70.47
package/README.ja.md CHANGED
@@ -215,7 +215,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
215
215
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
216
216
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
217
217
 
218
- **状態:** 開発継続中 · 現行公開版 **v0.70.49** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.70.50** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
219
219
 
220
220
  ### 更新と巻き戻し
221
221
 
package/README.md CHANGED
@@ -227,7 +227,7 @@ collection is off by default and performs no network I/O. It ships via
227
227
  tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
228
228
  Release re-registers the Official MCP Registry entry.
229
229
 
230
- **Status:** actively maintained · current public release **v0.70.49** · runs on Linux · WSL2 · macOS · native Windows (tmux on POSIX, the tmux-CLI-compatible [psmux](https://github.com/psmux/psmux) on native Windows — no WSL required) · MIT · see the [CHANGELOG](CHANGELOG.md).
230
+ **Status:** actively maintained · current public release **v0.70.50** · runs on Linux · WSL2 · macOS · native Windows (tmux on POSIX, the tmux-CLI-compatible [psmux](https://github.com/psmux/psmux) on native Windows — no WSL required) · MIT · see the [CHANGELOG](CHANGELOG.md).
231
231
 
232
232
  ### Update and rollback
233
233
 
@@ -338,6 +338,9 @@ export function parentPaneEvidence(kind, screen) {
338
338
  start = marker - 1;
339
339
  while (start > 0 && (!lines[start].trim() || /^[╭─\s]+$/u.test(lines[start])))
340
340
  start--;
341
+ // agy prints a "└ Tip: …" line under its spinner: the spinner is the current block's first line.
342
+ if (kind === "antigravity" && start > 0 && /^\s*└ Tip:/u.test(lines[start]))
343
+ start--;
341
344
  }
342
345
  const current = lines.slice(Math.max(0, start)).join("\n");
343
346
  // Antigravity keeps the turn open while a background task runs: it reruns the model when the task ends, then sends Stop.
@@ -367,11 +370,11 @@ export function parentPaneEvidence(kind, screen) {
367
370
  if (kind === "grok" && observed.state === "busy"
368
371
  && !/^\s*(?:[│┃]\s*)?(?:Waiting for response|Responding(?:…|\.\.\.)).*$/mu.test(current))
369
372
  return "unknown";
370
- // agy reruns the model after a background task ends with a "Loading..." spinner over an "esc to cancel" footer (a41-agy).
373
+ // Other agy spinners ("Running command...", "Loading..." while it reruns the model after a background task) over an
374
+ // "esc to cancel" footer (a41-agy).
371
375
  if (kind === "antigravity" && observed.state === "busy"
372
376
  && !/^\s*(?:[^\p{L}\p{N}\s]{1,3}\s+)?(?:Generating|Working)(?:…|\.\.\.).*$/mu.test(current)
373
- // The spinner may sit one line above a "└ Tip: …" line.
374
- && !(/^\s*[^\p{L}\p{N}\s]{1,3}\s+Loading(?:…|\.\.\.)\s*$/mu.test(lines.slice(Math.max(0, start - 1), marker).join("\n"))
377
+ && !(/^\s*[^\p{L}\p{N}\s]{1,3}\s+\p{L}[^\n]*?(?:…|\.\.\.)\s*$/mu.test(lines.slice(start, marker).join("\n"))
375
378
  && /^\s*esc to cancel\b/imu.test(lines.slice(marker + 1).join("\n")))
376
379
  && !/^\s*esc to interrupt\s*$/imu.test(lines.slice(marker + 1).join("\n")))
377
380
  return "unknown";
package/dist/core.js CHANGED
@@ -11,7 +11,7 @@ import { inspectIdleSettings, inspectCodexResumeSettings, codexRecoveryComposer
11
11
  import { AGENT_TUI_READY_TIMEOUT_MS, AGENT_TUI_FIRST_DRAW_TIMEOUT_MS, AGENT_TUI_READY_POLL_MS, isAgentTuiReady, isAgentTuiBusy, isAgentTuiIdleReady, agentPaneObservation, parentPaneEvidence, waitAgentTuiReadyImpl, detectAgentSubmitResidueImpl, waitCursorPromptVisibleImpl, settleAgentDoneScreenImpl } from "./agent-screen-observation.js";
12
12
  export { launchEchoIsLastOnScreen, __testSetAgentTuiReadyStableSamples } from "./agent-screen-observation.js";
13
13
  import { parseClaudeOperationMarker } from "./claude-operation-marker.js";
14
- import { withManagedSpan, observeManagedSpan, closeManagedSpan, SPAN_HELD } from "./managed-seat-turn.js";
14
+ import { withManagedSpan, observeManagedSpan, closeManagedSpan, managedSpanSettling, MANAGED_SPAN_SETTLE_MS, SPAN_HELD } from "./managed-seat-turn.js";
15
15
  /**
16
16
  * core — CLI/MCP が共有する端末操作とharness進行(Node/TS 版)。
17
17
  *
@@ -4178,27 +4178,36 @@ function readManagedSeatTurn(meta) {
4178
4178
  if (live.pane_alive !== true || live.harness_alive !== true || !live.pane_process || !live.harness_process
4179
4179
  || before.native?.agent?.stopped === true || live.launch_id !== meta.launch_id)
4180
4180
  return null;
4181
- const captured = tmux("capture-pane", "-p", "-J", "-t", proof ? nativePaneTarget(proof) : meta.aiterm_session);
4182
- if (captured.code !== 0)
4183
- return null;
4184
- const evidence = parentPaneEvidence(meta.kind, captured.stdout);
4185
- const terminal = managedSeatTerminal(meta);
4186
- const observedAfter = observeSessionNative(meta.aiterm_session), after = observedAfter.result;
4187
- if (proof)
4188
- verifyAgentResumeNative(meta, proof);
4189
- if (after.pane_alive !== true || after.harness_alive !== true || observedAfter.native?.agent?.stopped === true
4190
- || !isDeepStrictEqual(after.pane_process, live.pane_process) || !isDeepStrictEqual(after.harness_process, live.harness_process)
4191
- || !isDeepStrictEqual(loadAgentMetadata(meta.aiterm_session), meta)
4192
- || managedSeatConversation(meta) !== conversation || agentDormantState(meta) !== null
4193
- || performance.now() - started >= 15_000)
4194
- return null;
4195
- const binding = JSON.stringify([meta.aiterm_session, meta.launch_id, meta.kind, conversation, proof, live.pane_process, live.harness_process]);
4196
- // Claude holds a limit-ended turn with no Stop and a busy-looking footer; its transcript says the turn ended.
4197
- const limited = meta.kind === "claude" ? claudeSeatLimitEnd(meta) : null;
4198
- if (limited && !limited.continued) {
4199
- return closeManagedSpan(file, binding, `limit:${limited.at}`, () => managedSpanStart(meta));
4200
- }
4201
- return observeManagedSpan(file, binding, evidence, terminal, new Date().toISOString(), () => managedSpanStart(meta));
4181
+ const look = () => {
4182
+ const captured = tmux("capture-pane", "-p", "-J", "-t", proof ? nativePaneTarget(proof) : meta.aiterm_session);
4183
+ if (captured.code !== 0)
4184
+ return null;
4185
+ const evidence = parentPaneEvidence(meta.kind, captured.stdout);
4186
+ const terminal = managedSeatTerminal(meta);
4187
+ const observedAfter = observeSessionNative(meta.aiterm_session), after = observedAfter.result;
4188
+ if (proof)
4189
+ verifyAgentResumeNative(meta, proof);
4190
+ if (after.pane_alive !== true || after.harness_alive !== true || observedAfter.native?.agent?.stopped === true
4191
+ || !isDeepStrictEqual(after.pane_process, live.pane_process) || !isDeepStrictEqual(after.harness_process, live.harness_process)
4192
+ || !isDeepStrictEqual(loadAgentMetadata(meta.aiterm_session), meta)
4193
+ || managedSeatConversation(meta) !== conversation || agentDormantState(meta) !== null
4194
+ || performance.now() - started >= 15_000)
4195
+ return null;
4196
+ const binding = JSON.stringify([meta.aiterm_session, meta.launch_id, meta.kind, conversation, proof, live.pane_process, live.harness_process]);
4197
+ // Claude holds a limit-ended turn with no Stop and a busy-looking footer; its transcript says the turn ended.
4198
+ const limited = meta.kind === "claude" ? claudeSeatLimitEnd(meta) : null;
4199
+ if (limited && !limited.continued) {
4200
+ return closeManagedSpan(file, binding, `limit:${limited.at}`, () => managedSpanStart(meta));
4201
+ }
4202
+ return observeManagedSpan(file, binding, evidence, terminal, new Date().toISOString(), () => managedSpanStart(meta));
4203
+ };
4204
+ const first = look();
4205
+ // A first ready sighting only starts the settle clock (observeManagedSpan): look again past it in this same read, so a
4206
+ // caller polling every ~10 s does not see one unknown read at every turn end (Kiro/Trony a41, 0.70.49).
4207
+ if (first !== null || !managedSpanSettling(file))
4208
+ return first;
4209
+ pauseSync(MANAGED_SPAN_SETTLE_MS + 50);
4210
+ return look();
4202
4211
  });
4203
4212
  return performance.now() - started < 15_000 ? result : null;
4204
4213
  }
@@ -142,6 +142,10 @@ export function antigravityPaneObservation(screen) {
142
142
  return { state: "blocked", reason: "vendor_action_required" };
143
143
  if (/(?:Generating|Working)(?:\.{3}|…)|esc to interrupt/i.test(screen))
144
144
  return { state: "busy", reason: "vendor_generating" };
145
+ // Any other spinner line ("⣾ Running command...", "⣻ Loading..." while the model reruns after a background task)
146
+ // with "esc to cancel" in the footer is a turn in progress (1.5.8).
147
+ if (/^\s*[^\p{L}\p{N}\s]{1,3}\s+\p{L}[^\n]*?(?:\.{3}|…)\s*$/mu.test(screen) && /^\s*esc to cancel\b/imu.test(screen))
148
+ return { state: "busy", reason: "vendor_generating" };
145
149
  if (antigravityEmptyComposer(screen))
146
150
  return { state: "idle", reason: "composer_ready" };
147
151
  return { state: "unknown", reason: "vendor_state_unknown" };
@@ -64,6 +64,18 @@ export function withManagedSpan(meta, capture) {
64
64
  fs.rmSync(candidate, { recursive: true, force: true });
65
65
  }
66
66
  }
67
+ /** How long a ready frame must hold (same terminal) before the span settles idle. */
68
+ export const MANAGED_SPAN_SETTLE_MS = 250;
69
+ /** The last observation saw ready and started the settle clock: a second look after MANAGED_SPAN_SETTLE_MS can settle it. */
70
+ export function managedSpanSettling(file) {
71
+ try {
72
+ const record = recordSchema.parse(JSON.parse(fs.readFileSync(file, "utf8")));
73
+ return record.ready !== null && Date.now() - Date.parse(record.ready.since) < MANAGED_SPAN_SETTLE_MS;
74
+ }
75
+ catch {
76
+ return false;
77
+ }
78
+ }
67
79
  /** Persistence keeps identity only; evidence must come from a new validated native read. */
68
80
  export function observeManagedSpan(file, binding, evidence, terminal, at, position = () => null) {
69
81
  stamp.parse(at);
@@ -107,7 +119,7 @@ export function observeManagedSpan(file, binding, evidence, terminal, at, positi
107
119
  writeJson0600(file, record);
108
120
  return null;
109
121
  }
110
- if (Date.parse(at) - Date.parse(record.ready.since) < 250)
122
+ if (Date.parse(at) - Date.parse(record.ready.since) < MANAGED_SPAN_SETTLE_MS)
111
123
  return null;
112
124
  const settled = position();
113
125
  if (record.span || (record.settled_from ?? null) !== settled) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.70.49",
3
+ "version": "0.70.50",
4
4
  "mcpName": "io.github.kitepon/aiterm-mcp",
5
5
  "description": "Persistent terminal MCP with one harness-based launcher for Claude Code, Codex CLI, Grok CLI, Cursor Agent CLI, and Antigravity CLI, plus durable PTYs for SSH, containers, and REPLs.",
6
6
  "keywords": [