aiterm-mcp 0.62.6 → 0.63.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/docs/DESIGN.md CHANGED
@@ -85,6 +85,7 @@ coreの観測(`pty_observe`)・起動準備・送信口・停止は`kind`を
85
85
  agent入力欄への`bracketedPaste`は、制御文字の除去後も本文のまま渡す。nativeの前面process名が起動shellを報告していてもshell実行文へ変換しない。shell用のUTF-8初期化・複数行適合はshell送信(利用者のshell送信と、Aiterm自身のbash起動command)だけに適用する。
86
86
 
87
87
  `pty_read`は制御文字除去、反復圧縮、head+tail、command別reducerでcontext量を減らす。
88
+ CR後の表示制御だけの断片は既印字内容を消さず、文字による進捗上書きと明示的な行消去は維持する。同じ整形を使うmark検出でも結果と相関IDを保持する。
88
89
  完了はprocess exit、shell sentinel、literal/regex `until`、shell復帰を伴うquiescence、timeoutを区別する。
89
90
  新しいmarkは送信IDを完了印と待機fileへ結び、旧commandの印を次の完了へ使わない。旧producerのpending flagは読取り互換を保ち、旧readの完了で新しい待機fileを消さない。ID保存失敗は入力前拒否。
90
91
  要求されたsentinel/untilを静止判定より優先し、nested shellで証拠がない状態を完了へ丸めない。
@@ -183,6 +184,12 @@ Codex model-only configuration reads the native current effort before navigating
183
184
 
184
185
  4harness共通の`agent_configure`は、変更を発行し得る境界に達したかを要求内で保持する。失敗は`aiterm.agent-configure-error.v1`の`not_applied/not_started`又は`outcome_unknown/possible`で返し、後者には部分適用を含む。これは要求単位の保守的な分類で、以前の実設定や他要求の状態は証明しない。成功型は維持し、Codexの完了は指定ID・effortに一致する新規native通知を確認する。別modelの通知や残画面では成功にしない。
185
186
 
