@sleep2agi/agent-node 2.4.5 → 2.4.6-preview.0

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.
Files changed (3) hide show
  1. package/README.md +35 -4
  2. package/dist/cli.js +31 -31
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @sleep2agi/agent-node
2
2
 
3
- Agent runtime for Agent Network. Connects to a CommHub server, registers under an alias, and processes incoming tasks with one of three runtimes.
3
+ 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.
4
4
 
5
5
  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.
6
6
 
@@ -52,11 +52,39 @@ CLI flags:
52
52
  | `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 |
53
53
  | `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 |
54
54
  | `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)) |
55
- | `grok-build-acp` | local `grok agent stdio` | engineering preview | requires Grok Build CLI login; stable for receive/reply, session persistence, and explicit CommHub delegation handled by agent-node |
55
+ | `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 |
56
56
  | `http-api` | OpenAI/Anthropic-compatible HTTP | experimental | reads `ANTHROPIC_*`, `OPENAI_*`, or `MINIMAX_CODING_API_KEY` environment variables |
57
57
 
58
58
  Runtimes are loaded lazily — picking one doesn't pull the others' dependencies. `claude-code-cli` adds zero extra SDK weight.
59
59
 
60
+ ## Long-running goals for codex-sdk
61
+
62
+ `codex-sdk` itself does not provide a native `/goal`, timer, cron, or scheduler API. `agent-node` provides an Agent Network scheduler around it:
63
+
64
+ - send a task that starts with `/goal` or `/loop`
65
+ - the node persists the goal in `.anet/nodes/<name>/goals.json`
66
+ - the running `agent-node` process wakes the runtime on the requested interval
67
+ - each wake asks the agent to check current state, make incremental progress, and report back
68
+ - if the reply contains `目标已完成` or `goal completed`, the goal is marked complete
69
+
70
+ Example task:
71
+
72
+ ```text
73
+ /goal 每30分钟检查 PR #188 的 CI,修复失败,并在 issue #189 汇报进展
74
+ ```
75
+
76
+ Accepted intervals include `1min`, `5 min`, `hourly`, `daily`, `每5分钟`, `每小时`, and `每天`. Sub-minute intervals such as `30s` or `30秒` are rejected.
77
+
78
+ When a node starts, its log prints the goal store path:
79
+
80
+ ```text
81
+ goals: .anet/nodes/<name>/goals.json
82
+ ```
83
+
84
+ Existing running nodes must be restarted after upgrading `agent-node`; Node.js processes do not hot-load the new scheduler code. Goals already written to `goals.json` are reloaded on restart.
85
+
86
+ Current boundary: there is not yet an `anet goal list/pause/cancel` management CLI or Dashboard goal panel. Use the create reply, node logs, and `goals.json` for now.
87
+
60
88
  ## Grok Build ACP
61
89
 
62
90
  `grok-build-acp` runs the local Grok Build CLI over Agent Client Protocol:
@@ -70,18 +98,21 @@ anet node start grok-demo
70
98
 
71
99
  The runtime starts `grok agent stdio`, authenticates with the cached Grok login, opens or loads a Grok session, sends the task prompt, collects streamed ACP notifications, and writes `grokSession` back to the node config.
72
100
 
73
- Preview-stable behavior:
101
+ Stable behavior:
74
102
 
75
103
  - CommHub task delivery and replies are handled by `agent-node`, not by Grok itself.
76
104
  - Plain text tasks should be answered directly by Grok.
77
- - Explicit delegation tasks are intercepted before Grok when they use a clear pattern such as `给 <alias> 发任务: <task>`.
105
+ - Explicit delegation tasks are intercepted before Grok when they use `给 <alias> 发任务: <task>` or `给 <alias> 派任务: <task>`.
78
106
  - Intercepted delegation calls CommHub directly, passes `parent_task_id`, polls `get_task`, and returns the child result.
79
107
 
80
108
  Known boundary:
81
109
 
82
110
  - Native Grok MCP tool injection is still experimental. Do not rely on Grok itself seeing `commhub_get_all_status` or `commhub_send_task`.
83
111
  - Image attachments are currently text-only because the captured Grok ACP capability reports `promptCapabilities.image=false`.
112
+ - If startup reports `grok CLI not found`, install Grok Build and confirm `grok --version` works.
113
+ - If authentication fails, run `grok` interactively once, then restart the node.
84
114
  - `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.
115
+ - 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.
85
116
 
86
117
  ## Provider presets (claude-agent-sdk)
87
118