agmsg 1.5.2 → 1.6.0-rc.1
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 +18 -0
- package/README.md +27 -4
- package/bin/agmsg.js +131 -138
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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.5.3] - 2026-10-05
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Sessions in the Claude desktop app (Code tab) and the Codex desktop app are recognized as desktop seats: team status shows them as such, and they are never recorded against a terminal pane. Message delivery is unchanged. (#1563, #1565)
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Remote sync no longer leaves a small temp file behind for every message it applies; on a long-running synced team these filled the temp directory (on Linux tmpfs, until it ran out of inodes) (#1572)
|
|
14
|
+
- `install --update` removes the temp files leaked before this fix, and `doctor` reports them (`doctor --fix` removes them) (#1575)
|
|
15
|
+
- Stop treating a missing TaskList entry as a failed watch (#1571)
|
|
16
|
+
- Drop the previous name's placement record for this pane on a switch (#1568)
|
|
17
|
+
- End the Claude Code watch at 1750 seconds, not 1790 (#1561)
|
|
18
|
+
- Break a registry lock only when its recorded holder is gone (#1556)
|
|
19
|
+
|
|
20
|
+
### Documentation
|
|
21
|
+
- Ask before creating a team when remote is in use; point at delete and update (#1574)
|
|
22
|
+
|
|
23
|
+
[1.5.3]: https://github.com/fujibee/agmsg/compare/v1.5.2...v1.5.3
|
|
24
|
+
|
|
7
25
|
## [1.5.2] - 2026-10-02
|
|
8
26
|
|
|
9
27
|
### Added
|
package/README.md
CHANGED
|
@@ -152,6 +152,25 @@ Git Bash PATH). There is no PowerShell reimplementation.
|
|
|
152
152
|
Set-Alias bash 'C:\Program Files\Git\bin\bash.exe'
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
+
### agmsgd beta (1.6.0)
|
|
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. The Claude Code path is macOS/Linux only; a Windows Claude Code seat keeps using Monitor as before. It is off by default. 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
|
+
|
|
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
|
+
|
|
161
|
+
```bash
|
|
162
|
+
agmsg daemon enable
|
|
163
|
+
agmsg daemon status
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
If `agmsg` is not found, use `<install>/scripts/agmsg daemon enable` (and the same path for `status`, `start`, `stop`, or `disable`); `<install>` is the installation directory printed by the installer. Follow its PATH instructions to make `agmsg` available in your shell.
|
|
167
|
+
|
|
168
|
+
While enabled, new Codex launches through the shim use plain Codex: no bridge app-server or dispatcher is started. Sessions that already have a bridge keep using it until restarted; agmsgd skips those sessions. `enable` and `start` list the remaining bridge sessions and missing destination records. Restart Codex and run `$agmsg actas <name>` to record a missing destination. Existing remote sync processes remain separate, so this beta does not yet reduce all background work to one process. A Claude Code seat only skips Monitor once agmsgd confirms it can actually be delivered to; every other seat keeps using Monitor as before. `daemon status` reports each such seat's state under `claude_code_seats`.
|
|
169
|
+
|
|
170
|
+
If agmsgd stops while enabled, the next ordinary agmsg script operation warns at most once every ten minutes per install. Codex startup also warns, and `daemon status` and `scripts/doctor.sh` report the failure with exit code 1. Run `agmsg daemon start` to recover. For a missing or outdated Node executable, install Node and run `agmsg daemon enable` again. Unread messages are preserved.
|
|
171
|
+
|
|
172
|
+
To return to bridge notices, run `agmsg daemon disable`, then restart the Codex sessions listed as having no bridge (for example, `codex resume`, followed by `$agmsg actas <name>`). They receive no new notices until restarted. Existing bridge sessions need no restart, and subsequent Codex launches get a bridge. Notices already accepted by the Codex queue are not cancelled and may appear once more. Claude Code seats go back to Monitor at their next SessionStart; an open Claude Code session gets no notices until then. To restore notices in an existing session, resume it so SessionStart arms Monitor again. `stop` stops the daemon without removing its resident service; `disable` also unregisters that service.
|
|
173
|
+
|
|
155
174
|
## First run
|
|
156
175
|
|
|
157
176
|
Open your project in your agent (Claude Code, Codex, Gemini CLI, etc.) and run:
|
|
@@ -278,17 +297,15 @@ For real-time delivery, verify the Claude Code runtime state:
|
|
|
278
297
|
|
|
279
298
|
1. `ToolSearch select:Monitor` finds Claude Code's generic `Monitor` tool.
|
|
280
299
|
2. The session starts `Monitor(agmsg inbox stream)` with the `watch.sh ... claude-code` command from the `AGMSG-DIRECTIVE` (or, after `actas <name>`, `Monitor(agmsg inbox stream (acting as <name>))`).
|
|
281
|
-
3.
|
|
282
|
-
4. The transcript contains a `Monitor event: "agmsg inbox stream"` (or `"agmsg inbox stream (acting as <name>)"`) notification when messages arrive.
|
|
300
|
+
3. The transcript contains a `Monitor event: "agmsg inbox stream"` (or `"agmsg inbox stream (acting as <name>)"`) notification when messages arrive.
|
|
283
301
|
|
|
284
302
|
These are failure states, even if `delivery.sh status` says `mode: monitor`:
|
|
285
303
|
|
|
286
|
-
- `TaskList` shows no task whose description begins with `agmsg inbox stream` for this session.
|
|
287
304
|
- `watch.sh` is running only as a Bash/background/nohup shell process, not through the Monitor tool.
|
|
288
305
|
- Tool search finds Azure Monitor, an MCP monitor, or any other monitor-branded tool instead of Claude Code's generic `Monitor` tool.
|
|
289
306
|
- `ToolSearch select:Monitor` cannot find a generic `Monitor` tool.
|
|
290
307
|
|
|
291
|
-
|
|
308
|
+
TaskList may list this task, but not every environment does (the desktop app's Code tab runs the Monitor and delivers its events without listing it), so a task missing from TaskList is not a failure: judge by the Monitor call starting and its events arriving. The background-task footer is not a reliable check either. If the Monitor tool is unavailable, use `turn` delivery or manual `/agmsg` inbox checks as a fallback. Those modes still deliver queued messages, but they are not real-time monitor delivery.
|
|
292
309
|
|
|
293
310
|
### Migrating from legacy `hook on/off`
|
|
294
311
|
|
|
@@ -424,6 +441,12 @@ The message store is effectively a replay log. There's no one-shot "rehydrate fr
|
|
|
424
441
|
|
|
425
442
|
## Update
|
|
426
443
|
|
|
444
|
+
```bash
|
|
445
|
+
npx agmsg@latest install --update # add --cmd <name> if you have more than one install
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
From a clone:
|
|
449
|
+
|
|
427
450
|
```bash
|
|
428
451
|
cd agmsg
|
|
429
452
|
git pull
|
package/bin/agmsg.js
CHANGED
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// agmsg npm
|
|
3
|
+
// agmsg npm entry.
|
|
4
4
|
//
|
|
5
|
-
// This package does NOT contain the agmsg implementation. It
|
|
6
|
-
//
|
|
7
|
-
// `npx agmsg install` entry point that defers to the canonical shell
|
|
8
|
-
// installer maintained at https://github.com/fujibee/agmsg.
|
|
5
|
+
// This package does NOT contain the agmsg implementation. It is the single
|
|
6
|
+
// `agmsg` command's Node entry point, and it does two things only:
|
|
9
7
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
8
|
+
// - `agmsg install` fetches the canonical setup.sh for this package's
|
|
9
|
+
// version and runs it (equivalent to the README's
|
|
10
|
+
// `bash <(curl -fsSL .../setup.sh)`; process substitution keeps the tty as
|
|
11
|
+
// stdin, see agmsg #98).
|
|
12
|
+
// - every other command is handed, unchanged, to the bash runtime that an
|
|
13
|
+
// install put on disk (scripts/agmsg). Nothing is reimplemented here.
|
|
13
14
|
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// interactive command-name prompt would `read -r` the next line of
|
|
20
|
-
// setup.sh as the command name. See agmsg #98.
|
|
21
|
-
//
|
|
22
|
-
// Subcommands:
|
|
23
|
-
// install Fetch and run the canonical setup.sh (default if no args).
|
|
24
|
-
// --help Print this message and exit 0.
|
|
25
|
-
// --version Print the bootstrapper version and exit 0.
|
|
15
|
+
// Usage:
|
|
16
|
+
// install [options] Fetch and run the canonical setup.sh.
|
|
17
|
+
// help, --help Print usage.
|
|
18
|
+
// --version Print this package's and the installed runtime's version.
|
|
19
|
+
// <anything else> Run the installed runtime's command with the same args.
|
|
26
20
|
|
|
27
21
|
const { spawnSync } = require('child_process');
|
|
28
22
|
const fs = require('fs');
|
|
@@ -56,46 +50,11 @@ function readVersion() {
|
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//
|
|
65
|
-
// Saying only "unknown argument" leaves the person exactly where they were.
|
|
66
|
-
// It has to name what to type instead.
|
|
67
|
-
//
|
|
68
|
-
// The verb→script map is a HINT, and the two halves of that are tested
|
|
69
|
-
// differently (review P1):
|
|
70
|
-
//
|
|
71
|
-
// NOT promised: that it is complete. This package does not ship scripts/,
|
|
72
|
-
// so it cannot enumerate them. A verb missing from here falls through to
|
|
73
|
-
// the general form, which stays correct.
|
|
74
|
-
// PROMISED: that every entry present is real. A renamed or deleted script
|
|
75
|
-
// would otherwise make this print a specific path that does not exist —
|
|
76
|
-
// WORSE than the general form, not merely less precise. The first version
|
|
77
|
-
// of this comment claimed only precision could degrade; that was wrong,
|
|
78
|
-
// and it was wrong for exactly the entries most likely to rot.
|
|
79
|
-
//
|
|
80
|
-
// test_bin_agmsg.bats pins every value against the repo's scripts/ — the
|
|
81
|
-
// list is asserted non-empty, not at a fixed size, so adding a verb here
|
|
82
|
-
// costs nothing while renaming a script fails the suite.
|
|
83
|
-
//
|
|
84
|
-
// That pin is about THIS repo. It cannot speak for the tree on a user's
|
|
85
|
-
// disk, so printNotACommand checks the actual file there before naming it.
|
|
86
|
-
const SCRIPT_FOR_VERB = {
|
|
87
|
-
send: 'send.sh', history: 'history.sh', inbox: 'inbox.sh', join: 'join.sh',
|
|
88
|
-
team: 'team.sh', key: 'key.sh', remote: 'remote.sh', whoami: 'whoami.sh',
|
|
89
|
-
leave: 'leave.sh', rename: 'rename.sh', export: 'export.sh', config: 'config.sh',
|
|
90
|
-
watch: 'watch.sh', spawn: 'spawn.sh', version: 'version.sh', api: 'api.sh',
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// The default install location. Checked because this package's whole job is
|
|
94
|
-
// to install agmsg, so a person who has never run it reaches this branch too
|
|
95
|
-
// (review P1) — and for them every path below is a command that fails.
|
|
96
|
-
// Advice that assumes the install is advice they cannot follow.
|
|
97
|
-
function defaultSkillDir() {
|
|
98
|
-
return path.join(os.homedir(), '.agents', 'skills', 'agmsg');
|
|
53
|
+
// The install location. `AGMSG_CMD=<name>` selects an install made with
|
|
54
|
+
// `--cmd <name>`; without it the default install is used. A named install that
|
|
55
|
+
// is missing is an error -- it never falls back to the default one.
|
|
56
|
+
function skillsRoot() {
|
|
57
|
+
return path.join(os.homedir(), '.agents', 'skills');
|
|
99
58
|
}
|
|
100
59
|
|
|
101
60
|
function exists(p) {
|
|
@@ -106,82 +65,65 @@ function exists(p) {
|
|
|
106
65
|
}
|
|
107
66
|
}
|
|
108
67
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// point (review P1):
|
|
119
|
-
//
|
|
120
|
-
// naming ONE script -> that script file must exist. The repo-side pin
|
|
121
|
-
// proves the map matches THIS repo; it says nothing about the tree on
|
|
122
|
-
// the user's disk, which can be an old version, a partial update, or a
|
|
123
|
-
// broken install. Checking only that scripts/ exists reproduces the
|
|
124
|
-
// previous P1 one layer out — a directory is not the file.
|
|
125
|
-
// naming the DIRECTORY -> the directory must exist. Nothing more is
|
|
126
|
-
// claimed, so nothing more is checked.
|
|
127
|
-
const haveScripts = exists(scriptsDir);
|
|
128
|
-
const usable = script ? exists(path.join(scriptsDir, script)) : haveScripts;
|
|
129
|
-
|
|
130
|
-
const lines = ['agmsg: `agmsg ' + verb + '` is not a command.', ''];
|
|
131
|
-
|
|
132
|
-
if (!usable) {
|
|
133
|
-
// Three situations that need different next steps, kept apart: never
|
|
134
|
-
// installed, installed but without this command, and installed under
|
|
135
|
-
// another name. Folding them together leaves someone without a recovery
|
|
136
|
-
// step — which is what the first version of this message did.
|
|
137
|
-
if (haveScripts) {
|
|
138
|
-
lines.push('Your agmsg install does not contain that command. It may be an');
|
|
139
|
-
lines.push('older version — update it:');
|
|
140
|
-
} else {
|
|
141
|
-
lines.push('agmsg does not look installed on this machine — this package is');
|
|
142
|
-
lines.push('the installer for it. Install first:');
|
|
68
|
+
// Sets out how to reach the runtime `agmsg` (scripts/agmsg, a bash script that
|
|
69
|
+
// install.sh copies into the install). Returns { runtime } on success or
|
|
70
|
+
// { error, lines } describing why it cannot be reached.
|
|
71
|
+
function resolveRuntime(env, skillsDirForTest) {
|
|
72
|
+
const root = skillsDirForTest || skillsRoot();
|
|
73
|
+
const named = env.AGMSG_CMD;
|
|
74
|
+
if (named !== undefined && named !== '') {
|
|
75
|
+
if (!/^[A-Za-z0-9._-]+$/.test(named) || named === '.' || named === '..') {
|
|
76
|
+
return { error: true, lines: ['agmsg: AGMSG_CMD must be a plain install name, got "' + named + '".'] };
|
|
143
77
|
}
|
|
144
|
-
|
|
145
|
-
lines.push(' npx agmsg install');
|
|
146
|
-
lines.push('');
|
|
147
|
-
lines.push('After that, ' + (script ? 'that command is:' : 'the commands are:'));
|
|
148
|
-
lines.push('');
|
|
149
|
-
lines.push(script ? ' bash ' + skill + '/' + script + ' …'
|
|
150
|
-
: ' bash ' + skill + '/<name>.sh …');
|
|
151
|
-
lines.push('');
|
|
152
|
-
lines.push('(Already installed under a different name? Substitute it for');
|
|
153
|
-
lines.push('`agmsg` in that path — nothing is put on your PATH.)');
|
|
154
|
-
} else if (script) {
|
|
155
|
-
lines.push('This package only installs agmsg. That one lives in your install:');
|
|
156
|
-
lines.push('');
|
|
157
|
-
lines.push(' bash ' + skill + '/' + script + ' …');
|
|
158
|
-
} else {
|
|
159
|
-
lines.push('This package only installs agmsg. The commands live in your install:');
|
|
160
|
-
lines.push('');
|
|
161
|
-
lines.push(' ls ' + skill + '/');
|
|
162
|
-
lines.push(' bash ' + skill + '/<name>.sh …');
|
|
78
|
+
return checkInstall(path.join(root, named), 'AGMSG_CMD=' + named);
|
|
163
79
|
}
|
|
80
|
+
const def = path.join(root, 'agmsg');
|
|
81
|
+
const found = checkInstall(def, 'the default install');
|
|
82
|
+
if (!found.error) return found;
|
|
83
|
+
if (exists(path.join(def, 'scripts'))) return found;
|
|
84
|
+
// No default install: list others that have a runtime, without picking one.
|
|
85
|
+
let others = [];
|
|
86
|
+
try {
|
|
87
|
+
others = fs.readdirSync(root).filter((n) => exists(path.join(root, n, 'scripts', 'agmsg')));
|
|
88
|
+
} catch (_) { /* no skills directory */ }
|
|
89
|
+
if (others.length > 0) {
|
|
90
|
+
return {
|
|
91
|
+
error: true,
|
|
92
|
+
lines: ['agmsg: there is no default install, but these installs have the agmsg command:']
|
|
93
|
+
.concat(others.map((n) => ' ' + n))
|
|
94
|
+
.concat(['Pick one with AGMSG_CMD=<name> agmsg …'])
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
164
99
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
100
|
+
function checkInstall(dir, label) {
|
|
101
|
+
const runtime = path.join(dir, 'scripts', 'agmsg');
|
|
102
|
+
if (exists(runtime)) return { runtime, dir };
|
|
103
|
+
if (exists(path.join(dir, 'scripts'))) {
|
|
104
|
+
return { error: true, lines: [
|
|
105
|
+
'agmsg: ' + label + ' has no agmsg command (an older version). Update it:',
|
|
106
|
+
' agmsg install'
|
|
107
|
+
] };
|
|
108
|
+
}
|
|
109
|
+
return { error: true, lines: [
|
|
110
|
+
'agmsg: ' + label + ' is not installed. Install first:',
|
|
111
|
+
' agmsg install'
|
|
112
|
+
] };
|
|
171
113
|
}
|
|
172
114
|
|
|
173
115
|
function printHelp() {
|
|
174
116
|
process.stdout.write([
|
|
175
|
-
'agmsg —
|
|
176
|
-
'',
|
|
177
|
-
'This package is a thin wrapper. The real installer lives at:',
|
|
178
|
-
' ' + REPO_URL,
|
|
117
|
+
'agmsg — cross-agent messaging',
|
|
179
118
|
'',
|
|
180
119
|
'Usage:',
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
'
|
|
120
|
+
' agmsg install [options] install or update agmsg (runs the canonical setup.sh)',
|
|
121
|
+
' agmsg daemon <command> manage the agmsgd beta daemon (start|stop|status|enable|disable)',
|
|
122
|
+
' agmsg --version show this package and the installed runtime version',
|
|
123
|
+
' agmsg help show this message',
|
|
124
|
+
'',
|
|
125
|
+
'Every command other than install is run by the agmsg install on this',
|
|
126
|
+
'machine (AGMSG_CMD=<name> picks an install made with `--cmd <name>`).',
|
|
185
127
|
'',
|
|
186
128
|
'After install, restart your agent (Claude Code / Codex / Gemini CLI /',
|
|
187
129
|
'Copilot CLI / Antigravity / OpenCode) and run the agmsg skill command',
|
|
@@ -193,6 +135,42 @@ function printHelp() {
|
|
|
193
135
|
].join('\n'));
|
|
194
136
|
}
|
|
195
137
|
|
|
138
|
+
// Runs the runtime with the arguments exactly as given: an absolute path, no
|
|
139
|
+
// shell, inherited stdio, and the runtime's own exit status.
|
|
140
|
+
function runRuntime(runtime, args) {
|
|
141
|
+
const bash = bashCommand();
|
|
142
|
+
if (!bash) {
|
|
143
|
+
console.error('agmsg: Git for Windows bash was not found. Install Git for Windows, then run this again.');
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
146
|
+
const result = spawnSync(bash, [toBashPath(runtime), ...args], { stdio: 'inherit' });
|
|
147
|
+
if (result.error) {
|
|
148
|
+
console.error('agmsg: failed to launch bash:', result.error.message);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
if (result.signal) {
|
|
152
|
+
process.kill(process.pid, result.signal);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// On Windows a bare `bash` can be the WSL launcher, so only Git for Windows'
|
|
159
|
+
// own bash.exe is used there; when it cannot be found this returns null
|
|
160
|
+
// instead of falling back to a bare `bash`.
|
|
161
|
+
function bashCommand() {
|
|
162
|
+
if (process.platform === 'win32') {
|
|
163
|
+
const roots = [process.env.ProgramFiles, process.env.ProgramW6432, process.env.LOCALAPPDATA && path.join(process.env.LOCALAPPDATA, 'Programs')]
|
|
164
|
+
.filter(Boolean);
|
|
165
|
+
for (const root of roots) {
|
|
166
|
+
const gitBash = path.join(root, 'Git', 'bin', 'bash.exe');
|
|
167
|
+
if (exists(gitBash)) return gitBash;
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
return 'bash';
|
|
172
|
+
}
|
|
173
|
+
|
|
196
174
|
// Normalise a native path to the forward-slash form that bash.exe and
|
|
197
175
|
// curl.exe accept on Windows. bash is an MSYS2 program: Windows gives it a
|
|
198
176
|
// raw command-line string rather than a real argv[], and MSYS's own argv
|
|
@@ -217,6 +195,11 @@ function runInstaller(passthroughArgs) {
|
|
|
217
195
|
// correctly here is defense-in-depth and lets future interactive prompts
|
|
218
196
|
// in setup.sh keep working for real-tty users.
|
|
219
197
|
const ref = installRef();
|
|
198
|
+
const bash = bashCommand();
|
|
199
|
+
if (!bash) {
|
|
200
|
+
console.error('agmsg: Git for Windows bash was not found. Install Git for Windows, then run this again.');
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
220
203
|
const setupUrl = RAW_BASE + '/' + ref + '/setup.sh';
|
|
221
204
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agmsg-bootstrap-'));
|
|
222
205
|
// os.tmpdir()/path.join() return backslash-separated paths on Windows.
|
|
@@ -236,7 +219,7 @@ function runInstaller(passthroughArgs) {
|
|
|
236
219
|
}
|
|
237
220
|
|
|
238
221
|
// Pin the clone inside setup.sh to the same ref we fetched it from.
|
|
239
|
-
const result = spawnSync(
|
|
222
|
+
const result = spawnSync(bash, [setupPath, ...passthroughArgs], {
|
|
240
223
|
stdio: 'inherit',
|
|
241
224
|
env: Object.assign({}, process.env, { AGMSG_REF: ref })
|
|
242
225
|
});
|
|
@@ -253,21 +236,31 @@ function runInstaller(passthroughArgs) {
|
|
|
253
236
|
function main() {
|
|
254
237
|
const args = process.argv.slice(2);
|
|
255
238
|
|
|
256
|
-
if (args
|
|
239
|
+
if (args[0] === 'install') {
|
|
257
240
|
// Forward anything after `install` (e.g. `agmsg install --cmd m`) to
|
|
258
241
|
// setup.sh, which passes "$@" through to install.sh.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
} else if (args[0] === '--help' || args[0] === '-h' || args[0] === 'help') {
|
|
242
|
+
runInstaller(args.slice(1));
|
|
243
|
+
} else if (args.length === 0 || args[0] === '--help' || args[0] === '-h' || args[0] === 'help') {
|
|
262
244
|
printHelp();
|
|
263
|
-
process.exit(0);
|
|
245
|
+
process.exit(args.length === 0 ? 2 : 0);
|
|
264
246
|
} else if (args[0] === '--version' || args[0] === '-v') {
|
|
265
|
-
process.stdout.write('agmsg
|
|
266
|
-
|
|
247
|
+
process.stdout.write('agmsg ' + readVersion() + ' (npm entry)\n');
|
|
248
|
+
const found = resolveRuntime(process.env);
|
|
249
|
+
if (found.error) {
|
|
250
|
+
process.stdout.write('runtime: not available\n');
|
|
251
|
+
} else {
|
|
252
|
+
const bash = bashCommand();
|
|
253
|
+
const v = bash ? spawnSync(bash, [toBashPath(found.runtime), '--version'], { encoding: 'utf8' }) : null;
|
|
254
|
+
process.stdout.write('runtime: ' + (v && v.status === 0 ? v.stdout.trim() : 'unreadable') + '\n');
|
|
255
|
+
}
|
|
267
256
|
process.exit(0);
|
|
268
257
|
} else {
|
|
269
|
-
|
|
270
|
-
|
|
258
|
+
const found = resolveRuntime(process.env);
|
|
259
|
+
if (found.error) {
|
|
260
|
+
console.error(found.lines.join('\n'));
|
|
261
|
+
process.exit(2);
|
|
262
|
+
}
|
|
263
|
+
runRuntime(found.runtime, args);
|
|
271
264
|
}
|
|
272
265
|
}
|
|
273
266
|
|
|
@@ -275,4 +268,4 @@ if (require.main === module) {
|
|
|
275
268
|
main();
|
|
276
269
|
}
|
|
277
270
|
|
|
278
|
-
module.exports = { toBashPath,
|
|
271
|
+
module.exports = { toBashPath, resolveRuntime, runRuntime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agmsg",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-rc.1",
|
|
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"
|