autowonder 0.2.1 → 0.2.2
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
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
AutoWonder 本地 agent runtime。安装后启动 daemon,持续轮询本地 assignment 队列并执行任务包。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 连接 AutoWonder 服务
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
#
|
|
9
|
-
npx -y autowonder@0.2.
|
|
8
|
+
# Qoder CLI
|
|
9
|
+
npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
npx -y autowonder@0.2.
|
|
11
|
+
# Claude Code
|
|
12
|
+
npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider claude
|
|
13
|
+
|
|
14
|
+
# Codex CLI
|
|
15
|
+
npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider codex
|
|
13
16
|
```
|
|
14
17
|
|
|
15
|
-
`
|
|
18
|
+
`connect` 会安装当前 npm 包内置的 daemon,并使用页面生成的 WebSocket endpoint、Token 和执行器 ID 建立连接。目标机器必须提前安装并登录对应的 Qoder CLI、Claude Code 或 Codex CLI;runtime 会继承当前用户的 HOME、环境变量和 CLI 登录状态。
|
|
16
19
|
|
|
17
20
|
## 提交 assignment
|
|
18
21
|
|
|
@@ -28,14 +31,14 @@ mv "$queue/.assignment.tmp" "$queue/assignment.json"
|
|
|
28
31
|
也可以直接提交到本地 API:
|
|
29
32
|
|
|
30
33
|
```bash
|
|
31
|
-
npx -y autowonder@0.2.
|
|
34
|
+
npx -y autowonder@0.2.2 dispatch ./assignment.json
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
## 管理 daemon
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
|
-
npx -y autowonder@0.2.
|
|
38
|
-
npx -y autowonder@0.2.
|
|
40
|
+
npx -y autowonder@0.2.2 status
|
|
41
|
+
npx -y autowonder@0.2.2 stop
|
|
39
42
|
```
|
|
40
43
|
|
|
41
44
|
默认 API 是 `http://127.0.0.1:34989`,日志位于 `~/.autowonder/daemon.log`。npm 包不包含任何 agent、MCP 或服务端凭证。
|
package/bin/cli.js
CHANGED
|
@@ -42,7 +42,9 @@ function detectProvider() {
|
|
|
42
42
|
const providers = [];
|
|
43
43
|
try { execFileSync("which", ["claude"], { stdio: "ignore" }); providers.push("claude"); } catch {}
|
|
44
44
|
try { execFileSync("which", ["codex"], { stdio: "ignore" }); providers.push("codex"); } catch {}
|
|
45
|
-
try { execFileSync("which", ["
|
|
45
|
+
try { execFileSync("which", ["qodercli"], { stdio: "ignore" }); providers.push("qoder"); } catch {
|
|
46
|
+
try { execFileSync("which", ["qoder"], { stdio: "ignore" }); providers.push("qoder"); } catch {}
|
|
47
|
+
}
|
|
46
48
|
return providers;
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -270,28 +272,32 @@ function buildFromSource() {
|
|
|
270
272
|
// ─── Commands ────────────────────────────────────────────────────────
|
|
271
273
|
|
|
272
274
|
async function cmdConnect(args) {
|
|
273
|
-
const flags = parseFlags(args, ["token", "
|
|
275
|
+
const flags = parseFlags(args, ["ws-url", "token", "executor-id", "provider", "name", "max-tasks"]);
|
|
274
276
|
|
|
275
|
-
if (!flags.token
|
|
276
|
-
error("Usage: autowonder connect --
|
|
277
|
+
if (!flags["ws-url"] || !flags.token || !flags["executor-id"]) {
|
|
278
|
+
error("Usage: autowonder connect --ws-url <url> --token <token> --executor-id <id> [--provider qoder]");
|
|
277
279
|
process.exit(1);
|
|
278
280
|
}
|
|
279
281
|
|
|
280
|
-
|
|
282
|
+
// A version-pinned npx command must always run the binary bundled with that package.
|
|
283
|
+
const installed = await installBinary({ force: true });
|
|
281
284
|
if (!installed) process.exit(1);
|
|
282
285
|
|
|
283
286
|
const providers = detectProvider();
|
|
284
|
-
const provider = flags.provider || providers[0]
|
|
285
|
-
if (
|
|
286
|
-
error(`No agent CLI detected. Install one of: claude, codex,
|
|
287
|
+
const provider = flags.provider || providers[0];
|
|
288
|
+
if (!provider) {
|
|
289
|
+
error(`No agent CLI detected. Install one of: claude, codex, qodercli`);
|
|
287
290
|
process.exit(1);
|
|
288
291
|
}
|
|
289
292
|
|
|
293
|
+
const executorId = flags["executor-id"];
|
|
294
|
+
|
|
290
295
|
const config = {
|
|
291
|
-
serverUrl: flags["
|
|
292
|
-
token: flags.token
|
|
296
|
+
serverUrl: flags["ws-url"],
|
|
297
|
+
token: flags.token,
|
|
298
|
+
executorId,
|
|
293
299
|
provider,
|
|
294
|
-
name: flags.name ||
|
|
300
|
+
name: flags.name || `daemon_${provider}_${executorId}`,
|
|
295
301
|
maxTasks: parseInt(flags["max-tasks"] || "2", 10),
|
|
296
302
|
};
|
|
297
303
|
saveConfig(config);
|
|
@@ -308,9 +314,13 @@ async function cmdConnect(args) {
|
|
|
308
314
|
AUTOWONDER_PROVIDER: config.provider,
|
|
309
315
|
AUTOWONDER_MAX_CONCURRENT_DISPATCHES: String(config.maxTasks),
|
|
310
316
|
AUTOWONDER_DAEMON_ID: config.name,
|
|
317
|
+
AUTOWONDER_RUNTIME_ID: `rt_${provider}_${executorId}`,
|
|
318
|
+
AUTOWONDER_WORKSPACE_ROOT: path.join(os.homedir(), `autowonder_workspaces_${provider}_${executorId}`),
|
|
319
|
+
AUTOWONDER_LOCAL_API_ADDR: "127.0.0.1:0",
|
|
320
|
+
AUTOWONDER_SERVER_WS_URL: config.serverUrl,
|
|
321
|
+
AUTOWONDER_EXECUTOR_TOKEN: config.token,
|
|
322
|
+
AUTOWONDER_EXECUTOR_ID: executorId,
|
|
311
323
|
};
|
|
312
|
-
if (config.serverUrl) env.AUTOWONDER_SERVER_URL = config.serverUrl;
|
|
313
|
-
if (config.token) env.AUTOWONDER_SERVER_TOKEN = config.token;
|
|
314
324
|
|
|
315
325
|
const child = spawn(DAEMON_BIN, [], { env, stdio: "inherit" });
|
|
316
326
|
child.on("exit", (code) => process.exit(code || 0));
|
|
@@ -491,7 +501,7 @@ function cmdHelp() {
|
|
|
491
501
|
autowonder — local runtime for AI agent dispatch execution
|
|
492
502
|
|
|
493
503
|
Usage:
|
|
494
|
-
autowonder connect --
|
|
504
|
+
autowonder connect --ws-url <url> --token <token> --executor-id <id> Connect to server and run
|
|
495
505
|
autowonder start [--provider claude] Start daemon in background
|
|
496
506
|
autowonder stop Stop background daemon
|
|
497
507
|
autowonder status Show daemon status
|
|
@@ -502,14 +512,15 @@ function cmdHelp() {
|
|
|
502
512
|
--provider <name> Agent provider: claude, codex, qoder (default: auto-detect)
|
|
503
513
|
--max-tasks <n> Max concurrent dispatches (default: 2)
|
|
504
514
|
--addr <host:port> Local API address (default: 127.0.0.1:34989)
|
|
505
|
-
--
|
|
506
|
-
--token <token>
|
|
507
|
-
--
|
|
515
|
+
--ws-url <url> Executor WebSocket endpoint
|
|
516
|
+
--token <token> Executor authentication token
|
|
517
|
+
--executor-id <id> Executor ID
|
|
518
|
+
--name <name> Runtime name (default: provider + executor ID)
|
|
508
519
|
-h, --help Show this help
|
|
509
520
|
|
|
510
521
|
Examples:
|
|
511
522
|
# Quick start — connect to server
|
|
512
|
-
npx -y autowonder connect --
|
|
523
|
+
npx -y autowonder connect --ws-url wss://autowonder.example.com/ws/executor --token xxx --executor-id 10000 --provider qoder
|
|
513
524
|
|
|
514
525
|
# Local mode — start daemon, submit tasks manually
|
|
515
526
|
npx -y autowonder start
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|