aiterm-mcp 0.70.21 → 0.70.22
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 +7 -1
- package/README.ja.md +3 -3
- package/README.md +4 -4
- package/dist/core.js +2 -3
- package/dist/errors.js +0 -10
- package/dist/harnesses/claude.js +1 -38
- package/dist/index.js +1 -8
- package/dist/remote-terminal.js +10 -3
- package/docs/DESIGN.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.70.22] - 2026-11-11
|
|
11
|
+
|
|
12
|
+
- A Claude launch no longer refuses on an authentication pre-check. `claude auth status` read the computer's own login, while a seat may run on a credential passed only in its private environment (for example `CLAUDE_CODE_OAUTH_TOKEN`); with the computer's own login expired, seats that would run were refused as `AGENT_AUTH_REQUIRED`. A logged-out Claude now stops at its own login screen (`vendor_onboarding_required`, initial prompt not sent). Terminals on older versions still answer the old codes, and callers keep reading them.
|
|
13
|
+
- A terminal's seat forward no longer waits up to 60 seconds when the key arrives just after a launch asked for it. The keeper started before the key gave up and exited, and a key that landed while it was still running started no new one; it now waits for the key and starts the forward when it lands.
|
|
14
|
+
|
|
10
15
|
## [0.70.21] - 2026-11-11
|
|
11
16
|
|
|
12
17
|
- A terminal's seat MCP forward no longer goes down a few seconds after a launch. The `ssh -R` keeper ran inside the MCP process that handled the launch; BellTeam launches through a one-shot Aiterm, so the forward died when that process ended and stayed refused until another process's 60-second check (about 45 s in a lab run). A seat whose Claude was still connecting its MCP servers then, or that started in that window, lost its tools for good. The forward is now held by a detached keeper process (`aiterm-remote-terminal forward-keeper --ref R`) that lives while the forward is needed; MCP processes only start it when no live keeper holds the lock.
|
|
@@ -3287,7 +3292,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3287
3292
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3288
3293
|
provenance.
|
|
3289
3294
|
|
|
3290
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.
|
|
3295
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.22...HEAD
|
|
3296
|
+
[0.70.22]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.21...v0.70.22
|
|
3291
3297
|
[0.70.21]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.20...v0.70.21
|
|
3292
3298
|
[0.70.20]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.19...v0.70.20
|
|
3293
3299
|
[0.70.19]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.18...v0.70.19
|
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.22** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
219
219
|
|
|
220
220
|
### 更新と巻き戻し
|
|
221
221
|
|
|
@@ -760,9 +760,9 @@ Cursor親(`clientInfo.name`が`cursor-vscode`)も同じ完了観測と本文
|
|
|
760
760
|
Claudeをリンク経由の`cwd`から起動した場合も、実体パスに対応する会話記録を参照する。
|
|
761
761
|
|
|
762
762
|
|
|
763
|
-
Claude
|
|
763
|
+
Claudeの起動では、起動前の認証確認をしない(0.70.22)。`claude auth status`はその計算機自身のloginを読むが、席は私的envで渡された資格(例: `CLAUDE_CODE_OAUTH_TOKEN`)で動く事があり、動く席まで断っていた。起動へ進み、未ログインならlogin画面で`vendor_onboarding_required`として止まり初回promptを送らない。資格が拒まれた時は最初のturnがClaude自身の誤りで終わる。0.70.1〜0.70.21の端末は従来どおり`structuredContent`(`schema:"aiterm.agent-launch-error.v1"`、`phase:"authentication_preflight"`、`code`は`CLAUDE_AUTH_NOT_AUTHENTICATED`か`CLAUDE_AUTH_STATUS_UNCONFIRMED`。`CLAUDE_AUTH_STATUS_TIMEOUT`は0.70.1より前だけ)で断る。
|
|
764
764
|
|
|
765
|
-
ログインしていないと確かめられたCLIは、起動前確認のあるClaude Code
|
|
765
|
+
ログインしていないと確かめられたCLIは、起動前確認のあるCursor・Antigravity(0.70.22より前の端末ではClaude Codeも)で同じ形で起動を断る。`_meta["aiterm/launch_error"]`が`code:"AGENT_AUTH_REQUIRED"`・`phase:"input"`・`effect:"not_started"`・`session_created:false`・`harness`を持つ(本文は`AGENT_LAUNCH_NOT_STARTED: AGENT_AUTH_REQUIRED: ...`。古い端末のClaudeは従来の本文と`structuredContent`も残す)。Claude Code・Codex・Grokには起動前確認が無く、各CLIのログイン画面で止まる。状態を読めなかった場合はこのcodeにしない。
|
|
766
766
|
|
|
767
767
|
### 別端末のagentを1回で起動する(`remote`)
|
|
768
768
|
|
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.22** · 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
|
|
|
@@ -368,7 +368,7 @@ PTY launch command and retained in aiterm's per-session `.lastcmd`; the launched
|
|
|
368
368
|
processes with access to the same OS user may read them. Use this for non-secret seat identity and
|
|
369
369
|
workflow variables, not as a secret transport.
|
|
370
370
|
|
|
371
|
-
The selected harness CLI must be installed and authenticated. Aiterm resolves `CLAUDE_BIN` / `CODEX_BIN` / `GROK_BIN` / `CURSOR_AGENT_BIN`, then the documented default binary, then `PATH`. Cursor resolution deliberately uses `cursor-agent`, never the ambiguous `agent` name.
|
|
371
|
+
The selected harness CLI must be installed and authenticated. Aiterm resolves `CLAUDE_BIN` / `CODEX_BIN` / `GROK_BIN` / `CURSOR_AGENT_BIN`, then the documented default binary, then `PATH`. Cursor resolution deliberately uses `cursor-agent`, never the ambiguous `agent` name. Cursor authentication is checked before a PTY exists, so a failed preflight leaves no session. Claude is not checked before launch (0.70.22): a logged-out Claude stops at its own login screen. All harnesses use their normal harness-owned credential and configuration stores in place.
|
|
372
372
|
For Grok, Aiterm does not lock, inspect, or modify the credential. A non-empty inherited
|
|
373
373
|
`GROK_AUTH_PATH` must be absolute and exist; Aiterm passes it unchanged to Grok. Grok owns its
|
|
374
374
|
contents, permissions, and link handling. Absence of the default auth file is accepted only when
|
|
@@ -770,9 +770,9 @@ The result (`aiterm.agent-models.v1`) is `{ harness, source, harness_version, de
|
|
|
770
770
|
|
|
771
771
|
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.
|
|
772
772
|
|
|
773
|
-
Claude
|
|
773
|
+
A Claude launch runs no authentication pre-check (0.70.22): `claude auth status` read the computer's own login, while a seat may run on a credential passed in its private environment (for example `CLAUDE_CODE_OAUTH_TOKEN`), so the check refused seats that would run. The launch goes on; a logged-out Claude stops at its login screen as `vendor_onboarding_required` with the initial prompt not sent, and a rejected credential ends the first turn with Claude's own error. Terminals on 0.70.1 to 0.70.21 still refuse with the old `structuredContent` (schema `aiterm.agent-launch-error.v1`, `phase:"authentication_preflight"`, `code` `CLAUDE_AUTH_NOT_AUTHENTICATED` or `CLAUDE_AUTH_STATUS_UNCONFIRMED`; `CLAUDE_AUTH_STATUS_TIMEOUT` only before 0.70.1).
|
|
774
774
|
|
|
775
|
-
A CLI that is positively not logged in refuses the launch the same way for
|
|
775
|
+
A CLI that is positively not logged in refuses the launch the same way for Cursor and Antigravity (the harnesses with a launch preflight; Claude Code on terminals older than 0.70.22): `_meta["aiterm/launch_error"]` carries `code:"AGENT_AUTH_REQUIRED"`, `phase:"input"`, `effect:"not_started"`, `session_created:false` and the `harness`; the text is `AGENT_LAUNCH_NOT_STARTED: AGENT_AUTH_REQUIRED: ...` (an older terminal's Claude keeps its older text and structured answer beside it). Claude Code, Codex and Grok have no launch preflight and stop at their own login screen. A status check that cannot be read is not this code.
|
|
776
776
|
|
|
777
777
|
Set `throughline_source_session` together with a non-empty mission in `prompt` to prepend
|
|
778
778
|
Throughline's read-only handoff context. This optional route requires `throughline >= 0.9.0`,
|
package/dist/core.js
CHANGED
|
@@ -67,7 +67,7 @@ import { readFileOrNull, restoreJsonSetting, withUserConfigLock, restoreUserDefa
|
|
|
67
67
|
import { isDeepStrictEqual } from "node:util";
|
|
68
68
|
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";
|
|
69
69
|
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";
|
|
70
|
-
import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, claudeOauthTokenFile, claudeSetupTokenPlan, claudeOauthToken, claudeOauthTokenPresent, writeClaudeOauthToken, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText,
|
|
70
|
+
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, claudeApiErrorEndingTurn, claudeFailureCategory, } from "./harnesses/claude.js";
|
|
71
71
|
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";
|
|
72
72
|
import { interimFromNow, interimFromToken, readInterimWords, recordInterimBoundary } from "./interim-words.js";
|
|
73
73
|
import { codexSeatAwaitingRollout, codexSeatTurn, grokSteerAcceptance, observeSteerDone, readSteerEntry, recordSteer } from "./steer-follow.js";
|
|
@@ -7820,8 +7820,7 @@ function prepareAgentLaunch(kind, opts = {}) {
|
|
|
7820
7820
|
throw new AitermError("AGENT_CONFIGURATION_ROOT_REJECTED: env_varsのCLAUDE_CONFIG_DIRとconfiguration_rootは同時に指定できません。", 2);
|
|
7821
7821
|
const claudeEnv = claudeRoot ? withClaudeConfigRoot(process.env, claudeRoot) : process.env;
|
|
7822
7822
|
const claudeRootEntries = claudeRoot ? [["CLAUDE_CONFIG_DIR", claudeRoot.selector]] : [];
|
|
7823
|
-
|
|
7824
|
-
assertClaudeAuthenticationReady(bin, claudeEnv);
|
|
7823
|
+
// No Claude pre-check (ADR 0020, 2026-11-11): it read this computer's login, not the seat's private-env credential; a logged-out Claude stops at its login screen.
|
|
7825
7824
|
if (kind === "cursor")
|
|
7826
7825
|
assertCursorAuthenticationReady(bin);
|
|
7827
7826
|
if (kind === "antigravity") {
|
package/dist/errors.js
CHANGED
|
@@ -27,16 +27,6 @@ export function launchAuthRequired(harness, reason) {
|
|
|
27
27
|
error.launchNotStarted = { harness, phase: "input", code: "AGENT_AUTH_REQUIRED" };
|
|
28
28
|
return error;
|
|
29
29
|
}
|
|
30
|
-
/** A harness authentication check refused launch before any session creation.
|
|
31
|
-
* Keep the native CLI's status body and credential diagnostics out of the wire. */
|
|
32
|
-
export class AgentAuthenticationPreflightError extends AitermError {
|
|
33
|
-
reasonCode;
|
|
34
|
-
constructor(reasonCode, message) {
|
|
35
|
-
super(message, 2);
|
|
36
|
-
this.reasonCode = reasonCode;
|
|
37
|
-
this.name = "AgentAuthenticationPreflightError";
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
30
|
/** Admission refusal before the requested resume starts. */
|
|
41
31
|
export class AgentResumeUnavailableError extends AitermError {
|
|
42
32
|
resumeUnavailable;
|
package/dist/harnesses/claude.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as os from "node:os";
|
|
|
7
7
|
import * as path from "node:path";
|
|
8
8
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { AitermError
|
|
10
|
+
import { AitermError } from "../errors.js";
|
|
11
11
|
import { modeBitsWorldAccessible } from "../tmux-runtime.js";
|
|
12
12
|
import { runAgentProtocolCommand, spawnAgentControlCommand } from "../agent-resolver.js";
|
|
13
13
|
import { claudeCatalogRoot } from "../claude-catalog-root.js";
|
|
@@ -167,7 +167,6 @@ export function readClaudeResultText(meta, done, operationId, transcriptUnavaila
|
|
|
167
167
|
}
|
|
168
168
|
return result.text;
|
|
169
169
|
}
|
|
170
|
-
const CLAUDE_AUTH_STATUS_TIMEOUT_MS = 5_000;
|
|
171
170
|
const CLAUDE_MODELS_TIMEOUT_MS = 30_000;
|
|
172
171
|
const CLAUDE_MODELS_MAX_BYTES = 4 * 1024 * 1024;
|
|
173
172
|
// ultracodeはClaude Codeのsession設定で、`--effort ultracode` で有効になる(2.1.285実測:警告なしで受け付け、
|
|
@@ -314,42 +313,6 @@ export function claudeCatalogFromInitialize(stdout, requestId, summary = "") {
|
|
|
314
313
|
fast_unavailable: claudeFastUnavailable(response.response.response?.fast_mode_disabled_reason),
|
|
315
314
|
});
|
|
316
315
|
}
|
|
317
|
-
export function assertClaudeAuthenticationReady(bin, env = process.env) {
|
|
318
|
-
const result = spawnAgentControlCommand(bin, ["auth", "status", "--json"], process.cwd(), {
|
|
319
|
-
env,
|
|
320
|
-
encoding: "utf8",
|
|
321
|
-
timeout: CLAUDE_AUTH_STATUS_TIMEOUT_MS,
|
|
322
|
-
maxBuffer: 64 * 1024,
|
|
323
|
-
});
|
|
324
|
-
let status = null;
|
|
325
|
-
try {
|
|
326
|
-
status = JSON.parse((result.stdout ?? "").trim());
|
|
327
|
-
}
|
|
328
|
-
catch {
|
|
329
|
-
status = null;
|
|
330
|
-
}
|
|
331
|
-
if (result.error == null &&
|
|
332
|
-
result.status === 0 &&
|
|
333
|
-
status !== null &&
|
|
334
|
-
typeof status === "object" &&
|
|
335
|
-
!Array.isArray(status) &&
|
|
336
|
-
status.loggedIn === true) {
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
if (status !== null &&
|
|
340
|
-
typeof status === "object" &&
|
|
341
|
-
!Array.isArray(status) &&
|
|
342
|
-
status.loggedIn === false) {
|
|
343
|
-
throw new AgentAuthenticationPreflightError("CLAUDE_AUTH_NOT_AUTHENTICATED", "Claude Codeの認証を利用できません。sessionは作成していません。" +
|
|
344
|
-
"通常端末で `claude doctor` を実行し、Keychain/credential storeを直してから一度だけ `claude auth login` を実行してください。" +
|
|
345
|
-
"aiterm相関付きClaude session内で /login を繰り返さないでください。");
|
|
346
|
-
}
|
|
347
|
-
// A slow check is not a refusal (ADR 0020, 2026-11-10): launch on; a logged-out Claude stops at its login screen.
|
|
348
|
-
if (result.error && result.error.code === "ETIMEDOUT")
|
|
349
|
-
return;
|
|
350
|
-
throw new AgentAuthenticationPreflightError("CLAUDE_AUTH_STATUS_UNCONFIRMED", "Claude Codeの認証状態を起動前に確認できません。sessionは作成していません。" +
|
|
351
|
-
"`claude auth status --json` と `claude doctor` が成功することを通常端末で確認してください。");
|
|
352
|
-
}
|
|
353
316
|
/**
|
|
354
317
|
* 起動時に席へ渡す、Aitermの届け方の説明(ADR 0116)。Claude Codeは貼り付けを包み、包みの中の指示を利用者の言葉と分けて読む。
|
|
355
318
|
* Aitermが包みの外へ添える1行を先に教えておく。包みの中へ同じ文を書いても包みの外には出ないので、印をまねる事は出来ない。
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { terminalCwdFits } from "./remote-path.js";
|
|
|
6
6
|
import { launchEnvValue } from "./private-env.js";
|
|
7
7
|
import { AuthResponseError, authUiSchema, authBindingSchema, authResponseSchema } from "./agent-auth-ui.js";
|
|
8
8
|
import { configurationRequestSchema, configurationToolOutputSchema, applyConfigurationRequest, reconcileConfigurationRequest } from "./configure-request.js";
|
|
9
|
-
import { AitermError,
|
|
9
|
+
import { AitermError, AgentResumeUnavailableError, AgentResumeError, launchInputRefusal } from "./errors.js";
|
|
10
10
|
/**
|
|
11
11
|
* aiterm-mcp — AI が握るローカル永続端末を stdio MCP サーバとして公開する(Node/TS 版)。
|
|
12
12
|
*
|
|
@@ -255,13 +255,6 @@ export function createAitermServer(options = {}) {
|
|
|
255
255
|
content: [{ type: "text", text: "aiterm: " + msg }], isError: true,
|
|
256
256
|
structuredContent: { ...configurationFailure }, ...configureErrorMeta(e),
|
|
257
257
|
};
|
|
258
|
-
if (e instanceof AgentAuthenticationPreflightError)
|
|
259
|
-
return {
|
|
260
|
-
content: [{ type: "text", text: "aiterm: " + msg }], isError: true,
|
|
261
|
-
structuredContent: { schema: "aiterm.agent-launch-error.v1", harness: "claude-code", code: e.reasonCode,
|
|
262
|
-
phase: "authentication_preflight", effect: "not_issued", session_created: false, message: msg },
|
|
263
|
-
...(e.reasonCode === "CLAUDE_AUTH_NOT_AUTHENTICATED" ? { _meta: launchNotStartedMeta("claude-code", "input", "AGENT_AUTH_REQUIRED") } : {}),
|
|
264
|
-
};
|
|
265
258
|
if (e instanceof AitermError && e.launchNotStarted)
|
|
266
259
|
return { content: [{ type: "text", text: "aiterm: " + msg }], isError: true,
|
|
267
260
|
_meta: launchNotStartedMeta(e.launchNotStarted.harness, e.launchNotStarted.phase, e.launchNotStarted.code) };
|
package/dist/remote-terminal.js
CHANGED
|
@@ -955,6 +955,13 @@ export function runForwardKeeper(ref) {
|
|
|
955
955
|
binding(ref);
|
|
956
956
|
keeperProcess = true;
|
|
957
957
|
keeperHold = setInterval(() => { keep(ref); settleKeeper(ref); }, 5_000);
|
|
958
|
+
try { // a key that lands while this keeper waits for it: retry at once, not at the next 5 s turn
|
|
959
|
+
const watch = fs.watch(credentialDir(), (_event, name) => { if (!name || String(name).endsWith(".json"))
|
|
960
|
+
keep(ref); });
|
|
961
|
+
watch.on("error", () => watch.close());
|
|
962
|
+
watch.unref();
|
|
963
|
+
}
|
|
964
|
+
catch { /* the 5 s turn still covers it */ }
|
|
958
965
|
keep(ref);
|
|
959
966
|
settleKeeper(ref);
|
|
960
967
|
}
|
|
@@ -1012,12 +1019,13 @@ function keep(ref) {
|
|
|
1012
1019
|
// The remote command depends on the terminal's shell (T4): known from the cache, or probed once by this process.
|
|
1013
1020
|
// The probe's ssh arguments can refuse synchronously (CREDENTIAL_NOT_LOADED before credential-load): leave like the
|
|
1014
1021
|
// argument refusal below, never with `starting` set, or no later keep() would ever start the forward (0.70.9).
|
|
1022
|
+
// Keep the lock and stay (0.70.22): this keeper retries when the key lands. Exiting here left a credential-load
|
|
1023
|
+
// that landed while it was still running with no keeper until the 60 s check (other processes saw it alive).
|
|
1015
1024
|
let probe;
|
|
1016
1025
|
try {
|
|
1017
1026
|
probe = remoteShell(trustedTarget(b));
|
|
1018
1027
|
}
|
|
1019
1028
|
catch {
|
|
1020
|
-
releaseLock(ref);
|
|
1021
1029
|
return;
|
|
1022
1030
|
}
|
|
1023
1031
|
keeper.starting = true;
|
|
@@ -1029,8 +1037,7 @@ function keep(ref) {
|
|
|
1029
1037
|
args = trustedSshArguments(ref, keeperCommand(shell), null, ["-o", "ExitOnForwardFailure=yes", "-R", seatForwardSpec(requested, b.seat_ingress_port)]);
|
|
1030
1038
|
}
|
|
1031
1039
|
catch {
|
|
1032
|
-
|
|
1033
|
-
return;
|
|
1040
|
+
return; /* as above: keep the lock, retry when the key lands */
|
|
1034
1041
|
}
|
|
1035
1042
|
const child = spawn("ssh", args, { env: sshEnvironment(), stdio: ["pipe", "pipe", "pipe"] });
|
|
1036
1043
|
keeper.child = child;
|
package/docs/DESIGN.md
CHANGED
|
@@ -541,7 +541,7 @@ Claude authentication URL receipts recognize the official claude.com/cai/oauth/a
|
|
|
541
541
|
|
|
542
542
|
### 認証画面と専用応答
|
|
543
543
|
|
|
544
|
-
Claude起動前の公式auth status拒否はharnessが`AgentAuthenticationPreflightError`として所有し、通常MCPのfailが`aiterm.agent-launch-error.v1`へ投影する。既存数値exit codeと文言を維持し、未認証・確認不能の機械code(timeoutは拒否せず起動へ進み、未認証なら起動後のlogin画面判定が止める。`CLAUDE_AUTH_STATUS_TIMEOUT`は旧版の端末だけが返す。ADR 0020追補)、authentication_preflight/not_issued/session_created:falseだけを追加する。CLI status本文・stderr・資格・推定したexpiry原因は持ち出さず、この拒否は認証PTYの入力や起動後turnの終端とは分ける。
|
|
544
|
+
(0.70.22で廃止: Claudeの起動前auth statusは席の私的envの資格を見ずに動く席を断っていたため、起動前確認をやめ、未ログインは起動後のlogin画面判定が止める。以下は0.70.21までの端末の答えとして呼び手側の写像だけ残る。)Claude起動前の公式auth status拒否はharnessが`AgentAuthenticationPreflightError`として所有し、通常MCPのfailが`aiterm.agent-launch-error.v1`へ投影する。既存数値exit codeと文言を維持し、未認証・確認不能の機械code(timeoutは拒否せず起動へ進み、未認証なら起動後のlogin画面判定が止める。`CLAUDE_AUTH_STATUS_TIMEOUT`は旧版の端末だけが返す。ADR 0020追補)、authentication_preflight/not_issued/session_created:falseだけを追加する。CLI status本文・stderr・資格・推定したexpiry原因は持ち出さず、この拒否は認証PTYの入力や起動後turnの終端とは分ける。
|
|
545
545
|
|
|
546
546
|
`agent-auth-ui.ts`が既v1 receiptに追加する`auth_ui`とrespondの型を所有する。Native harnessが公式URL・device code・空code欄・現在のラベル付き選択肢を識別し、Rootはキー列を作らない。不明な入力段階はunavailable。coreが既auth metadataのdev/ino/作成・更新時刻、native session/pane/server/PID開始識別を照合する。legacyのlaunch UUID欠測はnullのまま扱い、無関係なflowをadoptしない。新startは既launch_id欄を必ず設定する。
|
|
547
547
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.22",
|
|
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": [
|