aiterm-mcp 0.33.0 → 0.33.1
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 +8 -1
- package/README.ja.md +3 -1
- package/README.md +3 -1
- package/dist/core.js +3 -6
- package/dist/index.js +1 -1
- package/dist/tmux-runtime.js +12 -4
- package/docs/DESIGN.md +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.33.1] - 2026-09-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- macOS・Linux上のAitermからSSH先のPowerShellへ`pty_send(mark:true)`するとPOSIXの`printf`を送っていた不具合を修理した。現在のPowerShell promptで方言を判定し、成功・失敗の完了マーカーを生成する。古いpromptや入力途中の行は使わない。
|
|
15
|
+
|
|
10
16
|
## [0.33.0] - 2026-09-09
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -1598,7 +1604,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
1598
1604
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
1599
1605
|
provenance.
|
|
1600
1606
|
|
|
1601
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.33.
|
|
1607
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.33.1...HEAD
|
|
1608
|
+
[0.33.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.33.0...v0.33.1
|
|
1602
1609
|
[0.33.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.32.0...v0.33.0
|
|
1603
1610
|
[0.32.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.31.2...v0.32.0
|
|
1604
1611
|
[0.31.2]: https://github.com/kitepon/aiterm-mcp/compare/v0.31.1...v0.31.2
|
package/README.ja.md
CHANGED
|
@@ -171,7 +171,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
|
|
|
171
171
|
場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
|
|
172
172
|
Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
|
|
173
173
|
|
|
174
|
-
**状態:** 開発継続中 · 現行公開版 **v0.33.
|
|
174
|
+
**状態:** 開発継続中 · 現行公開版 **v0.33.1** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
175
175
|
|
|
176
176
|
### 更新と巻き戻し
|
|
177
177
|
|
|
@@ -509,6 +509,8 @@ handoff contextを前置きできる。この任意経路は`throughline >= 0.9.
|
|
|
509
509
|
|
|
510
510
|
### 完了検出(5 層)
|
|
511
511
|
|
|
512
|
+
SSH先がPowerShellの場合、`mark:true`は現在の標準`PS ...>`プロンプトから方言を判定する。Aiterm自身がmacOS・Linux上でもPowerShell構文を送り、過去の出力に残ったプロンプトは判定に使わない。
|
|
513
|
+
|
|
512
514
|
`pty_read({ wait: true })`は通常PTYを、process終了/`mark:true` sentinel/`until`一致/shell復帰を伴う出力静止/timeoutの5層で判定する。agent sessionは第6の正確な層を使い、Codexは通常rollout、Grokは通常session event、Claudeはlaunch相関Stop event、Cursorは通常agent transcriptの`turn_ended`を`aiterm-wait --cursor`が観測する。親はブロックもポーリングもしない。
|
|
513
515
|
|
|
514
516
|
### トークン削減
|
package/README.md
CHANGED
|
@@ -187,7 +187,7 @@ collection is off by default and performs no network I/O. It ships via
|
|
|
187
187
|
tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
|
|
188
188
|
Release re-registers the Official MCP Registry entry.
|
|
189
189
|
|
|
190
|
-
**Status:** actively maintained · current public release **v0.33.
|
|
190
|
+
**Status:** actively maintained · current public release **v0.33.1** · 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).
|
|
191
191
|
|
|
192
192
|
### Update and rollback
|
|
193
193
|
|
|
@@ -544,6 +544,8 @@ When an agent's answer is longer than the on-screen tail (pane height ≈ 24 lin
|
|
|
544
544
|
|
|
545
545
|
### Completion detection (5 layers)
|
|
546
546
|
|
|
547
|
+
For PowerShell over SSH, `mark:true` recognizes the current standard `PS ...>` prompt and emits PowerShell syntax even when Aiterm runs on macOS or Linux. A prompt left in earlier output is not used to select the syntax.
|
|
548
|
+
|
|
547
549
|
`pty_read({ wait: true })` decides "is the command done?" via five layers: process exit / a `mark:true` sentinel / an `until` match / output quiescence with shell return / timeout. `mark` emits the shell's exit status on POSIX shells and `0` (success) or `1` (failure) on PowerShell; fish/csh/tcsh are rejected before send because they do not share either status syntax. When `mark` or `until` is active, that requested evidence takes precedence and a momentarily quiet shell cannot complete the read as quiescent. Agent sessions add a sixth exact layer: Codex observes normal rollout `task_complete`; Grok/Composer observe normal session `turn_ended`; Claude observes its additive launch-correlated Stop event; Cursor observes `turn_ended(status:"success")` in the launch-bound normal agent transcript. `aiterm-wait --cursor` performs that harness-specific observation without the parent blocking or polling. Pre-send readiness failures are MCP errors, and late completion remains recoverable without resending.
|
|
548
550
|
|
|
549
551
|
### Completion push for parent agents (`aiterm-wait`)
|
package/dist/core.js
CHANGED
|
@@ -16,7 +16,7 @@ import * as rtk from "./rtk.js";
|
|
|
16
16
|
import { paneTokenHint } from "./harnesses/pane-tokens.js";
|
|
17
17
|
import { readRuntimeProcesses, processSubtree, processIdentity, backgroundProcesses } from "./process-runtime.js";
|
|
18
18
|
import { AitermError, telemetryOwnedFailure, ownTelemetryFailure } from "./errors.js";
|
|
19
|
-
import { isWin, SOCKDIR, tmuxCommand, sendPsmuxPayload, loadPtyBufferChunk, pasteBufferBaseArgs, TMUX_EMPTY_CONFIG, attachCommand, normalizePaneCommand, appendMarkSentinel, settlePaneLog, paneCwdArgument, sessionEnvironmentLaunch, } from "./tmux-runtime.js";
|
|
19
|
+
import { isWin, SOCKDIR, tmuxCommand, sendPsmuxPayload, loadPtyBufferChunk, pasteBufferBaseArgs, TMUX_EMPTY_CONFIG, attachCommand, normalizePaneCommand, appendMarkSentinel, markShellCommand, settlePaneLog, paneCwdArgument, sessionEnvironmentLaunch, } from "./tmux-runtime.js";
|
|
20
20
|
import { sleep, currentUid, runtimeStateBase, safeStatSize, readFileRange, writeJson0600, createEmpty0600, shq, LAUNCH_ID_RE, AGENT_DONE_POLL_MS, AGENT_EVENT_MAX_BYTES, assertSessionName, agentsDir, agentEventPath, agentMetadataPath, writeAgentMetadata, AGENT_EVENT_TAIL_BYTES, agentLabel, agentHarness, subagentInstruction, agentLineageFields, } from "./agent-shared.js";
|
|
21
21
|
import { GROK_MODEL_DEFAULTS, realGrokHome, resolveAndValidateGrokAuth, assertGrokModelAvailable, grokEventsTranscript, latestGrokCompletion, observeGrokDone, buildGrokAgentCmd, grokLaunchNote, grokEnvTokens, grokTuiReady, grokTuiBusy, grokPaneObservation, grokStartupAction, grokLaunchBlockingDialog, assertGrokSandboxNotRejected, GROK_COMPOSER_MARKER_RE, grokFooterHasConfiguration, grokTranscriptText, createGrokAgentMetadata, } from "./harnesses/grok.js";
|
|
22
22
|
import { bindCodexTranscriptSession, latestCodexCompletion, observeCodexDone, buildCodexAgentCmd, codexLaunchNote, codexTuiReady, codexPaneObservation, codexApprovalDialog, codexStartupAction, CODEX_COMPOSER_MARKER_RE, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, } from "./harnesses/codex.js";
|
|
@@ -235,12 +235,9 @@ export async function ensureAgentOwnsPaneInput(name, kind) {
|
|
|
235
235
|
}
|
|
236
236
|
function paneCurrentCommandForMark(name) {
|
|
237
237
|
const foreground = paneCurrentCommand(name);
|
|
238
|
-
if (!isWin || foreground === "powershell" || foreground === "pwsh")
|
|
238
|
+
if ((!isWin && foreground !== "ssh") || foreground === "powershell" || foreground === "pwsh")
|
|
239
239
|
return foreground;
|
|
240
|
-
|
|
241
|
-
// 現在の末尾画面にPowerShell promptが描画済みなら、mark構文はその実効shellへ合わせる。
|
|
242
|
-
const screen = captureScreen(name, 4).replace(/\x1b\[[0-9;?]*[a-zA-Z]/g, "");
|
|
243
|
-
return /(?:^|\n)PS [^\r\n]*>\s*$/m.test(screen) ? "pwsh" : foreground;
|
|
240
|
+
return markShellCommand(foreground, captureScreen(name, 4));
|
|
244
241
|
}
|
|
245
242
|
function pasteBufferSupportsNoSanitizeFlag() {
|
|
246
243
|
const listed = tmux("list-commands");
|
package/dist/index.js
CHANGED
|
@@ -128,7 +128,7 @@ server.registerTool("pty_send", {
|
|
|
128
128
|
.boolean()
|
|
129
129
|
.default(false)
|
|
130
130
|
.describe("完了 sentinel(終了コード付き)で包む。pty_read(wait:true) が until 無しでも自動検出して" +
|
|
131
|
-
"完了確定する(POSIX shell と PowerShell に対応。PowerShell の rc は成功0/失敗1。" +
|
|
131
|
+
"完了確定する(POSIX shell と PowerShell に対応。SSH先の現在の標準PS promptも自動判定。PowerShell の rc は成功0/失敗1。" +
|
|
132
132
|
"fish/csh/tcsh は未対応として送信前に拒否)。" +
|
|
133
133
|
" enter:false と併用すると sentinel が実行されず完了検出が発火しない(送信後に pty_key(\"Enter\") で実行される)。"),
|
|
134
134
|
force: z
|
package/dist/tmux-runtime.js
CHANGED
|
@@ -215,13 +215,21 @@ export function normalizePaneCommand(cmd) {
|
|
|
215
215
|
return cmd;
|
|
216
216
|
return path.basename(cmd).replace(/\.exe$/i, "").toLowerCase();
|
|
217
217
|
}
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
// 完了マーカーの方言は実効shellで決める。SSH先のshellはhost OSやsshのprocess名と異なる。
|
|
219
|
+
const POWERSHELL_COMMANDS = new Set(["powershell", "pwsh"]);
|
|
220
|
+
export function markShellCommand(foreground, screen) {
|
|
221
|
+
if (POWERSHELL_COMMANDS.has(foreground))
|
|
222
|
+
return foreground;
|
|
223
|
+
if (!isWin && foreground !== "ssh")
|
|
224
|
+
return foreground;
|
|
225
|
+
// psmux起動直後の古いprocess名も、SSH先も、現在の末尾promptだけを実効shellの証拠にする。
|
|
226
|
+
const current = screen.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g, "").trimEnd();
|
|
227
|
+
return /(?:^|\n)PS [^\r\n]*>$/.test(current) ? "pwsh" : foreground;
|
|
228
|
+
}
|
|
221
229
|
export function appendMarkSentinel(text, foreground) {
|
|
222
230
|
// 複数行入力の末尾はheredoc/here-string終端になり得るため、独立した次行へ置く。
|
|
223
231
|
const separator = text.includes("\n") ? "\n" : "; ";
|
|
224
|
-
if (
|
|
232
|
+
if (POWERSHELL_COMMANDS.has(foreground)) {
|
|
225
233
|
// command echoに完成済みrc=<数字>を含めない。{0}を実行時formatして早期誤完了を防ぐ。
|
|
226
234
|
return text + separator +
|
|
227
235
|
"if ($?) { [Console]::WriteLine([Environment]::NewLine + ('<<<AITERM_DONE rc={0}>>>' -f 0)) }" +
|
package/docs/DESIGN.md
CHANGED
|
@@ -25,6 +25,8 @@ Windows nativeではpsmux 3.3.8以上に保存され、MCP serverやclientの再
|
|
|
25
25
|
`pty_read`は制御文字除去、反復圧縮、head+tail、command別reducerでcontext量を減らす。
|
|
26
26
|
完了はprocess exit、shell sentinel、literal/regex `until`、shell復帰を伴うquiescence、timeoutを区別する。
|
|
27
27
|
要求されたsentinel/untilを静止判定より優先し、nested shellで証拠がない状態を完了へ丸めない。
|
|
28
|
+
sentinelの方言は端末runtimeが実効shellから決める。SSH先の現在の標準PowerShell promptを
|
|
29
|
+
検出した場合は、Aiterm hostのOSに関係なくPowerShell構文を使う。過去のpromptでは切り替えない。
|
|
28
30
|
|
|
29
31
|
`pty_list`はtextと構造化したsession一覧を返す。`env_keys`は帰属等の非秘密キーの明示照会だけで、
|
|
30
32
|
psmuxが出力した余分な環境値を返さない。通常PTYとagentへ`AITERM_SESSION_ID`を注入し、
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
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, and Cursor Agent CLI, plus durable PTYs for SSH, containers, and REPLs.",
|
|
6
6
|
"keywords": [
|