kaizen-agent 1.87.2 → 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.
Files changed (76) hide show
  1. package/cli/activity.ts +86 -0
  2. package/cli/add-project.ts +64 -1
  3. package/cli/auto-update.ts +33 -0
  4. package/cli/browser.ts +21 -0
  5. package/cli/chat.ts +88 -13
  6. package/cli/chatgpt.ts +1 -1
  7. package/cli/dashboard.ts +1 -1
  8. package/cli/install.ts +65 -36
  9. package/cli/look.ts +1 -0
  10. package/cli/models.ts +94 -0
  11. package/cli/onboarding.ts +9 -4
  12. package/cli/pty.ts +27 -12
  13. package/cli/release.ts +13 -1
  14. package/cli/settings.ts +39 -7
  15. package/cli/sources.ts +84 -20
  16. package/cli/state.ts +56 -3
  17. package/cli/task-service.ts +10 -3
  18. package/cli/usage.ts +15 -2
  19. package/cli/web.ts +119 -47
  20. package/cli/whats-new.json +38 -0
  21. package/cli/whats-new.ts +43 -0
  22. package/cli/workers.ts +2 -2
  23. package/package.json +1 -1
  24. package/skills/kaizen/config.default.yml +3 -0
  25. package/skills/kaizen/spec.md +6 -0
  26. package/skills/kaizen-explore/SKILL.md +7 -0
  27. package/web/components/home/home-window.tsx +0 -36
  28. package/web/components/home/index.ts +1 -0
  29. package/web/components/home/onboarding-dialog.tsx +44 -7
  30. package/web/components/home/works-flow.tsx +119 -0
  31. package/web/components/icebox/capture-box.tsx +11 -2
  32. package/web/components/icebox/request-card.tsx +33 -11
  33. package/web/components/project/add-project-dialog.tsx +1 -1
  34. package/web/components/rail/rail-list.tsx +51 -7
  35. package/web/components/run/doc-body.tsx +43 -0
  36. package/web/components/settings/agent-rows.tsx +15 -11
  37. package/web/components/settings/browser-row.tsx +1 -1
  38. package/web/components/settings/setting-row.tsx +10 -6
  39. package/web/components/settings/settings-section.tsx +5 -3
  40. package/web/components/settings/skill-card.tsx +32 -2
  41. package/web/components/settings/update-bar.tsx +53 -35
  42. package/web/components/settings/whats-new-card.tsx +70 -0
  43. package/web/components/shared/picker.tsx +21 -1
  44. package/web/components/shell/rail.tsx +8 -4
  45. package/web/dist/annotate.js +1 -1
  46. package/web/dist/board.css +6 -11
  47. package/web/dist/board.js +83 -56
  48. package/web/dist/boot.js +1 -1
  49. package/web/dist/notebook.css +2 -2
  50. package/web/dist/notebook.js +34 -34
  51. package/web/dist/popup.css +1 -1
  52. package/web/dist/popup.js +1 -1
  53. package/web/dist/term.js +1 -1
  54. package/web/dist/ui.css +2 -2
  55. package/web/dist/video.js +1 -1
  56. package/web/lib/footer/footer-rules.ts +8 -2
  57. package/web/lib/footer/footer-store.ts +2 -2
  58. package/web/lib/home/onboarding.ts +63 -17
  59. package/web/lib/icebox/icebox-actions.ts +24 -2
  60. package/web/lib/icebox/icebox-store.ts +7 -1
  61. package/web/lib/icebox/icebox-view.ts +3 -2
  62. package/web/lib/icebox/icebox.ts +24 -4
  63. package/web/lib/icebox/use-ice-keys.ts +5 -0
  64. package/web/lib/project/add-project.ts +6 -0
  65. package/web/lib/rail/rules.ts +4 -1
  66. package/web/lib/run/panel-derive.ts +1 -1
  67. package/web/lib/run/panel-store.ts +1 -0
  68. package/web/lib/settings/index.ts +2 -0
  69. package/web/lib/settings/settings-actions.ts +8 -0
  70. package/web/lib/settings/settings.ts +6 -4
  71. package/web/lib/settings/use-model-choices.ts +31 -0
  72. package/web/lib/settings/whats-new.ts +36 -0
  73. package/web/pages/board/App.tsx +3 -10
  74. package/web/pages/icebox-page.tsx +173 -125
  75. package/web/pages/task-page.tsx +17 -4
  76. package/web/ui/legacy/board.css +4 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.87.2",
3
+ "version": "1.87.4",
4
4
  "description": "Staged workflow for AI agents — code, writing, research, operations: plan, human approval, build, independent review, bounded fix loop.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -249,6 +249,9 @@ agent:
249
249
  # gemini: { model: gemini-2.5-pro }
250
250
 
251
251
  board:
252
+ # Update kaizen by itself when a newer version is out and no terminal is running
253
+ # (an update restarts the board). The desktop app updates itself either way.
254
+ auto_update: false
252
255
  # A folder your projects live in, e.g. ~/Projects, or C:\Users\you\Projects on
