wildcrane-runner 0.6.21 → 0.6.23

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
@@ -20,6 +20,7 @@ wildcrane-runner
20
20
  - **看板与技能**:通过插件连接云端项目;插件自带 kanban 技能,无需手动安装。Runner 为其他 Agent 准备项目技能并维护提交保护,保留用户文件和已有钩子。
21
21
 
22
22
  - **Node**: 22 or newer.
23
+ - **代理**:宿主未传入代理时,在 `~/.wildcrane/proxy.env` 写入 `HTTPS_PROXY=...` 等代理变量并重启 Runner。支持 HTTP、HTTPS、ALL 和 NO_PROXY 的大小写形式。Runner 从此文件启用自身的 HTTP 代理需要 Node.js 24.14 或更新版本。
23
24
  - **One computer per account**: a second computer is refused while the first is connected.
24
25
  - **Folders**: tasks run in `~/.wildcrane/work/`, or in a project folder listed in
25
26
  `~/.wildcrane/projects.json` (`{ "projects": ["/path/to/project"] }`). Any other folder is
package/dist/launcher.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.21 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.23 — built by runner/scripts/build.mjs. Do not edit.
2
2
  import { createRequire as __ai4kanbanRequire } from 'node:module'
3
3
  const require = __ai4kanbanRequire(import.meta.url)
4
4
 
@@ -9,13 +9,32 @@ import { fileURLToPath } from "node:url";
9
9
  // src/home.ts
10
10
  import crypto from "node:crypto";
11
11
  import fs from "node:fs";
12
+ import http from "node:http";
12
13
  import os from "node:os";
13
14
  import path from "node:path";
15
+ import { parseEnv } from "node:util";
14
16
  function runnerHome() {
15
17
  return process.env.WILDCRANE_HOME || path.join(os.homedir(), ".wildcrane");
16
18
  }
17
19
  function useRunnerHome() {
18
20
  process.env.AI4KANBAN_HOME = runnerHome();
21
+ loadProxy();
22
+ }
23
+ function loadProxy() {
24
+ try {
25
+ const config = parseEnv(fs.readFileSync(path.join(runnerHome(), "proxy.env"), "utf8"));
26
+ for (const key of ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "NO_PROXY"]) {
27
+ const lower = key.toLowerCase();
28
+ const value = config[lower] ?? config[key];
29
+ if (value !== void 0 && process.env[key] === void 0 && process.env[lower] === void 0) {
30
+ process.env[key] = value;
31
+ }
32
+ }
33
+ const network = http;
34
+ network.setGlobalProxyFromEnv?.();
35
+ } catch (error) {
36
+ if (error.code !== "ENOENT") console.error("runner: could not load proxy.env");
37
+ }
19
38
  }
