agmsg 1.1.13 → 1.2.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/README.ja.md +2 -0
- package/README.md +2 -0
- package/bin/agmsg.js +116 -3
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -64,6 +64,8 @@ npx agmsg
|
|
|
64
64
|
|
|
65
65
|
先にコードを確認したい、最新の `main` を追いたい、あるいはカスタムのコマンド名にしたい場合は、下記の[インストール](#インストール)にある `setup.sh` ワンライナー、`git clone`、Claude Codeプラグインマーケットプレイスの各手順を参照。
|
|
66
66
|
|
|
67
|
+
セルフホストのリファレンスサーバー経由で2つのインストール間でチームを同期するには、[リモートセットアップ](docs/remote-setup.ja.md)の手順に従う。
|
|
68
|
+
|
|
67
69
|
## 仕組み
|
|
68
70
|
|
|
69
71
|
agmsgは薄いトランスポートだ。各エージェントは(配信モードに応じて)フックまたはMonitorストリームを持ち、共有SQLiteファイルから読み取って受信メッセージをエージェントが反応できるテキストとして提示する。送信は行を追加する `send.sh` の呼び出しにすぎない。デーモンもソケットもブローカーも存在しない — ファイルが共有の土台であり、エージェントはその上で順番にやり取りする。
|
package/README.md
CHANGED
|
@@ -64,6 +64,8 @@ That's it. The slash command prompts you for a team name and an agent name on fi
|
|
|
64
64
|
|
|
65
65
|
Prefer to inspect the code first, track the latest `main`, or pick a custom command name? See [Install](#install) below for the `setup.sh` one-liner, `git clone`, and the Claude Code plugin marketplace paths.
|
|
66
66
|
|
|
67
|
+
To sync a team between two installs through the self-hosted reference server, follow [Remote setup](docs/remote-setup.md).
|
|
68
|
+
|
|
67
69
|
## How it works
|
|
68
70
|
|
|
69
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. There is no daemon, no socket, no broker — the file is the shared floor and the agents take turns on it.
|
package/bin/agmsg.js
CHANGED
|
@@ -56,6 +56,120 @@ function readVersion() {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// `agmsg <verb>` is the single most common wrong guess about this project,
|
|
60
|
+
// and it is a guess the documentation taught: a sweep of docs/design and
|
|
61
|
+
// docs/spec found 34 backticked commands written as `agmsg send …`,
|
|
62
|
+
// `agmsg key show …`, `agmsg team list …`. There is no such CLI. This package
|
|
63
|
+
// installs agmsg; the commands are scripts inside the install.
|
|
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, co1):
|
|
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, co1) — 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');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function exists(p) {
|
|
102
|
+
try {
|
|
103
|
+
return fs.existsSync(p);
|
|
104
|
+
} catch (_) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function printNotACommand(verb, skillDirForTest) {
|
|
110
|
+
const dir = skillDirForTest || defaultSkillDir();
|
|
111
|
+
const skill = '~/.agents/skills/agmsg/scripts';
|
|
112
|
+
const script = Object.prototype.hasOwnProperty.call(SCRIPT_FOR_VERB, verb)
|
|
113
|
+
? SCRIPT_FOR_VERB[verb]
|
|
114
|
+
: null;
|
|
115
|
+
const scriptsDir = path.join(dir, 'scripts');
|
|
116
|
+
|
|
117
|
+
// The contract differs by what is about to be printed, and that is the
|
|
118
|
+
// point (review P1, co1):
|
|
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:');
|
|
143
|
+
}
|
|
144
|
+
lines.push('');
|
|
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 …');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
lines.push('');
|
|
166
|
+
// The skill command is the path most people actually want — it is what the
|
|
167
|
+
// install sets up, and it needs no paths.
|
|
168
|
+
lines.push('Or ask your agent: run the agmsg skill command (/agmsg in Claude Code).');
|
|
169
|
+
lines.push('`npx agmsg --help` covers what THIS package does.');
|
|
170
|
+
console.error(lines.join('\n'));
|
|
171
|
+
}
|
|
172
|
+
|
|
59
173
|
function printHelp() {
|
|
60
174
|
process.stdout.write([
|
|
61
175
|
'agmsg — npm bootstrapper for cross-agent messaging',
|
|
@@ -152,8 +266,7 @@ function main() {
|
|
|
152
266
|
process.stdout.write('canonical project: ' + REPO_URL + '\n');
|
|
153
267
|
process.exit(0);
|
|
154
268
|
} else {
|
|
155
|
-
|
|
156
|
-
console.error('Run `npx agmsg --help` for usage.');
|
|
269
|
+
printNotACommand(args[0]);
|
|
157
270
|
process.exit(2);
|
|
158
271
|
}
|
|
159
272
|
}
|
|
@@ -162,4 +275,4 @@ if (require.main === module) {
|
|
|
162
275
|
main();
|
|
163
276
|
}
|
|
164
277
|
|
|
165
|
-
module.exports = { toBashPath };
|
|
278
|
+
module.exports = { toBashPath, SCRIPT_FOR_VERB, printNotACommand };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agmsg",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.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"
|