253
256
  # Windows. Every folder inside it is offered in kaizen's project list;
254
257
  # choosing one creates its .kaizen and moves kaizen there. A folder that is
@@ -261,4 +261,10 @@ Task-specific exception to the general follow-up confirmation rule.
261
261
  Task acceptance (Looks good) is distinct from workflow completion, technical git
262
262
  housekeeping and publication. Finish genuine checks and workflow decisions, publish
263
263
  checks/limitations honestly, then leave the completed result for user acceptance.
264
+ End the run explicitly once the result is published and the review is over: with
265
+ `approvals.review` off run `kaizen done <run>` (the task then waits on Looks good);
266
+ with it on run `kaizen state <run> stage=review awaiting=approvals.review` and stop,
267
+ so the task page offers the approval. Never stop at `review` with `awaiting` empty:
268
+ the board cannot tell that from a review still running, and offers Looks good only
269
+ after two quiet minutes.
264
270
  A rendered event form is not evidence of registration storage or delivery.
@@ -35,6 +35,13 @@ them in your questions and recommendations. Stop at three searches unless the
35
35
  topic is still unclear; deep research comes after the decisions. Skip this only
36
36
  for work internal to the project (its own bugs, refactors).
37
37
 
38
+ Then ask before you investigate. Hands-on work (driving the app, installing it,
39
+ walking every screen, a study across many files or sources) waits until the user
40
+ has answered the first round, at least who it is for and how deep to go. This
41
+ holds most for a request that is itself research, such as an audit or a
42
+ walkthrough: do not deliver the research inside Explore before its scope is set.
43
+ Save each step to `00-explore.md` as it happens, not only at the end.
44
+
38
45
  Web tools, in this order:
39
46
 
40
47
  1. `kaizen search "<query>" --recent m` (add `--read` for page text, `--limit N`)
@@ -215,39 +215,3 @@ export function HomeWsButton() {
215
215
  );
216
216
  }
217
217
 
218
- // The minimized window: the first row of the Projects list. It sits beside the list, not in it (board/home-ws.ts mounts
219
- // it above #plist); the row's classes are the list's own.
220
- export function HomeWsRow() {
221
- const s = useHomeWs(),
222
- shells = useServer((x) => x.shells),
223
- n = homeTabs(shells, s.ending).length;
224
- return (
225
- <div className="plist hwsslot" hidden={s.st !== "min"}>
226
- <div className="pgrp">
227
- <button
228
- type="button"
229
- className="proj"
230
- title="Home workspace: agents outside any project (Ctrl+Alt+A)"
231
- onClick={() => showHomeWs("open")}
232
- >
233
- <svg className="plogo hwsico" aria-hidden="true">
234
- <use href="#i-home" />
235
- </svg>
236
- <span className="pname">Home</span>
237
- <span className="c">{n || ""}</span>
238
- </button>
239
- <button
240
- type="button"
241
- className="wadd hwsrx"
242
- title="Close the Home workspace"
243
- aria-label="Close the Home workspace"
244
- onClick={() => void closeAllHome()}
245
- >
246
- <svg viewBox="0 0 24 24" aria-hidden="true">
247
- <path d="M7 7l10 10M17 7 7 17" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
248
- </svg>
249
- </button>
250
- </div>
251
- </div>
252
- );
253
- }
@@ -4,3 +4,4 @@ export * from "./home-message.tsx";
4
4
  export * from "./home-window.tsx";
5
5
  export * from "./home-ws-add.tsx";
6
6
  export * from "./onboarding-dialog.tsx";
7
+ export * from "./works-flow.tsx";
@@ -2,6 +2,7 @@ import { useState, type ReactNode } from "react";
2
2
  import {
3
3
  agentGroups,
4
4
  answerOffer,
5
+ ASK,
5
6
  back,
6
7
  COPY,
7
8
  goto,
@@ -12,15 +13,19 @@ import {
12
13
  notifState,
13
14
  offerText,
14
15
  pickAgent,
16
+ pickPreset,
15
17
  pickTheme,
16
18
  skip,
19
+ STEP,
17
20
  toggleMore,
18
21
  useOnboarding,
19
22
  type Cfg,
23
+ type Flow as FlowState,
20
24
  } from "@lib/home";
21
25
  import { cn } from "@lib/core";
22
26
  import { Button, Dialog, DialogContent, DialogDescription, DialogTitle, Icon } from "@web/ui";
23
27
  import { PhoneCard } from "@components/phone";
28
+ import { WorksFlow } from "./works-flow.tsx";
24
29
 
25
30
  const MOD = typeof navigator !== "undefined" && /Mac|iP(hone|ad)/.test(navigator.platform) ? "⌘" : "Ctrl";
26
31
 
@@ -245,10 +250,36 @@ function AlertStep() {
245
250
  );
246
251
  }
247
252
 
