wildcrane 0.11.33 → 0.11.34
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 +44 -31
- 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.34 — 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)
|
|
@@ -1078,8 +1078,8 @@ var init_cloud = __esm({
|
|
|
1078
1078
|
en: "Could not reach WildCrane Cloud. Check your connection and try again."
|
|
1079
1079
|
},
|
|
1080
1080
|
credits_used_up: {
|
|
1081
|
-
zh: "\u672C\u6708\u79EF\u5206\u5DF2\u7528\u5B8C\
|
|
1082
|
-
en: "This month\u2019s AI credits are used up.
|
|
1081
|
+
zh: "\u672C\u6708 AI \u79EF\u5206\u5DF2\u7528\u5B8C\u3002\u53EF\u5728 WildCrane \u7F51\u9875\u7684\u201C\u8BBE\u7F6E \u2192 \u8D26\u5355\u201D\u4E2D\u4EE5 $10 \u52A0\u8D2D 2,500 \u79EF\u5206\uFF0C\u6216\u7B49\u4E0B\u6708 1 \u65E5\uFF08UTC\uFF09\u91CD\u7F6E\u3002",
|
|
1082
|
+
en: "This month\u2019s AI credits are used up. Buy 2,500 more for $10 in Settings \u2192 Billing on the WildCrane web app, or wait for the reset on the 1st of next month (UTC)."
|
|
1083
1083
|
},
|
|
1084
1084
|
trial_credits_used_up: {
|
|
1085
1085
|
zh: "\u8BD5\u7528\u671F\u7684 AI \u79EF\u5206\u5DF2\u7528\u5B8C\u3002\u8BD5\u7528\u7ED3\u675F\u540E\u53EF\u5728 WildCrane \u7F51\u9875\u8BBE\u7F6E\u4E2D\u8D2D\u4E70 Pro\u3002",
|
|
@@ -3903,7 +3903,7 @@ var init_package = __esm({
|
|
|
3903
3903
|
"package.json"() {
|
|
3904
3904
|
package_default = {
|
|
3905
3905
|
name: "wildcrane",
|
|
3906
|
-
version: "0.11.
|
|
3906
|
+
version: "0.11.34",
|
|
3907
3907
|
akbContract: 8,
|
|
3908
3908
|
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.",
|
|
3909
3909
|
keywords: [
|
|
@@ -10540,9 +10540,9 @@ var init_goal_cloud = __esm({
|
|
|
10540
10540
|
}
|
|
10541
10541
|
});
|
|
10542
10542
|
|
|
10543
|
-
//
|
|
10543
|
+
// node_modules/commander/lib/error.js
|
|
10544
10544
|
var require_error = __commonJS({
|
|
10545
|
-
"
|
|
10545
|
+
"node_modules/commander/lib/error.js"(exports) {
|
|
10546
10546
|
var CommanderError2 = class extends Error {
|
|
10547
10547
|
/**
|
|
10548
10548
|
* Constructs the CommanderError class
|
|
@@ -10575,9 +10575,9 @@ var require_error = __commonJS({
|
|
|
10575
10575
|
}
|
|
10576
10576
|
});
|
|
10577
10577
|
|
|
10578
|
-
//
|
|
10578
|
+
// node_modules/commander/lib/argument.js
|
|
10579
10579
|
var require_argument = __commonJS({
|
|
10580
|
-
"
|
|
10580
|
+
"node_modules/commander/lib/argument.js"(exports) {
|
|
10581
10581
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
10582
10582
|
var Argument2 = class {
|
|
10583
10583
|
/**
|
|
@@ -10702,9 +10702,9 @@ var require_argument = __commonJS({
|
|
|
10702
10702
|
}
|
|
10703
10703
|
});
|
|
10704
10704
|
|
|
10705
|
-
//
|
|
10705
|
+
// node_modules/commander/lib/help.js
|
|
10706
10706
|
var require_help = __commonJS({
|
|
10707
|
-
"
|
|
10707
|
+
"node_modules/commander/lib/help.js"(exports) {
|
|
10708
10708
|
var { humanReadableArgName } = require_argument();
|
|
10709
10709
|
var Help2 = class {
|
|
10710
10710
|
constructor() {
|
|
@@ -11271,9 +11271,9 @@ ${itemIndentStr}`);
|
|
|
11271
11271
|
}
|
|
11272
11272
|
});
|
|
11273
11273
|
|
|
11274
|
-
//
|
|
11274
|
+
// node_modules/commander/lib/option.js
|
|
11275
11275
|
var require_option = __commonJS({
|
|
11276
|
-
"
|
|
11276
|
+
"node_modules/commander/lib/option.js"(exports) {
|
|
11277
11277
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
11278
11278
|
var Option2 = class {
|
|
11279
11279
|
/**
|
|
@@ -11572,9 +11572,9 @@ var require_option = __commonJS({
|
|
|
11572
11572
|
}
|
|
11573
11573
|
});
|
|
11574
11574
|
|
|
11575
|
-
//
|
|
11575
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
11576
11576
|
var require_suggestSimilar = __commonJS({
|
|
11577
|
-
"
|
|
11577
|
+
"node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
11578
11578
|
var maxDistance = 3;
|
|
11579
11579
|
function editDistance2(a, b) {
|
|
11580
11580
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -11652,9 +11652,9 @@ var require_suggestSimilar = __commonJS({
|
|
|
11652
11652
|
}
|
|
11653
11653
|
});
|
|
11654
11654
|
|
|
11655
|
-
//
|
|
11655
|
+
// node_modules/commander/lib/command.js
|
|
11656
11656
|
var require_command = __commonJS({
|
|
11657
|
-
"
|
|
11657
|
+
"node_modules/commander/lib/command.js"(exports) {
|
|
11658
11658
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
11659
11659
|
var childProcess = __require("node:child_process");
|
|
11660
11660
|
var path84 = __require("node:path");
|
|
@@ -13811,9 +13811,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
13811
13811
|
}
|
|
13812
13812
|
});
|
|
13813
13813
|
|
|
13814
|
-
//
|
|
13814
|
+
// node_modules/commander/index.js
|
|
13815
13815
|
var require_commander = __commonJS({
|
|
13816
|
-
"
|
|
13816
|
+
"node_modules/commander/index.js"(exports) {
|
|
13817
13817
|
var { Argument: Argument2 } = require_argument();
|
|
13818
13818
|
var { Command: Command2 } = require_command();
|
|
13819
13819
|
var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
@@ -13833,10 +13833,10 @@ var require_commander = __commonJS({
|
|
|
13833
13833
|
}
|
|
13834
13834
|
});
|
|
13835
13835
|
|
|
13836
|
-
//
|
|
13836
|
+
// node_modules/commander/esm.mjs
|
|
13837
13837
|
var import_index, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help;
|
|
13838
13838
|
var init_esm = __esm({
|
|
13839
|
-
"
|
|
13839
|
+
"node_modules/commander/esm.mjs"() {
|
|
13840
13840
|
import_index = __toESM(require_commander(), 1);
|
|
13841
13841
|
({
|
|
13842
13842
|
program,
|
|
@@ -22733,7 +22733,7 @@ var init_card_chat = __esm({
|
|
|
22733
22733
|
var update_workflow_default;
|
|
22734
22734
|
var init_update_workflow = __esm({
|
|
22735
22735
|
"src/guide/update-workflow.md"() {
|
|
22736
|
-
update_workflow_default = "# Update a workflow\n\nChange one of this workspace's workflows so new tasks run the new version.\n\n## How a workflow works\n\nA workflow is steerable: agents do the work, and a person reviews and fine-tunes only the parts where precision matters most, so the result stays reliable.\n\n- **Previews**: usually one preview agent shows the first draft; add another only when a part needs precision and a mistake there is costly, such as a developer tool's screens. Each shows only what the person decides on, without overlapping another. With none, the card the `WORKFLOW.md` body writes is the only review.\n- **Unreviewable previews**: when the user finds a preview unneeded or cannot judge it, remove it; a land agent checks that part instead, or nobody does.\n- **Stages**: one stage by default. Add `after` only when a draft is too costly to make before another is approved, such as a video's storyboard, which waits for its script.\n- **Minimal**: when the user outlines the workflow, keep it that simple or simpler; add no review point or constraint they did not ask for, and let the trial show what else needs review.\n- **Land**: everything else runs unattended after the last approval and follows the approved drafts, such as building and merging a change; leave `land` empty when the last approved preview is the deliverable.\n- **Scheduled**: repeating work runs as a scheduled agent without previews; a workflow may hold only scheduled agents.\n- **`WORKFLOW.md`**: list its agents under `previews`, `land` and `scheduled`; `description` says in one sentence what it does; `when` tells an agent which requests it is for, exceptions included; the body is how a card of this kind is written.\n- **Agents**: write each as `akb guide write-agent` says.\n\n## Versions\n\n- **Pinned**: a workflow and the agents it holds live in Cloud as numbered versions; a task\n keeps the version it started with, and only tasks started after a push take the new one.\n- **Project agents**: agents under the board's `agents/` folder are the project's own; a\n workflow may name them, but they are not part of its versions and an edit there applies to\n every card at once.\n- **Own workflows only**:
|
|
22736
|
+
update_workflow_default = "# Update a workflow\n\nChange one of this workspace's workflows so new tasks run the new version.\n\n## How a workflow works\n\nA workflow is steerable: agents do the work, and a person reviews and fine-tunes only the parts where precision matters most, so the result stays reliable.\n\n- **Previews**: usually one preview agent shows the first draft; add another only when a part needs precision and a mistake there is costly, such as a developer tool's screens. Each shows only what the person decides on, without overlapping another. With none, the card the `WORKFLOW.md` body writes is the only review.\n- **Unreviewable previews**: when the user finds a preview unneeded or cannot judge it, remove it; a land agent checks that part instead, or nobody does.\n- **Stages**: one stage by default. Add `after` only when a draft is too costly to make before another is approved, such as a video's storyboard, which waits for its script.\n- **Minimal**: when the user outlines the workflow, keep it that simple or simpler; add no review point or constraint they did not ask for, and let the trial show what else needs review.\n- **Judgment**: leave to an agent what it can judge; never add a hard rule for one case, and keep a rule only once real runs show it holds widely.\n- **Memory**: give an agent memory only where it has wide latitude and tends to err or be corrected to taste, naming those error-prone points as what it records; give a narrow agent none.\n- **Land**: everything else runs unattended after the last approval and follows the approved drafts, such as building and merging a change; leave `land` empty when the last approved preview is the deliverable.\n- **Scheduled**: repeating work runs as a scheduled agent without previews; a workflow may hold only scheduled agents.\n- **`WORKFLOW.md`**: list its agents under `previews`, `land` and `scheduled`; `description` says in one sentence what it does; `when` tells an agent which requests it is for, exceptions included; the body is how a card of this kind is written.\n- **Agents**: write each as `akb guide write-agent` says.\n\n## Versions\n\n- **Pinned**: a workflow and the agents it holds live in Cloud as numbered versions; a task\n keeps the version it started with, and only tasks started after a push take the new one.\n- **Project agents**: agents under the board's `agents/` folder are the project's own; a\n workflow may name them, but they are not part of its versions and an edit there applies to\n every card at once.\n- **Own workflows only**: only the workspace's own workflows take a new version; ask the user to\n copy a built-in or marketplace one on the web first.\n\n## Change it\n\n- **Standing preference**: when the user only wants a lasting rule for a workflow or one of its\n agents and the flow itself stays, set it with `akb workflow rule <workflow>` or\n `akb workflow instructions <agent>` instead of pushing; it reaches every task's later runs and\n works on built-in workflows too. Either replaces all of them, so run it bare first to read the\n current ones, and keep each unless the user asks to change or drop it.\n- **Direct or task**: push directly a change the user spelled out; start a Workflow builder task\n instead when the change adds, removes or restages agents, or when the user wants to see it\n work before it applies.\n- **Steps**: `akb workflow pull <id> <folder>`, edit the files there and keep what the request\n leaves alone, fix every problem `akb workflow list` reports, then `akb workflow push <folder>`.\n- **Moved on**: when push says Cloud has a newer version, pull again and redo the change.\n";
|
|
22737
22737
|
}
|
|
22738
22738
|
});
|
|
22739
22739
|
|
|
@@ -22861,7 +22861,7 @@ var init_troubleshoot = __esm({
|
|
|
22861
22861
|
var write_agent_default;
|
|
22862
22862
|
var init_write_agent = __esm({
|
|
22863
22863
|
"src/guide/write-agent.md"() {
|
|
22864
|
-
write_agent_default = "# Write an agent\n\nAn agent is one folder: `docs/kanban/agents/<name>/AGENT.md`. The folder name is the agent's\nname and the word every flow asks for it by \u2014 lower-case words joined by `-`, matching the\n`name` in its frontmatter. It cannot be a name the board already answers to: one of the\nboard's roles, an agent the command ships, or a folder already in `docs/kanban/agents/`.\n\n## The file\n\n```yaml\n---\n# Required; matches the folder name.\nname: ux-writer\n# Required: one sentence saying what it does.\ndescription: Writes the words a screen shows.\n# Optional.\nakb:\n # Optional, for a preview agent: when to request it, exceptions included. Without it, it\n # always runs.\n when: A card changes what the product says to the user; not a typo.\n # Optional, for a preview agent: it runs only after these agents' previews are approved,\n # when the card requests them too; it never makes them run.\n after: [ui-designer]\n # Optional, for a preview agent: `new` runs it in a session of its own.\n session: new\n # Preview components this agent uses; an empty list loads no component documentation.\n components: [Asset]\n # Optional: a sticker of its deliverable, by glyph name (the Workflow builder lists them),\n # or 1 to 12 parts `{ d, f?, o?: true, s?, w? }`. Without it, a generic file is drawn.\n icon: text\n---\n\nYou write the words a screen shows.\n```\n\nIts workflow, not the agent, sets its role: `WORKFLOW.md` lists it under `previews`, `land`\nor `scheduled`.\n\nA scheduled agent can also name the new input it works on; it then runs only when there is some:\n\n```yaml\nakb:\n # archived-cards | chats | dismissals; omit to run on its cadence alone.\n reads: archived-cards\n```\n\nA land agent that merges code into the target branch declares it; completing its step then\nrequires the merged commit and branch:\n\n```yaml\nakb:\n merges: true\n```\n\nAn agent that shares material with others names the global memories it keeps:\n\n```yaml\nakb:\n # Optional; global memories under `docs/kanban/memory/<name>/`, by name.\n memory: [competitors]\n # Optional; its own memory files, or folders ending in `/`, that hold in any of the user's\n # projects. Everything else is this project's.\n memoryFiles:\n workspace: [style.md]\n```\n\nEverything under the frontmatter is the agent's instructions, read fresh on every run \u2014\na file with none is refused.\n\nAn agent declares no options of its own. Two ways of working is two agents, each with its own\n`AGENT.md` \u2014 a switch that changes how one agent works costs more than it buys.\n\n## Translations\n\n```yaml\nakb:\n # Optional; UI text only. Runs use English; omitted text falls back to English.\n i18n:\n # Language tag; every field below is optional.\n en:\n # Display name, shown as the stage name: name the output, not the role; at most\n # 3 English words or 4 Chinese characters. Does not change the agent's name.\n title: UI copy\n zh:\n title: \u754C\u9762\u6587\u6848\n description: \u64B0\u5199\u754C\u9762\u4E0A\u7684\u6587\u5B57\u3002\n when: \u5361\u7247\u65B0\u589E\u6216\u4FEE\u6539\u754C\u9762\u6587\u5B57\u65F6\u3002\n```\n\n## Files\n\nEvery file beside `AGENT.md`, in any subfolder, is named to the run by its path and opened only\nwhen the work calls for it. Put long material there and keep `AGENT.md` short.\n\n- **Scripts**: every agent owns its task scripts in its own folder, including built-in agents.\n Keep business validation there, outside the CLI's board logic. Document the runtime, inputs\n and invocation beside the script; consumers use the owner's script. Built-in files can be\n saved through `akb raw agent-file <agent> <path>` and run locally with their relative layout\n intact; custom agents use their existing folders.\n\n## Imported skills\n\nAn agent may carry several skills, each whole in its own `skills/<skill>/` folder.\n\n- **Keep the capability**: copy the skill's instructions, scripts, resources and license\n unchanged; never reduce it to rewritten instructions. Leave out installed packages and caches,\n and name any file it refers to that you could not get.\n- **Record the source**: list each in a `## Skills` section of `AGENT.md` as\n `- **<skill>**: <when to use it>. Source: <URL or pasted> @ <commit, tag or snapshot date>`.\n- **Adapt outside it**: say in `AGENT.md` when to use each skill and how its result becomes\n this agent's output; paths inside a skill resolve from its folder. Keep the skill folder\n untouched so an update can replace it whole.\n- **Runtime needs**: check every command, package and credential the skill needs on this\n machine. Name what is missing under its bullet and tell the user; never call the agent usable\n while anything is missing, and never copy a key into the folder.\n- **Update and remove**: update only when the user asks \u2014 replace the folder, show the diff and\n change the version. Remove a skill with its folder and bullet. Each agent owns its copies, so\n no change reaches another agent.\n\n## Memory\n\n`docs/kanban/memory/agents/<name>/` is read into every run. Keep none unless
|
|
22864
|
+
write_agent_default = "# Write an agent\n\nAn agent is one folder: `docs/kanban/agents/<name>/AGENT.md`. The folder name is the agent's\nname and the word every flow asks for it by \u2014 lower-case words joined by `-`, matching the\n`name` in its frontmatter. It cannot be a name the board already answers to: one of the\nboard's roles, an agent the command ships, or a folder already in `docs/kanban/agents/`.\n\n## The file\n\n```yaml\n---\n# Required; matches the folder name.\nname: ux-writer\n# Required: one sentence saying what it does.\ndescription: Writes the words a screen shows.\n# Optional.\nakb:\n # Optional, for a preview agent: when to request it, exceptions included. Without it, it\n # always runs.\n when: A card changes what the product says to the user; not a typo.\n # Optional, for a preview agent: it runs only after these agents' previews are approved,\n # when the card requests them too; it never makes them run.\n after: [ui-designer]\n # Optional, for a preview agent: `new` runs it in a session of its own.\n session: new\n # Preview components this agent uses; an empty list loads no component documentation.\n components: [Asset]\n # Optional: a sticker of its deliverable, by glyph name (the Workflow builder lists them),\n # or 1 to 12 parts `{ d, f?, o?: true, s?, w? }`. Without it, a generic file is drawn.\n icon: text\n---\n\nYou write the words a screen shows.\n```\n\nIts workflow, not the agent, sets its role: `WORKFLOW.md` lists it under `previews`, `land`\nor `scheduled`.\n\nA scheduled agent can also name the new input it works on; it then runs only when there is some:\n\n```yaml\nakb:\n # archived-cards | chats | dismissals; omit to run on its cadence alone.\n reads: archived-cards\n```\n\nA land agent that merges code into the target branch declares it; completing its step then\nrequires the merged commit and branch:\n\n```yaml\nakb:\n merges: true\n```\n\nAn agent that shares material with others names the global memories it keeps:\n\n```yaml\nakb:\n # Optional; global memories under `docs/kanban/memory/<name>/`, by name.\n memory: [competitors]\n # Optional; its own memory files, or folders ending in `/`, that hold in any of the user's\n # projects. Everything else is this project's.\n memoryFiles:\n workspace: [style.md]\n```\n\nEverything under the frontmatter is the agent's instructions, read fresh on every run \u2014\na file with none is refused.\n\nAn agent declares no options of its own. Two ways of working is two agents, each with its own\n`AGENT.md` \u2014 a switch that changes how one agent works costs more than it buys.\n\n## Translations\n\n```yaml\nakb:\n # Optional; UI text only. Runs use English; omitted text falls back to English.\n i18n:\n # Language tag; every field below is optional.\n en:\n # Display name, shown as the stage name: name the output, not the role; at most\n # 3 English words or 4 Chinese characters. Does not change the agent's name.\n title: UI copy\n zh:\n title: \u754C\u9762\u6587\u6848\n description: \u64B0\u5199\u754C\u9762\u4E0A\u7684\u6587\u5B57\u3002\n when: \u5361\u7247\u65B0\u589E\u6216\u4FEE\u6539\u754C\u9762\u6587\u5B57\u65F6\u3002\n```\n\n## Files\n\nEvery file beside `AGENT.md`, in any subfolder, is named to the run by its path and opened only\nwhen the work calls for it. Put long material there and keep `AGENT.md` short.\n\n- **Scripts**: every agent owns its task scripts in its own folder, including built-in agents.\n Keep business validation there, outside the CLI's board logic. Document the runtime, inputs\n and invocation beside the script; consumers use the owner's script. Built-in files can be\n saved through `akb raw agent-file <agent> <path>` and run locally with their relative layout\n intact; custom agents use their existing folders.\n\n## Imported skills\n\nAn agent may carry several skills, each whole in its own `skills/<skill>/` folder.\n\n- **Keep the capability**: copy the skill's instructions, scripts, resources and license\n unchanged; never reduce it to rewritten instructions. Leave out installed packages and caches,\n and name any file it refers to that you could not get.\n- **Record the source**: list each in a `## Skills` section of `AGENT.md` as\n `- **<skill>**: <when to use it>. Source: <URL or pasted> @ <commit, tag or snapshot date>`.\n- **Adapt outside it**: say in `AGENT.md` when to use each skill and how its result becomes\n this agent's output; paths inside a skill resolve from its folder. Keep the skill folder\n untouched so an update can replace it whole.\n- **Runtime needs**: check every command, package and credential the skill needs on this\n machine. Name what is missing under its bullet and tell the user; never call the agent usable\n while anything is missing, and never copy a key into the folder.\n- **Update and remove**: update only when the user asks \u2014 replace the folder, show the diff and\n change the version. Remove a skill with its folder and bullet. Each agent owns its copies, so\n no change reaches another agent.\n\n## Memory\n\n`docs/kanban/memory/agents/<name>/` is read into every run. Keep none unless the agent has wide\nlatitude and its mistakes or the user's corrections should change its next output. Otherwise say\nin `AGENT.md`:\n\n- **Files**: each file and what it holds; `## General` for what always holds, and a heading per\n situation (a format, a recipe, a channel) for what holds only there.\n- **When**: which file to apply before which step, and which error-prone points, answers or\n corrections to record.\n- **What goes in**: lasting preferences, decisions and corrections only \u2014 never raw feedback,\n run history, or what the instructions already say.\n- **Shared material**: what other agents also use goes in a global memory under `akb.memory`;\n its rules arrive with every run, so `AGENT.md` never restates them.\n\n## Output\n\nDeclare the preview components the agent uses in `akb.components` (Asset, Compare, Storyboard, Set).\nTheir usage documentation is supplied with the run; omitted declarations default to Asset.\nUse `akb raw components --agent <name> --docs` or `--workflow <id> --docs` to read it.\n\nChoose the form the reader takes in fastest and say it in `AGENT.md`: an image for a look, a\nstoryboard for a sequence over time, readable Markdown for everything else.\n\n## Dependencies\n\n- **In `after`**: name the agents whose approved previews this one needs; it waits for those\n approvals and never requests the agents.\n- **In the instructions**: say what to do when the section it needs is missing or still\n carries an open question \u2014 normally draw nothing and write one line naming what is missing.\n A preview agent never asks for another.\n\n## Instructions\n\nSay what the agent owns, what it produces, and what it leaves alone. Don't repeat the contract\nevery run is pointed to (`akb guide preview-agent`): where the section goes, how to validate,\nhow to keep memory, and how to defer to the user. A scheduled agent says what one run does,\nnever when it runs.\n\n## Work with the user\n\n- **Ask little**: settle what the request, the skill and the board already answer; ask the rest\n as `akb guide update-questions` does, and never ask again what is answered.\n- **State between runs**: ask how a scheduled agent should keep what its next run needs, and\n write the answer into `AGENT.md`; assume no file or format.\n- **Important choices**: give a recommendation and its tradeoff, and accept a free answer.\n- **Show each edit**: when changing an existing agent, show every changed file as a unified\n diff with context, followed by one sentence of reason.\n\n## Check it\n\n- **Validate before finishing**: after creating or editing an agent, run `akb raw previews`. Read all trigger conditions with `akb raw previews --triggers`.\n Fix every problem reported for its file under \"Problems on this board\", then run it again.\n Do not finish until the agent is accepted with no problems reported for it.\n- **`akb raw previews <name> <id> --print`** on a real card prints the whole prompt the agent will get:\n its instructions, the reference for each chosen setting, its files and its memory. Read it, and cut whatever the run does not need.\n- **Workflow**: a new agent belongs to the workflow it was created in and starts switched on;\n a preview agent joins the end of that workflow's `previews`. `akb raw previews` refuses it while it is off.\n Switch it in that workflow's `WORKFLOW.md`.\n- **Schedule**: set `reads` from what the agent works on; it runs automatically by default.\n For a fixed cadence, add `cadence: 1d` to its entry in the workflow's `scheduled`.\n";
|
|
22865
22865
|
}
|
|
22866
22866
|
});
|
|
22867
22867
|
|
|
@@ -23088,7 +23088,7 @@ async function cmdWorkflowPush(folder, opts) {
|
|
|
23088
23088
|
say(`Pushed ${id} v${next}. New tasks take it.`);
|
|
23089
23089
|
return { id, version: next, changed: true };
|
|
23090
23090
|
}
|
|
23091
|
-
function noteText(
|
|
23091
|
+
function noteText({ file, text: text4 }) {
|
|
23092
23092
|
if (file !== void 0 && text4 !== void 0) die("pass --file or --text, not both", "bad-args");
|
|
23093
23093
|
if (file !== void 0) {
|
|
23094
23094
|
try {
|
|
@@ -23097,8 +23097,7 @@ function noteText(what, { file, text: text4 }) {
|
|
|
23097
23097
|
die(`can't read ${file}`, "bad-args");
|
|
23098
23098
|
}
|
|
23099
23099
|
}
|
|
23100
|
-
|
|
23101
|
-
die(`the ${what} have to come from --text or --file`, "bad-args");
|
|
23100
|
+
return text4?.trim();
|
|
23102
23101
|
}
|
|
23103
23102
|
function cloudOk(res) {
|
|
23104
23103
|
if (!res.ok) die(res.error, res.code === "unauthenticated" ? "needs-cloud" : "cloud-refused");
|
|
@@ -23111,7 +23110,7 @@ async function cloudScope() {
|
|
|
23111
23110
|
return { project: project2, workspace: held4.workspace };
|
|
23112
23111
|
}
|
|
23113
23112
|
async function cmdWorkflowRule(name, opts) {
|
|
23114
|
-
const rule = noteText(
|
|
23113
|
+
const rule = noteText(opts);
|
|
23115
23114
|
const { workspace: workspace2 } = await cloudScope();
|
|
23116
23115
|
const held4 = cloudOk(await call("GET", `/v1/workspaces/${enc2(workspace2)}/workflow-rules`));
|
|
23117
23116
|
const flow = held4.workflows.find((w) => workflowName(w.id) === name);
|
|
@@ -23121,19 +23120,26 @@ async function cmdWorkflowRule(name, opts) {
|
|
|
23121
23120
|
workflow: name
|
|
23122
23121
|
});
|
|
23123
23122
|
}
|
|
23123
|
+
if (rule === void 0) {
|
|
23124
|
+
const now = flow.rule ?? "";
|
|
23125
|
+
say(now || `${name} has no rules`);
|
|
23126
|
+
return { workflow: name, rule: now };
|
|
23127
|
+
}
|
|
23124
23128
|
cloudOk(await call("PUT", `/v1/workspaces/${enc2(workspace2)}/workflows/${enc2(flow.id)}/rule`, { rule }));
|
|
23125
23129
|
say(`${rule ? "saved" : "cleared"} the rules of ${name}`);
|
|
23126
23130
|
return { workflow: name, rule };
|
|
23127
23131
|
}
|
|
23128
23132
|
async function cmdWorkflowInstructions(agent, opts) {
|
|
23129
|
-
const rule = noteText(
|
|
23133
|
+
const rule = noteText(opts);
|
|
23130
23134
|
const { project: project2, workspace: workspace2 } = await cloudScope();
|
|
23131
23135
|
const [shared, own] = await Promise.all([
|
|
23132
23136
|
call("GET", `/v1/workspaces/${enc2(workspace2)}/workflow-rules`),
|
|
23133
23137
|
call("GET", `/v1/projects/${enc2(project2)}/agents`)
|
|
23134
23138
|
]);
|
|
23135
|
-
const
|
|
23136
|
-
const
|
|
23139
|
+
const sharedRows = cloudOk(shared).data;
|
|
23140
|
+
const ownRows = cloudOk(own);
|
|
23141
|
+
const flowAgents = sharedRows.map((a) => a.agent);
|
|
23142
|
+
const board2 = ownRows.board;
|
|
23137
23143
|
const scope = board2.includes(agent) ? "project" : flowAgents.includes(agent) ? "workspace" : null;
|
|
23138
23144
|
if (!scope) {
|
|
23139
23145
|
die(`no agent called "${agent}" here. There are: ${[.../* @__PURE__ */ new Set([...flowAgents, ...board2])].join(", ")}.`, {
|
|
@@ -23141,6 +23147,11 @@ async function cmdWorkflowInstructions(agent, opts) {
|
|
|
23141
23147
|
agent
|
|
23142
23148
|
});
|
|
23143
23149
|
}
|
|
23150
|
+
if (rule === void 0) {
|
|
23151
|
+
const now = (scope === "project" ? ownRows.data : sharedRows).find((a) => a.agent === agent)?.rule ?? "";
|
|
23152
|
+
say(now || `${agent} has no instructions`);
|
|
23153
|
+
return { agent, rule: now, scope };
|
|
23154
|
+
}
|
|
23144
23155
|
const route2 = scope === "project" ? `/v1/projects/${enc2(project2)}/agents/${enc2(agent)}` : `/v1/workspaces/${enc2(workspace2)}/agents/${enc2(agent)}`;
|
|
23145
23156
|
cloudOk(await call("PUT", route2, { rule }));
|
|
23146
23157
|
say(rule ? `saved ${agent}'s instructions (${scope === "project" ? "this project" : "every project"})` : `cleared ${agent}'s instructions`);
|
|
@@ -26084,11 +26095,13 @@ function declareRuns(program2, cli) {
|
|
|
26084
26095
|
flowWord("push").argument("<folder>", "a folder `workflow pull` wrote").option("--dry-run", "check the folder and print what would happen, saving nothing").summary("save the edited folder as the workflow's next version, which new tasks take").action(async function(folder) {
|
|
26085
26096
|
await boardless(this, cli, () => cmdWorkflowPush(folder, this.opts()));
|
|
26086
26097
|
});
|
|
26087
|
-
flowWord("rule").argument("<workflow>", "a workflow id from `akb workflow list`").option("--text <text>", "the rules, for a one-liner; empty clears them").option("--file <path>", "the rules, as markdown written to a file first").summary("set a workflow's rules \u2014 what every card on it follows \u2014 in the user's own words").description(
|
|
26098
|
+
flowWord("rule").argument("<workflow>", "a workflow id from `akb workflow list`").option("--text <text>", "the rules, for a one-liner; empty clears them").option("--file <path>", "the rules, as markdown written to a file first").summary("set a workflow's rules \u2014 what every card on it follows \u2014 in the user's own words").description(
|
|
26099
|
+
"Without --text or --file, prints the workflow's current rules. With them, replaces all of them, saved to Cloud for every project in the workspace; empty clears them."
|
|
26100
|
+
).action(async function(id) {
|
|
26088
26101
|
await onBoard2(this, cli, () => cmdWorkflowRule(id, this.opts()));
|
|
26089
26102
|
});
|
|
26090
26103
|
flowWord("instructions").argument("<agent>", "an agent `akb workflow list` names").option("--text <text>", "the instructions, for a one-liner; empty clears them").option("--file <path>", "the instructions, as markdown written to a file first").summary("set one agent's instructions \u2014 appended to every run it does \u2014 in the user's own words").description(
|
|
26091
|
-
"A workflow's agent is the workspace's, shared by every workflow listing it; a board's scheduled agent is this project's. Saved to Cloud; empty clears them."
|
|
26104
|
+
"Without --text or --file, prints the agent's current instructions. With them, replaces all of them. A workflow's agent is the workspace's, shared by every workflow listing it; a board's scheduled agent is this project's. Saved to Cloud; empty clears them."
|
|
26092
26105
|
).action(async function(agent) {
|
|
26093
26106
|
await onBoard2(this, cli, () => cmdWorkflowInstructions(agent, this.opts()));
|
|
26094
26107
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wildcrane",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.34",
|
|
4
4
|
"akbContract": 8,
|
|
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": [
|