aiterm-mcp 0.63.17 → 0.63.18
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 +2 -2
- package/README.md +2 -2
- package/dist/core.js +23 -8
- package/dist/harnesses/claude.js +2 -2
- package/dist/index.js +9 -1
- 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.63.18] - 2026-11-08
|
|
11
|
+
|
|
12
|
+
- `pty_read(agent_transcript:true, input_id)` reads the Claude answer of the input that `pty_send` returned in its dispatch receipt. It selects that input's `agent_done` and does not refuse because a later turn is active, so a reply typed right after a turn ends no longer breaks the read of the previous answer. The answer is returned only while the per-launch result file still holds that event's digest and bytes. No completion yet answers `AITERM_TRANSCRIPT_INPUT_PENDING`; a result already replaced by a later turn answers `AITERM_TRANSCRIPT_INPUT_REPLACED`. `input_id` with a non-Claude session or with `operation_id` is an argument error. structuredContent is unchanged.
|
|
13
|
+
- Transcript read errors now start with a code token, rendered as `aiterm: <CODE>: <text>`: `TRANSCRIPT_TURN_ACTIVE` (an unbound Claude read while a turn is active), `TRANSCRIPT_UNAVAILABLE`, `TRANSCRIPT_NOT_FOUND` and `TRANSCRIPT_RESULT_MISMATCH`. Match the token, not the text.
|
|
14
|
+
- The macOS CI job removes Aiterm test tmux servers left by a cancelled or timed-out job before and after it runs.
|
|
15
|
+
|
|
10
16
|
## [0.63.17] - 2026-11-08
|
|
11
17
|
|
|
12
18
|
- A managed seat whose native terminal vanished while its records survived (for example after a container restart emptied tmux) is no longer refused with `AGENT_RESUME_UNCONFIRMED: 作成したnative端末が置き換わっています。` on every send. When the native list is known and the seat has no lifecycle or pending resume, an ordinary `pty_send`/dispatch records the existing `origin:restart` hibernation and cold-resumes the same Claude or Codex conversation, then delivers the body. A seat that cannot be resumed (other harnesses, missing vendor conversation, recipe or proof) answers `AGENT_SESSION_REQUIRED` with nothing sent and its records unchanged, so a fresh `agent_launch` under the same name reaches it. Unknown native state and live natives keep their existing checks.
|
|
@@ -3088,7 +3094,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3088
3094
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3089
3095
|
provenance.
|
|
3090
3096
|
|
|
3091
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.
|
|
3097
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.18...HEAD
|
|
3098
|
+
[0.63.18]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.17...v0.63.18
|
|
3092
3099
|
[0.63.17]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.16...v0.63.17
|
|
3093
3100
|
[0.63.16]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.15...v0.63.16
|
|
3094
3101
|
[0.63.15]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.14...v0.63.15
|
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.18** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
219
219
|
|
|
220
220
|
### 更新と巻き戻し
|
|
221
221
|
|
|
@@ -611,7 +611,7 @@ Claudeの相関済み承認は既存の`claude_approval`を使う。
|
|
|
611
611
|
| --- | --- | --- |
|
|
612
612
|
| `pty_open` | 端末を1個開き`session_id`を返す | `name?`, `shell?`, `env_vars?` |
|
|
613
613
|
| `pty_send` | テキストを送る。agent sessionでは子のturnが実行中なら現在のturnへ差し込み(`agent_steer`)、それ以外は非ブロックdispatchとして`event_cursor`を返す(`agent_dispatch`)。差し込みでGrokが待ち行列へ入れない時とCursorの入力欄に残った時は失敗する | `session_id`, `text`, `enter=true`, `mark`, `force`, `require_agent=false`, `preface`, `rtk`, `raw` |
|
|
614
|
-
| `pty_read` | 出力を削減して読む(既定は増分) | `session_id`, `wait`, `until`, `until_regex`, `timeout`, `screen`, `full`, `lines`, `line_range`, `raw`, `rtk`, `agent_transcript`, `operation_id` |
|
|
614
|
+
| `pty_read` | 出力を削減して読む(既定は増分) | `session_id`, `wait`, `until`, `until_regex`, `timeout`, `screen`, `full`, `lines`, `line_range`, `raw`, `rtk`, `agent_transcript`, `operation_id`, `input_id` |
|
|
615
615
|
| `pty_key` | 制御キーを送る | `session_id`, `key`(`C-c`/`Enter`/`Up`…) |
|
|
616
616
|
| `pty_close` | 冪等に閉じ、`closed` / `already_closed`を返す | `session_id` |
|
|
617
617
|
| `pty_list` | textと構造化したsession一覧。管理対象の起動ID `launch_id` は一覧取得時の値で、通常PTYやmetadata不明時はnull、旧remote版は省略。操作前の最新の紐付け確認は引き続き必要。明示した非秘密環境変数も照会できる | `env_keys?` |
|
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.18** · 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
|
|
|
@@ -651,7 +651,7 @@ continue to use `claude_approval`.
|
|
|
651
651
|
| --- | --- | --- |
|
|
652
652
|
| `pty_open` | Open one terminal and return a `session_id` | `name?`, `shell?`, `env_vars?` |
|
|
653
653
|
| `pty_send` | Send text. On an agent session Aiterm picks the route when it sends: if the child's turn is running, it steers the text into that turn (`agent_steer`); otherwise it is a non-blocking **dispatch** returning an `event_cursor` (`agent_dispatch`). Steering fails when Grok does not queue the text or Cursor leaves it in the composer | `session_id`, `text`, `enter=true`, `mark`, `force`, `require_agent=false`, `preface`, `rtk`, `raw` |
|
|
654
|
-
| `pty_read` | Read output, token-reduced (incremental by default) | `session_id`, `wait`, `until`, `until_regex`, `timeout`, `screen`, `full`, `lines`, `line_range`, `raw`, `rtk`, `agent_transcript`, `operation_id` |
|
|
654
|
+
| `pty_read` | Read output, token-reduced (incremental by default) | `session_id`, `wait`, `until`, `until_regex`, `timeout`, `screen`, `full`, `lines`, `line_range`, `raw`, `rtk`, `agent_transcript`, `operation_id`, `input_id` |
|
|
655
655
|
| `pty_key` | Send a control key | `session_id`, `key` (`C-c`/`Enter`/`Up`…) |
|
|
656
656
|
| `pty_close` | Close idempotently; return `closed` / `already_closed` | `session_id` |
|
|
657
657
|
| `pty_list` | Text and structured session list (managed sessions include snapshot `launch_id` and harness conversation ID `vendor_session_id`; `launch_id` is null for ordinary/unmanaged PTYs and may be absent on older remote versions, so callers retain fresh binding checks before operations), with explicitly requested non-secret environment values | `env_keys?` |
|
package/dist/core.js
CHANGED
|
@@ -3512,7 +3512,7 @@ function bindCompletedInitialPrompt(meta) {
|
|
|
3512
3512
|
bindAgentHarnessSession(meta, scanned.event);
|
|
3513
3513
|
setInitialPromptState(meta, "done");
|
|
3514
3514
|
}
|
|
3515
|
-
function latestAgentDoneEvent(meta, expectedOperationId = null) {
|
|
3515
|
+
function latestAgentDoneEvent(meta, expectedOperationId = null, expectedInputId = null) {
|
|
3516
3516
|
if (meta.kind === "codex")
|
|
3517
3517
|
return latestCodexCompletion(meta, readTranscriptLines);
|
|
3518
3518
|
if (meta.kind === "cursor" && meta.completion_route === "cursor_transcript") {
|
|
@@ -3537,7 +3537,8 @@ function latestAgentDoneEvent(meta, expectedOperationId = null) {
|
|
|
3537
3537
|
if (!line.trim() || Buffer.byteLength(line, "utf8") > 64 * 1024)
|
|
3538
3538
|
continue;
|
|
3539
3539
|
const parsed = parseAgentDoneEvent(line, meta);
|
|
3540
|
-
if (parsed.event && (!expectedOperationId || parsed.event.operation_id === expectedOperationId)
|
|
3540
|
+
if (parsed.event && (!expectedOperationId || parsed.event.operation_id === expectedOperationId)
|
|
3541
|
+
&& (!expectedInputId || parsed.event.input_id === expectedInputId))
|
|
3541
3542
|
latest = parsed.event;
|
|
3542
3543
|
}
|
|
3543
3544
|
return latest;
|
|
@@ -3632,12 +3633,12 @@ function agentCompletionCursor(meta) {
|
|
|
3632
3633
|
return transcript ? safeStatSize(transcript) : 0;
|
|
3633
3634
|
}
|
|
3634
3635
|
function transcriptUnavailable() {
|
|
3635
|
-
throw new AitermError(`transcript がまだありません。ターン完了後に再取得してください。${agentWaitGuide()}`, 2);
|
|
3636
|
+
throw new AitermError(`TRANSCRIPT_UNAVAILABLE: transcript がまだありません。ターン完了後に再取得してください。${agentWaitGuide()}`, 2);
|
|
3636
3637
|
}
|
|
3637
3638
|
/** 完了したturnの回答が空だった時に、人とAIが読む表示へ出す文。機械はstructuredContentのanswer_emptyを見る。 */
|
|
3638
3639
|
const AGENT_ANSWER_EMPTY_NOTICE = "このターンは完了しましたが、回答の本文は空でした。";
|
|
3639
3640
|
function transcriptNotFound(vendor) {
|
|
3640
|
-
throw new AitermError(
|
|
3641
|
+
throw new AitermError(`TRANSCRIPT_NOT_FOUND: 最終 assistant メッセージを特定できませんでした(harness=${agentHarness(vendor)}, vendor=${vendor})。screen で確認してください。`, 2);
|
|
3641
3642
|
}
|
|
3642
3643
|
function readTranscriptLines(file) {
|
|
3643
3644
|
try {
|
|
@@ -3805,22 +3806,34 @@ export async function readAgentTranscriptResult(name, o = {}) {
|
|
|
3805
3806
|
if (operationId && meta.kind !== "claude") {
|
|
3806
3807
|
throw new AitermError("operation_id付き回収はClaude agent sessionだけで使用できます", 2);
|
|
3807
3808
|
}
|
|
3808
|
-
|
|
3809
|
+
const inputId = o.input_id ?? null;
|
|
3810
|
+
if (inputId !== null && (!/^[a-f0-9]{32}$/.test(inputId) || meta.kind !== "claude" || operationId || o.completion)) {
|
|
3811
|
+
throw new AitermError("input_id付き回収はClaude agent sessionだけで、operation_idと併用せず32桁の小文字16進で指定してください", 2);
|
|
3812
|
+
}
|
|
3813
|
+
const inputPending = () => {
|
|
3814
|
+
throw new AitermError(`AITERM_TRANSCRIPT_INPUT_PENDING: input ${inputId} の番はまだ完了していません。同じinput_idで後から再取得してください。${agentWaitGuide(name)}`, 2);
|
|
3815
|
+
};
|
|
3816
|
+
// 入力に束縛した回収は、その入力の完了だけを読む。後の番のmarkerはこの回収と無関係。
|
|
3817
|
+
if (meta.kind === "claude" && !o.completion && inputId === null) {
|
|
3809
3818
|
let active = readClaudeOperationMarker(meta);
|
|
3810
3819
|
if (active)
|
|
3811
3820
|
active = await settlePublishedClaudeCompletionMarker(meta, active);
|
|
3812
3821
|
if (active) {
|
|
3813
3822
|
const label = active.operationId ? `operation ${active.operationId}` : "operation_idなしのClaude turn";
|
|
3814
|
-
throw new AitermError(
|
|
3823
|
+
throw new AitermError(`TRANSCRIPT_TURN_ACTIVE: ${label} はまだ完了していません。Stop完了後に同じsessionから再取得してください。${agentWaitGuide(name)}`, 2);
|
|
3815
3824
|
}
|
|
3816
3825
|
}
|
|
3817
3826
|
// wait timeout は「失敗」ではなく状態不明。後着した同一launchの完了eventから
|
|
3818
3827
|
// harness session をbindし、promptを再送せず結果だけ回収できるようにする。
|
|
3819
3828
|
recoverAgentHarnessSession(meta);
|
|
3820
3829
|
if (!meta.vendor_session_id) {
|
|
3830
|
+
if (inputId)
|
|
3831
|
+
inputPending();
|
|
3821
3832
|
throw new AitermError(`agent session '${name}' はまだターンが完了していません。agent_done 完了後に再取得してください。${agentWaitGuide(name)}`, 2);
|
|
3822
3833
|
}
|
|
3823
|
-
const done = latestAgentDoneEvent(meta, operationId);
|
|
3834
|
+
const done = latestAgentDoneEvent(meta, operationId, inputId);
|
|
3835
|
+
if (inputId && !done)
|
|
3836
|
+
inputPending();
|
|
3824
3837
|
if (o.completion && meta.kind !== "codex" && meta.kind !== "grok"
|
|
3825
3838
|
&& (!done || done.turn_id !== o.completion.turn_id || done.operation_id !== o.completion.operation_id)) {
|
|
3826
3839
|
throw new AitermError("回収対象の完了情報が置換されました。別の回答は配送しません", 2);
|
|
@@ -3834,7 +3847,9 @@ export async function readAgentTranscriptResult(name, o = {}) {
|
|
|
3834
3847
|
if (meta.kind === "claude") {
|
|
3835
3848
|
if (!done)
|
|
3836
3849
|
transcriptUnavailable();
|
|
3837
|
-
text = readClaudeResultText(meta, done, operationId, transcriptUnavailable)
|
|
3850
|
+
text = readClaudeResultText(meta, done, operationId, transcriptUnavailable, inputId ? () => {
|
|
3851
|
+
throw new AitermError(`AITERM_TRANSCRIPT_INPUT_REPLACED: input ${inputId} の回答は後の番の結果で置き換わりました。この入力の本文はもう読めません。`, 2);
|
|
3852
|
+
} : undefined);
|
|
3838
3853
|
}
|
|
3839
3854
|
else if (meta.kind === "antigravity") {
|
|
3840
3855
|
if (!done || done.done_status !== "turn_done")
|
package/dist/harnesses/claude.js
CHANGED
|
@@ -97,7 +97,7 @@ export function validateOperationId(operationId) {
|
|
|
97
97
|
}
|
|
98
98
|
return operationId;
|
|
99
99
|
}
|
|
100
|
-
export function readClaudeResultText(meta, done, operationId, transcriptUnavailable) {
|
|
100
|
+
export function readClaudeResultText(meta, done, operationId, transcriptUnavailable, mismatch = () => { throw new AitermError("TRANSCRIPT_RESULT_MISMATCH: Claude result file が完了eventと一致しません", 2); }) {
|
|
101
101
|
if (meta.kind !== "claude" || !meta.result_file || !done.result_digest || done.result_bytes == null) {
|
|
102
102
|
transcriptUnavailable();
|
|
103
103
|
}
|
|
@@ -134,7 +134,7 @@ export function readClaudeResultText(meta, done, operationId, transcriptUnavaila
|
|
|
134
134
|
typeof result.text !== "string" ||
|
|
135
135
|
Buffer.byteLength(result.text, "utf8") !== done.result_bytes ||
|
|
136
136
|
createHash("sha256").update(result.text, "utf8").digest("hex") !== done.result_digest) {
|
|
137
|
-
|
|
137
|
+
mismatch();
|
|
138
138
|
}
|
|
139
139
|
return result.text;
|
|
140
140
|
}
|
package/dist/index.js
CHANGED
|
@@ -634,6 +634,11 @@ export function createAitermServer(options = {}) {
|
|
|
634
634
|
.regex(/^sha256:[0-9a-f]{64}$/)
|
|
635
635
|
.nullish()
|
|
636
636
|
.describe("Claude operationの期待ID。agent_transcript:true時だけ指定し、古い別operationの結果を拒否する"),
|
|
637
|
+
input_id: z
|
|
638
|
+
.string()
|
|
639
|
+
.regex(/^[a-f0-9]{32}$/)
|
|
640
|
+
.nullish()
|
|
641
|
+
.describe("Claudeのpty_send dispatch receiptのinput_id。agent_transcript:true時だけ指定し、その入力の番の回答を読む。後の番が動いていても拒否しない。未完了はAITERM_TRANSCRIPT_INPUT_PENDING、後の番の結果で置換済みはAITERM_TRANSCRIPT_INPUT_REPLACED"),
|
|
637
642
|
},
|
|
638
643
|
outputSchema: {
|
|
639
644
|
schema: z.literal("aiterm.pty-read-result.v1"),
|
|
@@ -651,7 +656,7 @@ export function createAitermServer(options = {}) {
|
|
|
651
656
|
.optional()
|
|
652
657
|
.describe("agent_transcriptで、完了したturnの回答が空だった時だけtrue(textは空文字列)。回答を読めなかった時は誤りを返す。terminalではnull"),
|
|
653
658
|
},
|
|
654
|
-
}, async ({ session_id, wait, until, until_regex, timeout, screen, full, lines, line_range, raw, rtk, agent_transcript, operation_id }) => {
|
|
659
|
+
}, async ({ session_id, wait, until, until_regex, timeout, screen, full, lines, line_range, raw, rtk, agent_transcript, operation_id, input_id }) => {
|
|
655
660
|
try {
|
|
656
661
|
if (agent_transcript) {
|
|
657
662
|
if (screen || full || rtk || wait || line_range != null) {
|
|
@@ -661,6 +666,7 @@ export function createAitermServer(options = {}) {
|
|
|
661
666
|
const result = await core.readAgentTranscriptResult(session_id, {
|
|
662
667
|
lines: lines ?? null,
|
|
663
668
|
operation_id: operation_id ?? null,
|
|
669
|
+
input_id: input_id ?? null,
|
|
664
670
|
raw,
|
|
665
671
|
});
|
|
666
672
|
return {
|
|
@@ -680,6 +686,8 @@ export function createAitermServer(options = {}) {
|
|
|
680
686
|
}
|
|
681
687
|
if (operation_id != null)
|
|
682
688
|
throw new Error("operation_idはagent_transcript:true時だけ指定できます");
|
|
689
|
+
if (input_id != null)
|
|
690
|
+
throw new Error("input_idはagent_transcript:true時だけ指定できます");
|
|
683
691
|
let range = null;
|
|
684
692
|
if (line_range) {
|
|
685
693
|
const idx = line_range.indexOf(":");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.63.
|
|
3
|
+
"version": "0.63.18",
|
|
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": [
|