aiterm-mcp 0.61.5 → 0.61.6

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,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.61.6] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - Agent startup waits asynchronously for the existing metadata mutex before checking pane ownership, restoring its terminal mode, or accepting startup-menu keys. A short concurrent writer after promptless native creation no longer turns an otherwise valid launch into `unknown`. Stops, uncertain slots, generation changes and the existing lock-acquisition deadline still refuse further effects; no launch or input is replayed.
15
+
10
16
  ## [0.61.5] - 2026-10-22
11
17
 
12
18
  ### Fixed
@@ -2736,7 +2742,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
2736
2742
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
2737
2743
  provenance.
2738
2744
 
2739
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.5...HEAD
2745
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.6...HEAD
2746
+ [0.61.6]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.5...v0.61.6
2740
2747
  [0.61.5]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.4...v0.61.5
2741
2748
  [0.61.4]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.3...v0.61.4
2742
2749
  [0.61.3]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.2...v0.61.3
package/README.ja.md CHANGED
@@ -209,7 +209,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
209
209
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
210
210
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
211
211
 
212
- **状態:** 開発継続中 · 現行公開版 **v0.61.5** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
212
+ **状態:** 開発継続中 · 現行公開版 **v0.61.6** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
213
213
 
214
214
  ### 更新と巻き戻し
215
215
 
@@ -559,6 +559,7 @@ MCPの本体を初めて使う時まで起こさない中継の後ろにAiterm
559
559
 
560
560
  `agent_launch({ harness, cwd, trust_project: true })`はpromptなしでも既知のworkspace・project hooks・MCP初期同意を
561
561
  進め、入力受付とharness生存を確認して`startup.status="ready"`を返す。指定なしのpromptなし起動は`not_checked`。
562
+ 起動準備は競合するmetadata保存が終わるのを待って続行する。端末回復と起動メニューの各キーでは世代・停止状態を再確認し、native起動が未確認になった場合は自動再実行せず診断用に保持する。
562
563
  Claude Code初回起動の文字表示テーマ選択では、画面で選択済みの項目を確定して起動を続ける。
563
564
  続いてログイン方式の選択が出た場合は`vendor_onboarding_required`を返す。公式の対話型Claude Code CLIで初回設定を完了する。
564
565
  入力受付の待ちは30秒。混んだ端末でagentの画面がまだ描かれていない間に切れた時だけ、起動から50秒まで待つ。
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.61.5** · 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.61.6** · 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
 
@@ -600,6 +600,7 @@ Owner start times are checked through `/proc` on Linux; elsewhere an existing PI
600
600
 
601
601
  `agent_launch({ harness, cwd, trust_project: true })` completes known workspace, project-hook, and project-MCP startup
602
602
  consent even without a prompt, then verifies input readiness and harness liveness before returning `startup.status="ready"`.
603
+ Startup checks wait for concurrent metadata writers before continuing. Each terminal recovery or startup-menu key still checks the current generation and stop state; an uncertain native launch remains available for status inspection without automatic replay.
603
604
  For Claude Code's first-run text-style menu, it confirms the item already selected on screen before continuing startup.
604
605
  If the CLI then requests an account login method, the launch reports `vendor_onboarding_required`; complete that choice in the official interactive Claude Code CLI.
605
606
  The input-readiness wait is 30 seconds. Only when it expires while the agent has not drawn anything yet (a busy host), the launch
