autowonder 0.2.1 → 0.2.3
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.3 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder --model Qwen3.7-Max --reasoning-effort medium --context-window 131072
|
|
10
10
|
|
|
11
|
-
#
|
|
12
|
-
npx -y autowonder@0.2.
|
|
11
|
+
# Claude Code
|
|
12
|
+
npx -y autowonder@0.2.3 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider claude
|
|
13
|
+
|
|
14
|
+
# Codex CLI
|
|
15
|
+
npx -y autowonder@0.2.3 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider codex --model gpt-5.5 --reasoning-effort medium
|
|
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.3 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.3 status
|
|
41
|
+
npx -y autowonder@0.2.3 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,46 @@ 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", "model", "reasoning-effort", "context-window"]);
|
|
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`);
|
|
290
|
+
process.exit(1);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const hasProviderSettings = Boolean(flags.model || flags["reasoning-effort"]);
|
|
294
|
+
if (hasProviderSettings && provider !== "codex" && provider !== "qoder") {
|
|
295
|
+
error("--model and --reasoning-effort are supported only for codex and qoder");
|
|
287
296
|
process.exit(1);
|
|
288
297
|
}
|
|
298
|
+
if (flags["context-window"] && provider !== "qoder") {
|
|
299
|
+
error("--context-window is supported only for qoder");
|
|
300
|
+
process.exit(1);
|
|
301
|
+
}
|
|
302
|
+
if (flags["context-window"] && !/^[1-9][0-9]*$/.test(flags["context-window"])) {
|
|
303
|
+
error("--context-window must be a positive integer");
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const executorId = flags["executor-id"];
|
|
289
308
|
|
|
290
309
|
const config = {
|
|
291
|
-
serverUrl: flags["
|
|
292
|
-
token: flags.token
|
|
310
|
+
serverUrl: flags["ws-url"],
|
|
311
|
+
token: flags.token,
|
|
312
|
+
executorId,
|
|
293
313
|
provider,
|
|
294
|
-
name: flags.name ||
|
|
314
|
+
name: flags.name || `daemon_${provider}_${executorId}`,
|
|
295
315
|
maxTasks: parseInt(flags["max-tasks"] || "2", 10),
|
|
296
316
|
};
|
|
297
317
|
saveConfig(config);
|
|
@@ -308,9 +328,16 @@ async function cmdConnect(args) {
|
|
|
308
328
|
AUTOWONDER_PROVIDER: config.provider,
|
|
309
329
|
AUTOWONDER_MAX_CONCURRENT_DISPATCHES: String(config.maxTasks),
|
|
310
330
|
AUTOWONDER_DAEMON_ID: config.name,
|
|
331
|
+
AUTOWONDER_RUNTIME_ID: `rt_${provider}_${executorId}`,
|
|
332
|
+
AUTOWONDER_WORKSPACE_ROOT: path.join(os.homedir(), `autowonder_workspaces_${provider}_${executorId}`),
|
|
333
|
+
AUTOWONDER_LOCAL_API_ADDR: "127.0.0.1:0",
|
|
334
|
+
AUTOWONDER_SERVER_WS_URL: config.serverUrl,
|
|
335
|
+
AUTOWONDER_EXECUTOR_TOKEN: config.token,
|
|
336
|
+
AUTOWONDER_EXECUTOR_ID: executorId,
|
|
311
337
|
};
|
|
312
|
-
if (
|
|
313
|
-
if (
|
|
338
|
+
if (flags.model) env.AUTOWONDER_MODEL = flags.model;
|
|
339
|
+
if (flags["reasoning-effort"]) env.AUTOWONDER_REASONING_EFFORT = flags["reasoning-effort"];
|
|
340
|
+
if (flags["context-window"]) env.AUTOWONDER_CONTEXT_WINDOW = flags["context-window"];
|
|
314
341
|
|
|
315
342
|
const child = spawn(DAEMON_BIN, [], { env, stdio: "inherit" });
|
|
316
343
|
child.on("exit", (code) => process.exit(code || 0));
|
|
@@ -491,7 +518,7 @@ function cmdHelp() {
|
|
|
491
518
|
autowonder — local runtime for AI agent dispatch execution
|
|
492
519
|
|
|
493
520
|
Usage:
|
|
494
|
-
autowonder connect --
|
|
521
|
+
autowonder connect --ws-url <url> --token <token> --executor-id <id> Connect to server and run
|
|
495
522
|
autowonder start [--provider claude] Start daemon in background
|
|
496
523
|
autowonder stop Stop background daemon
|
|
497
524
|
autowonder status Show daemon status
|
|
@@ -502,14 +529,18 @@ function cmdHelp() {
|
|
|
502
529
|
--provider <name> Agent provider: claude, codex, qoder (default: auto-detect)
|
|
503
530
|
--max-tasks <n> Max concurrent dispatches (default: 2)
|
|
504
531
|
--addr <host:port> Local API address (default: 127.0.0.1:34989)
|
|
505
|
-
--
|
|
506
|
-
--token <token>
|
|
507
|
-
--
|
|
532
|
+
--ws-url <url> Executor WebSocket endpoint
|
|
533
|
+
--token <token> Executor authentication token
|
|
534
|
+
--executor-id <id> Executor ID
|
|
535
|
+
--model <model> Default model for Codex or Qoder
|
|
536
|
+
--reasoning-effort <level> Default reasoning effort for Codex or Qoder
|
|
537
|
+
--context-window <n> Qoder context window (positive integer)
|
|
538
|
+
--name <name> Runtime name (default: provider + executor ID)
|
|
508
539
|
-h, --help Show this help
|
|
509
540
|
|
|
510
541
|
Examples:
|
|
511
542
|
# Quick start — connect to server
|
|
512
|
-
npx -y autowonder connect --
|
|
543
|
+
npx -y autowonder connect --ws-url wss://autowonder.example.com/ws/executor --token xxx --executor-id 10000 --provider qoder
|
|
513
544
|
|
|
514
545
|
# Local mode — start daemon, submit tasks manually
|
|
515
546
|
npx -y autowonder start
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|