@pi-unipi/kanboard 3.0.0-alpha.16 → 3.0.0-alpha.18
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/index.ts +11 -0
- package/package.json +7 -7
- package/skills/kanboard/SKILL.md +19 -10
- package/src/commands.ts +90 -16
- package/src/guard.ts +3 -3
- package/src/monitor.ts +1 -1
- package/src/settings.ts +0 -19
- package/src/shapes.ts +3 -0
package/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
syncPiRuntime,
|
|
45
45
|
runRotateTokenAction,
|
|
46
46
|
runStopDaemon,
|
|
47
|
+
captureToBacklog,
|
|
47
48
|
type CommandDeps,
|
|
48
49
|
} from "./src/commands.js";
|
|
49
50
|
import { createWriteGuard } from "./src/guard.js";
|
|
@@ -224,6 +225,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
224
225
|
registerProgressRenderer(pi);
|
|
225
226
|
registerKanboardCommands(pi, buildDeps());
|
|
226
227
|
|
|
228
|
+
// ── API for other extensions (input-shortcuts K chord) ──────────────
|
|
229
|
+
// Add the editor text to this project's Backlog as a body-only task.
|
|
230
|
+
(globalThis as { __unipi_kanboard_api?: unknown }).__unipi_kanboard_api = {
|
|
231
|
+
captureToBacklog: (opts: { cwd: string; text: string }) => captureToBacklog(buildDeps(), opts),
|
|
232
|
+
};
|
|
233
|
+
|
|
227
234
|
// R1 progress reminders for hand-worked tasks (silent in child sessions).
|
|
228
235
|
registerProgressReminders(
|
|
229
236
|
pi,
|
|
@@ -416,6 +423,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
416
423
|
// cannot release), and release requires a comment — the next run's resume
|
|
417
424
|
// notice keys on it. Best effort: a dead pid is reaped with "session
|
|
418
425
|
// lost" anyway.
|
|
426
|
+
// Children (subagents, fusion sidekicks, kanboard's own helpers) inherit
|
|
427
|
+
// the lead's session id: their shutdown must never release the lead's
|
|
428
|
+
// claims (a finished subagent used to bounce the lead's task to Todo).
|
|
429
|
+
if (isChildProcess() || process.env.UNIPI_KANBOARD_CHILD) return;
|
|
419
430
|
try {
|
|
420
431
|
const session = sessionId();
|
|
421
432
|
const claims = await ownClaims();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/kanboard",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.18",
|
|
4
4
|
"description": "Kanboard v3 — deferred-work board: CLI/daemon bridge, task runner and skill",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@pi-unipi/core": "3.0.0-alpha.
|
|
34
|
+
"@pi-unipi/core": "3.0.0-alpha.18"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@earendil-works/pi-coding-agent": "^0.87.1",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"themes": []
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"@pi-unipi/kanboard-linux-x64": "3.0.0-alpha.
|
|
52
|
-
"@pi-unipi/kanboard-linux-arm64": "3.0.0-alpha.
|
|
53
|
-
"@pi-unipi/kanboard-darwin-x64": "3.0.0-alpha.
|
|
54
|
-
"@pi-unipi/kanboard-darwin-arm64": "3.0.0-alpha.
|
|
55
|
-
"@pi-unipi/kanboard-win32-x64": "3.0.0-alpha.
|
|
51
|
+
"@pi-unipi/kanboard-linux-x64": "3.0.0-alpha.18",
|
|
52
|
+
"@pi-unipi/kanboard-linux-arm64": "3.0.0-alpha.18",
|
|
53
|
+
"@pi-unipi/kanboard-darwin-x64": "3.0.0-alpha.18",
|
|
54
|
+
"@pi-unipi/kanboard-darwin-arm64": "3.0.0-alpha.18",
|
|
55
|
+
"@pi-unipi/kanboard-win32-x64": "3.0.0-alpha.18"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/skills/kanboard/SKILL.md
CHANGED
|
@@ -22,13 +22,13 @@ be on `PATH`):
|
|
|
22
22
|
<binary> --actor agent --project <slug> chain <ID> # upstream deps + downstream dependents
|
|
23
23
|
<binary> --actor agent --project <slug> search "<text>" [--all] # id/title/body, archived excluded unless --all
|
|
24
24
|
<binary> --actor agent --project <slug> add "<title>" [--status todo] [--after <ID>] [--body-file <f>] [--attach <file>]…
|
|
25
|
-
<binary> --actor agent --project <slug> note <ID> "<text>"
|
|
25
|
+
<binary> --actor agent --project <slug> note <ID> "<text>" [--attach <file>]…
|
|
26
26
|
<binary> --actor agent --project <slug> attach <ID> <file> --note "<what it shows>"
|
|
27
27
|
<binary> --actor agent --project <slug> attachments <ID>
|
|
28
28
|
<binary> --actor agent --project <slug> edit <ID> --title|--body|--labels … # only tasks you created, while in backlog/todo
|
|
29
29
|
<binary> --actor agent --project <slug> start <ID> # todo → in progress, claimed for your session (costs a -do slot)
|
|
30
|
-
<binary> --actor agent --project <slug> finish <ID> --comment "<summary>" # in progress → in review, only a task you started (free)
|
|
31
|
-
<binary> --actor agent --project <slug> move <ID> blocked --comment "<what you need>"
|
|
30
|
+
<binary> --actor agent --project <slug> finish <ID> --comment "<summary>" [--attach <file>]… # in progress → in review, only a task you started (free)
|
|
31
|
+
<binary> --actor agent --project <slug> move <ID> blocked --comment "<what you need>" [--attach <file>]…
|
|
32
32
|
<binary> --actor agent --project <slug> link <ID> --after <DEP>
|
|
33
33
|
<binary> --actor agent --project <slug> unlink <ID> --after <DEP>
|
|
34
34
|
<binary> --actor agent --project <slug> order <ID> --top|--bottom|--before <ID>
|
|
@@ -94,9 +94,8 @@ lists them — read the files there directly if you need one.
|
|
|
94
94
|
cannot continue — `move <ID> blocked --comment "<what you need>"`.
|
|
95
95
|
5. **Work only on the task you were given.** Follow-up work goes to the board as
|
|
96
96
|
a new task in Backlog (`add "<title>"`), optionally `link <new> --after <ID>`.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
why. You may
|
|
97
|
+
At most `maxSessions` (default 2) sessions may hold tasks in a project at
|
|
98
|
+
once — if the board refuses a `start`, that is why. You may
|
|
100
99
|
block only the task your own session is running (`move <ID> blocked` checks
|
|
101
100
|
`--session`/`UNIPI_KANBOARD_SESSION` against the claim).
|
|
102
101
|
6. **Sidekicks and subagents can read the board but never write it** — every
|
|
@@ -106,7 +105,14 @@ lists them — read the files there directly if you need one.
|
|
|
106
105
|
ready task in the same session — there is no separate worker.)
|
|
107
106
|
7. Use `note <ID> "<text>"` for progress worth remembering (decisions, what you
|
|
108
107
|
verified, what you left undone) — it is the activity log the next reader sees.
|
|
109
|
-
8.
|
|
108
|
+
8. **Write the `finish` / `blocked` comment as the report the user reads.** It
|
|
109
|
+
is shown as the task's status banner and opens in a reader, rendered as
|
|
110
|
+
markdown. Lead with one plain sentence (what you did, or what stops you),
|
|
111
|
+
then short paragraphs or `-` bullets separated by blank lines; put questions
|
|
112
|
+
for the user as a numbered list under `**Need from you:**`. Name files and
|
|
113
|
+
commands in backticks. Do not repeat a note you already wrote — the report
|
|
114
|
+
replaces it. Attach evidence with `--attach <file>`.
|
|
115
|
+
9. Dependencies form a DAG: a task is ready only when every dep reached the chain
|
|
110
116
|
gate (`in_review` by default, `done` when configured). Cancelled deps block
|
|
111
117
|
forever, so unlink or re-plan instead of waiting. `chain <ID>` shows the
|
|
112
118
|
whole line, `next` shows what would be picked and why others wait.
|
|
@@ -126,6 +132,9 @@ but only to write a summary.)
|
|
|
126
132
|
Users attach screenshots, logs and documents in the board UI; they appear in the
|
|
127
133
|
text as markdown with `att:<ID>/<name>` references, and `show <ID> --json` lists
|
|
128
134
|
them under `attachments` with an absolute `path` — read the file from there
|
|
129
|
-
(use your image-reading tool for images). To hand back evidence
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
(use your image-reading tool for images). To hand back evidence (a screenshot,
|
|
136
|
+
a log, a report), pass `--attach <file>` (repeatable) to `finish`, `move … blocked`
|
|
137
|
+
or `note`, or use `attach <ID> <file> --note "…"`: the file is stored beside the
|
|
138
|
+
board and the comment embeds it, so the user sees the image or file inline. A
|
|
139
|
+
file's path written in the comment is replaced by the embed; otherwise the
|
|
140
|
+
embed is appended. Attaching to a task you started is free.
|
package/src/commands.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { join } from "node:path";
|
|
|
11
11
|
import { promisify } from "node:util";
|
|
12
12
|
|
|
13
13
|
import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext, Theme } from "@earendil-works/pi-coding-agent";
|
|
14
|
+
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
14
15
|
import { getSettings } from "@pi-unipi/core";
|
|
15
16
|
|
|
16
17
|
import { KanboardCliError, type KanboardCli } from "./bin.js";
|
|
@@ -44,7 +45,7 @@ Priority -p: 1 none · 2 low · 3 medium · 4 high · 5 urgent`;
|
|
|
44
45
|
export function doText(slug: string, cli: string, request: string, slots = DEFAULT_DO_TASKS, writes = DEFAULT_DO_WRITES): string {
|
|
45
46
|
const s = slots === 1 ? "" : "s";
|
|
46
47
|
const ws = writes === 1 ? "" : "s";
|
|
47
|
-
return `[kanboard] For this request you may use the kanboard skill on project ${slug} (CLI: \`${cli} --actor agent --project ${slug} …\`). Budget this session: ${String(slots)} task slot${s} — each \`start\` uses one — and ${String(writes)} board write${ws} (add, edit, link, order, move backlog↔todo, note on tasks you don't hold); /unipi:kanboard-do tops both back up. Always free: reads, and \`finish\`, \`move <ID> blocked --comment\` and \`
|
|
48
|
+
return `[kanboard] For this request you may use the kanboard skill on project ${slug} (CLI: \`${cli} --actor agent --project ${slug} …\`). Budget this session: ${String(slots)} task slot${s} — each \`start\` uses one — and ${String(writes)} board write${ws} (add, edit, link, order, move backlog↔todo, note on tasks you don't hold); /unipi:kanboard-do tops both back up. Always free: reads, and \`finish\`, \`move <ID> blocked --comment\`, \`note\` and \`attach\` on tasks you started. Work the tasks yourself in this session, in whatever mode fits: \`start <ID>\` right before you work it, then \`finish <ID> --comment "<summary>"\` or \`move <ID> blocked --comment "<what you need>"\` — never leave a task you started In Progress. Before starting anything, count the tasks this request needs; if that is more than ${String(slots)}, start nothing — tell me you can do ${String(slots)} now and ask whether to raise the limit (setting kanboard.doTasks) or work in batches. Read a task with \`show <ID>\` before editing or starting it — \`list\` only shows titles and a one-line excerpt. Sidekicks and subagents can read the board but not write it: brief them with the task, then update the board yourself from their report. If the request is unclear, ask me instead of guessing.
|
|
48
49
|
|
|
49
50
|
Request: ${request}`;
|
|
50
51
|
}
|
|
@@ -576,15 +577,18 @@ export async function runAdd(deps: CommandDeps, ctx: ExtensionCommandContext, te
|
|
|
576
577
|
ctx.ui.notify(`kanboard: ${parsed.error} — /unipi:kanboard-add [-p 1-5] [--after ID] [--status backlog|todo] <title>`, "warning");
|
|
577
578
|
return;
|
|
578
579
|
}
|
|
579
|
-
|
|
580
|
-
|
|
580
|
+
const hasDescription = parsed.description.trim().length > 0;
|
|
581
|
+
if (!parsed.title && !hasDescription) {
|
|
582
|
+
ctx.ui.notify("kanboard: add needs a title or a description — /unipi:kanboard-add <title> (lines below are the description)", "warning");
|
|
581
583
|
return;
|
|
582
584
|
}
|
|
583
585
|
if (!(await ensureOnboarded(deps, ctx))) return;
|
|
584
586
|
|
|
585
587
|
let bodyFile: string | null = null;
|
|
586
588
|
try {
|
|
587
|
-
|
|
589
|
+
// A description-only add omits the title positional entirely (the binary
|
|
590
|
+
// stores an empty title and derives the display title from the body).
|
|
591
|
+
const argv = ["add", ...(parsed.title ? [parsed.title] : []), ...parsed.flags];
|
|
588
592
|
if (parsed.description) {
|
|
589
593
|
bodyFile = join(mkdtempSync(join(tmpdir(), "kb-add-")), "body.md");
|
|
590
594
|
writeFileSync(bodyFile, parsed.description);
|
|
@@ -606,6 +610,55 @@ export async function runAdd(deps: CommandDeps, ctx: ExtensionCommandContext, te
|
|
|
606
610
|
}
|
|
607
611
|
}
|
|
608
612
|
|
|
613
|
+
export type CaptureToBacklogResult =
|
|
614
|
+
| { ok: true; id: string; attachments: number }
|
|
615
|
+
| { ok: false; reason: string };
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Capture editor text as a Backlog task body — the entry point the
|
|
619
|
+
* input-shortcuts K chord calls through `globalThis.__unipi_kanboard_api`.
|
|
620
|
+
* No title: the body carries the point (the binary derives the display
|
|
621
|
+
* title). No prompts: when the folder is not onboarded the capture is
|
|
622
|
+
* refused with the reason instead.
|
|
623
|
+
*/
|
|
624
|
+
export async function captureToBacklog(
|
|
625
|
+
deps: CommandDeps,
|
|
626
|
+
opts: { cwd: string; text: string },
|
|
627
|
+
): Promise<CaptureToBacklogResult> {
|
|
628
|
+
const client = deps.cli;
|
|
629
|
+
if (!client) return { ok: false, reason: deps.unavailable ?? "kanboard binary unavailable" };
|
|
630
|
+
let slug: string | null = null;
|
|
631
|
+
try {
|
|
632
|
+
const settings = getSettings("kanboard", opts.cwd) as { slug?: string };
|
|
633
|
+
slug = typeof settings.slug === "string" && settings.slug.length > 0 ? settings.slug : null;
|
|
634
|
+
} catch {
|
|
635
|
+
slug = null;
|
|
636
|
+
}
|
|
637
|
+
if (!slug) {
|
|
638
|
+
return { ok: false, reason: "kanboard is not set up here — run /unipi:kanboard" };
|
|
639
|
+
}
|
|
640
|
+
const text = opts.text.trim();
|
|
641
|
+
if (!text) return { ok: false, reason: "nothing to add" };
|
|
642
|
+
const attaches = detectFilePaths(text);
|
|
643
|
+
let bodyFile: string | null = null;
|
|
644
|
+
try {
|
|
645
|
+
bodyFile = join(mkdtempSync(join(tmpdir(), "kb-capture-")), "body.md");
|
|
646
|
+
writeFileSync(bodyFile, text);
|
|
647
|
+
const argv = ["--project", slug, "add", "--status", "backlog", "--body-file", bodyFile];
|
|
648
|
+
for (const file of attaches) argv.push("--attach", file);
|
|
649
|
+
const task = asTask("add", await client.run<unknown>(argv, { cwd: opts.cwd }));
|
|
650
|
+
deps.debug(`captureToBacklog ${task.id} (${attaches.length} attachments)`);
|
|
651
|
+
return { ok: true, id: task.id, attachments: attaches.length };
|
|
652
|
+
} catch (error) {
|
|
653
|
+
return {
|
|
654
|
+
ok: false,
|
|
655
|
+
reason: error instanceof KanboardCliError ? error.message : String(error),
|
|
656
|
+
};
|
|
657
|
+
} finally {
|
|
658
|
+
if (bodyFile) rmSync(join(bodyFile, ".."), { recursive: true, force: true });
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
609
662
|
export async function runStatus(deps: CommandDeps, ctx: ExtensionCommandContext | ExtensionContext): Promise<void> {
|
|
610
663
|
const client = deps.cli;
|
|
611
664
|
const lines: string[] = [];
|
|
@@ -806,6 +859,8 @@ export async function runRotateTokenAction(
|
|
|
806
859
|
interface ShowTask {
|
|
807
860
|
id: string;
|
|
808
861
|
title: string;
|
|
862
|
+
/** Derived title (Rust `display_title`) — shown when `title` is empty. */
|
|
863
|
+
displayTitle?: string;
|
|
809
864
|
status: string;
|
|
810
865
|
priority?: string;
|
|
811
866
|
order?: number;
|
|
@@ -831,6 +886,11 @@ const SHOW_EXTRA_LANES: Array<{ id: string; label: string }> = [
|
|
|
831
886
|
const PRIO_GLYPH: Record<string, string> = { urgent: "⇈", high: "↑", medium: "·", low: "↓", none: " " };
|
|
832
887
|
const PRIO_RANK: Record<string, number> = { urgent: 0, high: 1, medium: 2, low: 3, none: 4 };
|
|
833
888
|
|
|
889
|
+
/** The title a row shows: the derived one when the raw title is empty. */
|
|
890
|
+
function showTitle(task: ShowTask): string {
|
|
891
|
+
return task.displayTitle || task.title || "(untitled)";
|
|
892
|
+
}
|
|
893
|
+
|
|
834
894
|
/** Same ordering as the CLI's claim_sort: priority, then lane order, then id. */
|
|
835
895
|
export function claimOrder(tasks: ShowTask[]): ShowTask[] {
|
|
836
896
|
return [...tasks].sort(
|
|
@@ -875,7 +935,7 @@ function laneRows(tasks: ShowTask[], lane: string): ShowRow[] {
|
|
|
875
935
|
number: `${number}.`,
|
|
876
936
|
id: task.id,
|
|
877
937
|
prio: PRIO_GLYPH[task.priority ?? "none"] ?? " ",
|
|
878
|
-
title: task
|
|
938
|
+
title: showTitle(task),
|
|
879
939
|
extra:
|
|
880
940
|
task.ready === false || waits.length > 0
|
|
881
941
|
? `waits for ${waits.join(", ")}`
|
|
@@ -898,7 +958,7 @@ function laneRows(tasks: ShowTask[], lane: string): ShowRow[] {
|
|
|
898
958
|
branch: "",
|
|
899
959
|
id: task.id,
|
|
900
960
|
prio: PRIO_GLYPH[task.priority ?? "none"] ?? " ",
|
|
901
|
-
title: task
|
|
961
|
+
title: showTitle(task),
|
|
902
962
|
extra:
|
|
903
963
|
lane === "in_progress" && task.run?.session
|
|
904
964
|
? `· ${task.run.session}`
|
|
@@ -952,15 +1012,29 @@ export function showRenderer(
|
|
|
952
1012
|
lines.push(theme.fg("accent", lane.label));
|
|
953
1013
|
for (const row of laneRows(inLane, lane.id)) {
|
|
954
1014
|
const head = ` ${row.branch}${row.number ? `${row.number} ` : ""}${theme.fg("muted", row.id)} ${row.prio} `;
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1015
|
+
const styledExtra = row.extra
|
|
1016
|
+
? ` ${row.tone === "error" ? theme.fg("error", row.extra) : theme.fg("dim", row.extra)}`
|
|
1017
|
+
: "";
|
|
1018
|
+
// Budgets in visible cells (CJK ≈ 2 cells, ANSI = 0 — .length lies on both).
|
|
1019
|
+
// Title takes all the room left after the extra when both fit comfortably,
|
|
1020
|
+
// else it is capped at 10 cells; the extra then takes whatever remains, so a
|
|
1021
|
+
// huge blockedReason is truncated instead of overflowing the terminal (which
|
|
1022
|
+
// hard-crashes pi). Final truncate is the belt-and-braces guarantee.
|
|
1023
|
+
const avail = Math.max(0, width - visibleWidth(head));
|
|
1024
|
+
const extraW = styledExtra ? visibleWidth(styledExtra) : 0;
|
|
1025
|
+
const titleBudget = Math.max(0, avail - extraW >= 10 ? avail - extraW : Math.min(avail, 10));
|
|
1026
|
+
const title = truncateToWidth(row.title, titleBudget, "…");
|
|
1027
|
+
let line = `${head}${title}`;
|
|
1028
|
+
if (styledExtra) {
|
|
1029
|
+
const extraBudget = avail - visibleWidth(title) - 2;
|
|
1030
|
+
if (extraBudget > 0) line += truncateToWidth(styledExtra, extraBudget + 2, "…");
|
|
1031
|
+
}
|
|
1032
|
+
lines.push(line);
|
|
961
1033
|
}
|
|
962
1034
|
}
|
|
963
|
-
|
|
1035
|
+
// Hard guarantee: a line wider than the terminal hard-crashes pi, so every
|
|
1036
|
+
// emitted line — header and lane labels included — is truncated to `width`.
|
|
1037
|
+
return lines.map((line) => truncateToWidth(line, width));
|
|
964
1038
|
},
|
|
965
1039
|
invalidate: () => undefined,
|
|
966
1040
|
};
|
|
@@ -1094,19 +1168,19 @@ export async function taskCompletions(
|
|
|
1094
1168
|
const needle = prefix.toLowerCase();
|
|
1095
1169
|
const items = cache.tasks
|
|
1096
1170
|
.filter((task) => !["cancelled", "archived"].includes(task.status))
|
|
1097
|
-
.filter((task) => task.id.toLowerCase().startsWith(needle) || (titleSearch && task.
|
|
1171
|
+
.filter((task) => task.id.toLowerCase().startsWith(needle) || (titleSearch && showTitle(task).toLowerCase().includes(needle)))
|
|
1098
1172
|
.slice(0, 12)
|
|
1099
1173
|
.map((task) =>
|
|
1100
1174
|
rowStyle === "id-title"
|
|
1101
1175
|
? {
|
|
1102
1176
|
value: fullArgs(before, task.id),
|
|
1103
|
-
label: `${task.id} ${task.
|
|
1177
|
+
label: `${task.id} ${showTitle(task).slice(0, 64)}`,
|
|
1104
1178
|
description: task.status,
|
|
1105
1179
|
}
|
|
1106
1180
|
: {
|
|
1107
1181
|
value: fullArgs(before, task.id),
|
|
1108
1182
|
label: task.id,
|
|
1109
|
-
description: `${task.status} — ${task
|
|
1183
|
+
description: `${task.status} — ${showTitle(task)}`,
|
|
1110
1184
|
},
|
|
1111
1185
|
);
|
|
1112
1186
|
return items.length > 0 ? items : null;
|
package/src/guard.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* writes. A `/unipi:kanboard-do` grants task SLOTS (each `start` uses one)
|
|
6
6
|
* and a WRITE budget (add, edit, link, order, move backlog↔todo, note on
|
|
7
7
|
* tasks you don't hold). Always free: reads, and `finish`, `move <ID>
|
|
8
|
-
* blocked` and `
|
|
8
|
+
* blocked`, `note <ID>` and `attach <ID>` on claims this session started — a started task
|
|
9
9
|
* can always be closed. Autowork lifts both budgets (the runaway guard is
|
|
10
10
|
* the per-turn add cap). In child processes every write is refused: the
|
|
11
11
|
* lead updates the board.
|
|
@@ -282,9 +282,9 @@ export function createWriteGuard(options: WriteGuardOptions = {}): WriteGuard {
|
|
|
282
282
|
const id = firstPositional(invocation)!;
|
|
283
283
|
if (await ownsClaim(id)) continue; // closing your own claim is free
|
|
284
284
|
}
|
|
285
|
-
if (invocation.sub === "note" && firstPositional(invocation) !== undefined) {
|
|
285
|
+
if ((invocation.sub === "note" || invocation.sub === "attach") && firstPositional(invocation) !== undefined) {
|
|
286
286
|
const id = firstPositional(invocation)!;
|
|
287
|
-
if (await ownsClaim(id)) continue; // noting your own claim is free
|
|
287
|
+
if (await ownsClaim(id)) continue; // noting on / attaching to your own claim is free
|
|
288
288
|
}
|
|
289
289
|
if (autowork) continue; // autowork: unlimited slots and writes
|
|
290
290
|
if (invocation.sub === "start") {
|
package/src/monitor.ts
CHANGED
|
@@ -294,7 +294,7 @@ export function createKanboardMonitor(deps: MonitorDeps): KanboardMonitor {
|
|
|
294
294
|
source: "kanboard",
|
|
295
295
|
priority: AUTOWORK_PRIORITY,
|
|
296
296
|
customType: AUTOWORK_NUDGE_CUSTOM_TYPE,
|
|
297
|
-
content: `↻ next ready: ${next.id} ${next.title} — show it, start it, work it (autowork) ${ANTI_POISONING_SUFFIX}`,
|
|
297
|
+
content: `↻ next ready: ${next.id} ${next.displayTitle || next.title || "(untitled)"} — show it, start it, work it (autowork) ${ANTI_POISONING_SUFFIX}`,
|
|
298
298
|
display: true,
|
|
299
299
|
onDelivered: () => {
|
|
300
300
|
offersPerTask.set(next.id, offers); // counts on DELIVERY, not proposal
|
package/src/settings.ts
CHANGED
|
@@ -34,12 +34,6 @@ export interface KanboardSettings {
|
|
|
34
34
|
doTasks: number;
|
|
35
35
|
/** Board writes a /unipi:kanboard-do grants. */
|
|
36
36
|
doWrites: number;
|
|
37
|
-
/** Strategy for unlabelled tasks ("auto" = jev decides, gated by `jevThreshold`). */
|
|
38
|
-
defaultStrategy: "auto" | "none" | "goal" | "ralph" | "swarm" | "graph";
|
|
39
|
-
/** Confidence floor for jev's strategy answer; below it (or missing) the task runs "none". */
|
|
40
|
-
jevThreshold: number;
|
|
41
|
-
/** Plan-first for unlabelled tasks (jev is never asked about plan). */
|
|
42
|
-
defaultPlan: boolean;
|
|
43
37
|
/** Whether a blocked-by-confusion task may ask the user (ask) or must
|
|
44
38
|
* assume-and-note (avoid, the default). */
|
|
45
39
|
blocking: "avoid" | "ask";
|
|
@@ -62,9 +56,6 @@ export const DEFAULT_SETTINGS: KanboardSettings = {
|
|
|
62
56
|
turnAddLimit: 20,
|
|
63
57
|
doTasks: 5,
|
|
64
58
|
doWrites: 10,
|
|
65
|
-
defaultStrategy: "none",
|
|
66
|
-
jevThreshold: 0.8,
|
|
67
|
-
defaultPlan: false,
|
|
68
59
|
blocking: "avoid",
|
|
69
60
|
reminders: true,
|
|
70
61
|
};
|
|
@@ -162,16 +153,6 @@ export function readKanboardSettings(cwd: string = process.cwd()): KanboardSetti
|
|
|
162
153
|
typeof raw.doWrites === "number" && raw.doWrites >= 0 && storedDoWritesSet(cwd)
|
|
163
154
|
? raw.doWrites
|
|
164
155
|
: (storedLegacyDoCredits(cwd) ?? DEFAULT_SETTINGS.doWrites),
|
|
165
|
-
defaultStrategy:
|
|
166
|
-
typeof raw.defaultStrategy === "string" &&
|
|
167
|
-
["auto", "none", "goal", "ralph", "swarm", "graph"].includes(raw.defaultStrategy)
|
|
168
|
-
? (raw.defaultStrategy as KanboardSettings["defaultStrategy"])
|
|
169
|
-
: DEFAULT_SETTINGS.defaultStrategy,
|
|
170
|
-
jevThreshold:
|
|
171
|
-
typeof raw.jevThreshold === "number" && raw.jevThreshold > 0 && raw.jevThreshold <= 1
|
|
172
|
-
? raw.jevThreshold
|
|
173
|
-
: DEFAULT_SETTINGS.jevThreshold,
|
|
174
|
-
defaultPlan: raw.defaultPlan === true,
|
|
175
156
|
blocking: raw.blocking === "ask" ? "ask" : "avoid",
|
|
176
157
|
reminders: raw.reminders !== false,
|
|
177
158
|
};
|
package/src/shapes.ts
CHANGED
|
@@ -45,6 +45,8 @@ export interface KanboardActivity {
|
|
|
45
45
|
export interface KanboardTask {
|
|
46
46
|
id: string;
|
|
47
47
|
title: string;
|
|
48
|
+
/** Title derived from the first body line when `title` is empty (Rust `Task::display_title`). */
|
|
49
|
+
displayTitle?: string;
|
|
48
50
|
body?: string;
|
|
49
51
|
status: string;
|
|
50
52
|
priority?: string;
|
|
@@ -115,6 +117,7 @@ export function asTask(command: string, value: unknown): KanboardTask {
|
|
|
115
117
|
...record,
|
|
116
118
|
id: requireString(command, record, "id"),
|
|
117
119
|
title: requireString(command, record, "title"),
|
|
120
|
+
displayTitle: typeof record.displayTitle === "string" ? record.displayTitle : undefined,
|
|
118
121
|
status: requireString(command, record, "status"),
|
|
119
122
|
deps: optionalArray<string>(record.deps) ?? [],
|
|
120
123
|
activity: optionalArray<KanboardActivity>(record.activity) ?? [],
|