constopen=h("button",{type:"button",class:"btn small icon-only",id:"kanban-prune-open",disabled:!stale&&!pending,...named("Prune","Prune stale tasks: one passkey signs the list and a deadline; the agents can keep a task until then")},icon("bi-scissors"));
constwords=`Prune at ${pruneClock(pending.deadline)}: ${pending.tasks.join(", ")}`;
constchip=h("span",{class:"pill prune-chip",id:"kanban-prune","data-tone":"warn","data-deadline":String(pending.deadline),role:"timer",...named(`Prune in ${Prune.clock(pending.left)}`,words)},
toast(result.ok?label:`${label}: not queued`,result.ok?[`Sécurité now, stopped at ${pruneClock(since+pruneView.dial.value()*Prune.MINUTE)} unless kept`]:fail(result),result.ok);
if(result.ok){
awaitload();
taskView.sig="";
drawTasks();
drawPrune(body);
}
}
functionpruneCountdown(body,pending){
pruneView.dial=dial({value:Math.ceil(pending.left/Prune.MINUTE),label:"Minutes until the prune",name:"prune-dial",min:0,max:Prune.MINUTES.max,page:Prune.MINUTES.page,
unit:"min",spoken:(minutes)=>`${minutes} minutes until the prune`,readonly:true});
pruneTicking();
body.replaceChildren(h("p",{},`Signed: the hub runner stops these tasks at ${pruneClock(pending.deadline)} unless an agent keeps one (rasci.py keep <task>) or changes it first.`),
pruneView.dial=dial({value:range.value,label:"Answer window in minutes",name:"prune-dial",min:range.min,max:range.max,page:range.page,unit:"min",
spoken:(minutes)=>`${minutes} minutes for the agents to keep a task`,readonly:false});
constcount=h("span",{class:"count"},"0");
constgo=h("button",{type:"button",class:"btn primary",id:"prune-sign",...named("Prune","Prune: one passkey signs the ticked tasks and the deadline; the hub sends a Sécurité to all at once")},icon("bi-scissors"),"Prune",count);
constfield=h("input",{class:"field",type:"text",inputmode:"numeric",id:"prune-days",value:String(pruneView.days),"aria-label":"Days without a register change",on:{change:(event)=>{
body.replaceChildren(h("label",{class:"prune-days"},h("span",{class:"muted"},"Stale after days"),field),list,
h("div",{class:"prune-wait"},pruneView.dial.root,h("p",{class:"muted"},"Answer window: the agents keep a task until then; every other ticked task is set stopped.")),