@sleep2agi/agent-network 2.3.0-preview.26 → 2.3.0-preview.27
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 +119 -9
- package/dist/bin/cli.d.ts +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/src/client.js +1 -1
- package/dist/src/grok-attach-client.d.ts +115 -0
- package/dist/src/grok-copresence-profile.d.ts +44 -0
- package/dist/src/im/feishu/worker.js +1 -1
- package/dist/src/node-server.js +1 -1
- package/dist/src/normalize-runtime.d.ts +1 -9
- package/dist/src/opencode-agent-node-pair.d.ts +14 -0
- package/dist/src/opencode-auth-login.d.ts +43 -0
- package/dist/src/opencode-launch-env.d.ts +13 -0
- package/dist/src/opencode-owner-mode.d.ts +6 -0
- package/dist/src/opencode-package-binary.d.ts +21 -0
- package/dist/src/opencode-pin.d.ts +6 -1
- package/dist/src/opencode-preset.d.ts +37 -8
- package/dist/src/opencode-safe-root.d.ts +27 -0
- package/dist/src/opencode-smoke-env.d.ts +1 -0
- package/dist/src/runtime-choices.d.ts +15 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -49,14 +49,17 @@ npm install -g @sleep2agi/agent-network@preview
|
|
|
49
49
|
anet -v
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Npm dist-tags move independently. Query the registry instead of relying on a
|
|
53
|
+
version table embedded in this source tree:
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
```bash
|
|
56
|
+
npm view @sleep2agi/agent-network dist-tags --json
|
|
57
|
+
npm view @sleep2agi/agent-node dist-tags --json
|
|
58
|
+
npm view @sleep2agi/commhub-server dist-tags --json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The Grok co-presence text below describes candidate source only until a
|
|
62
|
+
reviewed package is explicitly published to `preview`.
|
|
60
63
|
|
|
61
64
|
## 5-Minute Quick Start
|
|
62
65
|
|
|
@@ -98,8 +101,8 @@ anet node start my-bot
|
|
|
98
101
|
|
|
99
102
|
`anet node create` walks you through:
|
|
100
103
|
|
|
101
|
-
1. Runtime: `claude-code-cli`, `claude-agent-sdk`, `codex-sdk`,
|
|
102
|
-
2. Provider preset:
|
|
104
|
+
1. Runtime: `claude-code-cli`, `claude-agent-sdk`, `codex-sdk`, `codex-app-server`, `grok-build-acp`, the experimental preview-only `grok-build-cli`, or preview `opencode-cli`.
|
|
105
|
+
2. Provider preset: runtime-specific options, including Anthropic/OpenAI API-key presets for `opencode-cli` (other Anthropic-compatible providers remain available through `claude-agent-sdk`).
|
|
103
106
|
3. API key and model settings.
|
|
104
107
|
|
|
105
108
|
When the node starts successfully, look for:
|
|
@@ -154,7 +157,47 @@ Do not expose the hub directly to the public internet without a reverse proxy, H
|
|
|
154
157
|
| `claude-code-cli` | You want Claude Code CLI sessions and channel support | Uses Claude Code process; supports stable `COMMHUB_RESUME_ID` in recent previews |
|
|
155
158
|
| `claude-agent-sdk` | You want Anthropic-compatible API providers | Good default for provider presets |
|
|
156
159
|
| `codex-sdk` | You want Codex-backed nodes | Useful as a backup runtime when Claude quota is constrained |
|
|
160
|
+
| `codex-app-server` | You want a Codex TUI/app-server bridge | Preview bridge with a bound Codex thread |
|
|
157
161
|
| `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 |
|
|
162
|
+
| `grok-build-cli` | You want one human-visible, text-only Grok TUI shared with trusted network tasks | **Experimental preview only.** Fixed `[todo_write]` tool profile; Linux and an exact Grok CLI build are required; approval ownership is not fully hardened |
|
|
163
|
+
| `opencode-cli` | You want OpenCode ACP with an Anthropic/OpenAI API preset or a keyless OpenCode model | **Preview only.** Requires exact `opencode-ai@1.18.1` and the paired preview packages; safe mode is text-only and uses fresh private runtime roots |
|
|
164
|
+
|
|
165
|
+
### OpenCode ACP — Preview
|
|
166
|
+
|
|
167
|
+
Install the exact release pair and vetted OpenCode pin, then create a node:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
npm install -g @sleep2agi/agent-network@preview @sleep2agi/agent-node@preview opencode-ai@1.18.1
|
|
171
|
+
anet node create opencode-demo --runtime opencode-cli
|
|
172
|
+
anet node start opencode-demo
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
All three are deliberate global prerequisites for this preview. The OpenCode
|
|
176
|
+
launch path does not auto-run `npx` from a project-controlled PATH. It accepts
|
|
177
|
+
only canonical npm package entrypoints with exact metadata and rejects an
|
|
178
|
+
otherwise convincing same-version package inside the current project or an
|
|
179
|
+
enclosing monorepo workspace.
|
|
180
|
+
|
|
181
|
+
The wizard supports Anthropic and OpenAI API-key presets. If the selected key
|
|
182
|
+
is not exported, use the printed `anet opencode auth-login` command; OpenAI is
|
|
183
|
+
forced to the upstream `Manually enter API Key` method. By default OpenCode
|
|
184
|
+
runs only on Linux in an external random `0700` launch-scoped root whose
|
|
185
|
+
`workspace` and fresh private HOME/XDG roots are removed together after exit.
|
|
186
|
+
Local code tools and unattended `question` are disabled. Only explicit
|
|
187
|
+
`flags.opencodeUnsafeTools=true` restores the project cwd for trusted tasks.
|
|
188
|
+
|
|
189
|
+
The default trusted base is `/run/user/$uid`. On a non-systemd host, pre-create
|
|
190
|
+
an owner-only directory and set its absolute path in
|
|
191
|
+
`ANET_OPENCODE_SAFE_BASE`; the base and every ancestor must not be group/other
|
|
192
|
+
writable. The whole preview runtime (safe and unsafe) hard-fails when the base
|
|
193
|
+
cannot be verified or the host is not Linux. Unsafe still uses the external
|
|
194
|
+
writable root; it changes only cwd and local-tool policy. For exact 1.18.1, every workspace ancestor is scanned for
|
|
195
|
+
`opencode.jsonc`, `opencode.json`, `.opencode`, `AGENTS.md`, `CLAUDE.md`,
|
|
196
|
+
`CONTEXT.md`, `.claude`, `.agents`, and `.git`, then its identity and candidates
|
|
197
|
+
are checked again after the version probe immediately before ACP spawn.
|
|
198
|
+
`OPENCODE_PURE` and `OPENCODE_DISABLE_PROJECT_CONFIG` remain defense in depth,
|
|
199
|
+
not the isolation boundary. Local OpenCode conversation history is not promised
|
|
200
|
+
across process crashes; use Docker/VM when an OS security boundary is needed.
|
|
158
201
|
|
|
159
202
|
### Grok Build ACP
|
|
160
203
|
|
|
@@ -196,6 +239,68 @@ Current boundary:
|
|
|
196
239
|
|
|
197
240
|
Details: `docs/grok-build-runtime.md`.
|
|
198
241
|
|
|
242
|
+
### Grok Co-Presence TUI — Experimental Preview
|
|
243
|
+
|
|
244
|
+
> **Dangerous experimental feature:** network tasks drive the same Grok TUI and share its conversation context. Approval ownership is not fully hardened. Use only with trusted tasks on a trusted network. This runtime is not supported for production and is not part of the `latest` release channel.
|
|
245
|
+
|
|
246
|
+
The co-presence candidate is currently pinned to Linux with procfs mounted at `/proc` (including `/proc/self/fd`) and the exact Grok CLI build reported as `grok 0.2.93 (f00f96316d)` (the stable installer may append ` [stable]`). Install that build and log in as the same operating-system user that will run `anet`:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
grok login
|
|
250
|
+
grok --version
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Create the shared-TUI node and start its bridge in the first terminal:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
anet node create grok-shared --runtime grok-build-cli
|
|
257
|
+
anet node start grok-shared
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Attach an interactive terminal to the same TUI from a second terminal on the same machine and user account:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
anet grok attach grok-shared
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Press `Ctrl-]` to detach. While attached, a CommHub task sent to `grok-shared` is submitted to this same TUI, rendered in the visible session, and its completed answer is routed back to the originating task. This shared-session behavior is the reason untrusted tasks must not be connected.
|
|
267
|
+
|
|
268
|
+
This preview selects a runtime-owned TUI agent profile whose exact model-tool
|
|
269
|
+
inventory is `[todo_write]`. Filesystem, shell, network, media, MCP, scheduler,
|
|
270
|
+
and subagent tools are unavailable; custom `tools`/`maxTurns` are unsupported
|
|
271
|
+
in co-presence. It is a text-only co-presence preview, not a coding profile.
|
|
272
|
+
|
|
273
|
+
The pinned 0.2.93 TUI resolves its session-local `todo_write` helper without
|
|
274
|
+
human input. During an active network turn the preview admits only that exact
|
|
275
|
+
no-request-ID lifecycle with `decision=allow`, at most once per turn; every other tool, identity,
|
|
276
|
+
decision, overlap, mode transition, or unresolved completion remains closed.
|
|
277
|
+
This deliberately narrow preview exception is not production approval-owner
|
|
278
|
+
enforcement and is another reason to connect trusted tasks only.
|
|
279
|
+
|
|
280
|
+
`anet node start` capability-checks a compatible global `agent-node` if one exists. It requires the machine-readable `ANET_CAPABILITY_GROK_COPRESENCE_V2` marker, so an older headless-only or V1 co-presence binary cannot shadow the fixed-profile preview. A global install is not required: when it is absent or incompatible, `anet` uses `npx -y @sleep2agi/agent-node@preview` to fetch and resolve the preview package, verifies its metadata/capability, then launches the resolved `agent-node` entrypoint directly. Direct launch lets `anet node stop` signal the real runtime instead of an installer wrapper. The fallback therefore needs npm registry access or an already populated npm cache on first start.
|
|
281
|
+
|
|
282
|
+
The preview E2E covers the CommHub inbox path. `grok-build-cli` currently
|
|
283
|
+
refuses Feishu channels because that forked worker does not yet share the
|
|
284
|
+
credential-isolated log boundary; run Feishu on a separate non-Grok node.
|
|
285
|
+
|
|
286
|
+
For the older process-per-turn Grok CLI lane, opt out of co-presence explicitly:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
anet node create grok-turn --runtime grok-build-cli --grok-headless
|
|
290
|
+
anet node start grok-turn
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
`anet grok attach` intentionally refuses a headless node. The separate ACP runtime remains available as:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
anet node create grok-acp --runtime grok-build-acp
|
|
297
|
+
anet node start grok-acp
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
`grok-build-acp` uses `grok agent stdio`; it is not the same execution path as `grok-build-cli --grok-headless`.
|
|
301
|
+
|
|
302
|
+
This preview does **not** claim completion of the formal native Leader/Policy Gateway runtime. Its Phase 0 protocol freeze, Phase 1A implementation gate, production-grade approval ownership, and `latest` release gate remain locked. See the [Grok co-presence preview guide](../docs/grok-build-cli-preview.md) for the exact boundary.
|
|
303
|
+
|
|
199
304
|
## Provider Presets
|
|
200
305
|
|
|
201
306
|
`anet node create` writes the correct provider environment into `.anet/nodes/<name>/config.json`.
|
|
@@ -236,6 +341,11 @@ anet node ls
|
|
|
236
341
|
anet info <name>
|
|
237
342
|
anet logs <name>
|
|
238
343
|
|
|
344
|
+
# Grok co-presence (experimental preview; trusted tasks only)
|
|
345
|
+
anet node create grok-shared --runtime grok-build-cli
|
|
346
|
+
anet node start grok-shared
|
|
347
|
+
anet grok attach grok-shared
|
|
348
|
+
|
|
239
349
|
# Network status and repair
|
|
240
350
|
anet status
|
|
241
351
|
anet tasks [status]
|
package/dist/bin/cli.d.ts
CHANGED