wildcrane 0.11.19 → 0.11.21
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/kanban.mjs +110 -94
- package/package.json +1 -1
package/dist/kanban.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// ai4kanban 0.11.
|
|
2
|
+
// ai4kanban 0.11.21 — 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)
|
|
@@ -715,6 +715,7 @@ function cmdGoalWorkflows() {
|
|
|
715
715
|
for (const w2 of held4.workflows) {
|
|
716
716
|
say(`${shortWorkflowId(w2.id)} ${w2.name}`);
|
|
717
717
|
if (w2.description && w2.description !== w2.name) say(` ${w2.description}`);
|
|
718
|
+
if (w2.when) say(` when ${w2.when}`);
|
|
718
719
|
}
|
|
719
720
|
return { workflows: held4.workflows.map((w2) => ({ ...w2, id: shortWorkflowId(w2.id) })) };
|
|
720
721
|
}
|
|
@@ -5758,7 +5759,7 @@ var init_package = __esm({
|
|
|
5758
5759
|
"package.json"() {
|
|
5759
5760
|
package_default = {
|
|
5760
5761
|
name: "wildcrane",
|
|
5761
|
-
version: "0.11.
|
|
5762
|
+
version: "0.11.21",
|
|
5762
5763
|
akbContract: 7,
|
|
5763
5764
|
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.",
|
|
5764
5765
|
keywords: [
|
|
@@ -7083,7 +7084,7 @@ var init_AGENT25 = __esm({
|
|
|
7083
7084
|
var AGENT_default26;
|
|
7084
7085
|
var init_AGENT26 = __esm({
|
|
7085
7086
|
"src/agents/workflow-writer/AGENT.md"() {
|
|
7086
|
-
AGENT_default26 = "---\nname: workflow-writer\ndescription: Writes or changes a workflow, one of its preview agents or a scheduled agent, as a `WORKFLOW.md` and the agents it names.\nakb:\n components: [Asset]\n i18n:\n en:\n title: Workflow\n zh:\n title: \u5DE5\u4F5C\u6D41\n description: \u6309\u4F60\u7684\u63CF\u8FF0\u5199\u51FA\u6216\u4FEE\u6539\u5DE5\u4F5C\u6D41\u53CA\u5176 Preview Agent\uFF0C\u6216\u628A\u91CD\u590D\u6027\u5DE5\u4F5C\u5199\u6210\u5B9A\u65F6 agent\u3002\n---\n\nYou write a workflow from the user's request: a kind of work the user runs again and again, where each task shows a person previews to approve before the work goes on. A request may also change one preview agent in a workflow, or ask for work that repeats on a schedule.\n\n## Read first\n\n- **The project**: when the board belongs to a project folder, read its README and agent instruction files (such as `AGENTS.md` or `CLAUDE.md`) for what it makes, and its existing outputs of this kind for their format and destination.\n- **This board**: run `akb workflow list` and read `docs/kanban/agents/`, so a new workflow does not repeat one the board already has.\n\n## What to write\n\n- **The workflow**: when the card names a workflow folder, the workflow is that folder: keep its id and change it in place. Otherwise create it with `akb workflow new`. Name it with `akb workflow rename`, and list its agents in its `WORKFLOW.md`: `previews` the agents whose drafts a person approves, `land` the agents that run unattended in order after the last approval, and `scheduled`. Its body is how a card of this kind is written.\n- **Its agents**: write each agent it names as `akb guide write-agent` says.\n- **Approvals**: default to previews a person approves once. Give an agent `after` only when its preview is too costly to make before another is approved, such as a video before its script; it then waits for that approval.\n- **Previews**: give each part a person must see its own agent, such as the screens of a UI change or the script of a video. Show only what the person decides on, and keep previews from overlapping: a UI preview already shows its text, so add no separate copy preview.\n- **Land**: add agents to `land` only for work that needs no review, such as building and merging an approved change; leave it empty when the last approved preview is the deliverable.\n- **Memory**: for each agent, decide whether a user's correction should change its next output, such as a writer's tone or a designer's look; if so, declare its memory as `akb guide write-agent` says, otherwise give it none.\n- **Changing a workflow**: edit its `WORKFLOW.md` and its agents under `docs/kanban/agents/` in place, and keep what the request does not ask to change.\n- **Preview agents it does not hold**: when the request changes a preview agent of a built-in or another workflow, run `akb workflow duplicate <id>` on that workflow and change the copy of that agent.\n- **Saving a copy**: when the card names a folder, move the copy's `WORKFLOW.md` over the one there and remove the copy's empty folder, because only that folder is saved. Never run `akb workflow delete` on the copy: it deletes the agents too.\n- **Copied schedules**: remove the copy's `scheduled` entries and their agents unless the request is about them, so that work does not run twice.\n- **Repeating work**: write a scheduled agent as `akb guide write-agent` says. It goes in this workflow, which may hold nothing else.\n\n## Check it\n\nRun `akb previews` and `akb workflow list`, and fix every problem reported for this workflow or its agents before finishing.\n\n## Card\n\nUnder your section heading, say in a few lines, for a reader who has never seen a workflow file, what the workflow is for, what each approval shows, what runs after the last one, what runs on a schedule, and what each agent remembers; then embed each file you wrote as an `<Asset>`. When the work is a copy, say that new tasks must pick the copy and that open cards stay on the original.\n";
|
|
7087
|
+
AGENT_default26 = "---\nname: workflow-writer\ndescription: Writes or changes a workflow, one of its preview agents or a scheduled agent, as a `WORKFLOW.md` and the agents it names.\nakb:\n components: [Asset]\n i18n:\n en:\n title: Workflow\n zh:\n title: \u5DE5\u4F5C\u6D41\n description: \u6309\u4F60\u7684\u63CF\u8FF0\u5199\u51FA\u6216\u4FEE\u6539\u5DE5\u4F5C\u6D41\u53CA\u5176 Preview Agent\uFF0C\u6216\u628A\u91CD\u590D\u6027\u5DE5\u4F5C\u5199\u6210\u5B9A\u65F6 agent\u3002\n---\n\nYou write a workflow from the user's request: a kind of work the user runs again and again, where each task shows a person previews to approve before the work goes on. A request may also change one preview agent in a workflow, or ask for work that repeats on a schedule.\n\n## Read first\n\n- **The project**: when the board belongs to a project folder, read its README and agent instruction files (such as `AGENTS.md` or `CLAUDE.md`) for what it makes, and its existing outputs of this kind for their format and destination.\n- **This board**: run `akb workflow list` and read `docs/kanban/agents/`, so a new workflow does not repeat one the board already has.\n\n## What to write\n\n- **The workflow**: when the card names a workflow folder, the workflow is that folder: keep its id and change it in place. Otherwise create it with `akb workflow new`. Name it with `akb workflow rename`, and list its agents in its `WORKFLOW.md`: `previews` the agents whose drafts a person approves, `land` the agents that run unattended in order after the last approval, and `scheduled`. Its body is how a card of this kind is written.\n- **Description and when**: in `WORKFLOW.md`, `description` tells a person in one sentence what the workflow does, and `when` tells an agent which requests it is for, exceptions included, such as \"The deliverable is a slide deck; a one-page handout is not.\" On a copy, `when` says how its requests differ from the original's.\n- **Its agents**: write each agent it names as `akb guide write-agent` says.\n- **Approvals**: default to previews a person approves once. Give an agent `after` only when its preview is too costly to make before another is approved, such as a video before its script; it then waits for that approval.\n- **Previews**: give each part a person must see its own agent, such as the screens of a UI change or the script of a video. Show only what the person decides on, and keep previews from overlapping: a UI preview already shows its text, so add no separate copy preview.\n- **Land**: add agents to `land` only for work that needs no review, such as building and merging an approved change; leave it empty when the last approved preview is the deliverable.\n- **Memory**: for each agent, decide whether a user's correction should change its next output, such as a writer's tone or a designer's look; if so, declare its memory as `akb guide write-agent` says, otherwise give it none.\n- **Changing a workflow**: edit its `WORKFLOW.md` and its agents under `docs/kanban/agents/` in place, and keep what the request does not ask to change.\n- **Preview agents it does not hold**: when the request changes a preview agent of a built-in or another workflow, run `akb workflow duplicate <id>` on that workflow and change the copy of that agent.\n- **Saving a copy**: when the card names a folder, move the copy's `WORKFLOW.md` over the one there and remove the copy's empty folder, because only that folder is saved. Never run `akb workflow delete` on the copy: it deletes the agents too.\n- **Copied schedules**: remove the copy's `scheduled` entries and their agents unless the request is about them, so that work does not run twice.\n- **Repeating work**: write a scheduled agent as `akb guide write-agent` says. It goes in this workflow, which may hold nothing else.\n\n## Check it\n\nRun `akb previews` and `akb workflow list`, and fix every problem reported for this workflow or its agents before finishing.\n\n## Card\n\nUnder your section heading, say in a few lines, for a reader who has never seen a workflow file, what the workflow is for, what each approval shows, what runs after the last one, what runs on a schedule, and what each agent remembers; then embed each file you wrote as an `<Asset>`. When the work is a copy, say that new tasks must pick the copy and that open cards stay on the original.\n";
|
|
7087
7088
|
}
|
|
7088
7089
|
});
|
|
7089
7090
|
|
|
@@ -10246,46 +10247,6 @@ var init_claude_code = __esm({
|
|
|
10246
10247
|
}
|
|
10247
10248
|
});
|
|
10248
10249
|
|
|
10249
|
-
// src/lib/agent/proxy.ts
|
|
10250
|
-
import { execFileSync } from "node:child_process";
|
|
10251
|
-
function codexProxyEnv(env2 = process.env, platform = process.platform, read4 = () => execFileSync("/usr/sbin/scutil", ["--proxy"], { encoding: "utf8", timeout: 1e3, stdio: ["ignore", "pipe", "ignore"] })) {
|
|
10252
|
-
const out = { ...env2 };
|
|
10253
|
-
if (platform !== "darwin" || PROXY_KEYS.some((key) => env2[key] !== void 0)) return out;
|
|
10254
|
-
let raw;
|
|
10255
|
-
try {
|
|
10256
|
-
raw = read4();
|
|
10257
|
-
} catch {
|
|
10258
|
-
return out;
|
|
10259
|
-
}
|
|
10260
|
-
const value = (key) => new RegExp(`^\\s*${key}\\s*:\\s*(.*?)\\s*$`, "m").exec(raw)?.[1];
|
|
10261
|
-
for (const [name, key, scheme] of [["HTTP", "HTTP_PROXY", "http"], ["HTTPS", "HTTPS_PROXY", "http"], ["SOCKS", "ALL_PROXY", "socks5"]]) {
|
|
10262
|
-
if (value(`${name}Enable`) !== "1") continue;
|
|
10263
|
-
const host2 = value(`${name}Proxy`);
|
|
10264
|
-
const port = Number(value(`${name}Port`));
|
|
10265
|
-
if (!host2 || /[\s/@?#]/.test(host2) || !Number.isInteger(port) || port < 1 || port > 65535) continue;
|
|
10266
|
-
try {
|
|
10267
|
-
out[key] = new URL(`${scheme}://${host2.includes(":") && !host2.startsWith("[") ? `[${host2}]` : host2}:${port}`).href.replace(/\/$/, "");
|
|
10268
|
-
} catch {
|
|
10269
|
-
}
|
|
10270
|
-
}
|
|
10271
|
-
if (PROXY_KEYS.some((key) => out[key]) && env2.NO_PROXY === void 0 && env2.no_proxy === void 0) {
|
|
10272
|
-
const exceptions = /ExceptionsList\s*:\s*<array>\s*\{([^}]+)\}/.exec(raw)?.[1];
|
|
10273
|
-
const bypass = exceptions?.split("\n").flatMap((line) => {
|
|
10274
|
-
const host2 = /^\s*\d+\s*:\s*(\S+)\s*$/.exec(line)?.[1];
|
|
10275
|
-
return host2 ? [host2.startsWith("*.") ? host2.slice(1) : host2] : [];
|
|
10276
|
-
});
|
|
10277
|
-
if (bypass?.length) out.NO_PROXY = bypass.join(",");
|
|
10278
|
-
}
|
|
10279
|
-
return out;
|
|
10280
|
-
}
|
|
10281
|
-
var PROXY_KEYS;
|
|
10282
|
-
var init_proxy = __esm({
|
|
10283
|
-
"src/lib/agent/proxy.ts"() {
|
|
10284
|
-
"use strict";
|
|
10285
|
-
PROXY_KEYS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"];
|
|
10286
|
-
}
|
|
10287
|
-
});
|
|
10288
|
-
|
|
10289
10250
|
// src/lib/agent/worktree.ts
|
|
10290
10251
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
10291
10252
|
import fs27 from "node:fs";
|
|
@@ -10440,7 +10401,6 @@ var init_codex = __esm({
|
|
|
10440
10401
|
init_paths();
|
|
10441
10402
|
init_wire();
|
|
10442
10403
|
init_locate();
|
|
10443
|
-
init_proxy();
|
|
10444
10404
|
init_models();
|
|
10445
10405
|
init_worktree();
|
|
10446
10406
|
init_transient();
|
|
@@ -10611,7 +10571,7 @@ var init_codex = __esm({
|
|
|
10611
10571
|
// No `providerEnv` either: the pick already drops and sets OPENAI_API_KEY, and there is
|
|
10612
10572
|
// no second variable to drop. Codex reads no base URL from the environment — an exported
|
|
10613
10573
|
// OPENAI_BASE_URL moves nothing — and where a run goes is settled on its command line.
|
|
10614
|
-
env: () =>
|
|
10574
|
+
env: () => ({ ...process.env }),
|
|
10615
10575
|
// A completed turn carries its token counts and nothing else. The model comes from the
|
|
10616
10576
|
// session's rollout on disk instead, and the price is worked out from the two
|
|
10617
10577
|
// (agent/wire/codex-stream.ts). A model whose rates the board doesn't know shows no price.
|
|
@@ -11512,11 +11472,13 @@ var init_language = __esm({
|
|
|
11512
11472
|
init_settings();
|
|
11513
11473
|
LANGUAGE_ENV = "AI4KANBAN_LANGUAGE";
|
|
11514
11474
|
LANGUAGE_LINE_ENV = "AI4KANBAN_LANGUAGE_LINE";
|
|
11515
|
-
SYSTEM_LANGUAGE_ZH = "\u7528\u4E2D\u6587\u56DE\u590D\u3002\
|
|
11516
|
-
SYSTEM_LANGUAGE_EN = "Reply in English.
|
|
11475
|
+
SYSTEM_LANGUAGE_ZH = "\u7528\u4E2D\u6587\u56DE\u590D\u3002\u7ED9\u4EFB\u52A1\u521B\u5EFA\u8005\u770B\u7684\u7528\u4E2D\u6587\uFF0C\u5DE5\u4F5C\u6D41\u7684\u6700\u7EC8\u4EA7\u7269\u6CBF\u7528\u9879\u76EE\u8BED\u8A00\u3002";
|
|
11476
|
+
SYSTEM_LANGUAGE_EN = "Reply in English. Write for the task creator in English; the workflow's final artifacts follow the project's language.";
|
|
11517
11477
|
systemLanguages = /* @__PURE__ */ new Set([
|
|
11518
11478
|
SYSTEM_LANGUAGE_ZH,
|
|
11519
11479
|
SYSTEM_LANGUAGE_EN,
|
|
11480
|
+
"\u7528\u4E2D\u6587\u56DE\u590D\u3002\u6210\u679C\u8BED\u8A00\u4F9D\u6B21\u9075\u5FAA\u7528\u6237\u660E\u786E\u8981\u6C42\u3001\u6210\u679C\u4E13\u7528\u6307\u4EE4\u3001\u65E2\u6709\u6210\u679C\u6216\u9879\u76EE\u60EF\u4F8B\uFF0C\u6700\u540E\u91C7\u7528\u672C\u6B21\u8BF7\u6C42\u7684\u8BED\u8A00\u3002\u4EE3\u7801\u3001\u547D\u4EE4\u3001\u6587\u4EF6\u540D\u548C\u5B57\u6BB5\u540D\u4FDD\u6301\u539F\u6587\u3002",
|
|
11481
|
+
"Reply in English. Artifact language follows explicit user requests, artifact instructions, existing or project conventions, then the current request's language. Keep code, commands, filenames, and field names unchanged.",
|
|
11520
11482
|
"\u65E0\u8BBA\u5BF9\u8BDD\u91CC\u7684\u5361\u7247\u3001\u4EE3\u7801\u548C\u8D34\u8FDB\u6765\u7684\u5185\u5BB9\u662F\u4EC0\u4E48\u8BED\u8A00\uFF0C\u56DE\u590D\u548C\u5199\u4E0B\u7684\u5185\u5BB9\u90FD\u7528\u4E2D\u6587\u3002\u4EE3\u7801\u3001\u547D\u4EE4\u3001\u6587\u4EF6\u540D\u548C\u5B57\u6BB5\u540D\u4FDD\u6301\u539F\u6587\u3002",
|
|
11521
11483
|
"\u5BF9\u8BDD\u548C\u89E3\u91CA\u4F7F\u7528\u4E2D\u6587\uFF1B\u4EA7\u7269\u4F7F\u7528\u7528\u6237\u660E\u786E\u6307\u5B9A\u7684\u8BED\u8A00\uFF0C\u5426\u5219\u4F7F\u7528\u6240\u5C5E agent \u660E\u786E\u6307\u5B9A\u7684\u8BED\u8A00\uFF0C\u5747\u672A\u6307\u5B9A\u65F6\u4F7F\u7528\u4E2D\u6587\u3002\u4EE3\u7801\u3001\u547D\u4EE4\u3001\u6587\u4EF6\u540D\u548C\u5B57\u6BB5\u540D\u4FDD\u6301\u539F\u6587\u3002",
|
|
11522
11484
|
"Use English for conversation and explanations. For artifacts, use the language explicitly specified by the user, otherwise the responsible agent, otherwise English. Keep code, commands, filenames, and field names unchanged."
|
|
@@ -11533,6 +11495,46 @@ var init_language = __esm({
|
|
|
11533
11495
|
}
|
|
11534
11496
|
});
|
|
11535
11497
|
|
|
11498
|
+
// src/lib/agent/proxy.ts
|
|
11499
|
+
import { execFileSync } from "node:child_process";
|
|
11500
|
+
function withSystemProxy(env2 = process.env, platform = process.platform, read4 = () => execFileSync("/usr/sbin/scutil", ["--proxy"], { encoding: "utf8", timeout: 1e3, stdio: ["ignore", "pipe", "ignore"] })) {
|
|
11501
|
+
const out = { ...env2 };
|
|
11502
|
+
if (platform !== "darwin" || PROXY_KEYS.some((key) => env2[key] !== void 0)) return out;
|
|
11503
|
+
let raw;
|
|
11504
|
+
try {
|
|
11505
|
+
raw = read4();
|
|
11506
|
+
} catch {
|
|
11507
|
+
return out;
|
|
11508
|
+
}
|
|
11509
|
+
const value = (key) => new RegExp(`^\\s*${key}\\s*:\\s*(.*?)\\s*$`, "m").exec(raw)?.[1];
|
|
11510
|
+
for (const [name, key, scheme] of [["HTTP", "HTTP_PROXY", "http"], ["HTTPS", "HTTPS_PROXY", "http"], ["SOCKS", "ALL_PROXY", "socks5"]]) {
|
|
11511
|
+
if (value(`${name}Enable`) !== "1") continue;
|
|
11512
|
+
const host2 = value(`${name}Proxy`);
|
|
11513
|
+
const port = Number(value(`${name}Port`));
|
|
11514
|
+
if (!host2 || /[\s/@?#]/.test(host2) || !Number.isInteger(port) || port < 1 || port > 65535) continue;
|
|
11515
|
+
try {
|
|
11516
|
+
out[key] = new URL(`${scheme}://${host2.includes(":") && !host2.startsWith("[") ? `[${host2}]` : host2}:${port}`).href.replace(/\/$/, "");
|
|
11517
|
+
} catch {
|
|
11518
|
+
}
|
|
11519
|
+
}
|
|
11520
|
+
if (PROXY_KEYS.some((key) => out[key]) && env2.NO_PROXY === void 0 && env2.no_proxy === void 0) {
|
|
11521
|
+
const exceptions = /ExceptionsList\s*:\s*<array>\s*\{([^}]+)\}/.exec(raw)?.[1];
|
|
11522
|
+
const bypass = exceptions?.split("\n").flatMap((line) => {
|
|
11523
|
+
const host2 = /^\s*\d+\s*:\s*(\S+)\s*$/.exec(line)?.[1];
|
|
11524
|
+
return host2 ? [host2.startsWith("*.") ? host2.slice(1) : host2] : [];
|
|
11525
|
+
});
|
|
11526
|
+
if (bypass?.length) out.NO_PROXY = bypass.join(",");
|
|
11527
|
+
}
|
|
11528
|
+
return out;
|
|
11529
|
+
}
|
|
11530
|
+
var PROXY_KEYS;
|
|
11531
|
+
var init_proxy = __esm({
|
|
11532
|
+
"src/lib/agent/proxy.ts"() {
|
|
11533
|
+
"use strict";
|
|
11534
|
+
PROXY_KEYS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"];
|
|
11535
|
+
}
|
|
11536
|
+
});
|
|
11537
|
+
|
|
11536
11538
|
// src/lib/agent/providers.ts
|
|
11537
11539
|
function providerSetting(settings) {
|
|
11538
11540
|
return settings.find((s) => s.kind === "provider");
|
|
@@ -11596,7 +11598,7 @@ function settingArgs(harness, held4) {
|
|
|
11596
11598
|
function settingEnv(harness, held4, secrets, cwd) {
|
|
11597
11599
|
const { values } = held4;
|
|
11598
11600
|
const picked = providerFor(harness, held4);
|
|
11599
|
-
const env2 =
|
|
11601
|
+
const env2 = withSystemProxy(harness.env());
|
|
11600
11602
|
for (const name of ownedVars(harness)) delete env2[name];
|
|
11601
11603
|
for (const name of Object.values(SESSION_VARS)) delete env2[name];
|
|
11602
11604
|
for (const setting of harness.settings) {
|
|
@@ -11670,6 +11672,7 @@ var init_run_settings = __esm({
|
|
|
11670
11672
|
init_env();
|
|
11671
11673
|
init_language();
|
|
11672
11674
|
init_types2();
|
|
11675
|
+
init_proxy();
|
|
11673
11676
|
init_providers();
|
|
11674
11677
|
}
|
|
11675
11678
|
});
|
|
@@ -13977,6 +13980,7 @@ function parseWorkflowFile(id, source, from) {
|
|
|
13977
13980
|
id,
|
|
13978
13981
|
name,
|
|
13979
13982
|
description: text3(raw.description),
|
|
13983
|
+
when: text3(raw.when),
|
|
13980
13984
|
needsArtifact: text3(raw.needsArtifact) === "true",
|
|
13981
13985
|
previews,
|
|
13982
13986
|
land,
|
|
@@ -14003,7 +14007,7 @@ var init_workflow_def = __esm({
|
|
|
14003
14007
|
var WORKFLOW_default;
|
|
14004
14008
|
var init_WORKFLOW = __esm({
|
|
14005
14009
|
"src/workflows/coding/WORKFLOW.md"() {
|
|
14006
|
-
WORKFLOW_default = "---\nname: Coding\ndescription:
|
|
14010
|
+
WORKFLOW_default = "---\nname: Coding\ndescription: Plans the change, then builds it.\nwhen: Software changes, and any work no other workflow covers.\nneedsArtifact: false\npreviews: [copywriting, tech-stack-advisor, email-planner, ui-designer, api-designer, schema-designer, prompt-writer, competitor-research, illustrator]\nland: [builder]\nscheduled:\n - agent: qa-manager\n---\n\nYou plan cards that change software.\n\n## User-owned questions\n\n- **What also counts**: a tradeoff that touches data or privacy, or compatibility, passes the\n material-decision test in `akb guide update-questions`.\n\n## Explainer diagram\n\n- **When**: add one when no preview agent's section is on the card and one or two\n sentences cannot make clear what the card changes.\n- **Form**: one `mermaid` fenced block above `<!-- agent -->`, a top-down `flowchart TB` of at\n most six labelled nodes and arrows, no subgraphs, showing before \u2192 after or who triggers\n what; labels in the card's language. Never write coordinates, styles, or SVG.\n- **Keep it true**: edit it when the card no longer matches it; remove it once a preview\n agent's section joins the card.\n\n## Research-only cards\n\n- **No build**: when a card asks only for competitor research, the competitors memory it\n writes is the deliverable and its preview the summary to review; write a single todo to\n archive the card once read, and never mark it ready.\n";
|
|
14007
14011
|
}
|
|
14008
14012
|
});
|
|
14009
14013
|
|
|
@@ -14011,7 +14015,7 @@ var init_WORKFLOW = __esm({
|
|
|
14011
14015
|
var WORKFLOW_default2;
|
|
14012
14016
|
var init_WORKFLOW2 = __esm({
|
|
14013
14017
|
"src/workflows/hyperframes-video/WORKFLOW.md"() {
|
|
14014
|
-
WORKFLOW_default2 = "---\nname: Product video\ndescription:
|
|
14018
|
+
WORKFLOW_default2 = "---\nname: Product video\ndescription: Writes a script and rehearses any demo for approval, then makes the video for approval and its cover.\nwhen: The deliverable is a product or promo video.\nneedsArtifact: true\npreviews: [scriptwriter, demo-rehearser, hyperframes-editor]\nland: [cover-designer]\n---\n";
|
|
14015
14019
|
}
|
|
14016
14020
|
});
|
|
14017
14021
|
|
|
@@ -14019,7 +14023,7 @@ var init_WORKFLOW2 = __esm({
|
|
|
14019
14023
|
var WORKFLOW_default3;
|
|
14020
14024
|
var init_WORKFLOW3 = __esm({
|
|
14021
14025
|
"src/workflows/slide-deck/WORKFLOW.md"() {
|
|
14022
|
-
WORKFLOW_default3 = "---\nname: Slide deck\ndescription:
|
|
14026
|
+
WORKFLOW_default3 = "---\nname: Slide deck\ndescription: Lays out the slides for approval, then exports a PowerPoint with one image per slide for approval.\nwhen: The deliverable is a slide deck or presentation, including one designed as HTML or TSX pages.\nneedsArtifact: true\npreviews: [deck-planner, deck-builder]\n---\n";
|
|
14023
14027
|
}
|
|
14024
14028
|
});
|
|
14025
14029
|
|
|
@@ -14027,7 +14031,7 @@ var init_WORKFLOW3 = __esm({
|
|
|
14027
14031
|
var WORKFLOW_default4;
|
|
14028
14032
|
var init_WORKFLOW4 = __esm({
|
|
14029
14033
|
"src/workflows/carousel-post/WORKFLOW.md"() {
|
|
14030
|
-
WORKFLOW_default4 = "---\nname: Social post\ndescription:
|
|
14034
|
+
WORKFLOW_default4 = "---\nname: Social post\ndescription: Writes the copy, then makes its images, then renders any pages and writes captions for each platform, each for approval.\nwhen: The deliverable is a post published on a social platform, text-only or with images, such as a LinkedIn post, an X thread or a carousel.\nneedsArtifact: true\npreviews: [carousel-planner, social-illustrator, carousel-renderer]\n---\n";
|
|
14031
14035
|
}
|
|
14032
14036
|
});
|
|
14033
14037
|
|
|
@@ -14035,7 +14039,7 @@ var init_WORKFLOW4 = __esm({
|
|
|
14035
14039
|
var WORKFLOW_default5;
|
|
14036
14040
|
var init_WORKFLOW5 = __esm({
|
|
14037
14041
|
"src/workflows/blog-post/WORKFLOW.md"() {
|
|
14038
|
-
WORKFLOW_default5 = "---\nname: Blog post\ndescription:
|
|
14042
|
+
WORKFLOW_default5 = "---\nname: Blog post\ndescription: Outlines it, then draws its images, then writes the article, each for approval.\nwhen: The deliverable is a titled article on its own page, on the project's site or a platform such as dev.to or Medium; a post read in a feed is a Social post.\nneedsArtifact: true\npreviews: [blog-planner, blog-illustrator, blog-writer]\n---\n";
|
|
14039
14043
|
}
|
|
14040
14044
|
});
|
|
14041
14045
|
|
|
@@ -14043,7 +14047,7 @@ var init_WORKFLOW5 = __esm({
|
|
|
14043
14047
|
var WORKFLOW_default6;
|
|
14044
14048
|
var init_WORKFLOW6 = __esm({
|
|
14045
14049
|
"src/workflows/video-clone/WORKFLOW.md"() {
|
|
14046
|
-
WORKFLOW_default6 = "---\nname: Video clone\ndescription:
|
|
14050
|
+
WORKFLOW_default6 = "---\nname: Video clone\ndescription: Breaks it down for approval, then builds the template and renders the clone for approval.\nwhen: A reference video should be recreated or turned into a reusable template.\nneedsArtifact: true\npreviews: [video-cloner, video-template-builder]\n---\n";
|
|
14047
14051
|
}
|
|
14048
14052
|
});
|
|
14049
14053
|
|
|
@@ -14051,7 +14055,7 @@ var init_WORKFLOW6 = __esm({
|
|
|
14051
14055
|
var WORKFLOW_default7;
|
|
14052
14056
|
var init_WORKFLOW7 = __esm({
|
|
14053
14057
|
"src/workflows/workflow-builder/WORKFLOW.md"() {
|
|
14054
|
-
WORKFLOW_default7 = "---\nname: Workflow builder\ndescription:
|
|
14058
|
+
WORKFLOW_default7 = "---\nname: Workflow builder\ndescription: Writes the workflow and its preview agents for approval.\nwhen: The user wants a new workflow, wants to change a workflow or one of its preview agents, or wants repeating work done on a schedule; not for code or files in the repository.\nneedsArtifact: false\npreviews: [workflow-writer]\n---\n";
|
|
14055
14059
|
}
|
|
14056
14060
|
});
|
|
14057
14061
|
|
|
@@ -14070,6 +14074,7 @@ function agentLines(agents, indent2) {
|
|
|
14070
14074
|
function workflowFileText(def) {
|
|
14071
14075
|
const lines = ["---", `name: ${scalar(def.name)}`];
|
|
14072
14076
|
if (def.description) lines.push(`description: ${scalar(def.description)}`);
|
|
14077
|
+
if (def.when) lines.push(`when: ${scalar(def.when)}`);
|
|
14073
14078
|
lines.push(`needsArtifact: ${def.needsArtifact}`);
|
|
14074
14079
|
const group = (key, agents) => !agents.length ? [] : plain(agents) ? [`${key}: ${flowList(agents)}`] : [`${key}:`, ...agentLines(agents, " ")];
|
|
14075
14080
|
lines.push(...group("previews", def.previews), ...group("land", def.land));
|
|
@@ -14169,6 +14174,10 @@ function workflowPurpose(flow) {
|
|
|
14169
14174
|
if (flow.builtIn) return builtinDescription(flow.id) || flow.name;
|
|
14170
14175
|
return boardWorkflowDefs().defs.find((d2) => d2.id === flow.id)?.description || flow.name;
|
|
14171
14176
|
}
|
|
14177
|
+
function workflowWhen(flow) {
|
|
14178
|
+
const defs = flow.builtIn ? BUILTINS : boardWorkflowDefs().defs;
|
|
14179
|
+
return defs.find((d2) => d2.id === flow.id)?.when ?? "";
|
|
14180
|
+
}
|
|
14172
14181
|
function readRows(raw) {
|
|
14173
14182
|
const rows = configBlock(raw).helpers;
|
|
14174
14183
|
if (!Array.isArray(rows)) return void 0;
|
|
@@ -14280,13 +14289,12 @@ function previewStages(flow, chosen) {
|
|
|
14280
14289
|
const stages = stagesOf(names3, agentAfter);
|
|
14281
14290
|
return stages.length ? stages : [[]];
|
|
14282
14291
|
}
|
|
14283
|
-
function
|
|
14284
|
-
let own = "";
|
|
14292
|
+
function userWorkflowRules(flow) {
|
|
14285
14293
|
try {
|
|
14286
|
-
|
|
14294
|
+
return fs37.readFileSync(workflowRuleFile(flow.id), "utf8").trim();
|
|
14287
14295
|
} catch {
|
|
14296
|
+
return "";
|
|
14288
14297
|
}
|
|
14289
|
-
return [flow.rules.trim(), own].filter(Boolean).join("\n\n");
|
|
14290
14298
|
}
|
|
14291
14299
|
function workflowProblems(id) {
|
|
14292
14300
|
return workflowIssues(id).map((issue) => issue.error);
|
|
@@ -14358,7 +14366,7 @@ function createWorkflow(name) {
|
|
|
14358
14366
|
if (!wanted) return { ok: false, ...refusal("workflowUnnamed", "a workflow needs a name") };
|
|
14359
14367
|
if (nameTaken(wanted)) return { ok: false, ...refusal("workflowTaken", `this board already has a workflow called "${wanted}"`, { name: wanted }) };
|
|
14360
14368
|
const id = freeId2(workflows2().map((w2) => w2.id));
|
|
14361
|
-
const res = writeOwn({ id, name: wanted, description: "", needsArtifact: true, previews: [], land: [], scheduled: [], rules: "" });
|
|
14369
|
+
const res = writeOwn({ id, name: wanted, description: "", when: "", needsArtifact: true, previews: [], land: [], scheduled: [], rules: "" });
|
|
14362
14370
|
return res.ok ? { ok: true, id, name: wanted } : res;
|
|
14363
14371
|
}
|
|
14364
14372
|
function duplicateWorkflow(id, called) {
|
|
@@ -14387,6 +14395,7 @@ function duplicateWorkflow(id, called) {
|
|
|
14387
14395
|
id: copy2,
|
|
14388
14396
|
name,
|
|
14389
14397
|
description: flow.builtIn ? "" : ownDef(flow.id)?.description ?? "",
|
|
14398
|
+
when: flow.builtIn ? "" : ownDef(flow.id)?.when ?? "",
|
|
14390
14399
|
needsArtifact: flow.needsArtifact,
|
|
14391
14400
|
previews,
|
|
14392
14401
|
land,
|
|
@@ -14773,17 +14782,11 @@ function specAgentSelector(id, workflow, meta) {
|
|
|
14773
14782
|
// Tagged, because this block is a list of other agents' work sitting under an
|
|
14774
14783
|
// instruction about the card. Without a boundary a run reads "ui-designer" as part of its
|
|
14775
14784
|
// own job.
|
|
14776
|
-
"<
|
|
14777
|
-
|
|
14778
|
-
...agents.
|
|
14779
|
-
const after2 = agentAfter(a2.name);
|
|
14780
|
-
return [
|
|
14781
|
-
`- \`${a2.name}\` \u2014 ${a2.description}`,
|
|
14782
|
-
` When: ${a2.when ?? "always"}${!chosen && after2.length ? ` \xB7 After: ${after2.join(", ")}` : ""}${a2.session ? " \xB7 runs in a session of its own: leave out `--print`" : ""}`
|
|
14783
|
-
];
|
|
14784
|
-
}),
|
|
14785
|
+
"<preview-agents>",
|
|
14786
|
+
"The preview agents of this card's current stage, each writing one part of the card.",
|
|
14787
|
+
...agents.map((a2) => `- \`${a2.name}\` \u2014 ${a2.description}${a2.session ? " \xB7 runs in a session of its own: leave out `--print`" : ""}`),
|
|
14785
14788
|
`Command: \`akb previews <agent> ${id} <short note>\` \u2014 add \`--print\` to run it in this session, as \`akb guide refine\` says.`,
|
|
14786
|
-
"</
|
|
14789
|
+
"</preview-agents>"
|
|
14787
14790
|
].join("\n");
|
|
14788
14791
|
}
|
|
14789
14792
|
function specAgentList(program2, forPerson = false) {
|
|
@@ -16487,13 +16490,17 @@ function workflowRulesBlock(req) {
|
|
|
16487
16490
|
const meta = req.id !== void 0 ? cardMeta(req.id) : null;
|
|
16488
16491
|
const stages = cardStages(meta, flow).length;
|
|
16489
16492
|
const stage = cardStage(meta, flow);
|
|
16490
|
-
const rules = workflowRules(flow);
|
|
16491
16493
|
const where = req.id !== void 0 && stages > 1 ? `#${req.id} awaits Approve ${stage} of ${stages}: write only the previews this Approve covers${stage < stages ? "; the next previews start once the user approves" : ""}.` : "";
|
|
16492
16494
|
const end2 = landAgents(flow).length ? "After the last approval, the workflow agents complete the approved outcome and archive the card." : "The last Approve archives the card: nothing is built, so leave no todo for a build.";
|
|
16493
|
-
const
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
${
|
|
16495
|
+
const own = userWorkflowRules(flow);
|
|
16496
|
+
const body = [where, end2, flow.rules.trim()].filter(Boolean).join("\n\n");
|
|
16497
|
+
return [
|
|
16498
|
+
`<workflow name="${flow.name}">`,
|
|
16499
|
+
"How a card on this workflow is written.",
|
|
16500
|
+
body,
|
|
16501
|
+
"</workflow>",
|
|
16502
|
+
...own ? ["", "<rules>", "The user's own rules for cards on this workflow; they win over the workflow above.", own, "</rules>"] : []
|
|
16503
|
+
].join("\n");
|
|
16497
16504
|
}
|
|
16498
16505
|
function landBlock(req) {
|
|
16499
16506
|
if (req.action !== "implement") return "";
|
|
@@ -16658,7 +16665,7 @@ function actionPrompt(req, command, notes) {
|
|
|
16658
16665
|
].filter(Boolean).join(" ");
|
|
16659
16666
|
case "clarify": {
|
|
16660
16667
|
return [
|
|
16661
|
-
|
|
16668
|
+
`Plan task ${req.id} ${named2} in this one session following \`akb guide refine\`. Work the board only through \`akb\`; a command with \`--print\` prints its flow for you to follow here, and without it starts a separate agent.`,
|
|
16662
16669
|
carriedNote(req),
|
|
16663
16670
|
// A refine has no note box of its own, but one SCHEDULED on a blocked card
|
|
16664
16671
|
// carries whatever was typed when it was scheduled — often the very reason the user
|
|
@@ -17986,7 +17993,7 @@ async function runIsDown(sessionId) {
|
|
|
17986
17993
|
async function resumeDelivery(id) {
|
|
17987
17994
|
if (!id.trim()) return { ok: false, ...refusal("deliveryUnnamed", "name the delivery to carry on", { action: "resume" }) };
|
|
17988
17995
|
const execution = executionOf();
|
|
17989
|
-
if (execution && !await executionHeld(execution)) return { ok: false, error: "\u65E0\u6CD5\u786E\u8BA4\u672C\u6B21\u7EED\u8DD1\u7684\u6267\u884C\u6743\uFF0C\u4EA4\u4ED8\u4FDD\u6301\u539F\u72B6\u3002" };
|
|
17996
|
+
if (execution && !await executionHeld(execution)) return { ok: false, error: "\u65E0\u6CD5\u786E\u8BA4\u672C\u6B21\u7EED\u8DD1\u7684\u6267\u884C\u6743\uFF0C\u4EA4\u4ED8\u4FDD\u6301\u539F\u72B6\uFF0C\u8BF7\u7A0D\u540E\u518D\u70B9\u300C\u7EED\u8DD1\u300D\u3002" };
|
|
17990
17997
|
const put = resumeRecord(id, execution);
|
|
17991
17998
|
if (!put.ok) return put;
|
|
17992
17999
|
const delivery = put.delivery;
|
|
@@ -19141,6 +19148,9 @@ function validateCreate(opts) {
|
|
|
19141
19148
|
const modules = validModules(opts.modules ?? []);
|
|
19142
19149
|
const triage = (opts.triage ?? "").trim();
|
|
19143
19150
|
const workflow = workflowFlag(opts.workflow ?? (triage ? itemWorkflow(triage) : void 0));
|
|
19151
|
+
const flow = workflowFor(workflow);
|
|
19152
|
+
const previews = opts.previews === void 0 ? void 0 : previewsFlag(opts.previews, flow);
|
|
19153
|
+
const stages = previews ? cardStages({ previews }, flow).length : 0;
|
|
19144
19154
|
const source = sourceFlag(opts.source ?? [], "source");
|
|
19145
19155
|
if (opts.fromTask && !source.includes(opts.fromTask)) source.unshift(opts.fromTask);
|
|
19146
19156
|
const questions = collectQuestions(opts.asked ?? []);
|
|
@@ -19148,16 +19158,16 @@ function validateCreate(opts) {
|
|
|
19148
19158
|
const normalized = draft ? normalizeBody(draft, opts.bodyFile) : null;
|
|
19149
19159
|
const written = normalized?.body ?? null;
|
|
19150
19160
|
if (written) {
|
|
19151
|
-
const header = serializeFrontmatter({ title, priority, status: "todo", blocked_by, related, modules, workflow, triage, source, questions }) + "\n\n";
|
|
19161
|
+
const header = serializeFrontmatter({ title, priority, status: "todo", blocked_by, related, modules, workflow, previews, stages, triage, source, questions }) + "\n\n";
|
|
19152
19162
|
const errors = validateSpec(opts.bodyFile, header + written);
|
|
19153
19163
|
const offset = header.split("\n").length - 1;
|
|
19154
19164
|
for (const error of errors) error.line = normalized.lines[error.line - offset - 1] ?? 1;
|
|
19155
19165
|
if (errors.length) die(formatContractErrors(errors));
|
|
19156
19166
|
}
|
|
19157
|
-
return { title, priority, blocked_by, related, modules, triage, workflow, source, questions, written };
|
|
19167
|
+
return { title, priority, blocked_by, related, modules, triage, workflow, previews, stages, source, questions, written };
|
|
19158
19168
|
}
|
|
19159
19169
|
function cmdCreate(opts) {
|
|
19160
|
-
const { title, priority, blocked_by, related, modules, triage, workflow, source, questions, written } = validateCreate(opts);
|
|
19170
|
+
const { title, priority, blocked_by, related, modules, triage, workflow, previews, stages, source, questions, written } = validateCreate(opts);
|
|
19161
19171
|
if (opts.id === void 0) die("\u8BF7\u901A\u8FC7 `akb raw create` \u521B\u5EFA\u5361\u7247\uFF0C\u7531 Cloud \u5206\u914D\u7F16\u53F7", { kind: "needs-cloud" });
|
|
19162
19172
|
const start = opts.id;
|
|
19163
19173
|
const slug2 = slugify(opts.slug !== void 0 ? opts.slug : title);
|
|
@@ -19172,7 +19182,7 @@ function cmdCreate(opts) {
|
|
|
19172
19182
|
if (held4) die(`#${start} is already a card here (${rel(held4.target)})`, { kind: "id-taken", id: start });
|
|
19173
19183
|
if (fs52.existsSync(file)) die(`${rel(file)} already exists \u2014 pick a different --slug`);
|
|
19174
19184
|
countBoardEvent(triage ? "cards_created_proposed" : "cards_created_asked");
|
|
19175
|
-
const meta = { title, priority, status: "todo", blocked_by, related, modules, workflow, triage, source, questions };
|
|
19185
|
+
const meta = { title, priority, status: "todo", blocked_by, related, modules, workflow, previews, stages, triage, source, questions };
|
|
19176
19186
|
const scaffolded = !written && opts.body !== false;
|
|
19177
19187
|
const body = written ?? (scaffolded ? defaultBody() : "");
|
|
19178
19188
|
fs52.writeFileSync(file, serializeFrontmatter(meta) + "\n\n" + body);
|
|
@@ -19205,6 +19215,15 @@ function itemWorkflow(sourceId) {
|
|
|
19205
19215
|
const item = [...readInbox(), ...readArchived(), ...readAllDismissed()].find((signal2) => signal2.sourceId === sourceId);
|
|
19206
19216
|
return item?.workflow && workflowById(item.workflow) ? item.workflow : void 0;
|
|
19207
19217
|
}
|
|
19218
|
+
function previewsFlag(said3, flow) {
|
|
19219
|
+
const offered = flow ? previewAgents(flow).map((h3) => h3.agent) : [];
|
|
19220
|
+
const asked = new Set(said3.map((name) => canonicalSpecAgent(name.trim())).filter(Boolean));
|
|
19221
|
+
const unknown = [...asked].filter((name) => !offered.includes(name));
|
|
19222
|
+
if (unknown.length) {
|
|
19223
|
+
die(`${unknown.map((n) => `\`${n}\``).join(", ")} ${unknown.length > 1 ? "are not previews" : "is not a preview"} of its workflow. It offers: ${offered.join(", ") || "none"}.`, { kind: "needs-input" });
|
|
19224
|
+
}
|
|
19225
|
+
return offered.filter((name) => asked.has(name));
|
|
19226
|
+
}
|
|
19208
19227
|
function appendIds(have, added) {
|
|
19209
19228
|
return [.../* @__PURE__ */ new Set([...have, ...added])];
|
|
19210
19229
|
}
|
|
@@ -19273,13 +19292,7 @@ function cmdUpdate(id, flags) {
|
|
|
19273
19292
|
}
|
|
19274
19293
|
const flow = workflowFor(meta.workflow);
|
|
19275
19294
|
if (flags.previews !== void 0) {
|
|
19276
|
-
|
|
19277
|
-
const asked = new Set(flags.previews.map((name) => canonicalSpecAgent(name.trim())).filter(Boolean));
|
|
19278
|
-
const unknown = [...asked].filter((name) => !offered.includes(name));
|
|
19279
|
-
if (unknown.length) {
|
|
19280
|
-
die(`${unknown.map((n) => `\`${n}\``).join(", ")} ${unknown.length > 1 ? "are not previews" : "is not a preview"} of its workflow. It offers: ${offered.join(", ") || "none"}.`, { kind: "needs-input" });
|
|
19281
|
-
}
|
|
19282
|
-
meta.previews = offered.filter((name) => asked.has(name));
|
|
19295
|
+
meta.previews = previewsFlag(flags.previews, flow);
|
|
19283
19296
|
changes.push("previews");
|
|
19284
19297
|
}
|
|
19285
19298
|
meta.stages = meta.previews ? cardStages(meta, flow).length : 0;
|
|
@@ -21812,7 +21825,7 @@ function buildBoardProgram(cli) {
|
|
|
21812
21825
|
const inOrder = ordered(asked);
|
|
21813
21826
|
move("create").summary("write exactly one card \u2014 its fields, its body template and its index entry").description(
|
|
21814
21827
|
'Write exactly ONE card: allocate its id, write its frontmatter and a body template, and index it. There is no separate id-reservation mode. --blocked-by and --related take ids of existing open cards; for a group, create the root first, then create each subtask related to its id (see "Group tasks" in `akb guide add-task`). The script owns the frontmatter and writes the body scaffold; fill only the body by hand. Without --id, Cloud assigns the number in the linked project (no source task required). A failed local write can resume the same creation without making another Cloud task. Missing or invalid project links and denied access exit with code 1 using the existing error envelope. --body-file accepts a short draft or full card body. Invalid bodies fail before allocating a task or writing a card, with repair instructions. Cloud moves the card on by itself once it reaches the board: do not refine it here. Turning what a user just asked for into a card goes through `akb create` instead: this move only writes what you already decided. Example: akb raw create --title "Add a delete command" --body-file /tmp/delete-command.md'
|
|
21815
|
-
).requiredOption("--title <title>", "what the card is called").addOption(new Option("--recurring").hideHelp()).option("--priority <level>", `how much it matters: ${LEVELS.join(" | ")} (default: med)`, oneOf(LEVELS)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--modules <names>", "the parts of the project it touches, validated against modules.md", collectList).option("--question <text>", "an open question; needs its --option choices. Repeatable; follow `akb guide update-questions`", inOrder("question")).option("--option <text>", "a choice for the --question before it", inOrder("option")).option("--recommended-option <text>", "a choice for the --question before it, ticked to start", inOrder("recommended-option")).option("--mode <mode>", "how many choices the --question before it takes: single | multi", inOrder("mode")).option("--slug <slug>", "the filename to write it under (default: from the title)").option("--no-body", "write the frontmatter and no body template").option("--body-file <path>", "a short draft or full card body, written to a file first").addOption(new Option("--cadence <cadence>").hideHelp()).option("--workflow <id>", "the workflow it runs through (`akb workflow list`). Left off, the board's default").addOption(new Option("--id <n>", "the number Cloud gave this card's task; for the Runner").argParser(cardId).hideHelp()).option("--triage <source-id>", "the triage item this card is made of, so the item is never carded twice").option("--source <ref>", "where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable", collect).action(async function() {
|
|
21828
|
+
).requiredOption("--title <title>", "what the card is called").addOption(new Option("--recurring").hideHelp()).option("--priority <level>", `how much it matters: ${LEVELS.join(" | ")} (default: med)`, oneOf(LEVELS)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--modules <names>", "the parts of the project it touches, validated against modules.md", collectList).option("--question <text>", "an open question; needs its --option choices. Repeatable; follow `akb guide update-questions`", inOrder("question")).option("--option <text>", "a choice for the --question before it", inOrder("option")).option("--recommended-option <text>", "a choice for the --question before it, ticked to start", inOrder("recommended-option")).option("--mode <mode>", "how many choices the --question before it takes: single | multi", inOrder("mode")).option("--slug <slug>", "the filename to write it under (default: from the title)").option("--no-body", "write the frontmatter and no body template").option("--body-file <path>", "a short draft or full card body, written to a file first").addOption(new Option("--cadence <cadence>").hideHelp()).option("--workflow <id>", "the workflow it runs through (`akb workflow list`). Left off, the board's default").option("--previews <agents>", `the preview agents it chose, from its workflow's; "" chooses none`, collectList).addOption(new Option("--id <n>", "the number Cloud gave this card's task; for the Runner").argParser(cardId).hideHelp()).option("--triage <source-id>", "the triage item this card is made of, so the item is never carded twice").option("--source <ref>", "where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable", collect).action(async function() {
|
|
21816
21829
|
refuseRecurring(this);
|
|
21817
21830
|
await dispatch("create", this, [], { ...this.opts(), asked }, cli);
|
|
21818
21831
|
});
|
|
@@ -22080,7 +22093,7 @@ var init_board_cli = __esm({
|
|
|
22080
22093
|
var add_task_default;
|
|
22081
22094
|
var init_add_task = __esm({
|
|
22082
22095
|
"src/guide/add-task.md"() {
|
|
22083
|
-
add_task_default = '# Add tasks\n\nUse this guide whenever work may become a card.\n\n- **Modules**: read `docs/kanban/modules.md` and relevant code or plans to choose or verify tags;\n follow `akb guide module-map` when none fits or a module needs splitting, and never ask the\n user to categorize the task.\n\n## Create the card\n\nWrite the fields with flags, never by editing frontmatter. Only `--title` is required:\n\n```text\nakb raw create --title "..." --modules <names> --priority <high|med|low> \\\n [--workflow <id>] [--blocked-by <ids>] [--related <ids>] [--source <ref>]... \\\n [--slug <short-english-slug>] \\\n [--question "..." --recommended-option "..." --option "..." [--mode multi]]...\n```\n\n- **Workflow**: an id from `akb workflow list` when one fits the work; the request\'s own wins.\n- **Dependencies**: `--blocked-by` for cards this one waits on, `--related` for cards that only\n relate; an existing card that needs this one\'s output gets\n `akb raw update <id> --add-blocked-by <ids>`.\n- **Source**: each plan path, card `#id` or URL the card came from.\n- **Non-English title**: needs `--slug`.\n- **Open questions**: classify each as `akb guide update-questions` says before writing it.\n\nFor example:\n\n```text\nakb raw create --title "Document the export format" --modules docs --priority low \\\n --blocked-by 42 --related 41 --source "#41"\n```\n\n### Group tasks\n\nUse a group when the cards are parts of one larger outcome, such as a plugin system with its\nSlack and Notion examples: a root plus one card per part. Otherwise keep cards independent.\n\n```text\ntodo/<id>-<short-slug>/\n root.md # the whole job\n <subid>-<slug>.md # one part, its own card\n```\n\n1. Create the root; call the id it prints `<id>`.\n2. Create each part with `--related <id>`, and `--blocked-by <subid>` where order matters.\n3. Move the files: the root becomes `todo/<id>-<short-slug>/root.md`, and each part keeps\n its filename under that folder. The folder slug is short English ASCII.\n4. Point the root at its parts: `akb raw update <id> --related <subid,subid,...>`.\n5. Repoint the moved cards in `todo/README.md`: give each bullet its new path and leave it\n under its heading.\n\nThe root\'s `## Todo` lists its parts, one line each ending in `#<subid>`.\n\n### Writing\n\nFill the body scaffold that `akb raw create` wrote, carrying the request\'s constraints into\nit. Do not rename or translate its section titles, and leave empty scaffold sections in\nplace. Do not repeat the title as an H1.\n\nCloud moves the card on by itself once it reaches the board; do not refine it in this session.\n';
|
|
22096
|
+
add_task_default = '# Add tasks\n\nUse this guide whenever work may become a card.\n\n- **Modules**: read `docs/kanban/modules.md` and relevant code or plans to choose or verify tags;\n follow `akb guide module-map` when none fits or a module needs splitting, and never ask the\n user to categorize the task.\n\n## Create the card\n\nWrite the fields with flags, never by editing frontmatter. Only `--title` is required:\n\n```text\nakb raw create --title "..." --modules <names> --priority <high|med|low> \\\n [--workflow <id>] [--previews <agents>] [--blocked-by <ids>] [--related <ids>] [--source <ref>]... \\\n [--slug <short-english-slug>] \\\n [--question "..." --recommended-option "..." --option "..." [--mode multi]]...\n```\n\n- **Workflow**: an id from `akb workflow list` when one fits the work; the request\'s own wins.\n- **Previews**: the agents from `akb previews --triggers --workflow <id>` whose conditions the\n card meets, or `--previews ""` when none is met.\n- **Dependencies**: `--blocked-by` for cards this one waits on, `--related` for cards that only\n relate; an existing card that needs this one\'s output gets\n `akb raw update <id> --add-blocked-by <ids>`.\n- **Source**: each plan path, card `#id` or URL the card came from.\n- **Non-English title**: needs `--slug`.\n- **Open questions**: classify each as `akb guide update-questions` says before writing it.\n\nFor example:\n\n```text\nakb raw create --title "Document the export format" --modules docs --priority low \\\n --blocked-by 42 --related 41 --source "#41"\n```\n\n### Group tasks\n\nUse a group when the cards are parts of one larger outcome, such as a plugin system with its\nSlack and Notion examples: a root plus one card per part. Otherwise keep cards independent.\n\n```text\ntodo/<id>-<short-slug>/\n root.md # the whole job\n <subid>-<slug>.md # one part, its own card\n```\n\n1. Create the root; call the id it prints `<id>`.\n2. Create each part with `--related <id>`, and `--blocked-by <subid>` where order matters.\n3. Move the files: the root becomes `todo/<id>-<short-slug>/root.md`, and each part keeps\n its filename under that folder. The folder slug is short English ASCII.\n4. Point the root at its parts: `akb raw update <id> --related <subid,subid,...>`.\n5. Repoint the moved cards in `todo/README.md`: give each bullet its new path and leave it\n under its heading.\n\nThe root\'s `## Todo` lists its parts, one line each ending in `#<subid>`.\n\n### Writing\n\nFill the body scaffold that `akb raw create` wrote, carrying the request\'s constraints into\nit. Do not rename or translate its section titles, and leave empty scaffold sections in\nplace. Do not repeat the title as an H1.\n\nCloud moves the card on by itself once it reaches the board; do not refine it in this session.\n';
|
|
22084
22097
|
}
|
|
22085
22098
|
});
|
|
22086
22099
|
|
|
@@ -22120,7 +22133,7 @@ var init_describe_project = __esm({
|
|
|
22120
22133
|
var discuss_goal_default;
|
|
22121
22134
|
var init_discuss_goal = __esm({
|
|
22122
22135
|
"src/guide/discuss-goal.md"() {
|
|
22123
|
-
discuss_goal_default = "# Discuss a goal\n\
|
|
22136
|
+
discuss_goal_default = "# Discuss a goal\n\nThis flow only helps the user settle goals; refining, previewing, and running them come later.\n\n- **Remote user**: the user works remotely and sees only tasks and their previews, never local files.\n- **Software failures**: read `akb guide troubleshoot` when root cause analysis is needed.\n\n## Goals\n\n- **Missing information**: ask the user for information needed to form a goal.\n- **Save**: once a goal is clear, save or update it with `akb raw goal` (see `akb raw goal --help`), then stop; an existing build continues in its current session.\n- **Goal format**: each goal has a title, an outcome of at most 150 words, and a `## Done when` list of verifiable acceptance criteria, without technical design.\n- **Independent deliverables**: save separate deliverables as separate goals; remove a replaced goal with `akb raw goal drop --id <goal>`.\n- **Workflow**: pick the workflow from `akb workflow list` that fits the actual work; prefer the user\u2019s choice, otherwise `coding`.\n- **Review points**: save through `--previews` the agents from `akb previews --triggers --workflow <id>` whose conditions the goal meets, or an empty list.\n- **Use judgment**: settle outcome decisions you can and explain them; ask only for decisions the user must make that change the result, with a recommendation.\n- **Plain words**: answer directly using everyday words.\n- **Hide machinery**: omit plans, files, paths, commands, tools, and connectors from replies; refer to actions by their button labels.\n";
|
|
22124
22137
|
}
|
|
22125
22138
|
});
|
|
22126
22139
|
|
|
@@ -22176,7 +22189,7 @@ var init_review_rejections = __esm({
|
|
|
22176
22189
|
var refine_default;
|
|
22177
22190
|
var init_refine = __esm({
|
|
22178
22191
|
"src/guide/refine.md"() {
|
|
22179
|
-
refine_default = '# Refine a card\n\nPlan one card in this session until it can be built. Change no project code.\n\n- **\u91CD\u590D\u5361\u7247**: \u82E5\u53D1\u73B0\u53E6\u4E00\u5F20\u4EFB\u52A1\u5B8C\u6574\u8986\u76D6\u672C\u5361\uFF0C\u5373\u4F7F\u5BF9\u65B9\u5C1A\u672A\u5B9E\u65BD\uFF0C\u4E5F\u5148\u5C06\u5176\u7F3A\u5C11\u7684\u6709\u7528\u4FE1\u606F\u8865\u5165\u5E76\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\uFF1B\n \u4FDD\u5B58\u5931\u8D25\u5219\u4FDD\u7559\u672C\u5361\u5E76\u505C\u6B62\u3002\u6CA1\u6709\u4FE1\u606F\u9700\u8981\u8865\u5145\u6216\u5DF2\u4FDD\u5B58\u6210\u529F\u540E\uFF0C\u8FD0\u884C\n `akb raw reject <id> --reason "<\u627F\u63A5\u4EFB\u52A1\u7F16\u53F7\u53CA\u5B8C\u6574\u8986\u76D6\u539F\u56E0>"` \u5E76\u505C\u6B62\u3002\n \u4E0D\u8BF7\u6C42\u786E\u8BA4\uFF0C\u4E0D\u8FD0\u884C\u9884\u89C8\uFF1B\u4EC5\u90E8\u5206\u91CD\u53E0\u4E0D\u4E22\u5F03\u3002\n- **Unchecked card**: a card with `triage:` set and an empty `## Scope` was never checked\n against the project. Search the relevant code and docs first; when the project already does\n the work, or what it concerns no longer exists, run\n `akb raw reject <id> --reason "<what shows it>"` and stop.\n- **Gone or already done**: for any other card, append a question asking the user whether to\n discard it, run no preview agent, and stop.\n- **Split**: only when the card holds independently plannable areas and one is still vague,\n follow the group procedure in `akb guide add-task`, create each subtask, and stop: Cloud\n refines each one itself.\n- **Workflow rules**: write the card as the workflow rules at the end of this prompt say.\n- **
|
|
22192
|
+
refine_default = '# Refine a card\n\nPlan one card in this session until it can be built. Change no project code.\n\n- **\u91CD\u590D\u5361\u7247**: \u82E5\u53D1\u73B0\u53E6\u4E00\u5F20\u4EFB\u52A1\u5B8C\u6574\u8986\u76D6\u672C\u5361\uFF0C\u5373\u4F7F\u5BF9\u65B9\u5C1A\u672A\u5B9E\u65BD\uFF0C\u4E5F\u5148\u5C06\u5176\u7F3A\u5C11\u7684\u6709\u7528\u4FE1\u606F\u8865\u5165\u5E76\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\uFF1B\n \u4FDD\u5B58\u5931\u8D25\u5219\u4FDD\u7559\u672C\u5361\u5E76\u505C\u6B62\u3002\u6CA1\u6709\u4FE1\u606F\u9700\u8981\u8865\u5145\u6216\u5DF2\u4FDD\u5B58\u6210\u529F\u540E\uFF0C\u8FD0\u884C\n `akb raw reject <id> --reason "<\u627F\u63A5\u4EFB\u52A1\u7F16\u53F7\u53CA\u5B8C\u6574\u8986\u76D6\u539F\u56E0>"` \u5E76\u505C\u6B62\u3002\n \u4E0D\u8BF7\u6C42\u786E\u8BA4\uFF0C\u4E0D\u8FD0\u884C\u9884\u89C8\uFF1B\u4EC5\u90E8\u5206\u91CD\u53E0\u4E0D\u4E22\u5F03\u3002\n- **Unchecked card**: a card with `triage:` set and an empty `## Scope` was never checked\n against the project. Search the relevant code and docs first; when the project already does\n the work, or what it concerns no longer exists, run\n `akb raw reject <id> --reason "<what shows it>"` and stop.\n- **Gone or already done**: for any other card, append a question asking the user whether to\n discard it, run no preview agent, and stop.\n- **Split**: only when the card holds independently plannable areas and one is still vague,\n follow the group procedure in `akb guide add-task`, create each subtask, and stop: Cloud\n refines each one itself.\n- **Workflow rules**: write the card as the workflow rules at the end of this prompt say.\n- **Preview agents**: an agent\'s `After` names the previews it waits for; the board approves\n previews in stages, one stage per Approve, and the card\'s `previews` were chosen when its\n goal was written. Run each agent the list above names whose section is missing or outdated with\n `akb previews <agent> <id> --print`, one at a time in this session; leave out `--print` only for\n an agent the list says runs in a session of its own.\n- **Stale mentions**: rewrite any sentence that relies on a card no longer on the board.\n- **Questions**: settle every decision you can and record the answers as `akb guide writing`\n says; ask only what `akb guide update-questions` says to ask.\n- **Write**: shape the card as `akb guide writing` says, then run `akb raw validate <id>` and\n fix every reported line.\n- **Think like the one who ships it**: settle every fact from the code and authoritative\n sources, and write what shipping takes beyond the happy path: existing data and settings,\n release and rollback, failure, access, and ongoing cost. Once the card validates, judge\n whether it can be built as written, or before its last\n Approve: if so, run `akb raw update <id> --status ready`; otherwise leave what blocks it as\n an open question.\n\nFollow any closing steps the flow printed, then stop: the user approves the previews or starts\nthe build.\n';
|
|
22180
22193
|
}
|
|
22181
22194
|
});
|
|
22182
22195
|
|
|
@@ -22192,7 +22205,7 @@ var init_reflect = __esm({
|
|
|
22192
22205
|
var resolve_default;
|
|
22193
22206
|
var init_resolve2 = __esm({
|
|
22194
22207
|
"src/guide/resolve.md"() {
|
|
22195
|
-
resolve_default = '# Resolve questions\n\nApply the answers the user supplied to existing open questions. Leave every unanswered\nquestion unchanged. While applying answers, do not research, choose for the user, raise\nanother question, or change project code.\n\n## Apply each answer\n\n1. Match each supplied answer to its open question. If the answer is missing or unclear,\n leave that question open.\n2. Follow `akb guide writing`. Merge the answer into the existing decision, keep only the\n selected choice, remove obsolete or contradictory text, preserve completed work, and add\n newly required work as unchecked todos. When the answer changes an agent\'s section, read\n that agent\'s rules first, as "Preview ownership" there says.\n3. Drop each answered question after its answer is fully applied:\n\n```text\nakb raw update-questions <id> --drop <n[,n...]>\n```\n\nWhen an answer accepts a step the user was asked to review and asks for no changes, tick that\nstep\'s review todo; an answer asking for changes leaves it unticked.\n\nWhen an answer chooses to discard the card, run `akb raw reject <id> --reason "<why>"
|
|
22208
|
+
resolve_default = '# Resolve questions\n\nApply the answers the user supplied to existing open questions. Leave every unanswered\nquestion unchanged. While applying answers, do not research, choose for the user, raise\nanother question, or change project code.\n\n## Apply each answer\n\n1. Match each supplied answer to its open question. If the answer is missing or unclear,\n leave that question open.\n2. Follow `akb guide writing`. Merge the answer into the existing decision, keep only the\n selected choice, remove obsolete or contradictory text, preserve completed work, and add\n newly required work as unchecked todos. When the answer changes an agent\'s section, read\n that agent\'s rules first, as "Preview ownership" there says.\n3. Drop each answered question after its answer is fully applied:\n\n```text\nakb raw update-questions <id> --drop <n[,n...]>\n```\n\nWhen an answer accepts a step the user was asked to review and asks for no changes, tick that\nstep\'s review todo; an answer asking for changes leaves it unticked.\n\nWhen an answer chooses to discard the card, first run `akb delivery cancel <delivery>` if a\ndelivery is in flight, then `akb raw reject <id> --reason "<why>"`, and stop. Skip every\nremaining step of this guide.\n\nWhen an answer sends an agent\'s (`agent:`) section back for rework that the user must confirm\nagain, keep or `--update` the question instead of dropping it. Once no question is left for\nthat agent, request each matching agent listed below it whose section is missing or says it\nis waiting.\n\nWhen an answer selects one of several options in a preview agent\'s section, remove the rejected\noptions and their spec-tmp files.\n\n## Say what the answers did to a build in flight\n\nA delivery builds the card as it was approved when it started, and applying answers is the\nonly thing that rewrites that card underneath it. You read the question and you wrote the\nanswer, so you are the only one who can tell a confirmation from a change \u2014 the board reads\nyour conclusion and never the card\'s text.\n\n```text\nakb delivery answered <delivery> --unchanged "<why>"\nakb delivery answered <delivery> --changed "<why>"\n```\n\n- **Record it before you drop the questions**: dropping the last one is what puts the board\n back in motion, and until the conclusion is written the build does not land.\n- **Judge the meaning, not the words**: confirming an option that is already built, writing\n down a decision the card already carries, and tidying prose are all `--unchanged`.\n Adding, dropping or changing a requirement is `--changed`.\n- **A wrong implementation confirmed is still a change**: an answer that blesses work\n contradicting the approved copy is `--changed`, however finished that work is.\n- **One conclusion per round**: it covers every answer you applied in this session. The\n delivery a `--changed` reopens starts on the card as it then reads, with none of its own.\n\n`akb card implement <id> --print` prints the delivery\'s id and the copy it is building.\nNothing to record when no delivery is in flight.\n\n## Curate the human half\n\nPut each answer `akb guide writing` places in `Worth noting` in that section; put other\nnecessary lasting decisions below the boundary.\n\nRe-read the whole human half against the same rule. Remove or move down entries that\nfail it, repeat scope, or overlap another entry. Merge entries governed by one decision. One to\nthree independent items is normal; every additional item needs distinct user-facing stakes.\n\n## Refine\n\nOnce no question is left and no delivery is building the card, refine it in this session by\n`akb guide refine`, which decides readiness:\n\n- **Partial**: when the card was refined before, revisit only what the answers changed.\n- **Full**: when the answers reshape the card or its `## Scope` is still the creation scaffold.\n';
|
|
22196
22209
|
}
|
|
22197
22210
|
});
|
|
22198
22211
|
|
|
@@ -110451,6 +110464,8 @@ function cmdWorkflowList() {
|
|
|
110451
110464
|
say(`${flow.id} ${flow.name}${flow.builtIn ? " (built-in)" : ""}${flow.needsArtifact ? " (artifact required)" : ""}`);
|
|
110452
110465
|
const description = workflowPurpose(flow);
|
|
110453
110466
|
if (description !== flow.name) say(` ${description}`);
|
|
110467
|
+
const when = workflowWhen(flow);
|
|
110468
|
+
if (when) say(` when ${when}`);
|
|
110454
110469
|
say(` previews ${previewNames(previewMembers(flow)) || "(none)"}`);
|
|
110455
110470
|
say(` land ${names2(flow.land) || "(none) \u2014 the last approval archives the card"}`);
|
|
110456
110471
|
for (const agent of listedScheduled(flow)) say(` scheduled ${agent}`);
|
|
@@ -110464,6 +110479,7 @@ function cmdWorkflowList() {
|
|
|
110464
110479
|
previews: previewMembers(flow).map((h3) => ({ ...h3, after: agentAfter(h3.agent) })),
|
|
110465
110480
|
scheduled: listedScheduled(flow),
|
|
110466
110481
|
description: workflowPurpose(flow),
|
|
110482
|
+
when: workflowWhen(flow),
|
|
110467
110483
|
problems: workflowProblems(flow.id)
|
|
110468
110484
|
})),
|
|
110469
110485
|
problems: fileProblems
|
|
@@ -110945,7 +110961,7 @@ function readRequest(action, args, opts) {
|
|
|
110945
110961
|
}
|
|
110946
110962
|
async function cmdResume(id, opts) {
|
|
110947
110963
|
const opened = await startResume(id ?? "last", opts.requireSession);
|
|
110948
|
-
if ("error" in opened) die(opened.error, { kind: "run-refused" });
|
|
110964
|
+
if ("error" in opened) die(opened.error, { kind: "run-refused", ..."reason" in opened ? { reason: opened.reason } : {} });
|
|
110949
110965
|
const { run: run3 } = opened;
|
|
110950
110966
|
if (!opened.spawned) die(`couldn't start a process for run ${run3.sessionId}`, { kind: "spawn-failed" });
|
|
110951
110967
|
const within = run3.deliveryId ? ` in delivery ${run3.deliveryId}` : "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wildcrane",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.21",
|
|
4
4
|
"akbContract": 7,
|
|
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": [
|