agmsg 1.0.2 → 1.0.4

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 ADDED
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.4] - 2026-06-15
8
+
9
+ ### Added
10
+ - Record git-describe provenance version (/agmsg version) (#122)
11
+ - Add native Windows agmsg helpers (#103)
12
+ - Readiness handshake by default (status=ready / --no-wait / --ready-timeout) (#113)
13
+ - Launch a new agent into tmux/terminal and auto-actas (#105)
14
+
15
+ ### Fixed
16
+ - Busy_timeout on all DB connections — concurrent writes no longer drop (SQLITE_BUSY) (#115)
17
+ - Make the `monitor` mode and `delivery.sh set` work under Claude Code's sandboxed Bash tool (#106)
18
+ - Persist per-session watermark so restarts don't drop messages (#107) (#111)
19
+ - Resolve session's real project from subdir/worktree (#92) (#110)
20
+
21
+ ### Documentation
22
+ - Show all four install paths (#90)
23
+
24
+ ## [1.0.3] - 2026-06-11
25
+
26
+ ### Fixed
27
+ - Download setup.sh to a tempfile instead of piping curl into bash (#98) (#100)
28
+ - Refuse interactive prompt when stdin is not a tty (#98) (#99)
29
+ - Avoid E2BIG on large settings.local.json (#95) (#97)
30
+
31
+ ### Documentation
32
+ - README + agmsg.cc rework for PH-launch traffic conversion (#94)
33
+
34
+ ## [1.0.2] - 2026-06-08
35
+
36
+ ### Added
37
+ - Add CLI type auto-detection (#69)
38
+ - Add .claude-plugin/ manifests for Claude Code plugin marketplace (#81)
39
+ - Add GitHub Copilot CLI support (turn mode) (#74)
40
+ - Actas exclusivity lock — fix same-team multi-identity message leakage (#62) (#65)
41
+ - Override message store path via AGMSG_STORAGE_PATH (#59)
42
+ - Add support for gemini and antigravity (agy) agents (#45)
43
+
44
+ ### Fixed
45
+ - Unblock npm Trusted Publisher OIDC + bin path
46
+ - Support native Windows (Git Bash + Codex hooks) (#73)
47
+ - Scope set turn/off watcher kill to the target project (#86)
48
+ - SKILL.md self-bootstrap and substitute name placeholder (#83) (#85)
49
+
50
+ ### Documentation
51
+ - Add PRIVACY.md (required by Anthropic community marketplace submission) (#82)
52
+ - Handle empty TaskList explicitly to stop fresh-session loop (#71)
53
+ - Storage driver pluginization design (epic #51) (#52)
54
+
55
+ [1.0.4]: https://github.com/fujibee/agmsg/compare/v1.0.3...v1.0.4
56
+ [1.0.3]: https://github.com/fujibee/agmsg/compare/v1.0.2...v1.0.3
57
+ [1.0.2]: https://github.com/fujibee/agmsg/releases/tag/v1.0.2
58
+
package/README.md CHANGED
@@ -2,7 +2,24 @@
2
2
 
3
3
  Cross-agent messaging for CLI AI agents. No daemon, no network, no complexity.
4
4
 
5
- Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, and any CLI agent can message each other via a shared SQLite database.
5
+ <a href="https://www.producthunt.com/products/agmsg?utm_source=badge-top-post-badge&utm_medium=badge" target="_blank">
6
+ <picture>
7
+ <source media="(prefers-color-scheme: dark)"
8
+ srcset="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1165435&theme=dark&period=daily">
9
+ <img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=1165435&theme=light&period=daily"
10
+ alt="agmsg — #5 Product of the Day on Product Hunt" width="250" height="54">
11
+ </picture>
12
+ </a>
13
+
14
+ You stop being the copy-paste courier between your agents. Claude Code, Codex, Gemini CLI, GitHub Copilot CLI, and any other CLI agent message each other directly through a shared local SQLite database — no human in the middle.
15
+
16
+ **What it isn't:**
17
+
18
+ - Not MCP. No MCP server, no extra runtime — just `bash` + `sqlite3`.
19
+ - Not subagents. agmsg connects *peer* sessions across different tools. `spawn` can launch a new peer agent in its own terminal, but it's an independent session you talk to over agmsg — not a child process this one manages.
20
+ - Not a message queue. There's no broker. The SQLite file is the floor; agents are the players.
21
+
22
+ ## Demo
6
23
 
7
24
  Two `monitor`-mode Claude Code instances, 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:
8
25
 
@@ -14,6 +31,8 @@ In real use it looks like this — Claude Code asking Codex for a code review an
14
31
 
15
32
  ## Quick Start
16
33
 
34
+ **Requires:** `bash` and `sqlite3`. macOS ships both. On a minimal Linux box (some Debian/Ubuntu containers, Alpine) you may need to install `sqlite3` first — `sudo apt-get install -y sqlite3` or your distro's equivalent.
35
+
17
36
  ```bash
18
37
  # 1. Install (one-liner)
19
38
  bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh)
@@ -30,13 +49,52 @@ git clone https://github.com/fujibee/agmsg.git && cd agmsg && ./install.sh
30
49
  # Antigravity: $agmsg
31
50
  ```
32
51
 
33
- That's it. Once two agents have joined the same team, they can message each other. On first join, you'll be asked to pick a **delivery mode** — see [Delivery modes](#delivery-modes) below for the four options. The default on Claude Code is `monitor` (real-time push); Codex defaults to `turn` (between-turns check) because it has no Monitor tool.
52
+ That's it. The slash command prompts you for a team name and an agent name on first use, then asks you to pick a [delivery mode](#delivery-modes) (default on Claude Code: `monitor` — real-time push; Codex defaults to `turn` because it has no Monitor tool). After that, you talk to your agent naturally — see [First run](#first-run) below.
34
53
 
35
- After setup, your agent handles everything — just talk to it naturally. "Send alice a message saying the deploy is done", "check my messages", "who's on the team" all work. The shell scripts below are for reference and advanced use.
54
+ Prefer a different install method? See [Install](#install) below for `npm` / `npx` and the Claude Code plugin marketplace paths.
55
+
56
+ ## How it works
57
+
58
+ 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. There is no daemon, no socket, no broker — the file is the shared floor and the agents take turns on it.
59
+
60
+ 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.
36
61
 
37
62
  ## Install
38
63
 
64
+ agmsg ends up at `~/.agents/skills/agmsg/` no matter which install path you take. Pick whichever fits your setup.
65
+
66
+ **Which path gets the latest?** The `git clone` and `setup.sh` (curl) paths install straight from `main`, so they're always current. The **npm package and the Claude Code plugin are cut from tagged releases on a cadence**, so they can lag `main` by a few fixes — fine for almost everyone, but if you specifically want a just-merged change, clone the repo. You can always check exactly what you're running with `/agmsg version` (or `scripts/version.sh`): a tagged release reads like `v1.0.3`, while a checkout ahead of the last release reads like `v1.0.3-6-g1a2b3c4` (6 commits past `v1.0.3`).
67
+
68
+ ### npm / npx
69
+
70
+ ```bash
71
+ npx agmsg # one-shot, no global install
72
+ # or
73
+ npm i -g agmsg && agmsg install
74
+ ```
75
+
76
+ The npm package is a thin bootstrapper that downloads and runs the canonical `setup.sh`. Published from this repo via [npm Trusted Publisher (OIDC)](https://docs.npmjs.com/trusted-publishers) with [SLSA provenance](https://slsa.dev/) — the attestation is visible at <https://www.npmjs.com/package/agmsg>.
77
+
78
+ ### Claude Code plugin marketplace
79
+
80
+ Inside Claude Code:
81
+
82
+ ```
83
+ /plugin marketplace add fujibee/agmsg
84
+ /plugin install agmsg@fujibee-agmsg
85
+ /reload-plugins
86
+ /agmsg
87
+ ```
88
+
89
+ The plugin install path drops the skill into `~/.claude/plugins/cache/`; the first invocation of `/agmsg` runs a bootstrap that populates `~/.agents/skills/agmsg/` (database, scripts, team registry) so the runtime is identical to a script install. If your environment lacks `sqlite3` (some minimal Linux containers don't ship it by default), the bootstrap will surface a clear error message — install `sqlite3` and re-invoke `/agmsg`.
90
+
91
+ ### Direct script
92
+
93
+ Clone the repo first, then run the installer — this is also the path that always tracks the latest `main`:
94
+
39
95
  ```bash
96
+ git clone https://github.com/fujibee/agmsg.git
97
+ cd agmsg
40
98
  ./install.sh # Interactive (asks command name, default: agmsg)
41
99
  ./install.sh --cmd m # Non-interactive with custom command name
42
100
  ./install.sh --agent-type gemini # Install a Gemini-oriented SKILL.md
@@ -44,55 +102,57 @@ After setup, your agent handles everything — just talk to it naturally. "Send
44
102
 
45
103
  The **command name** determines:
46
104
  - Skill folder: `~/.agents/skills/<cmd>/`
47
- - Claude Code: `/<cmd>`
48
- - Codex/Gemini/Antigravity: `$<cmd>`
105
+ - Claude Code / Copilot CLI: `/<cmd>`
106
+ - Codex / Gemini CLI / Antigravity: `$<cmd>`
49
107
 
50
- After install, **restart your agent** (Claude Code / Codex / Gemini CLI / Antigravity) so it picks up the new skill.
108
+ `--cmd` and `--agent-type` are only available via the direct-script path; the `npm` and plugin paths always install as `agmsg` and auto-detect the host agent type.
51
109
 
52
- ## Join a Team
110
+ After install, **restart your agent** (Claude Code / Codex / Gemini CLI / Copilot CLI / Antigravity) so it picks up the new skill.
53
111
 
54
- Agents join teams by **identity**: `(agent name, team)`. Projects are stored as registration metadata, so the same agent can re-join from multiple projects without creating duplicate identities. The easiest way:
112
+ ### Native Windows / PowerShell shortcut
55
113
 
56
- 1. Open Claude Code in your project
57
- 2. Run `/<cmd>` (e.g. `/agmsg`)
58
- 3. It detects you're not in a team and asks for team name and agent name
114
+ When `install.sh` runs under Git Bash on Windows, it also installs optional native helpers:
59
115
 
60
- Or join manually:
116
+ - `~/.agents/agmsg.ps1` — a PowerShell function wrapper
117
+ - `~/.agents/agmsg-run.sh` — the Git Bash runner used by that wrapper
118
+ - `~/.agents/bin/sqlite3` — a compatibility shim for Windows `sqlite3.exe` output
61
119
 
62
- ```bash
63
- ~/.agents/skills/agmsg/scripts/join.sh myteam alice claude-code /path/to/project
120
+ To enable the PowerShell command, dot-source the generated file from your PowerShell profile:
121
+
122
+ ```powershell
123
+ . "$HOME\.agents\agmsg.ps1"
64
124
  ```
65
125
 
66
- To leave a team:
126
+ Then a PowerShell session can run:
67
127
 
68
- ```bash
69
- ~/.agents/skills/agmsg/scripts/leave.sh myteam alice
128
+ ```powershell
129
+ agmsg
130
+ agmsg history
131
+ agmsg team
132
+ agmsg send alice "hello from PowerShell"
133
+ agmsg mode turn
70
134
  ```
71
135
 
72
- To rename a team (moves the team dir, updates `config.json`, migrates messages):
136
+ The installer prints the same profile line but does not modify your profile automatically.
73
137
 
74
- ```bash
75
- ~/.agents/skills/agmsg/scripts/rename-team.sh oldteam newteam
76
- ```
138
+ ## First run
77
139
 
78
- **Effect on existing members:** all agents in the team keep their registrations
79
- and message history — only the team name changes. However, any session that has
80
- already cached the team name (e.g. a running `/agmsg` Claude Code session) will
81
- continue to use the old name until it re-resolves identity. After a rename,
82
- each member should re-run `whoami` from their project to pick up the new name:
140
+ Open your project in your agent (Claude Code, Codex, Gemini CLI, etc.) and run:
83
141
 
84
- ```bash
85
- ~/.agents/skills/agmsg/scripts/whoami.sh "$(pwd)" claude-code
142
+ ```
143
+ /agmsg # Claude Code, Copilot CLI
144
+ $agmsg # Codex, Gemini CLI, Antigravity
86
145
  ```
87
146
 
88
- ### Multiple identities
147
+ On first use it asks for a **team name** (joins an existing team or creates a new one) and an **agent name** for this project — that's the whole onboarding. After that, talk to your agent naturally:
89
148
 
90
- You can join the same project with multiple agent names (e.g. `cc` and `reviewer`). When the command detects multiple identities, it asks which one to use for the session.
149
+ - *"send alice a message saying the deploy is done"*
150
+ - *"check my messages"*
151
+ - *"who's on the team"*
91
152
 
92
- ```bash
93
- ~/.agents/skills/agmsg/scripts/join.sh myteam cc claude-code /path/to/project
94
- ~/.agents/skills/agmsg/scripts/join.sh myteam reviewer claude-code /path/to/project
95
- ```
153
+ The agent picks the right subcommand and runs it for you. You don't need to memorize anything below — the script reference further down is for automation, scripts, and CI.
154
+
155
+ For renaming a team, leaving, joining the same team from a second project, or clearing a project's registrations, see [docs/teams.md](docs/teams.md).
96
156
 
97
157
  ### Multiple roles per project (`actas` / `drop`)
98
158
 
@@ -104,40 +164,26 @@ Same project, same agent type, different role — for example a `tech-lead` iden
104
164
  /agmsg drop biz-analyst # remove the role from this project
105
165
  ```
106
166
 
107
- Mechanics:
167
+ `actas <name>` is **exclusive across sessions**: it switches both sending and receiving to `<name>`, claims a lock that stops peer sessions from subscribing to the same name, and refuses if another session already holds it. `drop` releases the lock. If a lock gets stuck, drop the role from the holding session or end that session.
108
168
 
109
- - `actas <name>` is **exclusive across sessions**: switches both sending and receiving to `<name>`. The skill joins the role under your current team if needed, claims an exclusivity lock on `(team, name)` under the skill's run directory, then TaskStops the running `agmsg inbox stream` Monitor and relaunches one filtered to `<name>` only (via `watch.sh`'s optional 4th argument). Two effects: messages addressed to other roles stop reaching this session, and other live sessions also stop subscribing to `<name>` (their watchers exclude any pair locked by a peer at startup). If another session already holds the lock, the call refuses with a clear error — drop it from that session first. The lock is released by `drop`, by session end, or by garbage collection when the holding session is no longer alive.
110
- - `drop <name>` removes only that role's registration for this project (via `reset.sh`). If the role is no longer registered anywhere, it's also dropped from the team config. If `<name>` was the currently-active role, the watcher is restarted in default mode — no `actas` name filter, so it receives every (team, agent) pair registered for this project that isn't held by another session.
111
- - Switching is session-scoped state held by the agent. `/clear` or a new session resets back to the multiple-identities picker.
112
- - **Recovery**: `actas-claim.sh` writes the lock file before the skill TaskStops the old Monitor and launches the new one. If that subsequent dance fails (e.g. TaskStop succeeds but the new Monitor invocation errors out), the lock stays put but the session has no narrowed watcher. Run `/agmsg drop <name>` in this session, or end the session — either releases the lock so peers can pick it up.
113
- - **Liveness**: a stale lock is reclaimed when its owner session_id no longer maps to any live cc-instance, where "live" is checked via `kill -0`. PID recycling could in theory keep a long-dead session looking alive forever (and starve peers from claiming or reaching its name); this is tracked in [#67](https://github.com/fujibee/agmsg/issues/67) and not addressed in v1.
114
- - **Codex caveat**: on Codex, `$agmsg actas <name>` is **send-side only** for this session. Codex slash commands don't see a stable `session_id`, so they can't claim a peer-visible exclusivity lock — Claude Code peers will still subscribe to `<name>`. The receive side isn't actually narrowed either: `check-inbox.sh` resolves identity through `whoami.sh` (which picks the first registered agent) and has no view of the agent's in-session actas role, so Codex keeps polling whichever pair it would have without actas. The check-inbox lock filter only skips pairs *another* session owns. Treat Codex actas as a from-line override until a Codex session-id story exists. Claude Code's `/agmsg actas` does claim the lock symmetrically and is the path that exercises the full exclusivity model.
169
+ See [docs/actas.md](docs/actas.md) for the full mechanics — exclusivity model, recovery, liveness / PID recycling, Codex caveat.
115
170
 
116
- #### Subscription model
171
+ ### Spawn a new agent (`spawn`)
117
172
 
118
- agmsg follows a **one CC session = one active role** model. Each watcher subscribes to a *static* set of identities decided at launch:
173
+ Where `actas` switches *this* session to a different role, `spawn` brings up a **separate agent process** that takes a role on boot — handy for fanning out collaborators.
119
174
 
120
- - **Without `actas`**: the watcher subscribes to whichever `(team, agent)` pairs were registered for this `(project, agent_type)` at the moment `watch.sh` started, *minus* any pair currently locked by another live session's `actas` claim. The set is *not* re-resolved later — a peer that claims a name after this watcher launched will start receiving exclusively, but this watcher won't notice the loss until it restarts. A role joined mid-session via `actas` from another CC does *not* start arriving in CCs that were launched before it.
121
- - **After `actas <name>`**: the watcher is relaunched filtered to `<name>` only, and the lock that filter implies prevents peer watchers from ever subscribing to `<name>` while this session is live.
122
-
123
- This is intentional: it keeps each CC bound to one role's inbox, so a `tech-lead` window stays clear of `biz-analyst` traffic and vice versa, and the exclusivity holds across sessions on the same machine rather than per-session. To pick up a role added after a CC launched (without switching to it exclusively), restart the CC or `/clear` so SessionStart re-launches `watch.sh` with the fresh identity list — and with the up-to-date lock view.
124
-
125
- The send side mirrors this: every `send.sh` call from this CC uses the active role as the `from` agent, whether that's the implicit one (default) or the one set by the most recent `actas`.
126
-
127
- ### Reusing the same identity across projects
175
+ ```
176
+ /agmsg spawn codex reviewer # new codex agent, joins and becomes "reviewer"
177
+ /agmsg spawn claude-code alice --window # new claude-code agent in a fresh tmux window
178
+ ```
128
179
 
129
- If you join the same team with the same agent name from another project, agmsg keeps the same identity and adds a registration record for the new project.
180
+ `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.
130
181
 
131
- ```bash
132
- ~/.agents/skills/agmsg/scripts/join.sh myteam alice claude-code /path/to/project-a
133
- ~/.agents/skills/agmsg/scripts/join.sh myteam alice claude-code /path/to/project-b
134
- ```
182
+ 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 Monitor).
135
183
 
136
- If you want to clear the current project's registrations without leaving the team identity entirely:
184
+ Options: `--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.
137
185
 
138
- ```bash
139
- ~/.agents/skills/agmsg/scripts/reset.sh /path/to/project-b claude-code
140
- ```
186
+ Only `claude-code` and `codex` are supported today. macOS is the primary target; Linux and Windows are best-effort (please open an issue/PR if your terminal isn't handled). Headless environments — no tmux **and** no usable terminal — error out, since the agent CLIs need an interactive terminal.
141
187
 
142
188
  ## Delivery modes
143
189
 
@@ -162,6 +208,8 @@ How incoming messages reach your agent. Pick one at first join via the prompt, o
162
208
 
163
209
  Settings are per-project. Each `<project>/.claude/settings.local.json` gets exactly the hooks the chosen mode needs — repeated `set` calls are idempotent.
164
210
 
211
+ **Monitor priming**: in `monitor` mode, the receiving agent doesn't react to its first inbound message until it has taken at least one turn this session. If you've just started a fresh session and a teammate has already sent something, nudge the agent with any short message ("hi") to prime it — subsequent messages stream in real time.
212
+
165
213
  ### Migrating from legacy `hook on/off`
166
214
 
167
215
  `hook on` is now a thin alias for `mode turn` (with a one-line deprecation hint). To switch to real-time push:
@@ -185,7 +233,9 @@ The command updates `db/config.yaml`, rewrites the project's hook entries, and p
185
233
  /agmsg mode — show current mode
186
234
  /agmsg actas <name> — switch to another role in this project (create if needed)
187
235
  /agmsg drop <name> — remove a role from this project
236
+ /agmsg spawn <type> <name> — launch a new agent (claude-code/codex) that takes <name>
188
237
  /agmsg hook on | off — legacy aliases (mode turn | off)
238
+ /agmsg version — show the installed version (git-describe provenance)
189
239
  /agmsg reset — clear current project registration
190
240
  ```
191
241
 
@@ -203,11 +253,7 @@ Codex supports `mode turn` and `mode off` only — there's no Monitor tool to st
203
253
  /agmsg — invokes the agmsg skill
204
254
  ```
205
255
 
206
- The Copilot installer drops a `SKILL.md` at `~/.copilot/skills/agmsg/` so
207
- `/agmsg` is auto-discovered. Per-project hooks live at
208
- `<project>/.github/hooks/agmsg.json`. Copilot CLI has no Monitor-tool
209
- equivalent, so only `mode turn` and `mode off` are supported. Asking for
210
- `monitor` or `both` is rejected with an error.
256
+ The Copilot installer drops a `SKILL.md` at `~/.copilot/skills/agmsg/` so `/agmsg` is auto-discovered. Per-project hooks live at `<project>/.github/hooks/agmsg.json`. Copilot CLI has no Monitor-tool equivalent, so only `mode turn` and `mode off` are supported. Asking for `monitor` or `both` is rejected with an error.
211
257
 
212
258
  ### Shell (any agent)
213
259
 
@@ -222,8 +268,52 @@ equivalent, so only `mode turn` and `mode off` are supported. Asking for
222
268
  ~/.agents/skills/<cmd>/scripts/reset.sh <project_path> <type> [agent_id]
223
269
  ```
224
270
 
271
+ `send.sh` takes exactly four positional arguments: `<team> <from> <to> "<message>"`. Quote the message so the shell sees it as one argument; an unquoted message with spaces will be misparsed.
272
+
225
273
  `hook.sh on|off` still works as a legacy alias for `delivery.sh set turn|off` but prints a deprecation notice.
226
274
 
275
+ ## FAQ / Design notes
276
+
277
+ **Is this MCP? Do I need an MCP server?**
278
+
279
+ No. agmsg is standalone — `bash` + `sqlite3`, no server, no daemon, no network. The two stacks are orthogonal: you can run agmsg alongside any MCP setup you already have.
280
+
281
+ **Concurrent writes to the same channel — do they conflict?**
282
+
283
+ The store is SQLite in WAL mode. Multiple readers and a single writer coexist; writes are short and serialized at the file level. In practice, two agents sending into the same team don't collide.
284
+
285
+ **Does SQLite guarantee turn order? Is there a lock or token?**
286
+
287
+ SQLite guarantees the ordering of the log itself — every row has a monotonic id and timestamp. Turn-taking between agents is a protocol-level concern, not enforced by the transport. The floor is intentionally dumb; the protocol lives in your prompts.
288
+
289
+ **Two Claude Code instances grab the same task — claim/lock?**
290
+
291
+ Not in v1. If two agents are subscribed to the same name, both see the same inbound message, and you'd need a protocol-level claim/lease to decide who acts. A claim table is on the roadmap; the `actas` exclusivity lock already prevents two *sessions* from holding the same role at once, which covers the most common form of this.
292
+
293
+ **Runaway loops — where does the stop condition live?**
294
+
295
+ At the protocol/prompt level, not the transport. Common pattern: include a max-turns or explicit done-signal instruction in the kickoff prompt ("stop after N exchanges", "reply DONE when complete"). agmsg won't cut a conversation off for you.
296
+
297
+ **What's carried on a handoff — context, diffs, or just text?**
298
+
299
+ Plain text. Messages are short — a sentence, a request, a path. Agents pass *summaries and references* (file paths, commit SHAs, issue numbers), not raw context. Transport is the message; semantic packing is up to the prompt.
300
+
301
+ **What if the output exceeds the receiver's context window?**
302
+
303
+ Use the summary + file-reference pattern: write the artifact to disk, send a one-line pointer. The DB stores messages, not files.
304
+
305
+ **Does it hold up with more than 2 agents?**
306
+
307
+ Yes. Teams are N-agent. The demo is 2 for clarity; larger rooms work the same way — we run our own 8-agent team on it.
308
+
309
+ **Does context persist across sessions?**
310
+
311
+ Yes. Messages live in SQLite and survive sessions. `history.sh <team>` replays the room.
312
+
313
+ **Can I re-seed a fresh agent from an old room?**
314
+
315
+ The message store is effectively a replay log. There's no one-shot "rehydrate from room X" command yet, but `history.sh` gives you the transcript and you can prompt a new agent with it. Treat persistence as the unlock that makes that possible.
316
+
227
317
  ## Update
228
318
 
229
319
  ```bash
@@ -259,6 +349,28 @@ The message store path resolves as **`AGMSG_STORAGE_PATH` (env) > built-in defau
259
349
  AGMSG_STORAGE_PATH=/tmp/agmsg-sandbox ./scripts/send.sh myteam alice bob "hi"
260
350
  ```
261
351
 
352
+ ### Sandbox compatibility (Claude Code)
353
+
354
+ Claude Code's sandbox restricts filesystem writes to the project directory. In `monitor` mode, `watch.sh` runs inside the sandbox and needs to write pidfiles and SQLite WAL files under `~/.agents/skills/agmsg/`. If you have sandboxing enabled, add an allowlist entry to your settings:
355
+
356
+ **`~/.claude/settings.json`** (user-level — applies to all projects):
357
+
358
+ ```json
359
+ {
360
+ "sandbox": {
361
+ "filesystem": {
362
+ "allowWrite": [
363
+ "~/.agents/skills/agmsg/"
364
+ ]
365
+ }
366
+ }
367
+ }
368
+ ```
369
+
370
+ This can also go in project-level `.claude/settings.local.json` if you prefer per-project scope. The allowlist merges across all settings scopes and takes effect immediately — no restart needed.
371
+
372
+ If you installed agmsg under a custom command name (e.g. `m`), adjust the path accordingly (`~/.agents/skills/m/`).
373
+
262
374
  ## Tests
263
375
 
264
376
  ```bash
@@ -282,15 +394,23 @@ bats tests/ # requires bats-core: brew install bats-core
282
394
 
283
395
  - **Storage**: Single SQLite file with WAL mode
284
396
  - **Concurrency**: Multiple readers + 1 writer, no conflicts
285
- - **Dependencies**: bash, sqlite3 (no python3 required)
286
- - **Auto detection**: Stop hook checks inbox after each response (60s cooldown)
397
+ - **Dependencies**: `bash`, `sqlite3` (no Python required)
398
+ - **Auto detection**: Stop hook checks inbox after each response (60s cooldown, configurable via `hook.check_interval`)
287
399
  - **No daemon**: Direct filesystem access
288
400
  - **No network**: Everything local
289
401
 
402
+ ## Community
403
+
404
+ - **Product Hunt**: #5 Product of the Day, [2026-06-09 launch](https://www.producthunt.com/products/agmsg) — 219 upvotes, 39 comments
405
+ - **Derivative projects**: `agmsg-shogi`, `agmsg-go`, `agmsg-mcp` (community-built)
406
+ - **External contributors**: [@MiuraKatsu](https://github.com/MiuraKatsu) (Gemini support + whoami auto-detect), [@roundrop](https://github.com/roundrop) (Copilot CLI support), [@TOMONOSUKEJP](https://github.com/TOMONOSUKEJP) (native Windows / Git Bash), [@kenshin-yamada](https://github.com/kenshin-yamada) (watcher scoping fix), [@utenadev](https://github.com/utenadev) (OpenCode contribution), [@lucianlamp](https://github.com/lucianlamp) (native Windows PowerShell helpers), [@tatsuya6502](https://github.com/tatsuya6502) (sandboxed Bash tool support)
407
+
290
408
  ## Contributing
291
409
 
292
410
  See [Design & Architecture](docs/design.md) for developer documentation — identity model, data storage, hook system, and script responsibilities.
293
411
 
412
+ If agmsg saves you copy-paste round-trips, a GitHub star helps other people find it.
413
+
294
414
  ## License
295
415
 
296
416
  MIT
package/bin/agmsg.js CHANGED
@@ -8,10 +8,17 @@
8
8
  // installer maintained at https://github.com/fujibee/agmsg.
9
9
  //
10
10
  // All real installation, configuration, and runtime logic lives in the
11
- // upstream repo. This bootstrapper just runs:
11
+ // canonical setup.sh. This bootstrapper fetches that script to a tempfile
12
+ // and exec's it directly — equivalent to the README's
12
13
  //
13
14
  // bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh)
14
15
  //
16
+ // form, which is process-substitution and preserves the user's tty as
17
+ // stdin. We deliberately do NOT pipe the curl output into bash: piping
18
+ // makes the installer's stdin the wrapper script stream, and install.sh's
19
+ // interactive command-name prompt would `read -r` the next line of
20
+ // setup.sh as the command name. See agmsg #98.
21
+ //
15
22
  // Subcommands:
16
23
  // install Fetch and run the canonical setup.sh (default if no args).
17
24
  // --help Print this message and exit 0.
@@ -19,6 +26,7 @@
19
26
 
20
27
  const { spawnSync } = require('child_process');
21
28
  const fs = require('fs');
29
+ const os = require('os');
22
30
  const path = require('path');
23
31
 
24
32
  const SETUP_URL = 'https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh';
@@ -57,24 +65,48 @@ function printHelp() {
57
65
  ].join('\n'));
58
66
  }
59
67
 
60
- function runInstaller() {
61
- // We deliberately invoke `bash -c "curl ... | bash"` rather than piping
62
- // through Node's HTTP stack. The canonical installer is bash; that's the
63
- // path upstream tests and supports. We pass `-fsSL` so curl fails on
64
- // HTTP errors rather than piping an error page into bash.
65
- const cmd = 'curl -fsSL "' + SETUP_URL + '" | bash';
66
- const result = spawnSync('bash', ['-c', cmd], { stdio: 'inherit' });
67
- if (result.error) {
68
- console.error('agmsg: failed to launch bash:', result.error.message);
69
- process.exit(1);
68
+ function runInstaller(passthroughArgs) {
69
+ // Fetch the canonical setup.sh to a private tempdir, then exec it directly
70
+ // with bash. This keeps the installer's stdin wired to the parent process's
71
+ // tty rather than a pipe stream — which matters because install.sh has an
72
+ // interactive `Command name [agmsg]:` prompt that would otherwise read the
73
+ // next line of setup.sh as the command name. See agmsg #98 for the full
74
+ // diagnosis. install.sh now guards itself with `[ -t 0 ]` (PR #99), so this
75
+ // bootstrapper plus a still-vulnerable install.sh would also work; doing it
76
+ // correctly here is defense-in-depth and lets future interactive prompts
77
+ // in setup.sh keep working for real-tty users.
78
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agmsg-bootstrap-'));
79
+ const setupPath = path.join(tmpDir, 'setup.sh');
80
+
81
+ try {
82
+ const fetch = spawnSync('curl', ['-fsSL', '-o', setupPath, SETUP_URL], { stdio: 'inherit' });
83
+ if (fetch.error) {
84
+ console.error('agmsg: failed to launch curl:', fetch.error.message);
85
+ process.exit(1);
86
+ }
87
+ if (fetch.status !== 0) {
88
+ console.error('agmsg: curl exited ' + fetch.status + ' fetching ' + SETUP_URL);
89
+ process.exit(fetch.status || 1);
90
+ }
91
+
92
+ const result = spawnSync('bash', [setupPath, ...passthroughArgs], { stdio: 'inherit' });
93
+ if (result.error) {
94
+ console.error('agmsg: failed to launch bash:', result.error.message);
95
+ process.exit(1);
96
+ }
97
+ process.exit(result.status === null ? 1 : result.status);
98
+ } finally {
99
+ try { fs.rmSync(tmpDir, { recursive: true, force: true }); } catch (_) { /* best-effort */ }
70
100
  }
71
- process.exit(result.status === null ? 1 : result.status);
72
101
  }
73
102
 
74
103
  const args = process.argv.slice(2);
75
104
 
76
105
  if (args.length === 0 || args[0] === 'install') {
77
- runInstaller();
106
+ // Forward anything after `install` (e.g. `agmsg install --cmd m`) to
107
+ // setup.sh, which passes "$@" through to install.sh.
108
+ const passthrough = args[0] === 'install' ? args.slice(1) : args;
109
+ runInstaller(passthrough);
78
110
  } else if (args[0] === '--help' || args[0] === '-h' || args[0] === 'help') {
79
111
  printHelp();
80
112
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agmsg",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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"
@@ -37,6 +37,7 @@
37
37
  "files": [
38
38
  "bin/",
39
39
  "README.md",
40
+ "CHANGELOG.md",
40
41
  "LICENSE"
41
42
  ]
42
43
  }