wildcrane 0.11.67 → 0.11.68

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/README.md CHANGED
@@ -24,7 +24,7 @@ Run `akb help` for commands and `akb guide` for studios.
24
24
  顶层 `task`、`goal`、`workspace`、`project`、`runner` 直接读写 WildCrane 云端,结果立即在网页可见,不读写本地看板。全部支持 `--json`。
25
25
 
26
26
  ```sh
27
- akb task list [--project <id>] [--status <status>]
27
+ akb task list [--project <id> | --workspace <id>] [--status <status>]
28
28
  akb task show <task>
29
29
  akb task create <request...> [--project <id>] [--studio <id>]
30
30
  akb task approve <task> [--comment <text>]
@@ -42,7 +42,7 @@ akb runner list [--workspace <id>]
42
42
  | --- | --- | --- |
43
43
  | `task list` | `GET /v1/tasks?project=&status=` | 每行 `WC-12 running <标题>` |
44
44
  | `task show` | `GET /v1/tasks/{id}` + `/card` | 标题、状态、流程、网页链接,再接卡片正文 |
45
- | `task create` | `POST /v1/tasks`(`source: api`) | `Created WC-13: <标题> <网页链接>` |
45
+ | `task create` | `POST /v1/tasks`(`source: api`,`run: true`,启动卡片准备) | `Created WC-13: <标题> <网页链接>`,随后显示实际状态 |
46
46
  | `task approve` | `POST /v1/tasks/{id}/decisions`,`decision: approve` 带当前 `review_revision` | `Approved WC-12.` |
47
47
  | `task chat` | `POST /v1/tasks/{id}/chat`,`body: <message>` | `Sent to WC-12.`,等同网页任务页的对话框 |
48
48
  | `task remove` | `POST /v1/tasks/{id}/cancel`,`reason` 可选 | `Removed WC-12. Restore it on the web.` |
@@ -52,12 +52,38 @@ akb runner list [--workspace <id>]
52
52
  | `project list` | `GET /v1/projects?workspace=` | 每行 `prj_… WC <名称>` |
53
53
  | `runner list` | `GET /v1/workspaces/{id}/runners` | 每行 `<机器名> online/offline` |
54
54
 
55
- - **`<task>`**:`WC-12`、`task_…`,或在已关联项目的文件夹里只写 `12`。
55
+ - **`<task>`**:`WC-12`、`task_…` 原样使用;纯数字如 `12` 使用所选位置关联项目的编号,适用于所有接收 `<task>` 的命令,包括聊天读取、跟随和停止回复。
56
56
  - **`--status`**:`queued`、`running`、`waiting_review`、`done`、`failed`、`cancelled`、`stopped`。
57
- - **`--studio`**:`akb studio list` 显示的名字。
58
- - **默认项目**:`--project` 优先,否则用当前文件夹 `.akb/base.json` 关联的项目;`task list` 也可改用 `--workspace`;`runner list` 的工作区默认取该项目所在工作区。都没有时报错并列出可选项。
57
+ - **`--studio`**:创建时必填,使用 `akb studio list` 显示的名字;省略返回 `no_studio`,不创建任务。
58
+ - **项目位置**:`--board` 优先,其次为 `AI4KANBAN_BOARD`、`--dir`、当前目录。看板使用其所属项目的关联;目录向上查找 `.akb/base.json`。共享参数可放在命令前后,相对路径以调用目录为准;读取关联不初始化或修改看板。
59
+ - **显式选择**:`task list` 的 `--project` 优先于 `--workspace`,否则推导项目;`task create` 的 `--project` 优先;`runner list` 的 `--workspace` 优先,否则取所选项目的工作区。`project list` 仍列出全部可见项目,仅用 `--workspace` 筛选。
60
+ - **完整列表**:`task list` 自动读完所有页,保持范围、状态筛选和服务端顺序。文字每个任务一行;JSON 的 `data` 包含全部任务,`next` 为 `null`,空列表为 `data: []`。后续页失败仍非零退出,沿用错误封装,不输出成功的部分列表;任务越多,等待越久。
61
+ - **无关联项目**:需要推导项目却未找到有效关联时,返回 `no_project`,不会退回原执行目录;完整 key/id 或显式项目、工作区无需位置关联。
59
62
  - **`--json`**:成功为 `{"ok":true, …云端返回}`;失败为 `{"ok":false,"error":{"kind":"<code>","code":"<code>","message":"…"}}`。
60
63
 
64
+ ### 创建任务与恢复
65
+
66
+ `akb task create <request...> [--project <id>] [--studio <id>]` 创建任务并异步准备可审阅卡片。
67
+ 请求可包含中文和多行验收项;无本地看板时,使用 `--project` 指定目标。
68
+ 无法确定工作台时提示 `--studio` 用法,不创建空任务。
69
+
70
+ 成功回执保留任务编号、标题及网页链接,随后显示 `Status: <云端状态>`;`--json` 沿用现有封装及任务字段。
71
+ `queued` 表示等待执行,`running` 表示正在执行,均不表示正文已经生成;`failed` 同时显示失败原因。
72
+ 使用 `akb task show <task>` 回读状态和正文,在任务页审阅生成结果;后续创建失败从原任务查看原因。
73
+
74
+ `akb task resume <task>` 恢复可继续的已停止或失败任务;历史创建未提交且尚无卡片的任务也从原任务继续准备卡片。
75
+ 保留编号与聊天,不批量自动启动历史任务。已有有效卡片的任务继续当前流程,不重复创建卡片。
76
+
77
+ 创建前的参数、项目、权限与连接错误沿用下表;空请求为用法错误。
78
+ 连接中断而未收到回执时,先查询目标项目确认是否已创建,再决定是否重试;CLI 不自动重发创建请求。
79
+ 重复执行创建不是恢复原任务;恢复失败不能输出已恢复或卡片已完成。
80
+
81
+ ```sh
82
+ akb task create "Add a dark mode toggle" --project prj_example --studio coding
83
+ akb task show WC-13
84
+ akb task resume WC-13
85
+ ```
86
+
61
87
  ### 错误(退出码 1,文字写 stderr)
62
88
 
63
89
  | 情况 | code | 英文文字 |
@@ -65,6 +91,7 @@ akb runner list [--workspace <id>]
65
91
  | 未登录 | `signed_out` | Not signed in to WildCrane Cloud. Sign in from Configuration → Cloud in the WildCrane app, then try again. |
66
92
  | 登录过期 | `expired` | Your WildCrane Cloud sign-in has expired. Sign in again from Configuration → Cloud in the WildCrane app, then try again. |
67
93
  | 无法连接 | `unreachable` | Could not reach WildCrane Cloud. Check your connection and try again. |
94
+ | 未选择工作台 | `no_studio` | Choose --studio from akb studio list. |
68
95
  | 无法确定项目 | `no_project` | Pick a project with --project: `<prj_… WC 名称>, …` |
69
96
  | 只写编号却无关联项目 | `no_project` | Write the full task key, like WC-12, or run this in a linked folder. |
70
97
  | 云端拒绝 | 云端的 `code` | 云端返回的 `message`,如任务不存在、当前状态不能批准 |
@@ -72,6 +99,9 @@ akb runner list [--workspace <id>]
72
99
  参数缺失按现有用法错误处理。未登录时不读写任何本地文件。
73
100
 
74
101
  ```sh
