aiterm-mcp 0.63.5 → 0.63.6

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.63.6] - 2026-11-03
11
+
12
+ - Make the existing read-only diagnostics PTY probe finite and socket-exact: share a 5000 ms subprocess budget across backend resolution and one listing, and stop treating broad connection errors as absence. Opt-in `format:"v2"` adds safe PTY reason codes and the timeout budget; default v1 fields and the parent-hook text stay unchanged. No PTY warming or provider calls.
13
+
10
14
  ## [0.63.5] - 2026-11-03
11
15
 
12
16
  - Add opt-in request-bound `agent_configure` receipts and read-only reconciliation. Persist the original UUID, expected launch and normalized settings digest before native input; never reapply an existing ID. Missing, corrupt or unfinished records remain unknown. Native issuance stays `later_effect: unconfirmed` even after a successful handler; current settings inspection remains unsupported. Durable tracked apply is POSIX-only; existing configuration remains available on Windows.
@@ -3028,7 +3032,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3028
3032
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3029
3033
  provenance.
3030
3034
 
3031
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.5...HEAD
3035
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.6...HEAD
3036
+ [0.63.6]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.5...v0.63.6
3032
3037
  [0.63.5]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.3...v0.63.5
3033
3038
  [0.63.3]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.2...v0.63.3
3034
3039
  [0.63.2]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.1...v0.63.2
package/README.ja.md CHANGED
@@ -209,7 +209,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
209
209
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
210
210
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
211
211
 
212
- **状態:** 開発継続中 · 現行公開版 **v0.63.5** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
212
+ **状態:** 開発継続中 · 現行公開版 **v0.63.6** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
213
213
 
214
214
  ### 更新と巻き戻し
215
215
 
@@ -619,6 +619,8 @@ Claudeの相関済み承認は既存の`claude_approval`を使う。
619
619
 
620
620
  `diagnostics` は PTY やエージェントを起動しない。パッケージ版、MCP 呼出 readiness、read-only な PTY 一覧要約、bounded runtime-error-store status、任意 vendor launcher の可用性だけを返す。path・環境値・認証情報・コマンド本文・PTY 出力・raw log は意図的に返さない。通常未設定の任意依存は `not_applicable`、安全に確定できない状態は `unverified` と表す。
621
621
 
622
+ `diagnostics({format:"v2"})`は同じ2つのtextを保ち、第1textを`aiterm-mcp.factory-diagnostics.v2`にする。`pty_list`には固定`reason_code`(`listed`/`socket_absent`/`dependency_unavailable`/`permission_denied`/`timeout`/`output_limit`/`signal`/`native_failure`)と`timeout_ms:5000`を追加する。binary解決とread-only一覧1回で共通5000msのsubprocess予算・1MiB出力上限を使い、PTYは作らない。不在はexit1・空stdout・選択socketの完全一致した不在文言が揃う場合だけ。他socket・権限/接続拒否・相反出力・未知はunverifiedのまま、生文言は返さない。`{}`/`{format:"v1"}`は既存fieldとschemaを維持し、不在判定だけを厳密化する。v2使用前に同接続のtoolが`format`を宣言していることと返却v2 schemaを確認する。旧serverは未知引数を捨て得る。vendor解決とruntime storeは既存の別の有限期限を持ち、5000msはPTY subprocessの予算であってMCP全体又はOSのhard realtime保証ではない。
623
+
622
624
  結果のtextは2つある。1つ目は上の内容で、項目を固定したfactory向けのJSON(`aiterm-mcp.factory-diagnostics.v1`)。2つ目は親配送hookの状態(`aiterm-mcp.parent-delivery-diagnostics.v1`)で、Claude Code・Cursorそれぞれの`status`(`ready`/`setup_required`/`not_applicable`/`unverified`)と`reason_code`、呼出元のclientに当たる`caller_status`を返す。`caller_status`が`setup_required`なら、そのclientからのagent送信は拒否されるので`aiterm-setup`を実行する。hookの状態は1つ目の`overall`には含めない。
623
625
 
624
626
  ### ローカル runtime error snapshot
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.63.5** · 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.63.6** · 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
 
@@ -661,6 +661,8 @@ continue to use `claude_approval`.
661
661
 
662
662
  `diagnostics` never starts a PTY or agent. It reports package version, MCP call readiness, a read-only PTY-list summary, bounded runtime-error-store status, and optional vendor-launcher availability. It deliberately excludes paths, environment values, credentials, command text, PTY output, and raw logs; normal unset optional dependencies are `not_applicable`, while an indeterminate probe is `unverified`.
