aiterm-mcp 0.70.63 → 0.70.64

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,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.64] - 2026-11-15
11
+
12
+ - `agent_configure model: "opusplan"` no longer hangs on a seat whose conversation is cached for its current model (Z27 lab). Claude Code asks "Switch model? … ❯ 1. Yes, switch" after `/model opusplan`; Aiterm now reads that question (with or without a model name) and answers Yes once, as the picker path does. If no result line comes within 20 seconds, Aiterm closes what is open with Escape (at most 3 times) and refuses with `CLAUDE_MODEL_SWITCH_UNCONFIRMED` (with `configureRefusal`), without waiting for the composer. The root's `settings.json` still goes back to its exact prior bytes.
13
+
10
14
  ## [0.70.63] - 2026-11-15
11
15
 
12
16
  - Claude seats can use `opusplan` (Opus Plan Mode), a141. `agent_models` for claude-code now lists it on both login paths: the catalog asks `initialize` with `--model opusplan`, and Claude Code 2.1.325 adds that row only while the session runs it. `agent_configure` with `model: "opusplan"` first sends `/model opusplan`, because the picker has no such row until the seat runs it. Claude Code saves that as the user's default; the root's `settings.json` `model` goes back to its value before, the same way as for fast. The picker step then selects the row for this session only, with the requested effort. Launches already passed `--model opusplan` unchanged.
@@ -3502,7 +3506,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3502
3506
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3503
3507
  provenance.
3504
3508
 
3505
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.63...HEAD
3509
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.64...HEAD
3510
+ [0.70.64]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.63...v0.70.64
3506
3511
  [0.70.63]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.62...v0.70.63
3507
3512
  [0.70.62]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.61...v0.70.62