187
+ Codex v1のactive goalは設定替えの間だけ一時停止する。`configure-goal.ts`がpause→nativeの番終了待ち→既存の設定替え→resumeを持つ。coreは同じlaunch/threadへの束縛と番終了記録を供給し、待機中は送信lockを持たない。pause/resumeは既存のCLI goal adapterで一度だけ発行し、mutation直前のnative readbackが比較元から変われば発行しない。設定替え失敗でも自分のpauseの復元を試み、別goalや変更されたgoalは再開しない。公開schemaは維持し、設定とgoalの不確定な結果はエラー本文で併記する(ADR 0137)。
188
+
189
+ 無活動判定用の時刻は、起動世代ごとのactivity.jsonlに追記する。agent-activity.tsがlast_input_atとlast_turn_end_atを返し、metadata全体を書き戻す処理とは独立する。親からの初手・dispatch・steerのPTY書込み境界と、Claude Stop/既存のnative完了観測だけが記録する。同じ番の完了を繰り返し読んでも起点を更新せず、途中出力・画面描画・設定命令では更新しない。履歴欠測と破損は未知として扱い、時刻記録失敗で既に得た完了結果を失わせない。Claude/Codexの3OS実会話復帰・公開論理席とconsumer受入に基づき、通常起動では自動休止を有効にする(ADR 0138)。node:testのfixtureはcontrollerを明示駆動し、無人timerを作らない。
190
+
191
+ 休止判定の部品はagent-idle.ts、木の停止はprocess-tree-stop.tsに置く。前者はruntimeが供給する既存の席admissionで世代/入力/保護条件を再確認し、未確定を成功にしない。後者は本人性を照合したpane木へTERM→5秒→KILLと退出確認を行い、POSIXの別sessionを除外する。OSごとのsignalはprocess-runtime.tsが所有する。本体adapterは既存送信queue/file lockで期待launchと元のnative ID/pane本人性を固定する。最新native完了の保存とprivate resume recipeの一致を確認し、durable stoppingの後も最初のsignal前は保護条件全体を再確認する。効果前だけ準備を取消し、効果後の不明はstoppingに残す。木の退出後に元native IDを閉じ、同世代だけをhibernatedへ進める。時計はper-launchのdetached shell/sleep(WindowsはPowerShell 7)で待ち、起床時だけNodeで同じC判定を行う。owner/tokenを同じ送信排他で記録し、busy等は60秒後の後続確認を持つ。list/launch/Stop/waiterから起動口を通し、元のnative作成proofが無い旧席には時計を登録しない。新規起動templateと設定替えの更新は接続し、既定値欠測や途中設定失敗は休止を許可しない。各世代のmetadataは保持し、active-launch.jsonの原子的切替で現在のlaunchを選ぶ。Codexの停止前には一意な起動marker付きroot/完了境界を検証し、file本人性・prefix hash・旧cursor/turn IDのproofをlifecycleへ束縛する。resumed_fromを持つ読取りは旧metadata/lifecycle/recipe/proofを照合し、保存cursor以前と最後の旧turnの遅れた記録を除外する。通常waiter・番境界・差し込み・合間の言葉と次回停止が同じ相関を使い、復帰後の/newは新markerだけで認める。物理再開候補は同じ送信排他で旧stateを残し、新世代の公式resume→ready/fast確認→本文投入を進める。private resume-attemptの失敗は追加CLIと本文を止め、Claudeの設定rootもper-launchで保持する。通常POSIXのmanaged Claude/Codex初回起動も、実create receiptをその場で取得し、送信/休止と同じfile lockを取ってから旧記録を掃除する。同名置換・休止競合ではCLIを入れず古い記録を残し、自動採番も論理席名を避ける。実create receipt由来のnative IDとserver/paneの開始本人性をprivateに保存し、同じ送信排他でCLI/ready/fast/本文と後続操作を固定する。tmux受信側のnative format条件も同じqueueで確かめ、server再起動によるID再利用を拒否する。既存effect guardを迂回せず、正規resume transitionの無いmounted graphは停止・再開対象外にする。Windowsはqualified paneと固定server認証・native本人性を用いる。既存psmux registry保護を開始本人性取得の前へ置き、server/paneの開始時刻は保存精度を保って一括取得する。Windows closeは元server終了の確認後に記録を片付ける。受信側命令の引用はpsmuxのparserに合わせる。Windowsのnative clockはconsoleを継がないProcessStartInfoとnull標準handleで起こし、一時receiptのPID/開始時刻を保存して起動helperを終了する。同名agent_launchも保存設定を照合して同会話へ戻し、既存の初手/tupleを使う。公開list/observe/seat_turns/closeは論理席を扱い、内部の物理観測と分離する。native読取り/キー/承認は休止・復帰途中・失敗を拒否し、復帰先の実receiptへ固定する。中断は確定休止ならidleで返し、途中や不整合を拒否する。キーと承認応答は送信file lockを共有し、停止ボタンの即時性と既存のキー制限は維持する。登録env名も再現し、復帰中から公開一覧の本人性を保つ。native手動設定とClaude/Codex各3OSの実会話復帰、公開論理席とconsumerを受入済み。元作成証拠を持たない旧席・未受入harnessは対象へ登録しない(ADR 0138)。
192
+
186
193
  agent turnは常に非ブロックdispatchであり、receiptの`event_cursor`がturn境界になる。
187
194
  Codex親にはAitermのMCP processが完了を観測し、選択設定に応じて公式Steerまたはqueueへ本文を自動配送する。
188
195
  Claude Code親は公式の非同期hookで本文を受け取り、待機中も新しいturnへ進める。
@@ -572,3 +579,7 @@ Native Claude goal input also verifies the official per-PID current-session regi
572
579
  Grok 1.0.70 inspection verifies active_sessions.json against the original TUI PID, Linux birth ticks, cwd and vendor session. A fresh local /goal status update on that same session establishes null only with an absent state file, or an existing goal whose ID and exact objective remain stable across the query. The native persisted snapshot remains in goal.native; goal.current_status carries the separately parsed current status, phase, safe integer token count and original elapsed display. Resuming can leave persisted phase different from the live worker. Neither an old reply nor the snapshot supplies current values. A busy TUI queues the local slash command. The adapter does not send it on busy minimal views. An already fullscreen root view with a known Goal header and empty boxed composer instead permits native Goal-detail inspection. Core validates pane coordinates and the harness-provided current viewport predicate immediately before the bounded SGR pointer press/release, under the existing generation, PID-birth, current-session, TTY foreground/raw and native-admission checks. The harness uses string-width 7.2.0 display cells, requires the exact untruncated objective and stable native goal ID across the observation, then closes only its recognized modal with a current-row-checked key and confirms the empty composer. It neither switches modes nor stops a turn. The UI has rounded budget text and a phase label rather than an exact native phase/counter: the goal-detail current_status variant preserves those display strings while phase and tokens_used are null. Unknown views, existing drafts, moved hit targets and unavailable native ownership never trigger another input or a query through another leader. No leader, worker or conversation is created or resumed by product inspection.
