kaizen-agent 1.46.0 → 1.47.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/pty.test.ts CHANGED
@@ -216,6 +216,13 @@ test("asking: Claude Code and Codex prompts count as a question, ordinary output
216
216
  expect(asking("What behavior do you want?\r\n\x1b[36m❯ 1. Retry with backoff\x1b[0m\r\n 2. Fail\r\n 4. Type something.")).toBe(true);
217
217
  expect(asking("Do you want to make this edit to cli/pty.ts?")).toBe(true);
218
218
  expect(asking("Reading cli/pty.ts\r\n\x1b[2K✻ Thinking… 1. step one done")).toBe(false);
219
+ // Answered: the working line drawn after the question clears it.
220
+ expect(asking("Do you want to make this edit?\r\n\x1b[2K✻ Contemplating… (1m 4s · ↓ 4.4k tokens)")).toBe(false);
221
+ expect(asking("Would you like to run the following command?\r\n• Working (12s • esc to interrupt)")).toBe(false);
222
+ expect(asking("Do you want to proceed?\r\n⠋ Reading files (esc to cancel, 4s)")).toBe(false);
223
+ expect(asking("Do you want to proceed?\r\n esc interrupt")).toBe(false);
224
+ expect(asking("Do you want to proceed?\r\n❯ 1. Yes\r\n 2. No\r\n\r\nEsc to cancel · Tab to amend")).toBe(true);
225
+ expect(asking("✻ Thinking… (3s · esc to interrupt)\r\nDo you want to proceed?\r\n❯ 1. Yes")).toBe(true);
219
226
  });
220
227
 