package/dist/core.js CHANGED
@@ -209,7 +209,10 @@ function paneTtyOf(name) {
209
209
  * agent が tty 上に実在しない時は触らない(ready gate が入力受付不能として止める)。
210
210
  */
211
211
  export async function ensureAgentOwnsPaneInput(name, kind) {
212
- assertExecutionContext(name);
212
+ // Startup resumes after native creation/readiness awaits. A short metadata
213
+ // writer is not a reason to abandon that already created launch. Wait for
214
+ // admission, then run the unchanged source/target/generation checks.
215
+ await withExecutionNativeAdmission(name, () => assertExecutionContext(name));
213
216
  if (isWin)
214
217
  return [];
215
218
  const tty = paneTtyOf(name);
@@ -225,9 +228,11 @@ export async function ensureAgentOwnsPaneInput(name, kind) {
225
228
  return [];
226
229
  if (state.agentPresent && !state.agentForeground) {
227
230
  const wasStopped = state.agentStopped;
228
- tmux("send-keys", "-t", name, "C-u");
229
- tmux("send-keys", "-l", "-t", name, "fg");
230
- tmux("send-keys", "-t", name, "Enter");
231
+ await withExecutionNativeAdmission(name, () => {
232
+ tmux("send-keys", "-t", name, "C-u");
233
+ tmux("send-keys", "-l", "-t", name, "fg");
234
+ tmux("send-keys", "-t", name, "Enter");
235
+ });
231
236
  const deadline = performance.now() + AGENT_FOREGROUND_RECOVERY_TIMEOUT_MS;
232
237
  for (;;) {
233
238
  await sleep(AGENT_FOREGROUND_RECOVERY_POLL_MS);
@@ -250,11 +255,13 @@ export async function ensureAgentOwnsPaneInput(name, kind) {
250
255
  // stty is a native mutation outside tmux's command gate. Recheck the
251
256
  // captured device and the shared request generation/fence immediately
252
257
  // before dispatch; a replaced pane must not inherit the old tty repair.
253
- beforeExecutionEffect(name, () => {
254
- if (paneTtyOf(name) !== tty)
255
- throw new ExecutionError("EXECUTION_STALE_GENERATION");
258
+ const set = await withExecutionNativeAdmission(name, () => {
259
+ beforeExecutionEffect(name, () => {
260
+ if (paneTtyOf(name) !== tty)
261
+ throw new ExecutionError("EXECUTION_STALE_GENERATION");
262
+ });
263
+ return spawnSync("/bin/stty", [ttyFlag, tty, "raw", "-echo"], { encoding: "utf8", timeout: 5000, env: psEnv });
256
264
  });
257
- const set = spawnSync("/bin/stty", [ttyFlag, tty, "raw", "-echo"], { encoding: "utf8", timeout: 5000, env: psEnv });
258
265
  if (set.status !== 0) {
259
266
  throw new AitermError(`AGENT_TTY_COOKED session=${name}\n` +
260
267
  `tty が icanon/echo のままで raw へ戻せません: ${(set.stderr ?? "").trim() || `code=${set.status}`}。送信していません。`, 2);
@@ -4230,7 +4237,7 @@ async function prepareAgentInput(name, meta, options) {
4230
4237
  handled.add(action.kind);
4231
4238
  const keys = action.selected ? action.keys.slice(0, -1) : action.keys;
4232
4239
  for (const key of keys) {
4233
- sendKey(name, key, { preserveAgentOperation: true });
4240
+ await withExecutionNativeAdmission(name, () => sendKey(name, key, { preserveAgentOperation: true }));
4234
4241
  await sleep(AGENT_SUBMIT_DELAY_MS);
4235
4242
  }
4236
4243
  if (action.selected) {
@@ -4238,14 +4245,14 @@ async function prepareAgentInput(name, meta, options) {
4238
4245
  let moved = await waitStartupSelection(name, action.selected);
4239
4246
  if (!moved && keys.length > 0) {
4240
4247
  for (const key of keys) {
4241
- sendKey(name, key, { preserveAgentOperation: true });
4248
+ await withExecutionNativeAdmission(name, () => sendKey(name, key, { preserveAgentOperation: true }));
4242
4249
  await sleep(AGENT_SUBMIT_DELAY_MS);
4243
4250
  }
4244
4251
  moved = await waitStartupSelection(name, action.selected);
4245
4252
  }
4246
4253
  if (!moved)
4247
4254
  break;
4248
- sendKey(name, action.keys.at(-1), { preserveAgentOperation: true });
4255
+ await withExecutionNativeAdmission(name, () => sendKey(name, action.keys.at(-1), { preserveAgentOperation: true }));
4249
4256
  await sleep(AGENT_SUBMIT_DELAY_MS);
4250
4257
  }
4251
4258
  ready = await waitAgentTuiReady(name, meta, options.ready_timeout ?? AGENT_TUI_READY_TIMEOUT_MS);
package/docs/DESIGN.md CHANGED
@@ -29,6 +29,8 @@ POSIXのraw tty回復もnative作用であり、tmux打鍵と同じ受付を通
29
29
  実stty直前にも同じdeviceを確認する。停止や世代/tty交代後に古いdeviceへ回復を発行しない。
30
30
  一つのRPCが複数のnative作用を発行するときも、各回に同じissued slotとsource/target世代・停止を再確認する。
31
31
  agentの貼付け・Enterの同期区間は、既存metadata mutexを非同期に取得してから実行する。
32
+ native作成後に再開する起動準備も同じ非同期取得を通す。pane所有検査、fg/stty回復、
33
+ 起動メニューの各キーを短い同期区間で実行し、待機後の停止・世代・slot検査を省略しない。
32
34
  mutexをawait中へ持ち越さず、同じ同期stack内の各gateが発行記録を永続化してからnative作用へ進む。
33
35
  検証済みsourceと同世代への通常sendがissuedである間も、そのsourceの送信先が別ならoutgoing RPCは継続できる。
34
36
  incomingのslotを解放・書換・成功扱いせず、unknown・管理操作・世代不一致は従来どおり拒否する。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.61.5",
3
+ "version": "0.61.6",
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, and Cursor Agent CLI, plus durable PTYs for SSH, containers, and REPLs.",
6
6
  "keywords": [