wildcrane-runner 0.6.98 → 0.6.99

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.79 — built by runner/scripts/build.mjs. Do not edit.
2
+ // ai4kanban 0.11.80 — built by runner/scripts/build.mjs. Do not edit.
3
3
  import { createRequire as __ai4kanbanRequire } from 'node:module'
4
4
  const require = __ai4kanbanRequire(import.meta.url)
5
5
  var __create = Object.create;
@@ -20816,6 +20816,108 @@ var init_zod = __esm({
20816
20816
  }
20817
20817
  });
20818
20818
 
20819
+ // ../cli/src/lib/shared/preview-blocks.ts
20820
+ function sourcePosition(source2, offset) {
20821
+ const before = source2.slice(0, offset);
20822
+ return { line: before.split("\n").length, column: offset - before.lastIndexOf("\n") };
20823
+ }
20824
+ function withoutCode(source2) {
20825
+ const blank = (s) => s.replace(/[^\n\r]/g, " ");
20826
+ let fence;
20827
+ let indented = false, afterBlank = true, inList = false;
20828
+ return source2.split(/(?<=\n)/).map((line) => {
20829
+ const marker = /^ {0,3}(`{3,}|~{3,})(.*)/.exec(line);
20830
+ if (fence) {
20831
+ if (marker && marker[1][0] === fence.char && marker[1].length >= fence.length && !marker[2].trim()) fence = void 0;
20832
+ return blank(line);
20833
+ }
20834
+ if (marker) {
20835
+ fence = { char: marker[1][0], length: marker[1].length };
20836
+ return blank(line);
20837
+ }
20838
+ if (!line.trim()) {
20839
+ afterBlank = true;
20840
+ return line;
20841
+ }
20842
+ const hasIndent = /^(?: {4}|\t)/.test(line);
20843
+ if (!hasIndent) indented = false;
20844
+ if (/^ {0,3}(?:[-+*]|\d+[.)])\s/.test(line)) inList = true;
20845
+ else if (/^\S/.test(line)) inList = false;
20846
+ if (hasIndent && (indented || afterBlank && !inList)) {
20847
+ indented = true;
20848
+ return blank(line);
20849
+ }
20850
+ afterBlank = false;
20851
+ return line;
20852
+ }).join("").replace(/(`+)([^]*?)\1(?!`)/g, blank);
20853
+ }
20854
+ function parsePreviewBlocks(source2, file2 = "STUDIO.md") {
20855
+ const blocks = [], problems = [];
20856
+ const masked = withoutCode(source2);
20857
+ let open4;
20858
+ const seen = /* @__PURE__ */ new Set();
20859
+ const fail = (offset, id2, code, message, hint2) => problems.push({ file: file2, ...sourcePosition(source2, offset), path: id2 ? `previews.${id2}` : "previews", code, message, hint: hint2 });
20860
+ for (const tag of masked.matchAll(/<\/?Preview\b[^>]*(?:>|$)/g)) {
20861
+ const offset = tag.index, text5 = tag[0];
20862
+ const closing = /^<\/Preview\s*>$/.test(text5);
20863
+ if (closing) {
20864
+ if (!open4) fail(offset, "", "preview-unexpected-close", "Preview has no opening tag", "Remove it or restore its opening tag.");
20865
+ else {
20866
+ const instructions = source2.slice(open4.content, offset).trim();
20867
+ if (!instructions) fail(open4.start, open4.id, "preview-empty", `Preview ${open4.id} is empty`, "Describe the requested output inside the block.");
20868
+ blocks.push({ id: open4.id, instructions, start: open4.start, end: offset + text5.length });
20869
+ open4 = void 0;
20870
+ }
20871
+ continue;
20872
+ }
20873
+ const opening = /^<Preview\s+id=(?:"([^"]*)"|'([^']*)')\s*>$/.exec(text5);
20874
+ if (!opening || open4) {
20875
+ fail(offset, open4?.id ?? "", "preview-tag", "Malformed or nested Preview tag", 'Use one non-nested <Preview id="stable-id"> block with only id.');
20876
+ continue;
20877
+ }
20878
+ const id2 = opening[1] ?? opening[2];
20879
+ if (!PREVIEW_ID.test(id2) || seen.has(id2)) fail(offset, id2, "preview-id", `Invalid or repeated Preview ID ${id2}`, "Use a unique lowercase ID with digits and dashes.");
20880
+ seen.add(id2);
20881
+ open4 = { id: id2, start: offset, content: offset + text5.length };
20882
+ }
20883
+ if (open4) fail(open4.start, open4.id, "preview-unclosed", `Preview ${open4.id} is not closed`, "Add </Preview> after this block.");
20884
+ return { blocks, problems };
20885
+ }
20886
+ var PREVIEW_ID;
20887
+ var init_preview_blocks = __esm({
20888
+ "../cli/src/lib/shared/preview-blocks.ts"() {
20889
+ "use strict";
20890
+ PREVIEW_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
20891
+ }
20892
+ });
20893
+
20894
+ // ../cli/src/lib/shared/preview-definitions.ts
20895
+ function effectivePreviewCatalog(studio, definitions) {
20896
+ const seen = new Set(studio.map((p) => p.id));
20897
+ for (const p of definitions) {
20898
+ if (seen.has(p.id)) throw new Error(`Duplicate Preview ID "${p.id}".`);
20899
+ seen.add(p.id);
20900
+ }
20901
+ return [...studio, ...definitions];
20902
+ }
20903
+ var previewComponents, language, previewDefinitionSchema, previewDefinitionsSchema;
20904
+ var init_preview_definitions = __esm({
20905
+ "../cli/src/lib/shared/preview-definitions.ts"() {
20906
+ "use strict";
20907
+ init_zod();
20908
+ init_preview_blocks();
20909
+ previewComponents = ["Asset", "Compare", "Storyboard", "Set", "Studio"];
20910
+ language = /^[a-z]{2,3}(?:-[A-Za-z0-9]+)*$/;
20911
+ previewDefinitionSchema = external_exports.object({
20912
+ id: external_exports.string().max(100).regex(PREVIEW_ID),
20913
+ title: external_exports.record(external_exports.string().regex(language), external_exports.string().trim().min(1).max(100)).refine((names2) => Boolean(names2.en && names2.zh), "A Preview needs English and Chinese titles."),
20914
+ instructions: external_exports.string().trim().min(1).max(1e4),
20915
+ components: external_exports.array(external_exports.enum(previewComponents)).max(previewComponents.length).refine((items) => new Set(items).size === items.length, "Preview Components must be unique.").transform((items) => [...items].sort()).optional()
20916
+ }).strict();
20917
+ previewDefinitionsSchema = external_exports.array(previewDefinitionSchema).max(50);
20918
+ }
20919
+ });
20920
+
20819
20921
  // ../cli/src/lib/shared/review-plan.ts
20820
20922
  function reviewPreviewIds(plan) {
20821
20923
  return [...new Set((plan ?? []).flatMap((node2) => node2.previews))];
@@ -20881,6 +20983,7 @@ function readReviewPlan(plan) {
20881
20983
  return plan?.map(({ id: id2, after: after2, previews, kind }) => ({ id: id2, after: after2, previews, ...kind && { kind } })) ?? null;
20882
20984
  }
20883
20985
  function reviewAuthorization(review, assigned, dispatchRevision) {
20986
+ if (review.pending_plan) return { kind: "waiting" };
20884
20987
  const states2 = new Map(review.stages.map((stage) => [stage.id, stage]));
20885
20988
  const nodes = (review.plan ?? []).filter((node2) => {
20886
20989
  const stage = states2.get(node2.id);
@@ -20920,9 +21023,18 @@ function reviewInstruction(authorization) {
20920
21023
  }
20921
21024
  }
20922
21025
  function reviewBoundary(review, assigned) {
21026
+ const { preview_definitions = [], ...state } = review;
21027
+ const authorization = reviewAuthorization(review, assigned);
21028
+ const definitions = authorization.kind === "stages" && assigned ? preview_definitions.filter((p) => authorization.nodes.some((node2) => node2.previews.includes(p.id))) : preview_definitions;
20923
21029
  return [
20924
- "Task review: " + JSON.stringify(review),
20925
- reviewInstruction(reviewAuthorization(review, assigned)),
21030
+ "Task review: " + JSON.stringify(state),
21031
+ reviewInstruction(authorization),
21032
+ ...definitions.map((p) => [
21033
+ `<Preview id="${p.id}">`,
21034
+ p.instructions,
21035
+ ...p.components ? [`Allowed Preview Components: ${p.components.join(", ") || "none"}.`] : [],
21036
+ "</Preview>"
21037
+ ].join("\n")),
20926
21038
  "Read akb task review before reporting running/done with its revision. Sync content and assets before done. Revise a stage before changing its approved output. Only stage approval accepts reviewable outputs."
20927
21039
  ].join("\n");
20928
21040
  }
@@ -22231,21 +22343,24 @@ async function taskReview(id2, opts = {}, location = {}) {
22231
22343
  if (count3 > 1 || opts.stage !== void 0 && opts.status === void 0) die("Use one of --review, --file, --stage with --status, or --revise-from.");
22232
22344
  const ref = await taskRef(id2, location);
22233
22345
  let task;
22234
- if (!count3) task = await cloud("GET", `/v1/tasks/${enc(ref)}`);
22346
+ if (opts.previewDefinitionsFile !== void 0 && (opts.status !== void 0 || opts.reviseFrom !== void 0)) die("Preview definitions can only change with a review plan.");
22347
+ if (!count3 && opts.previewDefinitionsFile === void 0) task = await cloud("GET", `/v1/tasks/${enc(ref)}`);
22235
22348
  else {
22236
22349
  const review_revision = reviewRevision(opts.revision);
22237
22350
  let fields2;
22238
22351
  if (opts.review !== void 0) {
22239
- const studio = opts.review === "" ? void 0 : await cloud("GET", `/v1/tasks/${enc(ref)}/studio`);
22240
- fields2 = { operation: "plan", review_plan: parseReviewFlow(opts.review, studio?.previews) };
22352
+ fields2 = { operation: "plan", review_flow: opts.review };
22241
22353
  } else if (opts.file !== void 0) {
22242
22354
  fields2 = { operation: "plan", review_plan: parseReviewPlan(JSON.parse(fs7.readFileSync(opts.file, "utf8"))) };
22243
22355
  } else if (opts.reviseFrom !== void 0) {
22244
22356
  fields2 = { operation: "revise", stage: opts.reviseFrom };
22357
+ } else if (opts.previewDefinitionsFile !== void 0) {
22358
+ fields2 = { operation: "plan" };
22245
22359
  } else {
22246
22360
  if (!opts.stage || !["running", "done"].includes(opts.status)) die("--stage and --status running|done are required.");
22247
22361
  fields2 = { operation: "status", stage: opts.stage, status: opts.status };
22248
22362
  }
22363
+ if (opts.previewDefinitionsFile !== void 0) fields2.preview_definitions = previewDefinitionsSchema.parse(JSON.parse(fs7.readFileSync(opts.previewDefinitionsFile, "utf8")));
22249
22364
  task = await cloud("POST", `/v1/tasks/${enc(ref)}/review`, { ...fields2, review_revision });
22250
22365
  }
22251
22366
  say(JSON.stringify(task.review, null, 2));
@@ -22317,6 +22432,7 @@ var init_task = __esm({
22317
22432
  "use strict";
22318
22433
  init_env();
22319
22434
  init_reply_approval();
22435
+ init_preview_definitions();
22320
22436
  init_review_plan();
22321
22437
  init_reply_approval();
22322
22438
  init_config();
@@ -36793,81 +36909,6 @@ var init_icon = __esm({
36793
36909
  }
36794
36910
  });
36795
36911
 
36796
- // ../cli/src/lib/shared/preview-blocks.ts
36797
- function sourcePosition(source2, offset) {
36798
- const before = source2.slice(0, offset);
36799
- return { line: before.split("\n").length, column: offset - before.lastIndexOf("\n") };
36800
- }
36801
- function withoutCode(source2) {
36802
- const blank = (s) => s.replace(/[^\n\r]/g, " ");
36803
- let fence;
36804
- let indented = false, afterBlank = true, inList = false;
36805
- return source2.split(/(?<=\n)/).map((line) => {
36806
- const marker = /^ {0,3}(`{3,}|~{3,})(.*)/.exec(line);
36807
- if (fence) {
36808
- if (marker && marker[1][0] === fence.char && marker[1].length >= fence.length && !marker[2].trim()) fence = void 0;
36809
- return blank(line);
36810
- }
36811
- if (marker) {
36812
- fence = { char: marker[1][0], length: marker[1].length };
36813
- return blank(line);
36814
- }
36815
- if (!line.trim()) {
36816
- afterBlank = true;
36817
- return line;
36818
- }
36819
- const hasIndent = /^(?: {4}|\t)/.test(line);
36820
- if (!hasIndent) indented = false;
36821
- if (/^ {0,3}(?:[-+*]|\d+[.)])\s/.test(line)) inList = true;
36822
- else if (/^\S/.test(line)) inList = false;
36823
- if (hasIndent && (indented || afterBlank && !inList)) {
36824
- indented = true;
36825
- return blank(line);
36826
- }
36827
- afterBlank = false;
36828
- return line;
36829
- }).join("").replace(/(`+)([^]*?)\1(?!`)/g, blank);
36830
- }
36831
- function parsePreviewBlocks(source2, file2 = "STUDIO.md") {
36832
- const blocks = [], problems = [];
36833
- const masked = withoutCode(source2);
36834
- let open4;
36835
- const seen = /* @__PURE__ */ new Set();
36836
- const fail = (offset, id2, code, message, hint2) => problems.push({ file: file2, ...sourcePosition(source2, offset), path: id2 ? `previews.${id2}` : "previews", code, message, hint: hint2 });
36837
- for (const tag of masked.matchAll(/<\/?Preview\b[^>]*(?:>|$)/g)) {
36838
- const offset = tag.index, text5 = tag[0];
36839
- const closing = /^<\/Preview\s*>$/.test(text5);
36840
- if (closing) {
36841
- if (!open4) fail(offset, "", "preview-unexpected-close", "Preview has no opening tag", "Remove it or restore its opening tag.");
36842
- else {
36843
- const instructions = source2.slice(open4.content, offset).trim();
36844
- if (!instructions) fail(open4.start, open4.id, "preview-empty", `Preview ${open4.id} is empty`, "Describe the requested output inside the block.");
36845
- blocks.push({ id: open4.id, instructions, start: open4.start, end: offset + text5.length });
36846
- open4 = void 0;
36847
- }
36848
- continue;
36849
- }
36850
- const opening = /^<Preview\s+id=(?:"([^"]*)"|'([^']*)')\s*>$/.exec(text5);
36851
- if (!opening || open4) {
36852
- fail(offset, open4?.id ?? "", "preview-tag", "Malformed or nested Preview tag", 'Use one non-nested <Preview id="stable-id"> block with only id.');
36853
- continue;
36854
- }
36855
- const id2 = opening[1] ?? opening[2];
36856
- if (!PREVIEW_ID.test(id2) || seen.has(id2)) fail(offset, id2, "preview-id", `Invalid or repeated Preview ID ${id2}`, "Use a unique lowercase ID with digits and dashes.");
36857
- seen.add(id2);
36858
- open4 = { id: id2, start: offset, content: offset + text5.length };
36859
- }
36860
- if (open4) fail(open4.start, open4.id, "preview-unclosed", `Preview ${open4.id} is not closed`, "Add </Preview> after this block.");
36861
- return { blocks, problems };
36862
- }
36863
- var PREVIEW_ID;
36864
- var init_preview_blocks = __esm({
36865
- "../cli/src/lib/shared/preview-blocks.ts"() {
36866
- "use strict";
36867
- PREVIEW_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
36868
- }
36869
- });
36870
-
36871
36912
  // ../cli/src/lib/agent/studio-def.ts