102
+ akb task list --dir /work/project-b --status running --json
103
+ akb task show 12 --board /work/project-b/.akb/kanban
104
+ akb runner list --dir /work/project-b
75
105
  akb task create "Add a dark mode toggle" --studio coding
76
106
  akb task approve WC-13 --comment "Looks right"
77
107
  akb task chat WC-13 "Keep the toggle in Settings only"
package/dist/kanban.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.67 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
2
+ // ai4kanban 0.11.68 — 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)
@@ -4005,7 +4005,7 @@ var init_package = __esm({
4005
4005
  "package.json"() {
4006
4006
  package_default = {
4007
4007
  name: "wildcrane",
4008
- version: "0.11.67",
4008
+ version: "0.11.68",
4009
4009
  akbContract: 17,
4010
4010
  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.",
4011
4011
  keywords: [
@@ -18866,8 +18866,14 @@ async function all(route2) {
18866
18866
  } while (after2);
18867
18867
  return rows;
18868
18868
  }
18869
- function linked() {
18870
- for (let dir = process.cwd(); ; dir = path69.dirname(dir)) {
18869
+ function linked(location) {
18870
+ const cwd = location.cwd ?? process.cwd();
18871
+ const board2 = location.board ?? (process.env.AI4KANBAN_BOARD?.trim() || null);
18872
+ if (board2) {
18873
+ const link2 = linkedProject("", projectRootOf(path69.resolve(cwd, board2)));
18874
+ return link2.ok ? link2.value : null;
18875
+ }
18876
+ for (let dir = path69.resolve(cwd, location.dir ?? "."); ; dir = path69.dirname(dir)) {
18871
18877
  if (fs66.existsSync(path69.join(dir, ".akb", "base.json"))) {
18872
18878
  const link2 = linkedProject("", dir);
18873
18879
  return link2.ok ? link2.value : null;
@@ -18875,33 +18881,33 @@ function linked() {
18875
18881
  if (path69.dirname(dir) === dir) return null;
18876
18882
  }
18877
18883
  }
18878
- async function project(asked) {
18879
- const id = asked ?? linked();
18884
+ async function project(asked, location) {
18885
+ const id = asked ?? linked(location);
18880
18886
  if (id) return id;
18881
18887
  const rows = await all("/v1/projects");
18882
18888
  return refuse2(`Pick a project with --project: ${rows.map(projectLine).join(", ") || "none yet"}`, "no_project");
18883
18889
  }
18884
- async function workspace(asked) {
18890
+ async function workspace(asked, location) {
18885
18891
  if (asked) return asked;
18886
- const prj = linked();
18892
+ const prj = linked(location);
18887
18893
  if (prj) return (await cloud("GET", `/v1/projects/${enc(prj)}`)).workspace;
18888
18894
  const rows = await all("/v1/workspaces");
18889
18895
  return refuse2(`Pick a workspace with --workspace: ${rows.map((w2) => `${w2.id} ${w2.name}`).join(", ")}`, "no_project");
18890
18896
  }
18891
- async function taskRef(asked) {
18897
+ async function taskRef(asked, location = {}) {
18892
18898
  if (!/^\d+$/.test(asked.trim())) return asked.trim();
18893
- const prj = linked();
18899
+ const prj = linked(location);
18894
18900
  if (!prj) refuse2("Write the full task key, like WC-12, or run this in a linked folder.", "no_project");
18895
18901
  return `${(await cloud("GET", `/v1/projects/${enc(prj)}`)).prefix}-${asked.trim()}`;
18896
18902
  }
18897
- async function taskList(opts) {
18898
- const scope = opts.project || !opts.workspace ? `project=${enc(await project(opts.project))}` : `workspace=${enc(opts.workspace)}`;
18899
- const page = await cloud("GET", `/v1/tasks?${scope}&limit=100${opts.status ? `&status=${enc(opts.status)}` : ""}`);
18900
- for (const t of page.data) say(`${t.key} ${t.status} ${t.title}`);
18901
- return { ...page };
18903
+ async function taskList(opts, location = {}) {
18904
+ const scope = opts.project || !opts.workspace ? `project=${enc(await project(opts.project, location))}` : `workspace=${enc(opts.workspace)}`;
18905
+ const data = await all(`/v1/tasks?${scope}${opts.status ? `&status=${enc(opts.status)}` : ""}`);
18906
+ for (const t of data) say(`${t.key} ${t.status} ${t.title}`);
18907
+ return { data, next: null };
18902
18908
  }
18903
- async function taskShow(id) {
18904
- const task = await cloud("GET", `/v1/tasks/${enc(await taskRef(id))}`);
18909
+ async function taskShow(id, location = {}) {
18910
+ const task = await cloud("GET", `/v1/tasks/${enc(await taskRef(id, location))}`);
18905
18911
  const card = task.studio ? await cloud("GET", `/v1/tasks/${enc(task.id)}/card`).catch(() => null) : null;
18906
18912
  say(`${task.key} ${task.title}`);
18907
18913
  say(`${task.status}${task.studio ? ` ${task.studio.name}` : ""} ${taskUrl(task.key)}`);
@@ -18909,42 +18915,47 @@ async function taskShow(id) {
18909
18915
  ${card.body.trim()}`);
18910
18916
  return { ...task, card };
18911
18917
  }
18912
- async function taskCreate(request2, opts) {
18918
+ async function taskCreate(request2, opts, location = {}) {
18913
18919
  const text6 = request2.trim();
18914
18920
  if (!text6) die("Say what the task is.", { kind: "bad-args", exitCode: 2 });
18915
18921
  const line = text6.split("\n")[0].trim();
18916
18922
  const title = line.length > 80 ? `${line.slice(0, 79)}\u2026` : line;
18923
+ const target = await project(opts.project, location);
18924
+ if (!opts.studio?.trim()) return refuse2("Choose --studio from akb studio list.", "no_studio");
18917
18925
  const task = await cloud("POST", "/v1/tasks", {
18918
18926
  title,
18919
18927
  request: text6,
18920
- project: await project(opts.project),
18921
- ...opts.studio ? { studio: cloudStudio(opts.studio) } : {},
18922
- source: "api"
18928
+ project: target,
18929
+ studio: cloudStudio(opts.studio),
18930
+ source: "api",
18931
+ run: true
18923
18932
  });
18924
18933
  say(`Created ${task.key}: ${task.title} ${taskUrl(task.key)}`);
18934
+ say(`Status: ${task.status}${task.failure ? ` \u2014 ${task.failure}` : ""}`);
18925
18935
  return { ...task };
18926
18936
  }
18927
- async function act(id, route2, body, done) {
18928
- const ref = await taskRef(id);
18937
+ async function act(id, route2, body, done, location = {}) {
18938
+ const ref = await taskRef(id, location);
18929
18939
  const value = await cloud("POST", `/v1/tasks/${enc(ref)}/${route2}`, body);
18930
18940
  say(done(ref));
18931
18941
  return value;
18932
18942
  }
18933
- async function taskApprove(id, comment, opts = {}) {
18943
+ async function taskApprove(id, comment, opts = {}, location = {}) {
18934
18944
  const preview = opts.preview || opts.previewStage || opts.previewVersion || opts.definitionRevision ? previewConfirmation(opts) : null;
18935
18945
  if (preview && (insideRun() || process.env[REPLY_APPROVAL_ENV] || process.env[PREVIEW_BRIDGE_ENV])) return refuse2("Only the user confirms a preview stage.", "preview_refused");
18936
- const deferred = preview ? null : await approveAfterReply(id, comment);
18946
+ const ref = !preview && process.env[REPLY_APPROVAL_ENV] && !linked(location) ? id.trim() : await taskRef(id, location);
18947
+ const deferred = preview ? null : await approveAfterReply(ref, comment);
18937
18948
  if (deferred) return deferred;
18938
- const task = await cloud("GET", `/v1/tasks/${enc(await taskRef(id))}`);
18949
+ const task = await cloud("GET", `/v1/tasks/${enc(ref)}`);
18939
18950
  return act(task.key, "decisions", {
18940
18951
  ...preview ?? { decision: "approve" },
18941
18952
  ...comment?.trim() ? { comment: comment.trim() } : {},
18942
18953
  ...preview ? { review_revision: task.previewReviewRevision ?? task.review?.revision ?? 0 } : task.review ? { review_revision: task.review.revision } : {}
18943
18954
  }, (k2) => `Approved ${k2}.`);
18944
18955
  }
18945
- async function taskUpdateQuestions(id, typed) {
18956
+ async function taskUpdateQuestions(id, typed, location = {}) {
18946
18957
  const ops = readQuestionOps(typed);
18947
- const ref = await taskRef(id);
18958
+ const ref = await taskRef(id, location);
18948
18959
  const card = await cloud("GET", `/v1/tasks/${enc(ref)}/card`);
18949
18960
  const questions = parseFrontmatter(card.body).meta?.questions ?? [];
18950
18961
  let changes;
@@ -18979,8 +18990,8 @@ async function projectList(opts) {
18979
18990
  for (const p2 of data) say(projectLine(p2));
18980
18991
  return { data };
18981
18992
  }
18982
- async function runnerList(opts) {
18983
- const held4 = await cloud("GET", `/v1/workspaces/${enc(await workspace(opts.workspace))}/runners`);
18993
+ async function runnerList(opts, location = {}) {
18994
+ const held4 = await cloud("GET", `/v1/workspaces/${enc(await workspace(opts.workspace, location))}/runners`);
18984
18995
  for (const r2 of held4.runners) say(`${r2.name} ${r2.connected ? "online" : "offline"}`);
18985
18996
  return held4;
18986
18997
  }
@@ -19007,11 +19018,11 @@ var init_task = __esm({
19007
19018
  WEB = () => process.env.WILDCRANE_WEB_URL || "https://app.wildcrane.ai";
19008
19019
  taskUrl = (key) => `${WEB()}/tasks/${enc(key)}`;
19009
19020
  projectLine = (p2) => `${p2.id} ${p2.prefix} ${p2.name}`;
19010
- taskChat = (id, message) => act(id, "chat", { body: message }, (k2) => `Sent to ${k2}.`);
19011
- taskRemove = (id, reason) => act(id, "cancel", reason.trim() ? { reason: reason.trim() } : void 0, (k2) => `Removed ${k2}. Restore it on the web.`);
19012
- taskResume = (id) => act(id, "resume", void 0, (k2) => `Resumed ${k2}.`);
19013
- taskStop = (id) => act(id, "stop", void 0, (k2) => `Stopped ${k2}.`);
19014
- taskComment = (id, text6) => act(id, "comments", { body: text6 }, (k2) => `Commented on ${k2}.`);
19021
+ taskChat = (id, message, location = {}) => act(id, "chat", { body: message }, (k2) => `Sent to ${k2}.`, location);
19022
+ taskRemove = (id, reason, location = {}) => act(id, "cancel", reason.trim() ? { reason: reason.trim() } : void 0, (k2) => `Removed ${k2}. Restore it on the web.`, location);
19023
+ taskResume = (id, location = {}) => act(id, "resume", void 0, (k2) => `Resumed ${k2}.`, location);
19024
+ taskStop = (id, location = {}) => act(id, "stop", void 0, (k2) => `Stopped ${k2}.`, location);
19025
+ taskComment = (id, text6, location = {}) => act(id, "comments", { body: text6 }, (k2) => `Commented on ${k2}.`, location);
19015
19026
  }
19016
19027
  });
19017
19028
 
@@ -27737,7 +27748,7 @@ ${m.body}`);
27737
27748
  if (value.truncated) say(text5(`Showing ${value.messages.length} of ${value.total} messages.`, `\u663E\u793A ${value.total} \u6761\u4E2D\u7684 ${value.messages.length} \u6761\u3002`));
27738
27749
  }
27739
27750
  async function read2(id, opts, signal2) {
27740
- const route2 = `/v1/tasks/${encodeURIComponent(await taskRef(id))}`;
27751
+ const route2 = `/v1/tasks/${encodeURIComponent(await taskRef(id, opts))}`;
27741
27752
  const [task, chat] = await Promise.all([cloud("GET", route2, void 0, signal2), cloud("GET", `${route2}/chat`, void 0, signal2)]);
27742
27753
  return { route: route2, chat, value: snapshot(task, chat, opts) };
27743
27754
  }
@@ -27888,7 +27899,7 @@ var init_task_chat = __esm({
27888
27899
  var add_task_default;
27889
27900
  var init_add_task = __esm({
27890
27901
  "src/guide/add-task.md"() {
27891
- 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 --studio <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- **Studio**: the request\'s own, else the id from `akb studio list` that fits the work.\n- **Previews**: the agents from `akb raw previews --triggers --studio <id>` whose conditions the\n card meets, always including those marked `Always`, or `--previews ""` when that leaves none.\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 --studio coding --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';
27902
+ add_task_default = "# Add tasks\n\nCreate new work with `akb task create`; read its `--help` for options.\n\n- **Modules**: read `docs/kanban/modules.md` and relevant project context; follow\n `akb guide module-map` when no tag fits.\n\n## Group tasks\n\nUse a group when several tasks deliver one larger outcome; otherwise keep them independent.\n\n- **Creation**: create the root first, then its subtasks.\n- **Relationships**: link group members with `related`; use `blocked_by` for actual dependencies.\n- **Layout**: once their cards are prepared, place the root at `todo/<id>-<slug>/root.md`\n and the subtask files beside it; update their paths in `todo/README.md`.\n- **Tracking**: the root's `## Todo` lists its subtasks, one line each ending in `#<subid>`.\n\nFollow `akb guide writing` when editing a card.\n";
27892
27903
  }
27893
27904
  });
27894
27905
 
@@ -27904,7 +27915,7 @@ var init_archive2 = __esm({
27904
27915
  var board_default;
27905
27916
  var init_board3 = __esm({
27906
27917
  "src/guide/board.md"() {
27907
- board_default = "# How this board works\n\nThese rules apply to every card studio. Read them once; each studio's guide covers\nthe remaining details.\n\n## Layout\n\n```\ndocs/kanban/\n\u251C\u2500\u2500 todo/ open tasks\n\u2502 \u251C\u2500\u2500 README.md the index \u2014 read it first\n\u2502 \u2514\u2500\u2500 <id>-<slug>.md\n\u2502 one card per file; a group keeps its cards in one folder\n\u251C\u2500\u2500 memory/ all memory \u2014 see \"Who owns a memory file\"\n\u2502 \u251C\u2500\u2500 readme.md what shipped \u2014 the board's own record\n\u2502 \u251C\u2500\u2500 project.md what the project is today \u2014 written only by `akb raw describe-project`\n\u2502 \u251C\u2500\u2500 <name>/ a global memory: `MEMORY.md` (its rules, unless built in), `README.md`\n\u2502 \u2502 (its index) and its entries\n\u2502 \u2514\u2500\u2500 agents/ one folder per agent that keeps memory, named after it \u2014\n\u2502 `planner/` holds `decisions.md`, `rejected.md`, `redesign.md`\n\u251C\u2500\u2500 rules/ `<agent>.md` \u2014 the user's rule for one agent, appended to every run it\n\u2502 does; written from the web or `akb studio instructions`\n\u251C\u2500\u2500 triage/ items waiting to be sorted, one file each \u2014 not cards. Only\n\u2502 \u2502 Cloud's sort or Refine idea on the web's Triage page turns one\n\u2502 \u2502 into a card; `akb raw triage check <source-id>` finds an existing one\n\u2502 \u251C\u2500\u2500 archived/ items a card was made of\n\u2502 \u251C\u2500\u2500 dismissed/ items ignored, with the reason\n\u2502 \u2514\u2500\u2500 files/ dropped-in files\n\u2514\u2500\u2500 modules.md one line per module \u2014 `akb guide module-map` writes it\n```\n\n## Task ID\n\nEvery task's id is the number at the front of its filename (`04-plan-cap-enforcement.md` \u2192\nid 4): its Cloud task's number (`WC-4`). Only Cloud assigns one; `akb raw create` takes it.\n\n## Never hand-write a card's frontmatter\n\n`akb raw create`, `update`, and `update-questions` manage all of a card's frontmatter,\nincluding its `previews`. Edit only the card's **body** by hand. `akb raw help`\nlists all operations; `akb raw help <move>` explains one operation.\n\n## Inside a board run\n\nA board run carries `KANBAN_RUN` in its environment. Never unset or bypass it (for example\n`env -u KANBAN_RUN`): when a command only prints a flow, follow the printed flow.\n\n## Group task\n\nA group lives in `todo/<id>-<slug>/`: `root.md` tracks the whole job and each subtask is its\nown card beside it; `akb guide add-task` says how to build one. The root's `## Todo` lists the\nsubtasks, one line each ending in `#<subid>`: archiving a subtask ticks its line, rejecting\none strikes it through, and resolving the last line archives the root in the same run, with\nany open question or unticked todo of its own. A board a Runner keeps leaves that close to\nCloud, which waits for the root to be queued with no step on it. A root listing no subtasks is\nonly closed by hand.\n\n## Who owns a memory file\n\n**A memory file belongs to whoever reads and writes it.**\n\n- **`memory/readme.md`**: the board's record of shipped user-facing work.\n- **`memory/project.md`**: what the project is today, from its users' side, and the\n direction every judgement serves. Only `akb raw describe-project` writes it.\n- **`memory/agents/planner/`**: `decisions.md` holds user-facing answers that guide future\n planning and `redesign.md` design mistakes to avoid, both written by the memory review (`akb\n guide review-memory`); `rejected.md` holds what the user turned down and why, written only\n by the rejection and dismissal review (`akb guide review-rejections`). Other flows only read\n them, `akb raw memory prune` aside.\n- **`memory/<name>/`**: a global memory, kept by every agent listing it under `akb.memory`\n by the rules each run is given. Only the user changes its `MEMORY.md`, from the board UI.\n- **`memory/agents/<agent>/`**: an agent keeps only the files and split paths its own AGENT.md\n declares, plus the `redesign.md` the memory review writes there. An agent whose instructions\n name none keeps none.\n\nFile a planning note about one module in that module's folder,\n`memory/agents/planner/<module>/`, under the same file name, creating it if missing. A note\nspanning modules, or from a card with none, stays in `memory/agents/planner/`.\n\n### What earns a note\n\nOnly what changes a future planning choice. Writing nothing is a complete outcome.\n\n- **Honor an opt-out**: told not to record, write no memory and finish the requested action.\n- **A conversation writes none**: a card chat, a discussion, a feedback conversation, and\n any flow started in it write no memory and say nothing about it.\n- **Require lasting value**: a durable preference, constraint, decision, or lesson.\n- **Skip housekeeping**: duplicates, routine status changes, and facts recorded elsewhere.\n A rejected duplicate is not a rejected feature.\n- **Merge, don't repeat**: rewrite an equivalent entry in place.\n\n`readme.md` is not planning memory.\n";
27918
+ board_default = "# How this board works\n\nThese rules apply to every card studio. Read them once; each studio's guide covers\nthe remaining details.\n\n## Layout\n\n```\ndocs/kanban/\n\u251C\u2500\u2500 todo/ open tasks\n\u2502 \u251C\u2500\u2500 README.md the index \u2014 read it first\n\u2502 \u2514\u2500\u2500 <id>-<slug>.md\n\u2502 one card per file; a group keeps its cards in one folder\n\u251C\u2500\u2500 memory/ all memory \u2014 see \"Who owns a memory file\"\n\u2502 \u251C\u2500\u2500 readme.md what shipped \u2014 the board's own record\n\u2502 \u251C\u2500\u2500 project.md what the project is today \u2014 written only by `akb raw describe-project`\n\u2502 \u251C\u2500\u2500 <name>/ a global memory: `MEMORY.md` (its rules, unless built in), `README.md`\n\u2502 \u2502 (its index) and its entries\n\u2502 \u2514\u2500\u2500 agents/ one folder per agent that keeps memory, named after it \u2014\n\u2502 `planner/` holds `decisions.md`, `rejected.md`, `redesign.md`\n\u251C\u2500\u2500 rules/ `<agent>.md` \u2014 the user's rule for one agent, appended to every run it\n\u2502 does; written from the web or `akb studio instructions`\n\u251C\u2500\u2500 triage/ items waiting to be sorted, one file each \u2014 not cards. Only\n\u2502 \u2502 Cloud's sort or Refine idea on the web's Triage page turns one\n\u2502 \u2502 into a card; `akb raw triage check <source-id>` finds an existing one\n\u2502 \u251C\u2500\u2500 archived/ items a card was made of\n\u2502 \u251C\u2500\u2500 dismissed/ items ignored, with the reason\n\u2502 \u2514\u2500\u2500 files/ dropped-in files\n\u2514\u2500\u2500 modules.md one line per module \u2014 `akb guide module-map` writes it\n```\n\n## Task ID\n\nEvery task's id is the number at the front of its filename (`04-plan-cap-enforcement.md` \u2192\nid 4): its Cloud task's number (`WC-4`). Only Cloud assigns one.\n\n## Never hand-write a card's frontmatter\n\n`akb raw update` and `update-questions` manage an existing card's frontmatter,\nincluding its `previews`. Edit only the card's **body** by hand. `akb raw help`\nlists all operations; `akb raw help <move>` explains one operation.\n\n## Inside a board run\n\nA board run carries `KANBAN_RUN` in its environment. Never unset or bypass it (for example\n`env -u KANBAN_RUN`): when a command only prints a flow, follow the printed flow.\n\n## Group task\n\nA group lives in `todo/<id>-<slug>/`: `root.md` tracks the whole job and each subtask is its\nown card beside it; `akb guide add-task` says how to build one. The root's `## Todo` lists the\nsubtasks, one line each ending in `#<subid>`: archiving a subtask ticks its line, rejecting\none strikes it through, and resolving the last line archives the root in the same run, with\nany open question or unticked todo of its own. A board a Runner keeps leaves that close to\nCloud, which waits for the root to be queued with no step on it. A root listing no subtasks is\nonly closed by hand.\n\n## Who owns a memory file\n\n**A memory file belongs to whoever reads and writes it.**\n\n- **`memory/readme.md`**: the board's record of shipped user-facing work.\n- **`memory/project.md`**: what the project is today, from its users' side, and the\n direction every judgement serves. Only `akb raw describe-project` writes it.\n- **`memory/agents/planner/`**: `decisions.md` holds user-facing answers that guide future\n planning and `redesign.md` design mistakes to avoid, both written by the memory review (`akb\n guide review-memory`); `rejected.md` holds what the user turned down and why, written only\n by the rejection and dismissal review (`akb guide review-rejections`). Other flows only read\n them, `akb raw memory prune` aside.\n- **`memory/<name>/`**: a global memory, kept by every agent listing it under `akb.memory`\n by the rules each run is given. Only the user changes its `MEMORY.md`, from the board UI.\n- **`memory/agents/<agent>/`**: an agent keeps only the files and split paths its own AGENT.md\n declares, plus the `redesign.md` the memory review writes there. An agent whose instructions\n name none keeps none.\n\nFile a planning note about one module in that module's folder,\n`memory/agents/planner/<module>/`, under the same file name, creating it if missing. A note\nspanning modules, or from a card with none, stays in `memory/agents/planner/`.\n\n### What earns a note\n\nOnly what changes a future planning choice. Writing nothing is a complete outcome.\n\n- **Honor an opt-out**: told not to record, write no memory and finish the requested action.\n- **A conversation writes none**: a card chat, a discussion, a feedback conversation, and\n any flow started in it write no memory and say nothing about it.\n- **Require lasting value**: a durable preference, constraint, decision, or lesson.\n- **Skip housekeeping**: duplicates, routine status changes, and facts recorded elsewhere.\n A rejected duplicate is not a rejected feature.\n- **Merge, don't repeat**: rewrite an equivalent entry in place.\n\n`readme.md` is not planning memory.\n";
27908
27919
  }
27909
27920
  });
27910
27921
 
@@ -28064,7 +28075,7 @@ var init_write_prompt = __esm({
28064
28075
  var writing_default;
28065
28076
  var init_writing = __esm({
28066
28077
  "src/guide/writing.md"() {
28067
- writing_default = "# Write a card\n\nA card has a **human half** for review and a folded **agent half** for implementation.\nUse this order and keep the English section titles and empty scaffold sections:\n\n```text\n<One short paragraph: the problem and the intended result.>\n\n## Worth noting <- user's answers first, then material decisions; empty if none\n- **<decision>**: <chosen behavior and main cost in one sentence>\n\n## Worth noting after implementation\n- **<decision>**: <chosen behavior and main cost in one sentence>\n <- settled by the build; omit when empty; no logs or open questions\n\n## By `<name>` agent <- preview owned by that agent\n\n<!-- agent --> <- folded content starts here\n\n## Scope <- requirements, not rationale\n### Done when <- acceptance checklist, when supplied\n- [ ] <observable result>\n\n## Todo <- implementation only; finish planning before writing steps\n- [ ] <one build step>\n\n## Decided by the agent <- other decisions and non-obvious findings the build needs\n- **<decision>**: <answer and required action>\n### Overruled by the user <- superseded decisions, always last\n```\n\n- **Decisions**: use the material-decision test in `akb guide update-questions` for Worth noting;\n merge entries governed by one policy and keep only the decision and its main cost.\n- **Delivery boundary**: Worth noting after implementation never changes approved scope or\n blocks an ongoing delivery; the build must fix deviations or refer them to the user.\n- **Preview ownership**: produce preview sections only by running their agent; before changing\n owned content, read `akb raw file <studio> agents/<agent>/AGENT.md` and the studio's\n `shared/RULES.md`, then only the files needed for that change with `akb raw file <studio> <path>`;\n report unreadable rules before proceeding.\n- **Preserve work**: leave checked todos and supplied Done when checklists unchanged; append a\n todo to reverse completed work, and move user-overruled decisions to Overruled by the user\n until the card leaves no room to repeat them.\n- **Writing**: write clear behavior and necessary tradeoffs for a fresh reader, keep the human\n half self-contained, and state each fact once.\n- **Agent half**: keep only implementation-critical information not stated elsewhere; omit\n process logs and routine implementation planning, and leave unneeded sections empty.\n- **Frontmatter**: never edit frontmatter by hand; use `akb raw create`, `update`, or\n `update-questions`.\n- **Validate**: run `akb raw validate <id>` after edits and fix every reported file and line.\n";
28078
+ writing_default = "# Write a card\n\nA card has a **human half** for review and a folded **agent half** for implementation.\nUse this order and keep the English section titles and empty scaffold sections:\n\n```text\n<One short paragraph: the problem and the intended result.>\n\n## Worth noting <- user's answers first, then material decisions; empty if none\n- **<decision>**: <chosen behavior and main cost in one sentence>\n\n## Worth noting after implementation\n- **<decision>**: <chosen behavior and main cost in one sentence>\n <- settled by the build; omit when empty; no logs or open questions\n\n## By `<name>` agent <- preview owned by that agent\n\n<!-- agent --> <- folded content starts here\n\n## Scope <- requirements, not rationale\n### Done when <- acceptance checklist, when supplied\n- [ ] <observable result>\n\n## Todo <- implementation only; finish planning before writing steps\n- [ ] <one build step>\n\n## Decided by the agent <- other decisions and non-obvious findings the build needs\n- **<decision>**: <answer and required action>\n### Overruled by the user <- superseded decisions, always last\n```\n\n- **Decisions**: use the material-decision test in `akb guide update-questions` for Worth noting;\n merge entries governed by one policy and keep only the decision and its main cost.\n- **Delivery boundary**: Worth noting after implementation never changes approved scope or\n blocks an ongoing delivery; the build must fix deviations or refer them to the user.\n- **Preview ownership**: produce preview sections only by running their agent; before changing\n owned content, read `akb raw file <studio> agents/<agent>/AGENT.md` and the studio's\n `shared/RULES.md`, then only the files needed for that change with `akb raw file <studio> <path>`;\n report unreadable rules before proceeding.\n- **Preserve work**: leave checked todos and supplied Done when checklists unchanged; append a\n todo to reverse completed work, and move user-overruled decisions to Overruled by the user\n until the card leaves no room to repeat them.\n- **Writing**: write clear behavior and necessary tradeoffs for a fresh reader, keep the human\n half self-contained, and state each fact once.\n- **Agent half**: keep only implementation-critical information not stated elsewhere; omit\n process logs and routine implementation planning, and leave unneeded sections empty.\n- **Frontmatter**: never edit frontmatter by hand; use `akb raw update` or `update-questions`.\n- **Validate**: run `akb raw validate <id>` after edits and fix every reported file and line.\n";
28068
28079
  }
28069
28080
  });
28070
28081
 
@@ -115832,7 +115843,7 @@ async function onBoard2(cmd, cli, work) {
115832
115843
  }
115833
115844
  async function boardless(cmd, cli, work) {
115834
115845
  const ctx = ctxOf(cmd, cli.program);
115835
- await runAction(ctx, {}, async () => await work(cli.program) ?? {});
115846
+ await runAction(ctx, {}, async () => await work(cli.program, { board: ctx.board, dir: ctx.dir, cwd: cli.cwd }) ?? {});
115836
115847
  }
115837
115848
  function nounOf(program2, name, summary2, description) {
115838
115849
  const cmd = withShared(program2.command(name)).summary(summary2);
@@ -115920,39 +115931,39 @@ function declareRuns(program2, cli) {
115920
115931
  this.help();
115921
115932
  });
115922
115933
  withShared(task.command("list")).summary("list tasks").option("--project <id>", "the project; default: this folder\u2019s linked one").option("--workspace <id>", "every project of a workspace").option("--status <status>", "queued, running, waiting_review, done, failed, cancelled or stopped").action(async function() {
115923
- await boardless(this, cli, () => taskList(this.opts()));
115934
+ await boardless(this, cli, (_2, location) => taskList(this.opts(), location));
115924
115935
  });
115925
115936
  withShared(task.command("show")).argument("<task>").summary("a task and its card").action(async function(id) {
115926
- await boardless(this, cli, () => taskShow(id));
115937
+ await boardless(this, cli, (_2, location) => taskShow(id, location));
115927
115938
  });
115928
- withShared(task.command("create")).argument("<request...>", "what the task should do").summary("create a task").option("--project <id>", "the project; default: this folder\u2019s linked one").option("--studio <id>", "a name `akb studio list` shows").action(async function(request2) {
115929
- await boardless(this, cli, () => taskCreate(request2.join(" "), this.opts()));
115939
+ withShared(task.command("create")).argument("<request...>", "what the task should do").summary("create a task and prepare its card asynchronously").option("--project <id>", "the project; default: this folder\u2019s linked one").option("--studio <id>", "required: a name `akb studio list` shows").action(async function(request2) {
115940
+ await boardless(this, cli, (_2, location) => taskCreate(request2.join(" "), this.opts(), location));
115930
115941
  });
115931
115942
  withShared(task.command("approve")).argument("<task>").summary("approve the current review point").option("--preview <agent>", "confirm this preview\u2019s intermediate stage").option("--preview-stage <id>", "the stage reviewed").option("--preview-version <n>", "the version reviewed").option("--definition-revision <revision>", "the frozen definition reviewed").option("--comment <text>", "a note with the approval").action(async function(id) {
115932
- await boardless(this, cli, () => taskApprove(id, this.opts().comment, this.opts()));
115943
+ await boardless(this, cli, (_2, location) => taskApprove(id, this.opts().comment, this.opts(), location));
115933
115944
  });
115934
115945
  const questionOps = [];
115935
115946
  const opInOrder = ordered(questionOps);
115936
115947
  withShared(task.command("update-questions")).argument("<task>").summary("edit the task's open questions, like `raw update-questions`").description("Positions are 1-based, in the order of the card\u2019s `questions:` (`akb task show`). --option, --recommended-option, --mode and --agent attach to the --append or --update before them.").option("--append <text>", "add one question to the end", opInOrder("append")).option("--update <n> <text...>", "rewrite question <n> whole", opInOrder("update")).option("--drop <positions>", "remove questions, e.g. 1 or 1,3", opInOrder("drop")).option("--clear", "remove every open question", opInOrder("clear")).option("--option <text>", "a choice for the op before it", opInOrder("option")).option("--recommended-option <text>", "a choice for the op before it, ticked to start", opInOrder("recommended-option")).option("--mode <mode>", "how many choices the op before it takes: single | multi", opInOrder("mode")).option("--agent <name>", "the preview agent whose section the op before it is about", opInOrder("agent")).action(async function(id) {
115937
- await boardless(this, cli, () => taskUpdateQuestions(id, questionOps));
115948
+ await boardless(this, cli, (_2, location) => taskUpdateQuestions(id, questionOps, location));
115938
115949
  });
115939
115950
  withShared(task.command("chat")).argument("<task>").argument("[message...]").summary("read task chat history, follow or stop its reply, or send a message").description("Without a message, read the last 20 messages and the chat reply state separately from task execution. --follow tracks only the reply present at the start; Ctrl+C disconnects locally. --stop stops only that reply. --follow --json emits JSON Lines; other modes return one JSON object.").option("--limit <n>", "show the last n messages, oldest first (default: 20)", intInRange(1, Number.MAX_SAFE_INTEGER)).option("--all", "show all retained messages").option("--follow", "follow this reply to its result, then exit").option("--stop", "request stopping only the current chat reply").addHelpText("after", '\nExamples:\n akb task chat WC-12\n akb task chat 12 --all --json\n akb task chat 12 --follow --json\n akb task chat 12 --stop\n akb task chat 12 "Revise the draft"').action(async function(id, message) {
115940
115951
  const opts = this.opts();
115941
115952
  validateChatOptions(message, opts);
115942
- if (opts.follow) return taskChatFollow(id, { ...opts, json: ctxOf(this, cli.program).json });
115943
- await boardless(this, cli, () => message.length ? taskChat(id, message.join(" ")) : taskChatRead(id, opts));
115953
+ if (opts.follow) return taskChatFollow(id, { ...opts, ...ctxOf(this, cli.program), cwd: cli.cwd });
115954
+ await boardless(this, cli, (_2, location) => message.length ? taskChat(id, message.join(" "), location) : taskChatRead(id, { ...opts, ...location }));
115944
115955
  });
115945
115956
  withShared(task.command("remove")).argument("<task>").argument("[reason...]").summary("remove a task; restore it on the web").action(async function(id, reason) {
115946
- await boardless(this, cli, () => taskRemove(id, reason.join(" ")));
115957
+ await boardless(this, cli, (_2, location) => taskRemove(id, reason.join(" "), location));
115947
115958
  });
115948
115959
  withShared(task.command("resume")).argument("<task>").summary("continue its stopped run").action(async function(id) {
115949
- await boardless(this, cli, () => taskResume(id));
115960
+ await boardless(this, cli, (_2, location) => taskResume(id, location));
115950
115961
  });
115951
115962
  withShared(task.command("stop")).argument("<task>").summary("stop its current run").action(async function(id) {
115952
- await boardless(this, cli, () => taskStop(id));
115963
+ await boardless(this, cli, (_2, location) => taskStop(id, location));
115953
115964
  });
115954
115965
  withShared(task.command("comment")).argument("<task>").argument("<text...>").summary("comment on a task").action(async function(id, text6) {
115955
- await boardless(this, cli, () => taskComment(id, text6.join(" ")));
115966
+ await boardless(this, cli, (_2, location) => taskComment(id, text6.join(" "), location));
115956
115967
  });
115957
115968
  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>] [--previews <agents>]; update with goal save --id <goal> and any of --title, --body-file, --studio, --previews. 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("--previews <agents>", "review points, comma-separated; empty clears the selection");
115958
115969
  goal.action(async function(sub) {
@@ -115965,7 +115976,7 @@ function declareRuns(program2, cli) {
115965
115976
  await boardless(this, cli, () => projectList(this.opts()));
115966
115977
  });
115967
115978
  withShared(withShared(program2.command("runner")).summary("the computers that run a workspace\u2019s tasks").command("list")).summary("list Runners").option("--workspace <id>", "default: the linked project\u2019s").action(async function() {
115968
- await boardless(this, cli, () => runnerList(this.opts()));
115979
+ await boardless(this, cli, (_2, location) => runnerList(this.opts(), location));
115969
115980
  });
115970
115981
  const account = withShared(program2.command("account")).summary("the account this MACHINE acts as").description(
115971
115982
  `A sign-in is started in the WildCrane app, under Configuration \u2192 Cloud, and nowhere else: the consent screen opens in your own browser and comes back to the app. Once per machine \u2014 every \`${cli.program}\` on it then acts as that account, because they read the one session the app wrote, outside every repository. Cloud is an invite-only preview.`
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "wildcrane",
3
- "version": "0.11.67",
3
+ "version": "0.11.68",
4
4
  "akbContract": 17,
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.",
5
+ "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.",
6
6
  "keywords": [
7
7
  "kanban",
8
8
  "claude",