kaizen-agent 1.87.3 → 1.87.4
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/activity.ts +86 -0
- package/cli/add-project.ts +64 -1
- package/cli/auto-update.ts +33 -0
- package/cli/chat.ts +88 -13
- package/cli/install.ts +65 -36
- package/cli/look.ts +1 -0
- package/cli/onboarding.ts +9 -4
- package/cli/pty.ts +27 -12
- package/cli/release.ts +13 -1
- package/cli/settings.ts +39 -7
- package/cli/state.ts +54 -1
- package/cli/task-service.ts +8 -3
- package/cli/usage.ts +15 -2
- package/cli/web.ts +88 -41
- package/cli/whats-new.json +38 -0
- package/cli/whats-new.ts +43 -0
- package/cli/workers.ts +2 -2
- package/package.json +1 -1
- package/skills/kaizen/config.default.yml +3 -0
- package/skills/kaizen/spec.md +6 -0
- package/skills/kaizen-explore/SKILL.md +7 -0
- package/web/components/home/index.ts +1 -0
- package/web/components/home/onboarding-dialog.tsx +44 -7
- package/web/components/home/works-flow.tsx +119 -0
- package/web/components/project/add-project-dialog.tsx +1 -1
- package/web/components/rail/rail-list.tsx +8 -6
- package/web/components/run/doc-body.tsx +43 -0
- package/web/components/settings/agent-rows.tsx +15 -11
- package/web/components/settings/browser-row.tsx +1 -1
- package/web/components/settings/setting-row.tsx +2 -1
- package/web/components/settings/skill-card.tsx +32 -2
- package/web/components/settings/update-bar.tsx +53 -35
- package/web/components/settings/whats-new-card.tsx +70 -0
- package/web/components/shell/rail.tsx +8 -4
- package/web/dist/annotate.js +1 -1
- package/web/dist/board.css +3 -3
- package/web/dist/board.js +83 -58
- package/web/dist/boot.js +1 -1
- package/web/dist/notebook.css +2 -2
- package/web/dist/notebook.js +27 -27
- package/web/dist/popup.css +1 -1
- package/web/dist/popup.js +1 -1
- package/web/dist/term.js +1 -1
- package/web/dist/ui.css +2 -2
- package/web/dist/video.js +1 -1
- package/web/lib/footer/footer-rules.ts +8 -2
- package/web/lib/footer/footer-store.ts +2 -2
- package/web/lib/home/onboarding.ts +63 -17
- package/web/lib/project/add-project.ts +6 -0
- package/web/lib/run/panel-derive.ts +1 -1
- package/web/lib/run/panel-store.ts +1 -0
- package/web/lib/settings/index.ts +1 -0
- package/web/lib/settings/settings.ts +6 -1
- package/web/lib/settings/whats-new.ts +36 -0
- package/web/pages/board/App.tsx +2 -1
- package/web/pages/task-page.tsx +17 -4
- package/web/ui/legacy/board.css +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// First-run onboarding: one panel over the board with
|
|
2
|
-
// your first project". Where a user got to is kept by the board in ~/.kaizen/onboarding.json (/onboarding), so a skipped or
|
|
1
|
+
// First-run onboarding: one panel over the board with five steps (how kaizen works, default agent, how much to ask, look and
|
|
2
|
+
// notifications, phone), then "Add your first project". Where a user got to is kept by the board in ~/.kaizen/onboarding.json (/onboarding), so a skipped or
|
|
3
3
|
// half-done flow can be continued from the side menu's Setup row or the "Continue setup?" popup. Existing users, who have a
|
|
4
4
|
// project, never see it. This file is its rules and requests; components/home/onboarding-dialog.tsx draws it.
|
|
5
5
|
import { create } from "zustand";
|
|
6
|
-
import { openAdd } from "@lib/project";
|
|
6
|
+
import { onProjectAdded, openAdd } from "@lib/project";
|
|
7
7
|
import { ask } from "@lib/core";
|
|
8
8
|
import { setSetupRow, setShell, setTheme } from "@lib/shell";
|
|
9
9
|
|
|
@@ -13,6 +13,7 @@ export type Cfg = {
|
|
|
13
13
|
step: number;
|
|
14
14
|
total: number;
|
|
15
15
|
default: string;
|
|
16
|
+
preset: string;
|
|
16
17
|
installed: string[];
|
|
17
18
|
agents: { cmd: string; name: string }[];
|
|
18
19
|
install: Record<string, { command?: string; docs: string }>;
|
|
@@ -20,19 +21,42 @@ export type Cfg = {
|
|
|
20
21
|
export type Notif = "na" | "default" | "granted" | "denied";
|
|
21
22
|
// The tools agent.default accepts.
|
|
22
23
|
export const PICKABLE = ["claude", "codex", "agy", "opencode", "gemini"];
|
|
23
|
-
export const NAMES = ["Default agent", "
|
|
24
|
+
export const NAMES = ["How it works", "Default agent", "How much to ask", "Look and alerts", "Phone"];
|
|
24
25
|
export const COPY = [
|
|
26
|
+
{
|
|
27
|
+
title: "How kaizen works",
|
|
28
|
+
sub: "You describe what you want. An AI agent does it in steps, and you stay in charge.",
|
|
29
|
+
},
|
|
25
30
|
{
|
|
26
31
|
title: "Pick your default agent",
|
|
27
32
|
sub: "kaizen works with every CLI agent. Choose the one you will reach for most. You can change it any time in Settings.",
|
|
28
33
|
},
|
|
29
|
-
{
|
|
30
|
-
|
|
34
|
+
{
|
|
35
|
+
title: "How much should kaizen ask you?",
|
|
36
|
+
sub: "This sets how many agents work and when it stops to ask. Change it any time in Settings → Runs.",
|
|
37
|
+
},
|
|
38
|
+
{ title: "Make it yours", sub: "Pick a look, and choose whether kaizen may tell you when it needs you." },
|
|
31
39
|
{
|
|
32
40
|
title: "Use kaizen on your phone",
|
|
33
41
|
sub: "Optional. Check runs and answer agents from your phone. You can skip this now; it is also in Settings → Phone.",
|
|
34
42
|
},
|
|
35
43
|
];
|
|
44
|
+
// The steps by what they hold, so a step can move without every number changing.
|
|
45
|
+
export const STEP = { works: 0, agent: 1, ask: 2, look: 3, phone: 4 } as const;
|
|
46
|
+
// The three presets in plain words. `id` is the preset's own name, which Settings → Runs shows.
|
|
47
|
+
export const ASK = [
|
|
48
|
+
{ id: "low", name: "You approve every step", tag: "Low · cheapest", text: "One agent session does the work. You approve the plan and the result." },
|
|
49
|
+
{ id: "medium", name: "Balanced", tag: "Medium · recommended", text: "Separate agents plan, build and check. You approve the plan; problems the checker finds are fixed for you." },
|
|
50
|
+
{ id: "ultra", name: "Hands-off", tag: "Ultra · costs the most", text: "Runs start to finish without asking, fixes problems itself and saves the work in git." },
|
|
51
|
+
];
|
|
52
|
+
// The steps' order of the flow in the first card: who does each, for the picture's colours.
|
|
53
|
+
export const FLOW = [
|
|
54
|
+
{ name: "ask", you: true },
|
|
55
|
+
{ name: "plan", you: false },
|
|
56
|
+
{ name: "approve", you: true },
|
|
57
|
+
{ name: "build", you: false },
|
|
58
|
+
{ name: "review", you: false },
|
|
59
|
+
];
|
|
36
60
|
export const NOTIF_TEXT: Record<Notif, string> = {
|
|
37
61
|
na: "Notifications are not available at this address. Open kaizen at localhost or over HTTPS to turn them on.",
|
|
38
62
|
default: "Allow notifications so a run that needs you, or an agent that finishes, reaches you in another window.",
|
|
@@ -50,9 +74,10 @@ export function agentGroups(c: Cfg) {
|
|
|
50
74
|
all,
|
|
51
75
|
};
|
|
52
76
|
}
|
|
53
|
-
// The agent picked when the flow opens: the saved default, else the first one found.
|
|
77
|
+
// The agent picked when the flow opens: the saved default when it is installed, else the first one found, else none. A tool
|
|
78
|
+
// that is not installed is never ticked for someone; they may pick it to see how to install it.
|
|
54
79
|
export const defaultPick = (c: Cfg) =>
|
|
55
|
-
PICKABLE.includes(c.default)
|
|
80
|
+
PICKABLE.includes(c.default) && c.installed.includes(c.default)
|
|
56
81
|
? c.default
|
|
57
82
|
: (c.agents.find((a) => PICKABLE.includes(a.cmd) && c.installed.includes(a.cmd))?.cmd ?? "");
|
|
58
83
|
// The picked agent is not on PATH: how to install it (the panel under the cards), else nothing.
|
|
@@ -71,9 +96,11 @@ export function storedTheme(): "light" | "dark" | "system" {
|
|
|
71
96
|
}
|
|
72
97
|
}
|
|
73
98
|
export const offerText = (c: Pick<Cfg, "step" | "total">) =>
|
|
74
|
-
c.step
|
|
75
|
-
?
|
|
76
|
-
:
|
|
99
|
+
c.step >= c.total - 1
|
|
100
|
+
? "One step left: add your first project."
|
|
101
|
+
: c.step > 0
|
|
102
|
+
? `You are on step ${c.step + 1} of ${c.total}. It only takes a minute.`
|
|
103
|
+
: "You skipped setup. It only takes a minute.";
|
|
77
104
|
|
|
78
105
|
async function call(path: string, body?: object) {
|
|
79
106
|
try {
|
|
@@ -88,7 +115,8 @@ async function call(path: string, body?: object) {
|
|
|
88
115
|
return null;
|
|
89
116
|
}
|
|
90
117
|
}
|
|
91
|
-
|
|
118
|
+
// preset: the card ticked ("" when the board's settings are custom, so nothing is); picked: the user chose one, so it is saved.
|
|
119
|
+
export type Flow = { step: number; agent: string; theme: string; more: boolean; preset: string; picked: boolean };
|
|
92
120
|
export const useOnboarding = create<{ cfg: Cfg | null; flow: Flow | null; offer: boolean }>()(() => ({
|
|
93
121
|
cfg: null,
|
|
94
122
|
flow: null,
|
|
@@ -119,14 +147,25 @@ export function openFlow(at: number) {
|
|
|
119
147
|
agent: defaultPick(cfg),
|
|
120
148
|
theme: storedTheme(),
|
|
121
149
|
more: false,
|
|
150
|
+
preset: ASK.some((a) => a.id === cfg.preset) ? cfg.preset : "",
|
|
151
|
+
picked: false,
|
|
122
152
|
},
|
|
123
153
|
});
|
|
124
154
|
}
|
|
125
|
-
// The agent picked on
|
|
155
|
+
// The agent picked on its step is saved when the user leaves it, by Continue or by a progress bar.
|
|
126
156
|
const keepAgent = () => {
|
|
127
157
|
const f = get().flow;
|
|
128
|
-
return f && f.step ===
|
|
158
|
+
return f && f.step === STEP.agent && f.agent ? call("/settings", { key: "agent.default", value: f.agent }) : null;
|
|
159
|
+
};
|
|
160
|
+
// The preset is saved only when the user picked a card (and a different one than the board has): nothing changes silently, and
|
|
161
|
+
// custom settings are never replaced by a Continue.
|
|
162
|
+
const keepPreset = () => {
|
|
163
|
+
const { cfg, flow } = get();
|
|
164
|
+
if (!cfg || !flow || flow.step !== STEP.ask || !flow.picked || flow.preset === cfg.preset) return null;
|
|
165
|
+
set({ cfg: { ...cfg, preset: flow.preset } });
|
|
166
|
+
return call("/settings", { key: "preset", value: flow.preset });
|
|
129
167
|
};
|
|
168
|
+
export const pickPreset = (preset: string) => edit({ preset, picked: true });
|
|
130
169
|
export const pickAgent = (agent: string) => edit({ agent });
|
|
131
170
|
export const toggleMore = () => edit({ more: !get().flow?.more });
|
|
132
171
|
export function pickTheme(theme: string) {
|
|
@@ -136,12 +175,14 @@ export function pickTheme(theme: string) {
|
|
|
136
175
|
export async function next() {
|
|
137
176
|
const { cfg, flow } = get();
|
|
138
177
|
if (!cfg || !flow) return;
|
|
139
|
-
await keepAgent();
|
|
178
|
+
await Promise.all([keepAgent(), keepPreset()]);
|
|
140
179
|
if (flow.step < cfg.total - 1) {
|
|
141
180
|
edit({ step: flow.step + 1 });
|
|
142
181
|
return void save({ step: flow.step + 1 });
|
|
143
182
|
}
|
|
144
|
-
|
|
183
|
+
// Not "done": setup ends when a project exists (the board stops offering it then), so cancelling the add dialog leaves the Setup
|
|
184
|
+
// row and the Continue setup popup waiting.
|
|
185
|
+
void save({ step: flow.step });
|
|
145
186
|
close();
|
|
146
187
|
openAdd({ start: "folder" });
|
|
147
188
|
}
|
|
@@ -153,6 +194,7 @@ export function back() {
|
|
|
153
194
|
}
|
|
154
195
|
export function goto(step: number) {
|
|
155
196
|
void keepAgent();
|
|
197
|
+
void keepPreset();
|
|
156
198
|
edit({ step });
|
|
157
199
|
void save({ step });
|
|
158
200
|
}
|
|
@@ -180,6 +222,10 @@ export function answerOffer(r: "go" | "later" | "never") {
|
|
|
180
222
|
// late answer after that does nothing.
|
|
181
223
|
export function initOnboarding() {
|
|
182
224
|
let alive = true;
|
|
225
|
+
// A project was added: the board stops offering setup, so the Setup row goes now, not on the next reload.
|
|
226
|
+
const off = onProjectAdded(() =>
|
|
227
|
+
void call("/onboarding").then((c: Cfg | null) => c && alive && (set({ cfg: c }), setSetupRow(c))),
|
|
228
|
+
);
|
|
183
229
|
void (async () => {
|
|
184
230
|
const cfg: Cfg | null = await call("/onboarding");
|
|
185
231
|
if (!cfg || !alive) return;
|
|
@@ -195,5 +241,5 @@ export function initOnboarding() {
|
|
|
195
241
|
if (cfg.show) return openFlow(0);
|
|
196
242
|
if (cfg.resume) offer();
|
|
197
243
|
})();
|
|
198
|
-
return () => void (alive = false);
|
|
244
|
+
return () => (off(), void (alive = false));
|
|
199
245
|
}
|
|
@@ -12,6 +12,11 @@ let opened = 0;
|
|
|
12
12
|
export const openAdd = (o: AddOpts = {}) => useAddProject.setState({ open: { ...o, n: ++opened } });
|
|
13
13
|
export const closeAdd = () => useAddProject.setState({ open: null });
|
|
14
14
|
|
|
15
|
+
// Told when a project was added (an existing folder, a clone, a new one): first-run setup is finished by it, not by a click.
|
|
16
|
+
const added = new Set<() => void>();
|
|
17
|
+
export const onProjectAdded = (f: () => void) => (added.add(f), () => void added.delete(f));
|
|
18
|
+
const ADDS = ["/add-project", "/new-project", "/clone"];
|
|
19
|
+
|
|
15
20
|
export async function call(path: string, body?: object): Promise<{ ok: boolean; d: any }> {
|
|
16
21
|
try {
|
|
17
22
|
const r = await fetch(
|
|
@@ -21,6 +26,7 @@ export async function call(path: string, body?: object): Promise<{ ok: boolean;
|
|
|
21
26
|
: undefined,
|
|
22
27
|
);
|
|
23
28
|
const d = await r.json().catch(() => ({}));
|
|
29
|
+
if (r.ok && body && ADDS.includes(path)) added.forEach((f) => f());
|
|
24
30
|
return { ok: r.ok, d: r.ok ? d : { error: d.error || d.why || "that did not work" } };
|
|
25
31
|
} catch {
|
|
26
32
|
return { ok: false, d: { error: "kaizen is offline" } };
|
|
@@ -139,7 +139,7 @@ export function deriveRun(i: RunIn): RunDraw {
|
|
|
139
139
|
doc:
|
|
140
140
|
k === "notes" || k === "git"
|
|
141
141
|
? null
|
|
142
|
-
: { k, id: c.id, text: doc || null, progress: k === "backlog" && c.column === 2 ? d.progress || null : null, needle: needle && !i.refresh ? needle : null, mark: 0 },
|
|
142
|
+
: { k, id: c.id, text: doc || null, progress: k === "backlog" && c.column === 2 ? d.progress || null : null, activity: k === "backlog" && c.column === 2 && Array.isArray(d.activity) ? d.activity : [], needle: needle && !i.refresh ? needle : null, mark: 0 },
|
|
143
143
|
notes: k === "notes" ? { card: c, src: doc, ro: !!c.archived || c.status === "done" || c.status === "abandoned", linked: d.linkedFrom } : null,
|
|
144
144
|
fix,
|
|
145
145
|
footer: { card: c, plan: d.plan, sourceControl: k !== "git" && i.git.pending },
|
|
@@ -21,6 +21,7 @@ export type PanelDoc = {
|
|
|
21
21
|
id: string;
|
|
22
22
|
text: string | null;
|
|
23
23
|
progress: string | null;
|
|
24
|
+
activity: { t: number; text: string }[]; // what the agent's hooks reported, oldest first (a building run's panel only)
|
|
24
25
|
needle: string | null;
|
|
25
26
|
mark: number;
|
|
26
27
|
};
|
|
@@ -83,7 +83,7 @@ const PAGE_ALIAS: Record<string, string> = { voice: "keyboard", shortcuts: "keyb
|
|
|
83
83
|
export const pageId = (id: string) => PAGE_ALIAS[id] ?? id;
|
|
84
84
|
// Subsections that should come first on their page, whatever order their rows arrive in.
|
|
85
85
|
export const SUB_ORDER: Record<string, string[]> = {
|
|
86
|
-
general: ["Storage", "Folders", "App"],
|
|
86
|
+
general: ["Updates", "Storage", "Folders", "App"],
|
|
87
87
|
keyboard: ["Shortcuts", "Dictation"],
|
|
88
88
|
};
|
|
89
89
|
// First match wins: [key pattern, page, subsection].
|
|
@@ -104,6 +104,7 @@ const PLACES: [RegExp, string, string][] = [
|
|
|
104
104
|
[/^git\./, "git", "Git"],
|
|
105
105
|
[/^ui\./, "terminal", "Terminal"],
|
|
106
106
|
[/^board\.chat_hotkey$/, "keyboard", "Shortcuts"],
|
|
107
|
+
[/^board\.auto_update$/, "general", "Updates"],
|
|
107
108
|
[/^board\.(projects_dir|video_dir)$/, "general", "Folders"],
|
|
108
109
|
[/^board\./, "general", "App"],
|
|
109
110
|
[/^state\./, "general", "Storage"],
|
|
@@ -121,6 +122,8 @@ export type Row = {
|
|
|
121
122
|
help?: string;
|
|
122
123
|
group?: string;
|
|
123
124
|
values: string[];
|
|
125
|
+
// What an option is called on screen, by its stored value (cli/settings.ts); a value with no entry shows as it is.
|
|
126
|
+
labels?: Record<string, string>;
|
|
124
127
|
value: string;
|
|
125
128
|
own?: boolean;
|
|
126
129
|
idle?: string;
|
|
@@ -168,6 +171,8 @@ export function controlOf(r: Pick<Row, "key" | "values" | "text" | "folder">): C
|
|
|
168
171
|
return "segments";
|
|
169
172
|
return "stepper";
|
|
170
173
|
}
|
|
174
|
+
// An option as the page shows it.
|
|
175
|
+
export const optionText = (r: Pick<Row, "labels">, v: string) => r.labels?.[v] ?? v;
|
|
171
176
|
export const settingId = (key: string) => "s-" + key.replace(/\./g, "-");
|
|
172
177
|
export const modelTool = (key: string) => key.split(".").pop()!;
|
|
173
178
|
export const modelName = (label: string) => label.replace(/^(Worker|Handoff) model: /, "");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// What's New (cli/whats-new.ts): the installed version's highlights and fixes, shown as a card under Settings → General → About.
|
|
2
|
+
// It opens by itself the first time after an update (the Settings gear carries a dot until then), and the About bar's What's new
|
|
3
|
+
// button opens and closes it any time. Got it / Hide record it as seen on this machine, not just this browser.
|
|
4
|
+
import { create } from "zustand";
|
|
5
|
+
import { post } from "@lib/core";
|
|
6
|
+
|
|
7
|
+
export type WhatsNew = {
|
|
8
|
+
version: string;
|
|
9
|
+
entry: { version: string; highlights: { title: string; text: string }[]; fixes: string[] } | null;
|
|
10
|
+
unseen: boolean;
|
|
11
|
+
};
|
|
12
|
+
// open: null means "follow unseen", true / false is what the user chose.
|
|
13
|
+
export const useWhatsNew = create<{ data: WhatsNew | null; open: boolean | null }>()(() => ({
|
|
14
|
+
data: null,
|
|
15
|
+
open: null,
|
|
16
|
+
}));
|
|
17
|
+
export const loadWhatsNew = () =>
|
|
18
|
+
fetch("/whats-new")
|
|
19
|
+
.then((r) => (r.ok ? r.json() : null))
|
|
20
|
+
.then((data: WhatsNew | null) => data && useWhatsNew.setState({ data }))
|
|
21
|
+
.catch(() => {});
|
|
22
|
+
// Whether the card is showing: what the user chose, else whether this machine has not seen it yet. Nothing without an entry.
|
|
23
|
+
export const cardOpen = (s: { data: WhatsNew | null; open: boolean | null }) =>
|
|
24
|
+
!!s.data?.entry && (s.open ?? s.data.unseen);
|
|
25
|
+
export const toggleWhatsNew = () => {
|
|
26
|
+
const s = useWhatsNew.getState();
|
|
27
|
+
if (cardOpen(s)) return void closeWhatsNew();
|
|
28
|
+
useWhatsNew.setState({ open: true });
|
|
29
|
+
};
|
|
30
|
+
export async function closeWhatsNew() {
|
|
31
|
+
useWhatsNew.setState({ open: false });
|
|
32
|
+
const s = useWhatsNew.getState();
|
|
33
|
+
if (!s.data?.unseen) return;
|
|
34
|
+
const r = await post("/whats-new", {});
|
|
35
|
+
if (r.ok) useWhatsNew.setState({ data: { ...s.data, unseen: false } });
|
|
36
|
+
}
|
package/web/pages/board/App.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { TooltipProvider } from "@web/ui";
|
|
|
3
3
|
import { useRouteClasses } from "@lib/router";
|
|
4
4
|
import { useBoard } from "@lib/board";
|
|
5
5
|
import { useRunView } from "@lib/run";
|
|
6
|
-
import { checkUpdate } from "@lib/settings";
|
|
6
|
+
import { checkUpdate, loadWhatsNew } from "@lib/settings";
|
|
7
7
|
import { SourceMarks } from "@components/rail";
|
|
8
8
|
import { Rail, Sprite } from "@components/shell";
|
|
9
9
|
import { FootBar } from "@components/footer";
|
|
@@ -43,6 +43,7 @@ export function App() {
|
|
|
43
43
|
// Hourly so a tab left open still hears of a release; the server's cache limits npm to every 6 h.
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
void checkUpdate();
|
|
46
|
+
void loadWhatsNew();
|
|
46
47
|
const t = setInterval(checkUpdate, 3600_000);
|
|
47
48
|
return () => clearInterval(t);
|
|
48
49
|
}, []);
|
package/web/pages/task-page.tsx
CHANGED
|
@@ -53,7 +53,8 @@ function Task() {
|
|
|
53
53
|
[follow, setFollow] = useState(true),
|
|
54
54
|
[artifactId, setArtifactId] = useState(""),
|
|
55
55
|
[drawer, setDrawer] = useState<boolean | null>(null),
|
|
56
|
-
[confirm, setConfirm] = useState<"" | "abandon" | "delete">("")
|
|
56
|
+
[confirm, setConfirm] = useState<"" | "abandon" | "delete">(""),
|
|
57
|
+
[denied, setDenied] = useState(false);
|
|
57
58
|
const thread = useRef<HTMLDivElement>(null),
|
|
58
59
|
input = useRef<HTMLTextAreaElement>(null);
|
|
59
60
|
const t = page?.task;
|
|
@@ -109,6 +110,7 @@ function Task() {
|
|
|
109
110
|
};
|
|
110
111
|
const send = async () => {
|
|
111
112
|
if (!(await sendMessage(selectedId))) return void input.current?.focus();
|
|
113
|
+
setDenied(false);
|
|
112
114
|
setFollow(true);
|
|
113
115
|
setDrawer(true);
|
|
114
116
|
input.current?.focus();
|
|
@@ -199,15 +201,19 @@ function Task() {
|
|
|
199
201
|
</header>
|
|
200
202
|
<div role="status" className="flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 text-base">
|
|
201
203
|
<StatusBadge category={t.attention?.category ?? "in-progress"}>{taskStatus(t)}</StatusBadge>
|
|
202
|
-
|
|
204
|
+
{/* While the agent waits on a permission the status must not say it is planning; after Deny it waits for an instruction. */}
|
|
205
|
+
{!(t.agentAsking && t.agentAlive) && <span className="text-muted-foreground">{t.attention?.action || ""}</span>}
|
|
206
|
+
{denied && !t.agentAsking && (
|
|
207
|
+
<span className="text-muted-foreground">Denied. The agent is waiting for your instruction: tell it what to do instead in the message box.</span>
|
|
208
|
+
)}
|
|
203
209
|
<span className="text-muted-foreground">{isCurrent && !t.decision ? (t.actions?.acceptWhy ?? "") : ""}</span>
|
|
204
210
|
{t.agentAsking && t.agentAlive && (
|
|
205
211
|
<span className="flex items-baseline gap-2 text-warning">
|
|
206
212
|
Waiting for permission
|
|
207
|
-
<Button disabled={pending} onClick={() => void runAction("prompt", { answer: "yes" })}>
|
|
213
|
+
<Button disabled={pending} onClick={() => (setDenied(false), void runAction("prompt", { answer: "yes" }))}>
|
|
208
214
|
Allow
|
|
209
215
|
</Button>
|
|
210
|
-
<Button disabled={pending} onClick={() => void runAction("prompt", { answer: "no" })}>
|
|
216
|
+
<Button disabled={pending} onClick={() => void runAction("prompt", { answer: "no" }).then((r) => r?.ok && setDenied(true))}>
|
|
211
217
|
Deny
|
|
212
218
|
</Button>
|
|
213
219
|
</span>
|
|
@@ -324,6 +330,13 @@ function Task() {
|
|
|
324
330
|
/>
|
|
325
331
|
))}
|
|
326
332
|
</div>
|
|
333
|
+
{resume && (
|
|
334
|
+
<div className="mb-2 flex justify-start px-1">
|
|
335
|
+
<Button variant="primary" disabled={pending} onClick={() => void runAction("resume")}>
|
|
336
|
+
{t.status === "failed" ? "Retry" : "Resume"}
|
|
337
|
+
</Button>
|
|
338
|
+
</div>
|
|
339
|
+
)}
|
|
327
340
|
{t.status === "working" && <TypingDots />}
|
|
328
341
|
{queue.length > 0 && (
|
|
329
342
|
<div aria-label="Requests awaiting completion" className="mb-1.5 flex justify-end gap-1.5 px-1">
|
package/web/ui/legacy/board.css
CHANGED
|
@@ -348,7 +348,7 @@ aside.wide{width:100%;border-left:0}@media(min-width:901px){aside.wide{width:62%
|
|
|
348
348
|
/* the flat footer under everything: agent usage, refresh; terminal count and phone on the right */
|
|
349
349
|
@media(min-width:641px){body{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto}.rail{grid-area:1/1}.app{grid-area:1/2}#context{grid-area:1/3}.foot{grid-area:2/1/3/-1}.app{margin-bottom:0}#context{margin-bottom:0}}
|
|
350
350
|
.foot{display:flex;align-items:center;gap:14px;padding:5px 12px;font-size:12px;color:var(--dim);min-width:0;white-space:nowrap}
|
|
351
|
-
.foot svg{width:15px;height:15px}
|
|
351
|
+
.foot svg{width:15px;height:15px}.foot :is(span,b){text-box:trim-both cap alphabetic}
|
|
352
352
|
.foot .fb{display:flex;align-items:center;gap:6px;padding:3px 7px;border-radius:var(--r-s);color:var(--dim);text-decoration:none}.foot .fb:hover{background:var(--hover);color:var(--ink)}.foot .fb[hidden]{display:none}
|
|
353
353
|
.foot button.fb{border:0;background:none;font:inherit;cursor:pointer}.foot .fb[aria-expanded=true]{background:var(--hover);color:var(--ink)}
|
|
354
354
|
/* Resource monitor, laid out like macOS Control Center: two half tiles (Memory, Storage) that open in place, then the terminals */
|