aiterm-mcp 0.70.50 → 0.70.51

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.51] - 2026-11-13
11
+
12
+ - A hibernated terminal seat stays bound to its terminal. `pty_close {hibernate:true}` unbound it like a real close, so the body read the seat as missing and `pty_close` of it ran locally (already_closed) while the seat stayed hibernated on the terminal.
13
+ - A hibernated seat whose project folder path goes through a symlink resumes again. Claude saves its cwd as a realpath, but the resume check compared the caller's path unresolved, so every resume failed with AGENT_RESUME_CONFLICT (macOS `/tmp`, a cloud-synced folder). Both sides are now compared by realpath.
14
+
10
15
  ## [0.70.50] - 2026-11-13
11
16
 
12
17
  - 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.
@@ -3427,7 +3432,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3427
3432
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3428
3433
  provenance.
3429
3434
 
3430
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.50...HEAD
3435
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.51...HEAD
3436
+ [0.70.51]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.50...v0.70.51
3431
3437
  [0.70.50]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.49...v0.70.50
3432
3438
  [0.70.49]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.48...v0.70.49
3433
3439
  [0.70.48]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.47...v0.70.48
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.50** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.70.51** · 動作対象は 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.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).
230
+ **Status:** actively maintained · current public release **v0.70.51** · 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
 
package/dist/core.js CHANGED
@@ -102,6 +102,17 @@ const PTY_PASTE_CHUNK_PAUSE_MS = 10;
102
102
  // 同期処理の中の短い間(paste chunkの間、server片付け中の一覧の読み直し)。eventループを進めずに待つ。
103
103
  const SYNC_PAUSE_BUFFER = new Int32Array(new SharedArrayBuffer(4));
104
104
  function pauseSync(ms) { Atomics.wait(SYNC_PAUSE_BUFFER, 0, 0, ms); }
105
+ // A Claude seat saves its cwd as a realpath, so a caller's path through a symlink (macOS /tmp, a cloud-synced folder) is the same project.
106
+ function sameProjectFolder(given, saved) {
107
+ if (path.resolve(given) === saved)
108
+ return true;
109
+ try {
110
+ return fs.realpathSync(given) === fs.realpathSync(saved);
111
+ }
112
+ catch {
113
+ return false;
114
+ }
115
+ }
105
116
  const SESSION_SEND_LOCK_WAIT_MS = isWin ? 130_000 : 10_000;
106
117
  const SESSION_SEND_LOCK_POLL_MS = 25;
107
118
  // 同じagent sessionへの送信が重なった時に、前の1通を待つ上限(ADR 0088)。
@@ -8657,7 +8668,7 @@ export async function openAgentWithInitialPrompt(kind, opts = {}) {
8657
8668
  || (opts.model != null && opts.model.trim() !== recipe.model)
8658
8669
  || (opts.reasoning_effort != null && opts.reasoning_effort.trim() !== recipe.reasoning_effort)
8659
8670
  || (opts.fast != null && opts.fast !== recipe.fast)
8660
- || (opts.cwd != null && path.resolve(opts.cwd) !== recipe.cwd)
8671
+ || (opts.cwd != null && !sameProjectFolder(opts.cwd, recipe.cwd))
8661
8672
  || (opts.write_scope !== undefined && opts.write_scope !== previous.write_scope)
8662
8673
  || (opts.env_vars !== undefined && !isDeepStrictEqual(resumeEnvNames(kind, opts.env_vars), resumeEnvNames(kind, [...Object.keys(recipe.environment), ...recipeSecretNames(recipe)]))))
8663
8674
  throw opts.require_existing_resume ? new AgentResumeUnavailableError(name) : new AitermError("AGENT_RESUME_CONFLICT: 同名の休止席は保存したharness・設定・project・明示envで再開します。変更は再開後に行ってください。", 2);
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { loadAgentMetadata } from "./agent-metadata-reader.js";
3
3
  import { remoteInputDescription, remoteInputSchema, terminalArgumentDescription, terminalArgumentSchema } from "./remote-contract.js";
4
- import { boundTerminalTarget, bindTerminalSession, terminalSeatGroups, ensureSeatForward, extractMcpHeaders, maintainSeatForwards, REMOTE_MINIMUM_VERSION, REMOTE_CLI_OPS_VERSION, seatIngressPort, checkTerminalPlatform, rewriteSeatMcpConfig, terminalRemoteTarget, unbindTerminalSession, versionAtLeast } from "./remote-terminal.js";
4
+ import { boundTerminalTarget, bindTerminalSession, terminalSeatGroups, ensureSeatForward, extractMcpHeaders, maintainSeatForwards, REMOTE_MINIMUM_VERSION, REMOTE_CLI_OPS_VERSION, seatIngressPort, checkTerminalPlatform, closeEndsTerminalSeat, rewriteSeatMcpConfig, terminalRemoteTarget, unbindTerminalSession, versionAtLeast } from "./remote-terminal.js";
5
5
  import { terminalCwdFits } from "./remote-path.js";
6
6
  import { launchEnvValue } from "./private-env.js";
7
7
  import { AuthResponseError, authUiSchema, authBindingSchema, authResponseSchema } from "./agent-auth-ui.js";
@@ -354,7 +354,7 @@ export function createAitermServer(options = {}) {
354
354
  if (!target)
355
355
  return handler(args, extra);
356
356
  const result = await remoteHandler(target, args, extra);
357
- if (name === "pty_close" && !remote && !result?.isError)
357
+ if (name === "pty_close" && !remote && closeEndsTerminalSeat(args, result))
358
358
  unbindTerminalSession(args.session_id);
359
359
  return remote ? result : withErrorCode(result);
360
360
  }
@@ -740,6 +740,13 @@ function readSeats() {
740
740
  }
741
741
  function writeSeats(seats) { writeJson0600(seatsFile(), { schema: "aiterm.terminal-seats.v1", seats }); }
742
742
  export function bindTerminalSession(session, ref) { writeSeats({ ...readSeats(), [session]: ref }); }
743
+ /** Whether a terminal seat's pty_close ended it: a hibernated seat keeps its binding, so its resume and reads still reach the terminal. */
744
+ export function closeEndsTerminalSeat(args, result) {
745
+ if (!result || result.isError)
746
+ return false;
747
+ const outcome = result.structuredContent?.outcome;
748
+ return typeof outcome === "string" ? outcome !== "hibernated" : args.hibernate !== true;
749
+ }
743
750
  export function unbindTerminalSession(session) {
744
751
  const seats = readSeats();
745
752
  if (!(session in seats))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.70.50",
3
+ "version": "0.70.51",
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": [