kaizen-agent 1.7.8 → 1.7.9
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/package.json +1 -1
- package/web/board.html +4 -2
package/package.json
CHANGED
package/web/board.html
CHANGED
|
@@ -324,12 +324,14 @@ const wasAwaiting=new Map();let first=true;
|
|
|
324
324
|
const key=c=>c.kind==="idea"?"idea:"+c.state+":"+c.text:"run:"+c.state+":"+c.id;
|
|
325
325
|
|
|
326
326
|
async function load(){
|
|
327
|
-
|
|
327
|
+
let r;try{r=await fetch("/state"+(all?"?all=1":""))}catch{toast(GONE);return}S=await r.json();
|
|
328
328
|
for(const c of S.cards){if(c.kind!=="run")continue;const k=key(c),before=wasAwaiting.get(k);
|
|
329
329
|
if(!first&&before===null&&c.awaiting)notifyUser("kaizen — waiting on you",c.text+" · "+c.awaiting);wasAwaiting.set(k,c.awaiting)}
|
|
330
330
|
first=false;render();
|
|
331
331
|
if(openKey){const c=S.cards.find(x=>key(x)===openKey);if(c&&runDoc)openRun(c,true);else if(c&&c.kind==="idea"){const ta=$("pbody").querySelector("textarea");if(!(ta&&document.activeElement===ta))chat(c,c.notes,c.archived||c.status!=="idea")}}}
|
|
332
|
-
|
|
332
|
+
// A tab outliving its server would otherwise swallow every click: say so.
|
|
333
|
+
const GONE="The board server is not running — start it with kaizen web (or the shortcut), then reload.";
|
|
334
|
+
async function post(path,body){let r;try{r=await fetch(path,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(body)})}catch{toast(GONE);return{ok:false}}const j=await r.json().catch(()=>({}));if(!r.ok){toast(j.error||j.why||"failed");if(j.manual)console.log("run manually:",j.manual)}return j}
|
|
333
335
|
|
|
334
336
|
function card(c){
|
|
335
337
|
const k=key(c),el=document.createElement("div");el.className="card"+(k===openKey?" open":"")+(k===menuKey?" menu":"")+(c.archived?" archived":"");el.tabIndex=0;el.setAttribute("role","button");
|