autowonder 0.2.116 → 0.2.118

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(模型使用 provider model ID;Context Window 使用固定档位)
9
- npx -y autowonder@0.2.116 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder --model qmodel_latest --reasoning-effort medium --context-window 260000
9
+ npx -y autowonder@0.2.118 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider qoder --model qmodel_latest --reasoning-effort medium --context-window 260000
10
10
 
11
11
  # Claude Code
12
- npx -y autowonder@0.2.116 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider claude
12
+ npx -y autowonder@0.2.118 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.116 connect --ws-url <wss-endpoint> --token <executor-token> --executor-id <executor-id> --provider codex --model gpt-5.5 --reasoning-effort medium
15
+ npx -y autowonder@0.2.118 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 时需要 Node.js 20+;runtime 会在缺少 `qodercli` 时自动通过 npm 安装,并在尚未登录时打开 Qoder 浏览器登录。Claude Code 和 Codex CLI 仍需提前安装并登录。runtime 会继承当前用户的 HOME、环境变量和 CLI 登录状态。
@@ -57,14 +57,14 @@ mv "$queue/.assignment.tmp" "$queue/assignment.json"
57
57
  也可以直接提交到本地 API:
58
58
 
59
59
  ```bash
60
- npx -y autowonder@0.2.116 dispatch ./assignment.json
60
+ npx -y autowonder@0.2.118 dispatch ./assignment.json
61
61
  ```
62
62
 
63
63
  ## 管理 daemon
64
64
 
65
65
  ```bash
66
- npx -y autowonder@0.2.116 status
67
- npx -y autowonder@0.2.116 stop
66
+ npx -y autowonder@0.2.118 status
67
+ npx -y autowonder@0.2.118 stop
68
68
  ```
69
69
 
70
70
  默认 API 是 `http://127.0.0.1:34989`,日志位于 `~/.autowonder/daemon.log`。npm 包不包含任何 agent、MCP 或服务端凭证。
package/bin/cli.js CHANGED
@@ -13,7 +13,10 @@ const VERSION = require("../package.json").version;
13
13
  const AUTOWONDER_HOME = path.join(os.homedir(), ".autowonder");
14
14
  const BIN_DIR = path.join(AUTOWONDER_HOME, "bin");
15
15
  function daemonBinPath() {
16
- return path.join(BIN_DIR, process.platform === "win32" ? "autowonder-daemon.exe" : "autowonder-daemon");
16
+ if (process.platform === "win32") {
17
+ return path.join(BIN_DIR, `v${VERSION}`, "autowonder-daemon.exe");
18
+ }
19
+ return path.join(BIN_DIR, "autowonder-daemon");
17
20
  }
18
21
  const DAEMON_BIN = daemonBinPath();
19
22
  const CONFIG_PATH = path.join(AUTOWONDER_HOME, "config.json");
@@ -82,8 +85,14 @@ function findExecutable(name) {
82
85
  return "";
83
86
  }
84
87
 
88
+ function spawnQoderSync(executable, args, options = {}) {
89
+ // npm exposes package binaries as .cmd shims on Windows. CreateProcess
90
+ // cannot execute those shims directly, so let ComSpec resolve them.
91
+ return spawnSync(executable, args, { ...options, shell: IS_WIN32 });
92
+ }
93
+
85
94
  function qoderAuthenticated(executable) {
86
- const result = spawnSync(executable, ["--list-models"], {
95
+ const result = spawnQoderSync(executable, ["--list-models"], {
87
96
  encoding: "utf8",
88
97
  stdio: ["ignore", "pipe", "pipe"],
89
98
  timeout: 20000,
@@ -93,11 +102,22 @@ function qoderAuthenticated(executable) {
93
102
 
94
103
  function installQoderCLI() {
95
104
  log("Qoder CLI is not installed. Installing @qoder-ai/qodercli...");
96
- const result = spawnSync(process.platform === "win32" ? "npm.cmd" : "npm", [
105
+ const args = [
97
106
  "install", "--prefix", MANAGED_QODER_DIR, "@qoder-ai/qodercli@latest", "--no-audit", "--no-fund",
98
- ], { stdio: "inherit" });
107
+ ];
108
+ // npm is a .cmd shim on Windows. When launched by npx, npm_execpath points
109
+ // at npm-cli.js, which Node can execute directly without cmd.exe quoting.
110
+ const runNpm = (npmArgs) => IS_WIN32 && process.env.npm_execpath
111
+ ? spawnSync(process.execPath, [process.env.npm_execpath, ...npmArgs], { stdio: "inherit" })
112
+ : spawnSync("npm", npmArgs, { stdio: "inherit" });
113
+ let result = runNpm(args);
114
+ if (result.status !== 0 && IS_WIN32) {
115
+ log("Default npm registry failed; retrying Qoder CLI installation with npmmirror...");
116
+ result = runNpm([...args, "--registry", "https://registry.npmmirror.com"]);
117
+ }
99
118
  if (result.status !== 0) {
100
- error(`Failed to install Qoder CLI into ${MANAGED_QODER_DIR}.`);
119
+ const detail = result.error?.message || (result.signal ? `signal ${result.signal}` : `exit status ${result.status}`);
120
+ error(`Failed to install Qoder CLI into ${MANAGED_QODER_DIR}: ${detail}`);
101
121
  return "";
102
122
  }
103
123
  const executable = findExecutable("qodercli");
@@ -159,8 +179,14 @@ async function ensureQoderReady() {
159
179
  if (!executable) return false;
160
180
  if (!qoderAuthenticated(executable)) {
161
181
  log("Qoder login is required. Opening browser login...");
162
- const login = spawnSync(executable, ["login"], { stdio: "inherit" });
163
- if (login.status !== 0 || !(await qoderAuthenticatedAfterLogin(executable))) {
182
+ const login = spawnQoderSync(executable, ["login"], { stdio: "inherit" });
183
+ if (login.status !== 0) {
184
+ const detail = login.error?.message || `exit status ${login.status}`;
185
+ error(`Qoder login command failed: ${detail}`);
186
+ error(`Run ${qoderLoginCommand(executable)} and retry.`);
187
+ return false;
188
+ }
189
+ if (!(await qoderAuthenticatedAfterLogin(executable))) {
164
190
  error(`Qoder login did not complete. Run ${qoderLoginCommand(executable)} and retry.`);
165
191
  return false;
166
192
  }
@@ -472,7 +498,9 @@ async function cmdConnect(args) {
472
498
  if (provider === "qoder" && !(await ensureQoderReady())) process.exit(1);
473
499
 
474
500
  // A version-pinned npx command must always run the binary bundled with that package.
475
- const installed = await installBinary({ force: true });
501
+ // Windows locks a running .exe. Its versioned path is immutable, so another
502
+ // Executor using the same package can safely reuse it instead of replacing it.
503
+ const installed = await installBinary({ force: !IS_WIN32 });
476
504
  if (!installed) process.exit(1);
477
505
 
478
506
  const hasProviderSettings = Boolean(flags.model || flags["reasoning-effort"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autowonder",
3
- "version": "0.2.116",
3
+ "version": "0.2.118",
4
4
  "description": "AutoWonder local runtime — execute AI agent dispatch packages on your machine",
5
5
  "bin": {
6
6
  "autowonder": "bin/cli.js"