kaizen-agent 1.24.0 → 1.26.0
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 +19 -242
- package/agents/kaizen-reviewer.md +3 -1
- package/cli/build-web.ts +16 -9
- package/cli/chatgpt.test.ts +44 -0
- package/cli/chatgpt.ts +175 -0
- package/cli/install.ts +27 -6
- package/cli/notes.test.ts +4 -4
- package/cli/pty.test.ts +133 -0
- package/cli/pty.ts +111 -0
- package/cli/settings.ts +5 -1
- package/cli/sources.test.ts +170 -25
- package/cli/sources.ts +153 -29
- package/cli/state.ts +33 -6
- package/cli/web.ts +175 -21
- package/commands/kaizen-discover.md +5 -0
- package/commands/kaizen-gather.md +1 -1
- package/package.json +4 -2
- package/skills/kaizen/README.md +1 -0
- package/skills/kaizen/SKILL.md +6 -2
- package/skills/kaizen/config.default.yml +17 -0
- package/skills/kaizen/discover.md +50 -0
- package/skills/kaizen/gather.md +22 -7
- package/skills/kaizen/settings.md +4 -1
- package/skills/kaizen/spec-build.md +4 -1
- package/skills/kaizen/spec-review.md +3 -1
- package/skills/kaizen/spec.md +2 -1
- package/skills/kaizen-help/SKILL.md +2 -1
- package/web/board.html +358 -103
- package/web/notebook.js +1 -1
- package/web/notes.html +16 -14
- package/web/term.css +285 -0
- package/web/term.js +39 -0
- package/web/term.ts +46 -0
package/web/term.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// The in-card terminal: xterm.js on the board's /pty WebSocket. Bundled into
|
|
2
|
+
// web/term.js by `bun run build:web`; board.html loads it the first time a card's
|
|
3
|
+
// Terminal tab opens and calls window.kzTerm(el, key).
|
|
4
|
+
import { Terminal } from "@xterm/xterm";
|
|
5
|
+
import { FitAddon } from "@xterm/addon-fit";
|
|
6
|
+
|
|
7
|
+
function mountTerm(el: HTMLElement, key: string, onEnd?: () => void): () => void {
|
|
8
|
+
const css = getComputedStyle(el);
|
|
9
|
+
const tok = (n: string) => css.getPropertyValue(n).trim() || undefined;
|
|
10
|
+
const term = new Terminal({
|
|
11
|
+
cursorBlink: true,
|
|
12
|
+
fontFamily: tok("--mono"),
|
|
13
|
+
fontSize: 12,
|
|
14
|
+
scrollback: 5000,
|
|
15
|
+
theme: { background: tok("--bg"), foreground: tok("--ink-hi"), cursor: tok("--accent"), selectionBackground: tok("--line") },
|
|
16
|
+
});
|
|
17
|
+
const fit = new FitAddon();
|
|
18
|
+
term.loadAddon(fit);
|
|
19
|
+
term.open(el);
|
|
20
|
+
|
|
21
|
+
const ws = new WebSocket(`${location.protocol === "https:" ? "wss" : "ws"}://${location.host}/pty?key=${encodeURIComponent(key)}`);
|
|
22
|
+
const send = (m: object) => { if (ws.readyState === WebSocket.OPEN) ws.send(JSON.stringify(m)); };
|
|
23
|
+
const size = () => {
|
|
24
|
+
if (!el.offsetWidth) return;
|
|
25
|
+
fit.fit();
|
|
26
|
+
send({ t: "r", c: term.cols, r: term.rows });
|
|
27
|
+
};
|
|
28
|
+
ws.onopen = size;
|
|
29
|
+
ws.onmessage = (e) => term.write(String(e.data));
|
|
30
|
+
// The board closes with "ended" when the agent exits; anything else is the board gone.
|
|
31
|
+
ws.onclose = (e) => { term.write(`\r\n\x1b[2m[${e.reason === "ended" ? "agent ended" : "connection to the board lost"}]\x1b[0m\r\n`); onEnd?.(); };
|
|
32
|
+
const typed = term.onData((d) => send({ t: "i", d }));
|
|
33
|
+
const ro = new ResizeObserver(size);
|
|
34
|
+
ro.observe(el);
|
|
35
|
+
term.focus();
|
|
36
|
+
|
|
37
|
+
return () => {
|
|
38
|
+
ro.disconnect();
|
|
39
|
+
typed.dispose();
|
|
40
|
+
ws.onclose = null;
|
|
41
|
+
ws.close();
|
|
42
|
+
term.dispose();
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
(window as any).kzTerm = mountTerm;
|