@mrpatronz/nexusflow 2.18.0 → 2.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/AcpCliAdapter.d.ts +2 -0
- package/dist/agent/AcpCliAdapter.d.ts.map +1 -1
- package/dist/agent/AcpCliAdapter.js +45 -0
- package/dist/agent/AcpCliAdapter.js.map +1 -1
- package/dist/agent/AntigravityCliAdapter.d.ts +6 -1
- package/dist/agent/AntigravityCliAdapter.d.ts.map +1 -1
- package/dist/agent/AntigravityCliAdapter.js +117 -12
- package/dist/agent/AntigravityCliAdapter.js.map +1 -1
- package/dist/agent/ClaudeCliAdapter.d.ts +6 -0
- package/dist/agent/ClaudeCliAdapter.d.ts.map +1 -1
- package/dist/agent/ClaudeCliAdapter.js +104 -6
- package/dist/agent/ClaudeCliAdapter.js.map +1 -1
- package/dist/agent/ClaudeSdkAdapter.d.ts.map +1 -1
- package/dist/agent/ClaudeSdkAdapter.js +3 -0
- package/dist/agent/ClaudeSdkAdapter.js.map +1 -1
- package/dist/agent/CodexCliAdapter.d.ts +3 -0
- package/dist/agent/CodexCliAdapter.d.ts.map +1 -1
- package/dist/agent/CodexCliAdapter.js +26 -1
- package/dist/agent/CodexCliAdapter.js.map +1 -1
- package/dist/agent/ProviderRegistry.d.ts +1 -1
- package/dist/agent/ProviderRegistry.d.ts.map +1 -1
- package/dist/agent/ProviderRegistry.js.map +1 -1
- package/dist/agent/TurnSessionManager.d.ts +3 -0
- package/dist/agent/TurnSessionManager.d.ts.map +1 -1
- package/dist/agent/TurnSessionManager.js +78 -2
- package/dist/agent/TurnSessionManager.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +35 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/core/config-schema.d.ts +1 -1
- package/dist/gui/assets/{AgentsPage-B8wY-KQB.js → AgentsPage-B9ejJYsf.js} +2 -2
- package/dist/gui/assets/{DashboardPage-B_ZsSGHU.js → DashboardPage-BwwB7uTm.js} +1 -1
- package/dist/gui/assets/{DocumentPreview-Ds1fjVR1.js → DocumentPreview-CtylgIF0.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-BlTIranD.js → GettingStartedPage-BM8m5uir.js} +1 -1
- package/dist/gui/assets/{MonacoDiffAdapter-DnVDZN_T.js → MonacoDiffAdapter-DHYIkG2a.js} +1 -1
- package/dist/gui/assets/{ProjectsPage-CETgIZML.js → ProjectsPage-CNZF11wO.js} +1 -1
- package/dist/gui/assets/{ScaffoldRepoInline-DAcCQwkr.js → ScaffoldRepoInline-B5qMbiRV.js} +1 -1
- package/dist/gui/assets/{SettingsPage-B-1dbgP4.js → SettingsPage-S68Q-rBG.js} +1 -1
- package/dist/gui/assets/{SkillsPage-Dynyirx8.js → SkillsPage-B97Al8vk.js} +4 -4
- package/dist/gui/assets/StartWorkPage-Dq0Ke4hS.js +1 -0
- package/dist/gui/assets/{StrategiesPage-DaGnJx4E.js → StrategiesPage-INv0HW7D.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-uCiHE87E.js +4 -0
- package/dist/gui/assets/{WorkspacesPage-CdqFqfKR.js → WorkspacesPage-CAHQrIgk.js} +11 -11
- package/dist/gui/assets/alert-dialog-B-6-jHIr.js +1 -0
- package/dist/gui/assets/index-BzqpMUfC.css +2 -0
- package/dist/gui/assets/{index-4lBf5Ph9.js → index-DmbV3DA2.js} +7 -7
- package/dist/gui/assets/{tabs-x72_G6CN.js → tabs-CJ2imrHY.js} +1 -1
- package/dist/gui/index.html +2 -2
- package/dist/harness/claude.d.ts.map +1 -1
- package/dist/harness/claude.js +92 -7
- package/dist/harness/claude.js.map +1 -1
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +21 -4
- package/dist/harness/codex.js.map +1 -1
- package/dist/harness/types.d.ts +58 -2
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/session-finder.d.ts +6 -1
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +226 -0
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/workrooms/store.d.ts +1 -1
- package/package.json +1 -1
- package/dist/gui/assets/StartWorkPage-tWC7hUNi.js +0 -1
- package/dist/gui/assets/WorkroomsPage-Du28BSKK.js +0 -4
- package/dist/gui/assets/alert-dialog-N0cNDLma.js +0 -1
- package/dist/gui/assets/index-BSApVBNm.css +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{n as r,t as i}from"./badge-BObbahyU.js";import{C as a,F as o,G as s,H as c,L as l,M as ee,P as u,Q as te,S as d,Z as f,a as p,b as m,c as ne,et as h,i as re,m as ie,n as ae,t as oe,vt as g,w as se,y as ce}from"./queries-CJBjicdw.js";import{h as _,m as v,t as y}from"./button-BrcP8Wxx.js";import{t as le}from"./chevron-down-Dy03VL1q.js";import{a as b,c as x,d as S,f as C,g as w,l as T,m as ue,n as de,o as fe,p as E,u as pe}from"./status-CKOvrZ16.js";import{n as me,r as D,t as he}from"./ScaffoldRepoInline-DAcCQwkr.js";import{n as ge,r as _e,t as ve}from"./vsc-EOWFTqft.js";import{s as ye}from"./brand-hHByyyzq.js";import{n as be}from"./client-B5szthbF.js";import{$t as xe,A as Se,B as Ce,D as O,Dt as we,E as Te,Gt as Ee,Ht as De,I as Oe,L as ke,M as Ae,N as je,O as Me,P as Ne,Qt as k,R as Pe,T as Fe,Xt as Ie,a as Le,en as Re,i as ze,j as Be,jt as Ve,k as He,n as Ue,o as We,qt as A,r as Ge,t as j,u as Ke,wt as M,yt as N,z as qe}from"./index-4lBf5Ph9.js";var Je=_(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),P=_(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),Ye=_(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),F=e(t(),1),I={status:`idle`,steps:[]};function Xe(){let[e,t]=(0,F.useState)(I),n=(0,F.useRef)(null),r=(0,F.useRef)(null),i=g(),a=(0,F.useCallback)(()=>{n.current?.close(),n.current=null,r.current=null},[]);return(0,F.useEffect)(()=>a,[a]),{progress:e,start:(0,F.useCallback)(e=>{if(n.current&&r.current===e)return;a(),r.current=e,t({status:`running`,steps:[]});let o=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=o;let s=0;o.addEventListener(`progress`,r=>{if(n.current===o){s=0;try{let n=JSON.parse(r.data);t({status:n.status===`completed`||n.status===`failed`?n.status:`running`,steps:n.steps??[],error:n.error,workspacePath:n.workspacePath,workspaceId:n.feature?.id??e}),(n.status===`completed`||n.status===`failed`)&&(a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}}),o.onerror=()=>{n.current===o&&(s+=1,!(o.readyState!==EventSource.CLOSED&&s<5)&&(t(e=>e.status===`running`?{...e,status:`unavailable`,error:e.error??`Unable to reconnect to the creation stream. The workspace may still have been created.`}:e),a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]})))}},[a,i]),reset:(0,F.useCallback)(()=>{a(),t(I)},[a])}}var L=n(),Ze=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,R={codex:ue,claude:b,vscode:ve,"vscode-insiders":ge,cursor:fe,antigravity:P,powershell:M,cmd:M,terminal:M,intellij:x,webstorm:S,pycharm:T,sublime:pe,zed:E,windsurf:C},z={codex:`bg-foreground text-background`,claude:`bg-[#D97757] text-white`,vscode:`bg-[#007ACC] text-white`,"vscode-insiders":`bg-[#24A148] text-white`,cursor:`bg-zinc-950 text-white dark:bg-white dark:text-zinc-950`,antigravity:`bg-violet-600 text-white`,powershell:`bg-sky-700 text-white`,cmd:`bg-zinc-800 text-amber-400`,terminal:`bg-zinc-800 text-emerald-400`,intellij:`bg-fuchsia-600 text-white`,webstorm:`bg-cyan-600 text-white`,pycharm:`bg-lime-600 text-zinc-950`,sublime:`bg-orange-500 text-white`,zed:`bg-red-600 text-white`,windsurf:`bg-teal-600 text-white`};function B({icon:e}){let t=R[e]??A;return(0,L.jsx)(`span`,{className:v(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,z[e]),"aria-hidden":`true`,children:(0,L.jsx)(t,{className:`size-5`})})}function Qe({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,L.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>a(e),"aria-label":`Open workspace in ${e.name}`,className:v(`flex min-h-20 w-full items-center gap-3 rounded-xl border p-3 text-left outline-none transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,`cursor-pointer border-border bg-card hover:border-primary/40 hover:bg-accent/60`),children:[(0,L.jsx)(B,{icon:e.icon}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,L.jsx)(O,{className:`size-4`}):r?(0,L.jsx)(i,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,L.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function $e({session:e,busy:t,launching:n,onResume:r}){let i=e.desktopHandoff.method===`direct`,a=i?`Codex Desktop`:`Claude Desktop`;return(0,L.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":i?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:v(`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/25 bg-primary/5 p-3 text-left outline-none transition-colors`,`hover:border-primary/45 hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-65`),children:[(0,L.jsx)(B,{icon:i?`codex`:`claude`}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,L.jsx)(O,{className:`size-4 shrink-0`}):i?(0,L.jsx)(w,{className:`size-4 shrink-0 text-muted-foreground`}):(0,L.jsx)(Ee,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,L.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[i?`Open this existing task in ${a}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function et({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,a]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),[ee,u]=(0,F.useState)(null),[te,d]=(0,F.useState)(null),f=(0,F.useRef)(!1),p=o(),m=l(e,i),ne=re().data?.config,h=p.data?.filter(e=>e.available)??[],ie=h.filter(e=>e.kind===`ai-app`),ae=ne?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[ne.defaultEditor]:void 0,oe=h.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===ae)-Number(e.id===ae)),g=new Set(h.map(e=>e.id)),se=(m.data??[]).filter(e=>e.desktopHandoff&&g.has(e.desktopHandoff.targetId)),ce=n||h.length>0,_=async t=>{if(!f.current){f.current=!0,u(null),d(null),c(t.id);try{await be(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),a(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await p.refetch()}finally{c(null),f.current=!1}}},v=async t=>{if(!(f.current||!t.desktopHandoff||!Ze.test(t.id))){f.current=!0,u(null),d(null),c(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await Fe(`claude --resume ${t.id}`),d(`Claude resume command copied. With a Claude subscription login, run it in this workspace, then type /desktop in Claude to move the session into Claude Desktop.`);return}await be(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),a(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await Promise.all([p.refetch(),m.refetch()])}finally{c(null),f.current=!1}}},le=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),a(!1)},b=()=>Promise.all([p.refetch(),m.refetch()]),x=p.isFetching||m.isFetching;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(y,{variant:`outline`,className:r,onClick:()=>a(!0),children:[(0,L.jsx)(Ye,{}),`Open with…`]}),(0,L.jsx)(Me,{open:i,onOpenChange:e=>{a(e),e||(u(null),d(null))},children:(0,L.jsxs)(je,{className:`max-w-2xl`,"aria-busy":s!==null,children:[(0,L.jsxs)(Be,{children:[(0,L.jsx)(Ne,{children:`Open workspace with…`}),(0,L.jsx)(He,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,L.jsxs)(Ae,{className:`space-y-5`,children:[ee&&(0,L.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:ee}),te&&(0,L.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:te}),m.isLoading?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,L.jsx)(O,{className:`size-4`}),` Checking recent sessions…`]}):se.length>0?(0,L.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,L.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:se.map(e=>(0,L.jsx)($e,{session:e,busy:s!==null,launching:s===`session:${e.id}`,onResume:v},`${e.assistant}:${e.id}`))})]}):m.isError?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,L.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,L.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,L.jsxs)(`button`,{type:`button`,disabled:s!==null,onClick:le,className:`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 p-3 text-left outline-none transition-colors hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-65`,children:[(0,L.jsx)(B,{icon:`vscode`}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,L.jsxs)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:[`Open through the installed `,ye,` extension.`]})]})]})]}),p.isLoading?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,L.jsx)(O,{}),` Checking apps on this computer…`]}):p.isError?(0,L.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:p.error instanceof Error?p.error.message:`Could not check available apps.`}):(0,L.jsxs)(L.Fragment,{children:[ie.length>0&&(0,L.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,L.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ie.map(e=>(0,L.jsx)(Qe,{target:e,busy:s!==null,launching:s===e.id,onLaunch:_},e.id))})]}),oe.length>0&&(0,L.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,L.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:oe.map(e=>(0,L.jsx)(Qe,{target:e,busy:s!==null,launching:s===e.id,preferred:e.id===ae,onLaunch:_},e.id))})]}),!ce&&(0,L.jsx)(j,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,L.jsxs)(Ge,{children:[(0,L.jsx)(ze,{variant:`icon`,children:(0,L.jsx)(Je,{})}),(0,L.jsx)(Le,{className:`text-base`,children:`No compatible apps detected`}),(0,L.jsx)(Ue,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:x?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,L.jsxs)(y,{size:`sm`,variant:`ghost`,onClick:()=>void b(),disabled:x||s!==null,children:[(0,L.jsx)(Ve,{className:x?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}var tt=`__ad-hoc__`,nt=new URLSearchParams(window.location.search).get(`env`)===`vscode`,rt=[{value:`quick`,title:`Small task`,body:`Make and verify a focused change.`},{value:`feature`,title:`Standard change`,body:`Plan, implement, verify, and review a feature.`},{value:`epic`,title:`Epic`,body:`Track a larger change through dependent milestones.`}],it=[{value:`in-place`,icon:N,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:De,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function at({repo:e,value:t,onChange:n,enabled:i}){let a=d(e.path,i),o=(0,F.useMemo)(()=>[...new Set([...a.data?.local??[],...a.data?.remote??[]])],[a.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,L.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,L.jsx)(r,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,L.jsx)(`datalist`,{id:s,children:o.map(e=>(0,L.jsx)(`option`,{value:e},e))})]})}function ot({step:e}){return(0,L.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,L.jsx)(`span`,{className:v(`grid size-5 shrink-0 place-items-center rounded-full border`,e.status===`completed`&&`border-success bg-success/15 text-success-foreground`,e.status===`running`&&`border-primary text-primary`,e.status===`failed`&&`border-destructive bg-destructive/15 text-destructive-foreground`,e.status===`pending`&&`border-border text-muted-foreground`),children:e.status===`completed`?(0,L.jsx)(k,{className:`size-3`}):e.status===`running`?(0,L.jsx)(O,{className:`size-3`}):e.status===`failed`?(0,L.jsx)(Ie,{className:`size-3`}):null}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,L.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function st(){let e=f(),[t,n]=te(),o=ce(),l=a(),d=ae(),re=u(),g=ee(),_=oe(),b=ie(),x=ne(),{progress:S,start:C,reset:w}=Xe(),T=t.get(`job`),ue=t.get(`from`)===`chat`,fe=(0,F.useRef)(null);(0,F.useEffect)(()=>{!ue||S.status!==`completed`||!S.workspaceId||fe.current===S.workspaceId||(fe.current=S.workspaceId,c.open(S.workspaceId),e(`/workspaces/${encodeURIComponent(S.workspaceId)}`))},[ue,S.status,S.workspaceId,e]);let[E,pe]=(0,F.useState)(t.get(`project`)??tt),[ge,ve]=(0,F.useState)(`feature`),[ye,Ee]=(0,F.useState)(`feature`),[k,Fe]=(0,F.useState)(`in-place`),[Ie,Le]=(0,F.useState)(``),[ze,Ue]=(0,F.useState)(``),[A,Ge]=(0,F.useState)(``),[j,M]=(0,F.useState)([]),[N,Je]=(0,F.useState)([]),[P,Ye]=(0,F.useState)(!1),[I,Ze]=(0,F.useState)([]),[R,z]=(0,F.useState)([]),[B,Qe]=(0,F.useState)([]),[$e,st]=(0,F.useState)(``),[ct,lt]=(0,F.useState)(``),[ut,dt]=(0,F.useState)(!1),[ft,pt]=(0,F.useState)(null),[V,mt]=(0,F.useState)({}),[ht,gt]=(0,F.useState)(!1),[_t,H]=(0,F.useState)(null),[vt,U]=(0,F.useState)(!1),[W,yt]=(0,F.useState)(``),[G,bt]=(0,F.useState)(``),[xt,St]=(0,F.useState)(``),[Ct,wt]=(0,F.useState)(`vertical`),[Tt,Et]=(0,F.useState)(``),[Dt,Ot]=(0,F.useState)(!1),kt=p(),At=async()=>{if(!(!W.trim()||!G.trim())){Ot(!0);try{let e=G.trim().toLowerCase();await kt.mutateAsync({id:e,name:W.trim(),description:xt.trim()||W.trim(),categoryType:Ct,verifyCommand:Tt.trim()||void 0,tags:[e,...W.trim().toLowerCase().split(/\s+/).filter(Boolean)]}),M(t=>t.includes(e)?t:[...t,e]),U(!1),yt(``),bt(``),St(``),Et(``)}catch{}finally{Ot(!1)}}},jt=(0,F.useMemo)(()=>{if(!A.trim()||A.trim().length<3)return[];let e=A.toLowerCase(),t=[];for(let n of b.data??[])j.includes(n.id)||[n.id,n.name,...n.tags??[]].some(t=>t&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:`#${n.id}`,type:`tag`});for(let n of g.data??[])R.includes(n.id)||[n.id,n.name,n.title,...n.tags??[]].some(t=>t&&t.length>2&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:n.title||n.name,type:`skill`});return t.slice(0,6)},[A,b.data,g.data,j,R]);(0,F.useEffect)(()=>{T?C(T):w()},[T,w,C]);let Mt=()=>{w(),n(e=>{let t=new URLSearchParams(e);return t.delete(`job`),t},{replace:!0})},Nt=()=>{let e=new URL(window.location.href);e.hash=`#/new`,window.location.replace(e.toString())},Pt=()=>{T&&C(T)},K=(0,F.useMemo)(()=>(o.data??[]).find(e=>e.id===E)??null,[o.data,E]),q=(0,F.useMemo)(()=>K?K.repos.map(e=>({name:de(e.path),path:e.path,defaultBranch:e.defaultBranch})):(l.data??[]).filter(e=>N.includes(e.path)),[K,l.data,N]),[Ft,It]=(0,F.useState)(!0),[Lt,J]=(0,F.useState)(null),Y=m(),Rt=(0,F.useMemo)(()=>q.map(e=>({path:e.path,branch:V[e.path]||e.defaultBranch})),[q,V]),X=se(Rt,Rt.length>0),zt=(0,F.useMemo)(()=>{let e={};for(let t of X.data??[])e[t.repoPath]=t;return e},[X.data]),Z=(0,F.useMemo)(()=>(X.data??[]).filter(e=>e.status===`behind`),[X.data]),Bt=async()=>{J(null);try{let e=(await Y.mutateAsync({repos:Z.map(e=>({path:e.repoPath,branch:e.branch}))})).results.filter(e=>e.status===`dirty`||e.status===`diverged`);e.length>0&&J(`Could not update ${e.length} repo(s): ${e.map(e=>`${e.repoName} (${e.message})`).join(`; `)}`)}catch(e){J(e instanceof Error?e.message:String(e))}},Vt=async(e,t)=>{J(null);try{let n=(await Y.mutateAsync({path:e,branch:t})).results.find(e=>!e.success);n&&J(`Could not update ${n.repoName}: ${n.message}`)}catch(e){J(e instanceof Error?e.message:String(e))}},Q=k===`in-place`,Ht=(Q?ze.trim().length>0:Ie.trim().length>0)&&q.length>0&&A.trim().length>0,Ut=e=>{st(e),pt(null);let t=(re.data??[]).find(t=>t.id===e);lt(t?.content??``)},Wt=async()=>{if(!A.trim()){H(`Describe what you are building first — the suggestion is based on it.`);return}H(null),dt(!0);try{let e=await be(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:A,repos:q})});st(e.suggestedWorkflowId),lt(e.customInstructions),pt(e.difficulty)}catch(e){H(e instanceof Error?e.message:String(e))}finally{dt(!1)}},Gt=(0,F.useRef)(!1),Kt=async()=>{if(Gt.current||x.isPending||!Ht)return;Gt.current=!0,H(null);let e={flowType:ye,workType:ge,mode:k,projectId:K?.id,...Q?{name:ze.trim()}:{branchName:Ie.trim()},description:A.trim(),repos:q.map(e=>({...e,existingBranch:!Q&&V[e.path]?.trim()?V[e.path].trim():void 0})),assistants:I,enabledSkills:R.length>0?R:void 0,enabledAgents:B.length>0?B:void 0,domainPacks:j.length>0?j:void 0,teamworkInstructions:ct.trim()||void 0,autoUpdateBase:Ft};try{let{jobId:t}=await x.mutateAsync(e);C(t),n(e=>{let n=new URLSearchParams(e);return n.set(`job`,t),n},{replace:!0})}catch(e){H(e instanceof Error?e.message:String(e))}finally{Gt.current=!1}},$=S.status===`idle`&&T?{status:`running`,steps:[]}:S;if($.status!==`idle`){let t=$.steps.find(e=>e.status===`failed`);return(0,L.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:$.status===`running`?`Setting up your workspace…`:$.status===`completed`?`Workspace ready`:$.status===`failed`?`Workspace creation failed`:`Unable to reconnect to workspace setup`}),(0,L.jsx)(`ul`,{"aria-live":`polite`,"aria-relevant":`additions text`,className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:$.steps.length>0?$.steps.map(e=>(0,L.jsx)(ot,{step:e},e.id)):(0,L.jsxs)(`li`,{className:`flex items-center gap-3 py-3.5`,children:[(0,L.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary`,children:(0,L.jsx)(O,{className:`size-3`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium`,children:`Connecting to workspace setup…`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting for creation progress…`})]})]})}),($.status===`failed`||$.status===`unavailable`)&&(0,L.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??$.error??`Something went wrong.`}),$.status===`completed`&&$.workspacePath&&(0,L.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:$.workspacePath}),_t&&(0,L.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:_t}),(0,L.jsxs)(`div`,{"data-testid":`workspace-ready-actions`,className:`mt-6 flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[$.status===`completed`&&$.workspaceId&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(y,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent($.workspaceId)}`),children:`Open workspace`}),$.workspacePath&&(0,L.jsx)(et,{workspaceId:$.workspaceId,workspacePath:$.workspacePath,isVsCode:nt,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),$.status===`failed`&&(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(y,{variant:`default`,onClick:Mt,children:`Back to form (edit & retry)`}),(0,L.jsx)(y,{variant:`outline`,onClick:Nt,children:`Start over (clear form)`})]}),$.status===`unavailable`&&(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(y,{variant:`default`,onClick:Pt,children:`Try reconnecting`}),(0,L.jsx)(y,{variant:`outline`,onClick:Mt,children:`Back to form`})]}),$.status===`running`&&(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`}),(0,L.jsx)(y,{variant:`outline`,size:`sm`,onClick:Mt,children:`Return to form`})]})]})]})}return(0,L.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,L.jsxs)(`header`,{className:`mb-6`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,L.jsxs)(Oe,{value:E,onValueChange:e=>typeof e==`string`&&pe(e),children:[(0,L.jsx)(qe,{className:`w-full`,"aria-label":`Project`,children:(0,L.jsx)(Ce,{children:K?K.name:`Ad-hoc — pick repositories manually`})}),(0,L.jsxs)(Pe,{alignItemWithTrigger:!1,children:[(o.data??[]).map(e=>(0,L.jsx)(ke,{value:e.id,children:e.name},e.id)),(0,L.jsx)(ke,{value:tt,children:`Ad-hoc — pick repositories manually`})]})]}),K?(0,L.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:K.repos.map(e=>(0,L.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,L.jsxs)(`div`,{className:`mt-2`,children:[(0,L.jsx)(me,{repos:l.data??[],selectedPaths:N,onToggle:e=>Je(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:l.isLoading,freshnessMap:zt}),(0,L.jsx)(he,{onCreated:e=>Je(t=>[...t,e.path])})]}),q.length>0&&(0,L.jsxs)(`div`,{className:`mt-3 rounded-lg border border-border bg-card p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,L.jsx)(De,{className:`size-3.5`}),`Base repository sync (`,q.length,`)`]}),(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:Z.length>0&&(0,L.jsxs)(y,{size:`sm`,variant:`outline`,className:`h-6 text-xs px-2`,onClick:Bt,disabled:Y.isPending,children:[Y.isPending?(0,L.jsx)(O,{className:`size-3 mr-1`}):(0,L.jsx)(Ve,{className:`size-3 mr-1`}),`Pull `,Z.length,` stale `,Z.length===1?`repo`:`repos`]})})]}),(0,L.jsx)(`ul`,{className:`mt-2 divide-y divide-border text-xs`,children:q.map(e=>{let t=zt[e.path],n=t?.status===`behind`;return(0,L.jsxs)(`li`,{className:`flex items-center justify-between py-1.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 truncate pr-2`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,L.jsxs)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:[`(`,V[e.path]||e.defaultBranch,`)`]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[X.isLoading?(0,L.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Checking…`}):t?(0,L.jsx)(Te,{tone:t.status===`up-to-date`?`success`:t.status===`behind`?`warning`:t.status===`diverged`?`danger`:t.status===`ahead`?`info`:`neutral`,title:t.message,children:t.status===`behind`?`↓ ${t.behind} behind ${t.trackingBranch}`:t.status===`up-to-date`?`Up to date`:t.status===`diverged`?`Diverged`:t.status===`ahead`?`↑ ${t.ahead} ahead`:`Local`}):null,n&&(0,L.jsx)(y,{size:`sm`,variant:`ghost`,className:`h-5 px-1.5 text-[11px] text-amber-500 hover:text-amber-600`,onClick:()=>Vt(e.path,V[e.path]||e.defaultBranch),disabled:Y.isPending,children:`Pull`})]})]},e.path)})}),Lt&&(0,L.jsx)(`p`,{className:`mt-2 text-xs text-amber-500`,children:Lt})]}),(o.data??[]).length===0&&!o.isLoading&&(0,L.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,L.jsx)(s,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,L.jsxs)(`fieldset`,{children:[(0,L.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:`What kind of work is this?`}),(0,L.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Work type`,(0,L.jsxs)(`select`,{"aria-label":`Work type`,className:`mt-1 block w-full rounded-md border border-border bg-background p-2`,value:ge,onChange:e=>ve(e.target.value),children:[(0,L.jsx)(`option`,{value:`bug`,children:`Bug fix`}),(0,L.jsx)(`option`,{value:`feature`,children:`Feature`}),(0,L.jsx)(`option`,{value:`performance`,children:`Performance`}),(0,L.jsx)(`option`,{value:`refactor`,children:`Refactor`}),(0,L.jsx)(`option`,{value:`rewrite`,children:`Rewrite`})]})]}),(0,L.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose a starting size and milestone preset. You can edit milestones in Plan.`}),(0,L.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:rt.map(e=>(0,L.jsxs)(`label`,{className:v(`cursor-pointer rounded-xl border p-4 focus-within:ring-2 focus-within:ring-ring`,ye===e.value?`border-primary bg-primary/5`:`border-border bg-card`),children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,L.jsx)(`input`,{type:`radio`,name:`flowType`,value:e.value,checked:ye===e.value,onChange:()=>Ee(e.value),"aria-label":e.title,"aria-describedby":`flow-${e.value}-description`,className:`accent-primary`}),e.title]}),(0,L.jsx)(`p`,{id:`flow-${e.value}-description`,className:`mt-2 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Work mode`,className:`grid gap-3 sm:grid-cols-2`,onKeyDown:e=>{if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(e.key)){e.preventDefault();let t=k===`in-place`?`worktree`:`in-place`;Fe(t),document.getElementById(`mode-${t}`)?.focus()}},children:it.map(e=>(0,L.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":k===e.value,tabIndex:k===e.value?0:-1,onClick:()=>Fe(e.value),className:v(`cursor-pointer rounded-xl border p-4 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,k===e.value?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border bg-card hover:border-foreground/20`),children:[(0,L.jsx)(e.icon,{className:v(`size-4`,k===e.value?`text-primary`:`text-muted-foreground`)}),(0,L.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,L.jsxs)(`section`,{children:[Q?(0,L.jsxs)(`label`,{className:`block`,children:[(0,L.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,L.jsx)(r,{value:ze,onChange:e=>Ue(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`label`,{className:`block`,children:[(0,L.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,L.jsx)(r,{value:Ie,onChange:e=>Le(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),q.length>0&&(0,L.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>gt(e.target.open),children:[(0,L.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,L.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:q.map(e=>(0,L.jsx)(at,{repo:e,enabled:ht,value:V[e.path]??``,onChange:t=>mt(n=>({...n,[e.path]:t}))},e.path))})]})]}),(0,L.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 cursor-pointer text-xs text-muted-foreground`,children:[(0,L.jsx)(D,{checked:Ft,onCheckedChange:e=>It(!!e),"aria-label":`Fast-forward clean base branches before creating workspace`}),(0,L.jsx)(`span`,{children:`Fast-forward clean base branches to latest remote commits`})]})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsxs)(`label`,{className:`block`,children:[(0,L.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,L.jsx)(We,{value:A,onChange:e=>Ge(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]}),jt.length>0&&(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 p-2 rounded-lg bg-primary/5 border border-primary/20 text-xs`,children:[(0,L.jsxs)(`span`,{className:`text-primary font-medium flex items-center gap-1 text-[11px]`,children:[(0,L.jsx)(we,{className:`size-3`}),` Suggested for this task:`]}),jt.map(e=>(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{e.type===`tag`?M(t=>t.includes(e.id)?t:[...t,e.id]):z(t=>t.includes(e.id)?t:[...t,e.id])},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-card border border-primary/30 text-[11px] font-mono hover:bg-primary/10 transition-colors text-foreground`,children:[(0,L.jsxs)(`span`,{children:[`+`,e.title]}),(0,L.jsx)(i,{variant:`outline`,className:`text-[8px] px-0.5 py-0 uppercase`,children:e.type})]},`${e.type}-${e.id}`))]})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,L.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,L.jsx)(_e,{className:`size-4 text-primary`}),`Category & Domain Tags`,j.length>0&&(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,j.length,` attached)`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground hidden sm:inline`,children:`Tags attach curated skill bundles & standards`}),(0,L.jsxs)(y,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>U(!0),className:`h-6 text-xs gap-1 px-2 border-primary/40 text-primary hover:bg-primary/10`,children:[(0,L.jsx)(_e,{className:`size-3`}),`+ New Tag`]})]})]}),(0,L.jsx)(`div`,{className:`space-y-2`,children:b.isLoading?(0,L.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,L.jsx)(O,{className:`size-3`}),`Loading category tags...`]}):(b.data??[]).length===0?(0,L.jsx)(`div`,{className:`p-3.5 border border-border rounded-xl bg-card/40 space-y-2`,children:(0,L.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`No domain tags defined yet`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Tags are optional bundles that package skills, rules, and test commands for a domain. You can create a tag now, or select skills directly below.`})]}),(0,L.jsxs)(y,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>U(!0),className:`text-xs gap-1.5 h-7 shrink-0 text-primary border-primary/40 hover:bg-primary/10`,children:[(0,L.jsx)(_e,{className:`size-3 text-primary`}),`+ Create Tag`]})]})}):(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(b.data??[]).map(e=>{let t=j.includes(e.id),n=e.skills?.length??0,r=e.rules?.length??0;return(0,L.jsxs)(`div`,{onClick:()=>M(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:v(`flex flex-col justify-between p-3 rounded-xl border cursor-pointer transition-colors text-left outline-none select-none`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/20`),children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(D,{checked:t,onCheckedChange:()=>M(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Attach ${e.name}`}),(0,L.jsxs)(`span`,{className:`font-medium text-xs font-mono`,children:[`#`,e.id]})]}),e.categoryType&&(0,L.jsx)(i,{variant:`outline`,className:`text-[10px] px-1 py-0 shrink-0 capitalize`,children:e.categoryType===`trait`?`trait`:`domain`})]}),(0,L.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground line-clamp-2`,children:e.description||e.name}),(n>0||r>0)&&(0,L.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border/50 flex flex-wrap gap-1 items-center text-[10px]`,children:[n>0&&(0,L.jsxs)(`span`,{className:`text-primary font-mono flex items-center gap-1`,children:[(0,L.jsx)(xe,{className:`size-2.5`}),e.skills.join(`, `)]}),r>0&&(0,L.jsxs)(`span`,{className:`text-muted-foreground ml-auto font-mono`,children:[r,` rule`,r===1?``:`s`]})]})]},e.id)})})}),(0,L.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-border/60`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,L.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,L.jsx)(xe,{className:`size-4 text-primary`}),`Direct Agent Skills`,R.length>0&&(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,R.length,` selected)`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(g.data??[]).length>0&&(0,L.jsx)(y,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(g.data??[]).map(e=>e.id);z(R.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:R.length===(g.data??[]).length&&(g.data??[]).length>0?`Deselect All`:`Select All`}),(0,L.jsx)(s,{to:`/skills`,className:`text-xs text-primary hover:underline flex items-center gap-1`,children:`Skill Library →`})]})]}),g.isLoading?(0,L.jsxs)(`div`,{className:`flex items-center justify-center p-3 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,L.jsx)(O,{className:`size-3`}),`Loading skills...`]}):(g.data??[]).length===0?(0,L.jsx)(`div`,{className:`p-3 border border-dashed border-border rounded-lg bg-card/20 text-center`,children:(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No skills in your catalog yet. You can create skills in the`,` `,(0,L.jsx)(s,{to:`/skills`,className:`text-primary underline`,children:`Skill Library`}),` `,`or let AI agents create them during development.`]})}):(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(g.data??[]).map(e=>{let t=R.includes(e.id);return(0,L.jsxs)(`div`,{onClick:()=>z(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:v(`flex items-center justify-between gap-2 p-2.5 rounded-lg border cursor-pointer transition-colors select-none text-left`,t?`border-primary/60 bg-primary/5 ring-1 ring-primary/40 text-foreground`:`border-border bg-card hover:border-foreground/20 text-muted-foreground`),children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,L.jsx)(D,{checked:t,onCheckedChange:()=>z(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Select ${e.title||e.name}`}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`font-mono text-xs font-medium truncate text-foreground`,children:e.title||e.name}),e.description&&(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),e.category&&(0,L.jsx)(i,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0 capitalize`,children:e.category})]},e.id)})})]})]}),(0,L.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-4`,"aria-label":`AI harnesses`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI harnesses`}),(0,L.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose which tools receive workspace instructions. This does not start a session or choose a default harness.`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(d.data??[]).map(e=>(0,L.jsxs)(`label`,{className:v(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,!e.detected&&`opacity-50`),children:[(0,L.jsx)(D,{checked:I.includes(e.name),onCheckedChange:()=>Ze(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),(0,L.jsx)(Ke,{harness:e.name}),e.displayName,!e.detected&&(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Not installed`})]},e.name))})]})}),(0,L.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>Ye(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":P,children:[`Advanced`,(0,L.jsx)(le,{className:v(`size-4 text-muted-foreground transition-transform`,P&&`rotate-180`)})]}),P&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,L.jsxs)(y,{size:`xs`,variant:`outline`,onClick:Wt,disabled:ut,children:[ut?(0,L.jsx)(O,{}):(0,L.jsx)(we,{}),`Suggest with AI`]})]}),(0,L.jsxs)(Oe,{value:$e,onValueChange:e=>typeof e==`string`&&Ut(e),children:[(0,L.jsx)(qe,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,L.jsx)(Ce,{children:(re.data??[]).find(e=>e.id===$e)?.name??`None`})}),(0,L.jsxs)(Pe,{alignItemWithTrigger:!1,children:[(0,L.jsx)(ke,{value:``,children:`None`}),(re.data??[]).map(e=>(0,L.jsx)(ke,{value:e.id,children:e.name},e.id))]})]}),ft&&(0,L.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,L.jsx)(`span`,{className:`font-medium`,children:ft}),` difficulty.`]}),(0,L.jsx)(We,{value:ct,onChange:e=>lt(e.target.value),placeholder:`Cooperation instructions for the agent team (editable — prefilled by the strategy pick or AI suggestion).`,rows:4,className:`mt-2 font-mono text-xs`})]}),(_.data??[]).length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,L.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,L.jsx)(Re,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,B.length,` selected)`]})}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(_.data??[]).map(e=>{let t=B.includes(e.id);return(0,L.jsxs)(`label`,{className:v(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-xs`,t?`border-purple-500/60 bg-purple-500/5 text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,L.jsx)(D,{checked:t,onCheckedChange:()=>Qe(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,L.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),_t&&(0,L.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:_t}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(h,{className:`size-3.5`}),q.length,` repositor`,q.length===1?`y`:`ies`,` selected`]}),(0,L.jsxs)(y,{onClick:Kt,disabled:!Ht||x.isPending,children:[x.isPending?(0,L.jsx)(O,{}):null,Q?`Start working`:`Create workspace`]})]})]}),(0,L.jsx)(Me,{open:vt,onOpenChange:U,children:(0,L.jsxs)(je,{className:`max-w-md`,children:[(0,L.jsxs)(Be,{children:[(0,L.jsxs)(Ne,{className:`flex items-center gap-2`,children:[(0,L.jsx)(_e,{size:16,className:`text-primary`}),(0,L.jsx)(`span`,{children:`Create Category Tag`})]}),(0,L.jsx)(He,{children:`Tags bundle reusable skills, rules, and test verification commands for a domain.`})]}),(0,L.jsxs)(Ae,{className:`space-y-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag Name`}),(0,L.jsx)(r,{value:W,onChange:e=>{yt(e.target.value),(!G||G===W.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))&&bt(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))},placeholder:`e.g. Invoicing & Billing`,size:`sm`})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag ID / Slug`}),(0,L.jsx)(r,{value:G,onChange:e=>bt(e.target.value),placeholder:`e.g. billing`,size:`sm`,className:`font-mono`})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Type`}),(0,L.jsxs)(`select`,{value:Ct,onChange:e=>wt(e.target.value),className:`w-full h-7.5 px-2 text-xs rounded-md border border-border bg-background text-foreground`,children:[(0,L.jsx)(`option`,{value:`vertical`,children:`Vertical Subsystem`}),(0,L.jsx)(`option`,{value:`trait`,children:`Horizontal Trait`})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Description (optional)`}),(0,L.jsx)(r,{value:xt,onChange:e=>St(e.target.value),placeholder:`What this domain covers...`,size:`sm`})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Verification Command (optional)`}),(0,L.jsx)(r,{value:Tt,onChange:e=>Et(e.target.value),placeholder:`e.g. npm test -- billing`,size:`sm`,className:`font-mono`})]})]}),(0,L.jsxs)(Se,{className:`flex items-center justify-end gap-2 pt-2 border-t`,children:[(0,L.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>U(!1),children:`Cancel`}),(0,L.jsx)(y,{type:`button`,size:`sm`,disabled:!W.trim()||!G.trim()||Dt,onClick:()=>void At(),children:Dt?`Creating...`:`Create & Attach Tag`})]})]})})]})}export{st as StartWorkPage};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{n as r,t as i}from"./badge-BObbahyU.js";import{h as a,t as o}from"./button-BrcP8Wxx.js";import{t as ee}from"./shield-check-FLrrAOFP.js";import{t as s}from"./trash-2-BrrLX4tD.js";import{i as c,n as te,r as l,t as ne}from"./tabs-x72_G6CN.js";import{C as re,S as u,d as ie,i as ae,t as d,x as oe}from"./brand-hHByyyzq.js";import{n as f,t as p}from"./client-B5szthbF.js";import{B as m,D as h,Et as se,Ht as ce,I as g,Jt as _,L as v,Nt as le,Qt as ue,R as y,St as de,T as fe,Ut as b,Zt as pe,an as me,at as x,in as he,it as ge,jt as S,kt as C,nt as _e,o as w,ot as T,rn as ve,rt as E,z as D}from"./index-4lBf5Ph9.js";import{a as O,i as k,n as A,r as j,t as M}from"./card-BMggHY3n.js";import{t as N}from"./label-C610MHwq.js";import{n as ye,r as be,t as xe}from"./alert-CHAmIFAx.js";var Se=a(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ce=a(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),we=a(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Te=a(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),P=a(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Ee=a(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),De=a(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Oe=a(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),ke=a(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Ae=a(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),je=a(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),Me=a(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Ne=a(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Pe=a(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Fe=a(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),F=a(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),I=e(t(),1),L=n(),Ie=[{pattern:/plan|decision|context|document|handoff/i,label:`Shared context`,tool:`context`},{pattern:/resource|package|skill|agent/i,label:`Resource evidence`,tool:`resources`},{pattern:/workflow|step|completion|evidence/i,label:`Workflow evidence`,tool:`workflow`},{pattern:/member|join|participant|invite/i,label:`People`,tool:`members`},{pattern:/password|credential|security|certificate|tls/i,label:`Security record`,tool:`security`}],Le=[{tool:`overview`,label:`Project & privacy`,icon:ee},{tool:`context`,label:`Shared context`,icon:b},{tool:`resources`,label:`Resources`,icon:je},{tool:`workflow`,label:`Workflow`,icon:ce},{tool:`members`,label:`People`,icon:de},{tool:`activity`,label:`Full activity log`,icon:me},{tool:`security`,label:`Security & export`,icon:Oe}];function Re(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t)}function ze(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function R(e){return e.role===`host`?`host`:e.role===`publisher`?`publisher`:`member`}function z(e){switch(e){case`in_progress`:return`In progress`;case`completion_proposed`:return`Review requested`;case`completed`:return`Complete`;case`skipped`:return`Skipped`;default:return`Pending`}}function Be({status:e}){return e===`completed`?(0,L.jsx)(ue,{"aria-hidden":`true`,className:`text-success`,size:14}):e===`in_progress`?(0,L.jsx)(Se,{"aria-hidden":`true`,className:`text-primary`,size:14}):e===`completion_proposed`?(0,L.jsx)(we,{"aria-hidden":`true`,className:`text-warning`,size:14}):(0,L.jsx)(_,{"aria-hidden":`true`,className:`text-muted-foreground`,size:14})}function B({participant:e,emphasized:t=!1}){return(0,L.jsx)(`span`,{"aria-hidden":`true`,"data-role":e?.role??`system`,className:`grid shrink-0 place-items-center rounded-full border ${t?`size-9 border-primary/60 bg-primary/15 text-primary`:`size-8 border-border bg-muted text-muted-foreground`}`,children:(0,L.jsx)(F,{"aria-hidden":`true`,size:t?17:15})})}function Ve({snapshot:e,roomUrl:t,isHost:n,me:r,busy:a,message:s,hasUnsavedHandoffDraft:c,headingRef:te,onCreateInvite:l,onRefresh:ne,onStopOrLeave:re,onOpenTool:u,onMessageChange:ie,onPostUpdate:ae}){let d=(0,I.useMemo)(()=>e.participants.filter(e=>!e.revokedAt),[e.participants]),oe=(0,I.useMemo)(()=>new Map(e.participants.map(e=>[e.id,e])),[e.participants]),f=e.workflowProgress,p=f?.steps.findIndex(e=>e.status===`completion_proposed`)??-1,m=f?.steps.findIndex(e=>e.status===`in_progress`)??-1,h=p>=0?p:m,g=f?.steps.findIndex(e=>e.status===`pending`)??-1,_=h>=0?f?.steps[h]:void 0,v=g>=0?f?.steps[g]:void 0,le=f?.package.steps.find(e=>e.id===_?.stepId),ue=f?.package.steps.find(e=>e.id===v?.stepId),y=h>=0?f?.steps.slice(h+1).find(e=>e.status===`pending`):void 0,de=f?.package.steps.find(e=>e.id===y?.stepId),fe=_?oe.get(_.updatedBy):void 0,he=!!(f?.steps.length&&f.steps.every(e=>e.status===`completed`||e.status===`skipped`)),D=e.activity.slice(-20);return(0,L.jsxs)(`section`,{"aria-labelledby":`handoff-stream-title`,className:`animate-fade-in`,"data-testid":`handoff-stream`,children:[(0,L.jsx)(`header`,{className:`border-b border-border pb-4`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 xl:flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(me,{"aria-hidden":`true`,className:`text-muted-foreground`,size:17}),(0,L.jsx)(`h1`,{ref:te,id:`handoff-stream-title`,tabIndex:-1,className:`text-lg font-semibold tracking-tight outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:`Handoff Stream`}),(0,L.jsxs)(i,{variant:`success`,children:[(0,L.jsx)(`span`,{className:`mr-1 inline-block size-1.5 rounded-full bg-success`}),`Live`]})]}),(0,L.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,children:e.bundle.feature.goal})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 sm:gap-3`,children:[(0,L.jsxs)(`div`,{"aria-label":`${d.length} participants`,className:`flex items-center gap-1`,children:[d.slice(0,4).map(e=>(0,L.jsxs)(`span`,{className:`flex items-center gap-2 rounded-md px-1 py-0.5`,title:`${e.displayName} · ${R(e)}`,children:[(0,L.jsx)(B,{participant:e,emphasized:e.id===r?.id}),(0,L.jsxs)(`span`,{className:`hidden max-w-24 leading-tight 2xl:block`,children:[(0,L.jsx)(`span`,{className:`block truncate text-xs font-semibold`,children:e.displayName}),(0,L.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:R(e)})]})]},e.id)),d.length>4&&(0,L.jsxs)(`span`,{className:`grid size-8 place-items-center rounded-full border border-border bg-muted text-[10px] font-semibold text-muted-foreground`,children:[`+`,d.length-4]})]}),n&&(0,L.jsxs)(o,{variant:`outline`,onClick:l,disabled:a!==null,children:[(0,L.jsx)(De,{"aria-hidden":`true`}),` Invite`,e.pendingJoins.length>0&&(0,L.jsx)(`span`,{className:`ml-0.5 rounded bg-warning/15 px-1 text-[10px] text-warning-foreground`,children:e.pendingJoins.length})]}),(0,L.jsxs)(_e,{children:[(0,L.jsx)(T,{"aria-label":`Open room tools`,className:`grid size-8 cursor-pointer place-items-center rounded-md border border-border bg-card text-muted-foreground shadow-2xs transition-colors hover:bg-accent hover:text-foreground`,children:(0,L.jsx)(P,{"aria-hidden":`true`,size:16})}),(0,L.jsxs)(ge,{align:`end`,className:`w-56`,children:[Le.map(({tool:t,label:n,icon:r})=>(0,L.jsxs)(E,{onClick:()=>u(t),children:[(0,L.jsx)(r,{"aria-hidden":`true`}),` `,n,t===`members`&&e.pendingJoins.length>0&&(0,L.jsx)(`span`,{className:`ml-auto text-[10px] text-warning-foreground`,children:e.pendingJoins.length})]},t)),(0,L.jsx)(x,{}),(0,L.jsxs)(E,{onClick:ne,children:[(0,L.jsx)(S,{"aria-hidden":`true`}),` Refresh room`]}),(0,L.jsxs)(E,{variant:`destructive`,disabled:a!==null,onClick:()=>{let e=n?`stop hosting this Workroom`:`leave this Workroom`;window.confirm(`Are you sure you want to ${e}?`)&&re()},children:[(0,L.jsx)(se,{"aria-hidden":`true`}),` `,n?`Stop room`:`Leave room`]})]})]})]})]})}),(0,L.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-[minmax(0,1fr)_17rem]`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-primary/35 bg-primary/10 px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-full border border-primary/50 bg-primary/12 text-primary`,children:(0,L.jsx)(ce,{"aria-hidden":`true`,size:17})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm font-semibold`,children:f?he?`Workflow complete`:_?.status===`completion_proposed`?`A review is ready`:_?`Work is moving`:`Workflow ready`:`No shared workflow yet`}),(0,L.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:he?`Every shared step has been completed.`:f&&_?`${fe?.displayName||`A participant`} updated ${le?.title||_.stepId} · step ${h+1} of ${f.steps.length}${de?` · next: ${de.title}`:``}`:f&&v?`Next: ${ue?.title||v.stepId} · step ${g+1} of ${f.steps.length}`:f?`The shared workflow is ready to start.`:n?`Choose a reviewed workflow to make the next handoff explicit.`:`The host has not selected a shared workflow yet.`})]})]}),(f||n)&&(0,L.jsxs)(o,{size:`sm`,onClick:()=>u(`workflow`),children:[_?.status===`completion_proposed`?`Review proposal`:f?`Open workflow`:`Set workflow`,(0,L.jsx)(pe,{"aria-hidden":`true`})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Room activity`}),(0,L.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:`Decisions, evidence, and handoffs shared with this room.`})]}),(0,L.jsxs)(o,{variant:`ghost`,size:`xs`,onClick:()=>u(`activity`),children:[`View log `,(0,L.jsx)(ve,{"aria-hidden":`true`})]})]}),D.length>0?(0,L.jsx)(`ol`,{"aria-label":`Workroom activity`,className:`relative divide-y divide-border/70 before:absolute before:bottom-8 before:left-[2.05rem] before:top-8 before:w-px before:bg-border`,children:D.map(e=>{let t=oe.get(e.actorId),n=Ie.find(({pattern:t})=>t.test(e.type));return(0,L.jsxs)(`li`,{className:`relative flex gap-3 px-4 py-4 sm:gap-4`,children:[(0,L.jsx)(`span`,{className:`relative z-10 rounded-full bg-card p-0.5`,children:(0,L.jsx)(B,{participant:t,emphasized:t?.id===r?.id})}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,L.jsx)(`span`,{className:`min-w-0 break-words text-xs font-semibold [overflow-wrap:anywhere]`,children:t?.displayName||`Historical participant`}),t&&(0,L.jsx)(i,{variant:t.role===`host`?`info`:`secondary`,children:R(t)}),(0,L.jsx)(`time`,{className:`text-[10px] text-muted-foreground`,dateTime:e.createdAt,children:Re(e.createdAt)})]}),(0,L.jsx)(`p`,{className:`mt-1.5 break-words text-sm font-medium text-foreground [overflow-wrap:anywhere]`,children:e.summary}),(0,L.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[e.type,` · event #`,e.sequence]}),n&&(0,L.jsxs)(`button`,{type:`button`,className:`mt-2 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-muted/35 px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,onClick:()=>u(n.tool),children:[(0,L.jsx)(b,{"aria-hidden":`true`,size:12}),` `,n.label]})]})]},e.sequence)})}):(0,L.jsxs)(`div`,{className:`px-4 py-10 text-center`,children:[(0,L.jsx)(me,{"aria-hidden":`true`,className:`mx-auto text-muted-foreground`,size:20}),(0,L.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`No shared activity yet`}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Post an update below to begin the handoff stream.`})]}),(0,L.jsxs)(`form`,{className:`border-t border-border p-3`,onSubmit:async e=>{e.preventDefault();let t=s.trim();!t||a!==null||c||await ae(t)},children:[(0,L.jsx)(`label`,{className:`sr-only`,htmlFor:`handoff-stream-message`,children:`Share a handoff update`}),(0,L.jsx)(w,{id:`handoff-stream-message`,className:`min-h-20 resize-y border-0 bg-transparent px-1 py-1 shadow-none focus-visible:ring-0`,maxLength:4e3,placeholder:`Share a decision, result, blocker, or next step…`,value:s,onChange:e=>ie(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&e.currentTarget.form?.requestSubmit()}}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Only the text you enter is shared from this composer. No files, diffs, paths, credentials, or transcripts are collected automatically.`}),c&&(0,L.jsx)(`p`,{className:`text-[10px] text-warning-foreground`,children:`Resolve your unsaved Handoff draft in Shared context before posting another update.`})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[c&&(0,L.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>u(`context`),children:`Review draft`}),(0,L.jsxs)(o,{type:`submit`,size:`sm`,disabled:!s.trim()||a!==null||c,children:[(0,L.jsx)(C,{"aria-hidden":`true`}),` `,a===`stream-post`?`Posting…`:`Post update`]})]})]})]})]})]}),(0,L.jsxs)(`aside`,{"aria-label":`Workroom details`,className:`h-fit divide-y divide-border rounded-lg border border-border bg-card xl:sticky xl:top-4`,children:[(0,L.jsxs)(`section`,{className:`p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`h2`,{className:`text-xs font-semibold`,children:[`Steps `,f?`(${f.steps.length})`:``]}),(f||n)&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(`workflow`),className:`cursor-pointer text-muted-foreground hover:text-foreground`,"aria-label":`Open workflow tools`,children:(0,L.jsx)(Me,{"aria-hidden":`true`,size:14})})]}),f?(0,L.jsx)(`ol`,{className:`mt-3 space-y-1`,children:f.steps.map((e,t)=>{let n=f.package.steps.find(t=>t.id===e.stepId),r=oe.get(e.updatedBy),i=z(e.status);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(`workflow`),className:`group flex w-full cursor-pointer items-start gap-2 rounded-md px-1 py-2 text-left hover:bg-accent/60`,children:[(0,L.jsx)(`span`,{className:`mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border border-border bg-background text-[10px]`,children:t+1}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-xs ${e.status===`in_progress`||e.status===`completion_proposed`?`font-semibold text-foreground`:`text-muted-foreground`}`,children:n?.title||e.stepId}),(0,L.jsx)(`span`,{className:`mt-0.5 block truncate text-[10px] text-muted-foreground`,children:e.status===`pending`||!r?i:`${i} · updated by ${r.displayName}`})]}),(0,L.jsx)(`span`,{className:`mt-1`,children:(0,L.jsx)(Be,{status:e.status})})]})},e.stepId)})}):n?(0,L.jsxs)(`button`,{type:`button`,onClick:()=>u(`workflow`),className:`mt-3 w-full cursor-pointer rounded-md border border-dashed border-border px-3 py-4 text-left hover:bg-accent/50`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium`,children:`Make turns explicit`}),(0,L.jsx)(`span`,{className:`mt-1 block text-[10px] text-muted-foreground`,children:`Select a shared workflow and require evidence for completion.`})]}):(0,L.jsxs)(`div`,{className:`mt-3 rounded-md border border-dashed border-border px-3 py-4`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium`,children:`Waiting for a workflow`}),(0,L.jsx)(`span`,{className:`mt-1 block text-[10px] text-muted-foreground`,children:`The host can select a shared workflow for this room.`})]})]}),(0,L.jsxs)(`section`,{className:`p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`h2`,{className:`text-xs font-semibold`,children:[`Participants (`,d.length,`)`]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(`members`),className:`cursor-pointer text-[10px] text-muted-foreground hover:text-foreground`,children:`Manage`})]}),(0,L.jsx)(`ul`,{className:`mt-3 space-y-2.5`,children:d.slice(0,6).map(e=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(B,{participant:e,emphasized:e.id===r?.id}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:e.displayName}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:R(e)})]},e.id))})]}),(0,L.jsxs)(`section`,{className:`space-y-2.5 p-4`,children:[(0,L.jsx)(`h2`,{className:`text-xs font-semibold`,children:`Room details`}),(0,L.jsxs)(`dl`,{className:`space-y-2 text-[11px]`,children:[(0,L.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,L.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,L.jsx)(`dd`,{className:`truncate text-right`,children:e.participants.find(e=>e.role===`host`)?.displayName||`Host`})]}),(0,L.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,L.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,L.jsx)(`dd`,{className:`text-right`,children:ze(e.createdAt)})]}),(0,L.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,L.jsx)(`dt`,{className:`text-muted-foreground`,children:`Workspace`}),(0,L.jsx)(`dd`,{className:`truncate text-right`,children:e.bundle.feature.id})]}),(0,L.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,L.jsx)(`dt`,{className:`text-muted-foreground`,children:`Status`}),(0,L.jsxs)(`dd`,{className:`inline-flex items-center gap-1.5`,children:[`Live `,(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`})]})]})]}),(0,L.jsx)(`p`,{className:`truncate border-t border-border pt-2 font-mono text-[9px] text-muted-foreground`,title:t,children:t})]}),(0,L.jsx)(`section`,{className:`p-3`,children:(0,L.jsxs)(o,{variant:`ghost`,className:`w-full justify-start`,onClick:()=>u(`security`),children:[(0,L.jsx)(ee,{"aria-hidden":`true`}),` Security & encrypted export`]})})]})]})]})}var V={plan:`Plan`,decisions:`Decisions & knowledge`,handoff:`Handoff`},He={overview:`Project & privacy`,context:`Shared context`,resources:`Resources`,workflow:`Workflow`,members:`People`,activity:`Full activity log`,security:`Security & encrypted export`};function Ue(){let e=new Uint8Array(18);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/[+/=]/g,``).slice(0,24)}function We(e){return e instanceof Error?e.message:String(e)}function H(e){return e.mode===`host`||e.mode===`guest`?e.snapshot:void 0}function Ge(e,t){return e.mode===`host`||e.mode===`guest`?{...e,snapshot:t}:e}function Ke(e,t){let n=H(e),r=H(t);if(!n||!r||n.roomId!==r.roomId)return t;let i=r.revision>=n.revision?r:n,a={plan:r.documents.plan.revision>=n.documents.plan.revision?r.documents.plan:n.documents.plan,decisions:r.documents.decisions.revision>=n.documents.decisions.revision?r.documents.decisions:n.documents.decisions,handoff:r.documents.handoff.revision>=n.documents.handoff.revision?r.documents.handoff:n.documents.handoff};return Ge(t,{...i,documents:a})}function qe(e,t,n){let r=H(e);return!r||r.roomId!==t||n.revision<r.documents.handoff.revision?e:Ge(e,{...r,documents:{...r.documents,handoff:n}})}async function Je(e,t){let n=JSON.stringify({bundle:e,documents:{plan:t.plan,decisions:t.decisions,handoff:t.handoff}}),r=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(n));return[...new Uint8Array(r)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Ye({workspaces:e,showToast:t}){let[n,a]=(0,I.useState)({mode:`idle`}),[ce,_]=(0,I.useState)([]),[b,pe]=(0,I.useState)(null),[x,ge]=(0,I.useState)(``),[C,_e]=(0,I.useState)(null),[T,ve]=(0,I.useState)({plan:``,decisions:``,handoff:``}),[E,Se]=(0,I.useState)({plan:!1,decisions:!1,handoff:!1}),[we,P]=(0,I.useState)(!1),[Oe,Me]=(0,I.useState)(``),[F,Ie]=(0,I.useState)(``),[Le,Re]=(0,I.useState)(`4242`),[ze,R]=(0,I.useState)(``),[z,Be]=(0,I.useState)(()=>Ue()),[B,H]=(0,I.useState)(``),[Ge,Ye]=(0,I.useState)(``),[Xe,Ze]=(0,I.useState)(``),[Qe,$e]=(0,I.useState)(``),[et,tt]=(0,I.useState)(``),[nt,rt]=(0,I.useState)(``),[it,at]=(0,I.useState)({plan:``,decisions:``,handoff:``}),[U,ot]=(0,I.useState)({plan:!1,decisions:!1,handoff:!1}),[W,st]=(0,I.useState)([]),[ct,lt]=(0,I.useState)(``),[ut,dt]=(0,I.useState)(`0.1.0`),[ft,pt]=(0,I.useState)({}),[mt,ht]=(0,I.useState)(``),[gt,_t]=(0,I.useState)(`0.1.0`),[vt,yt]=(0,I.useState)(`Plan
|
|
2
|
-
Implement
|
|
3
|
-
Verify
|
|
4
|
-
Review`),[bt,xt]=(0,I.useState)({}),[St,Ct]=(0,I.useState)(()=>Ue()),[G,wt]=(0,I.useState)(()=>Ue()),[Tt,Et]=(0,I.useState)(null),[K,q]=(0,I.useState)(`stream`),[Dt,Ot]=(0,I.useState)(``),[kt,At]=(0,I.useState)([]),[jt,Mt]=(0,I.useState)([]),Nt=(0,I.useRef)(null),Pt=(0,I.useRef)(null),Ft=(0,I.useRef)(null),It=(0,I.useRef)(!1),J=n.mode===`host`||n.mode===`guest`?n.snapshot:void 0,Y=n.mode===`host`,X=n.mode===`guest`&&n.status===`pending`,Lt=n.mode===`host`?J?.participants.find(e=>e.role===`host`):n.mode===`guest`?J?.participants.find(e=>e.id===n.memberId):void 0,Rt=Lt?.role===`host`||Lt?.role===`publisher`,zt=!!J,Z=(0,I.useCallback)(async(e=!1)=>{try{let e=await f(`/api/workrooms/status`);a(t=>Ke(t,e.status))}catch(n){if(n instanceof p&&n.status===401)try{let e=await f(`/api/workrooms/session`);a(e.active&&e.locked&&e.roomType?{mode:`locked`,roomType:e.roomType}:{mode:`idle`});return}catch(n){e&&t(We(n),`error`);return}e&&t(We(n),`error`)}},[t]),Bt=(0,I.useCallback)(async()=>{let[e,t]=await Promise.all([f(`/api/workrooms/paused`),f(`/api/workrooms/quarantined`)]);At(e.rooms),Mt(t.rooms)},[]);(0,I.useEffect)(()=>{Promise.all([Z(),f(`/api/workrooms/interfaces`).then(e=>{_(e.interfaces),Ie(t=>t||e.interfaces.find(e=>!e.internal&&e.family===`IPv4`)?.address||e.interfaces[0]?.address||``)}),Bt()]);let e=window.setInterval(()=>void Z(),3e3);return()=>window.clearInterval(e)},[Z,Bt]),(0,I.useEffect)(()=>{if(!x){_e(null);return}f(`/api/workrooms/preview/${encodeURIComponent(x)}`).then(({preview:e})=>{_e(e),ve(e.documents),Se({plan:!1,decisions:!1,handoff:!1}),P(!1),Me(t=>t||`${e.bundle.feature.id} workroom`)}).catch(e=>t(We(e),`error`))},[x,t]),(0,I.useEffect)(()=>{J&&at(e=>({plan:U.plan?e.plan:J.documents.plan.content,decisions:U.decisions?e.decisions:J.documents.decisions.content,handoff:U.handoff?e.handoff:J.documents.handoff.content}))},[J,U]),(0,I.useEffect)(()=>{J?.workflowProgress&&xt(e=>Object.fromEntries(J.workflowProgress.steps.map(t=>[t.stepId,e[t.stepId]??t.evidence??``])))},[J?.workflowProgress]),(0,I.useEffect)(()=>{zt&&f(`/api/workrooms/local-resources`).then(({resources:e})=>{st(e),lt(t=>t||(e[0]?`${e[0].kind}:${e[0].id}`:``)),ht(t=>t||e.find(e=>e.kind===`workflow`)?.id||``)}).catch(()=>{})},[zt]),(0,I.useEffect)(()=>{n.mode===`idle`&&(Ot(``),q(`stream`))},[n.mode]),(0,I.useEffect)(()=>{if(!zt){It.current=!1;return}if(!It.current){It.current=!0;return}let e=window.requestAnimationFrame(()=>{K===`stream`?Pt.current?.focus():Ft.current?.focus()});return()=>window.cancelAnimationFrame(e)},[K,zt]);let Q=async(e,n,r)=>{if(Nt.current!==null)return!1;Nt.current=e,pe(e);try{return await n(),await Z(),await Bt().catch(()=>{}),r&&t(r,`success`),!0}catch(e){return t(We(e),`error`,8e3),!1}finally{Nt.current=null,pe(null)}},Vt=()=>Q(`start`,async()=>{if(!C)throw Error(`Select and preview a workspace first.`);let e={plan:E.plan?T.plan:``,decisions:E.decisions?T.decisions:``,handoff:E.handoff?T.handoff:``},t=await f(`/api/workrooms/start`,{method:`POST`,body:JSON.stringify({workspaceId:x,name:Oe,address:F,port:Number(Le),password:z,hostDisplayName:ze,contextConfirmed:we,contextDigest:await Je(C.bundle,e),documents:e})});a(t.status)},`Workroom started.`),Ht=e=>Q(`resume-${e}`,async()=>{let t=await f(`/api/workrooms/${encodeURIComponent(e)}/resume`,{method:`POST`,body:JSON.stringify({password:z})});a(t.status)},`Workroom resumed with its existing identity and memberships.`),Ut=e=>{window.confirm(`Discard failed import ${e}? This removes only its quarantined local files so you can retry the original encrypted export.`)&&Q(`discard-${e}`,async()=>{await f(`/api/workrooms/quarantined/${encodeURIComponent(e)}/discard`,{method:`POST`,body:JSON.stringify({confirmRoomId:e})})},`Failed import discarded. You can retry the encrypted export.`)},Wt=()=>Q(`join`,async()=>{let e=await f(`/api/workrooms/join`,{method:`POST`,body:JSON.stringify({invite:Xe,password:Qe,displayName:et,workspaceId:x||void 0})});a(e.status)},`Join request sent to the host.`),Gt=()=>Q(`poll`,async()=>{let e=await f(`/api/workrooms/join/poll`,{method:`POST`});a(e.status)}),Kt=()=>Q(`stop`,async()=>{await f(`/api/workrooms/stop`,{method:`POST`}),a({mode:`idle`}),q(`stream`),Ot(``),H(``)},Y?`Workroom stopped.`:`Left the Workroom.`),qt=()=>Q(`invite`,async()=>{let e=await f(`/api/workrooms/invites`,{method:`POST`});H(e.invite),Ye(e.expiresAt),await fe(e.invite)},`One-use invitation copied. Share the password separately.`),Jt=e=>Q(`doc-${e}`,async()=>{if(J)try{await f(`/api/workrooms/documents/${e}`,{method:`PUT`,body:JSON.stringify({content:it[e],expectedRevision:J.documents[e].revision})}),ot(t=>({...t,[e]:!1}))}catch(e){throw e instanceof p&&e.status===409?(await Z(),Error(`Someone updated this document first. Your draft is preserved; compare it with the latest revision and save again.`,{cause:e})):e}},`${V[e]} shared.`),Yt=()=>Q(`publish-resource`,async()=>{let[e,t]=ct.split(`:`);await f(`/api/workrooms/resources/publish`,{method:`POST`,body:JSON.stringify({kind:e,id:t,version:ut})})},`Immutable resource version published.`),Xt=e=>Q(`download-${e}`,async()=>{let t=await f(`/api/workrooms/resources/${e}/download`,{method:`POST`});pt(n=>({...n,[e]:t.preview}))},`Resource downloaded to the local quarantine cache. Review it before applying.`),Zt=e=>Q(`apply-${e}`,async()=>{let t=ft[e];if(!t)throw Error(`Download and review this resource again before applying it.`);await f(`/api/workrooms/resources/${e}/apply`,{method:`POST`,body:JSON.stringify({approvedDigest:e,approvedLocalDigest:t.localDigest})})},`Resource applied to your local ${d} catalog.`),Qt=e=>Q(`quarantine-${e}`,async()=>{await f(`/api/workrooms/resources/${e}/quarantine`,{method:`POST`})},`Resource version quarantined and removed from future exports and downloads.`),$t=e=>{window.confirm(`Permanently purge quarantined resource ${e}? Its package bytes and catalog entry will be removed so the room quota can be reused.`)&&Q(`purge-${e}`,async()=>{await f(`/api/workrooms/resources/${e}/purge`,{method:`POST`,body:JSON.stringify({confirmDigest:e})})},`Quarantined resource permanently purged and its room quota released.`)},en=()=>Q(`select-workflow`,async()=>{let e=W.find(e=>e.kind===`workflow`&&e.id===mt);if(!e)throw Error(`Select a local workflow.`);let t=vt.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map((e,t)=>({id:`${t+1}-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`step`}`,title:e,requiresEvidence:!0}));await f(`/api/workrooms/workflow/select`,{method:`POST`,body:JSON.stringify({workflowId:e.id,version:gt,steps:t,expectedRevision:J?.workflowProgress?.revision??0})})},`Shared workflow selected.`),$=(e,t)=>Q(`step-${e.stepId}`,async()=>{let n=J?.workflowProgress?.package.steps.find(t=>t.id===e.stepId),r=(bt[e.stepId]??e.evidence??``).trim();if(t===`completed`&&n?.requiresEvidence&&!r)throw Error(`Add evidence before completing this workflow step.`);await f(`/api/workrooms/workflow/steps/${encodeURIComponent(e.stepId)}/transition`,{method:`POST`,body:JSON.stringify({status:t,expectedRevision:e.revision,...t===`completed`&&r?{evidence:r}:{}})})}),tn=async e=>{let t=e.trim(),n=await Q(`stream-post`,async()=>{if(!J)throw Error(`The Workroom snapshot is not available.`);if(U.handoff)throw Error(`Resolve the unsaved Handoff draft in Shared context before posting another update.`);let e=J.documents.handoff.content.trimEnd(),n=e?`${e}\n\n${t}\n`:`${t}\n`;try{let e=await f(`/api/workrooms/documents/handoff`,{method:`PUT`,body:JSON.stringify({content:n,expectedRevision:J.documents.handoff.revision})});a(t=>qe(t,J.roomId,e.document))}catch(e){throw e instanceof p&&e.status===409?(await Z(),Error(`Someone updated the handoff first. Your update is preserved; review the latest shared context and post again.`,{cause:e})):e}},`Handoff update shared.`);return n&&Ot(e=>e.trim()===t?``:e),n},nn=()=>Q(`export`,async()=>{let e=await f(`/api/workrooms/export`,{method:`POST`,body:JSON.stringify({passphrase:G})}),t=new Blob([JSON.stringify(e.export,null,2)],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`${J?.roomId??`${ae}-workroom`}${re}`,n.click(),URL.revokeObjectURL(n.href)},`Encrypted Workroom export created.`),rn=()=>Q(`import`,async()=>{if(!Tt)throw Error(`Choose a ${re} or ${u} export first.`);let e=await f(`/api/workrooms/import`,{method:`POST`,body:JSON.stringify({export:Tt,exportPassphrase:G,name:Oe||void 0,address:F,port:Number(Le),password:z,hostDisplayName:ze})});a(e.status)},`Encrypted export imported as a new Workroom with new credentials.`);if(n.mode===`locked`)return(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,L.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-amber-500/10 text-amber-700`,children:(0,L.jsx)(Ee,{})}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Active Workroom is locked`}),(0,L.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[`This browser lost its local human-session cookie. `,n.roomType===`host`?`Enter the room password to regain host dashboard controls.`:`For safety, leave this local guest connection and join again with the invitation and room password.`]})]}),n.roomType===`host`?(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-sm flex-col gap-3`,children:[(0,L.jsx)(N,{htmlFor:`workroom-recovery-password`,children:`Room password`}),(0,L.jsx)(r,{id:`workroom-recovery-password`,type:`password`,value:nt,onChange:e=>rt(e.target.value)}),(0,L.jsxs)(o,{onClick:()=>Q(`reclaim`,async()=>{await f(`/api/workrooms/session/reclaim`,{method:`POST`,body:JSON.stringify({password:nt})}),rt(``)},`Local Workroom dashboard reconnected.`),disabled:b!==null||!nt,children:[b===`reclaim`?(0,L.jsx)(h,{}):(0,L.jsx)(Ee,{}),` Unlock host dashboard`]})]}):(0,L.jsx)(`div`,{children:(0,L.jsxs)(o,{variant:`destructive-outline`,onClick:()=>Q(`abandon-locked-guest`,async()=>{await f(`/api/workrooms/session/abandon`,{method:`POST`,body:JSON.stringify({confirm:!0})}),a({mode:`idle`})},`Locked guest connection left. Join the Workroom again.`),disabled:b!==null,children:[b===`abandon-locked-guest`?(0,L.jsx)(h,{}):(0,L.jsx)(ke,{}),` Leave and rejoin`]})})]});if(n.mode===`idle`)return(0,L.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-6`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(de,{className:`text-primary`,size:20}),(0,L.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Workrooms`}),(0,L.jsx)(i,{variant:`info`,children:`Experimental`})]}),(0,L.jsxs)(`p`,{className:`mt-1 max-w-3xl text-sm text-muted-foreground`,children:[`Share only the project context and reusable agent resources you explicitly review over a private LAN or VPN. `,d,` never adds code, diffs, credentials, terminals, or AI sessions automatically.`]})]}),(0,L.jsxs)(xe,{variant:`info`,children:[(0,L.jsx)(ee,{}),(0,L.jsx)(be,{children:`No listener runs by default`}),(0,L.jsxs)(ye,{children:[`A Workroom binds only to the network address you select and stops with `,d,`.`]})]}),kt.length>0&&(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Paused Workrooms`}),(0,L.jsx)(A,{children:`Enter the room password in the host form below, then resume on the same saved address and port. The password unlocks human authority; agent credentials remain read-and-propose-only.`})]}),(0,L.jsx)(k,{className:`grid gap-2 sm:grid-cols-2`,children:kt.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,L.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:[e.address,`:`,e.port,` · `,e.workspaceId]})]}),(0,L.jsxs)(o,{size:`sm`,variant:`outline`,onClick:()=>Ht(e.roomId),disabled:b!==null||z.length<12,children:[b===`resume-${e.roomId}`?(0,L.jsx)(h,{}):(0,L.jsx)(le,{}),` Resume`]})]},e.roomId))})]}),jt.length>0&&(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Failed imports`}),(0,L.jsx)(A,{children:`These rooms never completed import and cannot be resumed. Inspect the identity below, discard its quarantined local files, then retry the original encrypted export.`})]}),(0,L.jsx)(k,{className:`grid gap-2 sm:grid-cols-2`,children:jt.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-amber-500/40 p-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:e.name||e.roomId}),(0,L.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:[e.status===`failed`?`Import failed`:`Import interrupted`,e.workspaceId?` · ${e.workspaceId}`:``]})]}),(0,L.jsxs)(o,{size:`sm`,variant:`destructive-outline`,onClick:()=>Ut(e.roomId),disabled:b!==null,children:[b===`discard-${e.roomId}`?(0,L.jsx)(h,{}):(0,L.jsx)(s,{}),` Discard`]})]},e.roomId))})]}),(0,L.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Ae,{size:15}),` Start a Workroom`]}),(0,L.jsx)(A,{children:`Host collaboration from this computer. Your existing dashboard remains localhost-only.`})]}),(0,L.jsxs)(k,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Workspace`}),(0,L.jsxs)(g,{value:x,onValueChange:e=>typeof e==`string`&&ge(e),children:[(0,L.jsx)(D,{children:(0,L.jsx)(m,{children:e.find(e=>e.branchName===x)?.branchName||`Select a workspace`})}),(0,L.jsx)(y,{children:e.map(e=>(0,L.jsx)(v,{value:e.branchName,children:e.branchName},e.id))})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Room name`}),(0,L.jsx)(r,{value:Oe,onChange:e=>Me(e.target.value)})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Your display name`}),(0,L.jsx)(r,{value:ze,onChange:e=>R(e.target.value),placeholder:`Defaults to OS user`})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[1fr_100px]`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Network interface`}),(0,L.jsxs)(g,{value:F,onValueChange:e=>typeof e==`string`&&Ie(e),children:[(0,L.jsx)(D,{children:(0,L.jsx)(m,{children:F||`Select an address`})}),(0,L.jsx)(y,{children:ce.map(e=>(0,L.jsxs)(v,{value:e.address,children:[e.name,` · `,e.address,e.internal?` (local only)`:``]},`${e.name}-${e.address}`))})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Port`}),(0,L.jsx)(r,{type:`number`,value:Le,onChange:e=>Re(e.target.value)})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(N,{children:`Room password`}),(0,L.jsx)(o,{size:`xs`,variant:`ghost`,onClick:()=>Be(Ue()),children:`Generate`})]}),(0,L.jsx)(r,{type:`password`,value:z,onChange:e=>Be(e.target.value)}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Share this separately from the invitation. Minimum 12 characters.`})]}),C&&(0,L.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-muted/30 p-3 text-xs`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`font-semibold text-foreground`,children:`Exact sharing review`}),(0,L.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Repository identities below are always included. Local context files are excluded until you explicitly include each one.`})]}),C.bundleWarnings.map(e=>(0,L.jsxs)(`p`,{className:`text-amber-700 dark:text-amber-300`,children:[`Bundle warning: `,e]},e)),(0,L.jsx)(`div`,{className:`space-y-1 font-mono text-[10px] text-muted-foreground`,children:C.bundle.repos.map(e=>(0,L.jsxs)(`div`,{className:`break-all`,children:[e.name,`: `,e.remoteUrl]},e.id))}),(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{className:`cursor-pointer font-semibold text-foreground`,children:`Complete shared feature metadata`}),(0,L.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 font-mono text-[10px]`,children:JSON.stringify(C.bundle,null,2)})]}),Object.keys(V).map(e=>(0,L.jsxs)(`div`,{className:`space-y-1.5 rounded border border-border bg-background p-2`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-2 font-semibold text-foreground`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:E[e],onChange:t=>{Se(n=>({...n,[e]:t.target.checked})),P(!1)}}),` Include `,V[e]]}),C.warnings[e].map(e=>(0,L.jsxs)(`p`,{className:`text-amber-700 dark:text-amber-300`,children:[`Warning: `,e]},e)),(0,L.jsx)(w,{"aria-label":`${V[e]} exact outbound content`,className:`min-h-28 font-mono text-[10px]`,value:T[e],onChange:t=>{ve(n=>({...n,[e]:t.target.value})),P(!1)}}),(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:E[e]?`${T[e].length.toLocaleString()} characters will be shared.`:`Excluded from the Workroom.`})]},e)),(0,L.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-border bg-background p-2 text-[11px]`,children:[(0,L.jsx)(`input`,{className:`mt-0.5`,type:`checkbox`,checked:we,onChange:e=>P(e.target.checked)}),(0,L.jsx)(`span`,{children:`I reviewed the exact included text and repository identities, including any credential, path, diff, or transcript warnings.`})]})]}),(0,L.jsxs)(o,{className:`w-full`,onClick:Vt,disabled:!C||!we||!F||z.length<12||b!==null,children:[b===`start`?(0,L.jsx)(h,{}):(0,L.jsx)(le,{}),` Start private Workroom`]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,L.jsx)(De,{size:15}),` Join a Workroom`]}),(0,L.jsx)(A,{children:`Paste the invitation and enter the separately shared password. The host must approve this device.`})]}),(0,L.jsxs)(k,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Invitation`}),(0,L.jsx)(w,{className:`min-h-24 font-mono text-xs`,value:Xe,onChange:e=>Ze(e.target.value),placeholder:`${oe}//workroom/join?...`})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Password`}),(0,L.jsx)(r,{type:`password`,value:Qe,onChange:e=>$e(e.target.value)})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Your display name`}),(0,L.jsx)(r,{value:et,onChange:e=>tt(e.target.value)})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Local workspace mapping`}),(0,L.jsxs)(g,{value:x,onValueChange:e=>typeof e==`string`&&ge(e),children:[(0,L.jsx)(D,{children:(0,L.jsx)(m,{children:e.find(e=>e.branchName===x)?.branchName||`Select your checkout (recommended)`})}),(0,L.jsx)(y,{children:e.map(e=>(0,L.jsx)(v,{value:e.branchName,children:e.branchName},e.id))})]}),(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Used for local agent proposals and handoff snapshots; code remains in this checkout.`})]}),(0,L.jsxs)(o,{className:`w-full`,onClick:Wt,disabled:!Xe||!Qe||b!==null,children:[b===`join`?(0,L.jsx)(h,{}):(0,L.jsx)(Pe,{}),` Request to join`]})]})]}),(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Ne,{size:15}),` Import an encrypted room`]}),(0,L.jsx)(A,{children:`Creates a new room identity, certificate, password, and membership set.`})]}),(0,L.jsxs)(k,{className:`space-y-3`,children:[(0,L.jsx)(r,{type:`file`,accept:`.json,${re},${u}`,onChange:e=>{let n=e.target.files?.[0];if(n){if(n.size>157286400){t(`Workroom export files are limited to 150 MiB.`,`error`);return}n.text().then(e=>Et(JSON.parse(e))).catch(()=>t(`Invalid Workroom export file.`,`error`))}}}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Export passphrase`}),(0,L.jsx)(r,{type:`password`,value:G,onChange:e=>wt(e.target.value)})]}),(0,L.jsxs)(o,{variant:`outline`,className:`w-full`,onClick:rn,disabled:!Tt||!F||z.length<12||b!==null,children:[b===`import`?(0,L.jsx)(h,{}):(0,L.jsx)(Ne,{}),` Import and host`]})]})]})]})]})]});if(X||n.mode===`guest`&&n.status===`rejected`)return(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,L.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-primary/10 text-primary`,children:X?(0,L.jsx)(S,{className:`animate-spin`}):(0,L.jsx)(Fe,{})}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:X?`Waiting for host approval`:`Join request rejected`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:X?`Your device credential is ready, but no room context is available until the host accepts you.`:`Ask the host for a new one-use invitation if this was unexpected.`})]}),(0,L.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[X&&(0,L.jsxs)(o,{onClick:Gt,disabled:b!==null,children:[b===`poll`?(0,L.jsx)(h,{}):(0,L.jsx)(S,{}),` Check approval`]}),(0,L.jsx)(o,{variant:`outline`,onClick:Kt,children:`Cancel`})]})]});if(n.mode===`guest`&&n.status===`accepted`&&!J){let e=n.connection===`revoked`;return(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,L.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-amber-500/10 text-amber-700`,children:e?(0,L.jsx)(Fe,{}):(0,L.jsx)(Ae,{})}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold`,children:e?`Workroom access was revoked`:`Workroom connection is unavailable`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e?`Leave this local connection, then ask the host for a new one-use invitation if you should rejoin.`:`The host or VPN may be offline. You can retry without losing the local connection, or leave immediately.`})]}),(0,L.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[!e&&(0,L.jsxs)(o,{onClick:()=>Z(!0),disabled:b!==null,children:[(0,L.jsx)(S,{}),` Retry connection`]}),(0,L.jsxs)(o,{variant:`outline`,onClick:Kt,disabled:b!==null,children:[b===`stop`?(0,L.jsx)(h,{}):(0,L.jsx)(se,{}),` Leave local connection`]})]})]})}return J?(0,L.jsxs)(`div`,{className:`mx-auto max-w-[1500px] animate-fade-in space-y-4`,children:[K!==`stream`&&(0,L.jsxs)(`header`,{className:`flex flex-col gap-3 border-b border-border pb-4 sm:flex-row sm:items-center`,children:[(0,L.jsxs)(o,{ref:Ft,variant:`ghost`,onClick:()=>q(`stream`),children:[(0,L.jsx)(he,{}),` Back to Handoff Stream`]}),(0,L.jsxs)(`div`,{className:`min-w-0 sm:border-l sm:border-border sm:pl-4`,children:[(0,L.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:J.name}),(0,L.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:He[K]})]})]}),B&&(0,L.jsxs)(xe,{variant:`success`,children:[(0,L.jsx)(Ee,{}),(0,L.jsx)(be,{children:`One-use invitation ready`}),(0,L.jsxs)(ye,{children:[(0,L.jsx)(`span`,{className:`break-all font-mono text-[10px]`,children:B}),(0,L.jsxs)(`span`,{children:[`Expires `,new Date(Ge).toLocaleString(),`. Share the password separately.`]})]}),(0,L.jsxs)(o,{size:`sm`,variant:`outline`,onClick:()=>void fe(B),children:[(0,L.jsx)(Ce,{}),` Copy`]})]}),(0,L.jsxs)(ne,{value:K,onValueChange:e=>q(e),children:[(0,L.jsxs)(te,{className:`hidden`,children:[(0,L.jsx)(c,{value:`stream`,children:`Handoff Stream`}),Object.keys(He).map(e=>(0,L.jsx)(c,{value:e,children:He[e]},e))]}),(0,L.jsx)(l,{value:`stream`,className:`mt-0`,children:(0,L.jsx)(Ve,{snapshot:J,roomUrl:n.url,isHost:Y,me:Lt,busy:b,message:Dt,hasUnsavedHandoffDraft:U.handoff,headingRef:Pt,onCreateInvite:qt,onRefresh:()=>Z(!0),onStopOrLeave:Kt,onOpenTool:q,onMessageChange:Ot,onPostUpdate:tn})}),(0,L.jsxs)(l,{value:`overview`,className:`space-y-5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,L.jsx)(M,{children:(0,L.jsxs)(j,{children:[(0,L.jsx)(A,{children:`Members`}),(0,L.jsx)(O,{className:`text-2xl`,children:J.participants.filter(e=>!e.revokedAt).length})]})}),(0,L.jsx)(M,{children:(0,L.jsxs)(j,{children:[(0,L.jsx)(A,{children:`Shared resources`}),(0,L.jsx)(O,{className:`text-2xl`,children:J.resources.filter(e=>!e.quarantinedAt).length})]})}),(0,L.jsx)(M,{children:(0,L.jsxs)(j,{children:[(0,L.jsx)(A,{children:`Repository identities`}),(0,L.jsx)(O,{className:`text-2xl`,children:J.bundle.repos.length})]})})]}),(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:J.bundle.feature.goal}),(0,L.jsxs)(A,{children:[J.bundle.project.name,` · portable feature `,J.bundle.feature.id]})]}),(0,L.jsx)(k,{className:`space-y-2`,children:J.bundle.repos.map(e=>(0,L.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,L.jsx)(i,{variant:`secondary`,children:e.defaultBranch})]}),(0,L.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:e.remoteUrl}),e.handoff&&(0,L.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.handoff.branch,` @ `,e.handoff.commit.slice(0,12),` · `,e.handoff.dirty?`dirty`:`clean`,` · ↑`,e.handoff.ahead,` ↓`,e.handoff.behind]})]},e.id))})]}),(0,L.jsxs)(xe,{variant:`info`,children:[(0,L.jsx)(ee,{}),(0,L.jsx)(be,{children:`Never collected automatically`}),(0,L.jsxs)(ye,{children:[d,` does not add source archives, filenames, diffs, local paths, credentials, terminals, editor state, or AI transcripts. A developer can still include sensitive text in a reviewed shared document.`]})]})]}),(0,L.jsx)(l,{value:`context`,className:`space-y-4`,children:Object.keys(V).map(e=>(0,L.jsxs)(M,{children:[(0,L.jsx)(j,{children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(O,{children:V[e]}),(0,L.jsxs)(A,{children:[`Revision `,J.documents[e].revision,` · updated `,new Date(J.documents[e].updatedAt).toLocaleString()]})]}),U[e]&&(0,L.jsx)(i,{variant:`warning`,children:`Local draft`})]})}),(0,L.jsxs)(k,{className:`space-y-3`,children:[(0,L.jsx)(w,{className:`min-h-64 font-mono text-xs`,value:it[e],disabled:b!==null,onChange:t=>{at(n=>({...n,[e]:t.target.value})),ot(t=>({...t,[e]:!0}))}}),(0,L.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[e===`handoff`&&(0,L.jsxs)(o,{variant:`outline`,onClick:()=>Q(`handoff`,()=>f(`/api/workrooms/handoff`,{method:`POST`,body:JSON.stringify({workspaceId:n.localWorkspaceId})}).then(()=>void 0),`Git metadata handoff published.`),disabled:!n.localWorkspaceId||b!==null,children:[(0,L.jsx)(S,{}),` Publish Git snapshot`]}),(0,L.jsxs)(o,{onClick:()=>Jt(e),disabled:!U[e]||b!==null,children:[b===`doc-${e}`?(0,L.jsx)(h,{}):(0,L.jsx)(Ne,{}),` Share revision`]})]})]})]},e))}),(0,L.jsxs)(l,{value:`resources`,className:`space-y-4`,children:[Rt&&(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Publish a local resource`}),(0,L.jsx)(A,{children:`Published versions are immutable. Connected developers are notified and choose whether to download and apply them.`})]}),(0,L.jsxs)(k,{className:`flex flex-col gap-3 sm:flex-row sm:items-end`,children:[(0,L.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,L.jsx)(N,{children:`Resource`}),(0,L.jsxs)(g,{value:ct,onValueChange:e=>typeof e==`string`&<(e),children:[(0,L.jsx)(D,{children:(0,L.jsx)(m,{children:W.find(e=>`${e.kind}:${e.id}`===ct)?.name||`Select resource`})}),(0,L.jsx)(y,{children:W.map(e=>(0,L.jsxs)(v,{value:`${e.kind}:${e.id}`,children:[e.kind,` · `,e.name]},`${e.kind}:${e.id}`))})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Version`}),(0,L.jsx)(r,{className:`w-32 font-mono`,value:ut,onChange:e=>dt(e.target.value)})]}),(0,L.jsxs)(o,{onClick:Yt,disabled:!ct||b!==null,children:[(0,L.jsx)(Ne,{}),` Publish`]})]})]}),(0,L.jsx)(`div`,{className:`grid gap-3`,children:J.resources.length===0?(0,L.jsx)(M,{className:`p-8 text-center text-sm text-muted-foreground`,children:`No resources have been published.`}):J.resources.map(e=>{let t=ft[e.digest],n=[e.compatibility?.platforms?.length?`platforms: ${e.compatibility.platforms.join(`, `)}`:void 0,e.compatibility?.contextspace?`${d} ${e.compatibility.contextspace}`:e.compatibility?.nexusflow?`${ie} ${e.compatibility.nexusflow}`:void 0].filter(Boolean).join(` · `);return(0,L.jsx)(M,{className:e.quarantinedAt?`opacity-60`:``,children:(0,L.jsxs)(k,{className:`space-y-3 p-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(i,{variant:`secondary`,children:e.kind}),(0,L.jsxs)(`span`,{className:`text-sm font-semibold`,children:[e.id,`@`,e.version]}),e.quarantinedAt&&(0,L.jsx)(i,{variant:`error`,children:`Quarantined`})]}),(0,L.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`SHA-256 `,e.digest]}),n&&(0,L.jsxs)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[`Compatibility · `,n]})]}),e.quarantinedAt?Y&&(0,L.jsxs)(o,{variant:`destructive-outline`,onClick:()=>$t(e.digest),disabled:b!==null,children:[b===`purge-${e.digest}`?(0,L.jsx)(h,{}):(0,L.jsx)(s,{}),` Purge permanently`]}):(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t?(0,L.jsxs)(o,{onClick:()=>Zt(e.digest),disabled:b!==null,children:[(0,L.jsx)(je,{}),` Approve exact digest & apply`]}):(0,L.jsxs)(o,{variant:`outline`,onClick:()=>Xt(e.digest),disabled:b!==null,children:[(0,L.jsx)(Te,{}),` Download for review`]}),Y&&(0,L.jsx)(o,{variant:`ghost`,onClick:()=>Qt(e.digest),disabled:b!==null,children:`Quarantine`})]})]}),t&&(0,L.jsxs)(`div`,{className:`space-y-3 rounded border border-border bg-muted/30 p-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`text-xs font-semibold`,children:[`Exact package review · `,t.action===`update`?`updates an existing local resource`:`creates a new local resource`]}),(0,L.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[`Applying installs the incoming definition shown below and is bound to SHA-256 `,e.digest,`.`]})]}),t.existingDefinition&&(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold`,children:`Current local definition`}),(0,L.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:t.existingDefinition})]}),(0,L.jsxs)(`details`,{open:!0,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold`,children:`Incoming applied definition`}),(0,L.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:t.incomingDefinition})]}),(0,L.jsx)(`div`,{className:`space-y-2`,children:t.files.map(e=>(0,L.jsxs)(`details`,{children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer font-mono text-[10px]`,children:[e.path,` · `,e.bytes.toLocaleString(),` bytes · `,e.encoding,e.executable?` · executable`:``]}),(0,L.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:e.content})]},e.path))})]})]})},e.digest)})})]}),(0,L.jsxs)(l,{value:`workflow`,className:`space-y-4`,children:[Y&&!J.workflowProgress&&(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Start shared workflow tracking`}),(0,L.jsx)(A,{children:`Convert a local strategy into explicit ordered steps. Agents may propose completion; a developer confirms it.`})]}),(0,L.jsxs)(k,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[1fr_130px]`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Workflow`}),(0,L.jsxs)(g,{value:mt,onValueChange:e=>typeof e==`string`&&ht(e),children:[(0,L.jsx)(D,{children:(0,L.jsx)(m,{children:W.find(e=>e.id===mt&&e.kind===`workflow`)?.name||`Select workflow`})}),(0,L.jsx)(y,{children:W.filter(e=>e.kind===`workflow`).map(e=>(0,L.jsx)(v,{value:e.id,children:e.name},e.id))})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Version`}),(0,L.jsx)(r,{value:gt,onChange:e=>_t(e.target.value)})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Ordered steps, one per line`}),(0,L.jsx)(w,{className:`min-h-32`,value:vt,onChange:e=>yt(e.target.value)})]}),(0,L.jsxs)(o,{onClick:en,disabled:!mt||b!==null,children:[(0,L.jsx)(le,{}),` Start workflow`]})]})]}),!Y&&!J.workflowProgress&&(0,L.jsx)(M,{children:(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`No shared workflow yet`}),(0,L.jsx)(A,{children:`The host can select a reviewed workflow for this room. You can continue sharing context and handoff updates while you wait.`})]})}),J.workflowProgress&&(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsxs)(O,{children:[J.workflowProgress.package.name,`@`,J.workflowProgress.workflow.version]}),(0,L.jsxs)(A,{children:[`Exact strategy retained at digest `,J.workflowProgress.workflow.digest.slice(0,12),`… · shared progress revision `,J.workflowProgress.revision]})]}),(0,L.jsx)(k,{className:`space-y-3`,children:J.workflowProgress.steps.map((e,t)=>{let n=J.workflowProgress.package.steps.find(t=>t.id===e.stepId);return(0,L.jsx)(`div`,{className:`rounded-lg border border-border p-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`grid size-5 place-items-center rounded-full bg-muted text-[10px]`,children:t+1}),(0,L.jsx)(`span`,{className:`text-xs font-semibold`,children:n?.title||e.stepId}),(0,L.jsx)(i,{variant:e.status===`completed`?`success`:e.status===`completion_proposed`?`warning`:`secondary`,children:e.status.replace(`_`,` `)})]}),(0,L.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.stepId}),e.evidence&&(0,L.jsxs)(`p`,{className:`mt-2 whitespace-pre-wrap text-xs text-muted-foreground`,children:[`Evidence: `,e.evidence]}),n?.requiresEvidence&&(0,L.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,L.jsx)(N,{htmlFor:`workflow-evidence-${e.stepId}`,children:`Completion evidence`}),(0,L.jsx)(w,{id:`workflow-evidence-${e.stepId}`,className:`min-h-20 text-xs`,value:bt[e.stepId]??e.evidence??``,onChange:t=>xt(n=>({...n,[e.stepId]:t.target.value})),placeholder:`Tests, review result, or other verification`})]})]}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.status===`completion_proposed`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(o,{size:`sm`,onClick:()=>$(e,`completed`),children:[(0,L.jsx)(ue,{}),` Confirm`]}),(0,L.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>$(e,`in_progress`),children:`Reject`})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>$(e,`in_progress`),children:`In progress`}),(0,L.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>$(e,`completed`),children:`Complete`}),(0,L.jsx)(o,{size:`sm`,variant:`ghost`,onClick:()=>$(e,`pending`),children:`Reopen`})]})})]})},e.stepId)})})]})]}),(0,L.jsxs)(l,{value:`members`,className:`space-y-4`,children:[Y&&J.pendingJoins.map(e=>(0,L.jsxs)(xe,{variant:`warning`,children:[(0,L.jsx)(Pe,{}),(0,L.jsxs)(be,{children:[e.displayName,` wants to join`]}),(0,L.jsxs)(ye,{children:[`Requested `,new Date(e.requestedAt).toLocaleString()]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(o,{size:`sm`,onClick:()=>Q(`accept-${e.id}`,()=>f(`/api/workrooms/members/${e.id}/decision`,{method:`POST`,body:JSON.stringify({accept:!0})}).then(()=>void 0)),children:`Accept`}),(0,L.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>Q(`reject-${e.id}`,()=>f(`/api/workrooms/members/${e.id}/decision`,{method:`POST`,body:JSON.stringify({accept:!1})}).then(()=>void 0)),children:`Reject`})]})]},e.id)),(0,L.jsx)(M,{children:(0,L.jsx)(k,{className:`divide-y divide-border p-0`,children:J.participants.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-2 rounded-full ${e.revokedAt?`bg-muted-foreground`:`bg-emerald-500`}`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold`,children:e.displayName}),(0,L.jsx)(i,{variant:e.role===`host`?`info`:`secondary`,children:e.role}),e.id===Lt?.id&&(0,L.jsx)(i,{variant:`success`,children:`You`})]}),(0,L.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[`Joined `,new Date(e.joinedAt).toLocaleString()]})]}),Y&&e.role!==`host`&&!e.revokedAt&&(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(o,{size:`sm`,variant:`outline`,onClick:()=>Q(`role-${e.id}`,()=>f(`/api/workrooms/members/${e.id}/role`,{method:`PUT`,body:JSON.stringify({role:e.role===`publisher`?`member`:`publisher`})}).then(()=>void 0)),children:e.role===`publisher`?`Make member`:`Make publisher`}),(0,L.jsxs)(o,{size:`sm`,variant:`destructive-outline`,onClick:()=>Q(`revoke-${e.id}`,()=>f(`/api/workrooms/members/${e.id}`,{method:`DELETE`}).then(()=>void 0)),children:[(0,L.jsx)(Fe,{}),` Revoke`]})]})]},e.id))})})]}),(0,L.jsx)(l,{value:`activity`,children:(0,L.jsx)(M,{children:(0,L.jsx)(k,{className:`divide-y divide-border p-0`,children:[...J.activity].reverse().map(e=>(0,L.jsxs)(`div`,{className:`flex gap-3 p-4`,children:[(0,L.jsx)(me,{className:`mt-0.5 shrink-0 text-muted-foreground`,size:14}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm`,children:e.summary}),(0,L.jsxs)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[`#`,e.sequence,` · `,e.type,` · `,new Date(e.createdAt).toLocaleString()]})]})]},e.sequence))})})}),(0,L.jsxs)(l,{value:`security`,className:`space-y-4`,children:[(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`TLS identity`}),(0,L.jsx)(A,{children:`Guests pin this SHA-256 fingerprint from the invitation. Mismatches stop before any password or device credential is sent.`})]}),(0,L.jsx)(k,{children:(0,L.jsx)(`code`,{className:`break-all text-xs`,children:J.certificateFingerprint})})]}),Y&&(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Rotate room password`}),(0,L.jsx)(A,{children:`Outstanding invitations are revoked. Existing device credentials are revoked by default.`})]}),(0,L.jsxs)(k,{className:`space-y-3`,children:[(0,L.jsx)(r,{type:`password`,value:St,onChange:e=>Ct(e.target.value)}),(0,L.jsxs)(o,{variant:`destructive-outline`,onClick:()=>Q(`rotate`,()=>f(`/api/workrooms/password/rotate`,{method:`POST`,body:JSON.stringify({password:St,revokeDevices:!0})}).then(()=>void 0),`Password rotated and guest devices revoked.`),children:[(0,L.jsx)(Ee,{}),` Rotate and revoke`]})]})]}),(0,L.jsxs)(M,{children:[(0,L.jsxs)(j,{children:[(0,L.jsx)(O,{children:`Encrypted portable export`}),(0,L.jsx)(A,{children:`Excludes certificates, password hashes, invitations, and device credentials.`})]}),(0,L.jsxs)(k,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(N,{children:`Export passphrase`}),(0,L.jsx)(r,{type:`password`,value:G,onChange:e=>wt(e.target.value)})]}),(0,L.jsxs)(o,{variant:`outline`,onClick:nn,disabled:G.length<12||b!==null,children:[(0,L.jsx)(Te,{}),` Export room`]})]})]})]})]})]})]}):(0,L.jsx)(`div`,{className:`flex justify-center py-24`,children:(0,L.jsx)(h,{className:`size-6`})})}export{Ye as WorkroomsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DE3RlOCf.js";import{m as t}from"./button-BrcP8Wxx.js";import{$ as n,J as r,Q as i,X as a,Y as o,Z as s,et as c,tt as l}from"./index-4lBf5Ph9.js";function u(e){return a(`alert-dialog`,e)}var d=e(),f=u,p=s;function m({className:e,...n}){return(0,d.jsx)(l,{forceRender:!0,className:t(`fixed inset-0 z-50 bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,e),"data-slot":`alert-dialog-backdrop`,...n})}function h({className:e,...n}){return(0,d.jsx)(o,{className:t(`fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center p-4`,e),"data-slot":`alert-dialog-viewport`,...n})}function g({className:e,bottomStickOnMobile:n=!0,...r}){return(0,d.jsxs)(p,{children:[(0,d.jsx)(m,{}),(0,d.jsx)(h,{className:t(n&&`max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12`),children:(0,d.jsx)(i,{className:t(`-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-full min-h-0 w-full min-w-0 max-w-lg scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover not-dark:bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,n&&`max-sm:max-w-none max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 max-sm:before:hidden max-sm:before:rounded-none`,e),"data-slot":`alert-dialog-popup`,...r})})]})}function _({className:e,...n}){return(0,d.jsx)(`div`,{className:t(`flex flex-col gap-2 p-6 text-center max-sm:pb-4 sm:text-left`,e),"data-slot":`alert-dialog-header`,...n})}function v({className:e,variant:n=`default`,...r}){return(0,d.jsx)(`div`,{className:t(`flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]`,n==="default"&&`border-t bg-muted/72 py-4`,n===`bare`&&`pb-6`,e),"data-slot":`alert-dialog-footer`,...r})}function y({className:e,...n}){return(0,d.jsx)(r,{className:t(`font-heading font-semibold text-xl leading-none`,e),"data-slot":`alert-dialog-title`,...n})}function b({className:e,...r}){return(0,d.jsx)(n,{className:t(`text-muted-foreground text-sm`,e),"data-slot":`alert-dialog-description`,...r})}function x(e){return(0,d.jsx)(c,{"data-slot":`alert-dialog-close`,...e})}export{_ as a,v as i,x as n,g as o,b as r,y as s,f as t};
|