3508
3513
  [0.70.61]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.60...v0.70.61
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.63** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.70.64** · 動作対象は 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.63** · 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.70.64** · 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
@@ -70,7 +70,7 @@ import { readFileOrNull, restoreJsonSetting, withUserConfigLock, restoreUserDefa
70
70
  import { isDeepStrictEqual } from "node:util";
71
71
  import { grokAuthPlan, grokAuthStatus, grokAuthPane, GROK_MODEL_DEFAULTS, realGrokHome, resolveAndValidateGrokAuth, assertGrokModelAvailable, grokModelChoices, grokModelFromFooter, grokFooterModelName, grokModelDefaultsFromBody, restoreGrokModelDefaults, grokEventsTranscript, grokSessionDirectory, latestGrokCompletion, grokTurnSettled, observeGrokDone, buildGrokAgentCmd, grokAgentArgv, writeGrokCallerFiles, checkGrokCallerInput, grokLaunchNote, grokEnvTokens, grokEnvEntries, grokTuiReady, grokPaneObservation, GROK_INTERRUPT_KEY, grokRateLimitDialog, grokPromptAwaitingAccept, grokUnacceptedPromptRestored, grokStartupAction, grokFooterHasConfiguration, grokTranscriptText, createGrokAgentMetadata, } from "./harnesses/grok.js";
72
72
  import { codexAuthPlan, codexAuthStatus, codexAuthPane, realCodexHome, readCodexConfigPins, bindCodexTranscriptSession, latestCodexCompletion, codexTurnSettled, codexCompletedTurnId, codexWorkingResumeConfiguration, captureCodexRecoveryProof, captureCodexResumeProof, readCodexResumeProof, codexResumeProofDigest, codexRootTranscript, codexRolloutSessionId, codexRunningTurn, codexInterruptionRecord, observeCodexDone, buildCodexAgentCmd, codexAgentArgv, codexResumeArgv, writeCodexCallerFiles, refuseCodexCallerInput, codexLaunchNote, codexPaneObservation, CODEX_INTERRUPT_KEY, codexHelperProcess, codexRateLimitModelSwitchDialog, codexApprovalDialog, codexStartupAction, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, codexModelChoices, codexFastCommandOffered, codexFooterShowsFast, codexServiceTierNotices, restoreCodexDefaults, restoreCodexDefaultInFile, } from "./harnesses/codex.js";
73
- import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, claudeOauthTokenFile, claudeSetupTokenPlan, claudeOauthToken, claudeOauthTokenPresent, writeClaudeOauthToken, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, claudeModelChoices, claudeConfigDir, claudeProjectSlug, claudeFastIndicatorShown, claudeFastResult, buildClaudeAgentCmd, claudeAgentArgv, claudeResumeArgv, claudeLaunchNote, claudePaneObservation, CLAUDE_INTERRUPT_KEY, claudeUsageLimit, claudeLiveSelectMenu, claudeStartupAction, createClaudeAgentMetadata, writeClaudeCallerFiles, claudeSessionTranscriptPath, claudeApiErrorFromLine, claudeApiErrorAfter, claudeLimitEnd, claudeInterruptedAfter, claudeLimitResetAt, claudeApiErrorEndingTurn, claudeFailureCategory, claudeOwnMcpNames, claudeModelSwitchResult, } from "./harnesses/claude.js";
73
+ import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, claudeOauthTokenFile, claudeSetupTokenPlan, claudeOauthToken, claudeOauthTokenPresent, writeClaudeOauthToken, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, claudeModelChoices, claudeConfigDir, claudeProjectSlug, claudeFastIndicatorShown, claudeFastResult, buildClaudeAgentCmd, claudeAgentArgv, claudeResumeArgv, claudeLaunchNote, claudePaneObservation, CLAUDE_INTERRUPT_KEY, claudeUsageLimit, claudeLiveSelectMenu, claudeModelPicker, claudeStartupAction, createClaudeAgentMetadata, writeClaudeCallerFiles, claudeSessionTranscriptPath, claudeApiErrorFromLine, claudeApiErrorAfter, claudeLimitEnd, claudeInterruptedAfter, claudeLimitResetAt, claudeApiErrorEndingTurn, claudeFailureCategory, claudeOwnMcpNames, claudeModelSwitchResult, claudeModelSwitchConfirm, } from "./harnesses/claude.js";
74
74
  import { cursorAuthPlan, cursorAuthStatus, cursorAuthPane, bindCursorTranscriptSession, cursorTurnBoundary, latestCursorCompletion, cursorTranscript, cursorTranscriptSessionId, observeCursorDone, cursorTranscriptText, assertCursorAuthenticationReady, assertCursorModelAvailable, cursorModelChoices, cursorModelIsFastVariant, cursorFastParameter, cursorHeaderShowsFast, cursorPickerView, cursorEffortSelected, cursorParameterRows, cursorUserConfigPath, CURSOR_DEFAULT_MODEL_KEYS, realCursorHome, buildCursorAgentCmd, cursorAgentArgv, cursorPromptWithLineage, cursorLineagePreface, writeCursorCallerFiles, checkCursorCallerInput, createCursorAgentMetadata, cursorLaunchNote, cursorEffortNavigation, cursorTuiReady, cursorPaneObservation, CURSOR_INTERRUPT_KEY, cursorPromptHooksRunning, cursorUsageLimit, CURSOR_SUBMIT_SEQUENCE, validateCursorModelEffort, } from "./harnesses/cursor.js";
75
75
  import { interimFromNow, interimFromToken, readInterimWords, recordInterimBoundary } from "./interim-words.js";
76
76
  import { codexSeatAwaitingRollout, codexSeatTurn, grokSteerAcceptance, observeSteerDone, readSteerEntry, recordSteer } from "./steer-follow.js";
