aiterm-mcp 0.64.0 → 0.64.2
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 +11 -1
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/core.js +5 -1
- package/dist/harnesses/claude.js +40 -1
- package/dist/managed-seat-turn.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.64.2] - 2026-11-08
|
|
11
|
+
|
|
12
|
+
- Claude wait (`observeAgentDone` / `aiterm-wait`): a transcript API-error record whose CLI `error` field is `rate_limit` (for example the Fable limit record with no `apiErrorStatus`) is now `failure.category: "rate_limited"`, whatever its text. When Stop still fires, the wait looks at the turn's last assistant record up to the Stop time and returns that error instead of `done`. The hibernate exception for a rate-limited turn reads the same category.
|
|
13
|
+
|
|
14
|
+
## [0.64.1] - 2026-11-08
|
|
15
|
+
|
|
16
|
+
- Seat turn (`readSeatTurns`, Claude/Grok/Cursor/Antigravity seats): a seat whose current launch has shown neither busy nor any completed turn now reports `{state: "idle"}` once its pane stays ready for 250 ms, instead of `turn: null` until its first turn. Once a span or a turn end was recorded, an unreadable turn end still reports null. Codex seats are unchanged.
|
|
17
|
+
|
|
10
18
|
## [0.64.0] - 2026-11-08
|
|
11
19
|
|
|
12
20
|
- Per-seat Claude configuration roots (hosts with several Claude accounts). `agent_launch` (claude-code) and `claude_agent` accept `configuration_root`: the default root (`~/.claude`; the seat then runs with `CLAUDE_CONFIG_DIR` unset) or a directory directly under a parent listed in `AITERM_CLAUDE_CONFIG_ROOTS` (path-delimited) of the MCP process. The seat runs with that `CLAUDE_CONFIG_DIR`, and the resume recipe keeps it. Any other path, another harness, or `env_vars` containing `CLAUDE_CONFIG_DIR` together with it answer `AGENT_CONFIGURATION_ROOT_REJECTED` before a seat is created. `AITERM_CLAUDE_CONFIG_ROOTS` never reaches a seat's environment, so a seat's own Aiterm can use only the default root.
|
|
@@ -3102,7 +3110,9 @@ prototype (preserved under `prototype/python/` as the porting source and referen
|
|
|
3102
3110
|
`ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
|
|
3103
3111
|
provenance.
|
|
3104
3112
|
|
|
3105
|
-
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.64.
|
|
3113
|
+
[Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.64.2...HEAD
|
|
3114
|
+
[0.64.2]: https://github.com/kitepon/aiterm-mcp/compare/v0.64.1...v0.64.2
|
|
3115
|
+
[0.64.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.64.0...v0.64.1
|
|
3106
3116
|
[0.64.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.18...v0.64.0
|
|
3107
3117
|
[0.63.18]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.17...v0.63.18
|
|
3108
3118
|
[0.63.17]: https://github.com/kitepon/aiterm-mcp/compare/v0.63.16...v0.63.17
|
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.64.
|
|
218
|
+
**状態:** 開発継続中 · 現行公開版 **v0.64.2** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
|
|
219
219
|
|
|
220
220
|
### 更新と巻き戻し
|
|
221
221
|
|
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.64.
|
|
230
|
+
**Status:** actively maintained · current public release **v0.64.2** · 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
|
|
package/dist/core.js
CHANGED
|
@@ -64,7 +64,7 @@ import { readFileOrNull, restoreJsonSetting, withUserConfigLock, restoreUserDefa
|
|
|
64
64
|
import { isDeepStrictEqual } from "node:util";
|
|
65
65
|
import { grokAuthPlan, grokAuthStatus, grokAuthPane, GROK_MODEL_DEFAULTS, realGrokHome, resolveAndValidateGrokAuth, assertGrokModelAvailable, grokModelChoices, grokModelFromFooter, grokFooterModelName, grokModelDefaultsFromBody, restoreGrokModelDefaults, grokEventsTranscript, grokSessionDirectory, latestGrokCompletion, grokTurnSettled, observeGrokDone, buildGrokAgentCmd, grokAgentArgv, grokLaunchNote, grokEnvTokens, grokEnvEntries, grokTuiReady, grokPaneObservation, GROK_INTERRUPT_KEY, grokRateLimitDialog, grokPromptAwaitingAccept, grokUnacceptedPromptRestored, grokStartupAction, grokFooterHasConfiguration, grokTranscriptText, createGrokAgentMetadata, } from "./harnesses/grok.js";
|
|
66
66
|
import { codexAuthPlan, codexAuthStatus, codexAuthPane, realCodexHome, readCodexConfigPins, bindCodexTranscriptSession, latestCodexCompletion, codexTurnSettled, codexCompletedTurnId, codexWorkingResumeConfiguration, captureCodexRecoveryProof, captureCodexResumeProof, readCodexResumeProof, codexResumeProofDigest, codexRootTranscript, codexRunningTurn, codexInterruptionRecord, observeCodexDone, buildCodexAgentCmd, codexAgentArgv, codexResumeArgv, codexLaunchNote, codexPaneObservation, CODEX_INTERRUPT_KEY, codexHelperProcess, codexRateLimitModelSwitchDialog, codexApprovalDialog, codexStartupAction, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, codexModelChoices, codexFastCommandOffered, codexFooterShowsFast, codexServiceTierNotices, restoreCodexDefaults, restoreCodexDefaultInFile, } from "./harnesses/codex.js";
|
|
67
|
-
import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, assertClaudeAuthenticationReady, claudeModelChoices, claudeConfigDir, claudeProjectSlug, claudeFastIndicatorShown, claudeFastResult, buildClaudeAgentCmd, claudeAgentArgv, claudeResumeArgv, claudeLaunchNote, claudePaneObservation, CLAUDE_INTERRUPT_KEY, claudeUsageLimit, claudeLiveSelectMenu, claudeStartupAction, createClaudeAgentMetadata, claudeSessionTranscriptPath, claudeApiErrorFromLine, claudeApiErrorAfter, claudeFailureCategory, } from "./harnesses/claude.js";
|
|
67
|
+
import { claudeAuthPlan, claudeAuthStatus, claudeAuthPane, OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, assertClaudeAuthenticationReady, claudeModelChoices, claudeConfigDir, claudeProjectSlug, claudeFastIndicatorShown, claudeFastResult, buildClaudeAgentCmd, claudeAgentArgv, claudeResumeArgv, claudeLaunchNote, claudePaneObservation, CLAUDE_INTERRUPT_KEY, claudeUsageLimit, claudeLiveSelectMenu, claudeStartupAction, createClaudeAgentMetadata, claudeSessionTranscriptPath, claudeApiErrorFromLine, claudeApiErrorAfter, claudeApiErrorEndingTurn, claudeFailureCategory, } from "./harnesses/claude.js";
|
|
68
68
|
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, createCursorAgentMetadata, cursorLaunchNote, cursorEffortNavigation, cursorTuiReady, cursorPaneObservation, CURSOR_INTERRUPT_KEY, cursorPromptHooksRunning, cursorUsageLimit, CURSOR_SUBMIT_SEQUENCE, validateCursorModelEffort, } from "./harnesses/cursor.js";
|
|
69
69
|
import { interimFromNow, readInterimWords, recordInterimBoundary } from "./interim-words.js";
|
|
70
70
|
import { codexSeatTurn, grokSteerAcceptance, observeSteerDone, readSteerEntry, recordSteer } from "./steer-follow.js";
|
|
@@ -4243,6 +4243,10 @@ async function observeAgentDoneInternal(name, o = {}) {
|
|
|
4243
4243
|
}
|
|
4244
4244
|
if (o.input_id && !scanned.event && parts.some(line => parseAgentDoneEvent(line, meta).event !== null))
|
|
4245
4245
|
throw new AitermError("AGENT_WAIT_INPUT_CHANGED: completion belongs to another or unconfirmed input", 2);
|
|
4246
|
+
// 利用上限ではStopも走る。その番の最後の記録がAPIエラーなら、doneでなく誤りとして返す。
|
|
4247
|
+
const ended = scanned.event && meta.kind === "claude" ? claudeApiErrorEndingTurn(meta, scanned.event.at) : null;
|
|
4248
|
+
if (ended)
|
|
4249
|
+
return observation("error", null, null, ended);
|
|
4246
4250
|
if (scanned.event)
|
|
4247
4251
|
return scanned.event.done_status === "turn_error"
|
|
4248
4252
|
? { ...observation("error", scanned.event), error: `Antigravity execution ended: ${scanned.event.reason}`, error_kind: scanned.event.reason }
|
package/dist/harnesses/claude.js
CHANGED
|
@@ -683,15 +683,54 @@ export function claudeApiErrorFromLine(line) {
|
|
|
683
683
|
session_id: typeof record.sessionId === "string" ? record.sessionId : null,
|
|
684
684
|
uuid: typeof record.uuid === "string" ? record.uuid : null,
|
|
685
685
|
parent_uuid: typeof record.parentUuid === "string" ? record.parentUuid : null,
|
|
686
|
+
kind: typeof record.error === "string" ? record.error : null,
|
|
686
687
|
};
|
|
687
688
|
}
|
|
688
689
|
export function claudeFailureCategory(error) {
|
|
689
|
-
if (error.status === 429 || /^You've (?:reached your [^.\r\n]{1,80} limit\.|hit your (?:[a-z0-9-]+ ){0,3}limit\b)/i.test(error.text))
|
|
690
|
+
if (error.status === 429 || error.kind === "rate_limit" || /^You've (?:reached your [^.\r\n]{1,80} limit\.|hit your (?:[a-z0-9-]+ ){0,3}limit\b)/i.test(error.text))
|
|
690
691
|
return "rate_limited";
|
|
691
692
|
if (error.status === 529)
|
|
692
693
|
return "capacity";
|
|
693
694
|
return error.status !== null && error.status >= 500 ? "transient" : "other";
|
|
694
695
|
}
|
|
696
|
+
// 利用上限のAPIエラー(error:"rate_limit")ではStopも発火する(実測 2026-11-09、Fable上限で19回)。
|
|
697
|
+
// Stopの時点で、その番の最後のassistant記録がAPIエラーなら、その番は誤りで終わっている。
|
|
698
|
+
// 次の番の記録はStopより後に書かれるので、Stopの時刻までの最後の記録だけを見る。
|
|
699
|
+
export function claudeApiErrorEndingTurn(meta, stopAt) {
|
|
700
|
+
const file = claudeSessionTranscriptPath(meta);
|
|
701
|
+
const stop = Date.parse(stopAt);
|
|
702
|
+
if (!file || !Number.isFinite(stop))
|
|
703
|
+
return null;
|
|
704
|
+
let size;
|
|
705
|
+
try {
|
|
706
|
+
size = fs.statSync(file).size;
|
|
707
|
+
}
|
|
708
|
+
catch (error) {
|
|
709
|
+
if (error.code === "ENOENT")
|
|
710
|
+
return null;
|
|
711
|
+
throw error;
|
|
712
|
+
}
|
|
713
|
+
const lines = readFileRange(file, Math.max(0, size - AGENT_EVENT_TAIL_BYTES), size).toString("utf8").split("\n");
|
|
714
|
+
lines.pop();
|
|
715
|
+
for (const line of lines.reverse()) {
|
|
716
|
+
let record;
|
|
717
|
+
try {
|
|
718
|
+
record = JSON.parse(line);
|
|
719
|
+
}
|
|
720
|
+
catch {
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if ((record?.type !== "assistant" && record?.type !== "user") || record.isSidechain === true
|
|
724
|
+
|| (record.sessionId && record.sessionId !== meta.vendor_session_id))
|
|
725
|
+
continue;
|
|
726
|
+
const at = Date.parse(record.timestamp);
|
|
727
|
+
if (!Number.isFinite(at) || at > stop)
|
|
728
|
+
continue;
|
|
729
|
+
// 先にuser行(この番の入力かtool結果)が来たら、この番の最後の答えはまだ書かれていない。前の番の誤りを持ち出さない。
|
|
730
|
+
return record.type === "assistant" ? claudeApiErrorFromLine(line) : null;
|
|
731
|
+
}
|
|
732
|
+
return null;
|
|
733
|
+
}
|
|
695
734
|
// Stopが発火しないエラー終了を、現在のturn開始後の会話記録だけから判定する。
|
|
696
735
|
export function claudeApiErrorAfter(meta, startedAtMs) {
|
|
697
736
|
const file = claudeSessionTranscriptPath(meta);
|
|
@@ -7,7 +7,7 @@ import { readProcessIdentities, observeExecutionActor } from "./process-runtime.
|
|
|
7
7
|
const stamp = z.string().refine(value => Number.isFinite(Date.parse(value)));
|
|
8
8
|
const spanSchema = z.object({ turn_id: z.string().regex(/^managed:[a-f0-9]{32}$/), started_at: stamp }).strict();
|
|
9
9
|
const recordSchema = z.object({ binding: z.string().min(1), span: spanSchema.nullable(), terminal: z.string().nullable(),
|
|
10
|
-
ready: z.object({ since: stamp, terminal: z.string() }).strict().nullable() }).strict();
|
|
10
|
+
ready: z.object({ since: stamp, terminal: z.string().nullable() }).strict().nullable() }).strict();
|
|
11
11
|
const ownerSchema = z.object({ pid: z.number().int().positive(), started_identity: stamp, token: z.string() }).strict();
|
|
12
12
|
export const managedSpanDirectory = (meta) => agentMetadataPath(meta.aiterm_session, meta.launch_id).replace(/\.agent\.json$/, ".seat-span.d");
|
|
13
13
|
/** Same callback owns live capture and the short identity transaction. Never waits or sends input. */
|
|
@@ -86,7 +86,8 @@ export function observeManagedSpan(file, binding, evidence, terminal, at) {
|
|
|
86
86
|
}
|
|
87
87
|
return { state: "running", ...record.span, event_cursor: null, interim_from: null, wait_process: null };
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
// A launch that never showed busy nor any terminal has no turn to hide: its settled ready is idle.
|
|
90
|
+
if (!terminal && (record?.span || record?.terminal) || record?.span && terminal === record.terminal)
|
|
90
91
|
return null;
|
|
91
92
|
if (!record)
|
|
92
93
|
record = { binding, span: null, terminal, ready: null };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiterm-mcp",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.2",
|
|
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": [
|