kaizen-agent 1.64.0 → 1.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +10 -10
  2. package/agents/kaizen-planner.md +2 -2
  3. package/cli/backlog.test.ts +1 -1
  4. package/cli/board.test.ts +24 -24
  5. package/cli/dashboard.ts +15 -15
  6. package/cli/install.ts +6 -3
  7. package/cli/notes.test.ts +3 -3
  8. package/cli/notes.ts +1 -1
  9. package/cli/settings.ts +5 -5
  10. package/cli/sources.test.ts +32 -32
  11. package/cli/sources.ts +15 -15
  12. package/cli/state.test.ts +74 -51
  13. package/cli/state.ts +69 -48
  14. package/cli/web.ts +53 -33
  15. package/commands/kaizen-discover.md +1 -1
  16. package/package.json +1 -1
  17. package/skills/kaizen/README.md +2 -2
  18. package/skills/kaizen/SKILL.md +2 -2
  19. package/skills/kaizen/config.default.yml +22 -22
  20. package/skills/kaizen/discover.md +8 -8
  21. package/skills/kaizen/gather.md +2 -2
  22. package/skills/kaizen/spec-plan.md +1 -1
  23. package/skills/kaizen/spec.md +1 -1
  24. package/skills/kaizen-help/SKILL.md +2 -2
  25. package/web/board/api.ts +10 -10
  26. package/web/board/cards.ts +46 -46
  27. package/web/board/icebox.ts +14 -14
  28. package/web/board/keys.ts +3 -3
  29. package/web/board/labels.ts +2 -2
  30. package/web/board/live.ts +3 -3
  31. package/web/board/main.ts +1 -1
  32. package/web/board/markdown.ts +1 -1
  33. package/web/board/panel.ts +17 -17
  34. package/web/board/phone.ts +7 -7
  35. package/web/board/projects.ts +6 -6
  36. package/web/board/run-view.ts +5 -5
  37. package/web/board/search.ts +11 -11
  38. package/web/board/settings-cleanup.ts +42 -0
  39. package/web/board/settings-pages.ts +1 -1
  40. package/web/board/settings.ts +13 -0
  41. package/web/board/store.ts +1 -1
  42. package/web/board/{ideas.ts → tasks.ts} +22 -22
  43. package/web/board/terms.ts +3 -3
  44. package/web/board/views.ts +23 -12
  45. package/web/board/workspace.ts +7 -7
  46. package/web/board/ws-board-ui.ts +1 -1
  47. package/web/board/ws-board.test.ts +1 -1
  48. package/web/board/ws-board.ts +1 -1
  49. package/web/board/ws-tabs.test.ts +2 -2
  50. package/web/board/ws-tabs.ts +2 -2
  51. package/web/board.html +33 -33
  52. package/web/board.js +101 -101
  53. package/web/notebook.js +17 -17
  54. package/web/notebook.ts +5 -5
  55. package/web/notes-lib.ts +2 -2
  56. package/web/notes.html +11 -11
  57. package/web/term-font.test.ts +22 -0
  58. package/web/term-font.ts +30 -0
  59. package/web/term.js +38 -38
  60. package/web/term.ts +13 -2
  61. package/web/video.html +11 -11
  62. package/web/video.js +24 -24
package/web/notebook.ts CHANGED
@@ -249,14 +249,14 @@ function boardTarget(l: BoardLink) {
249
249
  const q = (o: Record<string, string>) => "/?" + new URLSearchParams({ all: "1", dir, ...o }).toString();
250
250
  if (l.kind === "idea") {
251
251
  const t = l.text.toLowerCase();
252
- const idea =
252
+ const task =
253
253
  board.ideas.find((i) => i.text.toLowerCase() === t) ??
254
254
  board.ideas.find((i) => i.text.toLowerCase().startsWith(t));
255
255
  return {
256
- name: idea?.text ?? l.text,
256
+ name: task?.text ?? l.text,
257
257
  sub: "idea",
258
- status: idea?.status ?? "",
259
- href: idea ? q({ idea: idea.text }) : null,
258
+ status: task?.status ?? "",
259
+ href: task ? q({ idea: task.text }) : null,
260
260
  };
261
261
  }
262
262
  const id = resolveRun(
@@ -626,7 +626,7 @@ function slash(cx: CompletionContext) {
626
626
  };
627
627
  }
628
628
 
629
- // `[[` offers notes, runs and ideas; `#` after a run offers its tabs, findings and
629
+ // `[[` offers notes, runs and tasks; `#` after a run offers its tabs, findings and
630
630
  // backlog items. Picking one closes the link unless it is a run, which leaves the
631
631
  // cursor before `]]` so a `#` can follow.
632
632
  function links(cx: CompletionContext) {
package/web/notes-lib.ts CHANGED
@@ -47,8 +47,8 @@ export type BoardLink =
47
47
  | { kind: "run"; id: string; tab?: (typeof TABS)[number]; item?: { type: "finding" | "backlog"; n: number } }
48
48
  | { kind: "idea"; text: string };
49
49
  export function boardLink(w: Pick<Wikilink, "name" | "anchor" | "target">): BoardLink | null {
50
- const idea = /^idea:\s*(.+)$/i.exec(w.target);
51
- if (idea) return { kind: "idea", text: idea[1]!.trim() };
50
+ const task = /^idea:\s*(.+)$/i.exec(w.target);
51
+ if (task) return { kind: "idea", text: task[1]!.trim() };
52
52
  const run = /^run:\s*([\w.-]+)$/i.exec(w.name);
53
53
  if (!run) return null;
54
54
  const a = w.anchor.toLowerCase(),
package/web/notes.html CHANGED
@@ -88,16 +88,17 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
88
88
  body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;bottom:calc(68px + env(safe-area-inset-bottom))}}
89
89
  .rail a.it[data-n]{position:relative}.rail a.it[data-n]::after{content:attr(data-n);position:absolute;left:24px;top:3px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--dim);color:var(--bg);font:600 10px/16px var(--font);text-align:center;box-shadow:0 0 0 2px var(--bg)}