663
663
 
664
+ `diagnostics({format:"v2"})` keeps the two text items and uses `aiterm-mcp.factory-diagnostics.v2` for the first. Its `pty_list` adds `reason_code` (`listed`, `socket_absent`, `dependency_unavailable`, `permission_denied`, `timeout`, `output_limit`, `signal`, or `native_failure`) and `timeout_ms:5000`. Binary resolution and one read-only native listing share that 5000 ms subprocess budget and a 1 MiB output limit; no PTY is created. An absent result requires exit 1, empty stdout, and the exact selected-socket absence diagnostic. Other sockets, permission/refused connections, conflicting output and unknown failures stay unverified. Unknown text is never echoed. `{}` or `{format:"v1"}` retains the existing fields and schema, with the corrected strict absence classification. Inspect the connected tool's advertised `format` before opting into v2 and require the returned v2 schema: older servers can discard unknown input fields. Vendor lookup and runtime-store checks retain their own finite deadlines; the 5000 ms field describes the PTY subprocess budget, not the entire MCP call or a hard real-time OS guarantee.
665
+
664
666
  The result carries two text items. The first is the factory JSON described above (`aiterm-mcp.factory-diagnostics.v1`), whose fields are fixed. The second reports the parent-delivery hooks (`aiterm-mcp.parent-delivery-diagnostics.v1`): a `status` (`ready` / `setup_required` / `not_applicable` / `unverified`) and `reason_code` for Claude Code and Cursor, plus `caller_status` for the calling client. When `caller_status` is `setup_required`, agent dispatch from that client is rejected; run `aiterm-setup`. Hook status is not folded into `overall` in the first item.
665
667
 
666
668
  ### Local runtime error snapshot
package/dist/core.js CHANGED
@@ -51,7 +51,7 @@ import { unfinishedDeliveriesOwnedBy } from "./parent-delivery-owners.js";
51
51
  import { readLinuxProcessRegistrationIdentity, readRuntimeProcesses, readProcessIdentities, processSubtree, parentProcess, processIdentity, signalRuntimeProcess, backgroundProcesses, lazyRelayProcess, aitermProcessProbe, windowsConsoleHost, macKeepAwakeProcess, processElapsedSeconds } from "./process-runtime.js";
52
52
  import { liveNodeExecutable } from "./live-node.js";
53
53
  import { AitermError, AgentResumeError, telemetryOwnedFailure, ownTelemetryFailure } from "./errors.js";
54
- import { isWin, SOCKDIR, SOCK, tmuxCommand, tmuxCommandWithInput, sendPsmuxPayload, loadPtyBufferChunk, pasteBufferBaseArgs, tmuxNewSession, withNativeSessionCreation, withNativeSessionTarget, hasVerifiedNativeSessionTarget, registeredSessionEnvironment, registerSessionEnvironment, attachCommand, normalizePaneCommand, atomicShellMultiline, appendMarkSentinel, paneShellForSubmission, adaptShellSubmission, settlePaneLog, paneCwdArgument, sessionEnvironmentLaunch, paneCommandArgs, } from "./tmux-runtime.js";
54
+ import { isWin, SOCKDIR, SOCK, tmuxCommand, readOnlyTmuxList, PtyDiagnosticError, tmuxCommandWithInput, sendPsmuxPayload, loadPtyBufferChunk, pasteBufferBaseArgs, tmuxNewSession, withNativeSessionCreation, withNativeSessionTarget, hasVerifiedNativeSessionTarget, registeredSessionEnvironment, registerSessionEnvironment, attachCommand, normalizePaneCommand, atomicShellMultiline, appendMarkSentinel, paneShellForSubmission, adaptShellSubmission, settlePaneLog, paneCwdArgument, sessionEnvironmentLaunch, paneCommandArgs, } from "./tmux-runtime.js";
55
55
  import { AGENT_DEFAULT_PREFACE, sleep, currentUid, runtimeStateBase, safeStatSize, readFileRange, writeJson0600, createEmpty0600, shq, LAUNCH_ID_RE, AGENT_LINEAGE_RE, AGENT_DONE_POLL_MS, AGENT_RATE_LIMIT_POLL_MS, pollGate, AGENT_EVENT_MAX_BYTES, assertSessionName, agentsDir, readAgentGeneration, selectAgentMetadataFile, publishAgentGeneration, agentMetadataPath, writeAgentMetadata, AGENT_EVENT_TAIL_BYTES, agentLabel, agentHarness, subagentInstruction, } from "./agent-shared.js";
