aiterm-mcp 0.70.67 → 0.70.68
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 +6 -1
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/core.js +21 -4
- package/dist/harnesses/claude-configure.js +19 -5
- package/dist/harnesses/claude.js +17 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.70.68] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
- `agent_configure` now changes the model or the effort (low to max) of a Claude seat whose turn is running, without ending the turn (b8, Kiro's request, Owner's order). Typing `/model` into a busy Claude seat only queues it as a user message (2.1.325), so the picker is opened with Alt+P (tmux/psmux key `M-p`, ESC and p in one write; a lone ESC would stop the turn) and the usual row match, `s` (this session only, never Enter), "Yes, switch" and refusal logic (`configureRefusal`, `aiterm/configure_error`) follow. The same turn's next request runs on the new model. Differences from an idle seat: no Esc is sent except to close the picker or the switch question while one is on screen, the result line is read without the `❯ /model` line above it, and no composer is waited for. Idle seats still use `/model`. `fast`, `opusplan`, `ultracode`, an effort outside low-max and a running Claude goal keep the refusal "入力待ちではありません" (nothing typed). A seat already in a running turn needs no relaunch; the change is on the seat's own session only (model-configuration.md).
|
|
13
|
+
|
|
10
14
|
## [0.70.67] - 2026-11-15
|
|
11
15
|
|
|
12
16
|
- A Claude seat can no longer enter plan mode without having written what it will plan (b4, Kiro's request, Owner's order). EnterPlanMode takes no arguments, so a seat that called it blind fell into plan mode's ask-the-user flow and an unattended seat stalled there. Every Claude seat's own settings now carry a `PreToolUse` hook for `EnterPlanMode` only. It waits up to 1.5 s (polling every 50 ms) for the call to appear in the seat's transcript, then counts the assistant text written right before it in the same message. 80 characters or more: the call goes through. Less: the call is turned back once per prompt with an instruction to write the detailed spec in the AI's own words and call again; the second call of the same prompt is never turned back (a small `.claude-plan-spec` state file in the seat's agents folder records the turn-back and is cleaned with the seat). An unreadable transcript, a missing `prompt_id`, an unwritable state file, an unreadable input and a process outside an Aiterm seat all let the call through. A seat already running keeps its old settings until it is resumed or relaunched; an Aiterm below 0.70.67 behaves as before (harness-contracts.md "EnterPlanModeの前に仕様を書かせる").
|
|
@@ -3518,7 +3522,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3518
3522
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3519
3523
|
provenance.
|
|
3520
3524
|
|
|
3521
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.
|
|
3525
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.68...HEAD
|
|
3526
|
+
[0.70.68]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.67...v0.70.68
|
|
3522
3527
|
[0.70.67]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.66...v0.70.67
|
|
3523
3528
|
[0.70.66]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.65...v0.70.66
|
|
3524
3529
|
[0.70.65]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.64...v0.70.65
|
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.
|
|
218
|
+
**状態:** 開発継続中 · 現行公開版 **v0.70.68** · 動作対象は 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.
|
|
230
|
+
**Status:** actively maintained · current public release **v0.70.68** · 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
|
@@ -6723,6 +6723,16 @@ function claudeSeatCatalogEnv(name, meta) {
|
|
|
6723
6723
|
env[key] = value;
|
|
6724
6724
|
return env;
|
|
6725
6725
|
}
|
|
6726
|
+
/** Whether a Claude goal is running on the seat (inside the send lock). Unreadable counts as no goal: the picker path is harmless either way. */
|
|
6727
|
+
async function claudeGoalActive(name, meta) {
|
|
6728
|
+
try {
|
|
6729
|
+
const result = await agentGoalInContext({ session_id: name, launch_id: meta.launch_id, action: "inspect" }, "automatic", undefined, true);
|
|
6730
|
+
return result.availability === "available" && result.goal?.status === "active";
|
|
6731
|
+
}
|
|
6732
|
+
catch {
|
|
6733
|
+
return false;
|
|
6734
|
+
}
|
|
6735
|
+
}
|
|
6726
6736
|
/** 返りの null は、席の画面が番の最中を示していて、何も打っていない時。 */
|
|
6727
6737
|
async function configureAgentInLock(name, model, effort, fast, beforeChange) {
|
|
6728
6738
|
// 席の控えは、行列の順番が来てから読む(前の送信が書いた分を、古い控えで上書きしない)。
|
|
@@ -6731,10 +6741,17 @@ async function configureAgentInLock(name, model, effort, fast, beforeChange) {
|
|
|
6731
6741
|
let seatEnv;
|
|
6732
6742
|
const claudeSeatEnv = () => seatEnv === undefined ? (seatEnv = claudeSeatCatalogEnv(name, meta)) : seatEnv;
|
|
6733
6743
|
// Codexは回答を流している間、動作中の行を出さない(ADR 0101)。送信と同じく記録の番の開始を見て、動いている席へ命令を打たない。
|
|
6744
|
+
// A running Claude turn is changed in place only for model/effort(low-max), with no goal running (model-configuration.md, b8).
|
|
6745
|
+
let inTurn = false;
|
|
6734
6746
|
if (isAgentTuiBusy(meta.kind, captureScreen(name, AGENT_TUI_READY_LINES))
|
|
6735
|
-
|| (meta.kind === "codex" && codexRunningTurn(meta) !== null && observeSession(name).harness_alive === true))
|
|
6736
|
-
|
|
6737
|
-
|
|
6747
|
+
|| (meta.kind === "codex" && codexRunningTurn(meta) !== null && observeSession(name).harness_alive === true)) {
|
|
6748
|
+
inTurn = meta.kind === "claude" && fast === null && (model !== null || effort !== null) && model?.toLowerCase() !== "opusplan"
|
|
6749
|
+
&& (effort === null || CLAUDE_EFFORTS.has(effort)) && !(await claudeGoalActive(name, meta));
|
|
6750
|
+
if (!inTurn)
|
|
6751
|
+
return null;
|
|
6752
|
+
}
|
|
6753
|
+
const { ready, codexRateLimitModelSwitch } = inTurn ? { ready: { ready: true, lastScreen: "" }, codexRateLimitModelSwitch: false }
|
|
6754
|
+
: await waitAgentTuiReadyAfterCodexRateLimitRecovery(name, meta, AGENT_TUI_READY_TIMEOUT_MS);
|
|
6738
6755
|
if (!ready.ready) {
|
|
6739
6756
|
if (codexRateLimitModelSwitch) {
|
|
6740
6757
|
throw new AitermError(`CODEX_RATE_LIMIT_MODEL_SWITCH_RECOVERY_FAILED: ${codexPaneObservation(ready.lastScreen).reason}。設定変更は送信していません。`, 2);
|
|
@@ -6835,7 +6852,7 @@ async function configureAgentInLock(name, model, effort, fast, beforeChange) {
|
|
|
6835
6852
|
if (model?.toLowerCase() === "opusplan")
|
|
6836
6853
|
await switchClaudeOpusPlan(name, meta, beforeChange);
|
|
6837
6854
|
if (model || level)
|
|
6838
|
-
await configureClaudeForSessionOnly(name, meta, model, level, beforeChange, { ...agentModelUi(name), ready: () => waitAgentTuiReady(name, meta, AGENT_TUI_READY_TIMEOUT_MS) }, claudeSeatEnv() ?? process.env);
|
|
6855
|
+
await configureClaudeForSessionOnly(name, meta, model, level, beforeChange, { ...agentModelUi(name), ready: () => waitAgentTuiReady(name, meta, AGENT_TUI_READY_TIMEOUT_MS) }, claudeSeatEnv() ?? process.env, inTurn);
|
|
6839
6856
|
if (effort && !level) {
|
|
6840
6857
|
beforeChange();
|
|
6841
6858
|
await sendAgentPromptText(name, `/effort ${effort}`);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { AitermError } from "../errors.js";
|
|
2
2
|
import { sleep } from "../agent-shared.js";
|
|
3
3
|
import { resolveAgentBin } from "../agent-resolver.js";
|
|
4
|
-
import { claudeModelPicker, claudeModelPickerRow, claudePickerRowByName, claudeModelDisplayName, claudeModelSwitchConfirm, claudeModelSwitchResult, claudePaneObservation, claudeModelChoices } from "./claude.js";
|
|
4
|
+
import { claudeModelPicker, claudeModelPickerRow, claudePickerRowByName, claudeModelDisplayName, claudeModelSwitchConfirm, claudeModelSwitchResult, claudeModelSwitchResults, claudePaneObservation, claudeModelChoices } from "./claude.js";
|
|
5
5
|
const CLAUDE_MODEL_PICKER_TIMEOUT_MS = 8_000;
|
|
6
6
|
const CLAUDE_MODEL_PICKER_KEY_TIMEOUT_MS = 1_500;
|
|
7
7
|
const CLAUDE_MODEL_SWITCH_TIMEOUT_MS = 15_000;
|
|
8
8
|
const CLAUDE_EFFORT_ORDER = ["low", "medium", "high", "xhigh", "max"];
|
|
9
|
-
export async function configureClaudeForSessionOnly(name, meta, model, effort, beforeChange, ui, catalogEnv = process.env)
|
|
9
|
+
export async function configureClaudeForSessionOnly(name, meta, model, effort, beforeChange, ui, catalogEnv = process.env, // the seat's own root and login (model-configuration.md)
|
|
10
|
+
// The seat's turn is running: `/model` would only queue as a user message, so the picker opens with Alt+P, and no Esc or
|
|
11
|
+
// ready wait is used outside the picker (an Esc in a running turn stops it; the turn goes on after the switch).
|
|
12
|
+
inTurn = false) {
|
|
10
13
|
let selectionIssued = false;
|
|
11
14
|
const screen = () => ui.screen();
|
|
12
15
|
const until = async (read, timeoutMs) => {
|
|
@@ -47,12 +50,16 @@ export async function configureClaudeForSessionOnly(name, meta, model, effort, b
|
|
|
47
50
|
}
|
|
48
51
|
return null;
|
|
49
52
|
};
|
|
50
|
-
|
|
53
|
+
const resultsBefore = inTurn ? claudeModelSwitchResults(screen()) : [];
|
|
54
|
+
if (inTurn)
|
|
55
|
+
ui.key("M-p");
|
|
56
|
+
else
|
|
57
|
+
await ui.command("/model");
|
|
51
58
|
let now = await until(picker, CLAUDE_MODEL_PICKER_TIMEOUT_MS);
|
|
52
59
|
if (!now) {
|
|
53
60
|
// 読めない形の画面が開いたままだと、席が次の文を受け取れない。入力待ちでも動作中でもない時だけ、Escを1度打って閉じる。
|
|
54
61
|
let state = claudePaneObservation(screen());
|
|
55
|
-
if (state.state === "unknown") {
|
|
62
|
+
if (!inTurn && state.state === "unknown") {
|
|
56
63
|
ui.key("Escape");
|
|
57
64
|
await sleep(500);
|
|
58
65
|
state = claudePaneObservation(screen());
|
|
@@ -174,7 +181,12 @@ export async function configureClaudeForSessionOnly(name, meta, model, effort, b
|
|
|
174
181
|
}
|
|
175
182
|
if (confirm || claudeModelPicker(text))
|
|
176
183
|
return null;
|
|
177
|
-
|
|
184
|
+
if (!inTurn)
|
|
185
|
+
return claudeModelSwitchResult(text);
|
|
186
|
+
// In a running turn the result has no `❯ /model` line above it: take the newest result line that was not on screen before.
|
|
187
|
+
const seen = (rows, line) => rows.filter(row => row.line === line).length;
|
|
188
|
+
const rows = claudeModelSwitchResults(text);
|
|
189
|
+
return rows.filter(row => seen(rows, row.line) > seen(resultsBefore, row.line)).at(-1) ?? null;
|
|
178
190
|
}, CLAUDE_MODEL_SWITCH_TIMEOUT_MS);
|
|
179
191
|
if (!result)
|
|
180
192
|
return refuse("CLAUDE_MODEL_SWITCH_UNCONFIRMED", "Claude Codeの切り替えの知らせを確認できません");
|
|
@@ -186,6 +198,8 @@ export async function configureClaudeForSessionOnly(name, meta, model, effort, b
|
|
|
186
198
|
throw new AitermError(`CLAUDE_MODEL_SWITCH_REFUSED vendor=claude session=${name}\n` +
|
|
187
199
|
`Claude Codeがmodelを切り替えませんでした(${result.line})。modelとreasoning_effortは変えていません。`, 2);
|
|
188
200
|
}
|
|
201
|
+
if (inTurn)
|
|
202
|
+
return; // the turn keeps running on the new model; there is no composer to wait for
|
|
189
203
|
const ready = await ui.ready();
|
|
190
204
|
if (!ready.ready)
|
|
191
205
|
throw new AitermError("Claudeのmodel変更完了を確認できません", 2);
|
package/dist/harnesses/claude.js
CHANGED
|
@@ -635,14 +635,7 @@ export function claudeModelSwitchConfirm(screen) {
|
|
|
635
635
|
return null;
|
|
636
636
|
return body.some((line) => /^\s*❯\s*1\.\s*Yes, switch\b/u.test(line)) ? "yes_selected" : "other_selected";
|
|
637
637
|
}
|
|
638
|
-
|
|
639
|
-
const lines = screen.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/u);
|
|
640
|
-
const command = lastLineIndex(lines, /^\s*❯\s*\/model(?:\s+\S+)?\s*$/u);
|
|
641
|
-
if (command < 0)
|
|
642
|
-
return null;
|
|
643
|
-
const start = lines.findIndex((line, i) => i > command && /^\s*⎿\s+\S/u.test(line));
|
|
644
|
-
if (start < 0)
|
|
645
|
-
return null;
|
|
638
|
+
function switchResultAt(lines, start) {
|
|
646
639
|
const parts = [lines[start].replace(/^\s*⎿\s+/u, "").trim()];
|
|
647
640
|
for (const line of lines.slice(start + 1)) {
|
|
648
641
|
if (!/^\s{3,}\S/u.test(line) || /^\s*⎿/u.test(line))
|
|
@@ -660,6 +653,22 @@ export function claudeModelSwitchResult(screen) {
|
|
|
660
653
|
return { scope: "saved_as_default", line };
|
|
661
654
|
return /\bfor this session only\b/u.test(line) ? { scope: "session_only", line } : null;
|
|
662
655
|
}
|
|
656
|
+
export function claudeModelSwitchResult(screen) {
|
|
657
|
+
const lines = screen.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/u);
|
|
658
|
+
const command = lastLineIndex(lines, /^\s*❯\s*\/model(?:\s+\S+)?\s*$/u);
|
|
659
|
+
if (command < 0)
|
|
660
|
+
return null;
|
|
661
|
+
const start = lines.findIndex((line, i) => i > command && /^\s*⎿\s+\S/u.test(line));
|
|
662
|
+
return start < 0 ? null : switchResultAt(lines, start);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Every switch result line on the screen, oldest first. A switch made with Alt+P in a running turn prints its result with no
|
|
666
|
+
* `❯ /model` line above it (2.1.325), so the caller compares against the lines present before the picker was opened.
|
|
667
|
+
*/
|
|
668
|
+
export function claudeModelSwitchResults(screen) {
|
|
669
|
+
const lines = screen.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/u);
|
|
670
|
+
return lines.flatMap((text, i) => /^\s*⎿\s+\S/u.test(text) ? [switchResultAt(lines, i)] : []).filter(row => row !== null);
|
|
671
|
+
}
|
|
663
672
|
// Claude Code 2.1.282 は選択肢へ「1.」などの番号を付ける。番号の有無のどちらも受ける。
|
|
664
673
|
export function claudeLoginMethodMenu(screen) {
|
|
665
674
|
const tail = screen.split("\n").slice(-32).join("\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.68",
|
|
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": [
|