wildcrane-runner 0.6.126 → 0.6.128
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/akb/dist/kanban.mjs +3567 -2313
- package/dist/akb/package.json +1 -1
- package/dist/akb-proxy.mjs +1 -1
- package/dist/codex-proxy.mjs +1 -1
- package/dist/codex-retained.mjs +1 -1
- package/dist/flow-worker-main.mjs +2559 -1256
- package/dist/launcher.mjs +158 -56
- package/dist/plugin.mjs +14101 -7384
- package/dist/runner.mjs +2604 -1283
- package/dist/settings.mjs +158 -56
- package/package.json +1 -1
package/dist/settings.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.128 — 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;
|
|
@@ -41406,24 +41406,49 @@ var STUDIO_SCHEMA = {
|
|
|
41406
41406
|
var validate = new import_ajv.Ajv({ allErrors: true, meta: false, validateSchema: false }).compile(STUDIO_SCHEMA);
|
|
41407
41407
|
var comments = /<!--[^]*?(?:-->|$)/g;
|
|
41408
41408
|
var blank = (text2) => text2.replace(/[^\r\n]/g, " ");
|
|
41409
|
-
|
|
41410
|
-
|
|
41411
|
-
|
|
41412
|
-
|
|
41413
|
-
|
|
41414
|
-
|
|
41415
|
-
|
|
41416
|
-
visible += body.slice(at);
|
|
41417
|
-
const headings = headingsOf(visible);
|
|
41418
|
-
return headings.flatMap((heading, index) => {
|
|
41419
|
-
const start = heading.index;
|
|
41420
|
-
const end = start + heading[0].length;
|
|
41421
|
-
if (!/^ {0,3}##[ \t]+Land(?:[ \t]+#+)?[ \t]*$/.test(visible.slice(start, end))) return [];
|
|
41422
|
-
const text2 = visible.slice(end, headings[index + 1]?.index).replace(comments, "").trim();
|
|
41423
|
-
return [{ offset: start + heading[0].indexOf("#"), empty: !text2, text: text2 }];
|
|
41409
|
+
function studioSections(body) {
|
|
41410
|
+
const headings = [...withoutCode(body).replace(comments, blank).matchAll(/^ {0,3}#{1,2}(?=[ \t\r\n]|$)[^\r\n]*/gm)];
|
|
41411
|
+
return headings.map((heading, index) => {
|
|
41412
|
+
const start = heading.index + heading[0].indexOf("#");
|
|
41413
|
+
const content = heading.index + heading[0].length;
|
|
41414
|
+
const name = /^##[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(body.slice(start, content))?.[1];
|
|
41415
|
+
return { name, start, content, end: headings[index + 1]?.index ?? body.length };
|
|
41424
41416
|
});
|
|
41425
41417
|
}
|
|
41426
|
-
function
|
|
41418
|
+
function checkStudioSections(body, previews, fail) {
|
|
41419
|
+
let visible = "", end = 0;
|
|
41420
|
+
for (const block of previews) {
|
|
41421
|
+
visible += body.slice(end, block.start) + blank(body.slice(block.start, block.end));
|
|
41422
|
+
end = block.end;
|
|
41423
|
+
}
|
|
41424
|
+
visible += body.slice(end);
|
|
41425
|
+
const sections = studioSections(visible);
|
|
41426
|
+
const instructions = {
|
|
41427
|
+
Land: "Describe delivery, checks and what to record.",
|
|
41428
|
+
Work: "Describe the workflow and tools.",
|
|
41429
|
+
Previews: "Put Preview blocks under this heading, or leave it empty if none are needed."
|
|
41430
|
+
};
|
|
41431
|
+
for (const name of ["Land", "Work", "Previews"]) {
|
|
41432
|
+
const matching = sections.filter((section) => section.name === name);
|
|
41433
|
+
const code = `studio-${name.toLowerCase()}`;
|
|
41434
|
+
if (!matching.length) fail(0, name, `${code}-missing`, `Missing ## ${name} section`, `Add ## ${name} to the Studio body. ${instructions[name]}`);
|
|
41435
|
+
for (const [index2, section] of matching.entries()) {
|
|
41436
|
+
if (index2) fail(section.start, name, `${code}-duplicate`, `Repeated ## ${name} section`, `Combine its contents under one ## ${name} heading.`);
|
|
41437
|
+
if (name !== "Previews" && !visible.slice(section.content, section.end).replace(comments, "").trim()) {
|
|
41438
|
+
fail(section.start, name, `${code}-empty`, `The ## ${name} section is empty`, instructions[name]);
|
|
41439
|
+
}
|
|
41440
|
+
}
|
|
41441
|
+
}
|
|
41442
|
+
let index = 0;
|
|
41443
|
+
for (const block of previews) {
|
|
41444
|
+
while (sections[index] && sections[index].end <= block.start) index++;
|
|
41445
|
+
const section = sections[index];
|
|
41446
|
+
if (section?.name !== "Previews" || block.start < section.content) {
|
|
41447
|
+
fail(block.start, `previews.${block.id}`, "preview-section", `Preview ${block.id} is outside ## Previews`, "Move the block under ## Previews.");
|
|
41448
|
+
}
|
|
41449
|
+
}
|
|
41450
|
+
}
|
|
41451
|
+
function parseStudioFile(id, source, from, { requirePreviewCopy = false, requireSections = false } = {}) {
|
|
41427
41452
|
const problems = [];
|
|
41428
41453
|
const fail = (offset, path36, code, message, hint2) => problems.push({ file: from, ...sourcePosition(source, offset), path: path36, code, message, hint: hint2 });
|
|
41429
41454
|
const result = () => ({ problem: problems.map((p) => `${p.file}:${p.line}:${p.column} ${p.path}: ${p.code} \u2014 ${p.message}. ${p.hint}`).join("\n"), problems });
|
|
@@ -41475,14 +41500,7 @@ function parseStudioFile(id, source, from, { requirePreviewCopy = false, require
|
|
|
41475
41500
|
);
|
|
41476
41501
|
}
|
|
41477
41502
|
}
|
|
41478
|
-
if (
|
|
41479
|
-
const sections = landSections(body, parsed.blocks);
|
|
41480
|
-
if (!sections.length) fail(bodyOffset, "Land", "studio-land-missing", "Missing ## Land section", "Add ## Land to the Studio body and describe delivery, checks and what to record.");
|
|
41481
|
-
for (const [index, { offset, empty }] of sections.entries()) {
|
|
41482
|
-
if (index) fail(bodyOffset + offset, "Land", "studio-land-duplicate", "Repeated ## Land section", "Combine delivery instructions under one ## Land heading.");
|
|
41483
|
-
if (empty) fail(bodyOffset + offset, "Land", "studio-land-empty", "The ## Land section is empty", "Describe delivery, checks and what to record under ## Land.");
|
|
41484
|
-
}
|
|
41485
|
-
}
|
|
41503
|
+
if (requireSections) checkStudioSections(body, parsed.blocks, (offset, ...problem) => fail(bodyOffset + offset, ...problem));
|
|
41486
41504
|
if (problems.length) return result();
|
|
41487
41505
|
let rules = "", at = 0;
|
|
41488
41506
|
for (const block of parsed.blocks) {
|
|
@@ -41595,7 +41613,7 @@ function checkStudioFiles(value, official = false, checks = {}) {
|
|
|
41595
41613
|
const first = read3.problems[0];
|
|
41596
41614
|
return first ? { ok: false, ...first, problems: read3.problems } : { ok: true, def: read3.def, files: read3.files };
|
|
41597
41615
|
}
|
|
41598
|
-
function inspect(value, official, { allowLegacyPreviewCopy,
|
|
41616
|
+
function inspect(value, official, { allowLegacyPreviewCopy, allowLegacySections } = {}) {
|
|
41599
41617
|
const problems = [];
|
|
41600
41618
|
const fail = (file2, reason, tooLarge = false) => {
|
|
41601
41619
|
problems.push({ file: file2, reason, ...tooLarge ? { tooLarge } : {} });
|
|
@@ -41668,7 +41686,7 @@ function inspect(value, official, { allowLegacyPreviewCopy, allowLegacyLand } =
|
|
|
41668
41686
|
});
|
|
41669
41687
|
}
|
|
41670
41688
|
const source = files[STUDIO_FILE];
|
|
41671
|
-
const read3 = typeof source === "string" ? parseStudioFile("studio", source, STUDIO_FILE, { requirePreviewCopy: !official && !allowLegacyPreviewCopy,
|
|
41689
|
+
const read3 = typeof source === "string" ? parseStudioFile("studio", source, STUDIO_FILE, { requirePreviewCopy: !official && !allowLegacyPreviewCopy, requireSections: !allowLegacySections }) : null;
|
|
41672
41690
|
if (!read3) fail(STUDIO_FILE, "is missing");
|
|
41673
41691
|
else if ("problem" in read3) for (const problem of read3.problems) problems.push({ ...problem, reason: problem.message });
|
|
41674
41692
|
if (!read3 || "problem" in read3) return { problems };
|
|
@@ -41739,7 +41757,7 @@ var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray
|
|
|
41739
41757
|
var hasText = (value) => typeof value === "string" && !!value.trim();
|
|
41740
41758
|
function temporaryCloudFailure({ code, status: status2 }) {
|
|
41741
41759
|
if (code && ["unauthenticated", "machine_offline", "quota_exceeded", "daily_write_budget_reached", "storage_limit_reached"].includes(code)) return false;
|
|
41742
|
-
return ["unreachable", "invalid_response", "idempotency_in_progress", "service_unavailable", "artifacts_unavailable"].includes(code ?? "") || status2 === 408 || (status2 !== void 0 ? status2 >= 500 : !code);
|
|
41760
|
+
return ["unreachable", "invalid_response", "idempotency_in_progress", "service_unavailable", "artifacts_unavailable", "board-busy"].includes(code ?? "") || status2 === 408 || (status2 !== void 0 ? status2 >= 500 : !code);
|
|
41743
41761
|
}
|
|
41744
41762
|
var invalidResponse = (expected) => ({ code: "invalid_response", message: `Cloud did not return ${expected}.`, retryable: true });
|
|
41745
41763
|
async function readCloudJson(response) {
|
|
@@ -41755,8 +41773,8 @@ function cloudProblem(response, body) {
|
|
|
41755
41773
|
}
|
|
41756
41774
|
|
|
41757
41775
|
// src/protocol.ts
|
|
41758
|
-
var VERSION = true ? "0.6.
|
|
41759
|
-
var AKB_VERSION = true ? "0.11.
|
|
41776
|
+
var VERSION = true ? "0.6.128" : "0.0.0";
|
|
41777
|
+
var AKB_VERSION = true ? "0.11.110" : "0.0.0";
|
|
41760
41778
|
|
|
41761
41779
|
// ../cli/src/lib/agent/harnesses/antigravity.ts
|
|
41762
41780
|
import fs10 from "node:fs";
|
|
@@ -42947,8 +42965,8 @@ function createTail(log) {
|
|
|
42947
42965
|
// ../cli/package.json
|
|
42948
42966
|
var package_default = {
|
|
42949
42967
|
name: "wildcrane",
|
|
42950
|
-
version: "0.11.
|
|
42951
|
-
akbContract:
|
|
42968
|
+
version: "0.11.110",
|
|
42969
|
+
akbContract: 42,
|
|
42952
42970
|
canonicalCommands: true,
|
|
42953
42971
|
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.",
|
|
42954
42972
|
keywords: [
|
|
@@ -44335,37 +44353,63 @@ function dayDir(root2, at) {
|
|
|
44335
44353
|
const pad = (n) => String(n).padStart(2, "0");
|
|
44336
44354
|
return join2(root2, String(day.getFullYear()), pad(day.getMonth() + 1), pad(day.getDate()));
|
|
44337
44355
|
}
|
|
44338
|
-
function
|
|
44339
|
-
|
|
44356
|
+
function matchesRollout(name, threadId) {
|
|
44357
|
+
return name.startsWith("rollout-") && name.endsWith(".jsonl") && (name.endsWith(`-${threadId}.jsonl`) || name.includes(`-${threadId}_`));
|
|
44358
|
+
}
|
|
44359
|
+
function findCodexRollout(threadId, codexHome) {
|
|
44360
|
+
if (!threadId) return void 0;
|
|
44361
|
+
const customHome = codexHome?.trim() || process.env.CODEX_HOME?.trim();
|
|
44362
|
+
const home3 = customHome || join2(homedir2(), ".codex");
|
|
44340
44363
|
const root2 = join2(home3, "sessions");
|
|
44341
|
-
const
|
|
44342
|
-
const minted = parseInt(threadId.replace(/-/g, "").slice(0, 12), 16);
|
|
44364
|
+
const uuidLike = /^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(threadId);
|
|
44365
|
+
const minted = uuidLike ? parseInt(threadId.replace(/-/g, "").slice(0, 12), 16) : Number.NaN;
|
|
44343
44366
|
const days = /* @__PURE__ */ new Set();
|
|
44344
44367
|
for (const at of [Date.now(), ...Number.isFinite(minted) && minted > 0 ? [minted] : []]) {
|
|
44345
44368
|
for (const shift of [0, -1, 1]) days.add(dayDir(root2, at + shift * 864e5));
|
|
44346
44369
|
}
|
|
44347
|
-
let
|
|
44348
|
-
|
|
44370
|
+
let newestPath;
|
|
44371
|
+
let newestAt = -1;
|
|
44372
|
+
const considerDir = (dir) => {
|
|
44349
44373
|
let names;
|
|
44350
44374
|
try {
|
|
44351
44375
|
names = readdirSync(dir);
|
|
44352
44376
|
} catch {
|
|
44353
|
-
|
|
44377
|
+
return;
|
|
44354
44378
|
}
|
|
44355
44379
|
for (const name of names) {
|
|
44356
|
-
if (!name
|
|
44380
|
+
if (!matchesRollout(name, threadId)) continue;
|
|
44357
44381
|
const path36 = join2(dir, name);
|
|
44358
44382
|
try {
|
|
44359
44383
|
const at = statSync2(path36).mtimeMs;
|
|
44360
|
-
if (
|
|
44384
|
+
if (at > newestAt) {
|
|
44385
|
+
newestPath = path36;
|
|
44386
|
+
newestAt = at;
|
|
44387
|
+
}
|
|
44361
44388
|
} catch {
|
|
44362
44389
|
}
|
|
44363
44390
|
}
|
|
44391
|
+
};
|
|
44392
|
+
for (const dir of days) considerDir(dir);
|
|
44393
|
+
if (newestPath || !customHome && !uuidLike) return newestPath;
|
|
44394
|
+
const subdirs = (dir) => {
|
|
44395
|
+
try {
|
|
44396
|
+
return readdirSync(dir).map((n) => join2(dir, n));
|
|
44397
|
+
} catch {
|
|
44398
|
+
return [];
|
|
44399
|
+
}
|
|
44400
|
+
};
|
|
44401
|
+
for (const year of subdirs(root2)) {
|
|
44402
|
+
for (const month of subdirs(year)) {
|
|
44403
|
+
for (const day of subdirs(month)) {
|
|
44404
|
+
if (!days.has(day)) considerDir(day);
|
|
44405
|
+
}
|
|
44406
|
+
}
|
|
44364
44407
|
}
|
|
44365
|
-
|
|
44408
|
+
considerDir(join2(home3, "archived_sessions"));
|
|
44409
|
+
return newestPath;
|
|
44366
44410
|
}
|
|
44367
44411
|
function readCodexRunFacts(threadId) {
|
|
44368
|
-
const path36 =
|
|
44412
|
+
const path36 = findCodexRollout(threadId);
|
|
44369
44413
|
if (!path36) return void 0;
|
|
44370
44414
|
let raw;
|
|
44371
44415
|
try {
|
|
@@ -45366,6 +45410,13 @@ async function* terminals(rpc, threadId, alive2, verify = false) {
|
|
|
45366
45410
|
cursor = typeof page.nextCursor === "string" ? page.nextCursor : void 0;
|
|
45367
45411
|
} while (cursor !== void 0);
|
|
45368
45412
|
}
|
|
45413
|
+
async function activeTerminalHandles(rpc, threadId, alive2) {
|
|
45414
|
+
const handles = /* @__PURE__ */ new Map();
|
|
45415
|
+
for await (const { itemId, processId } of terminals(rpc, threadId, alive2, true)) {
|
|
45416
|
+
handles.set(terminalKey(threadId, itemId), processId);
|
|
45417
|
+
}
|
|
45418
|
+
return handles;
|
|
45419
|
+
}
|
|
45369
45420
|
function codexWork() {
|
|
45370
45421
|
const children = /* @__PURE__ */ new Set();
|
|
45371
45422
|
const entries = /* @__PURE__ */ new Map();
|
|
@@ -45579,17 +45630,21 @@ function createCodexConnection(argv) {
|
|
|
45579
45630
|
}
|
|
45580
45631
|
function createCodexClient(options = { images: [] }) {
|
|
45581
45632
|
let background = 0;
|
|
45633
|
+
let commandCheck = () => false;
|
|
45582
45634
|
return {
|
|
45583
45635
|
structured: true,
|
|
45584
45636
|
managedProcess: true,
|
|
45585
45637
|
idleRecovery: true,
|
|
45586
45638
|
background: () => background,
|
|
45639
|
+
activeCommand: () => commandCheck(),
|
|
45587
45640
|
turn: (io) => run(io, options, (count2) => {
|
|
45588
45641
|
background = count2;
|
|
45642
|
+
}, (check) => {
|
|
45643
|
+
commandCheck = check;
|
|
45589
45644
|
})
|
|
45590
45645
|
};
|
|
45591
45646
|
}
|
|
45592
|
-
async function run(io, options, count2) {
|
|
45647
|
+
async function run(io, options, count2, commandCheck) {
|
|
45593
45648
|
const since = Date.now();
|
|
45594
45649
|
const renderer = createCodexStreamRenderer();
|
|
45595
45650
|
let idling = false;
|
|
@@ -45638,12 +45693,17 @@ async function run(io, options, count2) {
|
|
|
45638
45693
|
const seenItems = /* @__PURE__ */ new Set();
|
|
45639
45694
|
const completedTurns = /* @__PURE__ */ new Set();
|
|
45640
45695
|
const historicalTurns = /* @__PURE__ */ new Set();
|
|
45696
|
+
const ownCommands = /* @__PURE__ */ new Set();
|
|
45641
45697
|
let currentTurn2 = "";
|
|
45642
45698
|
let threadId = "";
|
|
45643
45699
|
let active = true;
|
|
45644
45700
|
let timer;
|
|
45645
45701
|
let ended = false;
|
|
45646
45702
|
let checking = false;
|
|
45703
|
+
let checkingCommands = false;
|
|
45704
|
+
let commandProbeFailed = false;
|
|
45705
|
+
let commandCheckedAt = -Infinity;
|
|
45706
|
+
let commandHandles = /* @__PURE__ */ new Map();
|
|
45647
45707
|
let context;
|
|
45648
45708
|
let total;
|
|
45649
45709
|
let baseline;
|
|
@@ -45704,9 +45764,9 @@ async function run(io, options, count2) {
|
|
|
45704
45764
|
};
|
|
45705
45765
|
const cancelled = () => {
|
|
45706
45766
|
work.freeze();
|
|
45707
|
-
|
|
45708
|
-
|
|
45709
|
-
|
|
45767
|
+
for (const [id, entry] of work.entries) if (!itemTerminal(entry)) work.background.add(id);
|
|
45768
|
+
if (submitted && !started) note("Execution stopped before turn startup was confirmed.");
|
|
45769
|
+
else if (work.work().some((w) => !itemTerminal(w))) note(STOPPED_CLEANUP_DETAIL);
|
|
45710
45770
|
end("Codex execution stopped.");
|
|
45711
45771
|
};
|
|
45712
45772
|
io.signal?.addEventListener("abort", cancelled, { once: true });
|
|
@@ -45967,6 +46027,11 @@ async function run(io, options, count2) {
|
|
|
45967
46027
|
if (msg.method === "item/started" || msg.method === "item/completed") {
|
|
45968
46028
|
const raw = obj2(p.item);
|
|
45969
46029
|
work.observe(source, raw);
|
|
46030
|
+
const itemTurn = str2(p.turnId);
|
|
46031
|
+
if (source === threadId && submitted && active && itemTurn === currentTurn2 && itemTurn && raw.type === "commandExecution" && str2(raw.id)) {
|
|
46032
|
+
const id = terminalKey(source, str2(raw.id));
|
|
46033
|
+
if (!retained.has(id)) ownCommands.add(id);
|
|
46034
|
+
}
|
|
45970
46035
|
if (source === threadId && active) {
|
|
45971
46036
|
if (raw.type === "commandExecution") visible.add(terminalKey(source, str2(raw.id)));
|
|
45972
46037
|
if (raw.type === "collabAgentToolCall") for (const id of Object.keys(obj2(raw.agentsStates))) visible.add(`agent:${id}`);
|
|
@@ -46069,6 +46134,33 @@ async function run(io, options, count2) {
|
|
|
46069
46134
|
void check();
|
|
46070
46135
|
}
|
|
46071
46136
|
});
|
|
46137
|
+
commandCheck(() => {
|
|
46138
|
+
if (ended || idling || !threadId || commandProbeFailed) return false;
|
|
46139
|
+
const running = (id) => ownCommands.has(id) && work.entries.get(id)?.status === "running";
|
|
46140
|
+
const now = Date.now();
|
|
46141
|
+
if (!checkingCommands && now - commandCheckedAt >= 1e3 && [...ownCommands].some(running)) {
|
|
46142
|
+
checkingCommands = true;
|
|
46143
|
+
let settled = false;
|
|
46144
|
+
void bounded(
|
|
46145
|
+
activeTerminalHandles(rpc, threadId, () => !ended && !idling && !settled),
|
|
46146
|
+
2e3,
|
|
46147
|
+
"Codex background verification timed out."
|
|
46148
|
+
).then((handles) => {
|
|
46149
|
+
commandHandles = handles;
|
|
46150
|
+
commandCheckedAt = Date.now();
|
|
46151
|
+
}, () => {
|
|
46152
|
+
commandProbeFailed = true;
|
|
46153
|
+
}).finally(() => {
|
|
46154
|
+
settled = true;
|
|
46155
|
+
checkingCommands = false;
|
|
46156
|
+
});
|
|
46157
|
+
}
|
|
46158
|
+
return now - commandCheckedAt <= 3e3 && [...commandHandles].some(([id, handle]) => {
|
|
46159
|
+
if (!running(id)) return false;
|
|
46160
|
+
const observed = work.entries.get(id)?.processId;
|
|
46161
|
+
return !observed || observed === handle;
|
|
46162
|
+
});
|
|
46163
|
+
});
|
|
46072
46164
|
try {
|
|
46073
46165
|
if (io.signal?.aborted) {
|
|
46074
46166
|
cancelled();
|
|
@@ -48626,8 +48718,10 @@ var PAGE = (outcome, lang, links) => {
|
|
|
48626
48718
|
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>`;
|
|
48627
48719
|
};
|
|
48628
48720
|
function sameToken(a, b) {
|
|
48629
|
-
if (!a
|
|
48630
|
-
|
|
48721
|
+
if (!a) return false;
|
|
48722
|
+
const received = Buffer.from(a);
|
|
48723
|
+
const expected = Buffer.from(b);
|
|
48724
|
+
return received.length === expected.length && crypto6.timingSafeEqual(received, expected);
|
|
48631
48725
|
}
|
|
48632
48726
|
async function signIn(options = {}) {
|
|
48633
48727
|
const generation = accountGeneration();
|
|
@@ -48685,11 +48779,18 @@ async function signIn(options = {}) {
|
|
|
48685
48779
|
const params = asked.searchParams;
|
|
48686
48780
|
const code = params.get("code");
|
|
48687
48781
|
const error = params.get("error");
|
|
48688
|
-
const
|
|
48689
|
-
|
|
48690
|
-
|
|
48691
|
-
|
|
48692
|
-
}
|
|
48782
|
+
const errorCode = params.get("error_code");
|
|
48783
|
+
let failure3;
|
|
48784
|
+
if (!sameToken(params.get("state"), oauthState)) {
|
|
48785
|
+
failure3 = { why: "other", detail: "invalid oauth state" };
|
|
48786
|
+
} else if (code && !error && errorCode === null) {
|
|
48787
|
+
failure3 = await exchange(code, verifier, generation, options.signal);
|
|
48788
|
+
} else {
|
|
48789
|
+
failure3 = {
|
|
48790
|
+
why: error === "access_denied" && errorCode === null ? "denied" : "other",
|
|
48791
|
+
detail: params.get("error_description") || errorCode || error || "no code came back"
|
|
48792
|
+
};
|
|
48793
|
+
}
|
|
48693
48794
|
const outcome = !failure3 ? "ok" : failure3.why === "denied" ? "denied" : "failed";
|
|
48694
48795
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8" });
|
|
48695
48796
|
res.end(PAGE(outcome, lang));
|
|
@@ -48699,14 +48800,15 @@ async function signIn(options = {}) {
|
|
|
48699
48800
|
const { port } = server.address();
|
|
48700
48801
|
expectedOrigin = `http://127.0.0.1:${port}`;
|
|
48701
48802
|
const { supabaseUrl } = cloudEndpoints();
|
|
48803
|
+
const callback2 = new URL("/signed-in", expectedOrigin);
|
|
48804
|
+
callback2.searchParams.set("state", oauthState);
|
|
48702
48805
|
const authorize = (provider) => {
|
|
48703
48806
|
const url = new URL(`${supabaseUrl}/auth/v1/authorize`);
|
|
48704
48807
|
url.searchParams.set("provider", provider);
|
|
48705
|
-
url.searchParams.set("redirect_to",
|
|
48808
|
+
url.searchParams.set("redirect_to", callback2.toString());
|
|
48706
48809
|
if (provider === "github") url.searchParams.set("scopes", "user:email");
|
|
48707
48810
|
url.searchParams.set("code_challenge", challenge);
|
|
48708
48811
|
url.searchParams.set("code_challenge_method", "s256");
|
|
48709
|
-
url.searchParams.set("state", oauthState);
|
|
48710
48812
|
return url.toString().replace(/&/g, "&");
|
|
48711
48813
|
};
|
|
48712
48814
|
const choose = `http://127.0.0.1:${port}/`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wildcrane-runner",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.128",
|
|
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/",
|