agmsg 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ All notable changes to this project are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.0.6] - 2026-06-21
8
+
9
+ ### Added
10
+ - Codex monitor bridge (beta) — app-server bridge + re-arm + fresh-session launch (#41) (#148)
11
+ - Add OpenCode as a supported agent type (#136)
12
+
13
+ ### Fixed
14
+ - Pin install to the bootstrapper's version, not main (#173)
15
+ - Engage the monitor bridge on codex 0.141 (ws transport + loaded-thread discovery) (#174)
16
+ - Escape hook command values via json_object (#175)
17
+ - Stop orphaned watch.sh from advancing the shared watermark past undelivered messages (#145)
18
+ - Resolve Codex thread by physical path so symlinked project paths match (#160) (#164)
19
+ - Validate writefile() byte count, not just sqlite3 exit code (#166)
20
+ - Pass sqlite3 -escape off so the char(31) separator stays raw (#165)
21
+ - Write hook files with writefile() to avoid sqlite3 caret-escaping (#158)
22
+ - Validate team names to prevent teams/ path traversal (#147)
23
+
24
+ ### Documentation
25
+ - Worker guardrails + empty-poll OOM case study (#163) (#167)
26
+ - Add llms.txt for AI-agent orientation (#155)
27
+
7
28
  ## [1.0.5] - 2026-06-17
8
29
 
9
30
  ### Added
@@ -61,6 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
61
82
  - Handle empty TaskList explicitly to stop fresh-session loop (#71)
62
83
  - Storage driver pluginization design (epic #51) (#52)
63
84
 
85
+ [1.0.6]: https://github.com/fujibee/agmsg/compare/v1.0.5...v1.0.6
64
86
  [1.0.5]: https://github.com/fujibee/agmsg/compare/v1.0.4...v1.0.5
65
87
  [1.0.4]: https://github.com/fujibee/agmsg/compare/v1.0.3...v1.0.4
66
88
  [1.0.3]: https://github.com/fujibee/agmsg/compare/v1.0.2...v1.0.3
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Cross-agent messaging for CLI AI agents. No daemon, no network, no complexity.
4
4
 
5
+ > **For AI agents:** see [`/llms.txt`](llms.txt) for a quick, machine-friendly orientation.
6
+
5
7
  <a href="https://www.producthunt.com/products/agmsg?utm_source=badge-top-post-badge&utm_medium=badge" target="_blank">
6
8
  <picture>
7
9
  <source media="(prefers-color-scheme: dark)"
@@ -40,16 +42,17 @@ bash <(curl -fsSL https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh)
40
42
  # Or clone first if you want to inspect the code
41
43
  git clone https://github.com/fujibee/agmsg.git && cd agmsg && ./install.sh
42
44
 
43
- # 2. Restart Claude Code / Codex / Gemini CLI / Antigravity to pick up the new skill
45
+ # 2. Restart Claude Code / Codex / Gemini CLI / Antigravity / OpenCode to pick up the new skill
44
46
 
45
47
  # 3. Run the command — it will prompt for team and agent name on first use
46
48
  # Claude Code: /agmsg
47
49
  # Codex: $agmsg
48
50
  # Gemini CLI: $agmsg
49
51
  # Antigravity: $agmsg
52
+ # OpenCode: $agmsg
50
53
  ```
51
54
 
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.
55
+ 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 offers a beta `monitor` bridge or `turn`). After that, you talk to your agent naturally — see [First run](#first-run) below.
53
56
 
54
57
  Prefer a different install method? See [Install](#install) below for `npm` / `npx` and the Claude Code plugin marketplace paths.
55
58
 
@@ -97,7 +100,8 @@ git clone https://github.com/fujibee/agmsg.git
97
100
  cd agmsg
98
101
  ./install.sh # Interactive (asks command name, default: agmsg)
99
102
  ./install.sh --cmd m # Non-interactive with custom command name
100
- ./install.sh --agent-type gemini # Install a Gemini-oriented SKILL.md
103
+ ./install.sh --agent-type gemini # Install a Gemini-oriented SKILL.md
104
+ ./install.sh --agent-type opencode # OpenCode-only: sets shared skill to OpenCode template
101
105
  ```
102
106
 
103
107
  The **command name** determines:
@@ -107,7 +111,7 @@ The **command name** determines:
107
111
 
108
112
  `--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.
109
113
 
110
- After install, **restart your agent** (Claude Code / Codex / Gemini CLI / Copilot CLI / Antigravity) so it picks up the new skill.
114
+ After install, **restart your agent** (Claude Code / Codex / Gemini CLI / Copilot CLI / Antigravity / OpenCode) so it picks up the new skill.
111
115
 
112
116
  ### Native Windows / PowerShell profile function
113
117
 
@@ -210,7 +214,7 @@ How incoming messages reach your agent. Pick one at first join via the prompt, o
210
214
  | mode | mechanism | latency | who it's for |
211
215
  |---|---|---|---|
212
216
  | **`monitor`** (default on Claude Code) | SessionStart hook → Monitor tool → blocking SQLite stream | ~5s | Claude Code users wanting real-time push |
213
- | **`turn`** (default on Codex / Copilot CLI) | Stop hook fires `check-inbox.sh` between assistant turns | until your next interaction | Codex / Copilot CLI (no Monitor tool); Claude Code users on a quieter loop |
217
+ | **`turn`** (default on Codex / Copilot CLI / OpenCode) | Stop hook fires `check-inbox.sh` between assistant turns | until your next interaction | Codex / Copilot CLI / OpenCode (no Monitor tool); Claude Code users on a quieter loop |
214
218
  | **`both`** | monitor primary, turn as per-session safety net | ~5s; falls back to turn-end on watcher failure | belt-and-suspenders |
215
219
  | **`off`** | no automatic delivery | manual `/agmsg` only | minimalists |
216
220
 
@@ -264,7 +268,11 @@ The command updates `db/config.yaml`, rewrites the project's hook entries, and p
264
268
  $agmsg — or /skills → agmsg
265
269
  ```
266
270
 
267
- Codex supports `mode turn` and `mode off` only — there's no Monitor tool to stream into.
271
+ Codex supports `mode monitor` as a **beta** app-server bridge, plus `mode turn` and `mode off`.
272
+
273
+ > ⚠️ **The monitor beta changes how Codex starts — opt in only if you understand it.** Codex has no Monitor tool, so `mode monitor` installs a shim at `~/.agents/bin/codex` and asks you to put `~/.agents/bin` **first on your PATH**, so `codex` then resolves to the shim instead of the real binary. 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 experimental Codex app-server behavior and has known rough edges (orphans on TUI close — #149; one identity per project — #150).
274
+
275
+ If the shim can't be installed, launch with `~/.agents/skills/<cmd>/scripts/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, PATH notes, and internals: [docs/codex-monitor-beta.md](docs/codex-monitor-beta.md).
268
276
 
269
277
  ### GitHub Copilot CLI
270
278
 
@@ -274,6 +282,18 @@ Codex supports `mode turn` and `mode off` only — there's no Monitor tool to st
274
282
 
275
283
  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.
276
284
 
285
+ ### OpenCode
286
+
287
+ ```
288
+ $agmsg
289
+ ```
290
+
291
+ Install with `./install.sh` (when `~/.config/opencode/` exists, the OpenCode-typed skill is placed automatically alongside the default Codex-typed shared skill). Use `--agent-type opencode` only for OpenCode-only environments where Codex is not installed. OpenCode is supported for manual and turn/off delivery workflows. It currently supports `mode turn` and `mode off`; `monitor`, `both`, and `spawn opencode` are not supported.
292
+
293
+ This makes OpenCode useful as a local coding agent, including configurations backed by local providers such as Ollama.
294
+
295
+ See [docs/opencode.md](docs/opencode.md) for full setup instructions.
296
+
277
297
  ### Shell (any agent)
278
298
 
279
299
  ```bash
package/bin/agmsg.js CHANGED
@@ -29,10 +29,24 @@ const fs = require('fs');
29
29
  const os = require('os');
30
30
  const path = require('path');
31
31
 
32
- const SETUP_URL = 'https://raw.githubusercontent.com/fujibee/agmsg/main/setup.sh';
32
+ const RAW_BASE = 'https://raw.githubusercontent.com/fujibee/agmsg';
33
33
  const REPO_URL = 'https://github.com/fujibee/agmsg';
34
34
  const HOMEPAGE = 'https://agmsg.cc';
35
35
 
36
+ // Install the repo ref that matches THIS bootstrapper's version, so
37
+ // `npx agmsg@X` installs X — not whatever happens to be on main. We fetch
38
+ // setup.sh from the matching tag AND pass AGMSG_REF so setup.sh clones the
39
+ // same tag. Falls back to main only when the version can't be read (e.g. a
40
+ // dev checkout with no published tag). See #172.
41
+ //
42
+ // Bootstrappers published before this fix (<= 1.0.5) hardcoded main and
43
+ // cannot be retrofitted — `npx agmsg@1.0.5` will still pull main. Pinning
44
+ // holds from the first release that ships this file (1.0.6) onward.
45
+ function installRef() {
46
+ const v = readVersion();
47
+ return v && v !== '?' ? 'v' + v : 'main';
48
+ }
49
+
36
50
  function readVersion() {
37
51
  try {
38
52
  const pkgPath = path.join(__dirname, '..', 'package.json');
@@ -75,21 +89,27 @@ function runInstaller(passthroughArgs) {
75
89
  // bootstrapper plus a still-vulnerable install.sh would also work; doing it
76
90
  // correctly here is defense-in-depth and lets future interactive prompts
77
91
  // in setup.sh keep working for real-tty users.
92
+ const ref = installRef();
93
+ const setupUrl = RAW_BASE + '/' + ref + '/setup.sh';
78
94
  const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agmsg-bootstrap-'));
79
95
  const setupPath = path.join(tmpDir, 'setup.sh');
80
96
 
81
97
  try {
82
- const fetch = spawnSync('curl', ['-fsSL', '-o', setupPath, SETUP_URL], { stdio: 'inherit' });
98
+ const fetch = spawnSync('curl', ['-fsSL', '-o', setupPath, setupUrl], { stdio: 'inherit' });
83
99
  if (fetch.error) {
84
100
  console.error('agmsg: failed to launch curl:', fetch.error.message);
85
101
  process.exit(1);
86
102
  }
87
103
  if (fetch.status !== 0) {
88
- console.error('agmsg: curl exited ' + fetch.status + ' fetching ' + SETUP_URL);
104
+ console.error('agmsg: curl exited ' + fetch.status + ' fetching ' + setupUrl);
89
105
  process.exit(fetch.status || 1);
90
106
  }
91
107
 
92
- const result = spawnSync('bash', [setupPath, ...passthroughArgs], { stdio: 'inherit' });
108
+ // Pin the clone inside setup.sh to the same ref we fetched it from.
109
+ const result = spawnSync('bash', [setupPath, ...passthroughArgs], {
110
+ stdio: 'inherit',
111
+ env: Object.assign({}, process.env, { AGMSG_REF: ref })
112
+ });
93
113
  if (result.error) {
94
114
  console.error('agmsg: failed to launch bash:', result.error.message);
95
115
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agmsg",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
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"