kaizen-agent 1.63.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.
- package/README.md +10 -10
- package/agents/kaizen-planner.md +2 -2
- package/cli/backlog.test.ts +1 -1
- package/cli/board.test.ts +24 -24
- package/cli/dashboard.ts +15 -15
- package/cli/handoff.test.ts +133 -0
- package/cli/handoff.ts +122 -0
- package/cli/install.ts +31 -5
- package/cli/notes.test.ts +3 -3
- package/cli/notes.ts +1 -1
- package/cli/pty.ts +16 -2
- package/cli/resources.test.ts +50 -0
- package/cli/resources.ts +113 -0
- package/cli/restart.test.ts +28 -1
- package/cli/settings.ts +8 -5
- package/cli/sources.test.ts +32 -32
- package/cli/sources.ts +15 -15
- package/cli/state.test.ts +74 -51
- package/cli/state.ts +77 -49
- package/cli/usage.test.ts +11 -0
- package/cli/web.ts +139 -38
- package/cli/workers.ts +11 -4
- package/cli/worktree.test.ts +174 -1
- package/cli/worktree.ts +190 -35
- package/commands/kaizen-discover.md +1 -1
- package/package.json +1 -1
- package/skills/kaizen/README.md +2 -2
- package/skills/kaizen/SKILL.md +2 -2
- package/skills/kaizen/config.default.yml +32 -22
- package/skills/kaizen/discover.md +8 -8
- package/skills/kaizen/gather.md +2 -2
- package/skills/kaizen/settings.md +3 -0
- package/skills/kaizen/spec-build.md +13 -0
- package/skills/kaizen/spec-main.md +13 -0
- package/skills/kaizen/spec-plan.md +1 -1
- package/skills/kaizen/spec.md +1 -1
- package/skills/kaizen-help/SKILL.md +2 -2
- package/web/board/api.ts +10 -10
- package/web/board/cards.ts +47 -46
- package/web/board/git.ts +4 -4
- package/web/board/icebox.ts +14 -14
- package/web/board/keys.ts +3 -3
- package/web/board/labels.ts +2 -2
- package/web/board/live.ts +3 -3
- package/web/board/main.ts +1 -1
- package/web/board/markdown.ts +1 -1
- package/web/board/panel.ts +17 -17
- package/web/board/phone.ts +10 -12
- package/web/board/projects.ts +6 -6
- package/web/board/resources.ts +152 -0
- package/web/board/run-view.ts +5 -5
- package/web/board/search.ts +11 -11
- package/web/board/settings-cleanup.ts +42 -0
- package/web/board/settings-pages.ts +1 -1
- package/web/board/settings.ts +13 -0
- package/web/board/store.ts +1 -1
- package/web/board/{ideas.ts → tasks.ts} +22 -22
- package/web/board/terms.ts +3 -3
- package/web/board/views.ts +23 -12
- package/web/board/workspace.ts +9 -7
- package/web/board/ws-board-ui.ts +1 -1
- package/web/board/ws-board.test.ts +1 -1
- package/web/board/ws-board.ts +1 -1
- package/web/board/ws-tabs.test.ts +10 -2
- package/web/board/ws-tabs.ts +10 -9
- package/web/board.html +46 -34
- package/web/board.js +107 -97
- package/web/notebook.js +22 -22
- package/web/notebook.ts +5 -5
- package/web/notes-lib.ts +2 -2
- package/web/notes.html +12 -11
- package/web/term-font.test.ts +22 -0
- package/web/term-font.ts +30 -0
- package/web/term.js +38 -38
- package/web/term.ts +13 -2
- package/web/video.html +12 -11
- package/web/video.js +48 -48
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
|
|
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:
|
|
256
|
+
name: task?.text ?? l.text,
|
|
257
257
|
sub: "idea",
|
|
258
|
-
status:
|
|
259
|
-
href:
|
|
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
|
|
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
|
|
51
|
-
if (
|
|
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=
|
|
92
|
-
[data-rail=min] .rail a.it:is([data-view=board],[data-view=
|
|
93
|
-
@media(max-width:640px){[data-rail=min] .rail a.it:is([data-view=board],[data-view=
|
|
94
|
-
/* the rail's Projects list:
|
|
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)}
|
|
@@ -121,6 +122,7 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
|
|
|
121
122
|
.si.review{box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--warn) 35%,transparent);animation:si-spin 1.6s linear infinite}
|
|
122
123
|
.si.review::after{content:"";position:absolute;width:4px;height:4px;border-radius:50%;background:var(--warn);top:-1px;left:4px;box-shadow:0 0 4px var(--warn)}
|
|
123
124
|
.si.wait{background:var(--warn)}.si.wait::after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--warn);animation:si-ping 1.6s cubic-bezier(0,0,.2,1) infinite}
|
|
125
|
+
.si.fail{background:var(--danger)}.si.fail::after{content:"!";position:absolute;inset:0;color:#fff;font:700 9px/12px system-ui;text-align:center}.mk.bad{color:var(--danger);font-weight:600}
|
|
124
126
|
.si.done{background:var(--ok)}.si.done::after{content:"";position:absolute;left:4.2px;top:2px;width:2.5px;height:5.5px;border:solid var(--bg);border-width:0 1.6px 1.6px 0;transform:rotate(45deg)}
|
|
125
127
|
.si.stalled{background:var(--danger)}.si.stalled::after{content:"";position:absolute;left:3.5px;top:3.5px;width:5px;height:5px;background:linear-gradient(90deg,var(--bg) 0 1.6px,transparent 0 3.4px,var(--bg) 0)}
|
|
126
128
|
.si.aband{box-shadow:inset 0 0 0 1.5px var(--dim);opacity:.5}
|
|
@@ -130,12 +132,12 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
|
|
|
130
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}
|
|
131
133
|
[data-rail=min] .rail .psec{padding:0;margin:12px 0 2px;flex-direction:column}[data-rail=min] .rail .rbot{flex-direction:column}
|
|
132
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}
|
|
133
|
-
@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=
|
|
134
|
-
/* phones: Home, Chat, Runs, Settings. The board,
|
|
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) */
|
|
135
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}}
|
|
136
138
|
.rail a.it.ponly,#phome{display:none}
|
|
137
139
|
@media(max-width:640px){
|
|
138
|
-
.rail a.it:is([data-view=board],[data-view=
|
|
140
|
+
.rail a.it:is([data-view=board],[data-view=tasks],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
|
|
139
141
|
.rail a.it.ponly{display:flex}
|
|
140
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}
|
|
141
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)}
|
|
@@ -344,11 +346,10 @@ select.sel{cursor:pointer;appearance:none;padding-right:30px;max-width:min(320px
|
|
|
344
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>
|
|
345
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>
|
|
346
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>
|
|
347
|
-
<a class="it" href="/?view=
|
|
348
|
-
<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>
|
|
349
350
|
<a class="it" href="/?setup=1" id="rsetup" hidden title="Continue setup"><span class="ring"></span><span class="lbl">Setup</span></a>
|
|
350
|
-
<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>
|
|
351
|
-
<div class="plist" id="plist" aria-label="
|
|
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>
|
|
352
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>
|
|
353
354
|
</nav>
|
|
354
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
|
+
});
|
package/web/term-font.ts
ADDED
|
@@ -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
|
+
}
|