aiterm-mcp 0.40.2 → 0.40.3
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 +8 -1
- package/README.ja.md +13 -12
- package/README.md +15 -14
- package/dist/harnesses/grok.js +4 -3
- package/dist/index.js +3 -3
- package/docs/DESIGN.md +5 -5
- package/package.json +1 -1
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.40.3] - 2026-09-27
|
|
11
|
+
|
|
12
|
+
### 文書
|
|
13
|
+
|
|
14
|
+
- Composerの位置づけを改めた。ComposerはCursorのmodelの一つで、harnessでもGrokのmodelでもない。README・AGENTS.md・CONTRIBUTING.md・DESIGN・ツール説明から「Grok/Composer」の併記とGrok CLI presetという説明を外し、`agent_launch(harness=cursor-cli, model=composer-2.5-fast)`を案内する。旧互換alias `composer_agent`は旧Grok CLI presetのままで、現行Grok CLIでは起動できないことを説明に明記した。
|
|
15
|
+
|
|
10
16
|
## [0.40.2] - 2026-09-27
|
|
11
17
|
|
|
12
18
|
### 修正
|
|
@@ -1798,7 +1804,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
1798
1804
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
1799
1805
|
provenance.
|
|
1800
1806
|
|
|
1801
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.40.
|
|
1807
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.40.3...HEAD
|
|
1808
|
+
[0.40.3]: https://github.com/kitepon/aiterm-mcp/compare/v0.40.2...v0.40.3
|
|
1802
1809
|
[0.40.2]: https://github.com/kitepon/aiterm-mcp/compare/v0.40.1...v0.40.2
|
|
1803
1810
|
[0.40.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.40.0...v0.40.1
|
|
1804
1811
|
[0.40.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.39.1...v0.40.0
|
package/README.ja.md
CHANGED
|
@@ -145,7 +145,7 @@ diagnostics、recovery、update、releaseを所有します。このREADMEと[
|
|
|
145
145
|
|
|
146
146
|
17ツール: 7つのPTYツール、正規のagent起動入口`agent_launch`、移行用の旧4alias、`agent_configure`、`agent_approval`、`claude_turn`、`claude_approval`、`diagnostics`。backendはPOSIXのtmux/Windows nativeのpsmuxなので、MCPサーバやAIクライアントが再起動してもsessionは生き残る。
|
|
147
147
|
|
|
148
|
-
**v0.28.0では実行基盤harnessとmodelを分離した。** harnessはagent loop・認証・hook・session・transcriptを所有し、modelはその上で選ぶ。Cursor Agent CLIでGPT/Claude/Grokを選んでも完了契約はCursor方式のまま。Composer
|
|
148
|
+
**v0.28.0では実行基盤harnessとmodelを分離した。** harnessはagent loop・認証・hook・session・transcriptを所有し、modelはその上で選ぶ。Cursor Agent CLIでGPT/Claude/Grokを選んでも完了契約はCursor方式のまま。ComposerはCursorのmodelの一つで、harnessでもGrokのmodelでもない。`harness:"cursor-cli", model:"composer-2.5-fast"`(または`composer-2.5`)で表す。旧4起動ツールは同じ実装へ流れる互換alias。
|
|
149
149
|
|
|
150
150
|
**v0.25.2ではGrok 4.6を含む同一sessionの連続設定変更を安定化。** Grok Build 1.0.3で
|
|
151
151
|
`/model`の成功通知が再描画により消えても、変更前には無かった要求model/effortが常駐footerへ現れた
|
|
@@ -156,6 +156,7 @@ diagnostics、recovery、update、releaseを所有します。このREADMEと[
|
|
|
156
156
|
`write_scope:"read-only"`の`--sandbox read-only`強制、`agent_configure`による同一session内の
|
|
157
157
|
model/effort変更に対応した。明示したGrok/Composer modelとComposer既定modelはPTY作成前に
|
|
158
158
|
現在の`grok models` catalogへ照合し、不在時は別modelへ黙ってfallbackせず明示失敗する。
|
|
159
|
+
その後ComposerはGrok CLIから外れ、現在はCursorのmodelの一つである。
|
|
159
160
|
|
|
160
161
|
**v0.24.3ではlauncherへ渡す環境変数を現在のMCP processから明示選択できる。** `env_vars`へ
|
|
161
162
|
変数名だけを指定すると、aitermは起動時の現在値を読み、存在する値だけをそのagentへ渡す。永続multiplexer
|
|
@@ -202,7 +203,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
|
|
|
202
203
|
場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
|
|
203
204
|
Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
|
|
204
205
|
|
|
205
|
-
**状態:** 開発継続中 · 現行公開版 **v0.40.
|
|
206
|
+
**状態:** 開発継続中 · 現行公開版 **v0.40.3** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
206
207
|
|
|
207
208
|
### 更新と巻き戻し
|
|
208
209
|
|
|
@@ -254,15 +255,15 @@ pty_read(id, { wait: true }) → 削減済みの出力を読む(完了
|
|
|
254
255
|
|
|
255
256
|
`agent_launch`は任意の`write_scope`も受ける。Codex/Grokのread-onlyは`--sandbox read-only`、Cursorは公式`--mode ask`で実効化する。path説明は同等CLI引数がないためdeclaration-only。
|
|
256
257
|
|
|
257
|
-
Grok
|
|
258
|
+
Grokの無人起動は公式`--trust`で指定された作業フォルダを信頼登録し、確認画面を完了してから初回promptを送る。この登録はGrok CLIの信頼ストアへ保存され、フォルダ内のhook・MCP・LSPにも適用される。read-only sandboxの制限は維持する。画面に残る完了済みhookの結果は実行中と判定しない。
|
|
258
259
|
|
|
259
|
-
Grok
|
|
260
|
+
Grokで終了済みターンのweekly-limitパネルが残っている場合、次の通常`pty_send`が`Shift+X`で一度閉じ、入力受付を確認して今回の本文を送る。同じsessionと会話を保ち、receiptの`pane_input_recovery`に`grok_rate_limit_dialog_dismissed`を記録する。ターン未終了・harness不在は`GROK_RATE_LIMIT_RECOVERY_BLOCKED`、解除後の入力受付失敗は`GROK_RATE_LIMIT_RECOVERY_FAILED`となり、本文は未送信。上限の継続は`rate_limited`として返し、過去promptは再送しない。Grokの上限観測には現在の画面だけを使う。
|
|
260
261
|
|
|
261
262
|
Cursorの送信前hook(`beforeSubmitPrompt`と、互換読込するClaude Codeの`UserPromptSubmit`)がpromptを拒否すると、Cursorはpromptを捨て、turnも完了も起きない。Aitermはこの拒否の表示を見分け、起動時promptは`initial_prompt=failed`、`pty_send`は成功receiptを返さず、どちらも`USER_HOOK_BLOCKED`とhookの出力を返す。確認時間(3秒)より後の拒否は、完了待ちが`outcome=error`(`aiterm-wait`はexit 7)で返す。
|
|
262
263
|
|
|
263
|
-
Grok
|
|
264
|
+
Grokがread-only sandboxの適用を拒否した場合、prompt送信時に`GROK_SANDBOX_STARTUP_FAILED`とCLIの原因を返す。例えばhookのパスにシンボリックリンクがあるとGrok CLIは起動を拒否する。設定の管理元で原因を修正し、対象sessionを`pty_close`して起動し直す。Aitermはsandboxを解除したりhookをコピーしたりしない。
|
|
264
265
|
|
|
265
|
-
この判定はGrok
|
|
266
|
+
この判定はGrok専用アダプターが所有する。初回prompt付きの`agent_launch`と通常の`pty_send`で、入力受付待ち中に拒否を検出すると未送信のエラーを返す。promptなし・`trust_project`指定なしの起動応答は入力受付を保証しない。`trust_project:true`では入力受付まで確認し、`startup.status`を返す。Grokのprivacy notice起動設定も同アダプターが所有する。実装の責務分担は[DESIGN](docs/DESIGN.md#failure-and-recovery)を参照。
|
|
266
267
|
|
|
267
268
|
Codex 0.155.1の「Approaching rate limits」model切替dialogは、通常の`pty_send`と`agent_configure`で同じsessionのまま一時的な**2. Keep current model**だけを選ぶ。入力受付を再確認してから本文または設定変更を進め、dispatch receiptの`pane_input_recovery`には`codex_rate_limit_model_switch_kept_current`を記録する。model切替と今後の表示抑止は選ばない。入力受付へ戻らなければ`CODEX_RATE_LIMIT_MODEL_SWITCH_RECOVERY_FAILED`となり、本文・設定変更は未送信。このdialogは`agent_approval`の対象ではなく、inspectは`reason="rate_limit_model_switch"`だけを返し、prompt digestとchoicesを出さない。
|
|
268
269
|
|
|
@@ -285,7 +286,7 @@ $ aiterm-wait --session codex1 --cursor <event_cursor> # exit 0=done / 3=timeo
|
|
|
285
286
|
| --- | --- | --- |
|
|
286
287
|
| `claude-code` | Claude Code CLI | Claude model/effort |
|
|
287
288
|
| `codex-cli` | Codex CLI | OpenAI model/effort |
|
|
288
|
-
| `grok-cli` | Grok Build CLI | Grok model、live catalog
|
|
289
|
+
| `grok-cli` | Grok Build CLI | Grok model、live catalog照合 |
|
|
289
290
|
| `cursor-cli` | Cursor Agent CLI | Cursor catalog上のGPT/Claude/Grok等 |
|
|
290
291
|
|
|
291
292
|
Cursorの`model`は`gpt-5.6-luna`のようなbase model、`reasoning_effort`は`high`のように別指定する。adapterは現行`model-effort` IDを`cursor-agent models`へ照合し、起動中変更はCursor標準model pickerのparameter editorを使う。不在時は別modelへfallbackしない。
|
|
@@ -395,7 +396,7 @@ claude mcp add --scope user --transport stdio aiterm -- aiterm-mcp
|
|
|
395
396
|
|
|
396
397
|
MCP クライアントが aiterm を stdio 越しにプログラムから駆動するので、上のすべては **端末に誰も座らないまま**動く。任意のMCP対応統括役が、自分と同じharnessを含む`agent_launch`を呼び、`pty_read`で結果を読んで次へ進める——無人で。これは、人が操作する端末が向かない場所にこそ aiterm が合うということ:
|
|
397
398
|
|
|
398
|
-
- **複数エージェントのオーケストレーション** — 統括役がサブタスクを Claude Code / Codex / Grok / Cursor harnessへ渡し、各々を専用の永続セッションに置き、全部を読み戻す。ComposerはCursor
|
|
399
|
+
- **複数エージェントのオーケストレーション** — 統括役がサブタスクを Claude Code / Codex / Grok / Cursor harnessへ渡し、各々を専用の永続セッションに置き、全部を読み戻す。ComposerはCursorが選ぶmodelの一つ(`composer-2.5-fast`)。
|
|
399
400
|
- **CI** — ジョブのステップがエージェントを起こし、操作し、片付けられる。
|
|
400
401
|
- **cron** — スケジュール実行がエージェントを起動して出力を回収できる。
|
|
401
402
|
|
|
@@ -522,8 +523,8 @@ Claudeの相関済み承認は既存の`claude_approval`を使う。
|
|
|
522
523
|
| `pty_observe` | pane/harnessの生存、native process identity、状態と活動 | `session_id`, `cursor?` |
|
|
523
524
|
| `agent_launch` | harnessとmodelを別軸で選ぶ正規agent起動入口 | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?`, `trust_project?`, `env_vars?`, `throughline_source_session?`, `throughline_supplement_file?` |
|
|
524
525
|
| `agent_approval` | Codexの現在の承認を検査し、単発許可・拒否を送る | `action`, `session_id`, `approval_choice?`, `observed_prompt_digest?` |
|
|
525
|
-
| `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | deprecated互換alias | 旧launcher引数 |
|
|
526
|
-
| `agent_configure` | 起動中のClaude/Codex/Grok/
|
|
526
|
+
| `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | deprecated互換alias(`composer_agent`は旧Grok CLI presetで今は起動できない。Composerは`agent_launch`の`cursor-cli`で使う) | 旧launcher引数 |
|
|
527
|
+
| `agent_configure` | 起動中のClaude/Codex/Grok/Cursorを再起動せずmodel/effort変更 | `session_id`, `model?`, `reasoning_effort?` |
|
|
527
528
|
| `claude_turn` | 相関済みClaude operationをdispatch(issue)または回収(recover) | `action`, `session_id`, `operation_id`, `text?` |
|
|
528
529
|
| `claude_approval` | 現在表示中の相関済みClaude承認UIを検査または応答 | `action`, `session_id`, `operation_id?`, `approval_choice?`, `observed_prompt_digest?` |
|
|
529
530
|
| `diagnostics` | 機械可読 JSON による read-only factory readiness | (なし) |
|
|
@@ -540,13 +541,13 @@ consumer は `aiterm-runtime-errors snapshot` を読み、durable ingestion 後
|
|
|
540
541
|
|
|
541
542
|
`agent_launch`は選んだharnessの対話TUIを新しい永続PTYに起動し、`session_id`を返す。harnessはagent loop・認証・hook・session・transcriptを所有し、modelは独立。以後は他sessionと同じ`pty_read`/`pty_send`で操作する。
|
|
542
543
|
|
|
543
|
-
`agent_configure({ session_id, model?, reasoning_effort? })`はharness標準操作で起動中のClaude/Codex/Grok/
|
|
544
|
+
`agent_configure({ session_id, model?, reasoning_effort? })`はharness標準操作で起動中のClaude/Codex/Grok/Cursorを変更し、PTYと会話contextを維持する。
|
|
544
545
|
|
|
545
546
|
| `harness` | 起動するもの | modelの扱い |
|
|
546
547
|
| --- | --- | --- |
|
|
547
548
|
| `claude-code` | Claude Code CLI | Claude model/effort |
|
|
548
549
|
| `codex-cli` | Codex CLI | OpenAI model/effort |
|
|
549
|
-
| `grok-cli` | Grok Build CLI | Grok model、live catalog
|
|
550
|
+
| `grok-cli` | Grok Build CLI | Grok model、live catalog照合 |
|
|
550
551
|
| `cursor-cli` | Cursor Agent CLI | Cursor catalog上のGPT/Claude/Grok等 |
|
|
551
552
|
|
|
552
553
|
対応するCLI(`claude`/`codex`/`grok`/`cursor-agent`)の公式導入・認証が必要。前提違反はsession作成前に明示失敗する。全harnessが通常project/user環境と同じ非ブロックdispatch契約を使う。
|
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ Aiterm and is not a runtime dependency.
|
|
|
147
147
|
|
|
148
148
|
Seventeen tools: seven **PTY tools** — `pty_open` / `pty_send` / `pty_read` / `pty_key` / `pty_close` / `pty_list` / `pty_observe` — to open, drive, read, and observe one persistent terminal; one canonical **agent launcher**, `agent_launch`, which selects `claude-code`, `codex-cli`, `grok-cli`, or `cursor-cli` as the execution harness; four deprecated launcher aliases kept for migration; `agent_configure`; `agent_approval`; `claude_turn`; `claude_approval`; and `diagnostics`. The backend is **tmux on POSIX and psmux on native Windows**, so sessions survive even if the MCP server or the AI client restarts.
|
|
149
149
|
|
|
150
|
-
**v0.28.0 separates the execution harness from the model.** The harness owns the agent loop, authentication, hooks, session, and transcript; `model` is what that harness runs. Cursor Agent CLI can therefore select GPT, Claude, or Grok without changing the completion contract from Cursor hooks to another harness's. Composer is
|
|
150
|
+
**v0.28.0 separates the execution harness from the model.** The harness owns the agent loop, authentication, hooks, session, and transcript; `model` is what that harness runs. Cursor Agent CLI can therefore select GPT, Claude, or Grok without changing the completion contract from Cursor hooks to another harness's. Composer is one of Cursor's models, not a harness and not a Grok model: use `harness: "cursor-cli", model: "composer-2.5-fast"` (or `composer-2.5`). The old four launcher tools are thin compatibility aliases over the same implementation.
|
|
151
151
|
|
|
152
152
|
**v0.25.2 stabilizes repeated in-place configuration changes, including Grok 4.6.** If Grok Build
|
|
153
153
|
1.0.3 redraws before its `/model` success notice can be observed, aiterm confirms the requested model/effort
|
|
@@ -159,6 +159,7 @@ round a failure into success; explicit `grok-4.6` launch and configuration still
|
|
|
159
159
|
in-place model/effort changes through `agent_configure`. Before creating a PTY, aiterm checks an
|
|
160
160
|
explicit Grok/Composer model—and Composer's default model—against the live `grok models` catalog.
|
|
161
161
|
An unavailable model fails visibly instead of letting the harness CLI fall back to another model.
|
|
162
|
+
Composer has since left the Grok CLI and is now one of Cursor's models.
|
|
162
163
|
|
|
163
164
|
**v0.24.3 forwards explicitly selected launcher environment variables from the current MCP process.**
|
|
164
165
|
Pass variable names in `env_vars`; aiterm reads their current values at launch and injects only the
|
|
@@ -216,7 +217,7 @@ collection is off by default and performs no network I/O. It ships via
|
|
|
216
217
|
tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
|
|
217
218
|
Release re-registers the Official MCP Registry entry.
|
|
218
219
|
|
|
219
|
-
**Status:** actively maintained · current public release **v0.40.
|
|
220
|
+
**Status:** actively maintained · current public release **v0.40.3** · 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).
|
|
220
221
|
|
|
221
222
|
### Update and rollback
|
|
222
223
|
|
|
@@ -275,15 +276,15 @@ The same primitive hosts another agent's TUI. `agent_launch` starts a selected e
|
|
|
275
276
|
|
|
276
277
|
`agent_launch` accepts an optional `write_scope`: either `"read-only"` or a human-readable description of writable paths. Codex/Grok use `--sandbox read-only`; Cursor uses its official read-only `--mode ask`. A path description remains declaration-only because these CLI launch surfaces provide no equivalent path allowlist flag.
|
|
277
278
|
|
|
278
|
-
Grok
|
|
279
|
+
Grokの無人起動は公式`--trust`で指定された作業フォルダを信頼登録し、確認画面を完了してから初回promptを送る。この登録はGrok CLIの信頼ストアへ保存され、フォルダ内のhook・MCP・LSPにも適用される。read-only sandboxの制限は維持する。画面に残る完了済みhookの結果は実行中と判定しない。
|
|
279
280
|
|
|
280
|
-
Grok
|
|
281
|
+
Grokで終了済みターンのweekly-limitパネルが残っている場合、次の通常`pty_send`が`Shift+X`で一度閉じ、入力受付を確認して今回の本文を送る。同じsessionと会話を保ち、receiptの`pane_input_recovery`に`grok_rate_limit_dialog_dismissed`を記録する。ターン未終了・harness不在は`GROK_RATE_LIMIT_RECOVERY_BLOCKED`、解除後の入力受付失敗は`GROK_RATE_LIMIT_RECOVERY_FAILED`となり、本文は未送信。上限の継続は`rate_limited`として返し、過去promptは再送しない。Grokの上限観測には現在の画面だけを使う。
|
|
281
282
|
|
|
282
283
|
When a Cursor pre-submit hook (`beforeSubmitPrompt`, or a Claude Code `UserPromptSubmit` hook that Cursor loads for compatibility) rejects the prompt, Cursor drops it and no turn or completion follows. Aiterm recognizes the rejection: an initial prompt returns `initial_prompt=failed`, and `pty_send` returns an error instead of a success receipt, both with `USER_HOOK_BLOCKED` and the hook's output. A rejection that comes after the 3-second start check is reported by the completion wait as `outcome=error` (`aiterm-wait` exit 7).
|
|
283
284
|
|
|
284
|
-
Grok
|
|
285
|
+
Grokがread-only sandboxの適用を拒否した場合、prompt送信時に`GROK_SANDBOX_STARTUP_FAILED`とCLIの原因を返す。hookパスのシンボリックリンクなど、CLIが示した原因を設定の管理元で修正し、対象sessionを`pty_close`して起動し直す。Aitermはsandboxを解除したりhookをコピーしたりしない。
|
|
285
286
|
|
|
286
|
-
この判定はGrok
|
|
287
|
+
この判定はGrok専用アダプターが所有する。初回prompt付きの`agent_launch`と通常の`pty_send`で、入力受付待ち中に拒否を検出すると未送信のエラーを返す。promptなし・`trust_project`指定なしの起動応答は入力受付を保証しない。`trust_project:true`では入力受付まで確認し、`startup.status`を返す。Grokのprivacy notice起動設定も同アダプターが所有する。実装の責務分担は[DESIGN](docs/DESIGN.md#failure-and-recovery)を参照。
|
|
287
288
|
|
|
288
289
|
Codex 0.155.1の「Approaching rate limits」model切替dialogは、通常の`pty_send`と`agent_configure`で同じsessionのまま一時的な**2. Keep current model**だけを選ぶ。入力受付を再確認してから本文または設定変更を進め、dispatch receiptの`pane_input_recovery`には`codex_rate_limit_model_switch_kept_current`を記録する。model切替と今後の表示抑止は選ばない。入力受付へ戻らなければ`CODEX_RATE_LIMIT_MODEL_SWITCH_RECOVERY_FAILED`となり、本文・設定変更は未送信。このdialogは`agent_approval`の対象ではなく、inspectは`reason="rate_limit_model_switch"`だけを返し、prompt digestとchoicesを出さない。
|
|
289
290
|
|
|
@@ -309,7 +310,7 @@ The canonical harness choices are:
|
|
|
309
310
|
| --- | --- | --- |
|
|
310
311
|
| `claude-code` | Claude Code CLI | Claude model and effort controls; correlated Stop hook |
|
|
311
312
|
| `codex-cli` | Codex CLI | OpenAI model and effort controls; durable rollout completion |
|
|
312
|
-
| `grok-cli` | Grok Build CLI | Grok model selected with `model`; live catalog check
|
|
313
|
+
| `grok-cli` | Grok Build CLI | Grok model selected with `model`; live catalog check |
|
|
313
314
|
| `cursor-cli` | Cursor Agent CLI | GPT, Claude, Grok, or another Cursor catalog model; normal transcript completion |
|
|
314
315
|
|
|
315
316
|
`env_vars` is an allowlist of environment-variable **names**, not a name/value map. At launch,
|
|
@@ -424,7 +425,7 @@ This registers it in `~/.claude.json`; you'll get an approval prompt the first t
|
|
|
424
425
|
|
|
425
426
|
Because an MCP client drives aiterm programmatically over stdio, everything above can run with **nobody sitting at the terminal**. Any MCP-capable orchestrator can call `agent_launch` — including a harness matching itself — then `pty_read` the result and act on it unattended. That makes aiterm a fit for exactly the places a human-driven terminal isn't:
|
|
426
427
|
|
|
427
|
-
- **Multi-agent orchestration** — an orchestrator hands sub-tasks to Claude Code / Codex / Grok / Cursor harnesses, each in its own persistent session, and reads them all back. Composer
|
|
428
|
+
- **Multi-agent orchestration** — an orchestrator hands sub-tasks to Claude Code / Codex / Grok / Cursor harnesses, each in its own persistent session, and reads them all back. Composer is one of the models Cursor selects (`composer-2.5-fast`).
|
|
428
429
|
- **CI** — a job step can spin up an agent, drive it, and tear it down.
|
|
429
430
|
- **cron** — a scheduled run can launch an agent and collect its output.
|
|
430
431
|
|
|
@@ -555,8 +556,8 @@ continue to use `claude_approval`.
|
|
|
555
556
|
| `pty_observe` | Pane/harness liveness, native process identity, state, and activity | `session_id`, `cursor?` |
|
|
556
557
|
| `agent_launch` | Canonical agent launch; harness and model are independent | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?`, `trust_project?`, `env_vars?`, `throughline_source_session?`, `throughline_supplement_file?` |
|
|
557
558
|
| `agent_approval` | Inspect a Codex approval and submit a one-time approval or denial | `action`, `session_id`, `approval_choice?`, `observed_prompt_digest?` |
|
|
558
|
-
| `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | Deprecated compatibility aliases | legacy launcher arguments |
|
|
559
|
-
| `agent_configure` | Change model/effort in a running Claude, Codex, Grok,
|
|
559
|
+
| `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | Deprecated compatibility aliases (`composer_agent` is the old Grok CLI preset and cannot start now; run Composer with `agent_launch` on `cursor-cli`) | legacy launcher arguments |
|
|
560
|
+
| `agent_configure` | Change model/effort in a running Claude, Codex, Grok, or Cursor session without restarting it | `session_id`, `model?`, `reasoning_effort?` |
|
|
560
561
|
| `claude_turn` | Issue (dispatch-only) or recover one correlated Claude operation | `action`, `session_id`, `operation_id`, `text?` |
|
|
561
562
|
| `claude_approval` | Inspect or answer the current correlated Claude approval prompt | `action`, `session_id`, `operation_id?`, `approval_choice?`, `observed_prompt_digest?` |
|
|
562
563
|
| `diagnostics` | Read-only factory readiness as machine-readable JSON | (none) |
|
|
@@ -575,13 +576,13 @@ Consumer flow is `aiterm-runtime-errors snapshot`, then `aiterm-runtime-errors a
|
|
|
575
576
|
|
|
576
577
|
`agent_launch` starts a selected harness's interactive coding-agent TUI inside a fresh persistent PTY and returns its `session_id`. The harness owns the agent loop, authentication, hooks, session, and transcript; `model` is independent. The TUI is a full-screen app, so read it with `pty_read({ screen: true })` for the rendered view.
|
|
577
578
|
|
|
578
|
-
`agent_configure({ session_id, model?, reasoning_effort? })` changes a running Claude, Codex, Grok,
|
|
579
|
+
`agent_configure({ session_id, model?, reasoning_effort? })` changes a running Claude, Codex, Grok, or Cursor TUI through the harness's standard controls, preserving the PTY and conversation context.
|
|
579
580
|
|
|
580
581
|
| `harness` | Launches | Model behavior |
|
|
581
582
|
| --- | --- | --- |
|
|
582
583
|
| `claude-code` | Claude Code CLI | Claude catalog model; native effort controls |
|
|
583
584
|
| `codex-cli` | Codex CLI | OpenAI catalog model; native effort controls |
|
|
584
|
-
| `grok-cli` | Grok Build CLI | Grok catalog model
|
|
585
|
+
| `grok-cli` | Grok Build CLI | Grok catalog model |
|
|
585
586
|
| `cursor-cli` | Cursor Agent CLI | Cursor catalog model, including GPT/Claude/Grok; effort uses model parameter override |
|
|
586
587
|
|
|
587
588
|
The selected harness CLI must be installed and authenticated. Use each product owner's official installer and updater; Aiterm does not distribute alternate CLI tarballs. For Cursor Agent CLI, use `curl https://cursor.com/install -fsS | bash` on macOS/Linux/WSL or `irm 'https://cursor.com/install?win32=true' | iex` on native Windows, authenticate once with `agent login`, and update with `agent update`; Aiterm invokes the unambiguous `cursor-agent` binary. Missing binaries, invalid model/effort values, unavailable Grok catalog models, and nonexistent `cwd` fail before a session exists.
|
|
@@ -593,13 +594,13 @@ unchanged. Optional `throughline_supplement_file` is passed unchanged to Through
|
|
|
593
594
|
`throughline_source_session` and Throughline 0.10.8 or later; Aiterm does not read or classify the supplement. Throughline is resolved through `THROUGHLINE_BIN` and then `PATH`; a missing or invalid
|
|
594
595
|
export fails before the PTY exists instead of silently launching clean.
|
|
595
596
|
|
|
596
|
-
When an agent's answer is longer than the on-screen tail (pane height ≈ 24 lines), callers recover it in full with `pty_read({ agent_transcript: true })`. It returns the most recently completed turn's final assistant message in plain text with no re-prompting. The existing human-readable content keeps its diagnostic suffix; machine callers read the answer alone from `structuredContent.text` in `aiterm.pty-read-result.v1`. Claude reads the bounded owner-only result captured by the launch-correlated Stop hook and verifies its digest/byte count; it never reads Claude's private transcript. Durable machine callers should use `claude_turn`: `issue` sends once, `recover` never sends, `pending` is distinct from unsafe or malformed state, and only `completed` carries the exact verified `raw_output`. Codex uses the normal rollout transcript's `task_complete.turn_id`; Grok
|
|
597
|
+
When an agent's answer is longer than the on-screen tail (pane height ≈ 24 lines), callers recover it in full with `pty_read({ agent_transcript: true })`. It returns the most recently completed turn's final assistant message in plain text with no re-prompting. The existing human-readable content keeps its diagnostic suffix; machine callers read the answer alone from `structuredContent.text` in `aiterm.pty-read-result.v1`. Claude reads the bounded owner-only result captured by the launch-correlated Stop hook and verifies its digest/byte count; it never reads Claude's private transcript. Durable machine callers should use `claude_turn`: `issue` sends once, `recover` never sends, `pending` is distinct from unsafe or malformed state, and only `completed` carries the exact verified `raw_output`. Codex uses the normal rollout transcript's `task_complete.turn_id`; Grok returns the last non-empty assistant message after the last real user row, excluding tool-use preambles; Cursor uses the normal agent transcript bound to the launch ID and current turn. Missing or ambiguous attribution remains an explicit error.
|
|
597
598
|
|
|
598
599
|
### Completion detection (5 layers)
|
|
599
600
|
|
|
600
601
|
For PowerShell over SSH, `mark:true` recognizes the current standard `PS ...>` prompt and emits PowerShell syntax even when Aiterm runs on macOS or Linux. A prompt left in earlier output is not used to select the syntax.
|
|
601
602
|
|
|
602
|
-
`pty_read({ wait: true })` decides "is the command done?" via five layers: process exit / a `mark:true` sentinel / an `until` match / output quiescence with shell return / timeout. `mark` emits the shell's exit status on POSIX shells and `0` (success) or `1` (failure) on PowerShell; fish/csh/tcsh are rejected before send because they do not share either status syntax. When `mark` or `until` is active, that requested evidence takes precedence and a momentarily quiet shell cannot complete the read as quiescent. Agent sessions add a sixth exact layer: Codex observes normal rollout `task_complete`; Grok
|
|
603
|
+
`pty_read({ wait: true })` decides "is the command done?" via five layers: process exit / a `mark:true` sentinel / an `until` match / output quiescence with shell return / timeout. `mark` emits the shell's exit status on POSIX shells and `0` (success) or `1` (failure) on PowerShell; fish/csh/tcsh are rejected before send because they do not share either status syntax. When `mark` or `until` is active, that requested evidence takes precedence and a momentarily quiet shell cannot complete the read as quiescent. Agent sessions add a sixth exact layer: Codex observes normal rollout `task_complete`; Grok observes normal session `turn_ended`; Claude observes its additive launch-correlated Stop event; Cursor observes `turn_ended(status:"success")` in the launch-bound normal agent transcript. `aiterm-wait --cursor` performs that harness-specific observation without the parent blocking or polling. Pre-send readiness failures are MCP errors, and late completion remains recoverable without resending.
|
|
603
604
|
|
|
604
605
|
### Completion push for parent agents (`aiterm-wait`)
|
|
605
606
|
|
package/dist/harnesses/grok.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
// Grok
|
|
2
|
-
// モデル既定値と表示名以外は Grok
|
|
1
|
+
// Grok 固有の制御。kind "composer" は旧互換alias composer_agent 用の旧Grok CLI presetで、
|
|
2
|
+
// モデル既定値と表示名以外は Grok と完全共通。Composer は現在 Cursor の model の一つであり、
|
|
3
|
+
// 現行Grok CLIには無い(2026-09-27 grok 1.0.41 実測)。
|
|
3
4
|
// core 所有のサービス(transcript 行読取・rate limit 検知)は引数で注入し、
|
|
4
5
|
// 依存方向を core → harnesses → agent-shared の一方向に保つ。
|
|
5
6
|
import * as fs from "node:fs";
|
|
@@ -66,7 +67,7 @@ export function assertGrokModelAvailable(bin, cwd, model) {
|
|
|
66
67
|
if (!models.includes(model)) {
|
|
67
68
|
throw new AitermError(`Grok model catalog に ${JSON.stringify(model)} がありません。利用可能: ${models.join(", ")}。` +
|
|
68
69
|
"別modelへfallbackせず起動を中止しました" +
|
|
69
|
-
(/composer/i.test(model) ? "。ComposerはCursor
|
|
70
|
+
(/composer/i.test(model) ? "。ComposerはCursorのmodelです: harness=cursor-cli, model=composer-2.5-fast" : ""), 2);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
export function grokSessionDirectory(meta) {
|
package/dist/index.js
CHANGED
|
@@ -716,7 +716,7 @@ registerRemoteAwareTool("claude_approval", {
|
|
|
716
716
|
}
|
|
717
717
|
});
|
|
718
718
|
registerRemoteAwareTool("agent_configure", {
|
|
719
|
-
description: "起動済みのClaude/Codex/Grok/
|
|
719
|
+
description: "起動済みのClaude/Codex/Grok/Cursor agent sessionを再起動せず、会話contextを保ったままmodel/reasoning effortを変更する。" +
|
|
720
720
|
"各harnessのCLI標準model操作を使う。Cursorのreasoning_effort変更はmodelと同時指定する。",
|
|
721
721
|
inputSchema: {
|
|
722
722
|
session_id: z.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
@@ -939,7 +939,7 @@ function registerAgentTool(toolName, kind, desc) {
|
|
|
939
939
|
server.registerTool("agent_launch", {
|
|
940
940
|
description: "エージェントを単一の標準入口から永続sessionへ起動する。harnessはagent loop・認証・hook・transcriptを所有する実行基盤、" +
|
|
941
941
|
"modelはそのharnessが選ぶ推論モデルであり別軸。Cursor harnessからGPT/Claude/Grok等を選んでも完了相関はCursor方式のまま。" +
|
|
942
|
-
"Composer
|
|
942
|
+
"ComposerはCursorのmodelの一つで、harnessでもGrokのmodelでもない。harness=cursor-cli と model=composer-2.5-fast(またはcomposer-2.5)で指定する。" +
|
|
943
943
|
"remoteを付けると、SSHで入った別端末のAitermで同じ起動を行い、完了は同じ形で親へ届く。" +
|
|
944
944
|
agentEnvironmentDesc + agentCompletionDesc,
|
|
945
945
|
inputSchema: {
|
|
@@ -1006,7 +1006,7 @@ registerAgentTool("grok_agent", "grok", "【旧互換alias。新規連携は age
|
|
|
1006
1006
|
"turn は pty_send で送る(自動で非ブロック dispatch になる)。" +
|
|
1007
1007
|
agentCompletionDesc +
|
|
1008
1008
|
"model/reasoning_effortを引数で指定可。read-only sandboxとagent_configureに対応。");
|
|
1009
|
-
registerAgentTool("composer_agent", "composer", "【旧互換alias
|
|
1009
|
+
registerAgentTool("composer_agent", "composer", "【旧互換alias・起動不能。ComposerはCursorのmodelの一つなので agent_launch(harness=cursor-cli, model=composer-2.5-fast) を使う】旧Grok CLIのComposer presetを起動しようとする。現行Grok CLIにComposerは無く、常にcatalogエラーになる。" +
|
|
1010
1010
|
agentEnvironmentDesc +
|
|
1011
1011
|
"turn は pty_send で送る(自動で非ブロック dispatch になる)。" +
|
|
1012
1012
|
agentCompletionDesc +
|
package/docs/DESIGN.md
CHANGED
|
@@ -61,7 +61,7 @@ Claude Code親は公式の非同期hookで本文を受け取り、待機中も
|
|
|
61
61
|
それ以外の親には`wait_process`がplatform nativeな別process起動情報を返す。
|
|
62
62
|
waiterは純readerで、親のforeground turnを塞がない。
|
|
63
63
|
回答はharness所有transcriptから同じturnへ相関して回収し、欠落・曖昧・timeout時にpromptを再送しない。
|
|
64
|
-
Grok
|
|
64
|
+
Grokの記録先はCLIと同じOS絶対パスへcwdを正規化して導出し、完了通知と回答で同じ関数を使う。
|
|
65
65
|
配送用のGrok回答は`turn_ended.ts`から同じturnの`turn_started.turn_number`を取得し、
|
|
66
66
|
`chat_history.jsonl`の`user.prompt_index`と相関する。次turnが既に始まっていても対象回答だけを回収する。
|
|
67
67
|
agent sessionへの送信口は`pty_send`だけとする。子の状態は呼び出し側に選ばせず、Aitermが送る時点の画面で振り分ける。
|
|
@@ -235,9 +235,9 @@ shell、接続先、各harnessの公式CLIが所有する。
|
|
|
235
235
|
stale send lockは並行processとのABAを避けるため自動削除せず、公開APIでは対象sessionを`pty_close`して
|
|
236
236
|
同じIDで再作成する。全session一括停止は公開しない。
|
|
237
237
|
|
|
238
|
-
Grok
|
|
238
|
+
Grokのread-only sandbox起動拒否は、`src/harnesses/grok.ts`の
|
|
239
239
|
`assertGrokSandboxNotRejected`がCLIのエラー表示から検出する。`src/core.ts`の共通入力受付待機は
|
|
240
|
-
Grok
|
|
240
|
+
Grokの場合だけこの判定を呼び、`GROK_SANDBOX_STARTUP_FAILED`で原因と未送信を返す。
|
|
241
241
|
初回prompt付き起動と通常dispatchに適用され、他harnessの入力受付判定には適用しない。
|
|
242
242
|
`trust_project`指定なしのpromptなし起動応答はPTYへの起動要求を示し、入力受付の確認は後続の送信時に行う。
|
|
243
243
|
|
|
@@ -245,12 +245,12 @@ hookパスのシンボリックリンク等を拒否する判断はGrok CLIが
|
|
|
245
245
|
hookのコピー、設定の置換、sandboxの解除は行わない。原因を設定の管理元で修正した後、対象sessionを
|
|
246
246
|
閉じて起動し直す。検出の回帰試験は`test/grok-startup.test.mjs`に置く。
|
|
247
247
|
|
|
248
|
-
Grok
|
|
248
|
+
Grokのmanaged起動は公式`--trust`を渡し、指定cwdの信頼状態はGrok CLIが管理する。
|
|
249
249
|
`grokLaunchBlockingDialog`は信頼確認を入力受付から除外し、scrollbackのshell promptを取り違えない。
|
|
250
250
|
`grokTuiBusy`は応答中の表示だけを実行中の根拠にし、完了後も残る`[hooks: 成功/失敗]`を含めない。
|
|
251
251
|
これらのCLI固有判定は`src/harnesses/grok.ts`が所有し、共通処理は判定を呼び出す。
|
|
252
252
|
|
|
253
|
-
Grok
|
|
253
|
+
Grokの終了済みerrorターンにweekly-limit質問カードが残る場合、通常dispatchだけが
|
|
254
254
|
現在のviewportを読み、harness生存と最新turnのエラー完了を確かめて`X`を一回送る。
|
|
255
255
|
既存の入力受付待機を通した後に完了cursorを取得し、今回の本文だけを送る。
|
|
256
256
|
実施した解除は既存receiptの`pane_input_recovery`に`grok_rate_limit_dialog_dismissed`として載る。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.3",
|
|
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": [
|