@wrongstack/webui 0.306.4 → 0.307.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/AgentRosterView-Bb5m_XjZ.js +9 -0
- package/dist/assets/AnalyticsDashboard-lqPCAo9u.js +1 -0
- package/dist/assets/AudienceMemoryPanel-putWTq5V.js +3 -0
- package/dist/assets/{ChangesView-DplR2Twb.js → ChangesView-Cw-qvOLA.js} +1 -1
- package/dist/assets/ChronicleDashboard-DQdMkTLQ.js +1 -0
- package/dist/assets/CodeEditor-BAv2f4se.js +2 -0
- package/dist/assets/CodeMap-BB1WETLd.js +1 -0
- package/dist/assets/ConfirmModal-LBZaZgsG.js +1 -0
- package/dist/assets/CronJobsPanel-DE5CVuSW.js +1 -0
- package/dist/assets/{DeadCodeScanPanel-Dp6vW6pV.js → DeadCodeScanPanel-nlQ9nL3Y.js} +1 -1
- package/dist/assets/{DebugDashboard-d4ETqxOe.js → DebugDashboard-CgRH9SvC.js} +1 -1
- package/dist/assets/{DesignGalleryView-3jRTmgzx.js → DesignGalleryView-Uwo3JXyu.js} +1 -1
- package/dist/assets/GoalView-Cc4B-0Qd.js +1 -0
- package/dist/assets/KanbanView-CK4bvZfi.js +3 -0
- package/dist/assets/MailboxDetailView-CGwtSBcH.js +1 -0
- package/dist/assets/{MemoryDrawer-DIrEAQNI.js → MemoryDrawer-Cw1IiFCO.js} +1 -1
- package/dist/assets/MemoryManager-l0R8JBzL.js +1 -0
- package/dist/assets/{ModelPicker-OSfUtS6_.js → ModelPicker-DC-XCx0f.js} +1 -1
- package/dist/assets/OfficeMapPanel-CUI0PJBI.js +4 -0
- package/dist/assets/{ProcessMonitor-SLnEEbRY.js → ProcessMonitor-DLD6PrVx.js} +1 -1
- package/dist/assets/PromptJournalView-Cf1szLLw.js +1 -0
- package/dist/assets/{QueuePanel-BszNSrlq.js → QueuePanel-O7IsaKUs.js} +1 -1
- package/dist/assets/{RefreshDebugView-DA6cPIhw.js → RefreshDebugView-CuKbgI-T.js} +1 -1
- package/dist/assets/RequirementIntakeView-Bg8ZoV7J.js +1 -0
- package/dist/assets/{SageTabs-BR09lBUK.js → SageTabs-Bk8VDMmR.js} +2 -2
- package/dist/assets/SddFlowGraph-DdYgCVM_.js +1 -0
- package/dist/assets/SddHub-tQztZlHf.js +2 -0
- package/dist/assets/{SessionInspectView-Bf3X0qK8.js → SessionInspectView-BnoD3YER.js} +1 -1
- package/dist/assets/SessionList-BRbF7FVS.js +1 -0
- package/dist/assets/{SessionsDashboard-CwuOKWQc.js → SessionsDashboard-7heYIhHQ.js} +1 -1
- package/dist/assets/SetupScreen-CQW-6bhj.js +1 -0
- package/dist/assets/SkillDetailView-DdxB0JI4.js +3 -0
- package/dist/assets/{SpecsView-Do8eQuTN.js → SpecsView-BAnFfPPH.js} +1 -1
- package/dist/assets/TechStackView-DJeNOZE9.js +2 -0
- package/dist/assets/{TerminalPanel-Pq97A882.js → TerminalPanel-v3SC9LTq.js} +1 -1
- package/dist/assets/Toaster-wXvKXbbS.js +1 -0
- package/dist/assets/{activity-Dr_u3dOm.js → activity-C0qPnCbW.js} +2 -2
- package/dist/assets/{activity-Dzgvt4Nh.js → activity-DTSVEiLK.js} +2 -2
- package/dist/assets/{activity-L2_b8Uan.js → activity-DWHlYL9x.js} +2 -2
- package/dist/assets/{activity-gB90peLu.js → activity-DjnYvN9C.js} +2 -2
- package/dist/assets/{activity-Dg9Q9kwt.js → activity-fdbTRXeg.js} +3 -3
- package/dist/assets/{activity-BI4XyF_x.js → activity-jL8-j1D0.js} +2 -2
- package/dist/assets/{activity-IttuV5ar.js → activity-phJuGuf4.js} +2 -2
- package/dist/assets/{button-DvHe5h9X.js → button-DvpRpKkt.js} +1 -1
- package/dist/assets/{chat-CdiY7G6Z.js → chat-CzaGXz_W.js} +1 -1
- package/dist/assets/chat-store-c0pGYczr.js +17 -0
- package/dist/assets/codemap-activity-store-BH7Mh4k9.js +1 -0
- package/dist/assets/codemap-index-store-BFm1TzVW.js +1 -0
- package/dist/assets/{commandPalette-DpaemFux.js → commandPalette-BovBiPec.js} +1 -1
- package/dist/assets/common-BBHmIHQW.js +1 -0
- package/dist/assets/common-C3PzxyXg.js +1 -0
- package/dist/assets/common-CUWL8eNX.js +1 -0
- package/dist/assets/common-CvSB5NM3.js +1 -0
- package/dist/assets/common-DT2FL9xN.js +1 -0
- package/dist/assets/common-DuR5FTPN.js +1 -0
- package/dist/assets/common-xPePelft.js +1 -0
- package/dist/assets/{css.worker-B1A7g9RU.js → css.worker-DRH2OcAG.js} +14 -14
- package/dist/assets/{dialog-jbs7gu-q.js → dialog-BJjDUqb3.js} +1 -1
- package/dist/assets/{empty-state-D-ojp6Gp.js → empty-state-Cefmzojx.js} +1 -1
- package/dist/assets/{html.worker-NdFMIQdB.js → html.worker-DQLddT9h.js} +17 -17
- package/dist/assets/i18n-CDoHRskt.js +2 -0
- package/dist/assets/index-BRJ_UrGk.js +133 -0
- package/dist/assets/index-BRs425Ir.css +1 -0
- package/dist/assets/{input-oJ0Gehqp.js → input-BtoHcCl9.js} +1 -1
- package/dist/assets/json.worker-D_Dqrls5.js +62 -0
- package/dist/assets/mailbox-store-bF96Ih2G.js +1 -0
- package/dist/assets/markdown-CIRD7kOg.js +44 -0
- package/dist/assets/monaco-BCqJp2xW.js +1236 -0
- package/dist/assets/{monaco-theme-DSeCDzQy.js → monaco-theme-CR1QvFi2.js} +1 -1
- package/dist/assets/{rolldown-runtime-QTnfLwEv.js → rolldown-runtime-hePW80VL.js} +1 -1
- package/dist/assets/{roster-ws-DobwmzEj.js → roster-ws-CK52jAnG.js} +1 -1
- package/dist/assets/session-store-BgiP4PnQ.js +1 -0
- package/dist/assets/{settings-t7_uBgp_.js → settings-CbtB0i7o.js} +1 -1
- package/dist/assets/{setup-BFcmn89w.js → setup-DfcCCvUO.js} +1 -1
- package/dist/assets/{shared-CiaNczO0.js → shared-B3czc2Dj.js} +1 -1
- package/dist/assets/stores-DSGsI875.js +7 -0
- package/dist/assets/{toasts-BL_8kH4B.js → toasts-DOfXc7Rt.js} +1 -1
- package/dist/assets/{ts.worker-XonqDHUu.js → ts.worker-DkYoA6bF.js} +45 -45
- package/dist/assets/ui-store-xx1NssJI.js +1 -0
- package/dist/assets/useWebSocket-BFFntyS4.js +29 -0
- package/dist/assets/utils-tsZEnrBH.js +1 -0
- package/dist/assets/vendor-C_zEzV4N.js +139 -0
- package/dist/assets/{view-navigation-D-afwlSZ.js → view-navigation-CZKugncK.js} +1 -1
- package/dist/assets/ws-client-B3MVz75-.js +1 -0
- package/dist/assets/xterm-BWzBEEhg.js +18 -0
- package/dist/components/ChatInput/composer-button-bar.d.ts +24 -0
- package/dist/components/ChatInput/next-steps-helpers.d.ts +19 -0
- package/dist/components/ChatInput/use-chat-input-mcp.d.ts +8 -0
- package/dist/components/ChatInput/use-refine-timeout.d.ts +9 -0
- package/dist/components/ChatView/ChatDisplayToggles.d.ts +18 -0
- package/dist/components/ChatView/ChatHeader.d.ts +60 -0
- package/dist/components/ChatView/ChatRowView.d.ts +9 -0
- package/dist/components/ChatView/ToggleSwitch.d.ts +6 -0
- package/dist/components/ChatView/useChatViewState.d.ts +80 -0
- package/dist/components/ContextBar.d.ts +15 -2
- package/dist/components/FileExplorer/FileExplorerModals.d.ts +44 -0
- package/dist/components/FileExplorer/TreeRow.d.ts +23 -0
- package/dist/components/FileExplorer/tree-helpers.d.ts +16 -0
- package/dist/components/FileExplorer/types.d.ts +19 -0
- package/dist/components/MemoryManager/MemoryDrawerToolbar.d.ts +8 -0
- package/dist/components/MemoryManager/MemoryManagerHeader.d.ts +7 -0
- package/dist/components/MemoryManager/MemoryManagerStatsBar.d.ts +8 -0
- package/dist/components/MemoryManager/useMemoryManagerState.d.ts +85 -0
- package/dist/components/PromptJournalView.d.ts +2 -0
- package/dist/components/SddWizard.d.ts +0 -6
- package/dist/components/SettingsPanel/AgentSettingsTab.d.ts +5 -0
- package/dist/components/SettingsPanel/ContextSettingsTab.d.ts +4 -0
- package/dist/components/SettingsPanel/ExecutionSettingsTab.d.ts +6 -0
- package/dist/components/SettingsPanel/LogsSettingsTab.d.ts +4 -0
- package/dist/components/TechStackView/shared.d.ts +1 -0
- package/dist/components/self-learning/SelfLearningAgentList.d.ts +9 -0
- package/dist/components/self-learning/SelfLearningDetail.d.ts +39 -0
- package/dist/components/self-learning/types.d.ts +30 -0
- package/dist/components/self-learning/use-self-learning-state.d.ts +46 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +19 -0
- package/dist/hooks/ws-handlers/session-context-handlers.d.ts +18 -0
- package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +24 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +3 -36
- package/dist/hooks/ws-handlers/session-replay-handlers.d.ts +22 -0
- package/dist/index.html +31 -31
- package/dist/index.js +18021 -15149
- package/dist/lib/view-navigation.d.ts +1 -1
- package/dist/lib/ws-client-domain-methods.d.ts +86 -0
- package/dist/lib/ws-client.d.ts +2 -83
- package/dist/stores/chat-queue-helpers.d.ts +9 -0
- package/dist/stores/chat-retention.d.ts +14 -0
- package/dist/stores/chat-store-types.d.ts +106 -0
- package/dist/stores/chat-store.d.ts +6 -183
- package/dist/stores/file-store.d.ts +72 -3
- package/dist/stores/session-store.d.ts +20 -0
- package/dist/stores/ui-store.d.ts +3 -3
- package/dist/types/client-message.d.ts +51 -0
- package/dist/types/protocol-core.d.ts +2 -0
- package/dist/types/runtime.d.ts +1 -0
- package/dist/types/server-message.d.ts +76 -0
- package/package.json +20 -20
- package/dist/assets/AgentRosterView-X4NWBm16.js +0 -9
- package/dist/assets/AnalyticsDashboard-CvEY3lEY.js +0 -1
- package/dist/assets/AudienceMemoryPanel-ChhQVsbD.js +0 -3
- package/dist/assets/ChronicleDashboard-BpykJceZ.js +0 -1
- package/dist/assets/CodeEditor-DQDKQlAo.js +0 -1
- package/dist/assets/CodeMap-CnlnHM8P.js +0 -1
- package/dist/assets/ConfirmModal-BD6pUkAB.js +0 -1
- package/dist/assets/CronJobsPanel-Dp9xc7vb.js +0 -1
- package/dist/assets/GoalView-CoMRM0Vo.js +0 -1
- package/dist/assets/KanbanView-BMHq13vg.js +0 -3
- package/dist/assets/MailboxDetailView-C0n5fMGN.js +0 -1
- package/dist/assets/MemoryManager-CEfDQuV9.js +0 -1
- package/dist/assets/OfficeMapPanel-TIRw1a9O.js +0 -4
- package/dist/assets/RequirementIntakeView-CN7Yympd.js +0 -1
- package/dist/assets/SddFlowGraph-B-5J7zOV.js +0 -1
- package/dist/assets/SddHub-CkjrCykN.js +0 -2
- package/dist/assets/SessionList-cAmzxd3Z.js +0 -1
- package/dist/assets/SetupScreen-DZUvrhr0.js +0 -1
- package/dist/assets/SkillDetailView-CULufBnT.js +0 -3
- package/dist/assets/TechStackView-B2v5LoJp.js +0 -1
- package/dist/assets/Toaster-Dic3369l.js +0 -1
- package/dist/assets/chat-store-BgCgMMd0.js +0 -17
- package/dist/assets/codemap-activity-store-DBdfN0ix.js +0 -1
- package/dist/assets/codemap-index-store-45CkVCxN.js +0 -1
- package/dist/assets/common-BXJbu5Y-.js +0 -1
- package/dist/assets/common-BiNu_WzQ.js +0 -1
- package/dist/assets/common-COVxQ0FV.js +0 -1
- package/dist/assets/common-Ch7JihXD.js +0 -1
- package/dist/assets/common-DPaTeTls.js +0 -1
- package/dist/assets/common-DdGpRh8j.js +0 -1
- package/dist/assets/common-pI6fYZW3.js +0 -1
- package/dist/assets/i18n-nlW2iAya.js +0 -2
- package/dist/assets/index-eK0iH6jY.js +0 -133
- package/dist/assets/index-mNf-KFcC.css +0 -1
- package/dist/assets/json.worker-Ax0gao5O.js +0 -62
- package/dist/assets/mailbox-store-BuLRsYu3.js +0 -1
- package/dist/assets/markdown-sSmz-Ua_.js +0 -44
- package/dist/assets/monaco-BLUV5g0U.js +0 -1236
- package/dist/assets/session-store-DkPaOIhe.js +0 -1
- package/dist/assets/stores-BpVw7ENx.js +0 -7
- package/dist/assets/ui-store-FVcXVdRC.js +0 -1
- package/dist/assets/useWebSocket-Dh-clEvj.js +0 -29
- package/dist/assets/utils-D1fGupR8.js +0 -1
- package/dist/assets/vendor-AeHpGMaG.js +0 -139
- package/dist/assets/ws-client-B7j8isQb.js +0 -1
- package/dist/assets/xterm-DUBp1lnG.js +0 -35
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Aa as t,An as n,Bn as r,Bt as i,Ca as a,Ct as o,Et as s,Gt as c,Ia as l,Ki as u,Kn as d,Li as f,Nt as p,Ot as m,Pr as h,Pt as g,Qi as _,Qn as v,Tn as y,Ut as b,Va as ee,Wt as x,Zr as te,ar as S,da as C,dt as w,ea as T,hn as E,in as D,ji as ne,jt as O,lt as k,mi as re,mn as A,ta as j,ut as M,xi as N,xt as ie,za as P}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{t as F}from"./useWebSocket-Dh-clEvj.js";import{t as I}from"./utils-D1fGupR8.js";import{c as L,p as R,s as z}from"./stores-BpVw7ENx.js";import{n as ae}from"./ui-store-FVcXVdRC.js";import{o as B}from"./view-navigation-D-afwlSZ.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./dialog-jbs7gu-q.js";import{t as q}from"./button-DvHe5h9X.js";import{n as oe,t as se}from"./ModelPicker-OSfUtS6_.js";import{c as ce,s as le}from"./index-eK0iH6jY.js";import{a as J,c as Y,i as ue,l as X,n as de,o as fe,r as pe,s as me,t as he,u as ge}from"./SddFlowGraph-B-5J7zOV.js";import{SpecsView as _e}from"./SpecsView-Do8eQuTN.js";var Z=e(ee(),1),Q=k();function ve({feed:e,now:n}){let{t:r}=l();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.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,Q.jsx)(t,{className:`h-3.5 w-3.5 text-warning`}),r(`activity:sdd.activityHeading`)]}),(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-1 overflow-auto overscroll-contain p-2`,children:e.length===0?(0,Q.jsx)(`p`,{className:`px-1 pt-4 text-center text-[11px] text-muted-foreground`,children:r(`activity:sdd.feedEmpty`)}):e.map((e,t)=>{let r=pe[e.kind]??pe.started,i=r.icon;return(0,Q.jsxs)(`div`,{className:I(`sdd-rise flex items-start gap-2 rounded-md px-2 py-1.5 text-[11px]`,t===0?`bg-muted`:`hover:bg-muted`),children:[(0,Q.jsx)(i,{className:I(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.color)}),(0,Q.jsx)(`span`,{className:`flex-1 leading-snug text-foreground`,children:e.text}),(0,Q.jsx)(`span`,{className:`shrink-0 tabular-nums text-[10px] text-muted-foreground`,children:fe(e.ts,n)})]},`${e.ts}-${t}`)})})]})}function ye({open:e,onOpenChange:t,snapshot:n,busy:r,onConfirm:i}){let{t:a}=l(),o=n?.mergedCommits?.length??0,s=n?.baseBranch,[c,u]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{e&&u(!1)},[e]);let d=n?.status===`running`||n?.status===`paused`,f=(0,Z.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.worktreeBranch&&e.add(t.worktreeBranch);return e.size},[n?.tasks]),p=(0,Z.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,Q.jsx)(K,{open:e,onOpenChange:e=>!r&&t(e),children:(0,Q.jsxs)(U,{className:`sm:max-w-lg border-destructive/50`,children:[(0,Q.jsxs)(V,{children:[(0,Q.jsxs)(W,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(O,{className:`h-5 w-5 text-destructive`}),a(`activity:sdd.destroyTitle`)]}),(0,Q.jsx)(G,{children:a(`activity:sdd.destroyDesc`)})]}),(0,Q.jsxs)(`ul`,{className:`space-y-1.5 py-1 text-sm`,children:[d&&(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:p>0?a(`activity:sdd.stopRunAgents`,{count:p}):a(`activity:sdd.stopRun`)})]}),(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:f>0?a(`activity:sdd.removeWorktreesCount`,{count:f}):a(`activity:sdd.removeWorktreesAll`)})]}),(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:a(`activity:sdd.deleteArtifacts`)})]})]}),o>0&&(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border border-warning/30 bg-warning/5 p-2.5 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>u(e.target.checked),className:`mt-0.5 h-4 w-4 accent-warning`}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:a(`activity:sdd.revertMerged`,{count:o})}),` `,`on `,(0,Q.jsx)(`code`,{className:`text-xs`,children:s??a(`activity:sdd.baseBranchFallback`)}),(0,Q.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(`activity:sdd.revertHint`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(m,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),a(o>0&&!c?`activity:sdd.noteLeaveMerged`:`activity:sdd.noteAbandon`)]}),(0,Q.jsxs)(H,{className:`gap-2 sm:gap-2`,children:[(0,Q.jsx)(q,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>t(!1),children:a(`common:action.cancel`)}),(0,Q.jsx)(q,{size:`sm`,disabled:r,onClick:()=>i(c),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{className:`mr-1 h-3.5 w-3.5 animate-spin`}),` `,a(`activity:sdd.destroying`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(O,{className:`mr-1 h-3.5 w-3.5`}),` `,a(`activity:sdd.destroyAll`)]})})]})]})})}var be=[{key:`pending`,labelKey:`kanbanBacklog`,accent:`border-border/70`,head:`text-muted-foreground`},{key:`queued`,labelKey:`kanbanReady`,accent:`border-primary/35`,head:`text-primary`},{key:`in_progress`,labelKey:`kanbanRunning`,accent:`border-warning/45`,head:`text-warning`},{key:`review`,labelKey:`kanbanReview`,accent:`border-primary/35`,head:`text-primary`},{key:`failed`,labelKey:`kanbanFailed`,accent:`border-destructive/35`,head:`text-destructive`},{key:`completed`,labelKey:`kanbanDone`,accent:`border-success/35`,head:`text-success`}];function xe({tasks:e,selectedId:t,onTaskClick:n}){let{t:r}=l(),i=(0,Z.useMemo)(()=>{let t=new Map;for(let e of be)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,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 gap-3 overflow-x-auto p-4`,children:be.map(e=>{let a=i.get(e.key)??[];return(0,Q.jsxs)(`div`,{className:`flex min-h-0 w-64 shrink-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:I(`mb-2 flex items-center gap-2 border-b-2 pb-1.5`,e.accent),children:[(0,Q.jsx)(`span`,{className:I(`text-xs font-bold uppercase tracking-wide`,e.head),children:r(`activity:sdd.${e.labelKey}`)}),(0,Q.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.length})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain pr-1`,children:[a.map(e=>(0,Q.jsx)(Se,{task:e,selected:e.id===t,onClick:()=>n(e.id)},e.id)),a.length===0&&(0,Q.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 Se({task:e,selected:t,onClick:n}){let r=e.displayStatus===`in_progress`;return(0,Q.jsxs)(`button`,{type:`button`,onClick:n,className:I(`sdd-node-enter w-full rounded-lg border bg-card/85 p-2 text-left shadow-sm transition hover:border-primary/35 hover:bg-accent/35`,t?`border-primary/55 ring-1 ring-primary/35`:`border-border/70`,r&&`sdd-node-running`,e.displayStatus===`completed`&&`sdd-node-complete`,e.displayStatus===`failed`&&`sdd-node-failed`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,Q.jsx)(S,{className:`h-3 w-3 animate-spin text-warning`}),e.displayStatus===`completed`&&(0,Q.jsx)(j,{className:`h-3 w-3 text-success`}),e.displayStatus===`failed`&&(0,Q.jsx)(w,{className:`h-3 w-3 text-destructive`}),(0,Q.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.shortId}),(0,Q.jsx)(`span`,{className:I(`ml-auto rounded px-1.5 text-[9px] font-bold uppercase`,Y(e.priority).chip),children:e.priority})]}),(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:e.title}),(e.agentName||e.worktreeBranch||e.retries)&&(0,Q.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[e.agentName&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:I(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,r?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:J(e.agentName)}),(0,Q.jsx)(`span`,{className:`max-w-[80px] truncate text-[10px] text-muted-foreground`,children:e.agentName})]}),e.retries?(0,Q.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,Q.jsx)(A,{className:`h-2.5 w-2.5`}),e.retries]}):null,e.worktreeBranch&&(0,Q.jsx)(h,{className:`ml-auto h-2.5 w-2.5 text-muted-foreground`})]})]})}function Ce({task:e,allTasks:t,feed:n,now:r,expanded:s,modelCandidates:c,defaultModel:u,onClose:f,onToggleExpanded:p,onRetry:m,onReassign:g,onSetModel:_,onSetVerification:y,onCancel:ee,onDelete:x,onSplit:te,onSelectTask:S}){let{t:C}=l(),T=X(e.displayStatus),E=T.icon,D=e.displayStatus===`in_progress`,k=e.displayStatus===`pending`||e.displayStatus===`blocked`||e.displayStatus===`queued`,[re,M]=(0,Z.useState)(!1),[N,ie]=(0,Z.useState)(``),[P,F]=(0,Z.useState)(null),[L,R]=(0,Z.useState)(!1),[z,ae]=(0,Z.useState)(``),[B,V]=(0,Z.useState)(!1),[H,U]=(0,Z.useState)(e.verificationCommand??``),W=()=>{N.trim()&&(g(e.id,N.trim()),M(!1),ie(``))},G=()=>{let t=z.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&&(te(e.id,t),R(!1),ae(``))},K=(0,Z.useMemo)(()=>new Map(t.map(e=>[e.shortId,e])),[t]),q=(0,Z.useMemo)(()=>t.filter(t=>t.deps.includes(e.shortId)),[t,e.shortId]),oe=(0,Z.useMemo)(()=>n.filter(t=>t.taskId===e.id||t.taskShortId===e.shortId),[n,e.id,e.shortId]),ce=e.startedAt&&!e.completedAt?me(r-e.startedAt):e.startedAt&&e.completedAt?me(e.completedAt-e.startedAt):null;return(0,Q.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:I(`flex items-center gap-2 border-b border-border/70 bg-card/70 px-3 py-2`,s&&`px-5 py-3`),children:[(0,Q.jsx)(`button`,{type:`button`,onClick:f,className:`text-muted-foreground hover:text-foreground`,title:C(`activity:sddTask.backTitle`),children:(0,Q.jsx)(a,{className:`h-4 w-4`})}),(0,Q.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),p&&(0,Q.jsx)(`button`,{type:`button`,onClick:p,className:`ml-1 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground`,title:C(s?`activity:sddTask.collapseTitle`:`activity:sddTask.expandTitle`),"aria-label":C(s?`activity:sddTask.collapseTitle`:`activity:sddTask.expandTitle`),"aria-pressed":s,children:s?(0,Q.jsx)(d,{className:`h-4 w-4`}):(0,Q.jsx)(v,{className:`h-4 w-4`})}),(0,Q.jsxs)(`span`,{className:I(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,T.ring,T.text),children:[(0,Q.jsx)(E,{className:I(`h-3 w-3`,D&&`animate-spin`)}),T.label]})]}),(0,Q.jsxs)(`div`,{className:I(`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain`,s?`grid grid-cols-2 content-start gap-4 p-5`:`space-y-3 p-3`),children:[(0,Q.jsx)(`h3`,{className:I(`text-sm font-semibold leading-snug text-foreground`,s&&`col-span-2 text-lg`),children:e.title}),e.agentName&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/70 bg-muted/45 p-2`,children:[(0,Q.jsx)(`span`,{className:I(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,D?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:J(e.agentName)}),(0,Q.jsxs)(`div`,{className:`leading-tight`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,Q.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:C(D?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,Q.jsx)(Te,{label:C(`activity:sddTask.metaPriority`),children:(0,Q.jsx)(`span`,{className:I(`font-medium uppercase`,Y(e.priority).text),children:e.priority})}),(0,Q.jsx)(Te,{label:C(`activity:sddTask.metaType`),children:e.type}),ce&&(0,Q.jsx)(Te,{label:e.completedAt?C(`activity:sddTask.metaDuration`):C(`activity:sddTask.metaElapsed`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(ne,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,Q.jsx)(Te,{label:C(`activity:sddTask.metaRetries`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-destructive`,children:[(0,Q.jsx)(A,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,Q.jsx)(Te,{label:C(`activity:sddTask.metaWorktree`),full:!0,children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,Q.jsx)(h,{className:`h-3 w-3 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[C(`activity:sddTask.workerModel`),!e.model&&u&&(0,Q.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,C(`activity:sddTask.runDefault`,{model:u})]})]}),(0,Q.jsx)(se,{value:e.model,provider:e.provider,candidates:c,placeholder:u?C(`activity:sddTask.runDefaultPlaceholderModel`,{model:u}):C(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>_(e.id,t,n),onReset:e.model?()=>_(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map(e=>(0,Q.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[C(`activity:sddTask.verificationCmd`),(0,Q.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,C(`activity:sddTask.gatesCompletion`)]})]}),B?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`input`,{value:H,onChange:e=>U(e.target.value),onKeyDown:t=>{t.key===`Enter`?(y(e.id,H.trim()||void 0),V(!1)):t.key===`Escape`&&(U(e.verificationCommand??``),V(!1))},placeholder:C(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{y(e.id,H.trim()||void 0),V(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:C(`common:action.save`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{U(e.verificationCommand??``),V(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:C(`common:action.cancel`)})]})]}):e.verificationCommand?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.verificationState&&(0,Q.jsx)(`span`,{title:e.verificationDetail,className:e.verificationState===`passed`?`rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success`:`rounded bg-destructive/10 px-1.5 py-0.5 text-[10px] text-destructive`,children:e.verificationState===`passed`?`✓ verified`:`✗ failed`}),(0,Q.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,Q.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:C(`common:action.edit`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>y(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:C(`common:action.clear`)})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:C(`activity:sddTask.addVerify`)})]}),e.description&&(0,Q.jsxs)(`div`,{className:I(s&&`col-span-2`),children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:C(`activity:sddTask.description`)}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),(0,Q.jsx)(we,{events:oe,expanded:s}),e.deps.length>0&&(0,Q.jsx)(Ee,{title:C(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:K,onSelectTask:S}),q.length>0&&(0,Q.jsx)(Ee,{title:C(`activity:sddTask.blocks`),shortIds:q.map(e=>e.shortId),byShort:K,onSelectTask:S})]}),(0,Q.jsxs)(`div`,{className:I(`border-t border-border p-2`,s&&`px-5 py-3`),children:[re?(0,Q.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,Q.jsx)(`input`,{value:N,onChange:e=>ie(e.target.value),onKeyDown:e=>{e.key===`Enter`&&W(),e.key===`Escape`&&M(!1)},placeholder:C(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs outline-none focus:border-primary/60`}),(0,Q.jsx)(`button`,{type:`button`,onClick:W,disabled:!N.trim(),className:`rounded-md bg-primary/10 px-2 py-1.5 text-xs font-medium text-primary hover:bg-primary/15 disabled:opacity-40`,children:(0,Q.jsx)(j,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>M(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(w,{className:`h-3.5 w-3.5`})})]}):P?(0,Q.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:C(P===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{P===`stop`?ee(e.id):x(e.id),F(null)},className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(j,{className:`h-3.5 w-3.5`}),` `,C(P===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>F(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(w,{className:`h-3.5 w-3.5`})})]}):(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>m(e.id),title:C(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-warning/12 py-1.5 text-xs font-medium text-warning hover:bg-warning/18`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),` `,C(`common:action.retry`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>M(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(o,{className:`h-3.5 w-3.5`}),` `,C(`activity:sddTask.reassign`)]}),D&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>F(`stop`),title:C(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(i,{className:`h-3.5 w-3.5`}),` `,C(`common:action.stop`)]}),!D&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>R(!0),title:C(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),` `,C(`activity:sddTask.split`)]}),k&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>F(`delete`),title:C(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),` `,C(`common:action.delete`)]})]}),L&&(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,Q.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:C(`activity:sddTask.splitHint`)}),(0,Q.jsx)(`textarea`,{id:`sdd-split-input`,rows:3,value:z,onChange:e=>ae(e.target.value),placeholder:C(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring`}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:G,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),` `,C(`activity:sddTask.splitInto`)]}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{R(!1),ae(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(w,{className:`h-3.5 w-3.5`})})]})]})]})]})}function we({events:e,expanded:n}){let{t:r}=l();return(0,Q.jsxs)(`section`,{className:I(`rounded-lg border border-border/70 bg-background/45`,n&&`col-span-2`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-3 py-2.5`,children:[(0,Q.jsx)(t,{className:`h-4 w-4 text-primary`}),(0,Q.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:r(`activity:sddTask.eventLog`)}),(0,Q.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,children:e.length}),(0,Q.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:r(`activity:sddTask.newestFirst`)})]}),e.length===0?(0,Q.jsx)(`p`,{className:`px-3 py-5 text-center text-[11px] text-muted-foreground`,children:r(`activity:sddTask.noEvents`)}):(0,Q.jsx)(`div`,{className:I(`divide-y divide-border/45 overflow-auto`,n?`max-h-[32rem]`:`max-h-72`),children:e.map((e,n)=>{let r=e.kind===`file`,i=e.kind===`tool`,a=e.ok===!1||e.kind===`failed`||e.kind===`verification_failed`,o=r?te:i?p:t;return(0,Q.jsxs)(`div`,{className:I(`grid grid-cols-[4.75rem_1rem_minmax(0,1fr)] gap-2 px-3 py-2.5 text-[11px]`,a&&`bg-destructive/[0.035]`),children:[(0,Q.jsx)(`time`,{dateTime:new Date(e.ts).toISOString(),className:`font-mono text-[10px] text-muted-foreground`,title:new Date(e.ts).toLocaleString(),children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,Q.jsx)(o,{className:I(`mt-0.5 h-3.5 w-3.5`,a?`text-destructive`:r?`text-info`:i?`text-warning`:`text-primary`)}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[e.action&&(0,Q.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] font-medium text-foreground`,children:e.action}),e.agentName&&(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.agentName}),e.durationMs!==void 0&&(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.durationMs<1e3?`${Math.round(e.durationMs)}ms`:`${(e.durationMs/1e3).toFixed(1)}s`})]}),e.filePath?(0,Q.jsx)(`code`,{className:`mt-1 block break-all font-mono text-[10px] leading-relaxed text-foreground`,children:e.filePath}):e.detail?(0,Q.jsx)(`code`,{className:`mt-1 block break-words font-mono text-[10px] leading-relaxed text-muted-foreground`,children:e.detail}):(0,Q.jsx)(`p`,{className:`mt-1 break-words leading-relaxed text-foreground`,children:e.text})]})]},`${e.ts}-${e.kind}-${n}`)})})]})}function Te({label:e,children:t,full:n}){return(0,Q.jsxs)(`div`,{className:I(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,Q.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`div`,{className:`text-foreground`,children:t})]})}function Ee({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,Q.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,Q.jsx)(`span`,{className:I(`h-1.5 w-1.5 rounded-full`,X(t?.displayStatus??`pending`).dot)}),(0,Q.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function De({onClose:e}){let{t:r}=l(),{client:a}=F(),o=L(e=>e.snapshot),c=L(e=>e.lifecycleResult),u=L(e=>e.destroying),d=L(e=>e.setDestroying),f=L(e=>e.setLifecycleResult),[p,h]=(0,Z.useState)(()=>Date.now()),[g,_]=(0,Z.useState)(null),[v,b]=(0,Z.useState)(!1),[ee,x]=(0,Z.useState)(`graph`),[te,S]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{a?.send?.({type:`sdd.board.get`})},[a]);let C=o&&(o.status===`running`||o.status===`paused`);(0,Z.useEffect)(()=>{if(!C)return;let e=setInterval(()=>h(Date.now()),1e3);return h(Date.now()),()=>clearInterval(e)},[C]);let T=(0,Z.useCallback)(e=>a?.send?.(e),[a]),E=(0,Z.useRef)(null),D=(0,Z.useCallback)(e=>{E.current=null,T({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[T]),ne=(0,Z.useCallback)(e=>{S(!1),f(null),d(!0),C?(T({type:`sdd.board.stop`,payload:{}}),E.current={revertMerged:e,deadline:Date.now()+2e4}):D(e)},[C,T,D,d,f]);(0,Z.useEffect)(()=>{let e=E.current;if(!e)return;if(!C||Date.now()>=e.deadline){D(e.revertMerged);return}let t=setTimeout(()=>{let e=E.current;e&&D(e.revertMerged)},Math.max(0,e.deadline-Date.now()));return()=>clearTimeout(t)},[C,o,D]);let k=(0,Z.useCallback)(()=>{f(null),T({type:`sdd.board.cleanup_worktrees`,payload:{}})},[T,f]),j=(0,Z.useCallback)(()=>{f(null),T({type:`sdd.board.rollback`,payload:{}})},[T,f]),ie=(0,Z.useMemo)(()=>(o?.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})),[o?.tasks]),P=(0,Z.useMemo)(()=>{let e=new Map;for(let t of o?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[o?.tasks]),z=(0,Z.useCallback)(e=>_(e),[]),B=(0,Z.useCallback)(()=>{_(null),b(!1)},[]),V=(0,Z.useCallback)(e=>T({type:`sdd.board.retry`,payload:{taskId:e}}),[T]),H=(0,Z.useCallback)(()=>T({type:`sdd.board.retry_all_failed`,payload:{}}),[T]),U=(0,Z.useCallback)((e,t)=>{let n=t.trim();n&&T({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[T]),W=(0,Z.useCallback)((e,t,n)=>T({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[T]),G=(0,Z.useCallback)((e,t)=>T({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[T]),K=(0,Z.useCallback)(e=>T({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[T]),se=(0,Z.useCallback)(e=>{T({type:`sdd.board.delete_task`,payload:{taskId:e}}),_(null),b(!1)},[T]),ce=(0,Z.useCallback)((e,t)=>{T({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),_(null),b(!1)},[T]),le=oe(g!==null),Y=(0,Z.useMemo)(()=>o?.tasks.find(e=>e.id===g)??null,[o?.tasks,g]),X=o?.progress,fe=o?.diagnostics?.deadlockChains??[];return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(t,{className:`h-5 w-5 text-warning`}),(0,Q.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:o?.title??r(`activity:sddBoard.titleFallback`)}),o&&(0,Q.jsx)(`span`,{className:I(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,ue[o.status]??ue.idle),children:o.status}),o?.defaultModel&&(0,Q.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:r(`activity:sddBoard.defaultModelTitle`),children:[(0,Q.jsx)(N,{className:`h-3 w-3 text-primary`}),o.defaultModel]})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o&&(0,Q.jsxs)(`button`,{type:`button`,title:r(`activity:sddBoardView.openTheMirroredKanbanBoardSForThisRunOnePerDependencyWave`),onClick:()=>{let e=`run:${o.runId}`,t=R.getState().boards.filter(t=>t.tags?.includes(e)),n=t.find(e=>e.tags?.includes(`phase:wave-0`))??t[0];n&&(R.getState().setActiveBoardId(n.id),a?.send?.({type:`kanban.get`,payload:{boardId:n.id}})),ae.getState().setCurrentView(`kanban`)},className:`inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted`,children:[(0,Q.jsx)(t,{className:`h-3.5 w-3.5`}),` Kanban`]}),o&&(0,Q.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>x(e),className:I(`rounded px-2 py-0.5 capitalize transition`,ee===e?`bg-primary/12 text-primary`:`text-muted-foreground hover:text-foreground`),children:r(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),C&&(X?.failed??0)>0&&(0,Q.jsxs)(`button`,{type:`button`,onClick:H,title:r(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.retryFailed`,{count:X?.failed??0})]}),C&&(0,Q.jsxs)(Q.Fragment,{children:[o?.status===`paused`?(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>T({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,Q.jsx)(y,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.resume`)]}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>T({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(n,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.pause`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>T({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive hover:bg-destructive/25`,children:[(0,Q.jsx)(i,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.stop`)]})]}),o&&!C&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:k,title:r(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted/80`,children:[(0,Q.jsx)(re,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.cleanWorktrees`)]}),(o.mergedCommits?.length??0)>0&&(0,Q.jsxs)(`button`,{type:`button`,onClick:j,title:r(`activity:sddBoard.rollbackTitle`,{count:o.mergedCommits?.length??0,base:o.baseBranch??r(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(s,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.rollback`,{count:o.mergedCommits?.length??0})]})]}),o&&(u?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5 animate-spin`}),` `,r(C?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S(!0),title:r(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-destructive px-2.5 py-1 text-xs font-medium text-destructive-foreground hover:bg-destructive/90`,children:[(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddBoard.destroy`)]})),(0,Q.jsx)(q,{variant:`ghost`,size:`icon`,onClick:e,children:(0,Q.jsx)(w,{className:`h-4 w-4`})})]})]}),o&&X&&(0,Q.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,Q.jsx)(ge,{pct:X.percentComplete}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,Q.jsx)(Ae,{label:r(`activity:sddBoard.statDone`),value:`${X.completed}/${X.total}`,color:`text-success`}),X.inProgress>0&&(0,Q.jsx)(Ae,{label:r(`activity:sddBoard.statRunning`),value:X.inProgress,color:`text-warning`}),X.failed>0&&(0,Q.jsx)(Ae,{label:r(`activity:sddBoard.statFailed`),value:X.failed,color:`text-destructive`}),(0,Q.jsx)(Ae,{label:r(`activity:sddBoard.statWave`),value:o.wave+1,color:`text-primary`}),C&&o.startedAt>0&&(0,Q.jsx)(Ae,{label:r(`activity:sddBoard.statElapsed`),value:me(p-o.startedAt),color:`text-foreground`})]}),(0,Q.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:P.length===0?(0,Q.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r(`activity:sddBoard.noActiveWorkers`)}):P.map((e,t)=>(0,Q.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,Q.jsx)(`span`,{className:I(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,de[t%de.length]),children:J(e.name)}),(0,Q.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),c&&(0,Q.jsx)(ke,{result:c,onDismiss:()=>f(null)}),fe.length>0&&(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/30 bg-destructive/5 px-4 py-2 text-xs text-destructive`,children:[(0,Q.jsx)(m,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-semibold`,children:r(`activity:sddBoard.deadlock`)}),fe.map(e=>(0,Q.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:o?ee===`graph`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(he,{tasks:ie,columns:o.columns,onTaskClick:z}),(0,Q.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:r(`activity:sddBoard.clickTaskHint`)})]}):(0,Q.jsx)(xe,{tasks:o.tasks,selectedId:g,onTaskClick:z}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,Q.jsx)(M,{className:`h-10 w-10 text-primary/40`}),(0,Q.jsx)(`p`,{className:`text-foreground`,children:r(`activity:sddBoard.noRunTitle`)}),(0,Q.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:r(`activity:sddBoard.noRunBody`)})]})}),o&&(0,Q.jsx)(`aside`,{"data-testid":`sdd-task-panel`,"data-expanded":v&&Y?`true`:`false`,className:I(`shrink-0 border-l border-border bg-card transition-[width] duration-200 ease-out`,v&&Y?`w-[min(72rem,72vw)]`:`w-80`),children:Y?(0,Q.jsx)(Ce,{task:Y,allTasks:o.tasks,feed:o.taskEvents?.[Y.id]??o.feed??[],now:p,expanded:v,modelCandidates:le,defaultModel:o.defaultModel,onClose:B,onToggleExpanded:()=>b(e=>!e),onRetry:V,onReassign:U,onSetModel:W,onSetVerification:G,onCancel:K,onDelete:se,onSplit:ce,onSelectTask:_},Y.id):(0,Q.jsx)(ve,{feed:o.feed??[],now:p})})]}),(0,Q.jsx)(ye,{open:te,onOpenChange:S,snapshot:o,busy:u,onConfirm:ne})]})}function Oe(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=P.t(`activity:sddBoard.${t}`);if(!e.ok)return P.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??P.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(P.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(P.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(P.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):P.t(`activity:sddBoard.lcNothing`);return e.reason?P.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):P.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ke({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,Q.jsxs)(`div`,{className:I(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-warning/30 bg-warning/5 text-warning`:`border-success/30 bg-success/5 text-success`),children:[n?(0,Q.jsx)(f,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,Q.jsx)(u,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:Oe(e)}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,Q.jsx)(w,{className:`h-3.5 w-3.5`})})]})}function Ae({label:e,value:t,color:n}){return(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,Q.jsx)(`span`,{className:I(`font-semibold tabular-nums`,n),children:t}),(0,Q.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}var je={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},Me=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function Ne({onClose:e,onRunStarted:t}){let{t:n}=l(),{client:i}=F(),a=z(e=>e.snapshot),o=z(e=>e.agentText),s=z(e=>e.error),u=z(e=>e.startedRunId),d=z(e=>e.setStartedRunId),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(!1),[b,ee]=(0,Z.useState)(!0),[te,C]=(0,Z.useState)(!0),[ne,O]=(0,Z.useState)(!1),[k,re]=(0,Z.useState)(void 0),[A,M]=(0,Z.useState)(void 0),[N,ie]=(0,Z.useState)([]),[P,L]=(0,Z.useState)(4),[R,ae]=(0,Z.useState)(!0),[B,V]=(0,Z.useState)(!1),H=oe(ne),U=(0,Z.useCallback)(e=>i?.send?.(e),[i]),W=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{U({type:`sdd.spec.get`})},[U]),(0,Z.useEffect)(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[a?.answers.length??0,o]),(0,Z.useEffect)(()=>{u&&(d(null),t?.())},[t,d,u]);let G=a?.busy??!1,K=a?.phase??`idle`,J=!!a?.sessionId,ue=!!a?.resumed,X=a?.lastRunId;(0,Z.useEffect)(()=>{J&&y(!1)},[J]);let de=a?.answers[a.answers.length-1]?.question??``,fe=!!a&&(a.taskCount>0||!!a.graphId||K===`task_review`||K===`executing`),pe=()=>{let e=f.trim();!e||G||v||(y(!0),U({type:`sdd.spec.start`,payload:{goal:e}}))},me=()=>{let e=m.trim();!e||G||(U({type:`sdd.spec.message`,payload:{text:e}}),h(``))},ge=()=>!G&&U({type:`sdd.spec.approve`,payload:{}}),_e=()=>{U({type:`sdd.run.start`,payload:{parallelSlots:P,worktrees:R,planDecompose:B,...k?{model:k,provider:A}:{},...N.length?{fallbackModels:N}:{}}}),O(!1)},ve=()=>{G||U({type:`sdd.spec.discard`,payload:{}})},ye=(0,Z.useMemo)(()=>(a?.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})),[a?.board]),be=ye.length>0;return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(x,{className:`h-5 w-5 text-primary`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-lg font-semibold`,children:a?.title||n(`activity:sddWizard.titleFallback`)}),J&&(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[n(`activity:sddWizard.${je[K]??`phaseStart`}`),K===`questioning`&&` · ${n(`activity:sddWizard.questionsSuffix`,{cur:a?.questionCount??0,max:a?.maxQuestions??0})}`,a&&a.taskCount>0?` · ${n(`activity:sddWizard.tasksSuffix`,{count:a.taskCount})}`:``]})]}),G&&(0,Q.jsx)(S,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[X&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>t?.(),className:`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted`,children:[(0,Q.jsx)(E,{className:`h-3.5 w-3.5`}),` `,n(`activity:sddWizard.openLiveBoard`)]}),J&&(0,Q.jsx)(`button`,{type:`button`,onClick:ve,disabled:G,title:n(`activity:sddWizard.discardTitle`),className:`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-destructive/10 hover:text-destructive disabled:opacity-50`,children:n(`activity:sddWizard.discardInterview`)}),fe&&(0,Q.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>!e),title:n(`activity:sddWizard.runCfgTitle`),className:I(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,k||N.length||B?`border-primary/40 bg-primary/10 text-primary`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(c,{className:`h-3.5 w-3.5`}),k||n(`activity:sddWizard.modelsLabel`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:_e,className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,Q.jsx)(E,{className:`h-3.5 w-3.5`}),` `,n(`activity:sddWizard.startRun`)]}),ne&&(0,Q.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,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:n(`activity:sddWizard.defaultWorkerModel`)}),(0,Q.jsx)(se,{value:k,provider:A,candidates:H,placeholder:n(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:n(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{re(e),M(t)},onReset:k?()=>{re(void 0),M(void 0)}:void 0}),(0,Q.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:n(`activity:sddWizard.fallbackChain`)}),(0,Q.jsx)(le,{value:N,candidates:H,onChange:ie}),(0,Q.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:n(`activity:sddWizard.appliesToAll`)}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:n(`activity:sddWizard.parallelAgents`)}),(0,Q.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:P,onChange:e=>{let t=Number.parseInt(e.target.value,10);L(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-primary`})]}),(0,Q.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:n(`activity:sddWizard.isolateWorktrees`)}),(0,Q.jsx)(`input`,{type:`checkbox`,checked:R,onChange:e=>ae(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:n(R?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)}),(0,Q.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:n(`activity:sddWizard.planDecompose`)}),(0,Q.jsx)(`input`,{type:`checkbox`,checked:B,onChange:e=>V(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:n(B?`activity:sddWizard.planDecomposeOn`:`activity:sddWizard.planDecomposeOff`)})]})]}),(0,Q.jsx)(q,{variant:`ghost`,size:`icon`,onClick:e,children:(0,Q.jsx)(w,{className:`h-4 w-4`})})]})]}),J&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:Me.map((e,t)=>{let r=e===K,i=Me.indexOf(K)>t;return(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsxs)(`span`,{className:I(`rounded-full px-2 py-0.5`,r?`bg-primary/15 text-primary`:i?`text-success`:`text-muted-foreground`),children:[i&&(0,Q.jsx)(j,{className:`mr-0.5 inline h-3 w-3`}),n(`activity:sddWizard.${je[e]}`)]}),t<Me.length-1&&(0,Q.jsx)(`span`,{className:`text-muted-foreground/65`,children:`→`})]},e)})}),(0,Q.jsxs)(`div`,{ref:ce(`sdd-wizard`),className:`min-h-0 flex-1 overflow-auto overscroll-contain p-4`,children:[s&&(0,Q.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/5 p-2 text-xs text-destructive`,children:s}),ue&&J&&(0,Q.jsx)(`div`,{className:`mb-3 rounded-md border border-primary/30 bg-primary/5 px-3 py-2 text-xs text-primary`,children:n(`activity:sddWizard.resumeBanner`)}),J?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[be&&(0,Q.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-primary/20 bg-[hsl(var(--surface-2)/0.85)]`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>ee(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-1.5 text-[11px] font-medium text-primary hover:bg-muted/40`,children:[b?(0,Q.jsx)(T,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(_,{className:`h-3.5 w-3.5`}),(0,Q.jsx)(r,{className:`h-3.5 w-3.5`}),n(`activity:sddWizard.taskGraphSummary`,{count:a?.taskCount??0}),(0,Q.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:n(b?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),b&&(0,Q.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,Q.jsx)(he,{tasks:ye,columns:a?.board?.columns??[]})})]}),(0,Q.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[a?.goal&&(0,Q.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,Q.jsx)(g,{className:`h-3 w-3`}),` `,n(`activity:sddWizard.goalLabel`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:a.goal})]}),a?.answers.length||o&&K===`questioning`||G?(0,Q.jsxs)(`div`,{className:`space-y-2.5`,children:[a?.answers.map(e=>(0,Q.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,Q.jsx)(Fe,{speaker:`assistant`,text:e.question}),(0,Q.jsx)(Fe,{speaker:`user`,text:e.answer})]},e.question.slice(0,64))),o&&K===`questioning`&&o!==de&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:o}),G&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:``,thinking:!0})]}):null,a?.spec&&(0,Q.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,Q.jsx)(x,{className:`h-3.5 w-3.5 text-primary`}),a.spec.title]}),(0,Q.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:a.spec.overview}),(0,Q.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:a.spec.requirements.map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(`span`,{className:I(`shrink-0 font-mono uppercase`,Y(e.priority).text),children:e.priority[0]}),(0,Q.jsx)(`span`,{children:e.description})]},`${e.priority}-${e.description.slice(0,32)}`))})]}),o&&(K===`implementation`||K===`task_review`)&&(0,Q.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>C(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:[te?(0,Q.jsx)(T,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(_,{className:`h-3.5 w-3.5`}),(0,Q.jsx)(x,{className:`h-3.5 w-3.5 text-primary`}),` `,n(`activity:sddWizard.implementationPlan`)]}),te&&(0,Q.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:Pe(o)})})]}),o&&K!==`questioning`&&K!==`implementation`&&K!==`task_review`&&!a?.spec&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:o}),(K===`spec_review`||K===`implementation`||K===`task_review`)&&(0,Q.jsxs)(q,{variant:`secondary`,onClick:ge,disabled:G,children:[(0,Q.jsx)(j,{className:`mr-1.5 h-4 w-4`}),n(K===`spec_review`?`activity:sddWizard.approveSpec`:K===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,Q.jsx)(`div`,{ref:W})]})]}):(0,Q.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:n(`activity:sddWizard.goalPrompt`)}),(0,Q.jsx)(`textarea`,{id:`sdd-goal`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&pe()},rows:4,placeholder:n(`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-primary`}),(0,Q.jsx)(q,{className:`mt-3`,onClick:pe,disabled:!f.trim()||v,children:v?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,n(`activity:sddWizard.startingInterview`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(x,{className:`mr-1.5 h-4 w-4`}),` `,n(`activity:sddWizard.startInterview`)]})}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:n(`activity:sddWizard.introBody`)})]})]}),J&&K!==`executing`&&K!==`done`&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,Q.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),me())},rows:1,placeholder:n(K===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:G,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-primary disabled:opacity-50`}),(0,Q.jsx)(q,{size:`icon`,onClick:me,disabled:G||!m.trim(),children:(0,Q.jsx)(D,{className:`h-4 w-4`})})]})]})}function Pe(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function Fe({speaker:e,text:t,live:n,thinking:r}){let i=e===`user`;return(0,Q.jsxs)(`div`,{className:I(`sdd-rise flex items-start gap-2`,i&&`flex-row-reverse`),children:[(0,Q.jsx)(`span`,{className:I(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,i?`bg-info/15 text-info`:`bg-primary/15 text-primary`,(n||r)&&`sdd-agent-live`),children:i?(0,Q.jsx)(ie,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(C,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`div`,{className:I(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,i?`rounded-tr-sm bg-info/10`:`rounded-tl-sm bg-muted`),children:r?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}var $=[{id:`project`,labelKey:`activity:sddhub.tabProject`},{id:`board`,labelKey:`activity:sddhub.tabBoard`},{id:`specs`,labelKey:`activity:sddhub.tabSpecs`}];function Ie(){let{t:e}=l(),[t,n]=(0,Z.useState)(`project`),r=z(e=>e.startedRunId),i=z(e=>e.setStartedRunId),a=()=>B(`chat`),o=(0,Z.useCallback)(()=>n(`board`),[]);(0,Z.useEffect)(()=>{r&&(n(`board`),i(null))},[r,i]);let s=(e,t)=>{let r;if(e.key===`ArrowLeft`&&(r=(t-1+$.length)%$.length),e.key===`ArrowRight`&&(r=(t+1)%$.length),e.key===`Home`&&(r=0),e.key===`End`&&(r=$.length-1),r===void 0)return;e.preventDefault();let i=$[r];i&&(n(i.id),e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)[r]?.focus())};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsx)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`flex shrink-0 items-end border-b border-border/70 bg-card px-4`,children:$.map((r,i)=>{let a=t===r.id;return(0,Q.jsxs)(`button`,{id:`sdd-hub-tab-${r.id}`,type:`button`,role:`tab`,"aria-selected":a,"aria-controls":`sdd-hub-panel-${r.id}`,tabIndex:a?0:-1,onClick:()=>n(r.id),onKeyDown:e=>s(e,i),className:I(`relative px-4 py-2.5 text-sm font-medium transition-colors`,a?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e(r.labelKey),a&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-0 left-0 right-0 h-0.5 bg-primary`})]},r.id)})}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{id:`sdd-hub-panel-project`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-project`,hidden:t!==`project`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(Ne,{onClose:a,onRunStarted:o})}),(0,Q.jsx)(`div`,{id:`sdd-hub-panel-board`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-board`,hidden:t!==`board`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(De,{onClose:a})}),(0,Q.jsx)(`div`,{id:`sdd-hub-panel-specs`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-specs`,hidden:t!==`specs`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(_e,{onClose:a,onRunStarted:o})})]})]})}export{Ie as SddHub};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Aa as t,Dr as n,Ia as r,Ki as i,Mi as a,On as o,Ot as s,Tn as c,Va as l,an as u,ar as d,dt as ee,ft as f,jt as te,lt as p,on as ne,si as m,vn as re,za as h,zi as g,zt as _}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{t as v}from"./utils-D1fGupR8.js";import"./stores-BpVw7ENx.js";import{n as y}from"./ui-store-FVcXVdRC.js";import{r as b}from"./ConfirmModal-BD6pUkAB.js";import{b as ie}from"./index-eK0iH6jY.js";var x=e(l(),1),S=p(),ae=10,oe=20,C=e=>{if(!e)return 0;let t=Date.parse(e);return Number.isNaN(t)?0:t},w=e=>(e.iterationCount??0)+(e.toolCallCount??0)+(e.fileChangeCount??0),T=e=>{let t=Date.parse(e);if(Number.isNaN(t))return``;let n=Math.max(0,Date.now()-t);if(n<6e4)return h.t(`common:time.justNow`);if(n<36e5)return h.t(`common:time.minutesAgo`,{count:Math.floor(n/6e4)});if(n<864e5)return h.t(`common:time.hoursAgo`,{count:Math.floor(n/36e5)});let r=Math.floor(n/864e5);return r<7?h.t(`common:time.daysAgo`,{count:r}):new Date(t).toLocaleDateString()},E=e=>e.lastActivityAt??e.endedAt??e.startedAt;function D(e){let t=C(e.startedAt);if(!t)return``;let n=e.isCurrent?Date.now():C(e.endedAt)||t,r=Math.max(0,Math.floor((n-t)/6e4));if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h ${r%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function O(e){return new Intl.NumberFormat(void 0,{notation:e>=1e3?`compact`:`standard`,maximumFractionDigits:1}).format(e)}function se(e){return e.filter(e=>e.tokenTotal===0&&!e.isCurrent).map(e=>e.id)}function ce(e,t){let n=t.query.trim().toLocaleLowerCase(),r=new Set(t.favoriteIds);return[...e.filter(e=>{if(!(!n||[e.name,e.title,e.lastUserMessage,e.model,e.provider,e.id,...Object.keys(e.toolBreakdown??{})].some(e=>e?.toLocaleLowerCase().includes(n))))return!1;switch(t.filter){case`favorites`:return r.has(e.id);case`active`:return e.isCurrent;case`completed`:return!e.isCurrent&&(e.outcome===`completed`||e.outcome===void 0&&!!e.endedAt);case`issues`:return e.outcome===`error`||e.outcome===`timeout`||e.outcome===`aborted`||(e.toolErrorCount??0)>0;default:return!0}})].sort((e,n)=>{if(t.sort===`tokens`&&n.tokenTotal!==e.tokenTotal)return n.tokenTotal-e.tokenTotal;if(t.sort===`activity`){let t=w(n)-w(e);if(t!==0)return t}return C(E(n))-C(E(e))})}function le(e,t,n=Date.now()){let r=new Date(n);r.setHours(0,0,0,0);let i=r.getTime(),a=i-864e5,o=i-6*864e5,s=new Set(t),c=e.filter(e=>s.has(e.id)),l={today:[],yesterday:[],thisWeek:[],earlier:[]};for(let t of e){if(s.has(t.id))continue;let e=C(E(t));e>=i?l.today.push(t):e>=a?l.yesterday.push(t):e>=o?l.thisWeek.push(t):l.earlier.push(t)}let u=[];c.length>0&&u.push({label:`favorites`,rows:c,favorite:!0});for(let e of[`today`,`yesterday`,`thisWeek`,`earlier`])l[e].length>0&&u.push({label:e,rows:l[e]});return u}function ue(e){return e.reduce((e,t)=>({sessions:e.sessions+1,active:e.active+ +!!t.isCurrent,tokens:e.tokens+t.tokenTotal,tools:e.tools+(t.toolCallCount??0),files:e.files+(t.fileChangeCount??0),errors:e.errors+(t.toolErrorCount??0)+ +(t.outcome===`error`)}),{sessions:0,active:0,tokens:0,tools:0,files:0,errors:0})}function de(e){if(e.isCurrent)return{icon:t,label:`active`,defaultLabel:`Active`,className:`text-primary`};switch(e.outcome){case`completed`:return{icon:i,label:`completed`,defaultLabel:`Completed`,className:`text-success`};case`error`:return{icon:s,label:`error`,defaultLabel:`Error`,className:`text-destructive`};case`timeout`:return{icon:a,label:`timeout`,defaultLabel:`Timed out`,className:`text-warning`};case`aborted`:return{icon:g,label:`aborted`,defaultLabel:`Aborted`,className:`text-muted-foreground`};default:return e.endedAt?{icon:i,label:`completed`,defaultLabel:`Completed`,className:`text-success`}:{icon:n,label:`saved`,defaultLabel:`Saved session`,className:`text-muted-foreground`}}}function fe({stats:e}){let{t:i}=r();return(0,S.jsx)(`div`,{className:`grid grid-cols-2 border-b border-border/75 bg-card md:grid-cols-5`,children:[{label:i(`activity:sessions.stats.sessions`,{defaultValue:`Sessions`}),value:e.sessions,icon:n},{label:i(`activity:sessions.stats.tokens`,{defaultValue:`Tokens`}),value:e.tokens,icon:t},{label:i(`activity:sessions.stats.tools`,{defaultValue:`Tool calls`}),value:e.tools,icon:f},{label:i(`activity:sessions.stats.files`,{defaultValue:`Files changed`}),value:e.files,icon:m},{label:i(`activity:sessions.stats.errors`,{defaultValue:`Errors`}),value:e.errors,icon:s}].map(e=>{let t=e.icon;return(0,S.jsxs)(`div`,{className:`border-b border-r border-border/75 px-4 py-3 md:border-b-0`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground`,children:[(0,S.jsx)(t,{className:`h-3 w-3`}),e.label]}),(0,S.jsx)(`div`,{className:`mt-1 font-mono text-xl font-semibold tabular-nums`,children:O(e.value)})]},e.label)})})}function k({historyQuery:e,setHistoryQuery:t,historyEntries:i,historyLoading:a,historyError:l,wsConnected:p,listSessions:h,resumeSession:g,deleteSession:C,renameSession:w,variant:k=`sidebar`}){let{t:A}=r(),j=y(e=>e.favoriteSessionIds),pe=y(e=>e.toggleFavoriteSession),M=y(e=>e.sessionNicknames),N=y(e=>e.setSessionNickname),me=y(e=>e.setInspectSession),[P,he]=(0,x.useState)(`all`),[F,ge]=(0,x.useState)(`recent`),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(null),[H,U]=(0,x.useState)(1),W=(0,x.useRef)(null),G=(0,x.useRef)(null),K=k===`workspace`,q=(0,x.useCallback)(e=>e.name||M[e.id]||e.title||A(`activity:sessions.empty`),[M,A]),J=(0,x.useCallback)(e=>{L(e.id),z(e.name??M[e.id]??e.title??``)},[M]),Y=(0,x.useCallback)(e=>{L(null),N(e,R),w(e,R)},[R,w,N]);(0,x.useEffect)(()=>{B&&i.some(e=>e.id===B&&e.isCurrent)&&(V(null),W.current&&clearTimeout(W.current))},[i,B]),(0,x.useEffect)(()=>{I&&(G.current?.focus(),G.current?.select())},[I]),(0,x.useEffect)(()=>()=>{W.current&&clearTimeout(W.current)},[]);let X=(0,x.useCallback)(e=>{V(e),g(e),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>V(null),1e4)},[g]),Z=(0,x.useMemo)(()=>se(i),[i]),Q=(0,x.useMemo)(()=>ce(i,{query:e,filter:P,sort:F,favoriteIds:j}),[j,P,i,e,F]),$=K?oe:ae,_e=(0,x.useMemo)(()=>Q.slice((H-1)*$,H*$),[H,$,Q]),ve=(0,x.useMemo)(()=>le(_e,j),[j,_e]),ye=(0,x.useMemo)(()=>ue(i),[i]);(0,x.useEffect)(()=>{U(1)},[P,e,F]),(0,x.useEffect)(()=>{let e=Math.max(1,Math.ceil(Q.length/$));H>e&&U(e)},[H,$,Q.length]);let be=(0,x.useCallback)(async()=>{if(Z.length!==0&&await b({title:A(`activity:sessions.deleteEmptyTitle`,{count:Z.length}),message:A(`activity:sessions.deleteEmptyConfirmBody`),confirmLabel:A(`common:action.delete`),danger:!0}))for(let e of Z)C(e)},[C,Z,A]),xe=[{id:`all`,label:A(`activity:sessions.filters.all`,{defaultValue:`All`})},{id:`favorites`,label:A(`activity:sessions.filters.favorites`,{defaultValue:`Pinned`})},{id:`active`,label:A(`activity:sessions.filters.active`,{defaultValue:`Active`})},{id:`completed`,label:A(`activity:sessions.filters.completed`,{defaultValue:`Completed`})},{id:`issues`,label:A(`activity:sessions.filters.issues`,{defaultValue:`Issues`})}];return(0,S.jsxs)(`div`,{className:v(`flex min-h-0 min-w-0 flex-1 flex-col bg-background`,K&&`h-full`),"data-history-variant":k,children:[K?(0,S.jsx)(fe,{stats:ye}):null,(0,S.jsxs)(`div`,{className:v(`border-b border-border/75 bg-card`,K?`px-4 py-3`:`px-3 py-2`),children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:A(`activity:sessions.recentSessions`)}),K?(0,S.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:A(`activity:sessions.workspaceHint`,{defaultValue:`Search, inspect, pin and resume every project conversation.`})}):null]}),(0,S.jsxs)(`div`,{className:`flex shrink-0 items-center border border-border/75`,children:[Z.length>0?(0,S.jsxs)(`button`,{type:`button`,className:`inline-flex h-8 items-center justify-center gap-1 border-r border-border/75 px-2 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-40`,onClick:be,disabled:!p,title:A(`activity:sessions.deleteEmptyTitle`,{count:Z.length}),children:[(0,S.jsx)(te,{className:`h-3.5 w-3.5`}),K?(0,S.jsx)(`span`,{className:`text-[10px]`,children:Z.length}):null]}):null,(0,S.jsx)(`button`,{type:`button`,className:`inline-flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40`,onClick:()=>h(200),disabled:!p,title:A(`common:action.refresh`),children:a?(0,S.jsx)(d,{className:`h-3.5 w-3.5 animate-spin`}):(0,S.jsx)(re,{className:`h-3.5 w-3.5`})})]})]}),(0,S.jsxs)(`div`,{className:v(`grid gap-2`,K?`mt-3 lg:grid-cols-[minmax(18rem,1fr)_auto_auto]`:`mt-2`),children:[(0,S.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,S.jsx)(u,{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,S.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:A(`activity:sessions.filterPlaceholder`),"aria-label":A(`activity:sessions.filterPlaceholder`),className:`h-9 w-full border border-border/75 bg-background pl-8 pr-8 text-xs outline-none transition-colors placeholder:text-muted-foreground/70 focus:border-primary focus:ring-1 focus:ring-primary`}),e?(0,S.jsx)(`button`,{type:`button`,onClick:()=>t(``),className:`absolute right-0 top-0 inline-flex h-9 w-8 items-center justify-center text-muted-foreground hover:text-foreground`,title:A(`activity:sessions.clearFilter`),children:(0,S.jsx)(ee,{className:`h-3.5 w-3.5`})}):null]}),(0,S.jsxs)(`fieldset`,{className:`flex min-w-0 overflow-x-auto border border-border/75`,children:[(0,S.jsx)(`legend`,{className:`sr-only`,children:A(`activity:sessionList.historyFilters`)}),xe.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>he(e.id),"aria-pressed":P===e.id,className:v(`h-9 shrink-0 border-r border-border/75 px-2.5 text-[10px] font-semibold uppercase tracking-[0.08em] transition-colors last:border-r-0`,P===e.id?`bg-foreground text-background`:`bg-background text-muted-foreground hover:bg-muted hover:text-foreground`),children:e.label},e.id))]}),(0,S.jsxs)(`select`,{value:F,onChange:e=>ge(e.target.value),"aria-label":A(`activity:sessions.sort.label`,{defaultValue:`Sort sessions`}),className:`h-9 border border-border/75 bg-background px-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground outline-none focus:border-primary`,children:[(0,S.jsx)(`option`,{value:`recent`,children:A(`activity:sessions.sort.recent`,{defaultValue:`Recent`})}),(0,S.jsx)(`option`,{value:`tokens`,children:A(`activity:sessions.sort.tokens`,{defaultValue:`Most tokens`})}),(0,S.jsx)(`option`,{value:`activity`,children:A(`activity:sessions.sort.activity`,{defaultValue:`Most activity`})})]})]})]}),l?(0,S.jsx)(`div`,{className:`border-b border-destructive/30 bg-destructive/5 px-4 py-2 text-xs text-destructive`,children:l}):null,(0,S.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain overflow-x-hidden [scrollbar-gutter:stable]`,children:i.length===0&&!a?(0,S.jsxs)(`div`,{className:`flex min-h-56 flex-col items-center justify-center px-4 py-10 text-center text-muted-foreground`,children:[(0,S.jsx)(n,{className:`h-9 w-9 opacity-25`}),(0,S.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:A(`activity:sessions.noHistory`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs`,children:A(`activity:sessions.noHistoryHint`)})]}):ve.length===0?(0,S.jsxs)(`div`,{className:`flex min-h-56 flex-col items-center justify-center px-4 py-10 text-center text-muted-foreground`,children:[(0,S.jsx)(u,{className:`h-9 w-9 opacity-25`}),(0,S.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:A(`activity:sessions.noMatches`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs`,children:A(`activity:sessions.noMatchesHint`)})]}):(0,S.jsxs)(`div`,{className:v(K?`mx-auto w-full max-w-7xl p-4 lg:p-6`:`p-2`),children:[(0,S.jsx)(`div`,{className:v(`space-y-5`,K&&`grid gap-x-5 space-y-0 xl:grid-cols-2`),children:ve.map(e=>(0,S.jsxs)(`section`,{className:`min-w-0`,children:[(0,S.jsxs)(`div`,{className:v(`sticky top-0 z-[1] flex items-center gap-1 border-b border-border/75 bg-background/95 px-1 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] backdrop-blur-sm`,e.favorite?`text-warning`:`text-muted-foreground`),children:[e.favorite?(0,S.jsx)(_,{className:`h-3 w-3 fill-current`}):null,A(`activity:sessions.group.${e.label}`),(0,S.jsx)(`span`,{className:`ml-1 font-mono font-normal text-muted-foreground`,children:e.rows.length})]}),(0,S.jsx)(`div`,{className:`divide-y divide-border/75 border-x border-b border-border/75`,children:e.rows.map(e=>{let t=j.includes(e.id),n=de(e),r=n.icon,i=I===e.id,a=B===e.id;return(0,S.jsxs)(`article`,{className:v(`group grid min-w-0 grid-cols-[minmax(0,1fr)_auto] bg-card transition-colors`,e.isCurrent?`border-l-2 border-l-primary bg-primary/5`:`border-l-2 border-l-transparent hover:bg-muted/45`),"data-session-id":e.id,children:[i?(0,S.jsxs)(`div`,{className:`min-w-0 px-3 py-3`,children:[(0,S.jsx)(`label`,{className:`block text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground`,htmlFor:`session-name-${e.id}`,children:A(`activity:sessions.rename`,{defaultValue:`Session name`})}),(0,S.jsx)(`input`,{ref:G,id:`session-name-${e.id}`,value:R,onChange:e=>z(e.target.value),onBlur:()=>Y(e.id),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),Y(e.id)):t.key===`Escape`&&(t.preventDefault(),L(null))},placeholder:e.title||A(`activity:sessions.nicknamePlaceholder`),className:`mt-1 h-8 w-full border border-primary bg-background px-2 text-sm outline-none ring-1 ring-primary`})]}):(0,S.jsx)(`button`,{type:`button`,disabled:e.isCurrent||B!==null,onClick:()=>X(e.id),onDoubleClick:()=>J(e),"aria-current":e.isCurrent?`page`:void 0,className:`min-w-0 px-3 py-3 text-left outline-none focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:cursor-default`,children:(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,S.jsx)(`span`,{className:v(`mt-0.5 shrink-0`,n.className),title:A(`activity:sessions.status.${n.label}`,{defaultValue:n.defaultLabel}),children:(0,S.jsx)(r,{className:v(`h-3.5 w-3.5`,e.isCurrent&&`animate-pulse`)})}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,title:q(e),children:q(e)}),(0,S.jsxs)(`div`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:[e.provider,`/`,e.model]}),e.lastUserMessage?(0,S.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.lastUserMessage,children:e.lastUserMessage}):null,(0,S.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] text-muted-foreground`,children:[a?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-sans font-semibold text-primary`,children:[(0,S.jsx)(d,{className:`h-3 w-3 animate-spin`}),A(`activity:sessions.resuming`)]}):(0,S.jsx)(`span`,{title:new Date(E(e)).toLocaleString(),children:T(E(e))}),(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{children:D(e)}),e.tokenTotal>0?(0,S.jsxs)(`span`,{children:[O(e.tokenTotal),` tok`]}):null,(e.messageCount??0)>0?(0,S.jsxs)(`span`,{children:[O(e.messageCount??0),` msg`]}):null,(e.toolCallCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,S.jsx)(f,{className:`h-3 w-3`}),e.toolCallCount]}):null,(e.fileChangeCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,S.jsx)(m,{className:`h-3 w-3`}),e.fileChangeCount]}):null,(e.toolErrorCount??0)>0?(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-destructive`,children:[(0,S.jsx)(s,{className:`h-3 w-3`}),e.toolErrorCount]}):null]})]})]})}),(0,S.jsxs)(`div`,{className:`flex items-start gap-0.5 p-2`,children:[!e.isCurrent&&K&&!i?(0,S.jsxs)(`button`,{type:`button`,onClick:()=>X(e.id),disabled:B!==null,className:`inline-flex h-7 items-center gap-1 border border-border/75 px-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground hover:border-primary hover:text-primary disabled:opacity-40`,title:A(`activity:sessions.resume`,{defaultValue:`Resume session`}),children:[(0,S.jsx)(c,{className:`h-3 w-3`}),A(`activity:sessions.resumeShort`,{defaultValue:`Resume`})]}):null,i?null:(0,S.jsx)(`button`,{type:`button`,onClick:()=>me(e.id),className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary`,title:A(`activity:sessions.inspect`,{defaultValue:`Inspect session`}),children:(0,S.jsx)(ne,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>pe(e.id),"aria-pressed":t,className:v(`inline-flex h-7 w-7 items-center justify-center transition-colors hover:bg-warning/10 hover:text-warning`,t?`text-warning`:`text-muted-foreground`),title:A(t?`activity:sessions.unfavorite`:`activity:sessions.markFavorite`),children:(0,S.jsx)(_,{className:v(`h-3.5 w-3.5`,t&&`fill-current`)})}),i?null:(0,S.jsx)(`button`,{type:`button`,onClick:()=>J(e),className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary`,title:A(`activity:sessions.renameAction`,{defaultValue:`Rename`}),children:(0,S.jsx)(o,{className:`h-3.5 w-3.5`})}),e.isCurrent?null:(0,S.jsx)(`button`,{type:`button`,onClick:async()=>{await b({title:A(`activity:sessions.deleteSessionConfirmTitle`),message:A(`activity:sessions.deleteSessionConfirmBody`,{name:q(e)}),confirmLabel:A(`common:action.delete`),danger:!0})&&C(e.id)},className:`inline-flex h-7 w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:A(`activity:sessions.deleteSessionTitle`),children:(0,S.jsx)(te,{className:`h-3.5 w-3.5`})})]})]},e.id)})})]},e.label))}),(0,S.jsx)(ie,{page:H,pageSize:$,totalItems:Q.length,onPageChange:U,compact:!K,itemLabel:`sessions`})]})})]})}export{D as i,O as n,T as r,k as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ci as t,Fr as n,Ia as r,Jt as i,Na as a,Qi as o,Va as s,Wt as c,ar as l,br as u,da as d,ea as f,en as p,fi as m,jr as h,lt as g,t as _,ta as v,vn as y,wn as b,xa as x,za as S}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{t as ee}from"./useWebSocket-Dh-clEvj.js";import{t as C}from"./ws-client-B7j8isQb.js";import{t as w}from"./utils-D1fGupR8.js";import{I as te}from"./stores-BpVw7ENx.js";import{o as T}from"./view-navigation-D-afwlSZ.js";import{n as E}from"./Toaster-Dic3369l.js";import{a as D,n as ne,o as re,r as O,t as k}from"./dialog-jbs7gu-q.js";import{t as A}from"./button-DvHe5h9X.js";import{t as j}from"./input-oJ0Gehqp.js";import{D as M,a as N,b as P,i as F,r as I,t as L,x as R}from"./index-eK0iH6jY.js";var z=e(s(),1);function B(e,t=8e3){return new Promise((n,r)=>{let i=setTimeout(()=>{a(),r(Error(`timeout`))},t),a=e.on(`key.operation_result`,e=>{clearTimeout(i),a(),n(e.payload)})})}var V=g();function ie({onKeySaved:e}){let{t}=r(),[n,i]=(0,z.useState)(!1),[a,s]=(0,z.useState)(``),[c,u]=(0,z.useState)(`openai-compatible`),[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(``),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)([]),{setFieldRef:y,handleKeyDown:x}=N(),S=async()=>{if(a.trim()){g(!0);try{let n=C(te.getState().wsUrl),r=B(n);n.send({type:`provider.add`,payload:{id:a.trim(),family:c,baseUrl:d.trim()||void 0,apiKey:p.trim()||void 0,models:_.length>0?_.map(e=>e.id):void 0,customModels:_.length>0?Object.fromEntries(_.filter(e=>e.name||e.maxOutput||e.capabilities).map(e=>[e.id,{...e.name&&e.name!==e.id?{name:e.name}:{},...e.maxOutput?{maxOutput:e.maxOutput}:{},...e.capabilities&&Object.values(e.capabilities).some(Boolean)?{capabilities:e.capabilities}:{}}])):void 0}});let o=await r;if(!o.success)throw Error(o.message);E.success(t(`setup:screen.toasts.providerAdded`,{id:a.trim()})),e(a.trim()),n.listSavedProviders(),n.probeProvider(a.trim()),s(``),f(``),m(``),v([]),i(!1)}catch(e){let n=e instanceof Error&&e.message&&e.message!==`timeout`?e.message:null;E.error(n??t(`setup:screen.toasts.providerAddFailed`))}finally{g(!1)}}};return(0,V.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/60 overflow-hidden`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(!n),className:`w-full flex items-center gap-3 p-4 text-left hover:bg-muted/30 transition-colors`,children:[(0,V.jsx)(`div`,{className:`w-10 h-10 rounded-lg bg-muted/50 flex items-center justify-center`,children:(0,V.jsx)(b,{className:`h-5 w-5 text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:t(`setup:screen.custom.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`setup:screen.custom.description`)})]}),(0,V.jsx)(o,{className:w(`h-4 w-4 text-muted-foreground transition-transform`,n&&`rotate-90`)})]}),n&&(0,V.jsxs)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/40`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5 pt-3`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground block`,children:t(`setup:screen.custom.localServers`)}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:I.map(e=>(0,V.jsx)(A,{type:`button`,size:`sm`,variant:a===e.id?`default`:`outline`,onClick:()=>{s(e.id),u(`openai-compatible`),f(e.defaultBaseUrl),e.noAuth&&m(``),v([])},title:e.hint,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.providerId`)}),(0,V.jsx)(j,{placeholder:t(`activity:customProviderSection.eGMyLlm`),value:a,onChange:e=>s(e.target.value),className:`text-sm`,ref:y(0),onKeyDown:e=>x(e,0)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.family`)}),(0,V.jsxs)(`select`,{value:c,onChange:e=>u(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm`,ref:y(1),onKeyDown:e=>x(e,1),children:[(0,V.jsx)(`option`,{value:`openai-compatible`,children:t(`setup:screen.custom.familyOpenAiCompatible`)}),(0,V.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,V.jsx)(`option`,{value:`anthropic`,children:`Anthropic`}),(0,V.jsx)(`option`,{value:`google`,children:`Google`})]})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.baseUrl`)}),(0,V.jsx)(j,{placeholder:t(`activity:customProviderSection.eGHttpLocalhost11434V1`),value:d,onChange:e=>f(e.target.value),className:`text-sm font-mono`,ref:y(2),onKeyDown:e=>x(e,2)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:t(`setup:screen.custom.apiKey`)}),(0,V.jsx)(j,{type:`password`,placeholder:t(`setup:screen.custom.apiKeyPlaceholder`),value:p,onChange:e=>m(e.target.value),className:`text-sm font-mono`,ref:y(3),onKeyDown:e=>x(e,3)})]}),(0,V.jsx)(L,{models:_,onChange:v}),(0,V.jsxs)(A,{onClick:S,disabled:!a.trim()||h,size:`sm`,ref:y(4),onKeyDown:e=>x(e,4,S),children:[h?(0,V.jsx)(l,{className:`h-4 w-4 animate-spin mr-2`}):null,t(`setup:screen.custom.add`)]})]})]})}var H=F();async function ae(e,t){try{let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json();if(!Array.isArray(r))throw Error(`Expected JSON array`);let i=r.filter(e=>typeof e.id==`string`&&typeof e.name==`string`&&typeof e.family==`string`);return i.length>0?i:H}catch{return H}}function oe(e,t){let n=new Date().getTime()-e.getTime(),r=Math.floor(n/1e3);if(r<10)return t(`setup:screen.time.justNow`);if(r<60)return t(`setup:screen.time.secondsAgo`,{count:r});let i=Math.floor(r/60);if(i<60)return t(`setup:screen.time.minutesAgo`,{count:i});let a=Math.floor(i/60);return a<24?t(`setup:screen.time.hoursAgo`,{count:a}):t(`setup:screen.time.daysAgo`,{count:Math.floor(a/24)})}var se=e(_(),1);function ce({popular:e,catalogProvider:i,savedProvider:a,onKeySaved:s,probeResult:c}){let{t:u}=r(),[d,h]=(0,z.useState)(``),[g,_]=(0,z.useState)(!1),[y,b]=(0,z.useState)(!!a?.apiKeys.some(e=>e.isActive)),[x,S]=(0,z.useState)(!1),[ee,T]=(0,z.useState)(!1),[M,N]=(0,z.useState)(!1),[P,F]=(0,z.useState)(null);(0,z.useEffect)(()=>{M&&e.referral&&se.toDataURL(e.referral.url,{width:200,margin:2,color:{dark:`#000000`,light:`#ffffff`}}).then(e=>F(e)).catch(()=>F(null))},[M,e.referral]);let I=async()=>{if(d.trim()){_(!0);try{let t=C(te.getState().wsUrl),n=B(t);i?t.addKey(e.id,`default`,d.trim()):t.send({type:`provider.add`,payload:{id:e.id,family:e.family,apiKey:d.trim()}});let r=await n;if(!r.success)throw Error(r.message);b(!0),h(``),E.success(u(`setup:screen.toasts.keySaved`,{name:e.name})),s(e.id),t.listSavedProviders(),t.probeProvider(e.id)}catch(t){let n=t instanceof Error&&t.message&&t.message!==`timeout`?t.message:null;E.error(n??u(`setup:screen.toasts.keySaveFailed`,{name:e.name}))}finally{_(!1)}}},L=e=>{e.key===`Enter`&&d.trim()&&I()},R=async()=>{if(e.referral)try{await navigator.clipboard.writeText(e.referral.url),T(!0),E.success(u(`setup:screen.toasts.referralCopied`)),setTimeout(()=>T(!1),2e3)}catch{E.error(u(`setup:screen.toasts.referralCopyFailed`))}},ie=i&&i.modelCount>0;return(0,V.jsxs)(`div`,{className:w(`rounded-xl border p-4 transition-all`,y?`border-success/30 bg-success/5`:`bg-gradient-to-br ${e.color}`),children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`text-2xl shrink-0 mt-0.5`,children:e.icon}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),y&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-success/10 text-success border border-success/20`,children:[(0,V.jsx)(v,{className:`h-2.5 w-2.5`}),u(`setup:screen.card.keySaved`)]}),e.referral&&!y&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-warning/10 text-warning border border-warning/20`,children:[(0,V.jsx)(n,{className:`h-2.5 w-2.5`}),u(`setup:screen.card.referral`)]})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),e.referral&&!y&&(0,V.jsxs)(`p`,{className:`text-[11px] text-warning/80 mt-1`,children:[`🎁 `,e.referral.reward]}),y?y?(0,V.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[a?.baseUrl&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70 font-mono truncate`,title:a.baseUrl,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[u(`activity:providerKey.url`),` `]}),a.baseUrl]}),a?.models&&a.models.length>0&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[u(`activity:providerKey.models`),` `]}),a.pickedModelId??a.models[0],(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[` (+`,a.models.length-1,` more)`]})]}),c===`probing`?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground mt-1`,children:[(0,V.jsx)(l,{className:`h-3 w-3 animate-spin`}),u(`setup:screen.probe.checking`,`Checking connection…`)]}):c?.ok?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-success mt-1`,children:[(0,V.jsx)(v,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[u(`setup:screen.probe.connected`,`Connected`),c.modelCount!=null&&` · ${c.modelCount} ${u(`setup:screen.probe.models`,`models`)}`,c.elapsedMs!=null&&` · ${c.elapsedMs}ms`]})]}):c&&!c.ok?(0,V.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[11px] text-destructive mt-1`,children:[(0,V.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:`✕`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:u(`setup:screen.probe.failed`,`Probe failed`)}),c.status===`no_base_url`&&(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:u(`setup:screen.probe.noBaseUrl`,`No base URL configured`)}),c.status===`unreachable`&&(0,V.jsxs)(`span`,{className:`block text-destructive/70`,children:[u(`setup:screen.probe.unreachable`,`Could not connect`),c.detail?`: ${c.detail}`:``]}),c.status!==`no_base_url`&&c.status!==`unreachable`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:c.httpStatus==null?c.status:`${u(`setup:screen.probe.httpStatus`,`Status`)} ${c.httpStatus}`}),c.detail&&(0,V.jsx)(`span`,{className:`block text-destructive/70 truncate max-w-[250px]`,title:c.detail,children:c.detail})]})]})]}):null,ie&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>S(!x),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[u(`setup:screen.providers.modelsAvailable`,{count:i?.modelCount??0}),x?(0,V.jsx)(f,{className:`h-3 w-3`}):(0,V.jsx)(o,{className:`h-3 w-3`})]})]}):null:(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(j,{type:`password`,placeholder:e.keyPlaceholder,value:d,onChange:e=>h(e.target.value),onKeyDown:L,className:`font-mono text-sm`}),(0,V.jsx)(A,{onClick:I,disabled:!d.trim()||g,size:`sm`,className:`shrink-0`,children:g?(0,V.jsx)(l,{className:`h-4 w-4 animate-spin`}):u(`setup:screen.card.save`)})]}),e.docsUrl&&(0,V.jsxs)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors`,children:[u(`setup:screen.card.getKey`),` `,(0,V.jsx)(m,{className:`h-3 w-3`})]}),e.referral&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:R,className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:ee?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(v,{className:`h-3 w-3`}),` `,u(`setup:screen.card.copied`)]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(t,{className:`h-3 w-3`}),` `,u(`setup:screen.card.copyReferral`)]})}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>N(!0),className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),` `,u(`setup:screen.card.share`)]})]})]})]})]}),(0,V.jsx)(k,{open:M,onOpenChange:N,children:(0,V.jsxs)(ne,{className:`sm:max-w-md`,children:[(0,V.jsxs)(D,{children:[(0,V.jsxs)(re,{className:`flex items-center gap-2`,children:[(0,V.jsx)(n,{className:`h-4 w-4 text-warning`}),u(`setup:screen.share.title`,{name:e.name})]}),(0,V.jsx)(O,{children:u(`setup:screen.share.description`)})]}),(0,V.jsx)(`div`,{className:`flex flex-col items-center gap-4 py-4`,children:e.referral&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`text-sm text-center`,children:(0,V.jsxs)(`p`,{className:`font-medium text-warning`,children:[`🎁 `,e.referral.reward]})}),P?(0,V.jsx)(`div`,{className:`rounded-lg border border-border p-2 bg-white`,children:(0,V.jsx)(`img`,{src:P,alt:u(`setup:screen.card.qrAlt`,{name:e.name}),className:`w-[200px] h-[200px]`})}):(0,V.jsx)(`div`,{className:`w-[200px] h-[200px] rounded-lg border border-border flex items-center justify-center bg-muted`,children:(0,V.jsx)(l,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`w-full space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://twitter.com/intent/tweet?text=${t}&url=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.twitter`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})}),`X`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`Check out ${e.name}! ${e.referral.reward}`);window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${t}&summary=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.linkedin`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`})}),u(`activity:providerKey.linkedin`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward} ${e.referral.url}`);window.open(`https://t.me/share/url?url=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.telegram`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`})}),u(`activity:providerKey.telegram`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://wa.me/?text=${t}%20${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.whatsapp`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.134 1.585 5.934L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})}),u(`activity:providerKey.whatsapp`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`${e.name} - ${e.referral.reward}`);window.open(`https://www.reddit.com/submit?url=${t}&title=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.reddit`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 0 1.108-.701 1.25 1.25 0 0 1 2.144.33zm-8.811 8.748c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754zm7.944 0c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754z`})}),u(`activity:providerKey.reddit`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://www.facebook.com/sharer/sharer.php?u=${n}"e=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:u(`setup:screen.share.facebook`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})}),u(`activity:providerKey.facebook`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`mailto:?subject=${t}&body=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs hover:bg-muted/80 transition-colors`,title:u(`setup:screen.share.email`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25H4.5a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75`})}),u(`activity:providerKey.email`)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(j,{value:e.referral.url,readOnly:!0,className:`font-mono text-xs flex-1`}),(0,V.jsx)(A,{size:`sm`,variant:`outline`,onClick:R,className:`shrink-0`,children:ee?(0,V.jsx)(v,{className:`h-4 w-4`}):(0,V.jsx)(t,{className:`h-4 w-4`})})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground text-center`,children:u(`setup:screen.share.hint`)})]})]})})]})})]})}function U(){let{t:e}=r(),{model:t,setProvider:n,setModel:s,wsConnected:f,wsUrl:p}=te(a(e=>({model:e.model,setProvider:e.setProvider,setModel:e.setModel,wsConnected:e.wsConnected,wsUrl:e.wsUrl})));ee();let[m,g]=(0,z.useState)([]),[_,b]=(0,z.useState)({}),[D,ne]=(0,z.useState)([]),[re,O]=(0,z.useState)(!1),[k,j]=(0,z.useState)(null),[N,F]=(0,z.useState)(0),[I,L]=(0,z.useState)(new Set),[B,se]=(0,z.useState)({}),[U,le]=(0,z.useState)(H),[W,G]=(0,z.useState)(!1),[ue,de]=(0,z.useState)(0),[fe,pe]=(0,z.useState)(0),[K,me]=(0,z.useState)(null),q=(0,z.useRef)(!0);(0,z.useEffect)(()=>{let e=new AbortController,t=`${window.location.origin}/providers.json`;return G(!0),ae(t,e.signal).then(t=>{if(t!==H){if(le(t),G(!1),!q.current){let e=t.length-fe;e>0?E.success(S.t(`setup:screen.toasts.providersLoadedNew`,{count:t.length,diff:e})):e<0?E.success(S.t(`setup:screen.toasts.providersLoadedRemoved`,{count:t.length,diff:Math.abs(e)})):E.success(S.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:t.length})),pe(t.length)}me(new Date);return}return ae(`https://raw.githubusercontent.com/WrongStack/WrongStack/main/packages/webui/public/providers.json`,e.signal)}).then(e=>{if(e){if(le(e),!q.current){let t=e.length-fe;t>0?E.success(S.t(`setup:screen.toasts.providersLoadedNew`,{count:e.length,diff:t})):t<0?E.success(S.t(`setup:screen.toasts.providersLoadedRemoved`,{count:e.length,diff:Math.abs(t)})):E.success(S.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:e.length})),pe(e.length)}me(new Date)}}).catch(()=>{q.current||E.error(S.t(`setup:screen.toasts.providersRefreshFailed`))}).finally(()=>{G(!1),q.current=!1}),()=>e.abort()},[ue]);let[J,he]=(0,z.useState)(null),[Y,X]=(0,z.useState)(null),[ge,_e]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!f)return;let e=C(p),n=setTimeout(()=>{n=null,O(!1),j(S.t(`setup:screen.errors.backendNotResponding`))},8e3),r=()=>{n&&=(clearTimeout(n),null)},i=e.on(`provider.catalog`,e=>{if(e.type===`provider.catalog`){r(),j(null);let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));g(t),O(!1)}}),a=e.on(`provider.models`,e=>{if(e.type===`provider.models`){let n=e.payload;if(n.provider!==J)return;b(e=>({...e,[n.provider]:n.models})),_e(!1),n.models.length===1?X(n.models[0].id):t&&n.models.some(e=>e.id===t)&&X(t)}}),o=e.on(`providers.saved`,e=>{if(e.type===`providers.saved`){let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));ne(t);let n=new Set(t.filter(e=>e.apiKeys.some(e=>e.isActive)).map(e=>e.id));L(n)}}),s=e.on(`provider.probe`,e=>{if(e.type!==`provider.probe`)return;let t=e.payload;se(e=>({...e,[t.providerId]:t}))});return j(null),O(!0),e.listProviders(),()=>{r(),i?.(),a?.(),o?.(),s?.()}},[f,p,t,N,J]);let ve=(0,z.useCallback)(()=>{j(null),F(e=>e+1)},[]),ye=(0,z.useCallback)(()=>{de(e=>e+1)},[]),be=(0,z.useCallback)(t=>oe(t,e),[e]),Z=(0,z.useCallback)(e=>{L(t=>new Set([...t,e])),he(e),X(null)},[]),xe=I.size>0;(0,z.useEffect)(()=>{if(!J||!f)return;let e=C(p);_[J]||(_e(!0),e.listProviderModels(J))},[J,f,p,_]);let Se=J?_[J]??[]:[],Ce=(0,z.useCallback)(async()=>{if(!J||!Y)return;if(!I.has(J)){E.error(`Please save the provider configuration before starting a session.`);return}n(J),s(Y);let e=C(p),t=await e.switchModel(J,Y,5e3);t.success?(e.newSession(),T(`chat`)):E.error(t.message||S.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,n,s,p]),we=(0,z.useCallback)(async()=>{if(!J||!Y)return;n(J),s(Y);let e=await C(p).switchModel(J,Y,5e3);e.success?T(`chat`):E.error(e.message||S.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,n,s,p]),Te=new Set(U.map(e=>e.id)),Ee=m.filter(e=>!Te.has(e.id)).sort((e,t)=>e.id.localeCompare(t.id)),Q=R(Ee,10);R(D,9);let $=R(Se,12,J);return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,V.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b bg-card px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(`img`,{src:`/wrongstack.svg`,alt:`WrongStack`,draggable:!1,className:`ws-brand-logo h-10 w-10 shrink-0 border border-border/70 shadow-sm`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:e(`setup:screen.header.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground sm:truncate`,children:e(`setup:screen.header.subtitle`)})]})]}),xe&&J?(0,V.jsxs)(`span`,{className:`text-xs text-success/80`,children:[(0,V.jsx)(v,{className:`h-3 w-3 inline-block mr-1`}),e(`setup:screen.header.continue`)]}):null]}),(0,V.jsx)(M,{className:`min-h-0 flex-1`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-8 p-4 pb-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,xe?`text-success`:`text-primary font-medium`),children:[(0,V.jsx)(u,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.addKeys`)})]}),(0,V.jsx)(o,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,J?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(d,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.pickModel`)})]}),(0,V.jsx)(o,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:w(`flex min-w-0 items-center gap-1.5`,J&&Y?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(c,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.start`)})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-primary/20 bg-primary/5 p-4`,children:[(0,V.jsx)(i,{className:`h-5 w-5 text-primary shrink-0 mt-0.5`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium`,children:e(`setup:screen.security.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`setup:screen.security.body`)})]})]}),k?(0,V.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-4 py-12 rounded-xl border border-destructive/30 bg-destructive/5 px-6`,children:[(0,V.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-destructive/10 border border-destructive/30 flex items-center justify-center`,children:(0,V.jsx)(h,{className:`h-6 w-6 text-destructive`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e(`setup:screen.errors.backendUnreachable`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 max-w-sm`,children:k})]}),(0,V.jsxs)(A,{onClick:ve,size:`sm`,variant:`outline`,children:[(0,V.jsx)(l,{className:`h-4 w-4 mr-2`}),e(`setup:screen.errors.retry`)]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.popular`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[W&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,V.jsx)(l,{className:`h-3 w-3 animate-spin`}),e(`setup:screen.providers.updating`)]}),K&&!W&&(0,V.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,title:K.toLocaleString(),children:be(K)}),(0,V.jsxs)(`button`,{type:`button`,onClick:ye,disabled:W,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,title:e(`setup:screen.providers.refreshTitle`),children:[(0,V.jsx)(y,{className:w(`h-3 w-3`,W&&`animate-spin`)}),e(`setup:screen.providers.refresh`)]})]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:U.map(e=>(0,V.jsx)(ce,{popular:e,catalogProvider:m.find(t=>t.id===e.id),savedProvider:D.find(t=>t.id===e.id),onKeySaved:Z,probeResult:B[e.id]},e.id))})]}),Ee.length>0&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.more`)}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Q.pageItems.map(t=>(0,V.jsx)(ce,{popular:{id:t.id,name:t.name,description:e(`setup:screen.providers.catalogDescription`,{family:t.family,count:t.modelCount}),icon:`🔗`,color:`from-muted/60 to-muted/20 border-border hover:border-primary/40`,keyPlaceholder:`API key`,family:t.family},catalogProvider:t,savedProvider:D.find(e=>e.id===t.id),onKeySaved:Z,probeResult:B[t.id]},t.id))}),(0,V.jsx)(P,{page:Q.page,pageSize:Q.pageSize,totalItems:Q.totalItems,onPageChange:Q.setPage,itemLabel:`providers`})]}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.selfHosted`)}),(0,V.jsx)(ie,{onKeySaved:Z})]})]}),re&&(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(l,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),J&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`h2`,{className:`text-base font-semibold flex items-center gap-2`,children:[(0,V.jsx)(c,{className:`h-4 w-4 text-primary`}),e(`setup:screen.start.chooseModel`)]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{he(null),X(null)},className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,children:e(`setup:screen.start.addMoreKeys`)})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`setup:screen.start.modelsFor`,{provider:J})}),ge?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(l,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):Se.length>0?(0,V.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:$.pageItems.map(e=>{let t=e.contextWindow?`${(e.contextWindow/1e6).toFixed(0)}M ctx`:null;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>X(e.id),className:w(`w-full text-left rounded-xl border p-3 transition-all`,`hover:border-primary/40 hover:bg-primary/5`,Y===e.id?`border-primary bg-primary/10 ring-1 ring-primary/30`:`border-border bg-card`),children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[t&&(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:t}),e.capabilities.slice(0,3).map(e=>(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20`,children:e},e))]})]}),Y===e.id&&(0,V.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary`,children:(0,V.jsx)(v,{className:`h-3 w-3 text-primary-foreground`})})]})},e.id)})}):(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-8 text-center`,children:e(`setup:screen.errors.noModels`)}),(0,V.jsx)(P,{page:$.page,pageSize:$.pageSize,totalItems:$.totalItems,onPageChange:$.setPage,itemLabel:`models`})]}),J&&Y&&(0,V.jsxs)(`div`,{className:`sticky bottom-0 -mx-4 border-t bg-background/80 px-4 py-4 backdrop-blur-sm sm:-mx-6 sm:px-6`,children:[(0,V.jsx)(`div`,{className:`mb-3 flex min-w-0 items-center justify-between gap-2 text-sm text-muted-foreground`,children:(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[J,` / `,Y]})}),(0,V.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,V.jsxs)(A,{onClick:Ce,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(d,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.startSession`),(0,V.jsx)(x,{className:`h-4 w-4 ml-2`})]}),(0,V.jsxs)(A,{onClick:we,variant:`outline`,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(v,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.saveConfig`)]})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60 text-center mt-2`,children:e(`setup:screen.start.saveConfigHint`)})]})]})})]})}export{U as SetupScreen};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-AeHpGMaG.js","assets/rolldown-runtime-QTnfLwEv.js","assets/monaco-BLUV5g0U.js","assets/monaco-Bowa0-zp.css","assets/markdown-sSmz-Ua_.js","assets/vendor-BMdWcCR4.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{$i as t,Ci as n,Gr as r,Ia as i,Mn as ee,On as te,Qi as a,Va as o,Wt as ne,Zr as re,_i as ie,ar as s,dt as ae,jr as oe,jt as c,lt as l,pa as se,ta as ce,va as u,vn as le,za as d}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{s as f}from"./monaco-BLUV5g0U.js";import{t as ue}from"./useWebSocket-Dh-clEvj.js";import{t as p}from"./utils-D1fGupR8.js";import{n as m}from"./ui-store-FVcXVdRC.js";import{o as de}from"./view-navigation-D-afwlSZ.js";import{a as fe,n as pe,o as me,t as he}from"./dialog-jbs7gu-q.js";import{p as ge}from"./markdown-sSmz-Ua_.js";import{c as _e,g as ve,u as ye}from"./index-eK0iH6jY.js";import{t as be}from"./empty-state-D-ojp6Gp.js";var h=e(o(),1),g=l(),xe=(0,h.lazy)(()=>f(()=>import(`./vendor-AeHpGMaG.js`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5])));function _(e){return e===`project`||e===`user`}function Se(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function Ce({source:e}){let{t}=i(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,g.jsx)(`span`,{className:p(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function v({className:e}){let{t:o}=i(),{client:l}=ue(),f=m(e=>e.skillsState),v=m(e=>e.setSkillsState),y=f.selectedSkill,b=f.navHistory,x=f.historyIndex,[S,C]=(0,h.useState)(null),[we,w]=(0,h.useState)(!1),[T,E]=(0,h.useState)(null),Te=_e(`skill-detail`,!!S),[D,O]=(0,h.useState)(!1),[k,A]=(0,h.useState)(``),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)(null),[F,I]=(0,h.useState)(!1),[L,R]=(0,h.useState)(null),[z,B]=(0,h.useState)(!1),V=(0,h.useRef)(``),[H,Ee]=(0,h.useState)(!1),[U,W]=(0,h.useState)(null),[De,Oe]=(0,h.useState)(!1),[G,K]=(0,h.useState)(null),[q,ke]=(0,h.useState)(!1),[Ae,je]=(0,h.useState)([]),J=(0,h.useRef)(f);J.current=f;let Y=(0,h.useRef)(!1),X=(0,h.useMemo)(()=>k?{lines:k.split(`
|
|
3
|
-
`).length,words:k.trim()?k.trim().split(/\s+/).length:0,chars:k.length}:{lines:0,words:0,chars:0},[k]),Z=(0,h.useMemo)(()=>{if(!k)return null;let e=5*1024*1024,t=new Blob([k]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[k]);(0,h.useEffect)(()=>{if(!L)return;let e=setTimeout(()=>R(null),2e3);return()=>clearTimeout(e)},[L]),(0,h.useEffect)(()=>{if(!D||!y)return;let e=setInterval(()=>{k&&k!==V.current&&(V.current=k,localStorage.setItem(`skills_draft_${y.name}`,JSON.stringify({content:k,savedAt:Date.now()})),R(Date.now()))},5e3);return()=>clearInterval(e)},[D,k,y]),(0,h.useEffect)(()=>{if(!y||!D)return;let e=localStorage.getItem(`skills_draft_${y.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==k&&t!==V.current&&(A(t),V.current=t,B(!0))}catch{}},[y?.name,D]),(0,h.useEffect)(()=>{if(!l||!y)return;w(!0),C(null),E(null);let e=setTimeout(()=>{w(!1),E(d.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?E(n.payload.error):n.payload.name&&C(n.payload),w(!1)},n=e=>{let t=e;Ee(!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;v({...n,knownRefs:e,updateAvailableCount:0}),W({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),l.send({type:`skills.list`},{echoToChat:!1})}else W({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??d.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&je(t.payload.skills)};return l.on(`skills.content`,t),l.on(`skills.updated`,n),l.on(`skills.list`,r),l.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),()=>{clearTimeout(e),l.off(`skills.content`,t),l.off(`skills.updated`,n),l.off(`skills.list`,r)}},[l,y?.name,y?.source]),(0,h.useEffect)(()=>{D&&(O(!1),A(``),P(null))},[y?.name]);let Q=(0,h.useCallback)(e=>Ae.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ae]),Me=(0,h.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=b.slice(0,x+1);e.push(t),v({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),O(!1),A(``),W(null)}},[Q,b,x,v]),Ne=(0,h.useCallback)(()=>{if(x<=0)return;Y.current=!0;let e=x-1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),Pe=(0,h.useCallback)(()=>{if(x>=b.length-1)return;Y.current=!0;let e=x+1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),$=(0,h.useCallback)(()=>{de(`chat`)},[]),Fe=(0,h.useCallback)(()=>{S&&(A(S.body),V.current=S.body,B(!1),P(null),O(!0),I(!1))},[S]),Ie=(0,h.useCallback)(()=>{O(!1),A(``),P(null),I(!1),B(!1),y&&localStorage.removeItem(`skills_draft_${y.name}`)},[y]),Le=(0,h.useCallback)(()=>{!y||!S||(B(!1),A(S.body),V.current=S.body,y&&localStorage.removeItem(`skills_draft_${y.name}`))},[y,S]),Re=(0,h.useCallback)(()=>{if(!l||!y||!k.trim())return;M(!0),P(null);let e=t=>{let n=t;M(!1),n.payload.success?(V.current=``,localStorage.removeItem(`skills_draft_${y.name}`),B(!1),O(!1),l.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),l.send({type:`skills.list`},{echoToChat:!1})):P(n.payload.error??d.t(`activity:skillDetail.saveFailed`)),l.off(`skills.edited`,e)};l.on(`skills.edited`,e),l.editSkill(y.name,k)},[l,y,k]),ze=(0,h.useCallback)(()=>{!l||!y||(Ee(!0),W(null),l.checkForUpdates(y.name,y.source===`user`))},[l,y]),Be=(0,h.useCallback)(()=>{y?.sourceUrl&&navigator.clipboard.writeText(y.sourceUrl).then(()=>{Oe(!0),setTimeout(()=>Oe(!1),2e3)})},[y]),Ve=(0,h.useCallback)(()=>{if(!S?.body)return;let e=new Blob([S.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${S.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[S]),He=(0,h.useCallback)(async e=>{if(!l||!e)return;ke(!0);let t=e=>{let n=e;ke(!1),n.payload.success?(K(null),l.send({type:`skills.list`},{echoToChat:!1}),$()):P(n.payload.error??d.t(`activity:skillDetail.uninstallFailed`)),l.off(`skills.uninstalled`,t)};l.on(`skills.uninstalled`,t),l.uninstallSkill(e.name,e.source===`user`)},[l,$]);return y?(0,g.jsxs)(`div`,{className:p(`flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:[(0,g.jsxs)(`div`,{className:`shrink-0 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,g.jsx)(ne,{className:`h-4 w-4`})}),(0,g.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold`,children:y.name}),y.version&&(0,g.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,y.version]}),(0,g.jsx)(Ce,{source:y.source})]}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:y.description||y.trigger}),y.sourceUrl&&(0,g.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1`,children:[(0,g.jsxs)(`a`,{href:`https://${y.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,title:o(`activity:skillDetail.openSourceRepo`),children:[(0,g.jsx)(oe,{className:`h-3 w-3 shrink-0`}),(0,g.jsx)(`span`,{className:`truncate font-mono`,children:y.sourceUrl})]}),(0,g.jsx)(`button`,{type:`button`,onClick:Be,className:`flex shrink-0 items-center text-muted-foreground transition-colors hover:text-foreground`,title:o(`activity:skillDetail.copySourceUrl`),children:De?(0,g.jsx)(ce,{className:`h-3 w-3 text-success`}):(0,g.jsx)(n,{className:`h-3 w-3`})})]}),y.scope.length>0&&(0,g.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:y.scope.map(e=>(0,g.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),U&&(0,g.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[U.updated.length>0&&(0,g.jsx)(`div`,{className:`text-success`,children:o(`activity:skillDetail.updatedLabel`,{list:U.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),U.unchanged.length>0&&(0,g.jsx)(`div`,{className:`text-muted-foreground`,children:o(`activity:skillDetail.upToDateLabel`,{list:U.unchanged.join(`, `)})}),U.errors.length>0&&(0,g.jsx)(`div`,{className:`text-destructive`,children:o(`activity:skillDetail.errorsLabel`,{list:U.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 lg:ml-auto lg:shrink-0 lg:justify-end`,children:[_(y.source)&&y.sourceUrl&&(0,g.jsx)(`button`,{type:`button`,onClick:ze,disabled:H,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,title:o(`activity:skillDetail.checkUpdatesTitle`),children:H?(0,g.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}):(0,g.jsx)(le,{className:`h-3.5 w-3.5`})}),y.source!==`bundled`&&!D&&(0,g.jsx)(`button`,{type:`button`,onClick:Ve,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:o(`activity:skillDetail.exportTitle`),children:(0,g.jsx)(ie,{className:`h-3.5 w-3.5`})}),_(y.source)&&!D&&(0,g.jsx)(`button`,{type:`button`,onClick:Fe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:o(`activity:skillDetail.editTitle`),children:(0,g.jsx)(te,{className:`h-3.5 w-3.5`})}),_(y.source)&&(0,g.jsx)(`button`,{type:`button`,onClick:()=>K(y),className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:o(`activity:skillDetail.uninstallTitle`),children:(0,g.jsx)(c,{className:`h-3.5 w-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:$,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:o(`activity:skillDetail.closeTitle`),children:(0,g.jsx)(ae,{className:`h-4 w-4`})})]})]}),b.length>1&&(0,g.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1 rounded-lg border border-border/60 bg-muted/35 px-2 py-1`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:Ne,disabled:x<=0,className:p(`rounded p-1 transition-colors`,x<=0?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:o(`activity:skillDetail.backTitle`),children:(0,g.jsx)(t,{className:`h-4 w-4`})}),(0,g.jsx)(`button`,{type:`button`,onClick:Pe,disabled:x>=b.length-1,className:p(`rounded p-1 transition-colors`,x>=b.length-1?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:o(`activity:skillDetail.forwardTitle`),children:(0,g.jsx)(a,{className:`h-4 w-4`})}),(0,g.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:b.map((e,t)=>(0,g.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,g.jsx)(a,{className:`h-3 w-3 text-muted-foreground/65 mx-0.5 shrink-0`}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>{t<x&&(Y.current=!0,v({...J.current,selectedSkill:e,historyIndex:t}),O(!1),A(``),W(null))},className:p(`hover:text-primary cursor-pointer transition-colors`,t===x?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),S&&(S.relatedFiles.length>0||S.references.length>0)&&(0,g.jsxs)(`div`,{className:`shrink-0 space-y-2 rounded-xl border border-border/70 bg-card/70 px-4 py-3 shadow-sm`,children:[S.relatedFiles.length>0&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,g.jsx)(r,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:o(`activity:skillDetail.relatedFiles`)})]}),S.relatedFiles.map(e=>{let t=Se(e);return t&&Q(t)?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>Me(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] transition-colors hover:border-primary/40 hover:text-primary`,title:o(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,g.jsx)(u,{className:`h-2.5 w-2.5`}),e]},e):(0,g.jsx)(`span`,{className:`rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e},e)})]}),S.references.length>0&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,g.jsx)(re,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:o(`activity:skillDetail.references`)})]}),S.references.map(e=>{let t=Se(e)??e.replace(/\.md$/,``);return Q(t)?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>Me(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] text-primary transition-colors hover:border-primary/30 hover:bg-primary/10`,title:o(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,g.jsx)(u,{className:`h-2.5 w-2.5`}),t]},e):(0,g.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:t},e)})]})]}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-xl border border-border/70 bg-card/70 shadow-sm`,children:we?(0,g.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center text-muted-foreground`,children:[(0,g.jsx)(s,{className:`mx-auto mb-2 h-6 w-6 animate-spin text-primary`}),(0,g.jsx)(`p`,{children:o(`activity:skillDetail.loadingContent`)})]}):D?(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,g.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border/70 bg-muted/30 px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(`activity:skillDetail.editingLabel`,{name:y.name})}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:o(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,g.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`font-medium text-destructive`:`text-warning`}`,children:o(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),L&&(0,g.jsx)(`span`,{className:`text-xs text-success animate-pulse`,children:o(`activity:skillDetail.draftSaved`)}),z&&(0,g.jsx)(`span`,{className:`animate-pulse text-xs text-warning`,children:o(`activity:skillDetail.draftRestored`)})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[N&&(0,g.jsx)(`span`,{className:`text-xs text-destructive`,children:N}),z&&(0,g.jsx)(`button`,{type:`button`,onClick:Le,className:`rounded-md border border-warning/35 px-2 py-1 text-[10px] text-warning transition-colors hover:bg-warning/10`,children:o(`activity:skillDetail.discardDraft`)}),(0,g.jsx)(`button`,{type:`button`,onClick:Ie,className:`rounded-md border border-border/70 px-2 py-1 text-xs transition-colors hover:bg-accent`,children:o(`common:action.cancel`)}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:o(F?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`rounded-md border px-2 py-1 text-xs transition-colors ${F?`border-primary/40 bg-primary/10 text-primary`:`border-border/70 text-muted-foreground hover:bg-accent`}`,children:(0,g.jsx)(ee,{className:`h-3 w-3 inline`})}),(0,g.jsx)(`button`,{type:`button`,onClick:Re,disabled:j||!k.trim(),className:`rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground shadow-sm shadow-primary/15 transition-colors hover:bg-primary/90 disabled:opacity-50`,children:j?(0,g.jsx)(s,{className:`h-3 w-3 animate-spin inline`}):o(`common:action.save`)})]})]}),F?(0,g.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,g.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(xe,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:o(`activity:skillDetail.contentPlaceholder`)})})}),(0,g.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-background/45 p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,g.jsx)(ye,{rehypePlugins:[ge],components:ve,children:k})})]}):(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(xe,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:o(`activity:skillDetail.contentPlaceholder`)})})]}):S?(0,g.jsx)(`div`,{ref:Te,className:`h-full min-h-0 overflow-y-auto overscroll-contain p-5 sm:p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,g.jsx)(ye,{rehypePlugins:[ge],components:ve,children:S.body})}):T?(0,g.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center`,children:[(0,g.jsx)(`p`,{className:`text-destructive mb-2`,children:o(`activity:skillDetail.loadFailed`)}),(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>{l&&y&&(w(!0),E(null),l.send({type:`skills.content`,payload:{name:y.name,source:y.source}}))},className:`mt-4 rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent`,children:o(`common:action.retry`)})]}):(0,g.jsx)(`div`,{className:`flex h-full min-h-[16rem] items-center justify-center p-8 text-center text-muted-foreground`,children:o(`activity:skillDetail.noContent`)})}),(0,g.jsx)(he,{open:!!G,onOpenChange:e=>{e||K(null)},children:(0,g.jsxs)(pe,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col gap-0 overflow-hidden p-0`,showCloseButton:!1,children:[(0,g.jsxs)(fe,{className:`flex shrink-0 items-center justify-between border-b border-border/70 p-4 sm:flex-row sm:justify-between sm:space-y-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(c,{className:`h-4 w-4 text-destructive`}),(0,g.jsx)(me,{className:`font-semibold text-sm`,children:o(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>K(null),"aria-label":o(`common:action.close`),className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:(0,g.jsx)(ae,{className:`h-4 w-4`})})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-4`,children:[(0,g.jsx)(`p`,{className:`text-sm`,children:G&&o(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:G&&o(`activity:skillDetail.uninstallRemovePath`,{path:G.path})})]}),(0,g.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-border/70 bg-muted/20 p-4`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent disabled:opacity-50`,children:o(`common:action.cancel`)}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>G&&He(G),disabled:q,className:`flex items-center gap-1.5 rounded-md bg-destructive px-3 py-1.5 text-xs text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[q&&(0,g.jsx)(s,{className:`h-3 w-3 animate-spin`}),o(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,g.jsx)(be,{icon:(0,g.jsx)(se,{className:`h-6 w-6`}),title:o(`activity:skillDetail.noSkillSelected`),description:o(`activity:skillDetail.selectSkillHint`),action:{label:o(`activity:skillDetail.goToChat`),onClick:$},className:e})}export{v as SkillDetailView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ai as t,Br as n,Ca as r,Ia as i,Ir as a,Jt as o,M as s,Nt as c,Oa as l,Oi as u,Rn as d,Va as f,Wn as p,Wt as m,_i as ee,an as h,ar as g,dt as te,fi as _,hn as v,la as y,lt as ne,ua as b,ut as x,vn as re,wi as S}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{t as C}from"./utils-D1fGupR8.js";import{i as w}from"./stores-BpVw7ENx.js";import{t as T}from"./button-DvHe5h9X.js";import{t as E}from"./input-oJ0Gehqp.js";import{b as D,x as O}from"./index-eK0iH6jY.js";var k=e(f(),1),A=ne(),ie={current:{labelKey:`activity:techStackStatus.current`,badge:`border-success/35 bg-success/10 text-success`,dot:`bg-success`,weight:0},update_available_safe:{labelKey:`activity:techStackStatus.update_available_safe`,badge:`border-info/35 bg-info/10 text-info`,dot:`bg-info`,weight:30},update_available_breaking:{labelKey:`activity:techStackStatus.update_available_breaking`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:50},vulnerable:{labelKey:`activity:techStackStatus.vulnerable`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:100},deprecated:{labelKey:`activity:techStackStatus.deprecated`,badge:`border-destructive/35 bg-destructive/10 text-destructive`,dot:`bg-destructive`,weight:70},yanked:{labelKey:`activity:techStackStatus.yanked`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:80},unmaintained_suspected:{labelKey:`activity:techStackStatus.unmaintained_suspected`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:60},blocked_by_constraints:{labelKey:`activity:techStackStatus.blocked_by_constraints`,badge:`border-warning/30 bg-warning/5 text-warning`,dot:`bg-warning`,weight:40},private_or_unresolved:{labelKey:`activity:techStackStatus.private_or_unresolved`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:10},local_path:{labelKey:`activity:techStackStatus.local_path`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},git_dependency:{labelKey:`activity:techStackStatus.git_dependency`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unsupported:{labelKey:`activity:techStackStatus.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unknown:{labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:20}},ae={labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function j(e){return ie[e]??ae}var M={npm:{label:`npm / Node.js`,icon:d},python:{label:`Python`,icon:u},rust:{label:`Rust`,icon:o},go:{label:`Go`,icon:v},dotnet:{label:`.NET`,icon:p},php:{label:`PHP`,icon:c},dart:{label:`Dart / Flutter`,icon:S},maven:{label:`Maven`,icon:l},gradle:{label:`Gradle`,icon:b},ruby:{label:`Ruby`,icon:a},swift:{label:`Swift`,icon:x},elixir:{label:`Elixir`,icon:c},cpp:{label:`C / C++`,icon:t}},oe={labelKey:`activity:techStackStatus.unknown`};function N(e,t){let n=P(e);return n.labelKey?t(n.labelKey):n.label??e}function P(e){return M[e]??oe}function F({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=P(e);if(!n.icon)return null;let r=n.icon;return(0,A.jsx)(r,{className:t})}function se(e){return j(e.status).weight>=50}var I=[`critical`,`high`,`medium`,`low`,`info`],L={critical:{labelKey:`activity:techStackSeverity.critical`,badge:`border-destructive/45 bg-destructive/15 text-destructive`},high:{labelKey:`activity:techStackSeverity.high`,badge:`border-destructive/35 bg-destructive/10 text-destructive`},medium:{labelKey:`activity:techStackSeverity.medium`,badge:`border-warning/35 bg-warning/10 text-warning`},low:{labelKey:`activity:techStackSeverity.low`,badge:`border-info/35 bg-info/10 text-info`},info:{labelKey:`activity:techStackSeverity.info`,badge:`border-border/70 bg-muted text-muted-foreground`}},R={none:`activity:techStackAction.none`,upgrade_patch:`activity:techStackAction.upgrade_patch`,upgrade_minor:`activity:techStackAction.upgrade_minor`,upgrade_major:`activity:techStackAction.upgrade_major`,replace:`activity:techStackAction.replace`,remove:`activity:techStackAction.remove`,investigate:`activity:techStackAction.investigate`},z={full:{labelKey:`activity:techStackCoverage.full`,badge:`border-success/35 bg-success/10 text-success`,noteKey:void 0},partial:{labelKey:`activity:techStackCoverage.partial`,badge:`border-warning/35 bg-warning/10 text-warning`,noteKey:`activity:techStackCoverage.partialNote`},unsupported:{labelKey:`activity:techStackCoverage.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,noteKey:`activity:techStackCoverage.unsupportedNote`}};function B(e){return z[e]??z.unsupported}function V(e){if(!e)return null;let t=/^\D*(\d+)/.exec(e);if(!t?.[1])return null;let n=Number(t[1]);return Number.isFinite(n)?n:null}function H(e){let t=V(e.locked??e.installed??e.requested),n=V(e.latestStable);if(t===null||n===null||n<=t)return{majorsBehind:0,label:null};let r=n-t;return{majorsBehind:r,label:`${r} major${r===1?``:`s`} behind`}}function U(e){return e.locked??e.installed??e.requested??null}function W(e){return e.confidence<1}function G({className:e,children:t}){return(0,A.jsx)(`span`,{className:C(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function K({label:e,value:t,hint:n,tone:r=`default`}){let i={default:`text-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,destructive:`text-destructive`}[r];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/55 px-3 py-2.5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.035)]`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:C(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,A.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function ce({dependency:e,findings:t,deepDive:n,onDeepDive:a,onBack:o,coverage:s}){let{t:c}=i(),l=j(e.status),u=U(e),d=H(e),f=s?B(s).noteKey:void 0;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:o,"aria-label":c(`activity:techStack.backToDependencyList`),className:`shrink-0 md:hidden`,children:(0,A.jsx)(r,{className:`size-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`h2`,{className:`min-w-0 truncate font-mono text-sm font-bold text-foreground`,children:e.name}),(0,A.jsx)(G,{className:l.badge,children:c(l.labelKey)})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[N(e.ecosystem,c),` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,A.jsx)(`span`,{className:`text-warning`,children:c(f)})]})]})]})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-baseline gap-2 font-mono text-xs`,children:[(0,A.jsx)(`span`,{className:`text-foreground`,children:u??`—`}),e.latestStable&&e.latestStable!==u&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`text-info`,children:e.latestStable})]}),d.label&&(0,A.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[`(`,d.label,`)`]})]})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-2 gap-px border border-border/70 bg-border/60`,children:[(0,A.jsx)(q,{label:c(`activity:techStack.constraint`),value:e.requested??`—`,mono:!0}),(0,A.jsx)(q,{label:c(`activity:techStack.locked`),value:e.locked??`—`,mono:!0}),(0,A.jsx)(q,{label:c(`activity:techStack.latestStable`),value:e.latestStable??`—`,mono:!0}),(0,A.jsx)(q,{label:c(`activity:techStack.license`),value:e.license??`—`}),e.wanted&&(0,A.jsx)(q,{label:c(`activity:techStack.wanted`),value:e.wanted,mono:!0}),e.resolvable&&(0,A.jsx)(q,{label:c(`activity:techStack.resolvable`),value:e.resolvable,mono:!0}),e.purl&&(0,A.jsx)(q,{label:c(`activity:techStack.purl`),value:e.purl,mono:!0}),(0,A.jsx)(q,{label:c(`activity:techStack.registryFlags`),value:[e.deprecated&&`deprecated`,e.yanked&&`yanked`].filter(Boolean).join(`, `)||`none`})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:c(`activity:techStack.findings`)}),(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>a(e),disabled:n.status===`loading`,className:`h-7 text-[10px]`,children:[n.status===`loading`?(0,A.jsx)(g,{className:`size-3 animate-spin`}):(0,A.jsx)(m,{className:`size-3`}),n.status===`loading`?`Researching…`:`Deep dive`]})]}),n.status===`error`&&n.error&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-1.5 text-[10px] text-destructive`,children:n.error}),t.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:c(`activity:techStack.nothingFlaggedRunADeepDive`)}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:L[e.severity].badge,children:c(L[e.severity].labelKey)}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?c(R[e.action]):e.action}),W(e)&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(m,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk})]},e.id))})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsx)(`h3`,{className:`mb-1.5 text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:c(`activity:techStack.evidence`)}),e.evidence.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:c(`activity:techStack.noEvidenceRecorded`)}):(0,A.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.evidence.map((t,n)=>(0,A.jsxs)(`li`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:t.kind}),(0,A.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(t.retrievedAt).toLocaleString()})]}),t.source.startsWith(`http`)?(0,A.jsxs)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`mt-1 flex min-w-0 items-center gap-1 truncate text-[10px] text-info underline-offset-2 hover:underline`,children:[(0,A.jsx)(`span`,{className:`truncate`,children:t.source}),(0,A.jsx)(_,{className:`size-2.5 shrink-0`})]}):(0,A.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:t.source}),t.detail&&(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-muted-foreground`,children:t.detail})]},`${e.id}-evidence-${n}`))})]})]})]})}function q({label:e,value:t,mono:n}){return(0,A.jsxs)(`div`,{className:`bg-card/55 px-2.5 py-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:C(`mt-0.5 truncate text-[11px] text-foreground`,n&&`font-mono`),children:t})]})}var J=`grid grid-cols-[minmax(0,2.2fr)_minmax(0,1.6fr)_minmax(0,1.1fr)] gap-2`;function le({dependencies:e,selectedId:t,hasDependencies:n,coverageByWorkspaceId:r,onSelect:a}){let{t:o}=i(),c=O(e,30);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:n?`No dependencies match the current filters.`:`No dependencies inventoried yet. Run a scan to populate the inventory.`})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:C(J,`shrink-0 border-b border-border/70 bg-card/45 px-3 py-1.5 text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`),children:[(0,A.jsx)(`span`,{children:o(`activity:techStack.package`)}),(0,A.jsx)(`span`,{children:o(`activity:techStack.installedLatest`)}),(0,A.jsx)(`span`,{children:o(`activity:techStack.status`)})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(s,{className:`h-full`,"aria-label":o(`activity:techStack.dependencies`),children:c.pageItems.map(e=>(0,A.jsx)(Y,{dependency:e,selected:e.id===t,coverage:r?.get(e.workspaceId),onSelect:a},e.id))})}),(0,A.jsx)(D,{page:c.page,pageSize:c.pageSize,totalItems:c.totalItems,onPageChange:c.setPage,itemLabel:`dependencies`})]})}function Y({dependency:e,selected:t,coverage:n,onSelect:r}){let{t:a}=i(),o=j(e.status),s=U(e),c=H(e),l=n?B(n).noteKey:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e),"aria-current":t,className:C(J,`w-full items-center border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-accent/40`,t&&`bg-accent/60`),children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:C(`size-1.5 shrink-0`,o.dot),"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e.name})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem,className:`mr-0.5 inline-block size-3 align-text-bottom`}),N(e.ecosystem,a),` · `,e.direct?`direct`:`transitive`,` · `,e.scope,l&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`span`,{className:`text-warning`,children:a(l)})]})]})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5 font-mono text-[11px]`,children:[(0,A.jsx)(`span`,{className:`truncate text-foreground`,children:s??`—`}),e.latestStable&&e.latestStable!==s&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`truncate text-info`,children:e.latestStable})]})]}),c.label?(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:c.label}):e.requested&&(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:e.requested})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,A.jsx)(G,{className:o.badge,children:a(o.labelKey)}),e.deprecated&&(0,A.jsx)(G,{className:`border-destructive/35 bg-destructive/10 text-destructive`,children:`dep`}),e.yanked&&(0,A.jsx)(G,{className:`border-destructive/45 bg-destructive/15 text-destructive`,children:`yank`})]})]})}function ue({findings:e,dependenciesById:t,onSelectDependency:n}){let{t:r}=i(),a=O(e,20);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsxs)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:[r(`activity:techStack.noFindingsRun`),` `,(0,A.jsx)(`span`,{className:`font-mono text-foreground`,children:r(`activity:techStack.analyze`)}),` `,r(`activity:techStack.toCheckVersionsAndAdvisoriesAgainst`)]})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-4`,children:I.map(e=>[e,a.pageItems.filter(t=>t.severity===e)]).filter(([,e])=>e.length>0).map(([e,i])=>(0,A.jsxs)(`section`,{children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,A.jsx)(G,{className:L[e].badge,children:r(L[e].labelKey)}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] tabular-nums text-muted-foreground`,children:i.length})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map(e=>(0,A.jsx)(X,{finding:e,dependency:t.get(e.dependencyId),onSelectDependency:n},e.id))})]},e))})}),(0,A.jsx)(D,{page:a.page,pageSize:a.pageSize,totalItems:a.totalItems,onPageChange:a.setPage,itemLabel:`findings`})]})}function X({finding:e,dependency:t,onSelectDependency:n}){let{t:r}=i(),a=W(e);return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>n(e.dependencyId),className:`min-w-0 truncate font-mono text-xs text-foreground underline-offset-2 hover:underline`,children:t?.name??e.dependencyId}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?r(R[e.action]):e.action}),a&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(m,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk}),e.evidence.length>0&&(0,A.jsx)(`ul`,{className:C(`mt-1.5 flex flex-col gap-0.5`),children:e.evidence.slice(0,4).map((t,n)=>(0,A.jsx)(`li`,{className:`min-w-0 truncate text-[10px]`,children:t.source.startsWith(`http`)?(0,A.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`text-info underline-offset-2 hover:underline`,children:t.detail??t.source}):(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:t.detail??t.source})},`${e.id}-${n}`))})]})}function de({searchQuery:e,ecosystemFilter:t,statusFilter:r,directOnly:a,sort:o,hasFilters:s,ecosystems:c,statuses:l,visibleCount:u,totalCount:d,onSearchChange:f,onEcosystemFilterChange:p,onStatusFilterChange:m,onToggleDirectOnly:ee,onSortChange:g,onClearFilters:_}){let{t:v}=i();return(0,A.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,A.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(E,{"aria-label":v(`activity:techStack.searchDependencies`),value:e,onChange:e=>f(e.target.value),placeholder:v(`activity:techStack.searchByPackageName`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,A.jsx)(`button`,{type:`button`,"aria-label":v(`activity:techStack.clearSearch`),onClick:()=>f(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(te,{className:`size-3.5`})})]}),(0,A.jsx)(T,{variant:a?`default`:`outline`,size:`sm`,onClick:ee,"aria-pressed":a,title:v(`activity:techStack.showOnlyDependenciesThisProjectDeclaresItself`),className:`shrink-0`,children:v(`activity:techStack.directOnly`)}),s&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:_,"aria-label":v(`activity:techStack.clearAllFilters`),title:v(`activity:techStack.clearAllFilters`),className:`shrink-0`,children:(0,A.jsx)(n,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-ecosystem-filter`,children:v(`activity:techStack.filterByEcosystem`)}),(0,A.jsxs)(`select`,{id:`techstack-ecosystem-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:v(`activity:techStack.allEcosystems`)}),c.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[N(e,v),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:v(`activity:techStack.filterByStatus`)}),(0,A.jsxs)(`select`,{id:`techstack-status-filter`,value:r,onChange:e=>m(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:v(`activity:techStack.allStatuses`)}),l.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[v(j(e).labelKey),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:v(`activity:techStack.sortDependencies`)}),(0,A.jsxs)(`select`,{id:`techstack-sort`,value:o,onChange:e=>g(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`attention`,children:v(`activity:techStack.sortNeedsAttention`)}),(0,A.jsx)(`option`,{value:`drift`,children:v(`activity:techStack.sortMostOutOfDate`)}),(0,A.jsx)(`option`,{value:`name`,children:v(`activity:techStack.sortName`)})]})]})]}),(0,A.jsx)(`p`,{className:C(`text-[10px] text-muted-foreground`,s&&`text-info`),children:u===d?`${d} dependencies`:`${u} of ${d} dependencies`})]})}var fe=[{id:`dependencies`,labelKey:`activity:techStack.tabDependencies`},{id:`findings`,labelKey:`activity:techStack.tabFindings`},{id:`workspaces`,labelKey:`activity:techStack.tabWorkspaces`},{id:`trends`,labelKey:`activity:techStack.tabTrends`},{id:`remediation`,labelKey:`activity:techStack.tabRemediation`}],Z=new Set([`npm`,`python`,`rust`,`go`,`php`,`dotnet`]);function pe(){let{t:e}=i(),t=w(e=>e.snapshot),n=w(e=>e.stale),r=w(e=>e.loading),a=w(e=>e.error),o=w(e=>e.activeJob),[s,c]=(0,k.useState)(`dependencies`),[l,u]=(0,k.useState)(``),[d,f]=(0,k.useState)(`all`),[p,h]=(0,k.useState)(`all`),[_,v]=(0,k.useState)(!1),[y,ne]=(0,k.useState)(`attention`),[b,x]=(0,k.useState)(null),[S,E]=(0,k.useState)([]),[D,O]=(0,k.useState)({status:`idle`,error:null}),[ie,ae]=(0,k.useState)(null),[M,oe]=(0,k.useState)(null),[N,P]=(0,k.useState)(new Set),[F,I]=(0,k.useState)(!1),L=(0,k.useCallback)(async()=>{let e=w.getState();e.setLoading(!0),e.setError(null);try{let t=await fetch(`/api/techstack/snapshot`);if(t.status===404){e.setSnapshot(null,!1);return}if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);let n=await t.json();e.setSnapshot(n.snapshot,n.stale)}catch(t){e.setError(t instanceof Error?t.message:String(t))}},[]),R=(0,k.useCallback)(async e=>{let t=w.getState();t.setLoading(!0),t.setError(null);try{let n=await fetch(`/api/techstack/${e}`,{method:`POST`}),r=await n.json();if(!n.ok||!r.jobId)throw Error(r.error??`HTTP ${n.status}: ${n.statusText}`);t.jobStarted(r.jobId,e)}catch(e){t.setError(e instanceof Error?e.message:String(e))}},[]),z=(0,k.useCallback)(async()=>{let e=w.getState().activeJob;if(e)try{let t=await fetch(`/api/techstack/jobs/${encodeURIComponent(e.id)}/cancel`,{method:`POST`});if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);w.getState().jobCancelled(e.id)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}},[]),B=(0,k.useCallback)(async e=>{O({status:`loading`,error:null});try{let t=await fetch(`/api/techstack/deps/${encodeURIComponent(e.id)}/research`,{method:`POST`}),n=await t.json();if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);E(n.findings??[]),O({status:`idle`,error:null})}catch(e){O({status:`error`,error:e instanceof Error?e.message:String(e)})}},[]);(0,k.useEffect)(()=>{L()},[L]),(0,k.useEffect)(()=>{s!==`trends`&&s!==`remediation`||fetch(`/api/techstack/${s===`trends`?`trends`:`remediation`}`).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);t.trend&&ae(t.trend),t.plan&&oe(t.plan)}).catch(e=>w.getState().setError(e instanceof Error?e.message:String(e)))},[s,t?.id]);let V=(0,k.useCallback)(async()=>{if(N.size!==0){I(!0);try{let e=await fetch(`/api/techstack/remediation/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvedItems:[...N]})}),t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);P(new Set),await R(`inventory`)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}finally{I(!1)}}},[N,R]);(0,k.useEffect)(()=>{E([]),O({status:`idle`,error:null})},[t?.id]);let U=(0,k.useMemo)(()=>t?.dependencies??[],[t]),W=(0,k.useMemo)(()=>t?.findings??[],[t]),G=(0,k.useMemo)(()=>new Map(U.map(e=>[e.id,e])),[U]),q=(0,k.useMemo)(()=>ve(U.map(e=>e.ecosystem)),[U]),J=(0,k.useMemo)(()=>ve(U.map(e=>e.status)),[U]),Y=(0,k.useMemo)(()=>new Map(t?.workspaces.map(e=>[e.id,e.coverage])??[]),[t]),X=(0,k.useMemo)(()=>{let e=l.trim().toLowerCase(),t=[...U.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||d!==`all`&&t.ecosystem!==d||p!==`all`&&t.status!==p||_&&!t.direct))];return y===`name`?t.sort((e,t)=>e.name.localeCompare(t.name)):y===`drift`?t.sort((e,t)=>H(t).majorsBehind-H(e).majorsBehind||e.name.localeCompare(t.name)):t.sort((e,t)=>j(t.status).weight-j(e.status).weight||Number(t.direct)-Number(e.direct)||e.name.localeCompare(t.name)),t},[U,l,d,p,_,y]),Z=b?G.get(b):void 0,pe=(0,k.useMemo)(()=>Z?[...W.filter(e=>e.dependencyId===Z.id),...S.filter(e=>e.dependencyId===Z.id)]:[],[W,S,Z]),be=(0,k.useMemo)(()=>U.filter(se).length,[U]),xe=(0,k.useMemo)(()=>U.filter(e=>H(e).majorsBehind>0).length,[U]),Se=(0,k.useMemo)(()=>U.filter(e=>e.status===`vulnerable`).length,[U]),Ce=l.trim()!==``||d!==`all`||p!==`all`||_,we=(0,k.useCallback)(()=>{u(``),f(`all`),h(`all`),v(!1)},[]),$=!!(o&&![`completed`,`failed`,`cancelled`].includes(o.status)),Te=(0,k.useCallback)(e=>{x(e),c(`dependencies`)},[]);return(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,A.jsx)(`header`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:e(`activity:techStack.techstack`)}),(0,A.jsx)(`span`,{className:`border border-info/35 bg-info/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-info`,children:t?`${t.workspaces.length} workspaces`:`no scan yet`}),n&&(0,A.jsx)(`span`,{className:`border border-warning/35 bg-warning/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-warning`,children:e(`activity:techStack.staleGt24h`)})]}),(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground sm:text-xs`,children:t?`${t.targetRoot} · scanned ${new Date(t.createdAt).toLocaleString()}`:`Scan the open project to inventory its dependencies.`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>void R(`inventory`),disabled:$,title:e(`activity:techStack.offlineReReadManifestsAndLockfiles`),children:[(0,A.jsx)(re,{className:C(`size-3.5`,$&&`animate-spin`)}),(0,A.jsx)(`span`,{className:`hidden sm:inline`,children:e(`activity:techStack.refresh`)})]}),(0,A.jsxs)(T,{size:`sm`,onClick:()=>void R(`analyze`),disabled:$,title:e(`activity:techStack.checkRegistriesAndAdvisoriesThenInterpretTheResultsWithTheModel`),children:[(0,A.jsx)(m,{className:`size-3.5`}),e(`activity:techStack.analyze`)]}),$&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>void z(),"aria-label":e(`activity:techStack.cancelJob`),children:(0,A.jsx)(te,{className:`size-4`})}),(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>t&&ye(t),disabled:!t,"aria-label":e(`activity:techStack.exportSnapshotAsJson`),title:e(`activity:techStack.exportSnapshotAsJson`),children:(0,A.jsx)(ee,{className:`size-4`})})]})]})}),t&&(0,A.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-px border-b border-border/70 bg-border/60 sm:grid-cols-4`,children:[(0,A.jsx)(K,{label:e(`activity:techStack.dependencies`),value:U.length,hint:`${X.length} visible`}),(0,A.jsx)(K,{label:e(`activity:techStack.outdated`),value:xe,hint:e(`activity:techStack.majorsBehind`),tone:xe>0?`warning`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.vulnerable`),value:Se,hint:e(`activity:techStack.knownAdvisories`),tone:Se>0?`destructive`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.findings`),value:W.length,hint:`${be} need attention`,tone:W.length>0?`info`:`default`})]}),($||a)&&(0,A.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[$&&o&&(0,A.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-info`,children:[(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),(0,A.jsx)(`span`,{className:`font-mono`,children:o.status}),o.progress&&(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[o.progress.completed,`/`,o.progress.total]})]}),a&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:a}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>void L(),className:`underline`,children:e(`activity:techStack.retry`)})]})]}),r&&!t?(0,A.jsx)(Q,{}):t?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`nav`,{className:`flex shrink-0 gap-1 border-b border-border/70 px-2`,children:fe.map(t=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>c(t.id),"aria-current":s===t.id,className:C(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,s===t.id?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e(t.labelKey),t.id===`findings`&&W.length>0&&(0,A.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:W.length})]},t.id))}),s===`dependencies`&&(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(340px,1fr)_minmax(0,1.15fr)]`,children:[(0,A.jsxs)(`section`,{className:C(`min-h-0 border-r border-border/70`,Z?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:techStack.dependencyList`),children:[(0,A.jsx)(de,{searchQuery:l,ecosystemFilter:d,statusFilter:p,directOnly:_,sort:y,hasFilters:Ce,ecosystems:q,statuses:J,visibleCount:X.length,totalCount:U.length,onSearchChange:u,onEcosystemFilterChange:f,onStatusFilterChange:h,onToggleDirectOnly:()=>v(e=>!e),onSortChange:ne,onClearFilters:we}),(0,A.jsx)(le,{dependencies:X,selectedId:b,hasDependencies:U.length>0,coverageByWorkspaceId:Y,onSelect:e=>x(e.id)})]}),(0,A.jsx)(`section`,{className:C(`min-h-0`,Z?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:techStack.dependencyDetail`),children:Z?(0,A.jsx)(ce,{dependency:Z,findings:pe,deepDive:D,onDeepDive:B,onBack:()=>x(null),coverage:Y.get(Z.workspaceId)}):(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:e(`activity:techStack.selectADependencyToSeeIts`)})})})]}),s===`findings`&&(0,A.jsx)(ue,{findings:W,dependenciesById:G,onSelectDependency:Te}),s===`workspaces`&&(0,A.jsx)(ge,{snapshot:t}),s===`trends`&&(0,A.jsx)(me,{trend:ie}),s===`remediation`&&(0,A.jsx)(he,{plan:M,approved:N,applying:F,onToggle:e=>P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onApply:()=>void V()})]}):(0,A.jsx)(_e,{onScan:()=>void R(`inventory`),disabled:$})]})}function me({trend:e}){return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[e.snapshots,` snapshots`,e.vulnerabilityHalfLifeMs===void 0?``:` · vulnerability half-life ${(e.vulnerabilityHalfLifeMs/864e5).toFixed(1)} days`]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,A.jsxs)(`div`,{className:`grid grid-cols-4 border border-border/70 bg-card/40 p-2 text-xs`,children:[(0,A.jsx)(`span`,{children:new Date(e.createdAt).toLocaleDateString()}),(0,A.jsxs)(`span`,{children:[e.dependencies,` deps`]}),(0,A.jsxs)(`span`,{className:`text-warning`,children:[e.outdated,` outdated`]}),(0,A.jsxs)(`span`,{className:`text-destructive`,children:[e.vulnerable,` vulnerable`]})]},e.snapshotId))})]}):(0,A.jsx)(Q,{})}function he({plan:e,approved:t,applying:n,onToggle:r,onApply:a}){let{t:o}=i();return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.warning}),(0,A.jsxs)(T,{size:`sm`,disabled:t.size===0||n,onClick:a,children:[n&&(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),`Apply `,t.size>0?t.size:``]})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.items.map(e=>{let n=`${e.workspaceId}:${e.ecosystem}:${e.dependencyName}:${e.action}`,i=e.action===`replace`||e.action===`investigate`||!Z.has(e.ecosystem);return(0,A.jsxs)(`label`,{className:C(`flex gap-3 border border-border/70 bg-card/40 p-2.5`,i?`cursor-not-allowed opacity-65`:`cursor-pointer`),children:[(0,A.jsx)(`input`,{type:`checkbox`,disabled:i,checked:t.has(n),onChange:()=>r(n)}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`span`,{className:`block font-mono text-xs`,children:[e.dependencyName,` · `,e.action]}),(0,A.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[e.currentVersion??`?`,` → `,e.targetVersion??`latest`,` · `,e.rationale]}),i&&(0,A.jsx)(`span`,{className:`block text-[10px] text-warning`,children:o(`activity:techStack.requiresAManualPackageChoice`)})]})]},n)}),e.items.length===0&&(0,A.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:o(`activity:techStack.noRemediationNeeded`)})]})]}):(0,A.jsx)(Q,{})}function ge({snapshot:e}){let{t}=i(),n=(0,k.useMemo)(()=>{let t=new Map;for(let n of e.dependencies)t.set(n.workspaceId,(t.get(n.workspaceId)??0)+1);return t},[e]);return e.workspaces.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`activity:techStack.noWorkspacesDetected`)})}):(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.workspaces.map(e=>{let r=z[e.coverage];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate font-mono text-xs text-foreground`,children:e.relativeRoot}),(0,A.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem}),(0,A.jsx)(`span`,{children:N(e.ecosystem,t)}),e.packageManager?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(`span`,{children:e.packageManager})]}):null,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsxs)(`span`,{children:[n.get(e.id)??0,` deps`]})]})]}),(0,A.jsx)(`span`,{className:C(`shrink-0 border px-1.5 py-0.5 text-[10px] font-medium`,r.badge),children:t(r.labelKey)})]}),e.manifests.length>0&&(0,A.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.manifests.map(e=>(0,A.jsx)(`span`,{className:`border border-border/70 bg-background/45 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:e.split(/[/\\]/).pop()},e))})]},e.id)})})})}function Q(){let{t:e}=i();return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,A.jsx)(g,{className:`size-5 animate-spin text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:techStack.loadingSnapshot`)})]})})}function _e({onScan:e,disabled:t}){let{t:n}=i(),r=(0,k.useMemo)(()=>Object.values(M).map(e=>e.label??``).filter(Boolean).join(`, `),[]);return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-3 text-center`,children:[(0,A.jsx)(`div`,{className:`flex size-14 items-center justify-center border border-info/25 bg-info/5 text-info`,children:(0,A.jsx)(y,{className:`size-6`})}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`activity:techStack.noInventoryYet`)}),(0,A.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`TechStack reads every manifest and lockfile in the open project — `,r,` — and compares what you have against the upstream registries.`]}),(0,A.jsxs)(T,{size:`sm`,onClick:e,disabled:t,children:[(0,A.jsx)(re,{className:C(`size-3.5`,t&&`animate-spin`)}),n(`activity:techStack.scanThisProject`)]})]})})}function ve(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}function ye(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`techstack.json`,r.click(),URL.revokeObjectURL(n)}export{pe as TechStackView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Fa as t,Ia as n,Ki as r,Li as i,Ot as a,Va as o,dt as s,lt as c,xr as l,za as u}from"./vendor-AeHpGMaG.js";import"./i18n-nlW2iAya.js";import{n as d,t as f}from"./utils-D1fGupR8.js";var p=e(o(),1),m=c();function h(){return`toast_${d()}`}var g=8e3,_=t(e=>({toasts:[],push:t=>{let n=h();return e(e=>({toasts:[...e.toasts,{...t,id:n}]})),n},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),v={success:(e,t=3500)=>_.getState().push({message:e,variant:`success`,ttl:t}),error:(e,t=6e3)=>_.getState().push({message:e,variant:`error`,ttl:t}),warn:(e,t=4500)=>_.getState().push({message:e,variant:`warn`,ttl:t}),info:(e,t=3500)=>_.getState().push({message:e,variant:`info`,ttl:t}),undoable:(e,t,n=u.t(`common:action.undo`),r=g)=>_.getState().push({message:e,variant:`info`,ttl:r,action:{label:n,onClick:t}}),dismiss:e=>_.getState().dismiss(e)};function y({variant:e}){return e===`success`?(0,m.jsx)(r,{className:`h-4 w-4 text-success`}):e===`error`?(0,m.jsx)(i,{className:`h-4 w-4 text-destructive`}):e===`warn`?(0,m.jsx)(a,{className:`h-4 w-4 text-warning`}):(0,m.jsx)(l,{className:`h-4 w-4 text-info`})}function b({entry:e}){let{t}=n(),r=_(e=>e.dismiss);return(0,p.useEffect)(()=>{let t=setTimeout(()=>r(e.id),e.ttl);return()=>clearTimeout(t)},[e.id,e.ttl,r]),(0,m.jsxs)(`div`,{className:f(`flex items-start gap-2 rounded-lg border bg-popover shadow-lg px-3 py-2 text-sm max-w-sm`,`animate-message`,e.variant===`error`&&`border-destructive/40`,e.variant===`warn`&&`border-warning/40`,e.variant===`success`&&`border-success/40`),children:[(0,m.jsx)(y,{variant:e.variant}),(0,m.jsx)(`div`,{className:`flex-1 min-w-0 whitespace-pre-wrap break-words leading-snug`,children:e.message}),e.action&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.onClick(),r(e.id)},className:`shrink-0 font-medium text-primary hover:underline`,children:e.action.label}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:`text-muted-foreground hover:text-foreground`,title:t(`activity:toast.dismiss`),"aria-label":t(`activity:toast.dismiss`),children:(0,m.jsx)(s,{className:`h-3.5 w-3.5`})})]})}function x(){let{t:e}=n(),t=_(e=>e.toasts);return t.length===0?null:(0,m.jsx)(`section`,{className:`fixed bottom-4 right-4 z-[60] flex flex-col gap-2 pointer-events-auto`,"aria-label":e(`activity:toaster.notifications`),"aria-live":`polite`,children:t.map(e=>(0,m.jsx)(b,{entry:e},e.id))})}export{v as n,x as t};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{Fa as e,Pa as t}from"./vendor-AeHpGMaG.js";import{n}from"./utils-D1fGupR8.js";function r(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 i(e){return e!==`tool_use`&&e!==`tool_call`}var a=/<nextsteps\b[^>]*>\s*\n+/i,o=/^(?:(\d+)[.)]\s*|[-*•]\s*)(.+?)(\s+auto="true")?$/,s=6;function c(e,t=!0){return t?d(e):u(e)}function l(e,t,n,r){e.push(r?{index:t,text:n,auto:!0}:{index:t,text:n})}function u(e){let t=e.split(`
|
|
2
|
-
`),n=[],r=new Set;for(let e of t){let t=e.trim();if(!t)continue;let i=o.exec(t);if(!i)continue;let a=i[1],c=i[2].trim(),u;if(u=a===void 0?n.length+1:Number.parseInt(a,10),r.has(u))continue;r.add(u);let d=!!i[3]&&n.length===0&&u===1;if(l(n,u,c,d),n.length>=s)break}return{steps:n,texts:n.map(e=>e.text),stripped:e,autoTexts:n.filter(e=>e.auto).map(e=>e.text)}}function d(e){let t=a.exec(e);if(!t)return{steps:[],texts:[],stripped:e,autoTexts:[]};let n=t.index+t[0].length,r=e.slice(n),i=r.split(`
|
|
3
|
-
`),c=[],u=new Set;for(let e of i){let t=e.trim();if(!t)continue;let n=o.exec(t);if(!n)break;let r=n[1],i=n[2].trim(),a;if(a=r===void 0?c.length+1:Number.parseInt(r,10),u.has(a))continue;u.add(a);let d=!!n[3]&&c.length===0&&a===1;if(l(c,a,i,d),c.length>=s)break}if(c.length===0||!r.includes(`</nextsteps>`))return{steps:[],texts:[],stripped:e,autoTexts:[]};let d=c.map(e=>e.text),p=c.filter(e=>e.auto).map(e=>e.text),m=t.index,h=t[0].length+f(r,c.length);return{steps:c,texts:d,stripped:(e.slice(0,m)+e.slice(m+h)).replace(/\n{3,}/g,`
|
|
4
|
-
|
|
5
|
-
`).trim(),autoTexts:p}}function f(e,t){let n=e.indexOf(`</nextsteps>`);if(n!==-1){let t=n+12;return e[t]===`
|
|
6
|
-
`&&(t+=1),t}let r=e.split(`
|
|
7
|
-
`),i=0,a=0;for(let e of r){let n=e.trim();if(!n||!o.exec(n))break;if(i+=e.length+1,a++,a>=t){--i;break}}return i}function p(e){return e.replace(/<next_?steps\b[^>]*>[\s\S]*?<\/next_?steps>/gi,``).replace(/<next_?steps\b[^>]*\/?>/gi,``).replace(/\n{3,}/g,`
|
|
8
|
-
|
|
9
|
-
`).trim()}function m(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(`
|
|
10
|
-
`),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(`
|
|
11
|
-
`)}).join(`
|
|
12
|
-
|
|
13
|
-
`)}var h=1e3,g=new Map;function _(e){let t=g.get(e);t!==void 0&&(clearTimeout(t),g.delete(e))}var v=0;function y(){return v+=1,v}function b(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.text!=`string`||t.mode!==`btw`&&t.mode!==`steer`&&t.mode!==`queue`||typeof t.addedAt!=`number`||!Number.isFinite(t.addedAt))return null;let n=typeof t.itemId==`number`&&Number.isSafeInteger(t.itemId)&&t.itemId>0?t.itemId:y();return v=Math.max(v,n),{text:t.text,mode:t.mode,addedAt:t.addedAt,itemId:n,...t.images?{images:t.images}:{}}}var x=1800,S=2*1024*1024;function C(e,t=S){if(e.length<=t)return e;if(t<=55){let n=Math.ceil(t/2);return e.slice(0,n)+e.slice(e.length-(t-n))}let n=t-55,r=Math.ceil(n/2);return e.slice(0,r)+`
|
|
14
|
-
|
|
15
|
-
… [older streamed text omitted to protect memory] …
|
|
16
|
-
|
|
17
|
-
`+e.slice(e.length-(n-r))}var w=new WeakMap;function T(e){if(e===void 0)return 0;let t=typeof e==`object`&&!!e;if(t){let t=w.get(e);if(t!==void 0)return t}let n;try{n=JSON.stringify(e).length*2}catch{n=S*2}return t&&w.set(e,n),n}function E(e,t){let n=C(e.content,t),r=e.toolResult===void 0?void 0:C(e.toolResult,t),i=e.thinkingLog?{...e.thinkingLog,text:C(e.thinkingLog.text,t)}:void 0,a=T(e.toolInput)>t*2?`[tool input omitted from live transcript to protect memory]`:e.toolInput;return n===e.content&&r===e.toolResult&&i?.text===e.thinkingLog?.text&&a===e.toolInput?e:{...e,content:n,...r===void 0?{}:{toolResult:r},...i?{thinkingLog:i}:{},...a===void 0?{}:{toolInput:a}}}function D(e){let t=384+e.content.length*2+(e.toolResult?.length??0)*2+(e.thinkingLog?.text.length??0)*2+T(e.toolInput);for(let n of e.attachments??[])t+=(n.dataUrl?.length??0)*2+192;for(let n of e.sageLines??[])t+=n.length*2;for(let n of e.progressLines??[])t+=n.length*2;return t}function O(e,t={}){let n=Math.max(1,Math.floor(t.maxMessages??h)),r=Math.max(1,Math.floor(t.maxBytes??50331648)),i=Math.max(1,Math.floor(t.maxFieldChars??2097152)),a=[],o=0;for(let t=e.length-1;t>=0&&a.length<n;--t){let n=E(e[t],i),s=D(n);if(s>r&&n.attachments?.some(e=>e.dataUrl)&&(n={...n,attachments:n.attachments.map(e=>({...e,dataUrl:void 0}))},s=D(n)),a.length>0&&o+s>r)break;a.push(n),o+=s}return a.reverse(),a}function k(e){let t=new Map;for(let n of e)n.role===`tool`&&n.toolUseId&&t.set(n.toolUseId,n.id);return t}var A=e()(t((e,t)=>({messages:[],currentAssistantMessageId:null,currentToolId:null,isLoading:!1,abortController:null,executions:new Map,toolMessageIdsByUseId:new Map,queue:[],runStart:null,refining:!1,pendingRefinement:null,thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null,boundSessionId:null,addMessage:t=>{let r=`msg_${Date.now()}_${n().slice(0,8)}`,i={...t,id:r,timestamp:t.timestamp??Date.now()};return e(e=>{let n=O([...e.messages,i]),a=k(n),o=e.executions;if(o.size>0){let e=new Map,t=!1;for(let[n,r]of o)a.has(n)?e.set(n,r):t=!0;t&&(o=e)}let s={messages:n,currentAssistantMessageId:t.role===`assistant`?r:e.currentAssistantMessageId,toolMessageIdsByUseId:a};if(i.role===`tool`&&i.toolUseId){let e=new Map(a);e.set(i.toolUseId,r),s.toolMessageIdsByUseId=e}return o!==e.executions&&(s.executions=o),s}),r},setMessages:t=>{let n=O(t);e({messages:n,currentAssistantMessageId:null,currentToolId:null,executions:new Map,toolMessageIdsByUseId:k(n),thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null})},updateMessage:(t,n)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,...n}:e)}))},appendToMessage:(t,n)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,content:C(e.content+n)}:e)}))},finalizeMessage:(t,n)=>{let r=n?.final!==!1;e(e=>({messages:e.messages.map(e=>{if(e.id!==t)return e;if(e.role!==`assistant`)return{...e,content:m(e.content),streaming:!1};let n=c(e.content),i=r&&n.steps.length>0?{steps:n.steps}:void 0;return{...e,content:m(n.stripped),streaming:!1,...i?{nextSteps:i}:{}}})}))},setToolResult:(t,n,r)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,toolResult:C(n),isError:!r,progressLines:void 0}:e)}))},appendToolProgress:(e,n)=>{t().appendToolProgressLines(e,[n])},appendToolProgressLines:(t,n)=>{n.length!==0&&e(e=>({messages:e.messages.map(e=>{if(e.id!==t)return e;let r=e.progressLines??[];return r.push(...n),r.length>30&&r.splice(0,r.length-30),{...e,progressLines:r}})}))},getToolMessageId:e=>t().toolMessageIdsByUseId.get(e),setToolResultByUseId:(e,n,r)=>{let i=t().toolMessageIdsByUseId.get(e);i&&t().setToolResult(i,n,r)},appendToolProgressLinesByUseId:(e,n)=>{let r=t().toolMessageIdsByUseId.get(e);r&&t().appendToolProgressLines(r,n)},setLoading:t=>e({isLoading:t}),setAbortController:t=>e({abortController:t}),clearMessages:()=>e({messages:[],currentAssistantMessageId:null,currentToolId:null,executions:new Map,toolMessageIdsByUseId:new Map,thinkingBuffer:``,thinkingStartedAt:null,thinkingLogBuffer:``,thinkingLogStartedAt:null,boundSessionId:null}),setBoundSessionId:t=>e({boundSessionId:t}),setCurrentAssistantMessage:t=>e({currentAssistantMessageId:t}),setCurrentToolId:t=>e({currentToolId:t}),truncateAfter:t=>e(e=>{let n=e.messages.findIndex(e=>e.id===t);if(n===-1)return e;let r=e.messages.slice(0,n+1);return{messages:r,currentAssistantMessageId:null,currentToolId:null,toolMessageIdsByUseId:k(r)}}),addExecution:t=>{e(e=>{let n=new Map(e.executions);return n.set(t.id,t),{executions:n}})},updateExecution:(t,n)=>{e(e=>{let r=new Map(e.executions),i=r.get(t);return i&&r.set(t,{...i,...n}),{executions:r}})},setRefining:t=>e({refining:t}),setPendingRefinement:(t,n,r=`queue`)=>e({pendingRefinement:t===null?null:{text:t,images:n??[],mode:r}}),enqueue:(t,n=`queue`,r,i)=>{let a=Date.now(),o=++v;if(e(e=>({queue:[...e.queue,{text:t,mode:n,addedAt:a,itemId:o,...r?.length?{images:r}:{},...i?{alreadyDispatched:!0}:{}}]})),i){let e=setTimeout(()=>{g.delete(o);let e=null;A.setState(t=>{let n=t.queue.find(e=>e.itemId===o&&e.alreadyDispatched===!0);if(n&&n.bubbleAdded!==!0){let t=n.images??[];e={role:`user`,content:n.text,...t.length>0?{attachments:t.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}}}return{queue:t.queue.filter(e=>!(e.itemId===o&&e.alreadyDispatched===!0))}}),e&&A.getState().addMessage(e)},x);g.set(o,e)}},dequeue:()=>{let{queue:n}=t();if(n.length===0)return null;let[i,...a]=n;return i?.itemId!==void 0&&_(i.itemId),e({queue:a}),r(i)},dequeueDrainable:()=>{let t={popped:null,leadingBubbles:[]};e(e=>{let n=e.queue.findIndex(e=>e.alreadyDispatched!==!0);if(n===-1){for(let n of e.queue)if(n.alreadyDispatched===!0&&n.bubbleAdded!==!0){let e=n.images??[];t.leadingBubbles.push({role:`user`,content:n.text,...e.length>0?{attachments:e.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}})}return t.leadingBubbles.length===0?{}:{queue:e.queue.filter(e=>!(e.alreadyDispatched===!0&&e.bubbleAdded!==!0))}}for(let r=0;r<n;r+=1){let n=e.queue[r];if(n.bubbleAdded===!0)continue;let i=n.images??[];t.leadingBubbles.push({role:`user`,content:n.text,...i.length>0?{attachments:i.map(e=>({id:e.id,kind:`image`,dataUrl:e.dataUrl,mediaType:e.mediaType,bytes:e.bytes,name:e.name}))}:{}})}let r=e.queue[n],i=e.queue.map((e,t)=>t<n&&e.bubbleAdded!==!0&&e.alreadyDispatched===!0?{...e,bubbleAdded:!0}:e).slice(0,n).concat(e.queue.map((e,t)=>t<n&&e.bubbleAdded!==!0&&e.alreadyDispatched===!0?{...e,bubbleAdded:!0}:e).slice(n+1));return t.popped=r,{queue:i}});for(let e of t.leadingBubbles)A.getState().addMessage(e);let n=t.popped;return n?.itemId!==void 0&&_(n.itemId),n},removeQueued:t=>e(e=>{let n=e.queue[t];return n?.itemId!==void 0&&_(n.itemId),{queue:e.queue.filter((e,n)=>n!==t)}}),clearQueue:()=>{let t=Array.from(g.values());g.clear();for(let e of t)clearTimeout(e);e({queue:[]})},removeMessage:t=>e(e=>{let n=e.messages.filter(e=>e.id!==t);return{messages:n,toolMessageIdsByUseId:k(n)}}),updateLastUserMessage:t=>e(e=>{let n=e.messages;for(let e=n.length-1;e>=0;e--)if(n[e].role===`user`){let r={...n[e],content:t},i=[...n];return i[e]=r,{messages:i}}return e}),setRunStart:t=>e({runStart:t}),appendThinking:t=>e(e=>({thinkingBuffer:C(e.thinkingBuffer+t),thinkingStartedAt:e.thinkingStartedAt??Date.now(),thinkingLogBuffer:C(e.thinkingLogBuffer+t),thinkingLogStartedAt:e.thinkingLogStartedAt??Date.now()})),clearThinking:()=>e({thinkingBuffer:``,thinkingStartedAt:null}),flushThinkingLog:e=>{let{thinkingLogBuffer:n,thinkingLogStartedAt:r}=t(),i=n.trim();if(!i)return;let a=r??Date.now();t().addMessage({role:`system`,content:``,thinkingLog:{iteration:e,text:i,startedAt:a,durationMs:Math.max(0,Date.now()-a)}}),t().clearThinkingLog()},clearThinkingLog:()=>e({thinkingLogBuffer:``,thinkingLogStartedAt:null})}),{name:`wrongstack-chat`,version:3,partialize:e=>({messages:e.messages.slice(-200).map(e=>e.attachments?.some(e=>e.dataUrl)?{...e,attachments:e.attachments.map(e=>({...e,dataUrl:void 0}))}:e),queue:e.queue.filter(e=>e.alreadyDispatched!==!0).map(e=>e.images?{...e,images:void 0}:e),boundSessionId:e.boundSessionId,thinkingLogBuffer:e.thinkingLogBuffer}),migrate:(e,t)=>{if(t>3)return null;let n=e??{},r=Array.isArray(n.messages)?n.messages:[],i=Array.isArray(n.queue)?n.queue:[];t<3&&(i=i.filter(e=>typeof e==`object`&&!!e&&e.alreadyDispatched!==!0));let a=i.flatMap(e=>{let t=b(e);return t?[t]:[]});return{messages:O(r),queue:a,boundSessionId:typeof n.boundSessionId==`string`?n.boundSessionId:null,thinkingLogBuffer:typeof n.thinkingLogBuffer==`string`?n.thinkingLogBuffer:``}},onRehydrateStorage:()=>(e,t)=>{t||typeof window<`u`&&(window.__wrongstackChatRehydrated=!0)}}));export{r as a,p as i,i as n,c as r,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fa as e}from"./vendor-AeHpGMaG.js";var t=8e3,n=2500,r=30*6e4,i=200,a=500,o={read:`read`,read_file:`read`,write:`write`,write_file:`write`,edit:`edit`,patch:`edit`,apply_patch:`edit`,replace:`edit`,delete:`delete`,delete_file:`delete`,remove:`delete`,grep:`search`,glob:`search`,search:`search`,"codebase-search":`search`,"codebase-index":`index`,remember:`memory`,forget:`memory`,memory_search:`memory`,memory_update:`memory`,memory_delete:`memory`};function s(e,t=``){return e===`rename`?`edit`:e in{read:1,write:1,edit:1,delete:1,search:1}?e:o[t]}function c(e){let t=[];for(let n of[`path`,`file`,`filePath`,`target`]){let r=e[n];typeof r==`string`&&t.push(r)}let n=e.files;if(typeof n==`string`&&t.push(n),Array.isArray(n))for(let e of n)typeof e==`string`&&t.push(e);return[...new Set(t)]}function l(e,t){let n=typeof t.old_string==`string`?t.old_string.trim():``,r=typeof t.new_string==`string`?t.new_string.trim():``;if(n||r)return`${n.replace(/\s+/g,` `).slice(0,42)||`∅`} → ${r.replace(/\s+/g,` `).slice(0,42)||`∅`}`;if(typeof t.patch==`string`){let n=d(t);return`${e} +${n?.added??0} −${n?.removed??0}`}let i=typeof t.content==`string`?t.content:void 0;if(i!==void 0){let t=i.length===0?0:i.split(/\r?\n/).length;return`${e} ${t} line${t===1?``:`s`}`}for(let e of[`query`,`pattern`,`old_string`,`new_string`,`text`,`command`]){let n=t[e];if(typeof n==`string`&&n.trim()){let t=n.trim().replace(/\s+/g,` `).slice(0,96);return e===`query`?`"${t}"`:e===`pattern`?`/${t}/`:e===`command`?`$ ${t}`:t}}return e}function u(e){return e.trim().replace(/\s+/g,` `).slice(0,72)}function d(e){let t=typeof e.old_string==`string`?e.old_string:void 0,n=typeof e.new_string==`string`?e.new_string:void 0;if(t!==void 0||n!==void 0){let e=t?t.split(/\r?\n/).length:0;return{added:n?n.split(/\r?\n/).length:0,removed:e,...t?{before:u(t)}:{},...n?{after:u(n)}:{}}}let r=typeof e.patch==`string`?e.patch:void 0;if(r){let e=r.split(/\r?\n/),t=e.filter(e=>e.startsWith(`+`)&&!e.startsWith(`+++`)),n=e.filter(e=>e.startsWith(`-`)&&!e.startsWith(`---`));return{added:t.length,removed:n.length,...n[0]?{before:u(n[0].slice(1))}:{},...t[0]?{after:u(t[0].slice(1))}:{}}}let i=typeof e.content==`string`?e.content:void 0;if(i!==void 0)return{added:i.length===0?0:i.split(/\r?\n/).length,removed:0,...i?{after:u(i)}:{}}}function f(e){let t=e.status??`observed`;return{...e,id:e.id??`${e.toolUseId??`event`}:${e.filePath}:${e.timestamp}`,status:t,source:e.source??`legacy`,agentName:e.agentName??e.agent,agent:e.agent??e.agentName}}function p(e,t){let n=e.get(t.filePath)??[];if(e.set(t.filePath,[t,...n].slice(0,i)),e.size<=a)return;let r=[...e.entries()].sort((e,t)=>(e[1][0]?.timestamp??0)-(t[1][0]?.timestamp??0))[0]?.[0];r&&e.delete(r)}function m(e){return`${e.sessionId??`unscoped`}:${e.agentId??e.agentName??e.agent??`external`}`}function h(e){let t=new Map;for(let n of e){let e=n.agentId??`external`,r=n.agentName??n.agent??`External process`,i=n.sessionId??`unscoped`,a=m(n),o=t.get(a);o?(o.operations.push(n),o.startedAt=Math.min(o.startedAt,n.timestamp)):t.set(a,{key:a,agentId:e,agentName:r,sessionId:i,operations:[n],startedAt:n.timestamp})}return[...t.values()].sort((e,t)=>e.startedAt-t.startedAt)}function g(e,t,n){let r=String(e.name??`unknown`),i=e.input&&typeof e.input==`object`?e.input:{},a=Date.now(),o=String(e.id??`${r}:${a}`),c=d(i);return(t.length>0?t:[{filePath:`(tool:${r})`,operation:`execute`}]).map((u,d)=>({id:`${o}:${d}`,toolUseId:o,filePath:u.filePath,type:u.operation===`execute`?`execute`:s(u.operation,r)??`edit`,toolName:r,summary:l(r,i),timestamp:a,status:n,source:`tool`,attribution:t.length>0?`exact`:`correlated`,...c?{change:c}:{},sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,traceId:typeof e.traceId==`string`?e.traceId:void 0,agentId:typeof e.agentId==`string`?e.agentId:`leader`,agentName:typeof e.agentName==`string`?e.agentName:`LEADER`,...u.line?{line:u.line}:{},...u.endLine?{endLine:u.endLine}:{}}))}function _(e){let t=e.payload??{};if(e.type===`tool.started`||e.type===`tool.executed`||e.type===`codemap.tool_started`||e.type===`codemap.tool_executed`)return g(t,Array.isArray(t.fileTargets)?t.fileTargets:c(t.input&&typeof t.input==`object`?t.input:{}).map(e=>({filePath:e,operation:o[String(t.name??``)]??`edit`})),e.type===`tool.started`||e.type===`codemap.tool_started`?`active`:`completed`);if(e.type===`provider.response`){let e=t.blocks;if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type!==`tool_use`)continue;let r=String(e.name??``),i=o[r];if(!i)continue;let a=e.input&&typeof e.input==`object`?e.input:{},s=c(a),u=Date.now();s.length===0&&(i===`memory`||i===`search`||i===`index`)&&s.push(`(global)`);for(let e of s)n.push({filePath:e,type:i,toolName:r,summary:l(r,a),timestamp:u})}return n}if(e.type===`tool.progress`){let e=t.event&&typeof t.event==`object`?t.event:void 0;if(e?.type!==`file_changed`||typeof e.path!=`string`)return[];let n=String(e.operation??`edit`);return[{id:`${String(t.id??`progress`)}:${e.path}:${Date.now()}`,toolUseId:typeof t.id==`string`?t.id:void 0,filePath:e.path,type:s(n)??`edit`,toolName:String(t.name??`deterministic-tool`),summary:String(e.text??`tool reported file change`),timestamp:Date.now(),status:`active`,source:`deterministic`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,line:typeof e.line==`number`?e.line:void 0,endLine:typeof e.endLine==`number`?e.endLine:void 0,attribution:`exact`}]}if(e.type===`codemap.file_event`){let e=s(String(t.operation??`edit`))??`edit`;return typeof t.filePath==`string`?[{filePath:t.filePath,type:e,toolName:typeof t.toolName==`string`?t.toolName:String(t.source??`watcher`),summary:`${String(t.source??`external`)} ${String(t.operation??`changed`)}`,timestamp:typeof t.at==`number`?t.at:Date.now(),status:t.phase===`started`?`active`:`observed`,source:t.source??`external`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,toolUseId:typeof t.toolUseId==`string`?t.toolUseId:void 0,line:typeof t.line==`number`?t.line:void 0,endLine:typeof t.endLine==`number`?t.endLine:void 0}]:[]}return e.type===`file.saved`&&typeof t.filePath==`string`?[{filePath:t.filePath,type:`write`,toolName:`save`,summary:``,timestamp:Date.now(),source:`editor`}]:e.type===`memory.event`&&typeof t.event==`string`?[{filePath:`(memory)`,type:`memory`,toolName:`memory.${t.event}`,summary:String(t.memoryId??``),timestamp:Date.now()}]:[]}var v=e((e,i)=>({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0,recordActivity(n){let r=f(n);e(e=>{let n=new Map(e.history),i=new Map(e.pulses);return p(n,r),i.set(r.filePath,Date.now()+t),{history:n,pulses:i,totalCount:e.totalCount+1}})},startActivities(n){if(n.length===0)return;let r=n.map(e=>f({...e,status:`active`}));e(e=>{let n=new Map(e.history),i=new Map(e.pulses),a=new Map(e.activeOperations);for(let e of r)if(p(n,e),i.set(e.filePath,Date.now()+t),e.toolUseId){let t=a.get(e.toolUseId)??[];a.set(e.toolUseId,[...t,e])}return{history:n,pulses:i,activeOperations:a,totalCount:e.totalCount+r.length}})},finishTool(n,r){let i=r.timestamp??Date.now();e(e=>{let a=e.activeOperations.get(n)??[];if(a.length===0)return e;let o=new Map(e.history),s=new Map(e.pulses);for(let e of a){let a=o.get(e.filePath)??[];o.set(e.filePath,a.map(e=>e.toolUseId===n?{...e,status:r.ok?`completed`:`failed`,ok:r.ok,completedAt:i,durationMs:r.durationMs??i-e.timestamp}:e)),s.set(e.filePath,Date.now()+t)}let c=new Map(e.activeOperations);return c.delete(n),{history:o,pulses:s,activeOperations:c}})},recordFileEvent(r){let i=f({...r,attribution:r.attribution??(r.agentId?`exact`:`external`)});e(e=>{let r=(e.history.get(i.filePath)??[]).find(e=>e.source!==`watcher`&&e.source!==`external`&&Math.abs(i.timestamp-e.timestamp)<=n);if(r){let n=new Map(e.history);n.set(i.filePath,(n.get(i.filePath)??[]).map(e=>e.id===r.id?{...e,watcherConfirmed:e.watcherConfirmed||i.source===`watcher`||i.source===`editor`}:e));let a=new Map(e.pulses);return a.set(i.filePath,Date.now()+t),{history:n,pulses:a}}let a=i.toolUseId?e.activeOperations.get(i.toolUseId):void 0;if(a&&a.length>0){let n=a[0],r=f({...i,status:`active`,source:i.source??`deterministic`,sessionId:i.sessionId??n.sessionId,traceId:i.traceId??n.traceId,agentId:i.agentId??n.agentId,agentName:i.agentName??n.agentName,agent:i.agent??n.agent,attribution:`exact`}),o=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);return p(o,r),s.set(r.filePath,Date.now()+t),c.set(i.toolUseId,[...a,r]),{history:o,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let o=[...e.activeOperations.values()].flat().filter(e=>e.filePath.startsWith(`(tool:`)&&Math.abs(i.timestamp-e.timestamp)<=3e5);if(o.length===1){let n=o[0],r=f({...i,id:`${n.toolUseId}:${i.filePath}:${i.timestamp}`,toolUseId:n.toolUseId,toolName:n.toolName,summary:`${n.toolName} → filesystem ${i.type}`,status:`active`,source:`deterministic`,sessionId:n.sessionId,traceId:n.traceId,agentId:n.agentId,agentName:n.agentName,agent:n.agent,watcherConfirmed:!0,attribution:`correlated`}),a=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);if(p(a,r),s.set(r.filePath,Date.now()+t),r.toolUseId){let e=c.get(r.toolUseId)??[];c.set(r.toolUseId,[...e,r])}return{history:a,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let s=new Map(e.history),c=new Map(e.pulses);return p(s,i),c.set(i.filePath,Date.now()+t),{history:s,pulses:c,totalCount:e.totalCount+1}})},resolveActivitySymbol(t,n,r){e(e=>{let i=new Map(e.history);i.set(n,(i.get(n)??[]).map(e=>e.toolUseId===t?{...e,symbol:r}:e));let a=new Map(e.activeOperations),o=a.get(t);return o&&a.set(t,o.map(e=>e.filePath===n?{...e,symbol:r}:e)),{history:i,activeOperations:a}})},getActivityForFile(e){return i().history.get(e)??[]},getActiveForFile(e){return[...i().activeOperations.values()].flat().filter(t=>t.filePath===e)},getActiveOperations(){return[...i().activeOperations.values()].flat()},getAgentPresences(){return h(i().getActiveOperations())},getPulsingFiles(){return i()._sweep(),new Set(i().pulses.keys())},getPulseType(e){if(i()._sweep(),i().pulses.has(e))return i().history.get(e)?.[0]?.type},clear(){e({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0})},_sweep(){let t=Date.now(),n=[...i().pulses].filter(([,e])=>e<t).map(([e])=>e),a=[...i().activeOperations].filter(([,e])=>e.every(e=>t-e.timestamp>r)).map(([e])=>e);n.length===0&&a.length===0||e(e=>{let r=new Map(e.pulses);for(let e of n)r.delete(e);if(a.length===0)return{pulses:r};let i=new Map(e.history),o=new Map(e.activeOperations);for(let e of a){for(let n of o.get(e)??[])i.set(n.filePath,(i.get(n.filePath)??[]).map(n=>n.toolUseId===e?{...n,status:`failed`,ok:!1,completedAt:t,durationMs:t-n.timestamp,summary:`${n.summary||n.toolName} · telemetry timeout`}:n));o.delete(e)}return{pulses:r,history:i,activeOperations:o}})}}));export{v as i,_ as n,h as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fa as e}from"./vendor-AeHpGMaG.js";var t=e(e=>({generation:0,lastUpdatedAt:null,notifyIndexUpdated(t=Date.now()){e(e=>({generation:e.generation+1,lastUpdatedAt:t}))}}));export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`OK`,cancel:`Cancelar`,save:`Guardar`,saved:`Guardado`,close:`Cerrar`,yes:`Sí`,no:`No`,delete:`Eliminar`,remove:`Quitar`,add:`Añadir`,edit:`Editar`,rename:`Renombrar`,retry:`Reintentar`,reset:`Restablecer`,apply:`Aplicar`,confirm:`Confirmar`,back:`Atrás`,next:`Siguiente`,done:`Hecho`,refresh:`Actualizar`,copy:`Copiar`,copied:`Copiado`,copyFailed:`Error al copiar: acceso al portapapeles bloqueado.`,open:`Abrir`,start:`Iniciar`,stop:`Detener`,pause:`Pausar`,resume:`Reanudar`,continue:`Continuar`,clear:`Limpiar`,search:`Buscar`,loading:`Cargando…`,saving:`Guardando…`,searchPlaceholder:`Buscar…`,always:`Siempre`,deny:`Denegar`,undo:`Deshacer`,all:`Todos`},t={title:`Aprobación requerida: {{tool}}`,descriptionEdit:`El agente quiere modificar un archivo. Revisa la solicitud a continuación y decide si deseas continuar.`,descriptionTool:`El agente quiere ejecutar esta herramienta. Revisa la solicitud a continuación y decide si deseas continuar.`,fileModification:`Modificación de archivo`,toolExecution:`Ejecución de herramienta`,riskSuffix:`riesgo {{risk}}`,command:`Comando`,inputLabel:`Entrada:`,trustSuggestionTitle:`Sugerencia de patrón de confianza`,trustSuggestionHint:`Elegir Siempre añadirá a la lista de permitidas las llamadas coincidentes para este proyecto.`,yoloDestructiveNote:`YOLO está activado. Este aviso se sigue mostrando porque la solicitud se clasificó como destructiva.`,skipApprovalsTitle:`Omitir aprobaciones futuras`,skipApprovalsHint:`Activa el modo YOLO y el agente ejecuta sin preguntar. Las operaciones destructivas siguen solicitando confirmación.`,enableYoloTitle:`Activar modo YOLO (aprobar automáticamente esta y futuras llamadas no destructivas)`,enableYoloBtn:`Activar YOLO`,denyAlways:`Denegar siempre`,denyAlwaysTitle:`Rechazar esta y todas las futuras llamadas que coincidan con el patrón (d)`,noTitle:`Rechazar solo esta llamada (Esc / n)`,alwaysTitle:`Aprobar y recordar el patrón para el proyecto (a)`,yesTitle:`Aprobar solo esta llamada (y)`},n={connected:`Conectado`,disconnected:`Desconectado`,notConnectedRetry:`Sin conexión con el servidor: inténtalo de nuevo al reconectar.`,connecting:`Conectando…`,reconnecting:`Reconectando…`,ready:`Listo`,error:`Error`,offline:`Sin conexión`,online:`En línea`,live:`En vivo`,budgetWarning:`alerta de presupuesto`,running:`En ejecución`,inProgress:`En progreso`,working:`trabajando`},r={justNow:`justo ahora`,secondsAgo_one:`hace {{count}} segundo`,secondsAgo_other:`hace {{count}} segundos`,minutesAgo_one:`hace {{count}} minuto`,minutesAgo_other:`hace {{count}} minutos`,hoursAgo_one:`hace {{count}} hora`,hoursAgo_other:`hace {{count}} horas`,daysAgo_one:`hace {{count}} día`,daysAgo_other:`hace {{count}} días`,compactSecondsAgo:`hace {{count}} s`,compactMinutesAgo:`hace {{count}} min`,compactHoursAgo:`hace {{count}} h`},i={title:`Algo salió mal`,body:`Ocurrió un error de renderizado. Tu sesión sigue activa en el servidor — recargar continuará donde lo dejaste.`,reload:`Recargar página`,tryAgain:`Reintentar`,panelTitle:`{{name}} encontró un error`},a={noActivity:`Sin actividad`,noActivityYet:`Aún sin actividad`,activityMax:`Sparkline de actividad: máx {{count}} eventos`,activityPeak:`Sparkline de actividad — pico {{count}} eventos/intervalo`},o=`Cargando {{name}}…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`OK`,cancel:`Abbrechen`,save:`Speichern`,saved:`Gespeichert`,close:`Schließen`,yes:`Ja`,no:`Nein`,delete:`Löschen`,remove:`Entfernen`,add:`Hinzufügen`,edit:`Bearbeiten`,rename:`Umbenennen`,retry:`Erneut versuchen`,reset:`Zurücksetzen`,apply:`Anwenden`,confirm:`Bestätigen`,back:`Zurück`,next:`Weiter`,done:`Fertig`,refresh:`Aktualisieren`,copy:`Kopieren`,copied:`Kopiert`,copyFailed:`Kopieren fehlgeschlagen — Zugriff auf die Zwischenablage blockiert.`,open:`Öffnen`,start:`Starten`,stop:`Stopp`,pause:`Pausieren`,resume:`Fortsetzen`,continue:`Weiter`,clear:`Leeren`,search:`Suchen`,loading:`Lädt…`,saving:`Wird gespeichert…`,searchPlaceholder:`Suchen…`,always:`Immer`,deny:`Ablehnen`,undo:`Rückgängig`,all:`Alle`},t={title:`Freigabe erforderlich: {{tool}}`,descriptionEdit:`Der Agent möchte eine Datei ändern. Überprüfe die Anfrage unten und entscheide, ob du fortfahren möchtest.`,descriptionTool:`Der Agent möchte dieses Tool ausführen. Überprüfe die Anfrage unten und entscheide, ob du fortfahren möchtest.`,fileModification:`Dateiänderung`,toolExecution:`Tool-Ausführung`,riskSuffix:`{{risk}} Risiko`,command:`Befehl`,inputLabel:`Eingabe:`,trustSuggestionTitle:`Vorschlag für Vertrauensmuster`,trustSuggestionHint:`Wenn du Immer wählst, werden übereinstimmende Aufrufe für dieses Projekt auf die Whitelist gesetzt.`,yoloDestructiveNote:`YOLO ist aktiv. Diese Abfrage wird trotzdem angezeigt, da die Anfrage als destruktiv eingestuft wurde.`,skipApprovalsTitle:`Zukünftige Freigaben überspringen`,skipApprovalsHint:`Aktiviere den YOLO-Modus und der Agent läuft ohne Nachfrage. Destruktive Vorgänge fragen weiterhin nach.`,enableYoloTitle:`YOLO-Modus aktivieren (diesen und zukünftige nicht-destruktive Aufrufe automatisch freigeben)`,enableYoloBtn:`YOLO aktivieren`,denyAlways:`Immer ablehnen`,denyAlwaysTitle:`Diesen und alle zukünftigen, zum Muster passenden Aufrufe ablehnen (d)`,noTitle:`Diesen einzelnen Aufruf ablehnen (Esc / n)`,alwaysTitle:`Freigeben und das Muster für das Projekt speichern (a)`,yesTitle:`Diesen einzelnen Aufruf freigeben (y)`},n={connected:`Verbunden`,disconnected:`Getrennt`,notConnectedRetry:`Keine Verbindung zum Server — nach dem Wiederverbinden erneut versuchen.`,connecting:`Verbindung wird hergestellt…`,reconnecting:`Verbindung wird wiederhergestellt…`,ready:`Bereit`,error:`Fehler`,offline:`Offline`,online:`Online`,live:`Live`,budgetWarning:`Budget-Warnung`,running:`Läuft`,inProgress:`In Arbeit`,working:`arbeitet`},r={justNow:`gerade eben`,secondsAgo_one:`vor {{count}} Sekunde`,secondsAgo_other:`vor {{count}} Sekunden`,minutesAgo_one:`vor {{count}} Minute`,minutesAgo_other:`vor {{count}} Minuten`,hoursAgo_one:`vor {{count}} Stunde`,hoursAgo_other:`vor {{count}} Stunden`,daysAgo_one:`vor {{count}} Tag`,daysAgo_other:`vor {{count}} Tagen`,compactSecondsAgo:`vor {{count}} s`,compactMinutesAgo:`vor {{count}} min`,compactHoursAgo:`vor {{count}} Std.`},i={title:`Etwas ist schiefgelaufen`,body:`Ein Render-Fehler ist aufgetreten. Deine Sitzung ist auf dem Server noch aktiv — Neuladen setzt dort fort, wo du aufgehört hast.`,reload:`Seite neu laden`,tryAgain:`Erneut versuchen`,panelTitle:`{{name}} ist auf einen Fehler gestoßen`},a={noActivity:`Keine Aktivität`,noActivityYet:`Noch keine Aktivität`,activityMax:`Aktivitäts-Sparkline: max. {{count}} Ereignisse`,activityPeak:`Aktivitäts-Sparkline — Spitze {{count}} Ereignisse/Intervall`},o=`{{name}} wird geladen…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";var t=e({action:()=>n,confirm:()=>r,default:()=>l,error:()=>o,loadingNamed:()=>c,sparkline:()=>s,status:()=>i,time:()=>a}),n={ok:`OK`,cancel:`Cancel`,save:`Save`,saved:`Saved`,close:`Close`,yes:`Yes`,no:`No`,delete:`Delete`,remove:`Remove`,add:`Add`,edit:`Edit`,rename:`Rename`,retry:`Retry`,reset:`Reset`,apply:`Apply`,confirm:`Confirm`,back:`Back`,next:`Next`,done:`Done`,refresh:`Refresh`,copy:`Copy`,copied:`Copied`,copyFailed:`Copy failed — clipboard access was blocked.`,open:`Open`,start:`Start`,stop:`Stop`,pause:`Pause`,resume:`Resume`,continue:`Continue`,clear:`Clear`,search:`Search`,loading:`Loading…`,saving:`Saving…`,searchPlaceholder:`Search…`,always:`Always`,deny:`Deny`,undo:`Undo`,all:`All`},r={title:`Approval required: {{tool}}`,descriptionEdit:`The agent wants to modify a file. Review the request below and decide whether to proceed.`,descriptionTool:`The agent wants to run this tool. Review the request below and decide whether to proceed.`,fileModification:`File modification`,toolExecution:`Tool execution`,riskSuffix:`{{risk}} risk`,command:`Command`,inputLabel:`Input:`,trustSuggestionTitle:`Trust pattern suggestion`,trustSuggestionHint:`Picking Always will whitelist matching calls for this project.`,yoloDestructiveNote:`YOLO is on. This prompt is still shown because the request was classified as destructive.`,skipApprovalsTitle:`Skip future approvals`,skipApprovalsHint:`Enable YOLO mode and the agent runs without asking. Destructive operations still ask for confirmation.`,enableYoloTitle:`Enable YOLO mode (auto-approve this and future non-destructive calls)`,enableYoloBtn:`Enable YOLO`,denyAlways:`Deny always`,denyAlwaysTitle:`Reject this and all future calls matching the pattern (d)`,noTitle:`Reject this single call (Esc / n)`,alwaysTitle:`Approve and remember the pattern for the project (a)`,yesTitle:`Approve this single call (y)`},i={connected:`Connected`,disconnected:`Disconnected`,notConnectedRetry:`Not connected to the server — try again once reconnected.`,connecting:`Connecting…`,reconnecting:`Reconnecting…`,ready:`Ready`,error:`Error`,offline:`Offline`,online:`Online`,live:`Live`,budgetWarning:`budget warning`,running:`Running`,inProgress:`In Progress`,working:`working`},a={justNow:`just now`,secondsAgo_one:`{{count}} second ago`,secondsAgo_other:`{{count}} seconds ago`,minutesAgo_one:`{{count}} minute ago`,minutesAgo_other:`{{count}} minutes ago`,hoursAgo_one:`{{count}} hour ago`,hoursAgo_other:`{{count}} hours ago`,daysAgo_one:`{{count}} day ago`,daysAgo_other:`{{count}} days ago`,compactSecondsAgo:`{{count}}s ago`,compactMinutesAgo:`{{count}}m ago`,compactHoursAgo:`{{count}}h ago`},o={title:`Something went wrong`,body:`A rendering error occurred. Your session is still active on the server — reloading will pick up where you left off.`,reload:`Reload page`,tryAgain:`Try again`,panelTitle:`{{name}} hit an error`},s={noActivity:`No activity`,noActivityYet:`No activity yet`,activityMax:`Activity sparkline: max {{count}} events`,activityPeak:`Activity sparkline — peak {{count}} events/bucket`},c=`Loading {{name}}…`,l={action:n,confirm:r,status:i,time:a,error:o,sparkline:s,loadingNamed:c};export{t as n,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`OK`,cancel:`Annuler`,save:`Enregistrer`,saved:`Enregistré`,close:`Fermer`,yes:`Oui`,no:`Non`,delete:`Supprimer`,remove:`Retirer`,add:`Ajouter`,edit:`Modifier`,rename:`Renommer`,retry:`Réessayer`,reset:`Réinitialiser`,apply:`Appliquer`,confirm:`Confirmer`,back:`Retour`,next:`Suivant`,done:`Terminé`,refresh:`Actualiser`,copy:`Copier`,copied:`Copié`,copyFailed:`Échec de la copie — accès au presse-papiers bloqué.`,open:`Ouvrir`,start:`Démarrer`,stop:`Arrêter`,pause:`Pause`,resume:`Reprendre`,continue:`Continuer`,clear:`Effacer`,search:`Rechercher`,loading:`Chargement…`,saving:`Enregistrement…`,searchPlaceholder:`Rechercher…`,always:`Toujours`,deny:`Refuser`,undo:`Annuler`,all:`Tous`},t={title:`Approbation requise : {{tool}}`,descriptionEdit:`L'agent souhaite modifier un fichier. Examinez la demande ci-dessous et décidez s'il faut poursuivre.`,descriptionTool:`L'agent souhaite exécuter cet outil. Examinez la demande ci-dessous et décidez s'il faut poursuivre.`,fileModification:`Modification de fichier`,toolExecution:`Exécution d'outil`,riskSuffix:`Risque {{risk}}`,command:`Commande`,inputLabel:`Entrée :`,trustSuggestionTitle:`Suggestion de motif de confiance`,trustSuggestionHint:`Choisir Toujours ajoutera les appels correspondants à la liste blanche pour ce projet.`,yoloDestructiveNote:`YOLO est activé. Cette confirmation s'affiche encore car la requête a été classée comme destructrice.`,skipApprovalsTitle:`Ignorer les futures approbations`,skipApprovalsHint:`Activez le mode YOLO et l'agent agit sans demander. Les opérations destructrices continuent de demander confirmation.`,enableYoloTitle:`Activer le mode YOLO (auto-approuver cet appel et les futurs appels non destructeurs)`,enableYoloBtn:`Activer YOLO`,denyAlways:`Toujours refuser`,denyAlwaysTitle:`Refuser cet appel et tous les futurs appels correspondant au motif (d)`,noTitle:`Refuser cet appel unique (Échap / n)`,alwaysTitle:`Approuver et mémoriser le motif pour le projet (a)`,yesTitle:`Approuver cet appel unique (y)`},n={connected:`Connecté`,disconnected:`Déconnecté`,notConnectedRetry:`Non connecté au serveur — réessayez après la reconnexion.`,connecting:`Connexion…`,reconnecting:`Reconnexion…`,ready:`Prêt`,error:`Erreur`,offline:`Hors ligne`,online:`En ligne`,live:`En direct`,budgetWarning:`alerte budget`,running:`En cours`,inProgress:`En cours`,working:`travaille`},r={justNow:`à l'instant`,secondsAgo_one:`il y a {{count}} seconde`,secondsAgo_other:`il y a {{count}} secondes`,minutesAgo_one:`il y a {{count}} minute`,minutesAgo_other:`il y a {{count}} minutes`,hoursAgo_one:`il y a {{count}} heure`,hoursAgo_other:`il y a {{count}} heures`,daysAgo_one:`il y a {{count}} jour`,daysAgo_other:`il y a {{count}} jours`,compactSecondsAgo:`il y a {{count}} s`,compactMinutesAgo:`il y a {{count}} min`,compactHoursAgo:`il y a {{count}} h`},i={title:`Une erreur est survenue`,body:`Une erreur de rendu s'est produite. Votre session est toujours active sur le serveur — recharger reprendra là où vous étiez.`,reload:`Recharger la page`,tryAgain:`Réessayer`,panelTitle:`{{name}} a rencontré une erreur`},a={noActivity:`Aucune activité`,noActivityYet:`Pas encore d'activité`,activityMax:`Sparkline d'activité : max {{count}} événements`,activityPeak:`Sparkline d'activité — pic {{count}} événements/intervalle`},o=`Chargement de {{name}}…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`OK`,cancel:`Annulla`,save:`Salva`,saved:`Salvato`,close:`Chiudi`,yes:`Sì`,no:`No`,delete:`Elimina`,remove:`Rimuovi`,add:`Aggiungi`,edit:`Modifica`,rename:`Rinomina`,retry:`Riprova`,reset:`Ripristina`,apply:`Applica`,confirm:`Conferma`,back:`Indietro`,next:`Avanti`,done:`Fatto`,refresh:`Aggiorna`,copy:`Copia`,copied:`Copiato`,copyFailed:`Copia non riuscita — accesso agli appunti bloccato.`,open:`Apri`,start:`Avvia`,stop:`Ferma`,pause:`Sospendi`,resume:`Riprendi`,continue:`Continua`,clear:`Cancella`,search:`Cerca`,loading:`Caricamento…`,saving:`Salvataggio…`,searchPlaceholder:`Cerca…`,always:`Sempre`,deny:`Nega`,undo:`Annulla`,all:`Tutti`},t={title:`Approvazione richiesta: {{tool}}`,descriptionEdit:`L'agente vuole modificare un file. Rivedi la richiesta qui sotto e decidi se procedere.`,descriptionTool:`L'agente vuole eseguire questo strumento. Rivedi la richiesta qui sotto e decidi se procedere.`,fileModification:`Modifica file`,toolExecution:`Esecuzione strumento`,riskSuffix:`Rischio {{risk}}`,command:`Comando`,inputLabel:`Input:`,trustSuggestionTitle:`Suggerimento pattern attendibile`,trustSuggestionHint:`Scegliendo Sempre le chiamate corrispondenti verranno aggiunte all'allowlist per questo progetto.`,yoloDestructiveNote:`YOLO è attivo. Questo prompt viene comunque mostrato perché la richiesta è stata classificata come distruttiva.`,skipApprovalsTitle:`Salta le approvazioni future`,skipApprovalsHint:`Abilita la modalità YOLO e l'agente procede senza chiedere. Le operazioni distruttive richiedono comunque conferma.`,enableYoloTitle:`Abilita la modalità YOLO (approva automaticamente questa e le future chiamate non distruttive)`,enableYoloBtn:`Abilita YOLO`,denyAlways:`Nega sempre`,denyAlwaysTitle:`Rifiuta questa e tutte le future chiamate corrispondenti al pattern (d)`,noTitle:`Rifiuta questa singola chiamata (Esc / n)`,alwaysTitle:`Approva e ricorda il pattern per il progetto (a)`,yesTitle:`Approva questa singola chiamata (y)`},n={connected:`Connesso`,disconnected:`Disconnesso`,notConnectedRetry:`Non connesso al server — riprova dopo la riconnessione.`,connecting:`Connessione…`,reconnecting:`Riconnessione…`,ready:`Pronto`,error:`Errore`,offline:`Offline`,online:`Online`,live:`Live`,budgetWarning:`avviso budget`,running:`In corso`,inProgress:`In corso`,working:`lavora`},r={justNow:`adesso`,secondsAgo_one:`{{count}} secondo fa`,secondsAgo_other:`{{count}} secondi fa`,minutesAgo_one:`{{count}} minuto fa`,minutesAgo_other:`{{count}} minuti fa`,hoursAgo_one:`{{count}} ora fa`,hoursAgo_other:`{{count}} ore fa`,daysAgo_one:`{{count}} giorno fa`,daysAgo_other:`{{count}} giorni fa`,compactSecondsAgo:`{{count}} s fa`,compactMinutesAgo:`{{count}} min fa`,compactHoursAgo:`{{count}} h fa`},i={title:`Qualcosa è andato storto`,body:`Si è verificato un errore di rendering. La tua sessione è ancora attiva sul server — ricaricare riprenderà da dove eri rimasto.`,reload:`Ricarica pagina`,tryAgain:`Riprova`,panelTitle:`{{name}} ha riscontrato un errore`},a={noActivity:`Nessuna attività`,noActivityYet:`Nessuna attività ancora`,activityMax:`Sparkline attività: max {{count}} eventi`,activityPeak:`Sparkline attività — picco {{count}} eventi/intervallo`},o=`Caricamento di {{name}}…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`OK`,cancel:`Cancelar`,save:`Salvar`,saved:`Salvo`,close:`Fechar`,yes:`Sim`,no:`Não`,delete:`Excluir`,remove:`Remover`,add:`Adicionar`,edit:`Editar`,rename:`Renomear`,retry:`Tentar novamente`,reset:`Redefinir`,apply:`Aplicar`,confirm:`Confirmar`,back:`Voltar`,next:`Avançar`,done:`Concluído`,refresh:`Atualizar`,copy:`Copiar`,copied:`Copiado`,copyFailed:`Falha ao copiar — acesso à área de transferência bloqueado.`,open:`Abrir`,start:`Iniciar`,stop:`Parar`,pause:`Pausar`,resume:`Retomar`,continue:`Continuar`,clear:`Limpar`,search:`Buscar`,loading:`Carregando…`,saving:`Salvando…`,searchPlaceholder:`Buscar…`,always:`Sempre`,deny:`Negar`,undo:`Desfazer`,all:`Todos`},t={title:`Aprovação necessária: {{tool}}`,descriptionEdit:`O agente deseja modificar um arquivo. Revise a solicitação abaixo e decida se deseja prosseguir.`,descriptionTool:`O agente deseja executar esta ferramenta. Revise a solicitação abaixo e decida se deseja prosseguir.`,fileModification:`Modificação de arquivo`,toolExecution:`Execução de ferramenta`,riskSuffix:`risco {{risk}}`,command:`Comando`,inputLabel:`Entrada:`,trustSuggestionTitle:`Sugestão de padrão de confiança`,trustSuggestionHint:`Escolher Sempre vai permitir chamadas correspondentes para este projeto.`,yoloDestructiveNote:`YOLO está ativado. Esta confirmação ainda é exibida porque a solicitação foi classificada como destrutiva.`,skipApprovalsTitle:`Pular aprovações futuras`,skipApprovalsHint:`Ative o modo YOLO e o agente executará sem perguntar. Operações destrutivas ainda exigem confirmação.`,enableYoloTitle:`Ativar modo YOLO (aprovar automaticamente esta e futuras chamadas não destrutivas)`,enableYoloBtn:`Ativar YOLO`,denyAlways:`Negar sempre`,denyAlwaysTitle:`Rejeitar esta e todas as futuras chamadas correspondentes ao padrão (d)`,noTitle:`Rejeitar esta única chamada (Esc / n)`,alwaysTitle:`Aprovar e lembrar o padrão para o projeto (a)`,yesTitle:`Aprovar esta única chamada (y)`},n={connected:`Conectado`,disconnected:`Desconectado`,notConnectedRetry:`Sem conexão com o servidor — tente novamente após reconectar.`,connecting:`Conectando…`,reconnecting:`Reconectando…`,ready:`Pronto`,error:`Erro`,offline:`Offline`,online:`Online`,live:`Ao vivo`,budgetWarning:`alerta de orçamento`,running:`Em execução`,inProgress:`Em progresso`,working:`trabalhando`},r={justNow:`agora mesmo`,secondsAgo_one:`há {{count}} segundo`,secondsAgo_other:`há {{count}} segundos`,minutesAgo_one:`há {{count}} minuto`,minutesAgo_other:`há {{count}} minutos`,hoursAgo_one:`há {{count}} hora`,hoursAgo_other:`há {{count}} horas`,daysAgo_one:`há {{count}} dia`,daysAgo_other:`há {{count}} dias`,compactSecondsAgo:`há {{count}} s`,compactMinutesAgo:`há {{count}} min`,compactHoursAgo:`há {{count}} h`},i={title:`Algo deu errado`,body:`Ocorreu um erro de renderização. Sua sessão ainda está ativa no servidor — recarregar continuará de onde você parou.`,reload:`Recarregar página`,tryAgain:`Tentar novamente`,panelTitle:`{{name}} encontrou um erro`},a={noActivity:`Sem atividade`,noActivityYet:`Sem atividade ainda`,activityMax:`Sparkline de atividade: máx {{count}} eventos`,activityPeak:`Sparkline de atividade — pico {{count}} eventos/intervalo`},o=`Carregando {{name}}…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={ok:`Tamam`,cancel:`İptal`,save:`Kaydet`,saved:`Kaydedildi`,close:`Kapat`,yes:`Evet`,no:`Hayır`,delete:`Sil`,remove:`Kaldır`,add:`Ekle`,edit:`Düzenle`,rename:`Yeniden adlandır`,retry:`Yeniden dene`,reset:`Sıfırla`,apply:`Uygula`,confirm:`Onayla`,back:`Geri`,next:`İleri`,done:`Bitti`,refresh:`Yenile`,copy:`Kopyala`,copied:`Kopyalandı`,copyFailed:`Kopyalanamadı — pano erişimi engellendi.`,open:`Aç`,start:`Başlat`,stop:`Durdur`,pause:`Duraklat`,resume:`Sürdür`,continue:`Devam et`,clear:`Temizle`,search:`Ara`,loading:`Yükleniyor…`,saving:`Kaydediliyor…`,searchPlaceholder:`Ara…`,always:`Her zaman`,deny:`Reddet`,undo:`Geri al`,all:`Tümü`},t={title:`Onay gerekli: {{tool}}`,descriptionEdit:`Vekil bir dosyayı değiştirmek istiyor. Aşağıdaki isteği inceleyin ve devam edip etmeyeceğinize karar verin.`,descriptionTool:`Vekil bu aracı çalıştırmak istiyor. Aşağıdaki isteği inceleyin ve devam edip etmeyeceğinize karar verin.`,fileModification:`Dosya değişikliği`,toolExecution:`Araç çalıştırma`,riskSuffix:`{{risk}} risk`,command:`Komut`,inputLabel:`Girdi:`,trustSuggestionTitle:`Güven kalıbı önerisi`,trustSuggestionHint:`Her Zaman'ı seçmek, bu proje için eşleşen çağrıları beyaz listeye alır.`,yoloDestructiveNote:`YOLO açık. Bu onay yine de gösteriliyor çünkü istek yıkıcı olarak sınıflandırıldı.`,skipApprovalsTitle:`Sonraki onayları atla`,skipApprovalsHint:`YOLO modunu etkinleştir; vekil izin istemeden çalışır. Yıkıcı işlemler yine de onay ister.`,enableYoloTitle:`YOLO modunu etkinleştir (bu ve gelecekteki yıkıcı olmayan çağrıları otomatik onayla)`,enableYoloBtn:`YOLO'yu etkinleştir`,denyAlways:`Her zaman reddet`,denyAlwaysTitle:`Bu ve kalıpla eşleşen tüm gelecek çağrıları reddet (d)`,noTitle:`Bu tek çağrıyı reddet (Esc / n)`,alwaysTitle:`Onayla ve kalıbı proje için hatırla (a)`,yesTitle:`Bu tek çağrıyı onayla (y)`},n={connected:`Bağlı`,disconnected:`Bağlı değil`,notConnectedRetry:`Sunucuya bağlı değil — bağlantı kurulunca tekrar deneyin.`,connecting:`Bağlanıyor…`,reconnecting:`Yeniden bağlanıyor…`,ready:`Hazır`,error:`Hata`,offline:`Çevrimdışı`,online:`Çevrimiçi`,live:`Canlı`,budgetWarning:`bütçe uyarısı`,running:`Çalışıyor`,inProgress:`Devam ediyor`,working:`çalışıyor`},r={justNow:`az önce`,secondsAgo_one:`{{count}} saniye önce`,secondsAgo_other:`{{count}} saniye önce`,minutesAgo_one:`{{count}} dakika önce`,minutesAgo_other:`{{count}} dakika önce`,hoursAgo_one:`{{count}} saat önce`,hoursAgo_other:`{{count}} saat önce`,daysAgo_one:`{{count}} gün önce`,daysAgo_other:`{{count}} gün önce`,compactSecondsAgo:`{{count}} sn önce`,compactMinutesAgo:`{{count}} dk önce`,compactHoursAgo:`{{count}} sa önce`},i={title:`Bir şeyler ters gitti`,body:`Bir oluşturma hatası oluştu. Oturumunuz sunucuda hâlâ etkin — yeniden yüklemek kaldığınız yerden devam eder.`,reload:`Sayfayı yeniden yükle`,tryAgain:`Tekrar dene`,panelTitle:`{{name}} bir hatayla karşılaştı`},a={noActivity:`Etkinlik yok`,noActivityYet:`Henüz etkinlik yok`,activityMax:`Etkinlik sparkline: en fazla {{count}} olay`,activityPeak:`Etkinlik sparkline — tepe {{count}} olay/kova`},o=`{{name}} yükleniyor…`,s={action:e,confirm:t,status:n,time:r,error:i,sparkline:a,loadingNamed:o};export{e as action,t as confirm,s as default,i as error,o as loadingNamed,a as sparkline,n as status,r as time};
|