mulmoterminal 10.5.0 → 10.6.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.
- package/README.md +1 -1
- package/docs/ChangeLog.md +15 -0
- package/docs/facts.json +1 -1
- package/docs/guide/en/feature-list.md +2 -1
- package/docs/guide/en/index.md +2 -2
- package/docs/guide/en/v10.6.0.md +78 -0
- package/docs/guide/ja/feature-list.md +2 -1
- package/docs/guide/ja/index.md +2 -2
- package/docs/guide/ja/v10.6.0.md +75 -0
- package/package.json +1 -1
- package/server/routes/plugin-routes.ts +6 -5
- package/server/routes/ws-routes.ts +5 -0
- package/server/session/scheduled/background-chat.ts +8 -3
- package/server/session/spawn/agents/inherited-gui-restriction.ts +21 -0
- package/server/session/spawn/agents/session-gui-restriction.ts +25 -0
- package/server/session/spawn/agents/spawn-claude.ts +2 -18
- package/server/session/spawn/agents/spawn-codex.ts +9 -3
- package/server/session/spawn/agents/spawn-copilot.ts +10 -4
package/README.md
CHANGED
|
@@ -2137,7 +2137,7 @@ From a shell: `mulmoterminal room read <room>` · `room post <room> <text…> [-
|
|
|
2137
2137
|
| Endpoint | Purpose |
|
|
2138
2138
|
| -------- | ------- |
|
|
2139
2139
|
| `POST /api/mcp/:sessionId` | Per-session GUI MCP server (Streamable HTTP; `GET`/`DELETE` → 405). |
|
|
2140
|
-
| `POST /api/plugin/:toolName` | GUI-plugin dispatch (incl. `spawnBackgroundChat`, `manageAccounting`, `presentHtml`). `spawnBackgroundChat` takes an optional `guiGroups` (claude
|
|
2140
|
+
| `POST /api/plugin/:toolName` | GUI-plugin dispatch (incl. `spawnBackgroundChat`, `manageAccounting`, `presentHtml`). `spawnBackgroundChat` takes an optional `guiGroups` (claude, codex and copilot): a list of tool groups (`render`, `data`, `media`, `external`) the spawned session is limited to, `[]` for no GUI tool. The limit holds across a resume, including a codex resume opened by its rollout id. It is not a sandbox: the tools stay callable over HTTP. |
|
|
2141
2141
|
| `GET /api/agent/toolResults/:id` · `POST /api/agent/toolResult` | GUI-panel result history / persist. |
|
|
2142
2142
|
| `GET /api/tools` · `GET /api/tool-calls/:id` | Available tools / tool-call history. |
|
|
2143
2143
|
| `POST /api/accounting` | Double-entry accounting (bundled plugin). |
|
package/docs/ChangeLog.md
CHANGED
|
@@ -8,6 +8,21 @@ This file records **what changed and why**. For **how to actually use** a new fe
|
|
|
8
8
|
|
|
9
9
|
Entries here are folded into the next release's heading when it ships.
|
|
10
10
|
|
|
11
|
+
## mulmoterminal@10.6.0 — 2026-10-15
|
|
12
|
+
|
|
13
|
+
> **Setup guide:** [10.6.0 — Codex and Copilot workers can be limited to some GUI tools](https://receptron.github.io/mulmoterminal/guide/en/v10.6.0.html) ([日本語](https://receptron.github.io/mulmoterminal/guide/ja/v10.6.0.html))
|
|
14
|
+
|
|
15
|
+
### `guiGroups` for Codex and Copilot sessions (#3057)
|
|
16
|
+
|
|
17
|
+
- `POST /api/plugin/spawnBackgroundChat` accepts `guiGroups` for `codex` and `copilot` as well as `claude` (#3050), closing #3033. `spawnCodexPty` / `spawnCopilotPty` record the restriction, read it back on every spawn of the id, hand exactly those groups whatever the directory registered, and never claim the all-tools url. The MCP routes already enforced the record by session id for every agent. Antigravity / Grok / Cursor / Muse stay refused: their groups live in a file shared by every session in the directory.
|
|
18
|
+
- A Codex conversation is listed for resuming under its rollout id, a key the restriction was never recorded for. `inheritedGuiRestriction()` takes the narrowest restriction among the sessions holding that rollout, and the spawn records it under the new key.
|
|
19
|
+
- The Codex and Copilot cell handlers now wait for the restriction log before spawning, as the Claude handler does, so a resume right after a restart is no longer handed every tool.
|
|
20
|
+
- Not changed: a restricted Copilot session keeps `--allow-all-tools`, so Copilot's built-ins and the user's own MCP servers stay pre-approved, as for every Copilot session. The restriction log is read at boot only, so it is not shared live between two servers on one `~/.mulmoterminal` (an unsupported setup).
|
|
21
|
+
|
|
22
|
+
### Note missing from 10.5.0: a permanently overridden `HOME` (#3053)
|
|
23
|
+
|
|
24
|
+
- If MulmoTerminal always runs with `HOME` pointed away from the account's own home, the first start on 10.5.0 or later cannot reattach the pre-upgrade terminals: they stay on the shared `-L mulmoterminal` tmux server and their drop copies in `mulmoterminal-drops`. Conversations resume from disk. End the leftovers with `tmux -L mulmoterminal kill-server` — only when no server ever runs on the real home. No migration is possible: nothing in a session or a drop directory records which `HOME` made it.
|
|
25
|
+
|
|
11
26
|
## mulmoterminal@10.5.0 — 2026-10-15
|
|
12
27
|
|
|
13
28
|
> **Setup guide:** [10.5.0 — A cell closes when its agent ends, and Antigravity tells you when it is done](https://receptron.github.io/mulmoterminal/guide/en/v10.5.0.html) ([日本語](https://receptron.github.io/mulmoterminal/guide/ja/v10.5.0.html))
|
package/docs/facts.json
CHANGED
|
@@ -4,7 +4,7 @@ nav_title: Feature list
|
|
|
4
4
|
layout: default
|
|
5
5
|
parent: English
|
|
6
6
|
nav_order: 6.5
|
|
7
|
-
as_of: 10.
|
|
7
|
+
as_of: 10.6.0
|
|
8
8
|
description: "Every capability MulmoTerminal has today, one line each with the release it arrived in, grouped by area (as of 9.1.0)."
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -66,6 +66,7 @@ More: [Agents](agents.html)
|
|
|
66
66
|
|
|
67
67
|
- Antigravity cells light the working dot during a turn and play the finished sound and push when it ends (v10.5.0)
|
|
68
68
|
- An agent can start a Claude session with only some GUI tool groups (`spawnBackgroundChat` `guiGroups`) (v10.5.0)
|
|
69
|
+
- The same `guiGroups` limit works for a Codex or Copilot session, and holds when a Codex session is reopened from its rollout in the resume list (v10.6.0)
|
|
69
70
|
- The Skills viewer's skills.sh mode searches the public directory for skills not on disk and shows a skill's `SKILL.md`, every file it brings and the ones that can run code, with the `npx skills add` line to copy; it installs nothing (v8.4.0)
|
|
70
71
|
- More features → Skills lists every Claude skill on disk — `~/.claude/skills`, each enabled plugin (as `plugin:skill`), and the `.claude/skills` of each folder a terminal ran in — in three columns with search, marking a folder skill that overrides yours (v8.3.0)
|
|
71
72
|
- Settings → Models and backends adds and removes custom agents, accounts and backends, validating URLs and keys (v7.2.0)
|
package/docs/guide/en/index.md
CHANGED
|
@@ -8,8 +8,8 @@ description: A browser-terminal cockpit for running several AI coding agents in
|
|
|
8
8
|
|
|
9
9
|
# MulmoTerminal Guide (English)
|
|
10
10
|
|
|
11
|
-
> **10.
|
|
12
|
-
>
|
|
11
|
+
> **10.6.0 is out.** An agent can now limit a Codex or Copilot worker to some GUI tools, as it already
|
|
12
|
+
> could a Claude one. [Setup guide](v10.6.0.html)
|
|
13
13
|
|
|
14
14
|
## What is MulmoTerminal? {#what-is}
|
|
15
15
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 10.6.0 — Codex and Copilot workers can be limited to some GUI tools
|
|
3
|
+
layout: default
|
|
4
|
+
parent: English
|
|
5
|
+
nav_order: 9999881
|
|
6
|
+
description: Setup guide for MulmoTerminal 10.6.0. An agent that starts a Codex or Copilot session with spawnBackgroundChat can limit it to some GUI tool groups, as it already could for Claude. Plus a note 10.5.0 left out for anyone who runs MulmoTerminal with HOME pointed somewhere else.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 10.6.0 — Codex and Copilot workers can be limited to some GUI tools
|
|
10
|
+
|
|
11
|
+
**A snapshot as of 10.6.0 (released 2026-10-15).** It will go stale as the app moves on — that is
|
|
12
|
+
expected, and the living reference is the guide each section links to.
|
|
13
|
+
|
|
14
|
+
## New features
|
|
15
|
+
|
|
16
|
+
### Limit a Codex or Copilot worker to some GUI tools
|
|
17
|
+
|
|
18
|
+
This is for setups where one agent starts other agents — a coordinator that hands work to workers in
|
|
19
|
+
their own folders. Since 10.5.0 the coordinator could start a **Claude** worker with only some of
|
|
20
|
+
MulmoTerminal's GUI tools. Now it can do the same for a **Codex** or **Copilot** worker
|
|
21
|
+
([#3057](https://github.com/receptron/mulmoterminal/pull/3057),
|
|
22
|
+
[#3033](https://github.com/receptron/mulmoterminal/issues/3033)).
|
|
23
|
+
|
|
24
|
+
The GUI tools come in four groups: `render` (charts, forms, documents, questions to you), `data`,
|
|
25
|
+
`media` and `external`. The coordinator names the groups the worker may use in `guiGroups` when it
|
|
26
|
+
calls `spawnBackgroundChat`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "message": "Fix the failing test", "agent": "codex", "guiGroups": ["data"] }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Leave `guiGroups` out and the worker gets every GUI tool, as before.
|
|
33
|
+
- `[]` gives it no GUI tool at all.
|
|
34
|
+
- A list gives it only those groups. It cannot start further sessions, and it cannot ask you
|
|
35
|
+
questions in its own cell unless `render` is in the list.
|
|
36
|
+
|
|
37
|
+
The limit stays with the worker when its cell is reopened, when the server restarts, and when the
|
|
38
|
+
conversation is resumed. For Codex that includes reopening it from the resume list, where Codex
|
|
39
|
+
conversations appear under Codex's own id.
|
|
40
|
+
|
|
41
|
+
Asking for `guiGroups` with Antigravity, Grok, Cursor or Muse is refused with a message, instead of
|
|
42
|
+
starting a worker with every tool: those agents read their tools from a file that every session in the
|
|
43
|
+
folder shares.
|
|
44
|
+
|
|
45
|
+
How to tell it worked: open the worker's cell and look at its tools pane — it lists only the groups you
|
|
46
|
+
named.
|
|
47
|
+
|
|
48
|
+
This keeps the tools from being **offered**; it is not a sandbox. A worker with a shell can still call
|
|
49
|
+
MulmoTerminal over HTTP if it sets out to. A Copilot worker also keeps Copilot's own approval of its
|
|
50
|
+
built-in tools and of your own MCP servers, as every Copilot session does.
|
|
51
|
+
|
|
52
|
+
Reference: the `POST /api/plugin/:toolName` row of the API table in the
|
|
53
|
+
[README](https://github.com/receptron/mulmoterminal/blob/main/README.md), and the
|
|
54
|
+
[feature list](feature-list.html).
|
|
55
|
+
|
|
56
|
+
## What looks different
|
|
57
|
+
|
|
58
|
+
- Nothing on screen changes. A limited Codex or Copilot worker's tools pane lists only its groups, the
|
|
59
|
+
same way a limited Claude worker's already did.
|
|
60
|
+
|
|
61
|
+
## Under the hood
|
|
62
|
+
|
|
63
|
+
- **A note 10.5.0 left out — only if you run MulmoTerminal with `HOME` pointed somewhere else all the
|
|
64
|
+
time.** Since 10.5.0 a server on another `HOME` uses its own tmux server and its own folder for
|
|
65
|
+
dropped files, so it no longer disturbs the server on your real home
|
|
66
|
+
([#3053](https://github.com/receptron/mulmoterminal/pull/3053)). If that is how you always run it,
|
|
67
|
+
the first start on 10.5.0 or later cannot reattach the terminals from before the upgrade. The
|
|
68
|
+
conversations themselves resume as usual. The old terminals keep running in the background until you
|
|
69
|
+
end them:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
tmux -L mulmoterminal kill-server
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Only run that if you never run MulmoTerminal on your real home: on your real home, this name is the
|
|
76
|
+
one in use. If you never change `HOME`, none of this applies to you and nothing needs doing.
|
|
77
|
+
- A Codex or Copilot cell opened right after a restart now waits until it knows whether its session
|
|
78
|
+
was limited, instead of briefly starting with every tool (#3057).
|
|
@@ -4,7 +4,7 @@ nav_title: 全機能リスト
|
|
|
4
4
|
layout: default
|
|
5
5
|
parent: 日本語
|
|
6
6
|
nav_order: 6.5
|
|
7
|
-
as_of: 10.
|
|
7
|
+
as_of: 10.6.0
|
|
8
8
|
description: MulmoTerminal のいまある機能を、入った版つきで領域ごとに一行ずつ並べた一覧(9.1.0 時点)。
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -66,6 +66,7 @@ description: MulmoTerminal のいまある機能を、入った版つきで領
|
|
|
66
66
|
|
|
67
67
|
- Antigravity のセルで、ターン中は作業中の点が付き、終わると終了の音と通知が出る (v10.5.0)
|
|
68
68
|
- エージェントが、GUI の道具を一部のグループだけ持つ Claude のセッションを立ち上げられる(`spawnBackgroundChat` の `guiGroups`) (v10.5.0)
|
|
69
|
+
- 同じ `guiGroups` の制限が Codex と Copilot のセッションでも使え、Codex のセッションを再開一覧から開き直しても続く (v10.6.0)
|
|
69
70
|
- Skills 画面の skills.sh の切り替えで、まだ入っていないスキルを公開一覧から検索し、`SKILL.md`・持ち込むファイル・コードを実行できるファイルを見られる。インストールはせず、`npx skills add` の行をコピーできる (v8.4.0)
|
|
70
71
|
- その他の機能 → Skills で、`~/.claude/skills`・有効なプラグイン(`plugin:skill` の名前で)・ターミナルを開いたフォルダの `.claude/skills` にあるスキルを 3 列で一覧・検索。自分のスキルを上書きするフォルダのスキルに印がつく (v8.3.0)
|
|
71
72
|
- 設定の「Models and backends」でカスタムエージェント・アカウント・バックエンドを追加・削除できる(URL とキーを検証) (v7.2.0)
|
package/docs/guide/ja/index.md
CHANGED
|
@@ -8,8 +8,8 @@ description: 複数の AI コーディングエージェントをブラウザの
|
|
|
8
8
|
|
|
9
9
|
# MulmoTerminal ガイド(日本語)
|
|
10
10
|
|
|
11
|
-
> **10.
|
|
12
|
-
>
|
|
11
|
+
> **10.6.0 が出ました。** Claude と同じように、Codex や Copilot のワーカーも GUI の道具の一部だけで
|
|
12
|
+
> 立ち上げられるようになりました。[セットアップガイド](v10.6.0.html)
|
|
13
13
|
|
|
14
14
|
## MulmoTerminal とは {#what-is}
|
|
15
15
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 10.6.0 — Codex と Copilot のワーカーも GUI の道具を絞れる
|
|
3
|
+
layout: default
|
|
4
|
+
parent: 日本語
|
|
5
|
+
nav_order: 9999881
|
|
6
|
+
description: MulmoTerminal 10.6.0 の手順。spawnBackgroundChat で Codex や Copilot のセッションを立ち上げるとき、Claude と同じように GUI の道具をグループ単位で絞れるようになりました。HOME を別の場所にして使っている人向けに、10.5.0 で書き漏れた注意も載せています。
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 10.6.0 — Codex と Copilot のワーカーも GUI の道具を絞れる
|
|
10
|
+
|
|
11
|
+
**10.6.0 時点(2026-10-15 公開)の記録です。** アプリが進むにつれて古くなります。それは想定どおりで、
|
|
12
|
+
最新の説明は各節のリンク先のガイドにあります。
|
|
13
|
+
|
|
14
|
+
## 新機能
|
|
15
|
+
|
|
16
|
+
### Codex や Copilot のワーカーを、GUI の道具の一部だけに絞る
|
|
17
|
+
|
|
18
|
+
あるエージェントが別のエージェントを立ち上げる使い方のための機能です(取りまとめ役が、それぞれのフォルダで
|
|
19
|
+
動くワーカーに仕事を渡す、など)。10.5.0 から、取りまとめ役は **Claude** のワーカーを MulmoTerminal の
|
|
20
|
+
GUI の道具の一部だけで立ち上げられるようになっていました。今回、**Codex** と **Copilot** のワーカーでも
|
|
21
|
+
同じことができるようになりました([#3057](https://github.com/receptron/mulmoterminal/pull/3057)、
|
|
22
|
+
[#3033](https://github.com/receptron/mulmoterminal/issues/3033))。
|
|
23
|
+
|
|
24
|
+
GUI の道具は 4 つのグループに分かれています。`render`(グラフ・フォーム・文書・あなたへの質問)、`data`、
|
|
25
|
+
`media`、`external` です。取りまとめ役は `spawnBackgroundChat` を呼ぶとき、ワーカーが使ってよいグループを
|
|
26
|
+
`guiGroups` に並べます。
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "message": "落ちているテストを直して", "agent": "codex", "guiGroups": ["data"] }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- `guiGroups` を書かなければ、これまでどおり GUI の道具をすべて持ちます。
|
|
33
|
+
- `[]` にすると、GUI の道具を何も持ちません。
|
|
34
|
+
- グループを並べると、そのグループの道具だけを持ちます。ほかのセッションを立ち上げることはできません。
|
|
35
|
+
`render` を入れない限り、自分のセルからあなたに質問することもできません。
|
|
36
|
+
|
|
37
|
+
この制限は、セルを開き直しても、サーバーを再起動しても、会話を再開しても続きます。Codex では、再開の一覧から
|
|
38
|
+
開き直した場合も同じです(一覧では Codex の会話が Codex 自身の id で並んでいます)。
|
|
39
|
+
|
|
40
|
+
Antigravity・Grok・Cursor・Muse で `guiGroups` を指定すると、すべての道具を持つワーカーを立ち上げる代わりに、
|
|
41
|
+
理由を添えて断ります。これらのエージェントは、同じフォルダのすべてのセッションが共有するファイルから道具を
|
|
42
|
+
読むためです。
|
|
43
|
+
|
|
44
|
+
うまくいったかの確かめ方: ワーカーのセルを開いて道具の一覧を見ます。指定したグループの道具だけが並びます。
|
|
45
|
+
|
|
46
|
+
これは道具を **差し出さない** 仕組みで、隔離された環境ではありません。シェルを使えるワーカーが意図すれば、
|
|
47
|
+
HTTP で MulmoTerminal を直接呼べます。また Copilot のワーカーは、どの Copilot のセッションとも同じく、
|
|
48
|
+
Copilot 自身の組み込みの道具とあなた自身の MCP サーバーを事前に承認したままです。
|
|
49
|
+
|
|
50
|
+
参考: [README](https://github.com/receptron/mulmoterminal/blob/main/README.md) の API の表の
|
|
51
|
+
`POST /api/plugin/:toolName` の行、[機能一覧](feature-list.html)。
|
|
52
|
+
|
|
53
|
+
## 画面の変化
|
|
54
|
+
|
|
55
|
+
- 画面に変化はありません。制限した Codex や Copilot のワーカーの道具の一覧には、Claude のワーカーと同じく、
|
|
56
|
+
そのグループの道具だけが並びます。
|
|
57
|
+
|
|
58
|
+
## 見えない変化
|
|
59
|
+
|
|
60
|
+
- **10.5.0 で書き漏れた注意(HOME をいつも別の場所にして MulmoTerminal を動かしている人だけ)。**
|
|
61
|
+
10.5.0 から、別の `HOME` で動くサーバーは自分専用の tmux サーバーと、ドロップしたファイル用の自分専用の
|
|
62
|
+
フォルダを使います。そのため、本来のホームで動くサーバーを乱さなくなりました
|
|
63
|
+
([#3053](https://github.com/receptron/mulmoterminal/pull/3053))。いつもその使い方をしている場合、
|
|
64
|
+
10.5.0 以降で初めて起動したときに、アップグレード前の端末にはつなぎ直せません。会話そのものは
|
|
65
|
+
いつもどおり再開できます。古い端末は、終わらせるまで裏で動き続けます。
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
tmux -L mulmoterminal kill-server
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
これを実行するのは、本来のホームで MulmoTerminal を一度も動かさない場合だけにしてください。本来のホームでは、
|
|
72
|
+
この名前の tmux サーバーが使われています。`HOME` を変えていなければ、この注意は関係なく、何もする必要は
|
|
73
|
+
ありません。
|
|
74
|
+
- 再起動の直後に開いた Codex や Copilot のセルは、自分のセッションが制限されているかが分かるまで待つように
|
|
75
|
+
なりました。以前は、短いあいだ全部の道具を持って立ち上がることがありました(#3057)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmoterminal",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Run multiple Claude Code and Codex sessions in parallel — a browser terminal grid that shows which agent needs you. Local, tmux-backed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -88,21 +88,22 @@ function spawnSeededSession(
|
|
|
88
88
|
// directory get them from `groupsForSpawn(agent, cwd)` instead, which is the per-directory
|
|
89
89
|
// mechanism that DOES have to follow the cwd.
|
|
90
90
|
const initialPrompt = codexifySkillSeed(message);
|
|
91
|
-
|
|
91
|
+
// `guiGroups` reaches claude, codex and copilot only: the parser refuses it for every other agent (#3033).
|
|
92
|
+
const limit = guiGroups ?? undefined;
|
|
93
|
+
if (mode === "codex-run") deps.spawnCodexPty(sessionId, null, null, cwd, true, { initialPrompt, guiGroups: limit });
|
|
92
94
|
else if (mode === "antigravity-run") deps.spawnAntigravityPty(sessionId, null, null, cwd, { mcpGroups, initialPrompt });
|
|
93
95
|
else if (mode === "grok-run") deps.spawnGrokPty(sessionId, null, null, cwd, { mcpGroups, initialPrompt });
|
|
94
96
|
else if (mode === "muse-run") deps.spawnMusePty(sessionId, null, null, cwd, { mcpGroups, initialPrompt });
|
|
95
97
|
// A seeded copilot chat carries the whole GUI MCP (attachGuiMcp = true): it has no cell, which is
|
|
96
98
|
// the same reason claude and codex get it here.
|
|
97
|
-
else if (mode === "copilot-run") deps.spawnCopilotPty(sessionId, null, null, cwd, true, { mcpGroups, initialPrompt });
|
|
99
|
+
else if (mode === "copilot-run") deps.spawnCopilotPty(sessionId, null, null, cwd, true, { mcpGroups, initialPrompt, guiGroups: limit });
|
|
98
100
|
// Cursor reaches its groups through a file in the directory, written and approved by the caller
|
|
99
101
|
// before this runs (cursor-mcp.ts). The list is passed anyway, as muse's is: the bridge cannot
|
|
100
102
|
// inherit anything from cursor, so it asks which session it belongs to and is told these groups
|
|
101
103
|
// with the answer (bridge-session.ts).
|
|
102
104
|
else if (mode === "cursor-run") deps.spawnCursorPty(sessionId, null, null, cwd, { mcpGroups, initialPrompt });
|
|
103
|
-
|
|
104
|
-
else
|
|
105
|
-
else deps.spawnClaudePty(sessionId, null, null, { initialPrompt: message, cwd, guiGroups: guiGroups ?? undefined });
|
|
105
|
+
else if (mode === "claude-draft") deps.spawnClaudePty(sessionId, null, null, { draft: message, cwd, guiGroups: limit });
|
|
106
|
+
else deps.spawnClaudePty(sessionId, null, null, { initialPrompt: message, cwd, guiGroups: limit });
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
/** Where a seeded chat runs: the project it was started from, or the workspace when it named
|
|
@@ -708,6 +708,9 @@ export async function handleCodexConnection(deps: WsRouteDeps, ws: WebSocket, re
|
|
|
708
708
|
// arrives while the log is still being read would see an empty map and decline to resume a
|
|
709
709
|
// rollout that is right there — which is the restart case this exists for.
|
|
710
710
|
await codexRolloutsHydrated;
|
|
711
|
+
// And the GUI tool restriction (#3033), for the claude handler's reason: the spawn reads it, and a
|
|
712
|
+
// resume that ran ahead of the log would be handed every tool and claim them.
|
|
713
|
+
await guiGroupRestrictionsHydrated;
|
|
711
714
|
// Same order and rule as the claude handler: bind where an existing rollout is, and give only a
|
|
712
715
|
// newly minted key the picked account.
|
|
713
716
|
const rolloutOf = (key: string) => codexRollouts.get(key)?.conversationId ?? key;
|
|
@@ -802,6 +805,8 @@ export async function handleCopilotConnection(deps: WsRouteDeps, ws: WebSocket,
|
|
|
802
805
|
// would see nothing remembered and fall back to the request's directory, which is the case the
|
|
803
806
|
// resolver exists to avoid.
|
|
804
807
|
await devTerminalCwdsHydrated;
|
|
808
|
+
// The GUI tool restriction (#3033), read by the spawn — see the codex handler.
|
|
809
|
+
await guiGroupRestrictionsHydrated;
|
|
805
810
|
const { sessionId, live: resolvedLive } = await resolveCopilotSession(requested, cwd);
|
|
806
811
|
await sessionConnects(sessionId, async () => {
|
|
807
812
|
const admitted = await admitInSessionDir(ws, "copilot", { requested, sessionId, resolvedLive, cwd, devTerminal: !attachGuiMcp }, early);
|
|
@@ -30,10 +30,15 @@ export interface BackgroundChatRequest {
|
|
|
30
30
|
* anything the caller sent. A slug naming nothing is therefore harmless — it records nothing. */
|
|
31
31
|
collection: string | null;
|
|
32
32
|
/** The GUI tool groups the session may use (#3033), or null for every GUI tool. `[]` is no GUI
|
|
33
|
-
* tool at all.
|
|
33
|
+
* tool at all. claude, codex and copilot only: the parser refuses it for any other agent. */
|
|
34
34
|
guiGroups: readonly ToolGroup[] | null;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/** The agents handed their GUI MCP per spawn, so one session can be limited without touching its
|
|
38
|
+
* neighbours. agy / grok / cursor / muse read their groups from a file every session in the
|
|
39
|
+
* directory shares. */
|
|
40
|
+
const GUI_GROUP_AGENTS: readonly TerminalAgent[] = ["claude", "codex", "copilot"];
|
|
41
|
+
|
|
37
42
|
/** `guiGroups` as asked for: absent is null (unrestricted), and anything that is not a list of
|
|
38
43
|
* known groups is a refusal rather than "absent" — falling back would hand out every tool to a
|
|
39
44
|
* caller that asked for fewer. */
|
|
@@ -54,8 +59,8 @@ export function parseBackgroundChat(body: unknown): { ok: true; request: Backgro
|
|
|
54
59
|
// toggle reads by, so a model naming an agent we don't host gets a session rather
|
|
55
60
|
// than an error about a field it half-guessed.
|
|
56
61
|
const agent = asTerminalAgent(record.agent);
|
|
57
|
-
if (guiGroups.groups !== null && agent
|
|
58
|
-
return { ok: false, message: `spawnBackgroundChat: \`guiGroups\` is supported for
|
|
62
|
+
if (guiGroups.groups !== null && !GUI_GROUP_AGENTS.includes(agent))
|
|
63
|
+
return { ok: false, message: `spawnBackgroundChat: \`guiGroups\` is supported for ${GUI_GROUP_AGENTS.join(", ")} only, not ${agent}.` };
|
|
59
64
|
return {
|
|
60
65
|
ok: true,
|
|
61
66
|
request: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The GUI tool restriction a codex resume inherits from the session that wrote the rollout (#3033).
|
|
2
|
+
//
|
|
3
|
+
// The launcher lists codex conversations by codex's own rollout id, so an ended restricted worker
|
|
4
|
+
// can come back under a key the restriction was never recorded for — and would start with every
|
|
5
|
+
// tool. The sessions recorded as holding that rollout say what it was limited to.
|
|
6
|
+
import type { ToolGroup } from "../../../../common/toolGroups.js";
|
|
7
|
+
import type { AgentConversation } from "../../list/agent-conversations.js";
|
|
8
|
+
|
|
9
|
+
/** The narrowest restriction among the sessions holding `rolloutId`, or null when none was limited. */
|
|
10
|
+
export function inheritedGuiRestriction(
|
|
11
|
+
rolloutId: string,
|
|
12
|
+
conversations: Iterable<AgentConversation>,
|
|
13
|
+
restrictionOf: (sessionId: string) => readonly ToolGroup[] | null,
|
|
14
|
+
): readonly ToolGroup[] | null {
|
|
15
|
+
const restrictions = [...conversations]
|
|
16
|
+
.filter((record) => record.conversationId === rolloutId)
|
|
17
|
+
.map((record) => restrictionOf(record.sessionId))
|
|
18
|
+
.filter((groups): groups is readonly ToolGroup[] => groups !== null);
|
|
19
|
+
if (restrictions.length === 0) return null;
|
|
20
|
+
return restrictions.reduce((narrowest, groups) => narrowest.filter((group) => groups.includes(group)));
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// The GUI tool groups a spawned session is limited to (#3033), shared by every agent that takes its
|
|
2
|
+
// GUI MCP per spawn (claude, codex, copilot).
|
|
3
|
+
import type { ToolGroup } from "../../../../common/toolGroups.js";
|
|
4
|
+
import { codexRollouts, guiGroupRestriction, rememberGuiGroupRestriction } from "../../registry.js";
|
|
5
|
+
import { inheritedGuiRestriction } from "./inherited-gui-restriction.js";
|
|
6
|
+
|
|
7
|
+
/** The groups this session is limited to, or null. Recorded before anything can connect, and read
|
|
8
|
+
* back on EVERY spawn of the id: a resume arrives as a plain reconnect, and only this record says
|
|
9
|
+
* the session was limited. */
|
|
10
|
+
export function sessionGuiRestriction(sessionId: string, guiGroups: readonly ToolGroup[] | undefined): readonly ToolGroup[] | null {
|
|
11
|
+
if (guiGroups) rememberGuiGroupRestriction(sessionId, guiGroups);
|
|
12
|
+
return guiGroupRestriction(sessionId);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** codex's, which also covers a resume under the rollout id: that key was never recorded, so the
|
|
16
|
+
* restriction of the sessions holding the rollout is recorded under it before the spawn. */
|
|
17
|
+
export function codexSessionGuiRestriction(
|
|
18
|
+
sessionId: string,
|
|
19
|
+
guiGroups: readonly ToolGroup[] | undefined,
|
|
20
|
+
resumeRolloutId: string | null,
|
|
21
|
+
): readonly ToolGroup[] | null {
|
|
22
|
+
const unrecorded = !guiGroups && resumeRolloutId !== null && guiGroupRestriction(sessionId) === null;
|
|
23
|
+
const inherited = unrecorded ? inheritedGuiRestriction(resumeRolloutId, codexRollouts.values(), guiGroupRestriction) : null;
|
|
24
|
+
return sessionGuiRestriction(sessionId, guiGroups ?? inherited ?? undefined);
|
|
25
|
+
}
|
|
@@ -19,19 +19,11 @@ import { buildClaudeArgs } from "../../../agents/claude/claude-args.js";
|
|
|
19
19
|
import { refuseUnsupportedPermissionMode } from "../../../agents/claude/claude-help-probe.js";
|
|
20
20
|
import { claudeAdapter } from "../../../agents/claude/claude.js";
|
|
21
21
|
import { appendedSystemPrompt } from "../../../agents/appended-prompt.js";
|
|
22
|
-
import {
|
|
23
|
-
customAgentSessions,
|
|
24
|
-
guiGroupRestriction,
|
|
25
|
-
hookedSessions,
|
|
26
|
-
knownSessions,
|
|
27
|
-
launchChoices,
|
|
28
|
-
rememberCustomAgentSession,
|
|
29
|
-
rememberGuiGroupRestriction,
|
|
30
|
-
resetSessionToolGroups,
|
|
31
|
-
} from "../../registry.js";
|
|
22
|
+
import { customAgentSessions, hookedSessions, knownSessions, launchChoices, rememberCustomAgentSession, resetSessionToolGroups } from "../../registry.js";
|
|
32
23
|
import { ptyWouldReattach, type PtySpawnEnv } from "../../pty/pty-spawn.js";
|
|
33
24
|
import { ptyExitLine } from "../../pty/pty-exit-log.js";
|
|
34
25
|
import { startAgentPty, type StartedAgentPty } from "../../pty/agent-pty-start.js";
|
|
26
|
+
import { sessionGuiRestriction } from "./session-gui-restriction.js";
|
|
35
27
|
import { spawnWithFullGuiClaim } from "../spawn-with-full-gui-claim.js";
|
|
36
28
|
import { attachDraftInjection } from "../draft-injection.js";
|
|
37
29
|
import { sendFrame } from "../../ws-frames.js";
|
|
@@ -271,14 +263,6 @@ function sessionProgram(
|
|
|
271
263
|
return { file: launch.file, prefixArgs: launch.prefixArgs, spawnEnv: env, note };
|
|
272
264
|
}
|
|
273
265
|
|
|
274
|
-
// The GUI tool groups this session is limited to, or null. Recorded before anything can connect,
|
|
275
|
-
// and read back on EVERY spawn of the id: a resume arrives as a plain `?gui=0` reconnect, and only
|
|
276
|
-
// this record says the session was limited.
|
|
277
|
-
function sessionGuiRestriction(sessionId: string, guiGroups: readonly ToolGroup[] | undefined): readonly ToolGroup[] | null {
|
|
278
|
-
if (guiGroups) rememberGuiGroupRestriction(sessionId, guiGroups);
|
|
279
|
-
return guiGroupRestriction(sessionId);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
266
|
// What `--allowedTools` pre-approves. Carrying the whole GUI MCP: the GUI tools + the user's own
|
|
283
267
|
// configured MCP servers (mcp__<id>), so their tools don't trip a permission prompt on every call.
|
|
284
268
|
// A project-directory cell: no --mcp-config of ours, so there is nothing of ours to name — except
|
|
@@ -16,6 +16,7 @@ import { claimedCodexRollouts, codexRollouts, ptys, rememberCodexRollout } from
|
|
|
16
16
|
import { ptyWouldReattach } from "../../pty/pty-spawn.js";
|
|
17
17
|
import { startAgentPty } from "../../pty/agent-pty-start.js";
|
|
18
18
|
import { spawnWithFullGuiClaim, type FullGuiClaimRequest } from "../spawn-with-full-gui-claim.js";
|
|
19
|
+
import { codexSessionGuiRestriction } from "./session-gui-restriction.js";
|
|
19
20
|
import { wireAgentPtyRelay } from "../../pty/pty-relay.js";
|
|
20
21
|
import { attachCodexAutoRun } from "../draft-injection.js";
|
|
21
22
|
import type { PtyEntry } from "../../types.js";
|
|
@@ -64,9 +65,12 @@ export function createCodexSpawner(deps: SpawnDeps) {
|
|
|
64
65
|
/** The tool groups this cell's DIRECTORY has registered, for a grid cell (gui=0). Read by
|
|
65
66
|
* the caller because the lookup reads Claude Code's config files, and this is sync. */
|
|
66
67
|
mcpGroups?: readonly ToolGroup[];
|
|
68
|
+
/** Limit this session to these GUI tool groups, for this spawn and every later one (#3033). */
|
|
69
|
+
guiGroups?: readonly ToolGroup[] | undefined;
|
|
67
70
|
} = {},
|
|
68
71
|
): PtyEntry {
|
|
69
|
-
const { initialPrompt = null, mcpGroups = [] } = options;
|
|
72
|
+
const { initialPrompt = null, mcpGroups = [], guiGroups } = options;
|
|
73
|
+
const restrictedTo = codexSessionGuiRestriction(sessionId, guiGroups, resumeRolloutId);
|
|
70
74
|
// codex reads skills from its mirror (~/.codex/skills), not from the workspace's own
|
|
71
75
|
// `.claude/skills`, and the mirror is otherwise refreshed only at boot — so a skill created
|
|
72
76
|
// mid-run (a new collection) would stay invisible to codex until a restart. No-op outside
|
|
@@ -98,9 +102,11 @@ export function createCodexSpawner(deps: SpawnDeps) {
|
|
|
98
102
|
// reuses the id, and a stale claim would stand its group urls down with nothing left to serve
|
|
99
103
|
// them (Codex review on #1399). claimFullGuiMcp owns both directions so neither spawn path can
|
|
100
104
|
// apply half the rule.
|
|
101
|
-
|
|
105
|
+
// A restricted session is handed exactly its groups, whatever the directory registered.
|
|
106
|
+
const restricted = restrictedTo !== null;
|
|
107
|
+
const claim: FullGuiClaimRequest = { sessionId, attachGuiMcp, cwd, wouldReattach: ptyWouldReattach(sessionId, true), agent: "codex", restricted };
|
|
102
108
|
const { entry, spawnedAtMs, reattached } = spawnWithFullGuiClaim(claim, (allTools) => {
|
|
103
|
-
const guiMcpServers = codexGuiMcpServers({ sessionId, port: PORT, groups: mcpGroups, allTools });
|
|
109
|
+
const guiMcpServers = codexGuiMcpServers({ sessionId, port: PORT, groups: restrictedTo ?? mcpGroups, allTools });
|
|
104
110
|
const permissionHook = wantsCodexPermissionHook(process.platform, initialPrompt !== null);
|
|
105
111
|
const args = buildCodexArgs({ resume: resumeRolloutId, model: deps.codexModel, guiMcpServers, permissionHook });
|
|
106
112
|
const spawnEnv = {
|
|
@@ -20,6 +20,7 @@ import { copilotHome, syncCopilotHooksFile } from "../../../agents/copilot/copil
|
|
|
20
20
|
import type { ToolGroup } from "../../../../common/toolGroups.js";
|
|
21
21
|
import { codexGuiMcpServers } from "../setup/mcp-config.js";
|
|
22
22
|
import { spawnWithFullGuiClaim, type FullGuiClaimRequest } from "../spawn-with-full-gui-claim.js";
|
|
23
|
+
import { sessionGuiRestriction } from "./session-gui-restriction.js";
|
|
23
24
|
import { ptyWouldReattach } from "../../pty/pty-spawn.js";
|
|
24
25
|
import { startAgentPty } from "../../pty/agent-pty-start.js";
|
|
25
26
|
import { wireAgentPtyRelay } from "../../pty/pty-relay.js";
|
|
@@ -36,9 +37,12 @@ export function createCopilotSpawner(deps: SpawnDeps) {
|
|
|
36
37
|
_resumeId: string | null,
|
|
37
38
|
cwd: string,
|
|
38
39
|
attachGuiMcp: boolean,
|
|
39
|
-
|
|
40
|
+
// `guiGroups` limits this session to those GUI tool groups, for this spawn and every later one (#3033).
|
|
41
|
+
options: { initialPrompt?: string | null; mcpGroups?: readonly ToolGroup[]; guiGroups?: readonly ToolGroup[] | undefined } = {},
|
|
40
42
|
): PtyEntry {
|
|
41
|
-
const { initialPrompt = null, mcpGroups = [] } = options;
|
|
43
|
+
const { initialPrompt = null, mcpGroups = [], guiGroups } = options;
|
|
44
|
+
// `--session-id` is our id on resume too, so the record is always under this key.
|
|
45
|
+
const restrictedTo = sessionGuiRestriction(sessionId, guiGroups);
|
|
42
46
|
// Every spawn, not only at boot: the file is one the user can delete, and rewriting it costs a
|
|
43
47
|
// read when it already matches (see syncCopilotHooksFile).
|
|
44
48
|
syncCopilotHooksFile("127.0.0.1", PORT);
|
|
@@ -47,11 +51,13 @@ export function createCopilotSpawner(deps: SpawnDeps) {
|
|
|
47
51
|
// MCP on one URL, a project cell carries one URL per group its DIRECTORY registered. Copilot
|
|
48
52
|
// can be given either through the same per-spawn flag, so unlike agy/grok/muse there is no
|
|
49
53
|
// file in the directory to keep in step.
|
|
50
|
-
|
|
54
|
+
// A restricted session is handed exactly its groups, whatever the directory registered.
|
|
55
|
+
const restricted = restrictedTo !== null;
|
|
56
|
+
const claim: FullGuiClaimRequest = { sessionId, attachGuiMcp, cwd, wouldReattach: ptyWouldReattach(sessionId, true), agent: "copilot", restricted };
|
|
51
57
|
const { entry, spawnedAtMs } = spawnWithFullGuiClaim(claim, (allTools) => {
|
|
52
58
|
const mcpConfig = allTools
|
|
53
59
|
? deps.mcpConfigJson(sessionId, "127.0.0.1")
|
|
54
|
-
: copilotMcpConfigJson(codexGuiMcpServers({ sessionId, port: PORT, groups: mcpGroups, allTools }));
|
|
60
|
+
: copilotMcpConfigJson(codexGuiMcpServers({ sessionId, port: PORT, groups: restrictedTo ?? mcpGroups, allTools }));
|
|
55
61
|
|
|
56
62
|
// A seed this agent takes as an ARGUMENT cannot carry a newline on Windows, so it may travel in
|
|
57
63
|
// a file with the command line naming it instead (#1518, session-settings.ts).
|