36872
36913
  function landSections(body, previews) {
36873
36914
  const blank = (text5) => text5.replace(/[^\r\n]/g, " ");
@@ -37573,7 +37614,7 @@ var init_language = __esm({
37573
37614
  isSystemLanguage = (text5) => text5 === SYSTEM_LANGUAGE_ZH || text5 === SYSTEM_LANGUAGE_EN;
37574
37615
  languageCode = (value) => value === "zh" || value === "en" ? value : null;
37575
37616
  translating = () => runLanguage() === "zh";
37576
- systemLanguage = (language) => language === "zh" ? SYSTEM_LANGUAGE_ZH : language === "en" ? SYSTEM_LANGUAGE_EN : "";
37617
+ systemLanguage = (language2) => language2 === "zh" ? SYSTEM_LANGUAGE_ZH : language2 === "en" ? SYSTEM_LANGUAGE_EN : "";
37577
37618
  }
37578
37619
  });
37579
37620
 
@@ -37727,22 +37768,25 @@ function editGoal(args2, opts, held4) {
37727
37768
  const body = readBody(opts.bodyFile);
37728
37769
  const studio = opts.studio ? studioOf(held4, opts.studio) : fallbackStudio(held4);
37729
37770
  const id2 = `new_${held4.goals.filter((i) => i.id.startsWith("new_")).length + 1}`;
37730
- const review_plan = goalReview(held4, studio, opts);
37731
- held4.goals.push({ id: id2, title, ...body, studio, review_plan, task: null });
37732
- return { id: id2, title, studio, review_plan };
37771
+ const preview_definitions = goalDefinitions(opts);
37772
+ const review_plan = goalReview(held4, studio, opts, null, preview_definitions);
37773
+ held4.goals.push({ id: id2, title, ...body, studio, review_plan, ...opts.previewDefinitionsFile !== void 0 ? { preview_definitions } : {}, task: null });
37774
+ return { id: id2, title, studio, review_plan, preview_definitions };
37733
37775
  }
