wildcrane-runner 0.6.64 → 0.6.66

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/launcher.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.64 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.66 — 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;
@@ -26903,8 +26903,8 @@ function saveAlphaUpdates(value) {
26903
26903
  }
26904
26904
 
26905
26905
  // src/protocol.ts
26906
- var VERSION = true ? "0.6.64" : "0.0.0";
26907
- var AKB_VERSION = true ? "0.11.50" : "0.0.0";
26906
+ var VERSION = true ? "0.6.66" : "0.0.0";
26907
+ var AKB_VERSION = true ? "0.11.52" : "0.0.0";
26908
26908
  var EXIT_REFUSED = 10;
26909
26909
  var EXIT_OUTDATED = 11;
26910
26910
  var EXIT_UPDATE = 12;
@@ -27214,6 +27214,16 @@ function readMap(lines, start, indent) {
27214
27214
  return [out, i];
27215
27215
  }
27216
27216
  function readScalar(value) {
27217
+ if (value.startsWith("{") && value.endsWith("}")) {
27218
+ const entries = value.slice(1, -1).match(/(?:[^,"']|"(?:\\.|[^"\\])*"|'(?:''|[^'])*')+/g) ?? [];
27219
+ const out = {};
27220
+ for (const entry2 of entries) {
27221
+ const pair = /^\s*([^:]+):\s*(.+)$/.exec(entry2);
27222
+ if (!pair) return value;
27223
+ out[unquote(pair[1].trim())] = readScalar(pair[2].trim());
27224
+ }
27225
+ return out;
27226
+ }
27217
27227
  const flow = value.match(/^\[(.*)\]$/);
27218
27228
  if (!flow) return unquote(value);
27219
27229
  return flow[1].split(",").map((item) => unquote(item.trim())).filter(Boolean);
@@ -27306,6 +27316,22 @@ function parseSpecAgent(text3, from, file2, builtIn = false, list2 = () => []) {
27306
27316
  if (declaredSession && declaredSession !== "new") {
27307
27317
  return bad(`\`${name}\` declares \`akb.session: ${declaredSession}\` \u2014 it is \`new\`, or left out to run in the planning session`);
27308
27318
  }
27319
+ let stages;
27320
+ if (akb.stages !== void 0) {
27321
+ if (!Array.isArray(akb.stages) || !akb.stages.length || akb.stages.length > 50) return bad("`akb.stages` must contain 1 to 50 stages");
27322
+ stages = [];
27323
+ for (const value of akb.stages) {
27324
+ const row = map(value);
27325
+ const id = str(row?.id);
27326
+ const title = map(row?.title);
27327
+ const instructions2 = str(row?.instructions);
27328
+ if (!row || Object.keys(row).some((key) => !["id", "title", "instructions", "when"].includes(key)) || !AGENT_NAME.test(id) || stages.some((stage) => stage.id === id)) return bad("`akb.stages` needs unique stage IDs and only id, title, instructions and optional when");
27329
+ if (!title || !str(title.en) || Object.values(title).some((text4) => typeof text4 !== "string" || !text4.trim())) return bad(`stage ${id} needs a title map with en`);
27330
+ if (!instructions2.endsWith(".md") || instructions2.startsWith("/") || instructions2.includes("\\") || instructions2.split("/").some((part) => !part || part === ".." || part === ".") || !file2(instructions2)?.trim()) return bad(`stage ${id} needs an existing agent-relative instructions file`);
27331
+ if (row.when !== void 0 && !str(row.when)) return bad(`stage ${id} needs nonempty when text, or omit when for a required stage`);
27332
+ stages.push({ id, title: Object.fromEntries(Object.entries(title).map(([lang, text4]) => [lang, str(text4)])), instructions: instructions2, ...str(row.when) ? { when: str(row.when) } : {} });
27333
+ }
27334
+ }
27309
27335
  const components = akb.components === void 0 ? ["Asset"] : akb.components;
27310
27336
  if (!Array.isArray(components) || components.some((value) => typeof value !== "string" || !value.trim())) {
27311
27337
  return bad(`\`${name}\` declares \`akb.components\` that is not a list of component IDs`);
@@ -27326,6 +27352,7 @@ function parseSpecAgent(text3, from, file2, builtIn = false, list2 = () => []) {
27326
27352
  description,
27327
27353
  ...when ? { when } : {},
27328
27354
  after,
27355
+ ...stages ? { stages } : {},
27329
27356
  components: [...new Set(components.map((value) => value.trim()))],
27330
27357
  ...icon ? { icon } : {},
27331
27358
  ...akb.merges === "true" ? { merges: true } : {},
@@ -27595,6 +27622,9 @@ function inspect(value, official) {
27595
27622
  ...def.land.map((h) => [h.agent, "it lands with"]),
27596
27623
  ...def.scheduled.map((s) => [s.agent, "it schedules"])
27597
27624
  ];
27625
+ for (const { agent } of [...def.land, ...def.scheduled]) {
27626
+ if (agents.get(agent)?.stages) fail(`agents/${agent}/AGENT.md`, "`akb.stages` is only supported for preview agents");
27627
+ }
27598
27628
  for (const [name, why] of named) {
27599
27629
  if (!agents.has(name) && !folders2.has(name)) fail(STUDIO_FILE, `${why} \`${name}\`, which has no agents/${name}/AGENT.md`);
27600
27630
  }
@@ -31016,8 +31046,8 @@ function createTail(log) {
31016
31046
  // ../cli/package.json
31017
31047
  var package_default = {
31018
31048
  name: "wildcrane",
31019
- version: "0.11.50",
31020
- akbContract: 14,
31049
+ version: "0.11.52",
31050
+ akbContract: 15,
31021
31051
  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.",
31022
31052
  keywords: [
31023
31053
  "kanban",
@@ -31689,7 +31719,8 @@ function createCodexConnection(argv) {
31689
31719
  }
31690
31720
  }
31691
31721
  if (roots.length) server.push("-c", `sandbox_workspace_write.writable_roots=${JSON.stringify(roots)}`);
31692
- return { argv: server, client: createCodexClient(options) };
31722
+ const proxy = process.env.WILDCRANE_CODEX_PROXY;
31723
+ return { argv: proxy && process.env.WILDCRANE_CODEX_SERVER ? [process.execPath, proxy, ...server] : server, client: createCodexClient(options) };
31693
31724
  }
31694
31725
  function createCodexClient(options = { images: [] }) {
31695
31726
  const tasks = createBackgroundTasks();
package/dist/plugin.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.64 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.66 — 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;
@@ -73825,8 +73825,8 @@ function machineId() {
73825
73825
  var machineName = () => os3.hostname().replace(/\.local$/, "");
73826
73826
 
73827
73827
  // src/protocol.ts
73828
- var VERSION = true ? "0.6.64" : "0.0.0";
73829
- var AKB_VERSION = true ? "0.11.50" : "0.0.0";
73828
+ var VERSION = true ? "0.6.66" : "0.0.0";
73829
+ var AKB_VERSION = true ? "0.11.52" : "0.0.0";
73830
73830
  var EXIT_REFUSED = 10;
73831
73831
  var EXIT_OUTDATED = 11;
73832
73832
  var EXIT_UPDATE = 12;
@@ -74130,6 +74130,16 @@ function readMap(lines, start, indent) {
74130
74130
  return [out, i];
74131
74131
  }
74132
74132
  function readScalar(value) {
74133
+ if (value.startsWith("{") && value.endsWith("}")) {
74134
+ const entries = value.slice(1, -1).match(/(?:[^,"']|"(?:\\.|[^"\\])*"|'(?:''|[^'])*')+/g) ?? [];
74135
+ const out = {};
74136
+ for (const entry of entries) {
74137
+ const pair = /^\s*([^:]+):\s*(.+)$/.exec(entry);
74138
+ if (!pair) return value;
74139
+ out[unquote(pair[1].trim())] = readScalar(pair[2].trim());
74140
+ }
74141
+ return out;
74142
+ }
74133
74143
  const flow = value.match(/^\[(.*)\]$/);
74134
74144
  if (!flow) return unquote(value);
74135
74145
  return flow[1].split(",").map((item) => unquote(item.trim())).filter(Boolean);
@@ -74222,6 +74232,22 @@ function parseSpecAgent(text4, from, file2, builtIn = false, list2 = () => []) {
74222
74232
  if (declaredSession && declaredSession !== "new") {
74223
74233
  return bad(`\`${name}\` declares \`akb.session: ${declaredSession}\` \u2014 it is \`new\`, or left out to run in the planning session`);
74224
74234
  }
74235
+ let stages;
74236
+ if (akb.stages !== void 0) {
74237
+ if (!Array.isArray(akb.stages) || !akb.stages.length || akb.stages.length > 50) return bad("`akb.stages` must contain 1 to 50 stages");
74238
+ stages = [];
74239
+ for (const value of akb.stages) {
74240
+ const row = map(value);
74241
+ const id = str(row?.id);
74242
+ const title = map(row?.title);
74243
+ const instructions2 = str(row?.instructions);
74244
+ if (!row || Object.keys(row).some((key) => !["id", "title", "instructions", "when"].includes(key)) || !AGENT_NAME.test(id) || stages.some((stage) => stage.id === id)) return bad("`akb.stages` needs unique stage IDs and only id, title, instructions and optional when");
74245
+ if (!title || !str(title.en) || Object.values(title).some((text5) => typeof text5 !== "string" || !text5.trim())) return bad(`stage ${id} needs a title map with en`);
74246
+ if (!instructions2.endsWith(".md") || instructions2.startsWith("/") || instructions2.includes("\\") || instructions2.split("/").some((part) => !part || part === ".." || part === ".") || !file2(instructions2)?.trim()) return bad(`stage ${id} needs an existing agent-relative instructions file`);
74247
+ if (row.when !== void 0 && !str(row.when)) return bad(`stage ${id} needs nonempty when text, or omit when for a required stage`);
74248
+ stages.push({ id, title: Object.fromEntries(Object.entries(title).map(([lang, text5]) => [lang, str(text5)])), instructions: instructions2, ...str(row.when) ? { when: str(row.when) } : {} });
74249
+ }
74250
+ }
74225
74251
  const components = akb.components === void 0 ? ["Asset"] : akb.components;
74226
74252
  if (!Array.isArray(components) || components.some((value) => typeof value !== "string" || !value.trim())) {
74227
74253
  return bad(`\`${name}\` declares \`akb.components\` that is not a list of component IDs`);
@@ -74242,6 +74268,7 @@ function parseSpecAgent(text4, from, file2, builtIn = false, list2 = () => []) {
74242
74268
  description,
74243
74269
  ...when ? { when } : {},
74244
74270
  after,
74271
+ ...stages ? { stages } : {},
74245
74272
  components: [...new Set(components.map((value) => value.trim()))],
74246
74273
  ...icon ? { icon } : {},
74247
74274
  ...akb.merges === "true" ? { merges: true } : {},
@@ -74511,6 +74538,9 @@ function inspect(value, official) {
74511
74538
  ...def.land.map((h) => [h.agent, "it lands with"]),
74512
74539
  ...def.scheduled.map((s) => [s.agent, "it schedules"])
74513
74540
  ];
74541
+ for (const { agent } of [...def.land, ...def.scheduled]) {
74542
+ if (agents.get(agent)?.stages) fail(`agents/${agent}/AGENT.md`, "`akb.stages` is only supported for preview agents");
74543
+ }
74514
74544
  for (const [name, why] of named) {
74515
74545
  if (!agents.has(name) && !folders2.has(name)) fail(STUDIO_FILE, `${why} \`${name}\`, which has no agents/${name}/AGENT.md`);
74516
74546
  }
@@ -77597,8 +77627,8 @@ function createTail(log) {
77597
77627
  // ../cli/package.json
77598
77628
  var package_default = {
77599
77629
  name: "wildcrane",
77600
- version: "0.11.50",
77601
- akbContract: 14,
77630
+ version: "0.11.52",
77631
+ akbContract: 15,
77602
77632
  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.",
77603
77633
  keywords: [
77604
77634
  "kanban",
@@ -78270,7 +78300,8 @@ function createCodexConnection(argv) {
78270
78300
  }
78271
78301
  }
78272
78302
  if (roots.length) server2.push("-c", `sandbox_workspace_write.writable_roots=${JSON.stringify(roots)}`);
78273
- return { argv: server2, client: createCodexClient(options) };
78303
+ const proxy = process.env.WILDCRANE_CODEX_PROXY;
78304
+ return { argv: proxy && process.env.WILDCRANE_CODEX_SERVER ? [process.execPath, proxy, ...server2] : server2, client: createCodexClient(options) };
78274
78305
  }
78275
78306
  function createCodexClient(options = { images: [] }) {
78276
78307
  const tasks2 = createBackgroundTasks();