573
580
 
574
581
  Grok clear uses the existing host-origin contract and only a fresh UserPaused/Idle status and empty composer on the same original worker. The native manager advertises clear only with a freshly observed existing goal and confirmed input readiness. The harness verifies the same goal ID/objective before paste and immediately before Enter, and accepts only the current anchored completion menu for the exact command when minimal mode hides its model footer. Core repeats current viewport and native ownership checks under input admission. A single /goal clear requires a fresh same-session host-turn reply of Goal cleared. plus absent native state; the manager then reads a separate fresh no-goal status. A known pre-Enter refusal remains not_issued; uncertain input or missing/replaced readback removes the goal and capabilities and reports outcome_unknown. It never retries, restores a goal, interrupts a turn or routes to another worker. Other Grok mutations remain unsupported.
582
+
583
+ 休止の直前には、保存templateではなく元nativeのmodel/effort/fast表示を、同じ送信admissionとcreate receiptで確認する。harnesses/idle-settings.tsが保存しないnative表示の確認/取消しを所有し、coreは既存の入力とready確認を供給する。確認後の画面やattach履歴が最初のsignal前に変われば停止しない。未対応表示や現在設定の欠測はskipし、native表示用の命令を活動時刻へ数えない。詳細と現時点の受入限界はADR0138。
584
+
585
+ Claude resume preserves the original CLAUDE_CONFIG_DIR selector (including unset) separately from its resolved path; incomplete old selectors remain unavailable. Security notes block startup even when an older shell marker remains above them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.62.6",
3
+ "version": "0.63.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, Cursor Agent CLI, and Antigravity CLI, plus durable PTYs for SSH, containers, and REPLs.",
6
6
  "keywords": [
@@ -46,7 +46,8 @@
46
46
  "aiterm-wait": "dist/aiterm-wait-cli.js",
47
47
  "aiterm-delivery-wake": "dist/delivery-wake-cli.js",
48
48
  "aiterm-parent-delivery": "dist/parent-delivery-cli.js",
49
- "aiterm-update": "dist/update-cli.js"
49
+ "aiterm-update": "dist/update-cli.js",
50
+ "aiterm-idle-check": "dist/agent-idle-cli.js"
50
51
  },
51
52
  "files": [
52
53
  "dist/*.js",
@@ -61,12 +62,18 @@
61
62
  "engines": {
62
63
  "node": ">=18"
63
64
  },
65
+ "testgate": {
66
+ "wrappers": {
67
+ "scripts/run-seat-tests.mjs": {}
68
+ }
69
+ },
64
70
  "scripts": {
65
71
  "build": "node scripts/clean-build.mjs && tsc",
66
72
  "mcpb:build": "npm run build && node scripts/build-mcpb.mjs && npm ci --omit=dev --ignore-scripts --no-audit --no-fund --prefix dist/mcpb-stage/server && npx --yes @anthropic-ai/mcpb@2.1.2 validate dist/mcpb-stage/manifest.json && npx --yes @anthropic-ai/mcpb@2.1.2 pack dist/mcpb-stage dist/aiterm-mcp.mcpb",
67
73
  "verify:release-commit": "node scripts/verify-release-commit.mjs",
68
74
  "release": "node scripts/release.mjs",
69
75
  "test:docs": "node scripts/run-seat-tests.mjs --test test/repository-contract.test.mjs",
76
+ "test:dev": "node scripts/run-seat-tests.mjs --test scripts/verify-release-commit.test.mjs test/*.test.mjs",
70
77
  "prepublishOnly": "npm run verify:release-commit && npm run build",
71
78
  "start": "node dist/index.js",
72
79
  "test": "npm run build && node scripts/run-seat-tests.mjs --test test/seat-env.test.mjs && node scripts/run-seat-tests.mjs --test scripts/verify-release-commit.test.mjs test/*.test.mjs",