aiterm-mcp 0.29.27 → 0.29.29

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,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.29.29] - 2026-09-02
11
+
12
+ ### Fixed
13
+
14
+ - Cursor Agentのsubmitをextended keyboard protocolのEnterへ変換し、通常のtmux Enterがcomposerに残る配送失敗を解消した。
15
+
16
+ ## [0.29.28] - 2026-09-02
17
+
18
+ ### Fixed
19
+
20
+ - Cursorの長いpromptが矢印の次行へ折り返され、末尾が画面外にある場合もcomposerへの反映を確認してsubmitする。
21
+
10
22
  ## [0.29.27] - 2026-09-02
11
23
 
12
24
  ### Fixed
@@ -1512,7 +1524,9 @@ prototype (preserved under `prototype/python/` as the porting source and referen
1512
1524
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
1513
1525
  provenance.
1514
1526
 
1515
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.27...HEAD
1527
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.29...HEAD
1528
+ [0.29.29]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.28...v0.29.29
1529
+ [0.29.28]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.27...v0.29.28
1516
1530
  [0.29.27]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.26...v0.29.27
1517
1531
  [0.29.26]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.25...v0.29.26
1518
1532
  [0.29.25]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.24...v0.29.25
package/README.ja.md CHANGED
@@ -153,7 +153,7 @@ runtime-error store は canonical dotagents config の `collection.enabled: true
153
153
  場合だけ収集し、既定OFF、network送信は行いません。tag起点CIのnpm provenance(OIDC Trusted
154
154
  Publishing)で公開し、GitHub Release が Official MCP Registry を再登録します。
155
155
 
156
- **状態:** 開発継続中 · 現行公開版 **v0.29.27** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
156
+ **状態:** 開発継続中 · 現行公開版 **v0.29.29** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
157
157
 
158
158
  ### 更新と巻き戻し
159
159
 
@@ -187,7 +187,7 @@ pty_read(id, { wait: true }) → 削減済みの出力を読む(完了
187
187
 
188
188
  同じprimitiveが別エージェントのTUIを宿す。`agent_launch`の`harness`はagent loop・認証・hook・session・transcriptを所有する実行基盤、`model`は独立した選択。起動processは直接CLIと同じproject/user環境を使い、通常config、MCP、plugin、skill、permission、trust、memory、historyをcopy・filter・置換しない。
189
189
 
190
- `aiterm.agent-launch-result.v1`は正規`harness`を返し、旧`provider`は互換fieldとして残す。同じ`harness`はagent dispatch、`aiterm-wait`、`agent_configure`、`pty_list`のagent行にも載り、旧vendor/provider/agent fieldは互換用に残る。Codexは通常rollout、Grok CLIは通常session event、Claudeはlaunch固有Stop hook、Cursorは通常agent transcript末尾の`turn_ended`を完了正本に使う。`pty_send`は非ブロックdispatchで、vendor別完了境界を表すopaqueな整数`event_cursor`を返し、完了通知は`aiterm-wait`を親のターンを塞がない別processで受ける。送信textがCursorのcomposerへ残った場合は成功receiptを返さず失敗する。
190
+ `aiterm.agent-launch-result.v1`は正規`harness`を返し、旧`provider`は互換fieldとして残す。同じ`harness`はagent dispatch、`aiterm-wait`、`agent_configure`、`pty_list`のagent行にも載り、旧vendor/provider/agent fieldは互換用に残る。Codexは通常rollout、Grok CLIは通常session event、Claudeはlaunch固有Stop hook、Cursorは通常agent transcript末尾の`turn_ended`を完了正本に使う。`pty_send`は非ブロックdispatchで、vendor別完了境界を表すopaqueな整数`event_cursor`を返し、完了通知は`aiterm-wait`を親のターンを塞がない別processで受ける。Cursorのsubmitキーはadapterが現行CLIのextended keyboard protocolへ変換する。送信textがCursorのcomposerへ残った場合は成功receiptを返さず失敗する。
191
191
 
192
192
  `agent_launch`は任意の`write_scope`も受ける。Codex/Grokのread-onlyは`--sandbox read-only`、Cursorは公式`--mode ask`で実効化する。path説明は同等CLI引数がないためdeclaration-only。
193
193
 
package/README.md CHANGED
@@ -169,7 +169,7 @@ collection is off by default and performs no network I/O. It ships via
169
169
  tag-triggered CI with npm provenance (OIDC Trusted Publishing); the GitHub
170
170
  Release re-registers the Official MCP Registry entry.
171
171
 
172
- **Status:** actively maintained · current public release **v0.29.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).
172
+ **Status:** actively maintained · current public release **v0.29.29** · 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).
173
173
 
174
174
  ### Update and rollback
175
175
 
@@ -209,7 +209,7 @@ pty_read(id, { wait: true }) → read the token-reduced output, completion
209
209
 
210
210
  The same primitive hosts another agent's TUI. `agent_launch` starts a selected execution harness inside a fresh persistent terminal and returns a `session_id`. `harness` names the component that owns the agent loop, authentication, hooks, session, and transcript; `model` remains an independent choice. The launched process sees the same project and user environment as a direct CLI invocation: normal configuration, MCPs, plugins, skills, permissions, trust decisions, memory, and history are not copied, filtered, or replaced. Aiterm adds only completion correlation and a non-user sub-agent context containing `role=subagent`, the parent session, delegation depth, lineage, and `delegation_allowed=true`.
211
211
 
212
- The human-readable launch text is accompanied by an `aiterm.agent-launch-result.v1` structured receipt containing the canonical `harness`; the old `provider` field remains for compatibility. The same `harness` is carried by agent dispatch, `aiterm-wait`, `agent_configure`, and agent rows in `pty_list`, while their old vendor/provider/agent fields remain compatibility fields. Codex completion comes from its normal durable rollout transcript, Grok CLI from its normal session events, Claude Code from a launch-specific Stop hook settings addition, and Cursor from its normal agent transcript's terminal `turn_ended` record. Sending to any agent session is a non-blocking **dispatch** — the call returns immediately with an opaque, harness-specific integer `event_cursor`, and completion arrives via [`aiterm-wait`](#completion-push-for-parent-agents-aiterm-wait). If submitted text remains in Cursor's composer, its dispatch fails instead of returning a successful receipt.
212
+ The human-readable launch text is accompanied by an `aiterm.agent-launch-result.v1` structured receipt containing the canonical `harness`; the old `provider` field remains for compatibility. The same `harness` is carried by agent dispatch, `aiterm-wait`, `agent_configure`, and agent rows in `pty_list`, while their old vendor/provider/agent fields remain compatibility fields. Codex completion comes from its normal durable rollout transcript, Grok CLI from its normal session events, Claude Code from a launch-specific Stop hook settings addition, and Cursor from its normal agent transcript's terminal `turn_ended` record. Sending to any agent session is a non-blocking **dispatch** — the call returns immediately with an opaque, harness-specific integer `event_cursor`, and completion arrives via [`aiterm-wait`](#completion-push-for-parent-agents-aiterm-wait). The Cursor adapter translates submit into the current CLI's extended keyboard protocol. If submitted text remains in Cursor's composer, its dispatch fails instead of returning a successful receipt.
213
213
 
214
214
  `agent_launch` accepts an optional `write_scope`: either `"read-only"` or a human-readable description of writable paths. Codex/Grok use `--sandbox read-only`; Cursor uses its official read-only `--mode ask`. A path description remains declaration-only because these CLI launch surfaces provide no equivalent path allowlist flag.
215
215
 
package/dist/core.js CHANGED
@@ -19,7 +19,7 @@ import { sleep, currentUid, runtimeStateBase, safeStatSize, readFileRange, write
19
19
  import { GROK_MODEL_DEFAULTS, realGrokHome, resolveAndValidateGrokAuth, assertGrokModelAvailable, grokEventsTranscript, latestGrokCompletion, observeGrokDone, buildGrokAgentCmd, grokLaunchNote, grokEnvTokens, grokTuiReady, GROK_COMPOSER_MARKER_RE, grokFooterHasConfiguration, grokTranscriptText, createGrokAgentMetadata, } from "./harnesses/grok.js";
20
20
  import { bindCodexTranscriptSession, latestCodexCompletion, observeCodexDone, buildCodexAgentCmd, codexLaunchNote, codexTuiReady, codexLaunchBlockingDialog, CODEX_COMPOSER_MARKER_RE, codexModelChoice, codexEffortChoice, codexMoreReasoningChoice, codexTranscriptText, createCodexAgentMetadata, } from "./harnesses/codex.js";
21
21
  import { OPERATION_ID_RE, CLAUDE_RESULT_MAX_BYTES, CLAUDE_EFFORTS, agentManagedClaudeSettingsPath, agentClaudeResultPath, agentClaudeOperationPath, agentClaudeApprovalReceiptPath, agentClaudeDispatchReceiptPath, validateOperationId, readClaudeResultText, assertClaudeAuthenticationReady, buildClaudeAgentCmd, claudeLaunchNote, claudeTuiReady, CLAUDE_COMPOSER_MARKER_RE, createClaudeAgentMetadata, } from "./harnesses/claude.js";
22
- import { bindCursorTranscriptSession, cursorTurnBoundary, latestCursorCompletion, observeCursorDone, cursorTranscriptText, assertCursorAuthenticationReady, assertCursorModelAvailable, buildCursorAgentCmd, cursorPromptWithLineage, createCursorAgentMetadata, cursorLaunchNote, cursorEffortNavigation, cursorTuiReady, CURSOR_COMPOSER_CONTENT_MARKER_RE, validateCursorModelEffort, } from "./harnesses/cursor.js";
22
+ import { bindCursorTranscriptSession, cursorTurnBoundary, latestCursorCompletion, observeCursorDone, cursorTranscriptText, assertCursorAuthenticationReady, assertCursorModelAvailable, buildCursorAgentCmd, cursorPromptWithLineage, createCursorAgentMetadata, cursorLaunchNote, cursorEffortNavigation, cursorTuiReady, CURSOR_SUBMIT_SEQUENCE, CURSOR_COMPOSER_CONTENT_MARKER_RE, validateCursorModelEffort, } from "./harnesses/cursor.js";
23
23
  import { resolveAgentBin, resolveThroughlineBin, runThroughlineHandoffContext, isWindowsNativeExecutable, agentBinForPaneShell, resolveWinPaneShell } from "./agent-resolver.js";
24
24
  export { AitermError } from "./errors.js";
25
25
  export { tmuxSpawnEnv } from "./tmux-runtime.js";
@@ -738,6 +738,16 @@ export function sendKey(name, key, o = {}) {
738
738
  throw new AitermError("aiterm相関付きClaude agent sessionではturn相関を壊さないC-cだけをpty_keyで送れます。" +
739
739
  "他の対話操作はpty_send(自動dispatch)、終了はpty_closeを使ってください。", 2);
740
740
  }
741
+ const meta = tryLoadAgentMetadata(name);
742
+ if (meta?.kind === "cursor" && k === "Enter") {
743
+ send(name, CURSOR_SUBMIT_SEQUENCE, {
744
+ enter: false,
745
+ force: true,
746
+ raw: true,
747
+ preserveAgentOperation: o.preserveAgentOperation,
748
+ });
749
+ return `sent key ${k} to ${name}`;
750
+ }
741
751
  tmux("send-keys", "-t", name, k);
742
752
  return `sent key ${k} to ${name}`;
743
753
  }
@@ -2444,14 +2454,24 @@ function agentSubmitResidueOnScreen(kind, screen, tail) {
2444
2454
  if (markerIdx < 0)
2445
2455
  return null;
2446
2456
  if (kind === "cursor") {
2447
- // Cursorは長いpasteを入力欄の先頭側だけ表示することがあり、送信文の末尾一致では
2448
- // 座礁を検出できない。最新composerのmarkerと同じ行にplaceholder以外の本文が
2449
- // 残っていれば、その本文自体を未submitの陽性証拠とする。
2450
- const sameRowText = lines[markerIdx]
2451
- .replace(/^\s*(?:->|>|→)\s*/u, "")
2452
- .trim();
2453
- if (sameRowText.length > 0
2454
- && !/^(?:Add a follow-up|Plan,\s*search,\s*build anything)\b/iu.test(sameRowText))
2457
+ // Cursorは長いpasteを入力欄の先頭側だけ表示し、矢印の次行へ本文を折り返すことがある。
2458
+ // 最新composerから下部statusを除いた領域にplaceholder以外の本文が残っていれば、
2459
+ // 送信文の末尾が画面外でも未submitの陽性証拠とする。
2460
+ const composerLines = lines.slice(markerIdx);
2461
+ composerLines[0] = composerLines[0].replace(/^\s*(?:->|>|→)\s*/u, "");
2462
+ while (composerLines.at(-1)?.trim() === "")
2463
+ composerLines.pop();
2464
+ if (/^\s*\/\S.*\s·\s\S/u.test(composerLines.at(-1) ?? ""))
2465
+ composerLines.pop();
2466
+ while (composerLines.at(-1)?.trim() === "")
2467
+ composerLines.pop();
2468
+ if (/^\s*(?:Auto|Ask)(?:\s|·|$)/iu.test(composerLines.at(-1) ?? ""))
2469
+ composerLines.pop();
2470
+ while (composerLines.at(-1)?.trim() === "")
2471
+ composerLines.pop();
2472
+ const composerText = composerLines.join("\n").trim();
2473
+ if (composerText.length > 0
2474
+ && !/^(?:Add a follow-up|Plan,\s*search,\s*build anything)\b/iu.test(composerText))
2455
2475
  return true;
2456
2476
  }
2457
2477
  return normalizeResidueText(lines.slice(markerIdx).join("")).includes(tail);
@@ -9,6 +9,9 @@ import { spawnAgentControlCommand } from "../agent-resolver.js";
9
9
  import { AGENT_DONE_POLL_MS, AGENT_EVENT_MAX_BYTES, agentEventPath, agentHarness, agentLineageFields, agentMetadataPath, createEmpty0600, readFileRange, safeStatSize, shq, sleep, subagentInstruction, writeAgentMetadata, writeScopeLaunchNote, } from "../agent-shared.js";
10
10
  const CURSOR_TRANSCRIPT_MATCH_MAX_BYTES = 1024 * 1024;
11
11
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
12
+ // Cursor Agentはextended keyboard protocolを有効にするため、通常のtmux Enterではなく
13
+ // CSI-uのEnterを送る。呼び出し側へCursor固有の端末方言を漏らさない。
14
+ export const CURSOR_SUBMIT_SEQUENCE = "\x1b[13u";
12
15
  export function realCursorHome() {
13
16
  return path.join(process.env.HOME ?? os.homedir(), ".cursor");
14
17
  }
package/docs/DESIGN.md CHANGED
@@ -27,6 +27,7 @@ agent turnは常に非ブロックdispatchである。receiptの`event_cursor`
27
27
  platform nativeな別process起動情報を返す。waiterは純readerで、親のforeground turnを塞がない。
28
28
  回答はharness所有transcriptから同じturnへ相関して回収し、欠落・曖昧・timeout時にpromptを再送しない。
29
29
  `agent_steer`は実行中のCodex/Grok turnへ追加textを差し込み、idleなら送信せず状態を返す。
30
+ Cursorのsubmitはadapterがextended keyboard protocolのEnterへ変換し、呼び出し側は通常のdispatchだけを使う。
30
31
 
31
32
  ## Layer ownership
32
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.29.27",
3
+ "version": "0.29.29",
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": [