kaizen-agent 1.84.0 → 1.85.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/accounts.ts +1 -1
- package/cli/add-project.ts +1 -1
- package/cli/phone-setup.ts +1 -1
- package/cli/state.ts +22 -0
- package/cli/ui-audit.ts +1 -1
- package/cli/web.ts +31 -10
- package/package.json +1 -1
- package/web/board/home-ws.ts +254 -0
- package/web/board/main.ts +2 -0
- package/web/board/onboarding.ts +1 -1
- package/web/board/phone-setup.ts +1 -1
- package/web/board/run-view.ts +12 -10
- package/web/board/search.ts +1 -1
- package/web/board/settings-accounts.ts +1 -1
- package/web/board/settings-automations.ts +1 -1
- package/web/board/settings-cleanup.ts +1 -1
- package/web/board/settings-pages.ts +33 -24
- package/web/board/settings.ts +31 -40
- package/web/board/views.ts +1 -1
- package/web/board/whatsapp-setup.ts +1 -1
- package/web/board/workspace.ts +89 -8
- package/web/board/ws-tabs.ts +15 -0
- package/web/board.html +59 -27
- package/web/board.js +205 -201
- package/web/notebook.js +136 -132
- package/web/notes.html +3 -1
- package/web/term.js +56 -56
- package/web/term.ts +63 -13
- package/web/video.html +3 -1
- package/web/video.js +236 -232
|
@@ -1,50 +1,59 @@
|
|
|
1
|
-
// Settings' sidebar, grouped as
|
|
2
|
-
//
|
|
1
|
+
// Settings' sidebar, grouped as macOS System Settings is: short groups of pages, each with
|
|
2
|
+
// its icon tile. Only the page knows this: a setting's `group` in cli/settings.ts still
|
|
3
|
+
// decides its scope and the TUI's headings.
|
|
3
4
|
export type SettingsPage = { id: string; title: string; desc: string; ico: string };
|
|
4
5
|
export const SETTINGS_NAV: [string, SettingsPage[]][] = [
|
|
5
|
-
["
|
|
6
|
+
["App", [
|
|
7
|
+
{ id: "general", title: "General", desc: "About kaizen, storage, folders and how the app opens.", ico: "gear" },
|
|
8
|
+
{ id: "appearance", title: "Appearance", desc: "Theme, color and motion in this browser.", ico: "sun" },
|
|
9
|
+
{ id: "notifications", title: "Notifications", desc: "Notices and sounds in this browser.", ico: "inbox" },
|
|
10
|
+
{ id: "keyboard", title: "Keyboard & Dictation", desc: "Shortcuts, and speech-to-text dictation run in the browser.", ico: "kbd" },
|
|
11
|
+
{ id: "terminal", title: "Terminal", desc: "Board terminals and the terminal dashboard.", ico: "term" },
|
|
12
|
+
]],
|
|
13
|
+
["Agents", [
|
|
6
14
|
{ id: "agents", title: "Agents", desc: "Manage AI agents, set a default, and customize commands.", ico: "ai" },
|
|
7
|
-
{ id: "
|
|
8
|
-
{ id: "
|
|
15
|
+
{ id: "models", title: "Models", desc: "The model each agent runs its stages and handoff sessions on.", ico: "mem" },
|
|
16
|
+
{ id: "accounts", title: "AI Accounts", desc: "Who is signed in to each AI tool kaizen runs. Add accounts only to switch between more than one.", ico: "link" },
|
|
9
17
|
{ id: "skills", title: "Skills", desc: "What your agents can do. Changes apply to new sessions.", ico: "note" },
|
|
10
|
-
{ id: "voice", title: "Voice", desc: "Speech-to-text dictation, run in the browser.", ico: "mic" },
|
|
11
|
-
]],
|
|
12
|
-
["Set Up", [
|
|
13
|
-
{ id: "general", title: "General", desc: "Which settings you are editing, folders, and maintenance.", ico: "gear" },
|
|
14
|
-
{ id: "integrations", title: "Integrations", desc: "Request sources, your Google account, and web research.", ico: "link" },
|
|
15
|
-
{ id: "mobile", title: "Mobile", desc: "Open kaizen from your phone.", ico: "send" },
|
|
16
18
|
]],
|
|
17
|
-
["
|
|
19
|
+
["Workflow", [
|
|
20
|
+
{ id: "runs", title: "Runs", desc: "How a run is carried out: who builds, who reviews, and what it remembers.", ico: "play" },
|
|
18
21
|
{ id: "approvals", title: "Approvals", desc: "Where a run stops and waits for you.", ico: "check" },
|
|
19
22
|
{ id: "autofix", title: "Auto-fix", desc: "What happens to review findings.", ico: "bug" },
|
|
23
|
+
{ id: "orchestration", title: "Orchestration", desc: "Split a run into workers, each in its own terminal. Off by default.", ico: "lgrid" },
|
|
20
24
|
{ id: "automations", title: "Automations", desc: "Schedules that start a run in this project.", ico: "clock" },
|
|
21
|
-
{ id: "git", title: "Git
|
|
22
|
-
{ id: "terminal", title: "Terminal", desc: "The terminal dashboard.", ico: "term" },
|
|
25
|
+
{ id: "git", title: "Git", desc: "Branches and commits for each run.", ico: "pen" },
|
|
23
26
|
]],
|
|
24
|
-
["
|
|
25
|
-
{ id: "
|
|
26
|
-
{ id: "
|
|
27
|
-
{ id: "shortcuts", title: "Shortcuts", desc: "Keyboard shortcuts for common actions.", ico: "kbd" },
|
|
27
|
+
["Connections", [
|
|
28
|
+
{ id: "integrations", title: "Integrations", desc: "Request sources, your Google account, and web research.", ico: "ext" },
|
|
29
|
+
{ id: "mobile", title: "Phone", desc: "Open kaizen from your phone, and send files to WhatsApp.", ico: "phone" },
|
|
28
30
|
]],
|
|
29
31
|
];
|
|
32
|
+
// Pages that were merged into another: an old `?page=` address still opens the right one.
|
|
33
|
+
const PAGE_ALIAS: Record<string, string> = { voice: "keyboard", shortcuts: "keyboard" };
|
|
34
|
+
export const pageId = (id: string) => PAGE_ALIAS[id] ?? id;
|
|
35
|
+
// Subsections that should come first on their page, whatever order their rows arrive in.
|
|
36
|
+
export const SUB_ORDER: Record<string, string[]> = { general: ["Storage", "Folders", "App"], keyboard: ["Shortcuts", "Dictation"] };
|
|
30
37
|
// First match wins: [key pattern, page, subsection].
|
|
31
38
|
const PLACES: [RegExp, string, string][] = [
|
|
32
|
-
[/^(preset|runner|explore\.|build\.|review\.executor)/, "
|
|
33
|
-
[/^(
|
|
34
|
-
[/^agent\.
|
|
39
|
+
[/^(preset|runner|explore\.|build\.|review\.executor)/, "runs", "Workflow"],
|
|
40
|
+
[/^review\.(write_memory|memory_max_lines)$/, "runs", "Memory"],
|
|
41
|
+
[/^(subagents\.|agent\.model\.)/, "models", "Models"],
|
|
42
|
+
[/^agent\.handoff_model\./, "models", "Handoff session"],
|
|
35
43
|
[/^agent\.default$/, "agents", "Default agent"],
|
|
36
44
|
[/^agent\./, "agents", "Running agents"],
|
|
37
45
|
[/^orchestration\./, "orchestration", "Workers"],
|
|
38
|
-
[/^dictation\./, "
|
|
46
|
+
[/^dictation\./, "keyboard", "Dictation"],
|
|
39
47
|
[/^sources\./, "integrations", "Request sources"],
|
|
40
48
|
[/^(mode|approvals\.|auto_accept)/, "approvals", "Approvals"],
|
|
41
49
|
[/^auto_fix\./, "autofix", "Auto-fix"],
|
|
42
50
|
[/^auto_guard\./, "autofix", "Auto mode guard"],
|
|
43
51
|
[/^git\./, "git", "Git"],
|
|
44
52
|
[/^ui\./, "terminal", "Terminal"],
|
|
45
|
-
[/^board\.chat_hotkey$/, "
|
|
53
|
+
[/^board\.chat_hotkey$/, "keyboard", "Shortcuts"],
|
|
54
|
+
[/^board\.(projects_dir|video_dir)$/, "general", "Folders"],
|
|
46
55
|
[/^board\./, "general", "App"],
|
|
47
|
-
[/^
|
|
56
|
+
[/^state\./, "general", "Storage"],
|
|
48
57
|
];
|
|
49
58
|
// A setting nobody has placed yet still shows, on General.
|
|
50
59
|
export const placeOf = (key: string): [string, string] => {
|
package/web/board/settings.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { skillRows, wireSkills } from "./settings-skills.ts";
|
|
|
14
14
|
import { mountPhone } from "./phone-setup.ts";
|
|
15
15
|
import { mountWhatsApp } from "./whatsapp-setup.ts";
|
|
16
16
|
import { fillMics, micRow } from "./settings-voice.ts";
|
|
17
|
-
import { placeOf, SETTINGS_NAV } from "./settings-pages.ts";
|
|
17
|
+
import { pageId, placeOf, SETTINGS_NAV, SUB_ORDER } from "./settings-pages.ts";
|
|
18
18
|
import { askNotify, notifyOn, playSound, soundPick, SOUNDS, toast } from "./toast.ts";
|
|
19
19
|
import { updBar } from "./update.ts";
|
|
20
20
|
import { go, view } from "./views.ts";
|
|
@@ -55,35 +55,28 @@ export async function openSettings() {
|
|
|
55
55
|
$("pfoot").innerHTML = "";
|
|
56
56
|
const cur = document.documentElement.dataset.theme || "system";
|
|
57
57
|
const colour = document.documentElement.dataset.color || "monochrome";
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Everything the page shows, asked for at once.
|
|
59
|
+
const get = (url: string, init?: RequestInit) =>
|
|
60
|
+
fetch(url, init)
|
|
61
|
+
.then((r) => (r.ok ? r.json() : null))
|
|
62
|
+
.catch(() => null);
|
|
63
|
+
let [cfg, gg, rk, ap, ac, sk, au, cl] = await Promise.all([
|
|
64
|
+
get("/settings?scope=" + encodeURIComponent(store.setScope)),
|
|
65
|
+
get("/google"),
|
|
66
|
+
get("/research-key"),
|
|
67
|
+
get("/agent-prefs"),
|
|
68
|
+
get("/accounts"),
|
|
69
|
+
get("/skills"),
|
|
70
|
+
get("/automations", { headers: dirHeader() }),
|
|
71
|
+
get("/cleanup", { headers: dirHeader() }),
|
|
72
|
+
]);
|
|
73
|
+
gg ??= {};
|
|
61
74
|
// A project the board no longer knows: fall back to All projects.
|
|
62
75
|
if (!cfg && store.setScope !== "all") {
|
|
76
|
+
if (gen !== store.pageGen) return;
|
|
63
77
|
store.setScope = "all";
|
|
64
78
|
return openSettings();
|
|
65
79
|
}
|
|
66
|
-
const gg = await fetch("/google")
|
|
67
|
-
.then((r) => r.json())
|
|
68
|
-
.catch(() => ({}));
|
|
69
|
-
const rk = await fetch("/research-key")
|
|
70
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
71
|
-
.catch(() => null);
|
|
72
|
-
const ap = await fetch("/agent-prefs")
|
|
73
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
74
|
-
.catch(() => null);
|
|
75
|
-
const ac = await fetch("/accounts")
|
|
76
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
77
|
-
.catch(() => null);
|
|
78
|
-
const sk = await fetch("/skills")
|
|
79
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
80
|
-
.catch(() => null);
|
|
81
|
-
const au = await fetch("/automations", { headers: dirHeader() })
|
|
82
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
83
|
-
.catch(() => null);
|
|
84
|
-
const cl = await fetch("/cleanup", { headers: dirHeader() })
|
|
85
|
-
.then((r) => (r.ok ? r.json() : null))
|
|
86
|
-
.catch(() => null);
|
|
87
80
|
if (gen !== store.pageGen) return;
|
|
88
81
|
$("psub").textContent = "";
|
|
89
82
|
$("psub").title = "";
|
|
@@ -117,22 +110,14 @@ export async function openSettings() {
|
|
|
117
110
|
const nton = notifyOn();
|
|
118
111
|
const ntHelp = !nton ? "Off in this browser" : np === "granted" ? "" : np === "denied" ? "Pop-ups blocked by this browser; the sound still plays" : np ? "Pop-ups wait for the browser to ask; the sound still plays" : "Pop-ups not supported here; the sound still plays";
|
|
119
112
|
// Each page's subsections, in the order they first appear.
|
|
120
|
-
const pageRows = new Map<string, Map<string, unknown[]>>(PAGES.map((p) => [p.id, new Map()]));
|
|
113
|
+
const pageRows = new Map<string, Map<string, unknown[]>>(PAGES.map((p) => [p.id, new Map((SUB_ORDER[p.id] ?? []).map((sub) => [sub, []]))]));
|
|
121
114
|
const put = (page, sub, r) => {
|
|
122
115
|
const m = pageRows.get(page);
|
|
123
116
|
if (!m.has(sub)) m.set(sub, []);
|
|
124
117
|
m.get(sub).push(r);
|
|
125
118
|
};
|
|
126
119
|
const defaultAgent = cfg?.rows.find((r) => r.key === "agent.default")?.value ?? "auto";
|
|
127
|
-
if (cl) for (const r of cleanupRows(cl)) put("general", "Cleanup", row(r.label, r.control, r.hint, r.id, r.q));
|
|
128
120
|
if (cfg) {
|
|
129
|
-
put("general", "Scope", row(
|
|
130
|
-
"Settings for",
|
|
131
|
-
html`<select class="sel" id="s-scope">${[{ dir: "all", label: "All projects" }, ...cfg.projects].map((p) => html`<option value="${p.dir}"${p.dir === cfg.scope ? " selected" : ""}>${p.label}</option>`)}</select>`,
|
|
132
|
-
scoped ? "This project's own .kaizen/config.yml; anything it does not set comes from All projects." : "~/.kaizen/config.yml; a project's own config wins where it sets a value.",
|
|
133
|
-
"s-scope",
|
|
134
|
-
"settings for scope project all projects",
|
|
135
|
-
));
|
|
136
121
|
// Drawn as chips with the agent list, above the rest of the page.
|
|
137
122
|
cfg.rows = cfg.rows.filter((r) => !(r.key === "agent.default" && ap));
|
|
138
123
|
// A model row only for a tool on this machine.
|
|
@@ -157,10 +142,12 @@ export async function openSettings() {
|
|
|
157
142
|
));
|
|
158
143
|
}
|
|
159
144
|
}
|
|
160
|
-
|
|
145
|
+
// Under Runs to keep, which they act on.
|
|
146
|
+
if (cl) for (const r of cleanupRows(cl)) put("general", "Storage", row(r.label, r.control, r.hint, r.id, r.q));
|
|
147
|
+
put("keyboard", "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"));
|
|
161
148
|
put("mobile", "Phone", html`
|
|
162
149
|
<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"
|
|
150
|
+
<div class="srow ph-card" data-q="whatsapp phone mobile qr message send"><div id="waset"></div></div>
|
|
164
151
|
`);
|
|
165
152
|
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"));
|
|
166
153
|
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"));
|
|
@@ -197,7 +184,7 @@ export async function openSettings() {
|
|
|
197
184
|
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"));
|
|
198
185
|
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));
|
|
199
186
|
// A narrow screen starts on the list of pages, a wide one on the first page.
|
|
200
|
-
store.setPage
|
|
187
|
+
store.setPage = pageId(store.setPage ?? new URLSearchParams(location.search).get("page") ?? "");
|
|
201
188
|
const scopeName = scoped ? cfg.projects.find((p) => p.dir === cfg.scope)?.label : "";
|
|
202
189
|
// A save redraws the page: the rows stay where they were scrolled to.
|
|
203
190
|
const top = $("smain")?.scrollTop || 0;
|
|
@@ -205,14 +192,18 @@ export async function openSettings() {
|
|
|
205
192
|
<nav class="snav" aria-label="Settings">
|
|
206
193
|
<button class="sback" id="sback" type="button">${ico("chev")}Back to app</button>
|
|
207
194
|
<div class="sq"><input class="sel" id="sq" type="search" placeholder="Search settings" aria-label="Search settings" spellcheck="false" autocomplete="off" value="${store.setQ}"></div>
|
|
208
|
-
|
|
195
|
+
${cfg ? html`<div class="sacct" title="${scoped ? "This project's own .kaizen/config.yml; anything it does not set comes from All projects." : "~/.kaizen/config.yml; a project's own config wins where it sets a value."}">
|
|
196
|
+
<span class="stile">${ico(scoped ? "board" : "home")}</span>
|
|
197
|
+
<span class="sacct-t"><small id="s-scope-l">Settings for</small><select class="sel" id="s-scope" aria-labelledby="s-scope-l">${[{ dir: "all", label: "All projects" }, ...cfg.projects].map((p) => html`<option value="${p.dir}"${p.dir === cfg.scope ? " selected" : ""}>${p.label}</option>`)}</select><small>${scoped ? "Overrides All projects" : "Every project"}</small></span>
|
|
198
|
+
</div>` : ""}
|
|
199
|
+
<div class="snavs">${SETTINGS_NAV.map(([g, ps]) => html`<div class="snavg" role="group" aria-label="${g}">${ps.map((p) => html`<button type="button" data-page="${p.id}"><span class="stile">${ico(p.ico)}</span><span>${p.title}</span></button>`)}</div>`)}</div>
|
|
209
200
|
</nav>
|
|
210
201
|
<div class="smain" id="smain">
|
|
211
202
|
${PAGES.map((p) => html`<div class="spage" data-page="${p.id}">
|
|
212
203
|
<button class="sup" type="button">${ico("chev")}Settings</button>
|
|
213
|
-
<header><h2>${p.title}</h2><p>${p.desc}${scopeName ? ` Editing ${scopeName}.` : ""}</p></header>
|
|
204
|
+
<header><span class="stile">${ico(p.ico)}</span><div><h2>${p.title}</h2><p>${p.desc}${scopeName ? ` Editing ${scopeName}.` : ""}</p></div></header>
|
|
214
205
|
${p.id === "general" ? html`<div id="supd"></div>` : ""}
|
|
215
|
-
<div class="scard">${p.id === "agents" && ap ? agentRows(ap, defaultAgent, scopeName) : ""}${p.id === "accounts" && ac ? accountRows(ac) : ""}${p.id === "orchestration" && cfg ? orchestrationRows({ windows: !!cfg.windows, bypass: cfg.rows.some((r) => r.key === "orchestration.permissions" && r.value === "bypass") }) : ""}${p.id === "skills" && sk ? skillRows(sk.skills) : ""}${p.id === "automations" ? (au ? automationRows(au) : html`<h3 class="sg">Automations</h3><div class="sgrp"><div class="sk" data-q="automation">Open a project to add automations. They belong to one project each.</div></div>`) : ""}${[...pageRows.get(p.id)].map(([sub, rows]) => html`<h3 class="sg">${sub}</h3><div class="sgrp">${rows}</div>`)}</div>
|
|
206
|
+
<div class="scard">${p.id === "agents" && ap ? agentRows(ap, defaultAgent, scopeName) : ""}${p.id === "accounts" && ac ? accountRows(ac) : ""}${p.id === "orchestration" && cfg ? orchestrationRows({ windows: !!cfg.windows, bypass: cfg.rows.some((r) => r.key === "orchestration.permissions" && r.value === "bypass") }) : ""}${p.id === "skills" && sk ? skillRows(sk.skills) : ""}${p.id === "automations" ? (au ? automationRows(au) : html`<h3 class="sg">Automations</h3><div class="sgrp"><div class="sk" data-q="automation">Open a project to add automations. They belong to one project each.</div></div>`) : ""}${[...pageRows.get(p.id)].filter(([, rows]) => rows.length).map(([sub, rows]) => html`<h3 class="sg">${sub}</h3><div class="sgrp">${rows}</div>`)}</div>
|
|
216
207
|
</div>`)}
|
|
217
208
|
${cfg ? "" : html`<p class="snone">Settings could not be read. Run <code>kaizen settings</code>.</p>`}
|
|
218
209
|
<p class="snone" id="snone" hidden></p>
|
package/web/board/views.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The WhatsApp card: Settings →
|
|
1
|
+
// The WhatsApp card: Settings → Phone. Walks the user through linking WhatsApp Web,
|
|
2
2
|
// displaying a QR code that connects to the background Baileys bridge.
|
|
3
3
|
import { html, raw } from "./dom.ts";
|
|
4
4
|
|
package/web/board/workspace.ts
CHANGED
|
@@ -9,7 +9,8 @@ import { initResources } from "./resources.ts";
|
|
|
9
9
|
import { age, need } from "./labels.ts";
|
|
10
10
|
import { openAdd } from "./add-project.ts";
|
|
11
11
|
import { initSearch } from "./search.ts";
|
|
12
|
-
import { agentsHtml, dueWord, forgetAgents, gitDue, settleIn, toggleOpen, wsAgents, type Agent } from "./ws-tabs.ts";
|
|
12
|
+
import { agentsHtml, dueWord, forgetAgents, gitDue, moveTo, settleIn, toggleOpen, wsAgents, type Agent } from "./ws-tabs.ts";
|
|
13
|
+
import { toast } from "./toast.ts";
|
|
13
14
|
|
|
14
15
|
const DAY = 864e5;
|
|
15
16
|
const STAGE = ["idea", "planning", "building", "reviewing", "done"];
|
|
@@ -195,7 +196,10 @@ export function wsOfCard(c, projects = last.projects) {
|
|
|
195
196
|
const ws = projects?.find((p) => p.dir === c.state)?.workspaces ?? [];
|
|
196
197
|
return ws.find((w) => w.path === c.ws)?.path ?? ws.find((w) => w.main)?.path ?? c.ws ?? "";
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
+
// The floating Home workspace's folder (~/.kaizen/home): never a project's `.kaizen` state dir, and it has no workspace view.
|
|
200
|
+
export const isHomeDir = (d: unknown) => typeof d === "string" && /[\\/]\.kaizen[\\/]home$/.test(d);
|
|
201
|
+
// A Home terminal's address opens the board with its panel (web/board/home-ws.ts), from any page.
|
|
202
|
+
export const wsHref = (dir, ws) => (isHomeDir(dir) ? "/?view=board&homews=1" : `/?view=ws&dir=${encodeURIComponent(dir)}&ws=${encodeURIComponent(ws)}`);
|
|
199
203
|
export const RANK = { wait: 0, plan: 1, build: 2, review: 3, stalled: 4, idle: 5, done: 6, aband: 7 };
|
|
200
204
|
export const folderOf = (w) => w.path.split(/[\\/]/).pop() || w.path;
|
|
201
205
|
// A worktree's mark on line 2 of its card.
|
|
@@ -212,10 +216,85 @@ async function readTaskAttention() {
|
|
|
212
216
|
}
|
|
213
217
|
const taskLinks = (dir: string, w: any, cards: any[]) => (attentionTasks ?? []).filter((t) => t.dir === dir && !t.legacy && t.attention.category !== "completed" && filt.running && t.status !== "draft" && (cards.some((c) => taskForCard(c)?.id === t.id) || (w.main && !(t.runs ?? t.runIds ?? []).length))).sort((a: any, b: any) => (a.created ?? 0) - (b.created ?? 0)).map((t) => html`<a class="rtask" href="/?view=task&task=${encodeURIComponent(t.id)}&dir=${encodeURIComponent(t.dir)}" data-task-id="${t.id}" data-task-dir="${t.dir}" title="${t.attention.reason} · ${t.attention.action}"><span class="si ${t.attention.category === "needs-you" ? "wait" : t.attention.category === "completed" ? "done" : ["interrupted", "failed"].includes(t.status ?? "") ? "stalled" : t.status === "draft" ? "idle" : "build"}"></span><span><b>${t.title}</b><small>${t.attention.reason}</small></span></a>`);
|
|
214
218
|
|
|
219
|
+
// ---- ranking projects: press a project's bar and drag it up or down (pointer events, so a mouse
|
|
220
|
+
// and a finger work alike). A mouse starts after 5 px of movement; a finger after a 300 ms hold
|
|
221
|
+
// without moving, so a quick swipe still scrolls the sidebar. A line shows where it will land;
|
|
222
|
+
// letting go saves the order for every device (POST /projects/order rewrites ~/.kaizen/projects).
|
|
223
|
+
// Escape or a cancelled pointer puts it back. The click that ends a drag does not fold.
|
|
224
|
+
let ranking = false, rankDirty = false, rankClick = false;
|
|
225
|
+
function rankDrag(box: HTMLElement) {
|
|
226
|
+
let d: { dir: string; bar: HTMLElement; id: number; x: number; y: number; hold?: ReturnType<typeof setTimeout>; to: number } | null = null;
|
|
227
|
+
const groups = () => [...box.querySelectorAll<HTMLElement>(":scope > .pgrp")];
|
|
228
|
+
const clear = () => {
|
|
229
|
+
groups().forEach((g) => g.classList.remove("rank-before"));
|
|
230
|
+
box.classList.remove("rank-end");
|
|
231
|
+
d?.bar.classList.remove("rank-lift");
|
|
232
|
+
};
|
|
233
|
+
const end = (save: boolean) => {
|
|
234
|
+
if (!d) return;
|
|
235
|
+
clearTimeout(d.hold);
|
|
236
|
+
const was = ranking, { dir, to } = d;
|
|
237
|
+
clear();
|
|
238
|
+
d = null;
|
|
239
|
+
ranking = false;
|
|
240
|
+
if (was) rankClick = true; // the click that follows this pointerup
|
|
241
|
+
if (was && save) {
|
|
242
|
+
const dirs = groups().map((g) => g.querySelector<HTMLElement>(".proj")!.dataset.proj!);
|
|
243
|
+
const from = dirs.indexOf(dir);
|
|
244
|
+
if (from >= 0 && to !== from && to !== from + 1) {
|
|
245
|
+
const next = moveTo(dirs, from, to);
|
|
246
|
+
const rank = new Map(next.map((x, i) => [x, i]));
|
|
247
|
+
last.projects = [...(last.projects ?? [])].sort((a, b) => (rank.get(a.dir) ?? 1e9) - (rank.get(b.dir) ?? 1e9));
|
|
248
|
+
void fetch("/projects/order", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ dirs: next }) })
|
|
249
|
+
.then((r) => { if (!r.ok) toast("Could not save the project order"); })
|
|
250
|
+
.catch(() => toast("Could not save the project order"));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (was || rankDirty) (rankDirty = false), drawList();
|
|
254
|
+
if (was) setTimeout(() => (rankClick = false), 0);
|
|
255
|
+
};
|
|
256
|
+
const start = () => {
|
|
257
|
+
if (!d) return;
|
|
258
|
+
ranking = true;
|
|
259
|
+
d.bar.classList.add("rank-lift");
|
|
260
|
+
try { d.bar.setPointerCapture(d.id); } catch {}
|
|
261
|
+
navigator.vibrate?.(8);
|
|
262
|
+
};
|
|
263
|
+
box.addEventListener("pointerdown", (e) => {
|
|
264
|
+
const bar = (e.target as HTMLElement).closest<HTMLElement>(".pgrp > .proj");
|
|
265
|
+
if (!bar || e.button !== 0 || bar.parentElement?.parentElement !== box) return;
|
|
266
|
+
d = { dir: bar.dataset.proj!, bar, id: e.pointerId, x: e.clientX, y: e.clientY, to: -1 };
|
|
267
|
+
if (e.pointerType !== "mouse") d.hold = setTimeout(start, 300);
|
|
268
|
+
});
|
|
269
|
+
box.addEventListener("pointermove", (e) => {
|
|
270
|
+
if (!d || e.pointerId !== d.id) return;
|
|
271
|
+
const far = Math.hypot(e.clientX - d.x, e.clientY - d.y);
|
|
272
|
+
if (!ranking) {
|
|
273
|
+
if (e.pointerType === "mouse" ? far > 5 : far > 8) e.pointerType === "mouse" ? start() : end(false);
|
|
274
|
+
if (!ranking) return;
|
|
275
|
+
}
|
|
276
|
+
e.preventDefault();
|
|
277
|
+
// The landing slot: before the first project whose bar's middle is below the pointer, else the end.
|
|
278
|
+
const gs = groups();
|
|
279
|
+
const i = gs.findIndex((g) => { const r = g.getBoundingClientRect(); return e.clientY < r.top + r.height / 2; });
|
|
280
|
+
d.to = i < 0 ? gs.length : i;
|
|
281
|
+
gs.forEach((g, k) => g.classList.toggle("rank-before", k === d!.to));
|
|
282
|
+
box.classList.toggle("rank-end", d.to === gs.length);
|
|
283
|
+
});
|
|
284
|
+
box.addEventListener("pointerup", (e) => d && e.pointerId === d.id && end(true));
|
|
285
|
+
box.addEventListener("pointercancel", () => end(false));
|
|
286
|
+
// A held finger: no page scroll and no long-press menu while it drags.
|
|
287
|
+
box.addEventListener("touchmove", (e) => { if (ranking) e.preventDefault(); }, { passive: false });
|
|
288
|
+
box.addEventListener("contextmenu", (e) => { if (d) e.preventDefault(); }, true);
|
|
289
|
+
addEventListener("keydown", (e) => { if (ranking && e.key === "Escape") (e.preventDefault(), end(false)); });
|
|
290
|
+
}
|
|
291
|
+
|
|
215
292
|
export const wsLabel = (w) => w.branch || (w.main ? "workspace" : w.path.split(/[\\/]/).pop());
|
|
216
293
|
function drawList() {
|
|
217
294
|
const box = $("plist");
|
|
218
295
|
if (!box) return;
|
|
296
|
+
// A drag in progress owns the list: a redraw would pull the bar out from under the pointer.
|
|
297
|
+
if (ranking) return void (rankDirty = true);
|
|
219
298
|
const now = Date.now();
|
|
220
299
|
const projects = (last.projects ?? []).filter((p) => p.workspaces?.length);
|
|
221
300
|
const all = new Set(projects.map((p) => p.dir));
|
|
@@ -251,9 +330,8 @@ function drawList() {
|
|
|
251
330
|
return { p, rows, top: Math.min(9, ...rows.map((r) => top(r.cs))) };
|
|
252
331
|
})
|
|
253
332
|
// Running only keeps every project listed, so an idle one reads "Nothing running" rather than vanishing.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
.sort((a, b) => a.top - b.top);
|
|
333
|
+
// In the registry's order, which the user ranks by dragging a project's bar (rankDrag below).
|
|
334
|
+
.filter((g) => g.rows.length || filt.running);
|
|
257
335
|
|
|
258
336
|
const f = $("pfilter");
|
|
259
337
|
const on = filt.dirs.some((d) => all.has(d)) || !filt.running || filt.done;
|
|
@@ -275,7 +353,7 @@ function drawList() {
|
|
|
275
353
|
// A + for a new worktree on git projects (the main checkout has a branch).
|
|
276
354
|
const git = p.workspaces.some((w) => w.branch);
|
|
277
355
|
const mainWs = p.workspaces?.find((w) => w.main)?.path ?? p.workspaces?.[0]?.path ?? dir;
|
|
278
|
-
return html`<div class="pgrp"><button type="button" class="proj${shut ? " shut" : ""}" data-proj="${dir}" data-ws="${mainWs}" data-fold="${dir}" title="${dir}" aria-expanded="${String(!shut)}">${logo(dir, name, last.projects)}<span class="pname">${name}</span><svg class="fchev" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>${git ? html`<button type="button" class="wadd" data-wadd="${dir}" title="New workspace in ${name}" aria-label="New workspace in ${name}"><svg aria-hidden="true"><use href="#i-plus"/></svg></button>` : ""}</div>${shut ? "" : raw('<div class="pws">')}${shut ? "" : rows.map(({ w, cs }) => {
|
|
356
|
+
return html`<div class="pgrp"><button type="button" class="proj${shut ? " shut" : ""}" data-proj="${dir}" data-ws="${mainWs}" data-fold="${dir}"${rows.length ? "" : " data-empty"} title="${dir}" aria-expanded="${String(!shut)}">${logo(dir, name, last.projects)}<span class="pname">${name}</span><svg class="fchev" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>${git ? html`<button type="button" class="wadd" data-wadd="${dir}" title="New workspace in ${name}" aria-label="New workspace in ${name}"><svg aria-hidden="true"><use href="#i-plus"/></svg></button>` : ""}</div>${shut ? "" : raw('<div class="pws">')}${shut ? "" : rows.map(({ w, cs }) => {
|
|
279
357
|
// The dot: the most urgent run there, or an agent asking (amber) or working (spinner).
|
|
280
358
|
const rows = shownAgents(wsAgents(last.agents ?? [], dir, w.path, wsOfCard, now));
|
|
281
359
|
const st0 = cs.length ? stateOf([...cs].sort((a, b) => RANK[stateOf(a)] - RANK[stateOf(b)])[0]) : "";
|
|
@@ -293,6 +371,7 @@ function drawList() {
|
|
|
293
371
|
if (a) wsMenu(e, a);
|
|
294
372
|
};
|
|
295
373
|
box.onclick = (e) => {
|
|
374
|
+
if (rankClick) return void ((rankClick = false), e.preventDefault(), e.stopPropagation());
|
|
296
375
|
const t = e.target as HTMLElement;
|
|
297
376
|
const task = t.closest<HTMLElement>("[data-task-id]");
|
|
298
377
|
if (task) {
|
|
@@ -311,11 +390,12 @@ function drawList() {
|
|
|
311
390
|
const d = t.closest<HTMLElement>("[data-fold]")?.dataset.fold;
|
|
312
391
|
if (d) return void (e.preventDefault(), fold(d));
|
|
313
392
|
}
|
|
314
|
-
|
|
393
|
+
// A project bar folds and unfolds, like a folder. One that lists nothing has no rows to click,
|
|
394
|
+
// so it opens its main workspace instead.
|
|
395
|
+
const proj = t.closest<HTMLElement>("[data-proj][data-empty]");
|
|
315
396
|
if (proj) {
|
|
316
397
|
e.preventDefault();
|
|
317
398
|
const dir = proj.dataset.proj!, ws = proj.dataset.ws || dir;
|
|
318
|
-
if (folded.has(dir)) fold(dir);
|
|
319
399
|
if (ask("kz-open-ws", { dir, ws })) return;
|
|
320
400
|
}
|
|
321
401
|
const d = t.closest<HTMLElement>("[data-fold]")?.dataset.fold;
|
|
@@ -438,6 +518,7 @@ export function initRail() {
|
|
|
438
518
|
});
|
|
439
519
|
}).observe(document.body, { childList: true, subtree: true });
|
|
440
520
|
if (!$("plist")) return;
|
|
521
|
+
rankDrag($("plist"));
|
|
441
522
|
addEventListener("kz-task-attention", drawList);
|
|
442
523
|
void readTaskAttention();
|
|
443
524
|
onBoardCards((cards, projects, agents) => {
|
package/web/board/ws-tabs.ts
CHANGED
|
@@ -147,6 +147,21 @@ export function devUrl(pv: string | null | undefined, ports: number[]): string |
|
|
|
147
147
|
// yet opened the Browser: once per run id (`seen`).
|
|
148
148
|
export const toOpen = (cards: any[], was: Set<string>, seen: string[], keyOf: (c) => string) => cards.filter((c) => reviewing(c) && !was.has(keyOf(c)) && !seen.includes(keyOf(c)));
|
|
149
149
|
|
|
150
|
+
// The list with the item at `from` moved into slot `to` (0 = top, list.length = the end), counted
|
|
151
|
+
// before the move: the sidebar's project drag lands it where its drop line was drawn.
|
|
152
|
+
export const moveTo = <T>(list: T[], from: number, to: number): T[] => {
|
|
153
|
+
const out = list.filter((_, i) => i !== from);
|
|
154
|
+
out.splice(to > from ? to - 1 : to, 0, list[from]);
|
|
155
|
+
return out;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// `kaizen preview` written from folder `pws` belongs to workspace `ws`: the same folder or one inside
|
|
159
|
+
// it, but never a worktree under it (`.kaizen/wt/`), which is a workspace of its own.
|
|
160
|
+
export const previewIn = (pws: string, ws: string) => pws === ws || (pws.startsWith(ws + "/") && !pws.startsWith(ws + "/.kaizen/wt/"));
|
|
161
|
+
// A preview opens a tab only when written after the last one this visit recorded; the first look at
|
|
162
|
+
// a workspace (`last` undefined: a click, a switch, a reload) only records.
|
|
163
|
+
export const previewOpens = (at: number, last: number | undefined) => last !== undefined && at > last;
|
|
164
|
+
|
|
150
165
|
// ---- the sidebar card's agents (/state `agents`, one entry per open agent terminal)
|
|
151
166
|
export type Agent = { key: string; dir: string; ws?: string; agent?: string; name: string; run?: string; asking: boolean; busy: boolean; last?: string; at?: number; born?: number; land?: string };
|
|
152
167
|
export type Status = "conflict" | "failed" | "asking" | "working" | "done";
|
package/web/board.html
CHANGED
|
@@ -142,6 +142,8 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
|
|
|
142
142
|
/* phones: Runs, Search, Home, Chat, Terminal (Settings and the Icebox are Search results). The board and Tasks are set up on a computer (web/board/phone.ts) */
|
|
143
143
|
@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}}
|
|
144
144
|
.rail a.it.ponly,#phome{display:none}
|
|
145
|
+
/* the Home chat item reads Chat on a computer (Home is the floating workspace there) and Home on a phone */
|
|
146
|
+
.rail .phl{display:none}@media(max-width:640px){.rail .dkl{display:none}.rail .phl{display:inline}.rail svg.phl{display:block}}
|
|
145
147
|
@media(max-width:640px){
|
|
146
148
|
.rail a.it:is([data-view=board],[data-view=tasks],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .ib.xs{display:none!important}
|
|
147
149
|
.rail a.it.ponly{display:flex}
|
|
@@ -668,6 +670,19 @@ body.runv #runv{grid-area:1/1;display:flex;flex-direction:column;min-width:0;min
|
|
|
668
670
|
.rtab{display:flex;gap:var(--gap);align-items:center;height:var(--row);padding:0 12px;border-radius:var(--r-s);color:var(--dim);white-space:nowrap}.rtab:hover{color:var(--ink)}.rtab svg{width:var(--ico);height:var(--ico)}.rtab.on{color:var(--ink);background:var(--hover)}.rtab.sec{color:var(--ink);box-shadow:inset 0 -2px var(--line)}
|
|
669
671
|
#rtabs .rtab span:not(.si){max-width:180px;overflow:hidden;text-overflow:ellipsis}
|
|
670
672
|
.rtab i{font-style:normal;opacity:.5;padding:0 3px;margin-left:2px}.rtab i:hover{opacity:1}
|
|
673
|
+
/* the floating Home workspace (web/board/home-ws.ts): agents in kaizen's own folder, over every view; minimized to a row above the projects */
|
|
674
|
+
.hws{position:fixed;z-index:35;right:16px;bottom:calc(var(--foot-h,0px) + 16px);width:min(760px,calc(100vw - 32px));height:min(480px,calc(100vh - 96px));min-width:360px;min-height:220px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:flex;flex-direction:column;overflow:hidden;resize:both;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);border-radius:var(--r-l);box-shadow:var(--shadow-2),0 18px 48px -12px var(--shade)}.hws[hidden]{display:none}
|
|
675
|
+
.hws.max{inset:8px!important;width:auto!important;height:auto!important;max-width:none;max-height:none;resize:none}
|
|
676
|
+
.hwsh{display:flex;align-items:center;gap:6px;height:var(--tabbar);padding:0 6px 0 12px;border-bottom:1px solid var(--line);cursor:move;user-select:none;flex:none}.hwsh>b{font-size:var(--fs);font-weight:600}.hwsh .hwsico{width:var(--ico);height:var(--ico);color:var(--dim);flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}.hwsh .sp{flex:1}.hwsh .ib.xs{width:var(--btn-xs);height:var(--btn-xs)}.hwsh .ib.xs:hover{background:var(--hover);color:var(--ink)}.hwsh .ib.xs svg{width:var(--ico);height:var(--ico)}
|
|
677
|
+
.hwstabs{display:flex;gap:2px;min-width:0;overflow:auto hidden;scrollbar-width:none;margin-left:6px}.hwstab{display:flex;align-items:center;gap:6px;flex:none;max-width:180px;height:26px;padding:0 4px 0 8px;border-radius:var(--r-s);color:var(--dim);font-size:var(--fs-s);cursor:pointer}.hwstab:hover{background:var(--hover);color:var(--ink)}.hwstab.on{background:var(--hover);color:var(--ink-hi)}.hwstab svg{width:var(--ico-s);height:var(--ico-s);flex:none}.hwstab span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hwstab i{font-style:normal;width:16px;height:16px;display:grid;place-items:center;border-radius:var(--r-xs);opacity:.6}.hwstab i:hover{background:var(--hover);opacity:1}
|
|
678
|
+
/* Ranking projects by drag (rankDrag in board/workspace.ts): the lifted bar dims, a 2px line marks where it lands. */
|
|
679
|
+
#plist>.pgrp{position:relative}#plist>.pgrp.rank-before::before,#plist.rank-end::after{content:"";display:block;height:2px;margin:0 var(--padx);border-radius:1px;background:var(--accent)}#plist>.pgrp.rank-before::before{position:absolute;left:0;right:0;top:-2px}#plist .proj.rank-lift{opacity:.45;cursor:grabbing}body:has(#plist .proj.rank-lift){cursor:grabbing;user-select:none}
|
|
680
|
+
/* The Home window's tabs match the workspace tab bar (Orca's): flat, the header's full height, an underline under the active one, × at the end. */
|
|
681
|
+
.hwstabs{align-self:stretch;gap:0}.hwstab{height:auto;min-width:120px;max-width:220px;padding:0 6px 0 12px;gap:8px;border-radius:0;font-size:var(--fs)}.hwstab span{flex:1;min-width:0;text-align:left}.hwstab i{margin-left:auto;opacity:0}.hwstab:hover i,.hwstab.on i{opacity:.6}.hwstab:hover{background:var(--hover)}.hwstab.on{background:none;color:var(--ink-hi);box-shadow:inset 0 -2px var(--ink-hi)}.hwstabs+.radd{margin-left:4px}
|
|
682
|
+
.hwsb{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--bg)}.hwsb .term{flex:1;min-height:0;padding:6px 0 0 8px}.hwsb .term .xterm{height:100%}.hwsb .term .xterm-viewport{background:transparent!important}.hwsempty{margin:auto;color:var(--dim);font-size:var(--fs-s)}
|
|
683
|
+
.hwsbtn{position:fixed;z-index:34;right:16px;bottom:calc(var(--foot-h,0px) + 16px);width:40px;height:40px;display:grid;place-items:center;border-radius:50%;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);box-shadow:var(--shadow-2)}.hwsbtn:hover{color:var(--ink-hi);background:color-mix(in srgb,var(--bg-2) 85%,var(--ink))}.hwsbtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.hwsbtn[hidden]{display:none}.hwsbtn:focus-visible,.hws button:focus-visible{outline:2px solid var(--accent)}
|
|
684
|
+
.rail .plist.hwsslot{flex:none;min-height:0;overflow:visible}.rail .plist.hwsslot[hidden]{display:none}.hwsslot .proj .c{margin-left:auto}.hwsslot .wadd{opacity:.6}.hwsslot .plogo.hwsico{background:none;color:var(--ink);fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}[data-rail=min] .hwsslot .proj .hwsico use{display:inline}
|
|
685
|
+
@media(max-width:640px){.hws,.hwsbtn,.hwsslot{display:none!important}}
|
|
671
686
|
.radd{position:relative}.radd summary{list-style:none}.radd summary::-webkit-details-marker{display:none}
|
|
672
687
|
.radd .menu-pop{position:fixed;z-index:20;right:auto;bottom:auto;width:max-content;margin-top:0;min-width:250px;padding:5px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-2);display:flex;flex-direction:column}
|
|
673
688
|
.radd .menu-pop button{display:grid;grid-template-columns:18px 1fr;gap:10px;align-items:start;text-align:left;padding:7px 9px;border-radius:var(--r)}.radd .menu-pop button:hover{background:var(--hover)}.radd .menu-pop svg{width:16px;height:16px;margin-top:1px}.radd small{display:block;color:var(--dim);font-size:11.5px}.radd .agent-yolo{margin:0 0 4px;padding:7px 9px;border-block:0;border-bottom:1px solid var(--line);border-radius:0;font-size:13px}
|
|
@@ -723,6 +738,13 @@ body.runv.rflip #panel::before{content:"";position:absolute;top:7px;left:50%;wid
|
|
|
723
738
|
#rtabs .rtab span{max-width:110px;overflow:hidden;text-overflow:ellipsis}}
|
|
724
739
|
/* A phone: the panel is a sheet opened from the run tab (#rside); compact tabs */
|
|
725
740
|
@media(max-width:640px){body.runv #rbar{height:40px;min-height:40px;padding:0 10px 4px 10px;border-bottom:1px solid var(--line)}body.runv #rtabs{height:36px;min-height:36px;padding:0;gap:4px}body.runv #rtabs .rtab{min-height:32px;height:32px;padding:0 10px;font-size:12px;border-radius:var(--r-s)}body.runv #rtabs .rtab i{padding:0 2px 0 6px}body.runv #rbar :is(.rbtn,.ib.xs){min-height:32px;height:32px;min-width:32px;width:32px;padding:0;border-radius:var(--r-s)}body.runv #rbar :is(.rbtn,.ib.xs) svg{width:16px;height:16px}body.runv #pnotes{width:44px;height:44px}body.runv #pfoot details button{min-height:44px}body .termtools button{min-width:40px;min-height:40px}body.runv #ptabs button{width:44px;height:44px}body.runv #pclose{width:44px;height:44px}body.runv #pfoot .btn{min-height:44px}}
|
|
741
|
+
/* Workspace tabs as Orca's: flat, the bar's full height, an underline under the active one, × at the end. */
|
|
742
|
+
@media(min-width:641px){#rtabs{align-items:stretch;gap:0}html body.runv #rtabs{padding-top:0;padding-bottom:0}#rtabs>:not(.rtab){align-self:center}#rtabs>.rtab+:not(.rtab){margin-left:4px}#rtabs .rtab{height:auto;min-width:140px;max-width:240px;padding:0 8px 0 12px;gap:8px;border-radius:0;background:none;color:var(--dim)}#rtabs .rtab span:not(.si){flex:1;min-width:0;max-width:none;text-align:left}#rtabs .rtab i{margin-left:auto;padding:0 4px;opacity:0}#rtabs .rtab:hover i,#rtabs .rtab.on i,#rtabs .rtab i:focus-visible{opacity:.6}#rtabs .rtab i:hover{opacity:1}#rtabs .rtab:hover{color:var(--ink);background:var(--hover)}#rtabs .rtab.on{color:var(--ink-hi);background:none;box-shadow:inset 0 -2px var(--ink-hi)}}
|
|
743
|
+
/* A terminal fills its pane in its own colours (--term-bg, set by web/term.ts from its palette), edge to edge;
|
|
744
|
+
while a divider moves it clips rather than refits, so the pane must not show anything else behind it. */
|
|
745
|
+
.term{overflow:hidden;background:var(--term-bg,var(--bg))}.term .xterm-viewport{background:transparent!important}
|
|
746
|
+
.rpane:has(>.term),.rstage:has(>.term),.hwsb:has(>.term){background:var(--term-bg,var(--bg))}
|
|
747
|
+
.rpane>.term,.rstage .term,.hwsb .term{padding:8px 4px 4px 10px}
|
|
726
748
|
|
|
727
749
|
/* revise 5: the mockup's plain chrome for terminals, in the workspace and on the Terminal page */
|
|
728
750
|
body.termv #tmodes{background:none;padding:0;gap:2px}body.termv #tmodes button{color:var(--dim);background:none;box-shadow:none;border-radius:var(--r-s);font-weight:400}body.termv #tmodes button:hover{background:var(--hover);color:var(--ink)}body.termv #tmodes button.on{color:var(--ink);background:var(--hover);box-shadow:none}
|
|
@@ -943,39 +965,47 @@ aside .foot .more .menu-pop{left:0;right:auto;top:auto;bottom:calc(100% + 4px)}.
|
|
|
943
965
|
.sq{position:sticky;top:-24px;z-index:1;background:var(--bg);padding:24px 0 12px;margin:-24px 0 4px;border-bottom:1px solid var(--line)}.sq input{width:100%;max-width:none}.sq+.sg{margin-top:16px}
|
|
944
966
|
.sjump{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.sjump button{padding:3px 10px;border:1px solid var(--line);border-radius:var(--r-pill);font-size:12px;color:var(--dim)}.sjump button:hover{background:var(--hover);color:var(--ink)}
|
|
945
967
|
.snone{color:var(--dim);margin-top:20px}
|
|
946
|
-
/* settings, laid out as
|
|
947
|
-
@media(min-width:641px){body.setv .rail{display:none}body.setv #panel>header{display:none}body.setv #panel>.body{padding:0!important;overflow:hidden}body.setv #panel{background:none;border-color:transparent;box-shadow:none}body.setv .app{margin:0;background:none;border:0;border-radius:0}.sset .snav{background:none;border-right:0;padding:18px 12px 14px}.sset .sback{margin:0 0 6px;padding:0 var(--padx);height:var(--row);gap:var(--gap);font-size:var(--fs);font-weight:500}.sset .snav .sq{border-block:0;padding:0 0
|
|
948
|
-
.sset{display:grid;grid-template-columns:clamp(
|
|
968
|
+
/* settings, laid out as macOS System Settings: its own sidebar of icon tiles in place of the rail, the project being edited on top, one page per item, each section its own rounded box */
|
|
969
|
+
@media(min-width:641px){body.setv .rail{display:none}body.setv #panel>header{display:none}body.setv #panel>.body{padding:0!important;overflow:hidden}body.setv #panel{background:none;border-color:transparent;box-shadow:none}body.setv .app{margin:0;background:none;border:0;border-radius:0}.sset .snav{background:none;border-right:0;padding:18px 12px 14px}.sset .sback{margin:0 0 6px;padding:0 var(--padx);height:var(--row);gap:var(--gap);font-size:var(--fs);font-weight:500}.sset .snav .sq{border-block:0;padding:0 0 10px}.sset .snavs{padding:4px 0 0}.sset .smain{margin:8px 8px 0 0;background:var(--bg);border:1px solid var(--line);border-radius:var(--r-l)}}
|
|
970
|
+
.sset{display:grid;grid-template-columns:clamp(220px,24vw,272px) minmax(0,1fr);height:100%}
|
|
949
971
|
.snav{min-height:0;display:flex;flex-direction:column;background:var(--bg-2);border-right:1px solid var(--line)}
|
|
950
972
|
.sback{flex:none;display:flex;align-items:center;gap:8px;padding:0 12px;margin:12px;height:var(--btn-s);border-radius:var(--r-s);font-size:13px;color:var(--dim);text-align:left}.sback:hover,.sup:hover{color:var(--ink)}
|
|
951
973
|
.sback svg,.sup svg{width:var(--ico);height:var(--ico);transform:rotate(90deg)}
|
|
952
974
|
.snav .sq{position:static;background:none;margin:0;padding:12px;border-block:1px solid var(--line)}
|
|
953
|
-
|
|
954
|
-
.
|
|
955
|
-
|
|
956
|
-
.
|
|
957
|
-
.
|
|
958
|
-
.
|
|
959
|
-
.
|
|
960
|
-
.
|
|
961
|
-
.
|
|
962
|
-
.
|
|
963
|
-
.
|
|
964
|
-
.
|
|
965
|
-
.
|
|
966
|
-
.
|
|
967
|
-
.
|
|
968
|
-
.
|
|
969
|
-
.
|
|
970
|
-
.
|
|
971
|
-
.
|
|
975
|
+
/* The icon tile: a small rounded square in the theme colour, as macOS draws its sidebar. */
|
|
976
|
+
.stile{flex:none;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:var(--r-s);color:var(--dim)}.stile svg{width:var(--ico-s);height:var(--ico-s)}
|
|
977
|
+
/* Settings for: the project being edited, where macOS shows your account. */
|
|
978
|
+
.sacct{flex:none;display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:10px 12px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-l)}
|
|
979
|
+
.sacct .stile,.spage>header .stile{background:var(--bg);border:1px solid var(--line);color:var(--ink)}.sacct .stile{width:34px;height:34px;border-radius:var(--r)}.sacct .stile svg{width:18px;height:18px}
|
|
980
|
+
.sacct-t{display:grid;min-width:0;flex:1;line-height:1.3}.sacct-t small{font-size:var(--fs-xs);color:var(--dim)}
|
|
981
|
+
.sacct select.sel{width:100%;min-width:0;height:var(--btn-s);padding:0;margin:0;border:0;background-color:transparent;box-shadow:none;font-size:var(--fs-l);font-weight:600;color:var(--ink-hi);text-overflow:ellipsis;cursor:pointer}
|
|
982
|
+
.snavs{flex:1;min-height:0;overflow-y:auto;padding:12px}
|
|
983
|
+
.snavg{display:grid;gap:1px;margin-bottom:14px}.snavg[hidden],.snavg button[hidden],.spage[hidden]{display:none}
|
|
984
|
+
.snavg button{display:flex;align-items:center;gap:8px;height:30px;padding:0 6px;border-radius:var(--r-s);font-size:13px;color:var(--ink);text-align:left;white-space:nowrap;overflow:hidden}
|
|
985
|
+
.snavg button>span:last-child{overflow:hidden;text-overflow:ellipsis}
|
|
986
|
+
.snavg button:hover{background:var(--hover)}.snavg button:hover .stile{color:var(--ink)}
|
|
987
|
+
.snavg button[aria-current],.snavg button[aria-current]:hover{background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--ink-hi);font-weight:500}.snavg button[aria-current] .stile{color:var(--accent)}
|
|
988
|
+
.smain{min-width:0;overflow-y:auto;padding:36px clamp(16px,5vw,56px) 64px}
|
|
989
|
+
.spage{max-width:720px;margin:0 auto}.sup{display:none}
|
|
990
|
+
.spage>header{display:flex;align-items:center;gap:14px;margin-bottom:24px;padding:0;border:0}
|
|
991
|
+
.spage>header .stile{width:52px;height:52px;border-radius:var(--r-l)}.spage>header .stile svg{width:26px;height:26px}
|
|
992
|
+
.spage>header h2{margin:0 0 6px;padding:0;border:0;font-size:22px;font-weight:600;line-height:1.2;color:var(--ink-hi)}
|
|
993
|
+
.spage>header p{margin:0;font-size:13px;line-height:1.5;color:var(--dim)}
|
|
994
|
+
.sset .sg{margin:24px 0 8px;padding:0;border:0;font-size:13px;font-weight:600;text-transform:none;letter-spacing:0;color:var(--ink-hi)}
|
|
995
|
+
.sset .sg:first-child,.sset .sg[hidden]:first-child+.sgrp+.sg{margin-top:0}
|
|
996
|
+
.sset .sgrp{background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-l);overflow:visible}.sset .sgrp:not(:has(*)){display:none}
|
|
997
|
+
.sset .sgrp>:not([hidden])~:not([hidden]){border-top:1px solid var(--line)}
|
|
998
|
+
.sset .srow,.sset .srow:not([hidden])~.srow:not([hidden]){margin:0;padding:10px 14px;min-height:44px;gap:2px 24px}
|
|
999
|
+
.sset .sk,.sset .ag{padding:10px 14px}
|
|
1000
|
+
.sset .srow label{align-self:center;font-size:13px;font-weight:400;color:var(--ink-hi)}
|
|
1001
|
+
.sset .srow>:nth-child(2){grid-row:1/3}@container (min-width:521px){.sset .srow:not(:has(>.hint))>:nth-child(2){grid-row:1}}
|
|
972
1002
|
.sset .srow .hint{grid-column:1;max-width:none;line-height:1.5}
|
|
973
1003
|
.sset .srow input.sel,.sset .srow select.sel{width:240px;height:var(--btn-s);padding:0 10px;border:1px solid var(--line);border-radius:var(--r-s);background-color:var(--bg);color:var(--ink);text-align:left;text-align-last:left}
|
|
974
1004
|
.sset .bar{gap:0;padding:0;background:none;border:1px solid var(--line);border-radius:var(--r-s);overflow:hidden}
|
|
975
1005
|
.sset .bar button{height:30px;padding:0 12px;border-radius:0;font-size:12px;color:var(--dim)}.sset .bar button+button{border-left:1px solid var(--line)}
|
|
976
1006
|
.sset .bar button.on,.sset .bar button.on:hover{background:var(--hover);box-shadow:none;color:var(--ink-hi)}
|
|
977
1007
|
.sset .step{background:none;border:1px solid var(--line)}
|
|
978
|
-
/* The phone card (Settings →
|
|
1008
|
+
/* The phone card (Settings → Phone, onboarding): steps, then the QR beside what to do on the phone. */
|
|
979
1009
|
.sset .srow.ph-card{display:block}
|
|
980
1010
|
#phset,#onb-phone{display:flex;flex-direction:column;gap:12px;font-size:13px;line-height:1.5;color:var(--ink)}
|
|
981
1011
|
#phset p,#onb-phone p{margin:0}
|
|
@@ -985,11 +1015,13 @@ aside .foot .more .menu-pop{left:0;right:auto;top:auto;bottom:calc(100% + 4px)}.
|
|
|
985
1015
|
.ph-qr{width:168px;flex:none;border-radius:var(--r);overflow:hidden}.ph-qr svg{display:block;width:100%;height:auto;stroke:none}.ph-qr svg *{stroke:none}
|
|
986
1016
|
.ph-st{display:flex;align-items:center;gap:6px;font-size:12px}.ph-dot{width:7px;height:7px;border-radius:50%;flex:none;background:var(--dim)}.ph-dot.on{background:var(--ok)}
|
|
987
1017
|
.ph-note{font-size:12px}.ph-err{color:var(--danger);font-size:12px}.ph-wait{color:var(--dim)}
|
|
988
|
-
/* A narrow
|
|
1018
|
+
/* A narrow page (small desktop window, split screen) stacks each row: label and hint on top, control below. */
|
|
989
1019
|
.scard{container-type:inline-size}
|
|
990
1020
|
@container (max-width:520px){.sset .srow{grid-template-columns:minmax(0,1fr)}.sset .srow>:nth-child(2){grid-column:1;grid-row:auto;justify-self:start;margin-top:6px;max-width:100%}.sset .srow .hint{grid-row:auto}.sset .srow input.sel,.sset .srow select.sel,.sset .fpick{width:100%}.sset .bar{flex-wrap:wrap}}
|
|
991
|
-
|
|
992
|
-
|
|
1021
|
+
/* General opens on About: the version and the update check, in a box like the rest. */
|
|
1022
|
+
#supd:not(:empty){margin-bottom:24px}#supd:not(:empty)::before{content:"About";display:block;margin:0 0 8px;font-size:13px;font-weight:600;color:var(--ink-hi)}.sset #supd .updbar{margin:0;padding:10px 14px;border-radius:var(--r-l)}.sset #supd .updbar.quiet{padding:10px 14px;border:1px solid var(--line);background:var(--bg-2);color:var(--ink-hi)}
|
|
1023
|
+
/* A phone opens on the list of pages, drawn as grouped boxes, and each page has a back row. */
|
|
1024
|
+
@media(max-width:640px){.sset{display:block;height:auto}.snav{background:none;border:0}.sback{display:none}.snav .sq{border:0;padding:0 0 12px}.sacct{margin:0 0 16px}.snavs{overflow:visible;padding:0}.snavg{gap:0;margin-bottom:20px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-l);overflow:hidden}.snavg button{height:44px;padding:0 12px;gap:12px;border-radius:0;font-size:15px}.snavg button:not([hidden])~button:not([hidden]){border-top:1px solid var(--line)}.snavg .stile{width:28px;height:28px}.snavg .stile svg{width:var(--ico);height:var(--ico)}.sset:not(.pick) .snav{display:none}.sset.pick .smain>.spage{display:none}.smain{overflow:visible;padding:0 0 24px}.sup{display:flex;align-items:center;gap:6px;margin-bottom:12px;font-size:13px;color:var(--dim)}.spage>header{gap:12px;margin-bottom:20px}.spage>header .stile{width:40px;height:40px}.spage>header .stile svg{width:20px;height:20px}.sset .srow{grid-template-columns:minmax(0,1fr)}.sset .srow>:nth-child(2){grid-column:1;grid-row:auto;justify-self:start;margin-top:6px;max-width:100%}.sset .srow .hint{grid-row:auto}.sset .srow input.sel,.sset .fpick{width:100%}.sset .fpick input.sel{flex:1;min-width:0}.sset .bar{flex-wrap:wrap}}
|
|
993
1025
|
/* the one switch, everywhere (toggle() in board/dom.ts writes it): a <button role="switch"> flipped with .on, or a
|
|
994
1026
|
checkbox (:checked) where a form reads it; drawn as a track and a thumb. .sm is the compact size. */
|
|
995
1027
|
.chk{appearance:none;margin:0;border:0;cursor:pointer;width:51px;height:31px;flex:none;border-radius:var(--r-pill);background:color-mix(in srgb,var(--dim) 40%,transparent);position:relative;transition:background .12s}
|
|
@@ -1405,7 +1437,7 @@ html body.wsb:not(.paged) #board{grid-template-columns:repeat(4,minmax(200px,1fr
|
|
|
1405
1437
|
<symbol id="r-term" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3M13 15h4"/></symbol>
|
|
1406
1438
|
</defs></svg>
|
|
1407
1439
|
<a class="it gs-it" href="#" id="gsearch" title="Search everything"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="M20 20l-4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg><span class="lbl">Search</span></a>
|
|
1408
|
-
<a class="it" href="/" data-view="home" title="
|
|
1440
|
+
<a class="it" href="/" data-view="home" title="Chat with the project's agent"><svg class="dkl"><use href="#r-chat"/></svg><svg class="phl"><use href="#i-home"/></svg><span class="lbl"><span class="dkl">Chat</span><span class="phl">Home</span></span></a>
|
|
1409
1441
|
<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>
|
|
1410
1442
|
<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>
|
|
1411
1443
|
<a class="it ponly" href="/?view=terminal" data-view="terminal" title="Open terminals across all projects"><svg><use href="#r-term"/></svg><span class="lbl">Terminal</span></a>
|