kaizen-agent 1.60.0 → 1.60.2

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/web/term.ts CHANGED
@@ -50,10 +50,15 @@ function mountTerm(el: HTMLElement, key: string, onEnd?: () => void): () => void
50
50
  const send = (m: object) => {
51
51
  if (ws?.readyState === WebSocket.OPEN) ws.send(JSON.stringify(m));
52
52
  };
53
- const size = () => {
53
+ const size = (nudge = false) => {
54
54
  if (!el.offsetWidth) return;
55
55
  fit.fit();
56
- send({ t: "r", c: term.cols, r: term.rows });
56
+ // The replay was drawn at whatever size the agent had before; a resize to the same size
57
+ // sends it no signal, so a full-screen agent never repaints it. One row short, then back, does.
58
+ if (nudge && term.rows > 5) {
59
+ send({ t: "r", c: term.cols, r: term.rows - 1 });
60
+ setTimeout(() => send({ t: "r", c: term.cols, r: term.rows }), 80);
61
+ } else send({ t: "r", c: term.cols, r: term.rows });
57
62
  };
58
63
  const connect = () => {
59
64
  clearTimeout(retry);
@@ -67,7 +72,7 @@ function mountTerm(el: HTMLElement, key: string, onEnd?: () => void): () => void
67
72
  lost = false;
68
73
  tries = 0;
69
74
  reBtn.hidden = true;
70
- size();
75
+ size(true);
71
76
  };
72
77
  ws.onmessage = (e) => term.write(String(e.data));
73
78
  // The board closes with "ended" when the agent exits; anything else is the board gone.
package/web/video.html CHANGED
@@ -3,7 +3,7 @@
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",(screen.orientation?.type.startsWith("landscape")?Math.min:Math.max)(screen.width,screen.height)+"px");s();addEventListener("resize",s)}}</script>
7
7
  <title>kaizen video</title>
8
8
  <link rel="icon" href="/favicon.ico" sizes="any">
9
9
  <link rel="icon" type="image/png" href="/logo.png">
@@ -21,6 +21,7 @@
21
21
  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
22
  html{background:var(--canvas);touch-action:manipulation}
23
23
  @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%}}
24
+ @media(display-mode:standalone) and (max-width:640px){body{bottom:auto;height:var(--sh,100lvh)}}
24
25
  @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
26
  /* 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
27
  @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 +43,9 @@ svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke
42
43
  .rail a.it[aria-current=page]{background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--ink)}
43
44
  .rail a.it[aria-current=page] svg{color:var(--accent)}
44
45
  .rail .end{flex:1}
46
+ .rail a.it[hidden]{display:none}
47
+ .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)}
48
+ @media(max-width:640px){.rail a.it#rsetup{display:none}}
45
49
  .theme{display:flex;gap:2px;padding:3px;border-radius:var(--r-s);background:var(--hover)}
46
50
  .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
51
  .theme button svg{width:var(--ico);height:var(--ico)}
@@ -90,9 +94,10 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
90
94
  .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
95
  .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
96
  .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}
97
+ .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
98
  .pfpop .pfh{margin:8px 8px 2px;font-size:11px;font-weight:600;color:var(--dim)}
94
99
  .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}
100
+ #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
101
  .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
102
  .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
103
  .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 +126,19 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
121
126
  [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
127
  @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
128
  /* phones: Home, Chat, Runs, Settings. The board, Ideas and the Icebox are set up on a computer (web/board/phone.ts) */
129
+ @media(min-width:641px){.rail .rbot .lbl{display:none}}
124
130
  .rail a.it.ponly,#phome{display:none}
125
131
  @media(max-width:640px){
126
132
  .rail a.it:is([data-view=board],[data-view=ideas],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
127
133
  .rail a.it.ponly{display:flex}
128
134
  .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}
135
+ .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)}
136
+ .rail a.it,[data-rail=min] .rail a.it{min-height:46px;gap:3px;font-size:10.5px;letter-spacing:.01em}
131
137
  .rail a.it svg{width:44px;height:26px;padding:4px 12px;box-sizing:border-box;border-radius:13px;transition:background .15s}
132
138
  .rail a.it[aria-current=page] svg{background:color-mix(in srgb,var(--accent) 16%,transparent)}
