aiterm-mcp 0.29.12 → 0.29.13

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,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.29.13] - 2026-09-01
11
+
12
+ ### Added
13
+
14
+ - Add optional `throughline_supplement_file` to `agent_launch` and the four legacy launcher aliases. Aiterm passes the path unchanged to `throughline handoff-context`; Throughline alone reads, validates, scopes, and budgets the long-term-memory/RAG supplement.
15
+
10
16
  ## [0.29.12] - 2026-09-01
11
17
 
12
18
  ### Changed
@@ -1420,7 +1426,8 @@ prototype (preserved under `prototype/python/` as the porting source and referen
1420
1426
  `ubuntu-latest` for Node 18/20/22, publishing to npm on `v*` tags with
1421
1427
  provenance.
1422
1428
 
1423
- [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.12...HEAD
1429
+ [Unreleased]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.13...HEAD
1430
+ [0.29.13]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.12...v0.29.13
1424
1431
  [0.29.12]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.11...v0.29.12
1425
1432
  [0.29.11]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.10...v0.29.11
1426
1433
  [0.29.10]: https://github.com/kitepon/aiterm-mcp/compare/v0.29.9...v0.29.10
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.12** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
156
+ **状態:** 開発継続中 · 現行公開版 **v0.29.13** · 動作対象は Linux · WSL2 · macOS · Windows ネイティブ · MIT · [変更履歴](CHANGELOG.md)。
157
157
 
158
158
  ### 更新と巻き戻し
159
159
 
@@ -229,7 +229,8 @@ GrokのcredentialをAitermがlock、検査、書換えすることはない。
229
229
  portable forkは任意である。`throughline_source_session`を使う場合、`prompt`は必須の新ミッションとなり、
230
230
  `launch_operation_id`とは併用できない。aitermは`THROUGHLINE_BIN`、次に`PATH`からThroughlineを解決し、
231
231
  `throughline handoff-context --session <id> --json`のcontextを固定区切りとミッションの前へそのまま置く。
232
- この経路だけ`throughline >= 0.9.0`が必要で、元sessionのDB所属は変わらない。引数省略時には
232
+ 任意の`throughline_supplement_file`はThroughline 0.10.8以降を必要とし、`--supplement-file <path>`として内容を読まずにそのまま渡し、
233
+ project束縛・検証・予算配分はThroughlineだけが所有する。この経路だけ`throughline >= 0.9.0`が必要で、元sessionのDB所属は変わらない。引数省略時には
233
234
  Throughline自体が不要である。
234
235
 
235
236
  エージェント間の隠れたプロトコルは無い。起動したharnessは利用者がattachできるもう1本の永続sessionであり、MCPクライアントが通常のPTY操作で駆動する。
@@ -408,7 +409,7 @@ aiterm は同じ核心の洞察——端末を出会いの場にする——を
408
409
  | `pty_key` | 制御キーを送る | `session_id`, `key`(`C-c`/`Enter`/`Up`…) |
409
410
  | `pty_close` | 冪等に閉じ、`closed` / `already_closed`を返す | `session_id` |
410
411
  | `pty_list` | セッション一覧(agent行は正規`harness=<id>`と互換`agent=<kind>`を含む) | (なし) |
411
- | `agent_launch` | harnessとmodelを別軸で選ぶ正規agent起動入口 | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?` |
412
+ | `agent_launch` | harnessとmodelを別軸で選ぶ正規agent起動入口 | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?`, `throughline_source_session?`, `throughline_supplement_file?` |
412
413
  | `agent_steer` | 実行中のCodex/Grok turnへtextを差し込む。idleなら送信せず`idle`を返す | `session_id`, `text` |
413
414
  | `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | deprecated互換alias | 旧launcher引数 |
414
415
  | `agent_configure` | 起動中のClaude/Codex/Grok/Composer/Cursorを再起動せずmodel/effort変更 | `session_id`, `model?`, `reasoning_effort?` |
@@ -443,6 +444,7 @@ consumer は `aiterm-runtime-errors snapshot` を読み、durable ingestion 後
443
444
  handoff contextを前置きできる。この任意経路は`throughline >= 0.9.0`を必要とし、
444
445
  `launch_operation_id`とは併用不可で、元sessionのDB所属を変更しない。Throughlineは
445
446
  `THROUGHLINE_BIN`、次に`PATH`から解決し、不在・不正・空のexportはPTY作成前に明示失敗する。
447
+ 任意の`throughline_supplement_file`はThroughline 0.10.8以降と`throughline_source_session`を必要とし、Aitermは内容を解釈せずThroughlineへ渡す。
446
448
 
447
449
  エージェントの回答が画面tailより長ければ、`pty_read({ agent_transcript:true })`で再promptなしに全文回収する。既存の人間向けcontentは診断suffixを維持し、機械呼出し側は`aiterm.pty-read-result.v1`の`structuredContent.text`から回答本文だけを取得する。Claudeはlaunch相関Stop hook、Codexは通常rollout、Grokは最後の実user行以後の最後の空でないassistantメッセージだけ、Cursorはlaunch IDでbindした通常agent transcriptから同じturnを回収する。
448
450
 
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.12** · 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.13** · 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
 
@@ -256,7 +256,9 @@ Portable fork is optional. When `throughline_source_session` is present, `prompt
256
256
  new mission and `launch_operation_id` cannot be combined with it. aiterm resolves Throughline via
257
257
  `THROUGHLINE_BIN` and then `PATH`, runs `throughline handoff-context --session <id> --json`, and
258
258
  places its returned context before a fixed separator and the mission. This route requires
259
- `throughline >= 0.9.0`; it reads the source memory without changing that database's session
259
+ `throughline >= 0.9.0`; `throughline_supplement_file` requires Throughline 0.10.8 or later. Aiterm appends
260
+ `--supplement-file <path>` without reading or interpreting the file. Throughline owns its project
261
+ binding, validation, and shared context budget. The route reads source memory without changing database session
260
262
  ownership. No Throughline dependency is needed when the field is omitted.
261
263
 
262
264
  Harness adapters translate `model` and `reasoning_effort` into each CLI's public controls. Explicit Grok models are checked against `grok models`; Cursor combines a base model such as `gpt-5.6-luna` with a separate effort such as `high`, checks the resulting current catalog ID, and uses Cursor's standard model picker for in-session changes. Missing models are errors, with no cache, retry, or fallback. Claude adds only launch-local Stop-hook settings, Codex reads its normal rollout store, Grok reads its normal session event/history, and Cursor binds its normal agent transcript with the launch ID. Pass an absolute `cwd`; `~` is not expanded.
@@ -439,7 +441,7 @@ On top of that sits a productized layer a raw tmux bridge doesn't have: **token-
439
441
  | `pty_key` | Send a control key | `session_id`, `key` (`C-c`/`Enter`/`Up`…) |
440
442
  | `pty_close` | Close idempotently; return `closed` / `already_closed` | `session_id` |
441
443
  | `pty_list` | List sessions (agent rows carry canonical `harness=<id>` plus compatibility `agent=<kind>`) | (none) |
442
- | `agent_launch` | Canonical agent launch; harness and model are independent | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?` |
444
+ | `agent_launch` | Canonical agent launch; harness and model are independent | `harness`, `prompt?`, `model?`, `reasoning_effort?`, `cwd?`, `write_scope?`, `throughline_source_session?`, `throughline_supplement_file?` |
443
445
  | `agent_steer` | Inject text into the active Codex or Grok turn; return `idle` without sending when no turn is active | `session_id`, `text` |
444
446
  | `claude_agent` / `codex_agent` / `grok_agent` / `composer_agent` | Deprecated compatibility aliases | legacy launcher arguments |
445
447
  | `agent_configure` | Change model/effort in a running Claude, Codex, Grok, Composer, or Cursor session without restarting it | `session_id`, `model?`, `reasoning_effort?` |
@@ -473,7 +475,8 @@ The selected harness CLI must be installed and authenticated. Use each product o
473
475
  Set `throughline_source_session` together with a non-empty mission in `prompt` to prepend
474
476
  Throughline's read-only handoff context. This optional route requires `throughline >= 0.9.0`,
475
477
  cannot be combined with `launch_operation_id`, and leaves the source session's database ownership
476
- unchanged. Throughline is resolved through `THROUGHLINE_BIN` and then `PATH`; a missing or invalid
478
+ unchanged. Optional `throughline_supplement_file` is passed unchanged to Throughline and requires
479
+ `throughline_source_session` and Throughline 0.10.8 or later; Aiterm does not read or classify the supplement. Throughline is resolved through `THROUGHLINE_BIN` and then `PATH`; a missing or invalid
477
480
  export fails before the PTY exists instead of silently launching clean.
478
481
 
479
482
  When an agent's answer is longer than the on-screen tail (pane height ≈ 24 lines), callers recover it in full with `pty_read({ agent_transcript: true })`. It returns the most recently completed turn's final assistant message in plain text with no re-prompting. The existing human-readable content keeps its diagnostic suffix; machine callers read the answer alone from `structuredContent.text` in `aiterm.pty-read-result.v1`. Claude reads the bounded owner-only result captured by the launch-correlated Stop hook and verifies its digest/byte count; it never reads Claude's private transcript. Durable machine callers should use `claude_turn`: `issue` sends once, `recover` never sends, `pending` is distinct from unsafe or malformed state, and only `completed` carries the exact verified `raw_output`. Codex uses the normal rollout transcript's `task_complete.turn_id`; Grok/Composer return the last non-empty assistant message after the last real user row, excluding tool-use preambles; Cursor uses the normal agent transcript bound to the launch ID and current turn. Missing or ambiguous attribution remains an explicit error.
@@ -168,7 +168,10 @@ export function resolveThroughlineBin() {
168
168
  }).stdout?.split(/\r?\n/).find(Boolean) ?? null;
169
169
  return resolved && isUsableExecutableFile(resolved) ? resolved : null;
170
170
  }
171
- export function runThroughlineHandoffContext(bin, sessionId) {
171
+ export function runThroughlineHandoffContext(bin, sessionId, supplementFile = null) {
172
+ const args = ["handoff-context", "--session", sessionId, "--json"];
173
+ if (supplementFile !== null)
174
+ args.push("--supplement-file", supplementFile);
172
175
  if (isWin && /\.(?:cmd|bat)$/i.test(bin)) {
173
176
  const ps1 = path.join(path.dirname(bin), `${path.basename(bin, path.extname(bin))}.ps1`);
174
177
  if (fs.existsSync(ps1)) {
@@ -180,14 +183,11 @@ export function runThroughlineHandoffContext(bin, sessionId) {
180
183
  "Bypass",
181
184
  "-File",
182
185
  ps1,
183
- "handoff-context",
184
- "--session",
185
- sessionId,
186
- "--json",
186
+ ...args,
187
187
  ], { encoding: "utf8" });
188
188
  }
189
189
  }
190
- return spawnSync(bin, ["handoff-context", "--session", sessionId, "--json"], {
190
+ return spawnSync(bin, args, {
191
191
  encoding: "utf8",
192
192
  });
193
193
  }
package/dist/core.js CHANGED
@@ -2941,12 +2941,12 @@ const PORTABLE_FORK_MISSION_SEPARATOR = "\n\n---\n\n## Portable fork mission\n\n
2941
2941
  export function composePortableForkPrompt(context, mission) {
2942
2942
  return context + PORTABLE_FORK_MISSION_SEPARATOR + mission;
2943
2943
  }
2944
- function portableForkPrompt(sourceSessionId, mission) {
2944
+ function portableForkPrompt(sourceSessionId, mission, supplementFile) {
2945
2945
  const bin = resolveThroughlineBin();
2946
2946
  if (!bin) {
2947
2947
  throw new AitermError("Throughline CLIが見つかりません。portable forkのsessionは作成していません", 2);
2948
2948
  }
2949
- const result = runThroughlineHandoffContext(bin, sourceSessionId);
2949
+ const result = runThroughlineHandoffContext(bin, sourceSessionId, supplementFile);
2950
2950
  if (result.error || result.status !== 0) {
2951
2951
  throw new AitermError("Throughline handoff-contextの取得に失敗しました。portable forkのsessionは作成していません", 2);
2952
2952
  }
@@ -3243,9 +3243,16 @@ export function openAgent(kind, opts = {}) {
3243
3243
  export async function openAgentWithInitialPrompt(kind, opts = {}) {
3244
3244
  const mission = opts.prompt ?? null;
3245
3245
  const sourceSessionId = opts.throughline_source_session ?? null;
3246
+ const supplementFile = opts.throughline_supplement_file ?? null;
3246
3247
  if (sourceSessionId !== null && !sourceSessionId.length) {
3247
3248
  throw new AitermError("throughline_source_sessionが空文字です", 2);
3248
3249
  }
3250
+ if (supplementFile !== null && !supplementFile.length) {
3251
+ throw new AitermError("throughline_supplement_fileが空文字です", 2);
3252
+ }
3253
+ if (supplementFile !== null && sourceSessionId === null) {
3254
+ throw new AitermError("throughline_supplement_file指定時はthroughline_source_sessionが必要です", 2);
3255
+ }
3249
3256
  if (sourceSessionId !== null && (mission === null || !mission.trim())) {
3250
3257
  throw new AitermError("throughline_source_session指定時はpromptにmissionが必要です", 2);
3251
3258
  }
@@ -3254,7 +3261,7 @@ export async function openAgentWithInitialPrompt(kind, opts = {}) {
3254
3261
  }
3255
3262
  const prompt = sourceSessionId === null
3256
3263
  ? mission
3257
- : portableForkPrompt(sourceSessionId, mission);
3264
+ : portableForkPrompt(sourceSessionId, mission, supplementFile);
3258
3265
  if (opts.launch_operation_id != null && prompt !== null) {
3259
3266
  throw new AitermError("launch_operation_idはpromptなしのClaude相関launchだけで指定できます", 2);
3260
3267
  }
package/dist/index.js CHANGED
@@ -544,7 +544,7 @@ const agentEnvironmentDesc = `通常CLIと同じHOME・cwd・project/user/local
544
544
  `delegation depth/lineage、delegation_allowed=trueを注入し、必要な追加委譲は許可する。`;
545
545
  async function launchAgent(kind, args) {
546
546
  const supportsWriteScope = kind !== "claude";
547
- const { prompt, throughline_source_session, model, reasoning_effort, env_vars, cwd, session_name, launch_operation_id, write_scope } = args;
547
+ const { prompt, throughline_source_session, throughline_supplement_file, model, reasoning_effort, env_vars, cwd, session_name, launch_operation_id, write_scope } = args;
548
548
  try {
549
549
  if (!supportsWriteScope && write_scope !== undefined) {
550
550
  throw new core.AitermError("claude-code harnessはwrite_scopeに対応していません。指定を外してください", 2);
@@ -552,6 +552,7 @@ async function launchAgent(kind, args) {
552
552
  const [sid, hint, eventCursor, submitResidue] = await core.openAgentWithInitialPrompt(kind, {
553
553
  prompt: prompt ?? undefined,
554
554
  throughline_source_session,
555
+ throughline_supplement_file,
555
556
  model: model ?? undefined,
556
557
  reasoning_effort: reasoning_effort ?? undefined,
557
558
  env_vars,
@@ -619,6 +620,11 @@ function registerAgentTool(toolName, kind, desc) {
619
620
  .min(1)
620
621
  .optional()
621
622
  .describe("同一端末のThroughline sessionから所有権を変えずに記憶を読み、promptのmissionより前へ注入する"),
623
+ throughline_supplement_file: z
624
+ .string()
625
+ .min(1)
626
+ .optional()
627
+ .describe("Throughline 0.10.8以降へそのまま渡すproject束縛済み長期記憶・知識の補足JSON path"),
622
628
  model: z.string().nullish().describe(agentModelDesc(kind)),
623
629
  // CLI/model側の値集合が版で変わるため公開enumでは縛らない(core側も同方針)。
624
630
  reasoning_effort: z.string().nullish().describe(agentEffortDesc(kind)),
@@ -655,6 +661,7 @@ server.registerTool("agent_launch", {
655
661
  harness: z.enum(["claude-code", "codex-cli", "grok-cli", "cursor-cli"]).describe("agent loop・session・hook・transcript・認証を所有する実行基盤"),
656
662
  prompt: z.string().nullish().describe("起動時に渡す初手プロンプト(任意)。送信後は待たずに即返る"),
657
663
  throughline_source_session: z.string().min(1).optional().describe("同一端末のThroughline sessionから読み取り専用contextを初手へ注入する"),
664
+ throughline_supplement_file: z.string().min(1).optional().describe("Throughline 0.10.8以降へそのまま渡すproject束縛済み長期記憶・知識の補足JSON path"),
658
665
  model: z.string().nullish().describe("harnessが選ぶモデル。provider名ではなくlive catalog上のmodel ID"),
659
666
  reasoning_effort: z.string().nullish().describe("harness adapterが標準CLI表現へ変換する思考レベル。Cursorではmodel同時指定が必要"),
660
667
  env_vars: z.array(z.string()).optional().describe("現在のMCP processから継承する環境変数名"),
package/docs/DESIGN.md CHANGED
@@ -21,6 +21,7 @@ Windows nativeではpsmux 3.3.8以上に保存され、MCP serverやclientの再
21
21
  標準入口`agent_launch`は`claude-code`、`codex-cli`、`grok-cli`、`cursor-cli`のharnessとmodelを別軸で選ぶ。
22
22
  harnessがagent loop、認証、hook、session、transcript、model catalogを所有する。Aitermは通常の
23
23
  project/user環境を置換せず、launch相関と完了回収に必要なstateだけを加える。
24
+ Throughlineの補足記憶はpathを透過搬送するだけで、内容、project束縛、context予算はThroughlineが所有する。
24
25
 
25
26
  agent turnは常に非ブロックdispatchである。receiptの`event_cursor`がturn境界、`wait_process`が
26
27
  platform nativeな別process起動情報を返す。waiterは純readerで、親のforeground turnを塞がない。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiterm-mcp",
3
- "version": "0.29.12",
3
+ "version": "0.29.13",
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": [