kaizen-agent 1.60.1 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/cli/knowledge.ts +1 -1
  2. package/cli/notes.test.ts +2 -1
  3. package/cli/onboarding.test.ts +70 -0
  4. package/cli/onboarding.ts +63 -0
  5. package/cli/pty.test.ts +15 -1
  6. package/cli/pty.ts +14 -3
  7. package/cli/shell-agent.test.ts +23 -0
  8. package/cli/state.test.ts +105 -1
  9. package/cli/state.ts +157 -19
  10. package/cli/web-decide.test.ts +41 -0
  11. package/cli/web.ts +145 -27
  12. package/package.json +1 -1
  13. package/web/board/add-project.ts +14 -4
  14. package/web/board/api.ts +37 -4
  15. package/web/board/approvals.ts +6 -6
  16. package/web/board/badge.ts +6 -2
  17. package/web/board/cards.ts +4 -2
  18. package/web/board/fixes.ts +1 -1
  19. package/web/board/git.ts +171 -97
  20. package/web/board/live.ts +2 -1
  21. package/web/board/main.ts +2 -0
  22. package/web/board/onboarding.ts +223 -0
  23. package/web/board/panel.ts +24 -14
  24. package/web/board/run-view.ts +86 -7
  25. package/web/board/settings-pages.test.ts +19 -0
  26. package/web/board/settings-pages.ts +44 -0
  27. package/web/board/settings.ts +118 -62
  28. package/web/board/store.ts +4 -0
  29. package/web/board/update.ts +1 -1
  30. package/web/board/views.ts +5 -1
  31. package/web/board/workspace.ts +92 -3
  32. package/web/board/ws-name.test.ts +10 -0
  33. package/web/board/ws-tabs.test.ts +14 -1
  34. package/web/board/ws-tabs.ts +12 -1
  35. package/web/board.html +165 -21
  36. package/web/board.js +107 -104
  37. package/web/notebook.js +29 -24
  38. package/web/notebook.ts +1 -0
  39. package/web/notes.html +28 -10
  40. package/web/popup.html +2 -2
  41. package/web/term.js +20 -20
  42. package/web/term.ts +8 -3
  43. package/web/video.html +28 -10
  44. package/web/video.js +56 -51