90
90
  @media(max-width:640px){body .rail a.it[data-n]::after{left:calc(50% + 4px);top:2px}}
91
- .rail a.it:is([data-view=board],[data-view=ideas])[data-n]::after{left:auto;right:8px;top:6px;background:var(--warn)}
92
- [data-rail=min] .rail a.it:is([data-view=board],[data-view=ideas])[data-n]::after{left:24px;right:auto;top:3px}
93
- @media(max-width:640px){[data-rail=min] .rail a.it:is([data-view=board],[data-view=ideas])[data-n]::after{left:calc(50% + 4px);top:2px}}
94
- /* the rail's Projects list: ideas and runs grouped by project, each with its state icon */
91
+ .rail a.it:is([data-view=board],[data-view=tasks])[data-n]::after{left:auto;right:8px;top:6px;background:var(--warn)}
92
+ [data-rail=min] .rail a.it:is([data-view=board],[data-view=tasks])[data-n]::after{left:24px;right:auto;top:3px}
93
+ @media(max-width:640px){[data-rail=min] .rail a.it:is([data-view=board],[data-view=tasks])[data-n]::after{left:calc(50% + 4px);top:2px}}
94
+ /* the rail's Projects list: tasks and runs grouped by project, each with its state icon */
95
95
  .rail a.it .n{margin-left:auto;font-size:var(--fs-xs);font-weight:400;color:var(--dim)}
96
96
  .rail a.it .srcs+.n{margin-left:8px}.rail a.it .srcs{margin-left:auto;display:flex;gap:4px;opacity:.75}.rail a.it .srcs svg,.rail a.it .srcs img{width:13px;height:13px}
97
97
  .rail a.it,.rail .theme,.rail .theme button{border-radius:4px}
98
98
  .rail .psec{display:flex;align-items:center;gap:2px;margin:14px 0 2px;padding-left:var(--padx);font-size:var(--fs-xs);font-weight:600;color:var(--dim)}.rail .psec .lbl{flex:1}
99
99
  .rail .psec button,.rail .rib{width:var(--btn-xs);height:var(--btn-xs);display:grid;place-items:center;flex:none;border-radius:4px;color:var(--dim)}.rail .psec button:hover,.rail .rib:hover{background:var(--hover);color:var(--ink)}.rail .psec button svg,.rail .rib svg{width:var(--ico);height:var(--ico)}
100
100
  .rail .psec button[aria-pressed=true]{color:var(--accent)}.rail .psec button{position:relative}.rail .psec button[aria-pressed=true]::after{content:"";position:absolute;right:3px;top:3px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
101
+ .rail .psec a.pbd{width:var(--btn-xs);height:var(--btn-xs);display:grid;place-items:center;flex:none;border-radius:4px;color:var(--dim)}.rail .psec a.pbd:hover{background:var(--hover);color:var(--ink)}.rail .psec a.pbd[aria-current=page]{color:var(--accent)}
101
102
  .pfpop{position:fixed;z-index:40;min-width:220px;max-width:280px;max-height:60vh;overflow:auto;padding:6px;display:flex;flex-direction:column;gap:1px;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);border-radius:4px;box-shadow:var(--shadow-2);font-size:12.5px}
102
103
  .pfpop .sel{margin:2px 2px 6px;padding:5px 8px;border-radius:4px}.pfrow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:4px;cursor:pointer;white-space:nowrap}.pfrow:hover{background:var(--hover)}.pfrow input{accent-color:var(--accent);margin:0}.pfrow .plogo{width:16px;height:16px;font-size:9px;border-radius:4px;display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover)}.pfrow img.plogo{background:none}
