@wrongstack/webui 0.281.3 → 0.282.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/assets/{AnalyticsDashboard-Cb08RPms.js → AnalyticsDashboard-TCNC-sVb.js} +1 -1
- package/dist/assets/AutoPhaseView-BMUiT6aI.js +1 -0
- package/dist/assets/{CodeEditor-CSTcX3Za.js → CodeEditor-C0si742k.js} +1 -1
- package/dist/assets/{DebugDashboard-D6-znhBO.js → DebugDashboard-BHpiEOcf.js} +1 -1
- package/dist/assets/{DesignGalleryView-yKa55dpM.js → DesignGalleryView-BfZTw48N.js} +1 -1
- package/dist/assets/KanbanView-C4T4y0b7.js +1 -0
- package/dist/assets/{MailboxDetailView-DbX_cNcu.js → MailboxDetailView-DJtjP0NF.js} +1 -1
- package/dist/assets/OfficeMapPanel-CgvHvGQm.js +4 -0
- package/dist/assets/{ProcessMonitor-DvPiHdzj.js → ProcessMonitor-D53zn0h4.js} +1 -1
- package/dist/assets/{QueuePanel-BVvnJXHh.js → QueuePanel-DTO68vaB.js} +1 -1
- package/dist/assets/{RefreshDebugView-pmMPOier.js → RefreshDebugView-BXq2P3wo.js} +1 -1
- package/dist/assets/{SddBoardView-CGJbbRrh.js → SddBoardView-C8X4MiTy.js} +2 -2
- package/dist/assets/{SddFlowGraph-WW0qCx0t.js → SddFlowGraph-CtMpzU4S.js} +1 -1
- package/dist/assets/SddWizard-t5Cly3CG.js +1 -0
- package/dist/assets/{SessionsDashboard-VwXvmSxS.js → SessionsDashboard-Dqsrp5CK.js} +1 -1
- package/dist/assets/SkillDetailView-Dq-fTqSp.js +2 -0
- package/dist/assets/{SpecsView-BRdxB6rh.js → SpecsView-Cwd6PiYr.js} +1 -1
- package/dist/assets/{TerminalPanel-CAcbPNO_.js → TerminalPanel-Bzyhr2aC.js} +1 -1
- package/dist/assets/{chat-store-YPRVJGbn.js → chat-store-CIMOL6-x.js} +1 -1
- package/dist/assets/{i18n-BJCOtLro.js → i18n-CNo6A2vu.js} +1 -1
- package/dist/assets/index-CWj2bI87.js +145 -0
- package/dist/assets/index-D7_FeyCA.css +1 -0
- package/dist/assets/{session-store-Do0MGnXu.js → session-store-DN1UYDL9.js} +1 -1
- package/dist/assets/ui-store-BdOsq6T-.js +1 -0
- package/dist/assets/utils-DBns3uMk.js +1 -0
- package/dist/assets/{vendor-Bhf0nZ3B.js → vendor-Ch4m_qLI.js} +25 -25
- package/dist/assets/{ws-client-D9IQ9580.js → ws-client-BAV7SLzK.js} +1 -1
- package/dist/assets/{xyflow-Bp8EMwkC.js → xyflow-D5_yey7w.js} +3 -3
- package/dist/index.html +9 -9
- package/dist/index.js +6253 -5282
- package/dist/index.js.map +1 -1
- package/dist/providers.json +2 -2
- package/dist/server/entry.js +642 -21
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +642 -21
- package/dist/server/index.js.map +1 -1
- package/dist/types.d.ts +18 -3
- package/package.json +6 -6
- package/dist/assets/AutoPhaseView--Ec4Mom8.js +0 -1
- package/dist/assets/OfficeMapPanel-BMxzEv_S.js +0 -4
- package/dist/assets/SddWizard-Cen90k6M.js +0 -1
- package/dist/assets/SkillDetailView-CjUeZv6V.js +0 -2
- package/dist/assets/index-BSuiEQIC.js +0 -145
- package/dist/assets/index-CMiinLaB.css +0 -1
- package/dist/assets/ui-store-D3gGpJWY.js +0 -1
- package/dist/assets/utils-sFCTikqz.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split(`::`),r=(t??``).trim();return{title:r,description:n.join(`::`).trim()||r}}).filter(e=>e.title);t.length&&(ne(e.id,t),z(!1),H(``))},se=(0,U.useMemo)(()=>new Map(t.map(e=>[e.shortId,e])),[t]),X=(0,U.useMemo)(()=>t.filter(t=>t.deps.includes(e.shortId)),[t,e.shortId]),Z=(0,U.useMemo)(()=>n.filter(t=>t.taskShortId===e.shortId),[n,e.shortId]),ce=e.startedAt&&!e.completedAt?V(i-e.startedAt):e.startedAt&&e.completedAt?V(e.completedAt-e.startedAt):null;return(0,W.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:l,className:`text-muted-foreground hover:text-foreground`,title:w(`activity:sddTask.backTitle`),children:(0,W.jsx)(a,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,W.jsxs)(`span`,{className:C(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,T.ring,T.text),children:[(0,W.jsx)(E,{className:C(`h-3 w-3`,D&&`animate-spin`)}),T.label]})]}),(0,W.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-3 overflow-auto p-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),e.agentName&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-muted p-2`,children:[(0,W.jsx)(`span`,{className:C(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,D?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:P(e.agentName)}),(0,W.jsxs)(`div`,{className:`leading-tight`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,W.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:w(D?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,W.jsx)(Y,{label:w(`activity:sddTask.metaPriority`),children:(0,W.jsx)(`span`,{className:C(`font-medium uppercase`,F(e.priority).text),children:e.priority})}),(0,W.jsx)(Y,{label:w(`activity:sddTask.metaType`),children:e.type}),ce&&(0,W.jsx)(Y,{label:e.completedAt?w(`activity:sddTask.metaDuration`):w(`activity:sddTask.metaElapsed`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(te,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,W.jsx)(Y,{label:w(`activity:sddTask.metaRetries`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 text-red-400`,children:[(0,W.jsx)(o,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,W.jsx)(Y,{label:w(`activity:sddTask.metaWorktree`),full:!0,children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,W.jsx)(r,{className:`h-3 w-3 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[w(`activity:sddTask.workerModel`),!e.model&&c&&(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,w(`activity:sddTask.runDefault`,{model:c})]})]}),(0,W.jsx)(re,{value:e.model,provider:e.provider,candidates:s,placeholder:c?w(`activity:sddTask.runDefaultPlaceholderModel`,{model:c}):w(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>m(e.id,t,n),onReset:e.model?()=>m(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,W.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map((e,t)=>(0,W.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[w(`activity:sddTask.verificationCmd`),(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,w(`activity:sddTask.gatesCompletion`)]})]}),ie?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`?(g(e.id,K.trim()||void 0),G(!1)):t.key===`Escape`&&(q(e.verificationCommand??``),G(!1))},placeholder:w(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>{g(e.id,K.trim()||void 0),G(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:w(`common:action.save`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{q(e.verificationCommand??``),G(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.cancel`)})]})]}):e.verificationCommand?(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.verificationCommand}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.edit`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>g(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.clear`)})]}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:w(`activity:sddTask.addVerify`)})]}),e.description&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:w(`activity:sddTask.description`)}),(0,W.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),Z.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:w(`activity:sddTask.timeline`)}),(0,W.jsx)(`div`,{className:`space-y-1 border-l border-border pl-2.5`,children:Z.map((e,t)=>(0,W.jsxs)(`div`,{className:`relative text-[11px] leading-snug text-foreground`,children:[(0,W.jsx)(`span`,{className:C(`absolute -left-[14px] top-1 h-1.5 w-1.5 rounded-full`,e.kind===`completed`?`bg-emerald-400`:e.kind===`failed`?`bg-red-400`:e.kind===`retrying`?`bg-orange-400`:`bg-amber-400`)}),e.text]},`${e.ts}-${t}`))})]}),e.deps.length>0&&(0,W.jsx)(oe,{title:w(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:se,onSelectTask:x}),X.length>0&&(0,W.jsx)(oe,{title:w(`activity:sddTask.blocks`),shortIds:X.map(e=>e.shortId),byShort:se,onSelectTask:x})]}),(0,W.jsxs)(`div`,{className:`border-t border-border p-2`,children:[k?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:j,onChange:e=>M(e.target.value),onKeyDown:e=>{e.key===`Enter`&&J(),e.key===`Escape`&&A(!1)},placeholder:w(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none focus:border-violet-500`}),(0,W.jsx)(`button`,{type:`button`,onClick:J,disabled:!j.trim(),className:`rounded-md bg-violet-500/20 px-2 py-1.5 text-xs font-medium text-violet-700 dark:text-violet-200 hover:bg-violet-500/30 disabled:opacity-40`,children:(0,W.jsx)(_,{className:`h-3.5 w-3.5`})}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>A(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(f,{className:`h-3.5 w-3.5`})})]}):N?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:w(N===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{N===`stop`?v(e.id):ee(e.id),I(null)},className:`inline-flex items-center gap-1 rounded-md bg-red-500/20 px-2.5 py-1.5 text-xs font-medium text-red-700 dark:text-red-200 hover:bg-red-500/30`,children:[(0,W.jsx)(_,{className:`h-3.5 w-3.5`}),` `,w(N===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>I(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(f,{className:`h-3.5 w-3.5`})})]}):(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),title:w(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-orange-500/15 py-1.5 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(o,{className:`h-3.5 w-3.5`}),` `,w(`common:action.retry`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-violet-500/15 py-1.5 text-xs font-medium text-violet-600 dark:text-violet-300 hover:bg-violet-500/25`,children:[(0,W.jsx)(y,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.reassign`)]}),D&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>I(`stop`),title:w(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/15 py-1.5 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(p,{className:`h-3.5 w-3.5`}),` `,w(`common:action.stop`)]}),!D&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>z(!0),title:w(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/15 py-1.5 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.split`)]}),O&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>I(`delete`),title:w(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/10 py-1.5 text-xs font-medium text-red-600 dark:text-red-300/90 hover:bg-red-500/20`,children:[(0,W.jsx)(h,{className:`h-3.5 w-3.5`}),` `,w(`common:action.delete`)]})]}),R&&(0,W.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:w(`activity:sddTask.splitHint`)}),(0,W.jsx)(`textarea`,{id:`sdd-split-input`,autoFocus:!0,rows:3,value:B,onChange:e=>H(e.target.value),placeholder:w(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-sky-500`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:ae,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/20 py-1.5 text-xs font-medium text-sky-700 dark:text-sky-200 hover:bg-sky-500/30`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.splitInto`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{z(!1),H(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(f,{className:`h-3.5 w-3.5`})})]})]})]})]})}function Y({label:e,children:t,full:n}){return(0,W.jsxs)(`div`,{className:C(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,W.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`text-foreground`,children:t})]})}function oe({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,W.jsxs)(`button`,{type:`button`,disabled:!t,onClick:()=>t&&r(t.id),className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-foreground hover:bg-muted disabled:opacity-50`,title:t?.title,children:[(0,W.jsx)(`span`,{className:C(`h-1.5 w-1.5 rounded-full`,L(t?.displayStatus??`pending`).dot)}),(0,W.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function se({pct:e}){let t=2*Math.PI*26,n=t-Math.max(0,Math.min(100,e))/100*t;return(0,W.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,children:[(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(215 28% 22%)`,strokeWidth:`6`}),(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#sddgrad)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:t,strokeDashoffset:n,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:`sddgrad`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#a78bfa`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#22d3ee`})]})})]}),(0,W.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}function X({onClose:e}){let{t}=b(),{client:n}=w(),r=O(e=>e.snapshot),i=O(e=>e.lifecycleResult),a=O(e=>e.destroying),c=O(e=>e.setDestroying),g=O(e=>e.setLifecycleResult),[_,te]=(0,U.useState)(()=>Date.now()),[y,x]=(0,U.useState)(null),[S,T]=(0,U.useState)(`graph`),[re,E]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n?.send?.({type:`sdd.board.get`})},[n]);let D=r&&(r.status===`running`||r.status===`paused`);(0,U.useEffect)(()=>{if(!D)return;let e=setInterval(()=>te(Date.now()),1e3);return te(Date.now()),()=>clearInterval(e)},[D]);let k=(0,U.useCallback)(e=>n?.send?.(e),[n]),M=(0,U.useRef)(null),N=(0,U.useCallback)(e=>{M.current=null,k({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[k]),F=(0,U.useCallback)(e=>{E(!1),g(null),c(!0),D?(k({type:`sdd.board.stop`,payload:{}}),M.current={revertMerged:e,deadline:Date.now()+2e4}):N(e)},[D,k,N,c,g]);(0,U.useEffect)(()=>{let e=M.current;e&&(!D||Date.now()>=e.deadline)&&N(e.revertMerged)},[D,r,N]);let L=(0,U.useCallback)(()=>{g(null),k({type:`sdd.board.cleanup_worktrees`,payload:{}})},[k,g]),z=(0,U.useCallback)(()=>{g(null),k({type:`sdd.board.rollback`,payload:{}})},[k,g]),B=(0,U.useMemo)(()=>(r?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch})),[r?.tasks]),K=(0,U.useMemo)(()=>{let e=new Map;for(let t of r?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[r?.tasks]),J=(0,U.useCallback)(e=>x(e),[]),Y=(0,U.useCallback)(e=>k({type:`sdd.board.retry`,payload:{taskId:e}}),[k]),oe=(0,U.useCallback)(()=>k({type:`sdd.board.retry_all_failed`,payload:{}}),[k]),X=(0,U.useCallback)((e,t)=>{let n=t.trim();n&&k({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[k]),Z=(0,U.useCallback)((e,t,n)=>k({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[k]),le=(0,U.useCallback)((e,t)=>k({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[k]),ue=(0,U.useCallback)(e=>k({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[k]),de=(0,U.useCallback)(e=>{k({type:`sdd.board.delete_task`,payload:{taskId:e}}),x(null)},[k]),fe=(0,U.useCallback)((e,t)=>{k({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),x(null)},[k]),pe=A(y!==null),me=(0,U.useMemo)(()=>r?.tasks.find(e=>e.id===y)??null,[r?.tasks,y]),$=r?.progress,he=r?.diagnostics?.deadlockChains??[];return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,W.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(v,{className:`h-5 w-5 text-orange-400`}),(0,W.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:r?.title??t(`activity:sddBoard.titleFallback`)}),r&&(0,W.jsx)(`span`,{className:C(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,I[r.status]??I.idle),children:r.status}),r?.defaultModel&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,title:t(`activity:sddBoard.defaultModelTitle`),children:[(0,W.jsx)(ee,{className:`h-3 w-3 text-violet-400`}),r.defaultModel]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,W.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>T(e),className:C(`rounded px-2 py-0.5 capitalize transition`,S===e?`bg-violet-500/25 text-violet-700 dark:text-violet-200`:`text-muted-foreground hover:text-foreground`),children:t(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),D&&($?.failed??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:oe,title:t(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(o,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.retryFailed`,{count:$?.failed??0})]}),D&&(0,W.jsxs)(W.Fragment,{children:[r?.status===`paused`?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-sky-500/15 px-2.5 py-1 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(l,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.resume`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(ne,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.pause`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(p,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.stop`)]})]}),r&&!D&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:L,title:t(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-slate-500/15 px-2.5 py-1 text-xs font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-500/25`,children:[(0,W.jsx)(d,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.cleanWorktrees`)]}),(r.mergedCommits?.length??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:z,title:t(`activity:sddBoard.rollbackTitle`,{count:r.mergedCommits?.length??0,base:r.baseBranch??t(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.rollback`,{count:r.mergedCommits?.length??0})]})]}),r&&(a?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300`,children:[(0,W.jsx)(o,{className:`h-3.5 w-3.5 animate-spin`}),` `,t(D?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>E(!0),title:t(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-red-600/90 px-2.5 py-1 text-xs font-medium text-white hover:bg-red-700`,children:[(0,W.jsx)(h,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.destroy`)]})),(0,W.jsx)(j,{variant:`ghost`,size:`icon`,onClick:e,children:(0,W.jsx)(f,{className:`h-4 w-4`})})]})]}),r&&$&&(0,W.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,W.jsx)(se,{pct:$.percentComplete}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,W.jsx)(Q,{label:t(`activity:sddBoard.statDone`),value:`${$.completed}/${$.total}`,color:`text-emerald-600 dark:text-emerald-300`}),$.inProgress>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statRunning`),value:$.inProgress,color:`text-amber-600 dark:text-amber-300`}),$.failed>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statFailed`),value:$.failed,color:`text-red-600 dark:text-red-300`}),(0,W.jsx)(Q,{label:t(`activity:sddBoard.statWave`),value:r.wave+1,color:`text-violet-600 dark:text-violet-300`}),D&&r.startedAt>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statElapsed`),value:V(_-r.startedAt),color:`text-foreground`})]}),(0,W.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:K.length===0?(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:sddBoard.noActiveWorkers`)}):K.map((e,t)=>(0,W.jsxs)(`span`,{title:`${e.name} → ${e.task}`,className:`flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2`,children:[(0,W.jsx)(`span`,{className:C(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,R[t%R.length]),children:P(e.name)}),(0,W.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),i&&(0,W.jsx)(ce,{result:i,onDismiss:()=>g(null)}),he.length>0&&(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rose-500/30 bg-rose-500/5 px-4 py-2 text-xs text-rose-600 dark:text-rose-300`,children:[(0,W.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`font-semibold`,children:t(`activity:sddBoard.deadlock`)}),he.map(e=>(0,W.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:r?S===`graph`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{tasks:B,columns:r.columns,onTaskClick:J}),(0,W.jsx)(`div`,{className:`pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/40 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur`,children:t(`activity:sddBoard.clickTaskHint`)})]}):(0,W.jsx)(q,{tasks:r.tasks,selectedId:y,onTaskClick:J}):(0,W.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,W.jsx)(u,{className:`h-10 w-10 text-violet-500/40`}),(0,W.jsx)(`p`,{className:`text-foreground`,children:t(`activity:sddBoard.noRunTitle`)}),(0,W.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:t(`activity:sddBoard.noRunBody`)})]})}),r&&(0,W.jsx)(`aside`,{className:`w-80 shrink-0 border-l border-border bg-card`,children:me?(0,W.jsx)(ae,{task:me,allTasks:r.tasks,feed:r.feed??[],now:_,modelCandidates:pe,defaultModel:r.defaultModel,onClose:()=>x(null),onRetry:Y,onReassign:X,onSetModel:Z,onSetVerification:le,onCancel:ue,onDelete:de,onSplit:fe,onSelectTask:x},me.id):(0,W.jsx)(ie,{feed:r.feed??[],now:_})})]}),(0,W.jsx)(G,{open:re,onOpenChange:E,snapshot:r,busy:a,onConfirm:F})]})}function Z(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=x.t(`activity:sddBoard.${t}`);if(!e.ok)return x.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??x.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(x.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(x.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(x.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):x.t(`activity:sddBoard.lcNothing`);return e.reason?x.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):x.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ce({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,W.jsxs)(`div`,{className:C(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-amber-500/30 bg-amber-500/5 text-amber-700 dark:text-amber-300`:`border-emerald-500/30 bg-emerald-500/5 text-emerald-700 dark:text-emerald-300`),children:[n?(0,W.jsx)(c,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,W.jsx)(g,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1`,children:Z(e)}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,W.jsx)(f,{className:`h-3.5 w-3.5`})})]})}function Q({label:e,value:t,color:n}){return(0,W.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,W.jsx)(`span`,{className:C(`font-semibold tabular-nums`,n),children:t}),(0,W.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}export{X as SddBoardView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$r as r,It as i,Mr as a,Or as o,Pr as s,Ut as c,Vr as l,X as u,Z as d,Zn as f,_r as p,bt as m,ci as h,ct as g,di as _,dt as v,jn as y,ot as ee,qt as te,rr as ne,sr as b,ti as x,xt as S}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as C}from"./utils-DBns3uMk.js";import{C as w,_ as T,a as re,g as E,h as D,k as O,m as k,o as A,p as j,v as M,y as N}from"./index-CWj2bI87.js";import{a as P,c as F,i as I,l as L,n as R,o as z,r as B,s as V,t as H}from"./SddFlowGraph-CtMpzU4S.js";var U=e(t(),1),W=n();function ie({feed:e,now:t}){let{t:n}=h();return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,W.jsx)(a,{className:`h-3.5 w-3.5 text-orange-500 dark:text-orange-400`}),n(`activity:sdd.activityHeading`)]}),(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-1 overflow-auto p-2`,children:e.length===0?(0,W.jsx)(`p`,{className:`px-1 pt-4 text-center text-[11px] text-muted-foreground`,children:n(`activity:sdd.feedEmpty`)}):e.map((e,n)=>{let r=B[e.kind]??B.started,i=r.icon;return(0,W.jsxs)(`div`,{className:C(`sdd-rise flex items-start gap-2 rounded-md px-2 py-1.5 text-[11px]`,n===0?`bg-muted`:`hover:bg-muted`),children:[(0,W.jsx)(i,{className:C(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.color)}),(0,W.jsx)(`span`,{className:`flex-1 leading-snug text-foreground`,children:e.text}),(0,W.jsx)(`span`,{className:`shrink-0 tabular-nums text-[10px] text-muted-foreground`,children:z(e.ts,t)})]},`${e.ts}-${n}`)})})]})}function G({open:e,onOpenChange:t,snapshot:n,busy:r,onConfirm:i}){let{t:a}=h(),o=n?.mergedCommits?.length??0,c=n?.baseBranch,[u,d]=(0,U.useState)(!1);(0,U.useEffect)(()=>{e&&d(!1)},[e]);let f=n?.status===`running`||n?.status===`paused`,p=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.worktreeBranch&&e.add(t.worktreeBranch);return e.size},[n?.tasks]),m=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.add(t.agentName);return e.size},[n?.tasks]);return(0,W.jsx)(k,{open:e,onOpenChange:e=>!r&&t(e),children:(0,W.jsxs)(D,{className:`sm:max-w-lg border-red-500/50`,children:[(0,W.jsxs)(M,{children:[(0,W.jsxs)(N,{className:`flex items-center gap-2`,children:[(0,W.jsx)(v,{className:`h-5 w-5 text-red-500`}),a(`activity:sdd.destroyTitle`)]}),(0,W.jsx)(E,{children:a(`activity:sdd.destroyDesc`)})]}),(0,W.jsxs)(`ul`,{className:`space-y-1.5 py-1 text-sm`,children:[f&&(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:m>0?a(`activity:sdd.stopRunAgents`,{count:m}):a(`activity:sdd.stopRun`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:p>0?a(`activity:sdd.removeWorktreesCount`,{count:p}):a(`activity:sdd.removeWorktreesAll`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:a(`activity:sdd.deleteArtifacts`)})]})]}),o>0&&(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 p-2.5 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked),className:`mt-0.5 h-4 w-4 accent-amber-500`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`font-medium`,children:a(`activity:sdd.revertMerged`,{count:o})}),` `,`on `,(0,W.jsx)(`code`,{className:`text-xs`,children:c??a(`activity:sdd.baseBranchFallback`)}),(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(`activity:sdd.revertHint`)})]})]}),(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(s,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500`}),a(o>0&&!u?`activity:sdd.noteLeaveMerged`:`activity:sdd.noteAbandon`)]}),(0,W.jsxs)(T,{className:`gap-2 sm:gap-2`,children:[(0,W.jsx)(j,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>t(!1),children:a(`common:action.cancel`)}),(0,W.jsx)(j,{size:`sm`,disabled:r,onClick:()=>i(u),className:`bg-red-600 text-white hover:bg-red-700`,children:r?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(l,{className:`mr-1 h-3.5 w-3.5 animate-spin`}),` `,a(`activity:sdd.destroying`)]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(v,{className:`mr-1 h-3.5 w-3.5`}),` `,a(`activity:sdd.destroyAll`)]})})]})]})})}var K=[{key:`pending`,labelKey:`kanbanBacklog`,accent:`border-slate-600/40`,head:`text-muted-foreground`},{key:`queued`,labelKey:`kanbanReady`,accent:`border-cyan-500/40`,head:`text-cyan-600 dark:text-cyan-300`},{key:`in_progress`,labelKey:`kanbanRunning`,accent:`border-amber-400/50`,head:`text-amber-600 dark:text-amber-300`},{key:`review`,labelKey:`kanbanReview`,accent:`border-sky-500/40`,head:`text-sky-600 dark:text-sky-300`},{key:`failed`,labelKey:`kanbanFailed`,accent:`border-red-500/40`,head:`text-red-600 dark:text-red-300`},{key:`completed`,labelKey:`kanbanDone`,accent:`border-emerald-500/40`,head:`text-emerald-600 dark:text-emerald-300`}];function q({tasks:e,selectedId:t,onTaskClick:n}){let{t:r}=h(),i=(0,U.useMemo)(()=>{let t=new Map;for(let e of K)t.set(e.key,[]);for(let n of e){let e=n.displayStatus===`blocked`?`pending`:n.displayStatus===`cancelled`?`failed`:n.displayStatus;(t.get(e)??t.get(`pending`))?.push(n)}return t},[e]);return(0,W.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 gap-3 overflow-x-auto p-4`,children:K.map(e=>{let a=i.get(e.key)??[];return(0,W.jsxs)(`div`,{className:`flex min-h-0 w-64 shrink-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:C(`mb-2 flex items-center gap-2 border-b-2 pb-1.5`,e.accent),children:[(0,W.jsx)(`span`,{className:C(`text-xs font-bold uppercase tracking-wide`,e.head),children:r(`activity:sdd.${e.labelKey}`)}),(0,W.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.length})]}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:[a.map(e=>(0,W.jsx)(J,{task:e,selected:e.id===t,onClick:()=>n(e.id)},e.id)),a.length===0&&(0,W.jsx)(`div`,{className:`rounded-md border border-dashed border-border py-6 text-center text-[10px] text-muted-foreground`,children:r(`activity:sdd.kanbanEmpty`)})]})]},e.key)})})}function J({task:e,selected:t,onClick:n}){let r=e.displayStatus===`in_progress`;return(0,W.jsxs)(`button`,{type:`button`,onClick:n,className:C(`sdd-node-enter w-full rounded-lg border bg-card p-2 text-left transition hover:brightness-125`,t?`border-violet-400/70 ring-1 ring-violet-400/40`:`border-border`,r&&`sdd-node-running`,e.displayStatus===`completed`&&`sdd-node-complete`,e.displayStatus===`failed`&&`sdd-node-failed`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,W.jsx)(l,{className:`h-3 w-3 animate-spin text-amber-400`}),e.displayStatus===`completed`&&(0,W.jsx)(p,{className:`h-3 w-3 text-emerald-400`}),e.displayStatus===`failed`&&(0,W.jsx)(d,{className:`h-3 w-3 text-red-400`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.shortId}),(0,W.jsx)(`span`,{className:C(`ml-auto rounded px-1.5 text-[9px] font-bold uppercase`,F(e.priority).chip),children:e.priority})]}),(0,W.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:e.title}),(e.agentName||e.worktreeBranch||e.retries)&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[e.agentName&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:C(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,r?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:P(e.agentName)}),(0,W.jsx)(`span`,{className:`max-w-[80px] truncate text-[10px] text-muted-foreground`,children:e.agentName})]}),e.retries?(0,W.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-red-400`,children:[(0,W.jsx)(i,{className:`h-2.5 w-2.5`}),e.retries]}):null,e.worktreeBranch&&(0,W.jsx)(y,{className:`ml-auto h-2.5 w-2.5 text-muted-foreground`})]})]})}function ae({task:e,allTasks:t,feed:n,now:r,modelCandidates:a,defaultModel:s,onClose:c,onRetry:l,onReassign:u,onSetModel:f,onSetVerification:g,onCancel:_,onDelete:te,onSplit:ne,onSelectTask:x}){let{t:w}=h(),T=L(e.displayStatus),E=T.icon,D=e.displayStatus===`in_progress`,O=e.displayStatus===`pending`||e.displayStatus===`blocked`||e.displayStatus===`queued`,[k,A]=(0,U.useState)(!1),[j,M]=(0,U.useState)(``),[N,I]=(0,U.useState)(null),[R,z]=(0,U.useState)(!1),[B,H]=(0,U.useState)(``),[ie,G]=(0,U.useState)(!1),[K,q]=(0,U.useState)(e.verificationCommand??``),J=()=>{j.trim()&&(u(e.id,j.trim()),A(!1),M(``))},ae=()=>{let t=B.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split(`::`),r=(t??``).trim();return{title:r,description:n.join(`::`).trim()||r}}).filter(e=>e.title);t.length&&(ne(e.id,t),z(!1),H(``))},se=(0,U.useMemo)(()=>new Map(t.map(e=>[e.shortId,e])),[t]),X=(0,U.useMemo)(()=>t.filter(t=>t.deps.includes(e.shortId)),[t,e.shortId]),Z=(0,U.useMemo)(()=>n.filter(t=>t.taskShortId===e.shortId),[n,e.shortId]),ce=e.startedAt&&!e.completedAt?V(r-e.startedAt):e.startedAt&&e.completedAt?V(e.completedAt-e.startedAt):null;return(0,W.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:c,className:`text-muted-foreground hover:text-foreground`,title:w(`activity:sddTask.backTitle`),children:(0,W.jsx)(o,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,W.jsxs)(`span`,{className:C(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,T.ring,T.text),children:[(0,W.jsx)(E,{className:C(`h-3 w-3`,D&&`animate-spin`)}),T.label]})]}),(0,W.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-3 overflow-auto p-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),e.agentName&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-muted p-2`,children:[(0,W.jsx)(`span`,{className:C(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,D?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:P(e.agentName)}),(0,W.jsxs)(`div`,{className:`leading-tight`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,W.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:w(D?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,W.jsx)(Y,{label:w(`activity:sddTask.metaPriority`),children:(0,W.jsx)(`span`,{className:C(`font-medium uppercase`,F(e.priority).text),children:e.priority})}),(0,W.jsx)(Y,{label:w(`activity:sddTask.metaType`),children:e.type}),ce&&(0,W.jsx)(Y,{label:e.completedAt?w(`activity:sddTask.metaDuration`):w(`activity:sddTask.metaElapsed`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(b,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,W.jsx)(Y,{label:w(`activity:sddTask.metaRetries`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 text-red-400`,children:[(0,W.jsx)(i,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,W.jsx)(Y,{label:w(`activity:sddTask.metaWorktree`),full:!0,children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,W.jsx)(y,{className:`h-3 w-3 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[w(`activity:sddTask.workerModel`),!e.model&&s&&(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,w(`activity:sddTask.runDefault`,{model:s})]})]}),(0,W.jsx)(re,{value:e.model,provider:e.provider,candidates:a,placeholder:s?w(`activity:sddTask.runDefaultPlaceholderModel`,{model:s}):w(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>f(e.id,t,n),onReset:e.model?()=>f(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,W.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map((e,t)=>(0,W.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[w(`activity:sddTask.verificationCmd`),(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,w(`activity:sddTask.gatesCompletion`)]})]}),ie?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`?(g(e.id,K.trim()||void 0),G(!1)):t.key===`Escape`&&(q(e.verificationCommand??``),G(!1))},placeholder:w(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>{g(e.id,K.trim()||void 0),G(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:w(`common:action.save`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{q(e.verificationCommand??``),G(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.cancel`)})]})]}):e.verificationCommand?(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.verificationCommand}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.edit`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>g(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:w(`common:action.clear`)})]}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:w(`activity:sddTask.addVerify`)})]}),e.description&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:w(`activity:sddTask.description`)}),(0,W.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),Z.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:w(`activity:sddTask.timeline`)}),(0,W.jsx)(`div`,{className:`space-y-1 border-l border-border pl-2.5`,children:Z.map((e,t)=>(0,W.jsxs)(`div`,{className:`relative text-[11px] leading-snug text-foreground`,children:[(0,W.jsx)(`span`,{className:C(`absolute -left-[14px] top-1 h-1.5 w-1.5 rounded-full`,e.kind===`completed`?`bg-emerald-400`:e.kind===`failed`?`bg-red-400`:e.kind===`retrying`?`bg-orange-400`:`bg-amber-400`)}),e.text]},`${e.ts}-${t}`))})]}),e.deps.length>0&&(0,W.jsx)(oe,{title:w(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:se,onSelectTask:x}),X.length>0&&(0,W.jsx)(oe,{title:w(`activity:sddTask.blocks`),shortIds:X.map(e=>e.shortId),byShort:se,onSelectTask:x})]}),(0,W.jsxs)(`div`,{className:`border-t border-border p-2`,children:[k?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:j,onChange:e=>M(e.target.value),onKeyDown:e=>{e.key===`Enter`&&J(),e.key===`Escape`&&A(!1)},placeholder:w(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none focus:border-violet-500`}),(0,W.jsx)(`button`,{type:`button`,onClick:J,disabled:!j.trim(),className:`rounded-md bg-violet-500/20 px-2 py-1.5 text-xs font-medium text-violet-700 dark:text-violet-200 hover:bg-violet-500/30 disabled:opacity-40`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>A(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]}):N?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:w(N===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{N===`stop`?_(e.id):te(e.id),I(null)},className:`inline-flex items-center gap-1 rounded-md bg-red-500/20 px-2.5 py-1.5 text-xs font-medium text-red-700 dark:text-red-200 hover:bg-red-500/30`,children:[(0,W.jsx)(p,{className:`h-3.5 w-3.5`}),` `,w(N===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>I(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]}):(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),title:w(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-orange-500/15 py-1.5 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5`}),` `,w(`common:action.retry`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-violet-500/15 py-1.5 text-xs font-medium text-violet-600 dark:text-violet-300 hover:bg-violet-500/25`,children:[(0,W.jsx)(ee,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.reassign`)]}),D&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>I(`stop`),title:w(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/15 py-1.5 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5`}),` `,w(`common:action.stop`)]}),!D&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>z(!0),title:w(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/15 py-1.5 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.split`)]}),O&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>I(`delete`),title:w(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/10 py-1.5 text-xs font-medium text-red-600 dark:text-red-300/90 hover:bg-red-500/20`,children:[(0,W.jsx)(v,{className:`h-3.5 w-3.5`}),` `,w(`common:action.delete`)]})]}),R&&(0,W.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:w(`activity:sddTask.splitHint`)}),(0,W.jsx)(`textarea`,{id:`sdd-split-input`,autoFocus:!0,rows:3,value:B,onChange:e=>H(e.target.value),placeholder:w(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-sky-500`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:ae,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/20 py-1.5 text-xs font-medium text-sky-700 dark:text-sky-200 hover:bg-sky-500/30`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,w(`activity:sddTask.splitInto`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{z(!1),H(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]})]})]})]})}function Y({label:e,children:t,full:n}){return(0,W.jsxs)(`div`,{className:C(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,W.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`text-foreground`,children:t})]})}function oe({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,W.jsxs)(`button`,{type:`button`,disabled:!t,onClick:()=>t&&r(t.id),className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-foreground hover:bg-muted disabled:opacity-50`,title:t?.title,children:[(0,W.jsx)(`span`,{className:C(`h-1.5 w-1.5 rounded-full`,L(t?.displayStatus??`pending`).dot)}),(0,W.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function se({pct:e}){let t=2*Math.PI*26,n=t-Math.max(0,Math.min(100,e))/100*t;return(0,W.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,children:[(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(215 28% 22%)`,strokeWidth:`6`}),(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#sddgrad)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:t,strokeDashoffset:n,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:`sddgrad`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#a78bfa`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#22d3ee`})]})})]}),(0,W.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}function X({onClose:e}){let{t}=h(),{client:n}=w(),r=O(e=>e.snapshot),o=O(e=>e.lifecycleResult),l=O(e=>e.destroying),p=O(e=>e.setDestroying),_=O(e=>e.setLifecycleResult),[y,ee]=(0,U.useState)(()=>Date.now()),[b,x]=(0,U.useState)(null),[S,T]=(0,U.useState)(`graph`),[re,E]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n?.send?.({type:`sdd.board.get`})},[n]);let D=r&&(r.status===`running`||r.status===`paused`);(0,U.useEffect)(()=>{if(!D)return;let e=setInterval(()=>ee(Date.now()),1e3);return ee(Date.now()),()=>clearInterval(e)},[D]);let k=(0,U.useCallback)(e=>n?.send?.(e),[n]),M=(0,U.useRef)(null),N=(0,U.useCallback)(e=>{M.current=null,k({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[k]),F=(0,U.useCallback)(e=>{E(!1),_(null),p(!0),D?(k({type:`sdd.board.stop`,payload:{}}),M.current={revertMerged:e,deadline:Date.now()+2e4}):N(e)},[D,k,N,p,_]);(0,U.useEffect)(()=>{let e=M.current;e&&(!D||Date.now()>=e.deadline)&&N(e.revertMerged)},[D,r,N]);let L=(0,U.useCallback)(()=>{_(null),k({type:`sdd.board.cleanup_worktrees`,payload:{}})},[k,_]),z=(0,U.useCallback)(()=>{_(null),k({type:`sdd.board.rollback`,payload:{}})},[k,_]),B=(0,U.useMemo)(()=>(r?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch})),[r?.tasks]),K=(0,U.useMemo)(()=>{let e=new Map;for(let t of r?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[r?.tasks]),J=(0,U.useCallback)(e=>x(e),[]),Y=(0,U.useCallback)(e=>k({type:`sdd.board.retry`,payload:{taskId:e}}),[k]),oe=(0,U.useCallback)(()=>k({type:`sdd.board.retry_all_failed`,payload:{}}),[k]),X=(0,U.useCallback)((e,t)=>{let n=t.trim();n&&k({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[k]),Z=(0,U.useCallback)((e,t,n)=>k({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[k]),le=(0,U.useCallback)((e,t)=>k({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[k]),ue=(0,U.useCallback)(e=>k({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[k]),de=(0,U.useCallback)(e=>{k({type:`sdd.board.delete_task`,payload:{taskId:e}}),x(null)},[k]),fe=(0,U.useCallback)((e,t)=>{k({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),x(null)},[k]),pe=A(b!==null),me=(0,U.useMemo)(()=>r?.tasks.find(e=>e.id===b)??null,[r?.tasks,b]),$=r?.progress,he=r?.diagnostics?.deadlockChains??[];return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,W.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(a,{className:`h-5 w-5 text-orange-400`}),(0,W.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:r?.title??t(`activity:sddBoard.titleFallback`)}),r&&(0,W.jsx)(`span`,{className:C(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,I[r.status]??I.idle),children:r.status}),r?.defaultModel&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,title:t(`activity:sddBoard.defaultModelTitle`),children:[(0,W.jsx)(ne,{className:`h-3 w-3 text-violet-400`}),r.defaultModel]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,W.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>T(e),className:C(`rounded px-2 py-0.5 capitalize transition`,S===e?`bg-violet-500/25 text-violet-700 dark:text-violet-200`:`text-muted-foreground hover:text-foreground`),children:t(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),D&&($?.failed??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:oe,title:t(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.retryFailed`,{count:$?.failed??0})]}),D&&(0,W.jsxs)(W.Fragment,{children:[r?.status===`paused`?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-sky-500/15 px-2.5 py-1 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(c,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.resume`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(te,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.pause`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>k({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(m,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.stop`)]})]}),r&&!D&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:L,title:t(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-slate-500/15 px-2.5 py-1 text-xs font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-500/25`,children:[(0,W.jsx)(f,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.cleanWorktrees`)]}),(r.mergedCommits?.length??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:z,title:t(`activity:sddBoard.rollbackTitle`,{count:r.mergedCommits?.length??0,base:r.baseBranch??t(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.rollback`,{count:r.mergedCommits?.length??0})]})]}),r&&(l?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300`,children:[(0,W.jsx)(i,{className:`h-3.5 w-3.5 animate-spin`}),` `,t(D?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>E(!0),title:t(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-red-600/90 px-2.5 py-1 text-xs font-medium text-white hover:bg-red-700`,children:[(0,W.jsx)(v,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.destroy`)]})),(0,W.jsx)(j,{variant:`ghost`,size:`icon`,onClick:e,children:(0,W.jsx)(d,{className:`h-4 w-4`})})]})]}),r&&$&&(0,W.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,W.jsx)(se,{pct:$.percentComplete}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,W.jsx)(Q,{label:t(`activity:sddBoard.statDone`),value:`${$.completed}/${$.total}`,color:`text-emerald-600 dark:text-emerald-300`}),$.inProgress>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statRunning`),value:$.inProgress,color:`text-amber-600 dark:text-amber-300`}),$.failed>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statFailed`),value:$.failed,color:`text-red-600 dark:text-red-300`}),(0,W.jsx)(Q,{label:t(`activity:sddBoard.statWave`),value:r.wave+1,color:`text-violet-600 dark:text-violet-300`}),D&&r.startedAt>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statElapsed`),value:V(y-r.startedAt),color:`text-foreground`})]}),(0,W.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:K.length===0?(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:sddBoard.noActiveWorkers`)}):K.map((e,t)=>(0,W.jsxs)(`span`,{title:`${e.name} → ${e.task}`,className:`flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2`,children:[(0,W.jsx)(`span`,{className:C(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,R[t%R.length]),children:P(e.name)}),(0,W.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),o&&(0,W.jsx)(ce,{result:o,onDismiss:()=>_(null)}),he.length>0&&(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rose-500/30 bg-rose-500/5 px-4 py-2 text-xs text-rose-600 dark:text-rose-300`,children:[(0,W.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`font-semibold`,children:t(`activity:sddBoard.deadlock`)}),he.map(e=>(0,W.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:r?S===`graph`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{tasks:B,columns:r.columns,onTaskClick:J}),(0,W.jsx)(`div`,{className:`pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/40 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur`,children:t(`activity:sddBoard.clickTaskHint`)})]}):(0,W.jsx)(q,{tasks:r.tasks,selectedId:b,onTaskClick:J}):(0,W.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,W.jsx)(u,{className:`h-10 w-10 text-violet-500/40`}),(0,W.jsx)(`p`,{className:`text-foreground`,children:t(`activity:sddBoard.noRunTitle`)}),(0,W.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:t(`activity:sddBoard.noRunBody`)})]})}),r&&(0,W.jsx)(`aside`,{className:`w-80 shrink-0 border-l border-border bg-card`,children:me?(0,W.jsx)(ae,{task:me,allTasks:r.tasks,feed:r.feed??[],now:y,modelCandidates:pe,defaultModel:r.defaultModel,onClose:()=>x(null),onRetry:Y,onReassign:X,onSetModel:Z,onSetVerification:le,onCancel:ue,onDelete:de,onSplit:fe,onSelectTask:x},me.id):(0,W.jsx)(ie,{feed:r.feed??[],now:y})})]}),(0,W.jsx)(G,{open:re,onOpenChange:E,snapshot:r,busy:l,onConfirm:F})]})}function Z(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=_.t(`activity:sddBoard.${t}`);if(!e.ok)return _.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??_.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(_.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(_.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(_.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):_.t(`activity:sddBoard.lcNothing`);return e.reason?_.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):_.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ce({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,W.jsxs)(`div`,{className:C(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-amber-500/30 bg-amber-500/5 text-amber-700 dark:text-amber-300`:`border-emerald-500/30 bg-emerald-500/5 text-emerald-700 dark:text-emerald-300`),children:[n?(0,W.jsx)(r,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,W.jsx)(x,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1`,children:Z(e)}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,W.jsx)(d,{className:`h-3.5 w-3.5`})})]})}function Q({label:e,value:t,color:n}){return(0,W.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,W.jsx)(`span`,{className:C(`font-semibold tabular-nums`,n),children:t}),(0,W.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}export{X as SddBoardView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Cr as r,Et as i,Hr as a,It as o,Pr as s,Ut as c,Vr as l,Z as u,_r as d,ci as f,jn as p,kn as m,ur as h,xt as g,yr as _}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as v}from"./utils-DBns3uMk.js";import{a as y,c as b,m as x,n as S,o as C,p as w,r as T,t as E,u as D}from"./xyflow-D5_yey7w.js";var O=e(t(),1),k={pending:{label:`Pending`,icon:h,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-600/50 dark:bg-slate-700/20`,dot:`bg-slate-500`,hex:`#64748b`},queued:{label:`Ready`,icon:h,text:`text-cyan-600 dark:text-cyan-300`,ring:`border-cyan-500/50 bg-cyan-500/10`,dot:`bg-cyan-400`,hex:`#22d3ee`},in_progress:{label:`Running`,icon:l,spin:!0,text:`text-amber-600 dark:text-amber-300`,ring:`border-amber-400/60 bg-amber-500/10`,dot:`bg-amber-400`,hex:`#fbbf24`},blocked:{label:`Blocked`,icon:h,text:`text-fuchsia-600 dark:text-fuchsia-300`,ring:`border-fuchsia-500/50 bg-fuchsia-500/10`,dot:`bg-fuchsia-400`,hex:`#e879f9`},review:{label:`Review`,icon:h,text:`text-sky-600 dark:text-sky-300`,ring:`border-sky-500/50 bg-sky-500/10`,dot:`bg-sky-400`,hex:`#38bdf8`},failed:{label:`Failed`,icon:u,text:`text-red-600 dark:text-red-300`,ring:`border-red-500/60 bg-red-500/10`,dot:`bg-red-400`,hex:`#f87171`},completed:{label:`Done`,icon:d,text:`text-emerald-600 dark:text-emerald-300`,ring:`border-emerald-500/55 bg-emerald-500/10`,dot:`bg-emerald-400`,hex:`#34d399`},cancelled:{label:`Cancelled`,icon:r,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-500/50 dark:bg-slate-600/20`,dot:`bg-slate-500`,hex:`#94a3b8`}};function A(e){return k[e]??k.pending}var j={critical:{text:`text-red-600 dark:text-red-400`,chip:`bg-red-500/20 text-red-600 dark:text-red-300`},high:{text:`text-amber-600 dark:text-amber-400`,chip:`bg-amber-500/20 text-amber-600 dark:text-amber-300`},medium:{text:`text-cyan-600 dark:text-cyan-400`,chip:`bg-cyan-500/15 text-cyan-600 dark:text-cyan-300`},low:{text:`text-slate-500 dark:text-slate-400`,chip:`bg-slate-400/20 text-slate-600 dark:bg-slate-600/30 dark:text-slate-400`}};function M(e){return j[e]??j.medium}var N={running:`border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-300`,paused:`border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-300`,stopped:`border-zinc-500/40 bg-zinc-500/10 text-zinc-600 dark:text-zinc-300`,completed:`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`,failed:`border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-300`,deadlocked:`border-rose-500/40 bg-rose-500/10 text-rose-600 dark:text-rose-300`,idle:`border-border bg-muted text-muted-foreground`},P=[`bg-amber-500`,`bg-sky-500`,`bg-violet-500`,`bg-emerald-500`,`bg-rose-500`,`bg-cyan-500`,`bg-fuchsia-500`],F={started:{icon:c,color:`text-amber-400`},completed:{icon:d,color:`text-emerald-400`},failed:{icon:u,color:`text-red-400`},retrying:{icon:o,color:`text-orange-400`},wave:{icon:a,color:`text-violet-400`},deadlock:{icon:s,color:`text-rose-400`},verification_failed:{icon:i,color:`text-red-400`},conflict:{icon:m,color:`text-amber-400`},split:{icon:g,color:`text-sky-400`},supervisor:{icon:_,color:`text-fuchsia-400`}};function I(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function L(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function R(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var z=n(),B=300,V=128,H=240,U={pending:{ring:`border-slate-600/50`,chip:`bg-slate-700/40 text-slate-400`,dot:`bg-slate-500`},queued:{ring:`border-cyan-500/50`,chip:`bg-cyan-500/15 text-cyan-300`,dot:`bg-cyan-400`},in_progress:{ring:`border-amber-400/70`,chip:`bg-amber-500/20 text-amber-300`,dot:`bg-amber-400`},blocked:{ring:`border-fuchsia-500/50`,chip:`bg-fuchsia-500/15 text-fuchsia-300`,dot:`bg-fuchsia-400`},review:{ring:`border-sky-500/50`,chip:`bg-sky-500/15 text-sky-300`,dot:`bg-sky-400`},failed:{ring:`border-red-500/60`,chip:`bg-red-500/15 text-red-300`,dot:`bg-red-400`},completed:{ring:`border-emerald-500/55`,chip:`bg-emerald-500/15 text-emerald-300`,dot:`bg-emerald-400`},cancelled:{ring:`border-slate-500/50`,chip:`bg-slate-600/25 text-slate-400`,dot:`bg-slate-500`}};function W({data:e}){let t=e.task,{t:n}=f(),r=U[t.displayStatus],i=t.displayStatus===`in_progress`,a=t.displayStatus===`completed`?d:t.displayStatus===`failed`?u:i?l:h;return(0,z.jsxs)(`div`,{className:v(`sdd-node-enter group relative rounded-lg border bg-[#0e1117]/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,r.ring,i&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`cursor-pointer hover:brightness-125`),style:{width:H,animationDelay:`${Math.min(e.index*45,600)}ms`},onClick:()=>e.onTaskClick?.(t.id),children:[(0,z.jsx)(y,{type:`target`,position:x.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsx)(y,{type:`source`,position:x.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(a,{className:v(`h-3.5 w-3.5`,i&&`animate-spin`,r.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,z.jsx)(`span`,{className:`font-mono text-[10px] text-slate-500`,children:t.shortId}),(0,z.jsx)(`span`,{className:v(`font-mono text-[10px] font-bold uppercase`,M(t.priority).text),children:t.priority[0]}),(0,z.jsx)(`span`,{className:v(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,r.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-slate-200`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`span`,{className:v(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,i?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:I(t.agentName)}),(0,z.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-slate-300`,children:t.agentName})]}),t.retries?(0,z.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-red-400`,children:[(0,z.jsx)(o,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-slate-500`,title:t.worktreeBranch,children:[(0,z.jsx)(p,{className:`h-2.5 w-2.5`}),(0,z.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function G({data:e}){return(0,z.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase tracking-wider text-slate-500`,children:e.label})}var K={task:W,colLabel:G};function q(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*B,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*B,y:o*V},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:A(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function J({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=w(),{nodes:i,edges:a}=(0,O.useMemo)(()=>q(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,z.jsxs)(D,{nodes:i,edges:a,nodeTypes:K,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,z.jsx)(E,{variant:S.Dots,gap:22,size:1,color:`#1e293b`}),(0,z.jsx)(T,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,z.jsx)(C,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`rgba(2,6,23,0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?A(t).hex:`#334155`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-white/10`})]})}function Y({tasks:e,columns:t,onTaskClick:n}){return(0,z.jsx)(b,{children:(0,z.jsx)(J,{tasks:e,columns:t,onTaskClick:n})})}export{I as a,M as c,N as i,A as l,P as n,R as o,F as r,L as s,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Ir as r,Lt as i,St as ee,Vr as a,Z as te,Zt as ne,_r as o,br as s,ci as re,gr as c,it as l,jt as ie,mt as u,pr as d}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as f}from"./utils-DBns3uMk.js";import{C as p,O as m,a as ae,i as h,o as oe,p as g,w as _}from"./index-CWj2bI87.js";import{c as v,t as se}from"./SddFlowGraph-CtMpzU4S.js";var y=e(t(),1),b=n(),x={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},S=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function C({onClose:e}){let{t}=re(),{client:n}=p(),s=m(e=>e.snapshot),l=m(e=>e.agentText),C=m(e=>e.error),E=m(e=>e.startedRunId),D=m(e=>e.setStartedRunId),[O,ce]=(0,y.useState)(``),[k,A]=(0,y.useState)(``),[j,M]=(0,y.useState)(!1),[N,le]=(0,y.useState)(!0),[P,ue]=(0,y.useState)(!0),[F,I]=(0,y.useState)(!1),[L,R]=(0,y.useState)(void 0),[z,B]=(0,y.useState)(void 0),[V,H]=(0,y.useState)([]),[U,de]=(0,y.useState)(4),[W,fe]=(0,y.useState)(!0),G=oe(F),K=(0,y.useCallback)(e=>n?.send?.(e),[n]),q=(0,y.useRef)(null);(0,y.useEffect)(()=>{K({type:`sdd.spec.get`})},[K]),(0,y.useEffect)(()=>{q.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[s?.answers.length??0,l]),(0,y.useEffect)(()=>{E&&(_(`sddboard`),D(null))},[E,D]);let J=s?.busy??!1,Y=s?.phase??`idle`,X=!!s;(0,y.useEffect)(()=>{X&&M(!1)},[X]);let pe=s?.answers[s.answers.length-1]?.question??``,me=!!s&&(s.taskCount>0||!!s.graphId||Y===`task_review`||Y===`executing`),Z=()=>{let e=O.trim();!e||J||j||(M(!0),K({type:`sdd.spec.start`,payload:{goal:e}}))},Q=()=>{let e=k.trim();!e||J||(K({type:`sdd.spec.message`,payload:{text:e}}),A(``))},he=()=>!J&&K({type:`sdd.spec.approve`,payload:{}}),ge=()=>{K({type:`sdd.run.start`,payload:{parallelSlots:U,worktrees:W,...L?{model:L,provider:z}:{},...V.length?{fallbackModels:V}:{}}}),I(!1)},$=(0,y.useMemo)(()=>(s?.board?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch,retries:e.retries})),[s?.board]),_e=$.length>0;return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,b.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(r,{className:`h-5 w-5 text-violet-400`}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h1`,{className:`text-lg font-semibold`,children:s?.title||t(`activity:sddWizard.titleFallback`)}),X&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`activity:sddWizard.${x[Y]??`phaseStart`}`),Y===`questioning`&&` · ${t(`activity:sddWizard.questionsSuffix`,{cur:s?.questionCount??0,max:s?.maxQuestions??0})}`,s&&s.taskCount>0?` · ${t(`activity:sddWizard.tasksSuffix`,{count:s.taskCount})}`:``]})]}),J&&(0,b.jsx)(a,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[me&&(0,b.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:t(`activity:sddWizard.runCfgTitle`),className:f(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,L||V.length?`border-violet-500/40 bg-violet-500/10 text-violet-600 dark:text-violet-300`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,b.jsx)(ee,{className:`h-3.5 w-3.5`}),L||t(`activity:sddWizard.modelsLabel`)]}),(0,b.jsxs)(`button`,{type:`button`,onClick:ge,className:`inline-flex items-center gap-1 rounded-md bg-emerald-500/15 px-2.5 py-1 text-xs font-medium text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-400`,children:[(0,b.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddWizard.startRun`)]}),F&&(0,b.jsxs)(`div`,{className:`sdd-rise absolute right-0 top-9 z-50 w-72 rounded-lg border border-border bg-popover p-3 shadow-xl`,children:[(0,b.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.defaultWorkerModel`)}),(0,b.jsx)(ae,{value:L,provider:z,candidates:G,placeholder:t(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:t(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{R(e),B(t)},onReset:L?()=>{R(void 0),B(void 0)}:void 0}),(0,b.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.fallbackChain`)}),(0,b.jsx)(h,{value:V,candidates:G,onChange:H}),(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:t(`activity:sddWizard.appliesToAll`)}),(0,b.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,b.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.parallelAgents`)}),(0,b.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:U,onChange:e=>{let t=Number.parseInt(e.target.value,10);de(Number.isFinite(t)?Math.min(16,Math.max(1,t)):1)},className:`w-16 rounded-md border border-border bg-background px-2 py-1 text-right text-xs outline-none focus:border-violet-500`})]}),(0,b.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,b.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.isolateWorktrees`)}),(0,b.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>fe(e.target.checked),className:`h-3.5 w-3.5 accent-violet-500`})]}),(0,b.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(W?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)})]})]}),(0,b.jsx)(g,{variant:`ghost`,size:`icon`,onClick:e,children:(0,b.jsx)(te,{className:`h-4 w-4`})})]})]}),X&&(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:S.map((e,n)=>{let r=e===Y,i=S.indexOf(Y)>n;return(0,b.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,b.jsxs)(`span`,{className:f(`rounded-full px-2 py-0.5`,r?`bg-violet-500/20 text-violet-600 dark:text-violet-300`:i?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`),children:[i&&(0,b.jsx)(o,{className:`mr-0.5 inline h-3 w-3`}),t(`activity:sddWizard.${x[e]}`)]}),n<S.length-1&&(0,b.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`})]},e)})}),(0,b.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[C&&(0,b.jsx)(`div`,{className:`mb-3 rounded-md border border-red-500/40 bg-red-500/5 p-2 text-xs text-red-300`,children:C}),X?(0,b.jsxs)(`div`,{className:`space-y-4`,children:[_e&&(0,b.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-violet-500/20 bg-[#0a0d14]`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>le(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-white/5 px-3 py-1.5 text-[11px] font-medium text-violet-300 hover:bg-white/5`,children:[N?(0,b.jsx)(c,{className:`h-3.5 w-3.5`}):(0,b.jsx)(d,{className:`h-3.5 w-3.5`}),(0,b.jsx)(ne,{className:`h-3.5 w-3.5`}),t(`activity:sddWizard.taskGraphSummary`,{count:s?.taskCount??0}),(0,b.jsx)(`span`,{className:`ml-auto text-slate-500`,children:t(N?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),N&&(0,b.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,b.jsx)(se,{tasks:$,columns:s?.board?.columns??[]})})]}),(0,b.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[s?.goal&&(0,b.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,b.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,b.jsx)(u,{className:`h-3 w-3`}),` `,t(`activity:sddWizard.goalLabel`)]}),(0,b.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:s.goal})]}),s?.answers.length||l&&Y===`questioning`||J?(0,b.jsxs)(`div`,{className:`space-y-2.5`,children:[s?.answers.map((e,t)=>(0,b.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,b.jsx)(T,{role:`assistant`,text:e.question}),(0,b.jsx)(T,{role:`user`,text:e.answer})]},t)),l&&Y===`questioning`&&l!==pe&&(0,b.jsx)(T,{role:`assistant`,text:l}),J&&(0,b.jsx)(T,{role:`assistant`,text:``,thinking:!0})]}):null,s?.spec&&(0,b.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,b.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,b.jsx)(r,{className:`h-3.5 w-3.5 text-violet-400`}),s.spec.title]}),(0,b.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:s.spec.overview}),(0,b.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:s.spec.requirements.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,b.jsx)(`span`,{className:f(`shrink-0 font-mono uppercase`,v(e.priority).text),children:e.priority[0]}),(0,b.jsx)(`span`,{children:e.description})]},t))})]}),l&&(Y===`implementation`||Y===`task_review`)&&(0,b.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>ue(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-2 text-sm font-semibold hover:bg-muted/40`,children:[P?(0,b.jsx)(c,{className:`h-3.5 w-3.5`}):(0,b.jsx)(d,{className:`h-3.5 w-3.5`}),(0,b.jsx)(r,{className:`h-3.5 w-3.5 text-violet-400`}),` `,t(`activity:sddWizard.implementationPlan`)]}),P&&(0,b.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,b.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:w(l)})})]}),l&&Y!==`questioning`&&Y!==`implementation`&&Y!==`task_review`&&!s?.spec&&(0,b.jsx)(T,{role:`assistant`,text:l}),(Y===`spec_review`||Y===`implementation`||Y===`task_review`)&&(0,b.jsxs)(g,{variant:`secondary`,onClick:he,disabled:J,children:[(0,b.jsx)(o,{className:`mr-1.5 h-4 w-4`}),t(Y===`spec_review`?`activity:sddWizard.approveSpec`:Y===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,b.jsx)(`div`,{ref:q})]})]}):(0,b.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,b.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:t(`activity:sddWizard.goalPrompt`)}),(0,b.jsx)(`textarea`,{id:`sdd-goal`,value:O,onChange:e=>ce(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},rows:4,placeholder:t(`activity:sddWizard.goalPlaceholder`),className:`w-full resize-none rounded-md border border-border bg-card px-3 py-2 text-sm outline-none focus:border-violet-500`}),(0,b.jsx)(g,{className:`mt-3`,onClick:Z,disabled:!O.trim()||j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,t(`activity:sddWizard.startingInterview`)]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r,{className:`mr-1.5 h-4 w-4`}),` `,t(`activity:sddWizard.startInterview`)]})}),(0,b.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`activity:sddWizard.introBody`)})]})]}),X&&Y!==`executing`&&Y!==`done`&&(0,b.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,b.jsx)(`textarea`,{value:k,onChange:e=>A(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q())},rows:1,placeholder:t(Y===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:J,className:`max-h-32 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-violet-500 disabled:opacity-50`}),(0,b.jsx)(g,{size:`icon`,onClick:Q,disabled:J||!k.trim(),children:(0,b.jsx)(ie,{className:`h-4 w-4`})})]})]})}function w(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function T({role:e,text:t,live:n,thinking:r}){let i=e===`user`;return(0,b.jsxs)(`div`,{className:f(`sdd-rise flex items-start gap-2`,i&&`flex-row-reverse`),children:[(0,b.jsx)(`span`,{className:f(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,i?`bg-sky-500/20 text-sky-600 dark:text-sky-300`:`bg-violet-500/20 text-violet-600 dark:text-violet-300`,(n||r)&&`sdd-agent-live`),children:i?(0,b.jsx)(l,{className:`h-3.5 w-3.5`}):(0,b.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`div`,{className:f(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,i?`rounded-tr-sm bg-sky-500/15`:`rounded-tl-sm bg-muted`),children:r?(0,b.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}export{C as SddWizard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$ as r,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$ as r,Vr as i,ci as a,di as o,et as s,rr as c,sr as l,zn as u}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";var d=e(t(),1),f=n();async function p(e){try{let t=await e.clone().json(),n=typeof t.error==`string`?t.error:t.message;if(typeof n==`string`&&n.trim())return n}catch{try{let t=await e.text();if(t.trim())return t.trim()}catch{}}return e.statusText||`HTTP ${e.status}`}function m(e){switch(e){case`running`:return`▶`;case`streaming`:return`↻`;case`waiting_user`:return`⏳`;case`error`:return`✗`;case`idle`:return`■`;default:return`?`}}function h(e){switch(e){case`running`:return`text-emerald-400`;case`streaming`:return`text-cyan-400`;case`waiting_user`:return`text-amber-400`;case`error`:return`text-red-400`;default:return`text-slate-500`}}function g(e){switch(e){case`active`:return`text-emerald-400`;case`idle`:return`text-cyan-400`;case`closing`:return`text-amber-400`;default:return`text-slate-500`}}function _(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`<1m`;if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function v(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return o.t(`common:time.justNow`);if(n<60)return o.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?o.t(`common:time.minutesAgo`,{count:r}):o.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function y(){let{t:e}=a(),[t,n]=(0,d.useState)([]),[o,y]=(0,d.useState)(!0),[b,x]=(0,d.useState)(null),S=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){x(null),n([]);return}throw Error(`HTTP ${e.status}: ${await p(e)}`)}n(await e.json()),x(null)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(!1)}},[]);return(0,d.useEffect)(()=>{S();let e=setInterval(S,5e3);return()=>clearInterval(e)},[S]),o?(0,f.jsxs)(`div`,{className:`flex items-center gap-2 p-4 text-slate-400`,children:[(0,f.jsx)(i,{className:`h-4 w-4 animate-spin`}),e(`activity:liveSessions.loading`)]}):b?(0,f.jsxs)(`div`,{className:`p-4 text-slate-500 text-sm`,children:[e(`activity:liveSessions.apiUnavailable`),` `,(0,f.jsx)(`span`,{className:`text-slate-400`,children:b})]}):t.length===0?(0,f.jsx)(`div`,{className:`p-4 text-slate-500 text-sm`,children:e(`activity:liveSessions.empty`)}):(0,f.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-slate-200 uppercase tracking-wider`,children:e(`activity:liveSessions.heading`,{count:t.length})}),(0,f.jsx)(`span`,{className:`text-xs text-slate-500`,children:e(`activity:liveSessions.autoRefresh`)})]}),t.map(t=>(0,f.jsxs)(`div`,{className:`rounded-lg border border-slate-700 bg-slate-800/50 p-3 space-y-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,f.jsx)(`span`,{className:g(t.status),children:t.status===`active`?(0,f.jsx)(r,{className:`h-3.5 w-3.5 inline`}):t.status===`idle`?(0,f.jsx)(s,{className:`h-3.5 w-3.5 inline`}):null}),(0,f.jsx)(`span`,{className:`font-medium text-slate-200 text-sm`,children:t.projectName}),(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs`,children:[`[`,t.projectSlug,`]`]}),t.gitBranch?(0,f.jsxs)(`span`,{className:`text-purple-400 text-xs flex items-center gap-1`,children:[(0,f.jsx)(u,{className:`h-3 w-3`}),t.gitBranch]}):null,(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs ml-auto flex items-center gap-1`,children:[(0,f.jsx)(l,{className:`h-3 w-3`}),_(t.startedAt)]}),(0,f.jsx)(`span`,{className:`text-slate-600 text-xs`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]}),(0,f.jsxs)(`div`,{className:`text-slate-500 text-xs flex items-center gap-1`,children:[(0,f.jsx)(c,{className:`h-3 w-3`}),t.workingDir]}),(0,f.jsxs)(`div`,{className:`space-y-1 mt-2`,children:[t.agents.slice(0,5).map(t=>(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-xs pl-2 border-l-2 border-slate-700`,children:[(0,f.jsx)(`span`,{className:h(t.status),children:m(t.status)}),(0,f.jsx)(`span`,{className:`text-slate-300 font-medium`,children:t.name}),t.currentTool?(0,f.jsxs)(`span`,{className:`text-slate-500`,children:[`[`,t.currentTool,`]`]}):null,(0,f.jsx)(`span`,{className:`text-slate-600 ml-auto`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:v(t.lastActivityAt)})})]},t.id)),t.agents.length>5?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null,t.agents.length===0?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.noAgents`)}):null]})]},t.sessionId))]})}export{y as SessionsDashboard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,o as r,p as i}from"./markdown-D0X23O-i.js";import{Bt as ee,Ir as te,Jt as ne,Kt as re,Ln as ie,On as ae,Qn as oe,Tr as se,Un as ce,Vr as a,Z as o,_r as le,ar as ue,ci as s,di as c,dt as de,hr as fe,pr as pe,t as me,xr as he}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{n as l}from"./ui-store-BdOsq6T-.js";import{t as u}from"./utils-DBns3uMk.js";import{C as ge,T as _e,d}from"./index-CWj2bI87.js";var f=e(n(),1),p=i();function m(e){return e===`project`||e===`user`}function h(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function ve({source:e}){let{t}=s(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,p.jsx)(`span`,{className:u(`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400`,n===`user`&&`bg-violet-100 text-violet-700 dark:bg-violet-950 dark:text-violet-400`,n===`bundled`&&`bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function g({className:e}){let{t:n}=s(),{client:i}=ge(),g=l(e=>e.skillsState),_=l(e=>e.setSkillsState),v=g.selectedSkill,y=g.navHistory,b=g.historyIndex,[x,S]=(0,f.useState)(null),[ye,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(!1),[O,k]=(0,f.useState)(``),[A,j]=(0,f.useState)(!1),[M,N]=(0,f.useState)(null),[P,F]=(0,f.useState)(!1),[I,L]=(0,f.useState)(null),[R,z]=(0,f.useState)(!1),B=(0,f.useRef)(``),[V,H]=(0,f.useState)(!1),[U,W]=(0,f.useState)(null),[be,xe]=(0,f.useState)(!1),[G,K]=(0,f.useState)(null),[q,Se]=(0,f.useState)(!1),[Ce,we]=(0,f.useState)([]),J=(0,f.useRef)(g);J.current=g;let Y=(0,f.useRef)(!1),X=(0,f.useMemo)(()=>O?{lines:O.split(`
|
|
2
|
+
`).length,words:O.trim()?O.trim().split(/\s+/).length:0,chars:O.length}:{lines:0,words:0,chars:0},[O]),Z=(0,f.useMemo)(()=>{if(!O)return null;let e=5*1024*1024,t=new Blob([O]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[O]);(0,f.useEffect)(()=>{if(!I)return;let e=setTimeout(()=>L(null),2e3);return()=>clearTimeout(e)},[I]),(0,f.useEffect)(()=>{if(!E||!v)return;let e=setInterval(()=>{O&&O!==B.current&&(B.current=O,localStorage.setItem(`skills_draft_${v.name}`,JSON.stringify({content:O,savedAt:Date.now()})),L(Date.now()))},5e3);return()=>clearInterval(e)},[E,O,v]),(0,f.useEffect)(()=>{if(!v||!E)return;let e=localStorage.getItem(`skills_draft_${v.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==O&&t!==B.current&&(k(t),B.current=t,z(!0))}catch{}},[v?.name,E]),(0,f.useEffect)(()=>{if(!i||!v)return;C(!0),S(null),T(null);let e=setTimeout(()=>{C(!1),T(c.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?T(n.payload.error):n.payload.name&&S(n.payload),C(!1)},n=e=>{let t=e;H(!1);let n=J.current;if(t.payload.success){let e={...n.knownRefs};for(let n of t.payload.updated??[])e[n.name]=n.newRef;_({...n,knownRefs:e,updateAvailableCount:0}),W({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),i.send({type:`skills.list`})}else W({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??c.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&we(t.payload.skills)};return i.on(`skills.content`,t),i.on(`skills.updated`,n),i.on(`skills.list`,r),i.send({type:`skills.content`,payload:{name:v.name,source:v.source}}),()=>{clearTimeout(e),i.off(`skills.content`,t),i.off(`skills.updated`,n),i.off(`skills.list`,r)}},[i,v?.name,v?.source]),(0,f.useEffect)(()=>{E&&(D(!1),k(``),N(null))},[v?.name]);let Q=(0,f.useCallback)(e=>Ce.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ce]),Te=(0,f.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=y.slice(0,b+1);e.push(t),_({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),D(!1),k(``),W(null)}},[Q,y,b,_]),Ee=(0,f.useCallback)(()=>{if(b<=0)return;Y.current=!0;let e=b-1,t=y[e];_({...J.current,selectedSkill:t,historyIndex:e}),D(!1),k(``),W(null)},[b,y,_]),De=(0,f.useCallback)(()=>{if(b>=y.length-1)return;Y.current=!0;let e=b+1,t=y[e];_({...J.current,selectedSkill:t,historyIndex:e}),D(!1),k(``),W(null)},[b,y,_]),$=(0,f.useCallback)(()=>{_e(`chat`)},[]),Oe=(0,f.useCallback)(()=>{x&&(k(x.body),B.current=x.body,z(!1),N(null),D(!0),F(!1))},[x]),ke=(0,f.useCallback)(()=>{D(!1),k(``),N(null),F(!1),z(!1),v&&localStorage.removeItem(`skills_draft_${v.name}`)},[v]),Ae=(0,f.useCallback)(()=>{!v||!x||(z(!1),k(x.body),B.current=x.body,v&&localStorage.removeItem(`skills_draft_${v.name}`))},[v,x]),je=(0,f.useCallback)(()=>{if(!i||!v||!O.trim())return;j(!0),N(null);let e=t=>{let n=t;j(!1),n.payload.success?(B.current=``,localStorage.removeItem(`skills_draft_${v.name}`),z(!1),D(!1),i.send({type:`skills.content`,payload:{name:v.name,source:v.source}}),i.send({type:`skills.list`})):N(n.payload.error??c.t(`activity:skillDetail.saveFailed`)),i.off(`skills.edited`,e)};i.on(`skills.edited`,e),i.editSkill(v.name,O)},[i,v,O]),Me=(0,f.useCallback)(()=>{!i||!v||(H(!0),W(null),i.checkForUpdates(v.name,v.source===`user`))},[i,v]),Ne=(0,f.useCallback)(()=>{v?.sourceUrl&&navigator.clipboard.writeText(v.sourceUrl).then(()=>{xe(!0),setTimeout(()=>xe(!1),2e3)})},[v]),Pe=(0,f.useCallback)(()=>{if(!x?.body)return;let e=new Blob([x.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${x.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[x]),Fe=(0,f.useCallback)(async e=>{if(!i||!e)return;Se(!0);let t=e=>{let n=e;Se(!1),n.payload.success?(K(null),i.send({type:`skills.list`}),$()):N(n.payload.error??c.t(`activity:skillDetail.uninstallFailed`)),i.off(`skills.uninstalled`,t)};i.on(`skills.uninstalled`,t),i.uninstallSkill(e.name,e.source===`user`)},[i,$]);return v?(0,p.jsxs)(`div`,{className:u(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-background`,e),children:[(0,p.jsxs)(`div`,{className:`px-4 py-3 border-b bg-card shrink-0`,children:[(0,p.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(te,{className:`h-4 w-4 text-primary shrink-0`}),(0,p.jsx)(`h1`,{className:`text-base font-semibold truncate`,children:v.name}),v.version&&(0,p.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,v.version]}),(0,p.jsx)(ve,{source:v.source})]}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:v.description||v.trigger}),v.sourceUrl&&(0,p.jsxs)(`div`,{className:`flex items-center gap-1 mt-2`,children:[(0,p.jsxs)(`a`,{href:`https://${v.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,title:n(`activity:skillDetail.openSourceRepo`),children:[(0,p.jsx)(ae,{className:`h-3 w-3 shrink-0`}),(0,p.jsx)(`span`,{className:`truncate font-mono`,children:v.sourceUrl})]}),(0,p.jsx)(`button`,{type:`button`,onClick:Ne,className:`flex items-center shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,title:n(`activity:skillDetail.copySourceUrl`),children:be?(0,p.jsx)(le,{className:`h-3 w-3 text-green-500`}):(0,p.jsx)(ue,{className:`h-3 w-3`})})]}),v.scope.length>0&&(0,p.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:v.scope.map(e=>(0,p.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),U&&(0,p.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[U.updated.length>0&&(0,p.jsx)(`div`,{className:`text-green-600`,children:n(`activity:skillDetail.updatedLabel`,{list:U.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),U.unchanged.length>0&&(0,p.jsx)(`div`,{className:`text-muted-foreground`,children:n(`activity:skillDetail.upToDateLabel`,{list:U.unchanged.join(`, `)})}),U.errors.length>0&&(0,p.jsx)(`div`,{className:`text-destructive`,children:n(`activity:skillDetail.errorsLabel`,{list:U.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-1 ml-auto shrink-0`,children:[m(v.source)&&v.sourceUrl&&(0,p.jsx)(`button`,{type:`button`,onClick:Me,disabled:V,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer disabled:opacity-50`,title:n(`activity:skillDetail.checkUpdatesTitle`),children:V?(0,p.jsx)(a,{className:`h-3.5 w-3.5 animate-spin`}):(0,p.jsx)(ee,{className:`h-3.5 w-3.5`})}),v.source!==`bundled`&&!E&&(0,p.jsx)(`button`,{type:`button`,onClick:Pe,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer`,title:n(`activity:skillDetail.exportTitle`),children:(0,p.jsx)(oe,{className:`h-3.5 w-3.5`})}),m(v.source)&&!E&&(0,p.jsx)(`button`,{type:`button`,onClick:Oe,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer`,title:n(`activity:skillDetail.editTitle`),children:(0,p.jsx)(re,{className:`h-3.5 w-3.5`})}),m(v.source)&&(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(v),className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer`,title:n(`activity:skillDetail.uninstallTitle`),children:(0,p.jsx)(de,{className:`h-3.5 w-3.5`})}),(0,p.jsx)(`button`,{type:`button`,onClick:$,className:`p-1.5 rounded hover:bg-accent text-muted-foreground cursor-pointer`,title:n(`activity:skillDetail.closeTitle`),children:(0,p.jsx)(o,{className:`h-4 w-4`})})]})]}),y.length>1&&(0,p.jsxs)(`div`,{className:`flex items-center gap-1 mt-2`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:Ee,disabled:b<=0,className:u(`p-1 rounded transition-colors`,b<=0?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.backTitle`),children:(0,p.jsx)(fe,{className:`h-4 w-4`})}),(0,p.jsx)(`button`,{type:`button`,onClick:De,disabled:b>=y.length-1,className:u(`p-1 rounded transition-colors`,b>=y.length-1?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.forwardTitle`),children:(0,p.jsx)(pe,{className:`h-4 w-4`})}),(0,p.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:y.map((e,t)=>(0,p.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,p.jsx)(pe,{className:`h-3 w-3 text-muted-foreground/40 mx-0.5 shrink-0`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>{t<b&&(Y.current=!0,_({...J.current,selectedSkill:e,historyIndex:t}),D(!1),k(``),W(null))},className:u(`hover:text-primary cursor-pointer transition-colors`,t===b?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),x&&(x.relatedFiles.length>0||x.references.length>0)&&(0,p.jsxs)(`div`,{className:`px-4 py-2 border-b bg-muted/30 shrink-0 space-y-2`,children:[x.relatedFiles.length>0&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,p.jsx)(ie,{className:`h-3 w-3`}),(0,p.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.relatedFiles`)})]}),x.relatedFiles.map(e=>{let t=h(e);return t&&Q(t)?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded bg-background border border-border hover:border-primary hover:text-primary transition-colors cursor-pointer`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,p.jsx)(se,{className:`h-2.5 w-2.5`}),e]},e):(0,p.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-background border border-border text-muted-foreground`,children:e},e)})]}),x.references.length>0&&(0,p.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,p.jsx)(ce,{className:`h-3 w-3`}),(0,p.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.references`)})]}),x.references.map(e=>{let t=h(e)??e.replace(/\.md$/,``);return Q(t)?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded bg-primary/5 border border-primary/20 text-primary hover:bg-primary/10 hover:border-primary/30 transition-colors cursor-pointer`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,p.jsx)(se,{className:`h-2.5 w-2.5`}),t]},e):(0,p.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:t},e)})]})]}),(0,p.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:ye?(0,p.jsxs)(`div`,{className:`p-8 text-center text-muted-foreground`,children:[(0,p.jsx)(a,{className:`h-6 w-6 animate-spin mx-auto mb-2`}),(0,p.jsx)(`p`,{children:n(`activity:skillDetail.loadingContent`)})]}):E?(0,p.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,p.jsxs)(`div`,{className:`px-4 py-2 border-b shrink-0 flex items-center justify-between gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.editingLabel`,{name:v.name})}),(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:n(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,p.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`text-red-500 font-medium`:`text-amber-500`}`,children:n(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),I&&(0,p.jsx)(`span`,{className:`text-xs text-green-500 animate-pulse`,children:n(`activity:skillDetail.draftSaved`)}),R&&(0,p.jsx)(`span`,{className:`text-xs text-amber-500 animate-pulse`,children:n(`activity:skillDetail.draftRestored`)})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[M&&(0,p.jsx)(`span`,{className:`text-xs text-destructive`,children:M}),R&&(0,p.jsx)(`button`,{type:`button`,onClick:Ae,className:`px-2 py-1 text-[10px] rounded border border-amber-500/50 text-amber-600 dark:text-amber-400 hover:bg-amber-500/10 transition-colors cursor-pointer`,children:n(`activity:skillDetail.discardDraft`)}),(0,p.jsx)(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-xs rounded border border-border hover:bg-accent transition-colors cursor-pointer`,children:n(`common:action.cancel`)}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>F(e=>!e),title:n(P?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`px-2 py-1 text-xs rounded border transition-colors cursor-pointer ${P?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-accent text-muted-foreground`}`,children:(0,p.jsx)(ne,{className:`h-3 w-3 inline`})}),(0,p.jsx)(`button`,{type:`button`,onClick:je,disabled:A||!O.trim(),className:`px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors cursor-pointer`,children:A?(0,p.jsx)(a,{className:`h-3 w-3 animate-spin inline`}):n(`common:action.save`)})]})]}),P?(0,p.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,p.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,p.jsx)(me,{value:O,onChange:e=>k(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})}),(0,p.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,p.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,p.jsx)(t,{rehypePlugins:[r],components:d,children:O})})]}):(0,p.jsx)(me,{value:O,onChange:e=>k(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})]}):x?(0,p.jsx)(`div`,{className:`p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,p.jsx)(t,{rehypePlugins:[r],components:d,children:x.body})}):w?(0,p.jsxs)(`div`,{className:`p-8 text-center`,children:[(0,p.jsx)(`p`,{className:`text-destructive mb-2`,children:n(`activity:skillDetail.loadFailed`)}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>{i&&v&&(C(!0),T(null),i.send({type:`skills.content`,payload:{name:v.name,source:v.source}}))},className:`mt-4 px-3 py-1.5 text-xs rounded border border-border hover:bg-accent transition-colors`,children:n(`common:action.retry`)})]}):(0,p.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:n(`activity:skillDetail.noContent`)})}),G&&(0,p.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:e=>{e.target===e.currentTarget&&K(null)},children:(0,p.jsxs)(`div`,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col overflow-hidden rounded-lg border bg-background shadow-xl`,children:[(0,p.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between p-4 border-b`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(de,{className:`h-4 w-4 text-destructive`}),(0,p.jsx)(`span`,{className:`font-semibold text-sm`,children:n(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(null),className:`p-1 rounded hover:bg-accent text-muted-foreground cursor-pointer`,children:(0,p.jsx)(o,{className:`h-4 w-4`})})]}),(0,p.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 space-y-2`,children:[(0,p.jsx)(`p`,{className:`text-sm`,children:n(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.uninstallRemovePath`,{path:G.source===`user`?`~/.wrongstack/skills`:`.wrongstack/skills`})})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 p-4 border-t bg-muted/20`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`px-3 py-1.5 text-xs rounded border border-border hover:bg-accent transition-colors disabled:opacity-50`,children:n(`common:action.cancel`)}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Fe(G),disabled:q,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[q&&(0,p.jsx)(a,{className:`h-3 w-3 animate-spin`}),n(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,p.jsxs)(`div`,{className:u(`flex-1 flex flex-col items-center justify-center text-muted-foreground p-8`,e),children:[(0,p.jsx)(he,{className:`h-12 w-12 mb-4 opacity-20`}),(0,p.jsx)(`p`,{className:`text-base font-medium`,children:n(`activity:skillDetail.noSkillSelected`)}),(0,p.jsx)(`p`,{className:`text-sm mt-1 text-center max-w-[300px]`,children:n(`activity:skillDetail.selectSkillHint`)}),(0,p.jsx)(`button`,{type:`button`,onClick:$,className:`mt-4 px-4 py-2 text-sm rounded-md border border-border hover:bg-accent transition-colors`,children:n(`activity:skillDetail.goToChat`)})]})}export{g as SkillDetailView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$r as r,Cr as i,It as a,Un as o,Ut as s,Vr as c,Z as l,Zt as u,ci as d,fn as f,gr as p,lr as m,pr as h,sr as g,ti as _,vn as v}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as y}from"./utils-DBns3uMk.js";import{C as b,D as x,p as S,w as C}from"./index-CWj2bI87.js";var w=e(t(),1),T=n(),E={completed:{icon:(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),label:`Completed`,text:`text-emerald-400`,ring:`border-emerald-500/40`},in_progress:{icon:(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),label:`Running`,text:`text-sky-400`,ring:`border-sky-500/50`},queued:{icon:(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),label:`Queued`,text:`text-amber-400`,ring:`border-amber-500/40`},blocked:{icon:(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),label:`Blocked`,text:`text-rose-400`,ring:`border-rose-500/30`},pending:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),label:`Pending`,text:`text-slate-400`,ring:`border-white/10`},review:{icon:(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),label:`Review`,text:`text-violet-400`,ring:`border-violet-500/40`},failed:{icon:(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),label:`Failed`,text:`text-red-400`,ring:`border-red-500/50`},cancelled:{icon:(0,T.jsx)(i,{className:`h-3.5 w-3.5`}),label:`Cancelled`,text:`text-slate-400`,ring:`border-slate-500/40`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{label:`Crit`,cls:`bg-red-500/15 text-red-400`},high:{label:`High`,cls:`bg-red-500/15 text-red-400`},medium:{label:`Med`,cls:`bg-amber-500/15 text-amber-400`},low:{label:`Low`,cls:`bg-emerald-500/15 text-emerald-400`}};function k({columns:e,onTaskClick:t}){let{t:n}=d();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-slate-400`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-lg border border-white/10 bg-[#0f1115] p-4`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-slate-200`,children:n(`activity:board.depGraphHeading`)}),(0,T.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs`,children:D.map(e=>(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-slate-400`,children:n(`activity:board.status.${e}`)})]},e))}),(0,T.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:e.map((n,r)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,T.jsxs)(`div`,{className:`w-60 shrink-0`,children:[(0,T.jsx)(`div`,{className:`mb-2 border-b border-white/10 pb-1 text-center text-xs font-medium uppercase tracking-wider text-slate-500`,children:n.label}),(0,T.jsx)(`div`,{className:`space-y-2`,children:n.tasks.map(e=>(0,T.jsx)(A,{task:e,onClick:t},e.id))})]}),r<e.length-1&&(0,T.jsx)(`div`,{className:`flex h-full items-center pt-8 text-slate-600`,children:(0,T.jsx)(h,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=d();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:y(`w-full rounded-md border bg-[#161a22] p-2.5 text-left transition-colors hover:border-orange-500/40`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-slate-300`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:y(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:r.label})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-slate-200`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:y(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-sky-500/15 text-sky-400`:`bg-white/5 text-slate-400`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(c,{className:`h-3 w-3 animate-spin`}),(0,T.jsx)(`span`,{children:e.agentName})]})]})}function j(e){return e.columns.map(e=>({name:e.label,description:``,priority:`medium`,estimateHours:e.tasks.length,parallelizable:!1,taskTemplates:e.tasks.map(e=>({title:e.title,description:e.description,type:e.type,priority:e.priority,estimateHours:1}))}))}function M({onClose:e}){let{client:t}=b(),{t:n}=d(),r=x(e=>e.specs),i=x(e=>e.detail),a=x(e=>e.expandedSpecId),c=x(e=>e.setExpanded),[f,m]=(0,w.useState)(`graph`),g=(0,w.useCallback)(e=>{!i||i.specId!==e.id||(t?.send?.({type:`autophase.start`,payload:{title:e.title,phases:j(i),autonomous:!0}}),C(`autophase`))},[i,t]);(0,w.useEffect)(()=>{t?.send?.({type:`specs.list`})},[t]);let _=(0,w.useCallback)(e=>{a===e.id?c(null):(c(e.id),t?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[a,c,t]),E=i?.columns.flatMap(e=>e.tasks)??[],D={done:E.filter(e=>e.status===`completed`).length,running:E.filter(e=>e.status===`in_progress`).length,pending:E.filter(e=>e.status===`pending`||e.displayStatus===`queued`).length};return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,T.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b bg-card px-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(o,{className:`h-5 w-5 text-orange-500`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(S,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(l,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:r.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:r.map(e=>{let t=a===e.id,r=e.total>0?Math.round(e.completed/e.total*100):0;return(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/60`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>_(e),className:`flex w-full items-start gap-3 p-4 text-left`,children:[(0,T.jsx)(`span`,{className:`mt-1 text-muted-foreground`,children:t?(0,T.jsx)(p,{className:`h-4 w-4`}):(0,T.jsx)(h,{className:`h-4 w-4`})}),(0,T.jsx)(o,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.displayId}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] capitalize text-muted-foreground`,children:e.status})]}),(0,T.jsx)(`h2`,{className:`mt-1 text-base font-semibold`,children:e.title}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-emerald-500 transition-all`,style:{width:`${r}%`}})}),(0,T.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]})]})]}),t&&(0,T.jsxs)(`div`,{className:`border-t border-border p-4`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`text-sm font-medium`,children:[n(`activity:specs.tasks`,{count:i?.total??e.total}),i&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-emerald-500`,children:n(`activity:specs.doneCount`,{count:D.done})}),` `,(0,T.jsx)(`span`,{className:`text-sky-500`,children:n(`activity:specs.runningCount`,{count:D.running})}),` `,(0,T.jsx)(`span`,{children:n(`activity:specs.pendingCount`,{count:D.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,disabled:!i||i.specId!==e.id,onClick:()=>g(e),title:n(`activity:specs.runTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-500 transition-colors hover:bg-orange-500/25 disabled:opacity-40`,children:[(0,T.jsx)(s,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.run`)]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`list`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,f===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(v,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`graph`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,f===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(u,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.graph`)]})]})]})]}),!i||i.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.loadingTasks`)}):f===`graph`?(0,T.jsx)(k,{columns:i.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:E.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,T.jsx)(`span`,{className:`flex-1 text-sm`,children:e.title}),(0,T.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.displayStatus.replace(`_`,` `)})]},e.id))})]})]},e.id)})})})]})}export{M as SpecsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Fr as r,Ht as i,It as a,Z as o,ci as s,di as c,dt as l}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as u}from"./ws-client-BAV7SLzK.js";import{t as d}from"./session-store-DN1UYDL9.js";import{n as f}from"./ui-store-BdOsq6T-.js";import{t as p}from"./utils-DBns3uMk.js";import{R as m}from"./index-CWj2bI87.js";import{n as h,t as g}from"./xterm-B9RXJkIu.js";var _=e(t(),1),v=`wrongstack.terminalDockHeight`;function y(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var b=n(),x={background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#f5e0dc`,selectionBackground:`#585b70`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#bac2de`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#f5c2e7`,brightCyan:`#94e2d5`,brightWhite:`#a6adc8`},S=8;function C(e=!1){return typeof window>`u`?300:y(window.innerHeight*(e?.32:.4))}function w(e=!1){if(typeof window>`u`)return C(e);try{let t=window.localStorage.getItem(v),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?y(n):C(e)}catch{return C(e)}}function T(e){try{window.localStorage.setItem(v,String(y(e)))}catch{}}function E(){try{return crypto.randomUUID()}catch{return`term-${Date.now()}-${Math.floor(Math.random()*1e6)}`}}function D(e){return{id:E(),name:`Terminal ${e}`,status:`starting`}}function O({desktopShell:e=!1,onClose:t}){let n=(0,_.useRef)(null),{t:c}=s(),u=(0,_.useRef)(1),[m,h]=(0,_.useState)(()=>w(e)),[g,v]=(0,_.useState)(()=>[D(1)]),[x,C]=(0,_.useState)(()=>g[0]?.id??``),O=f(e=>e.terminalCreateNonce),A=(0,_.useRef)(O),j=d(e=>e.projectName),M=d(e=>e.cwd);(0,_.useEffect)(()=>{let e=()=>{h(e=>{let t=y(e);return T(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),n.current?.();let t=e.clientY,r=m,i=document.body.style.cursor,a=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let o=e=>{let n=y(r+t-e.clientY);h(n),T(n)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),n.current===s&&(n.current=null)};n.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,_.useEffect)(()=>()=>n.current?.(),[]);let P=()=>{v(e=>{if(e.length>=S)return e;u.current+=1;let t=D(u.current);return C(t.id),[...e,t]})};(0,_.useEffect)(()=>{O!==A.current&&(A.current=O,P())},[O]);let F=e=>{v(n=>{let r=n.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(t),i):(x===e&&C(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=E();v(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&C(t),i})},L=()=>{v([]),C(``),queueMicrotask(t)},R=(e,t)=>{v(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===x)??g[0]??null;return(0,b.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:m},"data-shell":e?`desktop`:`browser`,className:p(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border bg-[#1e1e2e] shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,b.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,title:c(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-[#181825] hover:bg-primary/35 transition-colors`}),(0,b.jsxs)(`div`,{className:p(`flex min-w-0 items-center justify-between gap-3 border-b border-border/40 bg-[#181825]`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-[#cdd6f4]`,children:[(0,b.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),(0,b.jsx)(`span`,{className:`font-medium`,children:c(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,b.jsx)(`span`,{className:`min-w-0 truncate text-[#a6adc8]`,children:j||M||c(`activity:terminal.projectShell`)})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=S,title:g.length>=S?c(`activity:terminal.maxTerminals`,{count:S}):c(`activity:terminal.newTerminal`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(i,{className:`h-4 w-4`})}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:c(`activity:terminal.restart`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:c(`activity:terminal.closeAll`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(l,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:t,title:c(`activity:terminal.closeDock`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 transition-colors`,children:(0,b.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,b.jsx)(`div`,{className:p(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/40 bg-[#181825]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,b.jsxs)(`div`,{className:p(`group inline-flex items-center rounded border text-xs transition-colors`,e?`h-6 min-w-[92px] max-w-[148px]`:`h-7 min-w-[112px] max-w-[180px]`,x===t.id?`border-[#89b4fa]/45 bg-[#313244] text-[#cdd6f4]`:`border-transparent bg-transparent text-[#a6adc8] hover:bg-white/10`),children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>C(t.id),title:t.status===`exited`?`${t.name} exited`:t.name,className:`inline-flex min-w-0 flex-1 items-center gap-2 px-2 text-left`,children:[(0,b.jsx)(`span`,{className:p(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-[#a6e3a1]`,t.status===`starting`&&`bg-[#89b4fa]`,t.status===`exited`&&`bg-[#f38ba8]`)}),(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,b.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),F(t.id)},className:`mr-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[#a6adc8] opacity-70 hover:bg-white/10 hover:opacity-100`,title:c(`activity:terminal.closeTab`,{name:t.name}),children:(0,b.jsx)(o,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,b.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/30 bg-[#181825] px-3 py-1 text-[11px] font-mono text-[#6c7086]`,children:M}),(0,b.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,b.jsx)(k,{id:e.id,active:e.id===x,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function k({id:e,active:t,onRunning:n,onExit:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(n),l=(0,_.useRef)(r),d=m(e=>e.wsConnected);return(0,_.useEffect)(()=>{s.current=n,l.current=r},[r,n]),(0,_.useEffect)(()=>{let t=i.current;if(!t)return;let n=new g({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:x,scrollback:5e3}),r=new h;a.current=n,o.current=r,n.loadAddon(r),n.open(t);try{r.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:n.cols,rows:n.rows}}),s.current();let f=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&n.write(t.payload.data)}),p=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(n.write(`\r\n\x1b[2m${c.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),_=n.onData(t=>{d.send({type:`terminal.input`,payload:{id:e,data:t}})}),v=new ResizeObserver(()=>{if(t.offsetParent)try{r.fit(),d.send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}})}catch{}});return v.observe(t),()=>{f(),p(),_.dispose(),v.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),n.dispose(),a.current=null,o.current=null}},[e,d]),(0,_.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{o.current?.fit();let t=a.current;t&&(u(m.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,b.jsx)(`div`,{ref:i,className:p(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{O as TerminalPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{oi as e,si as t}from"./vendor-Ch4m_qLI.js";function n(e,t){if(e==null){let e=Error(t?`Expected ${t} to be defined`:`Expected value to be defined`);throw e.name=`ExpectDefinedError`,e}return e}function r(e,t){let n=e=>e.trim().replace(/\s+/g,` `).toLowerCase();return n(e)===n(t)}function i(e){return e instanceof Error?e.message:String(e)}function a(e){if(!e)return e;let t=e.split(/\n{2,}/),n=[];for(let e of t)n.length>0&&n[n.length-1]?.trim()===e.trim()||n.push(e);return n.map(e=>{let t=e.split(`
|
|
2
2
|
`),n=[];for(let e of t)n.length>0&&e.trim().length>0&&n[n.length-1]?.trim()===e.trim()||n.push(e);return n.join(`
|
|
3
3
|
`)}).join(`
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-DT93tsyC.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-DCAGDU3F.js","assets/commandPalette-DUootORZ.js","assets/common-D7usadq4.js","assets/settings-CGhOOFpI.js","assets/setup-Dr2UDb8s.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{
|
|
2
|
+
import{di as e,li as t,oi as n,si as r,ui as i}from"./vendor-Ch4m_qLI.js";import{t as a}from"./activity-DT93tsyC.js";import{t as o}from"./chat-DCAGDU3F.js";import{t as s}from"./commandPalette-DUootORZ.js";import{t as c}from"./common-D7usadq4.js";import{t as l}from"./settings-CGhOOFpI.js";import{t as u}from"./setup-Dr2UDb8s.js";import{t as d}from"./toasts-BL_8kH4B.js";import{l as f}from"./monaco-DqY9Mr3N.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,streamFleet:!0,nextPrediction:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceLanguage:`original`,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_()},x=r()(n(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:5,migrate:e=>{let t=e??{};return[`hybrid`,`intelligent`,`selective`].includes(t.contextStrategy)||(t.contextStrategy=`hybrid`),t.auditLevel===`verbose`&&(t.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(t.auditLevel)||(t.auditLevel=`standard`),typeof t.autoProceedMaxIterations!=`number`&&(t.autoProceedMaxIterations=50),(!t.fallbackProfiles||typeof t.fallbackProfiles!=`object`||Array.isArray(t.fallbackProfiles))&&(t.fallbackProfiles={}),Array.isArray(t.favoriteModels)||(t.favoriteModels=[]),typeof t.favoriteModelsOnly!=`boolean`&&(t.favoriteModelsOnly=!1),(!t.modelMatrix||typeof t.modelMatrix!=`object`||Array.isArray(t.modelMatrix))&&(t.modelMatrix={}),(typeof t.uiLocale!=`string`||!t.uiLocale)&&(t.uiLocale=_()),t}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}e.use(t).use(i((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-CVWYwjgf.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-cxuX4gFa.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-2M1hYRuH.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-CrGjglH4.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-CQ4x-iFD.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-Iyk4ncan.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-DT93tsyC.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-DCAGDU3F.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DUootORZ.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-D7usadq4.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-CGhOOFpI.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-Dr2UDb8s.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-ByEwzh5Q.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-Cvy-F2d6.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-CTE9ITWg.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BAg8_MKg.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-TqprB9wO.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-BqoJ89VQ.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-BEjzb11U.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-Cfq81NCh.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-BYf22WAi.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-tmj0IcQS.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-DgGu17XI.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-C4wNoopG.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-Cjm0UoMi.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-DNIePdaQ.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-BZhacjvy.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-BH1mb9Im.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-BVvx94WK.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-B8S3Rhsj.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-DN6Bmnaw.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-CdLXf1yN.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-RxWSjQIg.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-C29pCVfm.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-CmHCQRVI.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-CGWbN6bj.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CqiCPjKb.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-DhofDrgA.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-BE_ljQwl.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-KzRPhobM.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-OOQ-99Tn.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-BPkWK-DE.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(e.language||`en`),x.subscribe((t,n)=>{let r=t.uiLocale;r&&r!==n.uiLocale&&r!==e.language&&e.changeLanguage(r).then(()=>w(r))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(t=>{if(!t)return;let n=v(t);if(n===e.language)return;let r=x.getState();r.uiLocale!==n&&r.set({uiLocale:n}),e.changeLanguage(n).then(()=>w(n))})}try{T()}catch{}export{h as n,x as t};
|