@sleep2agi/agent-node 2.5.0-preview.21 → 2.5.0-preview.23
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 +36 -3
- package/dist/cli.js +116 -110
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
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, or compatible HTTP runtimes.
|
|
8
|
+
Agent runtime for Agent Network. Connects to a CommHub server, registers under an alias, and processes incoming tasks with Claude, Codex, Grok Build, OpenCode, or compatible HTTP 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 — except for preview `opencode-cli`, which requires the exact paired global `agent-network`/`agent-node` versions and `opencode-ai@1.18.1`. That credential-bearing path never auto-runs project-context `npx`; `anet` accepts only canonical exact package identities and refuses older or project/monorepo-local capable-looking packages. For the experimental `grok-build-cli` co-presence runtime, `anet` similarly capability-checks the global package. To pin the stable package for other runtimes:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install -g @sleep2agi/agent-node
|
|
@@ -44,7 +44,7 @@ CLI flags:
|
|
|
44
44
|
|---|---|---|
|
|
45
45
|
| `--alias` | required | unique name in the hub |
|
|
46
46
|
| `--hub` | `http://127.0.0.1:9200` | CommHub URL |
|
|
47
|
-
| `--runtime` | `claude-agent-sdk` | `claude-agent-sdk` / `codex-sdk` / `claude-code-cli` / `grok-build-acp` / `grok-build-cli` / `http-api` |
|
|
47
|
+
| `--runtime` | `claude-agent-sdk` | `claude-agent-sdk` / `codex-sdk` / `codex-app-server` / `claude-code-cli` / `grok-build-acp` / `grok-build-cli` / `opencode-cli` / `http-api` |
|
|
48
48
|
| `--model` | runtime default | passed through to the SDK |
|
|
49
49
|
| `--tools` | (none) | `all` or comma-separated list |
|
|
50
50
|
| `--max-turns` | `50` | upper bound per task |
|
|
@@ -59,10 +59,43 @@ CLI flags:
|
|
|
59
59
|
| `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)) |
|
|
60
60
|
| `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
61
|
| `grok-build-cli` | local Grok TUI or process-per-turn Grok CLI | dangerous experimental preview | shared TUI is text-only with fixed `[todo_write]`; Linux and exact Grok `0.2.93 (f00f96316d)` required; trusted tasks only |
|
|
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 |
|
|
62
63
|
| `http-api` | OpenAI/Anthropic-compatible HTTP | experimental | reads `ANTHROPIC_*`, `OPENAI_*`, or `MINIMAX_CODING_API_KEY` environment variables |
|
|
63
64
|
|
|
64
65
|
Runtimes are loaded lazily — picking one doesn't pull the others' dependencies. `claude-code-cli` adds zero extra SDK weight.
|
|
65
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
|
+
```
|
|
76
|
+
|
|
77
|
+
The default runtime policy disables local filesystem/shell/delegation tools
|
|
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.
|
|
98
|
+
|
|
66
99
|
## Grok Build ACP
|
|
67
100
|
|
|
68
101
|
`grok-build-acp` runs the local Grok Build CLI over Agent Client Protocol:
|