@wrongstack/webui-hq 0.296.4 → 0.297.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/dist/assets/{alerts-B_wJljmR.js → alerts-Bkl4wBJE.js} +1 -1
- package/dist/assets/{brain-D5R8R8BY.js → brain-aSSiXPI_.js} +1 -1
- package/dist/assets/{cockpit-DvD1_FDz.js → cockpit-Dj4gx69d.js} +1 -1
- package/dist/assets/{control-DGfNRSfd.js → control-BcPCPylB.js} +1 -1
- package/dist/assets/{cost-CE_P6ujW.js → cost-DdiRINxE.js} +1 -1
- package/dist/assets/{fleet-map-CPD0vSE4.js → fleet-map-B2eU2NoT.js} +1 -1
- package/dist/assets/{fleet-topology-BA3kpTuc.js → fleet-topology-CTK7p_tj.js} +1 -1
- package/dist/assets/index-B10rm8pW.css +1 -0
- package/dist/assets/index-DwX1O_JZ.js +2 -0
- package/dist/assets/{kanban-C9jQWM2T.js → kanban-6xxUvXep.js} +1 -1
- package/dist/assets/{live-console-BqDIM7Cs.js → live-console-BRrd34p2.js} +1 -1
- package/dist/assets/{mailbox-E7puE59T.js → mailbox-CtUPdH7g.js} +1 -1
- package/dist/assets/{settings-DMQf2eO5.js → settings-M1WNoX6Y.js} +1 -1
- package/dist/assets/{trends-DqAtNjBm.js → trends-Bl-Wyntb.js} +1 -1
- package/dist/assets/{use-backfilled-events-B_7YE0rb.js → use-backfilled-events-ceR5R8_K.js} +1 -1
- package/dist/assets/{worktree-D0pa1IH5.js → worktree-DrEOGtox.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -4
- package/dist/assets/index-04jymFDH.js +0 -2
- package/dist/assets/index-CBQuUJLJ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{F as t,I as n,L as r,Lt as i,P as a,W as o,h as s,it as c,k as l,w as u,wt as d,y as f}from"./icons-BV2PcvP1.js";import{i as p}from"./markdown-HUVrfVaI.js";import{a as m,c as h,f as g,i as _,l as v,u as y}from"./index-04jymFDH.js";import{t as b}from"./use-backfilled-events-B_7YE0rb.js";var x=e(i(),1),S=p(),C=[{value:`note`,label:`note — general information`},{value:`ask`,label:`ask — reply required`},{value:`assign`,label:`assign — work ownership`},{value:`steer`,label:`steer — redirect the current work`},{value:`btw`,label:`btw — FYI, no action required`},{value:`queue`,label:`queue — note for the next agent`},{value:`broadcast`,label:`broadcast — all agents in the project`},{value:`status`,label:`status — meaningful checkpoint`},{value:`result`,label:`result — completed output/evidence`},{value:`review`,label:`review — passive inspection request`}];function w({projects:e,sender:t}){let n=t??h,[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(``),[c,l]=(0,x.useState)(`steer`),[u,d]=(0,x.useState)(`leader`),[f,p]=(0,x.useState)(`normal`),[m,g]=(0,x.useState)(!1),[_,v]=(0,x.useState)(``),[y,b]=(0,x.useState)(``),[w,T]=(0,x.useState)({phase:`idle`}),E=o||e[0]?.projectId||``,D=w.phase!==`sending`&&y.trim().length>0&&E.length>0,O=async()=>{if(D){T({phase:`sending`});try{let e=await n({projectId:E,type:c,...c===`broadcast`?{}:{to:u.trim()||`leader`},subject:_.trim()||`HQ prompt`,body:y.trim(),priority:f,audience:m?`leaders`:`all`});T({phase:`sent`,messageId:e.messageId}),b(``)}catch(e){T({phase:`error`,message:e instanceof Error?e.message:String(e)})}}};return i?(0,S.jsxs)(`div`,{className:`hq-card hq-composer`,children:[(0,S.jsxs)(`div`,{className:`hq-row hq-row-baseline`,children:[(0,S.jsx)(`span`,{className:`hq-card-title hq-title-inline`,children:`Send to project mailbox`}),(0,S.jsx)(`span`,{className:`hq-composer-hint`,children:`lands in the mailbox file — picked up by the next agent, no live client needed`}),(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle hq-ml-auto`,"aria-label":`Collapse composer`,onClick:()=>a(!1),children:`▾`})]}),(0,S.jsxs)(`div`,{className:`hq-composer-grid`,children:[(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`project`}),(0,S.jsx)(`select`,{className:`hq-select`,value:E,onChange:e=>s(e.target.value),children:e.map(e=>(0,S.jsx)(`option`,{value:e.projectId,children:e.label??e.projectId},e.projectId))})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`type`}),(0,S.jsx)(`select`,{className:`hq-select`,value:c,onChange:e=>l(e.target.value),children:C.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),c!==`broadcast`&&(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`to`}),(0,S.jsx)(`input`,{className:`hq-input`,value:u,placeholder:`leader`,onChange:e=>d(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`audience`}),(0,S.jsxs)(`select`,{className:`hq-select`,value:m?`leaders`:`all`,onChange:e=>g(e.target.value===`leaders`),children:[(0,S.jsx)(`option`,{value:`all`,children:`all agents`}),(0,S.jsx)(`option`,{value:`leaders`,children:`leaders only — subagents cannot consume`})]})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`priority`}),(0,S.jsxs)(`select`,{className:`hq-select`,value:f,onChange:e=>p(e.target.value),children:[(0,S.jsx)(`option`,{value:`high`,children:`high`}),(0,S.jsx)(`option`,{value:`normal`,children:`normal`}),(0,S.jsx)(`option`,{value:`low`,children:`low`})]})]})]}),(0,S.jsx)(`input`,{className:`hq-input`,value:_,placeholder:`subject (optional)`,onChange:e=>v(e.target.value)}),(0,S.jsx)(`textarea`,{className:`hq-input hq-composer-body`,value:y,rows:3,placeholder:`Message body — e.g. “after the current task, run the full test suite”`,onChange:e=>b(e.target.value)}),(0,S.jsxs)(`div`,{className:`hq-row`,children:[(0,S.jsx)(`button`,{type:`button`,className:`hq-btn`,disabled:!D,onClick:()=>void O(),children:w.phase===`sending`?`Sending…`:`Send`}),w.phase===`sent`&&(0,S.jsxs)(`span`,{className:`hq-composer-status ok`,children:[`delivered`,w.messageId===void 0?``:` · ${w.messageId.slice(0,8)}`]}),w.phase===`error`&&(0,S.jsx)(`span`,{className:`hq-composer-status err`,title:w.message,children:w.message})]})]}):(0,S.jsxs)(`div`,{className:`hq-composer-bar`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`hq-btn`,disabled:e.length===0,title:e.length===0?`No projects reported yet — connect a client first`:`Write a message into a project mailbox (works with zero connected agents)`,onClick:()=>a(!0),children:[(0,S.jsx)(r,{size:13}),` Compose`]}),w.phase===`sent`&&(0,S.jsxs)(`span`,{className:`hq-composer-status ok`,children:[`delivered`,w.messageId===void 0?``:` · ${w.messageId.slice(0,8)}`]})]})}function T(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.mailboxId==`string`&&(t.scope===`project`||t.scope===`global`)&&Array.isArray(t.messages)&&Array.isArray(t.agents)&&typeof t.totals==`object`&&t.totals!==null}function E(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.mailboxId==`string`&&typeof t.action==`string`&&(t.message===void 0||typeof t.message==`object`)}function D(e,t){let n=e.get(t);return n===void 0&&(n={projectId:t,messages:[],countersFromSnapshot:!1,onlineAgentCount:0,highPriorityCount:0,unreadCount:0,incompleteCount:0},e.set(t,n)),n}function O(e){let t=0,n=0,r=0;for(let i of e){let e=i.message;e.priority===`high`&&(t+=1),e.completed||(r+=1,(e.readCount??0)===0&&(n+=1))}return{highPriorityCount:t,unreadCount:n,incompleteCount:r}}function k(e){let t=new Map;for(let n of e)(t.get(n.message.mailId)===void 0||n.source===`event`)&&t.set(n.message.mailId,n);return Array.from(t.values()).sort((e,t)=>t.message.timestamp.localeCompare(e.message.timestamp))}function A(e,t){let n=new Map;if(e!==null)for(let t of e.mailboxes){let e=D(n,t.projectId);e.mailboxId=t.mailboxId,e.scope=t.scope,e.onlineAgentCount=t.onlineAgentCount,e.highPriorityCount=t.highPriorityCount,e.unreadCount=t.unreadCount,e.incompleteCount=t.incompleteCount,e.countersFromSnapshot=!0}for(let e of t){if(e.type!==`mailbox.snapshot`||!T(e.payload))continue;let t=e.payload,r=D(n,e.projectId);r.mailboxId=t.mailboxId,r.scope=t.scope;for(let n of t.messages)r.messages.push({message:n,source:`snapshot`,key:`s:${e.id}:${n.messageId}`,projectId:e.projectId})}let r=new Map;for(let e of t){if(e.type!==`mailbox.event`||!E(e.payload))continue;let t=e.payload,i=D(n,e.projectId);i.mailboxId=t.mailboxId,i.scope=i.scope??`project`,t.message!==void 0&&!r.has(t.message.mailId)&&(r.set(t.message.mailId,i),i.messages.push({message:t.message,source:`event`,key:`e:${t.message.mailId}:${e.seq}`,projectId:e.projectId})),t.agent?.online&&(i.onlineAgentCount+=1)}for(let e of n.values())if(e.messages=k(e.messages),!e.countersFromSnapshot){let t=O(e.messages);e.highPriorityCount=t.highPriorityCount,e.unreadCount=t.unreadCount,e.incompleteCount=t.incompleteCount}let i=Array.from(n.values()).sort((e,t)=>{let n=e.messages[0]?.message.timestamp??``;return(t.messages[0]?.message.timestamp??``).localeCompare(n)});return{projects:i,hasAnyActivity:i.some(e=>e.messages.length>0)}}var j=Object.freeze({types:new Set,priorities:new Set,projectIds:new Set,includeCompleted:!0,query:``});function M(e,t){switch(t.type){case`toggle-type`:{let n=new Set(e.types);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,types:n}}case`toggle-priority`:{let n=new Set(e.priorities);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,priorities:n}}case`toggle-project`:{let n=new Set(e.projectIds);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,projectIds:n}}case`set-query`:return{...e,query:t.value};case`set-include-completed`:return{...e,includeCompleted:t.value};case`clear-all`:return j;default:return e}}function N(e,t={}){let n=t.includeCompleted??!0,r=t.types&&t.types.length>0?new Set(t.types):null,i=t.priorities&&t.priorities.length>0?new Set(t.priorities):null,a=t.projectIds&&t.projectIds.length>0?new Set(t.projectIds):null,o=t.query?.trim().toLowerCase()??``,s=t.limit??500,c=[];for(let t of e){let e=t.message;!n&&e.completed||r&&!r.has(e.type)||i&&!i.has(e.priority)||a||o.length>0&&!`${e.subject}\n${e.from}\n${e.to}\n${e.bodyPreview??``}`.toLowerCase().includes(o)||c.push({key:t.key,flat:t})}c.sort((e,t)=>{let n=t.flat.message.timestamp.localeCompare(e.flat.message.timestamp);return n===0?e.flat.message.mailId.localeCompare(t.flat.message.mailId):n});let l=c.length,u=l>s,d=u?c.slice(0,s):c;return{totalMatched:l,returned:d.length,truncated:u,entries:d}}function P(e,t,n={}){let{projectIds:r,...i}=n,a=A(e,t),o=[],s=r!==void 0&&r.length>0?new Set(r):null;for(let e of a.projects)s&&!s.has(e.projectId)||(o=o.concat(e.messages));return N(o,i)}function F(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.error==`string`)return!0;if(typeof t.error!=`object`||t.error===null)return!1;let n=t.error;return typeof n.code==`string`&&typeof n.message==`string`}async function I(e){let t=await y(`/api/mailbox/messages/${encodeURIComponent(e.mailId)}/action`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(t.status===401&&v.getState().markAuthRequired(),!t.ok){let e=`${t.status} ${t.statusText}`;try{let n=await t.json();F(n)&&(e=typeof n.error==`string`?n.error:`${n.error.code}: ${n.error.message}`)}catch{}throw Error(`mailbox action failed — ${e}`)}return await t.json()}var L={markRead:e=>I({...e,action:`mark-read`}),acknowledge:e=>I({...e,action:`acknowledge`}),reopen:e=>I({...e,action:`reopen`}),softDelete:e=>I({...e,action:`soft-delete`}),restore:e=>I({...e,action:`restore`})};function R({mailId:e,actorId:t,projectId:n,isDeleted:r=!1,onAction:i,disabled:a=!1}){let[o,s]=(0,x.useState)(null),[c,l]=(0,x.useState)(null),u=async(t,n)=>{if(!(a||o!==null)){s(t),l(null);try{await n(),i?.(e,t)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}},d={mailId:e,readerId:t,projectId:n};return(0,S.jsxs)(`div`,{className:`hq-msg-actions`,children:[!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`mark-read`,()=>L.markRead(d)),children:o===`mark-read`?`…`:`Mark read`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn`,disabled:a||o!==null,onClick:()=>u(`acknowledge`,()=>L.acknowledge(d)),children:o===`acknowledge`?`…`:`Acknowledge`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`reopen`,()=>L.reopen(d)),children:o===`reopen`?`…`:`Reopen`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn danger`,disabled:a||o!==null,onClick:()=>u(`soft-delete`,()=>L.softDelete(d)),children:o===`soft-delete`?`…`:`Delete`}),r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`restore`,()=>L.restore(d)),children:o===`restore`?`…`:`Restore`}),c!==null&&(0,S.jsx)(`span`,{className:`hq-msg-action-error`,title:c,children:c})]})}function z(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function B(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}var V={note:{icon:l,tone:`info`},ask:{icon:o,tone:`warn`},assign:{icon:u,tone:`warn`},steer:{icon:o,tone:`warn`},btw:{icon:a,tone:`info`},broadcast:{icon:t,tone:`info`},status:{icon:c,tone:`idle`},result:{icon:d,tone:`running`},review:{icon:f,tone:`info`},control:{icon:s,tone:`error`}};Object.keys(V);var H=`hq-operator`;function U({flat:e,defaultExpanded:t}){let[r,i]=(0,x.useState)(!!t),a=e.message,o=a.hasBody||a.bodyPreview!==void 0&&a.bodyPreview.length>0,s=V[a.type]??{icon:n,tone:`info`},c=s.icon,l=`${a.from} → ${a.to}`;return(0,S.jsxs)(`div`,{className:`hq-msg`+(a.completed?` done`:``),children:[(0,S.jsxs)(`div`,{className:`hq-msg-head`,children:[(0,S.jsx)(`span`,{className:`hq-msg-icon`,title:a.type,children:(0,S.jsx)(c,{size:13})}),(0,S.jsx)(`span`,{className:`hq-pill `+s.tone,children:a.type}),a.audience===`leaders`&&(0,S.jsx)(`span`,{className:`hq-pill info`,children:`leaders only`}),a.priority===`high`&&(0,S.jsx)(`span`,{className:`hq-pill error`,children:`high`}),a.priority===`low`&&(0,S.jsx)(`span`,{className:`hq-pill idle`,children:`low`}),(0,S.jsx)(`span`,{className:`hq-msg-subject`,title:a.subject,children:a.subject||`(no subject)`}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-route`,children:l}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-time`,title:a.timestamp,children:z(a.timestamp)}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-id`,children:B(a.messageId)}),(0,S.jsx)(`span`,{className:`hq-msg-flag `+(a.completed?`done`:`open`),children:a.completed?`completed${a.completedBy===void 0?``:` by ${a.completedBy}`}`:`open`}),o&&(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle hq-msg-toggle`,onClick:()=>i(e=>!e),"aria-expanded":r,"aria-label":r?`Collapse body`:`Expand body`,children:r?`▾`:`▸`})]}),r&&(0,S.jsxs)(`div`,{className:`hq-msg-body`,children:[a.bodyPreview!==void 0&&a.bodyPreview.length>0?(0,S.jsx)(`pre`,{className:`hq-msg-pre`,children:a.bodyPreview}):(0,S.jsx)(`div`,{className:`hq-empty hq-pad-sm`,children:`(empty body)`}),a.outcomePreview!==void 0&&a.outcomePreview.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`hq-msg-sublabel`,children:`outcome`}),(0,S.jsx)(`pre`,{className:`hq-msg-pre`,children:a.outcomePreview})]}),(0,S.jsxs)(`div`,{className:`hq-msg-meta`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`source:`}),` `,e.source]}),a.replyTo!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`reply to:`}),` `,B(a.replyTo)]}),a.senderSessionId!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`sender session:`}),` `,B(a.senderSessionId)]}),(a.readCount??0)>0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`reads:`}),` `,a.readCount]}),a.unreadCount!==void 0&&a.unreadCount>0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`unread:`}),` `,a.unreadCount]}),a.task!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`task:`}),` `,a.task.taskId??`—`,a.task.agentName===void 0?``:` · ${a.task.agentName}`,a.task.status===void 0?``:` (${a.task.status})`]})]}),e.projectId!==void 0&&(0,S.jsx)(R,{mailId:a.mailId,actorId:H,projectId:e.projectId})]})]})}var W=[`ask`,`assign`,`steer`,`review`,`result`,`status`,`broadcast`,`note`,`btw`,`control`],G=[`high`,`normal`,`low`];function K({snapshot:e,events:t}={}){let n=v(e=>e.snapshot),r=e===void 0?n:e,i=t===void 0?v.getState().events:t,a=m(),[o,s]=(0,x.useReducer)(M,(0,x.useMemo)(()=>{let e=a.mailbox;return{types:new Set(e.types),priorities:new Set(e.priorities),projectIds:new Set,includeCompleted:e.includeCompleted,query:e.query}},[a.mailbox]));(0,x.useEffect)(()=>{_({query:o.query,types:Array.from(o.types),priorities:Array.from(o.priorities),includeCompleted:o.includeCompleted})},[o.query,o.types,o.priorities,o.includeCompleted]);let c=(0,x.useMemo)(()=>A(r??null,i).projects.map(e=>({projectId:e.projectId,count:e.messages.length})),[r,i]),l=(0,x.useMemo)(()=>P(r??null,i,{types:Array.from(o.types),priorities:Array.from(o.priorities),projectIds:Array.from(o.projectIds),includeCompleted:o.includeCompleted,query:o.query||void 0,limit:500}),[r,i,o]),u=o.types.size+o.priorities.size+o.projectIds.size+ +!o.includeCompleted+ +(o.query.trim().length>0);return(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`hq-card-title`,children:[`Live mailbox feed · `,l.returned,` of `,l.totalMatched,` message`,l.totalMatched===1?``:`s`,l.truncated?` · refined to fit`:``]}),(0,S.jsxs)(`div`,{className:`hq-card hq-mailbox-filterbar`,children:[(0,S.jsx)(`label`,{className:`hq-label`,htmlFor:`mailbox-live-query`,children:`Search`}),(0,S.jsx)(`input`,{id:`mailbox-live-query`,className:`hq-input`,value:o.query,onChange:e=>s({type:`set-query`,value:e.target.value}),placeholder:`subject / sender / recipient / body…`}),(0,S.jsx)(q,{title:`Types`,children:W.map(e=>(0,S.jsx)(J,{selected:o.types.has(e),label:e,onClick:()=>s({type:`toggle-type`,value:e})},e))}),(0,S.jsx)(q,{title:`Priority`,children:G.map(e=>(0,S.jsx)(J,{selected:o.priorities.has(e),label:e,tone:e===`high`?`error`:e===`low`?`idle`:`info`,onClick:()=>s({type:`toggle-priority`,value:e})},e))}),c.length>0&&(0,S.jsx)(q,{title:`Projects`,children:c.map(e=>(0,S.jsx)(J,{selected:o.projectIds.has(e.projectId),label:`${e.projectId} (${e.count})`,onClick:()=>s({type:`toggle-project`,value:e.projectId})},e.projectId))}),(0,S.jsxs)(`div`,{className:`hq-row hq-mailbox-filter-actions`,children:[(0,S.jsxs)(`label`,{className:`hq-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:o.includeCompleted,onChange:e=>s({type:`set-include-completed`,value:e.target.checked})}),`include completed`]}),(0,S.jsxs)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:u===0,onClick:()=>s({type:`clear-all`}),children:[`Clear filters`,u>0?` (${u})`:``]})]})]}),l.entries.length===0?(0,S.jsx)(`div`,{className:`hq-empty`,children:`No mailbox activity matches the current filters.`}):(0,S.jsx)(`div`,{className:`hq-msg-list hq-live-feed`,children:l.entries.map((e,t)=>(0,S.jsx)(U,{flat:e.flat,defaultExpanded:t===0&&o.query.trim().length>0},e.key))})]})}function q({title:e,children:t}){return(0,S.jsxs)(`div`,{className:`hq-filter-section`,children:[(0,S.jsx)(`div`,{className:`hq-msg-sublabel`,children:e}),(0,S.jsx)(`div`,{className:`hq-filter-chip-row`,children:t})]})}function J({selected:e,label:t,onClick:n,tone:r=`info`}){return(0,S.jsx)(`button`,{type:`button`,className:`hq-filter-chip hq-pill ${r}${e?` selected`:``}`,"aria-pressed":e,onClick:n,children:t})}function Y(){let{snapshot:e,events:t}=v(g(e=>({snapshot:e.snapshot,events:e.events}))),[n,r]=(0,x.useState)(`live`),{events:i}=b(`mailbox.event`,300),a=(0,x.useMemo)(()=>[...i,...t.filter(e=>e.type!==`mailbox.event`)],[i,t]),{projects:o,hasAnyActivity:s}=(0,x.useMemo)(()=>A(e,a),[e,a]),c=e?.totals.unreadMailboxMessages??0,l=e?.totals.incompleteMailboxMessages??0,u=(0,x.useMemo)(()=>{let t=new Map;for(let n of e?.projects??[])t.set(n.projectId,{projectId:n.projectId,label:n.projectName});for(let e of o)t.has(e.projectId)||t.set(e.projectId,{projectId:e.projectId});return Array.from(t.values())},[e,o]);return o.length===0&&u.length===0?(0,S.jsx)(`div`,{className:`hq-empty`,children:`No mailbox activity reported by connected clients.`}):(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`hq-card-title`,children:[`Mailbox Activity — `,o.length,` project`,o.length===1?``:`s`,` ·`,` `,c,` unread · `,l,` incomplete`,s?` · showing detailed messages`:``]}),(0,S.jsx)(w,{projects:u}),(0,S.jsxs)(`div`,{className:`hq-mailbox-modebar`,role:`tablist`,"aria-label":`Mailbox view mode`,children:[(0,S.jsx)(`button`,{type:`button`,role:`tab`,className:`hq-btn secondary`+(n===`live`?` hq-btn-selected`:``),"aria-selected":n===`live`,onClick:()=>r(`live`),children:`Live feed`}),(0,S.jsx)(`button`,{type:`button`,role:`tab`,className:`hq-btn secondary`+(n===`grouped`?` hq-btn-selected`:``),"aria-selected":n===`grouped`,onClick:()=>r(`grouped`),children:`Grouped by project`})]}),n===`live`?(0,S.jsx)(K,{snapshot:e,events:a}):o.map(e=>(0,S.jsx)(X,{group:e},e.projectId))]})}function X({group:e}){let[t,n]=(0,x.useState)(!0);return(0,S.jsxs)(`div`,{className:`hq-card`,children:[(0,S.jsxs)(`div`,{className:`hq-row hq-row-baseline`,children:[(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle`,onClick:()=>n(e=>!e),"aria-label":t?`Collapse project messages`:`Expand project messages`,children:t?`▾`:`▸`}),(0,S.jsx)(`span`,{className:`hq-text-bright`,children:e.projectId}),e.scope!==void 0&&(0,S.jsx)(`span`,{className:`hq-pill info`,children:e.scope}),e.mailboxId!==void 0&&(0,S.jsx)(`span`,{className:`hq-mono hq-text-dim`,children:e.mailboxId}),(0,S.jsxs)(`span`,{className:`hq-mono hq-text-dim hq-ml-auto`,children:[e.messages.length,` message`,e.messages.length===1?``:`s`]})]}),(0,S.jsxs)(`div`,{className:`hq-grid hq-mt-8`,style:{gridTemplateColumns:`repeat(5,1fr)`},children:[(0,S.jsx)(Z,{label:`messages`,value:e.messages.length}),(0,S.jsx)(Z,{label:`unread`,value:e.unreadCount,accent:e.unreadCount>0?`amber`:void 0}),(0,S.jsx)(Z,{label:`incomplete`,value:e.incompleteCount,accent:e.incompleteCount>0?`red`:void 0}),(0,S.jsx)(Z,{label:`high-priority`,value:e.highPriorityCount,accent:e.highPriorityCount>0?`red`:void 0}),(0,S.jsx)(Z,{label:`online agents`,value:e.onlineAgentCount,accent:e.onlineAgentCount>0?`green`:void 0})]}),t&&e.messages.length>0&&(0,S.jsx)(`div`,{className:`hq-msg-list hq-mt-12`,children:e.messages.map(e=>(0,S.jsx)(U,{flat:e},e.key))}),t&&e.messages.length===0&&(0,S.jsx)(`div`,{className:`hq-empty hq-cockpit-empty`,children:`Snapshot counters reported for this project, but no detailed mailbox events have streamed yet.`})]})}function Z({label:e,value:t,accent:n}){return(0,S.jsxs)(`div`,{className:`hq-text-center`,children:[(0,S.jsx)(`div`,{className:`hq-stat-num`,style:{color:n===`amber`?`var(--amber)`:n===`red`?`var(--red)`:n===`green`?`var(--green)`:`var(--text)`},children:t}),(0,S.jsx)(`div`,{className:`hq-stat-label`,children:e})]})}export{Y as MailboxView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{F as t,I as n,L as r,Lt as i,P as a,W as o,h as s,it as c,k as l,w as u,wt as d,y as f}from"./icons-BV2PcvP1.js";import{i as p}from"./markdown-HUVrfVaI.js";import{a as m,c as h,f as g,i as _,l as v,u as y}from"./index-DwX1O_JZ.js";import{t as b}from"./use-backfilled-events-ceR5R8_K.js";var x=e(i(),1),S=p(),C=[{value:`note`,label:`note — general information`},{value:`ask`,label:`ask — reply required`},{value:`assign`,label:`assign — work ownership`},{value:`steer`,label:`steer — redirect the current work`},{value:`btw`,label:`btw — FYI, no action required`},{value:`queue`,label:`queue — note for the next agent`},{value:`broadcast`,label:`broadcast — all agents in the project`},{value:`status`,label:`status — meaningful checkpoint`},{value:`result`,label:`result — completed output/evidence`},{value:`review`,label:`review — passive inspection request`}];function w({projects:e,sender:t}){let n=t??h,[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(``),[c,l]=(0,x.useState)(`steer`),[u,d]=(0,x.useState)(`leader`),[f,p]=(0,x.useState)(`normal`),[m,g]=(0,x.useState)(!1),[_,v]=(0,x.useState)(``),[y,b]=(0,x.useState)(``),[w,T]=(0,x.useState)({phase:`idle`}),E=o||e[0]?.projectId||``,D=w.phase!==`sending`&&y.trim().length>0&&E.length>0,O=async()=>{if(D){T({phase:`sending`});try{let e=await n({projectId:E,type:c,...c===`broadcast`?{}:{to:u.trim()||`leader`},subject:_.trim()||`HQ prompt`,body:y.trim(),priority:f,audience:m?`leaders`:`all`});T({phase:`sent`,messageId:e.messageId}),b(``)}catch(e){T({phase:`error`,message:e instanceof Error?e.message:String(e)})}}};return i?(0,S.jsxs)(`div`,{className:`hq-card hq-composer`,children:[(0,S.jsxs)(`div`,{className:`hq-row hq-row-baseline`,children:[(0,S.jsx)(`span`,{className:`hq-card-title hq-title-inline`,children:`Send to project mailbox`}),(0,S.jsx)(`span`,{className:`hq-composer-hint`,children:`lands in the mailbox file — picked up by the next agent, no live client needed`}),(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle hq-ml-auto`,"aria-label":`Collapse composer`,onClick:()=>a(!1),children:`▾`})]}),(0,S.jsxs)(`div`,{className:`hq-composer-grid`,children:[(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`project`}),(0,S.jsx)(`select`,{className:`hq-select`,value:E,onChange:e=>s(e.target.value),children:e.map(e=>(0,S.jsx)(`option`,{value:e.projectId,children:e.label??e.projectId},e.projectId))})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`type`}),(0,S.jsx)(`select`,{className:`hq-select`,value:c,onChange:e=>l(e.target.value),children:C.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),c!==`broadcast`&&(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`to`}),(0,S.jsx)(`input`,{className:`hq-input`,value:u,placeholder:`leader`,onChange:e=>d(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`audience`}),(0,S.jsxs)(`select`,{className:`hq-select`,value:m?`leaders`:`all`,onChange:e=>g(e.target.value===`leaders`),children:[(0,S.jsx)(`option`,{value:`all`,children:`all agents`}),(0,S.jsx)(`option`,{value:`leaders`,children:`leaders only — subagents cannot consume`})]})]}),(0,S.jsxs)(`label`,{className:`hq-composer-field`,children:[(0,S.jsx)(`span`,{children:`priority`}),(0,S.jsxs)(`select`,{className:`hq-select`,value:f,onChange:e=>p(e.target.value),children:[(0,S.jsx)(`option`,{value:`high`,children:`high`}),(0,S.jsx)(`option`,{value:`normal`,children:`normal`}),(0,S.jsx)(`option`,{value:`low`,children:`low`})]})]})]}),(0,S.jsx)(`input`,{className:`hq-input`,value:_,placeholder:`subject (optional)`,onChange:e=>v(e.target.value)}),(0,S.jsx)(`textarea`,{className:`hq-input hq-composer-body`,value:y,rows:3,placeholder:`Message body — e.g. “after the current task, run the full test suite”`,onChange:e=>b(e.target.value)}),(0,S.jsxs)(`div`,{className:`hq-row`,children:[(0,S.jsx)(`button`,{type:`button`,className:`hq-btn`,disabled:!D,onClick:()=>void O(),children:w.phase===`sending`?`Sending…`:`Send`}),w.phase===`sent`&&(0,S.jsxs)(`span`,{className:`hq-composer-status ok`,children:[`delivered`,w.messageId===void 0?``:` · ${w.messageId.slice(0,8)}`]}),w.phase===`error`&&(0,S.jsx)(`span`,{className:`hq-composer-status err`,title:w.message,children:w.message})]})]}):(0,S.jsxs)(`div`,{className:`hq-composer-bar`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`hq-btn`,disabled:e.length===0,title:e.length===0?`No projects reported yet — connect a client first`:`Write a message into a project mailbox (works with zero connected agents)`,onClick:()=>a(!0),children:[(0,S.jsx)(r,{size:13}),` Compose`]}),w.phase===`sent`&&(0,S.jsxs)(`span`,{className:`hq-composer-status ok`,children:[`delivered`,w.messageId===void 0?``:` · ${w.messageId.slice(0,8)}`]})]})}function T(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.mailboxId==`string`&&(t.scope===`project`||t.scope===`global`)&&Array.isArray(t.messages)&&Array.isArray(t.agents)&&typeof t.totals==`object`&&t.totals!==null}function E(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.mailboxId==`string`&&typeof t.action==`string`&&(t.message===void 0||typeof t.message==`object`)}function D(e,t){let n=e.get(t);return n===void 0&&(n={projectId:t,messages:[],countersFromSnapshot:!1,onlineAgentCount:0,highPriorityCount:0,unreadCount:0,incompleteCount:0},e.set(t,n)),n}function O(e){let t=0,n=0,r=0;for(let i of e){let e=i.message;e.priority===`high`&&(t+=1),e.completed||(r+=1,(e.readCount??0)===0&&(n+=1))}return{highPriorityCount:t,unreadCount:n,incompleteCount:r}}function k(e){let t=new Map;for(let n of e)(t.get(n.message.mailId)===void 0||n.source===`event`)&&t.set(n.message.mailId,n);return Array.from(t.values()).sort((e,t)=>t.message.timestamp.localeCompare(e.message.timestamp))}function A(e,t){let n=new Map;if(e!==null)for(let t of e.mailboxes){let e=D(n,t.projectId);e.mailboxId=t.mailboxId,e.scope=t.scope,e.onlineAgentCount=t.onlineAgentCount,e.highPriorityCount=t.highPriorityCount,e.unreadCount=t.unreadCount,e.incompleteCount=t.incompleteCount,e.countersFromSnapshot=!0}for(let e of t){if(e.type!==`mailbox.snapshot`||!T(e.payload))continue;let t=e.payload,r=D(n,e.projectId);r.mailboxId=t.mailboxId,r.scope=t.scope;for(let n of t.messages)r.messages.push({message:n,source:`snapshot`,key:`s:${e.id}:${n.messageId}`,projectId:e.projectId})}let r=new Map;for(let e of t){if(e.type!==`mailbox.event`||!E(e.payload))continue;let t=e.payload,i=D(n,e.projectId);i.mailboxId=t.mailboxId,i.scope=i.scope??`project`,t.message!==void 0&&!r.has(t.message.mailId)&&(r.set(t.message.mailId,i),i.messages.push({message:t.message,source:`event`,key:`e:${t.message.mailId}:${e.seq}`,projectId:e.projectId})),t.agent?.online&&(i.onlineAgentCount+=1)}for(let e of n.values())if(e.messages=k(e.messages),!e.countersFromSnapshot){let t=O(e.messages);e.highPriorityCount=t.highPriorityCount,e.unreadCount=t.unreadCount,e.incompleteCount=t.incompleteCount}let i=Array.from(n.values()).sort((e,t)=>{let n=e.messages[0]?.message.timestamp??``;return(t.messages[0]?.message.timestamp??``).localeCompare(n)});return{projects:i,hasAnyActivity:i.some(e=>e.messages.length>0)}}var j=Object.freeze({types:new Set,priorities:new Set,projectIds:new Set,includeCompleted:!0,query:``});function M(e,t){switch(t.type){case`toggle-type`:{let n=new Set(e.types);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,types:n}}case`toggle-priority`:{let n=new Set(e.priorities);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,priorities:n}}case`toggle-project`:{let n=new Set(e.projectIds);return n.has(t.value)?n.delete(t.value):n.add(t.value),{...e,projectIds:n}}case`set-query`:return{...e,query:t.value};case`set-include-completed`:return{...e,includeCompleted:t.value};case`clear-all`:return j;default:return e}}function N(e,t={}){let n=t.includeCompleted??!0,r=t.types&&t.types.length>0?new Set(t.types):null,i=t.priorities&&t.priorities.length>0?new Set(t.priorities):null,a=t.projectIds&&t.projectIds.length>0?new Set(t.projectIds):null,o=t.query?.trim().toLowerCase()??``,s=t.limit??500,c=[];for(let t of e){let e=t.message;!n&&e.completed||r&&!r.has(e.type)||i&&!i.has(e.priority)||a||o.length>0&&!`${e.subject}\n${e.from}\n${e.to}\n${e.bodyPreview??``}`.toLowerCase().includes(o)||c.push({key:t.key,flat:t})}c.sort((e,t)=>{let n=t.flat.message.timestamp.localeCompare(e.flat.message.timestamp);return n===0?e.flat.message.mailId.localeCompare(t.flat.message.mailId):n});let l=c.length,u=l>s,d=u?c.slice(0,s):c;return{totalMatched:l,returned:d.length,truncated:u,entries:d}}function P(e,t,n={}){let{projectIds:r,...i}=n,a=A(e,t),o=[],s=r!==void 0&&r.length>0?new Set(r):null;for(let e of a.projects)s&&!s.has(e.projectId)||(o=o.concat(e.messages));return N(o,i)}function F(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.error==`string`)return!0;if(typeof t.error!=`object`||t.error===null)return!1;let n=t.error;return typeof n.code==`string`&&typeof n.message==`string`}async function I(e){let t=await y(`/api/mailbox/messages/${encodeURIComponent(e.mailId)}/action`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(t.status===401&&v.getState().markAuthRequired(),!t.ok){let e=`${t.status} ${t.statusText}`;try{let n=await t.json();F(n)&&(e=typeof n.error==`string`?n.error:`${n.error.code}: ${n.error.message}`)}catch{}throw Error(`mailbox action failed — ${e}`)}return await t.json()}var L={markRead:e=>I({...e,action:`mark-read`}),acknowledge:e=>I({...e,action:`acknowledge`}),reopen:e=>I({...e,action:`reopen`}),softDelete:e=>I({...e,action:`soft-delete`}),restore:e=>I({...e,action:`restore`})};function R({mailId:e,actorId:t,projectId:n,isDeleted:r=!1,onAction:i,disabled:a=!1}){let[o,s]=(0,x.useState)(null),[c,l]=(0,x.useState)(null),u=async(t,n)=>{if(!(a||o!==null)){s(t),l(null);try{await n(),i?.(e,t)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}},d={mailId:e,readerId:t,projectId:n};return(0,S.jsxs)(`div`,{className:`hq-msg-actions`,children:[!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`mark-read`,()=>L.markRead(d)),children:o===`mark-read`?`…`:`Mark read`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn`,disabled:a||o!==null,onClick:()=>u(`acknowledge`,()=>L.acknowledge(d)),children:o===`acknowledge`?`…`:`Acknowledge`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`reopen`,()=>L.reopen(d)),children:o===`reopen`?`…`:`Reopen`}),!r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn danger`,disabled:a||o!==null,onClick:()=>u(`soft-delete`,()=>L.softDelete(d)),children:o===`soft-delete`?`…`:`Delete`}),r&&(0,S.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:a||o!==null,onClick:()=>u(`restore`,()=>L.restore(d)),children:o===`restore`?`…`:`Restore`}),c!==null&&(0,S.jsx)(`span`,{className:`hq-msg-action-error`,title:c,children:c})]})}function z(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function B(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}var V={note:{icon:l,tone:`info`},ask:{icon:o,tone:`warn`},assign:{icon:u,tone:`warn`},steer:{icon:o,tone:`warn`},btw:{icon:a,tone:`info`},broadcast:{icon:t,tone:`info`},status:{icon:c,tone:`idle`},result:{icon:d,tone:`running`},review:{icon:f,tone:`info`},control:{icon:s,tone:`error`}};Object.keys(V);var H=`hq-operator`;function U({flat:e,defaultExpanded:t}){let[r,i]=(0,x.useState)(!!t),a=e.message,o=a.hasBody||a.bodyPreview!==void 0&&a.bodyPreview.length>0,s=V[a.type]??{icon:n,tone:`info`},c=s.icon,l=`${a.from} → ${a.to}`;return(0,S.jsxs)(`div`,{className:`hq-msg`+(a.completed?` done`:``),children:[(0,S.jsxs)(`div`,{className:`hq-msg-head`,children:[(0,S.jsx)(`span`,{className:`hq-msg-icon`,title:a.type,children:(0,S.jsx)(c,{size:13})}),(0,S.jsx)(`span`,{className:`hq-pill `+s.tone,children:a.type}),a.audience===`leaders`&&(0,S.jsx)(`span`,{className:`hq-pill info`,children:`leaders only`}),a.priority===`high`&&(0,S.jsx)(`span`,{className:`hq-pill error`,children:`high`}),a.priority===`low`&&(0,S.jsx)(`span`,{className:`hq-pill idle`,children:`low`}),(0,S.jsx)(`span`,{className:`hq-msg-subject`,title:a.subject,children:a.subject||`(no subject)`}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-route`,children:l}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-time`,title:a.timestamp,children:z(a.timestamp)}),(0,S.jsx)(`span`,{className:`hq-mono hq-msg-id`,children:B(a.messageId)}),(0,S.jsx)(`span`,{className:`hq-msg-flag `+(a.completed?`done`:`open`),children:a.completed?`completed${a.completedBy===void 0?``:` by ${a.completedBy}`}`:`open`}),o&&(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle hq-msg-toggle`,onClick:()=>i(e=>!e),"aria-expanded":r,"aria-label":r?`Collapse body`:`Expand body`,children:r?`▾`:`▸`})]}),r&&(0,S.jsxs)(`div`,{className:`hq-msg-body`,children:[a.bodyPreview!==void 0&&a.bodyPreview.length>0?(0,S.jsx)(`pre`,{className:`hq-msg-pre`,children:a.bodyPreview}):(0,S.jsx)(`div`,{className:`hq-empty hq-pad-sm`,children:`(empty body)`}),a.outcomePreview!==void 0&&a.outcomePreview.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`hq-msg-sublabel`,children:`outcome`}),(0,S.jsx)(`pre`,{className:`hq-msg-pre`,children:a.outcomePreview})]}),(0,S.jsxs)(`div`,{className:`hq-msg-meta`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`source:`}),` `,e.source]}),a.replyTo!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`reply to:`}),` `,B(a.replyTo)]}),a.senderSessionId!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`sender session:`}),` `,B(a.senderSessionId)]}),(a.readCount??0)>0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`reads:`}),` `,a.readCount]}),a.unreadCount!==void 0&&a.unreadCount>0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`unread:`}),` `,a.unreadCount]}),a.task!==void 0&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`strong`,{children:`task:`}),` `,a.task.taskId??`—`,a.task.agentName===void 0?``:` · ${a.task.agentName}`,a.task.status===void 0?``:` (${a.task.status})`]})]}),e.projectId!==void 0&&(0,S.jsx)(R,{mailId:a.mailId,actorId:H,projectId:e.projectId})]})]})}var W=[`ask`,`assign`,`steer`,`review`,`result`,`status`,`broadcast`,`note`,`btw`,`control`],G=[`high`,`normal`,`low`];function K({snapshot:e,events:t}={}){let n=v(e=>e.snapshot),r=e===void 0?n:e,i=t===void 0?v.getState().events:t,a=m(),[o,s]=(0,x.useReducer)(M,(0,x.useMemo)(()=>{let e=a.mailbox;return{types:new Set(e.types),priorities:new Set(e.priorities),projectIds:new Set,includeCompleted:e.includeCompleted,query:e.query}},[a.mailbox]));(0,x.useEffect)(()=>{_({query:o.query,types:Array.from(o.types),priorities:Array.from(o.priorities),includeCompleted:o.includeCompleted})},[o.query,o.types,o.priorities,o.includeCompleted]);let c=(0,x.useMemo)(()=>A(r??null,i).projects.map(e=>({projectId:e.projectId,count:e.messages.length})),[r,i]),l=(0,x.useMemo)(()=>P(r??null,i,{types:Array.from(o.types),priorities:Array.from(o.priorities),projectIds:Array.from(o.projectIds),includeCompleted:o.includeCompleted,query:o.query||void 0,limit:500}),[r,i,o]),u=o.types.size+o.priorities.size+o.projectIds.size+ +!o.includeCompleted+ +(o.query.trim().length>0);return(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`hq-card-title`,children:[`Live mailbox feed · `,l.returned,` of `,l.totalMatched,` message`,l.totalMatched===1?``:`s`,l.truncated?` · refined to fit`:``]}),(0,S.jsxs)(`div`,{className:`hq-card hq-mailbox-filterbar`,children:[(0,S.jsx)(`label`,{className:`hq-label`,htmlFor:`mailbox-live-query`,children:`Search`}),(0,S.jsx)(`input`,{id:`mailbox-live-query`,className:`hq-input`,value:o.query,onChange:e=>s({type:`set-query`,value:e.target.value}),placeholder:`subject / sender / recipient / body…`}),(0,S.jsx)(q,{title:`Types`,children:W.map(e=>(0,S.jsx)(J,{selected:o.types.has(e),label:e,onClick:()=>s({type:`toggle-type`,value:e})},e))}),(0,S.jsx)(q,{title:`Priority`,children:G.map(e=>(0,S.jsx)(J,{selected:o.priorities.has(e),label:e,tone:e===`high`?`error`:e===`low`?`idle`:`info`,onClick:()=>s({type:`toggle-priority`,value:e})},e))}),c.length>0&&(0,S.jsx)(q,{title:`Projects`,children:c.map(e=>(0,S.jsx)(J,{selected:o.projectIds.has(e.projectId),label:`${e.projectId} (${e.count})`,onClick:()=>s({type:`toggle-project`,value:e.projectId})},e.projectId))}),(0,S.jsxs)(`div`,{className:`hq-row hq-mailbox-filter-actions`,children:[(0,S.jsxs)(`label`,{className:`hq-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:o.includeCompleted,onChange:e=>s({type:`set-include-completed`,value:e.target.checked})}),`include completed`]}),(0,S.jsxs)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:u===0,onClick:()=>s({type:`clear-all`}),children:[`Clear filters`,u>0?` (${u})`:``]})]})]}),l.entries.length===0?(0,S.jsx)(`div`,{className:`hq-empty`,children:`No mailbox activity matches the current filters.`}):(0,S.jsx)(`div`,{className:`hq-msg-list hq-live-feed`,children:l.entries.map((e,t)=>(0,S.jsx)(U,{flat:e.flat,defaultExpanded:t===0&&o.query.trim().length>0},e.key))})]})}function q({title:e,children:t}){return(0,S.jsxs)(`div`,{className:`hq-filter-section`,children:[(0,S.jsx)(`div`,{className:`hq-msg-sublabel`,children:e}),(0,S.jsx)(`div`,{className:`hq-filter-chip-row`,children:t})]})}function J({selected:e,label:t,onClick:n,tone:r=`info`}){return(0,S.jsx)(`button`,{type:`button`,className:`hq-filter-chip hq-pill ${r}${e?` selected`:``}`,"aria-pressed":e,onClick:n,children:t})}function Y(){let{snapshot:e,events:t}=v(g(e=>({snapshot:e.snapshot,events:e.events}))),[n,r]=(0,x.useState)(`live`),{events:i}=b(`mailbox.event`,300),a=(0,x.useMemo)(()=>[...i,...t.filter(e=>e.type!==`mailbox.event`)],[i,t]),{projects:o,hasAnyActivity:s}=(0,x.useMemo)(()=>A(e,a),[e,a]),c=e?.totals.unreadMailboxMessages??0,l=e?.totals.incompleteMailboxMessages??0,u=(0,x.useMemo)(()=>{let t=new Map;for(let n of e?.projects??[])t.set(n.projectId,{projectId:n.projectId,label:n.projectName});for(let e of o)t.has(e.projectId)||t.set(e.projectId,{projectId:e.projectId});return Array.from(t.values())},[e,o]);return o.length===0&&u.length===0?(0,S.jsx)(`div`,{className:`hq-empty`,children:`No mailbox activity reported by connected clients.`}):(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`hq-card-title`,children:[`Mailbox Activity — `,o.length,` project`,o.length===1?``:`s`,` ·`,` `,c,` unread · `,l,` incomplete`,s?` · showing detailed messages`:``]}),(0,S.jsx)(w,{projects:u}),(0,S.jsxs)(`div`,{className:`hq-mailbox-modebar`,role:`tablist`,"aria-label":`Mailbox view mode`,children:[(0,S.jsx)(`button`,{type:`button`,role:`tab`,className:`hq-btn secondary`+(n===`live`?` hq-btn-selected`:``),"aria-selected":n===`live`,onClick:()=>r(`live`),children:`Live feed`}),(0,S.jsx)(`button`,{type:`button`,role:`tab`,className:`hq-btn secondary`+(n===`grouped`?` hq-btn-selected`:``),"aria-selected":n===`grouped`,onClick:()=>r(`grouped`),children:`Grouped by project`})]}),n===`live`?(0,S.jsx)(K,{snapshot:e,events:a}):o.map(e=>(0,S.jsx)(X,{group:e},e.projectId))]})}function X({group:e}){let[t,n]=(0,x.useState)(!0);return(0,S.jsxs)(`div`,{className:`hq-card`,children:[(0,S.jsxs)(`div`,{className:`hq-row hq-row-baseline`,children:[(0,S.jsx)(`button`,{type:`button`,className:`hq-toggle`,onClick:()=>n(e=>!e),"aria-label":t?`Collapse project messages`:`Expand project messages`,children:t?`▾`:`▸`}),(0,S.jsx)(`span`,{className:`hq-text-bright`,children:e.projectId}),e.scope!==void 0&&(0,S.jsx)(`span`,{className:`hq-pill info`,children:e.scope}),e.mailboxId!==void 0&&(0,S.jsx)(`span`,{className:`hq-mono hq-text-dim`,children:e.mailboxId}),(0,S.jsxs)(`span`,{className:`hq-mono hq-text-dim hq-ml-auto`,children:[e.messages.length,` message`,e.messages.length===1?``:`s`]})]}),(0,S.jsxs)(`div`,{className:`hq-grid hq-mt-8`,style:{gridTemplateColumns:`repeat(5,1fr)`},children:[(0,S.jsx)(Z,{label:`messages`,value:e.messages.length}),(0,S.jsx)(Z,{label:`unread`,value:e.unreadCount,accent:e.unreadCount>0?`amber`:void 0}),(0,S.jsx)(Z,{label:`incomplete`,value:e.incompleteCount,accent:e.incompleteCount>0?`red`:void 0}),(0,S.jsx)(Z,{label:`high-priority`,value:e.highPriorityCount,accent:e.highPriorityCount>0?`red`:void 0}),(0,S.jsx)(Z,{label:`online agents`,value:e.onlineAgentCount,accent:e.onlineAgentCount>0?`green`:void 0})]}),t&&e.messages.length>0&&(0,S.jsx)(`div`,{className:`hq-msg-list hq-mt-12`,children:e.messages.map(e=>(0,S.jsx)(U,{flat:e},e.key))}),t&&e.messages.length===0&&(0,S.jsx)(`div`,{className:`hq-empty hq-cockpit-empty`,children:`Snapshot counters reported for this project, but no detailed mailbox events have streamed yet.`})]})}function Z({label:e,value:t,accent:n}){return(0,S.jsxs)(`div`,{className:`hq-text-center`,children:[(0,S.jsx)(`div`,{className:`hq-stat-num`,style:{color:n===`amber`?`var(--amber)`:n===`red`?`var(--red)`:n===`green`?`var(--green)`:`var(--text)`},children:t}),(0,S.jsx)(`div`,{className:`hq-stat-label`,children:e})]})}export{Y as MailboxView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,Lt as n,R as r,f as i,mt as a,p as o,q as s,z as c}from"./icons-BV2PcvP1.js";import{i as l}from"./markdown-HUVrfVaI.js";import{d as u,u as d}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,Lt as n,R as r,f as i,mt as a,p as o,q as s,z as c}from"./icons-BV2PcvP1.js";import{i as l}from"./markdown-HUVrfVaI.js";import{d as u,u as d}from"./index-DwX1O_JZ.js";var f=e(n(),1),p=l();async function m(e){let t=e.statusText||`HTTP ${e.status}`;try{let n=await e.json();return typeof n.error==`string`?n.error:n.error?.message??t}catch{return t}}function h(){let[e,n]=(0,f.useState)(null),[l,h]=(0,f.useState)(``),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(null),[w,T]=(0,f.useState)(!1),E=async()=>{let e=await d(`/api/auth/status`);if(!e.ok)throw Error(await m(e));n(await e.json())};(0,f.useEffect)(()=>{E().catch(e=>{C({tone:`error`,text:e instanceof Error?e.message:String(e)})})},[]);let D=e?.passwordMode===!0&&e.authKind===`password`,O=g.length>=8&&g.length<=1024,k=g===v,A=O&&k&&(!D||l.length>0)&&!b,j=async()=>{if(A){x(!0),C(null);try{let t=await d(`/api/auth/password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...D?{currentPassword:l}:{},newPassword:g})});if(!t.ok)throw Error(await m(t));n(await t.json()),h(``),_(``),y(``),C({tone:`ok`,text:e?.passwordMode?`Password changed.`:`Password enabled.`})}catch(e){C({tone:`error`,text:e instanceof Error?e.message:String(e)})}finally{x(!1)}}},M=async()=>{x(!0),C(null);try{let e=await d(`/api/auth/password`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...D?{currentPassword:l}:{}})});if(!e.ok)throw Error(await m(e));n(await e.json()),h(``),T(!1),C({tone:`ok`,text:`Password protection removed.`})}catch(e){C({tone:`error`,text:e instanceof Error?e.message:String(e)})}finally{x(!1)}},N=async()=>{x(!0);try{await d(`/api/logout`,{method:`POST`})}finally{u(),window.location.reload()}},P=async()=>{if(!(!e?.publicOrigin||!e.passwordMode))try{await navigator.clipboard.writeText(e.publicOrigin),C({tone:`ok`,text:`Public tunnel URL copied.`})}catch{C({tone:`error`,text:`Could not copy the public tunnel URL.`})}};return(0,p.jsxs)(`div`,{className:`hq-security-page`,children:[(0,p.jsxs)(`section`,{className:`hq-security-summary`,"aria-label":`Authentication status`,children:[(0,p.jsxs)(`div`,{className:`hq-security-card`,children:[(0,p.jsx)(o,{size:18}),(0,p.jsx)(`span`,{children:`Browser access`}),(0,p.jsx)(`strong`,{children:e?.loggedIn?`Authenticated`:`Checking…`})]}),(0,p.jsxs)(`div`,{className:`hq-security-card`,children:[(0,p.jsx)(s,{size:18}),(0,p.jsx)(`span`,{children:`Browser tokens`}),(0,p.jsx)(`strong`,{children:e?.tokenMode?`Enabled`:`Disabled`})]}),(0,p.jsxs)(`div`,{className:`hq-security-card`,children:[(0,p.jsx)(c,{size:18}),(0,p.jsx)(`span`,{children:`Password login`}),(0,p.jsx)(`strong`,{children:e?.passwordMode?`Enabled`:`Disabled`})]}),(0,p.jsxs)(`div`,{className:`hq-security-card`,children:[(0,p.jsx)(t,{size:18}),(0,p.jsx)(`span`,{children:`Public tunnel`}),(0,p.jsx)(`strong`,{children:e?.publicRelay?`Active`:`Disabled`}),e?.publicOrigin&&e.passwordMode?(0,p.jsxs)(`button`,{type:`button`,className:`hq-security-copy`,"aria-label":`Copy public tunnel URL`,title:e.publicOrigin,onClick:()=>void P(),children:[(0,p.jsx)(a,{size:12}),`Copy URL`]}):null]})]}),(0,p.jsxs)(`section`,{className:`hq-security-panel`,children:[(0,p.jsxs)(`div`,{className:`hq-security-panel-head`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`span`,{children:`Browser credential`}),(0,p.jsx)(`h2`,{children:e?.passwordMode?`Change HQ password`:`Enable HQ password`}),(0,p.jsx)(`p`,{children:`Passwords are stored as salted scrypt hashes. Changing the password invalidates older password sessions.`})]}),(0,p.jsx)(c,{size:22})]}),S?(0,p.jsx)(`div`,{className:`hq-security-message`,"data-tone":S.tone,role:`status`,children:S.text}):null,(0,p.jsxs)(`div`,{className:`hq-security-form`,children:[D?(0,p.jsxs)(`label`,{children:[(0,p.jsx)(`span`,{children:`Current password`}),(0,p.jsx)(`input`,{type:`password`,autoComplete:`current-password`,value:l,onChange:e=>h(e.target.value)})]}):null,(0,p.jsxs)(`label`,{children:[(0,p.jsx)(`span`,{children:`New password`}),(0,p.jsx)(`input`,{type:`password`,autoComplete:`new-password`,minLength:8,maxLength:1024,value:g,onChange:e=>_(e.target.value)}),(0,p.jsx)(`small`,{children:`Minimum 8 characters.`})]}),(0,p.jsxs)(`label`,{children:[(0,p.jsx)(`span`,{children:`Confirm new password`}),(0,p.jsx)(`input`,{type:`password`,autoComplete:`new-password`,minLength:8,maxLength:1024,value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()}}),v&&!k?(0,p.jsx)(`small`,{"data-error":!0,children:`Passwords do not match.`}):null]}),(0,p.jsx)(`div`,{className:`hq-security-actions`,children:(0,p.jsxs)(`button`,{type:`button`,className:`hq-btn`,disabled:!A,onClick:()=>void j(),children:[(0,p.jsx)(o,{size:14}),b?`Saving…`:e?.passwordMode?`Change password`:`Enable password`]})})]})]}),(0,p.jsxs)(`section`,{className:`hq-security-panel danger-zone`,children:[(0,p.jsxs)(`div`,{className:`hq-security-panel-head`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`span`,{children:`Session and recovery`}),(0,p.jsx)(`h2`,{children:`Access controls`}),(0,p.jsx)(`p`,{children:`Browser tokens remain available as a recovery path. Public tunnel mode will refuse to remove the last browser authentication method.`})]}),(0,p.jsx)(i,{size:22})]}),(0,p.jsxs)(`div`,{className:`hq-security-actions split`,children:[(0,p.jsxs)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:b,onClick:()=>void N(),children:[(0,p.jsx)(r,{size:14}),`Log out this browser`]}),e?.passwordMode?w?(0,p.jsxs)(`div`,{className:`hq-security-confirm-remove`,children:[(0,p.jsx)(`span`,{children:`Remove password protection?`}),(0,p.jsx)(`button`,{type:`button`,className:`hq-btn secondary`,disabled:b,onClick:()=>T(!1),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`hq-btn danger`,disabled:b||D&&!l,onClick:()=>void M(),children:`Remove password`})]}):(0,p.jsxs)(`button`,{type:`button`,className:`hq-btn danger`,disabled:b,onClick:()=>T(!0),children:[(0,p.jsx)(i,{size:14}),`Remove password`]}):null]})]})]})}export{h as SettingsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Lt as t}from"./icons-BV2PcvP1.js";import{i as n}from"./markdown-HUVrfVaI.js";import{o as r}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Lt as t}from"./icons-BV2PcvP1.js";import{i as n}from"./markdown-HUVrfVaI.js";import{o as r}from"./index-DwX1O_JZ.js";var i=e(t(),1),a=n();function o({points:e,color:t,height:n=140,format:r,emptyLabel:o=`no data`}){let[s,c]=(0,i.useState)(null),l=(0,i.useId)(),u=n,d=u-10-22,f=(0,i.useMemo)(()=>Math.max(...e.map(e=>e.value),0),[e]);if(e.length===0||f<=0)return(0,a.jsx)(`div`,{className:`hq-chart-empty`,children:o});let p=e.length,m=666/p,h=Math.max(2,Math.min(18,m-2)),g=e=>10+d*(1-e/f),_=[f*.25,f*.5,f*.75,f],v=Math.max(1,Math.round(p/5)),y=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),b=s===null?void 0:e[s];return(0,a.jsxs)(`div`,{className:`hq-chart`,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 720 ${u}`,className:`hq-chart-svg`,role:`img`,"aria-label":`Time series chart with ${e.length} data points`,onMouseLeave:()=>c(null),onMouseMove:t=>{let n=t.currentTarget.getBoundingClientRect(),r=(t.clientX-n.left)/n.width*720,i=Math.floor((r-46)/m);c(i>=0&&i<e.length?i:null)},children:[(0,a.jsx)(`clipPath`,{id:l,children:(0,a.jsx)(`rect`,{x:46,y:10,width:666,height:d})}),_.map((e,t)=>(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:46,x2:712,y1:g(e),y2:g(e),className:`hq-chart-grid`}),(0,a.jsx)(`text`,{x:40,y:g(e)+3,className:`hq-chart-ytick`,textAnchor:`end`,children:r(e)})]},t)),(0,a.jsx)(`line`,{x1:46,x2:712,y1:10+d,y2:10+d,className:`hq-chart-axis`}),(0,a.jsx)(`g`,{clipPath:`url(#${l})`,children:e.map((e,n)=>{let r=46+n*m+(m-h)/2,i=g(e.value),o=10+d-i;return o<=0?null:(0,a.jsx)(`rect`,{x:r,y:i,width:h,height:o,rx:Math.min(3,h/2),fill:t,opacity:s===null||s===n?1:.45},n)})}),e.map((e,t)=>t%v===0?(0,a.jsx)(`text`,{x:46+t*m+m/2,y:u-6,className:`hq-chart-xtick`,textAnchor:`middle`,children:y(e.ts)},t):null),(0,a.jsx)(`rect`,{x:46,y:10,width:666,height:d,fill:`transparent`})]}),b!==void 0&&(0,a.jsxs)(`div`,{className:`hq-chart-tooltip`,children:[(0,a.jsx)(`span`,{className:`hq-chart-tooltip-swatch`,style:{background:t}}),(0,a.jsx)(`span`,{className:`hq-chart-tooltip-value`,children:r(b.value)}),(0,a.jsx)(`span`,{className:`hq-chart-tooltip-time`,children:y(b.ts)})]})]})}var s=[{label:`1h`,ms:3600*1e3},{label:`6h`,ms:360*60*1e3},{label:`24h`,ms:1440*60*1e3},{label:`7d`,ms:10080*60*1e3}];function c(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function l(e,t){let n=new Map;for(let r of e){let e=r[t];if(e!==void 0)for(let[t,r]of Object.entries(e)){let e=n.get(t);e===void 0?n.set(t,{...r}):(e.costUsd+=r.costUsd,e.inputTokens+=r.inputTokens,e.outputTokens+=r.outputTokens,e.cacheRead=(e.cacheRead??0)+(r.cacheRead??0),e.cacheWrite=(e.cacheWrite??0)+(r.cacheWrite??0))}}return[...n.entries()].map(([e,t])=>({key:e,entry:t})).sort((e,t)=>t.entry.costUsd-e.entry.costUsd)}function u(){let[e,t]=(0,i.useState)([]),[n,u]=(0,i.useState)(null),[f,p]=(0,i.useState)(s[2].ms);(0,i.useEffect)(()=>{let e=!1,n=()=>{r(`/api/trends/cost`).then(n=>{e||(t(n.samples),u(null))}).catch(t=>{e||u(t.message)})};n();let i=setInterval(n,3e4);return()=>{e=!0,clearInterval(i)}},[]);let{shown:m,totalCost:h,totalTokens:g,totalTools:_,byModel:v,byProvider:y,totalCacheRead:b,totalCacheWrite:x}=(0,i.useMemo)(()=>{let t=Date.now()-f,n=e.filter(e=>e.ts>=t),r=n.length>0?n:e.slice(-24),i=r.reduce((e,t)=>e+t.costUsd,0),a=r.reduce((e,t)=>e+t.inputTokens+t.outputTokens,0),o=r.reduce((e,t)=>e+t.toolCalls,0),s=l(r,`byModel`);return{shown:r,totalCost:i,totalTokens:a,totalTools:o,byModel:s,byProvider:l(r,`byProvider`),totalCacheRead:s.reduce((e,t)=>e+(t.entry.cacheRead??0),0),totalCacheWrite:s.reduce((e,t)=>e+(t.entry.cacheWrite??0),0)}},[e,f]);if(n!==null)return(0,a.jsxs)(`div`,{className:`hq-empty hq-empty-ornate`,children:[`Error loading trends: `,n]});if(e.length===0)return(0,a.jsx)(`div`,{className:`hq-empty hq-empty-ornate`,children:`No trend data yet. Trends accumulate as cost signals arrive.`});let S=v.length>0,C=b+x>0?b/(b+x)*100:null,w=s.find(e=>e.ms===f)?.label??`custom`;return(0,a.jsxs)(`div`,{className:`hq-screen hq-trends-screen`,children:[(0,a.jsxs)(`section`,{className:`hq-screen-hero hq-trends-hero`,"aria-label":`Telemetry trend summary`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Telemetry runway`}),(0,a.jsxs)(`h2`,{children:[w,` signal window`]}),(0,a.jsx)(`p`,{children:`Cost, tokens and tool activity are split into single-purpose charts so spikes stay attributable without dual-axis ambiguity.`})]}),(0,a.jsxs)(`div`,{className:`hq-hero-metrics`,children:[(0,a.jsx)(d,{label:`cost`,value:`$${h.toFixed(4)}`}),(0,a.jsx)(d,{label:`tokens`,value:c(g),tone:`warn`}),(0,a.jsx)(d,{label:`tool calls`,value:_.toLocaleString(),tone:`ok`}),C===null?null:(0,a.jsx)(d,{label:`cache hit`,value:`${C.toFixed(0)}%`})]})]}),(0,a.jsxs)(`div`,{className:`hq-filter-row hq-trends-filter-row`,children:[s.map(e=>(0,a.jsx)(`button`,{type:`button`,className:`hq-pill hq-filter-chip${f===e.ms?` selected`:``}`,onClick:()=>p(e.ms),children:e.label},e.label)),(0,a.jsxs)(`span`,{className:`hq-mono hq-row-subtle hq-ml-auto`,children:[m.length,` × 5-min buckets`]})]}),(0,a.jsxs)(`section`,{className:`hq-chart-gallery`,"aria-label":`Trend charts`,children:[(0,a.jsxs)(`div`,{className:`hq-card hq-chart-card primary`,children:[(0,a.jsx)(`div`,{className:`hq-section-head compact`,children:(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Spend`}),(0,a.jsx)(`h3`,{children:`Cost (USD)`})]})}),(0,a.jsx)(o,{points:m.map(e=>({ts:e.ts,value:e.costUsd})),color:`var(--chart-1)`,format:e=>`$${e>=1?e.toFixed(2):e.toFixed(4)}`})]}),(0,a.jsxs)(`div`,{className:`hq-card hq-chart-card`,children:[(0,a.jsx)(`div`,{className:`hq-section-head compact`,children:(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Volume`}),(0,a.jsx)(`h3`,{children:`Tokens (in + out)`})]})}),(0,a.jsx)(o,{points:m.map(e=>({ts:e.ts,value:e.inputTokens+e.outputTokens})),color:`var(--chart-2)`,format:c})]}),(0,a.jsxs)(`div`,{className:`hq-card hq-chart-card`,children:[(0,a.jsx)(`div`,{className:`hq-section-head compact`,children:(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Activity`}),(0,a.jsx)(`h3`,{children:`Tool calls`})]})}),(0,a.jsx)(o,{points:m.map(e=>({ts:e.ts,value:e.toolCalls})),color:`var(--chart-3)`,format:e=>String(Math.round(e))})]})]}),S&&(0,a.jsxs)(`section`,{className:`hq-two-column hq-trends-breakdowns`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`hq-section-head compact`,children:(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Model economics`}),(0,a.jsx)(`h3`,{children:`By Model`})]})}),(0,a.jsx)(`div`,{className:`hq-card hq-breakdown-card`,children:v.map(({key:e,entry:t})=>{let n=h>0?t.costUsd/h*100:0;return(0,a.jsxs)(`div`,{className:`hq-row hq-breakdown-row`,children:[(0,a.jsx)(`span`,{className:`hq-text-bright`,children:e}),(0,a.jsxs)(`span`,{className:`hq-mono hq-row-subtle`,children:[c(t.inputTokens),`→`,c(t.outputTokens),t.cacheRead!==void 0||t.cacheWrite!==void 0?` · cache ${c((t.cacheRead??0)+(t.cacheWrite??0))}`:``]}),(0,a.jsxs)(`span`,{className:`hq-cost-amount hq-ml-auto`,children:[`$`,t.costUsd.toFixed(4)]}),(0,a.jsxs)(`span`,{className:`hq-mono hq-row-subtle`,children:[n.toFixed(1),`%`]})]},e)})})]}),y.length>1&&(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`hq-section-head compact`,children:(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`span`,{className:`hq-section-kicker`,children:`Provider split`}),(0,a.jsx)(`h3`,{children:`By Provider`})]})}),(0,a.jsx)(`div`,{className:`hq-card hq-breakdown-card`,children:y.map(({key:e,entry:t})=>{let n=h>0?t.costUsd/h*100:0;return(0,a.jsxs)(`div`,{className:`hq-row hq-breakdown-row`,children:[(0,a.jsx)(`span`,{className:`hq-text-bright`,children:e}),(0,a.jsxs)(`span`,{className:`hq-cost-amount hq-ml-auto`,children:[`$`,t.costUsd.toFixed(4)]}),(0,a.jsxs)(`span`,{className:`hq-mono hq-row-subtle`,children:[n.toFixed(1),`%`]})]},e)})})]})]})]})}function d({label:e,value:t,tone:n}){return(0,a.jsxs)(`div`,{className:`hq-hero-metric`,"data-tone":n,children:[(0,a.jsx)(`strong`,{children:t}),(0,a.jsx)(`span`,{children:e})]})}export{u as TrendsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Lt as t}from"./icons-BV2PcvP1.js";import{l as n,o as r}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Lt as t}from"./icons-BV2PcvP1.js";import{l as n,o as r}from"./index-DwX1O_JZ.js";var i=e(t(),1);function a(e,t=200){let a=n(e=>e.events),[o,s]=(0,i.useState)([]),[c,l]=(0,i.useState)(!0);return(0,i.useEffect)(()=>{let n=!1;return r(`/api/events?type=${encodeURIComponent(e)}&limit=${t}`).then(e=>{n||(s([...e.events??[]].reverse()),l(!1))}).catch(()=>{n||l(!1)}),()=>{n=!0}},[e,t]),{events:(0,i.useMemo)(()=>{let t=new Set,n=[];for(let r of o)r.type!==e||t.has(r.id)||(t.add(r.id),n.push(r));for(let r of a)r.type!==e||t.has(r.id)||(t.add(r.id),n.push(r));return n},[o,a,e]),loading:c}}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{D as t,Lt as n,c as r,kt as i,l as a,tt as o,yt as s}from"./icons-BV2PcvP1.js";import{i as c}from"./markdown-HUVrfVaI.js";import{t as l}from"./use-backfilled-events-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{D as t,Lt as n,c as r,kt as i,l as a,tt as o,yt as s}from"./icons-BV2PcvP1.js";import{i as c}from"./markdown-HUVrfVaI.js";import{t as l}from"./use-backfilled-events-ceR5R8_K.js";var u=e(n(),1),d=c(),f={allocated:{Icon:t,cls:`info`},committed:{Icon:i,cls:`active`},merged:{Icon:o,cls:`active`},conflict:{Icon:r,cls:`warn`},released:{Icon:a,cls:`idle`},failed:{Icon:s,cls:`error`}};function p({e}){let n=e.payload,r=f[n.kind]??{Icon:t,cls:`info`};return(0,d.jsxs)(`div`,{className:`hq-row hq-worktree-event-line`,children:[(0,d.jsx)(r.Icon,{size:14,className:`hq-kind-icon ${r.cls}`}),(0,d.jsx)(`span`,{className:`hq-text-bright`,children:n.kind}),n.branch!==void 0&&(0,d.jsx)(`span`,{className:`hq-pill info`,children:n.branch}),n.kind===`committed`&&(0,d.jsxs)(`span`,{className:`hq-mono hq-diffstat`,children:[(0,d.jsxs)(`span`,{className:`hq-diff-add-count`,children:[`+`,n.insertions??0]}),` `,(0,d.jsxs)(`span`,{className:`hq-diff-del-count`,children:[`−`,n.deletions??0]}),` in `,n.files??0,` file(s)`,` `,n.sha===void 0?``:`(${n.sha.slice(0,7)})`]}),n.kind===`conflict`&&n.conflictFiles!==void 0&&(0,d.jsxs)(`span`,{className:`hq-mono hq-row-error`,children:[`conflicts: `,n.conflictFiles.join(`, `)]}),n.kind===`failed`&&(0,d.jsx)(`span`,{className:`hq-mono hq-row-error`,children:n.error}),(0,d.jsx)(`span`,{className:`hq-mono hq-row-time`,children:new Date(e.timestamp).toLocaleTimeString()})]})}function m(){let{events:e,loading:n}=l(`worktree.event`,300),r=(0,u.useMemo)(()=>{let t=new Map;for(let n of e){let e=n.payload.ownerId??`(unknown)`,r=t.get(e)??[];r.push(n),t.set(e,r)}return Array.from(t.entries()).reverse()},[e]),i=(0,u.useMemo)(()=>{let e=0,t=0,n=0,i=0;for(let[,a]of r){let r=a.at(-1)?.payload;r?.kind===`merged`||r?.kind===`released`?t+=1:e+=1,a.some(e=>e.payload.kind===`conflict`)&&(n+=1),a.some(e=>e.payload.kind===`failed`)&&(i+=1)}return{open:e,merged:t,conflicts:n,failed:i}},[r]);return r.length===0?(0,d.jsx)(`div`,{className:`hq-empty hq-empty-ornate`,children:n?`Loading worktree history…`:`No worktree events yet. These appear when Goal allocates or merges git worktrees for parallel phases.`}):(0,d.jsxs)(`div`,{className:`hq-screen hq-worktree-screen`,children:[(0,d.jsxs)(`section`,{className:`hq-screen-hero hq-worktree-hero`,"aria-label":`Worktree lifecycle summary`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`span`,{className:`hq-section-kicker`,children:`Workspace lanes`}),(0,d.jsx)(`h2`,{children:`Parallel branch lifecycle`}),(0,d.jsx)(`p`,{children:`Each owner gets a lane so allocation, commits, conflicts, merges and release events read as an ordered build path.`})]}),(0,d.jsxs)(`div`,{className:`hq-hero-metrics`,children:[(0,d.jsx)(h,{label:`lanes`,value:r.length}),(0,d.jsx)(h,{label:`open`,value:i.open,tone:i.open>0?`warn`:`ok`}),(0,d.jsx)(h,{label:`merged/released`,value:i.merged,tone:`ok`}),(0,d.jsx)(h,{label:`conflicts`,value:i.conflicts+i.failed,tone:i.conflicts+i.failed>0?`error`:`ok`})]})]}),(0,d.jsx)(`div`,{className:`hq-worktree-lanes`,children:r.map(([e,n])=>{let r=n[n.length-1].payload,i=f[r.kind]??{Icon:t,cls:`info`};return(0,d.jsxs)(`article`,{className:`hq-card hq-worktree-lane`,children:[(0,d.jsxs)(`div`,{className:`hq-row hq-lane-head`,children:[(0,d.jsx)(`span`,{className:`hq-mono hq-text-bright`,children:e}),(0,d.jsx)(`span`,{className:`hq-pill ${i.cls}`,children:r.kind}),(0,d.jsxs)(`span`,{className:`hq-mono hq-row-time`,children:[n.length,` events`]})]}),(0,d.jsx)(`div`,{className:`hq-worktree-event-list`,children:n.map(e=>(0,d.jsx)(p,{e},e.id))})]},e)})})]})}function h({label:e,value:t,tone:n}){return(0,d.jsxs)(`div`,{className:`hq-hero-metric`,"data-tone":n,children:[(0,d.jsx)(`strong`,{children:t}),(0,d.jsx)(`span`,{children:e})]})}export{m as WorktreeView};
|
package/dist/index.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/wrongstack.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>WrongStack HQ</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DwX1O_JZ.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/icons-BV2PcvP1.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendor-DT5_U5Rx.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/markdown-HUVrfVaI.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B10rm8pW.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/webui-hq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.297.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "HQ Command Center dashboard — offline React app for the cross-machine coordination surface (port 3499).",
|
|
6
6
|
"type": "module",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"remark-gfm": "^4.0.1",
|
|
22
22
|
"virtua": "^0.49.3",
|
|
23
23
|
"zustand": "5.0.14",
|
|
24
|
-
"@wrongstack/core": "0.
|
|
25
|
-
"@wrongstack/
|
|
26
|
-
"@wrongstack/
|
|
24
|
+
"@wrongstack/core": "0.297.0",
|
|
25
|
+
"@wrongstack/tools": "0.297.0",
|
|
26
|
+
"@wrongstack/webui-server": "0.297.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/react": "^19.2.17",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cockpit-DvD1_FDz.js","assets/rolldown-runtime-QTnfLwEv.js","assets/icons-BV2PcvP1.js","assets/markdown-HUVrfVaI.js","assets/fleet-map-CPD0vSE4.js","assets/vendor-DT5_U5Rx.js","assets/fleet-topology-BA3kpTuc.js","assets/live-console-BqDIM7Cs.js","assets/mailbox-E7puE59T.js","assets/use-backfilled-events-B_7YE0rb.js","assets/kanban-C9jQWM2T.js","assets/cost-CE_P6ujW.js","assets/brain-D5R8R8BY.js","assets/worktree-D0pa1IH5.js","assets/trends-DqAtNjBm.js","assets/alerts-B_wJljmR.js","assets/control-DGfNRSfd.js","assets/settings-DMQf2eO5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{A as t,At as n,C as r,Ct as i,E as a,It as o,J as s,K as c,Lt as l,Mt as u,N as d,Pt as f,R as ee,St as p,T as te,Y as ne,_ as re,a as ie,c as m,g as h,ht as g,i as ae,j as oe,mt as _,n as v,o as se,p as ce,rt as le,u as ue,x as y,yt as de}from"./icons-BV2PcvP1.js";import{t as fe}from"./vendor-DT5_U5Rx.js";import{i as pe}from"./markdown-HUVrfVaI.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b={maxReconnectAttempts:10,initialBackoffMs:1e3,maxBackoffMs:3e4,backoffMultiplier:2,jitterRatio:0,queueLimit:1e3,heartbeatIntervalMs:0,heartbeatTimeoutMs:0};function me(){return{phase:`idle`,reconnectAttempt:0,lastActivityAt:null,stopped:!1}}function he(e){return e.stopped?e:{...e,phase:`connecting`}}function ge(e,t=Date.now()){return{...e,phase:`open`,reconnectAttempt:0,lastActivityAt:t,stopped:!1}}function _e(e,t=Date.now()){return{...e,lastActivityAt:t}}function ve(e){return{...e,phase:`closed`,stopped:!0}}function ye(e,t,n=Date.now(),r=Math.random){if(e.stopped||e.reconnectAttempt>=t.maxReconnectAttempts)return{state:{...e,phase:`closed`},plan:null};let i=e.reconnectAttempt+1,a=Math.min(t.initialBackoffMs*t.backoffMultiplier**(i-1),t.maxBackoffMs),o=(r()*2-1)*t.jitterRatio,s=Math.max(0,Math.round(a*(1+o)));return{state:{...e,phase:`reconnecting`,reconnectAttempt:i},plan:{attempt:i,delayMs:s,retryAt:n+s}}}function be(e,t,n=Date.now()){return e.phase!==`open`||e.lastActivityAt===null||t.heartbeatIntervalMs<=0?!1:n-e.lastActivityAt>t.heartbeatIntervalMs+t.heartbeatTimeoutMs}var xe=`abort,ping,user_message,tool.confirm_result,completion.request,model.switch,model.refine,autonomy.switch,context.clear,context.compact,context.debug,context.editor.open,context.editor.validate,context.editor.apply,context.mode.create,context.mode.delete,context.mode.switch,context.mode.update,context.modes.list,context.repair,mode.switch,modes.list,session.checkpoints,session.delete,session.new,session.rename,session.resume,session.rewind,session.save,sessions.list,side_effects.list,stats.get,todo.update,todos.clear,todos.get,todos.remove`.split(`,`),Se=[`collab.join`,`collab.leave`,`collab.annotate`,`collab.resolve`,`collab.request_pause`,`collab.resume`,`collab.grant_control`,`collab.inject_tool`,`mailbox.agents`,`mailbox.clear`,`mailbox.compact`,`mailbox.messages`,`mailbox.purge`,`mailbox.send`],Ce=`brain.ask,brain.config.get,brain.config.set,brain.risk,brain.status,chronicle.facet,chronicle.facets,chronicle.graph,chronicle.metrics,chronicle.query,chronicle.status,config.doctor,design.list,design.materialize,design.set,design.state,design.swap,design.tune,design.use,design.verify,memory.list,memory.sage.backfillRecoverable,memory.sage.candidateResolve,memory.sage.delete,memory.sage.forFile,memory.sage.get,memory.sage.graph,memory.sage.list,memory.sage.listPage,memory.sage.recover,memory.sage.remember,memory.sage.update`.split(`,`),we=`auth.oauth.cancel,auth.oauth.code,auth.oauth.start,mcp.add,mcp.disable,mcp.discover,mcp.enable,mcp.list,mcp.prompt.get,mcp.prompts,mcp.remove,mcp.resource.read,mcp.resources,mcp.restart,mcp.sleep,mcp.update,mcp.wake,prompts.content,prompts.create,prompts.favorite,prompts.list,prompts.recent,prompts.search,prompts.used,skills.content,skills.create,skills.edit,skills.export,skills.install,skills.list,skills.uninstall,skills.update`.split(`,`),Te=`goal-state.get,goal.addTask,goal.assess,goal.assignTask,goal.clear,goal.get,goal.list,goal.load,goal.moveTask,goal.pause,goal.resume,goal.retryTask,goal.revert,goal.runTask,goal.save,goal.selectPhase,goal.start,goal.state,goal.status,goal.stop,goal.taskStatus,goal.toggleAutonomous,plan.get,plan.item.update,plan.template_use,task.update,tasks.get`.split(`,`),Ee=`sdd.board.cancel_task,sdd.board.cleanup_worktrees,sdd.board.delete_task,sdd.board.destroy,sdd.board.get,sdd.board.list,sdd.board.pause,sdd.board.reassign,sdd.board.resume,sdd.board.retry,sdd.board.retry_all_failed,sdd.board.rollback,sdd.board.set_task_fallbacks,sdd.board.set_task_model,sdd.board.set_task_verification,sdd.board.split_task,sdd.board.stop,sdd.run.from_graph,sdd.run.from_spec,sdd.run.start,sdd.spec.approve,sdd.spec.discard,sdd.spec.get,sdd.spec.message,sdd.spec.start,specs.get,specs.list,specs.taskStatus`.split(`,`),De=[`files.list`,`files.read`,`files.tree`,`files.write`,`git.changes`,`git.diff`,`git.info`,`projects.add`,`projects.list`,`projects.select`,`working_dir.set`,`worktree.cleanup`,`worktree.diff`,`worktree.merge`,`worktree.remove`,`worktree.scan`,`shell.open`,`process.kill`,`process.killAll`,`process.list`,`terminal.close`,`terminal.create`,`terminal.input`,`terminal.resize`],Oe=`codebase.index.server.shutdown,connections.health,connections.service_action,diag.get,key.add,key.delete,key.set_active,key.update,prefs.get,prefs.update,provider.add,provider.clear_models,provider.models,provider.models.search,provider.probe,provider.remove,provider.status.clear,provider.status.get,provider.status.retry,provider.undo_clear,provider.update,providers.list,providers.saved,tool.disable,tool.enable,tools.list,webui.shutdown`.split(`,`),ke=`error,log,pong,side_effects,agent.status_changed,agent.timeline.message,client.status_update,compaction.failed,completion.result,context.compacted,context.debug,context.editor.snapshot,context.editor.validation,context.editor.applied,context.mode.changed,context.modes.list,context.repaired,ctx.max_context,ctx.pct,delegate.completed,delegate.started,iteration.completed,iteration.limit_reached,iteration.started,model.refine_result,modes.list,provider.active_blocked,provider.error,provider.fallback,provider.response,provider.retry,provider.status_changed,provider.stream_error,provider.text_delta,provider.thinking_delta,run.result,session.checkpoints,session.damaged,session.end,session.rewound,session.start,session.stats,sessions.list,sessions.status_update,stats.get,token.cost_estimate_unavailable,token.threshold,tool.confirm_needed,tool.disabled,tool.enabled,tool.executed,tool.loop_detected,tool.progress,tool.started,tools.list,trust.persisted`.split(`,`),Ae=[`collab.annotation.added`,`collab.annotation.resolved`,`collab.event`,`collab.injection.granted`,`collab.participant.joined`,`collab.participant.left`,`collab.pause.granted`,`collab.pause.released`,`collab.state`,`mailbox.agent_registered`,`mailbox.agents`,`mailbox.cleared`,`mailbox.compacted`,`mailbox.event`,`mailbox.messages`,`mailbox.sent`,`mailbox.purged`,`mailbox.received`,`subagent.budget_extended`,`subagent.event`],je=`brain.answer,brain.config,brain.event,brain.status,chronicle.error,chronicle.facet_result,chronicle.facets_result,chronicle.graph_result,chronicle.metrics_result,chronicle.query_result,chronicle.status_result,config.doctor.result,design.list,design.materialize,design.set,design.state,design.swap,design.tune,design.use,design.verify,memory.event,memory.list,memory.sage.backfillRecoverable,memory.sage.candidateResolve,memory.sage.delete,memory.sage.forFile,memory.sage.get,memory.sage.graph,memory.sage.list,memory.sage.listPage,memory.sage.recover,memory.sage.remember,memory.sage.update`.split(`,`),Me=`mcp.content.error,mcp.content.selected,mcp.list,mcp.operation_result,mcp.prompts,mcp.resources,mcp.server.added,mcp.server.connected,mcp.server.disconnected,mcp.server.discovered,mcp.server.error,mcp.server.reconnected,mcp.server.removed,mcp.server.sleeping,mcp.server.updated,mcp.server.waking,prompts.content,prompts.created,prompts.favorite,prompts.list,prompts.recent,prompts.search,prompts.used,skills.content,skills.created,skills.edited,skills.exported,skills.installed,skills.list,skills.uninstalled,skills.updated`.split(`,`),Ne=`budget.decision,budget.threshold_reached,coordinator.stats,coordinator.status,eternal.iteration,fleet.concurrency_update,goal-state.updated,goal.assess.result,goal.list,goal.paused,goal.resumed,goal.saved,goal.error,goal.stopped,goal.failed,goal.completed,goal.cleared,goal.reverted,goal.progress,goal.state,in_flight.ended,in_flight.started,plan.updated,task.completed,task.failed,task.pending,task.started,tasks.updated,todos.cleared,todos.updated`.split(`,`),Pe=[`kanban.task.activity`,`sdd.board.lifecycle_result`,`sdd.board.list`,`sdd.board.snapshot`,`sdd.run.started`,`sdd.spec.agent_text`,`sdd.spec.error`,`sdd.spec.snapshot`,`specs.detail`,`specs.list`],Fe=[`consensus.vote_cast`,`consensus.vote_initiated`,`consensus.vote_resolved`,`cron.job_fired`,`cron.snapshot`,`techstack.job.cancelled`,`techstack.job.failed`,`techstack.job.progress`,`techstack.job.started`,`techstack.report.delivered`,`techstack.report.ready`,`techstack.snapshot.updated`,`techstack.workspace.completed`],Ie=`checkpoint.written,codemap.file_event,codemap.index_updated,codemap.tool_executed,codemap.tool_started,file.saved,files.list,files.read,files.tree,files.written,git.changes,git.diff,git.info,process.list,projects.added,projects.list,projects.selected,terminal.exit,terminal.output,working_dir.changed,worktree.cleanup_result,worktree.diff_result,worktree.event,worktree.merge_result,worktree.orphans,worktree.state`.split(`,`),Le=[`auth.oauth.status`,`codebase.index.server.shutdown_result`,`connections.health_error`,`connections.health_result`,`connections.service_action_result`,`diag.get`,`key.operation_result`,`model.switch_result`,`prefs.updated`,`provider.catalog`,`provider.models`,`provider.models.search_result`,`provider.probe`,`provider.status.snapshot`,`providers.saved`],Re=[...xe,...Se,...De,...Oe,...Te,...Ee,...Ce,...we],ze=[...ke,...Ae,...Ie,...Le,...Ne,...Pe,...Fe,...je,...Me];new Set(Re),new Set(ze);function x(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function S(e,t=0){return typeof e==`number`&&Number.isFinite(e)?e:t}function C(e){return e===void 0||Array.isArray(e)}function Be(e){return S(e.activeProjects)===e.activeProjects&&S(e.activeClients)===e.activeClients&&S(e.activeSessions)===e.activeSessions&&S(e.activeSubagents)===e.activeSubagents&&S(e.unreadMailboxMessages)===e.unreadMailboxMessages&&S(e.incompleteMailboxMessages)===e.incompleteMailboxMessages&&S(e.totalCostUsd)===e.totalCostUsd}function Ve(e){if(e.type!==`hq.snapshot`)return null;let t=x(e.snapshot),n=t?x(t.totals):null;return!t||typeof t.generatedAt!=`string`||!Array.isArray(t.clients)||!Array.isArray(t.projects)||!Array.isArray(t.sessions)||!Array.isArray(t.fleets)||!Array.isArray(t.mailboxes)||!n||!Be(n)||!C(t.machines)||!C(t.liveSessions)||!C(t.mcpServers)?null:{kind:`hq-snapshot`,snapshot:t}}function He(e){if(e.type!==`hq.event`)return null;let t=x(e.event);return!t||typeof t.id!=`string`||typeof t.type!=`string`||typeof t.timestamp!=`string`||typeof t.clientId!=`string`||typeof t.projectId!=`string`||typeof t.seq!=`number`?null:{kind:`hq-event`,event:t}}function Ue(e){return e.type!==`hq.alert`||typeof e.severity!=`string`||![`info`,`warn`,`error`].includes(e.severity)||typeof e.message!=`string`||typeof e.timestamp!=`string`?null:{kind:`hq-alert`,alert:e}}function We(e){if(e.type!==`hq.command_status`)return null;let t=x(e.command);return!t||typeof t.commandId!=`string`||typeof t.type!=`string`||typeof t.clientId!=`string`||typeof t.enqueuedBy!=`string`||typeof t.enqueuedAt!=`string`||typeof t.status!=`string`||![`queued`,`delivered`,`acked`].includes(t.status)?null:{kind:`hq-command-status`,command:t}}var w=e(l(),1),Ge=fe(),T=e=>Symbol.iterator in e,E=e=>`entries`in e,D=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},Ke=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function qe(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:T(e)&&T(t)?E(e)&&E(t)?D(e,t):Ke(e,t):D({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function O(e){let t=w.useRef(void 0);return n=>{let r=e(n);return qe(t.current,r)?t.current:t.current=r}}var k=`wrongstack.hq.token.v1`;function A(){if(typeof window>`u`)return null;try{let e=new URLSearchParams(window.location.search).get(`token`);return e!==null&&e.length>0?e:null}catch{return null}}function j(){if(typeof window>`u`)return null;try{return window.sessionStorage??null}catch{return null}}function Je(){try{let e=j()?.getItem(k)??null;return e!==null&&e.length>0?e:null}catch{return null}}function M(e){try{j()?.setItem(k,e)}catch{}}function N(){try{j()?.removeItem(k)}catch{}}function P(){let e=A();return e===null?Je():(M(e),e)}function Ye(){if(typeof window>`u`)return;let e=A();if(e!==null&&(M(e),Je()===e))try{let e=new URL(window.location.href);e.searchParams.delete(`token`),window.history.replaceState(null,``,`${e.pathname}${e.search}${e.hash}`)}catch{}}function Xe(){let e=P();return e===null?{}:{Authorization:`Bearer ${e}`}}function F(e,t){let n={...t?.headers??{},...Xe()};return fetch(e,{...t,headers:n})}function Ze(){if(typeof window>`u`)return null;try{let e=window.location.hash;if(!e.startsWith(`#bootstrap=`))return null;let t=e.slice(11);return t.length>0?t:null}catch{return null}}function Qe(){if(!(typeof window>`u`))try{let e=new URL(window.location.href);e.hash.startsWith(`#bootstrap=`)&&(e.hash=``,window.history.replaceState(null,``,`${e.pathname}${e.search}`))}catch{}}async function $e(){let e=Ze();if(e===null)return!1;try{return(await fetch(`/api/auth/bootstrap`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e}),credentials:`same-origin`,signal:AbortSignal.timeout(1e4)})).ok?(Qe(),N(),!0):!1}catch{return!1}}var I=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},et=(e=>e?I(e):I),tt=e=>e;function nt(e,t=tt){let n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n}var rt=e=>{let t=et(e),n=e=>nt(t,e);return Object.assign(n,t),n},it=(e=>e?rt(e):rt),at=6e3,ot=0,L=it()(e=>({toasts:[],addToast:(t,n=`info`,r=at,i)=>{let a=`toast-${++ot}-${Date.now()}`,o={id:a,message:t,severity:n,createdAt:Date.now(),ttlMs:r,action:i};e(e=>({toasts:[...e.toasts.slice(-4),o]})),r>0&&setTimeout(()=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==a)}))},r)},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),R=pe(),st={error:(0,R.jsx)(de,{size:16,"aria-hidden":`true`}),warning:(0,R.jsx)(m,{size:16,"aria-hidden":`true`}),info:(0,R.jsx)(s,{size:16,"aria-hidden":`true`}),success:(0,R.jsx)(i,{size:16,"aria-hidden":`true`})};function ct(){let{toasts:e,removeToast:t}=L(O(e=>({toasts:e.toasts,removeToast:e.removeToast})));return e.length===0?null:(0,R.jsx)(`div`,{className:`hq-toast-container`,role:`status`,"aria-live":`polite`,"aria-label":`Notifications`,children:e.map(e=>(0,R.jsxs)(`div`,{className:`hq-toast hq-toast--${e.severity}`,"data-severity":e.severity,children:[(0,R.jsx)(`span`,{className:`hq-toast-icon`,children:st[e.severity]}),(0,R.jsx)(`span`,{className:`hq-toast-message`,children:e.message}),e.action?(0,R.jsx)(`span`,{className:`hq-toast-action`,children:e.action}):null,(0,R.jsx)(`button`,{type:`button`,className:`hq-toast-close`,"aria-label":`Dismiss notification`,onClick:()=>t(e.id),children:(0,R.jsx)(v,{size:12})})]},e.id))})}function lt(e,t){let n=t.liveSessions??[],r=e.selectedSessionId===null?void 0:n.find(t=>t.sessionId===e.selectedSessionId),i=e.selectedAgentId===null||r?.agents.some(t=>t.id===e.selectedAgentId)===!0,a=e.selectedClientId===null||t.clients.some(t=>t.clientId===e.selectedClientId);return{snapshot:t,...e.selectedSessionId!==null&&r===void 0?{selectedSessionId:null,selectedAgentId:null}:i?{}:{selectedAgentId:null},...a?{}:{selectedClientId:null}}}function ut(e,t){return e.timestamp===t.timestamp&&e.severity===t.severity&&e.message===t.message}var z=it()(e=>({snapshot:null,events:[],alerts:[],commandStatuses:[],activeView:`cockpit`,selectedSessionId:null,selectedAgentId:null,selectedClientId:null,connected:!1,authRequired:!1,setActiveView:t=>e({activeView:t}),selectSession:(t,n=null)=>e({selectedSessionId:t,selectedAgentId:n}),selectAgent:(t,n)=>e({selectedSessionId:t,selectedAgentId:n}),selectClient:t=>e({selectedClientId:t}),markAuthRequired:()=>e(e=>e.authRequired?{}:{authRequired:!0}),_hydrateSnapshot:t=>e(e=>e.snapshot===null?lt(e,t):{}),_onSnapshot:t=>e(e=>({...lt(e,t),connected:!0})),_onEvent:t=>e(e=>e.events.some(e=>e.id===t.id)?{}:{events:[...e.events,t].slice(-500)}),_onAlert:t=>e(e=>e.alerts.some(e=>ut(e,t))?{}:{alerts:[...e.alerts,t].slice(-100)}),_onCommandStatus:t=>e(e=>{let n=e.commandStatuses.findIndex(e=>e.commandId===t.commandId);if(n<0)return{commandStatuses:[...e.commandStatuses,t].slice(-200)};let r=[...e.commandStatuses];return r[n]=t,{commandStatuses:r}}),_setConnected:t=>e({connected:t})}));async function B(e){let t;try{t=await F(e)}catch{throw Error(`Network error fetching ${e}`)}if(t.status===401)throw z.getState().markAuthRequired(),Error(`401 Unauthorized fetching ${e} — browser token required`);if(!t.ok)throw Error(`${t.status} ${t.statusText}`);try{return await t.json()}catch{throw Error(`Invalid JSON response from ${e}: ${t.status}`)}}async function dt(e){let t;try{t=await F(`/api/mailbox-send`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch{throw Error(`Network error sending mailbox message`)}if(t.status===401)throw z.getState().markAuthRequired(),Error(`401 Unauthorized — browser token required`);if(!t.ok){let e=await t.json().catch(()=>null),n=typeof e?.error==`string`?e.error:t.statusText||`HTTP ${t.status}`;throw Error(n)}try{return await t.json()}catch{throw Error(`Invalid JSON response from mailbox-send API`)}}async function ft(e,t,n){let r;try{r=await F(`/api/command`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({clientId:e,type:t,payload:n})})}catch{throw Error(`Network error sending command`)}if(r.status===401)throw z.getState().markAuthRequired(),Error(`401 Unauthorized — browser token required`);if(!r.ok){let e=(await r.json().catch(()=>null))?.error??(r.statusText||`HTTP ${r.status}`);throw Error(e)}try{return await r.json()}catch{throw Error(`Invalid JSON response from command API`)}}var pt=`wrongstack.hq.local-prefs.v1`,V={appearance:{theme:`dark`},fleet:{scope:`all`,layout:`map`,machineId:``,projectId:``},console:{delivery:`steer`,subject:``,body:``},control:{cmdType:`steer`,abortTarget:`leader`,spawnRole:`bug-hunter`,spawnTask:``,steerTo:`leader`,steerSubject:``,steerBody:``,broadcastSubject:``,broadcastBody:``},mailbox:{query:``,types:[],priorities:[],includeCompleted:!0}},H=null,U=new Set;function W(){for(let e of U)e()}function G(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function mt(){if(typeof window>`u`||window.localStorage===void 0)return G(V);try{let e=window.localStorage.getItem(pt);return e===null?G(V):ht(JSON.parse(e))}catch{return G(V)}}function ht(e){if(!K(e))return G(V);let t=K(e.appearance)?e.appearance:{},n=K(e.fleet)?e.fleet:{},r=K(e.console)?e.console:{},i=K(e.control)?e.control:{},a=K(e.mailbox)?e.mailbox:{};return{appearance:{theme:t.theme===`light`?`light`:`dark`},fleet:{scope:n.scope===`machine`||n.scope===`project`?n.scope:`all`,layout:n.layout===`compact`?`compact`:`map`,machineId:typeof n.machineId==`string`?n.machineId:``,projectId:typeof n.projectId==`string`?n.projectId:``},console:{delivery:r.delivery===`btw`||r.delivery===`queue`?r.delivery:`steer`,subject:typeof r.subject==`string`?r.subject:``,body:typeof r.body==`string`?r.body:``},control:{cmdType:i.cmdType===`btw`||i.cmdType===`queue`||i.cmdType===`abort`||i.cmdType===`spawn`||i.cmdType===`broadcast`||i.cmdType===`run-command`?i.cmdType:V.control.cmdType,abortTarget:i.abortTarget===`fleet`?`fleet`:`leader`,spawnRole:typeof i.spawnRole==`string`&&i.spawnRole.length>0?i.spawnRole:V.control.spawnRole,spawnTask:typeof i.spawnTask==`string`?i.spawnTask:V.control.spawnTask,steerTo:typeof i.steerTo==`string`?i.steerTo:V.control.steerTo,steerSubject:typeof i.steerSubject==`string`?i.steerSubject:V.control.steerSubject,steerBody:typeof i.steerBody==`string`?i.steerBody:V.control.steerBody,broadcastSubject:typeof i.broadcastSubject==`string`?i.broadcastSubject:V.control.broadcastSubject,broadcastBody:typeof i.broadcastBody==`string`?i.broadcastBody:V.control.broadcastBody},mailbox:{query:typeof a.query==`string`?a.query:V.mailbox.query,types:Array.isArray(a.types)?a.types.filter(e=>typeof e==`string`):[],priorities:Array.isArray(a.priorities)?a.priorities.filter(e=>typeof e==`string`):[],includeCompleted:typeof a.includeCompleted!=`boolean`||a.includeCompleted}}}function q(){return H===null&&(H=mt()),H}function J(e){if(!(typeof window>`u`||window.localStorage===void 0))try{window.localStorage.setItem(pt,JSON.stringify(e))}catch{}}function gt(e){return U.add(e),()=>U.delete(e)}function _t(){return q()}function vt(){return V}function yt(){return(0,w.useSyncExternalStore)(gt,_t,vt)}function bt(e){let t=q();H={...t,control:{...t.control,...e}},J(H),W()}function xt(e){let t=q();H={...t,appearance:{...t.appearance,...e}},J(H),W()}function St(e){let t=q();H={...t,fleet:{...t.fleet,...e}},J(H),W()}function Ct(e){let t=q();H={...t,console:{...t.console,...e}},J(H),W()}function wt(e){let t=q();H={...t,mailbox:{...t.mailbox,...e}},J(H),W()}function Tt({hadToken:e}){let[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)(null);(0,w.useEffect)(()=>{fetch(`/api/auth/status`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(n).catch(()=>i(`Could not load HQ auth status.`))},[]);let a=t?.tokenMode??!0,o=t?.passwordMode??!1,[s,c]=(0,w.useState)(`token`);return(0,w.useEffect)(()=>{t&&c(t.passwordMode?`password`:`token`)},[t]),r?(0,R.jsx)(`div`,{className:`hq-token-gate`,children:(0,R.jsxs)(`div`,{className:`hq-token-card`,children:[(0,R.jsx)(`div`,{className:`hq-brand`,children:`WrongStack HQ`}),(0,R.jsx)(`div`,{className:`hq-token-title`,children:`Auth status unavailable`}),(0,R.jsx)(`p`,{className:`hq-token-text`,children:r})]})}):t?(0,R.jsx)(`div`,{className:`hq-token-gate`,children:(0,R.jsxs)(`div`,{className:`hq-token-card`,children:[(0,R.jsx)(`div`,{className:`hq-brand`,children:`WrongStack HQ`}),a&&o?(0,R.jsxs)(`div`,{className:`hq-token-tabs`,children:[(0,R.jsx)(`button`,{type:`button`,className:`hq-token-tab`+(s===`token`?` active`:``),onClick:()=>c(`token`),children:`Browser token`}),(0,R.jsx)(`button`,{type:`button`,className:`hq-token-tab`+(s===`password`?` active`:``),onClick:()=>c(`password`),children:`Password`})]}):null,s===`token`||!o?(0,R.jsx)(Et,{hadToken:e}):(0,R.jsx)(Dt,{})]})}):(0,R.jsx)(`div`,{className:`hq-token-gate`,children:(0,R.jsxs)(`div`,{className:`hq-token-card`,children:[(0,R.jsx)(`div`,{className:`hq-brand`,children:`WrongStack HQ`}),(0,R.jsx)(`div`,{className:`hq-token-title`,children:`Checking auth mode…`})]})})}function Et({hadToken:e}){let[t,n]=(0,w.useState)(``),r=()=>{let e=t.trim();e.length!==0&&(M(e),window.location.reload())};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`hq-token-title`,children:`Browser token required`}),(0,R.jsx)(`p`,{className:`hq-token-text`,children:e?`The saved token was rejected — it may have been revoked or the server was reset. Paste a current browser token.`:`This HQ server runs in token mode. Paste the browser token printed at startup (the ?token= value in the URL wstack --hq shows).`}),(0,R.jsx)(`input`,{className:`hq-token-input`,type:`password`,placeholder:`browser token`,autoComplete:`off`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r()}}),(0,R.jsx)(`button`,{type:`button`,className:`hq-token-submit`,onClick:r,disabled:t.trim().length===0,children:`Connect`}),(0,R.jsxs)(`p`,{className:`hq-token-hint`,children:[`Manage tokens with `,(0,R.jsx)(`code`,{children:`wstack hq token list`}),` / `,(0,R.jsx)(`code`,{children:`wstack hq token create`}),` — they live in `,(0,R.jsx)(`code`,{children:`~/.wrongstack/hq/auth.json`}),`.`]})]})}function Dt(){let[e,t]=(0,w.useState)(``),[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(!1),o=async()=>{let t=e;if(t.length!==0){a(!0),r(null);try{let e=await fetch(`/api/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:t})});if(!e.ok){let t=`Login failed.`;try{let n=(await e.json()).error;typeof n==`string`?t=n:typeof n?.message==`string`&&(t=n.message)}catch{}r(t),a(!1);return}N(),window.location.reload()}catch{r(`Network error. Is the HQ server running?`),a(!1)}}};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`hq-token-title`,children:`Password required`}),(0,R.jsx)(`p`,{className:`hq-token-text`,children:`This HQ server is protected by a password. Enter it to open the dashboard.`}),n?(0,R.jsx)(`p`,{className:`hq-token-error`,children:n}):null,(0,R.jsx)(`input`,{className:`hq-token-input`,type:`password`,placeholder:`password`,autoComplete:`current-password`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o()}}),(0,R.jsx)(`button`,{type:`button`,className:`hq-token-submit`,onClick:()=>void o(),disabled:e.length===0||i,children:i?`Logging in…`:`Log in`}),(0,R.jsxs)(`p`,{className:`hq-token-hint`,children:[`Set or change the password with `,(0,R.jsx)(`code`,{children:`wstack --hq --password <secret>`}),`.`]})]})}var Ot=`modulepreload`,kt=function(e){return`/`+e},At={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=kt(t,n),t=s(t),t in At)return;At[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ot,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},jt=360*60*1e3,X=[{id:`cockpit`,label:`Cockpit`,eyebrow:`Fleet overview`,description:`Health, active work, alerts, cost and command shortcuts.`,group:`Operations`,icon:c,shortcut:1},{id:`fleet`,label:`Fleet Map`,eyebrow:`Topology`,description:`Machines, projects, terminals and agents in one live graph.`,group:`Operations`,icon:t,shortcut:2},{id:`console`,label:`Live Console`,eyebrow:`Transcripts`,description:`Stream and inspect session or agent conversations.`,group:`Operations`,icon:d,shortcut:3},{id:`mailbox`,label:`Mailbox`,eyebrow:`Coordination`,description:`Cross-project messages, unread work and direct delivery.`,group:`Operations`,icon:ne,shortcut:4},{id:`kanban`,label:`Kanban`,eyebrow:`Project work`,description:`Read-only project boards synchronized across clones and machines.`,group:`Operations`,icon:g},{id:`alerts`,label:`Alerts`,eyebrow:`Attention`,description:`Active fleet warnings and alert transition history.`,group:`Intelligence`,icon:f,shortcut:5},{id:`cost`,label:`Cost`,eyebrow:`Economics`,description:`Project, provider and model spending distribution.`,group:`Intelligence`,icon:p,shortcut:6},{id:`trends`,label:`Trends`,eyebrow:`Telemetry`,description:`Cost, token and tool activity over time.`,group:`Intelligence`,icon:n,shortcut:7},{id:`brain`,label:`Brain`,eyebrow:`Decisions`,description:`Autonomous decisions, escalations and interventions.`,group:`Intelligence`,icon:u,shortcut:8},{id:`worktree`,label:`Worktrees`,eyebrow:`Workspace`,description:`Distributed branches, worktrees and ownership state.`,group:`System`,icon:le,shortcut:9},{id:`control`,label:`Control`,eyebrow:`Command plane`,description:`Steer, queue, broadcast and audit remote commands.`,group:`System`,icon:r,shortcut:0},{id:`settings`,label:`Security`,eyebrow:`Access control`,description:`Manage the HQ browser password, authentication and active credentials.`,group:`System`,icon:h}],Mt=[`Operations`,`Intelligence`,`System`],Nt={cockpit:(0,w.lazy)(()=>Y(()=>import(`./cockpit-DvD1_FDz.js`).then(e=>({default:e.CockpitView})),__vite__mapDeps([0,1,2,3]))),fleet:(0,w.lazy)(()=>Y(()=>import(`./fleet-map-CPD0vSE4.js`).then(e=>({default:e.FleetMapView})),__vite__mapDeps([4,1,2,5,3,6]))),console:(0,w.lazy)(()=>Y(()=>import(`./live-console-BqDIM7Cs.js`).then(e=>({default:e.LiveConsoleView})),__vite__mapDeps([7,1,2,3,6,5]))),mailbox:(0,w.lazy)(()=>Y(()=>import(`./mailbox-E7puE59T.js`).then(e=>({default:e.MailboxView})),__vite__mapDeps([8,1,2,3,9]))),kanban:(0,w.lazy)(()=>Y(()=>import(`./kanban-C9jQWM2T.js`).then(e=>({default:e.KanbanView})),__vite__mapDeps([10,1,2,3]))),cost:(0,w.lazy)(()=>Y(()=>import(`./cost-CE_P6ujW.js`).then(e=>({default:e.CostView})),__vite__mapDeps([11,1,2,3]))),brain:(0,w.lazy)(()=>Y(()=>import(`./brain-D5R8R8BY.js`).then(e=>({default:e.BrainView})),__vite__mapDeps([12,1,2,3,9]))),worktree:(0,w.lazy)(()=>Y(()=>import(`./worktree-D0pa1IH5.js`).then(e=>({default:e.WorktreeView})),__vite__mapDeps([13,1,2,3,9]))),trends:(0,w.lazy)(()=>Y(()=>import(`./trends-DqAtNjBm.js`).then(e=>({default:e.TrendsView})),__vite__mapDeps([14,1,2,3]))),alerts:(0,w.lazy)(()=>Y(()=>import(`./alerts-B_wJljmR.js`).then(e=>({default:e.AlertsView})),__vite__mapDeps([15,1,2,3]))),control:(0,w.lazy)(()=>Y(()=>import(`./control-DGfNRSfd.js`).then(e=>({default:e.ControlView})),__vite__mapDeps([16,1,2,3]))),settings:(0,w.lazy)(()=>Y(()=>import(`./settings-DMQf2eO5.js`).then(e=>({default:e.SettingsView})),__vite__mapDeps([17,1,2,3])))};function Pt(e){return X.find(t=>t.id===e)??X[0]}var Ft=class extends w.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}componentDidUpdate(e){e.view!==this.props.view&&this.state.error!==null&&this.setState({error:null})}render(){return this.state.error===null?this.props.children:(0,R.jsxs)(`div`,{className:`hq-view-error`,role:`alert`,children:[(0,R.jsx)(ce,{size:22}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`strong`,{children:`This HQ surface stopped safely.`}),(0,R.jsx)(`p`,{children:this.state.error})]}),(0,R.jsxs)(`button`,{type:`button`,className:`hq-btn secondary`,onClick:()=>this.setState({error:null}),children:[(0,R.jsx)(y,{size:13}),`Retry view`]})]})}};function It(){let{snapshot:e,alerts:t,activeView:n,authRequired:r,connected:i}=z(O(e=>({snapshot:e.snapshot,alerts:e.alerts,activeView:e.activeView,authRequired:e.authRequired,connected:e.connected}))),[s,c]=(0,w.useState)(()=>typeof window>`u`||window.innerWidth>=1180),[l,u]=(0,w.useState)(null),[d,f]=(0,w.useState)(null),[ne,m]=(0,w.useState)(!1),{theme:h}=yt().appearance,g=(0,w.useRef)(!1),_=(0,w.useRef)(!1);if((0,w.useEffect)(()=>{_.current&&i===!1?L.getState().addToast(`Connection lost — reconnecting with backoff…`,`warning`,4e3):_.current&&g.current===!1&&i===!0&&L.getState().addToast(`Reconnected to HQ server`,`success`,3e3),i&&(_.current=!0),g.current=i},[i]),(0,w.useEffect)(()=>(document.documentElement.dataset.hqTheme=h,()=>{delete document.documentElement.dataset.hqTheme}),[h]),(0,w.useEffect)(()=>{let e=!1;return B(`/api/snapshot`).then(t=>{e||z.getState()._hydrateSnapshot(t)}).catch(()=>{}),()=>{e=!0}},[]),(0,w.useEffect)(()=>{let e=!1;return B(`/api/auth/status`).then(t=>{e||f(t)}).catch(()=>{}),()=>{e=!0}},[]),(0,w.useEffect)(()=>{let e=!1,t=()=>{B(`/api/system/update`).then(t=>{e||u(t)}).catch(()=>{})};t();let n=window.setInterval(t,jt);return()=>{e=!0,window.clearInterval(n)}},[]),(0,w.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`b`){e.preventDefault(),c(e=>!e);return}if(e.altKey&&/^\d$/.test(e.key)){let t=Number(e.key),n=X.find(e=>e.shortcut===t);n&&(e.preventDefault(),z.getState().setActiveView(n.id));return}e.key===`Escape`&&s&&window.innerWidth<900&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]),r)return(0,R.jsx)(Tt,{hadToken:P()!==null});let v=e?.totals,ce=v?.unreadMailboxMessages??0,le=t.filter(e=>e.severity!==`info`).length,y=Pt(n),de=y.icon,fe=Nt[n],pe=e=>{z.getState().setActiveView(e),window.innerWidth<900&&c(!1)},b=async()=>{m(!0);try{await F(`/api/logout`,{method:`POST`})}finally{N(),window.location.reload()}};return(0,R.jsxs)(`div`,{className:`hq-app`,"data-theme":h,"data-testid":`hq-workbench`,children:[(0,R.jsx)(`button`,{type:`button`,className:`hq-sidebar-scrim`,"data-open":s,"aria-label":`Close HQ navigation`,onClick:()=>c(!1)}),(0,R.jsxs)(`aside`,{className:`hq-secondary-nav`,"data-open":s,"aria-label":`HQ navigation`,children:[(0,R.jsxs)(`div`,{className:`hq-secondary-header`,children:[(0,R.jsxs)(`div`,{className:`hq-secondary-brand`,children:[(0,R.jsx)(`img`,{src:`/wrongstack.svg`,alt:``,"aria-hidden":`true`,draggable:!1}),(0,R.jsxs)(`div`,{className:`hq-secondary-copy`,children:[(0,R.jsx)(`span`,{className:`hq-secondary-eyebrow`,children:`Command center`}),(0,R.jsx)(`strong`,{children:`WrongStack HQ`})]})]}),(0,R.jsx)(`button`,{type:`button`,className:`hq-icon-button hq-secondary-close`,"aria-label":`Collapse HQ navigation`,title:`Collapse navigation (Ctrl+B)`,onClick:()=>c(!1),children:(0,R.jsx)(a,{size:16})})]}),(0,R.jsx)(`div`,{className:`hq-secondary-scroll`,children:Mt.map(e=>(0,R.jsxs)(`section`,{className:`hq-nav-group`,children:[(0,R.jsx)(`div`,{className:`hq-nav-group-label`,children:e}),X.filter(t=>t.group===e).map(e=>{let t=e.icon,r=e.id===`mailbox`?ce:e.id===`alerts`?le:0;return(0,R.jsxs)(`button`,{type:`button`,className:`hq-nav-item`,"data-active":n===e.id,"aria-current":n===e.id?`page`:void 0,onClick:()=>pe(e.id),children:[(0,R.jsx)(t,{size:15}),(0,R.jsx)(`span`,{children:e.label}),e.shortcut===void 0?null:(0,R.jsxs)(`kbd`,{children:[`Alt+`,e.shortcut]}),r>0?(0,R.jsx)(`span`,{className:`hq-nav-badge`,children:r}):null]},e.id)})]},e))}),(0,R.jsxs)(`div`,{className:`hq-secondary-footer`,children:[(0,R.jsxs)(`div`,{className:`hq-link-state`,"data-live":i,children:[(0,R.jsx)(`span`,{className:`hq-link-dot`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`strong`,{children:i?`Connected`:`Reconnecting`}),(0,R.jsxs)(`span`,{children:[v?.activeMachines??0,` machines · `,v?.activeClients??0,` clients`]})]})]}),(0,R.jsx)(`span`,{className:`hq-build-label`,children:`@wrongstack/webui-hq`})]})]}),(0,R.jsxs)(`section`,{className:`hq-workbench`,"data-update-available":l?.outdated===!0,children:[(0,R.jsxs)(`header`,{className:`hq-header`,children:[(0,R.jsx)(`button`,{type:`button`,className:`hq-icon-button hq-sidebar-toggle`,"aria-label":s?`Collapse HQ navigation`:`Expand HQ navigation`,"aria-expanded":s,title:`Toggle navigation (Ctrl+B)`,onClick:()=>c(e=>!e),children:s?(0,R.jsx)(a,{size:17}):(0,R.jsx)(te,{size:17})}),(0,R.jsx)(`div`,{className:`hq-view-icon`,"aria-hidden":`true`,children:(0,R.jsx)(de,{size:18})}),(0,R.jsxs)(`div`,{className:`hq-view-identity`,children:[(0,R.jsx)(`span`,{children:y.eyebrow}),(0,R.jsx)(`h1`,{children:y.label}),(0,R.jsx)(`p`,{children:y.description})]}),(0,R.jsxs)(`div`,{className:`hq-top-metrics`,children:[(0,R.jsx)(Z,{icon:re,label:`Machines`,value:v?.activeMachines??0}),(0,R.jsx)(Z,{icon:se,label:`Agents`,value:v?.activeAgents??0}),(0,R.jsx)(Z,{icon:o,label:`Sessions`,value:v?.activeSessions??0}),(0,R.jsx)(Z,{icon:p,label:`Cost`,value:`$${(v?.totalCostUsd??0).toFixed(2)}`,accent:!0})]}),(0,R.jsxs)(`div`,{className:`hq-connection-pill`,"data-live":i,children:[i?(0,R.jsx)(ae,{size:13}):(0,R.jsx)(ie,{size:13}),i?`Live`:`Reconnecting`]}),(0,R.jsx)(`button`,{type:`button`,className:`hq-icon-button hq-theme-toggle`,"aria-label":`Switch to ${h===`dark`?`light`:`dark`} mode`,title:`Switch to ${h===`dark`?`light`:`dark`} mode`,onClick:()=>xt({theme:h===`dark`?`light`:`dark`}),children:h===`dark`?(0,R.jsx)(ue,{size:16}):(0,R.jsx)(oe,{size:16})}),d?.tokenMode||d?.passwordMode?(0,R.jsx)(`button`,{type:`button`,className:`hq-icon-button`,"aria-label":`Log out of HQ`,title:`Log out and clear this tab's HQ credentials`,disabled:ne,onClick:()=>void b(),children:(0,R.jsx)(ee,{size:16})}):null]}),l?.outdated?(0,R.jsx)(Lt,{status:l}):null,(0,R.jsx)(`main`,{className:`hq-main`,id:`hq-main`,tabIndex:-1,children:(0,R.jsx)(Ft,{view:n,children:(0,R.jsx)(w.Suspense,{fallback:(0,R.jsx)(Rt,{label:y.label}),children:(0,R.jsx)(fe,{})})})})]}),(0,R.jsx)(ct,{})]})}function Lt({status:e}){let[t,n]=(0,w.useState)(!1),r=async()=>{try{await navigator.clipboard.writeText(e.command),n(!0),window.setTimeout(()=>n(!1),1500)}catch{n(!1)}};return(0,R.jsxs)(`aside`,{className:`hq-update-notice`,role:`status`,"aria-live":`polite`,children:[(0,R.jsx)(m,{size:16,"aria-hidden":`true`}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`strong`,{children:`WrongStack update available`}),(0,R.jsxs)(`span`,{children:[`v`,e.current,` → v`,e.latest,`. Run `,(0,R.jsx)(`code`,{children:e.command}),` in your terminal, then restart HQ.`]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void r(),title:`Copy update command`,children:[(0,R.jsx)(_,{size:13,"aria-hidden":`true`}),t?`Copied`:`Copy command`]})]})}function Z({icon:e,label:t,value:n,accent:r=!1}){return(0,R.jsxs)(`div`,{className:`hq-top-metric`,"data-accent":r,children:[(0,R.jsx)(e,{size:12}),(0,R.jsx)(`span`,{children:t}),(0,R.jsx)(`strong`,{children:n})]})}function Rt({label:e}){return(0,R.jsxs)(`div`,{className:`hq-view-loading`,role:`status`,children:[(0,R.jsx)(r,{size:18}),(0,R.jsxs)(`span`,{children:[`Loading `,e,`…`]})]})}var zt=25e3,Bt=1e4,Vt=3e4,Ht=class{ws=null;handlers=new Set;stateHandlers=new Set;reconnectAttempt=0;connectionState=me();reconnectTimer=null;heartbeatTimer=null;lastMessageAt=0;stopped=!1;_state=`disconnected`;url;maxRetries;heartbeatIntervalMs;heartbeatTimeoutMs;maxBackoffMs;constructor(e){if(this.maxRetries=e?.maxRetries??1/0,this.heartbeatIntervalMs=e?.heartbeatIntervalMs??zt,this.heartbeatTimeoutMs=e?.heartbeatTimeoutMs??Bt,this.maxBackoffMs=e?.maxBackoffMs??Vt,e?.url)this.url=e.url;else{let e=typeof window<`u`?window.location:{host:`127.0.0.1:3499`,protocol:`http:`},t=e.protocol===`https:`?`wss:`:`ws:`,n=P(),r=`${t}//${e.host}/ws/browser`;this.url=n===null?r:`${r}?token=${encodeURIComponent(n)}`}}get state(){return this._state}get isConnected(){return this.ws?.readyState===WebSocket.OPEN}connect(){if(this.stopped||this.ws!==null)return;this.connectionState=he(this.connectionState),this.emitState(`connecting`);let e;try{e=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{this.reconnectAttempt=0,this.connectionState=ge(this.connectionState),this.lastMessageAt=Date.now(),this.connectionState=_e(this.connectionState,this.lastMessageAt),this.emitState(`connected`),this.startHeartbeat()},e.onmessage=e=>{this.lastMessageAt=Date.now();try{let t=JSON.parse(typeof e.data==`string`?e.data:``);for(let e of this.handlers)try{e(t)}catch{}}catch{}},e.onclose=()=>this.handleClose(`close`),e.onerror=()=>this.handleClose(`error`)}close(){this.stopped=!0,this.connectionState=ve(this.connectionState),this.stopHeartbeat(),this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws?.close(1e3,`client closed`),this.ws=null,this.emitState(`disconnected`)}on(e){return this.handlers.add(e),()=>this.handlers.delete(e)}onStateChange(e){return this.stateHandlers.add(e),e(this._state),()=>this.stateHandlers.delete(e)}handleClose(e){this.ws!==null&&(this.ws=null,this.stopHeartbeat(),this.scheduleReconnect())}scheduleReconnect(){if(this.stopped||this.reconnectTimer!==null)return;let e=ye(this.connectionState,{...b,maxReconnectAttempts:this.maxRetries,maxBackoffMs:this.maxBackoffMs,heartbeatIntervalMs:this.heartbeatIntervalMs,heartbeatTimeoutMs:this.heartbeatTimeoutMs,jitterRatio:.5});if(this.connectionState=e.state,this.reconnectAttempt=e.state.reconnectAttempt,!e.plan){this.emitState(`disconnected`);return}this.emitState(`reconnecting`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e.plan.delayMs)}get isHeartbeatTimedOut(){return this.ws===null||be(this.connectionState,{...b,heartbeatIntervalMs:this.heartbeatIntervalMs,heartbeatTimeoutMs:this.heartbeatTimeoutMs})}startHeartbeat(){this.stopHeartbeat(),this.lastMessageAt=Date.now(),this.heartbeatTimer=setInterval(()=>{this.isHeartbeatTimedOut&&this.ws!==null&&(this.ws.close(4e3,`heartbeat timeout`),this.ws=null,this.scheduleReconnect())},this.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer!==null&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}emitState(e){this._state=e;for(let t of this.stateHandlers)try{t(e)}catch{}}},Q=null;function Ut(){return Q===null&&(Q=new Ht,Q.connect()),Q}var $=document.getElementById(`root`);$!==null&&$e().finally(()=>{Ye();let e=Ut();e.onStateChange(e=>{z.getState()._setConnected(e===`connected`)}),e.on(e=>{if(e.type===`hq.snapshot`){let t=Ve(e);t&&z.getState()._onSnapshot(t.snapshot)}else if(e.type===`hq.event`){let t=He(e);t&&z.getState()._onEvent(t.event)}else if(e.type===`hq.alert`){let t=Ue(e);t&&z.getState()._onAlert(t.alert)}else if(e.type===`hq.command_status`){let t=We(e);t&&z.getState()._onCommandStatus(t.command)}}),(0,Ge.createRoot)($).render((0,R.jsx)(w.StrictMode,{children:(0,R.jsx)(It,{})}))});export{yt as a,dt as c,N as d,O as f,wt as i,z as l,bt as n,B as o,St as r,ft as s,Ct as t,F as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(data:font/woff2;base64,d09GMgABAAAAAAn4ABMAAAAAEwQAAAmOAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjQbgnQcLj9IVkFSgQEGYD9TVEFUgQIAgQovahEICok0h0ULIAAwhzoBNgIkAzwEIAWHJgeBDgwHG6QQUdRKTmoBFD8K42bniObKrG3LZFcMWZzFmrjTFhQ6TVTqPJcInrfrvzq3b2PGn1wwMiNYGTy9ViREYARlL1zAGcPdPqBt3gNWrfKthv4xnM+b9caw+wmjgEUVRjHXhS6jgCK6zf5HiWQacJpGdAgdrbV6g/Rf1BfxRqZVQnrxRVWSJb6RLFnyu0elilmjeoSQCKnxsmwLaddUMjnksriSYuuPl06EAl7KfAiWQjCUETz0zNZ3EII94CDQtzkMfZ/9IkkY8tZRZTDky5ZVwBAM+GYpdd4ZVAWYImnLkiTg48l79gGx3D+VBtLeyg8u7bJAd4uo0pFuQBFysE9C95l0W4Fkiao6GfrDbu77lVU7wk9cV3uqOsXmQiMkhVKl1ugjzUAJBSIkkVWHijkpkVSyUFsgVBuJMA0N+ZnXtyUv5yMigGdfQRmwL1AAjQ3YXG6iIFNSUdPQo8+AISPGAltBMDQRAtyf4ZspLlZkpyOVoMZPvFGWzvk8p5SUC/NWPMj6T2/Yas2EdlON5GkfdkeFwVGjta825H89NIenlLWAPAp5h1KDtRhCaAQWMsFKtEvOKpIhgLHlXPARokkgEGEOAkqxJRQpKYq4ezahIiLHP6hZpqMbV0pUF2vdvEimLEQ/iIUYLgYWs0VXGVlLTOPdaPmFfCC/XrtzqVo1ez7vz6+Kd2+7o11ZJ+4MreLbB5BKVGxobAq4jZYalZ5aX2CKJiwUuc9GNJyi4M8bGyKcdjSRrG4JohdF8buJfmQefbYYREnMFsOoiNliFDVxmRgL0XUmUMLqzW0A4gCQAhWGYCQpFNukwXhIkPMsbRI19ewtw8Cp2Wj/Ro5cM2OTAbJAvZ/L4opBXb9+UHscYuOKM/W8isgwN26Exexjizmfnlp9dE3hOSqdZ/F5QqbckIlPb+oKfXxd6hftJ7Sm/uyPYpONza84CRlMNk/uhOrLpyf53982++zRkXNu3g3VF8qFbx1+7fbHZ9DrB3VXWNSmhnT2vrwS1+1Z+kHGBaZIhnnvuLBTNDeA340D1DWu5/jEa9pVfl6+Jij+yo3EELNixXCLjr173Q5eDP7Y7/L4iQFHbjpaJLFoP4cCsYP6sAPL7gMHNg53yYjqxqTDrYqLDl5DzW/eTLjYxCvucprjI3yl2ykKowKUC2Ox2FJLFo6Fa1HBWLC2jMCIIBEmklkYhmkpmBhTm/LCvJAH5oGcMKcgFEP1xUdho8ANPa6RFD99/PN60fjj9eXy2Eex4B5MpmRapXidzFk1p4uLk3+hn6jAP9ovJcXPPwk8o/0ltizbdbnTprvx4PSxT0VZ3Xc772aN7RflgbXRYwc3hLNO+k878nxGwfuVM8m8Gs7WEoVGWLHwSpx4vNSHBCMNqJ4m15Kp/TfHHVkQd++eY7PGN4W5byTs+6Ft8Ozvb/D60btv37de8ER0mS3P/0sLW84qGjEVkwztPzz06eGUWwKLwPb0D/WFd3vltl2aP276KpM0JNz6AfnAnZ5ADlF2zVyZ2OkxHSMxWPMnSZLbbDR3F1UjPVqp4d68da13F1YZujdWw7271iecO2l9+/4p47Oztjck355/75wFOI+VdGDqbNGs+ISgxg3iB2jb2r+b0CWsNLHIM4sdv8SDSFBP/Oromz6FNCWw2iMTxV0R8QLyBTkpe0j5+pSSJOOTB5Mck/gh3IopuNQnhKj02t3FL80gGbEh89SZcwTxcYt5cZT/nMnB3uXfPy8BSpVMBuRx+ZhACGzDBmwHsJRAjhotOnzuj2wDz3ug2wOUAY2NgZln9/TK/enG/oE4rO1wxvGUFMAxsZ0qNjRC7hl9d17e7imbgDt6uJXhUobDg7v3RX/yRCKxgMhfyiKcZfbpk0wmCcdQlIAOHeakXLvCNt++WfKiozNqSZxxJotn+c0a7DdPsx7DPYgKIDxwwYUZDg9aJbxocTjcwovr9WAsVV32mQoiiIOCHc60Oltst9qCQYuCqN1yHo0Kj60OgI2OqmiuBUWrNA0NDhYCDcdpmMrs1fZZ0xdTzMr1HdPtIHstYhqaPDDA5YxUDx7J4fJiisBSDI/L6G/bn34GNy8Q2g044ZTulAdFLb0tI6NNxfj3DzLjWiNGxje1pz7aXOcNV68lDPEd2SXl6VfBuwmHzdf1gxFy1HvA7pD8I2BnnmyGw852Cg5XbgIdEEGE5UCzen5jTlG6JCU5iajlxVcsXvbcS0SAcg1dcesWJLVK8+hYHOYQ+Pjy+EyVGXP0aPTFagrV9E03hCQvYx+g47KGq+1GsLj8uBIyihNw33YUe8PNC4BOJ3Lm1AglLV3nCuvUdIP+v15tVGbWIwgxLVpPkfpthCGpTKG+oA/DQfsKKvxhScqaN6FuElAUtTKv2UYgOmQegsN/n7njHUju8wM4VTcm+Q8xfX9SFwjTzdVqu95UOWSIGOabH8OGBEba//8Yxl3GcPdP/dMBOoSX/0z5SZmBoLbaPs+9asaMpb36yknKaw6FqWZa6A5vDa02mhkOba1q6KtLV208xrkwmW5C4VD6n2fvRjADy2qDYYnNy+H10Fq0LMbNzS863gkO7iQ8eC48/Ny5m59tOcEso3u7Qg3yrqDL6eKXwJAuWnhylfbWrRObe66rzX59+XDtzusnL66dI/86ArmtLlzED860Ef3bFPV78OX/zFTA11fcBn2Vntb7qiGBSgLBHyuv/uEaqqoTgSpOyjlzh86me1Vriv7i9rLPLvtghWmSnblRbAsBJL/4dScSQTBxOivHMO5QvBBY0iheJvfwWLxLOGzYKZyM4zVc2Cll46zEpeUV4MqGEWZj22SdOxhGAjgs9AEnfT+RoiMfcDb0GS5NncKVxju4Nt/mRk13O9Gz3FLct5oCD6wkwUNrCfHIUg6SMf8LwQGyVaBUqpLPW5BaMpRshEpl8nS1qw5dgnzlik8QBXmdy5UrIH74heTKZKMSilQso4hsRiGraQZRzxpNGqlEJMsXuAU7GlcR8mWSykUpVkWGyIf0a8v4qEQp5CtGsMiZa+4ESYQy+WilCiguHzxMXO54ogShooTV2bj2z1zL6DYSoImoQ8lFUWxMLBNQQgLkV2tHYgUoIbkuREz+fJHKxxWBcnvu3KQppFCxLkguB1NyVSp/TknRvNwYlCdbblWu3ze6owHdWluhE5tgQ6ej2SV65CijijoaRfSiH4Nqz1OpfEW+WeI/oU0ly60zkV9YzOQSYtZVEGYmrysTZAJkY4qZtIBD9/LYTIK7Nww3vMiYBwA=)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/manrope-cyrillic-wght-normal-Dvxsihut.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/manrope-greek-wght-normal-DL7QRZyv.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/manrope-vietnamese-wght-normal-usUDDRr7.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Manrope Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/manrope-latin-wght-normal-DHIcAJRg.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Space Grotesk Variable;font-style:normal;font-display:swap;font-weight:300 700;src:url(/assets/space-grotesk-vietnamese-wght-normal-D0rl6rjA.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Space Grotesk Variable;font-style:normal;font-display:swap;font-weight:300 700;src:url(/assets/space-grotesk-latin-ext-wght-normal-D9tNdqV9.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Space Grotesk Variable;font-style:normal;font-display:swap;font-weight:300 700;src:url(/assets/space-grotesk-latin-wght-normal-BhU9QXUp.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--xy-node-boxshadow-selected-default:0 0 0 .5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#555;--xy-background-pattern-lines-color-default:#333;--xy-background-pattern-cross-color-default:#333;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--xy-node-boxshadow-selected-default:0 0 0 .5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;color:var(--xy-node-color,var(--xy-node-color-default));text-align:center;border:var(--xy-node-border,var(--xy-node-border-default));background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));padding:10px;font-size:12px}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(--xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default)));color:var(--xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default)))}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)))}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}:root{color-scheme:dark;--bg:#1b1c1a;--bg2:color-mix(in srgb, var(--bg) 92%, var(--panel));--panel:#22231f;--panel2:color-mix(in srgb, var(--panel) 88%, var(--text));--inset:var(--bg);--border:color-mix(in srgb, var(--primary) 46%, var(--panel));--border2:color-mix(in srgb, var(--accent2) 40%, var(--text));--text:#f5f2e9;--bright:#fffdf8;--muted:#b6b2a8;--dim:color-mix(in srgb, var(--muted) 70%, var(--bg));--primary:#fe2e5f;--primary-dim:color-mix(in srgb, var(--primary) 68%, var(--bg));--accent2:#fd9f02;--cyan:var(--primary);--green:#2ac075;--amber:var(--accent2);--red:#df4949;--purple:#a685f4;--accent:var(--amber);--chart-1:var(--primary);--chart-2:var(--accent2);--chart-3:var(--green);--flow-node-bg:color-mix(in srgb, var(--panel) 86%, var(--bg));--flow-node-shadow:0 8px 24px #12121059;--flow-machine-border:color-mix(in srgb, var(--primary) 52%, transparent);--flow-project-border:color-mix(in srgb, var(--accent2) 50%, transparent);--flow-terminal-border:color-mix(in srgb, var(--text) 36%, transparent);--flow-agent-border:color-mix(in srgb, var(--green) 38%, transparent);--flow-selected-ring:color-mix(in srgb, var(--primary) 30%, transparent);--flow-selected-shadow:color-mix(in srgb, var(--primary) 24%, transparent);--flow-edge:color-mix(in srgb, var(--primary) 46%, transparent);--flow-edge-live:color-mix(in srgb, var(--green) 75%, transparent);--flow-grid:color-mix(in srgb, var(--text) 12%, transparent);--fg:var(--text);--surface:var(--panel);--danger:var(--red);--ring:var(--accent2);--radius:0;--radius-sm:0;--radius-md:0;--radius-lg:0;--radius-xl:0;--radius-full:0;--font-sans:"Manrope Variable", "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;--font-display:"Space Grotesk Variable", "Space Grotesk", "Manrope Variable", system-ui, sans-serif;--font-mono:"IBM Plex Mono", "JetBrains Mono", Consolas, "Cascadia Mono", monospace;--shadow:0 1px 2px #12121080, 0 4px 16px #12121059}:root[data-hq-theme=light]{color-scheme:light;--bg:#f8f6f0;--bg2:color-mix(in srgb, var(--bg) 92%, var(--fg));--panel:#fffdf8;--panel2:color-mix(in srgb, var(--panel) 90%, var(--fg));--inset:color-mix(in srgb, var(--bg) 88%, var(--fg));--border:color-mix(in srgb, var(--primary) 52%, var(--panel));--border2:color-mix(in srgb, var(--accent2) 42%, var(--fg));--text:#171714;--bright:#171714;--muted:#646159;--dim:color-mix(in srgb, var(--muted) 78%, var(--panel));--primary:#d51f4d;--primary-dim:color-mix(in srgb, var(--primary) 72%, var(--bg));--accent2:#d97706;--cyan:var(--primary);--green:#18864f;--amber:var(--accent2);--red:#c02626;--purple:#5f37be;--accent:var(--amber);--chart-1:var(--primary);--chart-2:var(--accent2);--chart-3:var(--green);--flow-node-bg:color-mix(in srgb, var(--panel) 98%, transparent);--flow-node-shadow:0 8px 24px color-mix(in srgb, var(--fg) 16%, transparent);--flow-machine-border:color-mix(in srgb, var(--primary) 52%, transparent);--flow-project-border:color-mix(in srgb, var(--accent2) 56%, transparent);--flow-terminal-border:color-mix(in srgb, var(--text) 38%, transparent);--flow-agent-border:color-mix(in srgb, var(--green) 42%, transparent);--flow-selected-ring:color-mix(in srgb, var(--primary) 24%, transparent);--flow-selected-shadow:color-mix(in srgb, var(--primary) 14%, transparent);--flow-edge:color-mix(in srgb, var(--primary) 52%, transparent);--flow-edge-live:color-mix(in srgb, var(--green) 72%, transparent);--flow-grid:color-mix(in srgb, var(--text) 14%, transparent);--shadow:0 1px 2px color-mix(in srgb, var(--fg) 12%, transparent), 0 8px 24px color-mix(in srgb, var(--fg) 12%, transparent)}*,:before,:after{box-sizing:border-box;border-radius:var(--radius)}html,body,#root{height:100%;margin:0}body{font-family:var(--font-sans);background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;letter-spacing:-.012em;font-size:13.5px;line-height:1.5;overflow:hidden}h1,h2,h3,h4{font-family:var(--font-display);letter-spacing:-.02em}button,input,select,textarea{font:inherit}button{color:inherit}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--primary);outline-offset:1px}::selection{background:#fe2e5f4d}a{color:var(--primary)}.hq-app{background:var(--bg);grid-template-columns:auto minmax(0,1fr);height:100vh;display:grid;overflow:hidden}.hq-sidebar-scrim{display:none}.hq-secondary-nav{z-index:20;border-right:1px solid var(--border);background:var(--bg2);flex-direction:column;width:232px;min-width:0;min-height:0;transition:width .15s;display:flex;position:relative;overflow:hidden}.hq-secondary-nav[data-open=false]{border-right-width:0;width:0}.hq-secondary-header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:flex-start;gap:10px;width:232px;min-height:70px;padding:12px 10px 10px 14px;display:flex}.hq-secondary-brand{flex-direction:row;align-items:center;gap:9px;min-width:0;display:flex}.hq-secondary-brand>img{border:1px solid var(--border);object-fit:cover;width:40px;height:40px;image-rendering:pixelated;user-select:none;flex:0 0 40px;display:block}.hq-secondary-copy{flex-direction:column;min-width:0;display:flex}.hq-secondary-header strong,.hq-brand{color:var(--bright);font-family:var(--font-display);letter-spacing:-.02em;white-space:nowrap;font-size:15px;font-weight:650}.hq-secondary-eyebrow{color:var(--primary);letter-spacing:.14em;text-transform:uppercase;white-space:nowrap;font-size:9px;font-weight:700}.hq-icon-button{border:1px solid var(--border);background:var(--inset);width:30px;height:30px;color:var(--muted);cursor:pointer;flex:0 0 30px;place-items:center;display:inline-grid}.hq-icon-button:hover{border-color:var(--border2);background:var(--panel2);color:var(--bright)}.hq-secondary-scroll{scrollbar-color:var(--border2) transparent;scrollbar-width:thin;flex:1;width:232px;min-height:0;padding:10px 8px 14px;overflow-y:auto}.hq-nav-group+.hq-nav-group{margin-top:14px}.hq-nav-group-label{color:var(--dim);letter-spacing:.14em;text-transform:uppercase;padding:0 6px 5px;font-size:9px;font-weight:700}.hq-nav-item{width:100%;min-height:34px;color:var(--muted);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:5px 7px;display:grid}.hq-nav-item:hover{border-color:var(--border);background:var(--panel);color:var(--bright)}.hq-nav-item[data-active=true]{color:var(--bright);background:#fe2e5f1a;border-color:#fe2e5f73}.hq-nav-item:where([data-active=true])>svg{color:var(--primary)}.hq-nav-item>span:first-of-type{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:12px;font-weight:600;overflow:hidden}.hq-nav-item kbd{color:var(--dim);font-family:var(--font-mono);font-size:8px}.hq-nav-badge{background:var(--amber);color:#171714;min-width:17px;font-family:var(--font-mono);text-align:center;padding:0 4px;font-size:9px;font-weight:700;line-height:16px}.hq-secondary-footer{border-top:1px solid var(--border);width:232px;padding:10px 12px}.hq-link-state{align-items:center;gap:8px;display:flex}.hq-link-dot{background:var(--red);flex:0 0 7px;width:7px;height:7px}.hq-link-state[data-live=true] .hq-link-dot{background:var(--green)}.hq-link-state>div{flex-direction:column;min-width:0;display:flex}.hq-link-state strong{color:var(--text);font-size:10px}.hq-link-state span{color:var(--dim);font-family:var(--font-mono);font-size:8px}.hq-build-label{color:var(--dim);font-family:var(--font-mono);margin-top:7px;font-size:8px;display:block}.hq-workbench{flex-direction:column;min-width:0;min-height:0;display:flex}.hq-header{z-index:10;border-bottom:1px solid var(--border);background:var(--panel);align-items:center;gap:10px;min-height:70px;padding:9px 14px;display:flex;position:relative}.hq-update-notice{border-bottom:1px solid color-mix(in srgb, var(--amber) 55%, var(--border));background:color-mix(in srgb, var(--amber) 10%, var(--panel));min-height:42px;color:var(--amber);align-items:center;gap:10px;padding:7px 14px;display:flex}.hq-update-notice>div{flex:1;align-items:baseline;gap:8px;min-width:0;display:flex}.hq-update-notice strong{color:var(--bright);white-space:nowrap;font-size:11px}.hq-update-notice span{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.hq-update-notice code{color:var(--bright);font-family:var(--font-mono)}.hq-update-notice button{border:1px solid color-mix(in srgb, var(--amber) 55%, var(--border));background:var(--inset);color:var(--bright);letter-spacing:.04em;text-transform:uppercase;cursor:pointer;flex:none;align-items:center;gap:6px;padding:5px 8px;font-size:9px;font-weight:700;display:inline-flex}.hq-update-notice button:hover{border-color:var(--amber)}.hq-sidebar-toggle{display:inline-grid}.hq-view-icon{border:1px solid var(--border);background:var(--bg2);width:34px;height:34px;color:var(--primary);flex:0 0 34px;place-items:center;display:grid}.hq-view-identity{gap:0;min-width:190px;display:grid}.hq-view-identity>span{color:var(--primary);letter-spacing:.14em;text-transform:uppercase;font-size:8px;font-weight:700}.hq-view-identity h1{color:var(--bright);margin:0;font-size:15px;font-weight:650;line-height:1.2}.hq-view-identity p{max-width:350px;color:var(--dim);text-overflow:ellipsis;white-space:nowrap;margin:2px 0 0;font-size:10px;overflow:hidden}.hq-top-metrics{border:1px solid var(--border);align-items:stretch;gap:0;min-width:0;margin-left:auto;display:flex}.hq-top-metric{border-right:1px solid var(--border);background:var(--inset);grid-template-columns:auto 1fr;align-content:center;gap:0 5px;min-width:88px;padding:6px 10px;display:grid}.hq-top-metric:last-child{border-right:0}.hq-top-metric svg{color:var(--dim);grid-row:1/span 2;align-self:center}.hq-top-metric>span{color:var(--dim);letter-spacing:.08em;text-transform:uppercase;font-size:8px;font-weight:700;line-height:1.1}.hq-top-metric>strong{color:var(--bright);font-family:var(--font-mono);font-size:13px;line-height:1.2}.hq-top-metric[data-accent=true]>strong{color:var(--green)}.hq-connection-pill{height:30px;color:var(--red);font-family:var(--font-mono);text-transform:uppercase;background:#e2535314;border:1px solid #e2535373;flex:none;align-items:center;gap:5px;padding:0 8px;font-size:9px;font-weight:600;display:inline-flex}.hq-connection-pill[data-live=true]{color:var(--green);background:#22c77a14;border-color:#22c77a66}.hq-stat{text-align:right;background:var(--inset);border:1px solid var(--border);border-radius:var(--radius-sm);min-width:72px;padding:4px 12px}.hq-stat-num{color:var(--bright);font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:17px;font-weight:600;line-height:1.15;display:block}.hq-stat.green .hq-stat-num{color:var(--green)}.hq-stat-label{color:var(--dim);letter-spacing:.04em;font-size:10px;display:block}.hq-main{scrollbar-width:thin;scrollbar-color:var(--border2) transparent;flex:1;min-height:0;padding:16px;overflow:auto}.hq-main>div{max-width:1480px;margin:0 auto}.hq-empty{color:var(--muted);text-align:center;border:1px dashed var(--border);border-radius:var(--radius);background:var(--panel);padding:48px 20px;font-size:13px}.hq-view-loading,.hq-view-error{border:1px solid var(--border);background:var(--panel);min-height:150px;color:var(--muted);justify-content:center;align-items:center;gap:10px;display:flex}.hq-view-loading svg{color:var(--primary);animation:1.2s ease-in-out infinite hq-loader-pulse}@keyframes hq-loader-pulse{50%{opacity:.35}}.hq-view-error{color:var(--red);border-color:#e2535373;justify-content:flex-start;padding:18px}.hq-view-error>div{flex:1;min-width:0}.hq-view-error strong{color:var(--bright)}.hq-view-error p{color:var(--muted);word-break:break-word;margin:3px 0 0}.hq-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:12px;padding:14px 16px}.hq-card-title{color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin:14px 0 8px;font-size:11px;font-weight:600}.hq-card-title:first-child{margin-top:0}.hq-row{align-items:center;gap:10px;min-width:0;padding:5px 0;display:flex}.hq-row-click{width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:var(--radius-sm);background:0 0;border:0;padding:5px 8px}.hq-row-click:hover{background:var(--panel2)}.hq-row-time{color:var(--dim);font-variant-numeric:tabular-nums;flex-shrink:0;margin-left:auto;font-size:11px}.hq-row-subtle{color:var(--dim);font-size:11.5px}.hq-row-detail{color:var(--text);word-break:break-word;margin-top:4px;font-size:12.5px}.hq-row-error{color:var(--red);word-break:break-word;font-size:12px}.hq-pill{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);color:var(--muted);white-space:nowrap;align-items:center;gap:4px;padding:1px 8px;font-size:11px;font-weight:500;line-height:1.6;display:inline-flex}.hq-pill.running,.hq-pill.active,.hq-pill.streaming,.hq-pill.streamed{color:var(--green);background:#2ac0751f;border-color:#2ac07573}.hq-pill.idle{color:var(--muted)}.hq-pill.error,.hq-pill.failed,.hq-pill.stopped,.hq-pill.critical,.hq-pill.high{color:var(--red);background:#df49491f;border-color:#df494973}.hq-pill.warn,.hq-pill.medium,.hq-pill.waiting_user{color:var(--amber);background:#f9af2f1a;border-color:#f9af2f73}.hq-pill.info,.hq-pill.low{color:var(--primary);background:#fe2e5f1a;border-color:#fe2e5f66}.hq-mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:12px}.hq-cost-amount{color:var(--green);font-family:var(--font-mono);font-variant-numeric:tabular-nums;flex-shrink:0;margin-left:auto;font-size:12px;font-weight:600}.hq-kind-icon{flex-shrink:0}.hq-kind-icon.active{color:var(--green)}.hq-kind-icon.info{color:var(--primary)}.hq-kind-icon.warn{color:var(--amber)}.hq-kind-icon.error{color:var(--red)}.hq-kind-icon.idle{color:var(--dim)}.hq-lane-head{border-bottom:1px solid var(--border);margin-bottom:4px;padding-bottom:8px}.hq-diffstat{font-size:11.5px}.hq-btn{border-radius:var(--radius-sm);background:var(--primary);color:#131316;cursor:pointer;border:1px solid #0000;align-items:center;gap:6px;padding:7px 14px;font-size:12.5px;font-weight:600;display:inline-flex}.hq-btn:hover{filter:brightness(1.08)}.hq-btn:disabled{opacity:.45;cursor:default}.hq-btn.danger{background:var(--red);color:var(--bright)}.hq-btn.secondary{background:var(--inset);color:var(--text);border-color:var(--border)}.hq-btn.secondary:hover{border-color:var(--border2);color:var(--bright);filter:none}.hq-btn.secondary.hq-btn-selected{border-color:var(--primary);color:var(--primary)}.hq-security-page{gap:14px;max-width:980px;display:grid}.hq-security-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;display:grid}.hq-security-card{border:1px solid var(--border);background:var(--panel);grid-template-columns:auto 1fr;gap:1px 9px;min-width:0;padding:12px 14px;display:grid}.hq-security-card>svg{color:var(--primary);grid-row:1/span 2;align-self:center}.hq-security-card span,.hq-security-panel-head span{color:var(--dim);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:700}.hq-security-card strong{color:var(--bright);font-family:var(--font-mono);font-size:12px}.hq-security-copy{width:max-content;color:var(--primary);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:2px 0 0;font-size:9px;font-weight:700;display:inline-flex}.hq-security-copy:hover{color:var(--bright)}.hq-security-panel{border:1px solid var(--border);background:var(--panel);padding:18px}.hq-security-panel.danger-zone{border-color:color-mix(in srgb, var(--red) 36%, var(--border))}.hq-security-panel-head{border-bottom:1px solid var(--border);justify-content:space-between;align-items:flex-start;gap:18px;padding-bottom:14px;display:flex}.hq-security-panel-head>div{min-width:0}.hq-security-panel-head>svg{color:var(--primary);flex:none}.hq-security-panel.danger-zone .hq-security-panel-head>svg{color:var(--red)}.hq-security-panel-head h2{color:var(--bright);margin:2px 0 3px;font-size:17px}.hq-security-panel-head p{max-width:700px;color:var(--muted);margin:0;font-size:11px}.hq-security-message{border:1px solid color-mix(in srgb, var(--green) 45%, var(--border));background:color-mix(in srgb, var(--green) 8%, var(--inset));color:var(--green);margin-top:14px;padding:8px 10px;font-size:11px}.hq-security-message[data-tone=error]{border-color:color-mix(in srgb, var(--red) 50%, var(--border));background:color-mix(in srgb, var(--red) 8%, var(--inset));color:var(--red)}.hq-security-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:620px;padding-top:16px;display:grid}.hq-security-form label{min-width:0;color:var(--text);gap:5px;font-size:11px;font-weight:600;display:grid}.hq-security-form label:first-child:nth-last-child(4){grid-column:1/-1}.hq-security-form input{border:1px solid var(--border);background:var(--inset);width:100%;color:var(--bright);font-family:var(--font-mono);padding:8px 10px}.hq-security-form input:focus{border-color:var(--primary)}.hq-security-form small{color:var(--dim);font-size:9px;font-weight:400}.hq-security-form small[data-error]{color:var(--red)}.hq-security-actions{grid-column:1/-1;align-items:center;gap:8px;padding-top:4px;display:flex}.hq-security-actions.split{justify-content:space-between;padding-top:16px}.hq-security-confirm-remove{justify-content:flex-end;align-items:center;gap:8px;display:flex}.hq-security-confirm-remove>span{color:var(--red);font-size:10px;font-weight:650}.hq-input,.hq-textarea,.hq-select{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);width:100%;color:var(--text);padding:7px 10px;font-size:12.5px}.hq-input::placeholder,.hq-textarea::placeholder{color:var(--dim)}.hq-textarea{resize:vertical;min-height:78px;line-height:1.5;font-family:var(--font-mono);font-size:12px}.hq-label{color:var(--muted);margin-bottom:5px;font-size:11.5px;font-weight:500;display:block}.hq-grid{gap:12px;display:grid}.hq-tree-node{cursor:pointer;border-radius:var(--radius-sm);border-left:2px solid #0000;align-items:center;gap:8px;min-width:0;padding:5px 9px;display:flex}.hq-tree-node:hover{background:var(--panel2)}.hq-tree-node.sel{border-left-color:var(--primary);background:#fe2e5f14}.hq-spark{color:var(--primary);font-family:var(--font-mono);letter-spacing:-1px;font-size:12px}.hq-flow-shell{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);height:calc(100vh - 150px);min-height:520px;box-shadow:var(--shadow);flex-direction:column;display:flex;overflow:hidden}.hq-flow-toolbar{border-bottom:1px solid var(--border);background:var(--panel2);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.hq-flow-scope{border-top:1px solid var(--border);flex-wrap:wrap;flex:100%;align-items:center;gap:6px;padding-top:9px;display:flex}.hq-flow-scope-buttons,.hq-flow-layout{align-items:center;gap:6px;display:inline-flex}.hq-flow-layout .hq-btn{align-items:center;gap:5px;display:inline-flex}.hq-flow-scope .hq-btn.active{border-color:var(--primary);color:var(--bright);background:#fe2e5f1f}.hq-flow-scope-select{width:min(360px,42vw);margin-left:4px}.hq-flow-toolbar-spacer{flex:20px}.hq-flow-search{min-width:min(100%,270px);color:var(--dim);align-items:center;gap:6px;display:flex}.hq-flow-search .hq-input{width:min(340px,38vw)}.hq-flow-stats,.hq-flow-legend{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.hq-flow-canvas{background:radial-gradient(circle at 20% 10%, #fe2e5f14, transparent 28%), linear-gradient(180deg, var(--inset), var(--bg));flex:1;min-height:0;position:relative}.hq-flow-arrange{z-index:5;align-items:center;gap:6px;font-size:12px;display:inline-flex;position:absolute;top:10px;right:10px}.hq-fleet-list{border-collapse:collapse;background:var(--inset);flex:1;width:100%;min-height:0;display:block;overflow:auto}.hq-fleet-list>thead,.hq-fleet-list>tbody{display:block}.hq-fleet-list th,.hq-fleet-list td{text-align:left;min-width:0;padding:0}.hq-fleet-list-header,.hq-fleet-list-row{grid-template-columns:minmax(260px,1.2fr) minmax(160px,1fr) 105px minmax(240px,1.3fr);align-items:center;gap:10px;min-width:900px;display:grid}.hq-fleet-list-header{z-index:2;border-bottom:1px solid var(--border2);background:var(--panel2);color:var(--dim);letter-spacing:.08em;text-transform:uppercase;padding:7px 12px;font-size:10px;font-weight:700;position:sticky;top:0}.hq-fleet-list-row{border:0;border-bottom:1px solid var(--border);background:var(--panel);width:100%;color:var(--text);font:inherit;text-align:left;padding:5px 12px}.hq-fleet-list-row.machine{background:var(--panel2)}.hq-fleet-list-row.project{background:color-mix(in srgb, var(--panel2) 58%, var(--panel))}.hq-fleet-list-row.clickable{cursor:pointer}.hq-fleet-list-row.clickable:hover,.hq-fleet-list-row.clickable:focus-visible{box-shadow:inset 3px 0 0 var(--primary);background:#fe2e5f17;outline:none}.hq-fleet-list-member{align-items:center;gap:8px;min-width:0;display:flex}.hq-fleet-list-member>span:last-child{min-width:0;display:grid}.hq-fleet-list-member strong,.hq-fleet-list-member small,.hq-fleet-list-context{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hq-fleet-list-member strong{font-size:11.5px}.hq-fleet-list-member small{color:var(--dim);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.hq-fleet-list-context{color:var(--muted);font-family:var(--font-mono);font-size:10px}.hq-fleet-list-chips{align-items:center;gap:5px;min-width:0;display:flex;overflow:hidden}.hq-fleet-list-empty{flex:1}@media (width<=760px){.hq-flow-search,.hq-flow-search .hq-input{width:100%}.hq-flow-toolbar-spacer{display:none}}.hq-fleet-drawer-layer{z-index:6;pointer-events:none;position:absolute;inset:0}.hq-fleet-drawer-scrim{background:0 0;border:0;width:100%;height:100%;padding:0;display:none;position:absolute;inset:0}.hq-fleet-drawer{pointer-events:auto;background:var(--panel);border-left:1px solid var(--border);flex-direction:column;width:min(440px,88%);animation:.16s ease-out hq-drawer-in;display:flex;position:absolute;top:0;bottom:0;right:0;box-shadow:-18px 0 44px #06060973}@keyframes hq-drawer-in{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}.hq-fleet-drawer-header{border-bottom:1px solid var(--border);flex-shrink:0;align-items:center;gap:8px;padding:10px 12px;display:flex}.hq-fleet-drawer-title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;font-weight:600;overflow:hidden}.hq-fleet-drawer-actions{flex-shrink:0;align-items:center;gap:6px;margin-left:auto;display:inline-flex}.hq-fleet-drawer-actions .hq-btn{align-items:center;gap:5px;padding:4px 8px;font-size:11.5px;display:inline-flex}.hq-fleet-drawer-stats{border-bottom:1px solid var(--border);flex-shrink:0;align-items:center;gap:6px;padding:6px 12px;display:flex}.hq-fleet-drawer-body{border:0;border-radius:0;flex:1;min-height:0}@media (width<=900px){.hq-fleet-drawer-scrim{pointer-events:auto;background:#00000080;display:block}.hq-fleet-drawer{width:min(440px,100% - 24px)}}.hq-flow-node{background:var(--flow-node-bg);border:1px solid var(--border2);border-radius:var(--radius);width:220px;min-height:104px;box-shadow:var(--flow-node-shadow);color:var(--text);padding:11px 12px}.hq-flow-node.machine{border-color:var(--flow-machine-border)}.hq-flow-node.project{border-color:var(--flow-project-border)}.hq-flow-node.terminal{border-color:var(--flow-terminal-border)}.hq-flow-node.agent{border-color:var(--flow-agent-border)}.hq-flow-node.clickable{cursor:pointer}.hq-flow-node.clickable:hover,.react-flow__node.selected .hq-flow-node,.hq-flow-node.selected{border-color:var(--primary);box-shadow:0 0 0 1px var(--flow-selected-ring), 0 10px 28px var(--flow-selected-shadow)}.hq-flow-title{min-width:0;color:var(--bright);align-items:center;gap:8px;font-weight:700;display:flex}.hq-flow-label,.hq-flow-sub{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hq-flow-sub{color:var(--muted);font-family:var(--font-mono);margin-top:5px;font-size:11px}.hq-flow-chips{flex-wrap:wrap;gap:5px;margin-top:10px;display:flex}.hq-flow-chips .hq-pill{text-overflow:ellipsis;max-width:92px;overflow:hidden}.hq-flow-dot{border-radius:var(--radius-sm);background:var(--dim);flex-shrink:0;width:9px;height:9px;transform:rotate(45deg)}.hq-flow-dot.active{background:var(--green)}.hq-flow-dot.warn{background:var(--amber)}.hq-flow-dot.error{background:var(--red)}.hq-flow-handle{border:1px solid var(--primary);background:var(--inset);width:8px;height:8px}.hq-flow-edge .react-flow__edge-path{stroke:var(--flow-edge);stroke-width:1.6px}.hq-flow-edge.live .react-flow__edge-path{stroke:var(--flow-edge-live);stroke-width:2px}.hq-flow-canvas .react-flow__minimap.hq-flow-minimap{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-sm)}.hq-flow-canvas .react-flow__controls.hq-flow-controls{border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow);overflow:hidden}.hq-flow-canvas .react-flow__controls.hq-flow-controls button{background:var(--panel);border-bottom-color:var(--border);color:var(--text)}.hq-flow-legend{border-top:1px solid var(--border);color:var(--muted);background:var(--panel2);padding:8px 12px;font-size:11px}.hq-flow-legend span{align-items:center;gap:4px;display:inline-flex}.hq-fleet-node-icon{color:var(--muted);flex-shrink:0}.hq-fleet-agent-dot{color:var(--dim)}.hq-fleet-agent-dot.running,.hq-fleet-agent-dot.streaming{color:var(--green)}.hq-fleet-agent-dot.waiting_user{color:var(--amber)}.hq-fleet-agent-dot.error{color:var(--red)}.hq-kpi-row{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:14px;display:grid}.hq-kpi{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px}.hq-kpi-value{color:var(--bright);font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:26px;font-weight:600;line-height:1.15;display:block}.hq-kpi.hero .hq-kpi-value{font-size:34px}.hq-kpi-value.accent-cost{color:var(--green)}.hq-kpi-label{color:var(--dim);letter-spacing:.05em;text-transform:uppercase;margin-top:3px;font-size:11px;display:block}.hq-share-track{background:var(--inset);border-radius:var(--radius-sm);height:5px;margin-top:6px;overflow:hidden}.hq-share-fill{border-radius:var(--radius-sm);background:var(--chart-1);height:100%}.hq-filter-row{flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:14px;display:flex}.hq-filter-chip{cursor:pointer}.hq-filter-chip.selected{border-color:var(--primary);color:var(--primary);background:#fe2e5f1a}.hq-chart{position:relative}.hq-chart-svg{width:100%;height:auto;display:block}.hq-chart-grid{stroke:var(--border);stroke-width:1px;stroke-dasharray:2 4}.hq-chart-axis{stroke:var(--border2);stroke-width:1px}.hq-chart-ytick,.hq-chart-xtick{fill:var(--dim);font-family:var(--font-mono);font-size:10px}.hq-chart-tooltip{background:var(--panel2);border:1px solid var(--border2);border-radius:var(--radius-sm);box-shadow:var(--shadow);pointer-events:none;align-items:center;gap:8px;padding:4px 10px;font-size:12px;display:inline-flex;position:absolute;top:4px;right:8px}.hq-chart-tooltip-swatch{border-radius:var(--radius-sm);width:8px;height:8px}.hq-chart-tooltip-value{color:var(--bright);font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-weight:600}.hq-chart-tooltip-time{color:var(--dim);font-variant-numeric:tabular-nums}.hq-chart-empty{color:var(--dim);text-align:center;padding:24px;font-size:12px}.hq-toggle{width:24px;height:24px;color:var(--muted);background:var(--inset);border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;justify-content:center;align-items:center;padding:0;font-size:12px;line-height:1;display:inline-flex}.hq-toggle:hover{color:var(--bright);border-color:var(--border2)}.hq-msg-list{border-top:1px solid var(--border);flex-direction:column;gap:7px;padding-top:10px;display:flex}.hq-msg{background:var(--inset);border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 11px}.hq-msg:hover{border-color:var(--border2)}.hq-msg.done{opacity:.6}.hq-msg-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.hq-msg-head>.hq-msg-toggle{margin-left:4px}.hq-msg-icon{display:none}.hq-msg-subject{min-width:120px;color:var(--bright);text-overflow:ellipsis;white-space:nowrap;flex:180px;font-weight:600;overflow:hidden}.hq-msg-route,.hq-msg-time,.hq-msg-id{color:var(--dim);font-size:11px}.hq-msg-flag{font-size:11px;font-weight:600}.hq-msg-flag.open{color:var(--amber)}.hq-msg-flag.done{color:var(--green)}.hq-msg-body{background:var(--panel2);border:1px solid var(--border);border-radius:var(--radius-sm);margin-top:9px;padding:10px 12px}.hq-msg-pre{color:var(--text);font-family:var(--font-mono);white-space:pre-wrap;word-break:break-word;background:0 0;margin:0;padding:0;font-size:12px;line-height:1.5}.hq-msg-sublabel{color:var(--dim);text-transform:uppercase;letter-spacing:.08em;margin:10px 0 4px;font-size:10.5px;font-weight:600}.hq-msg-meta{border-top:1px dashed var(--border);color:var(--muted);flex-wrap:wrap;gap:12px;margin-top:10px;padding-top:8px;font-size:11px;display:flex}.hq-msg-meta strong{color:var(--text);margin-right:4px;font-weight:600}.hq-mailbox-modebar{flex-wrap:wrap;gap:8px;margin:0 0 12px;display:flex}.hq-mailbox-filterbar{gap:12px;display:grid}.hq-filter-section{gap:6px;display:grid}.hq-filter-chip-row{flex-wrap:wrap;gap:6px;display:flex}.hq-check{color:var(--muted);cursor:pointer;align-items:center;gap:8px;font-size:12px;display:inline-flex}.hq-check input{accent-color:var(--primary)}.hq-live-feed{border-top:0;padding-top:0}.hq-control-target{gap:10px;display:grid}.hq-control-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:11.5px;display:flex}.hq-control-meta strong{color:var(--text);margin-right:4px}.hq-control-steps{border:0;flex-wrap:wrap;gap:6px;margin:0 0 10px;padding:0;display:flex}.hq-step{border:1px solid var(--border);background:var(--inset);color:var(--dim);border-radius:var(--radius-sm);padding:3px 9px;font-size:11px;font-weight:500}.hq-step.active{color:var(--primary);background:#fe2e5f14;border-color:#fe2e5f80}.hq-card-danger{border-color:#df494980}.hq-control-warning{color:var(--amber);border-radius:var(--radius-sm);background:#f9af2f0f;border:1px dashed #f9af2f80;margin-top:10px;padding:8px 10px;font-size:12px}.hq-command-preview,.hq-command-audit{gap:10px;display:grid}.hq-audit-list{gap:8px;display:grid}.hq-audit-row{border:1px solid var(--border);background:var(--inset);border-radius:var(--radius-sm);gap:7px;padding:9px 11px;display:grid}.hq-audit-row.other-client{opacity:.55}.hq-audit-row.just-dispatched{border-color:#fe2e5fb3;animation:1.6s ease-out hq-audit-flash}@keyframes hq-audit-flash{0%{background:#fe2e5f38}to{background:var(--inset)}}.hq-control-grid{grid-template-columns:minmax(0,1fr) minmax(280px,380px);align-items:start;gap:18px;display:grid}@media (width<=1100px){.hq-control-grid{grid-template-columns:minmax(0,1fr)}}.hq-control-types{flex-wrap:wrap;gap:8px;display:flex}.hq-control-type{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);color:var(--muted);cursor:pointer;align-items:center;gap:6px;padding:6px 11px;font-size:12.5px;transition:border-color .12s,color .12s,background .12s;display:inline-flex}.hq-control-type:hover{color:var(--text);border-color:#fe2e5f80}.hq-control-type.selected{color:var(--text);background:#fe2e5f1f;border-color:#fe2e5fcc}.hq-control-type.danger{border-color:#dd3c3c59}.hq-control-type.danger:hover,.hq-control-type.danger.selected{color:var(--text);background:#dd3c3c1a;border-color:#dd3c3cbf}.hq-control-typedesc{color:var(--muted);align-items:center;gap:6px;margin-top:8px;font-size:12px;display:flex}.hq-audit-main,.hq-audit-meta{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.hq-audit-meta{color:var(--muted);font-size:11px}.hq-audit-meta strong{color:var(--text);margin-right:4px}.hq-audit-message{color:var(--text);border-top:1px dashed var(--border);white-space:pre-wrap;word-break:break-word;padding-top:7px;font-size:12px}.hq-cockpit-summary,.hq-cockpit-section{gap:10px;display:grid}.hq-cockpit-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;display:grid}.hq-cockpit-actions{border-top:1px dashed var(--border);flex-wrap:wrap;align-items:center;gap:10px;padding-top:10px;display:flex}.hq-cockpit-actions-copy{gap:4px;min-width:180px;display:grid}.hq-cockpit-actions-buttons{flex-wrap:wrap;flex:360px;gap:8px;display:flex}.hq-cockpit-alert-list,.hq-cockpit-cost-list{gap:8px;display:grid}.hq-cockpit-alert-row{border:1px solid var(--border);background:var(--inset);border-radius:var(--radius-sm);flex-wrap:wrap;align-items:center;gap:8px;padding:7px 10px;font-size:12px;display:flex}.hq-cockpit-alert-msg{color:var(--text);white-space:nowrap;text-overflow:ellipsis;flex:220px;min-width:0;overflow:hidden}.hq-cockpit-cost-row{border:1px solid var(--border);background:var(--inset);border-radius:var(--radius-sm);gap:5px;padding:9px 11px;display:grid}.hq-cockpit-cost-line{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.hq-cockpit-cost-name{font-weight:600}.hq-cockpit-cost-bar{background:var(--bg);border-radius:var(--radius-sm);height:5px;position:relative;overflow:hidden}.hq-cockpit-cost-bar>span{border-radius:var(--radius-sm);background:var(--chart-1);height:100%;display:block}.hq-cockpit-cost-meta{color:var(--muted);flex-wrap:wrap;gap:8px;font-size:11px;display:flex}.hq-console-shell{grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:14px;height:calc(100vh - 132px);min-height:320px;display:grid}.hq-workbench[data-update-available=true] .hq-console-shell{height:calc(100vh - 174px)}@media (width<=900px){.hq-console-shell{grid-template-columns:minmax(0,1fr)}.hq-fleetnav{max-height:220px}}.hq-console{flex-direction:column;min-width:0;min-height:0;display:flex}.hq-fleetnav{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg2);padding:6px;display:block;overflow-y:auto}.hq-nav-row{text-align:left;border-radius:var(--radius-sm);width:100%;color:var(--text);cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;min-width:0;padding:4px 6px;font-size:12.5px;display:flex}.hq-nav-row:hover{background:var(--inset)}.hq-nav-row:disabled{cursor:wait;opacity:.58}.hq-nav-row:disabled:hover{background:0 0}.hq-nav-row.machine{font-weight:600}.hq-nav-row.project{color:var(--muted)}.hq-nav-row.client.selected,.hq-nav-row.agent.selected{color:var(--text);background:#fe2e5f29}.hq-nav-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.hq-nav-count{color:var(--muted);background:var(--inset);border-radius:var(--radius-sm);flex-shrink:0;padding:0 6px;font-size:10px;line-height:15px}.hq-nav-caret{color:var(--muted);flex-shrink:0;transition:transform .12s}.hq-nav-caret.open{transform:rotate(90deg)}.hq-nav-caretbtn{cursor:pointer;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;width:16px;padding:0;display:inline-flex}.hq-nav-project,.hq-nav-client{padding-left:12px}.hq-nav-clientrow{align-items:center;display:flex}.hq-nav-client .hq-nav-row.agent{padding-left:28px}.hq-nav-dot{border-radius:var(--radius-sm);background:var(--muted);flex-shrink:0;width:7px;height:7px;transform:rotate(45deg)}.hq-nav-dot.active{background:#2ac075;box-shadow:0 0 5px #2ac075b3}.hq-nav-dot.warn{background:#f9af2f}.hq-nav-dot.error{background:#dd3c3c}.hq-chat-header{flex-wrap:wrap;flex-shrink:0;align-items:center;gap:10px;margin-bottom:10px;display:flex}.hq-chat-header-icon{color:var(--primary)}.hq-chat-picker{flex:0 auto;width:auto;min-width:260px;max-width:46vw}.hq-chat-sid{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:46vw;font-size:11px;overflow:hidden}.hq-chat-counts{align-items:center;gap:6px;margin-left:auto;display:flex}.hq-chat-fullbtn{padding:3px 10px;font-size:11px}.hq-chat-scroll{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg2);flex:1;min-height:0;position:relative;overflow:hidden}.hq-chat-vlist{scrollbar-width:thin;scrollbar-color:var(--border2) transparent;height:100%;padding:10px 14px}.hq-chat-rowpad{padding:5px 0}.hq-chat-jump{border-radius:var(--radius-sm);border:1px solid var(--border2);background:var(--panel2);width:34px;height:34px;color:var(--bright);cursor:pointer;box-shadow:var(--shadow);justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:14px;right:18px}.hq-chat-jump:hover{border-color:var(--primary);color:var(--primary)}.hq-console-composer{border:1px solid var(--border);background:var(--panel);box-shadow:var(--shadow);flex:none;gap:7px;margin-top:9px;padding:9px;display:grid}.hq-console-composer-head,.hq-console-compose-row,.hq-console-compose-foot{align-items:center;gap:7px;display:flex}.hq-console-composer-head{color:var(--muted);justify-content:space-between;font-size:11px}.hq-console-composer-head>span:first-child{align-items:center;gap:6px;min-width:0;display:inline-flex}.hq-console-composer-head strong{color:var(--bright);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hq-console-delivery{flex:0 0 132px;width:132px}.hq-console-subject{flex:1;min-width:0}.hq-console-interrupt{flex:none}.hq-console-message-row{align-items:stretch}.hq-textarea.hq-console-message{resize:vertical;min-height:54px;max-height:150px;font-family:var(--font-sans)}.hq-console-send{justify-content:center;min-width:86px}.hq-console-compose-foot{min-width:0;color:var(--dim);justify-content:space-between;font-size:10px}.hq-console-status{text-align:right;text-overflow:ellipsis;white-space:nowrap;max-width:62%;overflow:hidden}.hq-console-status.ok{color:var(--green)}.hq-console-status.error{color:var(--red)}.hq-confirm-layer{z-index:100;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.hq-confirm-scrim{cursor:default;background:#0a0a09ad;border:0;position:absolute;inset:0}.hq-confirm-dialog{border:1px solid var(--red);background:var(--panel);grid-template-columns:auto minmax(0,1fr);gap:12px;width:min(460px,100vw - 32px);padding:18px;display:grid;position:relative;box-shadow:0 22px 70px #00000073}.hq-confirm-danger{color:var(--red)}.hq-confirm-dialog h2{color:var(--bright);margin:0;font-size:16px}.hq-confirm-dialog p{color:var(--muted);margin:4px 0 0;font-size:12px}.hq-confirm-check,.hq-confirm-actions{grid-column:1/-1}.hq-confirm-check{border:1px solid var(--border);background:var(--inset);color:var(--text);cursor:pointer;align-items:center;gap:8px;padding:9px 10px;font-size:12px;display:flex}.hq-confirm-check input{accent-color:var(--red)}.hq-confirm-actions{justify-content:flex-end;gap:8px;display:flex}.hq-chat-turn{flex-direction:column;display:flex}.hq-chat-turn.user{align-items:flex-end}.hq-chat-turn.assistant,.hq-chat-turn.error{align-items:flex-start}.hq-chat-bubble{border:1px solid var(--border);border-radius:var(--radius);background:var(--panel);max-width:min(88%,940px);padding:9px 13px}.hq-chat-bubble.user{background:#fe2e5f12;border-color:#fe2e5f59}.hq-chat-bubble.assistant{background:var(--panel)}.hq-chat-bubble.error{background:#df49490f;border-color:#df494980}.hq-chat-role{color:var(--dim);letter-spacing:.08em;text-transform:uppercase;align-items:center;gap:8px;margin-bottom:5px;font-size:10.5px;font-weight:600;display:flex}.hq-chat-role.err{color:var(--red)}.hq-chat-clock{color:var(--dim);font-variant-numeric:tabular-nums;margin-left:auto;font-weight:400}.hq-chat-prose{color:var(--text);white-space:pre-wrap;word-break:break-word;font-size:13px;line-height:1.55}.hq-chat-turn.system{align-items:center}.hq-command-turn .hq-pill{letter-spacing:0;text-transform:lowercase}.hq-command-turn .hq-chat-role .hq-pill{margin-left:2px}.hq-chat-system-line{color:var(--dim);border:1px dashed var(--border);border-radius:var(--radius-sm);background:var(--panel);align-items:center;gap:10px;padding:2px 12px;font-size:11.5px;display:inline-flex}.hq-command-turn .hq-chat-system-line{border-color:#fe2e5f47}.hq-md{color:var(--text);word-break:break-word;font-size:13px;line-height:1.6}.hq-md>:first-child{margin-top:0}.hq-md>:last-child{margin-bottom:0}.hq-md p{margin:.5em 0}.hq-md h1,.hq-md h2,.hq-md h3,.hq-md h4{color:var(--bright);margin:.9em 0 .4em;line-height:1.3}.hq-md h1{font-size:1.25em}.hq-md h2{font-size:1.15em}.hq-md h3{font-size:1.05em}.hq-md h4{font-size:1em}.hq-md ul,.hq-md ol{margin:.4em 0;padding-left:1.4em}.hq-md li{margin:.15em 0}.hq-md li>ul,.hq-md li>ol{margin:.1em 0}.hq-md blockquote{border-left:3px solid var(--border2);color:var(--muted);margin:.5em 0;padding:2px 12px}.hq-md hr{border:0;border-top:1px solid var(--border);margin:.9em 0}.hq-md code{font-family:var(--font-mono);background:var(--inset);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.05em .35em;font-size:.92em}.hq-md pre code{background:0 0;border:0;padding:0;font-size:12px}.hq-md-table-wrap{border:1px solid var(--border);border-radius:var(--radius-sm);margin:.6em 0;overflow-x:auto}.hq-md table{border-collapse:collapse;width:100%;font-size:12.5px}.hq-md th,.hq-md td{border-bottom:1px solid var(--border);text-align:left;padding:5px 10px}.hq-md th{color:var(--muted);background:var(--inset);font-weight:600}.hq-md tr:last-child td{border-bottom:0}.hq-md-code{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);margin:.6em 0;overflow:hidden}.hq-md-code-bar{border-bottom:1px solid var(--border);background:var(--panel2);align-items:center;gap:10px;padding:3px 10px;display:flex}.hq-md-code-lang{color:var(--primary);font-family:var(--font-mono);font-size:10.5px;font-weight:600}.hq-md-code-meta{color:var(--dim);margin-right:auto;font-size:10.5px}.hq-md-code pre{max-height:40rem;font-family:var(--font-mono);scrollbar-width:thin;scrollbar-color:var(--border2) transparent;margin:0;padding:10px 12px;font-size:12px;line-height:1.55;overflow-x:auto}.hq-chat-turn.thinking{align-items:stretch}.hq-thinking-head{width:100%;color:var(--muted);text-align:left;cursor:pointer;border:1px dashed var(--border);border-radius:var(--radius-sm);background:0 0;align-items:center;gap:8px;padding:5px 10px;font-size:12px;display:flex}.hq-thinking-head:hover{border-color:var(--border2);color:var(--text)}.hq-thinking-icon{color:var(--purple);flex-shrink:0}.hq-thinking-label{letter-spacing:.08em;text-transform:uppercase;flex-shrink:0;font-size:10.5px;font-weight:600}.hq-thinking-peek{color:var(--dim);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-style:italic;overflow:hidden}.hq-thinking-body{border:1px dashed var(--border);border-radius:var(--radius-sm);color:var(--muted);border-top:0;padding:8px 12px;font-style:italic}.hq-chat-turn.tool{align-items:stretch}.hq-tool-head{width:100%;color:var(--text);text-align:left;cursor:pointer;background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:6px 10px;display:flex}.hq-chat-turn.tool.err .hq-tool-head{border-color:#df494980}.hq-tool-head:hover{border-color:var(--border2);background:var(--panel2)}.hq-tool-caret{color:var(--dim);flex-shrink:0;display:inline-flex}.hq-tool-icon{flex-shrink:0;display:inline-flex}.hq-tool-dot{border-radius:var(--radius-sm);background:var(--green);flex-shrink:0;width:7px;height:7px;transform:rotate(45deg)}.hq-tool-dot.err{background:var(--red)}.hq-tool-name{color:var(--bright);flex-shrink:0;font-size:12.5px;font-weight:600}.hq-tool-summary{color:var(--muted);font-size:12px;font-family:var(--font-mono);text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.hq-tool-dur{color:var(--dim);font-variant-numeric:tabular-nums;flex-shrink:0;margin-left:auto;font-size:11px}.hq-tool-status{flex-shrink:0;align-items:center;display:inline-flex}.hq-status-ok{color:var(--green)}.hq-status-err{color:var(--red)}.hq-tool-running-dot{border-radius:var(--radius-sm);background:var(--amber);width:8px;height:8px;animation:1.2s ease-in-out infinite hq-pulse;transform:rotate(45deg)}@keyframes hq-pulse{0%,to{opacity:1}50%{opacity:.6}}.hq-tool-body{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--panel);border-top:0;flex-direction:column;gap:10px;padding:10px 12px;display:flex}.hq-tool-section{flex-direction:column;gap:4px;display:flex}.hq-tool-section-label{color:var(--dim);letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:600}.hq-tool-section-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.hq-tool-pre{background:var(--inset);border:1px solid var(--border);border-radius:var(--radius-sm);max-height:360px;color:var(--text);font-family:var(--font-mono);white-space:pre-wrap;word-break:break-word;scrollbar-width:thin;scrollbar-color:var(--border2) transparent;margin:0;padding:8px 10px;font-size:11.5px;line-height:1.5;overflow:auto}.hq-tool-pre.term{border-left:2px solid var(--green)}.hq-tool-pre.err{color:var(--red);border-color:#df494980}.hq-tool-result-note{color:var(--muted);font-size:11.5px}.hq-tool-empty{color:var(--dim);font-size:11.5px;font-style:italic}.hq-result{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);overflow:hidden}.hq-result.bare{background:0 0;border:0;border-radius:0}.hq-result.err-frame{border-color:#df494980}.hq-result-pre{max-height:24rem;color:var(--text);font-family:var(--font-mono);scrollbar-width:thin;scrollbar-color:var(--border2) transparent;margin:0;padding:8px 10px;font-size:11.5px;line-height:1.5;overflow:auto}.hq-result-pre.wrap{white-space:pre-wrap;word-break:break-word}.hq-result-pre.nowrap{white-space:pre}.hq-result-pre.err{color:var(--red)}.hq-result-toggle{border:0;border-top:1px solid var(--border);background:var(--panel2);width:100%;color:var(--muted);cursor:pointer;justify-content:center;align-items:center;gap:5px;padding:4px 8px;font-size:11px;display:flex}.hq-result-toggle:hover{color:var(--bright)}.hq-result-jsonbar{border:0;border-bottom:1px solid var(--border);background:var(--panel2);width:100%;color:var(--muted);cursor:pointer;justify-content:space-between;align-items:center;gap:8px;padding:4px 10px;font-size:11px;display:flex}.hq-result-jsonbar:hover{color:var(--bright)}.hq-result-jsonbar-left{font-family:var(--font-mono);align-items:center;gap:5px;display:inline-flex}.hq-result-bash{flex-direction:column;display:flex}.hq-result-exit{border-top:1px solid var(--border);background:var(--panel2);color:var(--muted);font-size:11px;font-family:var(--font-mono);font-variant-numeric:tabular-nums;align-items:center;gap:12px;padding:4px 10px;display:flex}.hq-result-exit.bad{color:var(--red)}.hq-diff{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);overflow:hidden}.hq-diff-stat{border-bottom:1px solid var(--border);background:var(--panel2);font-variant-numeric:tabular-nums;gap:10px;padding:4px 10px;font-size:11px;font-weight:600;display:flex}.hq-diff-add-count{color:var(--green)}.hq-diff-del-count{color:var(--red)}.hq-diff-body{max-height:360px;font-family:var(--font-mono);scrollbar-width:thin;scrollbar-color:var(--border2) transparent;margin:0;padding:6px 0;font-size:11.5px;line-height:1.5;overflow:auto}.hq-diff-line{white-space:pre-wrap;word-break:break-word;padding:0 10px 0 0;display:block}.hq-diff-line.add{color:#90dfb8;background:#2ac07521}.hq-diff-line.del{color:#f19d9d;background:#df49491f}.hq-diff-line.ctx{color:var(--muted)}.hq-diff-line.meta{color:var(--primary);opacity:.8}.hq-diff-gutter{text-align:center;width:20px;color:var(--dim);user-select:none;display:inline-block}.hq-diff-path{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;max-width:60%;margin-right:auto;font-weight:500;overflow:hidden}.hq-todo-list{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--inset);margin:0;padding:0;list-style:none;overflow:hidden}.hq-todo{border-bottom:1px solid var(--border);align-items:baseline;gap:8px;padding:5px 10px;font-size:12.5px;display:flex}.hq-todo:last-child{border-bottom:0}.hq-todo-mark{text-align:center;flex-shrink:0;width:14px;font-weight:700}.hq-todo-text{color:var(--text);word-break:break-word}.hq-todo.completed .hq-todo-mark{color:var(--green)}.hq-todo.completed .hq-todo-text{color:var(--dim);text-decoration:line-through}.hq-todo.in_progress .hq-todo-mark{color:var(--amber)}.hq-todo.in_progress .hq-todo-text{color:var(--bright);font-weight:600}.hq-todo.pending .hq-todo-mark{color:var(--dim)}.hq-copy-btn{border:1px solid var(--border);background:var(--inset);color:var(--muted);border-radius:var(--radius-sm);letter-spacing:.04em;text-transform:uppercase;cursor:pointer;align-items:center;gap:4px;padding:2px 7px;font-size:10px;font-weight:600;line-height:1.5;display:inline-flex}.hq-copy-btn:hover{color:var(--bright);border-color:var(--border2)}@media (width<=1280px){.hq-view-identity p{display:none}.hq-top-metric{min-width:76px;padding-inline:8px}}@media (width<=1080px){.hq-top-metric:first-child,.hq-top-metric:nth-child(2){display:none}}@media (width<=900px){.hq-app{grid-template-columns:minmax(0,1fr)}.hq-workbench{grid-column:1}.hq-secondary-nav,.hq-secondary-nav[data-open=false]{z-index:50;border-right:1px solid var(--border);visibility:hidden;pointer-events:none;width:264px;transition:transform .15s,visibility 0s linear .15s;position:fixed;inset:0 auto 0 0;transform:translate(-105%);box-shadow:12px 0 30px #00000057}.hq-secondary-nav[data-open=true]{visibility:visible;pointer-events:auto;transition-delay:0s;transform:translate(0)}.hq-secondary-header,.hq-secondary-scroll,.hq-secondary-footer{width:264px}.hq-sidebar-scrim{z-index:40;opacity:0;pointer-events:none;background:#00000085;border:0;transition:opacity .15s;display:block;position:fixed;inset:0}.hq-sidebar-scrim[data-open=true]{opacity:1;pointer-events:auto}.hq-header{min-height:62px;padding:7px 9px}.hq-main{padding:10px}.hq-main .hq-grid{grid-template-columns:1fr}.hq-row{flex-wrap:wrap}.hq-chat-picker{flex:100%;min-width:0;max-width:100%}.hq-console{height:calc(100vh - 168px)}.hq-security-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width<=620px){.hq-security-summary,.hq-security-form{grid-template-columns:1fr}.hq-security-form label:first-child:nth-last-child(4){grid-column:auto}.hq-security-panel{padding:14px}.hq-security-actions.split,.hq-security-confirm-remove{flex-direction:column;align-items:stretch}.hq-update-notice{align-items:flex-start;padding:7px 9px}.hq-update-notice>div{gap:1px;display:grid}.hq-update-notice span{white-space:normal}.hq-update-notice button{padding-inline:6px}.hq-update-notice button:not(:focus-visible){gap:0;font-size:0}.hq-view-icon,.hq-top-metrics{display:none}.hq-view-identity{min-width:0}.hq-view-identity h1{font-size:14px}.hq-connection-pill{margin-left:auto}.hq-main{padding:8px}.hq-console-compose-row{flex-wrap:wrap}.hq-console-delivery{flex-basis:120px;width:120px}.hq-console-interrupt{margin-left:auto}.hq-console-message{flex-basis:100%}.hq-console-send{margin-left:auto}}@media (prefers-reduced-motion:reduce){.hq-fleet-drawer,.hq-audit-row.just-dispatched,.hq-alert-live,.hq-tool-running-dot,.hq-view-loading svg{animation:none}.hq-control-type,.hq-toggle,.hq-nav-caret,.hq-secondary-nav,.hq-sidebar-scrim{transition:none}}.hq-composer-bar{align-items:center;gap:8px;margin:8px 0;display:flex}.hq-composer{flex-direction:column;gap:8px;margin:8px 0;display:flex}.hq-composer-hint{color:var(--dim);font-size:12px}.hq-composer-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;display:grid}.hq-composer-field{flex-direction:column;gap:4px;display:flex}.hq-composer-field>span{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px}.hq-composer-body{resize:vertical;font-family:var(--font-sans)}.hq-composer-status{text-overflow:ellipsis;white-space:nowrap;max-width:420px;font-size:12px;overflow:hidden}.hq-composer-status.ok{color:var(--green)}.hq-composer-status.err{color:var(--red)}.hq-msg-actions{border-top:1px solid var(--border);flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px;padding-top:8px;display:flex}.hq-msg-action-error{color:var(--red);text-overflow:ellipsis;white-space:nowrap;max-width:320px;font-size:12px;overflow:hidden}.hq-token-gate{background:var(--bg);justify-content:center;align-items:center;height:100%;display:flex}.hq-token-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);width:min(440px,100vw - 32px);box-shadow:var(--shadow);flex-direction:column;gap:12px;padding:28px 28px 22px;display:flex}.hq-token-title{color:var(--bright);font-size:16px;font-weight:600}.hq-token-text{color:var(--muted);margin:0}.hq-token-input{background:var(--inset);border:1px solid var(--border2);border-radius:var(--radius-sm);color:var(--text);font-family:var(--font-mono);padding:8px 10px}.hq-token-submit{background:var(--primary-dim);border:1px solid var(--primary);border-radius:var(--radius-sm);color:var(--bright);cursor:pointer;padding:8px 10px}.hq-token-submit:disabled{opacity:.5;cursor:default}.hq-token-hint{color:var(--dim);margin:4px 0 0;font-size:12px}.hq-token-hint code{font-family:var(--font-mono);color:var(--muted)}.hq-token-tabs{border-bottom:1px solid var(--border);gap:8px;margin-bottom:4px;display:flex}.hq-token-tab{color:var(--muted);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;flex:1;padding:8px 4px;font-size:13px}.hq-token-tab.active{color:var(--bright);border-bottom-color:var(--primary)}.hq-token-error{color:var(--red);margin:0;font-size:13px}.hq-card-severity{border-left:3px solid var(--border)}.hq-card-severity.warn{border-left-color:var(--amber)}.hq-card-severity.error,.hq-card-severity.critical{border-left-color:var(--red)}.hq-card-severity.info{border-left-color:var(--primary)}.hq-stat-block{background:var(--panel2);border:1px solid var(--border);flex-direction:column;gap:2px;min-width:0;padding:10px 14px;display:flex}.hq-stat-block-label{text-transform:uppercase;letter-spacing:.04em;color:var(--dim);font-size:10.5px}.hq-stat-block-value{font-variant-numeric:tabular-nums;color:var(--bright);font-size:18px;font-weight:700}.hq-stat-block-value.accent-cost{color:var(--chart-1)}.hq-stat-block-value.accent-tokens{color:var(--chart-2)}.hq-stat-block-value.accent-tools{color:var(--chart-3)}.hq-stat-block-sub{color:var(--dim);font-variant-numeric:tabular-nums;font-size:11px}.hq-stat-row{flex-wrap:wrap;gap:10px;display:flex}.hq-text-dim{color:var(--dim)}.hq-text-muted{color:var(--muted)}.hq-text-bright{color:var(--bright);font-weight:700}.hq-ml-auto{margin-left:auto}.hq-mt-8{margin-top:8px}.hq-mt-12{margin-top:12px}.hq-row-baseline{align-items:baseline}.hq-text-center{text-align:center}.hq-card-title.hq-title-inline,.hq-title-inline{margin:0}.hq-empty.hq-pad-sm{padding:8px;font-size:12px}.hq-empty.hq-pad-md{padding:16px;font-size:12px}.hq-cockpit-empty{padding:14px;font-size:12px}.hq-cockpit-section-title{color:var(--bright);margin:0;font-size:13px;font-weight:700}.hq-cockpit-cost-amount{color:var(--green)}.hq-screen{gap:16px;display:grid}.hq-screen-hero{border:1px solid var(--border);background:linear-gradient(135deg, #fe2e5f1f, transparent 46%), linear-gradient(315deg, #fd9f021a, transparent 40%), var(--panel);grid-template-columns:minmax(0,1fr) minmax(260px,430px);align-items:stretch;gap:18px;padding:18px;display:grid;position:relative;overflow:hidden}.hq-screen-hero:before,.hq-screen-hero:after{content:"";pointer-events:none;position:absolute}.hq-screen-hero:before{border:1px solid color-mix(in srgb, var(--border2) 42%, transparent);inset:7px}.hq-screen-hero:after{border-top:1px solid var(--border2);border-right:1px solid var(--border2);width:42px;height:42px;top:15px;right:18px}.hq-screen-hero>*{z-index:1;position:relative}.hq-screen-hero h2,.hq-section-head h3{color:var(--bright);margin:0;line-height:1.12}.hq-screen-hero h2{letter-spacing:-.04em;margin-top:4px;font-size:clamp(24px,4vw,42px)}.hq-screen-hero p{max-width:720px;color:var(--muted);margin:8px 0 0}.hq-section-kicker{color:var(--primary);letter-spacing:.16em;text-transform:uppercase;font-size:9px;font-weight:800}.hq-section-kicker:before{content:"◆";color:var(--accent2);margin-right:6px}.hq-hero-metrics{grid-template-columns:repeat(2,minmax(0,1fr));align-content:stretch;gap:8px;display:grid}.hq-hero-metric{border:1px solid var(--border);background:color-mix(in srgb, var(--inset) 78%, transparent);gap:2px;min-width:0;padding:10px 12px;display:grid}.hq-hero-metric strong{color:var(--bright);font-family:var(--font-mono);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;font-size:22px;overflow:hidden}.hq-hero-metric span{color:var(--dim);letter-spacing:.08em;text-transform:uppercase;font-size:9px;font-weight:700}.hq-hero-metric[data-tone=ok] strong{color:var(--green)}.hq-hero-metric[data-tone=warn] strong{color:var(--amber)}.hq-hero-metric[data-tone=error] strong{color:var(--red)}.hq-section-head{justify-content:space-between;align-items:flex-end;gap:14px;margin-bottom:10px;display:flex}.hq-section-head.compact{margin-bottom:8px}.hq-section-head h3{margin-top:2px;font-size:16px}.hq-priority-section{gap:0;display:grid}.hq-two-column{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:14px;display:grid}.hq-empty-ornate{position:relative;overflow:hidden}.hq-empty-ornate:before{content:"◆";color:var(--accent2);letter-spacing:.18em;margin-bottom:8px;font-size:16px;display:block}.hq-alert-priority-grid,.hq-cost-rank-list,.hq-worktree-lanes,.hq-decision-timeline{gap:10px;display:grid}.hq-alert-card{background:linear-gradient(90deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent 28%), var(--panel)}.hq-alert-feed-card,.hq-alert-history-card,.hq-breakdown-card,.hq-cost-session-card{gap:7px;display:grid}.hq-alert-feed-row,.hq-alert-history-row,.hq-breakdown-row,.hq-cost-session-row{border-bottom:1px dashed var(--border);min-width:0;padding-bottom:7px}.hq-alert-feed-row:last-child,.hq-alert-history-row:last-child,.hq-breakdown-row:last-child,.hq-cost-session-row:last-child{border-bottom:0;padding-bottom:0}.hq-decision-timeline{padding-left:18px;position:relative}.hq-decision-timeline:before{content:"";border-left:1px solid var(--border2);position:absolute;top:0;bottom:0;left:7px}.hq-decision-card{grid-template-columns:28px minmax(0,1fr);gap:10px;display:grid;position:relative}.hq-decision-card.warn{border-left:3px solid var(--amber)}.hq-decision-card.error{border-left:3px solid var(--red)}.hq-decision-card.active{border-left:3px solid var(--green)}.hq-decision-marker{border:1px solid var(--border);background:var(--inset);place-items:center;width:28px;height:28px;display:grid;transform:rotate(45deg)}.hq-decision-marker>svg{transform:rotate(-45deg)}.hq-decision-body{gap:6px;min-width:0;display:grid}.hq-worktree-lane{gap:10px;display:grid}.hq-worktree-event-list{border-left:1px solid var(--border);gap:7px;padding-left:12px;display:grid}.hq-worktree-event-line{position:relative}.hq-worktree-event-line:before{content:"";border:1px solid var(--border2);background:var(--panel);width:8px;height:8px;position:absolute;left:-17px;transform:rotate(45deg)}.hq-cost-project-card{grid-template-columns:52px minmax(0,1fr);align-items:stretch;gap:12px;display:grid}.hq-cost-rank{border:1px solid var(--border2);background:var(--inset);color:var(--primary);font-family:var(--font-mono);place-items:center;font-size:15px;font-weight:700;display:grid}.hq-cost-project-main{gap:7px;min-width:0;display:grid}.hq-chart-gallery{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px;display:grid}.hq-chart-card.primary{grid-row:span 2}.hq-chart-card{min-width:0}.hq-trends-filter-row{border:1px solid var(--border);background:var(--panel);padding:8px 10px}@media (width<=980px){.hq-screen-hero,.hq-two-column,.hq-chart-gallery{grid-template-columns:minmax(0,1fr)}.hq-chart-card.primary{grid-row:auto}}@media (width<=620px){.hq-hero-metrics,.hq-cost-project-card,.hq-decision-card{grid-template-columns:minmax(0,1fr)}.hq-section-head{flex-direction:column;align-items:flex-start}.hq-decision-timeline{padding-left:0}.hq-decision-timeline:before{display:none}}.hq-kanban-view{flex-direction:column;gap:12px;min-width:0;display:flex}.hq-kanban-toolbar{border:1px solid var(--border);background:var(--panel);align-items:flex-end;gap:10px;min-width:0;padding:10px;display:flex}.hq-kanban-toolbar label{gap:4px;min-width:210px;display:grid}.hq-kanban-toolbar label>span{color:var(--dim);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:700}.hq-kanban-toolbar .hq-select{width:100%}.hq-kanban-sync{min-width:0;color:var(--dim);font-family:var(--font-mono);align-items:center;gap:10px;margin-left:auto;font-size:10px;display:flex}.hq-kanban-sync button,.hq-kanban-error button{border:1px solid var(--border2);background:var(--inset);color:var(--bright);cursor:pointer;align-items:center;gap:6px;padding:6px 9px;display:inline-flex}.hq-kanban-sync button:hover,.hq-kanban-error button:hover{border-color:var(--primary)}.hq-kanban-sync button:disabled{opacity:.55;cursor:default}.hq-kanban-sync .is-spinning{animation:.9s linear infinite hq-kanban-spin}@keyframes hq-kanban-spin{to{transform:rotate(360deg)}}.hq-kanban-error{color:var(--red);background:#e2535314;border:1px solid #e2535373;align-items:center;gap:8px;padding:9px 10px;display:flex}.hq-kanban-error span{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.hq-kanban-summary{border:1px solid var(--border);background:var(--panel);padding:14px 16px}.hq-kanban-heading{justify-content:space-between;align-items:flex-start;gap:18px;display:flex}.hq-kanban-heading>div:first-child{min-width:0}.hq-kanban-heading>div:first-child>span{color:var(--primary);letter-spacing:.12em;text-transform:uppercase;font-size:9px;font-weight:700}.hq-kanban-heading h2{color:var(--bright);margin:2px 0 0;font-size:20px}.hq-kanban-heading p{max-width:760px;color:var(--muted);margin:5px 0 0}.hq-kanban-board-meta{color:var(--dim);flex:none;align-items:center;gap:8px;font-size:10px;display:flex}.hq-kanban-tags{flex-wrap:wrap;gap:6px;margin-top:10px;display:flex}.hq-kanban-stats{border:1px solid var(--border);grid-template-columns:repeat(5,minmax(80px,1fr));margin-top:14px;display:grid}.hq-kanban-stat{border-right:1px solid var(--border);background:var(--inset);align-items:baseline;gap:7px;min-width:0;padding:7px 10px;display:flex}.hq-kanban-stat:last-child{border-right:0}.hq-kanban-stat strong{color:var(--bright);font-family:var(--font-mono);font-size:17px}.hq-kanban-stat span{color:var(--dim);letter-spacing:.06em;text-transform:uppercase;font-size:9px}.hq-kanban-stat[data-tone=active] strong{color:var(--amber)}.hq-kanban-stat[data-tone=blocked] strong{color:var(--red)}.hq-kanban-stat[data-tone=done] strong{color:var(--green)}.hq-kanban-board{grid-template-columns:repeat(var(--hq-kanban-columns), minmax(270px, 1fr));scrollbar-width:thin;scrollbar-color:var(--border2) transparent;align-items:start;gap:10px;min-width:0;padding-bottom:8px;display:grid;overflow-x:auto}.hq-kanban-column{border:1px solid var(--border);background:var(--panel);min-width:270px}.hq-kanban-column[data-over-limit=true]{border-color:color-mix(in srgb, var(--red) 55%, var(--border))}.hq-kanban-column>header{border-top:2px solid var(--border2);border-bottom:1px solid var(--border);background:var(--panel2);justify-content:space-between;align-items:center;gap:10px;min-height:48px;padding:8px 10px;display:flex}.hq-kanban-column>header>div{min-width:0;display:grid}.hq-kanban-column>header strong{color:var(--bright);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.hq-kanban-column>header span{color:var(--dim);font-family:var(--font-mono);font-size:9px}.hq-kanban-column>header .hq-kanban-column-count{border:1px solid var(--border);background:var(--inset);min-width:24px;height:24px;color:var(--bright);place-items:center;display:grid}.hq-kanban-column-body{flex-direction:column;gap:8px;min-height:84px;padding:8px;display:flex}.hq-kanban-column-empty{color:var(--dim);text-align:center;padding:24px 8px;font-size:11px}.hq-kanban-task{border:1px solid var(--border);border-left:3px solid var(--border2);background:var(--inset);padding:9px 10px;position:relative}.hq-kanban-task[data-priority=critical],.hq-kanban-task[data-priority=high]{border-left-color:var(--red)}.hq-kanban-task[data-priority=medium]{border-left-color:var(--amber)}.hq-kanban-task[data-priority=low]{border-left-color:var(--green)}.hq-kanban-task-topline{justify-content:space-between;align-items:center;gap:8px;display:flex}.hq-kanban-task .hq-pill{text-transform:uppercase;padding:0 6px;font-size:9px}.hq-kanban-task .hq-pill.completed{color:var(--green);background:#2ac0751f;border-color:#2ac07573}.hq-kanban-task .hq-pill.in_progress,.hq-kanban-task .hq-pill.review,.hq-kanban-task .hq-pill.ready{color:var(--amber);background:#fd9f021a;border-color:#fd9f0273}.hq-kanban-task .hq-pill.blocked,.hq-kanban-task .hq-pill.failed{color:var(--red);background:#df49491f;border-color:#df494973}.hq-kanban-priority{color:var(--dim);font-family:var(--font-mono);letter-spacing:.06em;text-transform:uppercase;font-size:8px}.hq-kanban-priority.critical,.hq-kanban-priority.high{color:var(--red)}.hq-kanban-priority.medium{color:var(--amber)}.hq-kanban-priority.low{color:var(--green)}.hq-kanban-task h3{color:var(--bright);font-family:var(--font-sans);margin:8px 0 0;font-size:12.5px;line-height:1.35}.hq-kanban-task p{color:var(--muted);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin:5px 0 0;font-size:10.5px;display:-webkit-box;overflow:hidden}.hq-kanban-task-labels{flex-wrap:wrap;gap:4px;margin-top:8px;display:flex}.hq-kanban-task-labels span{border:1px solid var(--border);color:var(--muted);padding:1px 5px;font-size:8.5px}.hq-kanban-task footer{border-top:1px solid var(--border);min-height:18px;color:var(--dim);font-family:var(--font-mono);align-items:center;gap:9px;margin-top:9px;padding-top:7px;font-size:9px;display:flex}.hq-kanban-task footer span{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:4px;min-width:0;display:inline-flex;overflow:hidden}.hq-kanban-task footer .is-done{color:var(--green);margin-left:auto}@media (width<=760px){.hq-kanban-toolbar{flex-direction:column;align-items:stretch}.hq-kanban-toolbar label{min-width:0}.hq-kanban-sync{justify-content:space-between;margin-left:0}.hq-kanban-heading{flex-direction:column}.hq-kanban-board-meta{flex-wrap:wrap}.hq-kanban-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.hq-kanban-stat{border-bottom:1px solid var(--border)}}.hq-toast-container{z-index:9999;pointer-events:none;flex-direction:column;gap:.5rem;max-width:28rem;display:flex;position:fixed;bottom:1rem;right:1rem}.hq-toast{border-radius:var(--radius-md,.25rem);border:1px solid var(--border);background:var(--panel2);box-shadow:var(--shadow,0 1px 3px #0003);pointer-events:auto;align-items:center;gap:.5rem;padding:.625rem .75rem;animation:.2s ease-out hq-toast-in;display:flex}.hq-toast-icon{flex-shrink:0;align-items:center;line-height:0;display:flex}.hq-toast--error{border-left:3px solid var(--red)}.hq-toast--error .hq-toast-icon{color:var(--red)}.hq-toast--warning{border-left:3px solid var(--amber)}.hq-toast--warning .hq-toast-icon{color:var(--amber)}.hq-toast--info{border-left:3px solid var(--primary)}.hq-toast--info .hq-toast-icon{color:var(--primary)}.hq-toast--success{border-left:3px solid var(--green)}.hq-toast--success .hq-toast-icon{color:var(--green)}.hq-toast-message{color:var(--text);flex:1;font-size:.8125rem;line-height:1.35}.hq-toast-action{color:var(--primary);cursor:pointer;font-size:.75rem}.hq-toast-close{border-radius:var(--radius-sm);width:1.25rem;height:1.25rem;color:var(--muted);cursor:pointer;background:0 0;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex}.hq-toast-close:hover{color:var(--text);background:var(--inset)}@keyframes hq-toast-in{0%{opacity:0;transform:translateY(.5rem)}to{opacity:1;transform:translateY(0)}}.hq-connection-pill{border-radius:var(--radius-full);white-space:nowrap;text-transform:uppercase;letter-spacing:.03em;border:1px solid var(--border);align-items:center;gap:.375rem;padding:.25rem .625rem;font-size:.6875rem;font-weight:600;line-height:1;transition:background .2s,border-color .2s;display:inline-flex}.hq-connection-pill[data-live=true]{background:color-mix(in srgb, var(--green) 12%, transparent);border-color:color-mix(in srgb, var(--green) 30%, transparent);color:var(--green)}.hq-connection-pill[data-live=false]{background:color-mix(in srgb, var(--amber) 12%, transparent);border-color:color-mix(in srgb, var(--amber) 30%, transparent);color:var(--amber);animation:2s ease-in-out infinite hq-pulse}.hq-link-state[data-live=false] .hq-link-dot{animation:2s ease-in-out infinite hq-pulse}.hq-sidebar-footer-badge{color:var(--muted);align-items:center;gap:.25rem;padding:0 .375rem;font-size:.6875rem;display:inline-flex}.hljs{color:var(--text);background:0 0}.hljs-comment,.hljs-quote{color:color-mix(in oklab, var(--muted) 60%, transparent);font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-type,.hljs-literal{color:#f28dbc}.hljs-string,.hljs-attr,.hljs-template-tag,.hljs-template-variable{color:#64d488}.hljs-number,.hljs-symbol,.hljs-bullet{color:var(--primary)}.hljs-function .hljs-keyword,.hljs-title.function_,.hljs-title.class_,.hljs-title.class_.inherited__{color:#6cb6ff}.hljs-variable,.hljs-params{color:var(--text)}.hljs-tag,.hljs-name{color:#f47a95}.hljs-attribute,.hljs-property{color:#ffb055}.hljs-regexp{color:#49d3c5}.hljs-punctuation,.hljs-operator{color:color-mix(in oklab, var(--muted) 80%, var(--text))}.hljs-meta,.hljs-doctag,.hljs-section{color:var(--muted)}.hljs-addition{color:#64d488;background:#27915c1f}.hljs-deletion{color:#ff7a7a;background:#d322221f}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:600}.hljs-link{color:var(--primary);text-decoration:underline}:root[data-hq-theme=light] .hljs-keyword,:root[data-hq-theme=light] .hljs-selector-tag,:root[data-hq-theme=light] .hljs-type,:root[data-hq-theme=light] .hljs-literal{color:#9f2862}:root[data-hq-theme=light] .hljs-string,:root[data-hq-theme=light] .hljs-attr,:root[data-hq-theme=light] .hljs-template-tag,:root[data-hq-theme=light] .hljs-template-variable,:root[data-hq-theme=light] .hljs-addition{color:#146b39}:root[data-hq-theme=light] .hljs-function .hljs-keyword,:root[data-hq-theme=light] .hljs-title.function_,:root[data-hq-theme=light] .hljs-title.class_,:root[data-hq-theme=light] .hljs-title.class_.inherited__{color:#175aa3}:root[data-hq-theme=light] .hljs-tag,:root[data-hq-theme=light] .hljs-name,:root[data-hq-theme=light] .hljs-deletion{color:#b32947}:root[data-hq-theme=light] .hljs-attribute,:root[data-hq-theme=light] .hljs-property{color:#8b4b00}:root[data-hq-theme=light] .hljs-regexp{color:#08746c}
|