248
- // The setup flow: four steps in one panel, a progress bar that jumps between them, then Add your first project.
253
+ // How much kaizen asks: the three presets in plain words, starting on the one the board has. Picking saves it when the step is left.
254
+ function AskStep({ preset }: { preset: string }) {
255
+ return (
256
+ <>
257
+ <div role="radiogroup" aria-label="How much kaizen asks you" className="flex flex-col gap-2.5">
258
+ {ASK.map((a) => (
259
+ <Card key={a.id} on={preset === a.id} onPick={() => pickPreset(a.id)} className="items-start py-3">
260
+ <span>
261
+ <b className="font-medium">{a.name}</b>
262
+ <small className="ml-2 rounded-full border border-border px-2 py-px text-xs font-normal text-muted-foreground">
263
+ {a.tag}
264
+ </small>
265
+ <small className="mt-0.5 block text-sm font-normal text-muted-foreground">{a.text}</small>
266
+ </span>
267
+ </Card>
268
+ ))}
269
+ </div>
270
+ <p className="text-sm text-muted-foreground">
271
+ {preset
272
+ ? "It starts on your current setting and changes only if you pick another card."
273
+ : "You have custom settings. They stay as they are unless you pick a card."}
274
+ </p>
275
+ </>
276
+ );
277
+ }
278
+
279
+ // The setup flow: five steps in one panel, a progress bar that jumps between them, then Add your first project.
249
280
  // Escape and Skip ask first; clicking outside does nothing. Ctrl/Cmd+Enter always continues, a bare Enter does unless a
250
281
  // button (other than a choice card) or a field holds focus.
