@sleep2agi/agent-network 2.3.0-preview.36 → 2.3.0-preview.38

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.md CHANGED
@@ -5,373 +5,74 @@
5
5
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/sleep2agi/agent-network/blob/main/LICENSE)
6
6
  [![Docs](https://img.shields.io/badge/docs-anet.sh-009e7e.svg)](https://anet.sh)
7
7
 
8
- Run a local network of AI agents from one CLI.
9
-
10
- `anet` starts a CommHub, launches the web dashboard, creates agent nodes, and lets those nodes talk to each other through MCP tools such as `send_task`, `get_task`, and `get_all_status`.
11
-
12
- ## What It Is
13
-
14
- Agent Network is a local-first multi-agent runtime:
15
-
16
- - **CommHub**: MCP + REST + SSE hub for task routing, auth, networks, and status.
17
- - **Agent nodes**: long-running AI workers backed by Claude Code, Claude Agent SDK, Codex SDK, Codex app-server, Grok Build ACP, or OpenCode ACP.
18
- - **Dashboard**: browser UI for topology, chat, tasks, node health, and server telemetry.
19
- - **CLI**: `anet`, the single entry point for setup, auth, node lifecycle, and demos.
20
-
21
- The default path runs entirely on your machine. LAN sharing is opt-in.
22
-
23
- ## Requirements
24
-
25
- - Node.js **>= 22.13.0**
26
- - npm **>= 10**
27
- - Bun **>= 1.2.0** (`anet hub start` lazy-runs the Bun-based CommHub server)
28
- - macOS or Linux
29
-
30
- Install Bun if needed:
31
-
32
- ```bash
33
- curl -fsSL https://bun.sh/install | bash
34
- ```
8
+ `anet` connects local AI agents through one self-hosted Hub. It starts CommHub and the Dashboard, creates node identities, and manages node lifecycle, networks, tokens, tasks, and channels.
35
9
 
36
10
  ## Install
37
11
 
38
- Stable:
39
-
40
- ```bash
41
- npm install -g @sleep2agi/agent-network
42
- anet -v
43
- ```
44
-
45
- Preview channel:
12
+ Requires Node.js ≥ 22.13 and Bun ≥ 1.2.
46
13
 
47
14
  ```bash
48
- npm install -g @sleep2agi/agent-network@preview
49
- anet -v
15
+ npm install -g bun @sleep2agi/agent-network @sleep2agi/agent-node
50
16
  ```
51
17
 
52
- Canonical OpenCode preview (exact vetted pair; automatic `npx` fallback is intentionally disabled):
18
+ Stable releases use npm's `latest` tag. Features that are still being validated use `preview`:
53
19
 
54
20
  ```bash
55
- npm install -g @sleep2agi/agent-network@2.3.0-preview.34 \
56
- @sleep2agi/agent-node@2.5.0-preview.26 \
57
- opencode-ai@1.18.1
21
+ anet upgrade --channel preview
58
22
  ```
59
23
 
60
- Current npm dist-tags verified on 2026-05-28 (v0.10.11 stable):
61
-
62
- | Package | latest | preview |
63
- |---|---:|---:|
64
- | `@sleep2agi/agent-network` | `2.2.10` | `2.2.10-preview.3` |
65
- | `@sleep2agi/commhub-server` | `0.8.4` | `0.8.4-preview.1` |
66
- | `@sleep2agi/agent-network-dashboard` | `0.5.6` | `0.5.7-preview.2` |
67
- | `@sleep2agi/agent-node` | `2.4.7` | `2.4.8-preview.0` |
68
-
69
- ## 5-Minute Quick Start
24
+ Do not copy fixed package or preview numbers from old issues. Check the [versioning guide](https://anet.sh/guide/versioning) and npm dist-tags for the current release.
70
25
 
71
- Open three terminals.
26
+ ## Quick start
72
27
 
73
- ### 1. Start CommHub
28
+ Open three terminals:
74
29
 
75
30
  ```bash
31
+ # Terminal 1 — Hub
76
32
  anet hub start
77
- ```
78
-
79
- Default local URL:
80
33
 
81
- ```text
82
- http://127.0.0.1:9200
83
- ```
84
-
85
- By default the hub binds to localhost. Use `--host 0.0.0.0` only when you intentionally want LAN clients to connect.
86
-
87
- ### 2. Start Dashboard
88
-
89
- ```bash
34
+ # Terminal 2 — Dashboard
90
35
  anet hub dashboard
91
- ```
92
-
93
- Open:
94
36
 
95
- ```text
96
- http://localhost:3000
97
- ```
98
-
99
- ### 3. Log In, Create A Node, Start It
100
-
101
- ```bash
102
- anet login --hub http://127.0.0.1:9200 --username admin --password anethub
37
+ # Terminal 3 — login, create, start
38
+ anet login --hub http://127.0.0.1:9200 --username admin
103
39
  anet node create my-bot
104
40
  anet node start my-bot
105
41
  ```
106
42
 
107
- `anet node create` walks you through:
108
-
109
- 1. Runtime: `claude-agent-sdk`, `claude-code-cli`, `codex-sdk`, `codex-app-server`, `grok-build-acp`, or `opencode-cli` (the canonical preview picker has exactly these 6 choices).
110
- 2. Provider preset: Anthropic, MiniMax, InternLM, Xiaomi MiMo, or `custom` (any Anthropic-compatible endpoint — used for DeepSeek / GLM / Kimi / OpenRouter etc.; Codex runtimes reuse Codex auth; grok-build-acp reuses Grok auth; opencode-cli offers Anthropic/OpenAI presets).
111
- 3. API key and model settings.
112
-
113
- When the node starts successfully, look for:
114
-
115
- ```text
116
- SSE connected
117
- ```
118
-
119
- Then use the Dashboard chat panel to send `my-bot` a message.
120
-
121
- ## Multi-Agent Collaboration
122
-
123
- Create a second node:
124
-
125
- ```bash
126
- anet node create reviewer
127
- anet node start reviewer
128
- ```
129
-
130
- Ask `my-bot`:
43
+ The node is ready after its log reports `SSE connected`. Open `http://localhost:3000` and send it a task from Dashboard.
131
44
 
132
- ```text
133
- Ask reviewer to review this plan and summarize the risks.
134
- ```
45
+ ## Runtime selection
135
46
 
136
- The first agent can discover peers with `get_all_status`, delegate work with `send_task`, poll with `get_task`, and integrate the reply. The dashboard Tasks and Messages views show the chain.
47
+ `anet node create` shows only runtimes available in the installed release channel. Installation, authentication, permissions, and current availability are maintained in the [runtime guide](https://anet.sh/guide/runtimes).
137
48
 
138
- ## LAN Hub
49
+ - Claude Code, Claude Agent SDK, Codex SDK, and Grok Build ACP are the published task-runtime paths.
50
+ - Codex TUI co-presence is preview-only and must be started and recovered with `--copresence`; see the [co-presence guide](https://anet.sh/guide/codex-copresence).
51
+ - OpenCode support is preview-only. Its automatic `npx` fallback is intentionally disabled, so install the documented CLI explicitly.
52
+ - Neither npm `latest` nor `preview` includes a shared Grok TUI. Use `grok-build-acp` for published Grok nodes and follow the [Grok TUI status page](https://anet.sh/guide/grok-copresence).
139
53
 
140
- On the hub machine:
54
+ Development branches may contain source-only runtime experiments. They are not supported installation paths until they appear in an npm dist-tag and the runtime guide.
141
55
 
142
- ```bash
143
- anet hub start --host 0.0.0.0
144
- ```
56
+ ## What it provides
145
57
 
146
- On another machine:
58
+ - **CommHub** — MCP, REST, SSE task delivery, authentication, networks, and audit state.
59
+ - **Agent Node** — long-running workers backed by the selected runtime.
60
+ - **Dashboard** — topology, chat, tasks, messages, and node health.
61
+ - **CLI** — setup, login, node/project lifecycle, channels, tokens, and diagnostics.
147
62
 
148
- ```bash
149
- npm install -g @sleep2agi/agent-network
150
- anet init --hub http://<HUB-LAN-IP>:9200
151
- anet login --username admin --password anethub
152
- anet node create remote-bot
153
- anet node start remote-bot
154
- ```
63
+ Runtimes with CommHub tool integration can discover peers and delegate work with tools such as `get_all_status`, `send_task`, and `get_task`. Replies and ordinary messages do not recursively invoke another model; see the [task lifecycle](https://anet.sh/concepts/task-lifecycle).
155
64
 
156
- Do not expose the hub directly to the public internet without a reverse proxy, HTTPS, firewall rules, and reviewed auth settings.
65
+ ## Security
157
66
 
158
- ## Runtimes
159
-
160
- | Runtime | Use When | Notes |
161
- |---|---|---|
162
- | `claude-code-cli` | You want Claude Code CLI sessions and channel support | Uses Claude Code process; supports stable `COMMHUB_RESUME_ID` in recent previews |
163
- | `claude-agent-sdk` | You want Anthropic-compatible API providers | Good default for provider presets |
164
- | `codex-sdk` | You want Codex-backed nodes | Useful as a backup runtime when Claude quota is constrained |
165
- | `codex-app-server` | You want a Codex TUI thread shared with network tasks | Canonical preview; connects to the local app-server over WebSocket |
166
- | `grok-build-acp` | You want Grok Build through `grok agent stdio` | Requires Grok Build CLI auth; stable for receive/reply, session persistence, and explicit `send_task` delegation |
167
- | `opencode-cli` | You want public OpenCode ACP with Anthropic/OpenAI presets | Canonical preview; exact `opencode-ai@1.18.1` and exact network/node pair required |
168
-
169
- ### Grok Build ACP
170
-
171
- `grok-build-acp` uses the local Grok Build CLI via Agent Client Protocol (ACP). Install and authenticate Grok first:
172
-
173
- ```bash
174
- curl -fsSL https://x.ai/cli/install.sh | bash
175
- grok
176
- ```
177
-
178
- Create and start a node:
179
-
180
- ```bash
181
- anet node create grok-demo --runtime grok-build-acp
182
- anet node start grok-demo
183
- ```
184
-
185
- Look for:
186
-
187
- ```text
188
- runtime: grok-build-acp
189
- SSE connected
190
- ```
191
-
192
- Stable support:
193
-
194
- - Receive CommHub tasks through SSE.
195
- - Run one Grok Build ACP turn per task.
196
- - Persist `grokSession` into `.anet/nodes/<name>/config.json`.
197
- - Resume the saved Grok session on the next task.
198
- - Reply to the original sender through CommHub.
199
- - Explicit delegation such as `给 A站助手 发任务: ...` is intercepted by `agent-node`, sent through CommHub with `parent_task_id`, and polled until the child task reaches `replied` or `failed`.
200
-
201
- Current boundary:
202
-
203
- - Grok native MCP tool injection is not the stable path yet.
204
- - For cross-agent delegation, use explicit delegation wording so `agent-node` handles the CommHub call deterministically.
205
- - If Grok returns `grok ACP error -32603`, upgrade to the latest `@sleep2agi/agent-node` and restart the node; recent builds narrow ACP capabilities and include `error.data` diagnostics.
206
-
207
- Details: `docs/grok-build-runtime.md`.
208
-
209
- ## Provider Presets
210
-
211
- `anet node create` writes the correct provider environment into `.anet/nodes/<name>/config.json`.
212
-
213
- | Provider | Status | Notes |
214
- |---|---|---|
215
- | Anthropic | verified path | Native Anthropic Messages API |
216
- | MiniMax | verified path | Anthropic-compatible endpoint |
217
- | DeepSeek | verified path | Anthropic-compatible endpoint |
218
- | GLM / Zhipu | verified path | Anthropic-compatible endpoint |
219
- | Kimi / Moonshot | verified path | Anthropic-compatible endpoint |
220
- | OpenRouter | available | Anthropic-compatible routing |
221
- | Custom | available | Provide base URL, model, and token |
222
-
223
- ## Common Commands
224
-
225
- ```bash
226
- # Hub and dashboard
227
- anet hub start
228
- anet hub dashboard
229
-
230
- # Auth
231
- anet register
232
- anet login --username <user> --password <password>
233
- anet logout
234
- anet whoami
235
- anet passwd
236
-
237
- # Nodes
238
- anet node create <name>
239
- anet node start <name>
240
- anet node start --all
241
- anet node stop <name>
242
- anet node resume <name>
243
- anet node rename <old> <new> --force
244
- anet node delete <name>
245
- anet node ls
246
- anet info <name>
247
- anet logs <name>
248
-
249
- # Network status and repair
250
- anet status
251
- anet tasks [status]
252
- anet doctor
253
- anet doctor --fix
254
-
255
- # Project and session helpers
256
- anet init --hub <url>
257
- anet init project
258
- anet project up
259
- anet project restart
260
- anet project down
261
- anet session ls
262
-
263
- # Channels and upgrades
264
- anet channel add telegram <name> --bot-token <tok> --allow <uid>
265
- anet channel add feishu <name> --app-id <id> --app-secret <secret> --allow <open-id> # see docs/feishu-quickstart.md
266
- anet channel ls
267
- anet upgrade
268
- anet upgrade --channel preview --dry-run
269
-
270
- # Batch / demos
271
- anet create --batch
272
- anet batch list
273
- anet batch stop <prefix>
274
- anet demo sci-team
275
- ```
276
-
277
- ## Configuration Files
278
-
279
- ```text
280
- ~/.anet/config.json
281
- Global CLI profile: hub URL, user token, default network.
282
-
283
- ~/.anet/server/admin-utok.json
284
- Local bootstrap admin token for the hub.
285
-
286
- {project}/.anet/nodes/<name>/config.json
287
- Per-node runtime, model, provider env, node token, channels, and session IDs.
288
- ```
289
-
290
- Example node config:
291
-
292
- ```json
293
- {
294
- "node_id": "n_a1b2c3d4",
295
- "node_name": "my-bot",
296
- "alias": "my-bot",
297
- "hub": "http://127.0.0.1:9200",
298
- "network_id": "default",
299
- "token": "ntok_...",
300
- "runtime": "claude-agent-sdk",
301
- "model": "your-model",
302
- "channels": ["server:commhub"],
303
- "tools": ["Read", "Write", "Edit", "Bash", "Glob", "Grep"],
304
- "env": {
305
- "ANTHROPIC_BASE_URL": "https://example.com/anthropic",
306
- "ANTHROPIC_AUTH_TOKEN": "sk-..."
307
- },
308
- "flags": {
309
- "dangerouslySkipPermissions": true,
310
- "teammateMode": "in-process",
311
- "maxTurns": 50
312
- }
313
- }
314
- ```
315
-
316
- Do not commit `.anet/` or provider API keys.
317
-
318
- ## Security Notes
319
-
320
- - The hub binds to `127.0.0.1` by default.
321
- - LAN mode is explicit: `anet hub start --host 0.0.0.0`.
322
- - Node tokens are network-scoped `ntok_` tokens; user tokens are `utok_`.
323
- - Keep API keys in local node config or env refs; never paste real keys into issues or docs.
324
- - Treat tmux / terminal streaming features as local-admin tools.
325
-
326
- ## What Is Stable vs Experimental
327
-
328
- Stable day-to-day path:
329
-
330
- - `anet hub start` / `anet hub stop` / `anet hub status` (v0.10.11+: SIGTERM → 3s grace → SIGKILL stop; status shows PID + port + `/health` version — no more manual `lsof+kill`)
331
- - `anet hub dashboard`
332
- - `anet login`
333
- - `anet node create/start/stop/delete/rename`
334
- - `anet node start --all`
335
- - `anet project up/restart/down`
336
- - Dashboard chat, task list, topology, and status views
337
-
338
- Actively evolving:
339
-
340
- - IM platform integration (Feishu / Slack / WhatsApp / WeCom)
341
- - Telegram channel binding
342
- - Advanced dashboard topology edges
343
- - Batch orchestration and science-team demos
344
- - Codex runtime expansion
345
- - Grok Build ACP runtime
346
- - Cross-version rename hot-reload
67
+ The default Hub is local-only. Before exposing it beyond localhost, change the initial password and follow the [production deployment guide](https://anet.sh/deploy/production). Do not copy `.anet` node configs between machines: they contain network-bound identity and token material.
347
68
 
348
69
  ## Documentation
349
70
 
350
- - Docs site: https://anet.sh
351
- - Getting started: https://anet.sh/guide/getting-started
352
- - Preview guide: https://anet.sh/guide/preview/getting-started
353
- - Issues: https://github.com/sleep2agi/agent-network/issues
354
-
355
- ## Repository Layout
356
-
357
- This package lives in the `agent-network/` subdirectory of the monorepo:
358
-
359
- ```text
360
- agent-network/
361
- bin/cli.ts anet CLI
362
- src/client.ts SDK client
363
- src/node-server.ts CommHub MCP server bridge used by claude-code-cli
364
- src/im/ IM integration contracts and future adapters
365
- ```
366
-
367
- Related packages live next to it:
368
-
369
- ```text
370
- server/ @sleep2agi/commhub-server
371
- agent-node/ @sleep2agi/agent-node
372
- docs-site/ anet.sh documentation site
373
- ```
374
-
375
- ## License
71
+ - [Getting started](https://anet.sh/guide/getting-started)
72
+ - [CLI reference](https://anet.sh/guide/cli)
73
+ - [Runtime guide](https://anet.sh/guide/runtimes)
74
+ - [Tokens and permissions](https://anet.sh/concepts/tokens)
75
+ - [Troubleshooting](https://anet.sh/troubleshooting)
76
+ - [GitHub repository](https://github.com/sleep2agi/agent-network)
376
77
 
377
- Apache-2.0
78
+ Apache-2.0.