wildcrane-runner 0.6.122 → 0.6.123

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/dist/settings.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.122 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.123 — 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;
@@ -41755,8 +41755,8 @@ function cloudProblem(response, body) {
41755
41755
  }
41756
41756
 
41757
41757
  // src/protocol.ts
41758
- var VERSION = true ? "0.6.122" : "0.0.0";
41759
- var AKB_VERSION = true ? "0.11.104" : "0.0.0";
41758
+ var VERSION = true ? "0.6.123" : "0.0.0";
41759
+ var AKB_VERSION = true ? "0.11.105" : "0.0.0";
41760
41760
 
41761
41761
  // ../cli/src/lib/agent/harnesses/antigravity.ts
41762
41762
  import fs10 from "node:fs";
@@ -42947,7 +42947,7 @@ function createTail(log) {
42947
42947
  // ../cli/package.json
42948
42948
  var package_default = {
42949
42949
  name: "wildcrane",
42950
- version: "0.11.104",
42950
+ version: "0.11.105",
42951
42951
  akbContract: 39,
42952
42952
  canonicalCommands: true,
42953
42953
  description: "WildCrane's `akb` command \u2014 scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
@@ -48581,16 +48581,36 @@ var PAGE = (outcome, lang, links) => {
48581
48581
  const top = links ? `<h1>${title}</h1><p>${body}</p><form id="f" novalidate><input id="e" type="email" autocomplete="email" placeholder="${c.email}" required><input id="c" inputmode="numeric" autocomplete="one-time-code" maxlength="10" placeholder="${c.code}" hidden><button id="b" class="dark">${c.send}</button><small id="m"></small><button id="x" type="button" class="link" hidden>${c.change}</button></form><div class="or">${c.or}</div><nav><a href="${links.github}">${GITHUB_ICON}${c.github}</a><a href="${links.google}">${GOOGLE_ICON}${c.google}</a></nav><script>${EMAIL_SCRIPT(c)}</script>` : `<span class="icon"><svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${icon2}</svg></span><h1 class="below">${title}</h1><p>${body}</p>`;
48582
48582
  return `<!doctype html><html lang="${lang === "zh" ? "zh-CN" : "en"}"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title} \xB7 WildCrane</title><style>*{margin:0;box-sizing:border-box}body{display:flex;flex-direction:column;min-height:100dvh;background:#fff;color:#24231f;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}header{padding:16px 36px 0}main{flex:1;display:flex;align-items:center;justify-content:center;padding:0 36px 64px;text-align:center}.icon{display:flex;margin:0 auto;width:44px;height:44px;border-radius:50%;align-items:center;justify-content:center;background:${ok ? "#e4f3ea" : "#f7ddce"};color:${ok ? "#2f6b46" : "#b83a12"}}h1{font-size:24px;font-weight:850;line-height:1.25;letter-spacing:-0.02em}h1.below{margin-top:16px}p{margin:8px auto 0;max-width:38ch;font-size:13px;line-height:19px;color:#565550}main>div.choose{width:100%;max-width:320px}nav{margin-top:28px;display:flex;flex-direction:column;gap:12px}nav a{display:flex;height:44px;align-items:center;justify-content:center;gap:8px;border-radius:10px;font-size:14.5px;font-weight:600;color:#24231f;text-decoration:none;background:#fff;border:1px solid rgba(36,35,31,0.14)}nav a.dark{background:#24231f;color:#fff;border-color:#24231f}form{margin-top:28px;display:flex;flex-direction:column;gap:12px}input{height:44px;padding:0 14px;border-radius:10px;border:1px solid rgba(36,35,31,0.14);font:inherit;font-size:14.5px}button{height:44px;border-radius:10px;border:0;font:inherit;font-size:14.5px;font-weight:600;cursor:pointer}button.dark{background:#24231f;color:#fff}button:disabled{opacity:.6}button.link{height:auto;background:none;color:#565550;font-size:13px;font-weight:500}small{font-size:13px;line-height:19px;color:#565550}small.bad{color:#b83a12}small:empty{display:none}.or{margin-top:20px;display:flex;align-items:center;gap:12px;font-size:13px;color:#8a8984}.or::before,.or::after{content:"";flex:1;height:1px;background:rgba(36,35,31,0.12)}.or+nav{margin-top:20px}</style><header><svg viewBox="2 4 56 52" width="23.7" height="22" aria-hidden="true"><path d="${CRANE}" fill="#24231f"/><path d="${CREST}" fill="#dd4f1e"/></svg></header><main><div${links ? ' class="choose"' : ""}>${top}</div></main></html>`;
48583
48583
  };
48584
+ function sameToken(a, b) {
48585
+ if (!a || a.length !== b.length) return false;
48586
+ return crypto6.timingSafeEqual(Buffer.from(a), Buffer.from(b));
48587
+ }
48584
48588
  async function signIn(options = {}) {
48585
48589
  const generation = accountGeneration();
48586
48590
  const verifier = base64url(crypto6.randomBytes(32));
48587
48591
  const challenge = base64url(crypto6.createHash("sha256").update(verifier).digest());
48592
+ const oauthState = base64url(crypto6.randomBytes(24));
48588
48593
  let finish = () => {
48589
48594
  };
48590
48595
  const answered = new Promise((resolve2) => finish = resolve2);
48591
48596
  let answering = false;
48597
+ let expectedOrigin = "";
48592
48598
  const server = http.createServer(async (req, res) => {
48599
+ res.setHeader("cache-control", "no-store");
48600
+ res.setHeader("referrer-policy", "no-referrer");
48601
+ res.setHeader("x-content-type-options", "nosniff");
48602
+ const expectedHost = expectedOrigin.slice(7);
48603
+ const secFetchSite = req.headers["sec-fetch-site"] ? String(req.headers["sec-fetch-site"]) : null;
48604
+ if (req.headers.host !== expectedHost || req.headers.origin && req.headers.origin !== expectedOrigin) {
48605
+ res.writeHead(403, { "content-type": "application/json; charset=utf-8" }).end(JSON.stringify({ error: "forbidden" }));
48606
+ return;
48607
+ }
48593
48608
  const asked = new URL(req.url ?? "/", "http://127.0.0.1");
48609
+ const isCallback = asked.pathname === "/signed-in";
48610
+ if (secFetchSite && !(isCallback ? ["same-origin", "none", "cross-site"] : ["same-origin", "none"]).includes(secFetchSite)) {
48611
+ res.writeHead(403, { "content-type": "application/json; charset=utf-8" }).end(JSON.stringify({ error: "forbidden" }));
48612
+ return;
48613
+ }
48594
48614
  const lang = langOf(req.headers["accept-language"]);
48595
48615
  if (asked.pathname === "/" && !answering) {
48596
48616
  res.writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store" });
@@ -48598,6 +48618,10 @@ async function signIn(options = {}) {
48598
48618
  return;
48599
48619
  }
48600
48620
  if (req.method === "POST" && (asked.pathname === "/send" || asked.pathname === "/verify") && !answering) {
48621
+ if (req.headers.origin !== expectedOrigin) {
48622
+ res.writeHead(403, { "content-type": "application/json; charset=utf-8" }).end(JSON.stringify({ error: "forbidden" }));
48623
+ return;
48624
+ }
48601
48625
  const asks = await readJson2(req);
48602
48626
  const answer = asked.pathname === "/send" ? await sendCode(asks.email ?? "", lang) : await verifyCode(asks.email ?? "", asks.code ?? "", generation, options.signal);
48603
48627
  const done = answer.ok && asked.pathname === "/verify";
@@ -48617,7 +48641,8 @@ async function signIn(options = {}) {
48617
48641
  const params = asked.searchParams;
48618
48642
  const code = params.get("code");
48619
48643
  const error = params.get("error");
48620
- const failure3 = code ? await exchange(code, verifier, generation, options.signal) : {
48644
+ const stateOk = sameToken(params.get("state"), oauthState);
48645
+ const failure3 = !stateOk ? { why: "other", detail: "invalid oauth state" } : code ? await exchange(code, verifier, generation, options.signal) : {
48621
48646
  why: error === "access_denied" ? "denied" : "other",
48622
48647
  detail: params.get("error_description") || error || "no code came back"
48623
48648
  };
@@ -48628,6 +48653,7 @@ async function signIn(options = {}) {
48628
48653
  });
48629
48654
  await new Promise((resolve2) => server.listen(0, "127.0.0.1", resolve2));
48630
48655
  const { port } = server.address();
48656
+ expectedOrigin = `http://127.0.0.1:${port}`;
48631
48657
  const { supabaseUrl } = cloudEndpoints();
48632
48658
  const authorize = (provider) => {
48633
48659
  const url = new URL(`${supabaseUrl}/auth/v1/authorize`);
@@ -48636,18 +48662,20 @@ async function signIn(options = {}) {
48636
48662
  if (provider === "github") url.searchParams.set("scopes", "user:email");
48637
48663
  url.searchParams.set("code_challenge", challenge);
48638
48664
  url.searchParams.set("code_challenge_method", "s256");
48665
+ url.searchParams.set("state", oauthState);
48639
48666
  return url.toString().replace(/&/g, "&amp;");
48640
48667
  };
48641
48668
  const choose = `http://127.0.0.1:${port}/`;
48642
48669
  const onUrl = options.onUrl ?? ((u) => status(t.signIn(u)));
48643
48670
  onUrl(choose);
48644
- openBrowser(choose);
48671
+ if (!options.noBrowser) openBrowser(choose);
48645
48672
  const timer = setTimeout(() => finish({ why: "timeout", detail: "timed out" }), WAIT_MS);
48646
48673
  const cancel = () => finish({ why: "cancelled", detail: "cancelled" });
48647
48674
  options.signal?.addEventListener("abort", cancel);
48648
48675
  const failure2 = await answered;
48649
48676
  clearTimeout(timer);
48650
48677
  options.signal?.removeEventListener("abort", cancel);
48678
+ server.closeAllConnections();
48651
48679
  server.close();
48652
48680
  return failure2;
48653
48681
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.122",
3
+ "version": "0.6.123",
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": "Apache-2.0",
6
6
  "homepage": "https://wildcrane.ai/",