kaizen-agent 1.70.0 → 1.72.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.
Files changed (60) hide show
  1. package/README.md +2 -2
  2. package/cli/annotate-proxy.ts +5 -0
  3. package/cli/automations.ts +10 -3
  4. package/cli/browser.ts +1 -1
  5. package/cli/chat.ts +9 -1
  6. package/cli/chatgpt.ts +2 -1
  7. package/cli/docs.ts +1 -1
  8. package/cli/google.ts +2 -1
  9. package/cli/handoff.ts +1 -1
  10. package/cli/install.ts +63 -17
  11. package/cli/knowledge.ts +1 -1
  12. package/cli/notes.ts +10 -1
  13. package/cli/preflight.ts +149 -0
  14. package/cli/rea.ts +199 -0
  15. package/cli/settings.ts +5 -1
  16. package/cli/sources.ts +3 -2
  17. package/cli/state.ts +43 -5
  18. package/cli/versions.ts +1 -1
  19. package/cli/video.ts +1 -1
  20. package/cli/web.ts +111 -28
  21. package/cli/workers.ts +20 -7
  22. package/cli/worktree.ts +65 -21
  23. package/package.json +1 -1
  24. package/skills/kaizen/SKILL.md +12 -8
  25. package/skills/kaizen/config.default.yml +18 -2
  26. package/skills/kaizen/settings.md +3 -1
  27. package/skills/kaizen/spec-build.md +13 -2
  28. package/skills/kaizen/spec-main.md +15 -0
  29. package/skills/kaizen/spec-plan.md +4 -1
  30. package/skills/kaizen-help/SKILL.md +2 -0
  31. package/skills/media/kaizen-game/SKILL.md +96 -0
  32. package/skills/media/kaizen-game/assets/gdd.css +12 -0
  33. package/skills/media/kaizen-game/references/build.md +81 -0
  34. package/skills/media/kaizen-game/references/content.md +32 -0
  35. package/skills/media/kaizen-game/references/design.md +81 -0
  36. package/skills/media/kaizen-game/references/ship.md +34 -0
  37. package/skills/media/kaizen-game/references/verify.md +33 -0
  38. package/skills/media/kaizen-game/scripts/check.sh +13 -0
  39. package/skills/media/kaizen-game/scripts/frames.mjs +34 -0
  40. package/skills/media/kaizen-game/scripts/gdd-pdf.mjs +19 -0
  41. package/skills/media/kaizen-game/scripts/pw.mjs +18 -0
  42. package/skills/media/kaizen-game/scripts/serve.mjs +53 -0
  43. package/skills/media/kaizen-game/scripts/serve.test.mjs +18 -0
  44. package/skills/media/kaizen-game/scripts/setup.sh +9 -0
  45. package/skills/media/kaizen-game/scripts/smoke.mjs +40 -0
  46. package/skills/media/kaizen-game/skill.json +1 -0
  47. package/web/board/git.ts +23 -6
  48. package/web/board/icebox.ts +6 -3
  49. package/web/board/markdown.ts +7 -2
  50. package/web/board/run-view.ts +1 -1
  51. package/web/board/settings-orchestration.ts +1 -1
  52. package/web/board/settings-pages.ts +1 -0
  53. package/web/board/settings-skills.ts +28 -2
  54. package/web/board/settings.ts +2 -2
  55. package/web/board.html +1 -1
  56. package/web/board.js +96 -82
  57. package/web/notebook.js +1 -1
  58. package/web/term.js +48 -48
  59. package/web/term.ts +16 -4
  60. package/web/video.js +1 -1
@@ -5,7 +5,7 @@ import { toast } from "./toast.ts";
5
5
 
6
6
  // Settings → Skills: one row per bundled skill, grouped. /skills scans the folders, so
7
7
  // a new skill shows here with no change to this file.