251
- function Flow({ cfg, flow }: { cfg: Cfg; flow: { step: number; agent: string; theme: string; more: boolean } }) {
282
+ function Flow({ cfg, flow }: { cfg: Cfg; flow: FlowState }) {
252
283
  const { step } = flow,
253
284
  last = step === cfg.total - 1,
254
285
  s = COPY[step]!;
@@ -301,7 +332,7 @@ function Flow({ cfg, flow }: { cfg: Cfg; flow: { step: number; agent: string; th
301
332
  </span>
302
333
  </div>
303
334
  <div className="flex min-h-0 flex-1 flex-col gap-3.5 overflow-auto px-0.5 pb-1.5 pt-[30px]">
304
- {step === 0 && (
335
+ {step === STEP.works && (
305
336
  <small className="text-xs uppercase tracking-[0.14em] text-muted-foreground">Welcome to kaizen</small>
306
337
  )}
307
338
  <DialogTitle className="text-[30px] font-bold leading-[1.15] text-strong max-[640px]:text-2xl">
@@ -310,10 +341,16 @@ function Flow({ cfg, flow }: { cfg: Cfg; flow: { step: number; agent: string; th
310
341
  <DialogDescription id="onb-sub" className="mb-3 max-w-[56ch] text-lg">
311
342
  {s.sub}
312
343
  </DialogDescription>
313
- {step === 0 && <AgentStep cfg={cfg} agent={flow.agent} more={flow.more} />}
314
- {step === 1 && <LookStep theme={flow.theme} />}
315
- {step === 2 && <AlertStep />}
316
- {step === 3 && (
344
+ {step === STEP.works && <WorksFlow />}
345
+ {step === STEP.agent && <AgentStep cfg={cfg} agent={flow.agent} more={flow.more} />}
346
+ {step === STEP.ask && <AskStep preset={flow.preset} />}
347
+ {step === STEP.look && (
348
+ <>
349
+ <LookStep theme={flow.theme} />
350
+ <AlertStep />
351
+ </>
352
+ )}
353
+ {step === STEP.phone && (
317
354
  <Panel>
318
355
  <PhoneCard />
319
356
  </Panel>
@@ -0,0 +1,119 @@
1
+ import type { ReactNode } from "react";
2
+ import { FLOW } from "@lib/home";
3
+
4
+ // The first welcome step's picture, drawn like Settings → Orchestration's: rounded boxes joined by beams of light. ask → plan →
5
+ // approve → build → review; the boxes where you decide are solid, where an agent works outlined. One 10 s timeline: the beam
6
+ // travels start to end and each box lights up for 1.4 s when it arrives, with a little work in it (plan draws its lines, ask and
7
+ // build blink a cursor, approve draws its check). Two rows on a narrow screen. currentColor and var(--accent), so it follows light
8
+ // and dark. CSS only; with reduced motion the lines stay lit and nothing moves.
9
+ const CSS = `.wk svg{overflow:visible;width:100%;height:auto;fill:none}
10
+ .wk .l{fill:none;stroke:currentColor;stroke-width:2;opacity:.16}
11
+ .wk .b{fill:none;stroke:var(--accent);stroke-width:3;stroke-linecap:round;filter:drop-shadow(0 0 4px var(--accent));opacity:0;stroke-dasharray:25 100;stroke-dashoffset:125}
12
+ .wk rect.bx{fill:var(--bg);stroke:currentColor;stroke-width:1.6}
13
+ .wk rect.you{fill:currentColor}
14
+ .wk .i path,.wk .i circle{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
15
+ .wk .y .i path,.wk .y .i circle{stroke:var(--bg)}
16
+ .wk text{fill:currentColor;stroke:none;font:600 21px var(--mono,ui-monospace,monospace)}
17
+ .wk .y text{fill:var(--bg)}
18
+ .wk .cur{fill:currentColor;stroke:none;opacity:0}
19
+ .wk .y .cur{fill:var(--bg)}
20
+ .wk .wb{fill:var(--accent);stroke:none;transform-box:fill-box;transform-origin:left;transform:scaleX(0)}
21
+ .wk .ck{stroke-dasharray:1;stroke-dashoffset:0}
22
+ @media (prefers-reduced-motion:no-preference){
23
+ .wk rect.ag{animation:wk-ag 10s linear infinite}
24
+ .wk rect.you{animation:wk-you 10s linear infinite}
25
+ .wk .b{animation:wk-beam 10s linear infinite}
26
+ .wk .cur{animation:wk-blink 10s linear infinite}
27
+ .wk .wb{animation:wk-grow 10s linear infinite}
28
+ .wk .ck{animation:wk-draw 10s linear infinite}}
29
+ @keyframes wk-ag{0%,14%{stroke-width:3.2;fill:color-mix(in srgb,currentColor 12%,var(--bg));filter:drop-shadow(0 0 6px var(--accent))}16%,100%{stroke-width:1.6;fill:var(--bg);filter:none}}
30
+ @keyframes wk-you{0%,14%{stroke-width:3.2;filter:drop-shadow(0 0 6px var(--accent))}16%,100%{stroke-width:1.6;filter:none}}
31
+ @keyframes wk-beam{0%{stroke-dashoffset:125;opacity:1}7%{stroke-dashoffset:-25;opacity:1}7.5%,100%{stroke-dashoffset:-25;opacity:0}}
32
+ @keyframes wk-blink{0%{opacity:1}3.5%{opacity:0}7%{opacity:1}10.5%{opacity:0}14%{opacity:1}15%,100%{opacity:0}}
33
+ @keyframes wk-grow{0%{transform:scaleX(0)}5%{transform:scaleX(1)}9%{transform:scaleX(.55)}13%{transform:scaleX(1)}15%,100%{transform:scaleX(0)}}
34
+ @keyframes wk-draw{0%{stroke-dashoffset:1}8%,100%{stroke-dashoffset:0}}`;
35
+
36
+ const ICONS: Record<string, ReactNode> = {
37
+ ask: (
38
+ <>
39
+ <circle cx="6.5" cy="4" r="2.6" />
40
+ <path d="M1.5 12.5c.8-3 3-4 5-4s4.2 1 5 4" />
41
+ </>
42
+ ),
43
+ plan: <path d="M1 1h7l4 4v9H1zM8 1v4h4" />,
44
+ approve: (
45
+ <>
46
+ <circle cx="6.5" cy="6.5" r="6" />
47
+ <path className="ck" pathLength={1} d="M4 6.5l2 2 3.5-4" />
48
+ </>
49
+ ),
50
+ build: <path d="M1 2l4 3-4 3M7 10h5" />,
51
+ review: (
52
+ <>
53
+ <circle cx="5.5" cy="5.5" r="4" />
54
+ <path d="M8.5 8.5L12.5 12.5" />
55
+ </>
56
+ ),
57
+ };
58
+ // Where each box sits and how the beams join them: one row of five, or two rows (3 and 2) with the line wrapping down.
59
+ const WIDE = {
60
+ view: "0 0 960 120",
61
+ boxes: [[0, 30], [202, 30], [404, 30], [606, 30], [808, 30]],
62
+ lines: ["M152 60H202", "M354 60H404", "M556 60H606", "M758 60H808"],
63
+ };
64
+ const NARROW = {
65
+ view: "0 0 560 230",
66
+ boxes: [[0, 10], [204, 10], [408, 10], [0, 150], [204, 150]],
67
+ lines: ["M152 40H204", "M356 40H408", "M484 70V100Q484 120 464 120H96Q76 120 76 140V150", "M152 180H204"],
68
+ };
69
+ const LABEL = "You ask, kaizen plans, you approve, an agent builds it, a second agent reviews it.";
70
+
71
+ function Flow({ g, className }: { g: typeof WIDE; className: string }) {
72
+ return (
73
+ <svg viewBox={g.view} role="img" aria-label={LABEL} className={className}>
74
+ {g.lines.map((d) => (
75
+ <path key={"l" + d} className="l" d={d} />
76
+ ))}
77
+ {g.lines.map((d, k) => (
78
+ <path key={"b" + d} className="b" pathLength={100} style={{ animationDelay: `${k * 2 + 1.2}s` }} d={d} />
79
+ ))}
80
+ {FLOW.map((f, i) => (
81
+ <g key={f.name} className={f.you ? "y" : ""} transform={`translate(${g.boxes[i]![0]} ${g.boxes[i]![1]})`}>
82
+ <rect className={`bx ${f.you ? "you" : "ag"}`} style={{ animationDelay: `${i * 2}s` }} width={152} height={60} rx={12} />
83
+ <g className="i" transform="translate(16 20) scale(1.15)">
84
+ {ICONS[f.name]}
85
+ </g>
86
+ <text x={46} y={37}>
87
+ {f.name}
88
+ </text>
89
+ {f.name === "ask" && <rect className="cur" style={{ animationDelay: "0s" }} x={86} y={19} width={2.5} height={22} rx={1} />}
90
+ {f.name === "build" && <rect className="cur" style={{ animationDelay: "6s" }} x={114} y={19} width={2.5} height={22} rx={1} />}
91
+ {f.name === "plan" &&
92
+ [34, 26, 30].map((w, j) => (
93
+ <rect key={j} className="wb" style={{ animationDelay: `${2 + j * 0.25}s` }} x={102} y={17 + j * 10} width={w} height={4} rx={2} />
94
+ ))}
95
+ </g>
96
+ ))}
97
+ </svg>
98
+ );
99
+ }
100
+
101
+ export function WorksFlow() {
102
+ return (
103
+ <div className="wk my-1 block w-full py-1" data-testid="works-flow">
104
+ <style>{CSS}</style>
105
+ <Flow g={WIDE} className="block max-[560px]:hidden" />
106
+ <Flow g={NARROW} className="hidden max-[560px]:block" />
107
+ <div className="mt-2 flex gap-4 text-xs text-muted-foreground">
108
+ <span className="inline-flex items-center gap-1.5">
109
+ <i className="inline-block size-3 rounded-[3px] border-[1.5px] border-foreground bg-foreground" />
110
+ you
111
+ </span>
112
+ <span className="inline-flex items-center gap-1.5">
113
+ <i className="inline-block size-3 rounded-[3px] border-[1.5px] border-foreground" />
114
+ agent
115
+ </span>
116
+ </div>
117
+ </div>
118
+ );
119
+ }
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef } from "react";
2
- import { sameName, short, type Board, pickCaptureBoard, saveCapture, patchCap, useIce } from "@lib/icebox";
2
+ import { sameName, short, type Board, pickCaptureBoard, removeCollection, saveCapture, patchCap, useIce } from "@lib/icebox";
3
3
  import { useNarrow } from "@lib/shared";
4
4
  import { Button, Icon, Textarea } from "@web/ui";
5
5
  import { ClientMark, IconButton, MicButton, Picker, ProjectMark } from "@components/shared";
@@ -126,12 +126,21 @@ export function CaptureBox({
126
126
  value={board}
127
127
  options={[
128
128
  { value: "", label: "Inbox" },
129
- ...boards.map((b) => ({ value: b.name, label: b.name, icon: b.client ? <ClientMark /> : undefined })),
129
+ ...boards.map((b) => ({
130
+ value: b.name,
131
+ label: b.name,
132
+ icon: b.client ? <ClientMark /> : undefined,
133
+ removable: true,
134
+ })),
130
135
  ...(board && !boards.some((b) => sameName(b.name, board))
131
136
  ? [{ value: board, label: `${board} (new)` }]
132
137
  : []),
133
138
  { value: NEW, label: "New collection…", icon: <Icon name="plus" className="size-3.5" /> },
134
139
  ]}
140
+ onRemove={(name) => {
141
+ const b = boards.find((x) => sameName(x.name, name));
142
+ if (b) void removeCollection(b.dir, b.name, (useIce.getState().data?.icebox ?? []).filter((it) => it.dir === b.dir && sameName(it.board, b.name)).length);
143
+ }}
135
144
  onChange={async (v) => {
136
145
  await pickCaptureBoard(v, to);
137
146
  focus();
@@ -3,6 +3,7 @@ import {
3
3
  hostOf,
4
4
  hue,
5
5
  iceKey,
6
+ linkImage,
6
7
  isLive,
7
8
  short,
8
9
  srcName,
@@ -20,12 +21,14 @@ import { RequestBadges } from "./request-badges.tsx";
20
21
  import { RequestImages } from "./request-images.tsx";
21
22
 
22
23
  // A card: what it is, the words, where it sits, how old. A link leads with its title and summary, coloured from the
23
- // site's name; nothing is fetched from the site to draw it. Opening it shows it in the Sort list.
24
+ // site's name, over the page's own preview picture when it named one (the browser loads that from the site's server,
25
+ // without a referrer). Opening it shows it in the Sort list.
24
26
  export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
25
27
  const k = iceKey(item),
26
28
  cur = ctx.cur === k,
27
29
  lk = item.link && /^https?:\/\//i.test(item.link.url) ? item.link : null,
28
- site = lk ? hostOf(lk.url).replace(/^www\./, "") : "";
30
+ site = lk ? hostOf(lk.url).replace(/^www\./, "") : "",
31
+ img = lk ? linkImage(lk) : "";
29
32
  return (
30
33
  <article
31
34
  data-cur={cur || undefined}
@@ -38,12 +41,26 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
38
41
  href={webUrl(lk.url)}
39
42
  target="_blank"
40
43
  rel="noopener noreferrer"
44
+ data-img={img || undefined}
41
45
  style={{ "--h": hue(site) } as React.CSSProperties}
42
- className="group/lk flex min-h-[88px] flex-col justify-end gap-[3px] rounded-t-lg bg-[hsl(var(--h)_42%_40%)] px-3 pb-2.5 pt-3.5 text-white"
46
+ className="group/lk relative flex min-h-[88px] data-[img]:min-h-[160px] flex-col justify-end gap-[3px] overflow-hidden rounded-t-lg bg-[hsl(var(--h)_42%_40%)] px-3 pb-2.5 pt-3.5 text-white"
43
47
  >
44
- <b className="break-words text-base leading-[1.35] group-hover/lk:underline">{lk.title || site}</b>
45
- {lk.summary && <span className="line-clamp-2 text-sm leading-[1.4] opacity-90">{lk.summary}</span>}
46
- <small className="text-xs opacity-85">{site}</small>
48
+ {img && (
49
+ <>
50
+ <img
51
+ src={img}
52
+ alt=""
53
+ loading="lazy"
54
+ referrerPolicy="no-referrer"
55
+ onError={(e) => (e.currentTarget.hidden = true)}
56
+ className="absolute inset-0 h-full w-full object-cover"
57
+ />
58
+ <span aria-hidden className="absolute inset-0 bg-gradient-to-t from-black/75 via-black/25 to-transparent" />
59
+ </>
60
+ )}
61
+ <b className="relative break-words text-base leading-[1.35] group-hover/lk:underline">{lk.title || site}</b>
62
+ {lk.summary && <span className="relative line-clamp-2 text-sm leading-[1.4] opacity-90">{lk.summary}</span>}
63
+ <small className="relative text-xs opacity-85">{site}</small>
47
64
  </a>
48
65
  )}
49
66
  <div className="flex flex-col gap-2 px-3 pb-2.5 pt-3">
@@ -67,7 +84,7 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
67
84
  >
68
85
  {item.text}
69
86
  </button>
70
- <RequestImages item={item} card />
87
+ {!img && <RequestImages item={item} card />}
71
88
  <div className="flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground">
72
89
  {item.board && <span className="text-foreground">{item.board}</span>}
73
90
  {(item.tags || []).map((t) => (
@@ -82,9 +99,14 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
82
99
  </span>
83
100
  )}
84
101
  <span className="flex-1" />
85
- <span className="whitespace-nowrap tabular-nums">
86
- {item.source !== "manual" ? `${srcName(ctx.list, item)} · ` : ""}
87
- {ago(item.at)}
102
+ {/* A long source name (a search's words) is cut to the card; its age always shows. */}
103
+ <span className="flex min-w-0 max-w-full items-center gap-1 tabular-nums">
104
+ {item.source !== "manual" && (
105
+ <span className="min-w-0 truncate" title={srcName(ctx.list, item)}>
106
+ {srcName(ctx.list, item)} ·
107
+ </span>
108
+ )}
109
+ <span className="shrink-0 whitespace-nowrap">{ago(item.at)}</span>
88
110
  </span>
89
111
  </div>
90
112
  </div>
@@ -92,7 +114,7 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
92
114
  item={item}
93
115
  boards={ctx.boards}
94
116
  variant="card"
95
- className="hidden border-t border-[color:color-mix(in_srgb,var(--line)_50%,transparent)] px-1.5 pb-1.5 pt-1 group-focus-within/card:flex group-hover/card:flex group-data-[cur]/card:flex [@media(hover:none)]:flex"
117
+ className="hidden border-t border-[color:color-mix(in_srgb,var(--line)_50%,transparent)] px-1.5 pb-1.5 pt-1 group-focus-within/card:flex group-hover/card:flex [@media(hover:none)]:flex"
96
118
  />
97
119
  </article>
98
120
  );
@@ -121,7 +121,7 @@ function FolderStep({ back }: { back?: () => void }) {
121
121
  return (
122
122
  <Step
123
123
  title="Existing folder"
124
- hint="Pick a folder, or type its path. A .kaizen folder is added to it."
124
+ hint="Pick a folder, or type its path. A .kaizen folder and a short kaizen note in CLAUDE.md are added to it."
125
125
  err={err}
126
126
  go="Add project"
127
127
  busy={busy ? "Adding..." : ""}
@@ -21,6 +21,7 @@ import {
21
21
  type RailTask,
22
22
  } from "@lib/rail";
23
23
  import { useRoute } from "@lib/router";
24
+ import { closeAllHome, homeTabs, showHomeWs, useHomeWs } from "@lib/home";
24
25
  import { useRailData, useServer } from "@lib/server";
25
26
  import { AgentChips } from "./agent-chips.tsx";
26
27
 
@@ -93,7 +94,9 @@ function TaskLink({ t }: { t: RailTask }) {
93
94
  );
94
95
  }
95
96
 
96
- function WsRow({ dir, r, now, current }: { dir: string; r: RailRow; now: number; current: boolean }) {
97
+ // Home is your own space outside any project, so its one row says that instead of the folder's name.
98
+ export const HOME_TIP = "Your own space: chats and agent terminals that are not in a project. Add a project with +.";
99
+ function WsRow({ dir, r, now, current, home }: { dir: string; r: RailRow; now: number; current: boolean; home?: boolean }) {
97
100
  return (
98
101
  <>
99
102
  <div className="wsr wsc">
@@ -102,7 +105,7 @@ function WsRow({ dir, r, now, current }: { dir: string; r: RailRow; now: number;
102
105
  href={host.wsHref(dir, r.path)}
103
106
  data-dir={dir}
104
107
  data-ws={r.path}
105
- title={r.path}
108
+ title={home ? HOME_TIP : r.path}
106
109
  aria-current={current ? "true" : undefined}
107
110
  onClick={(e) => inPlace(e, () => openWs(dir, r.path))}
108
111
  onContextMenu={(e) => {
@@ -119,11 +122,11 @@ function WsRow({ dir, r, now, current }: { dir: string; r: RailRow; now: number;
119
122
  <span className={`si ${r.st || "none"}`} />
120
123
  <div className="wl">
121
124
  <span className="l1">
122
- <b>{r.label}</b>
125
+ <b>{home ? "No project" : r.label}</b>
123
126
  {r.pinned && <Pin />}
124
127
  </span>
125
128
  <span className="l2">
126
- <span>{r.folder}</span>
129
+ <span>{home ? "chats and terminals" : r.folder}</span>
127
130
  {!r.w.main && <Worktree />}
128
131
  </span>
129
132
  </div>
@@ -137,6 +140,40 @@ function WsRow({ dir, r, now, current }: { dir: string; r: RailRow; now: number;
137
140
  );
138
141
  }
139
142
 
143
+ // Home's own terminals (the Home window) while it is minimized: how many are open, a click brings the window back,
144
+ // × closes them all. Open or closed, the window speaks for itself; it opens with Ctrl+Alt+A or a Home row's +.
145
+ function HomeTerms() {
146
+ const h = useHomeWs(),
147
+ n = homeTabs(useServer((x) => x.shells), h.ending).length;
148
+ if (!n || h.st !== "min") return null;
149
+ return (
150
+ <span className="hterm">
151
+ <button
152
+ type="button"
153
+ title={`Home terminals: ${n} open (Ctrl+Alt+A)`}
154
+ aria-label={`Open the Home window, ${n} terminals`}
155
+ onClick={() => showHomeWs("open")}
156
+ >
157
+ <svg aria-hidden="true">
158
+ <use href="#i-term" />
159
+ </svg>
160
+ {n}
161
+ </button>
162
+ <button
163
+ type="button"
164
+ className="hx"
165
+ title="Close the Home terminals"
166
+ aria-label="Close the Home terminals"
167
+ onClick={() => void closeAllHome()}
168
+ >
169
+ <svg viewBox="0 0 24 24" aria-hidden="true">
170
+ <path d="M7 7l10 10M17 7 7 17" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
171
+ </svg>
172
+ </button>
173
+ </span>
174
+ );
175
+ }
176
+
140
177
  function Group({
141
178
  g,
142
179
  logo,
@@ -167,11 +204,17 @@ function Group({
167
204
  data-proj={g.dir}
168
205
  data-ws={g.mainWs}
169
206
  data-empty={g.empty ? "" : undefined}
170
- title={g.dir}
207
+ title={g.home ? HOME_TIP : g.dir}
171
208
  aria-expanded={!g.shut}
172
209
  onClick={fold}
173
210
  >
174
- <RailLogo dir={g.dir} name={g.name} logo={logo} />
211
+ {g.home ? (
212
+ <svg className="plogo hwsico" aria-hidden="true">
213
+ <use href="#i-home" />
214
+ </svg>
215
+ ) : (
216
+ <RailLogo dir={g.dir} name={g.name} logo={logo} />
217
+ )}
175
218
  <span className="pname">{g.name}</span>
176
219
  <svg className="fchev" viewBox="0 0 24 24" aria-hidden="true">
177
220
  <path
@@ -184,6 +227,7 @@ function Group({
184
227
  />
185
228
  </svg>
186
229
  </button>
230
+ {g.home && <HomeTerms />}
187
231
  {g.git && (
188
232
  <button
189
233
  type="button"
@@ -201,7 +245,7 @@ function Group({
201
245
  {!g.shut && (
202
246
  <div className="pws">
203
247
  {g.rows.map((r) => (
204
- <WsRow key={r.path} dir={g.dir} r={r} now={now} current={cur.dir === g.dir && cur.ws === r.path} />
248
+ <WsRow key={r.path} dir={g.dir} r={r} now={now} current={cur.dir === g.dir && cur.ws === r.path} home={g.home && r.w.main} />
205
249
  ))}
206
250
  </div>
207
251
  )}
@@ -29,6 +29,48 @@ const MARK: Record<Step["st"], string> = { done: "text-success", doing: "text-ru
29
29
 
30
30
  // A building run's Work list: how many are done, a bar, and one row per item (✓ done, a pulse for the one being worked
31
31
  // on). A redraw marks the rows whose status moved and slides the bar from where it was.
32
+ // What the agent is doing, from its own hooks: the newest line (a pulse while it is fresh), then the few before it. The checklist
33
+ // above is the agent's own words; this is what it really did.
34
+ function Activity({ list }: { list: { t: number; text: string }[] }) {
35
+ const [now, setNow] = useState(Date.now());
36
+ useEffect(() => {
37
+ const i = setInterval(() => setNow(Date.now()), 5000);
38
+ return () => clearInterval(i);
39
+ }, []);
40
+ if (!list.length) return null;
41
+ const last = list[list.length - 1]!,
42
+ live = now - last.t < 45_000,
43
+ ago = Math.max(0, Math.round((now - last.t) / 1000));
44
+ return (
45
+ <div data-activity className="mb-[18px] rounded-md border border-border px-3 py-2.5 text-base">
46
+ <div className="flex items-center gap-2">
47
+ <span
48
+ className={cn(
49
+ "size-[7px] flex-none rounded-full",
50
+ live ? "bg-running motion-safe:animate-pulse" : "bg-muted-foreground",
51
+ )}
52
+ />
53
+ <b className="min-w-0 flex-1 truncate font-medium text-foreground">{last.text}</b>
54
+ <span className="flex-none text-sm text-muted-foreground">
55
+ {live ? "now" : ago < 90 ? `${ago}s ago` : `${Math.round(ago / 60)} min ago`}
56
+ </span>
57
+ </div>
58
+ {list.length > 1 && (
59
+ <ul className="mt-1.5 flex flex-col gap-0.5 border-t border-border pt-1.5 text-sm text-muted-foreground">
60
+ {list
61
+ .slice(-6, -1)
62
+ .reverse()
63
+ .map((a, i) => (
64
+ <li key={i} className="truncate">
65
+ {a.text}
66
+ </li>
67
+ ))}
68
+ </ul>
69
+ )}
70
+ </div>
71
+ );
72
+ }
73
+
32
74
  function Progress({ id, src }: { id: string; src: string }) {
33
75
  const p = useMemo(() => parseProgress(src), [src]),
34
76
  prev = drawn?.id === id ? drawn : null,
@@ -112,6 +154,7 @@ export function DocBody() {
112
154
  return (
113
155
  <div ref={root}>
114
156
  {backlog && doc.progress && <Progress id={doc.id} src={doc.progress} />}
157
+ {backlog && <Activity list={doc.activity} />}
115
158
  {doc.text ? (
116
159
  <Markdown text={backlog && doc.progress ? "### Backlog\n\n" + doc.text : doc.text} ticks={backlog} />
117
160
  ) : (
@@ -102,21 +102,25 @@ export function AgentCard({ cmd }: { cmd: string }) {
102
102
  <b className="block font-medium">{a.name}</b>
103
103
  <code className="break-words text-xs text-muted-foreground">{a.command || a.cmd}</code>
104
104
  </span>
105
- {!a.installed && <span className="text-xs text-muted-foreground">Not installed</span>}
106
- <Segmented
107
- label={`${a.name} enabled`}
108
- idPrefix={`${id}-on`}
109
- options={[
110
- { id: "true", label: "Enabled" },
111
- { id: "false", label: "Disabled" },
112
- ]}
113
- value={String(a.enabled)}
114
- onChange={(v) => void saveAgentPrefs({ agent: cmd, enabled: v === "true" })}
115
- />
105
+ {a.installed ? (
106
+ <Segmented
107
+ label={`${a.name} enabled`}
108
+ idPrefix={`${id}-on`}
109
+ options={[
110
+ { id: "true", label: "Enabled" },
111
+ { id: "false", label: "Disabled" },
112
+ ]}
113
+ value={String(a.enabled)}
114
+ onChange={(v) => void saveAgentPrefs({ agent: cmd, enabled: v === "true" })}
115
+ />
116
+ ) : (
117
+ <span className="text-xs text-muted-foreground">Not installed. Install it to use it.</span>
118
+ )}
116
119
  <Button
117
120
  id={`${id}-def`}
118
121
  aria-pressed={def === cmd}
119
122
  disabled={!a.enabled || !a.installed}
123
+ className="min-w-[92px]"
120
124
  onClick={() => void setDefaultAgent(cmd)}
121
125
  >
122
126
  {def === cmd ? "✓ Default" : "Default"}