@wrongstack/webui 1.0.26 → 1.0.27
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/{AgentRosterView-udJ14GYq.js → AgentRosterView-BJ-1SQOm.js} +1 -1
- package/dist/assets/{AnalyticsDashboard-DwF-0cUA.js → AnalyticsDashboard-FYrD8BFQ.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-DpBGeZv_.js → AudienceMemoryPanel-BghMZicW.js} +1 -1
- package/dist/assets/{ChangesView-BfM0T_aS.js → ChangesView-B3uQtZGR.js} +1 -1
- package/dist/assets/{ChimeraReviewsView-Q_5C4DU1.js → ChimeraReviewsView-CBRbTHGM.js} +1 -1
- package/dist/assets/{ChronicleDashboard-D6LnZzhy.js → ChronicleDashboard-B1E-_u64.js} +1 -1
- package/dist/assets/{CodeEditor-DonrWH9u.js → CodeEditor-CbcWuMGV.js} +1 -1
- package/dist/assets/{CodeMap-Dxtc378S.js → CodeMap-WOfveRTG.js} +1 -1
- package/dist/assets/{CronJobsPanel-Cn2PQO_p.js → CronJobsPanel-DOFA5WVq.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-Mc5py-kJ.js → DeadCodeScanPanel-4ToPZX7e.js} +1 -1
- package/dist/assets/{DebugDashboard-D0LRcT4J.js → DebugDashboard-DAsNHSpG.js} +1 -1
- package/dist/assets/{DesignGalleryView-DAD-wRUc.js → DesignGalleryView-Dd5YnKhs.js} +1 -1
- package/dist/assets/{GoalView-CqeSw0tK.js → GoalView-BaDGAXuQ.js} +1 -1
- package/dist/assets/{KanbanView-V-bkFftp.js → KanbanView-CG8bVhpR.js} +1 -1
- package/dist/assets/{MailboxDetailView-CTEjap3r.js → MailboxDetailView-COxz-eEJ.js} +1 -1
- package/dist/assets/{MemoryDrawer-RCduY0FV.js → MemoryDrawer-4lDXuHCi.js} +1 -1
- package/dist/assets/{MemoryManager-B-p6-Bic.js → MemoryManager-DQlnpch1.js} +1 -1
- package/dist/assets/{ProcessMonitor-B9tpPo4r.js → ProcessMonitor-BUjfYqG3.js} +1 -1
- package/dist/assets/{PromptJournalView-DVNqlac9.js → PromptJournalView-o2dmPrwg.js} +1 -1
- package/dist/assets/{ProviderTestView-mmfpnAbZ.js → ProviderTestView-5wNbI46L.js} +1 -1
- package/dist/assets/{QueuePanel-BB9qozjm.js → QueuePanel-DP9D99DX.js} +1 -1
- package/dist/assets/{RefreshDebugView-CCCWzq29.js → RefreshDebugView-CB7_a_TI.js} +1 -1
- package/dist/assets/{RepositoryHistoryView-RQVRkkUU.js → RepositoryHistoryView-C_zpYLY6.js} +1 -1
- package/dist/assets/{RequirementIntakeView-D_JRhgzW.js → RequirementIntakeView-CahKEHJn.js} +1 -1
- package/dist/assets/{SageTabs--k2hQTvl.js → SageTabs-5Z2PR11S.js} +2 -2
- package/dist/assets/{SddFlowGraph-DKrrRXKy.js → SddFlowGraph-DSoWnlIt.js} +1 -1
- package/dist/assets/{SddHub-B5XO56oY.js → SddHub-0q2EpwYz.js} +2 -2
- package/dist/assets/{SessionInspectView-j3VJwXNi.js → SessionInspectView-CbDFR_tP.js} +1 -1
- package/dist/assets/{SessionList-CCVHBseu.js → SessionList-DhQK7JnP.js} +1 -1
- package/dist/assets/{SessionsDashboard-DsM7sXQw.js → SessionsDashboard-DNLDczSd.js} +1 -1
- package/dist/assets/{SetupScreen-DeuR8Y8S.js → SetupScreen-C-hpHQQ9.js} +1 -1
- package/dist/assets/{SkillDetailView-BeZyGIpW.js → SkillDetailView-Bir-Kdm4.js} +1 -1
- package/dist/assets/TechStackView-CJ3Abnwg.js +2 -0
- package/dist/assets/{TerminalPanel-BVJ5w-5R.js → TerminalPanel-8WHNTeQK.js} +1 -1
- package/dist/assets/{activity-BS2aW_NN.js → activity-B9WjS_Cz.js} +1 -1
- package/dist/assets/{activity-Cd0qM2Hx.js → activity-BB7AHL0U.js} +1 -1
- package/dist/assets/{activity-CR2KFruY.js → activity-Bd0XmdqX.js} +1 -1
- package/dist/assets/{activity-fI3Jy_jD.js → activity-BvmJte2K.js} +1 -1
- package/dist/assets/{activity-bBAOetvE.js → activity-DOEbDWqw.js} +1 -1
- package/dist/assets/{activity-DyXRoY2s.js → activity-beTxIN7V.js} +1 -1
- package/dist/assets/{activity-t6fUmVjo.js → activity-t-0KDhv5.js} +1 -1
- package/dist/assets/{chat-store-uzGtJfDz.js → chat-store-BMwP_sS0.js} +1 -1
- package/dist/assets/{common-DvjdaRhB.js → common-2kj0c3pG.js} +1 -1
- package/dist/assets/{common-D0QL7rwb.js → common-BAvh8XBp.js} +1 -1
- package/dist/assets/{common-opV6EoLd.js → common-CKwGvEQD.js} +1 -1
- package/dist/assets/{common-DJRPtYAt.js → common-CUd7l34J.js} +1 -1
- package/dist/assets/{common-BtyQBZBN.js → common-DmS4Wp1i.js} +1 -1
- package/dist/assets/common-PC103akE.js +1 -0
- package/dist/assets/{common-Bjl7V12m.js → common-zatZ4s-Z.js} +1 -1
- package/dist/assets/config-store-Cb4iyhGv.js +21 -0
- package/dist/assets/i18n-CzTjKT4L.js +3 -0
- package/dist/assets/{index-B4ELbNoz.js → index-Ci22AODp.js} +82 -81
- package/dist/assets/index-DfU9PQg8.css +1 -0
- package/dist/assets/{roster-ws-szSqUkqP.js → roster-ws-D-DCMdrg.js} +1 -1
- package/dist/assets/{settings-ClDQ01ie.js → settings-7W0ofid0.js} +1 -1
- package/dist/assets/{settings-BfNJfO4z.js → settings-BAArGYGW.js} +1 -1
- package/dist/assets/{settings-BMHZcBqe.js → settings-Btyr_M2v.js} +1 -1
- package/dist/assets/{settings-Dl_QM2QZ.js → settings-BwL_DVmc.js} +1 -1
- package/dist/assets/{settings-Da3EIcna.js → settings-C7ybAkyi.js} +1 -1
- package/dist/assets/{settings-BQ5J8WXE.js → settings-CgtL8eYb.js} +1 -1
- package/dist/assets/{settings-DD31lC4f.js → settings-D57Fd8Z8.js} +1 -1
- package/dist/assets/{stores-Cx52UOxM.js → stores-Svlibwo5.js} +2 -2
- package/dist/components/MessageBubble/FailedRunContinue.d.ts +7 -3
- package/dist/components/TechStackView/AnalyzeControls.d.ts +25 -0
- package/dist/components/TechStackView/RemediationTab.d.ts +20 -0
- package/dist/components/TechStackView/TrendsTab.d.ts +17 -0
- package/dist/hooks/ws-handlers/chat-handlers.d.ts +12 -0
- package/dist/hooks/ws-handlers/mcp-status-handlers.d.ts +6 -0
- package/dist/hooks/ws-handlers/techstack-handlers.d.ts +7 -0
- package/dist/index.html +7 -7
- package/dist/index.js +2639 -1487
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/local-prefs-defaults.d.ts +2 -1
- package/dist/stores/provider-quota-store.d.ts +5 -0
- package/dist/stores/techstack-store.d.ts +140 -1
- package/dist/stores/types.d.ts +5 -0
- package/dist/types/client-message.d.ts +3 -3
- package/dist/types/jev.d.ts +2 -0
- package/dist/types/server-message-mcp.d.ts +2 -0
- package/dist/types/server-message-system.d.ts +11 -0
- package/package.json +10 -9
- package/dist/assets/TechStackView-CpSMRQE0.js +0 -2
- package/dist/assets/common-DPPTV3yw.js +0 -1
- package/dist/assets/config-store-P5_updTQ.js +0 -21
- package/dist/assets/i18n-t7rIS4DB.js +0 -3
- package/dist/assets/index-qdrakcnP.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Pt as t,ht as n}from"./config-store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Pt as t,ht as n}from"./config-store-Cb4iyhGv.js";import{i as r,t as i}from"./react-core-wiHys0m2.js";import{La as a,Mt as o,Qt as s,mo as c,so as l,wo as u,zr as d}from"./vendor-BfBvt432.js";import"./i18n-CzTjKT4L.js";import{t as f}from"./utils-B21Devim.js";import"./stores-Svlibwo5.js";import{n as p,o as m,r as h,t as g}from"./dialog-BDUaV5gY.js";import{y as _}from"./index-Ci22AODp.js";var v=e(r(),1),y=i(),b={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-primary/10 text-primary border-primary/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-warning/10 text-warning border-warning/35`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-info/10 text-info border-info/30`}},x=`__no_session__`,S=new Map,C=new Set;t(e=>{S.delete(e),C.add(e)});function w({open:e,onClose:t,className:r}){let{t:i}=u(),{queue:w,remove:T,clear:E}=_(),[D,O]=(0,v.useState)(`oldest`),k=n(),A=(0,v.useRef)(k??x);(0,v.useLayoutEffect)(()=>{C.has(A.current)||S.set(A.current,D);let e=k??x;C.delete(e),O(S.get(e)??`oldest`),A.current=e},[k]);let j=(0,v.useCallback)(e=>{T(e)},[T]),M=(0,v.useMemo)(()=>{let e=w.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>D===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[w,D]),N=w.length>0&&w.every(e=>e.alreadyDispatched);return(0,y.jsx)(g,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(p,{className:f(`max-w-lg gap-0 overflow-hidden border-border/80 bg-card p-0 pt-[10dvh] flex flex-col max-h-[70dvh]`,r),showCloseButton:!1,children:[(0,y.jsx)(m,{className:`sr-only`,children:i(`activity:queue.heading`)}),(0,y.jsx)(h,{className:`sr-only`,children:i(`activity:queue.subtitle`,{count:w.length})}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 bg-card/95 px-4 py-3 shrink-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,y.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-md border border-primary/20 bg-primary/10 text-primary`,children:(0,y.jsx)(d,{className:`h-4 w-4`})}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold`,children:i(`activity:queue.heading`)}),(0,y.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:i(`activity:queue.subtitle`,{count:w.length})})]})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>e===`newest`?`oldest`:`newest`),className:f(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:i(D===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[D===`newest`?(0,y.jsx)(c,{className:`h-3 w-3`}):(0,y.jsx)(l,{className:`h-3 w-3`}),i(D===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),w.length>0&&!N&&(0,y.jsxs)(`button`,{type:`button`,onClick:()=>E(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:i(`activity:queue.clearDispatchedTitle`),"data-testid":`queue-clear-all`,children:[(0,y.jsx)(s,{className:`h-3 w-3`}),i(`activity:queue.clear`)]})]})]}),(0,y.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:w.length===0?(0,y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,y.jsx)(d,{className:`h-10 w-10 opacity-15`}),(0,y.jsx)(`p`,{className:`text-sm font-medium`,children:i(`activity:queue.emptyTitle`)}),(0,y.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:i(`activity:queue.emptyBody`)})]}):(0,y.jsx)(`ul`,{className:`divide-y divide-border/60`,"data-testid":`queue-list`,children:M.map(({item:e,sourceIdx:t},n)=>{let r=b[e.mode],s=e.alreadyDispatched===!0;return(0,y.jsxs)(`li`,{className:f(`flex items-start justify-between gap-3 px-4 py-3 text-xs transition-colors`,s?`bg-muted/30 text-muted-foreground hover:bg-muted/40`:`hover:bg-muted/35`),"data-testid":`queue-item`,"data-dispatched":s?`true`:void 0,children:[(0,y.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,y.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,y.jsx)(`span`,{className:f(`shrink-0 inline-flex items-center justify-center rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,r.tone,s&&`opacity-60`),title:i(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,y.jsx)(`p`,{className:`text-sm leading-relaxed min-w-0 break-words flex-1`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text}),s&&(0,y.jsxs)(`span`,{className:`shrink-0 mt-0.5 inline-flex items-center gap-1 text-[10px] font-semibold uppercase text-success`,title:i(`activity:queue.dispatchedTitle`),"data-testid":`queue-dispatched-${t}`,children:[(0,y.jsx)(a,{className:`h-3 w-3`}),i(`activity:queue.dispatchedLabel`)]})]}),!s&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>j(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:i(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,y.jsx)(o,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),w.length>0&&(0,y.jsx)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-2.5 shrink-0`,children:(0,y.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:i(`activity:queue.footer`)})})]})})}export{w as QueuePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{nt as t}from"./config-store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{nt as t}from"./config-store-Cb4iyhGv.js";import{i as n,t as r}from"./react-core-wiHys0m2.js";import{Fn as i,Ln as a,Oa as o,Qi as s,Tn as c,Yt as l,vo as u,wo as d}from"./vendor-BfBvt432.js";import"./i18n-CzTjKT4L.js";import{n as f}from"./ui-store-DI0iusYZ.js";import{t as p}from"./chat-store-BMwP_sS0.js";var m=e(n(),1),h=r();function g(){let e=t(e=>e.session),{t:n}=d(),r=t.getState().session?.id,g=t(e=>e.projectName),x=t(e=>e.cwd),S=t(e=>e.mode),C=t(e=>e.contextMode),w=t(e=>e.lastVisitedAt),T=p(e=>e.messages),E=p(e=>e.queue.length),D=p(e=>e.boundSessionId),O=f(e=>e.currentView),k=f(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0&&D!==r;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5 sm:space-y-6`,children:[(0,h.jsx)(`header`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-2 text-xl font-bold sm:text-2xl`,children:[(0,h.jsx)(i,{className:`h-6 w-6 shrink-0 text-primary sm:h-7 sm:w-7`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`inline-flex h-9 w-full items-center justify-center rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 sm:w-auto`,children:n(`activity:refresh.recordProbe`)})]})}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(u,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(s,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(a,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`space-y-1 rounded-lg border border-border/70 bg-card/65 p-3 text-xs font-mono`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(o,{className:`w-4 h-4 text-success shrink-0`}):(0,h.jsx)(l,{className:`w-4 h-4 text-warning shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${r?`border-warning/40 bg-warning/10 text-warning`:n?`border-success/40 bg-success/10 text-success`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium`,children:[n&&!r?(0,h.jsx)(o,{className:`h-4 w-4 shrink-0`}):(0,h.jsx)(l,{className:`h-4 w-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 break-words`,children:e})]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-card/75 p-3 shadow-sm`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{rt as t,t as n}from"./config-store-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{rt as t,t as n}from"./config-store-Cb4iyhGv.js";import{i as r,t as i}from"./react-core-wiHys0m2.js";import{Da as a,Dn as o,Fr as s,Ka as c,La as l,Pa as u,Vn as d,ci as f,di as p,do as m,gi as ee,ma as h,ra as g,rn as _,si as v,ui as y,zi as b}from"./vendor-BfBvt432.js";import{t as x}from"./utils-B21Devim.js";import{o as te}from"./view-navigation-Cvrp_uJm.js";import"./stores-Svlibwo5.js";import{a as S,n as ne,o as re,r as ie,t as ae}from"./dialog-BDUaV5gY.js";import{V as oe,z as se}from"./index-Ci22AODp.js";var C=e(r(),1),w=i(),T=[`#9b87f5`,`#37c9a2`,`#f2b95f`,`#67a7ff`,`#e879b8`,`#f07178`],E=48,D=15,O=`ws-commit-detail flex h-[44%] min-h-[230px] max-h-[460px] shrink-0 flex-col overflow-hidden border-t border-border/70 bg-card/35 shadow-[0_-16px_40px_-34px_hsl(var(--primary)/0.8)] sm:h-[36%] sm:max-h-[390px] sm:flex-row`;function ce(e){let t=[],n=[],r=new Map(e.map((e,t)=>[e.hash,t]));for(let r of e){let e=t.indexOf(r.hash);e<0&&(e=t.indexOf(void 0),e<0&&(e=t.length)),n.push(e),t[e]=r.parents[0];for(let e of r.parents.slice(1)){if(t.includes(e))continue;let n=t.indexOf(void 0);n<0&&(n=t.length),t[n]=e}}let i=new Map(e.map((e,t)=>[e.hash,n[t]??0])),a=e.flatMap((e,t)=>e.parents.flatMap(e=>{let a=r.get(e);return a===void 0?[]:[{fromRow:t,fromLane:n[t]??0,toRow:a,toLane:i.get(e)??0}]}));return{lanes:n,laneCount:Math.max(1,...n.map(e=>e+1)),edges:a}}function k(e){return e.slice(0,7)}function A(e){let t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t))return e;let n=Math.max(0,Math.round(t/6e4));if(n<60)return`${n}m`;let r=Math.round(n/60);if(r<48)return`${r}h`;let i=Math.round(r/24);return i<60?`${i}d`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(new Date(e))}function j(e){return e.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}function M(e){return e.startsWith(`tag: `)?`border-amber-400/35 bg-amber-400/10 text-amber-500`:e.includes(`/`)?`border-emerald-400/30 bg-emerald-400/10 text-emerald-500`:`border-violet-400/35 bg-violet-400/12 text-violet-400`}function le({commits:e,layout:t}){let n=22+t.laneCount*D;return(0,w.jsxs)(`svg`,{"aria-label":`Commit topology`,className:`pointer-events-none absolute inset-y-0 left-0`,width:n,height:e.length*E,viewBox:`0 0 ${n} ${e.length*E}`,children:[t.edges.map((e,t)=>{let n=14+e.fromLane*D,r=14+e.toLane*D,i=e.fromRow*E+E/2,a=e.toRow*E+E/2,o=Math.min(18,Math.max(8,(a-i)*.35));return(0,w.jsx)(`path`,{d:`M ${n} ${i} C ${n} ${i+o}, ${r} ${a-o}, ${r} ${a}`,fill:`none`,stroke:T[e.fromLane%T.length],strokeWidth:`2`,strokeLinecap:`round`,opacity:`0.9`},`${e.fromRow}-${e.toRow}-${t}`)}),e.map((e,n)=>{let r=t.lanes[n]??0,i=e.parents.length>1;return(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`circle`,{cx:14+r*D,cy:n*E+E/2,r:i?5:4,fill:`hsl(var(--background))`,stroke:T[r%T.length],strokeWidth:i?2.5:2}),!i&&(0,w.jsx)(`circle`,{cx:14+r*D,cy:n*E+E/2,r:`1.5`,fill:T[r%T.length]})]},e.hash)})]})}function ue({refs:e,activeRef:t,onSelect:n}){let r=[{kind:`local`,label:`Local branches`,icon:p},{kind:`remote`,label:`Remotes`,icon:f},{kind:`tag`,label:`Tags`,icon:_}];return(0,w.jsxs)(`aside`,{className:`hidden min-h-0 w-[218px] shrink-0 flex-col border-r border-border/70 bg-card/35 xl:flex`,children:[(0,w.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[(0,w.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.18em] text-muted-foreground`,children:`Repository`}),(0,w.jsxs)(`button`,{type:`button`,onClick:()=>n(``),className:x(`mt-2 flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-xs transition-colors`,t===``?`bg-primary/12 text-primary`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:[(0,w.jsx)(c,{className:`h-3.5 w-3.5`}),` All branches`]})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-3`,children:r.map(({kind:r,label:i,icon:a})=>{let o=e.filter(e=>e.kind===r);return o.length===0?null:(0,w.jsxs)(`section`,{className:`mb-5`,children:[(0,w.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 px-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/75`,children:[(0,w.jsx)(a,{className:`h-3 w-3`}),` `,i,(0,w.jsx)(`span`,{className:`ml-auto font-mono`,children:o.length})]}),o.map(e=>(0,w.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),title:e.name,className:x(`group flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[11px] transition-colors`,t===e.name?`bg-primary/12 text-primary`:`text-muted-foreground hover:bg-muted/55 hover:text-foreground`),children:[(0,w.jsx)(`span`,{className:x(`h-1.5 w-1.5 shrink-0 rounded-full`,e.current?`bg-primary shadow-[0_0_8px_hsl(var(--primary))]`:`bg-muted-foreground/45`)}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.shortName}),e.current&&(0,w.jsx)(l,{className:`h-3 w-3`})]},e.name))]},r)})})]})}function de({commit:e,detail:t,loading:n,onOpenFile:r}){let[i,o]=(0,C.useState)(!1);if(!e)return(0,w.jsx)(`section`,{className:`ws-commit-detail flex h-[34%] min-h-[210px] shrink-0 items-center justify-center border-t border-border/70 bg-card/30 p-6 text-center text-xs text-muted-foreground`,children:`Select a commit to inspect its files and metadata.`});let c=t?.files??[],d=c.reduce((e,t)=>e+t.added,0),f=c.reduce((e,t)=>e+t.deleted,0),p=t?.body?.split(/\r?\n/).slice(1).join(`
|
|
2
2
|
`).trim();return(0,w.jsxs)(`section`,{className:O,children:[(0,w.jsxs)(`div`,{className:`ws-commit-metadata min-w-0 w-full max-w-none shrink-0 overflow-y-auto border-b border-border/70 px-5 py-4 sm:w-[34%] sm:min-w-[250px] sm:max-w-[440px] sm:border-b-0 sm:border-r`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[0.17em] text-muted-foreground`,children:[(0,w.jsx)(a,{className:`h-3.5 w-3.5 text-primary`}),` Commit details`]}),(0,w.jsx)(`h2`,{className:`mt-3 break-words text-sm font-semibold leading-5 text-foreground`,children:e.subject}),(0,w.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center rounded-full border border-primary/25 bg-primary/10 text-[10px] font-bold text-primary`,children:j(e.author)}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.author}),(0,w.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.email})]})]}),(0,w.jsxs)(`button`,{type:`button`,onClick:async()=>{await navigator.clipboard?.writeText(e.hash),o(!0),window.setTimeout(()=>o(!1),1200)},className:`mt-4 flex w-full items-center justify-between rounded-lg border border-border/70 bg-background/55 px-3 py-2 font-mono text-[11px] text-muted-foreground hover:border-primary/35 hover:text-foreground`,children:[(0,w.jsx)(`span`,{children:k(e.hash)}),i?(0,w.jsx)(l,{className:`h-3.5 w-3.5 text-success`}):(0,w.jsx)(g,{className:`h-3.5 w-3.5`})]}),(0,w.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 overflow-hidden rounded-lg border border-border/70`,children:[(0,w.jsxs)(`div`,{className:`border-r border-border/70 p-3`,children:[(0,w.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:c.length}),(0,w.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Files`})]}),(0,w.jsxs)(`div`,{className:`p-3`,children:[(0,w.jsxs)(`div`,{className:`font-mono text-xs`,children:[(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,d]}),` `,(0,w.jsxs)(`span`,{className:`text-destructive`,children:[`-`,f]})]}),(0,w.jsx)(`div`,{className:`mt-1 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Lines`})]})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,w.jsx)(h,{className:`h-3.5 w-3.5`}),new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.authoredAt))]}),e.parents.length>1&&(0,w.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 text-[11px] text-violet-400`,children:[(0,w.jsx)(v,{className:`h-3.5 w-3.5`}),`Merge of `,e.parents.length,` parents`]}),p&&(0,w.jsx)(`p`,{className:`mt-4 whitespace-pre-wrap rounded-lg border border-border/60 bg-background/45 px-3 py-2.5 text-[11px] leading-5 text-muted-foreground`,children:p}),e.refs.length>0&&(0,w.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,children:e.refs.map(e=>(0,w.jsx)(`span`,{className:x(`rounded-md border px-1.5 py-0.5 text-[9px]`,M(e)),children:e.replace(/^tag: /,``)},e))})]}),(0,w.jsxs)(`div`,{className:`ws-commit-files min-h-0 min-w-0 flex-1 overflow-y-auto p-4 sm:p-5`,children:[(0,w.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.15em] text-muted-foreground`,children:`Changed files`}),n?(0,w.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,w.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}),`Loading changes…`]}):t?.error?(0,w.jsx)(`div`,{className:`py-5 text-xs text-destructive`,children:t.error}):(0,w.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[c.map(e=>(0,w.jsxs)(`button`,{type:`button`,onClick:t=>r(e,t.currentTarget),className:`group w-full rounded-lg border border-transparent px-2 py-2 text-left transition-colors hover:border-primary/30 hover:bg-primary/[0.055]`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1`,title:e.path,children:[(0,w.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.path.split(`/`).at(-1)}),(0,w.jsx)(`span`,{className:`block truncate text-[10px] text-muted-foreground`,children:e.path})]}),(0,w.jsx)(u,{className:`h-3 w-3 shrink-0 text-muted-foreground opacity-0 transition-all group-hover:translate-x-0.5 group-hover:opacity-100`})]}),(0,w.jsxs)(`div`,{className:`mt-1 pl-5 font-mono text-[10px]`,children:[(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,e.added]}),(0,w.jsxs)(`span`,{className:`ml-2 text-destructive`,children:[`-`,e.deleted]})]})]},e.path)),c.length===0&&(0,w.jsx)(`div`,{className:`py-5 text-xs text-muted-foreground`,children:`No file changes reported.`})]})]})]})}function N(){let{client:e}=oe(),r=n(e=>e.wsConnected),i=t(e=>e.files),[a,c]=(0,C.useState)(null),[l,h]=(0,C.useState)(null),[g,_]=(0,C.useState)(null),[T,O]=(0,C.useState)(``),[N,P]=(0,C.useState)(``),[F,I]=(0,C.useState)(!0),[L,R]=(0,C.useState)(!1),[z,B]=(0,C.useState)(null),[V,H]=(0,C.useState)(!1),[fe,U]=(0,C.useState)(!1),W=(0,C.useRef)(null),G=(0,C.useRef)(null),K=(0,C.useRef)(null);W.current=g;let q=(0,C.useCallback)((t,n=0)=>{e&&r&&(I(!0),e.getGitHistory({...t?{ref:t}:{},limit:160,skip:n}),e.getGitChanges())},[e,r]);(0,C.useEffect)(()=>{if(!e)return;let t=e.on(`git.history`,e=>{c(t=>e.payload.skip>0&&t?{...e.payload,commits:[...t.commits,...e.payload.commits],refs:t.refs}:e.payload),I(!1);let t=e.payload.commits[0]?.hash??null;_(n=>e.payload.skip>0||n&&e.payload.commits.some(e=>e.hash===n)?n:t)}),n=e.on(`git.commit_detail`,e=>{e.payload.hash===W.current&&(h(e.payload),R(!1))}),r=e.on(`git.commit_file_diff`,e=>{`${e.payload.hash}:${e.payload.path}`===G.current&&(B(e.payload),U(!1))});return q(``),()=>{t(),n(),r()}},[e,q]),(0,C.useEffect)(()=>{g&&e&&(h(null),R(!0),e.getGitCommitDetail(g))},[e,g]);let J=(0,C.useMemo)(()=>{let e=N.trim().toLowerCase();return e?(a?.commits??[]).filter(t=>`${t.subject} ${t.author} ${t.email} ${t.hash} ${t.refs.join(` `)}`.toLowerCase().includes(e)):a?.commits??[]},[a?.commits,N]),Y=(0,C.useMemo)(()=>ce(J),[J]),X=22+Y.laneCount*D,pe=a?.commits.find(e=>e.hash===g)??null,Z=(0,C.useMemo)(()=>{let e=a?.commits??[];return{commits:e.length,contributors:new Set(e.map(e=>e.email||e.author)).size,merges:e.filter(e=>e.parents.length>1).length,branches:(a?.refs??[]).filter(e=>e.kind!==`tag`).length}},[a]),Q=e=>{O(e),_(null),h(null),q(e)},$=e=>{if(J.length===0)return;let t=Math.max(0,J.findIndex(e=>e.hash===g));_(J[Math.max(0,Math.min(J.length-1,t+e))]?.hash??null)};return(0,w.jsxs)(`div`,{className:`ws-history-view relative flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[radial-gradient(circle_at_48%_-20%,hsl(var(--primary)/0.10),transparent_42%),hsl(var(--background))]`,"data-testid":`repository-history-view`,children:[(0,w.jsxs)(`div`,{className:`ws-history-browser flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,w.jsx)(ue,{refs:a?.refs??[],activeRef:T,onSelect:Q}),(0,w.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,w.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/30 px-4 py-3 backdrop-blur-xl sm:px-5`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-xl border border-primary/25 bg-primary/10 text-primary shadow-[0_0_22px_hsl(var(--primary)/0.12)]`,children:(0,w.jsx)(f,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h1`,{className:`text-base font-semibold tracking-tight`,children:`Repository history`}),(0,w.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every branch. One clear picture.`})]})]})}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(`span`,{className:`hidden rounded-full border border-border/70 bg-background/55 px-2.5 py-1 font-mono text-[10px] text-muted-foreground sm:inline-flex`,children:[(0,w.jsx)(p,{className:`mr-1.5 h-3 w-3 text-primary`}),a?.currentBranch||`—`]}),(0,w.jsxs)(`button`,{type:`button`,onClick:()=>q(T),className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-border/70 bg-background/55 px-2.5 text-xs text-muted-foreground transition-colors hover:border-primary/35 hover:text-foreground`,children:[(0,w.jsx)(d,{className:x(`h-3.5 w-3.5`,F&&`animate-spin`)}),`Refresh`]})]})]}),(0,w.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`label`,{className:`relative min-w-[220px] flex-1`,children:[(0,w.jsx)(o,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,w.jsx)(`input`,{value:N,onChange:e=>P(e.target.value),placeholder:`Search commits, authors, hashes…`,"aria-label":`Search commits, authors, hashes`,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 pl-9 pr-3 text-xs outline-none transition focus:border-primary/50 focus:ring-2 focus:ring-primary/10`})]}),(0,w.jsxs)(`label`,{className:`relative xl:hidden`,children:[(0,w.jsx)(ee,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,w.jsxs)(`select`,{"aria-label":`Filter branches`,value:T,onChange:e=>Q(e.target.value),className:`h-9 max-w-[190px] appearance-none rounded-lg border border-border/70 bg-background/60 pl-8 pr-7 text-xs outline-none`,children:[(0,w.jsx)(`option`,{value:``,children:`All branches`}),a?.refs.map(e=>(0,w.jsx)(`option`,{value:e.name,children:e.shortName},e.name))]})]})]})]}),(0,w.jsx)(`div`,{className:`grid h-10 shrink-0 grid-cols-4 divide-x divide-border/60 border-b border-border/70 bg-card/20`,children:[[`Commits`,Z.commits],[`Branches`,Z.branches],[`Contributors`,Z.contributors],[`Merges`,Z.merges]].map(([e,t])=>(0,w.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-2`,children:[(0,w.jsx)(`span`,{className:`font-mono text-xs font-semibold tabular-nums text-foreground`,children:t}),(0,w.jsx)(`span`,{className:`hidden text-[9px] font-semibold uppercase tracking-wider text-muted-foreground sm:inline`,children:e})]},e))}),i.length>0&&(0,w.jsxs)(`button`,{type:`button`,onClick:()=>te(`changes`),className:`group flex h-10 shrink-0 items-center gap-3 border-b border-border/70 bg-primary/[0.055] px-4 text-left text-xs hover:bg-primary/[0.09]`,children:[(0,w.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full border border-primary bg-background`}),(0,w.jsx)(`span`,{className:`font-medium`,children:`Working changes`}),(0,w.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:i.length}),(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:`Your next chapter starts here`}),(0,w.jsx)(u,{className:`ml-auto h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:translate-x-0.5`})]}),(0,w.jsxs)(`div`,{className:`ws-history-columns grid h-7 shrink-0 grid-cols-[minmax(0,1fr)_120px_82px_48px] items-center border-b border-border/70 bg-muted/20 px-3 text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_160px_92px_58px]`,children:[(0,w.jsx)(`span`,{className:`truncate`,style:{paddingLeft:X+10},children:`Graph / commit message`}),(0,w.jsx)(`span`,{children:`Author`}),(0,w.jsx)(`span`,{children:`Commit`}),(0,w.jsx)(`span`,{children:`When`})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:F&&!a?(0,w.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(s,{className:`h-4 w-4 animate-spin text-primary`}),`Mapping repository history…`]}):a?.error?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-sm text-destructive`,children:a.error}):J.length===0?(0,w.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(y,{className:`h-7 w-7 opacity-45`}),`No commits match this view.`]}):(0,w.jsxs)(`div`,{className:`relative min-w-[700px]`,style:{height:J.length*E},children:[(0,w.jsx)(le,{commits:J,layout:Y}),J.map((e,t)=>{let n=e.hash===g;return(0,w.jsxs)(`button`,{type:`button`,onClick:()=>_(e.hash),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`j`)&&(e.preventDefault(),$(1)),(e.key===`ArrowUp`||e.key===`k`)&&(e.preventDefault(),$(-1))},className:x(`ws-history-columns absolute left-0 grid w-full grid-cols-[minmax(0,1fr)_120px_82px_48px] items-center border-b border-border/45 pr-3 text-left transition-colors sm:grid-cols-[minmax(0,1fr)_160px_92px_58px]`,n?`bg-primary/[0.075] shadow-[inset_2px_0_hsl(var(--primary))]`:`hover:bg-muted/35`),style:{top:t*E,height:E},children:[(0,w.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,style:{paddingLeft:X+10},children:(0,w.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.refs.slice(0,2).map(e=>(0,w.jsx)(`span`,{className:x(`hidden max-w-[170px] shrink-0 truncate rounded-md border px-1.5 py-0.5 text-[9px] font-medium md:inline`,M(e)),children:e.replace(/^tag: /,``)},e)),(0,w.jsx)(`span`,{className:x(`truncate text-xs`,n?`font-semibold text-foreground`:`text-foreground/90`),children:e.subject}),e.parents.length>1&&(0,w.jsx)(v,{className:`h-3.5 w-3.5 shrink-0 text-violet-400`})]})}),(0,w.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-bold text-muted-foreground`,children:j(e.author)}),(0,w.jsx)(`span`,{className:`truncate text-[10px] text-muted-foreground`,children:e.author})]}),(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:k(e.hash)}),(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:A(e.authoredAt)})]},e.hash)})]})}),(0,w.jsxs)(`footer`,{className:`flex h-7 shrink-0 items-center border-t border-border/70 bg-card/25 px-4 text-[9px] text-muted-foreground`,children:[(0,w.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,w.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-violet-400`}),`Commit`]}),(0,w.jsxs)(`span`,{className:`ml-4 flex items-center gap-1.5`,children:[(0,w.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full border border-emerald-400`}),`Merge`]}),(0,w.jsxs)(`span`,{className:`ml-auto font-mono`,children:[J.length,` commits · topological order`]}),a?.hasMore&&!N&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>q(T,a.commits.length),disabled:F,className:`ml-3 rounded border border-border/70 px-1.5 py-0.5 font-sans text-[9px] font-semibold uppercase tracking-wider hover:border-primary/40 hover:text-primary disabled:opacity-50`,children:`Load more`}),(0,w.jsx)(m,{className:`ml-2 h-3 w-3`})]})]})]}),(0,w.jsx)(de,{commit:pe,detail:l,loading:L,onOpenFile:(t,n)=>{e&&g&&(K.current=n,G.current=`${g}:${t.path}`,B(null),U(!0),H(!0),e.getGitCommitFileDiff(g,t.path,t.previousPath))}}),(0,w.jsx)(ae,{open:V,onOpenChange:H,children:(0,w.jsxs)(ne,{className:`h-[min(86dvh,860px)] max-w-[min(94vw,1180px)] grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden p-0 sm:p-0`,onCloseAutoFocus:e=>{K.current?.isConnected&&(e.preventDefault(),K.current.focus())},children:[(0,w.jsx)(S,{className:`border-b border-border/70 bg-card/80 px-5 py-4 pr-12`,children:(0,w.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,w.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/25 bg-primary/10 text-primary`,children:(0,w.jsx)(b,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(re,{className:`truncate font-mono text-sm`,children:z?.path??`Commit file diff`}),(0,w.jsxs)(ie,{className:`mt-1 flex items-center gap-2 text-[11px]`,children:[(0,w.jsx)(`span`,{className:`font-mono`,children:z?k(z.hash):`—`}),z?.previousPath&&z.previousPath!==z.path&&(0,w.jsxs)(`span`,{className:`truncate`,children:[`renamed from `,z.previousPath]})]})]})]})}),(0,w.jsx)(`div`,{className:`min-h-0 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,children:(0,w.jsx)(`div`,{className:`flex h-full min-h-0 overflow-hidden rounded-lg border border-border/70 bg-background/70`,children:fe||!z?(0,w.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(s,{className:`h-4 w-4 animate-spin text-primary`}),` Loading revision diff…`]}):z.error?(0,w.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-destructive`,children:z.error}):z.binary?(0,w.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Binary files cannot be displayed as text.`}):z.tooLarge?(0,w.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`This revision is too large for the inline diff viewer.`}):(0,w.jsx)(se,{oldText:z.oldText??``,newText:z.newText??``,caption:z.path,fill:!0})})})]})})]})}export{N as RepositoryHistoryView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Ia as r,It as i,La as a,Pa as o,ra as s,wo as c}from"./vendor-BfBvt432.js";import"./i18n-t7rIS4DB.js";import{t as l}from"./utils-B21Devim.js";import{t as u}from"./button-UuKTnoM-.js";import{t as d}from"./input-DMnC2O7-.js";import{l as f}from"./index-B4ELbNoz.js";var p=e(t(),1),m=n(),h=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],g=[`unspecified`,`low`,`medium`,`high`,`critical`],_={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-warning/15 text-warning`,submitted:`bg-success/15 text-success`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function v(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function y(){return`webui-${globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function b({onStartSdd:e}={}){let{t}=c(),[n,b]=(0,p.useState)(null),[x,S]=(0,p.useState)([]),[C,w]=(0,p.useState)(!0),[T,E]=(0,p.useState)(null),[D,O]=(0,p.useState)(``),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(`unspecified`),[N,P]=(0,p.useState)(`unspecified`),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(null),[z,B]=(0,p.useState)(null),[V,H]=(0,p.useState)(null),[U,W]=(0,p.useState)(null),G=(0,p.useRef)(null),K=(0,p.useRef)(null),q=(0,p.useCallback)(()=>{K.current=null},[]),J=(0,p.useCallback)((e,t)=>{navigator.clipboard?.writeText(t),W(e),G.current!==null&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=null,W(null)},1500)},[]);(0,p.useEffect)(()=>()=>{G.current!==null&&clearTimeout(G.current)},[]);let Y=(0,p.useCallback)(async()=>{w(!0),E(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let t=await e.json();b(e=>(e!==null&&e!==t.projectId&&q(),t.projectId)),S(t.intakes)}catch(e){E(e instanceof Error?e.message:String(e))}finally{w(!1)}},[q]);(0,p.useEffect)(()=>{Y()},[Y]);let X=(0,p.useCallback)(async()=>{let e=D.trim();if(!e){R(`Describe the request first — it is preserved verbatim.`);return}if(!n){R(`No project identity available yet.`);return}I(!0),R(null),B(null);let t=K.current??y();K.current=t;try{let r=await fetch(`/api/projects/${encodeURIComponent(n)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:n,requestedBy:`webui`,idempotencyKey:t,originalRequest:e,...k.trim()?{title:k.trim()}:{},...j===`unspecified`?{}:{requestType:j},...N===`unspecified`?{}:{priority:N}})}),i=await r.json().catch(()=>null);if(!r.ok||!i?.record)throw Error(i?.error?.message??`Create failed (HTTP ${r.status})`);let a=await fetch(`/api/requirement-intakes/${i.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${a.status})`)}K.current=null,B(`Intake recorded and submitted (${i.record.id}).`),O(``),A(``),M(`unspecified`),P(`unspecified`),await Y()}catch(e){R(e instanceof Error?e.message:String(e))}finally{I(!1)}},[D,k,j,N,n,Y]);return(0,m.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,m.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,m.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:t(`activity:reqIntake.requirementsIntake`)}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:t(`activity:reqIntake.collectAndPreserveSoftwareDevelopmentRequests`)})]}),(0,m.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[T?(0,m.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[T,(0,m.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void Y(),children:t(`activity:reqIntake.retry`)})]}):null,(0,m.jsxs)(`section`,{"aria-label":t(`activity:reqIntake.fileANewIntake`),className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,m.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:reqIntake.fileANewRequest`)}),(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[t(`activity:reqIntake.requestText`),` `,(0,m.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,m.jsx)(`textarea`,{id:`intake-request`,value:D,onChange:e=>{q(),O(e.target.value)},placeholder:t(`activity:reqIntake.describeTheFeatureBugFixRefactorOrChange`),rows:4,className:l(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),/\[VIBE\]/i.test(D)?(0,m.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary`,children:[(0,m.jsx)(`span`,{children:`🌊`}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`strong`,{children:`VIBE Protocol Detected:`}),` Three-Stage Verification (Spec-Synthesizer → Coder → Auditor) is active.`]})]}):null,(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:t(`activity:reqIntake.storedVerbatimAsTheRecordApos`)})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.titleOptional`)}),(0,m.jsx)(d,{id:`intake-title`,value:k,onChange:e=>{q(),A(e.target.value)},placeholder:t(`activity:reqIntake.shortDisplayTitle`)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.type`)}),(0,m.jsx)(`select`,{id:`intake-type`,value:j,onChange:e=>{q(),M(e.target.value)},className:l(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:h.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.priority`)}),(0,m.jsx)(`select`,{id:`intake-priority`,value:N,onChange:e=>{q(),P(e.target.value)},className:l(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:g.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))})]})]}),L?(0,m.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:L}):null,z?(0,m.jsx)(`div`,{role:`status`,className:`rounded-md border border-success/30 bg-success/10 px-3 py-2 text-xs text-success`,children:z}):null,(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{variant:`secondary`,size:`sm`,disabled:F,onClick:()=>{O(``),R(null),B(null)},children:t(`activity:reqIntake.clear`)}),(0,m.jsx)(u,{size:`sm`,disabled:F||!D.trim(),onClick:()=>void X(),children:F?`Filing…`:`File + submit`})]})]})]}),(0,m.jsxs)(`section`,{"aria-label":t(`activity:reqIntake.intakeRecords`),className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:reqIntake.records`)}),(0,m.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[x.length,` total`]})]}),C?(0,m.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:t(`activity:reqIntake.loading`)}):x.length===0?(0,m.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:t(`activity:reqIntake.noIntakeRecordsYetFileThe`)}):(0,m.jsx)(`ul`,{className:`space-y-2`,children:x.map(n=>{let c=V===n.id,d=U===n.id;return(0,m.jsxs)(`li`,{className:`overflow-hidden rounded-md border border-border/70 bg-card/60 transition-colors`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>H(c?null:n.id),className:`flex w-full items-start justify-between gap-2 p-3 text-left transition-colors hover:bg-accent/40`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,m.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:c?(0,m.jsx)(r,{size:14}):(0,m.jsx)(o,{size:14})}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:n.title,children:n.title}),(0,m.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:n.id})]})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[n.isVibeMode?(0,m.jsx)(f,{variant:`outline`,className:`border-primary/40 bg-primary/10 text-[10px] text-primary`,children:`🌊 VIBE`}):null,(0,m.jsx)(f,{variant:`secondary`,className:`text-[10px]`,children:n.requestType}),(0,m.jsx)(f,{className:l(`text-[10px]`,_[n.status]??`bg-muted text-muted-foreground`),children:n.status})]})]}),c?(0,m.jsxs)(`div`,{className:`space-y-3 border-t border-border/40 bg-muted/20 px-3 py-3 text-xs`,children:[n.originalRequest?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] font-medium text-muted-foreground`,children:[(0,m.jsx)(`span`,{children:t(`activity:reqIntake.originalRequest`)}),(0,m.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-5 gap-1 px-1.5 text-[10px]`,onClick:()=>J(n.id,n.originalRequest),children:[d?(0,m.jsx)(a,{size:10,className:`text-success`}):(0,m.jsx)(s,{size:10}),(0,m.jsx)(`span`,{children:t(d?`activity:reqIntake.copied`:`activity:reqIntake.copyRequest`)})]})]}),(0,m.jsx)(`div`,{className:`max-h-48 overflow-y-auto whitespace-pre-wrap rounded border border-border/60 bg-background p-2 font-mono text-xs text-foreground`,children:n.originalRequest})]}):null,n.businessGoal?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`span`,{className:`font-semibold text-muted-foreground`,children:[`Business Goal:`,` `]}),(0,m.jsx)(`span`,{className:`text-foreground`,children:n.businessGoal})]}):null,n.expectedOutcome?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`span`,{className:`font-semibold text-muted-foreground`,children:[`Expected Outcome:`,` `]}),(0,m.jsx)(`span`,{className:`text-foreground`,children:n.expectedOutcome})]}):null,n.targetUsers&&n.targetUsers.length>0?(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-semibold text-muted-foreground`,children:`Target Users:`}),n.targetUsers.map((e,t)=>(0,m.jsx)(f,{variant:`outline`,className:`text-[10px]`,children:e},t))]}):null,n.constraints&&n.constraints.length>0?(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-semibold text-muted-foreground`,children:`Constraints:`}),n.constraints.map((e,t)=>(0,m.jsx)(f,{variant:`outline`,className:`border-destructive/30 text-[10px] text-destructive/80`,children:e},t))]}):null]}):null,(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-border/40 px-3 py-2 text-[11px] text-muted-foreground`,children:[(0,m.jsxs)(`div`,{children:[n.priority,` · updated `,v(n.updatedAt)]}),e?(0,m.jsxs)(u,{size:`sm`,variant:`outline`,className:`h-6 gap-1 px-2 text-[11px]`,onClick:()=>e(n),children:[(0,m.jsx)(i,{size:11}),(0,m.jsx)(`span`,{children:t(`activity:reqIntake.startSddSpec`)})]}):null]})]},n.id)})})]})]})]})}export{b as RequirementIntakeView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Ia as r,It as i,La as a,Pa as o,ra as s,wo as c}from"./vendor-BfBvt432.js";import"./i18n-CzTjKT4L.js";import{t as l}from"./utils-B21Devim.js";import{t as u}from"./button-UuKTnoM-.js";import{t as d}from"./input-DMnC2O7-.js";import{l as f}from"./index-Ci22AODp.js";var p=e(t(),1),m=n(),h=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],g=[`unspecified`,`low`,`medium`,`high`,`critical`],_={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-warning/15 text-warning`,submitted:`bg-success/15 text-success`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function v(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function y(){return`webui-${globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`}function b({onStartSdd:e}={}){let{t}=c(),[n,b]=(0,p.useState)(null),[x,S]=(0,p.useState)([]),[C,w]=(0,p.useState)(!0),[T,E]=(0,p.useState)(null),[D,O]=(0,p.useState)(``),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(`unspecified`),[N,P]=(0,p.useState)(`unspecified`),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(null),[z,B]=(0,p.useState)(null),[V,H]=(0,p.useState)(null),[U,W]=(0,p.useState)(null),G=(0,p.useRef)(null),K=(0,p.useRef)(null),q=(0,p.useCallback)(()=>{K.current=null},[]),J=(0,p.useCallback)((e,t)=>{navigator.clipboard?.writeText(t),W(e),G.current!==null&&clearTimeout(G.current),G.current=setTimeout(()=>{G.current=null,W(null)},1500)},[]);(0,p.useEffect)(()=>()=>{G.current!==null&&clearTimeout(G.current)},[]);let Y=(0,p.useCallback)(async()=>{w(!0),E(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let t=await e.json();b(e=>(e!==null&&e!==t.projectId&&q(),t.projectId)),S(t.intakes)}catch(e){E(e instanceof Error?e.message:String(e))}finally{w(!1)}},[q]);(0,p.useEffect)(()=>{Y()},[Y]);let X=(0,p.useCallback)(async()=>{let e=D.trim();if(!e){R(`Describe the request first — it is preserved verbatim.`);return}if(!n){R(`No project identity available yet.`);return}I(!0),R(null),B(null);let t=K.current??y();K.current=t;try{let r=await fetch(`/api/projects/${encodeURIComponent(n)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectId:n,requestedBy:`webui`,idempotencyKey:t,originalRequest:e,...k.trim()?{title:k.trim()}:{},...j===`unspecified`?{}:{requestType:j},...N===`unspecified`?{}:{priority:N}})}),i=await r.json().catch(()=>null);if(!r.ok||!i?.record)throw Error(i?.error?.message??`Create failed (HTTP ${r.status})`);let a=await fetch(`/api/requirement-intakes/${i.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${a.status})`)}K.current=null,B(`Intake recorded and submitted (${i.record.id}).`),O(``),A(``),M(`unspecified`),P(`unspecified`),await Y()}catch(e){R(e instanceof Error?e.message:String(e))}finally{I(!1)}},[D,k,j,N,n,Y]);return(0,m.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,m.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,m.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:t(`activity:reqIntake.requirementsIntake`)}),(0,m.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:t(`activity:reqIntake.collectAndPreserveSoftwareDevelopmentRequests`)})]}),(0,m.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[T?(0,m.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[T,(0,m.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void Y(),children:t(`activity:reqIntake.retry`)})]}):null,(0,m.jsxs)(`section`,{"aria-label":t(`activity:reqIntake.fileANewIntake`),className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,m.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:reqIntake.fileANewRequest`)}),(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[t(`activity:reqIntake.requestText`),` `,(0,m.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,m.jsx)(`textarea`,{id:`intake-request`,value:D,onChange:e=>{q(),O(e.target.value)},placeholder:t(`activity:reqIntake.describeTheFeatureBugFixRefactorOrChange`),rows:4,className:l(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),/\[VIBE\]/i.test(D)?(0,m.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 rounded bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary`,children:[(0,m.jsx)(`span`,{children:`🌊`}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`strong`,{children:`VIBE Protocol Detected:`}),` Three-Stage Verification (Spec-Synthesizer → Coder → Auditor) is active.`]})]}):null,(0,m.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:t(`activity:reqIntake.storedVerbatimAsTheRecordApos`)})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.titleOptional`)}),(0,m.jsx)(d,{id:`intake-title`,value:k,onChange:e=>{q(),A(e.target.value)},placeholder:t(`activity:reqIntake.shortDisplayTitle`)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.type`)}),(0,m.jsx)(`select`,{id:`intake-type`,value:j,onChange:e=>{q(),M(e.target.value)},className:l(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:h.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:t(`activity:reqIntake.priority`)}),(0,m.jsx)(`select`,{id:`intake-priority`,value:N,onChange:e=>{q(),P(e.target.value)},className:l(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:g.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))})]})]}),L?(0,m.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:L}):null,z?(0,m.jsx)(`div`,{role:`status`,className:`rounded-md border border-success/30 bg-success/10 px-3 py-2 text-xs text-success`,children:z}):null,(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,m.jsx)(u,{variant:`secondary`,size:`sm`,disabled:F,onClick:()=>{O(``),R(null),B(null)},children:t(`activity:reqIntake.clear`)}),(0,m.jsx)(u,{size:`sm`,disabled:F||!D.trim(),onClick:()=>void X(),children:F?`Filing…`:`File + submit`})]})]})]}),(0,m.jsxs)(`section`,{"aria-label":t(`activity:reqIntake.intakeRecords`),className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:reqIntake.records`)}),(0,m.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[x.length,` total`]})]}),C?(0,m.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:t(`activity:reqIntake.loading`)}):x.length===0?(0,m.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:t(`activity:reqIntake.noIntakeRecordsYetFileThe`)}):(0,m.jsx)(`ul`,{className:`space-y-2`,children:x.map(n=>{let c=V===n.id,d=U===n.id;return(0,m.jsxs)(`li`,{className:`overflow-hidden rounded-md border border-border/70 bg-card/60 transition-colors`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>H(c?null:n.id),className:`flex w-full items-start justify-between gap-2 p-3 text-left transition-colors hover:bg-accent/40`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,m.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,children:c?(0,m.jsx)(r,{size:14}):(0,m.jsx)(o,{size:14})}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:n.title,children:n.title}),(0,m.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:n.id})]})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[n.isVibeMode?(0,m.jsx)(f,{variant:`outline`,className:`border-primary/40 bg-primary/10 text-[10px] text-primary`,children:`🌊 VIBE`}):null,(0,m.jsx)(f,{variant:`secondary`,className:`text-[10px]`,children:n.requestType}),(0,m.jsx)(f,{className:l(`text-[10px]`,_[n.status]??`bg-muted text-muted-foreground`),children:n.status})]})]}),c?(0,m.jsxs)(`div`,{className:`space-y-3 border-t border-border/40 bg-muted/20 px-3 py-3 text-xs`,children:[n.originalRequest?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] font-medium text-muted-foreground`,children:[(0,m.jsx)(`span`,{children:t(`activity:reqIntake.originalRequest`)}),(0,m.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-5 gap-1 px-1.5 text-[10px]`,onClick:()=>J(n.id,n.originalRequest),children:[d?(0,m.jsx)(a,{size:10,className:`text-success`}):(0,m.jsx)(s,{size:10}),(0,m.jsx)(`span`,{children:t(d?`activity:reqIntake.copied`:`activity:reqIntake.copyRequest`)})]})]}),(0,m.jsx)(`div`,{className:`max-h-48 overflow-y-auto whitespace-pre-wrap rounded border border-border/60 bg-background p-2 font-mono text-xs text-foreground`,children:n.originalRequest})]}):null,n.businessGoal?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`span`,{className:`font-semibold text-muted-foreground`,children:[`Business Goal:`,` `]}),(0,m.jsx)(`span`,{className:`text-foreground`,children:n.businessGoal})]}):null,n.expectedOutcome?(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`span`,{className:`font-semibold text-muted-foreground`,children:[`Expected Outcome:`,` `]}),(0,m.jsx)(`span`,{className:`text-foreground`,children:n.expectedOutcome})]}):null,n.targetUsers&&n.targetUsers.length>0?(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-semibold text-muted-foreground`,children:`Target Users:`}),n.targetUsers.map((e,t)=>(0,m.jsx)(f,{variant:`outline`,className:`text-[10px]`,children:e},t))]}):null,n.constraints&&n.constraints.length>0?(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-semibold text-muted-foreground`,children:`Constraints:`}),n.constraints.map((e,t)=>(0,m.jsx)(f,{variant:`outline`,className:`border-destructive/30 text-[10px] text-destructive/80`,children:e},t))]}):null]}):null,(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-border/40 px-3 py-2 text-[11px] text-muted-foreground`,children:[(0,m.jsxs)(`div`,{children:[n.priority,` · updated `,v(n.updatedAt)]}),e?(0,m.jsxs)(u,{size:`sm`,variant:`outline`,className:`h-6 gap-1 px-2 text-[11px]`,onClick:()=>e(n),children:[(0,m.jsx)(i,{size:11}),(0,m.jsx)(`span`,{children:t(`activity:reqIntake.startSddSpec`)})]}):null]})]},n.id)})})]})]})]})}export{b as RequirementIntakeView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryManager-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Br as r,Vt as i,ur as a,wo as o}from"./vendor-BfBvt432.js";import"./i18n-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryManager-DQlnpch1.js","assets/rolldown-runtime-hePW80VL.js","assets/config-store-Cb4iyhGv.js","assets/react-core-wiHys0m2.js","assets/vendor-BfBvt432.js","assets/xyflow-BqDBClm9.js","assets/xyflow-DLioOiRN.css","assets/markdown-CXRzjX3p.js","assets/vendor-jL-bRT8f.css","assets/i18n-CzTjKT4L.js","assets/chat-B50ssTLh.js","assets/commandPalette-BovBiPec.js","assets/common-PC103akE.js","assets/setup-qooXjj4V.js","assets/toasts-Buww129h.js","assets/vite-preload-BZ1Pz5am.js","assets/utils-B21Devim.js","assets/ui-store-DI0iusYZ.js","assets/fonts-C303yVU_.js","assets/stores-Svlibwo5.js","assets/mailbox-store-DyOOYbni.js","assets/chat-store-BMwP_sS0.js","assets/codemap-activity-store-WjfEZe4_.js","assets/dialog-BDUaV5gY.js","assets/button-UuKTnoM-.js","assets/input-DMnC2O7-.js","assets/index-Ci22AODp.js","assets/view-navigation-Cvrp_uJm.js","assets/index-DfU9PQg8.css","assets/roster-ws-D-DCMdrg.js","assets/shared-CLNEiW00.js","assets/MemoryDrawer-4lDXuHCi.js","assets/AudienceMemoryPanel-BghMZicW.js","assets/vector-memory-panel-DnX-ODHC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Br as r,Vt as i,ur as a,wo as o}from"./vendor-BfBvt432.js";import"./i18n-CzTjKT4L.js";import{t as s}from"./vite-preload-BZ1Pz5am.js";import{t as c}from"./utils-B21Devim.js";import{F as l,M as u,N as d,P as f}from"./index-Ci22AODp.js";var p=e(t(),1),m=n(),h=(0,p.lazy)(()=>s(()=>import(`./MemoryManager-DQlnpch1.js`).then(e=>({default:e.MemoryManager})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),g=(0,p.lazy)(()=>s(()=>import(`./AudienceMemoryPanel-BghMZicW.js`).then(e=>({default:e.AudienceMemoryPanel})),__vite__mapDeps([32,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,23,24,25,26,2,17,18,27,20,19,21,22,28,30]))),_=(0,p.lazy)(()=>s(()=>import(`./vector-memory-panel-DnX-ODHC.js`).then(e=>({default:e.VectorMemoryPanel})),__vite__mapDeps([33,1,3,4,5,6,7,8,23,16,24])));function v({label:e}){return(0,m.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background text-xs text-muted-foreground`,"aria-busy":`true`,children:(0,m.jsxs)(`span`,{className:`font-mono uppercase tracking-wide`,children:[e,`…`]})})}var y=[{value:`all`,label:`activity:memoryManager.tabAllMemories`,hint:`activity:memoryManager.tabAllMemoriesHint`,Icon:r},{value:`audience`,label:`activity:memoryManager.tabAudience`,hint:`activity:memoryManager.tabAudienceHint`,Icon:i},{value:`vector`,label:`activity:memoryManager.tabVectorMemory`,hint:`activity:memoryManager.tabVectorMemoryHint`,Icon:a}];function b({defaultValue:e=`all`}={}){let{t}=o();return(0,m.jsxs)(u,{defaultValue:e,className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,children:[(0,m.jsx)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-border/70 bg-card/55 px-4 py-2 sm:px-5`,role:`presentation`,children:(0,m.jsx)(f,{"aria-label":t(`activity:memoryManager.lensesAria`),className:`h-9 bg-muted/40 p-1 shadow-none`,children:y.map(({value:e,label:n,hint:r,Icon:i})=>(0,m.jsxs)(l,{value:e,className:c(`h-7 gap-2 px-3 text-[11px] font-semibold uppercase tracking-wide`,`data-[state=active]:bg-background data-[state=active]:text-foreground`,`data-[state=active]:shadow-[0_0_0_1px_hsl(var(--border)/0.7)]`),children:[(0,m.jsx)(i,{className:`size-3.5`}),(0,m.jsx)(`span`,{children:t(n)}),(0,m.jsx)(`span`,{className:`hidden font-mono text-[9px] font-normal normal-case text-muted-foreground sm:inline`,children:t(r)})]},e))})}),(0,m.jsx)(d,{value:`all`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingSage`)}),children:(0,m.jsx)(h,{})})}),(0,m.jsx)(d,{value:`audience`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingAudience`)}),children:(0,m.jsx)(g,{})})}),(0,m.jsx)(d,{value:`vector`,className:`mt-0 flex-1 overflow-y-auto px-4 pb-6 pt-4 ring-offset-0 focus-visible:ring-0 sm:px-5`,children:(0,m.jsx)(p.Suspense,{fallback:(0,m.jsx)(v,{label:t(`activity:memoryManager.loadingVectorMemory`)}),children:(0,m.jsx)(_,{})})})]})}export{b as SageTabs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Da as r,Fr as i,In as a,Jn as o,La as s,Mt as c,Wa as l,Yt as u,bn as d,di as f,dn as p,no as m,qr as h,si as g,wo as _}from"./vendor-BfBvt432.js";import"./i18n-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-core-wiHys0m2.js";import{Da as r,Fr as i,In as a,Jn as o,La as s,Mt as c,Wa as l,Yt as u,bn as d,di as f,dn as p,no as m,qr as h,si as g,wo as _}from"./vendor-BfBvt432.js";import"./i18n-CzTjKT4L.js";import{a as v,c as y,h as b,n as x,o as S,p as C,r as w,t as T,u as E}from"./xyflow-BqDBClm9.js";import{t as D}from"./utils-B21Devim.js";var O=e(t(),1),k=n();function A({pct:e}){let{t}=_(),n=(0,O.useId)(),r=2*Math.PI*26,i=r-Math.max(0,Math.min(100,e))/100*r;return(0,k.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,role:`img`,"aria-label":t(`activity:progressring.progress`),children:[(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(var(--muted))`,strokeWidth:`6`}),(0,k.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#${n})`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:r,strokeDashoffset:i,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,k.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--primary))`}),(0,k.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--info))`})]})})]}),(0,k.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}var j={pending:{labelKey:`activity:sdd.status.pending`,icon:r,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`},queued:{labelKey:`activity:sdd.status.queued`,icon:r,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--primary))`},in_progress:{labelKey:`activity:sdd.status.in_progress`,icon:i,spin:!0,text:`text-warning`,ring:`border-warning/45 bg-warning/10`,dot:`bg-warning`,hex:`hsl(var(--warning))`},blocked:{labelKey:`activity:sdd.status.blocked`,icon:r,text:`text-destructive`,ring:`border-destructive/30 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},review:{labelKey:`activity:sdd.status.review`,icon:r,text:`text-primary`,ring:`border-primary/35 bg-primary/10`,dot:`bg-primary`,hex:`hsl(var(--info))`},failed:{labelKey:`activity:sdd.status.failed`,icon:c,text:`text-destructive`,ring:`border-destructive/45 bg-destructive/10`,dot:`bg-destructive`,hex:`hsl(var(--destructive))`},completed:{labelKey:`activity:sdd.status.completed`,icon:s,text:`text-success`,ring:`border-success/35 bg-success/10`,dot:`bg-success`,hex:`hsl(var(--success))`},cancelled:{labelKey:`activity:sdd.status.cancelled`,icon:m,text:`text-muted-foreground`,ring:`border-border/70 bg-muted/45`,dot:`bg-muted-foreground`,hex:`hsl(var(--muted-foreground))`}};function M(e){return j[e]??j.pending}var N={critical:{text:`text-destructive`,chip:`bg-destructive/10 text-destructive`},high:{text:`text-warning`,chip:`bg-warning/12 text-warning`},medium:{text:`text-primary`,chip:`bg-primary/10 text-primary`},low:{text:`text-muted-foreground`,chip:`bg-muted text-muted-foreground`}};function P(e){return N[e]??N.medium}var F={running:`border-primary/35 bg-primary/10 text-primary`,paused:`border-warning/35 bg-warning/10 text-warning`,stopped:`border-border/70 bg-muted text-muted-foreground`,completed:`border-success/35 bg-success/10 text-success`,failed:`border-destructive/35 bg-destructive/10 text-destructive`,deadlocked:`border-destructive/35 bg-destructive/10 text-destructive`,idle:`border-border bg-muted text-muted-foreground`},I=[`bg-warning`,`bg-primary`,`bg-success`,`bg-destructive`,`bg-secondary`,`bg-muted-foreground`,`bg-accent`],L={started:{icon:o,color:`text-warning`},completed:{icon:s,color:`text-success`},failed:{icon:c,color:`text-destructive`},retrying:{icon:a,color:`text-warning`},wave:{icon:h,color:`text-primary`},deadlock:{icon:u,color:`text-destructive`},verification_failed:{icon:d,color:`text-destructive`},conflict:{icon:g,color:`text-warning`},split:{icon:p,color:`text-primary`},supervisor:{icon:l,color:`text-primary`}};function R(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function z(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 B(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 V=300,H=128,U=240,W={pending:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`},queued:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},in_progress:{ring:`border-warning/45`,chip:`bg-warning/12 text-warning`,dot:`bg-warning`},blocked:{ring:`border-destructive/30`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},review:{ring:`border-primary/35`,chip:`bg-primary/10 text-primary`,dot:`bg-primary`},failed:{ring:`border-destructive/45`,chip:`bg-destructive/10 text-destructive`,dot:`bg-destructive`},completed:{ring:`border-success/35`,chip:`bg-success/12 text-success`,dot:`bg-success`},cancelled:{ring:`border-border/70`,chip:`bg-muted text-muted-foreground`,dot:`bg-muted-foreground`}};function G({data:e}){let t=e.task,{t:n}=_(),o=W[t.displayStatus],l=t.displayStatus===`in_progress`,u=t.displayStatus===`completed`?s:t.displayStatus===`failed`?c:l?i:r;return(0,k.jsxs)(`div`,{className:D(`sdd-node-enter group relative rounded-lg border bg-card/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,o.ring,l&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`hover:brightness-125`),style:{width:U,animationDelay:`${Math.min(e.index*45,600)}ms`},children:[e.onTaskClick&&(0,k.jsx)(`button`,{type:`button`,"aria-label":n(`activity:sdd.openTask`,{title:t.title,defaultValue:`Open task: ${t.title}`}),className:`absolute inset-0 z-10 cursor-pointer rounded-lg`,onClick:()=>e.onTaskClick?.(t.id)}),(0,k.jsx)(v,{type:`target`,position:b.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsx)(v,{type:`source`,position:b.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-border`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,k.jsx)(u,{className:D(`h-3.5 w-3.5`,l&&`animate-spin`,o.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,k.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:t.shortId}),(0,k.jsx)(`span`,{className:D(`font-mono text-[10px] font-bold uppercase`,P(t.priority).text),children:t.priority[0]}),(0,k.jsx)(`span`,{className:D(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,o.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,k.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,k.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`span`,{className:D(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,l?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:R(t.agentName)}),(0,k.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-muted-foreground`,children:t.agentName})]}),t.retries?(0,k.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,k.jsx)(a,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,k.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-muted-foreground`,title:t.worktreeBranch,children:[(0,k.jsx)(f,{className:`h-2.5 w-2.5`}),(0,k.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function K({data:e}){return(0,k.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase text-muted-foreground`,children:e.label})}var q={task:G,colLabel:K};function J(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*V,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*V,y:o*H},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:M(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function Y({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=C(),{nodes:i,edges:a}=(0,O.useMemo)(()=>J(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,k.jsxs)(E,{nodes:i,edges:a,nodeTypes:q,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,k.jsx)(T,{variant:x.Dots,gap:22,size:1,color:`hsl(var(--border))`}),(0,k.jsx)(w,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,k.jsx)(S,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`hsl(var(--background) / 0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?M(t).hex:`hsl(var(--muted-foreground))`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-border/70 bg-card`})]})}function X({tasks:e,columns:t,onTaskClick:n}){return(0,k.jsx)(y,{children:(0,k.jsx)(Y,{tasks:e,columns:t,onTaskClick:n})})}export{R as a,P as c,F as i,M as l,I as n,B as o,L as r,z as s,X as t,A as u};
|