37734
37776
  const goal = named(held4, opts.id);
37735
37777
  if (goal.task) die(`${goal.id} is already a task; it no longer changes here.`);
37736
37778
  if (sub === "save") {
37737
37779
  const studio = opts.studio !== void 0 ? studioOf(held4, opts.studio) : goal.studio;
37738
- const review_plan = goalReview(held4, studio, opts, goal.review_plan ?? null);
37780
+ const preview_definitions = goalDefinitions(opts, goal.preview_definitions);
37781
+ const review_plan = goalReview(held4, studio, opts, goal.review_plan ?? null, preview_definitions);
37739
37782
  if (opts.title !== void 0) {
37740
37783
  if (!opts.title.trim()) die("--title must not be empty");
37741
37784
  goal.title = opts.title.trim();
37742
37785
  }
37743
37786
  if (opts.bodyFile !== void 0) Object.assign(goal, readBody(opts.bodyFile));
37744
37787
  Object.assign(goal, { studio, review_plan });
37745
- return { id: goal.id, title: goal.title, studio: goal.studio, review_plan: goal.review_plan };
37788
+ if (opts.previewDefinitionsFile !== void 0) goal.preview_definitions = preview_definitions;
37789
+ return { id: goal.id, title: goal.title, studio: goal.studio, review_plan, preview_definitions };
37746
37790
  }
