baxian 1.2.33 → 1.2.34

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.
@@ -4,4 +4,4 @@ var Os=Object.defineProperty;var Ms=(t,s,n)=>s in t?Os(t,s,{enumerable:!0,config
4
4
  /Users/me/extra-repo`,disabled:b}),e.jsx("div",{className:dt,children:"透传到 --add-dir。当前 YOLO 模式下不影响权限拦截,主要用于让 CLI 把额外目录纳入工作根。"})]})]})]}),e.jsx("div",{className:"rounded-md border border-[#fde68a] bg-[#fef3c7]/60 px-3 py-2.5",children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-2",children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-3.5 w-3.5 accent-[#1348dc]",checked:r.yolo,onChange:C=>o({...r,yolo:C.target.checked}),disabled:b}),e.jsxs("div",{className:"text-sm text-og-800",children:[e.jsx("div",{className:"font-medium",children:"YOLO 模式(推荐开启)"}),e.jsxs("div",{className:"mt-1 text-xs text-warn",children:["Agent 自主执行所有命令、文件改动,无需逐条确认。开启后体验更顺滑, 但",e.jsx("strong",{className:"font-semibold",children:"请确认在受控环境(容器、隔离 worktree)中运行"}),"。"]})]})]})})]})})}const Vt=200,Kt=16e3,er="baxian.draft.createTask:";function xt(t){return`${er}${t??"*"}`}function Jt(t){try{const s=localStorage.getItem(t);if(!s)return null;const n=JSON.parse(s);if(!n||typeof n!="object")return null;const a=n,r=typeof a.title=="string"?a.title:"",o=typeof a.description=="string"?a.description:"",c=typeof a.projectId=="string"?a.projectId:"",u=typeof a.preferredAgentId=="string"?a.preferredAgentId:"",h=typeof a.updatedAt=="number"?a.updatedAt:void 0;return!r.trim()&&!o.trim()?null:{title:r,description:o,projectId:c,preferredAgentId:u,updatedAt:h}}catch{return null}}function tr(t,s){const n=!s.title.trim()&&!s.description.trim();try{n?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify({...s,updatedAt:Date.now()}))}catch{}}function Yt(t){try{localStorage.removeItem(t)}catch{}}function sr(t){const s=xt(t),n=Jt(s);if(!t)return n;const a=xt(void 0),r=Jt(a);if(!r||r.projectId!==t)return n;const o=!n||(r.updatedAt??0)>(n.updatedAt??0);if(o)try{localStorage.setItem(s,JSON.stringify(r))}catch{return r}try{localStorage.removeItem(a)}catch{}return o?r:n}const Qe="w-full rounded-md border border-og-100 bg-surface px-2.5 py-1.5 text-sm text-og-800 placeholder:text-og-400 focus:border-accent focus:outline-none focus:ring-[3px] focus:ring-accent-soft disabled:cursor-not-allowed disabled:opacity-50",Le="mb-1.5 block text-xs font-medium text-og-700",Xt="mt-1 text-right text-xs text-og-400",nr=Math.floor(et/1024/1024);function St(t){const s=t.mode==="edit",{show:n}=he(),a=s?t.task.projectId:t.projectId,r=s?t.task.title:"",o=s?t.task.description:"",c=s?t.task.preferredAgentId:"",[u,h]=i.useState([]),[m,g]=i.useState([]),[f,l]=i.useState(a??""),[v,S]=i.useState(c),[p,b]=i.useState(r),[k,H]=i.useState(o),[x,y]=i.useState([]),w=i.useRef(null),[N,W]=i.useState(!1),[E,M]=i.useState(null),[B,R]=i.useState(!1),T=i.useRef(0),Y=i.useRef(0),q=i.useRef(0),L=i.useRef(new Set),Q=s?null:xt(a);i.useEffect(()=>{if(!t.open)return;T.current+=1,Y.current+=1;const $=T.current;h([]),g([]),L.current=new Set;const G=Q?sr(a):null;G&&L.current.add(G.projectId),l(a??(G==null?void 0:G.projectId)??""),S((G==null?void 0:G.preferredAgentId)||c),b((G==null?void 0:G.title)||r),H((G==null?void 0:G.description)||o),R(G!==null),M(null),W(!1),y([]),Promise.all([P.projects.list(),P.agents.list()]).then(([ne,ee])=>{$===T.current&&(h(ne),g(ee))}).catch(ne=>{$===T.current&&M(ne instanceof Error?ne.message:String(ne))})},[t.open,a,r,o,c,Q]),i.useEffect(()=>{if(!(!t.open||!Q)){if(q.current!==Y.current){q.current=Y.current;return}tr(Q,{title:p,description:k,projectId:f,preferredAgentId:v})}},[t.open,Q,p,k,f,v]);const V=i.useMemo(()=>u.find($=>$.id===f)??null,[u,f]),ie=i.useMemo(()=>V?V.agent.flat().filter($=>$.role==="dev"):[],[V]),j=i.useMemo(()=>new Set(m.map($=>$.id)),[m]),X=i.useMemo(()=>ie.filter($=>j.has($.id)),[ie,j]),ce=i.useMemo(()=>ie.filter($=>!j.has($.id)),[ie,j]);i.useEffect(()=>{s||V!==null&&v!==""&&!X.find($=>$.id===v)&&S("")},[V,X,v,s]),i.useEffect(()=>{s||V&&X.length!==0&&(L.current.has(V.id)||(L.current.add(V.id),S($=>$===""?X[0].id:$)))},[s,V,X]);const le=!s||X.find($=>$.id===v),d=s&&!le&&!!v,O=d&&ce.some($=>$.id===v),K=O?`当前 dev "${v}" 在 baxian.json 中存在但 runtime 未加载,可能是手动编辑过配置文件;重启 server 可拉起`:d?`当前 dev "${v}" 不在 runtime(可能已从 project 配置移除);保存可能失败,请确认或选择新 dev`:!f||X.length>0?null:ce.length>0?"baxian.json 里有 dev agent 但 runtime 未加载(可能是手动编辑过配置);重启 server 后生效":null,z=p.trim(),C=k.trim(),_=!!f&&z.length>0&&!N,J=()=>{N||t.onClose()},te=()=>{Q&&(Yt(Q),l(a??""),S(c),b(r),H(o),M(null),R(!1))},A=async $=>{var G,ne;if($.preventDefault(),!!_){W(!0),M(null);try{if(t.mode==="edit"){const ee=await P.tasks.update(t.task.id,{title:z,description:C,preferredAgentId:v});n({kind:"success",title:"任务已更新"}),(G=t.onUpdated)==null||G.call(t,ee),t.onClose()}else{const ee=x.length?await Promise.all(x.map(async pe=>({dataBase64:await ht(pe),filename:pe.name}))):void 0,Ie=await P.tasks.create({projectId:f,title:z,description:C,preferredAgentId:v,...ee?{images:ee}:{}});Q&&Yt(Q),n({kind:"success",title:"任务已创建"}),(ne=t.onCreated)==null||ne.call(t,Ie),t.onClose()}}catch(ee){M(ee instanceof Error?ee.message:String(ee))}finally{W(!1)}}},U=$=>{const G=Array.from($.target.files??[]);if($.target.value="",G.length===0)return;const ne=G.filter(ee=>ee.size>et?(n({kind:"error",title:"图片过大",body:`${ee.name} 超过 ${nr} MiB`}),!1):!0);y(ee=>(ee.length+ne.length>Ue&&n({kind:"warn",title:`最多 ${Ue} 张图片`}),[...ee,...ne].slice(0,Ue)))},F=$=>y(G=>G.filter((ne,ee)=>ee!==$)),re=s?"编辑 Task":"新建 Task",oe=s?N?"保存中…":"保存":N?"创建中…":"创建",ue=!s&&!a;return e.jsx(Ne,{open:t.open,onClose:J,title:re,size:"md",dismissOnBackdrop:!1,footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:J,disabled:N,className:"btn-secondary",children:"取消"}),e.jsx("button",{type:"submit",form:"create-task-form",disabled:!_,className:"btn-primary",children:oe})]}),children:e.jsxs("form",{id:"create-task-form",onSubmit:A,className:"space-y-3",children:[!s&&B&&e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-accent-soft bg-accent-soft/30 px-3 py-2 text-xs text-accent",children:[e.jsx("span",{children:"已恢复上次未提交的草稿"}),e.jsx("button",{type:"button",onClick:te,className:"shrink-0 underline hover:text-accent-hover",children:"丢弃"})]}),E&&e.jsx("div",{className:"rounded-md border border-[#fecaca] bg-[#fef2f2] px-3 py-2 text-sm text-danger",children:E}),ue&&e.jsxs("div",{children:[e.jsx("label",{className:Le,htmlFor:"task-project",children:"Project"}),e.jsxs("select",{id:"task-project",value:f,onChange:$=>l($.target.value),className:Qe,disabled:N,required:!0,children:[e.jsx("option",{value:"",disabled:!0,children:"选择项目"}),u.map($=>e.jsx("option",{value:$.id,children:$.id},$.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:Le,htmlFor:"task-dev",children:"Dev Agent"}),e.jsxs("select",{id:"task-dev",value:v,onChange:$=>S($.target.value),className:Qe,disabled:N,children:[e.jsx("option",{value:"",children:"暂不指定"}),d&&e.jsxs("option",{value:v,children:[v," ",O?"(待重启)":"(不在 runtime)"]}),X.map($=>e.jsx("option",{value:$.id,children:$.id},$.id))]}),K&&e.jsx("div",{className:"mt-1 text-xs text-warn",children:K})]}),e.jsxs("div",{children:[e.jsx("label",{className:Le,htmlFor:"task-title",children:"Title"}),e.jsx("input",{id:"task-title",type:"text",value:p,onChange:$=>b($.target.value),maxLength:Vt,className:Qe,placeholder:"一句话描述要做什么",disabled:N,required:!0}),e.jsxs("div",{className:Xt,children:[p.length," / ",Vt]})]}),e.jsxs("div",{children:[e.jsx("label",{className:Le,htmlFor:"task-description",children:"Description(可选)"}),e.jsx("textarea",{id:"task-description",value:k,onChange:$=>H($.target.value),maxLength:Kt,rows:8,className:`${Qe} font-mono text-xs`,placeholder:"详细描述任务,支持 markdown;简单任务可不填",disabled:N}),e.jsxs("div",{className:Xt,children:[k.length," / ",Kt]})]}),!s&&e.jsxs("div",{children:[e.jsx("label",{className:Le,children:"图片(可选)"}),e.jsx("button",{type:"button",onClick:()=>{var $;return($=w.current)==null?void 0:$.click()},disabled:N||x.length>=Ue,className:"btn-secondary",children:"添加图片"}),e.jsx("input",{ref:w,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:U}),x.length>0&&e.jsx("ul",{className:"mt-2 space-y-1",children:x.map(($,G)=>e.jsxs("li",{className:"flex items-center justify-between rounded-md border border-og-100 bg-surface px-2.5 py-1.5",children:[e.jsx("span",{title:$.name,className:"truncate text-xs text-og-700",children:$.name}),e.jsx("button",{type:"button","aria-label":`移除图片 ${$.name}`,onClick:()=>F(G),disabled:N,className:"ml-2 shrink-0 text-og-400 transition-colors hover:text-danger",children:"✕"})]},`${$.name}-${G}`))})]})]})})}const Zt="***",Oe="w-full rounded-md border border-og-100 bg-surface px-2.5 py-1.5 text-sm text-og-800 placeholder:text-og-400 focus:border-accent focus:outline-none focus:ring-[3px] focus:ring-accent-soft disabled:cursor-not-allowed disabled:opacity-50",Me="mb-1.5 block text-xs font-medium text-og-700",ut={hostname:"",port:"",alias:"",user:"",password:""};function rr(t){return t.alias?t.alias:`${t.user?`${t.user}@`:""}${t.hostname}${t.port!=null?`:${t.port}`:""}`}function ar({open:t,onClose:s}){const[n,a]=i.useState([]),[r,o]=i.useState("list"),[c,u]=i.useState(null),[h,m]=i.useState(!1),[g,f]=i.useState(!1),[l,v]=i.useState(ut),[S,p]=i.useState(null),[b,k]=i.useState(!1),[H,x]=i.useState(!1),[y,w]=i.useState(null),{show:N}=he(),W=i.useCallback(()=>{P.hosts.list().then(a).catch(j=>p(j instanceof Error?j.message:String(j)))},[]);i.useEffect(()=>{t&&(o("list"),u(null),v(ut),p(null),w(null),W())},[t,W]);const E=()=>{u(null),m(!1),f(!1),v(ut),p(null),w(null),o("form")},M=j=>{u(j.id??null),m(j.password===Zt),f(!1),v({hostname:j.hostname,port:j.port!=null?String(j.port):"",alias:j.alias??"",user:j.user??"",password:""}),p(null),w(null),o("form")},B=()=>{const j={hostname:l.hostname.trim()};return c?(j.port=l.port.trim()?Number(l.port):null,j.alias=l.alias.trim(),j.user=l.user.trim()):(l.port.trim()&&(j.port=Number(l.port)),l.alias.trim()&&(j.alias=l.alias.trim()),l.user.trim()&&(j.user=l.user.trim())),c&&g?j.password="":l.password&&(j.password=l.password),j},R=l.port.trim(),T=R===""||/^\d+$/.test(R)&&Number(R)>0&&Number(R)<=65535,Y=l.hostname.trim().length>0&&T,q=async()=>{if(Y){x(!0),w(null),p(null);try{const j=await P.hosts.check({...B(),...c?{id:c}:{}});w(j)}catch(j){p(j instanceof Error?j.message:String(j))}finally{x(!1)}}},L=async j=>{if(j.preventDefault(),!(!Y||b)){k(!0),p(null);try{if(c)await P.hosts.update(c,B()),N({kind:"success",title:`Host ${c} 已更新`});else{const X=await P.hosts.create(B());N({kind:"success",title:`Host ${X.host.id} 已添加`})}W(),o("list")}catch(X){p(X instanceof Error?X.message:String(X))}finally{k(!1)}}},Q=async j=>{p(null);try{await P.hosts.delete(j.id),N({kind:"success",title:`Host ${j.id} 已删除`}),W()}catch(X){p(X instanceof Error?X.message:String(X))}},V=e.jsx("button",{type:"button",onClick:s,className:"btn-secondary",children:"关闭"}),ie=e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>o("list"),disabled:b,className:"btn-secondary",children:"返回"}),e.jsx("button",{type:"submit",form:"host-form",disabled:!Y||b,className:"btn-primary",children:b?"保存中…":"保存"})]});return e.jsxs(Ne,{open:t,onClose:s,title:"Host 管理",size:"md",footer:r==="list"?V:ie,children:[S&&e.jsx("div",{className:"mb-3 rounded-md border border-[#fecaca] bg-[#fef2f2] px-3 py-2 text-sm text-danger",children:S}),r==="list"?e.jsxs("div",{className:"space-y-3",children:[n.length===0?e.jsx("p",{className:"text-sm text-og-500",children:"还没有配置 Host。点击下方「添加 Host」。"}):e.jsx("ul",{className:"space-y-1.5",children:n.map(j=>e.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-og-100 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium text-og-800",children:rr(j)}),e.jsxs("div",{className:"truncate text-xs text-og-500",children:[(j.user?`${j.user}@`:"")+j.hostname,j.port!=null?`:${j.port}`:"",j.password===Zt?" · 密码已保存":""]})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>M(j),className:"text-xs text-accent transition-colors hover:text-accent-hover",children:"编辑"}),e.jsx("button",{type:"button",onClick:()=>Q(j),className:"text-xs text-danger transition-colors hover:opacity-80",children:"删除"})]})]},j.id))}),e.jsx("button",{type:"button",onClick:E,className:"btn-secondary w-full",children:"+ 添加 Host"})]}):e.jsxs("form",{id:"host-form",onSubmit:L,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:Me,htmlFor:"host-hostname",children:"Host 地址"}),e.jsx("input",{id:"host-hostname",type:"text",value:l.hostname,onChange:j=>v({...l,hostname:j.target.value}),className:Oe,placeholder:"remote.example.com",disabled:b})]}),e.jsxs("div",{children:[e.jsx("label",{className:Me,htmlFor:"host-port",children:"端口(可选)"}),e.jsx("input",{id:"host-port",type:"text",inputMode:"numeric",value:l.port,onChange:j=>v({...l,port:j.target.value}),className:Oe,placeholder:"22",disabled:b}),l.port.trim()!==""&&!T&&e.jsx("div",{className:"mt-1 text-xs text-danger",children:"端口需为 1–65535 的整数"})]}),e.jsxs("div",{children:[e.jsx("label",{className:Me,htmlFor:"host-alias",children:"别名(可选)"}),e.jsx("input",{id:"host-alias",type:"text",value:l.alias,onChange:j=>v({...l,alias:j.target.value}),className:Oe,placeholder:"Prod worker",disabled:b})]}),e.jsxs("div",{children:[e.jsx("label",{className:Me,htmlFor:"host-user",children:"用户名(可选)"}),e.jsx("input",{id:"host-user",type:"text",value:l.user,onChange:j=>v({...l,user:j.target.value}),className:Oe,placeholder:"留空则读 ~/.ssh/config 的 User",disabled:b})]}),e.jsxs("div",{children:[e.jsx("label",{className:Me,htmlFor:"host-password",children:"密码(可选)"}),e.jsx("input",{id:"host-password",type:"password",value:g?"":l.password,onChange:j=>v({...l,password:j.target.value}),className:Oe,placeholder:h?"已设置,留空保持不变":"留空使用 key 认证",disabled:b||g,autoComplete:"new-password"}),c&&h&&e.jsxs("label",{className:"mt-1.5 flex items-center gap-2 text-xs text-og-700",children:[e.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-[#1348dc]",checked:g,onChange:j=>f(j.target.checked),disabled:b}),"清除已保存的密码(改用 key 登录)"]})]}),e.jsxs("div",{className:"rounded-md border border-[#fde68a] bg-[#fef3c7]/60 px-3 py-2.5 text-xs text-warn",children:["建议为该 Host 配置好",e.jsx("strong",{className:"font-semibold",children:"免密码登入(SSH key)"}),"。 否则填写的密码将以",e.jsx("strong",{className:"font-semibold",children:"明文"}),"保存到 baxian.json 中。"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:q,disabled:!Y||H||b,className:"text-xs text-accent transition-colors hover:text-accent-hover disabled:cursor-not-allowed disabled:opacity-50",children:H?"测试中…":"测试连接"}),y&&e.jsxs("span",{className:`text-xs ${y.ok?"text-success":"text-danger"}`,children:[y.ok?"✓ ":"⨯ ",y.message]})]})]})]})}const ks="topbar-actions";function es(){return typeof document>"u"?null:document.getElementById(ks)}function Es({children:t}){const[s,n]=i.useState(es);return i.useEffect(()=>{s||n(es())},[s]),s?_s.createPortal(t,s):null}function ir(t){return Array.from(new TextEncoder().encode(t)).map(s=>s.toString(16).padStart(2,"0")).join("")}function or(){return`${location.protocol==="https:"?"wss":"ws"}://${location.host}/api/realtime`}const cr=(t,s)=>s&&s.length>0?new WebSocket(t,s):new WebSocket(t);class lr{constructor(s={}){se(this,"wsUrl");se(this,"wsFactory");se(this,"tokenProvider");se(this,"ws",null);se(this,"topics",new Map);se(this,"cache",new Map);se(this,"outbox",[]);se(this,"reconnectScheduler");se(this,"explicitlyClosed",!1);this.wsUrl=s.wsUrl??or(),this.wsFactory=s.wsFactory??cr,this.tokenProvider=s.tokenProvider??wt,this.reconnectScheduler=new vs({reconnect:()=>this.openSocket(),shouldReconnect:()=>!this.explicitlyClosed&&this.topics.size>0})}subscribe(s,n,a){let r=this.topics.get(s);const o=!r;return r||(r={data:new Set,error:new Set},this.topics.set(s,r)),r.data.add(n),a&&r.error.add(a),o?(this.ensureSocket(),this.wsSendOrQueue({op:"subscribe",topic:s})):this.cache.has(s)&&queueMicrotask(()=>{var c;(c=this.topics.get(s))!=null&&c.data.has(n)&&this.cache.has(s)&&n(this.cache.get(s))}),()=>this.unsubscribe(s,n,a)}close(){if(this.explicitlyClosed=!0,this.reconnectScheduler.cancel(),this.reconnectScheduler.reset(),this.ws){try{this.ws.close()}catch{}this.ws=null}this.topics.clear(),this.cache.clear(),this.outbox=[]}unsubscribe(s,n,a){const r=this.topics.get(s);r&&(r.data.delete(n),a&&r.error.delete(a),r.data.size===0&&r.error.size===0&&(this.topics.delete(s),this.cache.delete(s),this.wsSendOrQueue({op:"unsubscribe",topic:s}),this.topics.size===0&&this.teardownSocket()))}teardownSocket(){if(this.reconnectScheduler.cancel(),this.reconnectScheduler.reset(),this.outbox=[],this.ws){try{this.ws.close()}catch{}this.ws=null}}ensureSocket(){this.explicitlyClosed||this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)||this.openSocket()}openSocket(){if(this.explicitlyClosed)return;this.reconnectScheduler.cancel();const s=this.tokenProvider(),n=s?[`baxian.token.${ir(s)}`]:void 0;let a;try{a=this.wsFactory(this.wsUrl,n)}catch(o){console.warn("[events-client] WebSocket constructor threw:",o),this.broadcastConnectionError({code:"connection_failed",message:o instanceof Error?o.message:"WebSocket constructor threw"}),this.scheduleReconnect();return}this.ws=a;let r=!1;a.onopen=()=>{if(a!==this.ws)return;r=!0,this.reconnectScheduler.reset();for(const c of this.topics.keys())try{a.send(JSON.stringify({op:"subscribe",topic:c}))}catch(u){console.warn("[events-client] resubscribe send failed:",u)}const o=this.outbox;this.outbox=[];for(const c of o)if(!(c.op==="subscribe"||c.op==="unsubscribe"))try{a.send(JSON.stringify(c))}catch(u){console.warn("[events-client] outbox flush failed:",u)}},a.onmessage=o=>{if(a!==this.ws)return;let c;try{const u=typeof o.data=="string"?o.data:String(o.data);c=JSON.parse(u)}catch{return}this.handleMessage(c)},a.onclose=()=>{a===this.ws&&(this.ws=null,!this.explicitlyClosed&&(r||this.broadcastConnectionError({code:"connection_failed",message:"WebSocket failed to connect (auth, network, or proxy issue)"}),this.topics.size!==0&&this.scheduleReconnect()))},a.onerror=()=>{}}scheduleReconnect(){this.reconnectScheduler.schedule()}broadcastConnectionError(s){for(const n of this.topics.values())for(const a of[...n.error])try{a(s)}catch(r){console.error("[events-client] error handler threw on connection error:",r)}}wsSendOrQueue(s){if(this.ws&&this.ws.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify(s));return}catch(n){console.warn("[events-client] send failed, will queue:",n)}this.outbox.push(s)}handleMessage(s){switch(s.type){case"data":{const n=this.topics.get(s.topic);if(this.cache.set(s.topic,s.data),!n)return;for(const a of[...n.data])try{a(s.data)}catch(r){console.error(`[events-client] handler threw on ${s.topic}:`,r)}break}case"error":{const n={code:s.code,message:s.message};if(s.topic){const a=this.topics.get(s.topic);if(a)for(const r of[...a.error])try{r(n)}catch(o){console.error(`[events-client] error handler threw on ${s.topic}:`,o)}}else console.warn("[events-client] connection-level error:",s.code,s.message);break}}}}let ft=null;function kt(){return ft||(ft=new lr),ft}function Et(){const[t,s]=i.useState(null),[n,a]=i.useState(!1),[r,o]=i.useState(null);return i.useEffect(()=>kt().subscribe("agents",u=>{o(null),s(u),a(!0)},u=>o(u)),[]),{data:t,loaded:n,error:r}}function Rt(t){const[s,n]=i.useState(null),[a,r]=i.useState(!1),[o,c]=i.useState(null);return i.useEffect(()=>(n(null),r(!1),c(null),kt().subscribe(`task:${t}`,h=>{c(null),n(h),r(!0)},h=>c(h))),[t]),{data:s,loaded:a,error:o}}function Rs(t){const[s,n]=i.useState(null),[a,r]=i.useState(!1),[o,c]=i.useState(null);return i.useEffect(()=>{if(!t){n(null),r(!1),c(null);return}n(null),r(!1),c(null);let u=!1,h=!1,m=!1;const g=kt().subscribe(`project-tasks:${t}`,f=>{u||(h=!0,c(null),n(f),r(!0))},f=>{u||(c(f),!(h||m)&&(m=!0,P.tasks.list(t).then(l=>{u||h||(n(l),r(!0))},l=>{console.warn(`[useProjectTasks] REST fallback failed for ${t}:`,l)})))});return()=>{u=!0,g()}},[t]),{data:s,loaded:a,error:o}}let Ye=null,ve=null,Xe=null,Fe=0;const pt=new Set;function Cs(){pt.forEach(t=>t())}async function dr(){const t=Fe;try{const s=await P.projects.list();if(t!==Fe)return;Ye=s,Xe=null}catch(s){if(t!==Fe)return;Xe=s instanceof Error?s.message:String(s)}finally{t===Fe&&(ve=null,Cs())}}function gt(){return ve||(ve=dr(),ve)}function ur(){Fe+=1,Ye=null,ve=null,Xe=null,Cs()}typeof window<"u"&&window.addEventListener(Ke,ur);async function fr(){const t=ve!==null;await gt(),t&&await gt()}function st(){const[,t]=i.useState(0);return i.useEffect(()=>{const s=()=>t(n=>n+1);return pt.add(s),Ye===null&&!ve&&gt(),()=>{pt.delete(s)}},[]),{projects:Ye,error:Xe,refresh:fr}}function mr(){const t=me(),{projects:s,error:n,refresh:a}=st(),r=s??[],o=s!==null,[c,u]=i.useState(!1),[h,m]=i.useState(!1),[g,f]=i.useState(!1),[l,v]=i.useState({kind:"closed"}),{data:S,loaded:p,error:b}=Et(),k=(b==null?void 0:b.message)??null,H=new Map((S??[]).map(T=>[T.id,T])),x=n??k,[y,w]=i.useState(!1),N=i.useRef(null),W=i.useRef(null),E=i.useId(),M=i.useId();i.useEffect(()=>{if(!y)return;const T=q=>{var Q,V;const L=q.target;L&&((Q=W.current)!=null&&Q.contains(L)||(V=N.current)!=null&&V.contains(L)||w(!1))},Y=q=>{var L;q.key==="Escape"&&(w(!1),(L=N.current)==null||L.focus())};return document.addEventListener("mousedown",T),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",Y)}},[y]);const B=r.length===0,R=e.jsx("button",{type:"button",onClick:()=>m(!0),disabled:B,"aria-describedby":B?"create-task-hint":void 0,className:"btn-ghost",children:"+ 新建 Task"});return e.jsxs("div",{children:[e.jsxs(Es,{children:[B?e.jsx("span",{className:"inline-flex",title:"请先创建项目",children:R}):R,B&&e.jsx("span",{id:"create-task-hint",className:"sr-only",children:"请先创建项目"}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{ref:N,id:M,type:"button",onClick:()=>w(T=>!T),"aria-haspopup":"menu","aria-expanded":y,"aria-controls":y?E:void 0,"aria-label":"更多操作",className:"flex h-8 w-8 items-center justify-center rounded text-og-500 transition-colors hover:bg-og-50 hover:text-og-1000",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),y&&e.jsxs("div",{ref:W,id:E,role:"menu","aria-labelledby":M,className:"absolute right-0 top-full z-10 mt-1 min-w-[140px] rounded-md border border-hairline bg-surface py-1 shadow-md",children:[e.jsx("button",{type:"button",role:"menuitem",onClick:()=>{w(!1),u(!0)},className:"block w-full px-3 py-1.5 text-left text-sm text-og-800 hover:text-og-1000",children:"新建项目"}),e.jsx("button",{type:"button",role:"menuitem",onClick:()=>{w(!1),f(!0)},className:"block w-full px-3 py-1.5 text-left text-sm text-og-800 hover:text-og-1000",children:"Host 管理"})]})]})]}),e.jsx("h1",{className:"sr-only",children:"Dashboard"}),x&&e.jsxs("div",{className:"mb-4 text-sm text-danger",children:["Error: ",x]}),o&&r.length===0&&!n&&e.jsx("div",{className:"rounded-lg border border-hairline bg-surface py-12 text-center text-sm text-og-500",children:'还没有项目。点击右上角"更多"菜单 → "新建项目"开始。'}),r.map(T=>e.jsx(hr,{project:T,agentsById:H,agentsLoaded:p,agentsError:!!b,onAgentDeleted:a},T.id)),e.jsx(Yn,{open:c,onClose:()=>u(!1),onCreated:T=>{u(!1),a(),v({kind:"asking",projectId:T})}}),e.jsx(ar,{open:g,onClose:()=>f(!1)}),e.jsx(Ne,{open:l.kind==="asking",onClose:()=>v({kind:"closed"}),title:"项目已创建",size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>v({kind:"closed"}),className:"btn-secondary",children:"稍后再加"}),e.jsx("button",{type:"button",onClick:()=>{l.kind==="asking"&&v({kind:"addingAgent",projectId:l.projectId})},className:"btn-primary",children:"继续添加 Agent"})]}),children:e.jsx("p",{className:"text-sm text-og-700",children:"现在添加第一个 Agent,还是稍后再加?"})}),l.kind==="addingAgent"&&e.jsx(Ss,{open:!0,projectId:l.projectId,onClose:()=>v({kind:"closed"}),onCreated:()=>{a()}}),e.jsx(St,{open:h,onClose:()=>m(!1),onCreated:T=>t(Te(T.projectId,T.id))})]})}function hr({project:t,agentsById:s,agentsLoaded:n,agentsError:a,onAgentDeleted:r}){const{data:o,error:c}=Rs(t.id),u=o??[],h=(c==null?void 0:c.message)??null;return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"mb-3 -mx-2 flex items-baseline gap-x-3 gap-y-1 px-2 py-1",children:[e.jsx("h2",{className:"min-w-0 truncate font-display text-base font-semibold tracking-tight text-og-1000",title:t.id,children:e.jsx(Be,{to:`/project/${t.id}`,className:"hover:text-accent-hover",children:t.id})}),e.jsx("span",{className:"hidden min-w-0 truncate font-mono text-xs text-og-500 sm:inline-block",title:t.repo,children:t.repo}),e.jsx(Be,{to:`/project/${t.id}`,className:"ml-auto text-sm text-accent hover:text-accent-hover","aria-label":`Details — ${t.id}`,children:"Details →"})]}),h&&e.jsxs("div",{className:"mb-2 text-xs text-danger",children:["任务列表加载失败:",h]}),t.agent.flat().length===0?e.jsx("div",{className:"rounded-lg border border-hairline bg-surface py-6 text-center text-sm text-og-500",children:"还没有 Agent。进入 Details 添加。"}):e.jsx("div",{className:t.agent.length===1?"space-y-3":"grid grid-cols-1 gap-3 xl:grid-cols-2",children:t.agent.map((m,g)=>e.jsx(Ns,{group:m,projectId:t.id,agentsById:s,agentsLoaded:n,agentsError:a,tasks:u,onDeleted:r,terminalMode:"embedded-full"},m.map(f=>f.id).join(":")||g))})]})}const As="baxian.taskPanel.doneOpen";function xr(){try{return localStorage.getItem(As)==="1"}catch{return!1}}function Ze(t){const s=t.match(/^task-(\d+)$/);return s?parseInt(s[1],10):Number.NaN}function pr(t,s){const n=Ze(t.id),a=Ze(s.id);return Number.isNaN(n)||Number.isNaN(a)?t.id.localeCompare(s.id):n-a}function gr(t,s){const n=(s.updatedAt??"").localeCompare(t.updatedAt??"");if(n!==0)return n;const a=Ze(t.id),r=Ze(s.id);return Number.isNaN(a)||Number.isNaN(r)?s.id.localeCompare(t.id):r-a}function ts(t,s){const[n,a]=i.useState(nt);i.useEffect(()=>a(nt),[s]);const r=t.slice(0,n),o=t.length>r.length;return{items:r,hasMore:o,loadMore:()=>a(u=>u+nt),total:t.length}}function br(t){const[s,n]=i.useState([]),[a,r]=i.useState(!1),[o,c]=i.useState(!1),[u,h]=i.useState(!1),[m,g]=i.useState(null),f=i.useRef(0),l=i.useRef(0),v=i.useCallback(S=>{const p=++f.current,b=S==="first"?0:l.current;c(!0),g(null),P.tasks.page(t,{category:"done",offset:b}).then(k=>{f.current===p&&(n(H=>S==="first"?k.tasks:[...H,...k.tasks]),r(k.hasMore),l.current=k.nextOffset,h(!0),c(!1))},k=>{f.current===p&&(g(k instanceof Error?k.message:String(k)),c(!1))})},[t]);return i.useEffect(()=>{f.current+=1,l.current=0,n([]),r(!1),h(!1),g(null),c(!1)},[t]),{items:s,hasMore:a,loading:o,loaded:u,error:m,load:v}}function vr({projectId:t,openTasks:s,className:n=""}){const a=i.useMemo(()=>s.filter(f=>ms.has(f.status)).sort(gr),[s]),r=i.useMemo(()=>s.filter(f=>f.status==="pending").sort(pr),[s]),o=ts(a,t),c=ts(r,t),u=br(t),[h,m]=i.useState(xr);i.useEffect(()=>{try{localStorage.setItem(As,h?"1":"0")}catch{}},[h]),i.useEffect(()=>{h&&u.load("first")},[h,u.load]);const g=()=>m(f=>!f);return e.jsx("aside",{"aria-label":"Task 面板",className:`flex flex-col rounded-lg border border-hairline bg-surface ${n}`,children:e.jsxs("div",{children:[e.jsx(ss,{title:"IN PROGRESS",section:o,emptyHint:"暂无正在处理的任务"}),e.jsx(ss,{title:"PENDING",section:c,emptyHint:"暂无待处理的任务"}),e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:g,"aria-expanded":h,className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-normal uppercase tracking-[0.05em] text-og-500 transition-colors hover:bg-og-50/40",children:[e.jsx("span",{children:"DONE"}),e.jsx("span",{className:"font-normal normal-case text-accent",children:h?"收起":"查看"})]}),h&&e.jsx(jr,{state:u})]})]})})}function ss({title:t,section:s,emptyHint:n}){return e.jsxs("section",{"aria-label":t,className:"border-b border-hairline",children:[e.jsxs("div",{className:"px-3 py-2 text-xs font-normal uppercase tracking-[0.05em] text-og-500",children:[t," ",e.jsxs("span",{className:"text-og-400",children:["(",s.total,")"]})]}),s.items.length===0?e.jsx("div",{className:"px-3 pb-3 text-xs text-og-400",children:n}):e.jsxs("div",{className:"divide-y divide-hairline",children:[s.items.map(a=>e.jsx($s,{task:a},a.id)),s.hasMore&&e.jsx("button",{type:"button",onClick:s.loadMore,className:"w-full px-3 py-2 text-center text-xs text-accent transition-colors hover:bg-og-50/40",children:"加载更多"})]})]})}function jr({state:t}){const s=t.loaded&&!t.error&&t.items.length===0;return e.jsxs("div",{className:"divide-y divide-hairline",children:[t.items.map(n=>e.jsx($s,{task:n},n.id)),t.error&&e.jsxs("div",{className:"px-3 py-2 text-xs text-danger",children:["加载失败:",t.error]}),s&&e.jsx("div",{className:"px-3 pb-3 pt-1 text-xs text-og-400",children:"暂无已处理的任务"}),t.loading&&t.items.length===0&&e.jsx("div",{className:"px-3 py-3 text-center text-xs text-og-400",children:"加载中…"}),t.hasMore&&e.jsx("button",{type:"button",onClick:()=>t.load("more"),disabled:t.loading,className:"w-full px-3 py-2 text-center text-xs text-accent transition-colors hover:bg-og-50/40 disabled:opacity-50",children:t.loading?"加载中…":"加载更多"})]})}function wr(t){const[s,n]=i.useState(!1);return i.useEffect(()=>{function a(){if(t.status!=="review"||!t.reviewDispatchedAt||!t.qaAgentId){n(!1);return}n(Date.now()-Date.parse(t.reviewDispatchedAt)>=hs)}a();const r=setInterval(a,3e4);return()=>clearInterval(r)},[t.status,t.reviewDispatchedAt,t.qaAgentId]),s}function $s({task:t}){const s=me(),n=t.phase==="spec"?t.specReviewRound??0:t.reviewRound,a=wr(t);return e.jsxs("button",{type:"button",onClick:()=>s(Te(t.projectId,t.id)),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-og-50/60",children:[e.jsx("span",{className:"shrink-0 font-mono text-xs text-og-500",title:t.id,children:Nt(t.id)}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-og-1000",title:t.title,children:t.title}),t.phase==="spec"&&e.jsx("span",{className:"pill pill-review shrink-0",children:"spec"}),a&&e.jsx("span",{className:"pill pill-warn shrink-0",title:"Review verdict missing",children:"!"}),e.jsxs("span",{"aria-label":`Round ${n}`,className:"shrink-0 text-xs text-og-400",children:["R",n]}),e.jsx(qn,{status:t.status})]})}const yr=[],Ts="baxian.taskPanel.open";function Nr(){try{return localStorage.getItem(Ts)!=="0"}catch{return!0}}function Sr(){const{id:t}=He(),s=me(),{show:n}=he(),{refresh:a}=st(),[r,o]=i.useState(null),[c,u]=i.useState(null),[h,m]=i.useState(!1),[g,f]=i.useState(!1),[l,v]=i.useState(Nr),[S,p]=i.useState(!1),[b,k]=i.useState(!1),[H,x]=i.useState(""),[y,w]=i.useState(!1),[N,W]=i.useState(null),E=i.useRef(null),M=i.useRef(null),B=i.useId(),R=i.useId(),T=i.useRef(0),{data:Y,loaded:q,error:L}=Et(),{data:Q,error:V}=Rs(t),ie=(L==null?void 0:L.message)??null,j=(V==null?void 0:V.message)??null,X=Q??yr,ce=new Map((Y??[]).map(I=>[I.id,I])),le=c??ie??j,d=i.useCallback(async I=>{const _=++T.current;try{const J=await P.projects.get(I);if(_!==T.current)return;o(J),u(null)}catch(J){if(_!==T.current)return;u(J instanceof Error?J.message:String(J))}},[]);i.useEffect(()=>{t&&(o(null),u(null),d(t))},[t,d]),i.useEffect(()=>{if(!S)return;const I=J=>{var A,U;const te=J.target;te&&((A=M.current)!=null&&A.contains(te)||(U=E.current)!=null&&U.contains(te)||p(!1))},_=J=>{var te;J.key==="Escape"&&(p(!1),(te=E.current)==null||te.focus())};return document.addEventListener("mousedown",I),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",_)}},[S]),i.useEffect(()=>{b||(x(""),W(null))},[b]),i.useEffect(()=>{try{localStorage.setItem(Ts,l?"1":"0")}catch{}},[l]);const O=(r==null?void 0:r.agent.flat().length)??0,K=O===0,z=!!r&&H.trim()===r.id,C=async()=>{if(!(!r||!z||y)){w(!0),W(null);try{await P.projects.delete(r.id),await a(),n({kind:"success",title:`项目 ${r.id} 已删除`}),k(!1),s("/")}catch(I){W(I instanceof Error?I.message:String(I))}finally{w(!1)}}};return r?e.jsxs("div",{children:[e.jsxs(Es,{children:[e.jsx("button",{type:"button",onClick:()=>f(!0),className:"btn-ghost",children:"+ 新建 Task"}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{ref:E,id:R,type:"button",onClick:()=>p(I=>!I),"aria-haspopup":"menu","aria-expanded":S,"aria-controls":S?B:void 0,"aria-label":`项目 ${r.id} 操作菜单`,className:"flex h-8 w-8 items-center justify-center rounded text-og-500 transition-colors hover:bg-og-50 hover:text-og-1000",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1"}),e.jsx("circle",{cx:"12",cy:"5",r:"1"}),e.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}),S&&e.jsxs("div",{ref:M,id:B,role:"menu","aria-labelledby":R,className:"absolute right-0 top-full z-10 mt-1 min-w-[180px] rounded-md border border-hairline bg-surface py-1 shadow-md",children:[!l&&e.jsx("button",{type:"button",role:"menuitem",onClick:()=>{var I;p(!1),v(!0),(I=E.current)==null||I.focus()},className:"block w-full px-3 py-1.5 text-left text-sm text-og-800 hover:bg-og-50 hover:text-og-1000",children:"显示 Task 面板"}),e.jsx("button",{type:"button",role:"menuitem",onClick:()=>{p(!1),m(!0)},className:"block w-full px-3 py-1.5 text-left text-sm text-og-800 hover:bg-og-50 hover:text-og-1000",children:"添加 Agent"}),e.jsx("div",{role:"none",className:"my-1 border-t border-hairline"}),e.jsx("button",{type:"button",role:"menuitem",onClick:()=>{p(!1),k(!0)},disabled:!K,title:K?void 0:`请先删除项目下的 ${O} 个 Agent`,className:"block w-full px-3 py-1.5 text-left text-sm text-danger hover:bg-[#fef2f2] disabled:cursor-not-allowed disabled:text-og-400 disabled:hover:bg-transparent",children:"删除项目…"})]})]})]}),le&&e.jsxs("div",{className:"mb-4 text-sm text-danger",children:["Error: ",le]}),e.jsxs("div",{className:"mb-6 flex items-baseline gap-x-3",children:[e.jsx("h1",{className:"min-w-0 truncate font-display text-base font-semibold tracking-tight text-og-1000",title:r.id,children:r.id}),e.jsx("span",{className:"hidden min-w-0 truncate font-mono text-xs text-og-500 sm:inline-block",title:r.repo,children:r.repo})]}),e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"mb-3 flex h-8 items-center gap-2",children:e.jsx("h2",{className:"font-display text-xs font-semibold uppercase tracking-[0.06em] text-og-500",children:"Agents"})}),r.agent.flat().length===0?e.jsx("div",{className:"mb-8 rounded-lg border border-hairline bg-surface py-6 text-center text-sm text-og-500",children:"还没有 Agent,点击右上角菜单添加。"}):e.jsx("div",{className:"mb-8 space-y-5",children:r.agent.map((I,_)=>e.jsx(Ns,{group:I,projectId:r.id,agentsById:ce,agentsLoaded:q,agentsError:!!L,tasks:X,onDeleted:()=>{d(r.id)},terminalMode:"embedded-full"},I.map(J=>J.id).join(":")||_))})]}),l&&e.jsxs("div",{className:"w-full lg:w-[340px] lg:shrink-0 xl:w-[380px]",children:[e.jsxs("div",{className:"mb-3 flex h-8 items-center justify-between gap-2",children:[e.jsx("h2",{className:"font-display text-xs font-semibold uppercase tracking-[0.06em] text-og-500",children:"Tasks"}),e.jsx("button",{type:"button",onClick:()=>{var I;v(!1),(I=E.current)==null||I.focus()},"aria-label":"关闭 Task 面板",className:"flex h-7 w-7 items-center justify-center rounded text-og-500 transition-colors hover:bg-og-50 hover:text-og-1000",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx(vr,{projectId:r.id,openTasks:X})]})]}),e.jsx(Ss,{open:h,projectId:r.id,onClose:()=>m(!1),onCreated:()=>{d(r.id)}}),e.jsx(St,{open:g,projectId:r.id,onClose:()=>f(!1),onCreated:I=>s(Te(I.projectId,I.id))}),e.jsx(Ne,{open:b,onClose:()=>{y||k(!1)},title:"删除项目",size:"sm",footer:e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>k(!1),disabled:y,className:"btn-secondary",children:"取消"}),e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!z||y,className:"btn-secondary !text-danger hover:!bg-[#fef2f2] hover:!text-danger disabled:!text-og-300",children:y?"删除中…":"确认删除"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-og-700",children:["将从 ",e.jsx("code",{className:"font-mono text-og-1000",children:"baxian.json"})," 中移除项目"," ",e.jsx("span",{className:"font-mono text-og-1000",children:r.id}),"。此操作不可撤销,且不会删除 Git 仓库本身。"]}),e.jsxs("p",{className:"text-sm text-og-700",children:["如需确认,请在下方输入项目 ID ",e.jsx("span",{className:"font-mono text-og-1000",children:r.id}),":"]}),e.jsx("input",{type:"text",value:H,onChange:I=>x(I.target.value),placeholder:r.id,autoComplete:"off",autoCorrect:"off",spellCheck:!1,disabled:y,"aria-label":"输入项目 ID 以确认删除",className:"w-full rounded border border-hairline bg-surface px-3 py-2 font-mono text-sm text-og-1000 focus:border-accent focus:outline-none"}),N&&e.jsx("div",{className:"rounded-md border border-[#fecaca] bg-[#fef2f2] px-3 py-2 text-xs text-danger",children:N})]})})]}):c?e.jsxs("div",{className:"text-sm text-danger",children:["Error: ",c]}):e.jsx("div",{className:"text-sm text-og-500",children:"Loading…"})}function Is(t,s){const[n,a]=i.useState(null),[r,o]=i.useState(!1),[c,u]=i.useState(null),h=i.useRef(t);return i.useEffect(()=>{let m=!0;return h.current!==t&&(h.current=t,a(null),o(!1)),u(null),P.tasks.reviews(t).then(g=>{m&&(a(g),o(!0))}).catch(g=>{m&&(u(g instanceof Error?g.message:String(g)),a([]),o(!0))}),()=>{m=!1}},[t,s]),{rounds:n,loaded:r,error:c}}function kr({task:t}){const s=me();function n(){s(`/tasks/${encodeURIComponent(t.id)}/github-review`)}return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs text-og-700",children:"代码评审"}),e.jsxs("button",{type:"button",onClick:n,className:"card flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:border-accent",children:[e.jsx("span",{className:"shrink-0 min-w-[1.75rem] text-xs uppercase tracking-wide text-[#c2410c]",children:"QA"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-og-700",children:"查看 PR 评审过程(QA review、行内评论、dev 修复 commit)"}),e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-og-300",children:"›"})]})]})}const Er={spec:"Spec 评审",code:"代码评审"},Rr={approve:"pill pill-live","request-changes":"pill pill-warn"};function ns(t){if(!t)return 0;const s=t.endsWith(`
5
5
  `)?t.slice(0,-1):t;return s===""?0:s.split(`
6
6
  `).length}function Cr(t){return t.phase==="code"?(t.diffstat??"").split(`
7
- `).map(n=>n.trim()).filter(Boolean).pop()??`diff ${ns(t.content)} 行`:`规格文档 ${ns(t.content)} 行`}function Ar(t){const s={critical:0,major:0,minor:0};for(const r of t.findings)r.severity in s&&s[r.severity]++;const n=[];return s.critical&&n.push(`${s.critical} critical`),s.major&&n.push(`${s.major} major`),s.minor&&n.push(`${s.minor} minor`),`${t.findings.length} 条 findings${n.length?`(${n.join(", ")})`:""}`}function $r(t){const s={fix:0,reject:0,"out-of-scope":0};for(const a of t.responses)a.action in s&&s[a.action]++;const n=[];return s.fix&&n.push(`${s.fix} fixed`),s.reject&&n.push(`${s.reject} rejected`),s["out-of-scope"]&&n.push(`${s["out-of-scope"]} out-of-scope`),n.join(" · ")||`${t.responses.length} 条反馈`}function Tr({task:t}){const s=t.reviewMode==="server"||(t.specReviewRound??0)>0,n=t.reviewMode!=="server"&&t.prNumber!==void 0;return!s&&!n?null:e.jsxs("section",{className:"mt-4","aria-label":"评审记录",children:[e.jsx("div",{className:"mb-2 text-base text-og-700",children:"评审记录"}),e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(Ir,{task:t}),n&&e.jsx(kr,{task:t})]})]})}function Ir({task:t}){const s=me(),n=`${t.specReviewRound??0}:${t.reviewRound}:${t.status}:${t.phase??"code"}`,{rounds:a,loaded:r,error:o}=Is(t.id,n);function c(u,h,m){s(`/tasks/${encodeURIComponent(t.id)}/rounds/${u}/${h}${m}`)}return o?e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",o]}):r?((a==null?void 0:a.length)??0)===0?e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未开始"}):e.jsx(e.Fragment,{children:["spec","code"].map(u=>{const h=(a??[]).filter(m=>m.phase===u).sort((m,g)=>m.round-g.round);return h.length===0?null:e.jsx(Pr,{title:Er[u],children:h.map(m=>e.jsx(Dr,{round:m,onOpen:c},`${u}-${m.round}`))},u)})}):e.jsx("div",{className:"text-sm text-og-400",children:"加载评审记录…"})}function Pr({title:t,children:s}){return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs text-og-700",children:t}),e.jsx("div",{className:"space-y-3",children:s})]})}function Dr({round:t,onOpen:s}){const n=t.phase==="spec";return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 text-xs text-og-400",children:["第 ",t.round," 轮"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(mt,{role:"dev",label:n?"提交规格稿":"提交代码改动",summary:Cr(t),onClick:()=>s(t.phase,t.round,"")}),t.findings&&e.jsx(mt,{role:"qa",label:"评审",badge:e.jsx("span",{className:Rr[t.findings.verdict],children:t.findings.verdict}),summary:Ar(t.findings),onClick:()=>s(t.phase,t.round,"#review")}),t.response&&e.jsx(mt,{role:"dev",label:"反馈",summary:$r(t.response),onClick:()=>s(t.phase,t.round,"#response")})]})]})}function mt({role:t,label:s,summary:n,badge:a,onClick:r}){return e.jsxs("button",{type:"button",onClick:r,className:"card flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:border-accent",children:[e.jsx("span",{className:`shrink-0 min-w-[1.75rem] text-xs uppercase tracking-wide ${t==="qa"?"text-[#c2410c]":"text-accent"}`,children:t==="qa"?"QA":"dev"}),e.jsx("span",{className:"shrink-0 text-og-800",children:s}),a,e.jsx("span",{className:"min-w-0 flex-1 truncate text-og-500",children:n}),e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-og-300",children:"›"})]})}const rs=fs;function Lr(t){const[s,n]=i.useState(!1);return i.useEffect(()=>{function a(){if(!t||t.status!=="review"||!t.reviewDispatchedAt||!t.qaAgentId){n(!1);return}const o=Date.now()-Date.parse(t.reviewDispatchedAt);n(o>=hs)}a();const r=setInterval(a,3e4);return()=>clearInterval(r)},[t==null?void 0:t.status,t==null?void 0:t.reviewDispatchedAt,t==null?void 0:t.qaAgentId]),s}function Or(t,s){if(!t||!s)return null;const n=t.match(/^(https?:\/\/[^/]+\/[^/]+\/[^/]+)\/pull\/\d+/);if(!n)return null;const a=s.split("/").map(encodeURIComponent).join("/");return`${n[1]}/tree/${a}`}function Mr(){const{taskId:t=""}=He();return e.jsx(_r,{taskId:t},t)}function _r({taskId:t}){const s=me(),{show:n}=he(),[a,r]=i.useState(!1),[o,c]=i.useState(!1),[u,h]=i.useState(!1),[m,g]=i.useState(!1),[f,l]=i.useState(!1),[v,S]=i.useState(!1),[p,b]=i.useState(null),{data:k,loaded:H,error:x}=Rt(t),{projects:y}=st(),{data:w,loaded:N,error:W}=Et(),E=p??k,M=Lr(E),B=(x==null?void 0:x.message)??null,R=i.useMemo(()=>new Map((w??[]).map(d=>[d.id,d])),[w]);i.useEffect(()=>{p&&k&&k.updatedAt>=p.updatedAt&&b(null)},[p,k]);const T=d=>{b(d)},Y=async()=>{if(E&&confirm(`确定取消 task ${E.id}?`)){c(!0);try{const d=await P.tasks.update(E.id,{status:"cancelled"});T(d),n({kind:"success",title:"任务已取消"})}catch(d){n({kind:"error",title:"取消失败",body:d instanceof Error?d.message:String(d)})}finally{c(!1)}}},q=async()=>{if(!E)return;const O=fs.has(E.status)?`task ${E.id} 已是 ${E.status} 状态。手动请 QA 重审会再跑一轮 review,但状态机不会把 QA 结果带回主流程。继续?`:`请 QA 重审 task ${E.id}?这会让 QA agent 立即开始新一轮 review(reviewRound +1)。`;if(confirm(O)){g(!0);try{const K=await P.tasks.review(E.id);T(K),n({kind:"success",title:`已派 QA 重审 (round ${K.reviewRound})`})}catch(K){n({kind:"error",title:"Review 派发失败",body:K instanceof Error?K.message:String(K)})}finally{g(!1)}}},L=async()=>{if(!E)return;const d=E.status==="merged"?`task ${E.id} 已 merged。Retry 会用同样的标题/描述新建一个 task 从头跑,确定继续?`:`Retry task ${E.id}?这会新建一个 task 从头开始,旧 task 保留为历史。`;if(confirm(d)){h(!0);try{const O=await P.tasks.retry(E.id);n({kind:"success",title:`已新建 task ${O.id}`}),s(Te(O.projectId,O.id))}catch(O){n({kind:"error",title:"Retry 失败",body:O instanceof Error?O.message:String(O)})}finally{h(!1)}}},Q=async()=>{if(E&&confirm(`将合并 PR #${E.prNumber} 并收尾(删本地分支 + 压缩 agent 上下文),确定?`)){l(!0);try{const d=await P.tasks.complete(E.id);T(d),n({kind:"success",title:"已标记完成,开始收尾"})}catch(d){n({kind:"error",title:"标记完成失败",body:d instanceof Error?d.message:String(d)})}finally{l(!1)}}},V=async()=>{if(E&&confirm(`派 dev 再修一轮(round → ${E.reviewRound+1}),完成后自动转 QA review?`)){S(!0);try{const d=await P.tasks.continue(E.id);T(d),n({kind:"success",title:`已继续一轮 (round ${d.reviewRound})`})}catch(d){n({kind:"error",title:"继续一轮失败",body:d instanceof Error?d.message:String(d)})}finally{S(!1)}}},ie=async()=>{if(E&&confirm(`确认完成 task ${E.id}?project.merge 为 auto 时由 baxian 自动执行合并。`)){l(!0);try{const d=await P.tasks.complete(E.id);T(d),n({kind:"success",title:`已确认(${d.status})`})}catch(d){n({kind:"error",title:"确认失败",body:d instanceof Error?d.message:String(d)})}finally{l(!1)}}};return e.jsxs("div",{children:[e.jsx("button",{type:"button",onClick:()=>s(-1),className:"btn-ghost mb-3",children:"← 返回"}),B&&!E&&e.jsxs("div",{className:"text-sm text-danger",children:["Error: ",B]}),H&&!E&&!B&&e.jsxs("div",{className:"text-sm text-danger",children:["Task not found: ",t]}),!E&&!B&&!H&&e.jsx("div",{className:"text-sm text-og-500",children:"Loading…"}),E&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsxs("h1",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"shrink-0 font-mono text-base text-og-400",children:E.id}),e.jsx("span",{className:"min-w-0 truncate font-display text-base font-semibold tracking-tight text-og-1000",title:E.title,children:E.title})]})}),e.jsxs("div",{className:"grid grid-cols-1 items-start gap-6 lg:grid-cols-2",children:[e.jsx("section",{className:"min-w-0",children:j(E)}),e.jsx("aside",{className:"min-w-0 space-y-4",children:X(E)})]})]}),a&&E&&e.jsx(St,{mode:"edit",open:!0,onClose:()=>r(!1),task:E,onUpdated:T})]});function j(d){const O=d.preferredAgentId==="",K=d.status==="approved"&&d.prNumber!==void 0,z=d.status==="merge-ready"&&d.prNumber!==void 0,C=d.status==="ready",I=d.status==="max_rounds"&&d.phase!=="spec",_=d.status==="max_rounds"&&d.phase==="spec",J=Or(d.prUrl,d.branch??"");return e.jsxs("div",{children:[B&&e.jsxs("div",{className:"mb-4 text-sm text-danger",children:["Error: ",B]}),O&&e.jsx("div",{className:"mb-4 rounded-md border border-[#fde68a] bg-[#fef3c7]/60 px-3 py-2.5 text-xs text-warn",children:d.status==="pending"?e.jsxs(e.Fragment,{children:["This task has no dev assigned yet — click ",e.jsx("b",{className:"font-semibold",children:"Edit"})," to choose one, or use the Start button on any idle dev card."]}):e.jsxs(e.Fragment,{children:["This is a legacy task with no preferred dev (read-only in status ",e.jsx("b",{className:"font-semibold",children:d.status}),")."]})}),e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:`${ys[d.status]} !text-base`,children:d.status}),e.jsxs("span",{className:"text-base text-og-500",children:["Round ",e.jsx("span",{className:"font-semibold text-og-800",children:d.reviewRound})]}),e.jsxs("span",{className:"text-base text-og-500",children:["Spec ",e.jsx("span",{className:"font-semibold text-og-800",children:d.specReviewRound??0})]})]}),e.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:le(d)}),e.jsxs("div",{className:"mb-4 text-xs text-og-500",children:["Created at ",ct(d.createdAt,!1),", Updated at ",ct(d.updatedAt,!1)]}),M&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fecaca] bg-[#fef2f2] p-4 text-sm text-danger",children:[e.jsx("div",{className:"font-semibold",children:"Review verdict missing"}),e.jsxs("div",{className:"mt-1 text-og-700",children:["QA dispatched at ",ct(d.reviewDispatchedAt)," 超过 10 分钟未提交 verdict。 可能原因:QA agent 上下文压缩后误报已完成、agent 卡住、或 GitHub API 异常。"]}),e.jsx("div",{className:"mt-2 text-og-700",children:"建议:打开 QA terminal 检查实际状态,或手动 Call review 重新派发。"})]}),K&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"QA approved · verifying feedback"}),e.jsx("div",{className:"mt-1 text-og-700",children:"Dev keeps the task reserved while it checks whether all human or agent feedback has been handled."}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),C&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"✅ 评审通过 · 等待人工确认"}),e.jsxs("div",{className:"mt-1 text-og-700",children:["Server review 完成(",d.reviewRound," 轮)。点击「确认」收尾",d.prNumber?"(merge:auto 时自动合并 PR)":"",",或「Cancel」丢弃。"]}),e.jsx(is,{taskId:d.id}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),z&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"✅ PR ready · 等待人工确认"}),e.jsx("div",{className:"mt-1 text-og-700",children:"Dev finished its post-approve checks — 点击「确认」收尾(merge:auto 时由 baxian 执行合并)。"}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),I&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fde68a] bg-[#fef3c7]/60 p-4 text-sm text-warn",children:[e.jsxs("div",{className:"font-semibold",children:["已达 review 轮次上限(round ",d.reviewRound,")"]}),e.jsx("div",{className:"mt-1 text-og-700",children:"可「标记完成」合并收尾,或「继续一轮」由 dev 再修一轮(完成后自动转 QA review)。"}),e.jsx("div",{className:"mt-2 text-og-700",children:"轮次越多,Agent 越容易偏离重点。若无严重问题,建议先合并本次成果,剩余问题另开任务跟进。"})]}),_&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fde68a] bg-[#fef3c7]/60 p-4 text-sm text-warn",children:[e.jsxs("div",{className:"font-semibold",children:["已达 spec review 轮次上限(round ",d.specReviewRound??0,")"]}),e.jsx("div",{className:"mt-1 text-og-700",children:"Spec 评审多轮未达成一致,任务已暂停。spec 是过程产物、没有可合并的成果, 可「Retry」新建任务从头跑(丢弃当前 worktree),或「Cancel」取消。"}),e.jsx("div",{className:"mt-2 text-og-700",children:"建议先查看下方评审记录定位分歧,细化任务描述后再 Retry。"}),e.jsx(is,{taskId:d.id})]}),e.jsxs("div",{className:"card mb-4 flex flex-wrap items-center gap-x-6 gap-y-1 p-4 text-sm",children:[e.jsxs("span",{className:"text-og-500",children:["PR:"," ",d.prNumber?d.prUrl?e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent-hover",children:["#",d.prNumber]}):e.jsxs("span",{className:"font-mono text-og-800",children:["#",d.prNumber]}):e.jsx("span",{className:"text-og-400",children:"—"})]}),e.jsxs("span",{className:"text-og-500",children:["Branch:"," ",d.branch?J?e.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-accent hover:text-accent-hover",children:d.branch}):e.jsx("span",{className:"font-mono text-og-800",children:d.branch}):e.jsx("span",{className:"text-og-400",children:"—"})]})]}),e.jsx("pre",{className:"card mb-4 whitespace-pre-wrap p-4 text-sm text-og-800",children:d.description||e.jsx("span",{className:"text-og-400",children:"(无描述)"})}),e.jsx(Tr,{task:d})]})}function X(d){if(y===null)return e.jsx("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:"加载中…"});const O=y.find(_=>_.id===d.projectId),K=d.agentId||d.preferredAgentId,z=(O==null?void 0:O.agent.find(_=>_.some(J=>J.id===K)))??(d.qaAgentId?O==null?void 0:O.agent.find(_=>_.some(J=>J.id===d.qaAgentId)):void 0),C=z==null?void 0:z.find(_=>_.role==="dev"),I=z==null?void 0:z.find(_=>_.role==="qa");return!C&&!I?e.jsx("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:"暂无关联 Agent"}):e.jsxs(e.Fragment,{children:[C?ce(d,C):e.jsx(as,{role:"dev"}),I?ce(d,I):e.jsx(as,{role:"qa"})]})}function ce(d,O){const K=R.get(O.id),z=K??{id:O.id,projectId:d.projectId,runtimeStatus:"unknown",tmuxSessionStatus:"unknown",stale:!0};return e.jsx(ws,{agent:z,projectId:d.projectId,role:O.role,runtime:O.runtime,pendingRestart:N&&!K,terminalLoading:!N&&!K&&!W,showTaskBinding:!1,terminalMode:"embedded-full"},O.id)}function le(d){const O=d.status==="max_rounds",K=O&&d.phase!=="spec",z=O&&d.phase==="spec",C=d.status==="ready"||d.status==="merge-ready",I=d.reviewMode==="server"&&d.status==="approved",_=d.status==="pending",J=d.status==="pending"||d.status==="in_progress"||O||C||I,te=(rs.has(d.status)||z)&&!!d.preferredAgentId,A=!!d.prNumber&&!z&&d.reviewMode!=="server",U=d.reviewMode==="server",F=K&&(!!d.prNumber||U),re=K&&(!!d.prNumber||U)&&!!d.agentId,oe=U&&d.status==="approved",ue=d.preferredAgentId==="";return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:!_,onClick:()=>r(!0),className:"btn-secondary",children:"Edit"}),e.jsx("button",{type:"button",disabled:!J||o,onClick:Y,className:"btn-secondary !border-[#fecaca] !text-danger hover:!bg-[#fef2f2] hover:!border-danger",children:o?"Cancelling…":"Cancel"}),!K&&e.jsx("button",{type:"button",disabled:!te||u,onClick:L,title:rs.has(d.status)||z?ue?"Legacy task has no preferred dev to retry against":"新建一个 task 从头跑,丢弃当前 worktree/branch":`Cannot retry in status ${d.status}`,className:"btn-secondary",children:u?"Retrying…":"Retry"}),e.jsx("button",{type:"button",disabled:!A||m,onClick:q,title:d.prNumber?z?"spec 阶段达上限不支持 Call review":"让 QA agent 立即开始新一轮 review(reviewRound +1)":"该 task 还没有 PR,无法派 review",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:m?"Dispatching…":"Call review"}),K&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:!re||v,onClick:V,title:"派 dev 再修一轮,完成后自动转 QA review",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:v?"Continuing…":"继续一轮"}),e.jsx("button",{type:"button",disabled:!F||f,onClick:Q,title:"合并 PR 并收尾(删本地分支 + 压缩上下文)",className:"btn-secondary !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:f?"Completing…":"标记完成"})]}),C&&e.jsx("button",{type:"button",disabled:f,onClick:ie,title:"确认完成;merge:auto 时由 baxian 执行合并",className:"btn-secondary !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:f?"Confirming…":"确认"}),oe&&e.jsx("button",{type:"button",disabled:f,onClick:ie,title:"发布派发失败后重试 push/PR 步骤",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:f?"Retrying…":"重试发布"})]})}}function as({role:t}){return e.jsxs("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:["暂无 ",t==="dev"?"Dev":"QA"," Agent"]})}function is({taskId:t}){var o;const[s,n]=i.useState(null);if(i.useEffect(()=>{let c=!0;return P.tasks.reviews(t).then(u=>{c&&n(u)}).catch(()=>{c&&n([])}),()=>{c=!1}},[t]),!s||s.length===0)return null;const a=s[s.length-1],r=s.reduce((c,u)=>{var h;return c+(((h=u.findings)==null?void 0:h.findings.length)??0)},0);return e.jsxs("div",{className:"mt-2 text-xs text-og-700",children:["Review ",s.length," 轮 · 最终 verdict ",e.jsx("span",{className:"font-mono",children:((o=a.findings)==null?void 0:o.verdict)??"—"})," ","· findings 共 ",r," 条"]})}function Fr(){const{agentId:t}=He(),{projects:s}=st(),n=i.useMemo(()=>{if(t)for(const a of s??[])for(const r of a.agent){const o=r.find(c=>c.id===t);if(o)return o.runtime}},[t,s]);return t?e.jsxs("div",{"data-testid":"terminal-page-container",className:"flex min-h-0 flex-1 flex-col overflow-hidden border border-hairline bg-surface",children:[e.jsxs("div",{className:"flex h-8 flex-none select-none items-center gap-3 border-b border-hairline bg-page px-3 font-mono text-xs text-og-500",children:[e.jsx("span",{"aria-hidden":!0,className:"block h-1.5 w-1.5 rounded-full bg-success"}),e.jsx("span",{className:"text-og-700",title:us(t,n),children:t})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(_e,{agentId:t,mode:"full",interactive:!0,arrowKeys:!0})})]}):e.jsx("div",{className:"text-sm text-danger",children:"No agent specified"})}function Br(t){return t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("--- ")||t.startsWith("+++ ")||t.startsWith("new file")||t.startsWith("deleted file")||t.startsWith("rename ")||t.startsWith("similarity ")||t.startsWith("old mode")||t.startsWith("new mode")}function Hr(t){if(!t)return[];const s=[];let n=!1;for(const a of t.split(/\r?\n/)){let r;a.startsWith("@@")?(r="hunk",n=!0):a.startsWith("diff --git")?(r="file",n=!1):a.startsWith("\\")?r="meta":n?r=a.startsWith("+")?"add":a.startsWith("-")?"del":"context":Br(a)?r="file":r="context",s.push({type:r,text:a})}return s}const Ur={file:"bg-og-50 font-semibold text-og-700",hunk:"bg-accent-soft text-accent",add:"bg-[#e6f4ec] text-success",del:"bg-[#fdecea] text-danger",context:"text-og-700",meta:"text-og-400"};function Wr({content:t,diffstat:s}){const n=Hr(t);return n.length===0?e.jsx("div",{className:"text-sm text-og-400",children:"无内容"}):e.jsxs("div",{children:[s&&e.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md border border-hairline bg-og-50 p-3 font-mono text-xs text-og-700",children:s.trimEnd()}),e.jsx("div",{className:"overflow-auto rounded-md border border-hairline bg-surface font-mono text-xs leading-[1.5] [max-height:70vh]",children:n.map((a,r)=>e.jsx("div",{className:`whitespace-pre px-3 ${Ur[a.type]}`,children:a.text===""?" ":a.text},r))})]})}const zr={critical:"pill !bg-[#fdecea] !text-danger",major:"pill pill-warn",minor:"pill"},qr={fix:"pill pill-live",reject:"pill pill-warn","out-of-scope":"pill"};function os(t){if(!t)return"";const s=t.match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/);return s?`${s[1]} ${s[2]}`:t}function cs(t){return t.file?t.line?`${t.file}:${t.line}`:t.file:t.location??""}function Gr(){const{taskId:t="",phase:s="",round:n=""}=He(),a=me(),{hash:r}=ls(),{data:o}=Rt(t),c=o?`${o.specReviewRound??0}:${o.reviewRound}:${o.status}:${o.phase??"code"}`:void 0,{rounds:u,loaded:h,error:m}=Is(t,c),g=Number(n),f=(u??[]).find(l=>l.phase===s&&l.round===g)??null;return i.useEffect(()=>{if(!f||!r)return;const l=document.getElementById(r.replace("#",""));l==null||l.scrollIntoView({behavior:"smooth",block:"start"})},[f,r]),e.jsxs("div",{className:"mx-auto w-full max-w-5xl",children:[e.jsx("button",{type:"button",onClick:()=>a(-1),className:"btn-ghost mb-3",children:"← 返回"}),e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:t}),e.jsx("span",{className:"text-base font-semibold text-og-1000",children:(o==null?void 0:o.title)??""})]}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-og-500",children:[e.jsx("span",{className:"pill",children:s}),e.jsxs("span",{children:["第 ",n," 轮"]}),(f==null?void 0:f.findings)&&e.jsx("span",{className:f.findings.verdict==="approve"?"pill pill-live":"pill pill-warn",children:f.findings.verdict}),f&&e.jsxs("span",{className:"text-og-400",children:[os(f.startedAt),f.completedAt?` → ${os(f.completedAt)}`:""]})]}),!h&&e.jsx("div",{className:"text-sm text-og-500",children:"加载中…"}),h&&m&&e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",m]}),h&&!m&&!f&&e.jsxs("div",{className:"text-sm text-danger",children:["未找到该轮评审(",s," 第 ",n," 轮)。"]}),f&&e.jsx(Qr,{round:f})]})}function Qr({round:t}){var r,o;const s=((r=t.findings)==null?void 0:r.findings)??[],n=((o=t.response)==null?void 0:o.responses)??[],a=new Map(s.map(c=>[c.id,c]));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{id:"diff",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:t.phase==="spec"?"规格稿":"代码改动"}),t.contentTruncated&&e.jsx("div",{className:"mb-2 text-xs text-warn",children:"内容较大,展示的是截断后的片段。"}),t.content?t.phase==="spec"?e.jsx("pre",{className:"card whitespace-pre-wrap break-words p-4 text-sm text-og-800",children:t.content}):e.jsx(Wr,{content:t.content,diffstat:t.diffstat}):e.jsx("div",{className:"text-sm text-og-400",children:"无内容"})]}),e.jsxs("section",{id:"review",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:"QA 评审"}),t.findings===void 0?e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未提交。"}):s.length===0?e.jsx("div",{className:"text-sm text-og-400",children:"本轮无 findings。"}):e.jsx("div",{className:"space-y-2",children:s.map(c=>e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:c.id}),e.jsx("span",{className:zr[c.severity],children:c.severity}),cs(c)&&e.jsx("span",{className:"min-w-0 break-all font-mono text-xs text-og-500",children:cs(c)})]}),e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:c.message})]},c.id))})]}),n.length>0&&e.jsxs("section",{id:"response",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:"Dev 反馈"}),e.jsx("div",{className:"space-y-2",children:n.map(c=>{const u=a.get(c.findingId);return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:c.findingId}),e.jsx("span",{className:qr[c.action],children:c.action}),c.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:c.commitSha.slice(0,9)})]}),u&&e.jsxs("div",{className:"mb-1 break-words text-xs text-og-500",children:["↳ ",u.message]}),e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:c.rationale})]},c.findingId)})})]})]})}function Vr(t,s){const[n,a]=i.useState(null),[r,o]=i.useState(!1),[c,u]=i.useState(null),h=i.useRef(t),m=i.useRef(s),g=i.useRef(0),f=i.useRef(!1);return i.useEffect(()=>{if(h.current!==t)h.current=t,f.current=!1,a(null),o(!1);else if(m.current===void 0&&s!==void 0&&f.current){m.current=s;return}m.current=s;const v=++g.current;u(null),P.tasks.githubReview(t).then(S=>{g.current===v&&(f.current=S.available===!0&&!S.error,a(S),o(!0))}).catch(S=>{g.current===v&&(f.current=!1,u(S instanceof Error?S.message:String(S)),a(null),o(!0))})},[t,s]),{data:n,loaded:r,error:c}}const Kr={approve:"pill pill-live","request-changes":"pill pill-warn",comment:"pill"},Jr={approve:"approve","request-changes":"request-changes",comment:"comment"},Yr={"server-mode":"该 task 为 server 评审模式,代码评审记录见任务详情的「评审记录」。","no-pr":"该 task 还没有 PR,暂无代码评审记录。","not-github":"该 task 的仓库不是 GitHub 仓库,无法拉取 PR 评审记录。"};function Xr(t){return t==="server-mode"||t==="no-pr"||t==="not-github"?t:void 0}function bt(t){if(!t)return"";const s=t.match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/);return s?`${s[1]} ${s[2]}`:t}function Zr(t){const s=[];let n=[];for(const a of t)a.kind==="review"?(s.push({items:n,review:a}),n=[]):n.push(a);return n.length>0&&s.push({items:n}),s}function ea(){const{taskId:t=""}=He(),s=me(),{data:n}=Rt(t),a=n?`${n.reviewRound}:${n.latestHeadSha??""}:${n.status}`:void 0,{data:r,loaded:o,error:c}=Vr(t,a),u=(r==null?void 0:r.prNumber)??(n==null?void 0:n.prNumber),h=(r==null?void 0:r.prUrl)??(n==null?void 0:n.prUrl),m=r?Zr(r.items):[];return e.jsxs("div",{className:"mx-auto w-full max-w-5xl",children:[e.jsx("button",{type:"button",onClick:()=>s(-1),className:"btn-ghost mb-3",children:"← 返回"}),e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:t}),e.jsx("span",{className:"text-base font-semibold text-og-1000",children:(n==null?void 0:n.title)??""})]}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-og-500",children:[e.jsx("span",{className:"pill",children:"代码评审"}),h&&u!==void 0&&e.jsxs("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent-hover",children:["Open PR #",u]})]}),!o&&e.jsx("div",{className:"text-sm text-og-500",children:"加载中…"}),o&&c&&e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",c]}),o&&!c&&r&&!r.available&&e.jsx("div",{className:"text-sm text-og-500",children:Yr[Xr(r.reason)??"no-pr"]}),o&&!c&&(r==null?void 0:r.available)&&(r.items.length===0?r.error?e.jsxs("div",{className:"text-sm text-warn",children:["评审记录拉取失败:",r.error]}):e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未开始"}):e.jsxs(e.Fragment,{children:[r.error&&e.jsxs("div",{className:"mb-3 text-xs text-warn",children:["部分评审记录拉取失败:",r.error,"(仅展示已获取的部分)"]}),e.jsx("div",{className:"space-y-5",children:m.map((g,f)=>e.jsx(ta,{round:g,index:f},f))})]}))]})}function ta({round:t,index:s}){const n=t.review?`第 ${s+1} 轮`:"进行中";return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs font-medium text-og-700",children:n}),e.jsxs("div",{className:"space-y-2",children:[t.items.map(a=>e.jsx(sa,{item:a},`${a.kind}-${a.id}`)),t.review&&e.jsx(na,{item:t.review})]})]})}function sa({item:t}){if(t.kind==="commit")return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"pill shrink-0",children:"提交"}),t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:t.commitSha.slice(0,9)}),t.author&&e.jsx("span",{className:"text-xs text-og-400",children:t.author}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),t.body&&e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:t.body})]});const s=t.kind==="review-comment";return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"pill shrink-0",children:s?"行内评论":"评论"}),t.author&&e.jsx("span",{className:"font-medium text-og-700",children:t.author}),s&&t.path&&e.jsx("span",{className:"min-w-0 break-all font-mono text-xs text-og-500",children:t.line!==void 0?`${t.path}:${t.line}`:t.path}),t.inReplyTo&&e.jsx("span",{className:"text-xs text-og-400",children:"↩ 回复"}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),e.jsx(Ps,{item:t})]})}function na({item:t}){const s=t.verdict??"comment";return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"shrink-0 min-w-[1.75rem] text-xs font-semibold uppercase tracking-wide text-[#c2410c]",children:"QA"}),e.jsx("span",{className:Kr[s],children:Jr[s]}),t.author&&e.jsx("span",{className:"text-xs text-og-400",children:t.author}),t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:t.commitSha.slice(0,9)}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),e.jsx(Ps,{item:t,placeholder:"(无评审正文)"})]})}function Ps({item:t,placeholder:s}){return e.jsxs(e.Fragment,{children:[t.body?e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:t.body}):s?e.jsx("div",{className:"text-og-400",children:s}):null,t.bodyTruncated&&e.jsx("div",{className:"mt-1 text-xs text-warn",children:"内容较大,已截断。"})]})}function ra(){const[t,s]=i.useState(!1);return e.jsx("button",{type:"button",onClick:()=>s(n=>!n),"aria-label":t?"切换为 Logo 图标":"切换为 Logo 文字",className:"flex h-7 min-w-[60px] shrink-0 items-center justify-center font-display text-base font-semibold tracking-tight text-og-1000",children:t?e.jsx("span",{className:"inline-flex h-6 items-center leading-none",children:"baxian"}):e.jsx("img",{src:"/baxian-logo.png",alt:"baxian",width:20,height:24,className:"block h-6 w-auto"})})}function aa(){const{phase:t,count:s,error:n,triggerRestart:a}=tt();return t==="idle"?null:t==="failed"?e.jsxs("div",{className:"flex items-center justify-between border-b border-[#fecaca] bg-[#fef2f2] px-4 py-2",children:[e.jsxs("div",{className:"text-sm text-danger",children:["❌ 重启失败:",n]}),e.jsx("button",{onClick:()=>{a()},className:"btn-ghost !text-danger hover:!bg-[#fef2f2]",children:"重试"})]}):t==="restarting"?e.jsx("div",{className:"border-b border-accent-soft bg-accent-soft/40 px-4 py-2 text-sm text-accent",children:"🔄 重启中…"}):e.jsxs("div",{className:"flex items-center justify-between border-b border-[#fde68a] bg-[#fef3c7]/60 px-4 py-2",children:[e.jsxs("div",{className:"text-sm text-warn",children:["⚠️ 有 ",s," 项配置变更待重启 baxian server 才生效"]}),e.jsx("button",{onClick:()=>{a()},className:"btn-secondary !border-warn !text-warn hover:!bg-[#fef3c7] hover:!border-warn hover:!text-warn",children:"现在重启"})]})}function ia(){const s=!ls().pathname.startsWith("/terminal/");return e.jsxs("div",{className:"flex h-dvh flex-col bg-page",children:[e.jsxs("nav",{className:"flex h-12 flex-none items-center border-b border-hairline bg-surface px-3 sm:px-6",children:[e.jsxs(Be,{to:"/",className:"flex shrink-0 items-center gap-2 font-display text-base font-semibold tracking-tight text-og-1000",children:[e.jsx("span",{"aria-hidden":!0,className:"block h-2.5 w-2.5 rounded-full bg-accent"}),"baxian"]}),e.jsx("div",{id:ks,className:"ml-auto flex min-w-0 items-center justify-end gap-2"})]}),e.jsx(aa,{}),e.jsxs("main",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-3 py-6 sm:px-6",children:[e.jsxs(Ws,{children:[e.jsx(Ee,{path:"/",element:e.jsx(mr,{})}),e.jsx(Ee,{path:"/project/:id",element:e.jsx(Sr,{})}),e.jsx(Ee,{path:"/project/:id/task/:taskId",element:e.jsx(Mr,{})}),e.jsx(Ee,{path:"/terminal/:agentId",element:e.jsx(Fr,{})}),e.jsx(Ee,{path:"/tasks/:taskId/rounds/:phase/:round",element:e.jsx(Gr,{})}),e.jsx(Ee,{path:"/tasks/:taskId/github-review",element:e.jsx(ea,{})})]}),s&&e.jsx("footer",{className:"mt-auto flex justify-center pb-4 pt-24",children:e.jsx(ra,{})})]})]})}function oa(){return e.jsx(Us,{children:e.jsx(ia,{})})}function ca({children:t}){const[s,n]=i.useState({kind:"probing"}),a=i.useRef(s);i.useEffect(()=>{a.current=s},[s]);const r=i.useCallback(async()=>{n({kind:"probing"});try{await P.config.get(),n({kind:"authorized"})}catch(o){if(o instanceof Ae&&o.status===401){n({kind:"unauthorized"});return}const c=o instanceof Error?o.message:"无法连接服务器";n({kind:"error",message:c})}},[]);return i.useEffect(()=>{r()},[r]),i.useEffect(()=>{const o=()=>{a.current.kind!=="probing"&&n({kind:"unauthorized",message:"登录已失效,请重新输入令牌"})};return window.addEventListener(Ke,o),()=>window.removeEventListener(Ke,o)},[]),s.kind==="authorized"?e.jsx(e.Fragment,{children:t}):s.kind==="error"?e.jsxs(vt,{title:"无法连接服务器",children:[e.jsx("p",{className:"text-sm text-og-600",children:s.message}),e.jsx("button",{type:"button",onClick:()=>{r()},className:"btn-primary mt-4 w-full",children:"重试"})]}):s.kind==="probing"?e.jsx(vt,{title:"加载中",children:e.jsx("p",{className:"text-sm text-og-500",children:"正在检查登录状态…"})}):e.jsx(la,{message:s.message,onSubmit:async o=>{Qs(o);try{await P.config.get(),n({kind:"authorized"})}catch(c){if(Vs(),c instanceof Ae&&c.status===401){n({kind:"unauthorized",message:"令牌无效,请重试"});return}const u=c instanceof Error?c.message:"登录失败";n({kind:"error",message:u})}}})}function vt({title:t,children:s}){return e.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-page px-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-lg border border-hairline bg-surface px-6 py-6",children:[e.jsx("h1",{className:"mb-3 font-display text-base font-semibold tracking-tight text-og-1000",children:t}),s]})})}function la({message:t,onSubmit:s}){const[n,a]=i.useState(""),[r,o]=i.useState(!1),[c,u]=i.useState(void 0),h=async g=>{g.preventDefault();const f=n.trim();if(!f){u("请输入访问令牌");return}u(void 0),o(!0);try{await s(f)}finally{o(!1)}},m=c??t;return e.jsxs(vt,{title:"登录 baxian",children:[e.jsx("p",{className:"mb-4 text-sm text-og-600",children:"服务器开启了访问鉴权,请输入访问令牌继续。"}),e.jsxs("form",{onSubmit:g=>{h(g)},children:[e.jsx("label",{className:"mb-1.5 block text-xs font-medium text-og-700",htmlFor:"baxian-token",children:"访问令牌"}),e.jsx("input",{id:"baxian-token",type:"password",autoComplete:"current-password",autoFocus:!0,value:n,onChange:g=>a(g.target.value),className:"w-full rounded-md border border-og-100 bg-surface px-2.5 py-1.5 font-mono text-sm text-og-800 placeholder:text-og-400 focus:border-accent focus:outline-none focus:ring-[3px] focus:ring-accent-soft disabled:cursor-not-allowed disabled:opacity-50",placeholder:"请输入服务器配置的 token",disabled:r}),m&&e.jsx("p",{role:"alert",className:"mt-2 text-xs text-danger",children:m}),e.jsx("button",{type:"submit",disabled:r,className:"btn-primary mt-4 w-full",children:r?"登录中…":"登录"})]})]})}Fs.createRoot(document.getElementById("root")).render(e.jsx(i.StrictMode,{children:e.jsx(an,{children:e.jsx(en,{children:e.jsx(ca,{children:e.jsx(oa,{})})})})}));
7
+ `).map(n=>n.trim()).filter(Boolean).pop()??`diff ${ns(t.content)} 行`:`规格文档 ${ns(t.content)} 行`}function Ar(t){const s={critical:0,major:0,minor:0};for(const r of t.findings)r.severity in s&&s[r.severity]++;const n=[];return s.critical&&n.push(`${s.critical} critical`),s.major&&n.push(`${s.major} major`),s.minor&&n.push(`${s.minor} minor`),`${t.findings.length} 条 findings${n.length?`(${n.join(", ")})`:""}`}function $r(t){const s={fix:0,reject:0,"out-of-scope":0};for(const a of t.responses)a.action in s&&s[a.action]++;const n=[];return s.fix&&n.push(`${s.fix} fixed`),s.reject&&n.push(`${s.reject} rejected`),s["out-of-scope"]&&n.push(`${s["out-of-scope"]} out-of-scope`),n.join(" · ")||`${t.responses.length} 条反馈`}function Tr({task:t}){const s=t.reviewMode==="server"||(t.specReviewRound??0)>0,n=t.reviewMode!=="server"&&t.prNumber!==void 0;return!s&&!n?null:e.jsxs("section",{className:"mt-4","aria-label":"评审记录",children:[e.jsx("div",{className:"mb-2 text-base text-og-700",children:"评审记录"}),e.jsxs("div",{className:"space-y-4",children:[s&&e.jsx(Ir,{task:t}),n&&e.jsx(kr,{task:t})]})]})}function Ir({task:t}){const s=me(),n=`${t.specReviewRound??0}:${t.reviewRound}:${t.status}:${t.phase??"code"}`,{rounds:a,loaded:r,error:o}=Is(t.id,n);function c(u,h,m){s(`/tasks/${encodeURIComponent(t.id)}/rounds/${u}/${h}${m}`)}return o?e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",o]}):r?((a==null?void 0:a.length)??0)===0?e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未开始"}):e.jsx(e.Fragment,{children:["spec","code"].map(u=>{const h=(a??[]).filter(m=>m.phase===u).sort((m,g)=>m.round-g.round);return h.length===0?null:e.jsx(Pr,{title:Er[u],children:h.map(m=>e.jsx(Dr,{round:m,onOpen:c},`${u}-${m.round}`))},u)})}):e.jsx("div",{className:"text-sm text-og-400",children:"加载评审记录…"})}function Pr({title:t,children:s}){return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs text-og-700",children:t}),e.jsx("div",{className:"space-y-3",children:s})]})}function Dr({round:t,onOpen:s}){const n=t.phase==="spec";return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 text-xs text-og-400",children:["第 ",t.round," 轮"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(mt,{role:"dev",label:n?"提交规格稿":"提交代码改动",summary:Cr(t),onClick:()=>s(t.phase,t.round,"")}),t.findings&&e.jsx(mt,{role:"qa",label:"评审",badge:e.jsx("span",{className:Rr[t.findings.verdict],children:t.findings.verdict}),summary:Ar(t.findings),onClick:()=>s(t.phase,t.round,"#review")}),t.response&&e.jsx(mt,{role:"dev",label:"反馈",summary:$r(t.response),onClick:()=>s(t.phase,t.round,"#response")})]})]})}function mt({role:t,label:s,summary:n,badge:a,onClick:r}){return e.jsxs("button",{type:"button",onClick:r,className:"card flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:border-accent",children:[e.jsx("span",{className:`shrink-0 min-w-[1.75rem] text-xs uppercase tracking-wide ${t==="qa"?"text-[#c2410c]":"text-accent"}`,children:t==="qa"?"QA":"dev"}),e.jsx("span",{className:"shrink-0 text-og-800",children:s}),a,e.jsx("span",{className:"min-w-0 flex-1 truncate text-og-500",children:n}),e.jsx("span",{"aria-hidden":!0,className:"shrink-0 text-og-300",children:"›"})]})}const rs=fs;function Lr(t){const[s,n]=i.useState(!1);return i.useEffect(()=>{function a(){if(!t||t.status!=="review"||!t.reviewDispatchedAt||!t.qaAgentId){n(!1);return}const o=Date.now()-Date.parse(t.reviewDispatchedAt);n(o>=hs)}a();const r=setInterval(a,3e4);return()=>clearInterval(r)},[t==null?void 0:t.status,t==null?void 0:t.reviewDispatchedAt,t==null?void 0:t.qaAgentId]),s}function Or(t,s){if(!t||!s)return null;const n=t.match(/^(https?:\/\/[^/]+\/[^/]+\/[^/]+)\/pull\/\d+/);if(!n)return null;const a=s.split("/").map(encodeURIComponent).join("/");return`${n[1]}/tree/${a}`}function Mr(){const{taskId:t=""}=He();return e.jsx(_r,{taskId:t},t)}function _r({taskId:t}){const s=me(),{show:n}=he(),[a,r]=i.useState(!1),[o,c]=i.useState(!1),[u,h]=i.useState(!1),[m,g]=i.useState(!1),[f,l]=i.useState(!1),[v,S]=i.useState(!1),[p,b]=i.useState(null),{data:k,loaded:H,error:x}=Rt(t),{projects:y}=st(),{data:w,loaded:N,error:W}=Et(),E=p??k,M=Lr(E),B=(x==null?void 0:x.message)??null,R=i.useMemo(()=>new Map((w??[]).map(d=>[d.id,d])),[w]);i.useEffect(()=>{p&&k&&k.updatedAt>=p.updatedAt&&b(null)},[p,k]);const T=d=>{b(d)},Y=async()=>{if(E&&confirm(`确定取消 task ${E.id}?`)){c(!0);try{const d=await P.tasks.update(E.id,{status:"cancelled"});T(d),n({kind:"success",title:"任务已取消"})}catch(d){n({kind:"error",title:"取消失败",body:d instanceof Error?d.message:String(d)})}finally{c(!1)}}},q=async()=>{if(!E)return;const O=fs.has(E.status)?`task ${E.id} 已是 ${E.status} 状态。手动请 QA 重审会再跑一轮 review,但状态机不会把 QA 结果带回主流程。继续?`:`请 QA 重审 task ${E.id}?这会让 QA agent 立即开始新一轮 review(reviewRound +1)。`;if(confirm(O)){g(!0);try{const K=await P.tasks.review(E.id);T(K),n({kind:"success",title:`已派 QA 重审 (round ${K.reviewRound})`})}catch(K){n({kind:"error",title:"Review 派发失败",body:K instanceof Error?K.message:String(K)})}finally{g(!1)}}},L=async()=>{if(!E)return;const d=E.status==="merged"?`task ${E.id} 已 merged。Retry 会用同样的标题/描述新建一个 task 从头跑,确定继续?`:`Retry task ${E.id}?这会新建一个 task 从头开始,旧 task 保留为历史。`;if(confirm(d)){h(!0);try{const O=await P.tasks.retry(E.id);n({kind:"success",title:`已新建 task ${O.id}`}),s(Te(O.projectId,O.id))}catch(O){n({kind:"error",title:"Retry 失败",body:O instanceof Error?O.message:String(O)})}finally{h(!1)}}},Q=async()=>{if(E&&confirm(`将合并 PR #${E.prNumber} 并收尾(删本地分支 + 压缩 agent 上下文),确定?`)){l(!0);try{const d=await P.tasks.complete(E.id);T(d),n({kind:"success",title:"已标记完成,开始收尾"})}catch(d){n({kind:"error",title:"标记完成失败",body:d instanceof Error?d.message:String(d)})}finally{l(!1)}}},V=async()=>{if(E&&confirm(`派 dev 再修一轮(round → ${E.reviewRound+1}),完成后自动转 QA review?`)){S(!0);try{const d=await P.tasks.continue(E.id);T(d),n({kind:"success",title:`已继续一轮 (round ${d.reviewRound})`})}catch(d){n({kind:"error",title:"继续一轮失败",body:d instanceof Error?d.message:String(d)})}finally{S(!1)}}},ie=async()=>{if(E&&confirm(`确认完成 task ${E.id}?project.merge 为 auto 时由 baxian 自动执行合并。`)){l(!0);try{const d=await P.tasks.complete(E.id);T(d),n({kind:"success",title:`已确认(${d.status})`})}catch(d){n({kind:"error",title:"确认失败",body:d instanceof Error?d.message:String(d)})}finally{l(!1)}}};return e.jsxs("div",{children:[e.jsx("button",{type:"button",onClick:()=>s(-1),className:"btn-ghost mb-3",children:"← 返回"}),B&&!E&&e.jsxs("div",{className:"text-sm text-danger",children:["Error: ",B]}),H&&!E&&!B&&e.jsxs("div",{className:"text-sm text-danger",children:["Task not found: ",t]}),!E&&!B&&!H&&e.jsx("div",{className:"text-sm text-og-500",children:"Loading…"}),E&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsxs("h1",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"shrink-0 font-mono text-base text-og-400",children:E.id}),e.jsx("span",{className:"min-w-0 truncate font-display text-base font-semibold tracking-tight text-og-1000",title:E.title,children:E.title})]})}),e.jsxs("div",{className:"grid grid-cols-1 items-start gap-6 lg:grid-cols-2",children:[e.jsx("section",{className:"min-w-0",children:j(E)}),e.jsx("aside",{className:"min-w-0 space-y-4",children:X(E)})]})]}),a&&E&&e.jsx(St,{mode:"edit",open:!0,onClose:()=>r(!1),task:E,onUpdated:T})]});function j(d){const O=d.preferredAgentId==="",K=d.status==="approved"&&d.prNumber!==void 0,z=d.status==="merge-ready"&&d.prNumber!==void 0,C=d.status==="ready",I=d.status==="max_rounds"&&d.phase!=="spec",_=d.status==="max_rounds"&&d.phase==="spec",J=Or(d.prUrl,d.branch??"");return e.jsxs("div",{children:[B&&e.jsxs("div",{className:"mb-4 text-sm text-danger",children:["Error: ",B]}),O&&e.jsx("div",{className:"mb-4 rounded-md border border-[#fde68a] bg-[#fef3c7]/60 px-3 py-2.5 text-xs text-warn",children:d.status==="pending"?e.jsxs(e.Fragment,{children:["This task has no dev assigned yet — click ",e.jsx("b",{className:"font-semibold",children:"Edit"})," to choose one, or use the Start button on any idle dev card."]}):e.jsxs(e.Fragment,{children:["This is a legacy task with no preferred dev (read-only in status ",e.jsx("b",{className:"font-semibold",children:d.status}),")."]})}),e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:`${ys[d.status]} text-sm`,children:d.status}),e.jsxs("span",{className:"text-sm text-og-500",children:["Round ",e.jsx("span",{className:"font-semibold text-og-800",children:d.reviewRound})]}),e.jsxs("span",{className:"text-sm text-og-500",children:["Spec ",e.jsx("span",{className:"font-semibold text-og-800",children:d.specReviewRound??0})]})]}),e.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:le(d)}),e.jsxs("div",{className:"mb-4 text-xs text-og-500",children:["Created at ",ct(d.createdAt,!1),", Updated at ",ct(d.updatedAt,!1)]}),M&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fecaca] bg-[#fef2f2] p-4 text-sm text-danger",children:[e.jsx("div",{className:"font-semibold",children:"Review verdict missing"}),e.jsxs("div",{className:"mt-1 text-og-700",children:["QA dispatched at ",ct(d.reviewDispatchedAt)," 超过 10 分钟未提交 verdict。 可能原因:QA agent 上下文压缩后误报已完成、agent 卡住、或 GitHub API 异常。"]}),e.jsx("div",{className:"mt-2 text-og-700",children:"建议:打开 QA terminal 检查实际状态,或手动 Call review 重新派发。"})]}),K&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"QA approved · verifying feedback"}),e.jsx("div",{className:"mt-1 text-og-700",children:"Dev keeps the task reserved while it checks whether all human or agent feedback has been handled."}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),C&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"✅ 评审通过 · 等待人工确认"}),e.jsxs("div",{className:"mt-1 text-og-700",children:["Server review 完成(",d.reviewRound," 轮)。点击「确认」收尾",d.prNumber?"(merge:auto 时自动合并 PR)":"",",或「Cancel」丢弃。"]}),e.jsx(is,{taskId:d.id}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),z&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#bbf7d0] bg-[#f0fdf4] p-4 text-sm text-success",children:[e.jsx("div",{className:"font-semibold",children:"✅ PR ready · 等待人工确认"}),e.jsx("div",{className:"mt-1 text-og-700",children:"Dev finished its post-approve checks — 点击「确认」收尾(merge:auto 时由 baxian 执行合并)。"}),d.prUrl&&e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"btn-secondary mt-3 !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:["Open PR #",d.prNumber]})]}),I&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fde68a] bg-[#fef3c7]/60 p-4 text-sm text-warn",children:[e.jsxs("div",{className:"font-semibold",children:["已达 review 轮次上限(round ",d.reviewRound,")"]}),e.jsx("div",{className:"mt-1 text-og-700",children:"可「标记完成」合并收尾,或「继续一轮」由 dev 再修一轮(完成后自动转 QA review)。"}),e.jsx("div",{className:"mt-2 text-og-700",children:"轮次越多,Agent 越容易偏离重点。若无严重问题,建议先合并本次成果,剩余问题另开任务跟进。"})]}),_&&e.jsxs("div",{className:"mb-4 rounded-lg border border-[#fde68a] bg-[#fef3c7]/60 p-4 text-sm text-warn",children:[e.jsxs("div",{className:"font-semibold",children:["已达 spec review 轮次上限(round ",d.specReviewRound??0,")"]}),e.jsx("div",{className:"mt-1 text-og-700",children:"Spec 评审多轮未达成一致,任务已暂停。spec 是过程产物、没有可合并的成果, 可「Retry」新建任务从头跑(丢弃当前 worktree),或「Cancel」取消。"}),e.jsx("div",{className:"mt-2 text-og-700",children:"建议先查看下方评审记录定位分歧,细化任务描述后再 Retry。"}),e.jsx(is,{taskId:d.id})]}),e.jsxs("div",{className:"card mb-4 flex flex-wrap items-center gap-x-6 gap-y-1 p-4 text-sm",children:[e.jsxs("span",{className:"text-og-500",children:["PR:"," ",d.prNumber?d.prUrl?e.jsxs("a",{href:d.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent-hover",children:["#",d.prNumber]}):e.jsxs("span",{className:"font-mono text-og-800",children:["#",d.prNumber]}):e.jsx("span",{className:"text-og-400",children:"—"})]}),e.jsxs("span",{className:"text-og-500",children:["Branch:"," ",d.branch?J?e.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-accent hover:text-accent-hover",children:d.branch}):e.jsx("span",{className:"font-mono text-og-800",children:d.branch}):e.jsx("span",{className:"text-og-400",children:"—"})]})]}),e.jsx("pre",{className:"card mb-4 whitespace-pre-wrap p-4 text-sm text-og-800",children:d.description||e.jsx("span",{className:"text-og-400",children:"(无描述)"})}),e.jsx(Tr,{task:d})]})}function X(d){if(y===null)return e.jsx("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:"加载中…"});const O=y.find(_=>_.id===d.projectId),K=d.agentId||d.preferredAgentId,z=(O==null?void 0:O.agent.find(_=>_.some(J=>J.id===K)))??(d.qaAgentId?O==null?void 0:O.agent.find(_=>_.some(J=>J.id===d.qaAgentId)):void 0),C=z==null?void 0:z.find(_=>_.role==="dev"),I=z==null?void 0:z.find(_=>_.role==="qa");return!C&&!I?e.jsx("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:"暂无关联 Agent"}):e.jsxs(e.Fragment,{children:[C?ce(d,C):e.jsx(as,{role:"dev"}),I?ce(d,I):e.jsx(as,{role:"qa"})]})}function ce(d,O){const K=R.get(O.id),z=K??{id:O.id,projectId:d.projectId,runtimeStatus:"unknown",tmuxSessionStatus:"unknown",stale:!0};return e.jsx(ws,{agent:z,projectId:d.projectId,role:O.role,runtime:O.runtime,pendingRestart:N&&!K,terminalLoading:!N&&!K&&!W,showTaskBinding:!1,terminalMode:"embedded-full"},O.id)}function le(d){const O=d.status==="max_rounds",K=O&&d.phase!=="spec",z=O&&d.phase==="spec",C=d.status==="ready"||d.status==="merge-ready",I=d.reviewMode==="server"&&d.status==="approved",_=d.status==="pending",J=d.status==="pending"||d.status==="in_progress"||O||C||I,te=(rs.has(d.status)||z)&&!!d.preferredAgentId,A=!!d.prNumber&&!z&&d.reviewMode!=="server",U=d.reviewMode==="server",F=K&&(!!d.prNumber||U),re=K&&(!!d.prNumber||U)&&!!d.agentId,oe=U&&d.status==="approved",ue=d.preferredAgentId==="";return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:!_,onClick:()=>r(!0),className:"btn-secondary",children:"Edit"}),e.jsx("button",{type:"button",disabled:!J||o,onClick:Y,className:"btn-secondary !border-[#fecaca] !text-danger hover:!bg-[#fef2f2] hover:!border-danger",children:o?"Cancelling…":"Cancel"}),!K&&e.jsx("button",{type:"button",disabled:!te||u,onClick:L,title:rs.has(d.status)||z?ue?"Legacy task has no preferred dev to retry against":"新建一个 task 从头跑,丢弃当前 worktree/branch":`Cannot retry in status ${d.status}`,className:"btn-secondary",children:u?"Retrying…":"Retry"}),e.jsx("button",{type:"button",disabled:!A||m,onClick:q,title:d.prNumber?z?"spec 阶段达上限不支持 Call review":"让 QA agent 立即开始新一轮 review(reviewRound +1)":"该 task 还没有 PR,无法派 review",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:m?"Dispatching…":"Call review"}),K&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",disabled:!re||v,onClick:V,title:"派 dev 再修一轮,完成后自动转 QA review",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:v?"Continuing…":"继续一轮"}),e.jsx("button",{type:"button",disabled:!F||f,onClick:Q,title:"合并 PR 并收尾(删本地分支 + 压缩上下文)",className:"btn-secondary !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:f?"Completing…":"标记完成"})]}),C&&e.jsx("button",{type:"button",disabled:f,onClick:ie,title:"确认完成;merge:auto 时由 baxian 执行合并",className:"btn-secondary !border-[#bbf7d0] !text-success hover:!bg-[#dcfce7] hover:!border-success",children:f?"Confirming…":"确认"}),oe&&e.jsx("button",{type:"button",disabled:f,onClick:ie,title:"发布派发失败后重试 push/PR 步骤",className:"btn-secondary !border-accent-soft !text-accent hover:!bg-accent-soft hover:!border-accent",children:f?"Retrying…":"重试发布"})]})}}function as({role:t}){return e.jsxs("div",{className:"rounded-lg border border-hairline bg-surface px-3 py-6 text-center text-sm text-og-400",children:["暂无 ",t==="dev"?"Dev":"QA"," Agent"]})}function is({taskId:t}){var o;const[s,n]=i.useState(null);if(i.useEffect(()=>{let c=!0;return P.tasks.reviews(t).then(u=>{c&&n(u)}).catch(()=>{c&&n([])}),()=>{c=!1}},[t]),!s||s.length===0)return null;const a=s[s.length-1],r=s.reduce((c,u)=>{var h;return c+(((h=u.findings)==null?void 0:h.findings.length)??0)},0);return e.jsxs("div",{className:"mt-2 text-xs text-og-700",children:["Review ",s.length," 轮 · 最终 verdict ",e.jsx("span",{className:"font-mono",children:((o=a.findings)==null?void 0:o.verdict)??"—"})," ","· findings 共 ",r," 条"]})}function Fr(){const{agentId:t}=He(),{projects:s}=st(),n=i.useMemo(()=>{if(t)for(const a of s??[])for(const r of a.agent){const o=r.find(c=>c.id===t);if(o)return o.runtime}},[t,s]);return t?e.jsxs("div",{"data-testid":"terminal-page-container",className:"flex min-h-0 flex-1 flex-col overflow-hidden border border-hairline bg-surface",children:[e.jsxs("div",{className:"flex h-8 flex-none select-none items-center gap-3 border-b border-hairline bg-page px-3 font-mono text-xs text-og-500",children:[e.jsx("span",{"aria-hidden":!0,className:"block h-1.5 w-1.5 rounded-full bg-success"}),e.jsx("span",{className:"text-og-700",title:us(t,n),children:t})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(_e,{agentId:t,mode:"full",interactive:!0,arrowKeys:!0})})]}):e.jsx("div",{className:"text-sm text-danger",children:"No agent specified"})}function Br(t){return t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("--- ")||t.startsWith("+++ ")||t.startsWith("new file")||t.startsWith("deleted file")||t.startsWith("rename ")||t.startsWith("similarity ")||t.startsWith("old mode")||t.startsWith("new mode")}function Hr(t){if(!t)return[];const s=[];let n=!1;for(const a of t.split(/\r?\n/)){let r;a.startsWith("@@")?(r="hunk",n=!0):a.startsWith("diff --git")?(r="file",n=!1):a.startsWith("\\")?r="meta":n?r=a.startsWith("+")?"add":a.startsWith("-")?"del":"context":Br(a)?r="file":r="context",s.push({type:r,text:a})}return s}const Ur={file:"bg-og-50 font-semibold text-og-700",hunk:"bg-accent-soft text-accent",add:"bg-[#e6f4ec] text-success",del:"bg-[#fdecea] text-danger",context:"text-og-700",meta:"text-og-400"};function Wr({content:t,diffstat:s}){const n=Hr(t);return n.length===0?e.jsx("div",{className:"text-sm text-og-400",children:"无内容"}):e.jsxs("div",{children:[s&&e.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md border border-hairline bg-og-50 p-3 font-mono text-xs text-og-700",children:s.trimEnd()}),e.jsx("div",{className:"overflow-auto rounded-md border border-hairline bg-surface font-mono text-xs leading-[1.5] [max-height:70vh]",children:n.map((a,r)=>e.jsx("div",{className:`whitespace-pre px-3 ${Ur[a.type]}`,children:a.text===""?" ":a.text},r))})]})}const zr={critical:"pill !bg-[#fdecea] !text-danger",major:"pill pill-warn",minor:"pill"},qr={fix:"pill pill-live",reject:"pill pill-warn","out-of-scope":"pill"};function os(t){if(!t)return"";const s=t.match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/);return s?`${s[1]} ${s[2]}`:t}function cs(t){return t.file?t.line?`${t.file}:${t.line}`:t.file:t.location??""}function Gr(){const{taskId:t="",phase:s="",round:n=""}=He(),a=me(),{hash:r}=ls(),{data:o}=Rt(t),c=o?`${o.specReviewRound??0}:${o.reviewRound}:${o.status}:${o.phase??"code"}`:void 0,{rounds:u,loaded:h,error:m}=Is(t,c),g=Number(n),f=(u??[]).find(l=>l.phase===s&&l.round===g)??null;return i.useEffect(()=>{if(!f||!r)return;const l=document.getElementById(r.replace("#",""));l==null||l.scrollIntoView({behavior:"smooth",block:"start"})},[f,r]),e.jsxs("div",{className:"mx-auto w-full max-w-5xl",children:[e.jsx("button",{type:"button",onClick:()=>a(-1),className:"btn-ghost mb-3",children:"← 返回"}),e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:t}),e.jsx("span",{className:"text-base font-semibold text-og-1000",children:(o==null?void 0:o.title)??""})]}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-og-500",children:[e.jsx("span",{className:"pill",children:s}),e.jsxs("span",{children:["第 ",n," 轮"]}),(f==null?void 0:f.findings)&&e.jsx("span",{className:f.findings.verdict==="approve"?"pill pill-live":"pill pill-warn",children:f.findings.verdict}),f&&e.jsxs("span",{className:"text-og-400",children:[os(f.startedAt),f.completedAt?` → ${os(f.completedAt)}`:""]})]}),!h&&e.jsx("div",{className:"text-sm text-og-500",children:"加载中…"}),h&&m&&e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",m]}),h&&!m&&!f&&e.jsxs("div",{className:"text-sm text-danger",children:["未找到该轮评审(",s," 第 ",n," 轮)。"]}),f&&e.jsx(Qr,{round:f})]})}function Qr({round:t}){var r,o;const s=((r=t.findings)==null?void 0:r.findings)??[],n=((o=t.response)==null?void 0:o.responses)??[],a=new Map(s.map(c=>[c.id,c]));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{id:"diff",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:t.phase==="spec"?"规格稿":"代码改动"}),t.contentTruncated&&e.jsx("div",{className:"mb-2 text-xs text-warn",children:"内容较大,展示的是截断后的片段。"}),t.content?t.phase==="spec"?e.jsx("pre",{className:"card whitespace-pre-wrap break-words p-4 text-sm text-og-800",children:t.content}):e.jsx(Wr,{content:t.content,diffstat:t.diffstat}):e.jsx("div",{className:"text-sm text-og-400",children:"无内容"})]}),e.jsxs("section",{id:"review",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:"QA 评审"}),t.findings===void 0?e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未提交。"}):s.length===0?e.jsx("div",{className:"text-sm text-og-400",children:"本轮无 findings。"}):e.jsx("div",{className:"space-y-2",children:s.map(c=>e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:c.id}),e.jsx("span",{className:zr[c.severity],children:c.severity}),cs(c)&&e.jsx("span",{className:"min-w-0 break-all font-mono text-xs text-og-500",children:cs(c)})]}),e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:c.message})]},c.id))})]}),n.length>0&&e.jsxs("section",{id:"response",children:[e.jsx("h2",{className:"mb-2 text-sm font-semibold text-og-800",children:"Dev 反馈"}),e.jsx("div",{className:"space-y-2",children:n.map(c=>{const u=a.get(c.findingId);return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:c.findingId}),e.jsx("span",{className:qr[c.action],children:c.action}),c.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:c.commitSha.slice(0,9)})]}),u&&e.jsxs("div",{className:"mb-1 break-words text-xs text-og-500",children:["↳ ",u.message]}),e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:c.rationale})]},c.findingId)})})]})]})}function Vr(t,s){const[n,a]=i.useState(null),[r,o]=i.useState(!1),[c,u]=i.useState(null),h=i.useRef(t),m=i.useRef(s),g=i.useRef(0),f=i.useRef(!1);return i.useEffect(()=>{if(h.current!==t)h.current=t,f.current=!1,a(null),o(!1);else if(m.current===void 0&&s!==void 0&&f.current){m.current=s;return}m.current=s;const v=++g.current;u(null),P.tasks.githubReview(t).then(S=>{g.current===v&&(f.current=S.available===!0&&!S.error,a(S),o(!0))}).catch(S=>{g.current===v&&(f.current=!1,u(S instanceof Error?S.message:String(S)),a(null),o(!0))})},[t,s]),{data:n,loaded:r,error:c}}const Kr={approve:"pill pill-live","request-changes":"pill pill-warn",comment:"pill"},Jr={approve:"approve","request-changes":"request-changes",comment:"comment"},Yr={"server-mode":"该 task 为 server 评审模式,代码评审记录见任务详情的「评审记录」。","no-pr":"该 task 还没有 PR,暂无代码评审记录。","not-github":"该 task 的仓库不是 GitHub 仓库,无法拉取 PR 评审记录。"};function Xr(t){return t==="server-mode"||t==="no-pr"||t==="not-github"?t:void 0}function bt(t){if(!t)return"";const s=t.match(/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/);return s?`${s[1]} ${s[2]}`:t}function Zr(t){const s=[];let n=[];for(const a of t)a.kind==="review"?(s.push({items:n,review:a}),n=[]):n.push(a);return n.length>0&&s.push({items:n}),s}function ea(){const{taskId:t=""}=He(),s=me(),{data:n}=Rt(t),a=n?`${n.reviewRound}:${n.latestHeadSha??""}:${n.status}`:void 0,{data:r,loaded:o,error:c}=Vr(t,a),u=(r==null?void 0:r.prNumber)??(n==null?void 0:n.prNumber),h=(r==null?void 0:r.prUrl)??(n==null?void 0:n.prUrl),m=r?Zr(r.items):[];return e.jsxs("div",{className:"mx-auto w-full max-w-5xl",children:[e.jsx("button",{type:"button",onClick:()=>s(-1),className:"btn-ghost mb-3",children:"← 返回"}),e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-2",children:[e.jsx("span",{className:"font-mono text-og-400",children:t}),e.jsx("span",{className:"text-base font-semibold text-og-1000",children:(n==null?void 0:n.title)??""})]}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-og-500",children:[e.jsx("span",{className:"pill",children:"代码评审"}),h&&u!==void 0&&e.jsxs("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent-hover",children:["Open PR #",u]})]}),!o&&e.jsx("div",{className:"text-sm text-og-500",children:"加载中…"}),o&&c&&e.jsxs("div",{className:"text-sm text-danger",children:["加载评审记录失败:",c]}),o&&!c&&r&&!r.available&&e.jsx("div",{className:"text-sm text-og-500",children:Yr[Xr(r.reason)??"no-pr"]}),o&&!c&&(r==null?void 0:r.available)&&(r.items.length===0?r.error?e.jsxs("div",{className:"text-sm text-warn",children:["评审记录拉取失败:",r.error]}):e.jsx("div",{className:"text-sm text-og-400",children:"评审尚未开始"}):e.jsxs(e.Fragment,{children:[r.error&&e.jsxs("div",{className:"mb-3 text-xs text-warn",children:["部分评审记录拉取失败:",r.error,"(仅展示已获取的部分)"]}),e.jsx("div",{className:"space-y-5",children:m.map((g,f)=>e.jsx(ta,{round:g,index:f},f))})]}))]})}function ta({round:t,index:s}){const n=t.review?`第 ${s+1} 轮`:"进行中";return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs font-medium text-og-700",children:n}),e.jsxs("div",{className:"space-y-2",children:[t.items.map(a=>e.jsx(sa,{item:a},`${a.kind}-${a.id}`)),t.review&&e.jsx(na,{item:t.review})]})]})}function sa({item:t}){if(t.kind==="commit")return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"pill shrink-0",children:"提交"}),t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:t.commitSha.slice(0,9)}),t.author&&e.jsx("span",{className:"text-xs text-og-400",children:t.author}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),t.body&&e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:t.body})]});const s=t.kind==="review-comment";return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"pill shrink-0",children:s?"行内评论":"评论"}),t.author&&e.jsx("span",{className:"font-medium text-og-700",children:t.author}),s&&t.path&&e.jsx("span",{className:"min-w-0 break-all font-mono text-xs text-og-500",children:t.line!==void 0?`${t.path}:${t.line}`:t.path}),t.inReplyTo&&e.jsx("span",{className:"text-xs text-og-400",children:"↩ 回复"}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),e.jsx(Ps,{item:t})]})}function na({item:t}){const s=t.verdict??"comment";return e.jsxs("div",{className:"card p-3 text-sm",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"shrink-0 min-w-[1.75rem] text-xs font-semibold uppercase tracking-wide text-[#c2410c]",children:"QA"}),e.jsx("span",{className:Kr[s],children:Jr[s]}),t.author&&e.jsx("span",{className:"text-xs text-og-400",children:t.author}),t.commitSha&&e.jsx("span",{className:"font-mono text-xs text-og-500",children:t.commitSha.slice(0,9)}),t.createdAt&&e.jsx("span",{className:"text-xs text-og-400",children:bt(t.createdAt)})]}),e.jsx(Ps,{item:t,placeholder:"(无评审正文)"})]})}function Ps({item:t,placeholder:s}){return e.jsxs(e.Fragment,{children:[t.body?e.jsx("div",{className:"whitespace-pre-wrap break-words text-og-800",children:t.body}):s?e.jsx("div",{className:"text-og-400",children:s}):null,t.bodyTruncated&&e.jsx("div",{className:"mt-1 text-xs text-warn",children:"内容较大,已截断。"})]})}function ra(){const[t,s]=i.useState(!1);return e.jsx("button",{type:"button",onClick:()=>s(n=>!n),"aria-label":t?"切换为 Logo 图标":"切换为 Logo 文字",className:"flex h-7 min-w-[60px] shrink-0 items-center justify-center font-display text-base font-semibold tracking-tight text-og-1000",children:t?e.jsx("span",{className:"inline-flex h-6 items-center leading-none",children:"baxian"}):e.jsx("img",{src:"/baxian-logo.png",alt:"baxian",width:20,height:24,className:"block h-6 w-auto"})})}function aa(){const{phase:t,count:s,error:n,triggerRestart:a}=tt();return t==="idle"?null:t==="failed"?e.jsxs("div",{className:"flex items-center justify-between border-b border-[#fecaca] bg-[#fef2f2] px-4 py-2",children:[e.jsxs("div",{className:"text-sm text-danger",children:["❌ 重启失败:",n]}),e.jsx("button",{onClick:()=>{a()},className:"btn-ghost !text-danger hover:!bg-[#fef2f2]",children:"重试"})]}):t==="restarting"?e.jsx("div",{className:"border-b border-accent-soft bg-accent-soft/40 px-4 py-2 text-sm text-accent",children:"🔄 重启中…"}):e.jsxs("div",{className:"flex items-center justify-between border-b border-[#fde68a] bg-[#fef3c7]/60 px-4 py-2",children:[e.jsxs("div",{className:"text-sm text-warn",children:["⚠️ 有 ",s," 项配置变更待重启 baxian server 才生效"]}),e.jsx("button",{onClick:()=>{a()},className:"btn-secondary !border-warn !text-warn hover:!bg-[#fef3c7] hover:!border-warn hover:!text-warn",children:"现在重启"})]})}function ia(){const s=!ls().pathname.startsWith("/terminal/");return e.jsxs("div",{className:"flex h-dvh flex-col bg-page",children:[e.jsxs("nav",{className:"flex h-12 flex-none items-center border-b border-hairline bg-surface px-3 sm:px-6",children:[e.jsxs(Be,{to:"/",className:"flex shrink-0 items-center gap-2 font-display text-base font-semibold tracking-tight text-og-1000",children:[e.jsx("span",{"aria-hidden":!0,className:"block h-2.5 w-2.5 rounded-full bg-accent"}),"baxian"]}),e.jsx("div",{id:ks,className:"ml-auto flex min-w-0 items-center justify-end gap-2"})]}),e.jsx(aa,{}),e.jsxs("main",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-3 py-6 sm:px-6",children:[e.jsxs(Ws,{children:[e.jsx(Ee,{path:"/",element:e.jsx(mr,{})}),e.jsx(Ee,{path:"/project/:id",element:e.jsx(Sr,{})}),e.jsx(Ee,{path:"/project/:id/task/:taskId",element:e.jsx(Mr,{})}),e.jsx(Ee,{path:"/terminal/:agentId",element:e.jsx(Fr,{})}),e.jsx(Ee,{path:"/tasks/:taskId/rounds/:phase/:round",element:e.jsx(Gr,{})}),e.jsx(Ee,{path:"/tasks/:taskId/github-review",element:e.jsx(ea,{})})]}),s&&e.jsx("footer",{className:"mt-auto flex justify-center pb-4 pt-24",children:e.jsx(ra,{})})]})]})}function oa(){return e.jsx(Us,{children:e.jsx(ia,{})})}function ca({children:t}){const[s,n]=i.useState({kind:"probing"}),a=i.useRef(s);i.useEffect(()=>{a.current=s},[s]);const r=i.useCallback(async()=>{n({kind:"probing"});try{await P.config.get(),n({kind:"authorized"})}catch(o){if(o instanceof Ae&&o.status===401){n({kind:"unauthorized"});return}const c=o instanceof Error?o.message:"无法连接服务器";n({kind:"error",message:c})}},[]);return i.useEffect(()=>{r()},[r]),i.useEffect(()=>{const o=()=>{a.current.kind!=="probing"&&n({kind:"unauthorized",message:"登录已失效,请重新输入令牌"})};return window.addEventListener(Ke,o),()=>window.removeEventListener(Ke,o)},[]),s.kind==="authorized"?e.jsx(e.Fragment,{children:t}):s.kind==="error"?e.jsxs(vt,{title:"无法连接服务器",children:[e.jsx("p",{className:"text-sm text-og-600",children:s.message}),e.jsx("button",{type:"button",onClick:()=>{r()},className:"btn-primary mt-4 w-full",children:"重试"})]}):s.kind==="probing"?e.jsx(vt,{title:"加载中",children:e.jsx("p",{className:"text-sm text-og-500",children:"正在检查登录状态…"})}):e.jsx(la,{message:s.message,onSubmit:async o=>{Qs(o);try{await P.config.get(),n({kind:"authorized"})}catch(c){if(Vs(),c instanceof Ae&&c.status===401){n({kind:"unauthorized",message:"令牌无效,请重试"});return}const u=c instanceof Error?c.message:"登录失败";n({kind:"error",message:u})}}})}function vt({title:t,children:s}){return e.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-page px-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-lg border border-hairline bg-surface px-6 py-6",children:[e.jsx("h1",{className:"mb-3 font-display text-base font-semibold tracking-tight text-og-1000",children:t}),s]})})}function la({message:t,onSubmit:s}){const[n,a]=i.useState(""),[r,o]=i.useState(!1),[c,u]=i.useState(void 0),h=async g=>{g.preventDefault();const f=n.trim();if(!f){u("请输入访问令牌");return}u(void 0),o(!0);try{await s(f)}finally{o(!1)}},m=c??t;return e.jsxs(vt,{title:"登录 baxian",children:[e.jsx("p",{className:"mb-4 text-sm text-og-600",children:"服务器开启了访问鉴权,请输入访问令牌继续。"}),e.jsxs("form",{onSubmit:g=>{h(g)},children:[e.jsx("label",{className:"mb-1.5 block text-xs font-medium text-og-700",htmlFor:"baxian-token",children:"访问令牌"}),e.jsx("input",{id:"baxian-token",type:"password",autoComplete:"current-password",autoFocus:!0,value:n,onChange:g=>a(g.target.value),className:"w-full rounded-md border border-og-100 bg-surface px-2.5 py-1.5 font-mono text-sm text-og-800 placeholder:text-og-400 focus:border-accent focus:outline-none focus:ring-[3px] focus:ring-accent-soft disabled:cursor-not-allowed disabled:opacity-50",placeholder:"请输入服务器配置的 token",disabled:r}),m&&e.jsx("p",{role:"alert",className:"mt-2 text-xs text-danger",children:m}),e.jsx("button",{type:"submit",disabled:r,className:"btn-primary mt-4 w-full",children:r?"登录中…":"登录"})]})]})}Fs.createRoot(document.getElementById("root")).render(e.jsx(i.StrictMode,{children:e.jsx(an,{children:e.jsx(en,{children:e.jsx(ca,{children:e.jsx(oa,{})})})})}));
@@ -1 +1 @@
1
- @font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-regular.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-italic.woff2) format("woff2");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-bold.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-bolditalic.woff2) format("woff2");font-weight:700;font-style:italic;font-display:swap}@font-face{font-family:Lilex;src:url(/fonts/lilex-variable.woff2) format("woff2-variations");font-weight:200 700;font-style:normal;font-display:swap}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:iA Writer Quattro S,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1));font-family:iA Writer Quattro S,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1));font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased;text-rendering:geometricprecision;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1));padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(15 59 184 / var(--tw-bg-opacity, 1))}.btn-primary:disabled{cursor:not-allowed;opacity:.5}.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.btn-secondary:disabled{cursor:not-allowed;opacity:.5}.btn-ghost{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;background-color:transparent;padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(109 116 132 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.btn-ghost:disabled{cursor:not-allowed;opacity:.5}.pill{display:inline-flex;align-items:center;gap:.375rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1));padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.4;--tw-text-opacity: 1;color:rgb(83 89 100 / var(--tw-text-opacity, 1))}.pill:before{content:"";display:inline-block;height:.375rem;width:.375rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(171 175 184 / var(--tw-bg-opacity, 1))}.pill-live{--tw-bg-opacity: 1;background-color:rgb(230 244 236 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.pill-live:before{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.pill-warn{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.pill-warn:before{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.pill-review{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.pill-review:before{--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1))}.card{border-radius:6px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(232 233 236 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.card:hover{--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1))}.status-dot{display:inline-block;height:.725rem;width:.725rem;flex-shrink:0;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.status-dot--warn{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.status-dot--danger{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.status-dot--info{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-4{left:1rem;right:1rem}.-top-4{top:-1rem}.bottom-full{bottom:100%}.right-0{right:0}.right-7{right:1.75rem}.top-4{top:1rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mr-1{margin-right:-.25rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3\.5{height:.875rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-28{max-height:7rem}.max-h-\[90dvh\]{max-height:90dvh}.min-h-0{min-height:0px}.min-h-dvh{min-height:100dvh}.w-1\.5{width:.375rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3\.5{width:.875rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[1\.75rem\]{min-width:1.75rem}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[60px\]{min-width:60px}.max-w-2xl{max-width:42rem}.max-w-5xl{max-width:64rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-hairline>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(232 233 236 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:6px}.rounded-md{border-radius:4px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.\!border-\[\#bbf7d0\]{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))!important}.\!border-\[\#fecaca\]{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))!important}.\!border-accent-soft{--tw-border-opacity: 1 !important;border-color:rgb(234 240 255 / var(--tw-border-opacity, 1))!important}.\!border-warn{--tw-border-opacity: 1 !important;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))!important}.border-\[\#bbf7d0\]{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-\[\#fde68a\]{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-\[\#fecaca\]{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.border-accent-soft{--tw-border-opacity: 1;border-color:rgb(234 240 255 / var(--tw-border-opacity, 1))}.border-hairline{--tw-border-opacity: 1;border-color:rgb(232 233 236 / var(--tw-border-opacity, 1))}.border-og-100{--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1))}.\!bg-\[\#fdecea\]{--tw-bg-opacity: 1 !important;background-color:rgb(253 236 234 / var(--tw-bg-opacity, 1))!important}.bg-\[\#e6f4ec\]{--tw-bg-opacity: 1;background-color:rgb(230 244 236 / var(--tw-bg-opacity, 1))}.bg-\[\#f0fdf4\]{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-\[\#fdecea\]{--tw-bg-opacity: 1;background-color:rgb(253 236 234 / var(--tw-bg-opacity, 1))}.bg-\[\#fdfdfd\]{--tw-bg-opacity: 1;background-color:rgb(253 253 253 / var(--tw-bg-opacity, 1))}.bg-\[\#fef2f2\]{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-\[\#fef3c7\]{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-\[\#fef3c7\]\/60{background-color:#fef3c799}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1))}.bg-accent-soft{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1))}.bg-accent-soft\/30{background-color:#eaf0ff4d}.bg-accent-soft\/40{background-color:#eaf0ff66}.bg-og-1000\/45{background-color:#0d0d0f73}.bg-og-300{--tw-bg-opacity: 1;background-color:rgb(171 175 184 / var(--tw-bg-opacity, 1))}.bg-og-50{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.bg-og-50\/40{background-color:#e3e4e766}.bg-page{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.bg-success{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.bg-surface{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-warn{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-28{padding-right:7rem}.pt-1{padding-top:.25rem}.pt-24{padding-top:6rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-display{font-family:Lilex,iA Writer Quattro S,ui-sans-serif,system-ui,sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\!text-base{font-size:15px!important;line-height:1.5!important}.text-base{font-size:15px;line-height:1.5}.text-sm{font-size:14px;line-height:1.55}.text-xs{font-size:12px;line-height:1.4}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.normal-case{text-transform:none}.leading-\[1\.5\]{line-height:1.5}.leading-none{line-height:1}.tracking-\[0\.05em\]{letter-spacing:.05em}.tracking-\[0\.06em\]{letter-spacing:.06em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.\!text-accent{--tw-text-opacity: 1 !important;color:rgb(19 72 220 / var(--tw-text-opacity, 1))!important}.\!text-danger{--tw-text-opacity: 1 !important;color:rgb(185 28 28 / var(--tw-text-opacity, 1))!important}.\!text-success{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity, 1))!important}.\!text-warn{--tw-text-opacity: 1 !important;color:rgb(180 83 9 / var(--tw-text-opacity, 1))!important}.text-\[\#c2410c\]{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-accent{--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-danger{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-og-1000{--tw-text-opacity: 1;color:rgb(13 13 15 / var(--tw-text-opacity, 1))}.text-og-300{--tw-text-opacity: 1;color:rgb(171 175 184 / var(--tw-text-opacity, 1))}.text-og-400{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.text-og-500{--tw-text-opacity: 1;color:rgb(109 116 132 / var(--tw-text-opacity, 1))}.text-og-600{--tw-text-opacity: 1;color:rgb(98 105 118 / var(--tw-text-opacity, 1))}.text-og-700{--tw-text-opacity: 1;color:rgb(83 89 100 / var(--tw-text-opacity, 1))}.text-og-800{--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.text-success{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-warn{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.accent-\[\#1348dc\]{accent-color:#1348dc}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-modal{--tw-shadow: 0 12px 32px rgba(15, 23, 42, .12);--tw-shadow-colored: 0 12px 32px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-toast{--tw-shadow: 0 4px 12px rgba(15, 23, 42, .08);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-accent{--tw-ring-opacity: 1;--tw-ring-color: rgb(19 72 220 / var(--tw-ring-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.scrollbar-none{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.\[max-height\:70vh\]{max-height:70vh}@media(pointer:coarse){input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=file]),select,textarea{font-size:16px!important}}@keyframes breathe{0%,to{opacity:1}50%{opacity:.35}}.placeholder\:text-og-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.placeholder\:text-og-400::placeholder{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.hover\:\!border-accent:hover{--tw-border-opacity: 1 !important;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))!important}.hover\:\!border-danger:hover{--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))!important}.hover\:\!border-success:hover{--tw-border-opacity: 1 !important;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))!important}.hover\:\!border-warn:hover{--tw-border-opacity: 1 !important;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))!important}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.hover\:\!bg-\[\#dcfce7\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef2f2\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef3c7\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef3c7\]\/60:hover{background-color:#fef3c799!important}.hover\:\!bg-accent-soft:hover{--tw-bg-opacity: 1 !important;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1))!important}.hover\:bg-\[\#fef2f2\]:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-og-50:hover{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.hover\:bg-og-50\/40:hover{background-color:#e3e4e766}.hover\:bg-og-50\/60:hover{background-color:#e3e4e799}.hover\:\!text-danger:hover{--tw-text-opacity: 1 !important;color:rgb(185 28 28 / var(--tw-text-opacity, 1))!important}.hover\:\!text-warn:hover{--tw-text-opacity: 1 !important;color:rgb(180 83 9 / var(--tw-text-opacity, 1))!important}.hover\:text-accent-hover:hover{--tw-text-opacity: 1;color:rgb(15 59 184 / var(--tw-text-opacity, 1))}.hover\:text-danger:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-og-1000:hover{--tw-text-opacity: 1;color:rgb(13 13 15 / var(--tw-text-opacity, 1))}.hover\:text-og-800:hover{--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-\[3px\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-accent-soft:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 240 255 / var(--tw-ring-opacity, 1))}.active\:bg-og-200:active{--tw-bg-opacity: 1;background-color:rgb(192 195 202 / var(--tw-bg-opacity, 1))}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:\!text-og-300:disabled{--tw-text-opacity: 1 !important;color:rgb(171 175 184 / var(--tw-text-opacity, 1))!important}.disabled\:text-og-400:disabled{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}@media(min-width:640px){.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media(min-width:1024px){.lg\:w-\[340px\]{width:340px}.lg\:shrink-0{flex-shrink:0}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}}@media(min-width:1280px){.xl\:w-\[380px\]{width:380px}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}
1
+ @font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-regular.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-italic.woff2) format("woff2");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-bold.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:iA Writer Quattro S;src:url(/fonts/ia-writer-quattro-s-bolditalic.woff2) format("woff2");font-weight:700;font-style:italic;font-display:swap}@font-face{font-family:Lilex;src:url(/fonts/lilex-variable.woff2) format("woff2-variations");font-weight:200 700;font-style:normal;font-display:swap}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:iA Writer Quattro S,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1));font-family:iA Writer Quattro S,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1));font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased;text-rendering:geometricprecision;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1));padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(15 59 184 / var(--tw-bg-opacity, 1))}.btn-primary:disabled{cursor:not-allowed;opacity:.5}.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.btn-secondary:disabled{cursor:not-allowed;opacity:.5}.btn-ghost{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;border-radius:4px;background-color:transparent;padding:.375rem .75rem;font-size:14px;line-height:1.55;font-weight:500;--tw-text-opacity: 1;color:rgb(109 116 132 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.btn-ghost:disabled{cursor:not-allowed;opacity:.5}.pill{display:inline-flex;align-items:center;gap:.375rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1));padding:.125rem .5rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.4;--tw-text-opacity: 1;color:rgb(83 89 100 / var(--tw-text-opacity, 1))}.pill:before{content:"";display:inline-block;height:.375rem;width:.375rem;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(171 175 184 / var(--tw-bg-opacity, 1))}.pill-live{--tw-bg-opacity: 1;background-color:rgb(230 244 236 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.pill-live:before{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.pill-warn{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.pill-warn:before{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.pill-review{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.pill-review:before{--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1))}.card{border-radius:6px;border-width:1px;--tw-border-opacity: 1;border-color:rgb(232 233 236 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.card:hover{--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1))}.status-dot{display:inline-block;height:.725rem;width:.725rem;flex-shrink:0;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.status-dot--warn{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.status-dot--danger{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.status-dot--info{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1));animation:breathe 1.8s ease-in-out infinite}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-4{left:1rem;right:1rem}.-top-4{top:-1rem}.bottom-full{bottom:100%}.right-0{right:0}.right-7{right:1.75rem}.top-4{top:1rem}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mr-1{margin-right:-.25rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3\.5{height:.875rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-28{max-height:7rem}.max-h-\[90dvh\]{max-height:90dvh}.min-h-0{min-height:0px}.min-h-dvh{min-height:100dvh}.w-1\.5{width:.375rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3\.5{width:.875rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[1\.75rem\]{min-width:1.75rem}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[60px\]{min-width:60px}.max-w-2xl{max-width:42rem}.max-w-5xl{max-width:64rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-hairline>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(232 233 236 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:6px}.rounded-md{border-radius:4px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.\!border-\[\#bbf7d0\]{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))!important}.\!border-\[\#fecaca\]{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))!important}.\!border-accent-soft{--tw-border-opacity: 1 !important;border-color:rgb(234 240 255 / var(--tw-border-opacity, 1))!important}.\!border-warn{--tw-border-opacity: 1 !important;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))!important}.border-\[\#bbf7d0\]{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-\[\#fde68a\]{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-\[\#fecaca\]{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-accent{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.border-accent-soft{--tw-border-opacity: 1;border-color:rgb(234 240 255 / var(--tw-border-opacity, 1))}.border-hairline{--tw-border-opacity: 1;border-color:rgb(232 233 236 / var(--tw-border-opacity, 1))}.border-og-100{--tw-border-opacity: 1;border-color:rgb(206 209 214 / var(--tw-border-opacity, 1))}.\!bg-\[\#fdecea\]{--tw-bg-opacity: 1 !important;background-color:rgb(253 236 234 / var(--tw-bg-opacity, 1))!important}.bg-\[\#e6f4ec\]{--tw-bg-opacity: 1;background-color:rgb(230 244 236 / var(--tw-bg-opacity, 1))}.bg-\[\#f0fdf4\]{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-\[\#fdecea\]{--tw-bg-opacity: 1;background-color:rgb(253 236 234 / var(--tw-bg-opacity, 1))}.bg-\[\#fdfdfd\]{--tw-bg-opacity: 1;background-color:rgb(253 253 253 / var(--tw-bg-opacity, 1))}.bg-\[\#fef2f2\]{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-\[\#fef3c7\]{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-\[\#fef3c7\]\/60{background-color:#fef3c799}.bg-accent{--tw-bg-opacity: 1;background-color:rgb(19 72 220 / var(--tw-bg-opacity, 1))}.bg-accent-soft{--tw-bg-opacity: 1;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1))}.bg-accent-soft\/30{background-color:#eaf0ff4d}.bg-accent-soft\/40{background-color:#eaf0ff66}.bg-og-1000\/45{background-color:#0d0d0f73}.bg-og-300{--tw-bg-opacity: 1;background-color:rgb(171 175 184 / var(--tw-bg-opacity, 1))}.bg-og-50{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.bg-og-50\/40{background-color:#e3e4e766}.bg-page{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.bg-success{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.bg-surface{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-warn{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-28{padding-right:7rem}.pt-1{padding-top:.25rem}.pt-24{padding-top:6rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-display{font-family:Lilex,iA Writer Quattro S,ui-sans-serif,system-ui,sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-base{font-size:15px;line-height:1.5}.text-sm{font-size:14px;line-height:1.55}.text-xs{font-size:12px;line-height:1.4}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.normal-case{text-transform:none}.leading-\[1\.5\]{line-height:1.5}.leading-none{line-height:1}.tracking-\[0\.05em\]{letter-spacing:.05em}.tracking-\[0\.06em\]{letter-spacing:.06em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.\!text-accent{--tw-text-opacity: 1 !important;color:rgb(19 72 220 / var(--tw-text-opacity, 1))!important}.\!text-danger{--tw-text-opacity: 1 !important;color:rgb(185 28 28 / var(--tw-text-opacity, 1))!important}.\!text-success{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity, 1))!important}.\!text-warn{--tw-text-opacity: 1 !important;color:rgb(180 83 9 / var(--tw-text-opacity, 1))!important}.text-\[\#c2410c\]{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-accent{--tw-text-opacity: 1;color:rgb(19 72 220 / var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-danger{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-og-1000{--tw-text-opacity: 1;color:rgb(13 13 15 / var(--tw-text-opacity, 1))}.text-og-300{--tw-text-opacity: 1;color:rgb(171 175 184 / var(--tw-text-opacity, 1))}.text-og-400{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.text-og-500{--tw-text-opacity: 1;color:rgb(109 116 132 / var(--tw-text-opacity, 1))}.text-og-600{--tw-text-opacity: 1;color:rgb(98 105 118 / var(--tw-text-opacity, 1))}.text-og-700{--tw-text-opacity: 1;color:rgb(83 89 100 / var(--tw-text-opacity, 1))}.text-og-800{--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.text-success{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-warn{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.accent-\[\#1348dc\]{accent-color:#1348dc}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-modal{--tw-shadow: 0 12px 32px rgba(15, 23, 42, .12);--tw-shadow-colored: 0 12px 32px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-toast{--tw-shadow: 0 4px 12px rgba(15, 23, 42, .08);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-accent{--tw-ring-opacity: 1;--tw-ring-color: rgb(19 72 220 / var(--tw-ring-opacity, 1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.scrollbar-none{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.\[max-height\:70vh\]{max-height:70vh}@media(pointer:coarse){input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=file]),select,textarea{font-size:16px!important}}@keyframes breathe{0%,to{opacity:1}50%{opacity:.35}}.placeholder\:text-og-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.placeholder\:text-og-400::placeholder{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.hover\:\!border-accent:hover{--tw-border-opacity: 1 !important;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))!important}.hover\:\!border-danger:hover{--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))!important}.hover\:\!border-success:hover{--tw-border-opacity: 1 !important;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))!important}.hover\:\!border-warn:hover{--tw-border-opacity: 1 !important;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))!important}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.hover\:\!bg-\[\#dcfce7\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef2f2\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef3c7\]:hover{--tw-bg-opacity: 1 !important;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))!important}.hover\:\!bg-\[\#fef3c7\]\/60:hover{background-color:#fef3c799!important}.hover\:\!bg-accent-soft:hover{--tw-bg-opacity: 1 !important;background-color:rgb(234 240 255 / var(--tw-bg-opacity, 1))!important}.hover\:bg-\[\#fef2f2\]:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-og-50:hover{--tw-bg-opacity: 1;background-color:rgb(227 228 231 / var(--tw-bg-opacity, 1))}.hover\:bg-og-50\/40:hover{background-color:#e3e4e766}.hover\:bg-og-50\/60:hover{background-color:#e3e4e799}.hover\:\!text-danger:hover{--tw-text-opacity: 1 !important;color:rgb(185 28 28 / var(--tw-text-opacity, 1))!important}.hover\:\!text-warn:hover{--tw-text-opacity: 1 !important;color:rgb(180 83 9 / var(--tw-text-opacity, 1))!important}.hover\:text-accent-hover:hover{--tw-text-opacity: 1;color:rgb(15 59 184 / var(--tw-text-opacity, 1))}.hover\:text-danger:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.hover\:text-og-1000:hover{--tw-text-opacity: 1;color:rgb(13 13 15 / var(--tw-text-opacity, 1))}.hover\:text-og-800:hover{--tw-text-opacity: 1;color:rgb(71 76 85 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(19 72 220 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-\[3px\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-accent-soft:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 240 255 / var(--tw-ring-opacity, 1))}.active\:bg-og-200:active{--tw-bg-opacity: 1;background-color:rgb(192 195 202 / var(--tw-bg-opacity, 1))}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:\!text-og-300:disabled{--tw-text-opacity: 1 !important;color:rgb(171 175 184 / var(--tw-text-opacity, 1))!important}.disabled\:text-og-400:disabled{--tw-text-opacity: 1;color:rgb(135 142 155 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}@media(min-width:640px){.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media(min-width:1024px){.lg\:w-\[340px\]{width:340px}.lg\:shrink-0{flex-shrink:0}.lg\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}}@media(min-width:1280px){.xl\:w-\[380px\]{width:380px}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}
@@ -6,12 +6,12 @@
6
6
  <link rel="icon" type="image/png" href="/baxian-logo.png" />
7
7
  <link rel="apple-touch-icon" href="/baxian-logo.png" />
8
8
  <title>baxian</title>
9
- <script type="module" crossorigin src="/assets/index-CRW5Qpcs.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-B6U5UO5q.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="/assets/react-BFCkCmbU.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/xterm-D5X2JljJ.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/router-BgSDZqI0.js">
13
13
  <link rel="stylesheet" crossorigin href="/assets/xterm-CFbL2ovg.css">
14
- <link rel="stylesheet" crossorigin href="/assets/index-DOXetyxZ.css">
14
+ <link rel="stylesheet" crossorigin href="/assets/index-DxVde59k.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baxian",
3
- "version": "1.2.33",
3
+ "version": "1.2.34",
4
4
  "description": "AI agent orchestration",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {