aiterm-mcp 0.37.0 → 0.37.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.37.1] - 2026-09-13
11
+
12
+ ### 修正
13
+
14
+ - WindowsのCodexでhook確認画面の見出しが画面上部へ出た場合も認識し、`trust_project: true`による起動準備を完了する。
15
+ - npmのshell shimとnative Codexの間にNode processがある場合、同じ起動を複数候補と誤判定して停止する問題を修正した。
16
+
10
17
  ## [0.37.0] - 2026-09-13
11
18
 
12
19
  ### 追加
@@ -1664,7 +1671,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
1664
1671
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
1665
1672
  provenance.
1666
1673
 
1667
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.37.0...HEAD
1674
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.37.1...HEAD
1675
+ [0.37.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.37.0...v0.37.1
1668
1676
  [0.37.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.36.0...v0.37.0
1669
1677
  [0.36.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.35.1...v0.36.0
1670
1678
  [0.35.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.35.0...v0.35.1
package/README.ja.md CHANGED
@@ -57,7 +57,7 @@ aiterm-setup --json --codex-steer enable
57
57
 
58
58
  公式Codex Desktopに同梱されたApp Serverを使い、実行中の親には同じターンへ回答を送り、
59
59
  終了後に届いた回答でも同じタスクを自動再開します。App Serverの改造・再ビルド・別配布は不要です。
60
- Steerの初回設定後は`restart_required`(終了コード3)を返します。Codexを完全終了して再起動し、
60
+ 新しいlauncherを設定した場合は`restart_required`(終了コード3)を返します。Codexを完全終了して再起動し、
61
61
  `aiterm-setup --codex-steer status`で`ready`を確認してください。接続できない時にキューへ自動退避しません。
62
62
 
63
63
  選択と復元情報は`~/.config/aiterm-mcp/codex-relay/`へ保存します。macOSはユーザーLaunchAgent、
@@ -195,7 +195,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
195
195
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
196
196
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
197
197
 
198
- **状態:** 開発継続中 · 現行公開版 **v0.37.0** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
198
+ **状態:** 開発継続中 · 現行公開版 **v0.37.1** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
199
199
 
200
200
  ### 更新と巻き戻し
201
201
 
@@ -475,6 +475,7 @@ aiterm は同じ核心の洞察——端末を出会いの場にする——を
475
475
 
476
476
  `agent_launch({ harness, cwd, trust_project: true })`はpromptなしでも既知のworkspace・project hooks・MCP初期同意を
477
477
  進め、入力受付とharness生存を確認して`startup.status="ready"`を返す。指定なしのpromptなし起動は`not_checked`。
478
+ WindowsのCodexもhook確認を認識し、npm shim経由の起動を一つのharnessとして識別する。
478
479
  初手の`initial_prompt.status`は`not_requested`/`not_sent`/`submitted_unconfirmed`/`started`を区別する。
479
480
  未送信・未確認の失敗もsession付きstructuredContentを保持する。未確認のpromptを再送せず、返ったcursorで観測する。
480
481
 
package/README.md CHANGED
@@ -57,7 +57,7 @@ aiterm-setup --json --codex-steer enable
57
57
 
58
58
  公式Codex Desktopに同梱されたApp Serverを使い、実行中の親には同じターンへ回答を送り、
59
59
  終了後に届いた回答でも同じタスクを自動再開します。App Serverの改造・再ビルド・別配布は不要です。
60
- Steerの初回設定後は`restart_required`(終了コード3)を返します。Codexを完全終了して再起動し、
60
+ 新しいlauncherを設定した場合は`restart_required`(終了コード3)を返します。Codexを完全終了して再起動し、
61
61
  `aiterm-setup --codex-steer status`で`ready`を確認してください。接続できない時にキューへ自動退避しません。
62
62
 
63
63
  選択と復元情報は`~/.config/aiterm-mcp/codex-relay/`へ保存します。macOSはユーザーLaunchAgent、
@@ -209,7 +209,7 @@ collection is off by default and performs no network I/O. It ships via
209
209
  tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
210
210
  Release re-registers the Official MCP Registry entry.
211
211
 
212
- **Status:** actively maintained · current public release **v0.37.0** · 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).
212
+ **Status:** actively maintained · current public release **v0.37.1** · 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).
213
213
 
214
214
  ### Update and rollback
215
215
 
@@ -508,6 +508,7 @@ displayed token count or null. Callers do not need raw argv or pane-text parsing
508
508
  consent even without a prompt, then verifies input readiness and harness liveness before returning `startup.status="ready"`.
509
509
  A prompt-free launch without this option retains `startup.status="not_checked"`. `initial_prompt.status` distinguishes
510
510
  `not_requested`, `not_sent`, `submitted_unconfirmed`, and `started`. Failure responses retain structured session information.
511
+ WindowsのCodexもhook確認を認識し、npm shim経由の起動を一つのharnessとして識別する。
511
512
  Do not resend an unconfirmed prompt; observe or wait using its returned cursor.
512
513
 
513
514
  For a live Codex approval, inspect with `agent_approval({ action: "inspect", session_id })`, review `prompt` and `choices`,
package/dist/core.js CHANGED
@@ -1051,7 +1051,7 @@ function decodeActivityCursor(cursor, name) {
1051
1051
  throw new AitermError("活動観測cursorが対象sessionの形式と一致しません", 2);
1052
1052
  return value;
1053
1053
  }
1054
- function selectHarnessProcesses(meta, rows, subtree) {
1054
+ export function selectHarnessProcesses(meta, rows, subtree) {
1055
1055
  const matches = (row) => {
1056
1056
  const first = /^(?:"([^"]+)"|(\S+))/.exec(row.command);
1057
1057
  const executable = path.posix.basename((first?.[1] ?? first?.[2] ?? "").replace(/\\/g, "/"))
@@ -1065,7 +1065,20 @@ function selectHarnessProcesses(meta, rows, subtree) {
1065
1065
  // WindowsのMSYS execでnative親子関係が切れる場合も、launch固有引数で相関する。
1066
1066
  const correlated = rows.filter(row => matches(row) && row.command.includes(meta.launch_id));
1067
1067
  const candidates = correlated.length ? correlated : subtree.filter(matches);
1068
- const roots = candidates.filter(row => !candidates.some(parent => row.parent_pid === parent.pid));
1068
+ const byPid = new Map(rows.map(row => [row.pid, row]));
1069
+ const candidatePids = new Set(candidates.map(row => row.pid));
1070
+ // npm shimとnative本体の間にNodeなどの非候補processがいても、同じ起動の祖先を辿る。
1071
+ const roots = candidates.filter(row => {
1072
+ const seen = new Set();
1073
+ let parent = byPid.get(row.parent_pid);
1074
+ while (parent && !seen.has(parent.pid)) {
1075
+ if (candidatePids.has(parent.pid))
1076
+ return false;
1077
+ seen.add(parent.pid);
1078
+ parent = byPid.get(parent.parent_pid);
1079
+ }
1080
+ return true;
1081
+ });
1069
1082
  return roots;
1070
1083
  }
1071
1084
  export function observeSession(name, cursor) {
@@ -386,7 +386,7 @@ export function codexTuiReady(screen) {
386
386
  return codexFrontend && /(^|\n)[ \t]*[›>](?![ \t]*\d+\.)/.test(screen);
387
387
  }
388
388
  function currentCodexDialog(screen) {
389
- const footers = [...screen.matchAll(/Press enter to confirm or esc to cancel|enter to submit\s*\|\s*esc to cancel/gi)];
389
+ const footers = [...screen.matchAll(/Press enter to confirm or esc to (?:cancel|go back)|enter to submit\s*\|\s*esc to cancel/gi)];
390
390
  // 過去の完了footerより前の質問・選択番号を、現在のdialogへ持ち込まない。
391
391
  const previousFooter = footers.at(-2);
392
392
  const current = previousFooter ? screen.slice(previousFooter.index + previousFooter[0].length) : screen;
@@ -400,7 +400,7 @@ export function codexPaneObservation(screen) {
400
400
  const tail = screen.split("\n").slice(-24).join("\n");
401
401
  // 現在のmodal footerがある時だけ、折返しで上へ出た質問を画面全体から探す。
402
402
  const lastComposer = [...tail.matchAll(/(?:^|\n)[ \t]*[›>](?![ \t]*\d+\.)/g)].at(-1)?.index ?? -1;
403
- const lastDialog = [...tail.matchAll(/Press enter to confirm or esc to cancel|enter to submit\s*\|\s*esc to cancel|Would you like to run the following command\?|Allow the [^\n]+ MCP server to run tool|Hooks need review|Do you trust the contents of this directory|Update available!/gi)].at(-1)?.index ?? -1;
403
+ const lastDialog = [...tail.matchAll(/Press enter to confirm or esc to (?:cancel|go back)|enter to submit\s*\|\s*esc to cancel|Would you like to run the following command\?|Allow the [^\n]+ MCP server to run tool|Hooks need review|Do you trust the contents of this directory|Update available!/gi)].at(-1)?.index ?? -1;
404
404
  const modal = lastDialog > lastComposer;
405
405
  if (!modal) {
406
406
  if (/esc to interrupt/i.test(tail))
package/docs/DESIGN.md CHANGED
@@ -34,6 +34,8 @@ psmuxが出力した余分な環境値を返さない。通常PTYとagentへ`AIT
34
34
 
35
35
  `pty_observe`は存在、pane/harnessの生存、画面状態と理由、native process identityを分ける。
36
36
  PIDは開始識別子・argv digestと組にし、paneとharnessを同一視しない。特定できないidentityはnull。
37
+ 同じlaunchに属するnpm shimとnative本体は、中間の非候補processも含めた祖先関係から一つの起動として扱う。
38
+ 祖先を共有しない候補は別々に残し、複数候補を一つと推測しない。
37
39
  POSIXの停止状態はOSのprocess表から取得し、SIGSTOP中は残画面より優先して`blocked/harness_stopped`を返す。
38
40
  画面本文とargv本文は返さず、活動cursorには画面digestとprocess別CPUだけを持たせる。
39
41
  初回とpane再作成後の差分はnull。区間中にprocessが消えた時は観測できたCPU増分だけを返し、
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
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": [