221
228
  test("Windows ConPTY host: resize travels in-band, the agent command survives quotes and newlines", () => {
package/cli/pty.ts CHANGED
@@ -25,8 +25,18 @@ const ptys = new Map<string, Pty>();
25
25
  // ponytail: screen-text heuristic, misses a prompt worded otherwise; read agent hooks if that bites.
26
26
  const ASK = /Would you like to|Do you want to|[❯›>] ?1\. |Type something|\(y\/n\)|\[y\/N\]|Press enter to/i;
27
27
  // Escape sequences out; a cursor move becomes a space so words drawn apart stay apart.
28
- export const asking = (screen: string) =>
29
- ASK.test(screen.replace(/\x1b\[[0-9;?]*[A-Za-z]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][0-9A-Za-z]/g, " "));
28
+ // The agent's working line (Claude Code's "✻ Thinking… (12s · ↓ 1.2k tokens)", Codex's
29
+ // "Working (12s • esc to interrupt)", Gemini's "(esc to cancel, 12s)", opencode's "esc interrupt")
30
+ // drawn after the last question means the question was answered and it is working again: a
31
+ // redraw of the answered prompt or prompt-like words in its output would otherwise keep it "asking".
32
+ // Not a bare "Esc to cancel": Claude Code's own question footer says that.
33
+ const WORK = /\(\d+m? ?\d*s [·•]|esc to interrupt|\(esc to cancel, \d|esc interrupt/gi;
34
+ const lastAt = (re: RegExp, t: string) => { let i = -1; for (const m of t.matchAll(re)) i = m.index!; return i; };
35
+ export const asking = (screen: string) => {
36
+ const t = screen.replace(/\x1b\[[0-9;?]*[A-Za-z]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][0-9A-Za-z]/g, " ");
37
+ const q = lastAt(new RegExp(ASK.source, "gi"), t);
38
+ return q >= 0 && q > lastAt(WORK, t);
39
+ };
30
40
  // How long output stays still before the screen is read for a question.
31
41
  const QUIET_MS = 700;
32
42
  // Bun gained pseudo-terminals in 1.3.5; an older one spawns without a tty, so it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaizen-agent",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
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": {
package/web/board/api.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { store } from "./store.ts";
2
2
  import { key, render } from "./cards.ts";
3
- import { $ } from "./dom.ts";
3
+ import { $, vt } from "./dom.ts";
4
4
  import { close, ideaBody, open, openRun } from "./panel.ts";
5
5
  import { notifyUser, toast } from "./toast.ts";
6
6
  import { openTerms, termsShowing } from "./terms.ts";
@@ -12,6 +12,10 @@ declare const due: (key: string, say: string | null, done: boolean, now: number)
12
12
  // already asking when the page loads is not news, only what starts asking after.
13
13
  let asked: Set<string> | null = null;
14
14
 
15
+ // Each card's column and whether it needed you, as of the last /state: a card that changed
16
+ // column slides to the new one, one that starts needing you flashes. null: the first load is not news.
17
+ let before: Map<string, [number, boolean]> | null = null;
18
+
15
19
  // This page's project, sent with each request: the server keeps none, so another
16
20
  // tab or a phone picking a project never moves this one.
17
21
  export const dirHeader = () => (store.dir ? { "x-kz-dir": store.dir } : {});
@@ -45,8 +49,26 @@ export async function load(quiet) {
45
49
  for (const [k, c] of now) if (!asked.has(k)) notifyUser(`${c.kind === "run" ? c.id : String(c.text).split("\n")[0].slice(0, 80)} needs you`, "ask:" + k);
46
50
  asked = new Set(now.keys());
47
51
  }
52
+ const need = (c) => c.status === "waiting" || !!(c.pty?.alive && c.pty.asking),
53
+ moved = [];
54
+ for (const c of before ? store.S.cards : []) {
55
+ const b = before.get(key(c));
56
+ if (b && b[0] !== c.column) moved.push(key(c));
57
+ if (b && !b[1] && need(c)) store.flash.add(key(c));
58
+ }
59
+ before = new Map(store.S.cards.map((c) => [key(c), [c.column, need(c)]]));
60
+ // The old and new element of a moved card share a view-transition-name, so the browser slides one into the other.
61
+ const name = () =>
62
+ moved.forEach((k, i) => {
63
+ const el = $("board").querySelector(`[data-k="${CSS.escape(k)}"]`);
64
+ if (el) el.style.viewTransitionName = "kzm" + i;
65
+ });
48
66
  // A redraw under a form being typed in would reset its fields and its focus.
49
- if (!(quiet && store.mode && $("board").querySelector(".inl input"))) render();
67
+ if (!(quiet && store.mode && $("board").querySelector(".inl input"))) {
68
+ name();
69
+ await (moved.length ? vt(() => (render(), name())) : (render(), undefined));
70
+ store.flash.clear();
71
+ } else store.flash.clear(); // no redraw now: a flash at some later one would be stale
50
72
  if (termsShowing()) openTerms();
51
73
  // Run on an idea closed the panel: open the card on its agent once the board knows the session.
52
74
  if (store.wantTerm && !store.openKey && !store.mode) {
@@ -10,6 +10,7 @@ import { open, openAt, toggleArchive } from "./panel.ts";
10
10
  import { ideaCombo, list, newDir, plogo, short, showList, showable } from "./projects.ts";
11
11
  import { askNotify, toast } from "./toast.ts";
12
12
  import { answer, decided, resumable, resume } from "./approvals.ts";
13
+ import { termsBadge } from "./terms.ts";
13
14
 
14
15
  let filter = null;
15
16
  let query = ""; // the header filter box, matched against a card's title and request
@@ -92,6 +93,7 @@ function card(c) {
92
93
  "card" +
93
94
  (k === store.openKey ? " open" : "") +
94
95
  (k === store.menuKey ? " menu" : "") +
96
+ (store.flash.has(k) ? " flash" : "") +
95
97
  (c.archived ? " archived" : "");
96
98
  el.tabIndex = 0;
97
99
  el.dataset.k = k;
@@ -866,6 +868,7 @@ export function render() {
866
868
  // The tab says how many runs wait on you, or agents wait on input, so a background tab still tells you.
867
869
  const nw = store.S.cards.filter((c) => !c.archived && ((c.kind === "run" && c.status === "waiting") || (c.pty?.alive && c.pty.asking))).length;
868
870
  document.title = nw ? `(${nw}) kaizen` : "kaizen";
871
+ termsBadge();
869
872
  stopDictation(false); // forms were just rebuilt; a listener whose field is gone would write into nothing
870
873
  if (fk && document.activeElement === document.body) cardEl(fk)?.focus({ preventScroll: true });
871
874
  }
package/web/board/dom.ts CHANGED
@@ -48,3 +48,12 @@ export function modal(body: string | Safe) {
48
48
  dl.showModal();
49
49
  return dl;
50
50
  }
51
+
52
+ // Motion: the Settings choice (data-motion on <html>), else the system's reduced-motion.
53
+ export const motion = () => {
54
+ const m = document.documentElement.dataset.motion;
55
+ return m ? m === "full" : !matchMedia("(prefers-reduced-motion: reduce)").matches;
56
+ };
57
+ // fn as a view transition where the browser has them and motion is on; resolves once the DOM is updated.
58
+ export const vt = (fn: () => void): Promise<void> =>
59
+ motion() && document.startViewTransition ? document.startViewTransition(fn).updateCallbackDone : (fn(), Promise.resolve());
@@ -99,6 +99,7 @@ export async function openSettings() {
99
99
  ${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")}
100
100
  ${row("Google account", html`<button class="btn${gg.connected ? "" : " pri"}" id="gg-conn" type="button"${gg.hasClient || gg.connected ? "" : " disabled"}>${gg.connected ? "Disconnect" : "Connect"}</button>`, "", "gg-conn", "google account connect sheets write back")}</div>
101
101
  <h3 class="sg">Browser</h3><div class="sgrp">${row("Theme", ctl("th", ["system", "light", "dark"], cur), "", "th", "theme light dark system browser")}
102
+ ${row("Motion", ctl("mo", ["system", "full", "reduce"], document.documentElement.dataset.motion || "system"), "Animations on the board and notes. System follows the device's reduce-motion setting.", "mo", "motion animation reduce reduced browser")}
102
103
  ${row("Notifications", html`<button class="chk${np === "granted" ? " on" : ""}" id="nt" role="switch" aria-checked="${String(np === "granted")}"${np && np !== "denied" ? "" : " disabled"}></button>`, ntHelp, "nt", "notifications " + ntHelp + " browser")}</div>
103
104
  <p class="snone" id="snone" hidden></p>`;
104
105
  // Hides rows that do not match, then any group (and its chip) left with none.
@@ -184,6 +185,7 @@ export async function openSettings() {
184
185
  if (f && /^s-preset-|-(prev|next)$/.test(f)) $(f)?.focus();
185
186
  };
186
187
  stepper($("th"), ["system", "light", "dark"], cur, setTheme);
188
+ stepper($("mo"), ["system", "full", "reduce"], document.documentElement.dataset.motion || "system", setMotion);
187
189
  $("nt").onclick = () => {
188
190
  askNotify();
189
191
  setTimeout(openSettings, 300);
@@ -10,6 +10,8 @@ export const store = {
10
10
  mode: null,
11
11
  modeKey: null,
12
12
  menuKey: null,
13
+ // Cards that just started needing you: card() gives them one .flash.
14
+ flash: new Set<string>(),
13
15
  tab: "request",
14
16
  lastTab: "request",
15
17
  runDoc: null,
@@ -49,6 +49,17 @@ function sessions() {
49
49
  return m;
50
50
  }
51
51
 
52
+ // The side menu's Terminal entry counts the tiles hidden here (the Hidden bar's chips), on every page.
53
+ export function termsBadge() {
54
+ const all = sessions();
55
+ const n = lay.hidden.filter((k) => all.get(k)?.pty.alive).length;
56
+ const a = document.querySelector<HTMLElement>('.rail a[data-view="terminal"]');
57
+ if (!a) return;
58
+ if (n) a.dataset.n = String(n);
59
+ else delete a.dataset.n;
60
+ a.title = "Terminal: every agent running in its card" + (n ? ` (${n} hidden)` : "");
61
+ }
62
+
52
63
  export function termsStop() {
53
64
  showing = false;
54
65
  document.body.classList.remove("tmax");
@@ -131,6 +142,7 @@ export function openTerms() {
131
142
  // The layout switch sits at the right of the page header.
132
143
  $("tmodes").innerHTML = html`${MODES.map(([v, l, i]) => html`<button data-mode="${v}" class="${lay.mode === v ? "on" : ""}" aria-pressed="${String(lay.mode === v)}" title="${l}" aria-label="${l}">${ico(i)}</button>`)}`.s;
133
144
  bar!.innerHTML = html`${hid.length ? html`<span class="dim">Hidden</span>${hid.map((k) => html`<button class="chip" data-show="${k}" title="Show this terminal">${ico("plus")}${nameOf(all.get(k))} - ${projOf(all.get(k))}</button>`)}` : ""}${phone.matches && keys.length > 1 ? html`<span class="ttabs" role="group" aria-label="Terminals">${keys.map((k) => html`<button class="${k === one ? "on" : ""}" data-pick="${k}" aria-pressed="${String(k === one)}"><span class="tdot ${tst(all.get(k))}"></span>${nameOf(all.get(k))} - ${projOf(all.get(k))}</button>`)}</span>` : ""}`.s;
145
+ termsBadge();
134
146
  bar!.querySelectorAll<HTMLElement>("[data-pick]").forEach(
135
147
  (b) =>
136
148
  (b.onclick = () => {
@@ -1,5 +1,5 @@
1
1
  import { store } from "./store.ts";
2
- import { $ } from "./dom.ts";
2
+ import { $, vt } from "./dom.ts";
3
3
  import { openSources } from "./icebox.ts";
4
4
  import { close } from "./panel.ts";
5
5
  import { openSettings } from "./settings.ts";
@@ -63,15 +63,15 @@ export function initViews() {
63
63
  if (e.ctrlKey || e.metaKey || e.shiftKey || e.button) return;
64
64
  e.preventDefault();
65
65
  if (a.dataset.view === "settings") store.setQ = "";
66
- go(a.dataset.view, true);
66
+ vt(() => go(a.dataset.view, true));
67
67
  };
68
68
  });
69
69
  document.querySelector(".rail .home").onclick = (e) => {
70
70
  if (e.ctrlKey || e.metaKey || e.shiftKey || e.button) return;
71
71
  e.preventDefault();
72
- go("board", true);
72
+ vt(() => go("board", true));
73
73
  };
74
- addEventListener("popstate", () => go(new URLSearchParams(location.search).get("view")));
74
+ addEventListener("popstate", () => vt(() => go(new URLSearchParams(location.search).get("view"))));
75
75
  // The menu's theme switch while Settings shows: its Theme row follows.
76
76
  addEventListener("kz-theme", () => {
77
77
  if (view === "settings") openSettings();
package/web/board.html CHANGED
@@ -68,6 +68,8 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
68
68
  [data-rail=min] .rail .lbl{position:static;width:auto;height:auto;overflow:visible;clip-path:none}
69
69
  body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;bottom:calc(68px + env(safe-area-inset-bottom))}}
70
70
  /* end side menu */
71
+ .rail a.it[data-n]{position:relative}.rail a.it[data-n]::after{content:attr(data-n);position:absolute;left:24px;top:3px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--dim);color:var(--bg);font:600 10px/16px var(--font);text-align:center;box-shadow:0 0 0 2px var(--bg)}
72
+ @media(max-width:640px){body .rail a.it[data-n]::after{left:calc(50% + 4px);top:2px}}
71
73
  /* the work area: an inset rounded panel on the canvas the side menu sits on */
72
74
  .app{flex:1;min-width:0;display:flex;flex-direction:column;margin:8px 8px 8px 0;background:var(--bg);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
73
75
  @media(max-width:640px){.app{margin:0;border:0;border-radius:0}html,body{background:var(--bg)}aside:not(.docked){padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0}}
@@ -196,7 +198,7 @@ section li.hint{display:block;padding:14px;border:1px dashed var(--line);border-
196
198
  .c-marks{display:flex;align-items:center;gap:6px;color:var(--dim);margin-left:auto}
197
199
  .mk{display:grid;place-items:center;font-size:11px;font-weight:500}
198
200
  .mk svg{width:13px;height:13px;stroke-width:1.7}
199
- .mk.accent{color:var(--accent)}.mk.ok{color:var(--ok)}.mk.warn{color:var(--warn)}.mk.run{color:var(--run)}.mk.ask{animation:askp 1.6s ease-in-out infinite}@keyframes askp{50%{opacity:.35}}@media (prefers-reduced-motion:reduce){.mk.ask{animation:none}}
201
+ .mk.accent{color:var(--accent)}.mk.ok{color:var(--ok)}.mk.warn{color:var(--warn)}.mk.run{color:var(--run)}.mk.ask{animation:askp 1.6s ease-in-out infinite}@keyframes askp{50%{opacity:.35}}
200
202
  .chip.proj{color:var(--ink);background:color-mix(in srgb,var(--dim) 12%,transparent);box-shadow:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;overflow-wrap:normal}
201
203
  .chip{display:inline-flex;align-items:center;gap:5px;min-height:20px;padding:1px 8px;border-radius:11px;overflow-wrap:anywhere;font-size:11px;font-weight:500;color:var(--dim);box-shadow:inset 0 0 0 1px var(--line)}
202
204
  .chip i{width:6px;height:6px;border-radius:50%;background:var(--dim)}
@@ -249,6 +251,7 @@ aside.wide{width:100%;border-left:0}#pbody:has(.term){display:flex;flex-directio
249
251
  .empty b{font-size:16px;font-weight:600;color:var(--ink)}.empty p{margin:0 0 6px;max-width:44ch}
250
252
  .mascot{width:120px;height:112px;background:var(--ink);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 428 400%22%3E%3Cpath fill=%22currentColor%22 fill-rule=%22evenodd%22 d=%22M130 381L122 362L119 346L119 325L124 305L123 294L119 288L117 288L115 285L109 282L89 264L89 262L82 256L82 254L79 252L79 250L76 248L76 246L73 244L70 237L68 236L58 216L53 201L49 182L48 166L45 166L39 170L19 177L7 178L2 176L0 173L0 163L4 157L4 154L7 150L7 147L10 143L16 126L20 120L26 103L30 97L30 94L34 88L37 78L41 72L44 62L48 56L48 53L52 47L52 44L56 38L59 28L64 20L67 10L70 7L247 0L252 4L253 11L250 18L243 25L243 27L209 60L207 60L203 65L201 65L197 70L195 70L191 75L189 75L186 79L180 82L169 92L164 93L161 90L162 85L169 81L171 78L173 78L176 74L178 74L181 70L183 70L186 66L193 62L197 57L199 57L205 50L207 50L235 23L235 21L242 14L244 9L241 9L226 14L220 18L217 18L199 27L198 29L190 32L189 34L183 36L182 38L178 39L177 41L173 42L167 47L163 48L156 54L152 55L151 57L149 57L148 59L146 59L145 61L143 61L142 63L140 63L139 65L137 65L136 67L134 67L133 69L131 69L130 71L116 79L114 82L106 86L104 89L99 91L93 97L88 99L86 102L84 102L82 105L80 105L78 108L76 108L74 111L72 111L70 114L68 114L66 117L64 117L62 120L56 123L53 127L51 127L48 131L41 135L37 140L35 140L15 159L15 161L11 164L9 169L21 167L30 164L34 161L37 161L45 156L48 156L50 140L57 132L71 131L75 133L79 138L81 138L87 135L88 133L94 131L95 129L104 126L107 129L106 134L82 147L82 156L85 172L92 188L94 189L94 194L92 196L88 196L84 192L79 182L74 164L73 144L69 140L62 140L58 144L58 182L62 200L68 217L76 232L82 239L82 241L92 252L92 254L107 269L109 269L112 273L114 273L128 285L132 292L133 307L128 325L128 345L131 361L140 382L149 390L160 392L191 381L228 377L238 373L251 362L251 360L254 358L255 354L258 351L261 341L261 322L259 315L253 304L243 294L232 288L220 285L203 286L188 292L176 303L176 305L170 313L167 323L168 345L178 363L187 370L187 375L184 377L179 376L169 366L161 352L158 341L158 323L162 309L167 300L170 298L170 296L181 286L194 279L207 276L221 276L234 279L244 284L249 289L251 289L263 303L270 322L270 342L266 355L260 363L260 365L257 367L257 369L247 378L243 379L240 382L253 386L263 391L277 391L281 389L290 379L298 358L300 347L300 323L296 307L297 298L302 292L318 287L333 279L335 276L337 276L339 273L341 273L345 268L349 266L349 264L355 259L351 251L349 242L345 243L341 247L329 253L309 258L290 258L276 255L274 257L262 261L236 266L192 266L154 257L130 245L129 243L121 239L119 236L117 236L101 220L101 218L98 216L96 212L95 207L107 192L113 180L119 159L121 157L121 151L118 146L118 142L115 135L114 112L117 101L124 92L129 90L138 90L146 92L159 99L169 109L184 103L204 99L231 100L244 103L259 109L264 103L266 103L268 100L270 100L271 98L280 93L290 90L302 91L309 97L314 112L314 130L311 143L307 152L307 156L310 161L316 182L325 198L332 205L333 210L328 219L322 224L322 226L317 231L315 231L310 237L308 237L306 240L296 245L292 249L309 249L325 245L341 236L347 230L350 210L360 193L360 187L355 178L355 174L357 172L387 172L389 177L384 187L385 195L387 194L391 182L394 180L401 180L415 187L426 190L428 193L428 202L423 211L423 214L421 216L421 219L419 221L419 224L417 226L417 229L415 231L415 234L413 236L413 239L411 241L405 258L402 260L395 260L390 257L388 259L366 259L361 264L361 266L340 285L318 297L307 300L305 302L305 307L309 325L318 323L325 319L334 310L334 308L337 306L341 298L354 283L356 283L362 277L377 271L394 271L400 273L407 277L415 285L420 294L423 306L421 323L416 335L408 344L408 346L401 353L399 353L397 356L395 356L388 362L369 370L353 373L330 373L304 367L301 377L297 385L294 387L294 389L288 395L279 400L261 400L240 391L216 387L192 390L167 400L150 400L139 394L132 386ZM130 155L119 189L116 192L112 201L106 207L107 210L119 207L126 200L134 185L136 184L137 180L149 166L163 158L171 156L180 156L191 160L198 166L202 173L204 182L203 192L195 205L194 216L196 220L205 227L212 229L221 228L227 225L233 219L234 207L225 191L225 177L233 163L235 163L237 160L241 158L248 156L262 157L278 165L289 177L289 179L295 186L297 192L299 193L300 197L309 207L316 210L323 209L313 196L307 184L304 171L297 154L302 142L305 129L304 107L301 101L298 99L291 99L278 104L261 119L257 119L243 112L224 108L197 109L185 112L171 119L167 119L163 114L161 114L157 109L155 109L150 104L138 99L130 99L126 103L123 113L123 128L125 138L131 152ZM380 280L372 282L361 289L361 306L364 310L375 312L382 317L384 321L384 337L386 339L390 341L400 341L408 331L413 319L413 301L409 292L400 283L393 280ZM144 187L141 193L139 194L138 198L134 202L134 204L131 206L131 208L125 214L123 214L120 217L113 218L113 220L124 230L126 230L128 233L138 238L139 240L156 248L180 255L201 258L226 258L257 253L277 246L291 239L292 237L303 231L315 220L315 218L306 216L298 209L298 207L291 199L290 195L288 194L287 190L285 189L281 181L271 171L257 165L245 166L241 168L235 175L234 190L242 203L243 217L240 224L234 231L221 237L207 237L201 235L194 229L192 229L186 220L185 207L187 201L193 193L195 185L193 175L187 168L179 165L171 165L164 167L158 172L156 172L148 180ZM367 179L364 179L367 185L367 195L362 204L360 205L355 219L355 240L357 247L361 253L383 253L388 245L390 236L389 218L383 203L377 195L377 185L380 179ZM319 362L330 364L360 363L376 358L387 352L389 349L382 347L376 341L375 323L371 320L362 319L359 316L357 316L353 310L351 300L348 306L343 311L343 313L333 324L331 324L329 327L320 332L309 334L309 348L307 358ZM130 59L132 59L133 57L147 49L149 46L76 18L66 105L72 100L74 100L76 97L78 97L80 94L82 94L84 91L89 89L91 86L93 86L95 83L97 83L105 76L113 72L115 69L129 61ZM213 204L218 204L225 208L224 213L217 218L211 218L207 216L203 210L205 206ZM39 96L20 142L26 136L28 136L33 130L35 130L38 126L40 126L43 122L45 122L48 118L50 118L53 114L56 113L64 41L56 57L56 60L52 66L49 76L45 82L42 92ZM194 11L101 14L95 16L98 16L100 18L103 18L105 20L108 20L110 22L113 22L115 24L118 24L120 26L123 26L125 28L128 28L130 30L133 30L135 32L138 32L140 34L143 34L145 36L148 36L159 41L164 37L168 36L169 34L173 33L174 31L178 30L179 28L213 11ZM409 203L413 193L412 191L404 189L400 186L396 186L394 190L390 203L395 213L397 230L401 223L407 205ZM418 210L421 200L423 198L423 196L418 195L412 212L407 221L407 224L405 226L405 229L403 231L403 234L401 236L401 239L399 241L399 244L397 246L397 249L395 251L396 254L400 254ZM182 191L178 195L170 194L167 190L168 182L172 179L180 180L183 183ZM256 194L250 195L245 190L245 184L250 179L256 179L261 184L261 190L258 194Z%22/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 428 400%22%3E%3Cpath fill=%22currentColor%22 fill-rule=%22evenodd%22 d=%22M130 381L122 362L119 346L119 325L124 305L123 294L119 288L117 288L115 285L109 282L89 264L89 262L82 256L82 254L79 252L79 250L76 248L76 246L73 244L70 237L68 236L58 216L53 201L49 182L48 166L45 166L39 170L19 177L7 178L2 176L0 173L0 163L4 157L4 154L7 150L7 147L10 143L16 126L20 120L26 103L30 97L30 94L34 88L37 78L41 72L44 62L48 56L48 53L52 47L52 44L56 38L59 28L64 20L67 10L70 7L247 0L252 4L253 11L250 18L243 25L243 27L209 60L207 60L203 65L201 65L197 70L195 70L191 75L189 75L186 79L180 82L169 92L164 93L161 90L162 85L169 81L171 78L173 78L176 74L178 74L181 70L183 70L186 66L193 62L197 57L199 57L205 50L207 50L235 23L235 21L242 14L244 9L241 9L226 14L220 18L217 18L199 27L198 29L190 32L189 34L183 36L182 38L178 39L177 41L173 42L167 47L163 48L156 54L152 55L151 57L149 57L148 59L146 59L145 61L143 61L142 63L140 63L139 65L137 65L136 67L134 67L133 69L131 69L130 71L116 79L114 82L106 86L104 89L99 91L93 97L88 99L86 102L84 102L82 105L80 105L78 108L76 108L74 111L72 111L70 114L68 114L66 117L64 117L62 120L56 123L53 127L51 127L48 131L41 135L37 140L35 140L15 159L15 161L11 164L9 169L21 167L30 164L34 161L37 161L45 156L48 156L50 140L57 132L71 131L75 133L79 138L81 138L87 135L88 133L94 131L95 129L104 126L107 129L106 134L82 147L82 156L85 172L92 188L94 189L94 194L92 196L88 196L84 192L79 182L74 164L73 144L69 140L62 140L58 144L58 182L62 200L68 217L76 232L82 239L82 241L92 252L92 254L107 269L109 269L112 273L114 273L128 285L132 292L133 307L128 325L128 345L131 361L140 382L149 390L160 392L191 381L228 377L238 373L251 362L251 360L254 358L255 354L258 351L261 341L261 322L259 315L253 304L243 294L232 288L220 285L203 286L188 292L176 303L176 305L170 313L167 323L168 345L178 363L187 370L187 375L184 377L179 376L169 366L161 352L158 341L158 323L162 309L167 300L170 298L170 296L181 286L194 279L207 276L221 276L234 279L244 284L249 289L251 289L263 303L270 322L270 342L266 355L260 363L260 365L257 367L257 369L247 378L243 379L240 382L253 386L263 391L277 391L281 389L290 379L298 358L300 347L300 323L296 307L297 298L302 292L318 287L333 279L335 276L337 276L339 273L341 273L345 268L349 266L349 264L355 259L351 251L349 242L345 243L341 247L329 253L309 258L290 258L276 255L274 257L262 261L236 266L192 266L154 257L130 245L129 243L121 239L119 236L117 236L101 220L101 218L98 216L96 212L95 207L107 192L113 180L119 159L121 157L121 151L118 146L118 142L115 135L114 112L117 101L124 92L129 90L138 90L146 92L159 99L169 109L184 103L204 99L231 100L244 103L259 109L264 103L266 103L268 100L270 100L271 98L280 93L290 90L302 91L309 97L314 112L314 130L311 143L307 152L307 156L310 161L316 182L325 198L332 205L333 210L328 219L322 224L322 226L317 231L315 231L310 237L308 237L306 240L296 245L292 249L309 249L325 245L341 236L347 230L350 210L360 193L360 187L355 178L355 174L357 172L387 172L389 177L384 187L385 195L387 194L391 182L394 180L401 180L415 187L426 190L428 193L428 202L423 211L423 214L421 216L421 219L419 221L419 224L417 226L417 229L415 231L415 234L413 236L413 239L411 241L405 258L402 260L395 260L390 257L388 259L366 259L361 264L361 266L340 285L318 297L307 300L305 302L305 307L309 325L318 323L325 319L334 310L334 308L337 306L341 298L354 283L356 283L362 277L377 271L394 271L400 273L407 277L415 285L420 294L423 306L421 323L416 335L408 344L408 346L401 353L399 353L397 356L395 356L388 362L369 370L353 373L330 373L304 367L301 377L297 385L294 387L294 389L288 395L279 400L261 400L240 391L216 387L192 390L167 400L150 400L139 394L132 386ZM130 155L119 189L116 192L112 201L106 207L107 210L119 207L126 200L134 185L136 184L137 180L149 166L163 158L171 156L180 156L191 160L198 166L202 173L204 182L203 192L195 205L194 216L196 220L205 227L212 229L221 228L227 225L233 219L234 207L225 191L225 177L233 163L235 163L237 160L241 158L248 156L262 157L278 165L289 177L289 179L295 186L297 192L299 193L300 197L309 207L316 210L323 209L313 196L307 184L304 171L297 154L302 142L305 129L304 107L301 101L298 99L291 99L278 104L261 119L257 119L243 112L224 108L197 109L185 112L171 119L167 119L163 114L161 114L157 109L155 109L150 104L138 99L130 99L126 103L123 113L123 128L125 138L131 152ZM380 280L372 282L361 289L361 306L364 310L375 312L382 317L384 321L384 337L386 339L390 341L400 341L408 331L413 319L413 301L409 292L400 283L393 280ZM144 187L141 193L139 194L138 198L134 202L134 204L131 206L131 208L125 214L123 214L120 217L113 218L113 220L124 230L126 230L128 233L138 238L139 240L156 248L180 255L201 258L226 258L257 253L277 246L291 239L292 237L303 231L315 220L315 218L306 216L298 209L298 207L291 199L290 195L288 194L287 190L285 189L281 181L271 171L257 165L245 166L241 168L235 175L234 190L242 203L243 217L240 224L234 231L221 237L207 237L201 235L194 229L192 229L186 220L185 207L187 201L193 193L195 185L193 175L187 168L179 165L171 165L164 167L158 172L156 172L148 180ZM367 179L364 179L367 185L367 195L362 204L360 205L355 219L355 240L357 247L361 253L383 253L388 245L390 236L389 218L383 203L377 195L377 185L380 179ZM319 362L330 364L360 363L376 358L387 352L389 349L382 347L376 341L375 323L371 320L362 319L359 316L357 316L353 310L351 300L348 306L343 311L343 313L333 324L331 324L329 327L320 332L309 334L309 348L307 358ZM130 59L132 59L133 57L147 49L149 46L76 18L66 105L72 100L74 100L76 97L78 97L80 94L82 94L84 91L89 89L91 86L93 86L95 83L97 83L105 76L113 72L115 69L129 61ZM213 204L218 204L225 208L224 213L217 218L211 218L207 216L203 210L205 206ZM39 96L20 142L26 136L28 136L33 130L35 130L38 126L40 126L43 122L45 122L48 118L50 118L53 114L56 113L64 41L56 57L56 60L52 66L49 76L45 82L42 92ZM194 11L101 14L95 16L98 16L100 18L103 18L105 20L108 20L110 22L113 22L115 24L118 24L120 26L123 26L125 28L128 28L130 30L133 30L135 32L138 32L140 34L143 34L145 36L148 36L159 41L164 37L168 36L169 34L173 33L174 31L178 30L179 28L213 11ZM409 203L413 193L412 191L404 189L400 186L396 186L394 190L390 203L395 213L397 230L401 223L407 205ZM418 210L421 200L423 198L423 196L418 195L412 212L407 221L407 224L405 226L405 229L403 231L403 234L401 236L401 239L399 241L399 244L397 246L397 249L395 251L396 254L400 254ZM182 191L178 195L170 194L167 190L168 182L172 179L180 180L183 183ZM256 194L250 195L245 190L245 184L250 179L256 179L261 184L261 190L258 194Z%22/%3E%3C/svg%3E") center/contain no-repeat}
251
253
  @keyframes fi{from{opacity:0}}
254
+ .card.flash{animation:flash .9s 2}@keyframes flash{50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 40%,transparent)}}
252
255
 
253
256
  /* footer */
254
257
  .ftr{display:flex;justify-content:space-between;gap:16px;padding:6px 28px;border-top:1px solid var(--line);color:var(--dim);font-size:12px;flex-wrap:wrap;align-items:center}
@@ -278,7 +281,7 @@ body.termv #terms{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px
278
281
  .tile header{display:flex;align-items:center;gap:8px;min-height:30px;padding:0 4px 0 10px;border-bottom:1px solid var(--line);background:var(--bg-2);cursor:grab;user-select:none}
279
282
  .tile header b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600}.tile header .sp{flex:1}
280
283
  .tile.ended .term{opacity:.6}.tend{flex:none;padding:0 6px;border-radius:9px;font-size:11px;color:var(--dim);box-shadow:inset 0 0 0 1px var(--line)}.tile header .btn.sm{height:22px;padding:0 8px;font-size:11px}
281
- .tile.asking{border-color:var(--warn);animation:task 1.6s ease-in-out infinite}@keyframes task{50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--warn) 45%,transparent)}}@media (prefers-reduced-motion:reduce){.tile.asking{animation:none;box-shadow:0 0 0 2px var(--warn)}}
284
+ .tile.asking{border-color:var(--warn);animation:task 1.6s ease-in-out infinite}@keyframes task{50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--warn) 45%,transparent)}}@media (prefers-reduced-motion:reduce){:root:not([data-motion=full]) .tile.asking{box-shadow:0 0 0 2px var(--warn)}}:root[data-motion=reduce] .tile.asking{box-shadow:0 0 0 2px var(--warn)}
282
285
  .tdot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--run)}.tdot.asking{background:var(--warn)}.tdot.ended{background:var(--dim);opacity:.6}
283
286
  .term{position:relative}.termtools{position:absolute;top:6px;right:14px;z-index:5;display:flex;gap:4px;opacity:.35;transition:opacity .15s}.term:hover .termtools,.termtools:focus-within{opacity:1}.termtools button,.termtools input{height:24px;padding:0 8px;border:1px solid var(--line);border-radius:6px;background:var(--bg-2);color:var(--ink-hi);font:12px var(--mono)}.termtools button:hover{background:var(--hover)}.tsearch{display:flex;gap:4px}.tsearch[hidden]{display:none}.termtools input{width:160px;padding:0 6px}.tile .term{flex:1;min-height:0}.tile .term .xterm{height:100%;padding:4px}.tile .term .xterm-viewport{background:transparent!important}
284
287
  .tsplit{position:absolute;z-index:2;touch-action:none}.tsplit.c{top:0;width:10px;margin-left:-5px;cursor:col-resize}.tsplit.r{left:0;right:0;height:10px;margin-top:-5px;cursor:row-resize}.tsplit:hover,.tdrag .tsplit:active{background:color-mix(in srgb,var(--accent) 35%,transparent)}
@@ -508,7 +511,11 @@ a.schip:hover{color:var(--ink);border-color:color-mix(in srgb,var(--line) 60%,va
508
511
  @media(max-width:640px){.hdr{gap:8px 12px}.hdr h1{order:0;flex:1 0 50%}#newtop{order:1}.hdr .combo{order:2;flex:1 1 calc(50% - 6px);min-width:0}.hdr .combo>.sel{width:100%;max-width:none}.hdr .sp{display:none}#bq{order:3;flex:1 0 100%;width:auto}.ftr{gap:6px 12px}}
509
512
  @media(hover:none){#kbd{display:none}}
510
513
  .skel{display:block;border-radius:6px;background:linear-gradient(90deg,var(--line) 25%,color-mix(in srgb,var(--line) 45%,transparent) 50%,var(--line) 75%);background-size:200% 100%;animation:skel 1.2s ease-in-out infinite}@keyframes skel{from{background-position:200% 0}to{background-position:-200% 0}}
511
- @media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
514
+ /* motion: data-motion (Settings) wins over the system's reduced-motion */
515
+ @view-transition{navigation:auto}
516
+ ::view-transition-group(*){animation-duration:.2s}
517
+ @media(prefers-reduced-motion:reduce){:root:not([data-motion=full]) *,:root:not([data-motion=full]) *::before,:root:not([data-motion=full]) *::after,:root:not([data-motion=full])::view-transition-group(*),:root:not([data-motion=full])::view-transition-old(*),:root:not([data-motion=full])::view-transition-new(*){transition:none!important;animation:none!important}}
518
+ :root[data-motion=reduce] *,:root[data-motion=reduce] *::before,:root[data-motion=reduce] *::after,:root[data-motion=reduce]::view-transition-group(*),:root[data-motion=reduce]::view-transition-old(*),:root[data-motion=reduce]::view-transition-new(*){transition:none!important;animation:none!important}
512
519
  </style>
513
520
  </head>
514
521
  <body>
@@ -601,6 +608,9 @@ a.schip:hover{color:var(--ink);border-color:color-mix(in srgb,var(--line) 60%,va
601
608
  const paint=()=>{const d=r.dataset.theme?r.dataset.theme==="dark":os.matches;document.querySelectorAll(".theme button").forEach(b=>b.setAttribute("aria-pressed",(b.dataset.t==="dark")===d))};
602
609
  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"))};
603
610
  try{const t=localStorage.getItem("kz-theme");if(t)r.dataset.theme=t}catch(e){}
611
+ // Motion: full, reduce, or unset to follow the system's reduced-motion, in kz-motion.
612
+ window.setMotion=m=>{if(m==="system")delete r.dataset.motion;else r.dataset.motion=m;try{m==="system"?localStorage.removeItem("kz-motion"):localStorage.setItem("kz-motion",m)}catch(e){}};
613
+ try{const m=localStorage.getItem("kz-motion");if(m)r.dataset.motion=m}catch(e){}
604
614
  os.addEventListener("change",paint);paint();
605
615
  document.querySelectorAll(".theme button").forEach(b=>b.onclick=()=>setTheme(b.dataset.t))})();
606
616
  </script>