@@ -5954,19 +5954,42 @@ async function switchAgentFast(name, meta, target, verified = false) {
5954
5954
  async function switchClaudeOpusPlan(name, meta, beforeChange) {
5955
5955
  const settings = path.join(meta.claude_home ?? claudeConfigDir(), "settings.json");
5956
5956
  beforeChange();
5957
+ const ui = agentModelUi(name);
5957
5958
  const seen = await keepingUserDefaults(settings, (before) => { restoreJsonSetting(settings, before, "model"); }, async () => {
5958
5959
  await sendAgentPromptText(name, "/model opusplan");
5959
5960
  const deadline = performance.now() + CLAUDE_FAST_RESULT_TIMEOUT_MS;
5960
- let result = null;
5961
+ let answered = false;
5961
5962
  do {
5962
5963
  await sleep(150);
5963
- result = claudeModelSwitchResult(captureScreen(name, AGENT_TUI_READY_LINES));
5964
- } while (!result && performance.now() < deadline);
5965
- return result;
5964
+ const screen = ui.screen();
5965
+ const confirm = claudeModelSwitchConfirm(screen);
5966
+ // A seat with a cached conversation asks "Switch model?" first: answer Yes once, as the picker path does.
5967
+ if (confirm === "yes_selected" && !answered) {
5968
+ answered = true;
5969
+ ui.key("Enter");
5970
+ }
5971
+ if (confirm)
5972
+ continue;
5973
+ const result = claudeModelSwitchResult(screen);
5974
+ if (result)
5975
+ return result;
5976
+ } while (performance.now() < deadline);
5977
+ return null;
5966
5978
  });
5979
+ if (!seen) {
5980
+ // Close what is still open (the switch question, or a screen Aiterm cannot read) so the seat takes the next input.
5981
+ for (let i = 0; i < 3; i++) {
5982
+ const screen = ui.screen();
5983
+ if (!claudeModelSwitchConfirm(screen) && !claudeModelPicker(screen) && claudePaneObservation(screen).state !== "unknown")
5984
+ break;
5985
+ ui.key("Escape");
5986
+ await sleep(300);
5987
+ }
5988
+ const error = new AitermError(`CLAUDE_MODEL_SWITCH_UNCONFIRMED vendor=claude session=${name}\nClaude Codeへ /model opusplan を送りましたが、結果の行を確かめられません。modelは変わった可能性があります。再送しないでください。`, 2);
5989
+ error.configureRefusal = { code: "CLAUDE_MODEL_SWITCH_UNCONFIRMED", relaunch: false, selection_excluded: false };
5990
+ throw error;
5991
+ }
5967
5992
  const ready = await waitAgentTuiReady(name, meta, AGENT_TUI_READY_TIMEOUT_MS);
5968
- if (!seen)
5969
- throw new AitermError(`CLAUDE_MODEL_SWITCH_UNCONFIRMED vendor=claude session=${name}\nClaude Codeへ /model opusplan を送りましたが、結果の行を確かめられません。modelは変わった可能性があります。再送しないでください。`, 2);
5970
5993
  if (seen.scope !== "saved_as_default" && seen.scope !== "session_only")
5971
5994
  throw new AitermError(`CLAUDE_MODEL_SWITCH_REFUSED vendor=claude session=${name}\nClaude Codeがmodelを切り替えませんでした(${seen.line})。`, 2);
5972
5995
  if (!ready.ready)
@@ -602,15 +602,16 @@ export function claudePickerRowByName(rows, name) {
602
602
  // Your next response will be slower and use more tokens
603
603
  // ❯ 1. Yes, switch to Opus 5.5
604
604
  // 2. No, go back
605
+ // `/model opusplan` (2.1.325) asks the same with "❯ 1. Yes, switch" and no model name (Z27 lab).
605
606
  export function claudeModelSwitchConfirm(screen) {
606
607
  const lines = screen.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/u);
607
608
  const head = lastLineIndex(lines, /^\s*Switch model\?\s*$/u);
608
609
  if (head < 0)
609
610
  return null;
610
611
  const body = lines.slice(head + 1);
611
- if (!body.some((line) => /^\s*(?:❯\s*)?1\.\s*Yes, switch to\b/u.test(line)))
612
+ if (!body.some((line) => /^\s*(?:❯\s*)?1\.\s*Yes, switch\b/u.test(line)))
612
613
  return null;
613
- return body.some((line) => /^\s*❯\s*1\.\s*Yes, switch to\b/u.test(line)) ? "yes_selected" : "other_selected";
614
+ return body.some((line) => /^\s*❯\s*1\.\s*Yes, switch\b/u.test(line)) ? "yes_selected" : "other_selected";
614
615
  }
615
616
  export function claudeModelSwitchResult(screen) {
616
617
  const lines = screen.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "").split(/\r?\n/u);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.70.63",
3
+ "version": "0.70.64",
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": [