aiterm-mcp 0.63.11 → 0.63.12
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 +2 -2
- package/README.md +2 -2
- package/dist/core.js +6 -62
- 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.63.12] - 2026-11-07
|
|
11
|
+
|
|
12
|
+
- Remove filesystem input locks and the legacy socket/log-directory readiness predicate from managed-agent send and fresh-launch admission. Keep process-local order, current launch/native identity and stable TUI readiness checks. Independent local MCP and remote callers now serialize the same agent seat themselves; ordinary PTY/shell and standalone auth/approval file exclusion remain unchanged.
|
|
13
|
+
- Distinguish pre-input native absence (`AGENT_INPUT_TARGET_UNAVAILABLE`) from an actual TUI readiness refusal (`AGENT_INPUT_NOT_READY`) in error text. Public schemas/options are unchanged; these labels do not retrospectively identify older generic failures or prove vendor acceptance.
|
|
14
|
+
|
|
10
15
|
## [0.63.11] - 2026-11-06
|
|
11
16
|
|
|
12
17
|
- Let any MCP client opt into existing host-controller routing with the initialize experimental capability `io.github.kitepon/aiterm-mcp/host-controller: {}`. The exact `bellteam` client name remains a backward-compatible alias; undeclared clients retain ordinary direct routing.
|
|
@@ -3058,7 +3063,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3058
3063
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3059
3064
|
provenance.
|
|
3060
3065
|
|
|
3061
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.
|
|
3066
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.12...HEAD
|
|
3067
|
+
[0.63.12]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.11...v0.63.12
|
|
3062
3068
|
[0.63.11]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.10...v0.63.11
|
|
3063
3069
|
[0.63.10]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.9...v0.63.10
|
|
3064
3070
|
[0.63.9]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.8...v0.63.9
|
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.63.
|
|
218
|
+
**状態:** 開発継続中 · 現行公開版 **v0.63.12** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
219
219
|
|
|
220
220
|
### 更新と巻き戻し
|
|
221
221
|
|
|
@@ -786,7 +786,7 @@ agent_launch({ "harness": "codex-cli", "remote": { "host": "rabbit" }, "cwd": "/
|
|
|
786
786
|
|
|
787
787
|
`pty_send` はコマンドやpromptの意味を判定せず、指定された本文を端末へ送る。既定ではESC・ブラケットペースト終端などをサニタイズし、`pty_read`も制御文字を無害化して返す(`raw: true`はそのまま扱う)。コマンドの許可・拒否はshell、接続先、起動したharnessが所有する。
|
|
788
788
|
|
|
789
|
-
1回の `pty_send` が受理する本文はUTF-8で最大64KiB
|
|
789
|
+
1回の `pty_send` が受理する本文はUTF-8で最大64KiB。Managed-agent callers serialize operations for the same seat across independent local MCP and remote clients. Aiterm keeps process-local ordering/native ownership; agent input has no filesystem send-lock or legacy directory readiness prerequisite. Ordinary PTY/shell and standalone auth/approval retain existing file exclusion.全OSで長いPTY入力の欠落を避けるためplatformのmultiplexerへUTF-8境界を壊さない256-byte単位でpasteし、chunk間に10msのdrain間隔を置く。POSIX shellまたはPowerShellが前面にいる時のsanitize済み複数行は、改行を含まない単一入力へ符号化する。POSIXは`eval`、PowerShellはUTF-8のBase64を復元したscriptblockのdot-sourceを使い、変数と作業場所を現在のshellに保つ。shellがscript全体を所有してから先頭行を実行するため、途中で起動したpager/REPLが後続行を対話キーとして奪わない。単一行、`raw:true`、非shell前面は従来どおり直接PTYへpasteする。agent dispatchは本文全体を`ESC[200~/201~`で1回だけ包み、包んだ全体を同じchunkで流す。agent TUIには1回の貼り付けに見えるので画像pathが貼り付けの間で切れず、chunk投入中のキー解釈による語中文字化け・submit取り落としも抑える。途中chunkが失敗した場合は部分送信済みであることを明示し、自動でEnterを押さない。For ordinary PTY/shell input, a lock left by a terminated sender still fails closed.`pty_list`で対象sessionを確認し、`pty_close`で閉じてから同じsession IDを作り直す。公開の一括停止toolは存在しない。 POSIXの明示native execution構成では、unknown sendになった対象1席も`pty_close`で閉じて再作成できる。元requestはunknownのまま保持し、再送しない。発行中の操作、管理close自体のunknown、native identityが不明な席は引き続き拒否する。
|
|
790
790
|
|
|
791
791
|
BellTeamのmodel・effort・fast変更も、既存session世代に結合したnative管理要求で受け付ける。途中で世代・受付枠・停止状態が変われば、それ以降の打鍵を止める。途中まで変更した結果は作用不明のまま保持し、自動でやり直さない。
|
|
792
792
|
|
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.
|
|
230
|
+
**Status:** actively maintained · current public release **v0.63.12** · 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
|
|
|
@@ -844,7 +844,7 @@ Ordinary delivery and parent-return hooks do not acquire or wait for the shared
|
|
|
844
844
|
|
|
845
845
|
`pty_send` does not interpret command or prompt meaning; it delivers the requested text to the terminal. By default it sanitizes ESC and bracketed-paste terminators, while `pty_read` neutralizes control characters in returned output (`raw: true` keeps them unchanged). The shell, remote endpoint, or launched harness owns command authorization.
|
|
846
846
|
|
|
847
|
-
Each `pty_send` accepts at most 64 KiB of UTF-8 text.
|
|
847
|
+
Each `pty_send` accepts at most 64 KiB of UTF-8 text. Managed-agent callers must serialize operations for the same seat across independent local MCP and remote clients. Aiterm retains process-local ordering/native ownership, but agent input no longer acquires filesystem send locks or treats the legacy socket/log directory as readiness. Ordinary PTY/shell and standalone auth/approval still use their existing file exclusion. Every OS pastes through its multiplexer in UTF-8-safe 256-byte chunks with a 10 ms drain interval; macOS, Linux, and WSL2 have all demonstrated silent middle/trailing loss when a long input is pushed without that boundary. Sanitized multiline text sent while a POSIX shell or PowerShell is in the foreground is encoded as one newline-free input (`eval` for POSIX shells; a dot-sourced, UTF-8 Base64-decoded scriptblock for PowerShell): the shell receives the complete script before it runs the first line, so a pager or REPL started mid-script cannot consume later lines as interactive keystrokes. Single-line input, `raw:true`, and non-shell frontends remain direct PTY pastes. Agent dispatches additionally wrap the whole text once in `ESC[200~/201~` and stream the wrapped text in the same chunks, so the agent TUI sees one paste (an image path is never split across pastes), hardening prompt injection against mid-word key-interpretation corruption and dropped submits. If a later chunk fails, aiterm reports the partial-send state and does not press Enter automatically. For ordinary PTY/shell input, a lock left by a terminated sender fails closed before sending; use `pty_list` to confirm the affected session, close it with `pty_close`, then recreate the same session ID. There is no public kill-all tool.
|
|
848
848
|
|
|
849
849
|
## A human can watch
|
|
850
850
|
|
package/dist/core.js
CHANGED
|
@@ -101,7 +101,6 @@ const SESSION_SEND_LOCK_POLL_MS = 25;
|
|
|
101
101
|
// 同じagent sessionへの送信が重なった時に、前の1通を待つ上限(ADR 0088)。
|
|
102
102
|
// 起動から最初の描画を待つ上限と、貼り付けの上限の和。前の1通が正常に進んでいる間は待ち切れる長さにする。
|
|
103
103
|
const AGENT_SEND_LOCK_WAIT_MS = AGENT_TUI_FIRST_DRAW_TIMEOUT_MS + SESSION_SEND_LOCK_WAIT_MS;
|
|
104
|
-
const AGENT_SEND_LOCK_POLL_MS = 50;
|
|
105
104
|
const PASTE_MARKERS_RE = /\x1b\[20[01]~/g;
|
|
106
105
|
// よく使う制御キーの別名(tmux のキー名へ)
|
|
107
106
|
const KEYMAP = {
|
|
@@ -829,7 +828,7 @@ export function send(name, text, o = {}) {
|
|
|
829
828
|
`正しく展開されません。until で完了パターンを指定してください。`, 2);
|
|
830
829
|
}
|
|
831
830
|
}
|
|
832
|
-
const releaseSendLock = acquireSessionSendFileLock(name);
|
|
831
|
+
const releaseSendLock = isAgentSession(name) ? () => { } : acquireSessionSendFileLock(name);
|
|
833
832
|
try {
|
|
834
833
|
// managed Claudeの通常送信は、lastcmd/mark/PTYのどれにも触れる前に拒否する。
|
|
835
834
|
// 拒否した呼び出しが古いmarkを消したり偽のmarkを残すと、後続readが存在しない
|
|
@@ -3101,7 +3100,7 @@ function acquireSessionSendFileLock(name) {
|
|
|
3101
3100
|
// ── 同じagent sessionへの送信を1本ずつ通す(ADR 0088) ────
|
|
3102
3101
|
// 振り分け(差し込みか新しいturnか)から送り終えるまでの間に、入力受付待ちなどの待ちが挟まる。
|
|
3103
3102
|
// その間に次の1通が同じ状態を読むと、Claudeはturnの印の取り合いで後の1通が断られ、他のharnessは同じ入力欄へ2回貼る。
|
|
3104
|
-
//
|
|
3103
|
+
// Process-local order/ownership remains; independent MCP/remote clients serialize the same managed seat themselves.
|
|
3105
3104
|
const agentSendQueues = new Map();
|
|
3106
3105
|
const agentSendHeld = new Set();
|
|
3107
3106
|
const agentSendOwner = new AsyncLocalStorage();
|
|
@@ -3213,48 +3212,6 @@ function agentSendBusyError(name, pid, waitMs, untouched = AGENT_SEND_UNSENT) {
|
|
|
3213
3212
|
return new AitermError(`AGENT_SEND_BUSY: agent session '${name}' は${pid != null ? `別プロセス(pid ${pid})` : "先に受け付けた送信"}の処理中です。` +
|
|
3214
3213
|
`${waitMs}ms待っても順番が来ませんでした。${untouched}`, 2);
|
|
3215
3214
|
}
|
|
3216
|
-
async function acquireAgentSendFileLock(name, deadline, waitMs, untouched = AGENT_SEND_UNSENT) {
|
|
3217
|
-
const p = agentSendLockPath(name);
|
|
3218
|
-
let checkedOwner = null;
|
|
3219
|
-
let checkedOwnerReplaced = false;
|
|
3220
|
-
for (;;) {
|
|
3221
|
-
let token;
|
|
3222
|
-
try {
|
|
3223
|
-
token = tryCreateOwnedLock(p);
|
|
3224
|
-
}
|
|
3225
|
-
catch (e) {
|
|
3226
|
-
// socketの置き場が無ければ、守る相手のsessionにも届かない。lockを取らずに進め、送信側の今まで通りの断りを返す。
|
|
3227
|
-
if (e.code === "ENOENT")
|
|
3228
|
-
return () => { };
|
|
3229
|
-
throw e;
|
|
3230
|
-
}
|
|
3231
|
-
if (token !== null)
|
|
3232
|
-
return () => releaseOwnedLock(p, token);
|
|
3233
|
-
const probe = probeAgentSendLock(name);
|
|
3234
|
-
let dead = !probe.live;
|
|
3235
|
-
let replacedToken = null;
|
|
3236
|
-
// 生きて見える持ち主は、初めて見た時に1回、本人かを確かめる。結果は覚え、待つ間にOSへ照会し直さない。
|
|
3237
|
-
if (!dead && probe.pid != null) {
|
|
3238
|
-
const owner = `${probe.pid}@${probe.at}`;
|
|
3239
|
-
if (owner !== checkedOwner) {
|
|
3240
|
-
checkedOwner = owner;
|
|
3241
|
-
checkedOwnerReplaced = agentSendLockOwnerReplaced(probe);
|
|
3242
|
-
}
|
|
3243
|
-
if (checkedOwnerReplaced) {
|
|
3244
|
-
dead = true;
|
|
3245
|
-
replacedToken = probe.token ?? null;
|
|
3246
|
-
}
|
|
3247
|
-
}
|
|
3248
|
-
if (dead && reapDeadAgentSendLock(name, replacedToken) === "stuck") {
|
|
3249
|
-
throw new AitermError(`agent session '${name}' に、終了した送信のlockを片付ける途中で残った印があります。` +
|
|
3250
|
-
`自動回収は並行送信の混線を招くため行いません。文字列は送信していません。` +
|
|
3251
|
-
`pty_listで対象を確認し、pty_closeでsessionを閉じてから同じIDで再作成してください`, 2);
|
|
3252
|
-
}
|
|
3253
|
-
if (performance.now() >= deadline)
|
|
3254
|
-
throw agentSendBusyError(name, dead ? null : probe.pid, waitMs, untouched);
|
|
3255
|
-
await sleep(AGENT_SEND_LOCK_POLL_MS);
|
|
3256
|
-
}
|
|
3257
|
-
}
|
|
3258
3215
|
function withAgentNativeOperation(name, mutates, body) {
|
|
3259
3216
|
assertSessionName(name);
|
|
3260
3217
|
if (!isAgentSession(name))
|
|
@@ -3273,9 +3230,6 @@ function withAgentNativeOperation(name, mutates, body) {
|
|
|
3273
3230
|
};
|
|
3274
3231
|
if (!mutates || owns)
|
|
3275
3232
|
return execute();
|
|
3276
|
-
const token = tryCreateOwnedLock(agentSendLockPath(name));
|
|
3277
|
-
if (!token)
|
|
3278
|
-
throw unavailable();
|
|
3279
3233
|
const mine = Symbol(name);
|
|
3280
3234
|
agentSendHeld.add(name);
|
|
3281
3235
|
activeAgentSendOwner.set(name, mine);
|
|
@@ -3285,13 +3239,11 @@ function withAgentNativeOperation(name, mutates, body) {
|
|
|
3285
3239
|
finally {
|
|
3286
3240
|
activeAgentSendOwner.delete(name);
|
|
3287
3241
|
agentSendHeld.delete(name);
|
|
3288
|
-
releaseOwnedLock(agentSendLockPath(name), token);
|
|
3289
3242
|
}
|
|
3290
3243
|
}
|
|
3291
3244
|
async function withAgentSendLock(name, run, untouched = AGENT_SEND_UNSENT, pinResume = true) {
|
|
3292
3245
|
const launchId = tryLoadAgentMetadata(name)?.launch_id;
|
|
3293
3246
|
const waitMs = agentSendLockWaitMs;
|
|
3294
|
-
const deadline = performance.now() + waitMs;
|
|
3295
3247
|
const previous = agentSendQueues.get(name) ?? Promise.resolve();
|
|
3296
3248
|
let leave;
|
|
3297
3249
|
const mine = new Promise((resolve) => {
|
|
@@ -3315,7 +3267,6 @@ async function withAgentSendLock(name, run, untouched = AGENT_SEND_UNSENT, pinRe
|
|
|
3315
3267
|
clearTimeout(timer);
|
|
3316
3268
|
if (!myTurn)
|
|
3317
3269
|
throw agentSendBusyError(name, null, waitMs, untouched);
|
|
3318
|
-
const release = await acquireAgentSendFileLock(name, deadline, waitMs, untouched);
|
|
3319
3270
|
const mine = Symbol(name);
|
|
3320
3271
|
agentSendHeld.add(name);
|
|
3321
3272
|
activeAgentSendOwner.set(name, mine);
|
|
@@ -3328,8 +3279,6 @@ async function withAgentSendLock(name, run, untouched = AGENT_SEND_UNSENT, pinRe
|
|
|
3328
3279
|
return await agentSendOwner.run(mine, async () => {
|
|
3329
3280
|
const meta = pinResume ? tryLoadAgentMetadata(name) : null;
|
|
3330
3281
|
if (meta && !readAgentLifecycle(meta)) {
|
|
3331
|
-
if (!fs.existsSync(SOCKDIR) && !meta.resumed_from)
|
|
3332
|
-
throw new AitermError(`agent session '${name}' の ${agentLabel(meta.kind)} TUI が入力受付状態になりません。文字列は送信していません。`, 2);
|
|
3333
3282
|
const uncertain = () => new AgentResumeError("AGENT_RESUME_UNCONFIRMED", "復帰対象のnativeを確認できません。本文は送信していません。", name, meta.launch_id);
|
|
3334
3283
|
let failed;
|
|
3335
3284
|
try {
|
|
@@ -3365,7 +3314,6 @@ async function withAgentSendLock(name, run, untouched = AGENT_SEND_UNSENT, pinRe
|
|
|
3365
3314
|
finally {
|
|
3366
3315
|
activeAgentSendOwner.delete(name);
|
|
3367
3316
|
agentSendHeld.delete(name);
|
|
3368
|
-
release();
|
|
3369
3317
|
}
|
|
3370
3318
|
}
|
|
3371
3319
|
finally {
|
|
@@ -6860,7 +6808,7 @@ async function dispatchAgentTurnInLock(name, text, o, pendingSend) {
|
|
|
6860
6808
|
}
|
|
6861
6809
|
// 待たずに断るのは、応答が要る既知の画面(承認・確認のmodal)の時。どの画面で断ったかを残す。
|
|
6862
6810
|
const state = agentPaneObservation(meta.kind, ready.lastScreen);
|
|
6863
|
-
throw new AitermError(`agent session '${name}' の ${agentLabel(meta.kind)} TUI が入力受付状態になりません。文字列は送信していません。` +
|
|
6811
|
+
throw new AitermError(`AGENT_INPUT_NOT_READY: agent session '${name}' の ${agentLabel(meta.kind)} TUI が入力受付状態になりません。文字列は送信していません。` +
|
|
6864
6812
|
"少し後で pty_read(screen:true) を確認し、TUI が起動済みなら再度 pty_send してください。" +
|
|
6865
6813
|
`\nstate=${state.state} reason=${state.reason}`, 2);
|
|
6866
6814
|
}
|
|
@@ -7062,7 +7010,7 @@ function assertAgentSendHarness(name, meta, inputStarted = false, waiting = fals
|
|
|
7062
7010
|
const starting = current.reason === "harness_start_unconfirmed";
|
|
7063
7011
|
if (!current.exists || current.harness_alive === false || (starting && !waiting)) {
|
|
7064
7012
|
throw new AitermError((inputStarted ? `agent session '${name}' の ${agentLabel(meta.kind)} への入力完了を確認できません。本文を再送しないでください。`
|
|
7065
|
-
: `agent session '${name}' の ${agentLabel(meta.kind)} TUI が入力受付状態になりません。文字列は送信していません。`) +
|
|
7013
|
+
: `AGENT_INPUT_TARGET_UNAVAILABLE: agent session '${name}' の ${agentLabel(meta.kind)} TUI が入力受付状態になりません。文字列は送信していません。`) +
|
|
7066
7014
|
`\nstate=${current.state} reason=${current.reason}`, 2);
|
|
7067
7015
|
}
|
|
7068
7016
|
return !starting;
|
|
@@ -7691,10 +7639,7 @@ function prepareAgentLaunch(kind, opts = {}) {
|
|
|
7691
7639
|
throw new AitermError("AGENT_RESUME_UNCONFIRMED: 作成したnative本人性を取得できません。", 2);
|
|
7692
7640
|
initialNative = { ...receipt, server_started_identity: server, pane_started_identity: pane };
|
|
7693
7641
|
try {
|
|
7694
|
-
|
|
7695
|
-
if (!token)
|
|
7696
|
-
throw agentSendBusyError(receipt.session_id, null, 0);
|
|
7697
|
-
initialAdmission = { name: receipt.session_id, token };
|
|
7642
|
+
initialAdmission = { name: receipt.session_id };
|
|
7698
7643
|
agentSendHeld.add(receipt.session_id);
|
|
7699
7644
|
// The old launch may have entered hibernation after the public precheck.
|
|
7700
7645
|
assertNoDormantSession(receipt.session_id);
|
|
@@ -7717,9 +7662,8 @@ function prepareAgentLaunch(kind, opts = {}) {
|
|
|
7717
7662
|
}
|
|
7718
7663
|
finally {
|
|
7719
7664
|
if (initialAdmission) {
|
|
7720
|
-
const { name
|
|
7665
|
+
const { name } = initialAdmission;
|
|
7721
7666
|
agentSendHeld.delete(name);
|
|
7722
|
-
releaseOwnedLock(agentSendLockPath(name), token);
|
|
7723
7667
|
}
|
|
7724
7668
|
}
|
|
7725
7669
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.63.
|
|
3
|
+
"version": "0.63.12",
|
|
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": [
|