37747
37791
  if (sub === "drop") {
37748
37792
  goal.dropped = true;
@@ -37762,8 +37806,16 @@ function cmdGoalStudios(held4 = loadGoals().held) {
37762
37806
  }
37763
37807
  return { studios: held4.studios.map((w) => ({ ...w, id: shortStudioId(w.id) })) };
37764
37808
  }
37765
- function checkGoalReview(held4, studio, value) {
37766
- const catalog = held4.studios.find((w) => w.id === studio)?.previews;
37809
+ function goalDefinitions(opts, previous = []) {
37810
+ return opts.previewDefinitionsFile === void 0 ? previous : previewDefinitionsSchema.parse(JSON.parse(fs16.readFileSync(opts.previewDefinitionsFile, "utf8")));
37811
+ }
37812
+ function goalCatalog(held4, studio, definitions) {
37813
+ const builtIn = held4.studios.find((w) => w.id === studio)?.previews;
37814
+ if (!builtIn && definitions.length) die("Preview outputs are unavailable; update Runner and try again.");
37815
+ return builtIn && effectivePreviewCatalog(builtIn, definitions);
37816
+ }
37817
+ function checkGoalReview(held4, studio, value, definitions = []) {
37818
+ const catalog = goalCatalog(held4, studio, definitions);
37767
37819
  try {
37768
37820
  const plan = parseReviewPlan(value);
37769
37821
  if (plan?.some((n) => n.previews.length) && !catalog) die("Preview outputs are unavailable; update Runner and try again.");
@@ -37772,20 +37824,19 @@ function checkGoalReview(held4, studio, value) {
37772
37824
  return die(e.message);
37773
37825
  }
37774
37826
  }
37775
- function goalReview(held4, studio, opts, previous = null) {
37827
+ function goalReview(held4, studio, opts, previous, definitions) {
37776
37828
  if (opts.review !== void 0) {
37777
37829
  if (opts.reviewFile !== void 0) die("Use either --review or --review-file.");
37778
- const catalog = held4.studios.find((w) => w.id === studio)?.previews;
37779
- return parseReviewFlow(opts.review, catalog);
37830
+ return parseReviewFlow(opts.review, goalCatalog(held4, studio, definitions));
37780
37831
  }
37781
37832
  const value = opts.reviewFile === void 0 ? previous : JSON.parse(fs16.readFileSync(opts.reviewFile, "utf8"));
37782
- return checkGoalReview(held4, studio, value);
37833
+ return checkGoalReview(held4, studio, value, definitions);
37783
37834
  }
37784
37835
  function cmdGoalPreviews(studio, held4 = loadGoals().held) {
37785
37836
  const id2 = studioOf(held4, studio);
37786
37837
  const catalog = held4.studios.find((w) => w.id === id2)?.previews;
37787
37838
  if (!catalog) die("Preview outputs are unavailable; update Runner and try again.");
37788
- const previews = catalog.map(({ id: id3, instructions }) => ({ id: id3, instructions }));
37839
+ const previews = catalog;
37789
37840
  say(previews.map((p) => `${p.id}
37790
37841
  ${p.instructions}`).join("\n"));
37791
37842
  return { previews, problems: [] };
@@ -37794,6 +37845,7 @@ var MAX_GOALS, shortStudioId, open2;
37794
37845
  var init_goal2 = __esm({
37795
37846
  "../cli/src/commands/goal.ts"() {
37796
37847
  "use strict";
37848
+ init_preview_definitions();
37797
37849
  init_review_plan();
37798
37850
  init_goal_draft();
37799
37851
  init_io();
@@ -37890,7 +37942,7 @@ async function queryPreviews(studio, workspace2) {
37890
37942
  const flow = list3.find((w) => w.id === studio || shortStudioId(w.id) === studio);
37891
37943
  if (!flow) die(`No studio \`${studio}\` here.`);
37892
37944
  if (!flow.previews) die("Preview outputs are unavailable; update Runner and try again.");
37893
- const previews = flow.previews.map(({ id: id2, instructions }) => ({ id: id2, instructions }));
37945
+ const previews = flow.previews;
37894
37946
  say(previews.map((p) => `${p.id}
37895
37947
  ${p.instructions}`).join("\n"));
37896
37948
  return { previews, problems: [] };
@@ -41869,8 +41921,8 @@ var init_package = __esm({
41869
41921
  "../cli/package.json"() {
41870
41922
  package_default = {
41871
41923
  name: "wildcrane",
41872
- version: "0.11.79",
41873
- akbContract: 26,
41924
+ version: "0.11.80",
41925
+ akbContract: 27,
41874
41926
  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.",
41875
41927
  keywords: [
41876
41928
  "kanban",
@@ -48418,8 +48470,8 @@ edits here do not last.
48418
48470
  });
48419
48471
 
48420
48472
  // ../cli/src/lib/agents/index.ts
48421
- function agentLines(agent, language = readLanguage()) {
48422
- const said2 = agent.i18n[language];
48473
+ function agentLines(agent, language2 = readLanguage()) {
48474
+ const said2 = agent.i18n[language2];
48423
48475
  return {
48424
48476
  title: said2?.title || agent.i18n.en?.title || "",
48425
48477
  description: said2?.description || agent.description
@@ -50858,13 +50910,13 @@ function languageEnv(given) {
50858
50910
  }
50859
50911
  return env2;
50860
50912
  }
50861
- function withSystemLanguage(harness, argv, env2, language) {
50913
+ function withSystemLanguage(harness, argv, env2, language2) {
50862
50914
  env2 = languageEnv(env2);
50863
- const text5 = systemLanguage(language);
50915
+ const text5 = systemLanguage(language2);
50864
50916
  if (!text5) return { argv, env: env2 };
50865
50917
  const added = argv.length ? harness.systemPrompt?.(text5, argv, env2) : void 0;
50866
50918
  if (!added?.args?.length && !Object.keys(added?.env ?? {}).length) {
50867
- const note = language === "zh" ? "\u8BED\u8A00\u89C4\u5219\u672A\u80FD\u66F4\u65B0\uFF1A\u8FDE\u63A5\u5668\u3001\u5DF2\u6709\u4F1A\u8BDD\u6216\u81EA\u8BBE\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4E0D\u652F\u6301\u6CE8\u5165\u3002\u8BF7\u81EA\u884C\u53E6\u5F00\u652F\u6301\u7684\u4F1A\u8BDD\u4EE5\u91C7\u7528\u65B0\u89C4\u5219\u3002" : "Language rules could not be updated: the connector, existing session, or custom system prompt prevents injection. Open a supported new session to apply them.";
50919
+ const note = language2 === "zh" ? "\u8BED\u8A00\u89C4\u5219\u672A\u80FD\u66F4\u65B0\uFF1A\u8FDE\u63A5\u5668\u3001\u5DF2\u6709\u4F1A\u8BDD\u6216\u81EA\u8BBE\u7CFB\u7EDF\u63D0\u793A\u8BCD\u4E0D\u652F\u6301\u6CE8\u5165\u3002\u8BF7\u81EA\u884C\u53E6\u5F00\u652F\u6301\u7684\u4F1A\u8BDD\u4EE5\u91C7\u7528\u65B0\u89C4\u5219\u3002" : "Language rules could not be updated: the connector, existing session, or custom system prompt prevents injection. Open a supported new session to apply them.";
50868
50920
  return { argv, env: env2, note };
50869
50921
  }
50870
50922
  const at = /^node(?:\.exe)?$/.test(path49.basename(argv[0])) && argv[1] && !argv[1].startsWith("-") ? 2 : 1;
@@ -51342,7 +51394,7 @@ var init_pictures = __esm({
51342
51394
  var Asset_default;
51343
51395
  var init_Asset = __esm({
51344
51396
  "../cli/src/components/Asset.md"() {
51345
- Asset_default = '# Asset\n\nShow a file as a Preview with `<Asset src=".assets/<card id>/<file>" label="..." />` alone in a paragraph.\nInline and fenced examples remain text.\n\n- **Label**: use a few words; an image\'s optional `alt` is its shipped caption and cannot contain `<`, `>` or its enclosing quote.\n- **Device**: use a separate tag for each device view, with `device="mobile"` or `device="desktop"`; both may reference the same responsive page.\n- **Variants**: versions of the same content on the same device share one tag with `variants=\'{"English": ".assets/<card id>/page.en.html", "\u4E2D\u6587": ".assets/<card id>/page.zh.html"}\'`, with `src` shown first; alternatives stay separate tags.\n- **Loop**: add `loop` for muted, looping video without controls.\n- **Tiled map**: a `.tmx` or `.tmj` `src` draws as a map; keep its `.tsx`/`.tsj` tilesets and images beside it, at the relative paths it names.\n- **Sprite animation**: a TexturePacker JSON (Hash or Array) `src` plays as an animation; keep its sheet image beside it, at the relative path `meta.image` names.\n- **Web page**: an `.html` or `.htm` `src` loads only the relative paths named in its tags and styles.\n- **Mermaid**: a `.mmd` or `.mermaid` `src` draws a diagram and shows its source if it cannot render.\n- **Excel**: a `.xlsx` draws a read-only workbook with sheet tabs, formulas, and saved results.\n- **Text**: code and other text files show as highlighted text; a `.diff` or `.patch` shows its added and removed lines.\n';
51397
+ Asset_default = '# Asset\n\nShow a file as a Preview with `<Asset src=".assets/<card id>/<file>" label="..." />` alone in a paragraph.\nInline and fenced examples remain text.\n\n- **Label**: use a few words; an image\'s optional `alt` is its shipped caption and cannot contain `<`, `>` or its enclosing quote.\n- **Device**: use a separate tag for each device view, with `device="mobile"` or `device="desktop"`; both may reference the same responsive page.\n- **Variants**: versions of the same content on the same device share one tag with `variants=\'{"English": ".assets/<card id>/page.en.html", "\u4E2D\u6587": ".assets/<card id>/page.zh.html"}\'`, with `src` shown first; alternatives stay separate tags.\n- **Loop**: add `loop` for muted, looping video without controls.\n- **Tiled map**: a `.tmx` or `.tmj` `src` draws as a map; keep its `.tsx`/`.tsj` tilesets and images beside it, at the relative paths it names.\n- **Sprite animation**: a TexturePacker JSON (Hash or Array) `src` plays as an animation; keep its sheet image beside it, at the relative path `meta.image` names.\n- **Web page**: an `.html` or `.htm` `src` loads only the relative paths named in its tags and styles.\n- **Mermaid**: a `.mmd` or `.mermaid` `src` draws a diagram and shows its source if it cannot render.\n- **Documents**: PDF, DOCX, and PPTX open in a read-only viewer with page and zoom controls. DOCX and PPTX previews use LibreOffice and the fonts installed on the Runner. The original remains downloadable.\n- **Excel**: a `.xlsx` draws a read-only workbook with sheet tabs, formulas, and saved results.\n- **Text**: code and other text files show as highlighted text; a `.diff` or `.patch` shows its added and removed lines.\n';
51346
51398
  }
51347
51399
  });
51348
51400
 
@@ -62023,7 +62075,7 @@ var init_describe_project = __esm({
62023
62075
  var discuss_goal_default;
62024
62076
  var init_discuss_goal = __esm({
62025
62077
  "../cli/src/guide/discuss-goal.md"() {
62026
- discuss_goal_default = "# Discuss a goal\n\nExplain feasible options and key tradeoffs, then save the result the user can choose to start.\n\n- **Investigations**: finish checks and diagnosis here; save a change only when findings establish it. Report unverified work plainly.\n- **Goals**: save independent deliverables separately. Update existing goals rather than duplicate them.\n- **Studio**: choose the fitting installed Studio, preferring the user's choice; read its Additional Notes with `akb studio rule <studio>` and honor their scope.\n- **Select Previews**: before saving the review plan, select Previews by matching the planned changes to the chosen Studio's Preview definitions.\n- **Review** independent Previews in parallel by default. Use Studio Preview names, e.g. `--review 'Tech choices + UI design'`. Add `->` only when the next group needs the previous group's approvals. Delivery waits for all approvals in the last group. Verify the saved plan even when no flowchart appears.\n- **Review state**: pass `--review ''` for no extra approval, leave the plan undecided while a decision is missing, and omit the option when keeping a saved plan.\n- **Decisions**: explain the proposed outcome and review arrangement before saving. Ask only for choices the user must make, with a recommendation.\n- **Start**: the user starts each Goal from the page; its effective review arrangement governs output approval.\n- **Communication**: the remote user sees tasks and previews. Use plain words and button labels, omitting internal paths, commands and tools.\n\n## Goal format\n\nUse exactly these three fields on create and update. Include only what the user requested or confirmed.\n\nPass the one-line title separately with `--title`. Use this template for `--body-file`:\n\n```markdown\n<The requested outcome in at most 150 words.>\n\n## Done when\n\n- <A verifiable condition for the requested outcome.>\n```\n";
62078
+ discuss_goal_default = '# Discuss a goal\n\nExplain feasible options and key tradeoffs, then save the result the user can choose to start.\n\n- **Investigations**: finish checks and diagnosis here; save a change only when findings establish it. Report unverified work plainly.\n- **Goals**: save independent deliverables separately. Update existing goals rather than duplicate them.\n- **Studio**: choose the fitting installed Studio, preferring the user\'s choice; read its Additional Notes with `akb studio rule <studio>` and honor their scope.\n- **Select Previews**: match requested work to the Studio\u2019s Previews. Define a Goal Preview only when the Studio lacks a requested result.\n- **Review** independent Previews in parallel by default. Use Studio or Goal Preview names, e.g. `--review \'Tech choices + UI design\'`. Add `->` when the next group needs the previous group\'s approvals. Verify the saved plan.\n- **Review state**: pass `--review \'\'` for no extra approval, leave the plan undecided while a decision is missing, and omit the option when keeping a saved plan.\n- **Decisions**: explain the proposed outcome and review arrangement before saving. Ask only for choices the user must make, with a recommendation.\n- **Start**: the user starts each Goal from the page; its effective review arrangement governs output approval. Confirm changes to task-specific Preview definitions before making the affected output.\n- **Communication**: the remote user sees tasks and previews. Use plain words and button labels, omitting internal paths, commands and tools.\n\n## Goal format\n\nUse exactly these three fields on create and update. Include only what the user requested or confirmed.\n\nPass the one-line title separately with `--title`. Use this template for `--body-file`:\n\n```markdown\n<The requested outcome in at most 150 words.>\n\n## Done when\n\n- <A verifiable condition for the requested outcome.>\n```\n\n\n## Custom Preview definitions\n\nPass a JSON array with `--preview-definitions-file`. Use a stable ID, English and Chinese titles, and concise requirements. Omit the file to keep definitions, or pass `[]` to clear them.\n\n```json\n[{\n "id": "accessibility-report",\n "title": {"en": "Accessibility report", "zh": "\u65E0\u969C\u788D\u68C0\u67E5\u62A5\u544A"},\n "instructions": "Check keyboard navigation, visible focus and contrast. Include steps to reproduce issues."\n}]\n```\n\nUse the title in a Flow such as `--review \'UI design -> Accessibility report\'` when preparation requires an earlier approval.\n';
62027
62079
  }
62028
62080
  });
62029
62081
 
@@ -65621,7 +65673,7 @@ function declareRuns(program2, cli) {
65621
65673
  withShared(task.command("approve")).argument("<task>").summary("approve the current review point").option("--stage <id>", "the reviewed node").requiredOption("--revision <n>", "the stage version you reviewed").option("--comment <text>", "a note with the approval").action(async function(id2) {
65622
65674
  await boardless(this, cli, (_, location) => taskApprove(id2, this.opts().comment, this.opts(), location));
65623
65675
  });
65624
- withShared(task.command("review")).argument("<task>").summary("read the task review, set the plan or report a stage").option("--review <flow>", "set a review flow using Studio Preview names").addHelpText("after", REVIEW_FLOW_HELP).option("--file <path>", "set a JSON review plan").option("--stage <id>", "the node to report").option("--status <status>", "running or done").option("--revise-from <id>", "revise this node and its dependents").option("--revision <n>", "the task review version read before this write").action(async function(id2) {
65676
+ withShared(task.command("review")).argument("<task>").summary("read the task review, set the plan or report a stage").option("--review <flow>", "set a review flow using Studio Preview names").addHelpText("after", REVIEW_FLOW_HELP).option("--file <path>", "set a JSON review plan").option("--stage <id>", "the node to report").option("--status <status>", "running or done").option("--preview-definitions-file <path>", "propose a JSON list of task Preview definitions").option("--revise-from <id>", "revise this node and its dependents").option("--revision <n>", "the task review version read before this write").action(async function(id2) {
65625
65677
  await boardless(this, cli, (_, location) => taskReview(id2, this.opts(), location));
65626
65678
  });
65627
65679
  const questionOps = [];
@@ -65650,7 +65702,7 @@ function declareRuns(program2, cli) {
65650
65702
  withShared(task.command("comment")).argument("<task>").argument("<text...>").summary("comment on a task").action(async function(id2, text5) {
65651
65703
  await boardless(this, cli, (_, location) => taskComment(id2, text5.join(" "), location));
65652
65704
  });
65653
- const goal = withShared(program2.command("goal")).argument("<move>", "new, save, drop or start").summary("save, drop and start goals of this conversation").description('Write a temporary draft, then goal new --title "\u2026" --body-file <file> [--studio <id>] [--review <flow>]; update with goal save --id <goal> and any of --title, --body-file, --studio, --review. goal drop --id <goal> withdraws one; goal start --id <goal> turns it into a task. A `## Done when` list in the body is what counts as done. Studios are the ones `akb studio list` shows.').option("--id <goal>", "the goal to save, drop or start").option("--title <title>", "what the goal is called").option("--body-file <path>", "the outcome, then a `## Done when` list").option("--studio <id>", "the studio that does the work, from `akb studio list`").option("--review <flow>", "save a review flow using Studio Preview names").option("--review-file <path>", "JSON review nodes with after dependencies; [] needs no extra review").addHelpText("after", REVIEW_FLOW_HELP);
65705
+ const goal = withShared(program2.command("goal")).argument("<move>", "new, save, drop or start").summary("save, drop and start goals of this conversation").description('Write a temporary draft, then goal new --title "\u2026" --body-file <file> [--studio <id>] [--review <flow>]; update with goal save --id <goal> and any of --title, --body-file, --studio, --review. goal drop --id <goal> withdraws one; goal start --id <goal> turns it into a task. A `## Done when` list in the body is what counts as done. Studios are the ones `akb studio list` shows.').option("--id <goal>", "the goal to save, drop or start").option("--title <title>", "what the goal is called").option("--body-file <path>", "the outcome, then a `## Done when` list").option("--studio <id>", "the studio that does the work, from `akb studio list`").option("--review <flow>", "save a review flow using Studio Preview names").option("--preview-definitions-file <path>", "save a JSON list of Goal Preview definitions").option("--review-file <path>", "JSON review nodes with after dependencies; [] needs no extra review").addHelpText("after", REVIEW_FLOW_HELP);
65654
65706
  goal.action(async function(sub) {
65655
65707
  await boardless(this, cli, () => externalGoalSession() ? cloudGoal([sub], this.opts()) : cmdGoal([sub], this.opts()));
65656
65708
  });
@@ -1 +1 @@
1
- {"name":"wildcrane","version":"0.11.79","akbContract":26,"type":"module","private":true}
1
+ {"name":"wildcrane","version":"0.11.80","akbContract":27,"type":"module","private":true}