package/web/notebook.ts CHANGED
@@ -1186,6 +1186,7 @@ addEventListener("pagehide", () => {
1186
1186
  try {
1187
1187
  const th = localStorage.getItem("kz-theme");
1188
1188
  if (th) document.documentElement.dataset.theme = th;
1189
+ if (localStorage.getItem("kz-color") === "blue") document.documentElement.dataset.color = "blue";
1189
1190
  } catch {
1190
1191
  /* no storage */
1191
1192
  }
package/web/notes.html CHANGED
@@ -3,24 +3,29 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
6
- <script>if(matchMedia("(display-mode:standalone)").matches||navigator.standalone){document.querySelector("meta[name=viewport]").content+=",maximum-scale=1,user-scalable=no";addEventListener("gesturestart",e=>e.preventDefault())}</script>
6
+ <script>if(matchMedia("(display-mode:standalone)").matches||navigator.standalone){document.querySelector("meta[name=viewport]").content+=",maximum-scale=1,user-scalable=no";addEventListener("gesturestart",e=>e.preventDefault());if(navigator.standalone){const s=()=>{document.documentElement.style.setProperty("--sh",(innerWidth>innerHeight?Math.min:Math.max)(screen.width,screen.height)+"px");scrollTo(0,0)},r=()=>{s();setTimeout(s,400)};s();addEventListener("resize",r);addEventListener("orientationchange",r)}}</script>
7
7
  <title>kaizen notebook</title>
8
8
  <link rel="icon" href="/favicon.ico" sizes="any">
9
9
  <link rel="icon" type="image/png" href="/logo.png">
10
10
  <link rel="apple-touch-icon" href="/logo.png">
11
11
  <style>
12
12
  /* Tokens: copied from web/board.html, line for line; cli/notes.test.ts holds them equal. */
13
- :root{--bg:#f6f8fc;--bg-2:#fff;--line:#d9e0ee;--ink:#0c162f;--ink-hi:#0c162f;--dim:#5b6b8c;--accent:#2d50a5;--run:#0f8fa3;--ok:#1f9d55;--warn:#a8720a;--danger:#c8322f;color-scheme:light}
14
- @media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;color-scheme:dark}}
15
- :root[data-theme=dark]{--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;color-scheme:dark}
13
+ /* Colour: monochrome by default; ok, warn and danger keep their hue because they carry meaning. data-color=blue is the navy palette (kz-color). */
14
+ :root{--bg:#f7f7f7;--bg-2:#fff;--line:#dedede;--ink:#171717;--ink-hi:#171717;--dim:#666;--accent:#171717;--run:#525252;--ok:#1f9d55;--warn:#a8720a;--danger:#c8322f;--on-accent:#fff;color-scheme:light}
15
+ @media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#121212;--bg-2:#1a1a1a;--line:#2e2e2e;--ink:#ededed;--ink-hi:#fafafa;--dim:#a0a0a0;--accent:#ededed;--run:#c4c4c4;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;--on-accent:#121212;color-scheme:dark}}
16
+ :root[data-theme=dark]{--bg:#121212;--bg-2:#1a1a1a;--line:#2e2e2e;--ink:#ededed;--ink-hi:#fafafa;--dim:#a0a0a0;--accent:#ededed;--run:#c4c4c4;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;--on-accent:#121212;color-scheme:dark}
17
+ :root[data-color=blue]{--bg:#f6f8fc;--bg-2:#fff;--line:#d9e0ee;--ink:#0c162f;--ink-hi:#0c162f;--dim:#5b6b8c;--accent:#2d50a5;--run:#0f8fa3;--on-accent:#fff;color-scheme:light}
18
+ @media(prefers-color-scheme:dark){:root[data-color=blue]:not([data-theme=light]){--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--on-accent:#fff;color-scheme:dark}}
19
+ :root[data-color=blue][data-theme=dark]{--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--on-accent:#fff;color-scheme:dark}
16
20
  *{box-sizing:border-box}
17
21
  /* Shape, type and depth. --shade is the one shadow colour, themed like the rest. */
18
- :root{--r:4px;--r-s:4px;--r-pill:999px;--font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;--mono:ui-monospace,"JetBrains Mono","Cascadia Code","SF Mono",Menlo,Consolas,monospace;--on-accent:#fff;--hover:color-mix(in srgb,var(--dim) 12%,transparent);--shade:rgb(12 22 47/.08);--shadow-1:0 1px 2px var(--shade);--shadow-2:0 0 0 1px var(--shade),0 8px 24px -6px var(--shade);--canvas:color-mix(in srgb,var(--bg) 95.5%,var(--ink));--row:28px;--row-h:32px;--ico:14px;--ico-s:12px;--btn-xs:24px;--btn-s:32px;--btn:36px;--tabbar:36px;--pane-h:24px;--fs-xs:11px;--fs-s:12px;--fs:13px;--fs-l:14px;--gap:6px;--padx:8px}
22
+ :root{--r:4px;--r-s:4px;--r-pill:999px;--font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;--mono:ui-monospace,"JetBrains Mono","Cascadia Code","SF Mono",Menlo,Consolas,monospace;--hover:color-mix(in srgb,var(--dim) 12%,transparent);--shade:rgb(0 0 0/.08);--shadow-1:0 1px 2px var(--shade);--shadow-2:0 0 0 1px var(--shade),0 8px 24px -6px var(--shade);--canvas:color-mix(in srgb,var(--bg) 95.5%,var(--ink));--row:28px;--row-h:32px;--ico:14px;--ico-s:12px;--btn-xs:24px;--btn-s:32px;--btn:36px;--tabbar:36px;--pane-h:24px;--fs-xs:11px;--fs-s:12px;--fs:13px;--fs-l:14px;--gap:6px;--padx:8px}
19
23
  @media(prefers-color-scheme:dark){:root:not([data-theme=light]){--shade:rgb(0 0 0/.45);--canvas:color-mix(in srgb,var(--bg) 70%,black)}}
20
24
  :root[data-theme=dark]{--shade:rgb(0 0 0/.45);--canvas:color-mix(in srgb,var(--bg) 70%,black)}
21
25
  body{margin:0;background:var(--canvas);color:var(--ink);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;height:100vh;height:100dvh;overflow:hidden;display:flex}
22
26
  html{background:var(--canvas);touch-action:manipulation}
23
27
  @media(display-mode:standalone){body{position:fixed;inset:0;height:auto;overscroll-behavior:none;touch-action:pan-x pan-y;-webkit-text-size-adjust:100%}}
28
+ @media(display-mode:standalone) and (max-width:640px){body{bottom:auto;height:var(--sh,100lvh)}}
24
29
  @media(max-width:640px),(display-mode:standalone){body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}}
25
30
  /* iOS 26 blurs the page under the status bar unless a fixed bar touches the top edge: give it one in the page colour */
26
31
  @media(display-mode:standalone){body::before{content:"";position:fixed;top:0;left:0;right:0;height:env(safe-area-inset-top);background:inherit;z-index:100;pointer-events:none}}
@@ -42,6 +47,9 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
42
47
  .rail a.it[aria-current=page]{background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--ink)}
43
48
  .rail a.it[aria-current=page] svg{color:var(--accent)}
44
49
  .rail .end{flex:1}
50
+ .rail a.it[hidden]{display:none}
51
+ .rail .ring{width:var(--ico,18px);height:var(--ico,18px);flex:none;border-radius:50%;background:conic-gradient(var(--accent) var(--p,0%),var(--line) 0);-webkit-mask:radial-gradient(circle,transparent 5px,#000 5.5px);mask:radial-gradient(circle,transparent 5px,#000 5.5px)}
52
+ @media(max-width:640px){.rail a.it#rsetup{display:none}}
45
53
  .theme{display:flex;gap:2px;padding:3px;border-radius:var(--r-s);background:var(--hover)}
46
54
  .theme button{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;height:var(--btn-xs);border-radius:4px;font-size:var(--fs-s);font-weight:500;color:var(--dim);transition:background .12s,color .12s}
47
55
  .theme button svg{width:var(--ico);height:var(--ico)}
@@ -90,9 +98,10 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
90
98
  .rail .psec button[aria-pressed=true]{color:var(--accent)}.rail .psec button{position:relative}.rail .psec button[aria-pressed=true]::after{content:"";position:absolute;right:3px;top:3px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
91
99
  .pfpop{position:fixed;z-index:40;min-width:220px;max-width:280px;max-height:60vh;overflow:auto;padding:6px;display:flex;flex-direction:column;gap:1px;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);border-radius:4px;box-shadow:var(--shadow-2);font-size:12.5px}
92
100
  .pfpop .sel{margin:2px 2px 6px;padding:5px 8px;border-radius:4px}.pfrow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:4px;cursor:pointer;white-space:nowrap}.pfrow:hover{background:var(--hover)}.pfrow input{accent-color:var(--accent);margin:0}.pfrow .plogo{width:16px;height:16px;font-size:9px;border-radius:4px;display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover)}.pfrow img.plogo{background:none}
101
+ .pfall{display:flex;align-items:center;gap:2px}.pfall .pfrow{flex:1;min-width:0}.pfb{all:unset;display:grid;place-items:center;width:24px;height:24px;flex:none;border-radius:4px;cursor:pointer;color:var(--dim)}.pfb:hover{background:var(--hover);color:var(--ink)}.pfb:focus-visible{outline:2px solid var(--accent)}
93
102
  .pfpop .pfh{margin:8px 8px 2px;font-size:11px;font-weight:600;color:var(--dim)}
94
103
  .rail .plist{flex:1;min-height:40px;overflow:hidden auto;margin:0 -4px;padding:0 4px}
95
- #kbd{display:none!important}.plist .proj{all:unset;box-sizing:border-box;display:flex;gap:8px;align-items:center;height:var(--row-h);margin:2px 0 0;padding:0 var(--padx);font-size:var(--fs-s);font-weight:500;color:var(--ink);white-space:nowrap;cursor:pointer;width:100%;border-radius:4px}.proj:hover{background:var(--hover)}.proj:focus-visible{outline:2px solid var(--accent)}.proj .pname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.proj .fchev{width:12px;height:12px;flex:none;color:var(--dim);transition:transform .15s,opacity .15s;transform:rotate(90deg);opacity:0}.proj:hover .fchev,.proj:focus-visible .fchev{opacity:1}.proj.shut .fchev{transform:none}@media(hover:none){.proj .fchev{opacity:1}}.plist .proj .c{color:var(--dim);font-size:11px;font-weight:400}.plist .proj .plogo{width:16px;height:16px;font-size:9px;border-radius:4px;display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover);object-fit:contain}.plist .proj img.plogo{background:none}
104
+ #kbd{display:none!important}.plist .proj{all:unset;box-sizing:border-box;display:flex;gap:8px;align-items:center;height:var(--row-h);margin:2px 0 0;padding:0 var(--padx);font-size:var(--fs-s);font-weight:500;color:var(--ink);white-space:nowrap;cursor:pointer;width:100%;border-radius:4px}.proj:focus-visible{outline:2px solid var(--accent)}.proj .pname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.proj .fchev{width:12px;height:12px;flex:none;color:var(--dim);transition:transform .15s,opacity .15s;transform:rotate(90deg);opacity:0}.proj:hover .fchev,.proj:focus-visible .fchev{opacity:1}.proj.shut .fchev{transform:none}@media(hover:none){.proj .fchev{opacity:1}}.plist .proj .c{color:var(--dim);font-size:11px;font-weight:400}.plist .proj .plogo{width:16px;height:16px;font-size:9px;border-radius:4px;display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover);object-fit:contain}.plist .proj img.plogo{background:none}
96
105
  .plist .row{display:grid;grid-template-columns:14px minmax(0,1fr);gap:var(--gap);align-items:center;height:var(--row);padding:0 var(--padx);border-radius:4px;color:var(--ink);text-decoration:none}.plist .row:hover,.plist .row[aria-current]{background:var(--hover)}.plist .row .si{margin-top:0}
97
106
  .plist .row div{display:flex;align-items:baseline;gap:var(--gap);min-width:0}.plist .row b{flex:1;min-width:0;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plist .row small{flex:0 1 auto;max-width:30%;color:var(--dim);font:var(--fs-xs)/1.4 var(--mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plist .wsr{position:relative}.plist .wsr:has(.wcount) .row{padding-right:36px}.plist .wcount{all:unset;box-sizing:border-box;position:absolute;right:var(--padx);top:50%;margin-top:-9px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;text-align:center;color:var(--dim);font:var(--fs-xs)/18px var(--mono);cursor:pointer}.plist .wcount::before{content:"";position:absolute;inset:-10px -6px}.plist .wcount:hover{background:var(--hover);color:var(--ink)}.plist .wcount:focus-visible{outline:2px solid var(--accent)}
98
107
  .plist .wsr.wsc{margin:3px 0;border:1px solid transparent;border-radius:8px}.plist .wsr.wsc:hover{background:var(--hover)}.plist .wsr.wsc:has(.row[aria-current]){border-color:var(--line);background:var(--hover)}.plist .wsr.wsc .row{height:auto;min-height:44px;align-items:start;padding-top:7px;padding-bottom:4px;background:none}.plist .wsr.wsc .row .si{margin-top:3px}.plist .row .wl{flex-direction:column;align-items:stretch;gap:1px}.plist .l1,.plist .l2{display:flex;align-items:center;gap:var(--gap);min-width:0}.plist .l1 b{font-weight:500}.plist .pri{flex:none;font:var(--fs-xs)/16px var(--mono);font-style:normal;padding:0 6px;border:1px solid var(--line);border-radius:6px;color:var(--dim)}.plist .l2{color:var(--dim);font:var(--fs-xs)/1.4 var(--mono)}.plist .l2 span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.plist .l2 svg{width:12px;height:12px;flex:none}.plist .wsr.wsc .wcount{top:8px;margin-top:0}
@@ -121,17 +130,19 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
121
130
  [data-rail=min] .plist .proj{justify-content:center;margin:10px 0 4px;padding:0}[data-rail=min] .plist .row{grid-template-columns:14px;justify-content:center;padding:0}
122
131
  @media(max-width:640px){.rail .psec,.rail .plist,.rail .rib{display:none}.rail .rbot,[data-rail=min] .rail .rbot{display:contents}.rail a.it[data-view=ideas]{order:3}.rail a.it[data-view=board]{order:4}.rail a.it .n,.rail a.it .srcs{display:none}}
123
132
  /* phones: Home, Chat, Runs, Settings. The board, Ideas and the Icebox are set up on a computer (web/board/phone.ts) */
133
+ @media(min-width:641px){.rail .rbot .lbl{display:none}}
124
134
  .rail a.it.ponly,#phome{display:none}
125
135
  @media(max-width:640px){
126
136
  .rail a.it:is([data-view=board],[data-view=ideas],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
127
137
  .rail a.it.ponly{display:flex}
128
138
  .rail a.it[data-view=home]{order:1}.rail a.it[data-view=chat]{order:2}.rail a.it[data-view=device]{order:3}.rail a.it[data-view=settings]{order:4}
129
- .rail,[data-rail=min] .rail{padding:6px 8px max(4px,calc(env(safe-area-inset-bottom) - 10px));border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
130
- .rail a.it,[data-rail=min] .rail a.it{min-height:50px;gap:3px;font-size:10.5px;letter-spacing:.01em}
139
+ .rail,[data-rail=min] .rail{padding:6px 8px max(4px,env(safe-area-inset-bottom));border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
140
+ .rail a.it,[data-rail=min] .rail a.it{min-height:46px;gap:3px;font-size:10.5px;letter-spacing:.01em}
131
141
  .rail a.it svg{width:44px;height:26px;padding:4px 12px;box-sizing:border-box;border-radius:13px;transition:background .15s}
132
142
  .rail a.it[aria-current=page] svg{background:color-mix(in srgb,var(--accent) 16%,transparent)}
133
143
  .rail a.it[aria-current=page]{font-weight:600}
134
144
  }
145
+ [data-hide="1"] .rail{width:calc(var(--btn-s) + 12px);padding-inline:6px;align-items:center}[data-hide="1"] .rail>:not(.top){display:none}[data-hide="1"] .rail .top{padding:0}[data-hide="1"] .rail .top>:not(#fold){display:none}
135
146
  /* end side menu */
136
147
  #kbd{display:none}
137
148
  body.embed .rail,body.embed .hdr{display:none}body.embed .app{margin:0;border:0;border-radius:0}
@@ -333,9 +344,10 @@ select.sel{cursor:pointer;appearance:none;padding-right:30px;max-width:min(320px
333
344
  <a class="it fold" href="/?view=icebox" data-view="sources" title="Icebox: requests gathered from your sources"><svg><use href="#r-tray"/></svg><span class="lbl">Icebox</span><span class="srcs" id="rail-srcs"></span><span class="n" id="ice-n"></span></a>
334
345
  <a class="it" href="/?view=ideas" data-view="ideas" title="Ideas: every idea and run, filtered"><svg><use href="#r-bulb"/></svg><span class="lbl">Ideas</span></a>
335
346
  <a class="it" href="/?view=board" data-view="board" title="Board"><svg><use href="#i-board"/></svg><span class="lbl">Board</span></a>
347
+ <a class="it" href="/?setup=1" id="rsetup" hidden title="Continue setup"><span class="ring"></span><span class="lbl">Setup</span></a>
336
348
  <div class="psec"><span class="lbl">Projects</span><button id="pfilter" title="Show one project" aria-label="Show one project"><svg><use href="#r-filter"/></svg></button><button id="padd" title="Add project or workspace" aria-label="Add project or workspace"><svg><use href="#r-plus"/></svg></button></div>
337
349
  <div class="plist" id="plist" aria-label="Ideas and runs by project"></div>
338
- <div class="rbot"><a class="it fold" href="/?view=settings" data-view="settings" title="Settings" aria-label="Settings"><svg><use href="#i-gear"/></svg></a><a class="rib" href="/issue" target="_blank" rel="noopener" title="Report an issue" aria-label="Report an issue"><svg><use href="#r-bug"/></svg></a><button class="rib" id="kbd" title="Keyboard shortcuts" aria-label="Keyboard shortcuts"><svg><use href="#r-kbd"/></svg></button><button class="rib th" id="themet" title="Theme" aria-label="Theme"><svg class="sun"><use href="#i-sun"/></svg><svg class="moon"><use href="#i-moon"/></svg></button></div>
350
+ <div class="rbot"><a class="it fold" href="/?view=settings" data-view="settings" title="Settings" aria-label="Settings"><svg><use href="#i-gear"/></svg><span class="lbl">Settings</span></a><a class="rib" href="/issue" target="_blank" rel="noopener" title="Report an issue" aria-label="Report an issue"><svg><use href="#r-bug"/></svg></a><button class="rib" id="kbd" title="Keyboard shortcuts" aria-label="Keyboard shortcuts"><svg><use href="#r-kbd"/></svg></button><button class="rib th" id="themet" title="Theme" aria-label="Theme"><svg class="sun"><use href="#i-sun"/></svg><svg class="moon"><use href="#i-moon"/></svg></button></div>
339
351
  </nav>
340
352
  <script>
341
353
  // Side menu: theme and collapse, the same lines in board.html and notes.html. Runs before
@@ -343,11 +355,14 @@ select.sel{cursor:pointer;appearance:none;padding-right:30px;max-width:min(320px
343
355
  (()=>{const r=document.documentElement,wide=matchMedia("(max-width:1100px)"),phone=matchMedia("(max-width:640px)"),os=matchMedia("(prefers-color-scheme: dark)");
344
356
  // The toggle's choice is kept per browser; with none, the width decides. A phone always gets icons.
345
357
  let fold=null;try{fold=localStorage.getItem("kz-rail")}catch(e){}
346
- const rail=()=>{const m=phone.matches||(fold?fold==="min":wide.matches),b=document.getElementById("fold");r.dataset.rail=m?"min":"full";b.title=m?"Expand menu":"Collapse menu";b.setAttribute("aria-label",b.title);b.setAttribute("aria-expanded",!m)};
358
+ const rail=()=>{const m=phone.matches||(fold?fold==="min":wide.matches),b=document.getElementById("fold");r.dataset.rail=m?"min":"full";r.dataset.hide=!phone.matches&&fold==="min"?"1":"0";b.title=m?"Expand menu":"Collapse menu";b.setAttribute("aria-label",b.title);b.setAttribute("aria-expanded",!m)};
347
359
  wide.addEventListener("change",rail);phone.addEventListener("change",rail);rail();
348
360
  document.getElementById("fold").onclick=()=>{fold=r.dataset.rail==="min"?"full":"min";try{localStorage.setItem("kz-rail",fold)}catch(e){}rail()};
349
361
  // Theme: light, dark, or unset for system, in kz-theme. The toggle shows what is on screen and flips it.
350
362
  const paint=()=>{const d=r.dataset.theme?r.dataset.theme==="dark":os.matches;const b=document.getElementById("themet");if(b){b.dataset.dark=d;b.title=d?"Dark theme: switch to light":"Light theme: switch to dark";b.setAttribute("aria-label",b.title)}};
363
+ // Colour: unset for monochrome, or blue, in kz-color. kz-theme repaints the terminals and Settings.
364
+ window.setColor=c=>{if(c==="blue")r.dataset.color=c;else delete r.dataset.color;try{c==="blue"?localStorage.setItem("kz-color",c):localStorage.removeItem("kz-color")}catch(e){}dispatchEvent(new Event("kz-theme"))};
365
+ try{if(localStorage.getItem("kz-color")==="blue")r.dataset.color="blue"}catch(e){}
351
366
  window.setTheme=t=>{if(t==="system")delete r.dataset.theme;else r.dataset.theme=t;try{t==="system"?localStorage.removeItem("kz-theme"):localStorage.setItem("kz-theme",t)}catch(e){}paint();dispatchEvent(new Event("kz-theme"))};
352
367
  try{const t=localStorage.getItem("kz-theme");if(t)r.dataset.theme=t}catch(e){}
353
368
  // Motion: full, reduce, or unset to follow the system's reduced-motion, in kz-motion.
@@ -355,6 +370,9 @@ select.sel{cursor:pointer;appearance:none;padding-right:30px;max-width:min(320px
355
370
  try{const m=localStorage.getItem("kz-motion");if(m)r.dataset.motion=m}catch(e){}
356
371
  os.addEventListener("change",paint);paint();
357
372
  document.getElementById("themet").onclick=e=>setTheme(e.currentTarget.dataset.dark==="true"?"light":"dark");
373
+ // Setup: while first-run onboarding is skipped or unfinished, a row that continues it; the board redraws it as it saves.
374
+ window.kzSetupRow=o=>{const a=document.getElementById("rsetup");if(!a)return;a.hidden=!(o&&o.resume);if(o&&o.resume){a.querySelector(".ring").style.setProperty("--p",Math.round(o.step/o.total*100)+"%");a.title="Continue setup: step "+(o.step+1)+" of "+o.total}};
375
+ fetch("/onboarding").then(r=>r.ok?r.json():null).then(window.kzSetupRow).catch(()=>{});
358
376
  // Phones: More holds the tabs that do not fit; a pick or a tap elsewhere closes it.
359
377
  const more=document.querySelector(".mtab");if(more){more.querySelectorAll("a").forEach(a=>a.addEventListener("click",()=>more.open=false));addEventListener("pointerdown",e=>{if(more.open&&!more.contains(e.target))more.open=false},true)}})();
360
378
  </script>
package/web/popup.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <title>kaizen chat</title>
7
7
  <style>
8
- :root{--bg-2:#fff;--line:#d9e0ee;--ink:#0c162f;--dim:#5b6b8c;--accent:#2d50a5;--danger:#c8322f;color-scheme:light}
9
- @media(prefers-color-scheme:dark){:root{--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--dim:#96aacd;--accent:#486ed9;--danger:#e85050;color-scheme:dark}}
8
+ :root{--bg-2:#fff;--line:#dedede;--ink:#171717;--dim:#666;--accent:#171717;--danger:#c8322f;color-scheme:light}
9
+ @media(prefers-color-scheme:dark){:root{--bg-2:#1a1a1a;--line:#2e2e2e;--ink:#ededed;--dim:#a0a0a0;--accent:#6b6b6b;--danger:#e85050;color-scheme:dark}}
10
10
  *{box-sizing:border-box}
11
11
  /* No window background: only the bubbles, the input and the buttons show. */
12
12
  html{background:transparent}