103
104
  .pfall{display:flex;align-items:center;gap:2px}.pfall .pfrow{flex:1;min-width:0}.pfb{all:unset;display:grid;place-items:center;width:24px;height:24px;flex:none;border-radius:4px;cursor:pointer;color:var(--dim)}.pfb:hover{background:var(--hover);color:var(--ink)}.pfb:focus-visible{outline:2px solid var(--accent)}
@@ -131,12 +132,12 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
131
132
  [data-rail=min] .rail a.it .n,[data-rail=min] .rail a.it .srcs,[data-rail=min] .rail .rib:not(.th),[data-rail=min] .plist .proj :not(.plogo),[data-rail=min] .plist .row div,[data-rail=min] .plist .wcount{display:none}
132
133
  [data-rail=min] .rail .psec{padding:0;margin:12px 0 2px;flex-direction:column}[data-rail=min] .rail .rbot{flex-direction:column}
133
134
  [data-rail=min] .plist .proj{justify-content:center;margin:10px 0 4px;padding:0}[data-rail=min] .plist .row{grid-template-columns:14px;justify-content:center;padding:0}
134
- @media(max-width:640px){.rail .psec,.rail .plist,.rail .rib{display:none}.rail .rbot,[data-rail=min] .rail .rbot{display:contents}.rail a.it[data-view=ideas]{order:3}.rail a.it[data-view=board]{order:4}.rail a.it .n,.rail a.it .srcs{display:none}}
135
- /* phones: Home, Chat, Runs, Settings. The board, Ideas and the Icebox are set up on a computer (web/board/phone.ts) */
135
+ @media(max-width:640px){.rail .psec,.rail .plist,.rail .rib{display:none}.rail .rbot,[data-rail=min] .rail .rbot{display:contents}.rail a.it[data-view=tasks]{order:3}.rail a.it[data-view=board]{order:4}.rail a.it .n,.rail a.it .srcs{display:none}}
136
+ /* phones: Home, Chat, Runs, Settings. The board, Tasks and the Icebox are set up on a computer (web/board/phone.ts) */
136
137
  @media(min-width:641px){.rail .rbot .lbl{display:none}.rail .rbot a.it{flex:none;width:var(--btn-xs);height:var(--btn-xs);padding:0;justify-content:center;margin-right:auto}[data-rail=min] .rail .rbot a.it{width:var(--btn-s);height:var(--btn-s);margin-right:0}}
137
138
  .rail a.it.ponly,#phome{display:none}