20
39
  function machineId() {
21
40
  const file = path.join(runnerHome(), "machine.json");
@@ -108,7 +127,7 @@ function status(line) {
108
127
  }
109
128
 
110
129
  // src/protocol.ts
111
- var VERSION = true ? "0.6.21" : "0.0.0";
130
+ var VERSION = true ? "0.6.23" : "0.0.0";
112
131
  var EXIT_REFUSED = 10;
113
132
  var EXIT_OUTDATED = 11;
114
133
  var EXIT_UPDATE = 12;
@@ -572,7 +591,7 @@ var sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
572
591
  // src/settings-server.ts
573
592
  import crypto3 from "node:crypto";
574
593
  import fs5 from "node:fs";
575
- import http from "node:http";
594
+ import http2 from "node:http";
576
595
  import path6 from "node:path";
577
596
 
578
597
  // src/settings-browser.ts
@@ -789,7 +808,7 @@ async function startSettingsServer(action) {
789
808
  const json = (res, code, value) => {
790
809
  res.writeHead(code, { "content-type": "application/json; charset=utf-8" }).end(JSON.stringify(value));
791
810
  };
792
- const server = http.createServer(async (req, res) => {
811
+ const server = http2.createServer(async (req, res) => {
793
812
  res.setHeader("cache-control", "no-store");
794
813
  res.setHeader("referrer-policy", "no-referrer");
795
814
  res.setHeader("x-content-type-options", "nosniff");
@@ -4927,7 +4946,7 @@ function runnerSettingsSupport() {
4927
4946
  // src/signin.ts
4928
4947
  import { spawn as spawn5 } from "node:child_process";
4929
4948
  import crypto6 from "node:crypto";
4930
- import http2 from "node:http";
4949
+ import http3 from "node:http";
4931
4950
 
4932
4951
  // src/settings-control.ts
4933
4952
  import fs15 from "node:fs";
@@ -4991,7 +5010,7 @@ async function signIn(options = {}) {
4991
5010
  };
4992
5011
  const answered = new Promise((resolve2) => finish = resolve2);
4993
5012
  let answering = false;
4994
- const server = http2.createServer(async (req, res) => {
5013
+ const server = http3.createServer(async (req, res) => {
4995
5014
  const asked = new URL(req.url ?? "/", "http://127.0.0.1");
4996
5015
  if (asked.pathname !== "/signed-in" || answering) {
4997
5016
  res.writeHead(404).end();
package/dist/runner.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.21 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.23 — built by runner/scripts/build.mjs. Do not edit.
2
2
  import { createRequire as __ai4kanbanRequire } from 'node:module'
3
3
  const require = __ai4kanbanRequire(import.meta.url)
4
4
  var __create = Object.create;
@@ -84582,13 +84582,32 @@ var sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
84582
84582
  // src/home.ts
84583
84583
  import crypto from "node:crypto";
84584
84584
  import fs2 from "node:fs";
84585
+ import http from "node:http";
84585
84586
  import os2 from "node:os";
84586
84587
  import path3 from "node:path";
84588
+ import { parseEnv } from "node:util";
84587
84589
  function runnerHome() {
84588
84590
  return process.env.WILDCRANE_HOME || path3.join(os2.homedir(), ".wildcrane");
84589
84591
  }
84590
84592
  function useRunnerHome() {
84591
84593
  process.env.AI4KANBAN_HOME = runnerHome();
84594
+ loadProxy();
84595
+ }
84596
+ function loadProxy() {
84597
+ try {
84598
+ const config = parseEnv(fs2.readFileSync(path3.join(runnerHome(), "proxy.env"), "utf8"));
84599
+ for (const key of ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "NO_PROXY"]) {
84600
+ const lower = key.toLowerCase();
84601
+ const value = config[lower] ?? config[key];
84602
+ if (value !== void 0 && process.env[key] === void 0 && process.env[lower] === void 0) {
84603
+ process.env[key] = value;
84604
+ }
84605
+ }
84606
+ const network = http;
84607
+ network.setGlobalProxyFromEnv?.();
84608
+ } catch (error) {
84609
+ if (error.code !== "ENOENT") console.error("runner: could not load proxy.env");
84610
+ }
84592
84611
  }
84593
84612
  function machineId() {
84594
84613
  const file2 = path3.join(runnerHome(), "machine.json");
@@ -84663,7 +84682,7 @@ function status(line) {
84663
84682
  }
84664
84683
 
84665
84684
  // src/protocol.ts
84666
- var VERSION = true ? "0.6.21" : "0.0.0";
84685
+ var VERSION = true ? "0.6.23" : "0.0.0";
84667
84686
  var AKB_VERSION = true ? "0.11.19" : "0.0.0";
84668
84687
  var AKB_CONTRACT = true ? 7 : 0;
84669
84688
  var EXIT_REFUSED = 10;
@@ -93037,7 +93056,10 @@ var assetsText = (assets) => `${JSON.stringify(assets, null, 2)}
93037
93056
  function pull(ws, machineId2) {
93038
93057
  return inFolder(ws.cwd, async () => {
93039
93058
  const sent = await sendBoard(boardFolder(ws), machineId2);
93040
- if (!sent.ok) return { ok: false, error: `This computer's board changes could not be sent: ${sent.error}`, ...sent.offline ? {} : { code: "version_conflict" } };
93059
+ if (!sent.ok) {
93060
+ const refused = sent.tasks ? sent.tasks[ws.cloudTask ?? ""] : sent;
93061
+ if (refused) return { ok: false, error: `This computer's board changes could not be sent: ${refused.error}`, ...refused.offline ? {} : { code: "version_conflict" } };
93062
+ }
93041
93063
  return readCloud(ws);
93042
93064
  });
93043
93065
  }
@@ -93394,7 +93416,7 @@ async function sendBoard(ws, machineId2) {
93394
93416
  }
93395
93417
  async function sendMarked(ws, job) {
93396
93418
  const pushed = await send2(ws, job);
93397
- markUnsent(ws.cwd, !pushed.ok);
93419
+ markUnsent(ws.cwd, !pushed.ok || !!readBase(ws).pendingAssets?.length);
93398
93420
  return pushed;
93399
93421
  }
93400
93422
  async function send2(ws, job) {
@@ -93411,8 +93433,9 @@ async function send2(ws, job) {
93411
93433
  }
93412
93434
  });
93413
93435
  const boardSync = !job.id && !ws.cloudTask;
93414
- const closedCards = /* @__PURE__ */ new Set();
93415
- const closedLists = /* @__PURE__ */ new Set();
93436
+ const deferredCards = /* @__PURE__ */ new Set();
93437
+ const deferredLists = /* @__PURE__ */ new Set();
93438
+ const assetErrors = {};
93416
93439
  for (const item of tasks) {
93417
93440
  const card = path32.relative(ws.board, cardFile(item.folder)).split(path32.sep).join("/");
93418
93441
  const archived = boardSync && card.startsWith(".archive/") && base.files[rootOf(ws) + card];
@@ -93422,26 +93445,32 @@ async function send2(ws, job) {
93422
93445
  writeRecord(item.folder, item.record);
93423
93446
  continue;
93424
93447
  }
93425
- if (!boardSync || assets.code !== "conflict" || !assets.error.endsWith(": This task has finished.")) {
93426
- return fail(assets.error, false, assets.code);
93448
+ if (!boardSync) return fail(assets.error, false, assets.code);
93449
+ if (assets.code !== "conflict" || !assets.error.endsWith(": This task has finished.")) {
93450
+ assetErrors[item.folder.task] = { error: assets.error, ...assets.code ? {} : { offline: true } };
93427
93451
  }
93428
93452
  }
93429
- closedCards.add(item.folder.number);
93430
- closedLists.add(assetsFile(item.folder.task));
93453
+ deferredCards.add(item.folder.number);
93454
+ deferredLists.add(assetsFile(item.folder.task));
93431
93455
  }
93432
93456
  proposeItems(ws, base);
93433
93457
  const shared = sharedMemory(ws.board);
93434
93458
  const deferred = new Set(boardSync ? [] : base.deferred);
93435
- const closed = (p2) => {
93459
+ const defer = (p2) => {
93436
93460
  if (!boardSync) return deferred.has(p2);
93437
- if (!closedLists.has(p2) && !closedCards.has(numberOfCard(p2) ?? 0)) return false;
93461
+ if (!deferredLists.has(p2) && !deferredCards.has(numberOfCard(p2) ?? 0)) return false;
93438
93462
  deferred.add(p2);
93439
93463
  return true;
93440
93464
  };
93441
93465
  const success = (changed) => {
93442
93466
  const refreshDeferred = boardSync && (deferred.size !== (base.deferred?.length ?? 0) || base.deferred?.some((p2) => !deferred.has(p2)));
93467
+ const pendingAssets = Object.keys(assetErrors);
93468
+ const refreshPending = boardSync && JSON.stringify(pendingAssets) !== JSON.stringify(base.pendingAssets ?? []);
93443
93469
  if (refreshDeferred) base.deferred = [...deferred];
93444
- if (changed || refreshDeferred) writeBase(ws, base);
93470
+ if (refreshPending) base.pendingAssets = pendingAssets;
93471
+ if (changed || refreshDeferred || refreshPending) writeBase(ws, base);
93472
+ const firstError = Object.values(assetErrors)[0];
93473
+ if (firstError) return { ok: false, conflict: false, ...firstError, tasks: assetErrors };
93445
93474
  return { ok: true, changed };
93446
93475
  };
93447
93476
  const local = localFiles(ws, base);
@@ -93449,7 +93478,7 @@ async function send2(ws, job) {
93449
93478
  const changes = [];
93450
93479
  const owed = (p2) => !job.id && busy(ws.cwd) && itemAt(p2)?.state === "open" && !base.files[rootOf(ws) + p2];
93451
93480
  for (const p2 of local) {
93452
- if (closed(p2) || owed(p2)) continue;
93481
+ if (defer(p2) || owed(p2)) continue;
93453
93482
  const content = fs28.readFileSync(path32.join(ws.board, p2), "utf8");
93454
93483
  const remote = remoteOf(ws, shared, p2);
93455
93484
  localOf.set(remote, p2);
@@ -93460,7 +93489,7 @@ async function send2(ws, job) {
93460
93489
  }
93461
93490
  for (const p2 of viewOf(ws, base, shared).keys()) {
93462
93491
  const remote = remoteOf(ws, shared, p2);
93463
- if (!closed(p2) && kept3(p2) && !localOf.has(remote) && base.files[remote]) {
93492
+ if (!defer(p2) && kept3(p2) && !localOf.has(remote) && base.files[remote]) {
93464
93493
  localOf.set(remote, p2);
93465
93494
  changes.push({ path: remote, content: null, base_seq: base.files[remote].seq });
93466
93495
  }
@@ -96418,7 +96447,7 @@ function startRunner(options) {
96418
96447
  // src/signin.ts
96419
96448
  import { spawn as spawn5 } from "node:child_process";
96420
96449
  import crypto7 from "node:crypto";
96421
- import http from "node:http";
96450
+ import http2 from "node:http";
96422
96451
  var WAIT_MS = 10 * 60 * 1e3;
96423
96452
  var CRANE = "M2 55.75C2 55.69 2.69 55.09 3.55 54.37L5.09 53.1L6.61 53.1L8.13 53.1L12.49 49.87C14.9 48.07 16.83 46.58 16.77 46.53C16.75 46.47 15.56 46.64 14.15 46.89C12.74 47.13 11.55 47.3 11.53 47.24C11.47 47.19 12.02 46.22 12.71 45.06L14.01 42.96L18.21 41.34C20.53 40.45 22.41 39.65 22.41 39.57C22.41 39.49 21.27 38.55 19.92 37.5C15.92 34.4 13.13 31.31 10.86 27.47L10.01 26.01L10.53 26.18C10.84 26.26 12.96 27.2 15.28 28.25C17.6 29.32 19.53 30.12 19.59 30.07C19.64 30.01 17.68 28.69 15.25 27.11C12.8 25.57 10.56 23.97 10.31 23.58C9.15 21.95 7.25 17.5 7.25 16.46C7.25 16.26 10.01 17.95 13.38 20.18C16.77 22.45 19.73 24.38 19.95 24.49C20.42 24.74 20.25 24.57 13.9 19.02L9.18 14.88L8.6 13.36C7.72 10.96 6.97 7.54 6.97 5.77L6.97 4.14L9.4 6.46C12.66 9.61 15.56 12.01 23.57 18.25C27.32 21.18 30.5 23.72 30.64 23.91C30.8 24.08 31.68 26.51 32.6 29.3L34.28 34.35L35.72 35.65C37.54 37.3 37.98 37.47 36.85 36.09L35.96 35.01L37.12 34.71C39.11 34.21 40.16 33.52 42.54 31.12L44.8 28.8L46.02 28.96C46.71 29.07 47.56 29.07 47.95 28.96L48.67 28.8L48.67 28.25L48.67 27.69L49.27 27.69C49.63 27.69 50.1 27.58 50.32 27.42L50.71 27.17L51.01 27.42C51.18 27.56 52.78 27.86 54.58 28.08C56.37 28.3 57.86 28.52 57.94 28.58C58 28.63 56.73 28.85 55.13 29.05C53.53 29.24 50.96 29.77 49.44 30.21C47.92 30.65 46.57 31.01 46.43 31.01C46.29 31.01 44.22 32.97 41.85 35.37C37.57 39.62 34.42 42.14 30.83 44.15L29.14 45.09L25.97 45.73L22.77 46.39L14.59 51.11L6.42 55.86L4.21 55.86C2.99 55.86 2 55.8 2 55.75Z";
96424
96453
  var CREST = "M44.97 27.45C44.61 26.89 46.57 25.76 47.87 25.76C48.72 25.76 50.6 26.7 50.6 27.14C50.6 27.64 45.27 27.97 44.97 27.45Z";
@@ -96449,7 +96478,7 @@ async function signIn(options = {}) {
96449
96478
  };
96450
96479
  const answered = new Promise((resolve2) => finish2 = resolve2);
96451
96480
  let answering = false;
96452
- const server = http.createServer(async (req, res) => {
96481
+ const server = http2.createServer(async (req, res) => {
96453
96482
  const asked = new URL(req.url ?? "/", "http://127.0.0.1");
96454
96483
  if (asked.pathname !== "/signed-in" || answering) {
96455
96484
  res.writeHead(404).end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.21",
3
+ "version": "0.6.23",
4
4
  "description": "WildCrane's Local Runner — connects this computer to WildCrane and runs its jobs on your local Claude Code, Codex, OpenCode or Cursor.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "homepage": "https://wildcrane.ai/",