aiterm-mcp 0.60.0 → 0.61.0

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.ja.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/claude-operation-marker.js +11 -0
  5. package/dist/claude-stop-hook.js +5 -9
  6. package/dist/core.js +538 -45
  7. package/dist/execution-checkpoint.js +83 -0
  8. package/dist/execution-close.js +82 -0
  9. package/dist/execution-context.js +19 -0
  10. package/dist/execution-contract.js +263 -0
  11. package/dist/execution-dispatch.js +285 -0
  12. package/dist/execution-effect.js +411 -0
  13. package/dist/execution-immediate-stop.js +68 -0
  14. package/dist/execution-interruption.js +150 -0
  15. package/dist/execution-inventory.js +100 -0
  16. package/dist/execution-lock.js +136 -0
  17. package/dist/execution-native-server.js +140 -0
  18. package/dist/execution-native-setup.js +64 -0
  19. package/dist/execution-parent-alias.js +75 -0
  20. package/dist/execution-parent-claude-records.js +136 -0
  21. package/dist/execution-parent-endpoint.js +92 -0
  22. package/dist/execution-parent-manager.js +89 -0
  23. package/dist/execution-parent-native.js +179 -0
  24. package/dist/execution-parent-process.js +29 -0
  25. package/dist/execution-parent-producer.js +129 -0
  26. package/dist/execution-parent-queue.js +84 -0
  27. package/dist/execution-parent-source.js +200 -0
  28. package/dist/execution-parent-worker.js +89 -0
  29. package/dist/execution-parent.js +345 -0
  30. package/dist/execution-participant-store.js +107 -0
  31. package/dist/execution-participant.js +78 -0
  32. package/dist/execution-runtime.js +182 -0
  33. package/dist/execution-service.js +1334 -0
  34. package/dist/execution-steer.js +37 -0
  35. package/dist/execution-store.js +206 -0
  36. package/dist/execution-tools.js +151 -0
  37. package/dist/execution-wire.js +129 -0
  38. package/dist/harnesses/claude.js +2 -0
  39. package/dist/harnesses/codex.js +111 -0
  40. package/dist/harnesses/cursor.js +13 -0
  41. package/dist/harnesses/grok.js +2 -0
  42. package/dist/index.js +1196 -1122
  43. package/dist/parent-delivery.js +408 -41
  44. package/dist/process-runtime.js +28 -0
  45. package/dist/tmux-runtime.js +30 -4
  46. package/docs/DESIGN.md +60 -0
  47. package/docs/RELEASE.md +19 -1
  48. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.61.0] - 2026-10-22
11
+
12
+ ### Added
13
+
14
+ - Opt-in native MCP entry with `agent_stop({session_id})` / `{session_ids}`. It sends each harness's normal cancel key to recorded descendants before their callers, once per session, preserving conversations. Results report key delivery (`sent`, `partial`, `failed`, `idle`), not native completion proof. Stop does not wait for metadata checkpoints, in-flight requests, or interruption journals and does not permanently block the next input.
15
+ - Native parent-hook setup preserves the same command, scope, provider and mode across MCP/Claude/Cursor/Codex registrations. Requires the matching Steer candidate with native admission and hook-argument support. Normal `dist/index.js` remains unchanged; this optional entry is not automatically installed into existing seats.
16
+
17
+ ### Fixed
18
+
19
+ - Reobserved normal completion seals the recorded call branch after known downstream work finishes, so later independent work on the same session does not revive historical stop relations. The existing finish wire remains compatible.
20
+ - After the single Codex keep-current choice, wait within the existing timeout for that handled rate-limit modal to redraw. Do not resend the choice or mistake its stale screen for an immediate recovery failure.
21
+
22
+ ## [0.60.1] - 2026-10-13
23
+
24
+ ### 修正
25
+
26
+ - WindowsでCursorの実行ファイル(`CURSOR_AGENT_BIN`、または既定の`~/.local/bin/cursor-agent`)がshebangのscriptの時、席のpaneの中で起きなかった。
27
+ WindowsのCursorの席はPowerShell 7のpaneから起こすが、PowerShellは`.exe`・`.com`・`.cmd`・`.bat`・`.ps1`でないfileを自分のconsoleで走らせない。
28
+ 「実行できませんでした」で空のPowerShellのまま席が残るか、拡張子の関連付けでpaneの外の別の窓(Git Bash)に開いて、`pty_close`で席を閉じてもprocessが残った
29
+ (WindowsのCIが、偽のCursorの`bash.exe`を1回ごとに1つ残していた)。scriptは、control command(`status`・`models`)と同じGit Bashを、paneの中で挟んで走らせる。
30
+ 公式の`cursor-agent.exe`・`cursor-agent.cmd`の起こし方は変えていない(本物の席は、閉じた後にprocessが残らない事をfoxで見た)。
31
+
10
32
  ## [0.60.0] - 2026-10-13