138
139
  @media(max-width:640px){
139
- .rail a.it:is([data-view=board],[data-view=ideas],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
140
+ .rail a.it:is([data-view=board],[data-view=tasks],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
140
141
  .rail a.it.ponly{display:flex}
141
142
  .rail a.it[data-view=home]{order:1}.rail a.it[data-view=chat]{order:2}.rail a.it[data-view=device]{order:3}.rail a.it[data-view=settings]{order:4}
142
143
  .rail,[data-rail=min] .rail{padding:8px 8px max(2px,calc(env(safe-area-inset-bottom) - 8px));border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
@@ -345,11 +346,10 @@ select.sel{cursor:pointer;appearance:none;padding-right:30px;max-width:min(320px
345
346
  <a class="it ponly" href="/?view=chat" data-view="chat" title="Chat with kaizen's agent"><svg><use href="#r-chat"/></svg><span class="lbl">Chat</span></a>
346
347
  <a class="it ponly" href="/?view=device" data-view="device" title="This computer's runs"><svg><use href="#r-runs"/></svg><span class="lbl">Runs</span></a>
347
348
  <a class="it fold" href="/?view=icebox" data-view="sources" title="Icebox: requests gathered from your sources"><svg><use href="#r-tray"/></svg><span class="lbl">Icebox</span><span class="srcs" id="rail-srcs"></span><span class="n" id="ice-n"></span></a>
348
- <a class="it" href="/?view=ideas" data-view="ideas" title="Ideas: every idea and run, filtered"><svg><use href="#r-bulb"/></svg><span class="lbl">Ideas</span></a>
349
- <a class="it" href="/?view=board" data-view="board" title="Board"><svg><use href="#i-board"/></svg><span class="lbl">Board</span></a>
349
+ <a class="it" href="/?view=tasks" data-view="tasks" title="Tasks: every task and run, filtered"><svg><use href="#r-bulb"/></svg><span class="lbl">Tasks</span></a>
350
350
  <a class="it" href="/?setup=1" id="rsetup" hidden title="Continue setup"><span class="ring"></span><span class="lbl">Setup</span></a>
351
- <div class="psec"><span class="lbl">Projects</span><button id="pfilter" title="Show one project" aria-label="Show one project"><svg><use href="#r-filter"/></svg></button><button id="padd" title="Add project or workspace" aria-label="Add project or workspace"><svg><use href="#r-plus"/></svg></button></div>
352
- <div class="plist" id="plist" aria-label="Ideas and runs by project"></div>
351
+ <div class="psec"><span class="lbl">Projects</span><a class="pbd" href="/?view=board" data-view="board" title="Board" aria-label="Board"><svg><use href="#i-board"/></svg></a><button id="pfilter" title="Show one project" aria-label="Show one project"><svg><use href="#r-filter"/></svg></button><button id="padd" title="Add project or workspace" aria-label="Add project or workspace"><svg><use href="#r-plus"/></svg></button></div>
352
+ <div class="plist" id="plist" aria-label="Tasks and runs by project"></div>
353
353
  <div class="rbot"><a class="it fold" href="/?view=settings" data-view="settings" title="Settings" aria-label="Settings"><svg><use href="#i-gear"/></svg><span class="lbl">Settings</span></a><a class="rib" href="/issue" target="_blank" rel="noopener" title="Report an issue" aria-label="Report an issue"><svg><use href="#r-bug"/></svg></a><button class="rib" id="kbd" title="Keyboard shortcuts" aria-label="Keyboard shortcuts"><svg><use href="#r-kbd"/></svg></button><button class="rib th" id="themet" title="Theme" aria-label="Theme"><svg class="sun"><use href="#i-sun"/></svg><svg class="moon"><use href="#i-moon"/></svg></button></div>
354
354
  </nav>
355
355
  <script>
@@ -0,0 +1,22 @@
1
+ import { expect, test } from "bun:test";
2
+ import { FONT_BASE, FONT_MAX, FONT_MIN, fontStep } from "./term-font.ts";
3
+
4
+ const key = (code: string, mods = {}) => ({ code, shiftKey: false, altKey: false, ctrlKey: true, metaKey: false, ...mods });
5
+
6
+ test("font keys step within the bounds", () => {
7
+ expect(fontStep(12, key("Equal"))).toBe(13);
8
+ expect(fontStep(12, key("Equal", { shiftKey: true }))).toBe(13);
9
+ expect(fontStep(12, key("Minus", { shiftKey: true }))).toBe(11);
10
+ expect(fontStep(12, key("Minus"))).toBe(11);
11
+ expect(fontStep(FONT_MAX, key("Equal"))).toBe(FONT_MAX);
12
+ expect(fontStep(FONT_MIN, key("Minus", { shiftKey: true }))).toBe(FONT_MIN);
13
+ expect(fontStep(20, key("Digit0"))).toBe(FONT_BASE);
14
+ expect(fontStep(12, key("Equal", { ctrlKey: false, metaKey: true }))).toBe(13);
15
+ });
16
+
17
+ test("other keys stay with the terminal", () => {
18
+ expect(fontStep(12, key("Minus", { altKey: true }))).toBeNull();
19
+ expect(fontStep(12, key("Equal", { ctrlKey: false }))).toBeNull();
20
+ expect(fontStep(12, key("Equal", { altKey: true }))).toBeNull();
21
+ expect(fontStep(12, key("KeyA"))).toBeNull();
22
+ });
@@ -0,0 +1,30 @@
1
+ // The board terminals' font size, one per browser. Its own module so the bounds are testable
2
+ // without xterm and Settings can share them without loading the terminal bundle.
3
+ export const FONT_MIN = 8;
4
+ export const FONT_MAX = 24;
5
+ export const FONT_BASE = 12;
6
+
7
+ export function fontRead(): number {
8
+ try {
9
+ const n = Number(localStorage.getItem("kz-term-font"));
10
+ if (Number.isInteger(n) && n >= FONT_MIN && n <= FONT_MAX) return n;
11
+ } catch {}
12
+ return FONT_BASE;
13
+ }
14
+
15
+ // Every mounted terminal listens for the event, so the size holds across tiles and panes.
16
+ export function fontSet(n: number) {
17
+ try {
18
+ localStorage.setItem("kz-term-font", String(n));
19
+ } catch {}
20
+ dispatchEvent(new CustomEvent("kz-term-font", { detail: n }));
21
+ }
22
+
23
+ // The size a key leads to, or null when the key is not a font key.
24
+ export function fontStep(size: number, e: { code: string; shiftKey: boolean; altKey: boolean; ctrlKey: boolean; metaKey: boolean }): number | null {
25
+ if (e.altKey || !(e.ctrlKey || e.metaKey)) return null;
26
+ if (e.code === "Equal") return Math.min(FONT_MAX, size + 1);
27
+ if (e.code === "Minus") return Math.max(FONT_MIN, size - 1);
28
+ if (e.code === "Digit0" && !e.shiftKey) return FONT_BASE;
29
+ return null;
30
+ }