@sleep2agi/agent-node 2.5.0-preview.24 → 2.5.0-preview.26
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 +15 -108
- package/dist/cli.js +129 -156
- package/package.json +6 -9
package/README.md
CHANGED
|
@@ -5,25 +5,33 @@
|
|
|
5
5
|
[](https://github.com/sleep2agi/agent-network/blob/main/LICENSE)
|
|
6
6
|
[](https://anet.sh)
|
|
7
7
|
|
|
8
|
-
Agent runtime for Agent Network. Connects to a CommHub server, registers under an alias, and processes incoming tasks with Claude, Codex, Grok Build,
|
|
8
|
+
Agent runtime for Agent Network. Connects to a CommHub server, registers under an alias, and processes incoming tasks with Claude, Codex, Codex app-server, Grok Build, or OpenCode ACP runtimes.
|
|
9
9
|
|
|
10
10
|
The supported entry point is the `anet` CLI from `@sleep2agi/agent-network`, which writes the right `config.json`, network token, and environment variables for you.
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
You usually don't install this package directly —
|
|
14
|
+
You usually don't install this package directly — `anet node create` and `anet node start` use it via `npx`. To pin it:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install -g @sleep2agi/agent-node
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
For the canonical OpenCode preview, install the entire vetted pair exactly. The OpenCode path does not execute an ambient package or automatic `npx` fallback:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @sleep2agi/agent-network@2.3.0-preview.34 \
|
|
24
|
+
@sleep2agi/agent-node@2.5.0-preview.26 \
|
|
25
|
+
opencode-ai@1.18.1
|
|
26
|
+
```
|
|
27
|
+
|
|
20
28
|
## Verified flow
|
|
21
29
|
|
|
22
30
|
```bash
|
|
23
31
|
npm install -g @sleep2agi/agent-network
|
|
24
32
|
anet hub start # local hub (terminal 1)
|
|
25
33
|
anet hub dashboard # web UI (terminal 2)
|
|
26
|
-
anet login --username admin --password anethub
|
|
34
|
+
anet login --hub http://127.0.0.1:9200 --username admin --password anethub
|
|
27
35
|
anet node create my-bot # two-step picker: runtime, then provider
|
|
28
36
|
anet node start my-bot # → SSE connected
|
|
29
37
|
```
|
|
@@ -44,7 +52,7 @@ CLI flags:
|
|
|
44
52
|
|---|---|---|
|
|
45
53
|
| `--alias` | required | unique name in the hub |
|
|
46
54
|
| `--hub` | `http://127.0.0.1:9200` | CommHub URL |
|
|
47
|
-
| `--runtime` | `claude-agent-sdk` | `claude-agent-sdk` / `
|
|
55
|
+
| `--runtime` | `claude-agent-sdk` | `claude-agent-sdk` / `claude-code-cli` / `codex-sdk` / `codex-app-server` / `grok-build-acp` / `opencode-cli` |
|
|
48
56
|
| `--model` | runtime default | passed through to the SDK |
|
|
49
57
|
| `--tools` | (none) | `all` or comma-separated list |
|
|
50
58
|
| `--max-turns` | `50` | upper bound per task |
|
|
@@ -57,44 +65,11 @@ CLI flags:
|
|
|
57
65
|
| `claude-agent-sdk` | [@anthropic-ai/claude-agent-sdk](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) | verified | Anthropic-compatible API; works with MiniMax, DeepSeek, GLM, Kimi, Anthropic, OpenRouter, or custom endpoints |
|
|
58
66
|
| `codex-sdk` | [@openai/codex-sdk](https://www.npmjs.com/package/@openai/codex-sdk) | unverified end-to-end | unit tests pass, no full E2E with real codex auth |
|
|
59
67
|
| `claude-code-cli` | local `claude` CLI | unverified end-to-end | runs locally for Claude Pro subscribers (v0.8.2 fixed the session-resume default-loss bug; see [changelog](https://anet.sh/en/changelog)) |
|
|
68
|
+
| `codex-app-server` | local `codex app-server` WebSocket | preview, Windows-verified | shares a Codex TUI thread with dispatched network tasks |
|
|
60
69
|
| `grok-build-acp` | local `grok agent stdio` | stable runtime, native MCP injection boundary remains preview | requires Grok Build CLI login; stable for receive/reply, session persistence, and explicit CommHub delegation handled by agent-node |
|
|
61
|
-
| `
|
|
62
|
-
| `opencode-cli` | local `opencode acp` | preview, Docker E2E gated | exact `opencode-ai@1.18.1`; Anthropic/OpenAI API presets; safe text-only default with fresh private state roots |
|
|
63
|
-
| `http-api` | OpenAI/Anthropic-compatible HTTP | experimental | reads `ANTHROPIC_*`, `OPENAI_*`, or `MINIMAX_CODING_API_KEY` environment variables |
|
|
64
|
-
|
|
65
|
-
Runtimes are loaded lazily — picking one doesn't pull the others' dependencies. `claude-code-cli` adds zero extra SDK weight.
|
|
66
|
-
|
|
67
|
-
## OpenCode ACP preview
|
|
68
|
-
|
|
69
|
-
Use the paired launcher rather than invoking this package directly:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm install -g @sleep2agi/agent-network@preview @sleep2agi/agent-node@preview opencode-ai@1.18.1
|
|
73
|
-
anet node create opencode-demo --runtime opencode-cli
|
|
74
|
-
anet node start opencode-demo
|
|
75
|
-
```
|
|
70
|
+
| `opencode-cli` | exact `opencode-ai@1.18.1` ACP child | canonical preview, release-gated | defaults to a launch-scoped external workspace with tools disabled; Anthropic/OpenAI presets |
|
|
76
71
|
|
|
77
|
-
The
|
|
78
|
-
and the unattended `question` tool. This preview requires Linux for both safe
|
|
79
|
-
and unsafe OpenCode launches. Safe mode creates one external,
|
|
80
|
-
random, `0700`, launch-scoped root containing the empty workspace and fresh
|
|
81
|
-
HOME/XDG tree; copied API credentials, OpenCode DB/log files, and the workspace
|
|
82
|
-
are removed together after exit. Only explicit
|
|
83
|
-
`flags.opencodeUnsafeTools=true` restores project cwd and local tools for
|
|
84
|
-
trusted tasks, but it is not a sandbox.
|
|
85
|
-
|
|
86
|
-
The default trusted base is `/run/user/$uid`. Non-systemd environments must
|
|
87
|
-
pre-create an owner-only directory and set its absolute path through
|
|
88
|
-
`ANET_OPENCODE_SAFE_BASE`. The base and all ancestors must be canonical
|
|
89
|
-
directories with no group/other write bit; an unverifiable base or non-Linux
|
|
90
|
-
host makes the runtime fail closed. Unsafe mode still needs the same external
|
|
91
|
-
writable root; it changes only cwd/tool policy. Exact 1.18.1 workspace ancestors are rejected
|
|
92
|
-
if they contain `opencode.jsonc`, `opencode.json`, `.opencode`, `AGENTS.md`,
|
|
93
|
-
`CLAUDE.md`, `CONTEXT.md`, `.claude`, `.agents`, or `.git`; identities and
|
|
94
|
-
candidates are revalidated after the version probe immediately before spawn.
|
|
95
|
-
`OPENCODE_PURE` / `OPENCODE_DISABLE_PROJECT_CONFIG` and the other discovery
|
|
96
|
-
disable flags are defense in depth only. A process restart may therefore log
|
|
97
|
-
`session lost on restart` and open a new session.
|
|
72
|
+
The canonical preview picker exposes exactly these 6 runtimes. They are loaded lazily; picking one does not pull the others' SDK dependencies. `claude-code-cli` adds zero extra SDK weight.
|
|
98
73
|
|
|
99
74
|
## Grok Build ACP
|
|
100
75
|
|
|
@@ -123,74 +98,6 @@ Known boundary:
|
|
|
123
98
|
- `grok ACP error -32603` is treated as retryable once with a fresh session; the runtime now logs JSON-RPC `error.data` when Grok provides it.
|
|
124
99
|
- Grok tool-state boilerplate such as "Do not attempt to use tools from these servers yet" is stripped from final CommHub replies so users see the actual task answer.
|
|
125
100
|
|
|
126
|
-
## Grok shared TUI — experimental preview
|
|
127
|
-
|
|
128
|
-
> **Not production-ready:** network tasks drive the same TUI and share its conversation context. Approval ownership is not fully hardened. Use only with trusted tasks on a trusted network. This path belongs to the npm `preview` channel and is not a capability claim for `latest`.
|
|
129
|
-
|
|
130
|
-
The preview is currently supported only on Linux with procfs mounted at `/proc` (including `/proc/self/fd`) and is pinned to build `grok 0.2.93 (f00f96316d)`; the known stable installer prints the same build with an optional trailing ` [stable]`. Install and authenticate that Grok CLI build as the same operating-system user that runs the node:
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
grok login
|
|
134
|
-
grok --version
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Use the supported `anet` entry point. In terminal 1:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
anet node create grok-shared --runtime grok-build-cli
|
|
141
|
-
anet node start grok-shared
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
In terminal 2 on the same machine and user account:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
anet grok attach grok-shared
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
`anet node start` owns the Grok PTY and the local attach socket. `anet grok attach` relays that same terminal and detaches on `Ctrl-]`. A task delivered by CommHub is submitted into the visible shared session, and the completed answer is routed back to the originating task.
|
|
151
|
-
|
|
152
|
-
For credential isolation, this preview selects a runtime-owned TUI agent
|
|
153
|
-
profile with the exact model-tool inventory `[todo_write]`. Filesystem, shell,
|
|
154
|
-
network, media, MCP, scheduler, and subagent tools are unavailable. Generic
|
|
155
|
-
`tools` and `maxTurns` settings are rejected in co-presence because pinned
|
|
156
|
-
Grok ignores those CLI flags in interactive mode. This is a text-only shared
|
|
157
|
-
conversation preview, not a coding runtime.
|
|
158
|
-
|
|
159
|
-
Grok 0.2.93 automatically resolves the fixed session-local `todo_write`
|
|
160
|
-
helper. The preview accepts at most one exact observed no-request-ID
|
|
161
|
-
`permission_requested` → `permission_resolved(decision=allow)` lifecycle
|
|
162
|
-
during each active network turn and only when no human decision was sent. Every
|
|
163
|
-
other automatic, mismatched, overlapping, or unfinished permission lifecycle
|
|
164
|
-
still fails closed. This exception is preview-only and does not satisfy the
|
|
165
|
-
approval-owner gate required for `latest`.
|
|
166
|
-
|
|
167
|
-
If no compatible global `agent-node` is installed, `anet` uses `npx -y @sleep2agi/agent-node@preview` to fetch and resolve the package, verifies preview metadata plus the machine-readable `ANET_CAPABILITY_GROK_COPRESENCE_V2` marker, and then launches the resolved entrypoint directly so stop signals reach the real runtime. An older headless-only or V1 co-presence package does not pass this check. First start therefore needs npm registry access or an already populated npm cache. An incompatible global package is not silently allowed to select another runtime.
|
|
168
|
-
|
|
169
|
-
This preview supports the CommHub inbox lane used by `anet node start`.
|
|
170
|
-
Feishu configuration is rejected for `grok-build-cli`: its forked worker log
|
|
171
|
-
path is not yet inside this runtime's credential-isolated boundary. The npm
|
|
172
|
-
resolver, agent-node parent, Grok probes, PTY, and helper processes each use
|
|
173
|
-
an exact from-empty environment; durable pending replies and goal state are
|
|
174
|
-
redacted and owner-only. Same-UID host processes remain trusted.
|
|
175
|
-
|
|
176
|
-
The legacy process-per-turn Grok CLI path uses the same runtime name with an explicit creation flag:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
anet node create grok-turn --runtime grok-build-cli --grok-headless
|
|
180
|
-
anet node start grok-turn
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
This headless node cannot be used with `anet grok attach`. It is also distinct from ACP headless mode:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
anet node create grok-acp --runtime grok-build-acp
|
|
187
|
-
anet node start grok-acp
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
`grok-build-acp` launches `grok agent stdio`; `grok-build-cli --grok-headless` launches one streaming-JSON Grok CLI turn per task.
|
|
191
|
-
|
|
192
|
-
The formal native Leader/Policy Gateway design is not shipped by this experimental path. Its Phase 0 protocol freeze, Phase 1A gate, production-grade approval ownership, and `latest` release gate remain locked. See the [Grok co-presence preview guide](../docs/grok-build-cli-preview.md).
|
|
193
|
-
|
|
194
101
|
## Provider presets (claude-agent-sdk)
|
|
195
102
|
|
|
196
103
|
`anet node create` step 2 picks one of these and writes `ANTHROPIC_BASE_URL` + a default model. All Anthropic-compatible HTTP API; `--model` is passed through verbatim.
|