agmsg 1.6.0-rc.1 → 1.6.0-rc.10
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 +11 -0
- package/README.ja.md +106 -27
- package/README.md +39 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
20
|
### Documentation
|
|
21
21
|
- Ask before creating a team when remote is in use; point at delete and update (#1574)
|
|
22
22
|
|
|
23
|
+
### If you use remote sync and are already affected
|
|
24
|
+
Check whether you use remote sync: `~/.agents/skills/agmsg/scripts/remote.sh status` lists each team, and only teams shown as `connected` are affected.
|
|
25
|
+
|
|
26
|
+
If your temp directory is already full (on Linux, commands fail with "No space left on device" even though the disk has room), free it before updating. This removes only files that match the leaked files exactly: directly in the temp directory, named `tmp.` plus 10 characters, exactly 3 bytes containing the line `ok`, and older than 10 minutes:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
find "${TMPDIR:-/tmp}" -maxdepth 1 -type f -name 'tmp.??????????' -size 3c -mmin +10 -print0 | xargs -0 grep -lx --null ok | xargs -0 rm -f
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then update with `npx agmsg@latest install --update`, which removes the rest. Afterwards, `doctor` reports any that remain and `doctor --fix` removes them.
|
|
33
|
+
|
|
23
34
|
[1.5.3]: https://github.com/fujibee/agmsg/compare/v1.5.2...v1.5.3
|
|
24
35
|
|
|
25
36
|
## [1.5.2] - 2026-10-02
|
package/README.ja.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://github.com/fujibee/agmsg/releases/latest)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
CLI AI
|
|
9
|
+
CLI AI エージェント間のクロスエージェントメッセージング。デーモン不要、ネットワークなし、複雑さなし。
|
|
10
10
|
|
|
11
11
|
> **AIエージェント向け:** 素早く機械可読な概要を掴むには [`/llms.txt`](llms.txt) を参照。
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ CLI AI エージェント間のクロスエージェントメッセージング
|
|
|
34
34
|
|
|
35
35
|
## デモ
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
同じチームに放たれた、`monitor`(legacy)モードの2つのClaude Codeインスタンスが、人間の介在なしに三目並べを対戦する — それぞれが相手の手をリアルタイムに拾い上げる:
|
|
38
38
|
|
|
39
39
|

|
|
40
40
|
|
|
@@ -60,7 +60,7 @@ npx agmsg
|
|
|
60
60
|
# OpenCode: $agmsg
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
これだけだ。スラッシュコマンドは初回使用時にチーム名とエージェント名を尋ね、続けて受信メッセージをどう届けるかを尋ねる([配信モード](#配信モード)を参照。任意のagmsgdがおすすめとして表示される)。その後は自然な言葉でエージェントに話しかければよい — 詳しくは下記の[初回実行](#初回実行)を参照。
|
|
64
64
|
|
|
65
65
|
先にコードを確認したい、最新の `main` を追いたい、あるいはカスタムのコマンド名にしたい場合は、下記の[インストール](#インストール)にある `setup.sh` ワンライナー、`git clone`、Claude Codeプラグインマーケットプレイスの各手順を参照。
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ npx agmsg
|
|
|
68
68
|
|
|
69
69
|
## 仕組み
|
|
70
70
|
|
|
71
|
-
agmsgは薄いトランスポートだ。各エージェントは(配信モードに応じて)フックまたはMonitorストリームを持ち、共有SQLiteファイルから読み取って受信メッセージをエージェントが反応できるテキストとして提示する。送信は行を追加する `send.sh`
|
|
71
|
+
agmsgは薄いトランスポートだ。各エージェントは(配信モードに応じて)フックまたはMonitorストリームを持ち、共有SQLiteファイルから読み取って受信メッセージをエージェントが反応できるテキストとして提示する。送信は行を追加する `send.sh` の呼び出しにすぎない。agmsg本体はデーモンもソケットもブローカーもなしで動く — ファイルが共有の土台であり、エージェントはその上で順番にやり取りする。任意の[agmsgd](#agmsgd-beta-160)は、選んだときだけ入る常駐サービスだ。
|
|
72
72
|
|
|
73
73
|
ストアはWALモードのSQLiteなので、複数のリーダーと単一のライターが競合なく共存できる。履歴は永続化される — メッセージはセッション終了後もDBに残り、`history.sh` は古いルームを新しいエージェントに再生できる。
|
|
74
74
|
|
|
@@ -123,13 +123,16 @@ cd agmsg
|
|
|
123
123
|
|
|
124
124
|
インストール後、**エージェントを再起動**して(Claude Code / Codex / Gemini CLI / Copilot CLI / Antigravity / OpenCode)新しいスキルを反映させる。
|
|
125
125
|
|
|
126
|
-
### Windows: Git Bash
|
|
126
|
+
### Windows: Git Bash
|
|
127
127
|
|
|
128
128
|
agmsgの実装は `scripts/` 配下のBashスクリプト群であるため、Windowsでは
|
|
129
129
|
スクリプトは**Git Bash**(Git for Windows、Git BashのPATH上に `sqlite3` がある状態)経由で実行される。PowerShell向けの再実装は存在しない。
|
|
130
130
|
|
|
131
|
-
- Windows環境では、Claude Code
|
|
132
|
-
|
|
131
|
+
- Windows環境では、Claude Codeのmonitor配信はGit Bash経由で検証されている。
|
|
132
|
+
PowerShellやネイティブのWindowsシェルからmonitorのセットアップが失敗したら、
|
|
133
|
+
同じagmsgコマンドをGit Bashから再実行し、`watch.sh` が想定どおりのBash環境で
|
|
134
|
+
動くようにすること。
|
|
135
|
+
- Claude Codeは通常、こうしたスクリプト呼び出しにBash/Git Bashを使うが、ネイティブWindowsのCodexコマンドやフックは
|
|
133
136
|
多くの場合PowerShellから始まる。すべてのエージェントが同じ `$HOME` と
|
|
134
137
|
SQLiteデータベースを共有できるよう、実際のagmsg実行パスはGit Bashに固定すること。
|
|
135
138
|
- **Codexの配信フック**は自動的にラップされる。ネイティブWindowsのCodexは
|
|
@@ -147,6 +150,25 @@ agmsgの実装は `scripts/` 配下のBashスクリプト群であるため、Wi
|
|
|
147
150
|
Set-Alias bash 'C:\Program Files\Git\bin\bash.exe'
|
|
148
151
|
```
|
|
149
152
|
|
|
153
|
+
### agmsgd beta (1.6.0)
|
|
154
|
+
|
|
155
|
+
任意のagmsgd betaは、Codexセッションにはcodexのキュー経由で受信箱を確認するよう通知を送り、Claude Codeセッションにはそのセッション自身のcross-sessionメッセージングソケットを通じて直接通知を送る。Claude Codeセッションがbypass-permissionsモードで動いているかを検出し、そのモード向けのラベルを通知に自動で付けるので、あなたが何かする必要はない。この方法で届くClaude Codeの席は、Monitorの監視を張り直す必要が一切ない。WindowsではClaude Codeが2.1.302以上であればこの方法で通知を受け取れる(2.1.198には通知の受け口がない)。届け先が確かめられないClaude Codeの席(古いClaude Codeなど)は、agmsgdが有効で動いていても今までどおりMonitorを使う。配信方法の選択画面でおすすめとして表示され、本人が選んだときだけ有効になる。インストール時には聞かず、`--update` でも変わらない。既存のSQLiteメッセージストアを読むだけで、データの移行、メッセージ本文の配送、リモート同期の肩代わり、Claude CodeとCodex以外のエージェントの受信方法の変更はしない。CodexはmacOS、Linux、Windowsに対応する。Windowsではネイティブのcodex 0.157.0以上が必要で、それより古い版は理由付きでブロックされる。ネイティブのキュー実行と、ログイン中の実際のWindowsセッションへの配送は、Codex 0.157.0と0.160.0で計測した。版や配送の証拠が読めないときは、従来どおりの保守的な扱いになる。JSONLストレージはこのbetaでは未対応なので、そのセッションにはブリッジを使い続けること。
|
|
156
|
+
|
|
157
|
+
Node >= 22.13.0 と `node:sqlite` が必要(実験的SQLiteの警告が出るのは想定内)。Nodeは [nodejs.org](https://nodejs.org/en/download) からインストールする。有効化と確認は次のとおり:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
agmsg daemon enable
|
|
161
|
+
agmsg daemon status
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`agmsg` が見つからなければ、`<install>/scripts/agmsg daemon enable` を使う(`status`、`start`、`stop`、`disable` も同じパスで)。`<install>` はインストーラーが表示したインストールディレクトリだ。シェルで `agmsg` が使えるよう、インストーラーのPATH案内に従うこと。
|
|
165
|
+
|
|
166
|
+
有効な間、シム経由の新しいCodex起動は素のCodexを使い、ブリッジのapp-serverもディスパッチャーも起動しない。すでにブリッジがあるセッションは再起動までそれを使い続け、agmsgdはそれらを飛ばす。`enable` と `start` は、残っているブリッジのセッションと、届け先の記録がない席を一覧する。届け先の記録がない席は、Codexを再起動して `$agmsg actas <name>` を実行すると記録される。既存のリモート同期プロセスは別のままなので、このbetaはまだすべてのバックグラウンド処理を1プロセスにまとめない。Claude Codeの席は、agmsgdが実際に届けられると確認できたときだけMonitorを省く。ほかの席はすべて今までどおりMonitorを使う。`daemon status` は各席の状態を `claude_code_seats` に出す。
|
|
167
|
+
|
|
168
|
+
agmsgdが有効なまま止まると、次の通常のagmsgスクリプト操作が、installごとに最大10分に1回だけ警告する。Codexの起動時も警告し、`daemon status` と `scripts/doctor.sh` は失敗を終了コード1で報告する。`agmsg daemon start` で復旧する。Nodeが無い、または古いときは、Nodeを入れて `agmsg daemon enable` をやり直す。未読メッセージは保たれる。
|
|
169
|
+
|
|
170
|
+
ブリッジ通知に戻すには `agmsg daemon disable` を実行し、ブリッジが無いと一覧されたCodexセッションを再起動する(例: `codex resume`、続けて `$agmsg actas <name>`)。再起動までは新しい通知を受け取らない。既存のブリッジのセッションは再起動不要で、以降のCodex起動にはブリッジが付く。Codexのキューがすでに受け付けた通知は取り消されず、もう一度表示されることがある。Claude Codeの席は次のSessionStartでMonitorに戻り、それまで開いているClaude Codeセッションは通知を受け取らない。既存のセッションで通知を戻すには、再開してSessionStartでMonitorを張り直す。`stop` は常駐サービスを外さずにデーモンを止め、`disable` はそのサービスの登録も解除する。
|
|
171
|
+
|
|
150
172
|
## 初回実行
|
|
151
173
|
|
|
152
174
|
エージェント(Claude Code、Codexなど)でプロジェクトを開き、次を実行する:
|
|
@@ -192,9 +214,9 @@ $agmsg # Codex, Gemini CLI, Antigravity
|
|
|
192
214
|
|
|
193
215
|
`spawn <type> <name>` は事前に `<name>` を参加させ、actasのスラッシュコマンド(`/<your-command> actas <name>`、インストールしたコマンド名に合わせる)を初期プロンプトとして対象のCLIを起動する。現在のセッションが**tmux**内であれば新しいペイン(`--window` で新しいウィンドウ、`--split h|v` で分割方向)を開き、そうでなければ新しい**OSターミナル**ウィンドウを開く。
|
|
194
216
|
|
|
195
|
-
`--boot-prompt <text>` を渡すと、新しいエージェントに初期タスクを渡せる — ブートプロンプトはactas
|
|
217
|
+
`--boot-prompt <text>` を渡すと、新しいエージェントに初期タスクを渡せる — ブートプロンプトはactasのスラッシュコマンドに続けて(改行区切りで)指定したテキストになるので、エージェントは同じ最初のターンでアイデンティティを主張し**かつ**タスクに着手する。アイドルになった後の `send` メッセージに気づくことが決してない**codex**ピア(monitor(legacy)もagmsgd配信も使っていないCodexセッションは、次のターンまで受信箱を見ない)に対してワンショットのゴールを渡す確実な方法がこれだ。
|
|
196
218
|
|
|
197
|
-
デフォルトでは `spawn` は**新しいエージェントが実際にリッスンし始めるまでブロックする** — ウォッチャーがアタッチし、レディネスの目印に触れる — その後 `status=ready` を表示するので、`spawn` が返ってきた瞬間にエージェントの起動直後の空白時間を気にせず作業を送れる。フックアンドフォーゲットなら `--no-wait`、待機時間の上限を決めたいなら `--ready-timeout <secs>`(デフォルト90、タイムアウト時は `status=timeout` を表示して終了コード3、呼び出し側は再spawnできる)を使う。Codexはこの待機をスキップする(
|
|
219
|
+
デフォルトでは `spawn` は**新しいエージェントが実際にリッスンし始めるまでブロックする** — ウォッチャーがアタッチし、レディネスの目印に触れる — その後 `status=ready` を表示するので、`spawn` が返ってきた瞬間にエージェントの起動直後の空白時間を気にせず作業を送れる。フックアンドフォーゲットなら `--no-wait`、待機時間の上限を決めたいなら `--ready-timeout <secs>`(デフォルト90、タイムアウト時は `status=timeout` を表示して終了コード3、呼び出し側は再spawnできる)を使う。Codexはこの待機をスキップする(spawn時のレディネスの受け渡しがないため。メッセージの受け取り方とは別の話)。
|
|
198
220
|
|
|
199
221
|
オプション: `--boot-prompt <text>`(初期タスク、上記参照)、`--project <path>`(デフォルト: 現在のプロジェクト)、`--team <team>`(プロジェクトにチームが1つだけなら自動解決)、`--terminal <tmpl>` / `$AGMSG_TERMINAL` / 設定 `spawn.terminal`(非tmux経路でターミナルコマンドを上書き。`{cmd}` プレースホルダーは生成されたブートスクリプトへのパスに置換される)。macOSでは、デフォルトで現在使っているターミナル(iTermまたはTerminal、`$TERM_PROGRAM` 経由で判定)を `open -a` で開く — これは単なるアプリ起動であり、ターミナルを直接スクリプト操作する場合に発生するAutomation/AppleScriptの権限プロンプトは**発生しない**。
|
|
200
222
|
|
|
@@ -223,41 +245,69 @@ codex:
|
|
|
223
245
|
|
|
224
246
|
デフォルトで `despawn <name>` は**グレースフル**だ — `<name>` に `ctrl:despawn` 制御メッセージを送信し、そのウォッチャーが自分のロール(actasロックと登録の解放)を解除し、自分のtmuxペインを閉じてエージェントを終了させる。ロールが解放されるまでブロックし、`--timeout <secs>`(デフォルト30)が上限、その後 `status=ok` を表示する。メンバーのウォッチャーが応答しない場合は `status=timeout` を表示して終了コード3 — `--force` で再試行すること。
|
|
225
247
|
|
|
226
|
-
`--force` はメッセージ送信をスキップし、spawn時に記録された配置情報からメンバーを終了させる — メンバーのtmuxペイン/ウィンドウをkillし、登録を削除する。メンバーのウォッチャーが応答できない場合(ウォッチャーが死んでいる、または**codex**メンバー —
|
|
248
|
+
`--force` はメッセージ送信をスキップし、spawn時に記録された配置情報からメンバーを終了させる — メンバーのtmuxペイン/ウィンドウをkillし、登録を削除する。メンバーのウォッチャーが応答できない場合(ウォッチャーが死んでいる、または**codex**メンバー — actasロックを持たず、Claude Codeのウォッチャーも動かさないので、グレースフルでは終了を確認できない)に使う。手動で起動されたメンバー(spawnの配置記録がない)は `--force` できない — despawnがその旨を伝え、あなた自身が閉じることになる。
|
|
227
249
|
|
|
228
250
|
despawnは指定されたメンバーにのみ作用する — `despawn` を実行しているセッション自体は決して終了させられず、広い購読範囲を持つウォッチャーは別のロール宛の `ctrl:despawn` を無視する。
|
|
229
251
|
|
|
252
|
+
### ロールを文脈ごと呼び戻す(セッション再開)
|
|
253
|
+
|
|
254
|
+
ロールは、最後にそのロールを担ったセッションを覚えている。セッションは `<team>-<agent>` という名前が付き、`spawn` は**ロールの前のセッションをデフォルトで再開する** — だから `despawn` やクラッシュ、再起動のあとに再spawnしても、空ではなく前の会話に戻る(`--fresh` で新規を強制)。[tmux-resurrect](https://github.com/tmux-plugins/tmux-resurrect) があれば、`~/.tmux.conf` に1行足すだけで、tmuxサーバーの再起動後にすべてのロールのペインがそれぞれのセッションに戻る。
|
|
255
|
+
|
|
256
|
+
tmux-resurrectの設定、各ペインの解決方法、自動で戻るものと戻らないもの、手動のフォールバックは **[docs/session-resurrect.md](docs/session-resurrect.md)** を参照。
|
|
257
|
+
|
|
230
258
|
## 配信モード
|
|
231
259
|
|
|
232
|
-
受信メッセージがエージェントにどう届くか。初回参加時のプロンプトで1つ選ぶか、後で `/agmsg
|
|
260
|
+
受信メッセージがエージェントにどう届くか。初回参加時のプロンプトで1つ選ぶか、後で `/agmsg delivery <name>` で変更する(`/agmsg mode` も別名として使える。シェルからは `agmsg delivery <name>`)。Claude CodeとCodexではプロンプトの先頭にagmsgdがおすすめとして出て、monitorは **`monitor (legacy)`** と表示される(モードの値は今まで通り `monitor`)。インストールや更新でagmsgdが勝手にオンになることはなく、更新で今使っているモードが変わることもない。
|
|
233
261
|
|
|
234
262
|
| モード | 仕組み | レイテンシ | 向いている相手 |
|
|
235
263
|
|---|---|---|---|
|
|
236
|
-
|
|
|
264
|
+
| **agmsgd**(Claude CodeとCodexでおすすめ。プロンプトか `/agmsg delivery agmsgd` で選ぶ) | バックグラウンドサービスが通知をセッションに直接届ける。Monitorタスクは不要 | 数秒 | サービスを動かせるClaude Code / Codexユーザー。ログイン時に起動するサービスを登録し、`agmsg daemon disable` で止めて削除できる |
|
|
265
|
+
| **`monitor (legacy)`**(値は `monitor`。Claude Codeのデフォルト。OpenCodeではopencode-sentinel pluginで利用可能) | SessionStartフック → Monitorツール → ブロッキングSQLiteストリーム | 約5秒 | リアルタイムプッシュを望むClaude Codeユーザー |
|
|
237
266
|
| **`turn`**(Codex / Copilot CLI / OpenCode(plugin未導入)のデフォルト) | アシスタントのターン間でStopフックが `check-inbox.sh` を発火 | 次のやり取りまで | monitorを実行していないCodex / Copilot CLI / OpenCodeユーザー、より静かなループを好むClaude Codeユーザー |
|
|
238
267
|
| **`both`** | monitorを主に、turnをセッションごとの安全網として | 約5秒。ウォッチャー障害時はturn相当にフォールバック | 二重の保険をかけたい場合 |
|
|
239
268
|
| **`off`** | 自動配信なし | 手動の `/agmsg` のみ | ミニマリスト |
|
|
240
269
|
|
|
270
|
+
`agmsg daemon enable` が断る環境(Node 22.13未満、JSONLのメッセージストレージ、Linuxでsystemdのユーザーサービスが使えない、WindowsのCodexが0.157未満)ではagmsgdは出さず、理由を1行添えて他のモードを並べる。agmsgdがすでにオンのときはどれを使うかを聞かず、そう伝えたうえで、そのまま使うか `monitor (legacy)` に切り替えるかだけ尋ねる。agmsgdを選ぶと `agmsg daemon enable` を実行し、届け先がまだ確かめられないセッションのために、プロジェクトのモードは `monitor` のままにしておく。`monitor (legacy)`(や `turn`、`both`、`off`)を選ぶとそのプロジェクトについては本当にagmsgdを使わない: agmsgdはそのプロジェクトの席に届けなくなり(`agmsg daemon status` には選択済みと出る)、agmsgd自体はインストール内の他のプロジェクト向けに動き続ける(全部止めるなら `agmsg daemon disable`)。一度も選んでいないプロジェクトは変わらない。
|
|
271
|
+
|
|
241
272
|
### モードの選択
|
|
242
273
|
|
|
243
274
|
```
|
|
244
|
-
/agmsg
|
|
245
|
-
/agmsg
|
|
246
|
-
/agmsg
|
|
247
|
-
/agmsg
|
|
248
|
-
/agmsg
|
|
275
|
+
/agmsg delivery agmsgd — バックグラウンドサービスによる直接配信(Claude Code、Codex)
|
|
276
|
+
/agmsg delivery monitor — このプロジェクトをリアルタイムプッシュに切り替え(Claude Code)
|
|
277
|
+
/agmsg delivery turn — ターン間チェックに切り替え
|
|
278
|
+
/agmsg delivery both — monitorをturnを安全網として併用
|
|
279
|
+
/agmsg delivery off — 手動の/agmsgのみ
|
|
280
|
+
/agmsg delivery — 現在のモードを表示
|
|
249
281
|
```
|
|
250
282
|
|
|
251
283
|
設定はプロジェクトごと。`<project>/.claude/settings.local.json` にはそのプロジェクトで選んだモードが必要とするフックだけが設定される — `set` の呼び出しを繰り返しても冪等だ。
|
|
252
284
|
|
|
253
285
|
**Monitorのプライミング**: `monitor` モードでは、受信側のエージェントはこのセッションで少なくとも1ターンを終えるまで最初の受信メッセージに反応しない。新しいセッションを始めたばかりで、チームメイトが既に何か送っている場合は、短いメッセージ(「hi」など)でエージェントをプライムしてやること — それ以降のメッセージはリアルタイムでストリームされる。
|
|
254
286
|
|
|
287
|
+
### Claude Codeのmonitor検証
|
|
288
|
+
|
|
289
|
+
`delivery.sh status claude-code <project>` が `mode: monitor` を示すのは、そのプロジェクトがmonitor配信向けに設定されている、という意味だ。現在のセッションでClaude Codeが実行時のMonitorタスクを開始した証拠には**ならない**。
|
|
290
|
+
|
|
291
|
+
リアルタイム配信を確かめるには、Claude Codeの実行時の状態を検証する:
|
|
292
|
+
|
|
293
|
+
1. `ToolSearch select:Monitor` がClaude Codeの汎用 `Monitor` ツールを見つける。
|
|
294
|
+
2. セッションが、`AGMSG-DIRECTIVE` の `watch.sh ... claude-code` コマンドで `Monitor(agmsg inbox stream)`(`actas <name>` の後は `Monitor(agmsg inbox stream (acting as <name>))`)を開始する。
|
|
295
|
+
3. メッセージが届いたとき、トランスクリプトに `Monitor event: "agmsg inbox stream"`(または `"agmsg inbox stream (acting as <name>)"`)の通知が入る。
|
|
296
|
+
|
|
297
|
+
`delivery.sh status` が `mode: monitor` と言っていても、次は失敗状態だ:
|
|
298
|
+
|
|
299
|
+
- `watch.sh` がMonitorツール経由ではなく、Bash/バックグラウンド/nohupのシェルプロセスとしてだけ動いている。
|
|
300
|
+
- ツール検索がClaude Codeの汎用 `Monitor` ツールではなく、Azure Monitor、MCPのmonitor、その他monitorを名乗る別のツールを見つける。
|
|
301
|
+
- `ToolSearch select:Monitor` が汎用 `Monitor` ツールを見つけられない。
|
|
302
|
+
|
|
303
|
+
TaskListにこのタスクが載ることはあるが、すべての環境で載るわけではない(デスクトップアプリのCodeタブはMonitorを実行してイベントを届けるが一覧には載せない)ので、TaskListにないことは失敗ではない。Monitor呼び出しの開始とイベントの到着で判断すること。バックグラウンドタスクのフッターも信頼できる確認方法ではない。Monitorツールが使えないときは、`turn` 配信か手動の `/agmsg` による受信箱の確認を代わりに使う。これらもキューに溜まったメッセージは届けるが、リアルタイムのmonitor配信ではない。
|
|
304
|
+
|
|
255
305
|
### レガシーの`hook on/off`からの移行
|
|
256
306
|
|
|
257
307
|
`hook on` は現在 `mode turn` の薄いエイリアスになっている(非推奨の一行ヒント付き)。リアルタイムプッシュに切り替えるには:
|
|
258
308
|
|
|
259
309
|
```
|
|
260
|
-
/agmsg
|
|
310
|
+
/agmsg delivery monitor
|
|
261
311
|
```
|
|
262
312
|
|
|
263
313
|
このコマンドは `db/config.yaml` を更新し、プロジェクトのフックエントリを書き換え、現在のセッションで `monitor` を有効化する `AGMSG-DIRECTIVE` を表示する — エージェントの再起動は不要。
|
|
@@ -271,11 +321,11 @@ despawnは指定されたメンバーにのみ作用する — `despawn` を実
|
|
|
271
321
|
/agmsg history — メッセージ履歴
|
|
272
322
|
/agmsg team — チームメンバー一覧
|
|
273
323
|
/agmsg send <agent> <message> — メッセージ送信
|
|
274
|
-
/agmsg
|
|
324
|
+
/agmsg delivery <agmsgd|monitor|turn|both|off> — 配信の切り替え(別名: /agmsg mode)
|
|
275
325
|
/agmsg mode — 現在のモードを表示
|
|
276
326
|
/agmsg actas <name> — このプロジェクトで別のロールに切り替え(必要なら作成)
|
|
277
327
|
/agmsg drop <name> — このプロジェクトからロールを削除
|
|
278
|
-
/agmsg spawn <type> <name> — <name
|
|
328
|
+
/agmsg spawn <type> <name> — <name>を名乗る新しいエージェントを起動(対応タイプは「新しいエージェントを起動する」を参照)
|
|
279
329
|
/agmsg despawn <name> [--force] — spawnしたメンバーを終了(グレースフル、または--force)
|
|
280
330
|
/agmsg hook on | off — レガシーエイリアス(mode turn | off)
|
|
281
331
|
/agmsg version — インストール済みバージョンを表示(git-describe由来)
|
|
@@ -290,7 +340,7 @@ $agmsg — または /skills → agmsg
|
|
|
290
340
|
|
|
291
341
|
Codexは `mode monitor` をapp-serverブリッジ経由でサポートし、加えて `mode turn` と `mode off` にも対応している。
|
|
292
342
|
|
|
293
|
-
> ⚠️ **monitor
|
|
343
|
+
> ⚠️ **monitor(legacy)モードはCodexの起動方法を変える — それを承知した上で有効化すること。** CodexにはClaude CodeのMonitorツールがないため、`mode monitor` はインタラクティブシェル内で `codex` をagmsgのmonitorシム経由にルーティングするシェル関数を表示する。monitorモードのプロジェクトでは、このシムがインタラクティブな起動を、受信したagmsgメッセージを現在のCodexスレッドのターンに変換するブリッジ経由にルーティングする。`codex exec` とmonitor対象外のプロジェクトは実物のCodexにそのまま通る。これはCodex app-serverの挙動に依存しており、既知の制限がある(TUIを閉じるとオーファンが残る — #149)。
|
|
294
344
|
|
|
295
345
|
グローバルなPATHシムを好むなら、`~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-shim-install.sh install` を実行し、`~/.agents/bin` を実物のCodexバイナリより前にPATHに置く。`~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-monitor.sh` で直接起動することもできる。Codexのサンドボックスはスキルの `db/`、`teams/`、`run/` ディレクトリへの書き込みを許可する必要がある — `~/.codex/config.toml` が存在する場合、`install.sh` がその `writable_roots` を設定する。セットアップの詳細と内部動作: [docs/codex-monitor-beta.md](docs/codex-monitor-beta.md)。
|
|
296
346
|
|
|
@@ -321,19 +371,28 @@ $agmsg
|
|
|
321
371
|
~/.agents/skills/<cmd>/scripts/inbox.sh <team> <agent_id>
|
|
322
372
|
~/.agents/skills/<cmd>/scripts/history.sh <team> [agent_id] [limit]
|
|
323
373
|
~/.agents/skills/<cmd>/scripts/team.sh <team> [--json] [--delete] [--force] [--purge-messages] [--yes]
|
|
374
|
+
~/.agents/skills/<cmd>/scripts/placement-collisions.sh
|
|
324
375
|
~/.agents/skills/<cmd>/scripts/whoami.sh <project_path> <type>
|
|
325
376
|
~/.agents/skills/<cmd>/scripts/delivery.sh set <mode> <type> <project_path>
|
|
326
377
|
~/.agents/skills/<cmd>/scripts/delivery.sh status [<type> <project_path>]
|
|
327
378
|
~/.agents/skills/<cmd>/scripts/reset.sh <project_path> <type> [agent_id]
|
|
328
379
|
```
|
|
329
380
|
|
|
381
|
+
`team.sh` は、名簿にターミナルの配置、アクティビティ、配信モード、アイデンティティの整合性を合わせて出す。確認できたアイデンティティは `identity=ok` にまとめられ、食い違いや観測できなかった値は証拠付きで展開される。`--json` はすべての登録のすべてのフィールドを出す。`team.sh` は他の席に対して読み取り専用だ: 食い違っている席や応答しない席は報告するが、外から修復することは決してない(以前の `--fix`、`--fix-pane-names`、`--rename-sessions` は#1152で削除された)。席は自分自身のアイデンティティのセルを、自分で `fix` を実行して直す。それができない席は、despawnして起動し直すか、人が引き継ぐ。ペインの生存状態は、pane-stateの契約が入った時点でこのビューに加わる。それまでは、利用できない列は `unknown` で埋めずに省く。
|
|
382
|
+
|
|
383
|
+
`--delete` は、すべてのメンバーが抜け(残りのメンバーごとに先に `leave.sh`)、かつチームが同期中でない場合(`team-list.sh --json` の `binding_state=active` は拒否、`disconnected` は追加の警告付きで続行)に、チームを削除する。削除されるのは設定、名簿、アイデンティティ履歴、エージェントごとのランタイム状態(actasロック、role-sessionレコード、spawn/配置レコード)で、メッセージ履歴は削除されない。`--force`(`--delete` と併用)は、残っているメンバー全員を先に外す(各メンバーに `leave.sh` を実行するのと同じ効果)うえで、`--delete` と同様にチームを削除する — デスクトップアプリが作ったチームは常にアプリのユーザーがメンバーにいるため、これがないとアプリからは削除できない。`--force` の確認では、外されるメンバーが名前で示される。`--purge-messages` はチームの行だけをsqliteのメッセージストアから削除し(jsonlは未対応)、単独でも `--delete` との併用でも使える。ほかのチームのデータには触れない。どちらも `uninstall.sh` と同じ形式で確認を求め、`--yes` を付けると省略できる。
|
|
384
|
+
|
|
385
|
+
`placement-collisions.sh` は、インストール全体を対象にした読み取り専用の別レポートだ。レコードの修復も削除も決してしない。この全体観測を `team.sh` の外に置くことで、運用者レベルのスキャンが席自身の修復経路の一部になるのを防いでいる。現時点で報告するのはレコードだけの層で、2つの*異なる*席のレコードが同じ正規の(種類、インスタンス、ペイン)ロケーターに解決される場合を、ディスク上のレコードだけから判定する — ターミナルには何も問い合わせない。解決できるインスタンス成分を持たない参照(今のherdrの参照はすべて、そしてレガシーの素のtmux `%N`/`@N`)は、文字列の一致では結合せず `unscoped_records` に列挙される。レコードだけの証拠では、ターミナルインスタンスをまたいでそうした参照を区別できないからだ。Orcaの参照はこの区分に入らない。`terminal_id_split` は検証済みハンドルに対して常に定数 `local` インスタンスに解決する(Orcaのローカルランタイムは現状ちょうど1つ)ので、Orcaの参照は実際のインスタンス+ペインの比較に進む。`collisions: none` は走査が完了して何も見つからなかったこと、`coverage: partial` を伴う `collisions: none_observed` は途中で何か(チーム設定、配置レコード、空の参照)が読めず空の答えが証明されていないこと、`collisions: not_attempted` は走査すべき `teams/` ディレクトリ自体がなかったことを意味する。席自身のレコードを、ライブの調査で実際に観測された場所と照合する実位置の層は、設計済みだがまだここには組み込まれていない。スクリプトのヘッダーを参照。
|
|
386
|
+
|
|
387
|
+
ターミナルのアイデンティティは、バックエンドごとに観測できる名前の数が違う。herdrは独立した3つの値を持つ: 見えるペインラベル、内部のエージェントキー、CLIのセッション名。tmuxは2つ: `@agmsg_agent` ペインオプションが内部キーで、CLIが `pane_title` を所有するため、CLI起動後は独立したペインラベルのフィールドがない。`team.sh` はtmuxのそのフィールドを、存在しない概念を不一致とみなさず `n/a` と報告する。Orcaは1つだけ: `terminal_name` がタブのタイトルを書き、`team.sh` はそれを `pane_label` として読み戻す(永続する値はタブ自体にあり、タブ内のどのペインにもない — タブは複数のペインに分割できる)。`@agmsg_agent` のような別のキーはないので、`agent_key` はtmuxの `pane_label` と同じく無条件に `n/a` になる。`cli_session` は違い、どのドライバーでも同じくAGENTタイプ自身の `session_name_source` に従う — `title` 由来のタイプ(Claude Code)はOrca自身の観測にも独立したタイトルのフィールドがないため `n/a`、`screen` 由来のタイプ(Codex。セッション名は `Thread name:` の行から来る)はOrca自身の観測拡張とは独立にペインの画面から直接読み、その行が見つからなければ `unknown:name_not_visible` を報告する。
|
|
388
|
+
|
|
330
389
|
`send.sh` は4つの位置引数 `<team> <from> <to> "<message>"` に加えて、末尾に任意で `--force` を取る。シェルが1つの引数として認識するようメッセージはクォートすること — クォートされていないスペース入りメッセージは誤って分割される。`from`・`to` はどちらも `<team>` に事前登録済みである必要があり、未登録の名前は(登録済み一覧を添えて)エラーになる — 意図的な事前登録前送信をしたい場合のみ `--force` でこのチェックを迂回できる。
|
|
331
390
|
|
|
332
391
|
## FAQ / 設計メモ
|
|
333
392
|
|
|
334
393
|
**これはMCPか? MCPサーバーが必要か?**
|
|
335
394
|
|
|
336
|
-
いいえ。agmsgはスタンドアロンだ — `bash` + `sqlite3
|
|
395
|
+
いいえ。agmsgはスタンドアロンだ — `bash` + `sqlite3`、サーバーもネットワークもなく、任意のagmsgdを選ばない限りデーモンもない。この2つのスタックは直交している — 既存のMCPセットアップと並行してagmsgを動かせる。
|
|
337
396
|
|
|
338
397
|
**同じチャンネルへの同時書き込み — 競合するか?**
|
|
339
398
|
|
|
@@ -377,6 +436,12 @@ v1にはない。2つのエージェントが同じ名前を購読していれ
|
|
|
377
436
|
|
|
378
437
|
## アップデート
|
|
379
438
|
|
|
439
|
+
```bash
|
|
440
|
+
npx agmsg@latest install --update # インストールが複数あるなら --cmd <name> を追加
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
クローンから:
|
|
444
|
+
|
|
380
445
|
```bash
|
|
381
446
|
cd agmsg
|
|
382
447
|
git pull
|
|
@@ -385,6 +450,12 @@ git pull
|
|
|
385
450
|
|
|
386
451
|
DBとチーム設定は保持される。更新されるのはスクリプトとアセットのみ。
|
|
387
452
|
|
|
453
|
+
### 1.5.xからのアップグレード
|
|
454
|
+
|
|
455
|
+
`--update` はagmsgdを有効にしない。一度も `agmsg daemon enable` を実行していなければ何も変わらない: agmsgdはオフのままで、メッセージングは1.5.xのときとまったく同じように動く。agmsgdが今オンなら、更新は新しい版で自動的に再起動する。それでも更新後に `agmsg daemon status` が停止を示すなら、`agmsg daemon start` を実行する。自分で `agmsg daemon disable` してオフにしていた場合は、更新を経てもオフのままだ(意図どおり)。
|
|
456
|
+
|
|
457
|
+
`--update` を実行しただけで再起動が必要なCodexセッションはない。Codexセッションの再起動が必要なのは、agmsgd自体を取り込むとき — 初めてオンにする場合(上の「agmsgd beta」を参照)、または `agmsg daemon disable` のあとでブリッジに戻る場合 — だけだ。
|
|
458
|
+
|
|
388
459
|
## アンインストール
|
|
389
460
|
|
|
390
461
|
`uninstall.sh`のコピーは各installの中にも入っているので、`git clone`・`npx agmsg`・curlのワンライナー、どの方法でinstallしても以下の形で使える:
|
|
@@ -466,6 +537,7 @@ sandbox_mode = "workspace-write"
|
|
|
466
537
|
writable_roots = [
|
|
467
538
|
"~/.agents/skills/agmsg/db",
|
|
468
539
|
"~/.agents/skills/agmsg/teams",
|
|
540
|
+
"~/.agents/skills/agmsg/run",
|
|
469
541
|
]
|
|
470
542
|
```
|
|
471
543
|
|
|
@@ -476,6 +548,7 @@ writable_roots = [
|
|
|
476
548
|
writable_roots = [
|
|
477
549
|
"~/.agents/skills/m/db",
|
|
478
550
|
"~/.agents/skills/m/teams",
|
|
551
|
+
"~/.agents/skills/m/run",
|
|
479
552
|
]
|
|
480
553
|
```
|
|
481
554
|
|
|
@@ -488,9 +561,10 @@ writable_roots = [
|
|
|
488
561
|
]
|
|
489
562
|
```
|
|
490
563
|
|
|
491
|
-
Codexは `mode
|
|
492
|
-
Monitor
|
|
493
|
-
`$agmsg`
|
|
564
|
+
Codexは `mode monitor`(legacy)をapp-serverブリッジ経由でサポートし、加えて `mode turn` と
|
|
565
|
+
`mode off` にも対応している。持っていないのはClaude CodeのMonitorツールだけだ。
|
|
566
|
+
サンドボックスのallowlistは、手動の `$agmsg` コマンド、ターン終了時の受信箱チェック、
|
|
567
|
+
ブリッジによる書き込みに必要となる。
|
|
494
568
|
|
|
495
569
|
Codexのランタイムや自動化の一部は、単一の実行に対して管理された権限プロファイルを
|
|
496
570
|
注入することがある。その場合、その実行固有のwritable rootsにもagmsgのストレージパスを
|
|
@@ -514,6 +588,7 @@ bats tests/ # bats-coreが必要: brew install bats-core
|
|
|
514
588
|
│ └── drivers/types/<name>/ # 組み込みのエージェントタイプドライバー(マニフェスト+ランタイム)
|
|
515
589
|
├── plugins/<axis>/<name>/ # オプトインする外部ドライバー(agmsg plugin trust)
|
|
516
590
|
├── db/messages.db # SQLite WALモードのメッセージストア
|
|
591
|
+
├── run/ # ランタイム状態: pidfile、actasロック、agmsgdのインストール記録
|
|
517
592
|
└── teams/ # チーム設定(自己完結)
|
|
518
593
|
└── <team>/
|
|
519
594
|
└── config.json
|
|
@@ -522,8 +597,8 @@ bats tests/ # bats-coreが必要: brew install bats-core
|
|
|
522
597
|
- **ストレージ**: WALモードの単一SQLiteファイル
|
|
523
598
|
- **並行性**: 複数リーダー + 1ライター、競合なし
|
|
524
599
|
- **依存関係**: `bash`、`sqlite3`(Pythonは不要)
|
|
525
|
-
- **自動検出**: Stopフックが各応答後に受信箱をチェック(60秒のクールダウン、`
|
|
526
|
-
-
|
|
600
|
+
- **自動検出**: Stopフックが各応答後に受信箱をチェック(60秒のクールダウン、`delivery.turn.check_interval` で設定可能)
|
|
601
|
+
- **デーモン不要**: 直接ファイルシステムアクセス(任意のagmsgdは選んだときだけ入る常駐サービス)
|
|
527
602
|
- **ネットワークなし**: すべてローカル
|
|
528
603
|
|
|
529
604
|
## プラグイン
|
|
@@ -536,6 +611,10 @@ agmsgのプラグイン可能な単位は軸(axis)ごとにグループ化
|
|
|
536
611
|
[docs/plugins.md](docs/plugins.md)(設計の根拠は
|
|
537
612
|
[ADR 0002](docs/adr/0002-driver-discovery-and-plugin-opt-in.md))。
|
|
538
613
|
|
|
614
|
+
## agmsgの上に作る
|
|
615
|
+
|
|
616
|
+
agmsg自身のスクリプトの*外側*で、agmsgを読んだり動かしたりするもの — GUIアプリ、ボット、派生プロジェクト(`agmsg-shogi`、`agmsg-go`、`agmsg-mcp` など)— を作るなら、データは `scripts/api.sh` 経由で読み(JSONで返る。`messages.db` や `teams/*/config.json` を直接触る必要はない。それらは内部のもので、自由に変わりうる)、書き込みはデータベースではなく既存のスクリプト(`send.sh`、`join.sh` など)を通す。詳しいガイダンスは [docs/building-on-agmsg.md](docs/building-on-agmsg.md) を参照。
|
|
617
|
+
|
|
539
618
|
## コミュニティ
|
|
540
619
|
|
|
541
620
|
- **Product Hunt**: Product of the Day 5位、[2026-06-09ローンチ](https://www.producthunt.com/products/agmsg) — 219アップボート、39コメント
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://github.com/fujibee/agmsg/releases/latest)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
Cross-agent messaging for CLI AI agents. No daemon, no network, no complexity.
|
|
9
|
+
Cross-agent messaging for CLI AI agents. No daemon required, no network, no complexity.
|
|
10
10
|
|
|
11
11
|
> **For AI agents:** see [`/llms.txt`](llms.txt) for a quick, machine-friendly orientation.
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ You stop being the copy-paste courier between your agents. Claude Code, Codex, G
|
|
|
34
34
|
|
|
35
35
|
## Demo
|
|
36
36
|
|
|
37
|
-
Two
|
|
37
|
+
Two Claude Code instances in `monitor` (legacy) mode, left alone in the same team, play tic-tac-toe against each other with no human in the loop — each picks up the other's move in real time:
|
|
38
38
|
|
|
39
39
|

|
|
40
40
|
|
|
@@ -68,7 +68,7 @@ To sync a team between two installs through the self-hosted reference server, fo
|
|
|
68
68
|
|
|
69
69
|
## How it works
|
|
70
70
|
|
|
71
|
-
agmsg is a thin transport. Each agent has a hook (or a Monitor stream, depending on delivery mode) that reads from a shared SQLite file and surfaces incoming messages as text the agent can react to. Sending is a `send.sh` call that appends a row.
|
|
71
|
+
agmsg is a thin transport. Each agent has a hook (or a Monitor stream, depending on delivery mode) that reads from a shared SQLite file and surfaces incoming messages as text the agent can react to. Sending is a `send.sh` call that appends a row. agmsg itself runs with no daemon, no socket and no broker — the file is the shared floor and the agents take turns on it. The optional [agmsgd](#agmsgd-beta-160) is a resident service that is installed only if you choose it.
|
|
72
72
|
|
|
73
73
|
The store is WAL-mode SQLite, so multiple readers and a single writer coexist without conflicts. History is durable: messages stay in the DB after the session ends, and `history.sh` can replay an old room into a fresh agent.
|
|
74
74
|
|
|
@@ -154,7 +154,7 @@ Git Bash PATH). There is no PowerShell reimplementation.
|
|
|
154
154
|
|
|
155
155
|
### agmsgd beta (1.6.0)
|
|
156
156
|
|
|
157
|
-
The optional agmsgd beta sends Codex sessions a notice to check their inbox through the Codex queue, and sends Claude Code sessions a notice directly through that session's own cross-session messaging socket. A Claude Code seat delivered this way never needs its Monitor watch re-armed.
|
|
157
|
+
The optional agmsgd beta sends Codex sessions a notice to check their inbox through the Codex queue, and sends Claude Code sessions a notice directly through that session's own cross-session messaging socket. It detects whether that Claude Code session is running in bypass-permissions mode and labels notices for that mode automatically, with no action from you. A Claude Code seat delivered this way never needs its Monitor watch re-armed. On Windows, Claude Code must be 2.1.302 or later to receive notices this way (2.1.198 has no endpoint for them). A Claude Code seat whose delivery destination cannot be confirmed, such as one on an older Claude Code, keeps using Monitor as before, even with agmsgd enabled and running. It is offered as the recommended choice in the delivery-method screen and is turned on only if you pick it: install never asks, and `--update` never changes it. It reads the existing SQLite message store; it does not migrate data, deliver message bodies, take over remote sync, or change how any agent other than Claude Code and Codex receives messages. macOS, Linux, and Windows are supported for Codex. Windows requires native Codex 0.157.0 or later; earlier versions are blocked with a reason. Native queue execution and delivery to a logged-in live Windows session were measured with Codex 0.157.0 and 0.160.0. Unreadable version or delivery evidence keeps the existing conservative handling. JSONL storage is unsupported by this beta; keep using the bridge for those sessions.
|
|
158
158
|
|
|
159
159
|
Requires Node >= 22.13.0 with `node:sqlite` (the experimental SQLite warning is expected). Install Node from [nodejs.org](https://nodejs.org/en/download). Enable and inspect the beta with:
|
|
160
160
|
|
|
@@ -216,9 +216,9 @@ Where `actas` switches *this* session to a different role, `spawn` brings up a *
|
|
|
216
216
|
|
|
217
217
|
`spawn <type> <name>` pre-joins `<name>`, then launches the target CLI with the actas slash command (`/<your-command> actas <name>`, matching your install command name) as its initial prompt. If the current session is inside **tmux**, it opens in a new pane (or `--window` for a new window, `--split h|v` for the direction); otherwise it opens a new **OS terminal** window.
|
|
218
218
|
|
|
219
|
-
Pass `--boot-prompt <text>` to hand the new agent an initial task: the boot prompt becomes the actas slash command followed (newline-separated) by your text, so the agent claims its identity **and** acts on the task in the same first turn. This is the
|
|
219
|
+
Pass `--boot-prompt <text>` to hand the new agent an initial task: the boot prompt becomes the actas slash command followed (newline-separated) by your text, so the agent claims its identity **and** acts on the task in the same first turn. This is the reliable way to give a one-shot goal to a **codex** peer: a Codex session that is not on monitor (legacy) or agmsgd delivery only looks at its inbox on its next turn, so it never notices a message you `send` after it goes idle.
|
|
220
220
|
|
|
221
|
-
By default `spawn` **blocks until the new agent is actually listening** — its watcher attaches and touches a readiness sentinel — then prints `status=ready`, so you can send work the moment `spawn` returns without losing it to the agent's cold start. Use `--no-wait` for fire-and-forget, or `--ready-timeout <secs>` to bound the wait (default 90; on timeout it prints `status=timeout` and exits 3 so a caller can re-spawn). Codex skips the wait
|
|
221
|
+
By default `spawn` **blocks until the new agent is actually listening** — its watcher attaches and touches a readiness sentinel — then prints `status=ready`, so you can send work the moment `spawn` returns without losing it to the agent's cold start. Use `--no-wait` for fire-and-forget, or `--ready-timeout <secs>` to bound the wait (default 90; on timeout it prints `status=timeout` and exits 3 so a caller can re-spawn). Codex skips the wait: it has no spawn-time readiness handshake (this is separate from how it receives messages).
|
|
222
222
|
|
|
223
223
|
Options: `--boot-prompt <text>` (initial task; see above), `--project <path>` (default: current project), `--team <team>` (auto-resolved when the project has a single team), and `--terminal <tmpl>` / `$AGMSG_TERMINAL` / config `spawn.terminal` to override the terminal command on the non-tmux path (a `{cmd}` placeholder is replaced with the path to the generated boot script). On macOS the default opens whichever terminal you're currently in (iTerm or Terminal, via `$TERM_PROGRAM`) using `open -a` — a plain app launch, so it does **not** trigger the Automation/AppleScript permission prompts that scripting the terminal directly would.
|
|
224
224
|
|
|
@@ -247,7 +247,7 @@ Eight of the ten agent types are spawnable — `claude-code`, `codex`, `grok-bui
|
|
|
247
247
|
|
|
248
248
|
By default `despawn <name>` is **graceful**: it sends a `ctrl:despawn` control message to `<name>`, whose watcher drops its own role (releasing the actas lock and registration) and closes its own tmux pane — ending the agent. It blocks until the role is released, up to `--timeout <secs>` (default 30), then prints `status=ok`. If the member's watcher never responds it prints `status=timeout` and exits 3 — retry with `--force`.
|
|
249
249
|
|
|
250
|
-
`--force` skips the message and tears the member down from the placement recorded at spawn time: it kills the member's tmux pane/window and drops its registration. Use it when the member's watcher can't respond — a dead watcher, or a **codex** member (no
|
|
250
|
+
`--force` skips the message and tears the member down from the placement recorded at spawn time: it kills the member's tmux pane/window and drops its registration. Use it when the member's watcher can't respond — a dead watcher, or a **codex** member (it never holds an actas lock and runs no Claude Code watcher, so graceful has nothing to confirm). A member started by hand (no spawn placement record) can't be `--force`d; despawn says so and leaves it for you to close.
|
|
251
251
|
|
|
252
252
|
Despawn only acts on the named member — the session running `despawn` is never torn down, and a broad-subscription watcher ignores a `ctrl:despawn` aimed at another role.
|
|
253
253
|
|
|
@@ -266,23 +266,27 @@ the manual fallback.
|
|
|
266
266
|
|
|
267
267
|
## Delivery modes
|
|
268
268
|
|
|
269
|
-
How incoming messages reach your agent. Pick one at first join via the prompt, or change it later with `/agmsg mode <name
|
|
269
|
+
How incoming messages reach your agent. Pick one at first join via the prompt, or change it later with `/agmsg delivery <name>` (`/agmsg mode` still works as an alias; from a shell: `agmsg delivery <name>`). On Claude Code and Codex the prompt offers agmsgd first, as the recommended choice, and lists the monitor as **`monitor (legacy)`** (the mode value is still `monitor`). Installing or updating never turns agmsgd on by itself, and an update changes nothing about the mode you already use.
|
|
270
270
|
|
|
271
271
|
| mode | mechanism | latency | who it's for |
|
|
272
272
|
|---|---|---|---|
|
|
273
|
-
|
|
|
273
|
+
| **agmsgd** (recommended on Claude Code and Codex; choose it at the prompt or with `/agmsg delivery agmsgd`) | a background service delivers a notice straight into the session, no Monitor task needed | a few seconds | anyone on Claude Code or Codex who can run the service: it registers one that starts at login, and `agmsg daemon disable` stops and removes it |
|
|
274
|
+
| **`monitor (legacy)`** (value `monitor`; default on Claude Code; on OpenCode with the opencode-sentinel plugin) | SessionStart hook → Monitor tool → blocking SQLite stream | ~5s | Claude Code users wanting real-time push |
|
|
274
275
|
| **`turn`** (default on Codex / Copilot CLI / OpenCode without the plugin) | Stop hook fires `check-inbox.sh` between assistant turns | until your next interaction | Codex / Copilot CLI / OpenCode users not running monitor; Claude Code users on a quieter loop |
|
|
275
276
|
| **`both`** | monitor primary, turn as per-session safety net | ~5s; falls back to turn-end on watcher failure | belt-and-suspenders |
|
|
276
277
|
| **`off`** | no automatic delivery | manual `/agmsg` only | minimalists |
|
|
277
278
|
|
|
279
|
+
agmsgd is not offered where `agmsg daemon enable` would refuse (Node older than 22.13, a JSONL message storage, no systemd user services on Linux, Codex older than 0.157 on Windows); the prompt says why in one line and lists the other modes. When agmsgd is already on, the prompt does not ask which to use: it says so and asks only whether to keep it or switch to `monitor (legacy)`. Choosing agmsgd runs `agmsg daemon enable` and leaves the project on `monitor` as the fallback for a session whose destination is not confirmed yet. Choosing `monitor (legacy)` (or `turn`, `both`, `off`) is a real opt-out for that project: agmsgd stops delivering to its seats (`agmsg daemon status` shows them as chosen), and agmsgd itself stays on for the install's other projects (`agmsg daemon disable` turns it off for all of them). A project that never chose is unchanged.
|
|
280
|
+
|
|
278
281
|
### Picking a mode
|
|
279
282
|
|
|
280
283
|
```
|
|
281
|
-
/agmsg
|
|
282
|
-
/agmsg
|
|
283
|
-
/agmsg
|
|
284
|
-
/agmsg
|
|
285
|
-
/agmsg
|
|
284
|
+
/agmsg delivery agmsgd — direct delivery by the background service (Claude Code, Codex)
|
|
285
|
+
/agmsg delivery monitor — switch this project to real-time push (Claude Code)
|
|
286
|
+
/agmsg delivery turn — switch to between-turns checking
|
|
287
|
+
/agmsg delivery both — monitor with turn as a safety net
|
|
288
|
+
/agmsg delivery off — manual /agmsg only
|
|
289
|
+
/agmsg delivery — show current mode
|
|
286
290
|
```
|
|
287
291
|
|
|
288
292
|
Settings are per-project. Each `<project>/.claude/settings.local.json` gets exactly the hooks the chosen mode needs — repeated `set` calls are idempotent.
|
|
@@ -312,7 +316,7 @@ TaskList may list this task, but not every environment does (the desktop app's C
|
|
|
312
316
|
`hook on` is now a thin alias for `mode turn` (with a one-line deprecation hint). To switch to real-time push:
|
|
313
317
|
|
|
314
318
|
```
|
|
315
|
-
/agmsg
|
|
319
|
+
/agmsg delivery monitor
|
|
316
320
|
```
|
|
317
321
|
|
|
318
322
|
The command updates `db/config.yaml`, rewrites the project's hook entries, and prints an `AGMSG-DIRECTIVE` that activates `monitor` in the current session — no agent restart needed.
|
|
@@ -326,11 +330,11 @@ The command updates `db/config.yaml`, rewrites the project's hook entries, and p
|
|
|
326
330
|
/agmsg history — message history
|
|
327
331
|
/agmsg team — list team members
|
|
328
332
|
/agmsg send <agent> <message> — send message
|
|
329
|
-
/agmsg
|
|
333
|
+
/agmsg delivery <agmsgd|monitor|turn|both|off> — switch delivery (alias: /agmsg mode)
|
|
330
334
|
/agmsg mode — show current mode
|
|
331
335
|
/agmsg actas <name> — switch to another role in this project (create if needed)
|
|
332
336
|
/agmsg drop <name> — remove a role from this project
|
|
333
|
-
/agmsg spawn <type> <name> — launch a new agent
|
|
337
|
+
/agmsg spawn <type> <name> — launch a new agent that takes <name> (supported types: see "Spawn a new agent")
|
|
334
338
|
/agmsg despawn <name> [--force] — tear down a member you spawned (graceful, or --force)
|
|
335
339
|
/agmsg hook on | off — legacy aliases (mode turn | off)
|
|
336
340
|
/agmsg version — show the installed version (git-describe provenance)
|
|
@@ -345,7 +349,7 @@ $agmsg — or /skills → agmsg
|
|
|
345
349
|
|
|
346
350
|
Codex supports `mode monitor` through an app-server bridge, plus `mode turn` and `mode off`.
|
|
347
351
|
|
|
348
|
-
> ⚠️ **Monitor mode changes how Codex starts — enable it knowing that.** Codex has no Monitor tool, so `mode monitor` prints a shell function that makes `codex` route through agmsg's monitor shim in your interactive shell. In monitor-mode projects the shim routes interactive launches through a bridge that turns incoming agmsg messages into turns on the current Codex thread; `codex exec` and non-monitor projects pass straight through to the real Codex. It depends on Codex app-server behavior and has a known limitation (orphans on TUI close — #149).
|
|
352
|
+
> ⚠️ **Monitor mode changes how Codex starts — enable it knowing that.** Codex has no Claude Code Monitor tool, so monitor (legacy) mode (`mode monitor`) prints a shell function that makes `codex` route through agmsg's monitor shim in your interactive shell. In monitor-mode projects the shim routes interactive launches through a bridge that turns incoming agmsg messages into turns on the current Codex thread; `codex exec` and non-monitor projects pass straight through to the real Codex. It depends on Codex app-server behavior and has a known limitation (orphans on TUI close — #149).
|
|
349
353
|
|
|
350
354
|
If you prefer a global PATH shim, run `~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-shim-install.sh install` and put `~/.agents/bin` before the real Codex binary on PATH. You can also launch with `~/.agents/skills/<cmd>/scripts/drivers/types/codex/codex-monitor.sh`. Codex sandboxing must allow writes to the skill's `db/`, `teams/`, and `run/` dirs — `install.sh` configures those `writable_roots` when `~/.codex/config.toml` exists. Setup notes and internals: [docs/codex-monitor-beta.md](docs/codex-monitor-beta.md).
|
|
351
355
|
|
|
@@ -383,7 +387,7 @@ See [docs/opencode.md](docs/opencode.md) for full setup instructions.
|
|
|
383
387
|
~/.agents/skills/<cmd>/scripts/reset.sh <project_path> <type> [agent_id]
|
|
384
388
|
```
|
|
385
389
|
|
|
386
|
-
`team.sh` combines the roster with terminal placement, activity, delivery mode, and identity consistency. Verified identity is collapsed to `identity=ok`; mismatches and values that could not be observed are expanded with their evidence. `--json` emits every field for every registration.
|
|
390
|
+
`team.sh` combines the roster with terminal placement, activity, delivery mode, and identity consistency. Verified identity is collapsed to `identity=ok`; mismatches and values that could not be observed are expanded with their evidence. `--json` emits every field for every registration. `team.sh` is read-only with respect to other seats: it reports an inconsistent or unresponsive seat but never repairs it from outside (the former `--fix`, `--fix-pane-names` and `--rename-sessions` flags were removed in #1152). A seat repairs its own identity cells by running `fix` from itself; one that cannot is despawned and restarted, or taken over by a person. Pane liveness will join this view when the pane-state contract lands; until then the unavailable column is omitted rather than filled with `unknown`.
|
|
387
391
|
|
|
388
392
|
`--delete` removes a team once every member has left (`leave.sh` each remaining one first) and the team is not actively synced (`binding_state=active` in `team-list.sh --json` refuses; `disconnected` proceeds with an extra warning) — its config, roster, identity history, and per-agent runtime state (actas locks, role-session records, spawn/placement records), but not its message history. `--force` (combined with `--delete`) removes every remaining member first, the same effect as running `leave.sh` for each, then deletes the team as `--delete` alone does — a team the desktop app created always has its app-user as a member, so it could never be deleted from the app without this; a `--force` confirmation names the members it will remove. `--purge-messages` deletes only a team's rows from the sqlite message store (jsonl is not supported yet) and can be used standalone or together with `--delete`; other teams' data is untouched. Both prompt for confirmation, in the same style as `uninstall.sh`'s, unless `--yes` is given.
|
|
389
393
|
|
|
@@ -397,7 +401,7 @@ Terminal identity has a different number of observable names on each backend. He
|
|
|
397
401
|
|
|
398
402
|
**Is this MCP? Do I need an MCP server?**
|
|
399
403
|
|
|
400
|
-
No. agmsg is standalone — `bash` + `sqlite3`, no server, no
|
|
404
|
+
No. agmsg is standalone — `bash` + `sqlite3`, no server, no network, and no daemon unless you choose the optional agmsgd. The two stacks are orthogonal: you can run agmsg alongside any MCP setup you already have.
|
|
401
405
|
|
|
402
406
|
**Concurrent writes to the same channel — do they conflict?**
|
|
403
407
|
|
|
@@ -455,6 +459,12 @@ git pull
|
|
|
455
459
|
|
|
456
460
|
DB and team configs are preserved. Only scripts and assets are updated.
|
|
457
461
|
|
|
462
|
+
### Upgrading from 1.5.x
|
|
463
|
+
|
|
464
|
+
`--update` does not enable agmsgd. If you have never run `agmsg daemon enable`, nothing changes: agmsgd stays off, and messaging keeps working exactly as it did on 1.5.x. If agmsgd is currently on, an update restarts it on the new version automatically; if `agmsg daemon status` still shows it stopped afterward, run `agmsg daemon start`. If you had turned it off yourself (`agmsg daemon disable`), it stays off through the update, as intended.
|
|
465
|
+
|
|
466
|
+
No running Codex session needs to be restarted just because you ran `--update`. Restarting a Codex session is only needed to pick up agmsgd itself — either turning it on for the first time (see "agmsgd beta" above) or dropping back to the bridge after `agmsg daemon disable`.
|
|
467
|
+
|
|
458
468
|
## Uninstall
|
|
459
469
|
|
|
460
470
|
An `uninstall.sh` copy ships inside every install, so this works whether you
|
|
@@ -545,6 +555,7 @@ sandbox_mode = "workspace-write"
|
|
|
545
555
|
writable_roots = [
|
|
546
556
|
"~/.agents/skills/agmsg/db",
|
|
547
557
|
"~/.agents/skills/agmsg/teams",
|
|
558
|
+
"~/.agents/skills/agmsg/run",
|
|
548
559
|
]
|
|
549
560
|
```
|
|
550
561
|
|
|
@@ -555,6 +566,7 @@ If you installed agmsg under a custom command name, adjust the path accordingly:
|
|
|
555
566
|
writable_roots = [
|
|
556
567
|
"~/.agents/skills/m/db",
|
|
557
568
|
"~/.agents/skills/m/teams",
|
|
569
|
+
"~/.agents/skills/m/run",
|
|
558
570
|
]
|
|
559
571
|
```
|
|
560
572
|
|
|
@@ -567,9 +579,10 @@ writable_roots = [
|
|
|
567
579
|
]
|
|
568
580
|
```
|
|
569
581
|
|
|
570
|
-
Codex
|
|
571
|
-
Monitor tool. The sandbox allowlist is
|
|
572
|
-
manual `$agmsg` commands
|
|
582
|
+
Codex supports `mode monitor` (legacy) through the app-server bridge, plus `mode turn`
|
|
583
|
+
and `mode off`; it just has no Claude Code Monitor tool. The sandbox allowlist is
|
|
584
|
+
required for writes performed by manual `$agmsg` commands, turn-end inbox checks and
|
|
585
|
+
the bridge.
|
|
573
586
|
|
|
574
587
|
Some Codex runtimes or automations may inject a managed permission profile for a
|
|
575
588
|
single run. In that case, the run-specific writable roots must also include the
|
|
@@ -593,6 +606,7 @@ bats tests/ # requires bats-core: brew install bats-core
|
|
|
593
606
|
│ └── drivers/types/<name>/ # Built-in agent-type drivers (manifest + runtime)
|
|
594
607
|
├── plugins/<axis>/<name>/ # External drivers you opt into (agmsg plugin trust)
|
|
595
608
|
├── db/messages.db # SQLite WAL-mode message store
|
|
609
|
+
├── run/ # Runtime state: pidfiles, actas locks, agmsgd install record
|
|
596
610
|
└── teams/ # Team configs (self-contained)
|
|
597
611
|
└── <team>/
|
|
598
612
|
└── config.json
|
|
@@ -601,8 +615,8 @@ bats tests/ # requires bats-core: brew install bats-core
|
|
|
601
615
|
- **Storage**: Single SQLite file with WAL mode
|
|
602
616
|
- **Concurrency**: Multiple readers + 1 writer, no conflicts
|
|
603
617
|
- **Dependencies**: `bash`, `sqlite3` (no Python required)
|
|
604
|
-
- **Auto detection**: Stop hook checks inbox after each response (60s cooldown, configurable via `
|
|
605
|
-
- **No daemon**:
|
|
618
|
+
- **Auto detection**: Stop hook checks inbox after each response (60s cooldown, configurable via `delivery.turn.check_interval`)
|
|
619
|
+
- **No daemon required**: direct filesystem access (the optional agmsgd is a resident service you choose)
|
|
606
620
|
- **No network**: Everything local
|
|
607
621
|
|
|
608
622
|
## Plugins
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agmsg",
|
|
3
|
-
"version": "1.6.0-rc.
|
|
3
|
+
"version": "1.6.0-rc.10",
|
|
4
4
|
"description": "Cross-agent messaging via SQLite for CLI AI agents (Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, Antigravity, OpenCode). The npm package is a thin bootstrapper that fetches and runs the canonical bash installer at https://github.com/fujibee/agmsg.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agmsg": "bin/agmsg.js"
|