autowonder 0.2.2 → 0.2.4

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
@@ -6,13 +6,13 @@ AutoWonder 本地 agent runtime。安装后启动 daemon,持续轮询本地 as
6
6
 
7
7
  ```bash
8
8
  # Qoder CLI
9
- npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder
9
+ npx -y autowonder@0.2.4 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
11
  # Claude Code
12
- npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider claude
12
+ npx -y autowonder@0.2.4 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider claude
13
13
 
14
14
  # Codex CLI
15
- npx -y autowonder@0.2.2 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider codex
15
+ npx -y autowonder@0.2.4 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider codex --model gpt-5.5 --reasoning-effort medium
16
16
  ```
17
17
 
18
18
  `connect` 会安装当前 npm 包内置的 daemon,并使用页面生成的 WebSocket endpoint、Token 和执行器 ID 建立连接。目标机器必须提前安装并登录对应的 Qoder CLI、Claude Code 或 Codex CLI;runtime 会继承当前用户的 HOME、环境变量和 CLI 登录状态。
@@ -31,14 +31,14 @@ mv "$queue/.assignment.tmp" "$queue/assignment.json"
31
31
  也可以直接提交到本地 API:
32
32
 
33
33
  ```bash
34
- npx -y autowonder@0.2.2 dispatch ./assignment.json
34
+ npx -y autowonder@0.2.4 dispatch ./assignment.json
35
35
  ```
36
36
 
37
37
  ## 管理 daemon
38
38
 
39
39
  ```bash
40
- npx -y autowonder@0.2.2 status
41
- npx -y autowonder@0.2.2 stop
40
+ npx -y autowonder@0.2.4 status
41
+ npx -y autowonder@0.2.4 stop
42
42
  ```
43
43
 
44
44
  默认 API 是 `http://127.0.0.1:34989`,日志位于 `~/.autowonder/daemon.log`。npm 包不包含任何 agent、MCP 或服务端凭证。
package/bin/cli.js CHANGED
@@ -170,6 +170,17 @@ function binaryExists() {
170
170
  } catch { return false; }
171
171
  }
172
172
 
173
+ function installBundledBinary(source, destination) {
174
+ const temporary = `${destination}.tmp-${process.pid}-${crypto.randomUUID()}`;
175
+ try {
176
+ fs.copyFileSync(source, temporary);
177
+ fs.chmodSync(temporary, 0o755);
178
+ fs.renameSync(temporary, destination);
179
+ } finally {
180
+ try { fs.unlinkSync(temporary); } catch {}
181
+ }
182
+ }
183
+
173
184
  // ─── Binary Installation ─────────────────────────────────────────────
174
185
 
175
186
  async function installBinary(options = {}) {
@@ -185,8 +196,7 @@ async function installBinary(options = {}) {
185
196
  // Priority 1: bundled binary in npm package (vendor/)
186
197
  const bundledPath = path.join(BUNDLED_BIN_DIR, `autowonder-daemon-${platform}`);
187
198
  if (fs.existsSync(bundledPath)) {
188
- fs.copyFileSync(bundledPath, DAEMON_BIN);
189
- fs.chmodSync(DAEMON_BIN, 0o755);
199
+ installBundledBinary(bundledPath, DAEMON_BIN);
190
200
  log(`Installed from bundled binary: ${DAEMON_BIN}`);
191
201
  return true;
192
202
  }
@@ -272,7 +282,7 @@ function buildFromSource() {
272
282
  // ─── Commands ────────────────────────────────────────────────────────
273
283
 
274
284
  async function cmdConnect(args) {
275
- const flags = parseFlags(args, ["ws-url", "token", "executor-id", "provider", "name", "max-tasks"]);
285
+ const flags = parseFlags(args, ["ws-url", "token", "executor-id", "provider", "name", "max-tasks", "model", "reasoning-effort", "context-window"]);
276
286
 
277
287
  if (!flags["ws-url"] || !flags.token || !flags["executor-id"]) {
278
288
  error("Usage: autowonder connect --ws-url <url> --token <token> --executor-id <id> [--provider qoder]");
@@ -290,6 +300,20 @@ async function cmdConnect(args) {
290
300
  process.exit(1);
291
301
  }
292
302
 
303
+ const hasProviderSettings = Boolean(flags.model || flags["reasoning-effort"]);
304
+ if (hasProviderSettings && provider !== "codex" && provider !== "qoder") {
305
+ error("--model and --reasoning-effort are supported only for codex and qoder");
306
+ process.exit(1);
307
+ }
308
+ if (flags["context-window"] && provider !== "qoder") {
309
+ error("--context-window is supported only for qoder");
310
+ process.exit(1);
311
+ }
312
+ if (flags["context-window"] && !/^[1-9][0-9]*$/.test(flags["context-window"])) {
313
+ error("--context-window must be a positive integer");
314
+ process.exit(1);
315
+ }
316
+
293
317
  const executorId = flags["executor-id"];
294
318
 
295
319
  const config = {
@@ -321,6 +345,9 @@ async function cmdConnect(args) {
321
345
  AUTOWONDER_EXECUTOR_TOKEN: config.token,
322
346
  AUTOWONDER_EXECUTOR_ID: executorId,
323
347
  };
348
+ if (flags.model) env.AUTOWONDER_MODEL = flags.model;
349
+ if (flags["reasoning-effort"]) env.AUTOWONDER_REASONING_EFFORT = flags["reasoning-effort"];
350
+ if (flags["context-window"]) env.AUTOWONDER_CONTEXT_WINDOW = flags["context-window"];
324
351
 
325
352
  const child = spawn(DAEMON_BIN, [], { env, stdio: "inherit" });
326
353
  child.on("exit", (code) => process.exit(code || 0));
@@ -515,6 +542,9 @@ function cmdHelp() {
515
542
  --ws-url <url> Executor WebSocket endpoint
516
543
  --token <token> Executor authentication token
517
544
  --executor-id <id> Executor ID
545
+ --model <model> Default model for Codex or Qoder
546
+ --reasoning-effort <level> Default reasoning effort for Codex or Qoder
547
+ --context-window <n> Qoder context window (positive integer)
518
548
  --name <name> Runtime name (default: provider + executor ID)
519
549
  -h, --help Show this help
520
550
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autowonder",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "AutoWonder local runtime — execute AI agent dispatch packages on your machine",
5
5
  "bin": {
6
6
  "autowonder": "bin/cli.js"