11
33
 
12
34
  ### 追加
@@ -2681,7 +2703,9 @@ prototype (preserved under `prototype/python/` as the porting source and referen
2681
2703
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
2682
2704
  provenance.
2683
2705
 
2684
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.60.0...HEAD
2706
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.61.0...HEAD
2707
+ [0.61.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.60.1...v0.61.0
2708
+ [0.60.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.60.0...v0.60.1
2685
2709
  [0.60.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.59.1...v0.60.0
2686
2710
  [0.59.1]: https://github.com/kitepon/aiterm-mcp/compare/v0.59.0...v0.59.1
2687
2711
  [0.59.0]: https://github.com/kitepon/aiterm-mcp/compare/v0.58.4...v0.59.0
package/README.ja.md CHANGED
@@ -209,7 +209,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
209
209
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
210
210
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
211
211
 
212
- **状態:** 開発継続中 · 現行公開版 **v0.60.0** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
212
+ **状態:** 開発継続中 · 現行公開版 **v0.61.0** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
213
213
 
214
214
  ### 更新と巻き戻し
215
215
 
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.60.0** · 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.61.0** · 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
 
@@ -0,0 +1,11 @@
1
+ export function parseClaudeOperationMarker(value) {
2
+ const row = value;
3
+ const keys = row && typeof row === "object" && !Array.isArray(row) ? Object.keys(row).sort().join(",") : "";
4
+ const legacy = keys === "operation_id,schema" && row.schema === "aiterm.claude-operation-marker.v1";
5
+ const bound = keys === "event_cursor,operation_id,schema" && row.schema === "aiterm.claude-operation-marker.v2"
6
+ && Number.isSafeInteger(row.event_cursor) && row.event_cursor >= 0;
7
+ if ((!legacy && !bound) || (row.operation_id !== null
8
+ && (typeof row.operation_id !== "string" || !/^sha256:[0-9a-f]{64}$/.test(row.operation_id))))
9
+ throw new Error("Claude operation markerが不正です");
10
+ return { operationId: row.operation_id, eventCursor: bound ? row.event_cursor : null };
11
+ }
@@ -5,7 +5,7 @@ import { currentUid as uid, runtimeStateBase } from "./state-root.js";
5
5
  import { createHash, randomBytes } from "node:crypto";
6
6
  const LAUNCH_ID_RE = /^[0-9a-f]{32}$/;
7
7
  const SESSION_RE = /^[A-Za-z0-9_-]{1,64}$/;
8
- const OPERATION_ID_RE = /^sha256:[0-9a-f]{64}$/;
8
+ import { parseClaudeOperationMarker } from "./claude-operation-marker.js";
9
9
  const MAX_STDIN_BYTES = 8 * 1024 * 1024;
10
10
  const MAX_RESULT_BYTES = 4 * 1024 * 1024;
11
11
  function fail(message) {
@@ -107,14 +107,10 @@ function readOperationMarker(file) {
107
107
  }
108
108
  const body = fs.readFileSync(fd, "utf8");
109
109
  const value = JSON.parse(body);
110
- const keys = value && typeof value === "object" && !Array.isArray(value) ? Object.keys(value).sort() : [];
111
- if (keys.join(",") !== "operation_id,schema" ||
112
- value.schema !== "aiterm.claude-operation-marker.v1" ||
113
- (value.operation_id !== null &&
114
- (typeof value.operation_id !== "string" || !OPERATION_ID_RE.test(value.operation_id)))) {
115
- fail("operation markerのschemaまたはoperation_idが不正です");
116
- }
117
- return { operationId: value.operation_id, dev: st.dev, ino: st.ino };
110
+ // Reading/consuming the v2 reservation is compatibility only. Its cursor
111
+ // is deliberately absent from agent_done/result and proves no interruption.
112
+ const marker = parseClaudeOperationMarker(value);
113
+ return { operationId: marker.operationId, dev: st.dev, ino: st.ino };
118
114
  }
119
115
  catch (error) {
120
116
  fail(error instanceof Error ? error.message : String(error));