aiterm-mcp 0.70.26 → 0.70.27

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.70.27] - 2026-11-11
11
+
12
+ - `pty_list` now lists a Claude agent seat whose terminal is gone with no lifecycle record (for example, it vanished with a container restart) as `current_command: "vanished"`, with its `last_input_at` and `limit_end`. Before, such a seat had no row until the next send adopted it, so a restart dropped a limit-held seat's record. Seat turns read it as idle. The next send still adopts and resumes it as before.
13
+
10
14
  ## [0.70.26] - 2026-11-11
11
15
 
12
16
  - A Claude turn that ends on a usage limit now has a terminal outcome. Claude Code 2.1.322 holds such a turn ("Usage limit reached · continuing automatically at 7pm · esc to cancel") and runs no Stop hook, so its operation stayed pending, `pty_key` refused every key but C-c, and the seat's span kept running. Now, from the transcript and Aiterm's activity record only: `pty_list` rows of Claude agent sessions carry `last_input_at` and `limit_end {at, reset_at, continued, hold: armed|cancelled|null}`; the Claude wait returns `rate_limited` (exit 6) with the record text and `reset_at` (it was `error` with failure category `rate_limited`); seat turns close the span; and an operation whose turn ended on an API error or an interrupt record no longer counts as pending. `pty_key` now refuses keys other than C-c only while an operation is pending (before, on every correlated Claude seat), so Escape cancels an armed hold, and `hold` turns `cancelled`.
@@ -3310,7 +3314,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
3310
3314
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
3311
3315
  provenance.
3312
3316
 
3313
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.26...HEAD
3317
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.27...HEAD
3318
+ [0.70.27]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.26...v0.70.27
3314
3319
  [0.70.26]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.25...v0.70.26
3315
3320
  [0.70.25]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.24...v0.70.25
3316
3321
  [0.70.24]: https://github.com/kitepon/aiterm-mcp/compare/v0.70.23...v0.70.24
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.70.26** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
218
+ **状態:** 開発継続中 · 現行公開版 **v0.70.27** · 動作対象は 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.70.26** · 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.70.27** · 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
@@ -2235,7 +2235,8 @@ function listNativeSessionsResult(envKeys = [], runTmux = tmux) {
2235
2235
  }
2236
2236
  return { schema: "aiterm.pty-list-result.v1", observed_at: new Date().toISOString(), sessions };
2237
2237
  }
2238
- export function listSessionsResult(envKeys = [], runTmux = tmux) {
2238
+ /** `vanished` is the public pty_list's view only: generation existence (observeSessionGeneration) and lineage keep native + dormant. */
2239
+ export function listSessionsResult(envKeys = [], runTmux = tmux, o = {}) {
2239
2240
  const result = listNativeSessionsResult(envKeys, runTmux);
2240
2241
  const present = new Set(result.sessions.map(row => row.session_id));
2241
2242
  for (const name of savedAgentSessionNames()) {
@@ -2244,10 +2245,12 @@ export function listSessionsResult(envKeys = [], runTmux = tmux) {
2244
2245
  if (!meta)
2245
2246
  continue;
2246
2247
  const state = agentDormantState(meta);
2247
- if (!state)
2248
+ // A Claude seat whose native session is gone with no lifecycle (e.g. it vanished with the container) stays listed as
2249
+ // "vanished": its last_input_at/limit_end survive, and the next dispatch adopts and resumes it (adoptVanishedAgentNative).
2250
+ if (!state && (!o.vanished || present.has(name) || meta.kind !== "claude"))
2248
2251
  continue;
2249
2252
  const environment = Object.fromEntries(envKeys.map(key => [key, null]));
2250
- let command = state;
2253
+ let command = state ?? "vanished";
2251
2254
  const recipe = readAgentResumeRecipe(meta);
2252
2255
  if (recipe?.kind === meta.kind && recipe.vendor_session_id === meta.vendor_session_id)
2253
2256
  for (const key of envKeys)
@@ -3825,6 +3828,9 @@ export function readSessionInterimWords(name, after, from = null) {
3825
3828
  export function readSeatTurns(sessionIds) {
3826
3829
  const seats = [], unread = [];
3827
3830
  const observedAt = new Map();
3831
+ let native = null;
3832
+ // One listing for the call: a Claude seat with no native session and no lifecycle vanished (pty_list "vanished") and runs no turn.
3833
+ const vanished = (name) => !(native ??= new Set(listNativeSessionRows().map(([listed]) => listed))).has(name);
3828
3834
  for (const name of sessionIds) {
3829
3835
  const meta = tryLoadAgentMetadata(name);
3830
3836
  if (!meta)
@@ -3833,7 +3839,8 @@ export function readSeatTurns(sessionIds) {
3833
3839
  try {
3834
3840
  const state = agentDormantState(meta);
3835
3841
  turn = state ? (state === "hibernated" && observeSession(name).state === "hibernated" ? { state: "idle" } : null)
3836
- : meta.kind === "codex" ? codexSeatTurn(meta) ?? freshCodexSeatTurn(meta) : readManagedSeatTurn(meta);
3842
+ : meta.kind === "codex" ? codexSeatTurn(meta) ?? freshCodexSeatTurn(meta)
3843
+ : meta.kind === "claude" && vanished(name) ? { state: "idle" } : readManagedSeatTurn(meta);
3837
3844
  }
3838
3845
  catch { /* 読めない席は、分からないまま返す */ }
3839
3846
  if (turn === SPAN_HELD) {
package/dist/index.js CHANGED
@@ -821,7 +821,8 @@ export function createAitermServer(options = {}) {
821
821
  schema: z.literal("aiterm.pty-list-result.v1"),
822
822
  observed_at: z.string(),
823
823
  sessions: z.array(z.object({
824
- session_id: z.string(), current_command: z.string(), attached: z.boolean(),
824
+ session_id: z.string(), current_command: z.string().describe("前面コマンド。休止などの席は状態名(hibernated等)、端末が消えたClaudeの席(コンテナ再起動等)は\"vanished\"。次の送信で再開する"),
825
+ attached: z.boolean(),
825
826
  width: z.number(), height: z.number(),
826
827
  harness: z.enum(["claude-code", "codex-cli", "grok-cli", "cursor-cli", "antigravity-cli"]).nullable(),
827
828
  launch_id: z.string().nullable().optional().describe("一覧取得時のmanaged起動ID。通常PTYやmetadata不明時はnull、旧remote版は省略。操作時のfresh binding検証の代わりにはしない"),
@@ -840,7 +841,7 @@ export function createAitermServer(options = {}) {
840
841
  }, async ({ env_keys }, extra) => {
841
842
  try {
842
843
  await core.maintainAgentIdleClocks();
843
- const result = core.listSessionsResult(env_keys);
844
+ const result = core.listSessionsResult(env_keys, undefined, { vanished: true });
844
845
  return { ...ok(core.listSessions(result)), structuredContent: { ...result }, ...await seatTurnsMeta(result.sessions, extra._meta) };
845
846
  }
846
847
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.70.26",
3
+ "version": "0.70.27",
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": [