kaizen-agent 1.79.1 → 1.81.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/cli/hermes.ts +20 -0
- package/cli/install.ts +20 -1
- package/cli/localsend.ts +61 -4
- package/cli/report.ts +7 -4
- package/cli/settings.ts +2 -8
- package/cli/state.ts +19 -3
- package/cli/task-results.ts +133 -0
- package/cli/task-service.ts +179 -0
- package/cli/tasks.ts +201 -0
- package/cli/ui-audit.allow.json +6 -0
- package/cli/ui-audit.ts +427 -0
- package/cli/web.ts +72 -1
- package/cli/whatsapp.ts +112 -0
- package/package.json +2 -1
- package/skills/kaizen/SKILL.md +4 -0
- package/skills/kaizen/adapters.md +4 -0
- package/skills/kaizen/spec-build.md +5 -1
- package/skills/kaizen/spec-main.md +4 -0
- package/skills/kaizen/spec-plan.md +4 -0
- package/skills/kaizen/spec-review.md +4 -0
- package/skills/kaizen/spec.md +52 -0
- package/web/board/add-project.ts +1 -1
- package/web/board/badge.ts +70 -8
- package/web/board/cards.ts +12 -4
- package/web/board/dom.ts +10 -0
- package/web/board/icebox.ts +2 -2
- package/web/board/keys.ts +1 -1
- package/web/board/live.ts +9 -5
- package/web/board/phone.ts +4 -3
- package/web/board/rich.ts +4 -2
- package/web/board/run-view.ts +16 -14
- package/web/board/settings-automations.ts +2 -2
- package/web/board/settings-skills.ts +2 -2
- package/web/board/settings.ts +12 -14
- package/web/board/task-page.ts +590 -0
- package/web/board/task-results.ts +232 -0
- package/web/board/tasks.ts +216 -200
- package/web/board/terms.ts +17 -2
- package/web/board/views.ts +35 -9
- package/web/board/whatsapp-setup.ts +137 -0
- package/web/board/workspace.ts +25 -2
- package/web/board/zoom.ts +90 -0
- package/web/board.html +139 -40
- package/web/board.js +355 -141
- package/web/notebook.js +367 -153
- package/web/notes.html +16 -11
- package/web/term.js +1 -1
- package/web/video.html +22 -11
- package/web/video.js +401 -187
- package/web/video.ts +5 -5
- package/web/board/new-agent.ts +0 -20
package/web/board/run-view.ts
CHANGED
|
@@ -8,11 +8,10 @@
|
|
|
8
8
|
// kzTerm mounts on /pty that live as long as their tab, so a tab switch or a /state tick never
|
|
9
9
|
// reconnects them. Split right or down shows a second tab beside the first, sized with the
|
|
10
10
|
// Terminal page's handles.
|
|
11
|
-
import { chooseAgentPermissions } from "./new-agent.ts";
|
|
12
11
|
import { pick } from "./projects.ts";
|
|
13
12
|
import { store } from "./store.ts";
|
|
14
13
|
import { toast } from "./toast.ts";
|
|
15
|
-
import { $, html, ico, raw } from "./dom.ts";
|
|
14
|
+
import { $, html, ico, raw, toggleSwitch } from "./dom.ts";
|
|
16
15
|
import { key } from "./cards.ts";
|
|
17
16
|
import { open } from "./panel.ts";
|
|
18
17
|
import { termLoad } from "./agent-term.ts";
|
|
@@ -247,14 +246,16 @@ function draw() {
|
|
|
247
246
|
const dflt = agents.find((a) => a.cmd === defAgent);
|
|
248
247
|
// Agents first, the default on top, then the tools.
|
|
249
248
|
const agentRow = (a) => html`<button data-n="agent:${a.cmd}">${mark(a)}<span>${a.name}<small>${a === dflt ? "default agent, in this folder" : "the agent alone, no run"}</small></span></button>`;
|
|
250
|
-
|
|
249
|
+
// Bypass for this launch, on top of the agents. It starts from Settings → Agents → Permissions (the default agent's) and resets each time the menu opens.
|
|
250
|
+
const yolo = agents.some((a) => a.yolo) ? html`<label class="agent-yolo"><span>Bypass permissions<small>run commands without asking</small></span>${toggleSwitch(!!(dflt ?? agents[0]).bypassDefault, { sm: true, box: true, attrs: { "aria-label": "Bypass permissions" } })}</label>` : "";
|
|
251
|
+
const menu = html`<div class="menu-pop">${PTY && agents.length ? html`${yolo}${agentRow(dflt ?? agents[0])}${agents.filter((a) => a !== (dflt ?? agents[0])).map(agentRow)}<hr>` : ""}${PTY ? html`<button data-n="shell">${ico("term")}<span>Shell<small>a terminal in this folder</small></span></button>` : ""}<button data-n="local">${ico("link")}<span>Browser<small>localhost pages, e.g. the dev server</small></span></button><button data-n="preview">${ico("eye")}<span>Preview<small>the run's Preview</small></span></button><button data-n="history">${ico("note")}<span>History<small>finished runs in this workspace</small></span></button></div>`;
|
|
251
252
|
$("rtabs").innerHTML = String(
|
|
252
253
|
html`${scs.map((sc) => {
|
|
253
254
|
const ids = leaves(sc.tree),
|
|
254
255
|
first = item(ids[0]),
|
|
255
256
|
title = ids.map((id) => item(id).title).join(" + ");
|
|
256
257
|
return html`<button class="rtab${sc.id === s.on ? " on" : ""}" data-t="${sc.id}" draggable="true" title="${title}">${icon(first)}<span>${title}</span><i data-xs="${sc.id}" role="button" aria-label="Close ${title}" title="Close tab">×</i></button>`;
|
|
257
|
-
})}<details class="radd" data-mode="tab"><summary class="
|
|
258
|
+
})}<details class="radd" data-mode="tab"><summary class="ib xs" title="New tab" aria-label="New tab">${ico("plus")}</summary>${menu}</details><button type="button" class="ib xs" data-pv title="Run app: start the dev server if it is off and open the app" aria-label="Run app">${ico("play")}</button><span class="sp"></span>${cur ? html`<details class="radd rsplit" data-mode="cols"><summary class="ib xs" title="Split right: add to this tab" aria-label="Split right">${ico("lcols")}</summary>${menu}</details><details class="radd rsplit" data-mode="rows"><summary class="ib xs" title="Split down: add to this tab" aria-label="Split down">${ico("lrows")}</summary>${menu}</details>` : ""}`,
|
|
258
259
|
);
|
|
259
260
|
$("rside").setAttribute("aria-pressed", String(document.body.classList.contains("rflip")));
|
|
260
261
|
$("rtabs").querySelector(".rtab.on")?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
@@ -667,11 +668,9 @@ async function openAgent(c, again = false, focus = true) {
|
|
|
667
668
|
else draw();
|
|
668
669
|
}
|
|
669
670
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
if (choice === null || ctx !== target) return;
|
|
674
|
-
const r = await fetch("/shell", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ dir: ctx!.dir, ws: ctx!.ws, run: ctx!.k, ...(agent ? { agent, yolo: choice } : {}) }) });
|
|
671
|
+
// `yolo` only when the + menu's switch was flipped; otherwise the server applies that agent's saved setting.
|
|
672
|
+
async function newPty(agent?: string, yolo?: boolean) {
|
|
673
|
+
const r = await fetch("/shell", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ dir: ctx!.dir, ws: ctx!.ws, run: ctx!.k, ...(agent ? { agent, yolo } : {}) }) });
|
|
675
674
|
if (r.status === 501) {
|
|
676
675
|
noPty = true;
|
|
677
676
|
return draw();
|
|
@@ -690,7 +689,7 @@ async function newPty(agent?: string) {
|
|
|
690
689
|
show("sh:" + sh.key);
|
|
691
690
|
}
|
|
692
691
|
|
|
693
|
-
// The Preview
|
|
692
|
+
// The Run app button (play icon; the + menu's Preview is the run's Preview tab): the workspace's app in the Browser tab. A dev server already listening
|
|
694
693
|
// opens at once; otherwise the board starts the folder's dev script in a terminal here, waits
|
|
695
694
|
// for its port, then opens it. No dev script: the run's Preview (report and screenshots).
|
|
696
695
|
let starting = false;
|
|
@@ -792,11 +791,11 @@ function onMoveMenu(e: Event) {
|
|
|
792
791
|
}
|
|
793
792
|
|
|
794
793
|
// + makes a new tab; split right/down adds to the tab shown. `n` is a menu item's data-n.
|
|
795
|
-
function openNew(n: string, mode: string) {
|
|
794
|
+
function openNew(n: string, mode: string, yolo?: boolean) {
|
|
796
795
|
const s = saved();
|
|
797
796
|
target = mode === "tab" || !s.on ? null : { screen: s.on, dir: mode as "cols" | "rows" };
|
|
798
797
|
if (n === "shell") void newPty();
|
|
799
|
-
else if (n.startsWith("agent:")) void newPty(n.slice(6));
|
|
798
|
+
else if (n.startsWith("agent:")) void newPty(n.slice(6), yolo);
|
|
800
799
|
else if (n === "local") addTab({ id: "local", kind: "local", title: "Browser" });
|
|
801
800
|
else if (n === "history") addTab({ id: "history", kind: "history", title: "History" });
|
|
802
801
|
else openPreview();
|
|
@@ -826,9 +825,10 @@ function wire() {
|
|
|
826
825
|
if (t.closest("[data-pv]")) return void previewApp();
|
|
827
826
|
const n = t.closest<HTMLElement>("[data-n]")?.dataset.n;
|
|
828
827
|
if (n) {
|
|
829
|
-
const d = t.closest<HTMLDetailsElement>(".radd")
|
|
828
|
+
const d = t.closest<HTMLDetailsElement>(".radd")!,
|
|
829
|
+
sw = d.querySelector<HTMLInputElement>(".agent-yolo input");
|
|
830
830
|
d.open = false;
|
|
831
|
-
openNew(n, d.dataset.mode as string);
|
|
831
|
+
openNew(n, d.dataset.mode as string, sw && sw.checked !== sw.defaultChecked ? sw.checked : undefined);
|
|
832
832
|
return;
|
|
833
833
|
}
|
|
834
834
|
};
|
|
@@ -843,6 +843,8 @@ function wire() {
|
|
|
843
843
|
add.ontoggle = () => {
|
|
844
844
|
if (!add.open) return;
|
|
845
845
|
for (const o of adds) if (o !== add) o.open = false;
|
|
846
|
+
const sw = add.querySelector<HTMLInputElement>(".agent-yolo input");
|
|
847
|
+
if (sw) sw.checked = sw.defaultChecked;
|
|
846
848
|
const m = add.querySelector<HTMLElement>(".menu-pop")!,
|
|
847
849
|
r = add.querySelector("summary")!.getBoundingClientRect(),
|
|
848
850
|
box = $("runv").getBoundingClientRect();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { post } from "./api.ts";
|
|
2
|
-
import { $, html, raw } from "./dom.ts";
|
|
2
|
+
import { $, html, raw, toggleSwitch } from "./dom.ts";
|
|
3
3
|
import { toast } from "./toast.ts";
|
|
4
4
|
|
|
5
5
|
// Settings → Workflows → Automations: schedules that start a run in this project. /automations
|
|
@@ -22,7 +22,7 @@ const row = (r: Rule) => html`<div class="sk" data-q="${["automation", r.name, r
|
|
|
22
22
|
<button type="button" class="btn" data-auto="run" data-id="${r.id}">Run now</button>
|
|
23
23
|
<button type="button" class="btn" data-auto="edit" data-id="${r.id}">Edit</button>
|
|
24
24
|
<button type="button" class="btn" data-auto="delete" data-id="${r.id}">Delete</button>
|
|
25
|
-
|
|
25
|
+
${toggleSwitch(r.enabled, { sm: true, attrs: { "data-auto": r.enabled ? "pause" : "resume", "data-id": r.id, "aria-label": r.name, title: r.enabled ? "On" : "Paused" } })}</div>
|
|
26
26
|
<div class="sk-a"><span>${r.text.length > 140 ? r.text.slice(0, 140) + "…" : r.text}</span></div>
|
|
27
27
|
${r.history.length ? html`<details class="sk-a"><summary>History (${r.history.length})</summary><ul>${r.history.map(hist)}</ul></details>` : ""}
|
|
28
28
|
</div>`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AGENT_FAVICONS } from "./agent-favicons.ts";
|
|
2
2
|
import { post } from "./api.ts";
|
|
3
|
-
import { $, html, raw } from "./dom.ts";
|
|
3
|
+
import { $, html, raw, toggleSwitch } from "./dom.ts";
|
|
4
4
|
import { toast } from "./toast.ts";
|
|
5
5
|
|
|
6
6
|
// Settings → Skills: one row per bundled skill, grouped. /skills scans the folders, so
|
|
@@ -27,7 +27,7 @@ const skillIcon = (id: string) => raw(`<svg class="sk-i" viewBox="0 0 24 24" ari
|
|
|
27
27
|
const row = (s: Row) =>
|
|
28
28
|
html`<div class="sk" data-q="${[s.title, s.id, s.description, s.group, "skill"].join(" ").toLowerCase()}">
|
|
29
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>
|
|
30
|
-
${s.group === "core" ? (s.agents.some((a) => a.state !== "installed") ? html`<button type="button" class="btn" data-repair="${s.id}" data-own="${String(s.agents.some((a) => a.state === "other"))}">Repair</button>` : 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>` : ""}
|
|
30
|
+
${s.group === "core" ? (s.agents.some((a) => a.state !== "installed") ? html`<button type="button" class="btn" data-repair="${s.id}" data-own="${String(s.agents.some((a) => a.state === "other"))}">Repair</button>` : 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>` : ""}${toggleSwitch(!s.off, { sm: true, attrs: { "data-skill": s.id, "data-on": String(s.off), "data-warn": String(!!s.offByDefault), "aria-label": s.title, title: s.off ? "Off" : "On" } })}`}</div>
|
|
31
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>
|
|
32
32
|
</div>`;
|
|
33
33
|
|
package/web/board/settings.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { termStop } from "./agent-term.ts";
|
|
|
3
3
|
import { dirHeader, load, post } from "./api.ts";
|
|
4
4
|
import { stopDictation } from "./dictation.ts";
|
|
5
5
|
import { FONT_MAX, FONT_MIN, fontRead, fontSet } from "../term-font.ts";
|
|
6
|
-
import { $, html, ico, raw } from "./dom.ts";
|
|
6
|
+
import { $, html, ico, raw, toggleSwitch } from "./dom.ts";
|
|
7
7
|
import { close } from "./panel.ts";
|
|
8
8
|
import { accountRows, wireAccounts } from "./settings-accounts.ts";
|
|
9
9
|
import { agentRows, wireAgents } from "./settings-agents.ts";
|
|
@@ -12,6 +12,7 @@ import { cleanupRows, wireCleanup } from "./settings-cleanup.ts";
|
|
|
12
12
|
import { automationRows, wireAutomations } from "./settings-automations.ts";
|
|
13
13
|
import { skillRows, wireSkills } from "./settings-skills.ts";
|
|
14
14
|
import { mountPhone } from "./phone-setup.ts";
|
|
15
|
+
import { mountWhatsApp } from "./whatsapp-setup.ts";
|
|
15
16
|
import { fillMics, micRow } from "./settings-voice.ts";
|
|
16
17
|
import { placeOf, SETTINGS_NAV } from "./settings-pages.ts";
|
|
17
18
|
import { askNotify, notifyOn, playSound, soundPick, SOUNDS, toast } from "./toast.ts";
|
|
@@ -97,7 +98,7 @@ export async function openSettings() {
|
|
|
97
98
|
.map((v) => html`<button id="${id}-${v}" data-v="${v}" class="${v === on ? "on" : ""}" aria-pressed="${String(v === on)}">${v}</button>`)}</span>`;
|
|
98
99
|
if (vals.length === 2 && vals.includes("true") && vals.includes("false")) {
|
|
99
100
|
const yes = on === "true";
|
|
100
|
-
return
|
|
101
|
+
return toggleSwitch(yes, { sm: true, attrs: { id, "data-v": yes ? "false" : "true", title: yes ? "On" : "Off" } });
|
|
101
102
|
}
|
|
102
103
|
// Short choices sit side by side, joined, as Orca's do; a long list keeps the stepper.
|
|
103
104
|
if (vals.every((v) => /^\d+$/.test(v)) || (vals.length <= 5 && vals.every((v) => v) && vals.join("").length <= 32))
|
|
@@ -106,16 +107,9 @@ export async function openSettings() {
|
|
|
106
107
|
return html`<span class="step" id="${id}" role="group" aria-labelledby="${id}-l"><button id="${id}-prev" aria-label="Previous">‹</button><output aria-live="polite">${on === "" ? "—" : on}</output><button id="${id}-next" aria-label="Next">›</button></span>`;
|
|
107
108
|
};
|
|
108
109
|
// `off`: the row has no effect while another setting stands as it is; dimmed, still editable.
|
|
109
|
-
const onOff = (v) => (v === "true" ? "on" : v === "false" ? "off" : v === "" ? "—" : v);
|
|
110
110
|
const scoped = cfg && cfg.scope !== "all";
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
const scopeNote = (r, id) =>
|
|
114
|
-
r.own
|
|
115
|
-
? html`Set for this project · <button class="sreset" id="${id}-reset" type="button">Reset</button>`
|
|
116
|
-
: r.overrides?.length
|
|
117
|
-
? r.overrides.map((o) => `${o.label}: ${onOff(o.value)}`).join(", ")
|
|
118
|
-
: "";
|
|
111
|
+
// A Reset for a value this project sets itself.
|
|
112
|
+
const scopeNote = (r, id) => (r.own ? html`Set for this project · <button class="sreset" id="${id}-reset" type="button">Reset</button>` : "");
|
|
119
113
|
const row = (label, control, hint, id, q, off = false) =>
|
|
120
114
|
html`<div class="srow${off ? " off" : ""}" data-q="${q.toLowerCase()}"><label for="${id}" id="${id}-l">${label}</label>${control}${hint ? html`<p class="hint">${hint}</p>` : ""}</div>`;
|
|
121
115
|
const hadFocus = document.activeElement?.id === "sq";
|
|
@@ -164,7 +158,10 @@ export async function openSettings() {
|
|
|
164
158
|
}
|
|
165
159
|
}
|
|
166
160
|
put("voice", "Dictation", row("Microphone", micRow(), "Used by this browser. Names appear after you first allow the microphone. Ctrl+Alt+D dictates into the focused terminal.", "v-mic", "microphone input device mic dictation shortcut"));
|
|
167
|
-
put("mobile", "Phone", html
|
|
161
|
+
put("mobile", "Phone", html`
|
|
162
|
+
<div class="srow ph-card" data-q="phone mobile tailscale qr connect address setup"><div id="phset"></div></div>
|
|
163
|
+
<div class="srow ph-card" style="margin-top:16px" data-q="whatsapp phone mobile qr message send"><div id="waset"></div></div>
|
|
164
|
+
`);
|
|
168
165
|
put("integrations", "Google", row("OAuth client id", html`<input class="sel" id="gg-id" placeholder="${gg.hasClient ? "Saved. Paste a new one to replace it" : "Desktop app client id from Google Cloud"}" spellcheck="false" autocomplete="off">`, "", "gg-id", "google oauth client id sheets write back"));
|
|
169
166
|
put("integrations", "Google", row("OAuth client secret", html`<span class="fpick"><input class="sel" id="gg-secret" type="password" placeholder="${gg.hasClient ? "Saved. Paste a new one to replace it" : ""}" spellcheck="false" autocomplete="off"><button class="btn" id="gg-save" type="button">Save</button></span>`, "", "gg-secret", "google oauth client secret"));
|
|
170
167
|
// Firecrawl for `kaizen search` / `kaizen scrape`: the key goes in, only its last four come back.
|
|
@@ -196,8 +193,8 @@ export async function openSettings() {
|
|
|
196
193
|
put("appearance", "Browser", row("Color", ctl("co", ["monochrome", "blue"], colour), "", "co", "color colour palette monochrome blue theme browser"));
|
|
197
194
|
put("appearance", "Browser", row("Motion", ctl("mo", ["system", "full", "reduce"], document.documentElement.dataset.motion || "system"), "Animations across kaizen. System follows the device's reduce-motion setting.", "mo", "motion animation reduce reduced browser"));
|
|
198
195
|
put("terminal", "Browser", row("Terminal font size", html`<input id="tf" class="sel" style="width:80px" type="number" min="${String(FONT_MIN)}" max="${String(FONT_MAX)}" value="${String(fontRead())}" aria-label="Terminal font size in pixels">`, "In every board terminal. Ctrl+= and Ctrl+- change it from a terminal, Ctrl+0 resets it.", "tf", "terminal font size text zoom browser"));
|
|
199
|
-
put("notifications", "Browser", row("Notifications",
|
|
200
|
-
put("notifications", "Browser", row("Haptic feedback",
|
|
196
|
+
put("notifications", "Browser", row("Notifications", toggleSwitch(nton, { sm: true, attrs: { id: "nt" } }), ntHelp, "nt", "notifications " + ntHelp + " browser"));
|
|
197
|
+
put("notifications", "Browser", row("Haptic feedback", toggleSwitch(hapton, { sm: true, attrs: { id: "hp" } }), "A light tick when you tap something on a phone.", "hp", "haptic feedback vibrate vibration touch tap phone browser"));
|
|
201
198
|
put("notifications", "Browser", row("Notification sound", ctl("ns", SOUNDS, soundPick()), "Plays with each notice. Changing it plays it.", "ns", "notification sound audio browser " + SOUNDS.join(" "), !nton));
|
|
202
199
|
// A narrow screen starts on the list of pages, a wide one on the first page.
|
|
203
200
|
store.setPage ??= new URLSearchParams(location.search).get("page") || "";
|
|
@@ -285,6 +282,7 @@ export async function openSettings() {
|
|
|
285
282
|
fillMics();
|
|
286
283
|
if (ac) wireAccounts(openSettings);
|
|
287
284
|
if ($("phset")) void mountPhone($("phset"));
|
|
285
|
+
if ($("waset")) void mountWhatsApp($("waset"));
|
|
288
286
|
filter();
|
|
289
287
|
$("smain").scrollTop = top;
|
|
290
288
|
if (hadFocus) {
|