wildcrane 0.11.81 → 0.11.82

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.
Files changed (2) hide show
  1. package/dist/kanban.mjs +37 -30
  2. package/package.json +1 -1
package/dist/kanban.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.81 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
2
+ // ai4kanban 0.11.82 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
3
3
  // Do not edit: every change belongs in cli/src/, and a build overwrites this file.
4
4
  import { createRequire as __ai4kanbanRequire } from 'node:module'
5
5
  const require = __ai4kanbanRequire(import.meta.url)
@@ -22511,13 +22511,20 @@ var init_goal = __esm({
22511
22511
 
22512
22512
  // src/lib/goal-draft.ts
22513
22513
  import fs8 from "node:fs";
22514
+ import { randomUUID } from "node:crypto";
22514
22515
  function readGoalDraft(file2) {
22515
22516
  return decodeGoals(JSON.parse(fs8.readFileSync(file2, "utf8")));
22516
22517
  }
22517
22518
  function writeGoalDraft(file2, { goals, ...draft }, field2) {
22518
22519
  const entries = field2 === "goals" ? goals : goals.map(({ task, ...goal }) => ({ ...goal, task: task?.key ? task : task?.id ?? null }));
22519
- fs8.writeFileSync(file2, `${JSON.stringify({ ...draft, [field2]: entries }, null, 2)}
22520
- `);
22520
+ const temporary = `${file2}.${randomUUID()}.tmp`;
22521
+ try {
22522
+ fs8.writeFileSync(temporary, `${JSON.stringify({ ...draft, [field2]: entries }, null, 2)}
22523
+ `, { mode: 384, flag: "wx" });
22524
+ fs8.renameSync(temporary, file2);
22525
+ } finally {
22526
+ fs8.rmSync(temporary, { force: true });
22527
+ }
22521
22528
  }
22522
22529
  var goalDraftPath;
22523
22530
  var init_goal_draft = __esm({
@@ -37779,7 +37786,7 @@ function cmdGoal(args2, opts) {
37779
37786
  write2();
37780
37787
  if ("dropped" in result) say(`Dropped goal ${result.id}.`);
37781
37788
  else if ("start" in result) say(`Goal ${result.id} starts as a task when this turn ends.`);
37782
- else say(`Saved goal ${result.id}: ${result.title} (${shortStudioId(result.studio)}).`);
37789
+ else say(`Goal ${result.id} will be saved when this turn ends: ${result.title} (${shortStudioId(result.studio)}).`);
37783
37790
  return result;
37784
37791
  }
37785
37792
  function editGoal(args2, opts, held4) {
@@ -41341,7 +41348,7 @@ var init_codex_background_types = __esm({
41341
41348
  });
41342
41349
 
41343
41350
  // src/lib/lock.ts
41344
- import { randomUUID } from "node:crypto";
41351
+ import { randomUUID as randomUUID2 } from "node:crypto";
41345
41352
  import fs19 from "node:fs";
41346
41353
  import path18 from "node:path";
41347
41354
  function sleep2(ms) {
@@ -41399,7 +41406,7 @@ function removeClaim(dir, token2) {
41399
41406
  }
41400
41407
  function tryLock(dir) {
41401
41408
  fs19.mkdirSync(path18.dirname(dir), { recursive: true });
41402
- const token2 = `${process.pid}-${randomUUID()}`;
41409
+ const token2 = `${process.pid}-${randomUUID2()}`;
41403
41410
  const candidate = fs19.mkdtempSync(`${dir}.`);
41404
41411
  try {
41405
41412
  fs19.writeFileSync(path18.join(candidate, token2), "");
@@ -41937,7 +41944,7 @@ var init_package = __esm({
41937
41944
  "package.json"() {
41938
41945
  package_default = {
41939
41946
  name: "wildcrane",
41940
- version: "0.11.81",
41947
+ version: "0.11.82",
41941
41948
  akbContract: 27,
41942
41949
  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.",
41943
41950
  keywords: [
@@ -42137,7 +42144,7 @@ var init_catalog = __esm({
42137
42144
  // src/lib/machine/telemetry.ts
42138
42145
  import fs24 from "node:fs";
42139
42146
  import path23 from "node:path";
42140
- import { randomUUID as randomUUID2 } from "node:crypto";
42147
+ import { randomUUID as randomUUID3 } from "node:crypto";
42141
42148
  function readUsageReporting() {
42142
42149
  const { unreadable, values } = heldSettings();
42143
42150
  if (unreadable) return { on: false, disclosed: false, installId: "", unreadable: true };
@@ -42159,7 +42166,7 @@ function ensureUsageInstallId() {
42159
42166
  const held4 = readUsageReporting();
42160
42167
  if (!held4.on) return "";
42161
42168
  if (held4.installId) return held4.installId;
42162
- const id2 = randomUUID2();
42169
+ const id2 = randomUUID3();
42163
42170
  return saveSettings({ usageInstallId: id2 }).ok ? id2 : "";
42164
42171
  }
42165
42172
  function write(on, disclosed) {
@@ -42189,7 +42196,7 @@ var init_telemetry = __esm({
42189
42196
  // src/lib/machine/usage.ts
42190
42197
  import fs25 from "node:fs";
42191
42198
  import path24 from "node:path";
42192
- import { randomUUID as randomUUID3 } from "node:crypto";
42199
+ import { randomUUID as randomUUID4 } from "node:crypto";
42193
42200
  function usageSurface() {
42194
42201
  return process.env.KANBAN_DESKTOP === "1" ? "app" : "command";
42195
42202
  }
@@ -42217,10 +42224,10 @@ function reportUsage(name, fields2 = {}, surface = usageSurface()) {
42217
42224
  const day = usageDay();
42218
42225
  const state = readState();
42219
42226
  if (state.dayEvent !== day && name !== "app_day") {
42220
- append({ name: "app_day", day, id: randomUUID3(), surface, version: SKILL_VERSION });
42227
+ append({ name: "app_day", day, id: randomUUID4(), surface, version: SKILL_VERSION });
42221
42228
  writeState({ ...state, dayEvent: day });
42222
42229
  }
42223
- append({ name, day, id: randomUUID3(), surface, version: SKILL_VERSION, ...fields2 });
42230
+ append({ name, day, id: randomUUID4(), surface, version: SKILL_VERSION, ...fields2 });
42224
42231
  } catch {
42225
42232
  return;
42226
42233
  }
@@ -42307,7 +42314,7 @@ function reportBoardNumbers(customAgentsOn2) {
42307
42314
  const on = customAgentsOn2();
42308
42315
  if (on > 0) fields2.custom_agents_on = on;
42309
42316
  if (!Object.keys(fields2).length) return;
42310
- const id2 = typeof held4.id === "string" && held4.id ? held4.id : randomUUID3();
42317
+ const id2 = typeof held4.id === "string" && held4.id ? held4.id : randomUUID4();
42311
42318
  writeBoard({ id: id2, day });
42312
42319
  reportUsage("board_numbers", { board: id2, ...fields2 });
42313
42320
  } catch {
@@ -46054,7 +46061,7 @@ var init_codex_work = __esm({
46054
46061
  });
46055
46062
 
46056
46063
  // src/lib/agent/wire/codex.ts
46057
- import { randomUUID as randomUUID4 } from "node:crypto";
46064
+ import { randomUUID as randomUUID5 } from "node:crypto";
46058
46065
  import { setTimeout as delay } from "node:timers/promises";
46059
46066
  function createCodexConnection(argv) {
46060
46067
  const execAt = argv.indexOf("exec");
@@ -46147,7 +46154,7 @@ async function run(io, options, count3) {
46147
46154
  };
46148
46155
  const work = codexWork();
46149
46156
  const children = work.children;
46150
- const execution = randomUUID4();
46157
+ const execution = randomUUID5();
46151
46158
  let host2 = {};
46152
46159
  let cleanup = { status: "confirmed", execution, kept: [] };
46153
46160
  let settlement;
@@ -51061,7 +51068,7 @@ var init_run_settings = __esm({
51061
51068
  });
51062
51069
 
51063
51070
  // src/lib/agent/resolve.ts
51064
- import { randomUUID as randomUUID5 } from "node:crypto";
51071
+ import { randomUUID as randomUUID6 } from "node:crypto";
51065
51072
  function activeProviderOf({
51066
51073
  harness,
51067
51074
  values,
@@ -51240,7 +51247,7 @@ function planResume(session, agent, own2 = {}) {
51240
51247
  cwd
51241
51248
  };
51242
51249
  }
51243
- function planFork(session, agent, own2 = {}, sessionId = randomUUID5()) {
51250
+ function planFork(session, agent, own2 = {}, sessionId = randomUUID6()) {
51244
51251
  const { harness: harnessName, resumeId, cwd = REPO_ROOT } = session;
51245
51252
  if (!harnessByName(harnessName)) return null;
51246
51253
  const resolved = resolveHarness({ agent, ...own2, harness: harnessName });
@@ -52210,7 +52217,7 @@ var init_creation_lock = __esm({
52210
52217
  });
52211
52218
 
52212
52219
  // src/lib/agent/sessions.ts
52213
- import { randomUUID as randomUUID6 } from "node:crypto";
52220
+ import { randomUUID as randomUUID7 } from "node:crypto";
52214
52221
  import fs51 from "node:fs";
52215
52222
  import path54 from "node:path";
52216
52223
  function reap(runs, reaped = [], restore = []) {
@@ -52492,7 +52499,7 @@ function approvedDirect(req) {
52492
52499
  const typed = req.description?.trim();
52493
52500
  return typed ? { title: typed, approved: typed } : void 0;
52494
52501
  }
52495
- function openRun(req, prompt, notes = [], sessionId = randomUUID6(), said2) {
52502
+ function openRun(req, prompt, notes = [], sessionId = randomUUID7(), said2) {
52496
52503
  const retired = retiredStudioRun(req.action);
52497
52504
  if (retired) return retired;
52498
52505
  if (req.deliveryId && findDelivery(req.deliveryId)?.scheduled) return retiredStudioRun("scheduled");
@@ -52557,7 +52564,7 @@ function openRun(req, prompt, notes = [], sessionId = randomUUID6(), said2) {
52557
52564
  // Internal refinement sessions name their position in the request. A standalone
52558
52565
  // resolve carries no round.
52559
52566
  refineRound: req.refineRound,
52560
- flowId: parent?.flowId ?? req.flowId ?? randomUUID6(),
52567
+ flowId: parent?.flowId ?? req.flowId ?? randomUUID7(),
52561
52568
  ...parent ? { parentId: parent.sessionId, deliveryId: parent.deliveryId, specAgent: req.specAgent } : {}
52562
52569
  };
52563
52570
  const out = withCreationLock(() => withStore((store) => {
@@ -52602,7 +52609,7 @@ function carriedSession(req) {
52602
52609
  const fresh = (why2) => ({ note: `new session \u2014 ${why2}` });
52603
52610
  if (req.session === "new") return fresh("the earlier one is gone, so this step was started again");
52604
52611
  const agent = agentForRun(req);
52605
- const own2 = planRun(randomUUID6(), REPO_ROOT, agent, req.runtime ? { pin: req.runtime } : {});
52612
+ const own2 = planRun(randomUUID7(), REPO_ROOT, agent, req.runtime ? { pin: req.runtime } : {});
52606
52613
  const resumeId = req.carry?.resumeId;
52607
52614
  const found2 = resumeId ? { session: { harness: own2.harness, resumeId }, fork: req.carry?.fork === true } : planningSession(req.id);
52608
52615
  if ("none" in found2) {
@@ -52616,7 +52623,7 @@ function carriedSession(req) {
52616
52623
  const pin = { pin: own2.runtime };
52617
52624
  return found2.fork ? planFork(session, agent, pin, sessionId) : planResume(session, agent, pin);
52618
52625
  };
52619
- if (!plan(REPO_ROOT, randomUUID6())) {
52626
+ if (!plan(REPO_ROOT, randomUUID7())) {
52620
52627
  return fresh(`${harnessLabel(own2.harness)} cannot ${found2.fork ? "copy a session" : "continue an earlier session"}`);
52621
52628
  }
52622
52629
  return {
@@ -52698,7 +52705,7 @@ async function openResume(id2, options) {
52698
52705
  }
52699
52706
  const resuming = prev.deliveryId ? findDelivery(prev.deliveryId) : void 0;
52700
52707
  const cwd = deliveryCwd(resuming ?? {});
52701
- const sessionId = randomUUID6();
52708
+ const sessionId = randomUUID7();
52702
52709
  let plan;
52703
52710
  let fresh;
52704
52711
  if (!forced && prev.harness === "antigravity" && !session && !neverStarted(prev)) {
@@ -62352,7 +62359,7 @@ var init_describe_project = __esm({
62352
62359
  var discuss_goal_default;
62353
62360
  var init_discuss_goal = __esm({
62354
62361
  "src/guide/discuss-goal.md"() {
62355
- 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**: choose Studio Previews for drafts or results that need review. Define a Goal Preview for a requested result the Studio lacks. Keep task context in the Goal body.\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';
62362
+ 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**: choose Studio Previews for drafts or results that need review. Define a Goal Preview for a requested result the Studio lacks. Keep task context in the Goal body.\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- **Save**: in a web discussion, use `akb goal` in the current session, including on retry. Say the goal is ready to save when the reply ends. If the command still fails, say it was not saved.\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';
62356
62363
  }
62357
62364
  });
62358
62365
 
@@ -62368,7 +62375,7 @@ var init_follow_up = __esm({
62368
62375
  var implement_default;
62369
62376
  var init_implement = __esm({
62370
62377
  "src/guide/implement.md"() {
62371
- implement_default = "# Implement the approved requirements\n\nBuild the approved requirements without reopening settled decisions or unrelated questions; without a card, create none.\n\nFor Git deliveries, adapt the approved work to the current target branch and preserve changes\nit made since approval, including removals. Stop the affected work and use\n`akb guide update-questions` only if those changes conflict with the task's core intent.\n\nDo not push, publish or deploy.\n\nOnce a task meets its Studio's delivery conditions, follow `akb guide archive` to record\ndelivery completion before ending the run.\n\n- **Verification**: run required and minimal representative checks, reuse valid results, distinguish defects from environment or tool limits, stop retries that add no evidence, and finish when acceptance is proven.\n- **Authorization**: carry approval for necessary in-scope operations across tools and stages without asking again.\n- **Blockers**: resolve routine problems and use `akb guide update-questions` only for user-action blockers or out-of-scope decisions, stating attempts, impact and recommendation while continuing independent work.\n- **Defer**: follow `akb guide follow-up` for unrelated work and keep it from blocking delivery.\n- **Decisions**: record material, reversible build decisions under `## Worth noting after implementation`.\n";
62378
+ implement_default = "# Implement the approved requirements\n\nBuild the approved requirements without reopening settled decisions or unrelated questions; without a card, create none.\n\nFor Git deliveries, adapt the approved work to the current target branch and preserve its\nbehavior and removals unless the task's core intent requires changing them. Stop the\naffected work and use `akb guide update-questions` only if those changes conflict with the\ntask's core intent.\n\nDo not push, publish or deploy.\n\nOnce a task meets its Studio's delivery conditions, follow `akb guide archive` to record\ndelivery completion before ending the run.\n\n- **Verification**: run required and minimal representative checks, reuse valid results, distinguish defects from environment or tool limits, stop retries that add no evidence, and finish when acceptance is proven.\n- **Authorization**: carry approval for necessary in-scope operations across tools and stages without asking again.\n- **Blockers**: resolve routine problems and use `akb guide update-questions` only for user-action blockers or out-of-scope decisions, stating attempts, impact and recommendation while continuing independent work.\n- **Defer**: follow `akb guide follow-up` for unrelated work and keep it from blocking delivery.\n- **Decisions**: record material, reversible build decisions under `## Worth noting after implementation`.\n";
62372
62379
  }
62373
62380
  });
62374
62381
 
@@ -62969,7 +62976,7 @@ var init_complete = __esm({
62969
62976
  });
62970
62977
 
62971
62978
  // src/lib/agent/start.ts
62972
- import { randomUUID as randomUUID7 } from "node:crypto";
62979
+ import { randomUUID as randomUUID8 } from "node:crypto";
62973
62980
  async function startRun(req) {
62974
62981
  const short2 = retiredStudioRun(req.action) ?? studioRefusal(req);
62975
62982
  if (short2) return short2;
@@ -62978,7 +62985,7 @@ async function startRun(req) {
62978
62985
  const previous = readRuns().filter((r) => r.deliveryId === delivery.deliveryId && r.action === "implement").reverse().sort((a, b) => b.startedAt - a.startedAt)[0];
62979
62986
  if (previous && !delivery.completions?.some((c) => c.sessionId === previous.sessionId || c.resumedSessions?.includes(previous.sessionId))) return startResume(previous.sessionId, { deliveryId: delivery.deliveryId, notes: req.notes });
62980
62987
  }
62981
- return open3(req, randomUUID7());
62988
+ return open3(req, randomUUID8());
62982
62989
  }
62983
62990
  function studioRefusal(req) {
62984
62991
  if (!Number.isInteger(req.id)) return null;
@@ -63007,7 +63014,7 @@ function startSubRun(parentId, prompt, runtime) {
63007
63014
  specAgent: parent.agent,
63008
63015
  runtime: runtime ?? inherited
63009
63016
  },
63010
- randomUUID7()
63017
+ randomUUID8()
63011
63018
  );
63012
63019
  }
63013
63020
  function runAsk(req, sessionId) {
@@ -65663,7 +65670,7 @@ var init_previews = __esm({
65663
65670
  // src/commands/studio-preview.ts
65664
65671
  import fs85 from "node:fs";
65665
65672
  import path84 from "node:path";
65666
- import { createHash as createHash9, randomUUID as randomUUID8 } from "node:crypto";
65673
+ import { createHash as createHash9, randomUUID as randomUUID9 } from "node:crypto";
65667
65674
  import { spawnSync as spawnSync7 } from "node:child_process";
65668
65675
  function readFolder2(folder2, baseline = false) {
65669
65676
  const root2 = fs85.realpathSync(folder2);
@@ -65700,7 +65707,7 @@ ${start < 0 ? "" : lines.slice(start + 2).join("\n")}`;
65700
65707
  }
65701
65708
  async function cmdStudioPreview(id2, opts) {
65702
65709
  if (!locate(id2)) die(`no card ${id2}`, "no-such-card");
65703
- const destination = path84.join(ASSETS, String(id2), "studio-review"), staging = `${destination}.${randomUUID8()}.tmp`, backup = `${destination}.${randomUUID8()}.previous`;
65710
+ const destination = path84.join(ASSETS, String(id2), "studio-review"), staging = `${destination}.${randomUUID9()}.tmp`, backup = `${destination}.${randomUUID9()}.previous`;
65704
65711
  let moved = false;
65705
65712
  try {
65706
65713
  const draft = readFolder2(path84.resolve(opts.folder)), base = opts.base === "empty" ? null : readFolder2(path84.resolve(opts.base), true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane",
3
- "version": "0.11.81",
3
+ "version": "0.11.82",
4
4
  "akbContract": 27,
5
5
  "description": "WildCrane's `akb` command — scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
6
6
  "keywords": [