133
139
  .rail a.it[aria-current=page]{font-weight:600}
134
140
  }
141
+ [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
142
  /* end side menu */
136
143
  #kbd{display:none}
137
144
  /* the work area: an inset rounded panel on the canvas the side menu sits on */
@@ -364,15 +371,17 @@ pre.mark span:nth-child(1){color:var(--ink-hi)}pre.mark span:nth-child(2){color:
364
371
  <symbol id="r-chat" viewBox="0 0 24 24"><path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z"/></symbol>
365
372
  <symbol id="r-runs" viewBox="0 0 24 24"><path d="M9 6h11M9 12h11M9 18h11"/><circle cx="4.5" cy="6" r="1.2"/><circle cx="4.5" cy="12" r="1.2"/><circle cx="4.5" cy="18" r="1.2"/></symbol>
366
373
  </defs></svg>
374
+ <a class="it gs-it" href="#" id="gsearch" title="Search everything"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" fill="none" stroke="currentColor" stroke-width="2"/><path d="M20 20l-4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg><span class="lbl">Search</span></a>
367
375
  <a class="it" href="/" data-view="home" title="Home: chat with the project's agent"><svg><use href="#i-home"/></svg><span class="lbl">Home</span></a>
368
376
  <a class="it ponly" href="/?view=chat" data-view="chat" title="Chat with kaizen's agent"><svg><use href="#r-chat"/></svg><span class="lbl">Chat</span></a>
369
377
  <a class="it ponly" href="/?view=device" data-view="device" title="This computer's runs"><svg><use href="#r-runs"/></svg><span class="lbl">Runs</span></a>
370
378
  <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>
371
379
  <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>
372
380
  <a class="it" href="/?view=board" data-view="board" title="Board"><svg><use href="#i-board"/></svg><span class="lbl">Board</span></a>
381
+ <a class="it" href="/?setup=1" id="rsetup" hidden title="Continue setup"><span class="ring"></span><span class="lbl">Setup</span></a>
373
382
  <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>
374
383
  <div class="plist" id="plist" aria-label="Ideas and runs by project"></div>
375
- <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>
384
+ <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>
376
385
  </nav>
377
386
  <script>
378
387
  // Side menu: theme and collapse, the same lines in board.html and notes.html. Runs before
@@ -380,7 +389,7 @@ pre.mark span:nth-child(1){color:var(--ink-hi)}pre.mark span:nth-child(2){color:
380
389
  (()=>{const r=document.documentElement,wide=matchMedia("(max-width:1100px)"),phone=matchMedia("(max-width:640px)"),os=matchMedia("(prefers-color-scheme: dark)");
381
390
  // The toggle's choice is kept per browser; with none, the width decides. A phone always gets icons.
382
391
  let fold=null;try{fold=localStorage.getItem("kz-rail")}catch(e){}
383
- 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)};
392
+ 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)};
384
393
  wide.addEventListener("change",rail);phone.addEventListener("change",rail);rail();
385
394
  document.getElementById("fold").onclick=()=>{fold=r.dataset.rail==="min"?"full":"min";try{localStorage.setItem("kz-rail",fold)}catch(e){}rail()};
386
395
  // Theme: light, dark, or unset for system, in kz-theme. The toggle shows what is on screen and flips it.
@@ -392,6 +401,9 @@ pre.mark span:nth-child(1){color:var(--ink-hi)}pre.mark span:nth-child(2){color:
392
401
  try{const m=localStorage.getItem("kz-motion");if(m)r.dataset.motion=m}catch(e){}
393
402
  os.addEventListener("change",paint);paint();
394
403
  document.getElementById("themet").onclick=e=>setTheme(e.currentTarget.dataset.dark==="true"?"light":"dark");
404
+ // Setup: while first-run onboarding is skipped or unfinished, a row that continues it; the board redraws it as it saves.
405
+ 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}};
406
+ fetch("/onboarding").then(r=>r.ok?r.json():null).then(window.kzSetupRow).catch(()=>{});
395
407
  // Phones: More holds the tabs that do not fit; a pick or a tap elsewhere closes it.
396
408
  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)}})();
397
409
  </script>