56
56
  import { AuthResponseError, authUi, authPromptDigest, authBindingSchema, authResponseSchema } from "./agent-auth-ui.js";
57
57
  import { processStartIdentity } from "./runtime-error-os.js";
@@ -2193,22 +2193,26 @@ export function agentSessionChildren() {
2193
2193
  * session 名・前面コマンド・PTY 出力を診断応答へ持ち出さないため、factory が安全に readiness を
2194
2194
  * 見られる。socket 不在は「セッション未設定」であって障害ではない。
2195
2195
  */
2196
- export function readOnlyPtyListDiagnostic(runTmux = tmux) {
2196
+ export function readOnlyPtyListDiagnostic(runTmux = readOnlyTmuxList, detailed = false) {
2197
+ const result = (status, session_count, reason_code) => detailed ? { status, session_count, reason_code } : { status, session_count };
2197
2198
  try {
2198
2199
  const r = runTmux("list-sessions", "-F", "#{session_name}");
2199
- if (r.code === 0) {
2200
- return { status: "ready", session_count: r.stdout.split(/\r?\n/).filter(Boolean).length };
2200
+ if (r.code === 0 && r.stderr.trim() === "") {
2201
+ return result("ready", r.stdout.split(/\r?\n/).filter(Boolean).length, "listed");
2201
2202
  }
2202
- // tmux は専用 socket に server がいない通常状態を exit 1 で返す。その他の失敗を「空」と
2203
- // 偽装しないため、メッセージを公開せず unverified に留める。
2204
- if (/no server running|failed to connect/i.test(r.stderr)) {
2205
- return { status: "not_applicable", session_count: null };
2203
+ if (absentExecutionServer(r)) {
2204
+ return result("not_applicable", null, "socket_absent");
2206
2205
  }
2206
+ if (r.code === 1 && r.stdout.trim() === "" && [
2207
+ `error connecting to ${SOCK} (Permission denied)`, `failed to connect to ${SOCK}: Permission denied`,
2208
+ `error connecting to ${SOCK} (Operation not permitted)`,
2209
+ ].includes(r.stderr.trim()))
2210
+ return result("unverified", null, "permission_denied");
2207
2211
  }
2208
- catch {
2209
- // tmux/psmux 未導入等。絶対 path や生 stderr を診断 JSON に出さない。
2212
+ catch (error) {
2213
+ return result("unverified", null, error instanceof PtyDiagnosticError ? error.reasonCode : "native_failure");
2210
2214
  }
2211
- return { status: "unverified", session_count: null };
2215
+ return result("unverified", null, "native_failure");
2212
2216
  }
2213
2217
  /** 別processが待機中・送信中のsessionは閉じない。閉じる前の操作(下のClaude Codeへの終了の鍵)より先に確かめる。 */
2214
2218
  function assertSessionClosable(name) {
package/dist/index.js CHANGED
@@ -204,8 +204,8 @@ export function createAitermServer(options = {}) {
204
204
  * Factory 向けの read-only 診断。JSON の field は意図的に allowlist 制で、絶対 path、環境変数、
205
205
  * token、コマンド本文、PTY 出力、raw log、認証状態を公開しない。
206
206
  */
207
- async function factoryDiagnostics() {
208
- const ptyList = core.readOnlyPtyListDiagnostic();
207
+ async function factoryDiagnostics(format = "v1") {
208
+ const ptyList = core.readOnlyPtyListDiagnostic(undefined, format === "v2");
209
209
  const claude = core.harnessLauncherDiagnostic("claude");
210
210
  const codex = core.harnessLauncherDiagnostic("codex");
211
211
  const grok = core.harnessLauncherDiagnostic("grok");
@@ -214,11 +214,11 @@ export function createAitermServer(options = {}) {
214
214
  const runtimeErrors = await runtimeErrorStoreDiagnostic();
215
215
  const overall = ptyList.status === "unverified" || runtimeErrors.status === "unverified" ? "unverified" : "ready";
216
216
  return JSON.stringify({
217
- diagnostic_schema: "aiterm-mcp.factory-diagnostics.v1",
217
+ diagnostic_schema: format === "v2" ? "aiterm-mcp.factory-diagnostics.v2" : "aiterm-mcp.factory-diagnostics.v1",
218
218
  version: pkg.version,
219
219
  overall,
220
220
  mcp: { transport: "stdio", initialize: "ready", tool_call: "ready" },
221
- pty_list: { access: "read_only", ...ptyList },
221
+ pty_list: { access: "read_only", ...ptyList, ...(format === "v2" ? { timeout_ms: 5000 } : {}) },
222
222
  runtime_error_store: runtimeErrors,
223
223
  vendor_dependencies: {
224
224
  claude: {
@@ -355,11 +355,11 @@ export function createAitermServer(options = {}) {
355
355
  server.registerTool("diagnostics", {
356
356
  description: "Factory 向け read-only 診断。安全な状態語彙だけを機械可読 JSON で返す(PTY 内容・認証情報・path・環境値は返さない)。" +
357
357
  "2つ目のtextは親配送hook(Claude Code・Cursor)の登録状態で、caller_status が setup_required なら呼出元からのagent送信は拒否される。aiterm-setup を実行する。",
358
- inputSchema: {},
358
+ inputSchema: { format: z.enum(["v1", "v2"]).optional().describe("既定v1は既存の固定fieldを維持。v2はPTY診断の安全なreason_codeを含む。") },
359
359
  },
360
360
  // 1つ目は項目を固定したfactory向けの契約。親配送hookの状態は別のtextに分け、既存の読み手の形を変えない。
361
- async () => ({ content: [
362
- { type: "text", text: await factoryDiagnostics() },
361
+ async ({ format }) => ({ content: [
362
+ { type: "text", text: await factoryDiagnostics(format) },
363
363
  { type: "text", text: JSON.stringify(parentDeliveryDiagnostic(deliveryParentKind(server.server.getClientVersion()?.name))) },
364
364
  ] }));
365
365
  const DEFAULT_PTY_SHELL = process.platform === "win32" ? "pwsh" : "bash";
@@ -156,10 +156,37 @@ export function psmuxVersionSupported(output) {
156
156
  }
157
157
  let winPsmuxOk = false;
158
158
  let winPsmuxVersion = null;
159
- export function ensureWinPsmux(observe = true) {
159
+ export const PTY_DIAGNOSTIC_TIMEOUT_MS = 5000;
160
+ export class PtyDiagnosticError extends Error {
161
+ reasonCode;
162
+ constructor(reasonCode) {
163
+ super("PTY diagnostic unavailable");
164
+ this.reasonCode = reasonCode;
165
+ }
166
+ }
167
+ function diagnosticSpawnOptions(deadline) {
168
+ if (deadline === undefined)
169
+ return {};
170
+ const remaining = Math.ceil(deadline - performance.now());
171
+ if (remaining <= 0)
172
+ throw new PtyDiagnosticError("timeout");
173
+ return { timeout: remaining, killSignal: "SIGKILL", maxBuffer: 1024 * 1024 };
174
+ }
175
+ function diagnosticSpawnFailure(result, deadline, dependency = false) {
176
+ if (deadline === undefined)
177
+ return;
178
+ const code = result.error?.code;
179
+ const reason = code === "ETIMEDOUT" ? "timeout" : code === "ENOBUFS" ? "output_limit"
180
+ : code === "EACCES" || code === "EPERM" ? "permission_denied" : code === "ENOENT" ? "dependency_unavailable"
181
+ : result.error ? "native_failure" : result.signal ? "signal" : dependency && result.status !== 0 ? "dependency_unavailable" : null;
182
+ if (reason)
183
+ throw new PtyDiagnosticError(reason);
184
+ }
185
+ export function ensureWinPsmux(observe = true, deadline) {
160
186
  if (winPsmuxOk)
161
187
  return;
162
- const r = spawnSync(psmuxBin(), ["-V"], { encoding: "utf8", timeout: 10000 });
188
+ const r = spawnSync(psmuxBin(), ["-V"], { encoding: "utf8", timeout: 10000, ...diagnosticSpawnOptions(deadline) });
189
+ diagnosticSpawnFailure(r, deadline, true);
163
190
  if (r.error) {
164
191
  const code = r.error.code;
165
192
  if (code === "ENOENT")
@@ -168,8 +195,11 @@ export function ensureWinPsmux(observe = true) {
168
195
  }
169
196
  if (r.status !== 0)
170
197
  ptyDependencyError("psmux -V が失敗しました。`psmux -V` が通るか確認してください。", observe);
171
- if (!psmuxVersionSupported(r.stdout ?? ""))
198
+ if (!psmuxVersionSupported(r.stdout ?? "")) {
199
+ if (deadline !== undefined)
200
+ throw new PtyDiagnosticError("dependency_unavailable");
172
201
  ptyDependencyError("psmux 3.3.8以上が必要です。winget upgrade --id marlocarlo.psmux --source winget で更新してください。", observe);
202
+ }
173
203
  winPsmuxVersion = /^psmux (\d+\.\d+\.\d+)(?:\s|$)/mu.exec(r.stdout ?? "")?.[1] ?? null;
174
204
  winPsmuxOk = true;
175
205
  }
@@ -304,18 +334,21 @@ function tmuxMissingMessage() {
304
334
  // 解決順: AITERM_TMUX(明示指定)→ PATH 上の tmux → Homebrew 既定パス。一度だけ実行しキャッシュする。
305
335
  // 見つからなければ tmuxMissingMessage で投げる(黙ってフォールバックせず、原因が見えるようにする)。
306
336
  let tmuxBin = null;
307
- export function resolveTmux(observe = true) {
337
+ export function resolveTmux(observe = true, deadline) {
308
338
  if (tmuxBin)
309
339
  return tmuxBin;
310
340
  const override = process.env.AITERM_TMUX;
311
341
  if (override) {
312
- const r = spawnSync(override, ["-V"], { encoding: "utf8", timeout: 5000 });
342
+ const r = spawnSync(override, ["-V"], { encoding: "utf8", timeout: 5000, ...diagnosticSpawnOptions(deadline) });
343
+ diagnosticSpawnFailure(r, deadline, true);
313
344
  if (!r.error && r.status === 0)
314
345
  return (tmuxBin = override);
315
346
  ptyDependencyError(`AITERM_TMUX に指定された tmux を起動できません: ${override}(\`${override} -V\` が通りません)`, observe);
316
347
  }
317
348
  // CLI/開発時は PATH 上の tmux をそのまま使う(最優先)。
318
- const onPath = spawnSync("tmux", ["-V"], { encoding: "utf8", timeout: 5000 });
349
+ const onPath = spawnSync("tmux", ["-V"], { encoding: "utf8", timeout: 5000, ...diagnosticSpawnOptions(deadline) });
350
+ if (onPath.signal || ["ETIMEDOUT", "ENOBUFS"].includes(onPath.error?.code ?? ""))
351
+ diagnosticSpawnFailure(onPath, deadline);
319
352
  if (!onPath.error && onPath.status === 0)
320
353
  return (tmuxBin = "tmux");
321
354
  // GUI 起動などで PATH に Homebrew の bin が無い場合、既定の場所を探す。
@@ -323,13 +356,15 @@ export function resolveTmux(observe = true) {
323
356
  for (const cand of ["/opt/homebrew/bin/tmux", "/usr/local/bin/tmux"]) {
324
357
  try {
325
358
  fs.accessSync(cand, fs.constants.X_OK);
326
- console.error(`aiterm: tmux が PATH 上に無いため ${cand} を使用します`);
359
+ if (deadline === undefined)
360
+ console.error(`aiterm: tmux が PATH 上に無いため ${cand} を使用します`);
327
361
  return (tmuxBin = cand);
328
362
  }
329
363
  catch {
330
364
  /* 次の候補へ */
331
365
  }
332
366
  }
367
+ diagnosticSpawnFailure(onPath, deadline, true);
333
368
  ptyDependencyError(tmuxMissingMessage(), observe);
334
369
  }
335
370
  // tmux は locale が C/POSIX/未設定だと UTF-8 を扱えない: server は send-keys/paste のマルチバイト
@@ -352,7 +387,7 @@ export function tmuxCommandWithInput(observe, input, ...args) {
352
387
  }
353
388
  // session は、新しい session を作る呼び出しの時だけ渡す client の環境(POSIX のみ)。server を起こし得るのは
354
389
  // この呼び出しだけなので、空 config の指定と macOS の gui domain での起動もここに限る。
355
- function runTmux(observe, input, args, session) {
390
+ function runTmux(observe, input, args, session, deadline) {
356
391
  // Authorize the logical/native session before routing it to its pinned pane.
357
392
  args = nativeSessionArgs(guardTmuxExecution(args));
358
393
  args = nativeConditionalArgs(args);
@@ -360,19 +395,20 @@ function runTmux(observe, input, args, session) {
360
395
  // 頭打ちになり stdout が切れる/空になる。Python の subprocess.run は無制限だったので 64MiB へ広げる。
361
396
  // Windows は tmux CLI 互換の native psmux を -L namespace 隔離で叩く(WSL 非依存)。
362
397
  let r;
363
- const spawnOpts = { encoding: "utf8", maxBuffer: 64 * 1024 * 1024, input, env: session ?? tmuxSpawnEnv() };
398
+ const spawnOpts = () => ({ encoding: "utf8", maxBuffer: 64 * 1024 * 1024, input, env: session ?? tmuxSpawnEnv(), ...diagnosticSpawnOptions(deadline) });
364
399
  if (isWin) {
365
- ensureWinPsmux(observe);
366
- r = spawnSync(psmuxBin(), ["-L", WIN_NS, ...args], spawnOpts);
400
+ ensureWinPsmux(observe, deadline);
401
+ r = spawnSync(psmuxBin(), ["-L", WIN_NS, ...args], spawnOpts());
367
402
  }
368
403
  else {
369
404
  // resolveTmux() は tmux を解決できなければ明確な AitermError を投げる(POSIX 版の事前確認)。
370
- const bin = resolveTmux(observe);
405
+ const bin = resolveTmux(observe, deadline);
371
406
  // -f は tmux 本体の引数で、server を起こす時にだけ読まれる(new-session の -f は別物で、config を指さない)。
372
407
  const argv = session ? ["-f", TMUX_EMPTY_CONFIG, "-S", SOCK, ...args] : ["-S", SOCK, ...args];
373
408
  r = (session && macGuiServerWanted(bin) && startTmuxInMacGui(bin, argv, session))
374
- || spawnSync(bin, argv, spawnOpts);
409
+ || spawnSync(bin, argv, spawnOpts());
375
410
  }
411
+ diagnosticSpawnFailure(r, deadline);
376
412
  // ENOBUFS(出力が 64MiB 超)を「code=1 の失敗」へ握り潰すと部分/空 stdout を正常扱いしてしまう。区別して投げる。
377
413
  // EXPECTED-FAILURE: 外部システム境界(tmux 出力過大)
378
414
  if (r.error && r.error.code === "ENOBUFS") {
@@ -391,6 +427,10 @@ function runTmux(observe, input, args, session) {
391
427
  verifyNativeTarget(native);
392
428
  return { code: r.status ?? 1, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
393
429
  }
430
+ /** One read-only probe; resolution and listing consume the same subprocess budget. */
431
+ export function readOnlyTmuxList() {
432
+ return runTmux(false, undefined, ["list-sessions", "-F", "#{session_name}"], undefined, performance.now() + PTY_DIAGNOSTIC_TIMEOUT_MS);
433
+ }
394
434
  // macOS の login keychain は GUI(Aqua)の security session からしか読めない。SSH 等から立てた
395
435
  // tmux server の pane では Claude Code・Cursor CLI がログイン済みでも未ログイン扱いになる。
396
436
  // server が無く、自分が Aqua の外にいて、同じ利用者が画面にログインしている時だけ、最初の
package/docs/DESIGN.md CHANGED
@@ -587,3 +587,5 @@ Grok clear uses the existing host-origin contract and only a fresh UserPaused/Id
587
587
  休止の直前には、保存templateではなく元nativeのmodel/effort/fast表示を、同じ送信admissionとcreate receiptで確認する。harnesses/idle-settings.tsが保存しないnative表示の確認/取消しを所有し、coreは既存の入力とready確認を供給する。確認後の画面やattach履歴が最初のsignal前に変われば停止しない。未対応表示や現在設定の欠測はskipし、native表示用の命令を活動時刻へ数えない。詳細と現時点の受入限界はADR0138。
588
588
 
589
589
  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.
590
+
591
+ Factory diagnostics keep the v1 default projection and the separate parent-hook text. Optional format v2 adds fixed PTY reason codes and the 5000ms subprocess budget. Native resolution and the single scoped listing consume one deadline; unknown/permission/timeout failures do not prove absence. This uses ordinary native reads and no execution graph, PTY creation or credentials. The subprocess budget is not a hard real-time bound on OS filesystem calls or the complete diagnostics response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.63.5",
3
+ "version": "0.63.6",
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": [