8
- type Row = { id: string; title: string; description: string; group: string; off: boolean; agents: { agent: string; state: string }[]; needs: { name: string; found: boolean }[]; offByDefault?: boolean; note?: string; status?: string };
8
+ type Row = { id: string; title: string; description: string; group: string; off: boolean; agents: { agent: string; state: string }[]; needs: { name: string; found: boolean }[]; offByDefault?: boolean; note?: string; status?: string; rea?: { installed: string | null; latest: string | null; update: boolean; outside: boolean } };
9
9
  const GROUPS: [string, string][] = [["core", "Core"], ["media", "Media"], ["optional", "Optional"]];
10
10
  const WORD: Record<string, string> = { installed: "installed", missing: "missing", other: "your own copy" };
11
11
 
@@ -17,7 +17,9 @@ const SKILL_ICONS: Record<string, string> = {
17
17
  "kaizen-book": '<path d="M12 6c-2-1.5-5-2-8-2v15c3 0 6 .5 8 2 2-1.5 5-2 8-2V4c-3 0-6 .5-8 2Z"/><path d="M12 6v15"/>',
18
18
  "kaizen-deck": '<rect x="3" y="4" width="18" height="12" rx="1"/><path d="M12 16v4M8 20h8M8 12l3-3 2 2 3-3"/>',
19
19
  "kaizen-computer": '<rect x="3" y="4" width="18" height="12" rx="1"/><path d="M8 20h8M12 16v4M9 8l5 3-2 .8-.8 2Z"/>',
20
+ "kaizen-game": '<rect x="2" y="7" width="20" height="11" rx="5"/><path d="M7 10.5v4M5 12.5h4"/><circle cx="16" cy="11.5" r=".6"/><circle cx="18" cy="13.5" r=".6"/>',
20
21
  "kaizen-video": '<rect x="3" y="6" width="13" height="12" rx="2"/><path d="m16 10 5-3v10l-5-3"/>',
22
+ rea: '<circle cx="10.5" cy="10.5" r="6"/><path d="m15 15 6 6"/><path d="M8.5 9 7 10.5 8.5 12M12.5 9l1.5 1.5-1.5 1.5"/>',
21
23
  };
22
24
  const PUZZLE = '<path d="M10 4a2 2 0 1 1 4 0v2h5v5h-2a2 2 0 1 0 0 4h2v5H5v-5h2a2 2 0 1 0 0-4H5V6h5Z"/>';
23
25
  const skillIcon = (id: string) => raw(`<svg class="sk-i" viewBox="0 0 24 24" aria-hidden="true">${SKILL_ICONS[id] ?? PUZZLE}</svg>`);
@@ -25,18 +27,42 @@ const skillIcon = (id: string) => raw(`<svg class="sk-i" viewBox="0 0 24 24" ari
25
27
  const row = (s: Row) =>
26
28
  html`<div class="sk" data-q="${[s.title, s.id, s.description, s.group, "skill"].join(" ").toLowerCase()}">
27
29
  <div class="sk-h">${skillIcon(s.id)}<span class="sk-n"><b>${s.title}${s.status && s.status !== "stable" ? html` <em class="sk-st">${s.status === "beta" ? "Beta" : "Experimental"}</em>` : ""}</b><span>${s.description}</span></span>
28
- ${s.group === "core" ? html`<span class="hint">Always on</span>` : html`${!s.off && s.agents.some((a) => a.state === "missing") ? html`<button type="button" class="btn" data-skill="${s.id}" data-on="true">Install</button>` : ""}<button type="button" class="chk sm${s.off ? "" : " on"}" data-skill="${s.id}" data-on="${String(s.off)}" data-warn="${String(!!s.offByDefault)}" role="switch" aria-checked="${String(!s.off)}" aria-label="${s.title}" title="${s.off ? "Off" : "On"}"></button>`}</div>
30
+ ${s.group === "core" ? html`<span class="hint">Always on</span>` : html`${s.rea?.update ? html`<button type="button" class="btn" data-rea-update="1">Update to ${s.rea.latest}</button>` : ""}${!s.rea && !s.off && s.agents.some((a) => a.state === "missing") ? html`<button type="button" class="btn" data-skill="${s.id}" data-on="true">Install</button>` : ""}<button type="button" class="chk sm${s.off ? "" : " on"}" data-skill="${s.id}" data-on="${String(s.off)}" data-warn="${String(!!s.offByDefault)}" role="switch" aria-checked="${String(!s.off)}" aria-label="${s.title}" title="${s.off ? "Off" : "On"}"></button>`}</div>
29
31
  <div class="sk-a">${s.agents.map((a) => html`<img class="sk-ag${a.state === "installed" ? "" : " off"}" src="${AGENT_FAVICONS[AGENT_CMD[a.agent] ?? ""] ?? ""}" width="18" height="18" alt="${a.agent}: ${WORD[a.state] ?? a.state}" title="${a.agent}: ${WORD[a.state] ?? a.state}">`)}${s.needs.map((n) => html`<span class="${n.found ? "" : "miss"}">Needs ${n.name}${n.found ? "" : " (not found)"}</span>`)}${s.note ? html`<span>${s.note}</span>` : ""}</div>
30
32
  </div>`;
31
33
 
32
34
  export const skillRows = (skills: Row[]) =>
33
35
  html`${GROUPS.filter(([g]) => skills.some((s) => s.group === g)).map(([g, label], i) => html`<h3 class="sg">${label}${i ? "" : html` <button type="button" id="sk-recheck">Re-check</button>`}</h3><div class="sgrp">${skills.filter((s) => s.group === g).map(row)}</div>`)}`;
34
36
 
37
+ // REA: the board runs REA's dry run first and shows what would change; only a yes to that
38
+ // exact plan is applied. Off runs REA's own uninstall, whoever set REA up.
39
+ async function reaSwitch(on: boolean, update: boolean, redraw: () => Promise<unknown>) {
40
+ if (!on) {
41
+ if (!confirm("Turn REA off?\n\nThis runs REA's own uninstall: it removes REA's MCP registration and skill from every agent, also a REA you set up yourself outside kaizen. Ghidra, Java and REA's data stay.")) return;
42
+ toast("Removing REA…");
43
+ const j = await post("/rea", { step: "off" });
44
+ if (!j.error) toast(j.hint ? `REA removed. Claude still has one: run ${j.hint}` : "REA removed. Restart your agents");
45
+ return redraw();
46
+ }
47
+ toast(update ? "Checking the newest REA…" : "Asking REA what it would change… (first time downloads REA)");
48
+ const plan = await post("/rea", { step: "plan", update });
49
+ if (plan.error) return redraw();
50
+ const files = plan.files?.length ? plan.files.map((f: string) => " " + f).join("\n") : " (REA did not list files)";
51
+ if (!confirm(`${update ? "Update" : "Set up"} REA ${plan.version} for: ${plan.clients.join(", ")}\n\nREA's setup will change:\n${files}\n\nIt backs each file up first. Agents can then run REA's reverse-engineering tools on files you point them at. Go ahead?`)) return;
52
+ toast(update ? "Updating REA…" : "Setting up REA…");
53
+ const j = await post("/rea", { step: "apply", confirm: true, token: plan.token });
54
+ if (!j.error) toast(`REA ${j.version} is set up. Restart your agents to load its tools`);
55
+ return redraw();
56
+ }
57
+
35
58
  export function wireSkills(redraw: () => Promise<unknown>, token = "") {
36
59
  const again = $("sk-recheck");
37
60
  if (again) again.onclick = () => redraw();
61
+ const up = $("pbody").querySelector<HTMLElement>("[data-rea-update]");
62
+ if (up) up.onclick = () => reaSwitch(true, true, redraw);
38
63
  $("pbody").querySelectorAll<HTMLElement>("[data-skill]").forEach((b) => (b.onclick = async () => {
39
64
  const on = b.dataset.on === "true";
65
+ if (b.dataset.skill === "rea") return reaSwitch(on, false, redraw);
40
66
  // An off-by-default skill gives agents a power the user never had to grant: say so, then ask.
41
67
  const warn = on && b.dataset.warn === "true";
42
68
  if (warn && !confirm("Let agents read and operate the apps on your desktop?\n\nThey see the window text of the apps they open and can click, set values and type in them, as you. A password manager is blocked by its name only, so one inside a browser or under another name is not. Any other open app is in reach. Turn on?")) return;
@@ -139,11 +139,11 @@ export async function openSettings() {
139
139
  // Drawn as chips with the agent list, above the rest of the page.
140
140
  cfg.rows = cfg.rows.filter((r) => !(r.key === "agent.default" && ap));
141
141
  // A model row only for a tool on this machine.
142
- if (ap) cfg.rows = cfg.rows.filter((r) => !r.key.startsWith("agent.model.") || ap.agents.some((a) => a.installed && r.key.endsWith("." + a.cmd)));
142
+ if (ap) cfg.rows = cfg.rows.filter((r) => !/^agent\.(model|handoff_model)\./.test(r.key) || ap.agents.some((a) => a.installed && r.key.endsWith("." + a.cmd)));
143
143
  for (const r of cfg.rows) {
144
144
  const id = "s-" + r.key.replace(/\./g, "-");
145
145
  const [page, sub] = placeOf(r.key);
146
- const wm = /^(orchestration\.worker_model|agent\.model)\./.test(r.key);
146
+ const wm = /^(orchestration\.worker_model|agent\.model|agent\.handoff_model)\./.test(r.key);
147
147
  put(page, sub + (scoped && r.group === "Board" ? " · all projects" : ""), row(
148
148
  wm ? modelLabel(r) : r.label,
149
149
  r.text
package/web/board.html CHANGED
@@ -400,7 +400,7 @@ section li.hint{display:block;padding:14px;border:1px dashed var(--line);border-
400
400
  .gdis .gpath{padding:var(--gap) var(--padx);border:1px solid var(--line);border-radius:var(--r-xs);font:var(--fs-s) var(--mono);overflow-wrap:anywhere}
401
401
  .gitp .gmsgbox{position:relative}.gitp .gmsgbox textarea{padding-right:32px}.gitp .gspark{position:absolute;top:var(--gap);right:var(--gap);color:var(--dim)}.gitp .gspark:hover{color:var(--accent)}.gitp .gspark.spin svg{animation:gspin 1s linear infinite}@keyframes gspin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.gitp .gspark.spin svg{animation:none}}
402
402
  .gdis .gpath{white-space:pre-wrap;max-height:180px;overflow:auto}
403
- .gdis .row{display:flex;justify-content:flex-end;gap:var(--gap)}.gdis .btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}.gdis .btn.danger:hover{filter:brightness(1.08)}.gdis .btn{display:inline-flex;align-items:center;gap:var(--gap)}
403
+ .gdis .row{display:flex;justify-content:flex-end;gap:var(--gap)}.gdis .btn.danger,body.runv .gdis .btn.danger:not(.pri){background:var(--danger);border-color:var(--danger);color:#fff}.gdis .btn.danger:hover{filter:brightness(1.08)}.gdis .btn{display:inline-flex;align-items:center;gap:var(--gap)}
404
404
  .inl .row .mic{margin-right:0}.inl .row #newpick{margin-right:auto}.inl .row .btn{white-space:nowrap}.inl .att{font-size:12px;color:var(--dim)}.inl .att{font-size:12px;color:var(--dim)}.inl .att:empty{display:none}
405
405
  /* first-run onboarding: one panel, three steps (see web/board/onboarding.ts) */
406
406
  dialog.onb{border:1px solid var(--line);padding:0;background:var(--bg);color:var(--ink);width:min(720px,calc(100vw - 32px));height:min(740px,calc(100dvh - 32px));border-radius:var(--r-l);box-shadow:var(--shadow-2);overflow:hidden}